def METHOD_NAME(
    x: AnyArray | None,
    items: Sequence[Label] | Index,
    major_axis: Sequence[Label] | Index,
    minor_axis: Sequence[Label] | Index,
    swap: bool = False,
) -> DataFrame:
    """
    Construct a multiindex DataFrame using Panel-like arguments
    Parameters
    ----------
    x : ndarray
        3-d array with size nite, nmajor, nminor
    items : list-like
        List like object with item labels
    major_axis : list-like
        List like object with major_axis labels
    minor_axis : list-like
        List like object with minor_axis labels
    swap : bool
        Swap is major and minor axes
    Notes
    -----
    This function is equivalent to
    Panel(x, items, major_axis, minor_axis).to_frame()
    if `swap` is True, it is equivalent to
    Panel(x, items, major_axis, minor_axis).swapaxes(1,2).to_frame()
    """
    nmajor = np.arange(len(major_axis))
    nminor = np.arange(len(minor_axis))
    final_levels = [major_axis, minor_axis]
    mi = MultiIndex.from_product([nmajor, nminor])
    if x is not None:
        shape = x.shape
        x = x.reshape((shape[0], shape[1] * shape[2])).T
    df = DataFrame(x, columns=Index(items), index=mi)
    if swap:
        df.index = mi.swaplevel()
        df.sort_index(inplace=True)
        final_levels = [minor_axis, major_axis]
    mi_index = cast(MultiIndex, df.index)
    df.index = mi_index.set_levels(levels=final_levels, level=[0, 1])
    df.index.names = ["major", "minor"]
    return df