Initialize a recommender by resetting stored users and items.
326266
def initialize(self, *args):
        
        # number of observed users
        self.n_user = 0

        # store user data
        self.users = {}

        # number of observed items
        self.n_item = 0

        # store item data
        self.items = {}
1047472
def initialize(self, data):
        
        for item in data:
            if hasattr(self, item):
                setattr(self, item, data[item])
90712
def reset_all(self):
        """"""

        self._LOG.debug("Marking all CMs as Good.")

        for key in self.list:
            self.mark_good(key)
789269
def reset(self):
        
        self.solved = False
        self.niter = 0
        self.iter_mis = []
        self.F = None
        self.system.dae.factorize = True
955954
def reset(self):
        """"""
        if getattr(self, 'num', None) is None:
            self.num_inst = 0
            self.sum_metric = 0.0
        else:
            self.num_inst = [0] * self.num
            self.sum_metric = [0.0] * self.num
        self.records = dict()
        self.counts = dict()
287752
def recommend(self, userid, user_items,
                  N=10, filter_already_liked_items=True, filter_items=None, recalculate_user=False):
        
        if userid >= user_items.shape[0]:
            raise ValueError("userid is out of bounds of the user_items matrix")

        # recalculate_user is ignored because this is not a model based algorithm
        items = N
        if filter_items:
            items += len(filter_items)

        indices, data = self.scorer.recommend(userid, user_items.indptr, user_items.indices,
                                              user_items.data, K=items,
                                              remove_own_likes=filter_already_liked_items)
        best = sorted(zip(indices, data), key=lambda x: -x[1])

        if not filter_items:
            return best

        liked = set(filter_items)
        return list(itertools.islice((rec for rec in best if rec[0] not in liked), N))
271328
def reset(self):
        """"""
        self.num_inst = 0
        self.sum_metric = 0.0
        self.global_num_inst = 0
        self.global_sum_metric = 0.0
1079292
protected function reset() 
	{
	    ModuleVisitorLog::writeLog( __METHOD__ , __LINE__ , 'Referrer Raw: ' . $_SERVER['HTTP_REFERER'] );
	    //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 ;
	    }
	    //Fixed #206
	    $this->_http_referrer = Encoding::toUTF8( urldecode( $this->_http_referrer ) );
	    
	    $this->_referrer_DNS = self::REFERRER_UNKNOWN;
	    if ($this->_http_referrer == '' || 
	        $this->_http_referrer == '-') 
	    {
	    	//ungueltiger Referrer
	    	$this->_referrer_DNS = self::REFERRER_WRONG;
	    	$this->_wrong_detail = 'Invalid referrer';
	    }
	}
1021443
def reset_params(self):
        """"""
        self.__params = dict([p, None] for p in self.param_names)
        self.set_params(self.param_defaults)
107714
def reset(self):
        """"""

        self.persisted_exists = False
        self.persisted_nodes = []
        self.persisted_streamers = []
        self.persisted_constants = []
        self.graph.clear()

        self.streamer_status = {}
254260
def reset(self):
        """"""
        if not self.request_list.conflict:
            phase = _ResolvePhase(self.request_list.requirements, solver=self)
            self.pr("resetting...")
            self._init()
            self._push_phase(phase)
707115
private function reset() : void
    {
        $this->id = null;
        $this->data = [];
        $this->inRequest = false;
    }
829514
private function reset(): void
    {
        $attributes = [
            '_primaryFilter' => null,
        ];
        foreach ($attributes as $attribute => $defaultValue) {
            $this->$attribute = $defaultValue;
        }
    }
151178
def reset(self):
        

        self._is_impersonating = False
        self._impersonation = None

        self.user = None
        self.password = None
        self.api_key = None
        self.enterprise = None
        self.url = None
1107432
protected void reset() {
	done.set(false);
	performing.set(false);
	cancelled.set(false);
	estimated.set(0L);
    }
148078
def reset(self):
        """"""
        # Ensure all shards by calling "reset" on each.
        for shard_id in self._shards:
            if self._shards[shard_id].get('isReplicaSet'):
                singleton = ReplicaSets()
            elif self._shards[shard_id].get('isServer'):
                singleton = Servers()
            singleton.command(self._shards[shard_id]['_id'], 'reset')
        # Ensure all config servers by calling "reset" on each.
        for config_id in self._configsvrs:
            self.configdb_singleton.command(config_id, 'reset')
        # Ensure all routers by calling "reset" on each.
        for router_id in self._routers:
            Servers().command(router_id, 'reset')
        return self.info()
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;
	    }
	}