def choose_process(args: argparse.Namespace, tool: Process, loadingContext: LoadingContext) -> Optional[Process]:
    'Walk the given Workflow and extract just args.single_process.'
    if (loadingContext.loader is None):
        raise Exception('loadingContext.loader cannot be None')
    if isinstance(tool, Workflow):
        url = urllib.parse.urlparse(tool.tool['id'])
        if url.fragment:
            step_id = ((tool.tool['id'] + '/') + args.single_process)
        else:
            step_id = loadingContext.loader.fetcher.urljoin(tool.tool['id'], ('#' + args.single_process))
        (extracted, workflow_step) = get_process(tool, step_id, loadingContext)
    else:
        _logger.error('Can only use --single-process on Workflows')
        return None
    if isinstance(loadingContext.loader.idx, MutableMapping):
        loadingContext.loader.idx[extracted['id']] = extracted
        new_tool = make_tool(extracted['id'], loadingContext)
    else:
        raise Exception('Missing loadingContext.loader.idx!')
    inherit_reqshints(new_tool, workflow_step)
    return new_tool
Walk the given Workflow and extract just args.single_process.
def choose_process(args: argparse.Namespace, tool: Process, loadingContext: LoadingContext) -> Optional[Process]:
    
    if (loadingContext.loader is None):
        raise Exception('loadingContext.loader cannot be None')
    if isinstance(tool, Workflow):
        url = urllib.parse.urlparse(tool.tool['id'])
        if url.fragment:
            step_id = ((tool.tool['id'] + '/') + args.single_process)
        else:
            step_id = loadingContext.loader.fetcher.urljoin(tool.tool['id'], ('#' + args.single_process))
        (extracted, workflow_step) = get_process(tool, step_id, loadingContext)
    else:
        _logger.error('Can only use --single-process on Workflows')
        return None
    if isinstance(loadingContext.loader.idx, MutableMapping):
        loadingContext.loader.idx[extracted['id']] = extracted
        new_tool = make_tool(extracted['id'], loadingContext)
    else:
        raise Exception('Missing loadingContext.loader.idx!')
    inherit_reqshints(new_tool, workflow_step)
    return new_tool