code: def pprint(params, offset=0, printer=repr):
      """Pretty print the dictionary 'params'
  
      Copied from sklearn.base._pprint to avoid accessing protected member of module
  
      Parameters
      ----------
      params : dict
          The dictionary to pretty print
  
      offset : int
          The offset in characters to add at the begin of each line.
  
      printer : callable
          The function to convert entries to strings, typically
          the builtin str or repr
  
      """
      # Do a multi-line justified repr:
      options = np.get_printoptions()
      np.set_printoptions(precision=5, threshold=64, edgeitems=2)
      params_list = list()
      this_line_length = offset
      line_sep = ",\n" + (1 + offset // 2) * " "
      for i, (k, v) in enumerate(sorted(six.iteritems(params))):
          if type(v) is float:
              # use str for representing floating point numbers
              # this way we get consistent representation across
              # architectures and versions.
              this_repr = "%s=%s" % (k, str(v))
          else:
              # use repr of the rest
              this_repr = "%s=%s" % (k, printer(v))
          if len(this_repr) > 500:
              this_repr = this_repr[:300] + "..." + this_repr[-100:]
          if i > 0:
              if (
                  this_line_length + len(this_repr) >= 75
                  or "\n" in this_repr
              ):
                  params_list.append(line_sep)
                  this_line_length = len(line_sep)
              else:
                  params_list.append(", ")
                  this_line_length += 2
          params_list.append(this_repr)
          this_line_length += len(this_repr)
  
      np.set_printoptions(**options)
      lines = "".join(params_list)
      # Strip trailing space to avoid nightmare in doctests
      lines = "\n".join(line.rstrip(" ") for line in lines.split("\n"))
      return lines
  
file_path: greykite/greykite/common/logging.py
imports: import logging
  import sys
  from enum import Enum
  import numpy
  import six
  from greykite.common.constants import LOGGER_NAME
label_desc: Use image node_id 1 for calling a global function with example usage: pprint(params, offset, printer) and returns: lines