code: def flat_list(inputs: Any) -> List:
      """
      flat a list by recursion
      """
      if not (
          isinstance(inputs, list)
          or isinstance(inputs, set)
          or isinstance(inputs, tuple)
      ):
          return [inputs]
      res = []
      for i in inputs:
          if (
              isinstance(i, list)
              or isinstance(i, set)
              or isinstance(i, tuple)
          ):
              res.extend(flat_list(i))
          elif isinstance(i, dict):
              res.extend(flat_list(list(i.keys())))
          else:
              res.append(i)
      return res
  
imports: from typing import Any, Dict, List, Union
  from torch.fx.node import Node
  from colossalai.logging import get_dist_logger
label_desc: Use image node_id 2 for calling a global function with example usage: flat_list(inputs) and returns: res, list