code: def head(task):
      """Return the top level node of a task."""
  
      if istask(task):
          return task[0]
      if isinstance(task, list):
          return list
      return task
  
imports: from collections import deque
  from flash.core.serve.dag.task import istask, subs
  from flash.core.utilities.imports import _TOPIC_SERVE_AVAILABLE
label_desc: Use image node_id 1 for calling a global function with example usage: head(task) and returns: task, task, list