code: def _make_initable(
      cls: _ModuleMeta, init, post_init, wraps: bool
  ) -> _ModuleMeta:
      # Used as part of the key. Don't cache if these have changed.
      # In practice, monkey-patching these on the class -- after you've already
      # instantiated it somewhere! -- is an *ahem*, adventurous, thing to do. But never
      # let it be said that Equinox doesn't support you in your questionable life choices!
      del init, post_init
  
      if wraps:
          field_names = _wrapper_field_names
      else:
          field_names = {
              field.name for field in dataclasses.fields(cls)
          }  # pyright: ignore
  
      class _InitableModule(cls, _Initable):  # pyright: ignore
          pass
  
      def __setattr__(self, name, value):
          if name in field_names:
              if (
                  isinstance(value, BoundMethod)
                  and value.__self__ is self
              ):
                  raise ValueError(
                      """Cannot assign methods in __init__.
  
  That is, something like the following is not allowed:
  ```
  class MyModule(eqx.Module):
      foo: Callable
  
      def __init__(self):
          self.foo = self.bar
  
      def bar(self):
          ...
  ```
  this is because Equinox modules are PyTrees -- but the above does not have a tree
  structure! `self.foo.__self__` is a cycle that brings us back to `self`.
  
  In the above example, you probably want something like this instead:
  ```
  class MyModule(eqx.Module):
      @property
      def foo(self):
          return self.bar
  
      def bar(self):
          ...
  ```
  so that you can still use `self.foo`, but it is not stored in the PyTree structure.
  
  This is a check that was introduced in Equinox v0.11.0. Before this, the above error
  went uncaught, possibly leading to silently wrong behaviour.
  """
                  )
              else:
                  object.__setattr__(self, name, value)
          else:
              raise AttributeError(f"Cannot set attribute {name}")
  
      # Done like this to avoid dataclasses complaining about overriding setattr on a
      # frozen class.
      _InitableModule.__setattr__ = __setattr__
      # Make beartype happy
      _InitableModule.__init__ = cls.__init__  # pyright: ignore
      # Appears in AbstractVar error messages
      _InitableModule.__name__ = cls.__name__
      _InitableModule.__qualname__ = cls.__qualname__
      # I don't have a specific use-case for this but it's probably good practice.
      _InitableModule.__module__ = cls.__module__
  
      return _InitableModule
  
imports: import abc
  import dataclasses
  import functools
  import inspect
  import types
  import warnings
  import weakref
  from collections.abc import Callable
  from typing import Any, cast, Optional, Protocol, TYPE_CHECKING, TypeVar, Union
  from typing_extensions import dataclass_transform, ParamSpec
  import jax._src.traceback_util
  import jax.tree_util
  import numpy
  from jaxtyping import Array, Bool, PyTreeDef
  from ._better_abstract import ABCMeta, dataclass
  from ._caches import internal_lru_caches
  from ._doc_utils import doc_repr
  from ._pretty_print import tree_pformat
  from ._tree import tree_equal
label_desc: Use image node_id 6 for calling a global function with example usage: _make_initable(cls, init, post_init, wraps) and returns: _InitableModule