def METHOD_NAME(oclass, obj, name):
    classdict = oclass.__dict__
    if isinstance(obj, FunctionType):
        if not isinstance(classdict[name], StaticMethodType):
            return False
    else:
        if not  isinstance(obj, MethodType):
            return False
        if obj.im_self is not None:
            if (not isinstance(classdict[name], ClassMethodType) or
                obj.im_self is not oclass):
                return False
        else:
            if not isinstance(classdict[name], FunctionType):
                return False
    objname = obj.__name__
    if objname.startswith("__") and not objname.endswith("__"):
        objname = "_%s%s" % (obj.im_class.__name__, objname)
    return objname == name