<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remote_set(self, url, name='origin'):
 """Set remote with name and URL like git remote add. :param url: defines the remote URL :type url: str :param name: defines the remote name. :type name: str """


        url = self.chomp_protocol(url)

        if self.remote_get(name):
            self.run(['remote', 'rm', 'name'])

        self.run(['remote', 'add', name, url])
        return self.remote_get(remote=name)