def clone_module(
    origin_module: ModuleType,
    new_globals: dict[str, Any],
    fallback: Callable[[Any], Any] | None = None,
    include_builtin_function_type: bool = False,
) -> None:
    """Copy attributes from one module to another, excluding submodules

    Function types are wrapped with a decorator to report API calls. All
    other values are copied as-is.

    Parameters
    ----------
    origin_module : ModuleTpe
        Existing module to clone attributes from

    new_globals : dict
        A globals() dict for the new module to clone into

    fallback :Callable[[Any], Any] | None
        A function that will be applied to each argument before calling into
        the original module, to handle unimplemented functions. The function
        will be called recursively on list/tuple/dict containers, and should
        convert objects of custom types into objects that the corresponding API
        on the original module can handle. Anything else should be passed
        through unchanged.

    include_builtin_function_type: bool
        Whether to wrap the "builtin" (C-extension) functions declared in the
        wrapped module

    Returns
    -------
    None

    """
    mod_name = origin_module.__name__

    missing = filter_namespace(
        origin_module.__dict__,
        omit_names=set(new_globals).union(MOD_INTERNAL),
        omit_types=(ModuleType,),
    )

    reporting = settings.report_coverage()

    from .._ufunc.ufunc import ufunc as lgufunc

    for attr, value in new_globals.items():
        # Only need to wrap things that are in the origin module to begin with
        if attr not in origin_module.__dict__:
            continue
        if should_wrap(value) or (
            include_builtin_function_type
            and isinstance(value, BuiltinFunctionType)
        ):
            wrapped = implemented(
                cast(AnyCallable, value), mod_name, attr, reporting=reporting
            )
            new_globals[attr] = wrapped
            if isinstance(value, lgufunc):
                for method in UFUNC_METHODS:
                    wrapped_method = (
                        implemented(
                            getattr(value, method),
                            f"{mod_name}.{attr}",
                            method,
                            reporting=reporting,
                        )
                        if hasattr(value, method)
                        else unimplemented(
                            getattr(getattr(origin_module, attr), method),
                            f"{mod_name}.{attr}",
                            method,
                            reporting=reporting,
                            fallback=fallback,
                        )
                    )
                    setattr(wrapped, method, wrapped_method)

    from numpy import ufunc as npufunc

    for attr, value in missing.items():
        if should_wrap(value) or (
            include_builtin_function_type
            and isinstance(value, BuiltinFunctionType)
        ):
            wrapped = unimplemented(
                value,
                mod_name,
                attr,
                reporting=reporting,
                fallback=fallback,
            )
            new_globals[attr] = wrapped
            if isinstance(value, npufunc):
                for method in UFUNC_METHODS:
                    wrapped_method = unimplemented(
                        getattr(value, method),
                        f"{mod_name}.{attr}",
                        method,
                        reporting=reporting,
                        fallback=fallback,
                    )
                    setattr(wrapped, method, wrapped_method)
        else:
            new_globals[attr] = value
Copy attributes from one module to another, excluding submodules

    Function types are wrapped with a decorator to report API calls. All
    other values are copied as-is.

    Parameters
    ----------
    origin_module : ModuleTpe
        Existing module to clone attributes from

    new_globals : dict
        A globals() dict for the new module to clone into

    fallback :Callable[[Any], Any] | None
        A function that will be applied to each argument before calling into
        the original module, to handle unimplemented functions. The function
        will be called recursively on list/tuple/dict containers, and should
        convert objects of custom types into objects that the corresponding API
        on the original module can handle. Anything else should be passed
        through unchanged.

    include_builtin_function_type: bool
        Whether to wrap the "builtin" (C-extension) functions declared in the
        wrapped module

    Returns
    -------
    None

    
cupynumeric/_utils/coverage.py