code: def format_sig_figs(value, default=None):
      """Get a default number of significant figures.
  
      Gives the integer part or `default`, whichever is bigger.
  
      Examples
      --------
      0.1234 --> 0.12
      1.234  --> 1.2
      12.34  --> 12
      123.4  --> 123
      """
      if default is None:
          default = 2
      if value == 0:
          return 1
      return max(int(np.log10(np.abs(value))) + 1, default)
  
imports: import importlib
  import warnings
  from typing import Any, Dict
  import matplotlib
  import numpy
  import packaging
  from matplotlib.colors import to_hex
  from scipy.stats import mode, rankdata
  from scipy.interpolate import CubicSpline
  from ..rcparams import rcParams
  from ..stats.density_utils import kde
  from ..stats import hdi
label_desc: Use image node_id 4 for calling a global function with example usage: format_sig_figs(value, default) and returns: max, int