class_docstr: Dataset which loads data from a list using given function.
  
  Considering a `elem_list` (can be an iterable or a `string` ) i-th sample
  of a dataset will be returned by `load(elem_list[i])`, where `load()`
  is a function provided by the user.
  
  If `path` is provided, `elem_list` is assumed to be a list of strings, and
  each element `elem_list[i]` will prefixed by `path/` when fed to `load()`.
  
  Purpose: many low or medium-scale datasets can be seen as a list of files
  (for example representing input samples). For this list of file, a target
  can be often inferred in a simple manner.
  
  Args:
      elem_list (iterable/str): List of arguments which will be passed to
          `load` function. It can also be a path to file with each line
          containing the arguments to `load`
      load (function, optional): Function which loads the data.
          i-th sample is returned by `load(elem_list[i])`. By default `load`
          is identity i.e, `lambda x: x`
      path (str, optional): Defaults to None. If a string is provided,
          `elem_list` is assumed to be a list of strings, and each element
          `elem_list[i]` will prefixed by this string when fed to `load()`.
class_docstr_tok: ["Dataset","which","loads","data","from","a","list","using","given","function",".","Considering","a","`","elem_list","`","(","can","be","an","iterable","or","a","`","string","`",")","i-th","sample","of","a","dataset","will","be","returned","by","`","load","(","elem_list","[","i","]",")","`",",","where","`","load","(",")","`","is","a","function","provided","by","the","user",".","If","`","path","`","is","provided",",","`","elem_list","`","is","assumed","to","be","a","list","of","strings",",","and","each","element","`","elem_list","[","i","]","`","will","prefixed","by","`","path\/","`","when","fed","to","`","load","(",")","`",".","Purpose",":","many","low","or","medium-scale","datasets","can","be","seen","as","a","list","of","files","(","for","example","representing","input","samples",")",".","For","this","list","of","file",",","a","target","can","be","often","inferred","in","a","simple","manner",".","Args",":","elem_list","(","iterable\/str",")",":","List","of","arguments","which","will","be","passed","to","`","load","`","function",".","It","can","also","be","a","path","to","file","with","each","line","containing","the","arguments","to","`","load","`","load","(","function",",","optional",")",":","Function","which","loads","the","data",".","i-th","sample","is","returned","by","`","load","(","elem_list","[","i","]",")","`",".","By","default","`","load","`","is","identity","i.e",",","`","lambda","x",":","x","`","path","(","str",",","optional",")",":","Defaults","to","None",".","If","a","string","is","provided",",","`","elem_list","`","is","assumed","to","be","a","list","of","strings",",","and","each","element","`","elem_list","[","i","]","`","will","prefixed","by","this","string","when","fed","to","`","load","(",")","`","."]
code: def __init__(self, elem_list, load=lambda x: x, path=None):
      super(ListDataset, self).__init__()
  
      if isinstance(elem_list, str):
          with open(elem_list) as f:
              self.list = [line.replace("\n", "") for line in f]
      else:
          # just assume iterable
          self.list = elem_list
  
      self.path = path
      self.load = load
  
imports: from .dataset import Dataset
label_desc: Use image node_id 1 to create a new ListDataset object from inherited base classes: Dataset with example: obj = ListDataset(elem_list, load, path)