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.errors import DistutilsSetupError
  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.extern import six
  from pkg_resources import get_build_platform, Distribution, ensure_directory
  from pkg_resources import EntryPoint
  from setuptools.extension import Library
  from setuptools import Command
label_desc: Use image node_id 5 for calling a global function with example usage: analyze_egg(egg_dir, stubs) and returns: safe, False, flag