code: def yaml_ordered_load(
      stream, Loader=yaml.Loader, object_pairs_hook=OrderedDict
  ):
      """Function to load YAML file using an OrderedDict
  
      See: https://stackoverflow.com/questions/5121931/in-python-how-can-you-load-yaml-mappings-as-ordereddicts
      """
  
      class OrderedLoader(Loader):
          pass
  
      def construct_mapping(loader, node):
          loader.flatten_mapping(node)
          return object_pairs_hook(loader.construct_pairs(node))
  
      OrderedLoader.add_constructor(
          yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG,
          construct_mapping,
      )
  
      return yaml.load(stream, OrderedLoader)
  
imports: import argparse
  from collections import OrderedDict
  from copy import deepcopy
  import logging
  import operator
  import random
  import numpy
  import torch
  import torch.nn
  import torch.backends.cudnn
  import yaml
  import inspect
label_desc: Use image node_id 46 for calling a global function with example usage: yaml_ordered_load(stream, Loader, object_pairs_hook) and returns: yaml, object_pairs_hook