:param urlparse.ParseResult url: x
        :rtype: AzureJobStore.BlobInfo
549363
def _parseWasbUrl(cls, url):
        
        assert url.scheme in ('wasb', 'wasbs')
        try:
            container, account = url.netloc.split('@')
        except ValueError:
            raise InvalidImportExportUrlException(url)
        suffix = '.blob.core.windows.net'
        if account.endswith(suffix):
            account = account[:-len(suffix)]
        else:
            raise InvalidImportExportUrlException(url)
        assert url.path[0] == '/'
        return cls.BlobInfo(account=account, container=container, name=url.path[1:])
645657
def parse_fileshare_or_file_snapshot_parameter(url):
    # type: (str) -> Tuple[str, str]
    
    if is_not_empty(url):
        if '?sharesnapshot=' in url:
            try:
                tmp = url.split('?sharesnapshot=')
                if len(tmp) == 2:
                    dateutil.parser.parse(tmp[1])
                    return tmp[0], tmp[1]
            except (ValueError, OverflowError):
                pass
        elif '?snapshot=' in url:
            try:
                tmp = url.split('?snapshot=')
                if len(tmp) == 2:
                    dateutil.parser.parse(tmp[1])
                    return tmp[0], tmp[1]
            except (ValueError, OverflowError):
                pass
    return url, None
678240
def url(self, var, default=NOTSET):
        
        return self.get_value(var, cast=urlparse, default=default, parse_default=True)
849023
def bibcode_from_url(cls, url):
        
        try:
            code = url.split('/abs/')
            code = code[1].strip()
            return code
        except:
            return None
139838
def parseUrl(url):
    
    scheme, netloc, url, params, query, fragment = urllib.parse.urlparse(url)
    query_dict = {
        k: sorted(v) if len(v) > 1 else v[0]
        for k, v in list(urllib.parse.parse_qs(query).items())
    }
    return {
        'scheme': scheme,
        'netloc': netloc,
        'url': url,
        'params': params,
        'query': query_dict,
        'fragment': fragment,
    }
826723
def handle_url(url, session, res):
    """"""
    print("Parsing", url, file=sys.stderr)
    try:
        data = getPageContent(url, session)
    except IOError as msg:
        print("ERROR:", msg, file=sys.stderr)
        return
    for match in url_matcher.finditer(data):
        url = match.group(1)
        name = unescape(match.group(2))
        name = asciify(name.replace('&', 'And').replace('@', 'At'))
        name = capfirst(name)
        if name in exclude_comics:
            continue
        if contains_case_insensitive(res, name):
            # we cannot handle two comics that only differ in case
            print("INFO: skipping possible duplicate", repr(name), file=sys.stderr)
            continue
        res[name] = url
807624
def parse(url, engine=None, conn_max_age=0, ssl_require=False):
    """"""

    if url == 'sqlite://:memory:':
        # this is a special case, because if we pass this URL into
        # urlparse, urlparse will choke trying to interpret "memory"
        # as a port number
        return {
            'ENGINE': SCHEMES['sqlite'],
            'NAME': ':memory:'
        }
        # note: no other settings are required for sqlite

    # otherwise parse the url as normal
    config = {}

    url = urlparse.urlparse(url)

    # Split query strings from path.
    path = url.path[1:]
    if '?' in path and not url.query:
        path, query = path.split('?', 2)
    else:
        path, query = path, url.query
    query = urlparse.parse_qs(query)

    # If we are using sqlite and we have no path, then assume we
    # want an in-memory database (this is the behaviour of sqlalchemy)
    if url.scheme == 'sqlite' and path == '':
        path = ':memory:'

    # Handle postgres percent-encoded paths.
    hostname = url.hostname or ''
    if '%2f' in hostname.lower():
        # Switch to url.netloc to avoid lower cased paths
        hostname = url.netloc
        if "@" in hostname:
            hostname = hostname.rsplit("@", 1)[1]
        if ":" in hostname:
            hostname = hostname.split(":", 1)[0]
        hostname = hostname.replace('%2f', '/').replace('%2F', '/')

    # Lookup specified engine.
    engine = SCHEMES[url.scheme] if engine is None else engine

    port = (str(url.port) if url.port and engine in [SCHEMES['oracle'], SCHEMES['mssql']]
            else url.port)

    # Update with environment configuration.
    config.update({
        'NAME': urlparse.unquote(path or ''),
        'USER': urlparse.unquote(url.username or ''),
        'PASSWORD': urlparse.unquote(url.password or ''),
        'HOST': hostname,
        'PORT': port or '',
        'CONN_MAX_AGE': conn_max_age,
    })

    # Pass the query string into OPTIONS.
    options = {}
    for key, values in query.items():
        if url.scheme == 'mysql' and key == 'ssl-ca':
            options['ssl'] = {'ca': values[-1]}
            continue

        options[key] = values[-1]

    if ssl_require:
        options['sslmode'] = 'require'

    # Support for Postgres Schema URLs
    if 'currentSchema' in options and engine in (
        'django.contrib.gis.db.backends.postgis',
        'django.db.backends.postgresql_psycopg2',
        'django.db.backends.postgresql',
        'django_redshift_backend',
    ):
        options['options'] = '-c search_path={0}'.format(options.pop('currentSchema'))

    if options:
        config['OPTIONS'] = options

    if engine:
        config['ENGINE'] = engine

    return config
