class_docstr: Handles loading of CSV files with user-defined features.
  
  This is a convenience class that allows for descriptors already present in a
  CSV file to be extracted without any featurization necessary.
  
  Examples
  --------
  Let's suppose we have some descriptors and labels. (Imagine that these
  descriptors have been computed by an external program.)
  
  >>> desc1 = [1, 43]
  >>> desc2 = [-2, -22]
  >>> labels = [1.5, 2.3]
  >>> ids = ["cp1", "cp2"]
  
  Let's put these in a dataframe.
  
  >>> import pandas as pd
  >>> df = pd.DataFrame(list(zip(ids, desc1, desc2, labels)), columns=["id", "desc1", "desc2", "task1"])
  
  Let's now write this to disk somewhere. We can now use `UserCSVLoader` to
  process this CSV dataset.
  
  >>> import tempfile
  >>> import deepchem as dc
  >>> featurizer = dc.feat.UserDefinedFeaturizer(["desc1", "desc2"])
  >>> with dc.utils.UniversalNamedTemporaryFile(mode='w') as tmpfile:
  ...     df.to_csv(tmpfile.name)
  ...     loader = dc.data.UserCSVLoader(["task1"], id_field="id",
  ...                              featurizer=featurizer)
  ...     dataset = loader.create_dataset(tmpfile.name)
  >>> len(dataset)
  2
  >>> dataset.X[0, 0]
  1
  
  The difference between `UserCSVLoader` and `CSVLoader` is that our
  descriptors (our features) have already been computed for us, but are spread
  across multiple columns of the CSV file.
  
  Of course in practice you should already have your data in a CSV file if
  you're using `UserCSVLoader`. If your data is already in memory, use
  `InMemoryLoader` instead.
class_docstr_tok: ["Handles","loading","of","CSV","files","with","user-defined","features",".","This","is","a","convenience","class","that","allows","for","descriptors","already","present","in","a","CSV","file","to","be","extracted","without","any","featurization","necessary",".","Examples","--","--","--","--","Let","'s","suppose","we","have","some","descriptors","and","labels",".","(","Imagine","that","these","descriptors","have","been","computed","by","an","external","program",".",")",">",">",">","desc1","=","[","1",",","43","]",">",">",">","desc2","=","[","-2",",","-22","]",">",">",">","labels","=","[","1.5",",","2.3","]",">",">",">","ids","=","[","``","cp1","''",",","``","cp2","''","]","Let","'s","put","these","in","a","dataframe",".",">",">",">","import","pandas","as","pd",">",">",">","df","=","pd.DataFrame","(","list","(","zip","(","ids",",","desc1",",","desc2",",","labels",")",")",",","columns=","[","``","id","''",",","``","desc1","''",",","``","desc2","''",",","``","task1","''","]",")","Let","'s","now","write","this","to","disk","somewhere",".","We","can","now","use","`","UserCSVLoader","`","to","process","this","CSV","dataset",".",">",">",">","import","tempfile",">",">",">","import","deepchem","as","dc",">",">",">","featurizer","=","dc.feat.UserDefinedFeaturizer","(","[","``","desc1","''",",","``","desc2","''","]",")",">",">",">","with","dc.utils.UniversalNamedTemporaryFile","(","mode=","'","w","'",")","as","tmpfile",":","...","df.to_csv","(","tmpfile.name",")","...","loader","=","dc.data.UserCSVLoader","(","[","``","task1","''","]",",","id_field=","''","id","''",",","...","featurizer=featurizer",")","...","dataset","=","loader.create_dataset","(","tmpfile.name",")",">",">",">","len","(","dataset",")","2",">",">",">","dataset.X","[","0",",","0","]","1","The","difference","between","`","UserCSVLoader","`","and","`","CSVLoader","`","is","that","our","descriptors","(","our","features",")","have","already","been","computed","for","us",",","but","are","spread","across","multiple","columns","of","the","CSV","file",".","Of","course","in","practice","you","should","already","have","your","data","in","a","CSV","file","if","you","'re","using","`","UserCSVLoader","`",".","If","your","data","is","already","in","memory",",","use","`","InMemoryLoader","`","instead","."]
docstr: Defines a generator which returns data for each shard
  
  Parameters
  ----------
  input_files: List[str]
      List of filenames to process
  shard_size: int, optional
      The size of a shard of data to process at a time.
  
  Returns
  -------
  Iterator[pd.DataFrame]
      Iterator over shards
docstr_tok: ["Defines","a","generator","which","returns","data","for","each","shard","Parameters","--","--","--","--","--","input_files",":","List","[","str","]","List","of","filenames","to","process","shard_size",":","int",",","optional","The","size","of","a","shard","of","data","to","process","at","a","time",".","Returns","--","--","--","-","Iterator","[","pd.DataFrame","]","Iterator","over","shards"]
code: def _get_shards(
      self, input_files: List[str], shard_size: Optional[int]
  ) -> Iterator[pd.DataFrame]:
      """Defines a generator which returns data for each shard
  
      Parameters
      ----------
      input_files: List[str]
          List of filenames to process
      shard_size: int, optional
          The size of a shard of data to process at a time.
  
      Returns
      -------
      Iterator[pd.DataFrame]
          Iterator over shards
      """
      return load_csv_files(input_files, shard_size)
  
imports: import os
  import tempfile
  import zipfile
  import time
  import logging
  import warnings
  from typing import List, Optional, Tuple, Any, Sequence, Union, Iterator
  import pandas
  import numpy
  from deepchem.utils.typing import OneOrMany
  from deepchem.utils.data_utils import load_image_files, load_csv_files, load_json_files, load_sdf_files, unzip_file
  from deepchem.feat import UserDefinedFeaturizer, Featurizer
  from deepchem.data import Dataset, DiskDataset, NumpyDataset, ImageDataset
  from deepchem.feat.molecule_featurizers import OneHotFeaturizer
  from deepchem.utils.genomics_utils import encode_bio_sequence
label_desc: Use image node_id 1 for calling the UserCSVLoader obj's underlying member method code with example usage: obj._get_shards(input_files, shard_size) and returns: load_csv_files