<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove_query_param(self, key, value=None):
 """ Remove a query param from a URL Set the value parameter if removing from a list. :param string key: The key to delete :param string value: The value of the param to delete (of more than one) """

        parse_result = self.query_params()
        if value is not None:
            index = parse_result[key].index(value)
            del parse_result[key][index]
        else:
            del parse_result[key]
        return URL._mutate(self, query=unicode_urlencode(parse_result, doseq=True))