Sets user avatar picture from file.

        :Parameters:
          Id : int
            Optional avatar Id.
          Set : str
            New avatar file name.

        :deprecated: Use `LoadAvatarFromFile` instead.
164009
def Avatar(self, Id=1, Set=None):
        
        from warnings import warn
        warn('Settings.Avatar: Use Settings.LoadAvatarFromFile instead.', DeprecationWarning, stacklevel=2)
        if Set is None:
            raise TypeError('Argument \'Set\' is mandatory!')
        self.LoadAvatarFromFile(Set, Id)
115353
def download_avatar(self, image, url_field='url'):
        
        return self.download(image, url_field=url_field, suffix='avatar')
291839
def build_avatar_url(jid):
        
        digest = md5(str(jid).encode("utf-8")).hexdigest()
        return "http://www.gravatar.com/avatar/{md5}?d=monsterid".format(md5=digest)
63051
def generate_img_id(profile, ext=None, label=None, tmp=False):
    
    if ext and not ext.startswith('.'):
        ext = '.' + ext
    if label:
        label = re.sub(r'[^a-z0-9_\-]', '', label, flags=re.I)
        label = re.sub(r'_+', '_', label)
        label = label[:60]
    return '{profile}:{tmp}{dtstr}_{rand}{label}{ext}'.format(
        profile=profile,
        tmp=(dju_settings.DJU_IMG_UPLOAD_TMP_PREFIX if tmp else ''),
        dtstr=datetime_to_dtstr(),
        rand=get_random_string(4, 'abcdefghijklmnopqrstuvwxyz0123456789'),
        label=(('_' + label) if label else ''),
        ext=(ext or ''),
    )
880234
def setProfile(self, profile):
        
        self._profile = profile
        
        # update the interface
        self.setIcon(profile.icon())
        self.setText(profile.name())
        self.setToolTip(profile.description())
390056
public AccountUpdater setAvatar(InputStream avatar, String fileType) {
        delegate.setAvatar(avatar, fileType);
        return this;
    }
1118628
public function setFileAvatar($file_avatar){
        if(!$this->setModified('file_avatar', $file_avatar)->isModified()){
            return $this;
        }
        $this->file_avatar = $file_avatar;
        return $this;
    }
382119
def delete_image(self, image_id):
        
        url = self.api_url + '/api/images/' + image_id
        response = self._request_url(url, 'delete', with_access_token=True)
        headers, result = self._parse_and_check(response)
        return Image.from_dict(result)
1370018
def __getAvatar(self, web):
        
        try:
            self.avatar = web.find("img", {"class": "avatar"})['src'][:-10]
        except IndexError as error:
            print("There was an error with the user " + self.name)
            print(error)
        except AttributeError as error:
            print("There was an error with the user " + self.name)
            print(error)
1150994
private void setNsid() throws FlickrException {

        if (username != null && !username.equals("")) {
            Auth auth = null;
            if (authStore != null) {
                auth = authStore.retrieve(username); // assuming FileAuthStore is enhanced else need to
                // keep in user-level files.

                if (auth != null) {
                    nsid = auth.getUser().getId();
                }
            }
            if (auth != null)
                return;

            Auth[] allAuths = authStore.retrieveAll();
            for (int i = 0; i < allAuths.length; i++) {
                if (username.equals(allAuths[i].getUser().getUsername())) {
                    nsid = allAuths[i].getUser().getId();
                    return;
                }
            }

            // For this to work: REST.java or PeopleInterface needs to change to pass apiKey
            // as the parameter to the call which is not authenticated.

            // Get nsid using flickr.people.findByUsername
            PeopleInterface peopleInterf = flickr.getPeopleInterface();
            User u = peopleInterf.findByUsername(username);
            if (u != null) {
                nsid = u.getId();
            }
        }
    }
986654
def get_profile_pic_from_id(self, id):
        
        profile_pic = self.wapi_functions.getProfilePicFromId(id)
        if profile_pic:
            return b64decode(profile_pic)
        else:
            return False
259162
def change_id(self, new_id):
        """"""
        self._load_raw_content()
        self._id = new_id
        self.get_filename(renew=True)
        self.get_filepath(renew=True)
        return
771151
def users_reset_avatar(self, user_id=None, username=None, **kwargs):
        """"""
        if user_id:
            return self.__call_api_post('users.resetAvatar', userId=user_id, kwargs=kwargs)
        elif username:
            return self.__call_api_post('users.resetAvatar', username=username, kwargs=kwargs)
        else:
            raise RocketMissingParamException('userID or username required')
860217
def id(self, id):
        

        if id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")
        if len(id) > 255:
            raise ValueError("Invalid value for `id`, length must be less than `255`")

        self._id = id
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')
1338739
def update_image(self, image_id, user_name, desc=None):
        """"""
        desc = desc if desc else ''
        data = {"username": user_name,
                "description": desc}

        return self._post('/images/%s' % image_id, data)
1107464
def delete_user_avatar(self, username, avatar):
        
        params = {'username': username}
        url = self._get_url('user/avatar/' + avatar)
        return self._session.delete(url, params=params)