code: def first_leaf(args, kwargs) -> Optional[Any]:
      flat_args = tree.flatten(args)
      if flat_args:
          return flat_args[0]
      flat_kwargs = tree.flatten(kwargs)
      if flat_kwargs:
          return flat_kwargs[0]
      return None
  
file_path: sonnet/sonnet/src/batch_apply.py
imports: from typing import Any, Callable, Optional, Sequence, Union
  import numpy
  from sonnet.src import base
  import tensorflow
  import tree
label_desc: Use image node_id 1 for calling a global function with example usage: first_leaf(args, kwargs) and returns: None, flat_args, flat_kwargs