<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def submit_form(self, form, submit=None, **kwargs):
 """Submit a form. :param Form form: Filled-out form object :param Submit submit: Optional `Submit` to click, if form includes multiple submits :param kwargs: Keyword arguments to `Session::send` """

        # Get HTTP verb
        method = form.method.upper()

        # Send request
        url = self._build_url(form.action) or self.url
        payload = form.serialize(submit=submit)
        serialized = payload.to_requests(method)
        send_args = self._build_send_args(**kwargs)
        send_args.update(serialized)
        response = self.session.request(method, url, **send_args)

        # Update history
        self._update_state(response)