code: def serialize(compiled: jax.stages.Compiled):
      """Serializes a compiled binary.
  
      Because pytrees are not serializable, they are returned so that
      the user can handle them properly.
      """
      unloaded_executable = getattr(
          compiled._executable, "_unloaded_executable", None
      )
      if unloaded_executable is None:
          raise ValueError("Compilation does not support serialization")
      args_info_flat, in_tree = jax.tree_util.tree_flatten(
          compiled.args_info
      )
  
      with io.BytesIO() as file:
          _JaxPjrtPickler(file).dump(
              (unloaded_executable, args_info_flat, compiled._no_kwargs)
          )
          return file.getvalue(), in_tree, compiled.out_tree
  
file_path: jax/jax/experimental/serialize_executable.py
imports: from __future__ import annotations
  import pickle
  import io
  from typing import Optional, Union
  import jax
  from jax._src.lib import xla_client
label_desc: Use image node_id 1 for calling a global function with example usage: serialize(compiled) and returns: file,  in_tree,  compiled