get the user avatar
@return string
960043
public function getAvatar() : ? string
    {
        //$this->cdn
        $cdn = \Phalcon\DI::getDefault()->getCdn() . '/avatars/';
        $avatar = $cdn . 'nopicture.png';

        if (!empty($this->profile_image)) {
            $avatar = $cdn . $this->profile_image;
        } elseif (!empty($this->profile_remote_image)) {
            $avatar = $this->profile_remote_image;
        }

        return $avatar;
    }
1054449
public static function getAvatar(User $user, $size = self::AVATAR_MIDDLE)
    {
        $size = in_array($size, [self::AVATAR_BIG, self::AVATAR_MIDDLE, self::AVATAR_SMALL]) ? $size : self::AVATAR_BIG;
        if ($user->getIsAvatar()) {
            $avatarPath = AvatarHelper::getAvatarPath($user->id) . "_avatar_{$size}.jpg";
            return static::getDisk()->url($avatarPath) . '?_t=' . $user->updated_at;
        } else {
            $avatarUrl = "/img/no_avatar_{$size}.gif";
            if (Yii::getAlias('@webroot', false)) {
                $baseUrl = UserAsset::register(Yii::$app->view)->baseUrl;
                return Url::to($baseUrl . $avatarUrl, true);
            }
        }
        return '';
    }
1028538
public function getProfileAlias()
    {
        $link = $this->getProfile();
        if ($link && $link->href) {
            $guidOrAlias = explode('/', $link->href);
            $guidOrAlias = end($guidOrAlias);
            return isset(self::$_profileAliases[$guidOrAlias]) ? self::$_profileAliases[$guidOrAlias] : $guidOrAlias;
        } else {
            return null;
        }
    }
869127
public function info() : object
    {
        if ($this->profile === null) {
            $this->profile = $this->get(sprintf(self::USERS_ENDPOINT . 'profile2', $this->onlineIdParameter), [
                'fields' => 'npId,onlineId,accountId,avatarUrls,plus,aboutMe,languagesUsed,trophySummary(@default,progress,earnedTrophies),isOfficiallyVerified,personalDetail(@default,profilePictureUrls),personalDetailSharing,personalDetailSharingRequestMessageFlag,primaryOnlineStatus,presences(@titleInfo,hasBroadcastData),friendRelation,requestMessageFlag,blocking,mutualFriendsCount,following,followerCount,friendsCount,followingUsersCount&avatarSizes=m,xl&profilePictureSizes=m,xl&languagesUsedLanguageSet=set3&psVitaTitleIcon=circled&titleIconSize=s'
            ])->profile;
        }
        return $this->profile;
    }
126257
public function get_userinfo() {
        $url = $this->get_issuer()->get_endpoint_url('userinfo');
        $response = $this->get($url);
        if (!$response) {
            return false;
        }
        $userinfo = new stdClass();
        try {
            $userinfo = json_decode($response);
        } catch (\Exception $e) {
            return false;
        }

        $map = $this->get_userinfo_mapping();

        $user = new stdClass();
        foreach ($map as $openidproperty => $moodleproperty) {
            // We support nested objects via a-b-c syntax.
            $getfunc = function($obj, $prop) use (&$getfunc) {
                $proplist = explode('-', $prop, 2);
                if (empty($proplist[0]) || empty($obj->{$proplist[0]})) {
                    return false;
                }
                $obj = $obj->{$proplist[0]};

                if (count($proplist) > 1) {
                    return $getfunc($obj, $proplist[1]);
                }
                return $obj;
            };

            $resolved = $getfunc($userinfo, $openidproperty);
            if (!empty($resolved)) {
                $user->$moodleproperty = $resolved;
            }
        }

        if (empty($user->username) && !empty($user->email)) {
            $user->username = $user->email;
        }

        if (!empty($user->picture)) {
            $user->picture = download_file_content($user->picture, null, null, false, 10, 10, true, null, false);
        } else {
            $pictureurl = $this->issuer->get_endpoint_url('userpicture');
            if (!empty($pictureurl)) {
                $user->picture = $this->get($pictureurl);
            }
        }

        if (!empty($user->picture)) {
            // If it doesn't look like a picture lets unset it.
            if (function_exists('imagecreatefromstring')) {
                $img = @imagecreatefromstring($user->picture);
                if (empty($img)) {
                    unset($user->picture);
                } else {
                    imagedestroy($img);
                }
            }
        }

        return (array)$user;
    }
38476
private function getImage()
    {
        $image = $this->_parser->find('.container-left .user-profile', 0);
        $image = $image->find('.user-image img', 0);

        return $image ? Helper::imageUrlCleaner($image->src) : '';
    }
987941
public function getUserProfile()
    {
        if ($this->_userProfile == NULL)
            $this->_userProfile = $this->getAdapter()->getUserProfile();

        return $this->_userProfile;
    }
154989
public function findAvatars($username)
    {
        $parameters['username'] = $username;
        return $this->apiClient->callEndpoint(sprintf('%s/avatars', self::ENDPOINT), $parameters);
    }
1200896
public function getUser()
    {
        if ($this->_user === false) {
            $this->_user = \Yii::$app->user->identity;
        }

        return $this->_user;
    }
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
521273
protected function getUserString()
    {
        $user = $this->core->auth()->user();

        if ( ! $user) return null;

        return $user->getUsername();
    }
997206
public function getavatarpath(){
		if(empty($this->created)){
			return false;
			}
		if(empty($this->provider)){
			return false;
			}
		if(empty($this->social_id)){
			return false;
			}
		$avatarpath='/users/avatars/';
		$avatarpath.=$this->created->format('Y').'/';
		$avatarpath.=$this->created->format('m').'/';
		$avatarpath.=$this->created->format('d').'/';
		$avatarpath.=$this->provider.'-'.$this->social_id;
		return $avatarpath;
		}
1044343
public function buildGravatarUrl()
    {
        $base_url = self::HTTPS_GRAVATAR_URL;
        if (!$this->secure) {
            $base_url = self::HTTP_GRAVATAR_URL;
        }
        return $base_url . 'avatar/' . $this->generateAddressHash() . '?s=' . $this->size . '&r=' . $this->rating . '&d=' . $this->default_avatar;
    }
82154
public function userProfile() {
        $path = '/v1/me';
        
        $result = $this->adapter->get($path, array(), $this->getHeaders());
        return $this->format($result);
    }
589866
public function getPostEditUser()
    {
        $this->checkIsLogin();
        $name = $this->di->get('session')->get("user");
        $user = $this->getUserDetails($name);

        $form       = new EditProfileForm($this->di, $name);
        $form->check();

        $views = [
            ["comment/user/profile/edit", ["form" => $form->getHTML(), "user" => $user], "main"]
        ];

        $this->di->get("pageRenderComment")->renderPage([
            "views" =>  $views,
            "title" => "Edit Profile"
        ]);
    }
1282080
public function getIcon()
    {
        $classNamespaces = explode("\\", static::class);
        $shortClass = end($classNamespaces);

        $resource = ModuleLoader::getModule('silverstripe/userforms')
            ->getResource('images/' . strtolower($shortClass) . '.png');

        if (!$resource->exists()) {
            return '';
        }

        return $resource->getURL();
    }
418178
protected function getUser()
    {
        if ($this->_user === null) {
            $userClass = Yii::$app->user->identityClass;
            $this->_user = $userClass::findOne(['nickname' => $this->nickname]);
        }
        return $this->_user;
    }