code: def parse_request():
      
      find = None
      if request.endpoint is not None:
          find = PATTERN_ENDPOINT.findall(request.endpoint)
      if not find:
          raise ValueError("invalid endpoint %s" % request.endpoint)
      __, resource, action_name = find[0]
      if action_name:
          action = request.method.lower() + "_" + action_name
      else:
          action = request.method.lower()
      return resource, action
docs: Parse request endpoint and return (resource, action)