original_docstring: 
      Map folder+classnames into list of (imagepath, class_index). Requires potentially
      expensive glob filesystem. For large object store datasets it's recommended to cache this.
      
docstring: Map folder+classnames into list of (imagepath, class_index). Requires potentially
  expensive glob filesystem. For large object store datasets it's recommended to cache this.
docstring_tokens: Map folder + classnames into list of ( imagepath class_index ) . Requires potentially expensive glob filesystem . For large object store datasets it ' s recommended to cache this .
code: def make_dataset(
          paths: List[str],
          extensions: Optional[Tuple[str, ...]] = None,
  ) -> Tuple[List[Tuple[str, int]], Dict[bytes, int]]:
      """
      Map folder+classnames into list of (imagepath, class_index). Requires potentially
      expensive glob filesystem. For large object store datasets it's recommended to cache this.
      """
      instances = []
      counter = 0
      if extensions is None:
          extensions = ()
      # make it easier to directly match on result of str.split
      ext_set = set(ext[1:].lower() for ext in extensions)
      classes_to_idx = {}
      for path in sorted(paths):
          components = path.split('/')
          # based on above glob expression the last 2 components are filename/class
          potentialclass = components[-2].encode('utf-8')
          fname = components[-1]
          if fname.split('.')[-1].lower() not in ext_set:
              continue
          if potentialclass not in classes_to_idx:
              classes_to_idx[potentialclass] = counter
              counter += 1
          instances.append((path, classes_to_idx[potentialclass]))
      return instances, classes_to_idx
code_tokens: def make_dataset ( paths : List [ str ] , extensions : Optional [ Tuple [ str , ... ] ] = None , ) -> Tuple [ List [ Tuple [ str , int ] ] , Dict [ bytes , int ] ] : instances = [ ] counter = 0 if extensions is None : extensions = ( ) ext_set = set ( ext [ 1 : ] . lower ( ) for ext in extensions ) classes_to_idx = { } for path in sorted ( paths ) : components = path . split ( '/' ) potentialclass = components [ - 2 ] . encode ( 'utf-8' ) fname = components [ - 1 ] if fname . split ( '.' ) [ - 1 ] . lower ( ) not in ext_set : continue if potentialclass not in classes_to_idx : classes_to_idx [ potentialclass ] = counter counter += 1 instances . append ( ( path , classes_to_idx [ potentialclass ] ) ) return instances , classes_to_idx
short_docstring: Map folder+classnames into list of (imagepath, class_index).
short_docstring_tokens: Map folder + classnames into list of ( imagepath class_index ) .
comment: """
      Map folder+classnames into list of (imagepath, class_index). Requires potentially
      expensive glob filesystem. For large object store datasets it's recommended to cache this.
      """$SEP$# make it easier to directly match on result of str.split$SEP$# based on above glob expression the last 2 components are filename/class