code: def check_type(type):
      if isinstance(type, tuple):
          type = type[0]
  
      if not isinstance(type, (str,)):
          raise TypeError("type must be a string")
  
      if type not in ["variable_importance", "ratio", "difference"]:
          raise ValueError(
              "type must be 'variable_importance'/'ratio'/'difference'"
          )
  
      return type
  
file_path: DALEX/python/dalex/dalex/model_explanations/_variable_importance/checks.py
imports: from warnings import warn
  from .._model_performance.utils import *
  from .._variable_importance.loss_functions import *
label_desc: Use image node_id 6 for calling a global function with example usage: check_type(type) and returns: type