code: def check_method_type(type, types, aliases=None):
      if isinstance(type, tuple):
          ret = type[0]
      elif isinstance(type, str):
          ret = type
      else:
          raise TypeError("'type' is not a string")
  
      if ret not in types:
          if aliases:
              if ret not in aliases:
                  raise ValueError(
                      "'type' must be one of: {}".format(
                          ", ".join(types + tuple(aliases))
                      )
                  )
              else:
                  return aliases[ret]
          else:
              if ret not in types:
                  raise ValueError(
                      "'type' must be one of: {}".format(
                          ", ".join(types)
                      )
                  )
      else:
          return ret
  
imports: import numpy
  import pandas
  from copy import deepcopy
  from warnings import warn
  from .helper import verbose_cat, is_y_in_data, get_model_info
  from .yhat import get_predict_function_and_model_type
label_desc: Use image node_id 12 for calling a global function with example usage: check_method_type(type, types, aliases) and returns: ret, aliases