code: def _int_ifclose(x, dec=1, width=4):
      """helper function for creating result string for int or float
  
      only dec=1 and width=4 is implemented
  
      Parameters
      ----------
      x : int or float
          value to format
      dec : 1
          number of decimals to print if x is not an integer
      width : 4
          width of string
  
      Returns
      -------
      xint : int or float
          x is converted to int if it is within 1e-14 of an integer
      x_string : str
          x formatted as string, either '%4d' or '%4.1f'
  
      """
      xint = int(round(x))
      if np.max(np.abs(xint - x)) < 1e-14:
          return xint, "%4d" % xint
      else:
          return x, "%4.1f" % x
  
file_path: statsmodels/statsmodels/stats/inter_rater.py
imports: import numpy
  from scipy import stats
label_desc: Use image node_id 1 for calling a global function with example usage: _int_ifclose(x, dec, width) and returns: xint,  unknown, x,  unknown