code: def analyze_egg(egg_dir, stubs):
      # check for existing flag in EGG-INFO
      for flag, fn in safety_flags.items():
          if os.path.exists(os.path.join(egg_dir, "EGG-INFO", fn)):
              return flag
      if not can_scan():
          return False
      safe = True
      for base, dirs, files in walk_egg(egg_dir):
          for name in files:
              if name.endswith(".py") or name.endswith(".pyw"):
                  continue
              elif name.endswith(".pyc") or name.endswith(".pyo"):
                  # always scan, even if we already know we're not safe
                  safe = (
                      scan_module(egg_dir, base, name, stubs) and safe
                  )
      return safe
  
imports: from distutils.dir_util import remove_tree, mkpath
  from distutils import log
  from types import CodeType
  import sys
  import os
  import re
  import textwrap
  import marshal
  from setuptools.extension import Library
  from setuptools import Command
  from .._path import ensure_directory
  from sysconfig import get_path, get_python_version
label_desc: Use image node_id 6 for calling a global function with example usage: analyze_egg(egg_dir, stubs) and returns: safe, False, flag