Returns an Avatar URL.
5184
public function avatar(string $email, array $options = [], ?bool $secure = null, bool $validateOptions = false): string
    {
        $url = 'avatar/'.$this->createEmailHash($email);

        $options = array_merge($this->defaults, array_filter($options));

        if ($validateOptions) {
            $this->validateOptions($options);
        }

        if (!empty($options)) {
            $url .= '?'.http_build_query($options);
        }

        return $this->buildUrl($url, $secure);
    }
997704
def splash_url_as(self, *, format='webp', size=2048):
        """"""
        return Asset._from_guild_image(self._state, self.id, self.splash, 'splashes', format=format, size=size)
108383
def url(self):
        """"""
        return self.get_url(self.id, self.world) if self.id and self.world else None
397628
def gravatar_url(cls, instance, default="mm", **kwargs):
        
        # construct the url
        hash = hashlib.md5(instance.email.encode("utf8").lower()).hexdigest()
        if "d" not in kwargs:
            kwargs["d"] = default
        params = "&".join(
            [
                six.moves.urllib.parse.urlencode({key: value})
                for key, value in kwargs.items()
            ]
        )
        return "https://secure.gravatar.com/avatar/{}?{}".format(hash, params)
86796
public void setAvatar(URL avatarURL) {
        byte[] bytes = new byte[0];
        try {
            bytes = getBytes(avatarURL);
        }
        catch (IOException e) {
            LOGGER.log(Level.SEVERE, "Error getting bytes from URL: " + avatarURL, e);
        }

        setAvatar(bytes);
    }
357967
public function gravatar()
    {
        // Check for valid gravatar
        $gravCheck = 'http://www.gravatar.com/avatar/'. md5( strtolower( trim( $this->email ) ) ) .'.png?d=404';
        $response  = get_headers($gravCheck);

        // If a valid gravatar URL is found, use the gravatar image
        if ($response[0] != "HTTP/1.0 404 Not Found"){
            return 'http://www.gravatar.com/avatar/'. md5( strtolower( trim( $this->email ) ) ) .'.png?s=200&d=blank';
        }

        // If no other image is set, use the default
        return '/img/no_user.png';
    }
858680
def gravatar(self, size=20):
        
        default = "mm"

        gravatar_url = "//www.gravatar.com/avatar/" + hashlib.md5(self.email.lower()).hexdigest() + "?"
        gravatar_url += urllib.urlencode({'d': default, 's': str(size)})

        return gravatar_url
1097501
def getURL(self, size='Medium', urlType='url'):
        
        method = 'flickr.photos.getSizes'
        data = _doget(method, photo_id=self.id)
        for psize in data.rsp.sizes.size:
            if psize.label == size:
                return getattr(psize, urlType)
        raise FlickrError, "No URL found"
230595
def imageurl(self):
        
        if self._imageurl is None:
            self._imageurl = 'http://www.chemspider.com/ImagesHandler.ashx?id=%s' % self.csid
        return self._imageurl
1356579
public function avatarImage($width = null, $height = null, $returnGravatarIfNotFound = false)
    {
        return new HtmlString(
          view()->make(
            "vendor.user.avatar", [
              'width'=>$width,
              'height'=>$height,
              'returnGravatarIfNotFound'=>$returnGravatarIfNotFound,
              'imageURL'=>$this->avatar($width, $height, $returnGravatarIfNotFound),
              'user'=>$this
            ]
          )->render()
        );
    }
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))) : '';
    }
62021
def get_avatar(from_header, size=64, default="retro"):
    
    params = OrderedDict([("s", size), ("d", default)])
    query = parse.urlencode(params)
    address = email.utils.parseaddr(from_header)[1]
    value_hash = sha256(address.encode("utf-8")).hexdigest()
    return "https://seccdn.libravatar.org/avatar/{}?{}".format(value_hash, query)
405816
def set_user_avatar(self, username, avatar):
        
        self._set_avatar(
            {'username': username}, self._get_url('user/avatar'), avatar)
794987
public function getAvatarUrl($size = 96)
	{
		$avatarUrls = $this->getValueByKey($this->response, 'avatar_urls');
		return in_array($size, array('24','48','96')) ? $avatarUrls[$size] : null;        
	}
1162032
def get_image_url(self, selector, by=By.CSS_SELECTOR,
                      timeout=settings.SMALL_TIMEOUT):
        
        if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
            timeout = self.__get_new_timeout(timeout)
        return self.get_attribute(selector,
                                  attribute='src', by=by, timeout=timeout)
410221
def users_get_avatar(self, user_id=None, username=None, **kwargs):
        """"""
        if user_id:
            return self.__call_api_get('users.getAvatar', userId=user_id, kwargs=kwargs)
        elif username:
            return self.__call_api_get('users.getAvatar', username=username, kwargs=kwargs)
        else:
            raise RocketMissingParamException('userID or username required')
72204
def get_avatar(self, mxit_id, output_file_path=None, scope='profile/public'):
        
        data = _get(
            token=self.oauth.get_app_token(scope),
            uri='/user/public/avatar/' + urllib.quote(mxit_id)
        )

        if output_file_path:
            with open(output_file_path, 'w') as f:
                f.write(data)
        else:
            return data