code: def rpc_method(func=None, name=None, entry_point=ALL, protocol=ALL,
                 str_standardization=settings.MODERNRPC_PY2_STR_TYPE,
                 str_standardization_encoding=settings.MODERNRPC_PY2_STR_ENCODING):
      
  
      def decorated(_func):
  
          _func.modernrpc_enabled = True
          _func.modernrpc_name = name or _func.__name__
          _func.modernrpc_entry_point = entry_point
          _func.modernrpc_protocol = protocol
          _func.str_standardization = str_standardization
          _func.str_standardization_encoding = str_standardization_encoding
  
          return _func
  
      # If @rpc_method() is used with parenthesis (with or without argument)
      if func is None:
          return decorated
  
      # If @rpc_method is used without parenthesis
      return decorated(func)
docs: Mark a standard python function as RPC method.
  
      All arguments are optional
  
      :param func: A standard function
      :param name: Used as RPC method name instead of original function name
      :param entry_point: Default: ALL. Used to limit usage of the RPC method for a specific set of entry points
      :param protocol: Default: ALL. Used to limit usage of the RPC method for a specific protocol (JSONRPC or XMLRPC)
      :param str_standardization: Default: settings.MODERNRPC_PY2_STR_TYPE. Configure string standardization on python 2.
      Ignored on python 3.
      :param str_standardization_encoding: Default: settings.MODERNRPC_PY2_STR_ENCODING. Configure the encoding used
      to perform string standardization conversion. Ignored on python 3.
      :type name: str
      :type entry_point: str
      :type protocol: str
      :type str_standardization: type str or unicode
      :type str_standardization_encoding: str