code: def scitype(obj, force_single_scitype=True, coerce_to_list=False):
      """Determine scitype string of obj.
  
      Parameters
      ----------
      obj : class or object inheriting from sktime BaseObject
      force_single_scitype : bool, optional, default = True
          whether only a single scitype is returned
          if True, only the *first* scitype found will be returned
          order is determined by the order in BASE_CLASS_REGISTER
      coerce_to_list : bool, optional, default = False
          determines the return type: if True, returns a single str,
          if False, returns a list of str
  
      Returns
      -------
      scitype : str, or list of str of sktime scitype strings from BASE_CLASS_REGISTER
          str, sktime scitype string, if exactly one scitype can be determined for obj
          or force_single_scitype is True, and if coerce_to_list is False
          list of str, of scitype strings, if more than one scitype are determined,
          or if coerce_to_list is True
          obj has scitype if it inherits from class in same row of BASE_CLASS_REGISTER
  
      Raises
      ------
      TypeError if no scitype can be determined for obj
      """
      # if object has tag, return tag
      if hasattr(obj, "get_tag"):
          if isclass(obj):
              tag_type = obj.get_class_tag("object_type", None)
          else:
              tag_type = obj.get_tag(
                  "object_type", None, raise_error=False
              )
          if tag_type is not None:
              if not isinstance(tag_type, list):
                  tag_type = [tag_type]
              if force_single_scitype and len(tag_type) > 1:
                  tag_type = [tag_type[0]]
              if coerce_to_list:
                  return tag_type
              else:
                  return tag_type[0]
  
      # if the tag is not present, determine scitype from legacy base class logic
      if isclass(obj):
          scitypes = [
              sci[0]
              for sci in BASE_CLASS_REGISTER
              if issubclass(obj, sci[1])
          ]
      else:
          scitypes = [
              sci[0]
              for sci in BASE_CLASS_REGISTER
              if isinstance(obj, sci[1])
          ]
  
      if len(scitypes) == 0:
          raise TypeError(
              "Error, no scitype could be determined for obj"
          )
  
      if len(scitypes) > 1 and "object" in scitypes:
          scitypes = list(set(scitypes).difference(["object"]))
  
      if len(scitypes) > 1 and "estimator" in scitypes:
          scitypes = list(set(scitypes).difference(["estimator"]))
  
      if force_single_scitype:
          scitypes = [scitypes[0]]
  
      if len(scitypes) == 1 and not coerce_to_list:
          return scitypes[0]
  
      return scitypes
  
label_desc: Use image node_id 1 for calling a global function with example usage: scitype(obj, force_single_scitype, coerce_to_list) and returns: scitypes, scitypes, tag_type, tag_type