code: def get_task_dataset(dataset, task):
      """Selects out entries for a particular task."""
      X, y, w, ids = dataset.X, dataset.y, dataset.w, dataset.ids
      # Get task specific entries
      w_task = w[:, task]
      X_task = X[w_task != 0]
      y_task = np.expand_dims(y[w_task != 0, task], 1)
      ids_task = ids[w_task != 0]
      # Now just get weights for this task
      w_task = np.expand_dims(w[w_task != 0, task], 1)
  
      return NumpyDataset(X_task, y_task, w_task, ids_task)
  
imports: import logging
  import time
  import numpy
  from deepchem.data import NumpyDataset
label_desc: Use image node_id 4 for calling a global function with example usage: get_task_dataset(dataset, task) and returns: NumpyDataset