#!/usr/bin/env python
# -*- coding: utf-8 -*-

from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from .definitions import _NUMPY_AVAILABLE, ACCEPTED_NUMPY_DTYPES, np, numpy
    from .functional import (
        is_numpy_bool_array,
        is_numpy_integral_array,
        is_numpy_number_like,
        is_numpy_scalar_like,
        is_numpy_str_array,
        logical_and_lst,
        logical_or_lst,
        ndarray_to_tensor,
        numpy_all_eq,
        numpy_all_ne,
        numpy_complex_dtype_to_float_dtype,
        numpy_is_complex,
        numpy_is_complex_dtype,
        numpy_is_floating_point,
        numpy_item,
        numpy_to_tensor,
        numpy_topk,
        numpy_view_as_complex,
        numpy_view_as_real,
        tensor_to_ndarray,
        tensor_to_numpy,
        to_ndarray,
        to_numpy,
    )
    from .scan_info import (
        InvalidTorchDType,
        ShapeDTypeInfo,
        get_default_numpy_dtype,
        merge_numpy_dtypes,
        merge_torch_dtypes,
        numpy_dtype_to_fill_value,
        numpy_dtype_to_torch_dtype,
        scan_numpy_dtype,
        scan_shape_dtypes,
        scan_torch_dtype,
        torch_dtype_to_numpy_dtype,
    )

else:
    import lazy_loader as lazy

    __getattr__, __dir__, __all__ = lazy.attach(
        __name__,
        submodules=["definitions", "functional", "scan_info"],
        submod_attrs={
            "definitions": ["_NUMPY_AVAILABLE", "ACCEPTED_NUMPY_DTYPES", "np", "numpy"],
            "functional": [
                "is_numpy_bool_array",
                "is_numpy_integral_array",
                "is_numpy_number_like",
                "is_numpy_scalar_like",
                "is_numpy_str_array",
                "logical_and_lst",
                "logical_or_lst",
                "ndarray_to_tensor",
                "numpy_all_eq",
                "numpy_all_ne",
                "numpy_complex_dtype_to_float_dtype",
                "numpy_is_complex",
                "numpy_is_complex_dtype",
                "numpy_is_floating_point",
                "numpy_item",
                "numpy_to_tensor",
                "numpy_topk",
                "numpy_view_as_complex",
                "numpy_view_as_real",
                "tensor_to_ndarray",
                "tensor_to_numpy",
                "to_ndarray",
                "to_numpy",
            ],
            "scan_info": [
                "InvalidTorchDType",
                "ShapeDTypeInfo",
                "get_default_numpy_dtype",
                "merge_numpy_dtypes",
                "merge_torch_dtypes",
                "numpy_dtype_to_fill_value",
                "numpy_dtype_to_torch_dtype",
                "scan_numpy_dtype",
                "scan_shape_dtypes",
                "scan_torch_dtype",
                "torch_dtype_to_numpy_dtype",
            ],
        },
    )


del TYPE_CHECKING
