Add a turret object to current turrets configuration

        :param dict turret_data: the data of the turret to add
        :param bool is_started: tell if test are already runing
343015
def add(self, turret_data, is_started=False):
        
        if turret_data.get('uuid') in self.turrets:
            return False

        turret = Turret(**turret_data)
        self.write(turret)
        self.turrets[turret.uuid] = turret

        if is_started:
            self.publish(self.START, turret.uuid)

        return True
998093
def add_bundle(self, data: dict) -> models.Bundle:
        
        bundle_obj = self.bundle(data['name'])
        if bundle_obj and self.version(bundle_obj.name, data['created']):
            LOG.debug('version of bundle already added')
            return None

        if bundle_obj is None:
            bundle_obj = self.new_bundle(name=data['name'], created_at=data['created'])

        version_obj = self.new_version(created_at=data['created'], expires_at=data.get('expires'))

        tag_names = set(tag_name for file_data in data['files'] for tag_name in file_data['tags'])
        tag_map = self._build_tags(tag_names)

        for file_data in data['files']:
            LOG.debug(f"adding file: {file_data['path']}")
            if not Path(file_data['path']).exists():
                raise FileNotFoundError(file_data['path'])
            tags = [tag_map[tag_name] for tag_name in file_data['tags']]
            new_file = self.new_file(file_data['path'], to_archive=file_data['archive'], tags=tags)
            version_obj.files.append(new_file)

        version_obj.bundle = bundle_obj
        return bundle_obj, version_obj
705364
def update_data(new_data)
      @name = new_data[:name] || new_data['name'] || @name
      @hoist = new_data['hoist'] unless new_data['hoist'].nil?
      @hoist = new_data[:hoist] unless new_data[:hoist].nil?
      @colour = new_data[:colour] || (new_data['color'] ? ColourRGB.new(new_data['color']) : @colour)
    end
499872
def _add_new_items(self, config, seen):
        ''''''
        for (key, value) in self.items():
            if key not in seen:
                self._set_value(config, key, value)
1373212
public void registerStatus(MtasSolrStatus item) throws IOException {
    history.add(item);
    running.add(item);
  }
61998
private void initData(final List<ChartData> DATA) {
        if (null == DATA || DATA.isEmpty()) {
            for (int i = 0; i < (getNoOfSectors() + 1); i++) { addData(new ChartData(0d)); }
        } else {
            setData(DATA);
        }
    }
1101319
def _init(self, state, initiate_arg):
        '''
        
        '''
        state.descriptor = None
        state.hosts = state.agent.query_partners('hosts')
        state.current_index = -1

        self.log('%s task initiated, will be trying to start a '
                 '%r on one of the hosts: %r', str(self.__class__.__name__),
                 initiate_arg, state.hosts)
        if len(state.hosts) == 0:
            # FIXME: Here would be a good idea to put an alert
            return self._fail('Shard Agent cannot start partner %r as it has '
                              'no Host Partners!' % (initiate_arg, ))
1305890
def add_data_list(self, dl):  # pragma: no cover - never used...
        
        if self.__data_lock.acquire():
            self.__data.extend(dl)
            self.__data_lock.release()
            return True
        return False
932299
function (data) {
          var isSigned = isTokenSigned(data.file);
          var isFinished = data.status === 'finished';
          var isComplete = isSigned && isFinished;
          debug('checking if run', url, 'is finished', isComplete);
          if (isComplete) {
            testRuns.removeListener('patched', checkIfRunIsFinished);
            resolve(data);
          }
        }
528215
def asset_add_asset(self, *args, **kwargs):
        
        if not self.cur_asset:
            return
        dialog = AssetAdderDialog(asset=self.cur_asset)
        dialog.exec_()
        assets = dialog.assets
        atypes = {}
        for c in self.asset_asset_model.root.childItems:
            atypes[c.internal_data()] = c
        for asset in assets:
            atypeitem = atypes.get(asset.atype)
            if not atypeitem:
                atypedata = djitemdata.AtypeItemData(asset.atype)
                atypeitem = treemodel.TreeItem(atypedata, self.asset_asset_model.root)
                atypes[asset.atype] = atypeitem
            assetdata = djitemdata.AssetItemData(asset)
            treemodel.TreeItem(assetdata, atypeitem)
        self.cur_asset.save()
1350443
function add(data, callback) {
        var id = hat() + '.json';
        repo.contents(id).add({
            content: btoa(JSON.stringify(data)),
            branch: options.branch,
            message: '+'
        }, function(err, res) {
           callback(err, res, id);
        });
    }
748911
def add(self, cmd):
        '''
        
        '''
        self.wait_ready()
        self._vehicle._handler.fix_targets(cmd)
        self._vehicle._wploader.add(cmd, comment='Added by DroneKit')
        self._vehicle._wpts_dirty = True
849987
def add_beacon(self, name, beacon_data):
        '''
        
        '''

        data = {}
        data[name] = beacon_data

        if name in self._get_beacons(include_opts=False):
            comment = 'Cannot update beacon item {0}, ' \
                      'because it is configured in pillar.'.format(name)
            complete = False
        else:
            if name in self.opts['beacons']:
                comment = 'Updating settings for beacon ' \
                          'item: {0}'.format(name)
            else:
                comment = 'Added new beacon item: {0}'.format(name)
            complete = True
            self.opts['beacons'].update(data)

        # Fire the complete event back along with updated list of beacons
        evt = salt.utils.event.get_event('minion', opts=self.opts)
        evt.fire_event({'complete': complete, 'comment': comment,
                        'beacons': self.opts['beacons']},
                       tag='/salt/minion/minion_beacon_add_complete')

        return True
1269272
def add_vts(self, task_name, targets, cache_key, valid, phase):
    
    if task_name not in self._task_reports:
      self.add_task(task_name)
    self._task_reports[task_name].add(targets, cache_key, valid, phase)
438483
public function addToProject() {
    $this->initializeBlt();
    $this->displayArt();
    $this->yell("BLT has been added to your project.");
    $this->say("This required a full `composer update`.");
    $this->say("BLT has added and modified various project files.");
    $this->say("Please inspect your repository.");
  }
494352
def train(self, **kwargs):
        
        log.info("Starting to train...")
        if not self.setup_run:
            self.setup()
        self.trained_tasks = []
        for task in self.tasks:
            data = self.reformatted_input[task.data_format]['data']
            target = self.reformatted_input[task.data_format]['target']
            if data is None:
                raise Exception("Data cannot be none.  Check the config file to make sure the right input is being read.")
            kwargs['data']=data
            kwargs['target']=target
            trained_task = self.execute_train_task_with_dependencies(task, **kwargs)
            self.trained_tasks.append(trained_task)
            #If the trained task alters the data in any way, pass it down the chain to the next task
            if hasattr(trained_task, 'data'):
                self.reformatted_input[task.data_format]['data'] = trained_task.data
        log.info("Finished training.")
975382
def _init_turrets(self):
        
        for turret in Turret.select():
            self.turrets.append(turret.to_dict())