import numpy as np
from pandas._config import get_option as get_option
from pandas._libs import index as libindex
from pandas._typing import GeneralDuplicatesKeepStrategy
from pandas.core.arrays import Categorical as Categorical
from pandas.core.arrays.categorical import factorize_from_iterables as factorize_from_iterables
from pandas.core.dtypes.cast import coerce_indexer_dtype as coerce_indexer_dtype
from pandas.core.dtypes.common import ensure_int64 as ensure_int64, ensure_platform_int as ensure_platform_int, is_categorical_dtype as is_categorical_dtype, is_hashable as is_hashable, is_integer as is_integer, is_iterator as is_iterator, is_list_like as is_list_like, is_object_dtype as is_object_dtype, is_scalar as is_scalar, pandas_dtype as pandas_dtype
from pandas.core.dtypes.dtypes import ExtensionDtype as ExtensionDtype
from pandas.core.dtypes.generic import ABCDataFrame as ABCDataFrame
from pandas.core.dtypes.missing import array_equivalent as array_equivalent, isna as isna
from pandas.core.indexes.base import Index as Index, InvalidIndexError as InvalidIndexError, ensure_index as ensure_index
from pandas.core.indexes.frozen import FrozenList as FrozenList
from pandas.core.sorting import get_group_index as get_group_index, indexer_from_factorized as indexer_from_factorized, lexsort_indexer as lexsort_indexer
from pandas.core.util.hashing import hash_tuple as hash_tuple, hash_tuples as hash_tuples
from pandas.errors import PerformanceWarning as PerformanceWarning, UnsortedIndexError as UnsortedIndexError
from pandas.io.formats.printing import format_object_attrs as format_object_attrs, format_object_summary as format_object_summary, pprint_thing as pprint_thing
from pandas.util._decorators import Appender as Appender, cache_readonly as cache_readonly
from typing import Any, Hashable, Optional, Sequence, Union

class MultiIndexUIntEngine(libindex.BaseMultiIndexCodesEngine, libindex.UInt64Engine): ...  # type: ignore
class MultiIndexPyIntEngine(libindex.BaseMultiIndexCodesEngine, libindex.ObjectEngine): ... # type: ignore

