code: def write_safety_flag(egg_dir, safe):
      # Write or remove zip safety flag file(s)
      for flag, fn in safety_flags.items():
          fn = os.path.join(egg_dir, fn)
          if os.path.exists(fn):
              if safe is None or bool(safe) != flag:
                  os.unlink(fn)
          elif safe is not None and bool(safe) == flag:
              f = open(fn, "wt")
              f.write("\n")
              f.close()
  
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 6 for calling a global function with example usage: write_safety_flag(egg_dir, safe) without return types