code: def flatten(node, parents=None):
      parents = list(parents or [])
      if isinstance(node, str):
          yield (node, parents)
      elif isinstance(node, list):
          for value in node:
              yield from flatten(value, parents=parents)
      elif isinstance(node, dict):
          for key, value in node.items():
              yield (key, parents)
              yield from flatten(value, parents=parents + [key])
      else:
          raise TypeError(node)
  
imports: import os
  import shlex
  import subprocess
  from io import StringIO
  from dotenv import dotenv_values
  from ruamel.yaml import YAML
  from ..utils.command import Command, default_bin
  from ..utils.source import arrow_path
  from ..compat import _ensure_path
label_desc: Use image node_id 1 for calling a global function with example usage: flatten(node, parents) without return types