code: def benchmark_model(
      model, all_dataset, transformers, metric, test=False
  ):
      """
      Benchmark custom model.
  
      model: user-defined model stucture
          For user define model, it should include function: fit, evaluate.
  
      all_dataset: (train, test, val) data tuple.
          Returned by `load_dataset` function.
  
      transformers
  
      metric: string
          choice of evaluation metrics.
      """
      time_start_fitting = time.time()
      train_score = 0.0
      valid_score = 0.0
      test_score = 0.0
  
      train_dataset, valid_dataset, test_dataset = all_dataset
  
      model.fit(train_dataset)
      train_score = model.evaluate(train_dataset, metric, transformers)
      valid_score = model.evaluate(valid_dataset, metric, transformers)
      if test:
          test_score = model.evaluate(
              test_dataset, metric, transformers
          )
  
      time_finish_fitting = time.time()
      time_for_running = time_finish_fitting - time_start_fitting
  
      return train_score, valid_score, test_score, time_for_running
  
file_path: deepchem/deepchem/molnet/run_benchmark.py
imports: import os
  import time
  import csv
  import numpy
  import deepchem
  import pickle
  from deepchem.molnet.run_benchmark_models import benchmark_classification, benchmark_regression
  from deepchem.molnet.check_availability import CheckFeaturizer, CheckSplit
  from deepchem.molnet.preset_hyper_parameters import hps
label_desc: Use image node_id 3 for calling a global function with example usage: benchmark_model(model, all_dataset, transformers, metric, test) and returns: train_score,  valid_score,  test_score,  time_for_running