def Mapit_mutate(): a = Map({"key_one": ("val_one", )}) b = a.set("key_one", ("sweets", "great")) with a.mutate() as mm: mm['key_one'] = ("sweets", "great") b = mm.finish() return b
async def run_one(partial: Type[Partial[T]], state: immutables.Map) -> immutables.Map: runnable = tuple(partial.runnable_dependencies(state)) while runnable: tasks = (dependency.run(state) for dependency in runnable) logger.debug(f"Running tasks: {[n.__name__ for n in runnable]}") results = await asyncio.gather(*tasks) mutation = state.mutate() for dependency, result in zip(runnable, results): mutation.set(dependency, result) state = mutation.finish() runnable = tuple(partial.runnable_dependencies(state)) if partial not in state: raise RuntimeError("Failed ") return state