code: def check_detector(detector):
      """Checks if fit and decision_function methods exist for given detector
  
      Parameters
      ----------
      detector : pyod.models
          Detector instance for which the check is performed.
  
      """
  
      if not hasattr(detector, "fit") or not hasattr(
          detector, "decision_function"
      ):
          raise AttributeError(
              "%s is not a detector instance." % (detector)
          )
  
imports: from __future__ import division
  from __future__ import print_function
  import numbers
  import numpy
  import sklearn
  from numpy import percentile
  from sklearn.metrics import precision_score
  from sklearn.preprocessing import StandardScaler
  from sklearn.utils import check_array
  from sklearn.utils import check_consistent_length
  from sklearn.utils import check_random_state
  from sklearn.utils import column_or_1d
  from sklearn.utils.random import sample_without_replacement
label_desc: Use image node_id 2 for calling a global function with example usage: check_detector(detector) without return types