<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rename(self, container, name):
 """ Rename a container. Similar to the ``docker rename`` command. Args: container (str):
 ID of the container to rename name (str):
 New name for the container Raises: :py:class:`docker.errors.APIError` If the server returns an error. """

        url = self._url("/containers/{0}/rename", container)
        params = {'name': name}
        res = self._post(url, params=params)
        self._raise_for_status(res)