def conditional_create(client, reactor, condition, *args, **kwargs):
 context = _LOG_CONDITIONAL_CREATE()
 def create():
  d = client.list_datasets_configuration()
  def got_config(config):
   condition(config)
   return deferLater(reactor, 0.001, context.run, client.create_dataset, configuration_tag=config.tag, *args, **kwargs)
  d.addCallback(got_config)
  return d
 with context.context():
  result = DeferredContext(retry_failure(reactor, create, [ConfigurationChanged], ([0.001] * 19)))
  result.addActionFinish()
  return result.result

def conditional_create ( client , reactor , condition , * args , ** kwargs ) : context = _LOG_CONDITIONAL_CREATE ( ) def create ( ) : d = client . list_datasets_configuration ( ) def got_config ( config ) : condition ( config ) return deferLater ( reactor , 0.001 , context . run , client . create_dataset , configuration_tag = config . tag , * args , ** kwargs ) d . addCallback ( got_config ) return d with context . context ( ) : result = DeferredContext ( retry_failure ( reactor , create , [ ConfigurationChanged ] , ( [ 0.001 ] * 19 ) ) ) result . addActionFinish ( ) return result . result
create a dataset only if a certain condition is true for the configuration .