# Path: taipan/_compat.py
# IS_PY26 = sys.version_info[:2] == (2, 6)
# IS_PY3 = sys.version_info[0] == 3
# class MetaclassDecorator(object):
#     def __init__(self, meta):
#     def __call__(self, cls):
# 
# Path: taipan/objective/classes.py
# def ensure_class(arg):
# def is_direct_subclass(class_, of):
# def ensure_direct_subclass(class_, of):
# def is_indirect_subclass(class_, of):
# def ensure_indirect_subclass(class_, of):
# def iter_subclasses(class_):
#     def descend(class_):
# def iter_superclasses(class_):
#     def ascend(class_):
# def is_metaclass(obj):
# def ensure_metaclass(arg):
# 
# Path: taipan/objective/methods.py
# def is_method(arg):
#     """Checks whether given object is a method."""
#     if inspect.ismethod(arg):
#         return True
#     if isinstance(arg, NonInstanceMethod):
#         return True
# 
#     # Unfortunately, there is no disctinction between instance methods
#     # that are yet to become part of a class, and regular functions.
#     # We attempt to evade this little gray zone by relying on extremely strong
#     # convention (which is nevertheless _not_ enforced by the intepreter)
#     # that first argument of an instance method must be always named ``self``.
#     if inspect.isfunction(arg):
#         return _get_first_arg_name(arg) == 'self'
# 
#     return False


import abc
import functools
import inspect
import sys
from taipan._compat import ifilter, xrange
from taipan.objective.classes import is_class, metaclass
from taipan.objective.methods import is_method
        from taipan.objective.modifiers import _WrappedMethod
        from taipan.objective.modifiers import _OverriddenMethod
        if not base:
            return None
        if is_class(base):
            return base

        # resolve the (possibly qualified) class name
        if '.' in base:
            # repeatedly try to import the first N-1, N-2, etc. dot-separated
            # parts of the qualified name; this way we can handle all names
            # including `package.module.Class.InnerClass`
            dot_parts = base.split('.')
            for i in xrange(len(dot_parts) - 1, 1, -1):  # n-1 -> 1
                module_name = '.'.join(dot_parts[:i])
                class_name = '.'.join(dot_parts[i:])
                try:
                    module = __import__(module_name, fromlist=[dot_parts[i]])
                    break
                except ImportError:
                    pass
            else:
                # couldn't resolve class name, return it verbatim
                return base
        else:
            class_name = base
            module_name = override_wrapper.method.__module__
            module = sys.modules[module_name]

        return getattr(module, class_name)



# Path: taipan/_compat.py
# IS_PY26 = sys.version_info[:2] == (2, 6)
# IS_PY3 = sys.version_info[0] == 3
# class MetaclassDecorator(object):
#     def __init__(self, meta):
#     def __call__(self, cls):
# 
# Path: taipan/objective/classes.py
# def ensure_class(arg):
# def is_direct_subclass(class_, of):
# def ensure_direct_subclass(class_, of):
# def is_indirect_subclass(class_, of):
# def ensure_indirect_subclass(class_, of):
# def iter_subclasses(class_):
#     def descend(class_):
# def iter_superclasses(class_):
#     def ascend(class_):
# def is_metaclass(obj):
# def ensure_metaclass(arg):
# 
# Path: taipan/objective/methods.py
# def is_method(arg):
#     """Checks whether given object is a method."""
#     if inspect.ismethod(arg):
#         return True
#     if isinstance(arg, NonInstanceMethod):
#         return True
# 
#     # Unfortunately, there is no disctinction between instance methods
#     # that are yet to become part of a class, and regular functions.
#     # We attempt to evade this little gray zone by relying on extremely strong
#     # convention (which is nevertheless _not_ enforced by the intepreter)
#     # that first argument of an instance method must be always named ``self``.
#     if inspect.isfunction(arg):
#         return _get_first_arg_name(arg) == 'self'
# 
#     return False


# Path: taipan/objective/base.py
import abc
import functools
import inspect
import sys
from taipan._compat import ifilter, xrange
from taipan.objective.classes import is_class, metaclass
from taipan.objective.methods import is_method
        from taipan.objective.modifiers import _WrappedMethod
        from taipan.objective.modifiers import _OverriddenMethod

        if not base:
            return None
        if is_class(base):
            return base

        # resolve the (possibly qualified) class name
        if '.' in base:
            # repeatedly try to import the first N-1, N-2, etc. dot-separated
            # parts of the qualified name; this way we can handle all names
            # including `package.module.Class.InnerClass`
            dot_parts = base.split('.')
            for i in xrange(len(dot_parts) - 1, 1, -1):  # n-1 -> 1
                module_name = '.'.join(dot_parts[:i])
                class_name = '.'.join(dot_parts[i:])
                try:
                    module = __import__(module_name, fromlist=[dot_parts[i]])
                    break
                except ImportError:
                    pass
            else:
                # couldn't resolve class name, return it verbatim
                return base
        else:
            class_name = base
            module_name = override_wrapper.method.__module__
            module = sys.modules[module_name]

        return getattr(module, class_name)



@metaclass(ObjectMetaclass)