code: def get_config_from_yaml(yaml_path: Path):
      try:
          import yaml
      except ImportError:
          print("Please install PyYAML: pip install PyYAML")
      config = {}
      if yaml_path.is_file():
          try:
              with open(yaml_path) as f:
                  config = yaml.load(f, Loader=yaml.FullLoader)
          except Exception as e:
              raise Exception(
                  f"Failed to load config from {yaml_path.as_posix()}: {e}"
              )
      else:
          raise FileNotFoundError(f"{yaml_path.as_posix()} not found")
  
      return config
  
imports: import logging
  from argparse import Namespace
  from copy import deepcopy
  from pathlib import Path
  from typing import Dict, Optional
  from fairseq.data import Dictionary
label_desc: Use image node_id 1 for calling a global function with example usage: get_config_from_yaml(yaml_path) and returns: config