class MultiIndex(Index):
    rename: Any = ...
    def __new__(cls: Any, levels: Any = ..., codes: Any = ..., sortorder: Any = ..., names: Any = ..., dtype: Any = ..., copy: Any = ..., name: Any = ..., verify_integrity: bool=..., _set_identity: bool=...) -> Any: ...
    @classmethod
    def from_arrays(cls, arrays: Any, sortorder: Optional[Any] = ..., names: Any = ...) -> Any: ...
    @classmethod
    def from_tuples(cls, tuples: Any, sortorder: Optional[Any] = ..., names: Optional[Any] = ...) -> Any: ...
    @classmethod
    def from_product(cls, iterables: Any, sortorder: Optional[Any] = ..., names: Any = ...) -> Any: ...
    @classmethod
    def from_frame(cls, df: Any, sortorder: Optional[Any] = ..., names: Optional[Any] = ...) -> Any: ...
    @property
    def shape(self) -> Any: ...
    @property
    def array(self) -> None: ...
    def levels(self) -> Any: ...
    def set_levels(self, levels: Any, level: Optional[Any] = ..., inplace: bool = ..., verify_integrity: bool = ...) -> Any: ...
    @property
    def codes(self) -> Any: ...
    def set_codes(self, codes: Any, level: Optional[Any] = ..., inplace: bool = ..., verify_integrity: bool = ...) -> Any: ...
    def copy(self, names: Optional[Any] = ..., dtype: Optional[Any] = ..., levels: Optional[Any] = ..., codes: Optional[Any] = ..., deep: bool = ..., _set_identity: bool = ..., **kwargs: Any) -> Any: ... # type: ignore
    def __array__(self, dtype: Any = ...) -> np.ndarray: ...
    def view(self, cls: Optional[Any] = ...) -> Any: ...
    def __contains__(self, key: Any) -> bool: ...
    def dtype(self) -> np.dtype: ...
    def memory_usage(self, deep: bool=...) -> int: ...
    def nbytes(self) -> int: ...
    def format(self, space: int = ..., sparsify: Optional[Any] = ..., adjoin: bool = ..., names: bool = ..., na_rep: Optional[Any] = ..., formatter: Optional[Any] = ...) -> Any: ...   # type: ignore
    def __len__(self) -> int: ...
    names: Any = ...
    def inferred_type(self) -> str: ...
    @property
    def values(self) -> Any: ...
    def is_monotonic_increasing(self) -> bool: ...
    def is_monotonic_decreasing(self) -> bool: ...
    def duplicated(self, keep: GeneralDuplicatesKeepStrategy = ...) -> Any: ...
    def fillna(self, value: Optional[Any] = ..., downcast: Optional[Any] = ...) -> None: ...
    def dropna(self, how: str = ...) -> Any: ...
    def get_value(self, series: Any, key: Any) -> Any: ...
    def get_level_values(self, level: Any) -> Any: ...
    def unique(self, level: Optional[Any] = ...) -> Any: ...
    def to_frame(self, index: bool = ..., name: Optional[Any] = ...) -> Any: ...
    def to_flat_index(self) -> Any: ...
    @property
    def is_all_dates(self) -> bool: ...
    def is_lexsorted(self) -> bool: ...
    def lexsort_depth(self) -> Any: ...
    def remove_unused_levels(self) -> Any: ...
    @property
    def nlevels(self) -> int: ...
    @property
    def levshape(self) -> Any: ...
    def __reduce__(self) -> Any: ...
    def __getitem__(self, key: Any) -> Any: ...
    def take(self, indices: Any, axis: int = ..., allow_fill: bool = ..., fill_value: Optional[Any] = ..., **kwargs: Any) -> Any: ...
    def append(self, other: Any) -> Any: ...
    def argsort(self, *args: Any, **kwargs: Any) -> Any: ...
    def repeat(self, repeats: Any, axis: Optional[Any] = ...) -> Any: ...
    def where(self, cond: Any, other: Optional[Any] = ...) -> None: ...
    def drop(self, codes: Any, level: Optional[Any] = ..., errors: str = ...) -> Any: ...   # type: ignore
    def swaplevel(self, i: int = ..., j: int = ...) -> Any: ...
    def reorder_levels(self, order: Any) -> Any: ...
    def sortlevel(self, level: int = ..., ascending: bool = ..., sort_remaining: bool = ...) -> Any: ...
    def get_indexer(self, target: Any, method: Optional[Any] = ..., limit: Optional[Any] = ..., tolerance: Optional[Any] = ...) -> Any: ...
    def get_indexer_non_unique(self, target: Any) -> Any: ...
    def reindex(self, target: Any, method: Optional[Any] = ..., level: Optional[Any] = ..., limit: Optional[Any] = ..., tolerance: Optional[Any] = ...) -> Any: ...
    def get_slice_bound(self, label: Union[Hashable, Sequence[Hashable]], side: str, kind: str) -> int: ...
    def slice_locs(self, start: Optional[Any] = ..., end: Optional[Any] = ..., step: Optional[Any] = ..., kind: Optional[Any] = ...) -> Any: ...
    def get_loc(self, key: Any, method: Optional[Any] = ...) -> Any: ...    # type: ignore
    def get_loc_level(self, key: Any, level: Any = ..., drop_level: bool=...) -> Any: ...
    def get_locs(self, seq: Any) -> Any: ...
    def truncate(self, before: Optional[Any] = ..., after: Optional[Any] = ...) -> Any: ...
    def equals(self, other: Any) -> bool: ...
    def equal_levels(self, other: Any) -> Any: ...
    def union(self, other: Any, sort: Optional[Any] = ...) -> Any: ...
    def intersection(self, other: Any, sort: bool = ...) -> Any: ...
    def difference(self, other: Any, sort: Optional[Any] = ...) -> Any: ...
    def astype(self, dtype: Any, copy: bool = ...) -> Any: ...
    def insert(self, loc: Any, item: Any) -> Any: ...
    def delete(self, loc: Any) -> Any: ...
    def isin(self, values: Any, level: Optional[Any] = ...) -> Any: ...

def maybe_droplevels(index: Any, key: Any) -> Any: ...
