code: def _df_with_names(data, index_name, columns_name):
      if type(data) == pd.DataFrame:
          # we want our index to be numbered
          df = pd.DataFrame(data.values)
      else:
          df = pd.DataFrame(data)
      df.index.name = index_name
      df.columns.name = columns_name
      return df
  
imports: import json
  import logging
  import numpy
  import pandas
  from collections import namedtuple
  from joblib import Parallel, delayed, cpu_count
  from scipy.stats import entropy
  from scipy.spatial.distance import pdist, squareform
  from sklearn.manifold import MDS, TSNE
  from pyLDAvis.utils import NumPyEncoder
label_desc: Use image node_id 9 for calling a global function with example usage: _df_with_names(data, index_name, columns_name) and returns: df