1138110
def handle_namespace_url(self, line: str, position: int, tokens: ParseResults) -> ParseResults:
        
        namespace = tokens['name']
        self.raise_for_redefined_namespace(line, position, namespace)

        url = tokens['url']
        self.namespace_url_dict[namespace] = url

        if self.skip_validation:
            return tokens

        namespace_result = self.manager.get_or_create_namespace(url)

        if isinstance(namespace_result, dict):
            self.namespace_to_term[namespace] = namespace_result
            self.uncachable_namespaces.add(url)
        else:
            self.namespace_to_term[namespace] = self.manager.get_namespace_encoding(url)

        return tokens
1101025
def parse(url_str):
    
    url_str = to_unicode(url_str)
    result = urlparse(url_str)
    netloc_parts = result.netloc.rsplit('@', 1)
    if len(netloc_parts) == 1:
        username = password = None
        host = netloc_parts[0]
    else:
        user_and_pass = netloc_parts[0].split(':')
        if len(user_and_pass) == 2:
            username, password = user_and_pass
        elif len(user_and_pass) == 1:
            username = user_and_pass[0]
            password = None
        host = netloc_parts[1]

    if host and ':' in host:
        host = host.split(':')[0]

    return {'host': host,
            'username': username,
            'password': password,
            'scheme': result.scheme,
            'port': result.port,
            'path': result.path,
            'query': result.query,
            'fragment': result.fragment}
10274
def parse_url(url)
      s = url

      # remove entities
      s = HTML_ENTITIES.decode(s)

      # fix a couple of common encoding bugs
      s = s.gsub(' ', '%20')
      s = s.gsub("'", '%27')

      # append query manually (instead of letting HTTParty handle it) so we can
      # include it in cache_key
      query = options.delete(:query)
      if query.present?
        q = HTTParty::HashConversions.to_params(query)
        separator = s.include?('?') ? '&' : '?'
        s = "#{s}#{separator}#{q}"
      end

      URI.parse(s)
    end
1164811
def urlparams(url_, hash=None, **query):
    
    url = urlparse.urlparse(url_)
    fragment = hash if hash is not None else url.fragment

    # Use dict(parse_qsl) so we don't get lists of values.
    q = url.query
    query_dict = dict(urlparse.parse_qsl(smart_str(q))) if q else {}
    query_dict.update((k, v) for k, v in query.items())

    query_string = _urlencode([(k, v) for k, v in query_dict.items()
                               if v is not None])
    new = urlparse.ParseResult(url.scheme, url.netloc, url.path, url.params,
                               query_string, fragment)
    return new.geturl()
48448
def _parse_result_page(self, url, payload, only_region=False):
        
        data = []
        try:

            if only_region:
                html = self.scraper._get_html(url)
            else:
                html = self.scraper._post_html(url, payload=payload)

        except RequestException500:

            self.scraper.log.warning(u"Status code 500 on {} with {}".format(url, payload))
            return None


        current_selection = self._get_current_selection(html)

        table = Datatable(html)
        data = []
        for row in table.data:
            region_or_unit_id, region_or_unit_label = row["region_or_unit"]
            if region_or_unit_label in self.regions:
                row["region"] = region_or_unit_label
                row["unit"] = None
            else:
                row["region"] = None
                row["unit"] = region_or_unit_label

            value = row["value"]

            row.pop("value", None)
            row.pop("region_or_unit", None)

            for dim in self.dimensions:
                if dim.id not in row:
                    row[dim.id] = current_selection[dim.id][1] # gets label



            data.append(Result(value, row))
        return data
