code: def round_to_k(x, k):
      """
      round float to k significant figure
      Parameters
      ----------
      x : float
          number to round
      k : int
          the number of significant figures
  
      Returns
      -------
      float or int
  
      """
      x = float(x)
      new_x = float(
          "%s" % float(f"%.{k}g" % x)
      )  # Rounding to k important figures
      if new_x % 1 == 0:
          return int(
              new_x
          )  # Avoid the '.0' that can mislead the user that it may be a round number
      else:
          return new_x
  
imports: import pandas
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: round_to_k(x, k) and returns: int, new_x