Return url for a Gravatar.
344748
def get_gravatar(email, size=80, rating='g', default=None,
                 protocol=PROTOCOL):
    
    gravatar_protocols = {'http': 'http://www',
                          'https': 'https://secure'}
    url = '%s.gravatar.com/avatar/%s' % (
        gravatar_protocols[protocol],
        md5(email.strip().lower().encode('utf-8')).hexdigest())
    options = {'s': size, 'r': rating}
    if default:
        options['d'] = default

    url = '%s?%s' % (url, urlencode(options))
    return url.replace('&', '&amp;')
908535
def page_url(self) -> str:
        """"""
        url = self.attributes['canonicalurl']
        assert isinstance(url, str)
        return url
230540
def get(self, url, **kwargs):
        
        """

        kwargs.setdefault('allow_redirects', True)
        return self.request('GET', url, **kwargs)
207272
def _build_url(self):
        """"""
        url_params = [
            BASE_URL, self.category + ' ratings', self.day, self.year, self.month
        ]

        return SEARCH_URL.format(*url_params)
605133
def get(self, url, params=None, callback=None, retry=0, **kwargs):
        """"""
        kwargs.setdefault("allow_redirects", True)
        return self.request(
            "get", url=url, params=params, callback=callback, retry=retry, **kwargs
        )
964853
def url_for(self, *args: str, **kwargs: str) -> URL:
        """"""
        return self._resource.url_for(*args, **kwargs)
748092
def make_url(*args, **kwargs):
    """"""
    base = "/".join(args)
    if kwargs:
        return "%s?%s" % (base, urlencode(kwargs))
    else:
        return base
1055021
def url(self, host):
        """"""
        path = '/'.join(str(v) for v in self._path)
        return 'coaps://{}:5684/{}'.format(host, path)
620333
public function getAvatarUrl(): string
    {
        // Try to locate avatar image.
        $avatar = $this->getAvatarImage();
        if ($avatar) {
            return $avatar->url();
        }

        // Try if avatar is a sting (URL).
        $avatar = $this->get('avatar');
        if (\is_string($avatar)) {
            return $avatar;
        }

        // Try looking for provider.
        $provider = $this->get('provider');
        $provider_options = $this->get($provider);
        if (\is_array($provider_options)) {
            if (isset($provider_options['avatar_url']) && \is_string($provider_options['avatar_url'])) {
                return $provider_options['avatar_url'];
            }
            if (isset($provider_options['avatar']) && \is_string($provider_options['avatar'])) {
                return $provider_options['avatar'];
            }
        }

        $email = $this->get('email');

        // By default fall back to gravatar image.
        return $email ? 'https://www.gravatar.com/avatar/' . md5(strtolower(trim($email))) : '';
    }
344952
def user_photo_url(user, size):
    """"""
    endpoint, kwargs = user_url_args(user, size)
    return url_for(endpoint, **kwargs)
865771
def shouldSkipUrl(self, url, data):
        """"""
        return url in (
            self.stripUrl % '130217', # video
            self.stripUrl % '130218', # video
            self.stripUrl % '130226', # video
            self.stripUrl % '130424', # video
        )
106471
def url(url: str, method: str):
    """"""
    try:
        url_rule, params = (current_app.url_map.bind('localhost')
                            .match(url, method=method, return_rule=True))
    except (NotFound, MethodNotAllowed)\
            as e:
        click.secho(str(e), fg='white', bg='red')
    else:
        headings = ('Method(s)', 'Rule', 'Params', 'Endpoint', 'View', 'Options')
        print_table(headings,
                    [(_get_http_methods(url_rule),
                      url_rule.rule if url_rule.strict_slashes
                                    else url_rule.rule + '[/]',
                      _format_dict(params),
                      url_rule.endpoint,
                      _get_rule_view(url_rule),
                      _format_rule_options(url_rule))],
                    ['<' if i > 0 else '>' for i, col in enumerate(headings)],
                    primary_column_idx=1)
1355386
def url(self):
        """"""
        query = {
            'key': self.api_key or default_api_key,
            'person': self.person.to_json(),
            'query_params_mode': self.query_params_mode,
            'exact_name': self.exact_name,
            'prioritize_records_by': ','.join(self._prioritize_records_by),
            'filter_records_by': self._filter_records_by,
        }
        return SearchAPIRequest.BASE_URL + urllib.urlencode(query, doseq=True)
90213
def get_url(width, height, color=True):
    
    d = dict(width=width, height=height)
    return URL % d
836625
def url_for(**options):
    ''''''

    url_parts = get_url_parts(**options)
    image_hash = hashlib.md5(b(options['image_url'])).hexdigest()
    url_parts.append(image_hash)

    return "/".join(url_parts)
141698
def _get(self, url, params={}):
        """"""
        r = requests.get(self._api_prefix + url,
            params=params,
            headers=self.headers,
            auth=self.auth,
        )
        return self._action(r)
197350
def artUrl(self):
        
        art = self.firstAttr('art', 'grandparentArt')
        return self._server.url(art, includeToken=True) if art else None