code: def get_single_task_test(dataset, batch_size, task, replace=True):
      """Gets test set from specified task.
  
      Samples random subset of size batch_size from specified task of dataset.
      Ensures that sampled points have measurements for this task.
      """
      w_task = dataset.w[:, task]
      X_task = dataset.X[w_task != 0]
      y_task = dataset.y[w_task != 0]
      ids_task = dataset.ids[w_task != 0]
      # Now just get weights for this task
      w_task = dataset.w[w_task != 0]
  
      inds = np.random.choice(
          np.arange(len(X_task)), batch_size, replace=replace
      )
      X_batch = X_task[inds]
      y_batch = np.squeeze(y_task[inds, task])
      w_batch = np.squeeze(w_task[inds, task])
      ids_batch = ids_task[inds]
      return NumpyDataset(X_batch, y_batch, w_batch, ids_batch)
  
imports: import logging
  import time
  import numpy
  from deepchem.data import NumpyDataset
label_desc: Use image node_id 6 for calling a global function with example usage: get_single_task_test(dataset, batch_size, task, replace) and returns: NumpyDataset