code: def check_default_columns_present_and_coerce_to_string(g: Plottable):
      """Helper to set COLLAPSE columns to nodes and edges dataframe, while converting src, dst, node to dtype(str)
      :param g: graphistry instance
  
      :returns: graphistry instance
      """
      ndf, edf, src, dst, node = unpack(g)
      if COLLAPSE_NODE not in ndf.columns:
          ndf[COLLAPSE_NODE] = DEFAULT_VAL
          ndf[node] = ndf[node].astype(str)
          logger.info(
              f"Converted ndf to type({type(ndf[node].values[0])})"
          )
          g._nodes = ndf
      if COLLAPSE_SRC not in edf.columns:
          edf[COLLAPSE_SRC] = DEFAULT_VAL
          edf[COLLAPSE_DST] = DEFAULT_VAL
          edf[src] = edf[src].astype(str)
          edf[dst] = edf[dst].astype(str)
          logger.info(
              f"Converted edf to type({type(edf[src].values[0])})"
          )
          g._edges = edf
      return g
  
imports: from typing import Union, Optional, List
  import copy, logging, pandas, numpy
  from graphistry.PlotterBase import Plottable
label_desc: Use image node_id 16 for calling a global function with example usage: check_default_columns_present_and_coerce_to_string(g) and returns: g