def setup_loadingContext(loadingContext: Optional[LoadingContext], runtimeContext: RuntimeContext, args: argparse.Namespace) -> LoadingContext:
    'Prepare a LoadingContext from the given arguments.'
    if (loadingContext is None):
        loadingContext = LoadingContext(vars(args))
        loadingContext.singularity = runtimeContext.singularity
        loadingContext.podman = runtimeContext.podman
    else:
        loadingContext = loadingContext.copy()
    loadingContext.loader = default_loader(loadingContext.fetcher_constructor, enable_dev=args.enable_dev, doc_cache=args.doc_cache)
    loadingContext.research_obj = runtimeContext.research_obj
    loadingContext.disable_js_validation = (args.disable_js_validation or (not args.do_validate))
    loadingContext.construct_tool_object = getdefault(loadingContext.construct_tool_object, workflow.default_make_tool)
    loadingContext.resolver = getdefault(loadingContext.resolver, tool_resolver)
    if (loadingContext.do_update is None):
        loadingContext.do_update = (not (args.pack or args.print_subgraph))
    return loadingContext
Prepare a LoadingContext from the given arguments.
def setup_loadingContext(loadingContext: Optional[LoadingContext], runtimeContext: RuntimeContext, args: argparse.Namespace) -> LoadingContext:
    
    if (loadingContext is None):
        loadingContext = LoadingContext(vars(args))
        loadingContext.singularity = runtimeContext.singularity
        loadingContext.podman = runtimeContext.podman
    else:
        loadingContext = loadingContext.copy()
    loadingContext.loader = default_loader(loadingContext.fetcher_constructor, enable_dev=args.enable_dev, doc_cache=args.doc_cache)
    loadingContext.research_obj = runtimeContext.research_obj
    loadingContext.disable_js_validation = (args.disable_js_validation or (not args.do_validate))
    loadingContext.construct_tool_object = getdefault(loadingContext.construct_tool_object, workflow.default_make_tool)
    loadingContext.resolver = getdefault(loadingContext.resolver, tool_resolver)
    if (loadingContext.do_update is None):
        loadingContext.do_update = (not (args.pack or args.print_subgraph))
    return loadingContext