def get_metaclass(class_or_instance):
if isinstance(class_or_instance, Class):<EOL><INDENT>return class_or_instance.__metaclass__<EOL><DEDENT>elif issubclass(class_or_instance, Class):<EOL><INDENT>return class_or_instance.__metaclass__<EOL><DEDENT>raise MetaException("<STR_LIT>")<EOL>
Get the metaclass for a *class_or_instance*.