def public(cls_or_method):
    """Marks class or method as public. Only public methods may be accessed through RPC."""
    if not isinstance(cls_or_method, object) and not callable(cls_or_method):
        raise ValueError('public decorator may only be used on classes or methods.')
    setattr(cls_or_method, '__rpc_public__', True)
    return cls_or_method