def load_job_order(args: argparse.Namespace, stdin: IO[Any], fetcher_constructor: Optional[FetcherCallableType], overrides_list: List[CWLObjectType], tool_file_uri: str) -> Tuple[(Optional[CWLObjectType], str, Loader)]:
    job_order_object = None
    job_order_file = None
    _jobloaderctx = jobloaderctx.copy()
    loader = Loader(_jobloaderctx, fetcher_constructor=fetcher_constructor)
    if ((len(args.job_order) == 1) and (args.job_order[0][0] != '-')):
        job_order_file = args.job_order[0]
    elif ((len(args.job_order) == 1) and (args.job_order[0] == '-')):
        yaml = yaml_no_ts()
        job_order_object = yaml.load(stdin)
        (job_order_object, _) = loader.resolve_all(job_order_object, (file_uri(os.getcwd()) + '/'))
    else:
        job_order_file = None
    if (job_order_object is not None):
        input_basedir = (args.basedir if args.basedir else os.getcwd())
    elif (job_order_file is not None):
        input_basedir = (args.basedir if args.basedir else os.path.abspath(os.path.dirname(job_order_file)))
        (job_order_object, _) = loader.resolve_ref(job_order_file, checklinks=False, content_types=CWL_CONTENT_TYPES)
    if ((job_order_object is not None) and ('http://commonwl.org/cwltool#overrides' in job_order_object)):
        ov_uri = file_uri((job_order_file or input_basedir))
        overrides_list.extend(resolve_overrides(job_order_object, ov_uri, tool_file_uri))
        del job_order_object['http://commonwl.org/cwltool#overrides']
    if (job_order_object is None):
        input_basedir = (args.basedir if args.basedir else os.getcwd())
    if ((job_order_object is not None) and (not isinstance(job_order_object, MutableMapping))):
        _logger.error('CWL input object at %s is not formatted correctly, it should be a JSON/YAML dictionay, not %s.\nRaw input object:\n%s', (job_order_file or 'stdin'), type(job_order_object), job_order_object)
        sys.exit(1)
    return (job_order_object, input_basedir, loader)
def load_job_order(args: argparse.Namespace, stdin: IO[Any], fetcher_constructor: Optional[FetcherCallableType], overrides_list: List[CWLObjectType], tool_file_uri: str) -> Tuple[(Optional[CWLObjectType], str, Loader)]:
    job_order_object = None
    job_order_file = None
    _jobloaderctx = jobloaderctx.copy()
    loader = Loader(_jobloaderctx, fetcher_constructor=fetcher_constructor)
    if ((len(args.job_order) == 1) and (args.job_order[0][0] != '-')):
        job_order_file = args.job_order[0]
    elif ((len(args.job_order) == 1) and (args.job_order[0] == '-')):
        yaml = yaml_no_ts()
        job_order_object = yaml.load(stdin)
        (job_order_object, _) = loader.resolve_all(job_order_object, (file_uri(os.getcwd()) + '/'))
    else:
        job_order_file = None
    if (job_order_object is not None):
        input_basedir = (args.basedir if args.basedir else os.getcwd())
    elif (job_order_file is not None):
        input_basedir = (args.basedir if args.basedir else os.path.abspath(os.path.dirname(job_order_file)))
        (job_order_object, _) = loader.resolve_ref(job_order_file, checklinks=False, content_types=CWL_CONTENT_TYPES)
    if ((job_order_object is not None) and ('http://commonwl.org/cwltool#overrides' in job_order_object)):
        ov_uri = file_uri((job_order_file or input_basedir))
        overrides_list.extend(resolve_overrides(job_order_object, ov_uri, tool_file_uri))
        del job_order_object['http://commonwl.org/cwltool#overrides']
    if (job_order_object is None):
        input_basedir = (args.basedir if args.basedir else os.getcwd())
    if ((job_order_object is not None) and (not isinstance(job_order_object, MutableMapping))):
        _logger.error('CWL input object at %s is not formatted correctly, it should be a JSON/YAML dictionay, not %s.\nRaw input object:\n%s', (job_order_file or 'stdin'), type(job_order_object), job_order_object)
        sys.exit(1)
    return (job_order_object, input_basedir, loader)