code: def load_yaml_file(i):
      
  
      import yaml
  
      fn=i['yaml_file']
  
      try:
        if sys.version_info[0]>2:
           f=open(fn, 'r', encoding='utf8')
        else:
           f=open(fn, 'r')
      except Exception as e:
         return {'return':16, 'error':'problem opening YAML file='+fn+' ('+format(e)+')'}
  
      try:
        s=f.read()
      except Exception as e:
         f.close()
         return {'return':1, 'error':'problem reading YAML file='+fn+' ('+format(e)+')'}
  
      f.close()
  
      try:
        d=yaml.load(s)
      except Exception as e:
         return {'return':1, 'error':'problem parsing YAML from file='+fn+' ('+format(e)+')'}
  
      return {'return':0, 'dict': d}
docs: Input:  {
                yaml_file - name of YAML file
              }
  
      Output: {
                return       - return code =  0, if successful
                                           = 16, if file not found (may be warning)
                                           >  0, if error
                (error)  - error text if return > 0
  
                dict     - dict from YAML file
              }