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