code: def freeze(self, bytecode_compile=True):
      
      self._ensure_unfrozen('Freezing the environment')
      self._prepare_code_hash()
      self._prepare_manifest()
      self._prepare_bootstrap()
      self._prepare_main()
      if bytecode_compile:
        self._precompile_source()
      self._frozen = True
docs: Freeze the PEX.
  
      :param bytecode_compile: If True, precompile .py files into .pyc files when freezing code.
  
      Freezing the PEX writes all the necessary metadata and environment bootstrapping code.  It may
      only be called once and renders the PEXBuilder immutable.