code: def check_params(lpar, rpar):
      """Check parameter overlap
  
      Routine for checking two sets of parameter collections.
      :func:`check_params` iterate over items and expand nested parameter
      collections and test for equivalence of :class:`int`, :class:`float`,
      :class:`str` and :class:`bool` parameters.
  
      .. versionadded:: 0.2.0
  
      .. versionchanged:: 0.2.2
          Changed into a warning to prevent overly aggressive fails.
  
      .. versionchanged:: 0.2.2
          None parameter values are not checked. Errors during checks are ignored.
  
      Parameters
      ----------
      lpar : int, float, str, bool, iterable, estimator
          Default comparison set.
  
      rpar : int, float, str, bool, iterable, estimator
          Comparison set of fitted model.
  
      Returns
      -------
      pass : bool
          True if the two collections have equivalent parameter values, False
          otherwise.
      """
      # Expand estimator parameters
      if hasattr(lpar, "get_params"):
          return check_params(
              lpar.get_params(deep=True), rpar.get_params(deep=True)
          )
  
      # Flatten dicts (also OrderedDicts)
      if isinstance(lpar, dict):
          par1, par2 = list(), list()
          for par in lpar:
              par1.append(lpar[par])
              par2.append(rpar[par])
          lpar, rpar = par1, par2
  
      # Iterate over flattened parameter collection
      if isinstance(lpar, (list, set, tuple)):
          for p1, p2 in zip(lpar, rpar):
              check_params(p1, p2)
  
      # --- param check ---
      _pass = True
  
      if lpar is None or rpar is None:
          # None parameters are liable to be overwritten - ignore
          return _pass
  
      try:
          if isinstance(lpar, (str, bool)):
              _pass = lpar == rpar
  
          if isinstance(lpar, (int, float)):
              if np.isnan(lpar):
                  _pass = np.isnan(rpar)
              elif np.isinf(lpar):
                  _pass = np.isinf(rpar)
              else:
                  _pass = lpar == rpar
      except Exception:
          # avoid failing a model because we can't make the check we want
          pass
  
      if not _pass:
          warnings.warn(
              "Parameter value (%r) has changed since model was fitted (%r)."
              % (lpar, rpar),
              ParameterChangeWarning,
          )
  
      return _pass
  
file_path: mlens/mlens/parallel/_base_functions.py
imports: from __future__ import division
  import os
  import warnings
  from scipy.sparse import issparse
  import numpy
  from ..utils import pickle_load, pickle_save, load
  from ..utils.exceptions import MetricWarning, ParameterChangeWarning
label_desc: Use image node_id 12 for calling a global function with example usage: check_params(lpar, rpar) and returns: _pass, check_params, _pass