def GetDataHandles(op, names, hyp_list, verbose=False):
  """Returns a list of data handles.

  This method is the top-level routine for creating data handlers. It takes a
  description of which datasets to load and returns data handlers to access
  them.
  Args:
    op: Operation protocol buffer.
    names: list of list of data names. The top level list corresponds to train,
      validation and test sets. The lower-level lists correspond to data
      modalities.
    hyp_list: List of hyperparameters for each modality.
    verbose: If True, will print out details of what is happening.
  Returns:
    A list of DataHandler objects.
  """
  typesize = 4
  data_proto_file = os.path.join(op.data_proto_prefix, op.data_proto)
  dataset_proto = util.ReadData(data_proto_file)
  handlers = []
  if dataset_proto.data_handler == 'deepnet':
    size_list = []
    for name_list in names:
      size = 0
      for name in name_list:
        try:
          data_proto = next(d for d in dataset_proto.data if d.name == name)
        except StopIteration as e:
          print '%s not found in data pbtxt' % name
          raise e
        datasetsize = data_proto.size
        numdims = np.prod(np.array(data_proto.dimensions))
        size += datasetsize * numdims * typesize
      size_list.append(size)
    total_size = sum(size_list)
    proportions = [float(size)/total_size for size in size_list]
    for i, name_list in enumerate(names):
      if name_list == []:
        handlers.append(None)
      else:
        handlers.append(DataHandler(op, name_list, hyp_list, frac=proportions[i]))
  elif dataset_proto.data_handler == 'navdeep':
    import navdeep_datahandler
    for i, name_list in enumerate(names):
      if name_list == []:
        handlers.append(None)
      else:
        handlers.append(navdeep_datahandler.NavdeepDataHandler(
          op, dataset_proto, name_list, hyp_list))

  return handlers
Returns a list of data handles.

  This method is the top-level routine for creating data handlers. It takes a
  description of which datasets to load and returns data handlers to access
  them.
  Args:
    op: Operation protocol buffer.
    names: list of list of data names. The top level list corresponds to train,
      validation and test sets. The lower-level lists correspond to data
      modalities.
    hyp_list: List of hyperparameters for each modality.
    verbose: If True, will print out details of what is happening.
  Returns:
    A list of DataHandler objects.
  
deepnet/datahandler.py