original_docstring: Pre-populate a list of MushroomImages to make splitting with sklearn simple
docstring: Pre-populate a list of MushroomImages to make splitting with sklearn simple
docstring_tokens: Pre - populate a list of MushroomImages to make splitting with sklearn simple
code: def _dataset_primer(path):
      """Pre-populate a list of MushroomImages to make splitting with sklearn simple"""
      items = []
      classnames = []
      for i, directory in enumerate(os.listdir(path)):
          classnames.append(directory)
          for img in os.listdir(os.path.join(path, directory)):
              items.append(MushroomImage(img_path=os.path.join(path, directory, img),
                                         class_id=i))
  
      return items, classnames
code_tokens: def _dataset_primer ( path ) : items = [ ] classnames = [ ] for i , directory in enumerate ( os . listdir ( path ) ) : classnames . append ( directory ) for img in os . listdir ( os . path . join ( path , directory ) ) : items . append ( MushroomImage ( img_path = os . path . join ( path , directory , img ) , class_id = i ) ) return items , classnames
short_docstring: Pre-populate a list of MushroomImages to make splitting with sklearn simple
short_docstring_tokens: Pre - populate a list of MushroomImages to make splitting with sklearn simple
comment: """Pre-populate a list of MushroomImages to make splitting with sklearn simple"""