code: def _is_metaclass(klass, seen=None):
      
      if klass.name == "type":
          return True
      if seen is None:
          seen = set()
      for base in klass.bases:
          try:
              for baseobj in base.infer():
                  baseobj_name = baseobj.qname()
                  if baseobj_name in seen:
                      continue
                  else:
                      seen.add(baseobj_name)
                  if isinstance(baseobj, bases.Instance):
                      # not abstract
                      return False
                  if baseobj is util.Uninferable:
                      continue
                  if baseobj is klass:
                      continue
                  if not isinstance(baseobj, ClassDef):
                      continue
                  if baseobj._type == "metaclass":
                      return True
                  if _is_metaclass(baseobj, seen):
                      return True
          except exceptions.InferenceError:
              continue
      return False
docs: Return if the given class can be
      used as a metaclass.