code: def check_cutoff(protected, cutoff, verbose):
      if isinstance(cutoff, dict):
          for value in cutoff.values():
              if not isinstance(value, float):
                  raise ParameterCheckError(
                      "cutoff values must be floats"
                  )
              else:
                  for value in cutoff.values():
                      if not 0 < value < 1:
                          raise ParameterCheckError(
                              "cutoff values should be in [0, 1] range"
                          )
  
          # changing to sets
          cutoff_set = set(cutoff.keys())
          protected_set = set(protected)
  
          # all cutoff keys are in protected
          if cutoff_set | protected_set != protected_set:
              raise ParameterCheckError(
                  "cutoff dict contains keys not present in protected"
              )
  
          # if some keys are in protected but not in cutoff, add them to cutoff with default value
          if protected_set - cutoff_set != set():
              helper.verbose_cat(
                  "Adding default (0.5) cutoffs for subgroups not provided in cutoff keys",
                  verbose,
              )
              for subgroup in protected_set - cutoff_set:
                  cutoff[subgroup] = 0.5
  
      elif isinstance(cutoff, float):
          if not 0 < cutoff < 1:
              raise ParameterCheckError(
                  "if cutoff is a float it should be in [0, 1] range"
              )
          helper.verbose_cat("Converting cutoff to dict", verbose)
          subgroups = np.unique(protected)
          value = cutoff
          cutoff = {}
          for subgroup in subgroups:
              cutoff[subgroup] = value
  
      else:
          raise ParameterCheckError(
              f"cutoff must be a float or a dict, not {type(cutoff)}"
          )
  
      return cutoff
  
imports: import numpy
  from .._basics.exceptions import ParameterCheckError
  from ..._explainer import helper
label_desc: Use image node_id 1 for calling a global function with example usage: check_cutoff(protected, cutoff, verbose) and returns: cutoff