329295
def relaxNGNewParserCtxt(URL):
    
    ret = libxml2mod.xmlRelaxNGNewParserCtxt(URL)
    if ret is None:raise parserError('xmlRelaxNGNewParserCtxt() failed')
    return relaxNgParserCtxt(_obj=ret)
1247646
def parse_pubmed_url(pubmed_url):
        """"""
        parse_result = urlparse(pubmed_url)
        pattern = re.compile(r'^/pubmed/(\d+)$')
        pmid = pattern.match(parse_result.path).group(1)
        return pmid
644726
private void parseRenameFile(List<String> lines, URL url) {
        // format allows multiple [types] and [enums] so file can be merged
        boolean types = false;
        boolean enums = false;
        for (String line : lines) {
            try {
                if (line.equals("[types]")) {
                    types = true;
                    enums = false;
                } else if (line.equals("[enums]")) {
                    types = false;
                    enums = true;
                } else if (types) {
                    int equalsPos = line.indexOf('=');
                    if (equalsPos < 0) {
                        throw new IllegalArgumentException(
                                "Renamed.ini type line must be formatted as 'oldClassName = newClassName'");
                    }
                    String oldName = line.substring(0, equalsPos).trim();
                    String newName = line.substring(equalsPos + 1).trim();
                    Class<?> newClass = null;
                    try {
                        newClass = StringConvert.loadType(newName);
                    } catch (Throwable ex) {
                        if (LOG) {
                            ex.printStackTrace(System.err);
                        }
                        throw new IllegalArgumentException(
                                "Class.forName(" + newName + ") failed: " + ex.getMessage());
                    }
                    renamedType(oldName, newClass);
                } else if (enums) {
                    int equalsPos = line.indexOf('=');
                    int lastDotPos = line.lastIndexOf('.');
                    if (equalsPos < 0 || lastDotPos < 0 || lastDotPos < equalsPos) {
                        throw new IllegalArgumentException(
                                "Renamed.ini enum line must be formatted as 'oldEnumConstantName = enumClassName.newEnumConstantName'");
                    }
                    String oldName = line.substring(0, equalsPos).trim();
                    String enumClassName = line.substring(equalsPos + 1, lastDotPos).trim();
                    String enumConstantName = line.substring(lastDotPos + 1).trim();
                    @SuppressWarnings("rawtypes")
                    Class<? extends Enum> enumClass = Class.forName(enumClassName).asSubclass(Enum.class);
                    @SuppressWarnings("unchecked")
                    Enum<?> newEnum = Enum.valueOf(enumClass, enumConstantName);
                    renamedEnum(oldName, newEnum);
                } else {
                    throw new IllegalArgumentException("Renamed.ini must start with [types] or [enums]");
                }
            } catch (Exception ex) {
                // always print message, and then continue
                System.err.println("ERROR: Invalid Renamed.ini: " + url + ": " + ex.getMessage());
            }
        }
    }
794771
def parse_immoweb_link(url):
    
    IMMOWEB_ID_RE = re.compile(r'.*?IdBien=([0-9]+).*?')
    return IMMOWEB_ID_RE.match(url).groups()[0]
1328616
private void parseSpecs(URL url) throws MalformedURLException
    {
        String spec = url.getFile();

        int separator = spec.indexOf('!');
        /*
         * REMIND: we don't handle nested JAR URLs
         */
        if (separator == -1) {
            throw new MalformedURLException("no ! found in url spec:" + spec);
        }

        // Get the protocol
        String protocol = spec.substring(0, spec.indexOf(":"));

        // This is the important part: we use a URL Stream Handler Factory to find the URL Stream handler to use for
        // the nested protocol.
        this.jarFileURL =
            new URL(null, spec.substring(0, separator++), this.handlerFactory.createURLStreamHandler(protocol));
        this.entryName = null;

        /* if ! is the last letter of the innerURL, entryName is null */
        if (++separator != spec.length()) {
            this.entryName = spec.substring(separator, spec.length());
            try {
                // Note: we decode using UTF8 since it's the W3C recommendation.
                // See http://www.w3.org/TR/html40/appendix/notes.html#non-ascii-chars
                this.entryName = URLDecoder.decode(this.entryName, "UTF-8");
            } catch (UnsupportedEncodingException e) {
                // Not supporting UTF-8 as a valid encoding for some reasons. We consider XWiki cannot work
                // without that encoding.
                throw new RuntimeException("Failed to URL decode [" + this.entryName + "] using UTF-8.", e);
            }
        }
    }