code: def get_task_ids(dataset_ids):
      # return task ids of corresponding datset ids.
  
      # active tasks
      tasks_a = openml.tasks.list_tasks(task_type_id=1, status="active")
      tasks_a = pd.DataFrame.from_dict(tasks_a, orient="index")
  
      # query only those with holdout as the resampling startegy.
      tasks_a = tasks_a[
          (tasks_a.estimation_procedure == "33% Holdout set")
      ]
  
      # deactivated tasks
      tasks_d = openml.tasks.list_tasks(
          task_type_id=1, status="deactivated"
      )
      tasks_d = pd.DataFrame.from_dict(tasks_d, orient="index")
  
      tasks_d = tasks_d[
          (tasks_d.estimation_procedure == "33% Holdout set")
      ]
  
      task_ids = []
      for did in dataset_ids:
          task_a = list(tasks_a.query("did == {}".format(did)).tid)
          if (
              len(task_a) > 1
          ):  # if there are more than one task, take the lowest one.
              task_a = [min(task_a)]
          task_d = list(tasks_d.query("did == {}".format(did)).tid)
          if len(task_d) > 1:
              task_d = [min(task_d)]
          task_ids += list(task_a + task_d)
  
      return task_ids
  
imports: import openml
  import pandas
label_desc: Use image node_id 1 for calling a global function with example usage: get_task_ids(dataset_ids) and returns: task_ids