def use_or_create_async_context(context, name=None, loop=None, **kwargs):
 if (name is None):
  name = AsyncContext.default_name
 async_context = getattr(context, name, None)
 if (async_context is None):
  async_context = AsyncContext(loop=loop, name=name, **kwargs)
  setattr(context, async_context.name, async_context)
 assert isinstance(async_context, AsyncContext)
 assert (getattr(context, async_context.name) is async_context)
 return async_context

def use_or_create_async_context ( context , name = None , loop = None , ** kwargs ) : if ( name is None ) : name = AsyncContext . default_name async_context = getattr ( context , name , None ) if ( async_context is None ) : async_context = AsyncContext ( loop = loop , name = name , ** kwargs ) setattr ( context , async_context . name , async_context ) assert isinstance ( async_context , AsyncContext ) assert ( getattr ( context , async_context . name ) is async_context ) return async_context
utility function to be used in step implementations to ensure that an :class:asynccontext object is stored in the .