code: def get_dataset(
      mode="classification",
      featurizer="smiles2seq",
      max_seq_len=20,
      data_points=10,
      n_tasks=5,
  ):
      dataset_file = os.path.join(
          os.path.dirname(__file__), "assets", "chembl_25_small.csv"
      )
  
      if featurizer == "smiles2seq":
          max_len = 250
          pad_len = 10
          char_to_idx = create_char_to_idx(
              dataset_file, max_len=max_len, smiles_field="smiles"
          )
          feat = SmilesToSeq(
              char_to_idx=char_to_idx, max_len=max_len, pad_len=pad_len
          )
  
      elif featurizer == "smiles2img":
          img_size = 80
          img_spec = "engd"
          res = 0.5
          feat = SmilesToImage(
              img_size=img_size, img_spec=img_spec, res=res
          )
  
      loader = dc.data.CSVLoader(
          tasks=CHEMBL25_TASKS, smiles_field="smiles", featurizer=feat
      )
      dataset = loader.create_dataset(
          inputs=[dataset_file],
          shard_size=10000,
          data_dir=tempfile.mkdtemp(),
      )
  
      w = np.ones(shape=(data_points, n_tasks))
  
      if mode == "classification":
          y = np.random.randint(0, 2, size=(data_points, n_tasks))
          metric = dc.metrics.Metric(
              dc.metrics.roc_auc_score, np.mean, mode="classification"
          )
      else:
          y = np.random.normal(size=(data_points, n_tasks))
          metric = dc.metrics.Metric(
              dc.metrics.mean_absolute_error, mode="regression"
          )
  
      if featurizer == "smiles2seq":
          dataset = dc.data.NumpyDataset(
              dataset.X[:data_points, :max_seq_len],
              y,
              w,
              dataset.ids[:data_points],
          )
      else:
          dataset = dc.data.NumpyDataset(
              dataset.X[:data_points], y, w, dataset.ids[:data_points]
          )
  
      if featurizer == "smiles2seq":
          return dataset, metric, char_to_idx
      else:
          return dataset, metric
  
file_path: deepchem/deepchem/models/tests/test_chemnet_models.py
imports: import os
  import numpy
  import tempfile
  import pytest
  from flaky import flaky
  import deepchem
  from deepchem.feat import create_char_to_idx, SmilesToSeq, SmilesToImage
  from deepchem.molnet.load_function.chembl25_datasets import CHEMBL25_TASKS
label_desc: Use image node_id 1 for calling a global function with example usage: get_dataset(mode, featurizer, max_seq_len, data_points, n_tasks) and returns: dataset,  metric,  char_to_idx, dataset,  metric