class_docstr: cmp: cascading module permissions
class_docstr_tok: ["cmp",":","cascading","module","permissions"]
docstr: Get the child of parent as a CMPBase object
  
  Args:
      parent_obj (_type_): parent object
      child_path (_type_): _description_
      child_obj (_type_): _description_
  
  Returns:
      _type_: _description_
code: def init_child(
      self,
      parent_obj: Union[type, object],
      child_path: str,
      child_obj: Union[type, object],
      absolute_path: str,
  ) -> Optional[Self]:
      """Get the child of parent as a CMPBase object
  
      Args:
          parent_obj (_type_): parent object
          child_path (_type_): _description_
          child_obj (_type_): _description_
  
      Returns:
          _type_: _description_
      """
      parent_is_parent_module = CMPBase.parent_is_parent_module(
          parent_obj, child_obj
      )
      if CMPBase.isfunction(child_obj) and parent_is_parent_module:
          return CMPFunction(
              child_path,
              permissions=self.permissions,
              obj=child_obj,
              absolute_path=absolute_path,
          )  # type: ignore
      elif inspect.ismodule(child_obj) and CMPBase.is_submodule(
          parent_obj, child_obj
      ):
          ## TODO, we could register modules and functions in 2 ways:
          # A) as numpy.float32 (what we are doing now)
          # B) as numpy.core.float32 (currently not supported)
          # only allow submodules
  
          return CMPModule(
              child_path,
              permissions=self.permissions,
              obj=child_obj,
              absolute_path=absolute_path,
          )  # type: ignore
      elif inspect.isclass(child_obj) and parent_is_parent_module:
          return CMPClass(
              child_path,
              permissions=self.permissions,
              obj=child_obj,
              absolute_path=absolute_path,
          )  # type: ignore
      else:
          return None
  
imports: import importlib
  import inspect
  from inspect import Signature
  from inspect import _signature_fromstr
  from types import BuiltinFunctionType
  from typing import Any
  from typing import Callable
  from typing import Dict
  from typing import List
  from typing import Optional
  from typing import Sequence
  from typing import Union
  import numpy
  from typing_extensions import Self
  from .lib_permissions import ALL_EXECUTE
  from .lib_permissions import CMPPermission
  from .lib_permissions import NONE_EXECUTE
  from .signature import get_signature
label_desc: Use image node_id 5 for calling the CMPBase obj's underlying member method code with example usage: obj.init_child(parent_obj, child_path, child_obj, absolute_path) and returns: CMPFunction, CMPModule, CMPClass, None