def typechecked(memb):
    """Decorator applicable to functions, methods, properties,
    classes or modules (by explicit call).
    If applied on a module, memb must be a module or a module name contained in sys.modules.
    See pytypes.set_global_typechecked_decorator to apply this on all modules.
    Asserts compatibility of runtime argument and return values of all targeted functions
    and methods w.r.t. PEP 484-style type annotations of these functions and methods.
    """
    if not pytypes.checking_enabled:
        return memb
    if is_no_type_check(memb):
        return memb
    if type_util._check_as_func(memb):
        return typechecked_func(memb)
    if isclass(memb):
        return typechecked_class(memb)
    if ismodule(memb):
        return typechecked_module(memb, True)
    if memb in sys.modules or memb in _pending_modules:
        return typechecked_module(memb, True)
    return memb