code: def traverse_parents(path, include_current=False):
      if not include_current:
          path = os.path.dirname(path)
  
      previous = None
      while previous != path:
          yield path
          previous = path
          path = os.path.dirname(path)
  
imports: import os
  from contextlib import contextmanager
label_desc: Use image node_id 1 for calling a global function with example usage: traverse_parents(path, include_current) without return types