addes a process to a given group
328476
function(ops, callback) {
        if(!callback) callback = function() { };

        //name of the script to run for supervisord
        if(!ops.name) ops.name = 'undefined';

        var supervisordName = this._name(ops.name);
        
        //script exists? split it apart
        if(ops.script) {
             ops.directory =  ops.script.split('.').length == 1 ? ops.script :path.dirname(ops.script);

            try {
                var package = JSON.parse(fs.readFileSync(ops.directory + '/package.json'));

                if(!package.main && package.bin) {
                    for(var binName in package.bin) {
                        ops.command = ops.directory + '/' + package.bin[binName];
                    }
                }
            } catch(e) {
                
            }
            
            if(!ops.command) ops.command = 'node ' + ops.script +' '+ (ops.args || []).join(' ');
        }

        var envStr;

        if(ops.environment) {
            var envBuffer = [];

            for(var property in ops.environment) {
                envBuffer.push(property + '=' + ops.environment[property]);
            }

            envStr = envBuffer.join(',');
        }


        //directory to script - chdir for supervisord
        //if(!ops.directory) return callback('directory is not provided');

        //the command to use for running supervisord
        if(!ops.command) return callback('command not provided');
        
        if(!ops.name) return callback('Name not provided');
         
        var self = this;


        var update = this._query({
            supervisordName: supervisordName, 
            name: ops.name,
            directory: ops.directory, 
            command: ops.command,
            environment: envStr,
            stdout_logfile: this.logsDir + '/' + supervisordName + '.log',
            stderr_logfile: this.logsDir + '/' + supervisordName + '-err.log'
        });
        
        //insert into the beet db 
        this._collection.update({ _id: this._id(supervisordName) }, { $set: update }, { upsert: true }, function(err, result){
            if(callback) callback(err, result);
        });
    }
97840
def AddProcessingOptions(self, argument_group):
    
    argument_group.add_argument(
        '--single_process', '--single-process', dest='single_process',
        action='store_true', default=False, help=(
            'Indicate that the tool should run in a single process.'))

    argument_helper_names = ['temporary_directory', 'workers', 'zeromq']
    if self._CanEnforceProcessMemoryLimit():
      argument_helper_names.append('process_resources')
    helpers_manager.ArgumentHelperManager.AddCommandLineArguments(
        argument_group, names=argument_helper_names)
137902
def add_option(self, group):
        
        group.add_argument(
            "--{0}".format(self.option), action="store_true", help=self.name)
734946
def add_group(opts)
      raise ArgumentError, "Expected Hash or Keepassx::Group, got #{opts.class}" unless valid_group?(opts)

      if opts.is_a?(Keepassx::Group)
        # Assign parent group
        parent = opts.parent
        index  = last_sibling_index(parent) + 1
        @groups.insert(index, opts)

        # Increment counter
        header.groups_count += 1

        # Return group
        opts

      elsif opts.is_a?(Hash)
        opts = deep_copy(opts)
        opts = build_group_options(opts)

        # Create group
        group = create_group(opts)

        # Increment counter
        header.groups_count += 1

        # Return group
        group
      end
    end
118790
def add_to_group(self, devices):
        """"""
        ids = {d.id for d in self.devices_in_group()}
        ids.update(self._device_ids(devices))
        self._set_group(ids)
138209
def _add(self, name, *args, **kw):
        
        argname = list(self.argdict)[self._argno]
        if argname != name:
            raise NameError(
                'Setting argument %s, but it should be %s' % (name, argname))
        self._group.add_argument(*args, **kw)
        self.all_arguments.append((args, kw))
        self.names.append(name)
        self._argno += 1
1304669
def add_group(self, groupname):
        
        url = self._options['server'] + '/rest/api/latest/group'

        # implementation based on
        # https://docs.atlassian.com/jira/REST/ondemand/#d2e5173

        x = OrderedDict()

        x['name'] = groupname

        payload = json.dumps(x)

        self._session.post(url, data=payload)

        return True
480889
def contribute_to_class(self, process, fields, name):
        
        self.name = name
        self.process = process
        fields[name] = self
1342788
def append(self, from_group_id, to_group_id, session):
        ''''''
        request = TOPRequest('taobao.crm.group.append')
        request['from_group_id'] = from_group_id
        request['to_group_id'] = to_group_id
        self.create(self.execute(request, session), fields=['is_success',])
        return self.is_success
1187161
def add_group(self, name, devices):
        
        device = self.add_device(name, "group")
        device.add_to_group(devices)
        return device
383365
def add(self, *args, **kwargs):
        """"""

        if self.start and self.start.state == 'done' and kwargs.get('log_action') != 'done':
            raise ProgressLoggingError("Can't add -- process section is done")

        self.augment_args(args, kwargs)

        kwargs['log_action'] = kwargs.get('log_action', 'add')

        rec = Process(**kwargs)

        self._session.add(rec)

        self.rec = rec

        if self._logger:
            self._logger.info(self.rec.log_str)

        self._session.commit()
        self._ai_rec_id = None

        return self.rec.id
444306
private function addGroup($group)
	{
		if($group != null)
		{
			if($this->_groups == null)
				$this->_groups = array();
			$this->_groups[] = $group;
		}
	}
805685
def launch_processes(tests, run_module, group=True, **config):
    
    manager = multiprocessing.Manager()
    test_summaries = manager.dict()
    process_handles = [multiprocessing.Process(target=run_module.run_suite,
                       args=(test, config[test], test_summaries)) for test in tests]
    for p in process_handles:
        p.start()
    for p in process_handles:
        p.join()

    if group:
        summary = run_module.populate_metadata(tests[0], config[tests[0]])
        summary["Data"] = dict(test_summaries)
        return summary
    else:
        test_summaries = dict(test_summaries)
        summary = []
        for ii, test in enumerate(tests):
            summary.append(run_module.populate_metadata(test, config[test]))
            if summary[ii]:
                summary[ii]['Data'] = {test: test_summaries[test]}
        return summary
1215468
def add_process(self, tgt, args=None, kwargs=None, name=None):
        '''
        
        '''
        if args is None:
            args = []

        if kwargs is None:
            kwargs = {}

        if salt.utils.platform.is_windows():
            # Need to ensure that 'log_queue' and 'log_queue_level' is
            # correctly transferred to processes that inherit from
            # 'MultiprocessingProcess'.
            if type(MultiprocessingProcess) is type(tgt) and (
                    issubclass(tgt, MultiprocessingProcess)):
                need_log_queue = True
            else:
                need_log_queue = False

            if need_log_queue:
                if 'log_queue' not in kwargs:
                    if hasattr(self, 'log_queue'):
                        kwargs['log_queue'] = self.log_queue
                    else:
                        kwargs['log_queue'] = (
                            salt.log.setup.get_multiprocessing_logging_queue()
                        )
                if 'log_queue_level' not in kwargs:
                    if hasattr(self, 'log_queue_level'):
                        kwargs['log_queue_level'] = self.log_queue_level
                    else:
                        kwargs['log_queue_level'] = (
                            salt.log.setup.get_multiprocessing_logging_level()
                        )

        # create a nicer name for the debug log
        if name is None:
            if isinstance(tgt, types.FunctionType):
                name = '{0}.{1}'.format(
                    tgt.__module__,
                    tgt.__name__,
                )
            else:
                name = '{0}{1}.{2}'.format(
                    tgt.__module__,
                    '.{0}'.format(tgt.__class__) if six.text_type(tgt.__class__) != "<type 'type'>" else '',
                    tgt.__name__,
                )

        if type(multiprocessing.Process) is type(tgt) and issubclass(tgt, multiprocessing.Process):
            process = tgt(*args, **kwargs)
        else:
            process = multiprocessing.Process(target=tgt, args=args, kwargs=kwargs, name=name)

        if isinstance(process, SignalHandlingMultiprocessingProcess):
            with default_signals(signal.SIGINT, signal.SIGTERM):
                process.start()
        else:
            process.start()
        log.debug("Started '%s' with pid %s", name, process.pid)
        self._process_map[process.pid] = {'tgt': tgt,
                                          'args': args,
                                          'kwargs': kwargs,
                                          'Process': process}
        return process
1219164
public void addGroup(TimelineGroup group) {
        if (groups == null) {
            groups = new ArrayList<>();
        }

        groups.add(group);
    }
229621
function addParamGroups(command) {
  Object.defineProperty(command, 'paramGroups', {
    get: function() {
      var paramGroups = {};
      this.params.forEach(function(param) {
        var groupName = param.option || l10n.lookup('canonDefaultGroupName');
        if (paramGroups[groupName] == null) {
          paramGroups[groupName] = [];
        }
        paramGroups[groupName].push(param);
      });
      return paramGroups;
    },
    enumerable: true
  });
}
761426
def addGroupsToKey(server, activation_key, groups):
    '''
    
    '''

    try:
        client, key = _get_session(server)
    except Exception as exc:
        err_msg = 'Exception raised when connecting to spacewalk server ({0}): {1}'.format(server, exc)
        log.error(err_msg)
        return {'Error': err_msg}

    all_groups = client.systemgroup.listAllGroups(key)
    groupIds = []
    for group in all_groups:
        if group['name'] in groups:
            groupIds.append(group['id'])

    if client.activationkey.addServerGroups(key, activation_key, groupIds) == 1:
        return {activation_key: groups}
    else:
        return {activation_key: 'Failed to add groups to activation key'}