code: def _update_index_on_df(df, index_names):
      
      if index_names:
          df = df.set_index(index_names)
          # Remove names from unnamed indexes
          index_names = _denormalize_index_names(index_names)
          df.index.names = index_names
      return df
docs: Helper function to restore index information after collection. Doesn't
      use self so we can serialize this.