code: def _reorder_by_original(association_matrix, original_df):
      """Reorder the matrix to the original order.
  
      Args:
          association_matrix (DataFrame): The square matrix of correlations/associations
          original_df (DataFrame): The original data frame
  
      Returns:
          A Pandas Data frame
      """
      # Get the original column order
      order = [
          np.where(association_matrix.columns.values == label)[0][0]
          for label in original_df.columns.values
          if label in association_matrix.columns.values
      ]
  
      reorder_matrix = pd.DataFrame(
          [row[order] for row in association_matrix.values[order]]
      )
  
      # Assign column and row labels
      reorder_matrix.columns = [
          association_matrix.columns.values[i] for i in order
      ]
      reorder_matrix.set_index(
          np.array(
              [association_matrix.columns.values[i] for i in order]
          ),
          inplace=True,
      )
  
      return reorder_matrix
  
imports: import warnings
  import pandas
  import numpy
  from scipy.cluster import hierarchy
  from sklearn.metrics import matthews_corrcoef
  from scipy.stats import chi2_contingency
  import seaborn
  import matplotlib.pyplot
  import plotly.graph_objs
  import plotly.offline
  from data_describe.config._config import get_option
  from data_describe.misc.colors import get_p_RdBl_cmap, mpl_to_plotly_cmap
  from data_describe._widget import BaseWidget
  from data_describe.compat import _is_dataframe, _in_notebook, _requires
  from data_describe.backends import _get_viz_backend, _get_compute_backend
label_desc: Use image node_id 8 for calling a global function with example usage: _reorder_by_original(association_matrix, original_df) and returns: reorder_matrix