def remove_factor(self, user_id, device_id):
self.clean_error()<EOL>try:<EOL><INDENT>url = self.get_url(Constants.DELETE_FACTOR_URL, user_id, device_id)<EOL>response = self.execute_call('<STR_LIT>', url)<EOL>if response.status_code == <NUM_LIT:200>:<EOL><INDENT>return True<EOL><DEDENT>else:<EOL><INDENT>self.error = str(response.status_code)<EOL>self.error_description = self.extract_error_message_from_response(response)<EOL>return False<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>self.error = <NUM_LIT><EOL>self.error_description = e.args[<NUM_LIT:0>]<EOL><DEDENT>return False<EOL>
Remove an enrolled factor from a user.

:param user_id: Set to the id of the user.
:type user_id: integer

:param device_id: The device_id of the MFA device.
:type device_id: integer

:return: true if action succeed
:rtype: bool

See https://developers.onelogin.com/api-docs/1/multi-factor-authentication/remove-factor Remove a Factor documentation