code: def check_protected(protected, verbose):
      if not isinstance(protected, np.ndarray):
          # if is not numpy array check what type it is and change to np array
          if isinstance(protected, list):
              try:
                  helper.verbose_cat(
                      "protected list will be converted to np.ndarray",
                      verbose,
                  )
                  protected = np.array(protected, dtype="U")
              except:
                  ParameterCheckError(
                      "failed to convert list to np.ndarray, try converting it manually",
                      verbose,
                  )
  
          elif isinstance(protected, pd.Series):
              try:
                  helper.verbose_cat(
                      "protected Series will be converted to np.ndarray",
                      verbose,
                  )
                  protected = np.array(protected, dtype="U")
              except ParameterCheckError:
                  ParameterCheckError(
                      "failed to convert list to np.ndarray"
                  )
          else:
              ParameterCheckError(
                  "unsupported protected type provided. Please convert protected to flat np.ndarray"
              )
  
      if protected.dtype.type is not str:
          try:
              helper.verbose_cat(
                  "protected array is not string type, converting to string ",
                  verbose,
              )
              protected = protected.astype(str)
          except:
              ParameterCheckError(
                  "Could not convert protected to String type"
              )
      return protected
  
file_path: DALEX/python/dalex/dalex/fairness/_basics/checks.py
imports: import numpy
  import pandas
  from .exceptions import *
  from ..._explainer import helper
label_desc: Use image node_id 1 for calling a global function with example usage: check_protected(protected, verbose) and returns: protected