code: def load_data(infile, workdir=None):
      
      infile = resolve_path(infile, workdir=workdir)
      infile, ext = os.path.splitext(infile)
  
      if os.path.isfile(infile + '.npy'):
          infile += '.npy'
      elif os.path.isfile(infile + '.yaml'):
          infile += '.yaml'
      else:
          raise Exception('Input file does not exist.')
  
      ext = os.path.splitext(infile)[1]
  
      if ext == '.npy':
          return infile, load_npy(infile)
      elif ext == '.yaml':
          return infile, load_yaml(infile)
      else:
          raise Exception('Unrecognized extension.')
docs: Load python data structure from either a YAML or numpy file.