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
778292
def remote_set(self, url, name='origin'):
        

        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)
198016
def fetch(self, url):
        
        url = self._get_url(url)
        so, se = self.run_git_command('ls-remote -h %s' % url)
        refs = []
        for line in (x for x in so.splitlines()):
            sha, ref = line.split('\t')
            refs.append(ref)
        refs = ' '.join(('+%s:%s' % (r, r) for r in refs))
        cmd = '''fetch %s -- %s''' % (url, refs)
        self.run_git_command(cmd)
596488
def add_remote_repository( url, username = nil, password = nil )
      if username
        @resolver.addRemoteRepositoryByUrl( url, username, password )
      else
        @resolver.addRemoteRepositoryByUrl( url )
      end
    end
269765
def remote=(urls)
      case urls
      when nil then @remote = nil
      when RepositoryArray then @remote = urls
      when Array then @remote = RepositoryArray.new(urls.dup)
      else @remote =  RepositoryArray.new([urls])
      end
    end
717215
def set_url(self, url):
        """"""
        self.url = url
        self.host, self.path = urllib.parse.urlparse(url)[1:3]
18
public void setUrl(final String url) {
		MenuItemModel model = getOrCreateComponentModel();
		model.url = url;
		model.action = null;
	}
1271899
def addUrlScheme(self, url):
        '''
        
        '''

        #@TODO: validate invalid url format according to http://oembed.com/
        if not isinstance(url, str):
            raise TypeError('url must be a string value')

        if not url in self._urlSchemes:
            self._urlSchemes[url] = OEmbedUrlScheme(url)
20936
public void addNameUrl(final String name, final String url) 
	throws IOException {
		doPostMethod(ResourceFileLocationDBServlet.ADD_OPERATION, name, url);
	}
947377
def set_item(self, key, url):
        
        if self._db.search(self._urls.key == key):
            self._db.update({'url': url}, self._urls.key == key)
        else:
            self._db.insert({'key': key, 'url': url})
826609
def with_name(self, name):
        
        # N.B. DOES cleanup query/fragment
        if not isinstance(name, str):
            raise TypeError("Invalid name type")
        if "/" in name:
            raise ValueError("Slash in name is not allowed")
        name = self._PATH_QUOTER(name)
        if name in (".", ".."):
            raise ValueError(". and .. values are forbidden")
        parts = list(self.raw_parts)
        if self.is_absolute():
            if len(parts) == 1:
                parts.append(name)
            else:
                parts[-1] = name
            parts[0] = ""  # replace leading '/'
        else:
            parts[-1] = name
            if parts[0] == "/":
                parts[0] = ""  # replace leading '/'
        return URL(
            self._val._replace(path="/".join(parts), query="", fragment=""),
            encoded=True,
        )
1116184
def curl_remote_name(cls, file_url):
        
        tar_gz_file_name = file_url.split('/')[-1]

        if sys.version_info >= (3, 2):
            from urllib.request import urlopen
            from urllib.error import HTTPError
        else:
            from urllib2 import urlopen
            from urllib2 import HTTPError

        response = None
        try:
            response = urlopen(file_url)
        except HTTPError as e:
            message = 'Download failed: URL: {0}, reason: {1}'.format(
                      file_url, e)
            if 'HTTP Error 404' in str(e):
                raise RemoteFileNotFoundError(message)
            else:
                raise InstallError(message)

        tar_gz_file_obj = io.BytesIO(response.read())
        with open(tar_gz_file_name, 'wb') as f_out:
            f_out.write(tar_gz_file_obj.read())
        return tar_gz_file_name
577264
def set_search_url(self, url):
        

        if url[0] == '?':
            url = url[1:]

        self.arguments = {}
        for key, value in parse_qs(url).items():
            self.arguments.update({key: unquote(value[0])})
903056
public void addRemoteRepositoryByUrl(String url, String username, String password) throws URLException {
        RemoteRepository remoteRepo;
        try {
            remoteRepo = RepoBuilder.remoteRepositoryFromUrl(url);
        } catch (MalformedURLException e) {
            throw new URLException(e);
        }
        remoteRepo = remoteRepo.setAuthentication(new Authentication(username, password));
        addRemoteRepository(remoteRepo);
    }
183986
public function add($name, $url, $options = array())
    {
        $subcmd = new AddSubCommand();
        $subcmd->prepare($name, $url, $options);

        return $this->remote($subcmd);
    }
1127203
public static String addParameter(final String url, final String name, final String value) {
        if (url != null) {
            final StringBuilder sb = new StringBuilder();
            sb.append(url);
            if (name != null) {
                if (url.indexOf("?") >= 0) {
                    sb.append("&");
                } else {
                    sb.append("?");
                }
                sb.append(name);
                sb.append("=");
                if (value != null) {
                    sb.append(urlEncode(value));
                }
            }
            return sb.toString();
        }
        return null;
    }
635911
def add_one(self, url: str,
                url_properties: Optional[URLProperties]=None,
                url_data: Optional[URLData]=None):
        '''
        '''
        self.add_many([AddURLInfo(url, url_properties, url_data)])
1007939
public void setURL(String url) {
		try {
			this.value = (url != null) ? new URL(url) : null;
		} catch (Throwable exception) {
			this.value = null;
		}
		this.type = AttributeType.URL;
		this.assigned = this.value != null;
	}