Reset a user’s avatar
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')
714949
def set_username(self, username = None):
        
        
        if username is None or type(username) is not str:
            raise KPError("Need a new image number")
        else:
            self.username = username
            self.last_mod = datetime.now().replace(microsecond=0)
            return True
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
286498
function reset() {
         this.sbIndex = 0;
         this.length = 0;
         var samplers = []; // WebGL context

         this.gl = this.renderer.gl;

         for (var i = 0; i < this.maxTextures; i++) {
           this.units[i] = false;
           samplers[i] = i;
         } // set the quad shader as the default program


         this.useShader(this.quadShader);
         this.quadShader.uniforms.uSampler = samplers;
       }
1250272
def invalidate_cache(user, size=None):
    
    sizes = set(settings.AVATAR_AUTO_GENERATE_SIZES)
    if size is not None:
        sizes.add(size)
    for prefix in cached_funcs:
        for size in sizes:
            cache.delete(get_cache_key(user, size, prefix))
389668
public static function reset()
    {
        self::$_is_desktop_browser = null;
        self::$_is_mobile_browser = null;
        self::$_is_smarttv = null;
        self::$_is_robot = null;
    }
297340
def get_user_avatar(self, userid):
        '''  '''
        response, status_code = self.__pod__.User.get_v1_admin_user_uid_avatar(
            sessionToken=self.__session,
            uid=userid
        ).result()
        self.logger.debug('%s: %s' % (status_code, response))
        return status_code, response
339690
protected function reset()
	{
	    //NEVER TRUST USER INPUT
	    if (function_exists('filter_var'))	// Adjustment for hoster without the filter extension
	    {
	        $this->_http_referrer  = isset($_SERVER['HTTP_REFERER']) ? filter_var($_SERVER['HTTP_REFERER'],  FILTER_SANITIZE_URL) : self::REFERRER_UNKNOWN ;
	    }
	    else
	    {
	        $this->_http_referrer  = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : self::REFERRER_UNKNOWN ;
	    }
	    $this->_referrer_DNS = self::REFERRER_UNKNOWN;
	    if ($this->_http_referrer == '' ||
            $this->_http_referrer == '-')
	    {
	        //ungueltiger Referrer
	        $this->_referrer_DNS = self::REFERRER_WRONG;
	    }
	}
1230133
public WebhookMessageBuilder reset()
    {
        content.setLength(0);
        embeds.clear();
        resetFiles();
        username = null;
        avatarUrl = null;
        isTTS = false;
        return this;
    }
591403
private boolean resetLayout(IPerson person) {
        final String userName = person.getUserName();
        if (PersonFactory.getGuestUsernames().contains(userName)) {
            throw new IllegalArgumentException("CANNOT RESET LAYOUT FOR A GUEST USER: " + person);
        }
        LOG.warn("Resetting user layout for: " + userName, new Throwable());

        boolean layoutWasReset = false;

        try {
            userIdentityStore.removePortalUID(person.getID());
            userIdentityStore.getPortalUID(person, true);

            // see if the current user was the one to reset their layout and if
            // so we need to refresh our local copy of their layout
            if (person == owner) {
                this.layoutCachingService.removeCachedLayout(person, profile);
                updateCacheKey();
                getUserLayoutDOM();
            }
            // if (isFragmentOwner)
            // {
            //
            //    store.updateOwnerLayout(person);
            // }
            layoutWasReset = true;
        } catch (Exception e) {
            LOG.error("Unable to reset layout for " + person.getUserName() + ".", e);
        }
        return layoutWasReset;
    }
1161846
def save_avatar(strategy, details, user=None, *args, **kwargs):
    """"""
    if user:
        backend_name = kwargs['backend'].__class__.__name__.lower()
        response = kwargs.get('response', {})
        social_thumb = None
        if 'facebook' in backend_name:
            if 'id' in response:
                social_thumb = (
                    'http://graph.facebook.com/{0}/picture?type=normal'
                ).format(response['id'])
        elif 'twitter' in backend_name and response.get('profile_image_url'):
            social_thumb = response['profile_image_url']
        elif 'googleoauth2' in backend_name and response.get('image', {}).get('url'):
            social_thumb = response['image']['url'].split('?')[0]
        else:
            social_thumb = 'http://www.gravatar.com/avatar/'
            social_thumb += hashlib.md5(user.email.lower().encode('utf8')).hexdigest()
            social_thumb += '?size=100'
        if social_thumb and user.social_thumb != social_thumb:
            user.social_thumb = social_thumb
            strategy.storage.user.changed(user)
695526
def reset(self):
        '''
        
        '''
        self.palette['title'] = (Screen.COLOUR_WHITE, Screen.A_BOLD, Screen.COLOUR_BLUE)
        self._completed_view.options = []
        self._task_view.options = []
        self.refresh()
639842
def reset(self):
        """"""
        self.info(self.tr("About to reset.."))

        models = self.data["models"]

        models["instances"].store_checkstate()
        models["plugins"].store_checkstate()

        # Reset current ids to secure no previous instances get mixed in.
        models["instances"].ids = []

        for m in models.values():
            m.reset()

        for b in self.data["buttons"].values():
            b.hide()

        comment_box = self.findChild(QtWidgets.QWidget, "CommentBox")
        comment_box.hide()

        util.defer(500, self.controller.reset)
945185
public void reset() {
		featsLeft0.reset();
		featsLeft1.reset();
		featsRight0.reset();
		featsRight1.reset();
		for( SetMatches m : setMatches )
			m.reset();
		newToOld.reset();
		leftCamToWorld.reset();
		first = true;
	}
1319116
@BasePortalJpaDao.PortalTransactional
    public void resetUserLayoutAllProfiles(final IPersonAttributes personAttributes) {
        final IPerson person = PersonFactory.createRestrictedPerson();
        person.setAttributes(personAttributes.getAttributes());
        // get the integer uid into the person object without creating any new person data
        int uid = userIdentityStore.getPortalUID(person, false);
        person.setID(uid);

        final Hashtable<Integer, UserProfile> map = userLayoutStore.getUserProfileList(person);
        for (UserProfile profile : map.values()) {
            resetUserLayoutForProfileByName(person, profile);
            resetStylesheetUserPreferencesForProfile(person, profile);
        }
    }
709196
def reset
      self.mount_at = DEFAULT_MOUNT_AT
      self.dfly = DEFAULT_DFLY
      self.tabs = DEFAULT_TABS
      self.allowed_mime_types = DEFAULT_ALLOWED_MIME_TYPES
      self.icons = DEFAULT_ICONS
      self
    end
1223217
public function reset()
    {
        $this->parameters = [
            'utt'       => null,
            'context'   => null,
            'mode'      => self::MODE_DIALOG,
            't'         => self::CHARACTER_DEFAULT,
        ];
        $this->user_info = null;
        return $this;
    }