def multi_index_to_frame(index):
    """
    Replicates MultiIndex.to_frame, which was introduced in pandas 0.21,
    for the sake of backwards compatibility.
    """
    return pandas.DataFrame(index.tolist(), index=index, columns=index.names)
Replicates MultiIndex.to_frame, which was introduced in pandas 0.21,
    for the sake of backwards compatibility.