<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, name, cloud=None, api_key=None, version=None, **kwargs):
 """ If you'd like to change the name you use to access a given collection, you can call the rename endpoint. This is especially useful if the name you use for your model is not available for registration. Inputs: name - String: The new name used to access your model. api_key (optional) - String: Your API key, required only if the key has not been declared elsewhere. This allows the API to recognize a request as yours and automatically route it to the appropriate destination. cloud (optional) - String: Your private cloud domain, required only if the key has not been declared elsewhere. This allows the API to recognize a request as yours and automatically route it to the appropriate destination. """

        kwargs['name'] = name
        url_params = {"batch": False, "api_key": api_key, "version": version, "method": "rename"}
        result = self._api_handler(None, cloud=cloud, api="custom", url_params=url_params, **kwargs)
        self.keywords['collection'] = name
        return result