Motivate someone
199336
def motivate(channel, rest):
	""
	if rest:
		r = rest.strip()
		m = re.match(r'^(.+)\s*\bfor\b\s*(.+)$', r)
		if m:
			r = m.groups()[0].strip()
	else:
		r = channel
	karma.Karma.store.change(r, 1)
	return "you're doing good work, %s!" % r
418408
function (target, methodName, args) {
    return perform(target, function (target) {
        return target.apply(methodName, args);
    }, function (target) {
        return target[methodName].apply(target, args);
    });
}
555916
def do_yo(self, args):
        """"""
        chant = ['yo'] + ['ho'] * args.ho
        separator = ', ' if args.commas else ' '
        chant = separator.join(chant)
        self.poutput('{0} and a bottle of {1}'.format(chant, args.beverage))
160181
def push(self, instance, action, success, idxs=_marker):
        
        uid = api.get_uid(instance)
        info = self.objects.get(uid, {})
        idx = [] if idxs is _marker else idxs
        info[action] = {'success': success, 'idxs': idx}
        self.objects[uid] = info
1085300
def cmd(send, msg, args):
    
    user = choice(get_users(args))
    if msg:
        msg = " for " + msg
    msg = "blames " + user + msg
    send(msg, 'action')
686414
def _post_action(self, action):
        """"""
        reward = self.reward(action)

        # done if number of elapsed timesteps is greater than horizon
        self.done = (self.timestep >= self.horizon) and not self.ignore_done
        return reward, self.done, {}
530887
def apply(self, func, skills):
        """"""

        def run_item(skill):
            try:
                func(skill)
                return True
            except MsmException as e:
                LOG.error('Error running {} on {}: {}'.format(
                    func.__name__, skill.name, repr(e)
                ))
                return False
            except:
                LOG.exception('Error running {} on {}:'.format(
                    func.__name__, skill.name
                ))

        with ThreadPool(20) as tp:
            return tp.map(run_item, skills)
121469
def reward(self):
    """"""
    raw_rewards, processed_rewards = 0, 0
    for ts in self.time_steps:
      # NOTE: raw_reward and processed_reward are None for the first time-step.
      if ts.raw_reward is not None:
        raw_rewards += ts.raw_reward
      if ts.processed_reward is not None:
        processed_rewards += ts.processed_reward
    return raw_rewards, processed_rewards
651011
def step(self, action):
    
    observ, reward, done, info = self._env.step(action)
    observ = self._convert_observ(observ)
    reward = self._convert_reward(reward)
    return observ, reward, done, info
488434
def create(self, user, obj, **kwargs):
        
        follow = Follow(user=user)
        follow.target = obj
        follow.save()
        return follow
98200
def reward_bonus(self, assignment_id, amount, reason):
        """"""
        logger.info(
            'Award ${} for assignment {}, with reason "{}"'.format(
                amount, assignment_id, reason
            )
        )
1155363
def listen(cls, event, func):
        """"""
        signal(event).connect(func, sender=cls)
825425
function promisePrompt(questions) {
    return new Promise(function(resolve, reject) {
        inquirer.prompt(questions, function(results) {
            resolve(results);
        });
    });
}
1340808
def step(self, action):
    """"""
    total_reward = 0.0
    done = None
    for i in range(self._skip):
      obs, reward, done, info = self.env.step(action)
      if i == self._skip - 2:
        self._obs_buffer[0] = obs
      if i == self._skip - 1:
        self._obs_buffer[1] = obs
      total_reward += reward
      if done:
        break
    # Note that the observation on the done=True frame doesn't matter.
    max_frame = self._obs_buffer.max(axis=0)
    return max_frame, total_reward, done, info
188364
function (content, block, target, type) {
            target = target || 'replace';

            return helpers['useref_' + type](content, block, target);
        }
553152
def solveAndNotify(self, request):
        
        remote = request.transport.remote
        withThisIdentifier = Exercise.identifier == self.exerciseIdentifier
        exercise = self.store.findUnique(Exercise, withThisIdentifier)
        solveAndNotify(remote, exercise)
638143
function any() {
      var args = [].slice.apply(arguments);
      args.unshift(this.event);
      task.emit.apply(task, args);
    }