code: def load_yaml(f):
      # Convert to absolute path for loading includes
      abs_f = get_absolute_path(f)
  
      try:
          mapping = OmegaConf.load(PathManager.get_local_path(abs_f))
          f = abs_f
      except FileNotFoundError as e:
          # Check if this file might be relative to root?
          # TODO: Later test if this can be removed
          relative = os.path.abspath(os.path.join(get_mmf_root(), f))
          if not PathManager.isfile(relative):
              raise e
          else:
              f = relative
              mapping = OmegaConf.load(PathManager.get_local_path(f))
  
      if mapping is None:
          mapping = OmegaConf.create()
  
      includes = mapping.get("includes", [])
  
      if not isinstance(includes, collections.abc.Sequence):
          raise AttributeError(
              "Includes must be a list, {} provided".format(
                  type(includes)
              )
          )
  
      include_mapping = OmegaConf.create()
  
      mmf_root_dir = get_mmf_root()
  
      for include in includes:
          original_include_path = include
          include = os.path.join(mmf_root_dir, include)
  
          # If path doesn't exist relative to MMF root, try relative to current file
          if not PathManager.exists(include):
              include = os.path.join(
                  os.path.dirname(f), original_include_path
              )
  
          current_include_mapping = load_yaml(include)
          include_mapping = OmegaConf.merge(
              include_mapping, current_include_mapping
          )
  
      mapping.pop("includes", None)
  
      mapping = OmegaConf.merge(include_mapping, mapping)
  
      return mapping
  
imports: import collections
  import json
  import logging
  import os
  import warnings
  from ast import literal_eval
  from typing import List
  import torch
  from mmf.common.registry import registry
  from mmf.utils.env import import_user_module
  from mmf.utils.file_io import PathManager
  from mmf.utils.general import get_absolute_path, get_mmf_root
  from omegaconf import DictConfig, errors, OmegaConf
label_desc: Use image node_id 1 for calling a global function with example usage: load_yaml(f) and returns: mapping