code: def walk_without_cycles(top_root):
      seen = set()
  
      def _recurse(root):
          for parent, dirs, files in os.walk(root):
              for d in dirs:
                  path = os.path.join(parent, d)
                  if os.path.islink(path):
                      # Breaking loops: never follow the same symlink twice
                      #
                      # NOTE: this also means that links to sibling links are
                      # not followed. In this case:
                      #
                      #   x -> y
                      #   y -> oo
                      #   oo/real_file
                      #
                      # real_file is only included twice, not three times
                      reallink = os.path.realpath(path)
                      if reallink not in seen:
                          seen.add(reallink)
                          for x in _recurse(path):
                              yield x
              yield parent, files
  
      for x in _recurse(top_root):
          yield x
  
imports: import importlib
  import os
  import sys
  import tarfile
  import time
  import json
  from io import BytesIO
  from .extension_support import EXT_PKG, package_mfext_all
  from .metaflow_config import DEFAULT_PACKAGE_SUFFIXES
  from .exception import MetaflowException
  from .util import to_unicode
  from .None import R, INFO_FILE
label_desc: Use image node_id 1 for calling a global function with example usage: walk_without_cycles(top_root) without return types