code: def _check_params(n_iter, dis_measure, random_state):
      """Internal function to check for and validate class parameters.
      Also, to return random state instance and the appropriate dissimilarity
      measure if valid.
      """
      if isinstance(n_iter, int):
          check_parameter(n_iter, low=1, param_name="n_iter")
      else:
          raise TypeError("n_iter should be int, got %s" % n_iter)
  
      if isinstance(dis_measure, str):
          if dis_measure not in ("aad", "var", "iqr"):
              raise ValueError(
                  "Unknown dissimilarity measure type, "
                  "dis_measure should be in "
                  "('aad', 'var', 'iqr'), "
                  "got %s" % dis_measure
              )
          # TO-DO: 'mad': Median Absolute Deviation to be added
          # once Scipy stats version 1.3.0 is released
      else:
          raise TypeError(
              "dis_measure should be str, got %s" % dis_measure
          )
  
      return check_random_state(
          random_state
      ), _aad if dis_measure == "aad" else (
          np.var
          if dis_measure == "var"
          else (stats.iqr if dis_measure == "iqr" else None)
      )
  
file_path: pyod/pyod/models/lmdd.py
imports: from __future__ import division
  from __future__ import print_function
  import numpy
  from numba import njit
  from scipy import stats
  from sklearn.utils import check_array, check_random_state
  from pyod.utils import check_parameter
  from .base import BaseDetector
label_desc: Use image node_id 2 for calling a global function with example usage: _check_params(n_iter, dis_measure, random_state) and returns: check_random_state,  unknown