code: def set_authentication_predicate(predicate, params=()):
      
  
      def wrapper(rpc_method):
  
          if hasattr(rpc_method, 'modernrpc_auth_predicates'):
              rpc_method.modernrpc_auth_predicates.append(predicate)
              rpc_method.modernrpc_auth_predicates_params.append(params)
  
          else:
              rpc_method.modernrpc_auth_predicates = [predicate]
              rpc_method.modernrpc_auth_predicates_params = [params]
  
          return rpc_method
  
      return wrapper
docs: Assign a new authentication predicate to an RPC method.
      This is the most generic decorator used to implement authentication.
      Predicate is a standard function with the following signature:
  
      .. code:: python
  
         def my_predicate(request, *params):
             # Inspect request and extract required information
  
             if <condition>:
                 # The condition to execute the method are met
                 return True
             return False
  
      :param predicate:
      :param params:
      :return: