Put information into a task.

        :param task_name: name of the task
        :param key: key of the information item
        :param value: value of the information item
338914
def put_task_info(self, task_name, key, value):
        
        params = OrderedDict([('info', ''), ('taskname', task_name)])
        headers = {'Content-Type': 'application/xml'}
        body = self.TaskInfo(key=key, value=value).serialize()

        self._client.put(self.resource(), params=params, headers=headers, data=body)
922925
def save_task_info(self, res, mem_gb=0):
    
    mon = res.mon
    name = mon.operation[6:]  # strip 'total '
    if self.hdf5:
        mon.hdf5 = self.hdf5  # needed for the flush below
        t = (mon.task_no, mon.weight, mon.duration, len(res.pik), mem_gb)
        data = numpy.array([t], task_info_dt)
        hdf5.extend3(self.hdf5.filename, 'task_info/' + name, data,
                     argnames=self.argnames, sent=self.sent)
    mon.flush()
260039
def set_info(self, key, value, append=True):
        
        if append:
            if key not in self.info:
                self.info[key] = []
            self.info[key].append(value)
        else:
            self.info[key] = value
284873
def add(self, key, value):
        
        self.configfile.add(self.name, key, value)
1001519
def common_params(task_instance, task_cls):
    
    if not isinstance(task_cls, task.Register):
        raise TypeError("task_cls must be an uninstantiated Task")

    task_instance_param_names = dict(task_instance.get_params()).keys()
    task_cls_params_dict = dict(task_cls.get_params())
    task_cls_param_names = task_cls_params_dict.keys()
    common_param_names = set(task_instance_param_names).intersection(set(task_cls_param_names))
    common_param_vals = [(key, task_cls_params_dict[key]) for key in common_param_names]
    common_kwargs = dict((key, task_instance.param_kwargs[key]) for key in common_param_names)
    vals = dict(task_instance.get_param_values(common_param_vals, [], common_kwargs))
    return vals
665656
def task_add(self, subsystem, name, pid):
        

        args = {
            'subsystem': subsystem,
            'name': name,
            'pid': pid,
        }

        self._task_chk.check(args)
        return self._client.json('cgroup.task-add', args)
793048
def add(self, task):
        
        wait_id = task.wait_for_task_id
        task_list = self.wait_id_to_task.get(wait_id, [])
        task_list.append(task)
        self.wait_id_to_task[wait_id] = task_list
487433
public void put(final String key, final Object value) {
        if (TASK_DIRECTORY_KEY.equals(key) && this.values.keySet().contains(TASK_DIRECTORY_KEY)) {
            // ensure that no one overwrites the task directory
            throw new IllegalArgumentException("Invalid key: " + key);
        }

        if (value == null) {
            throw new IllegalArgumentException(
                    "A null value was attempted to be put into the values object under key: " + key);
        }
        this.values.put(key, value);
    }
1234216
def add_task(self, task, parent_task_result):
        
        self.tasks.append((task, parent_task_result))
        self.task_id_to_task[task.id] = task
727787
def get_task_detail(self, task_name):
        
        def _get_detail():
            from ..compat import json  # fix object_pairs_hook parameter for Py2.6

            params = {'instancedetail': '',
                      'taskname': task_name}

            resp = self._client.get(self.resource(), params=params)
            return json.loads(resp.text if six.PY3 else resp.content,
                              object_pairs_hook=OrderedDict)

        result = _get_detail()
        if not result:
            # todo: this is a workaround for the bug that get_task_detail returns nothing.
            self.get_task_detail2(task_name)
            return _get_detail()
        else:
            return result
1269476
def setKey(self, key, value):
		
		data = self.getDictionary()
		data[key] = value
		self.setDictionary(data)
635751
def add_task(self, name=None, desc=None):
        
        # A name is required to create a task
        for k in self.get_tasks():
            if name in keys_of(k):
                raise ValueError('Task already exists')

        if name is not None:
            # desc can be None, so we can just append whatever we have
            self.grindstone['tasks'].append( {name: desc} )
        else:
            # Raising errors is good, and makes tests easy.
            raise ValueError('Tasks `name` cannot be None')
561312
def put(self, task, args, kwargs):
        
        if self.num_threads == 0:
            return task(*args, **kwargs)
        if self.queue is None:
            self._spawn()
        self.queue.put((task, args, kwargs))
1089321
def put(self, name_to_val):
    
    self._check_open()
    for name, val in name_to_val.iteritems():
      # First try to put data as a matrix:
      try:
        self.client.PutFullMatrix(name, 'base', val, None)
      except:
        self.client.PutWorkspaceData(name, 'base', val)
819862
def add_task_status(self, name, **attrs):
        
        return TaskStatuses(self.requester).create(self.id, name, **attrs)
465116
public void put(PlotItem it, VisualizationTask task, Element elem, Visualization vis) {
    map.put(key(it, task), value(elem, vis));
  }
844153
def _set_tasks_state(self, value):
        
        if value not in states.state_numbers.keys():
            raise ValueError(obj=self._uid,
                             attribute='set_tasks_state',
                             expected_value=states.state_numbers.keys(),
                             actual_value=value)

        for task in self._tasks:
            task.state = value