'Initializes the context of this flow.'

def InitializeContext(self, args):

    if (args is None):
        args = rdf_flows.FlowRunnerArgs()
    output_plugins_states = []
    for plugin_descriptor in args.output_plugins:
        if (not args.client_id):
            self.Log('Not    initializing    output    plugin    %s    as    flow    does    not    run    on    the    client.', plugin_descriptor.plugin_name)
            continue
        output_base_urn = self.session_id.Add(OUTPUT_PLUGIN_BASE_SUFFIX)
        plugin_class = plugin_descriptor.GetPluginClass()
        plugin = plugin_class(self.flow_obj.output_urn, args=plugin_descriptor.plugin_args, output_base_urn=output_base_urn, token=self.token)
        try:
            plugin.InitializeState()
            plugin.state['logs'] = []
            plugin.state['errors'] = []
            output_plugins_states.append(rdf_flows.OutputPluginState(plugin_state=plugin.state, plugin_descriptor=plugin_descriptor))
        except Exception as e:
            logging.info('Plugin    %s    failed    to    initialize    (%s),    ignoring    it.', plugin, e)
    parent_creator = None
    if self.parent_runner:
        parent_creator = self.parent_runner.context.creator
    context = rdf_flows.FlowContext(create_time=rdfvalue.RDFDatetime.Now(), creator=(parent_creator or self.token.username), current_state='Start', output_plugins_states=output_plugins_states, state=rdf_flows.FlowContext.State.RUNNING, user_notified=False)
    return context
