Prunes URLs that should be ignored.
483485
def prune_urls(url_set, start_url, allowed_list, ignored_list):
    """"""
    result = set()

    for url in url_set:
        allowed = False
        for allow_url in allowed_list:
            if url.startswith(allow_url):
                allowed = True
                break

        if not allowed:
            continue

        ignored = False
        for ignore_url in ignored_list:
            if url.startswith(ignore_url):
                ignored = True
                break

        if ignored:
            continue

        prefix, suffix = (url.rsplit('.', 1) + [''])[:2]
        if suffix.lower() in IGNORE_SUFFIXES:
            continue

        result.add(url)

    return result
1295891
function removeUrlPath (uri) {
  var parsed = url.parse(uri);
  if (parsed.host) {
    delete parsed.pathname;
  }
  return url.format(parsed);
}
623756
function stripTrailingSlash(url) {
        var arr = url.split('/');
        if (arr[arr.length - 1] === '') {
            arr.pop();
        }
        return arr.join('/');
    }
1292535
function skip() {
    rimraf(file, function() {})
    delete f.versions[v]
    if (f._attachments)
      delete f._attachments[file]
    need.splice(need.indexOf(v), 1)
    maybeDone(null)
  }
784724
private List<String> pruneSuggestions(final List<String> suggestions) {
      List<String> prunedSuggestions = new ArrayList<>(suggestions.size());
      for (final String suggestion : suggestions) {
        if (suggestion.indexOf(' ') == -1) {
          prunedSuggestions.add(suggestion);
        } else {
          String[] complexSug = suggestion.split(" ");
          if (!bannedSuffixes.contains(complexSug[1])) {
            prunedSuggestions.add(suggestion);
          }
        }
      }
      return prunedSuggestions;
    }
465298
def strip_trailing_slashes(self, path):
        """"""
        m = re.match(r"(.*)/+$", path)
        if (m is None):
            return(path)
        return(m.group(1))
276027
def url_unsplit (parts):
    """"""
    if parts[2] == default_ports.get(parts[0]):
        return "%s://%s%s" % (parts[0], parts[1], parts[3])
    return "%s://%s:%d%s" % parts
614183
def _delete(self, url):
        """"""
        r = requests.delete(self._api_prefix + url,
            headers=self.headers,
            auth=self.auth,
            allow_redirects=False,
        )
        return self._action(r)
182661
def _cleanup(path: str) -> None:
    """"""
    if os.path.isdir(path):
        shutil.rmtree(path)
895590
def filter_matching(self, urls):
        
        for url in urls:
            if urlparse(url).hostname in self:
                yield url
438150
function cleanup(html) {
      html = cheerio.load(html);
      html('[' + ignoreAttr + ']').removeAttr(ignoreAttr);
      html = html.html();
      return html;
    }
446452
def unwrap(url):
    """"""
    url = str(url).strip()
    if url[:1] == '<' and url[-1:] == '>':
        url = url[1:-1].strip()
    if url[:4] == 'URL:': url = url[4:].strip()
    return url
1034938
function (url) {
            var tmp = url.replace(/\burl\s*/gi, "");    // removing url word
            tmp = tmp.charAt(0) === "(" ? tmp.substring(1, tmp.length - 1) : tmp; // removing brackets
            tmp = tmp.charAt(0) === "\'" || tmp.charAt(0) === "\"" ? tmp.substring(1, tmp.length - 1) : tmp; // removing quotes
            return tmp;
        }
1303605
def _cleanup(self, domains):
        """"""
        for option in domains.values():
            try:
                os.remove(option['pot'])
            except (IOError, OSError):
                # It is not a problem if we can't actually remove the temporary file
                pass
69945
def normalize_urls(urls):
    """"""
    _urls = []
    if isinstance(urls, list):
        if urls:
            if isinstance(urls[0], list):
                # multiple connections (list of the lists)
                _urls = urls
            elif isinstance(urls[0], str):
                # single connections (make it list of the lists)
                _urls = [urls]
        else:
            raise RuntimeError("No target host url provided.")
    elif isinstance(urls, str):
        _urls = [[urls]]
    return _urls
701892
public function cleanParams()
    {
        $_GET    = array();
        $_POST   = array();
        $_FILES  = array();
        $_COOKIE = array();

        foreach ($this->getRequestHeader() as $key) {
            if (array_key_exists($key, $_SERVER)) {
                unset($_SERVER[$key]);
            }
        }
    }
517089
function cleanCssUrlQuotes(url) {
        //Make sure we are not ending in whitespace.
        //Not very confident of the css regexps above that there will not be ending
        //whitespace.
        url = url.replace(/\s+$/, "");

        if (url.charAt(0) === "'" || url.charAt(0) === "\"") {
            url = url.substring(1, url.length - 1);
        }

        return url;
    }