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