<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_leads_list(self, leads_list_id, name, team_id=None):
 """ Update a leads list. :param name: Name of the list to update. Must be defined. :param team_id: The id of the list to share this list with. :return: 204 Response. """

        params = self.base_params

        payload = {'name': name}
        if team_id:
            payload['team_id'] = team_id

        endpoint = self.base_endpoint.format('leads_lists/' + str(leads_list_id))

        return self._query_hunter(endpoint, params, 'put', payload)