code: def display_colored_df(df: pd.DataFrame):
      """
      Utility function to display dataframe as a heatmap
  
      Args:
          df: Input dataframe
      """
  
      def display_df_as_img(df):
          temp_file_name = "./temp.png"
          dataframe_image.export(
              df, temp_file_name, fontsize=4, dpi=800
          )
  
          with open(temp_file_name, "rb") as file:
              display(Image(file.read()))
  
          os.remove(temp_file_name)
  
      if (
          not isinstance(df.columns, pd.MultiIndex)
          or len(df.columns.names) != 1
      ):
          display_df_as_img(df.style.background_gradient(axis=None))
      else:
          df = df.copy()
          df.columns = df.columns.levels[0]
          display_df_as_img(df.style.background_gradient(axis=None))
  
imports: import json
  import multiprocessing
  import os
  import warnings
  from collections import defaultdict
  from time import time
  from typing import List, Tuple
  import dataframe_image
  import networkx
  import numpy
  import pandas
  from IPython.core.display import display
  from IPython.display import Image
  from sklearn import metrics
  from sklearn.model_selection import KFold
  from causalnex.evaluation import roc_auc
  from causalnex.inference import InferenceEngine
  from causalnex.network import BayesianNetwork
  from causalnex.plots import plot_structure
  from causalnex.structure import StructureModel
label_desc: Use image node_id 3 for calling a global function with example usage: display_colored_df(df) without return types