Adds the given {@link DataSet} to this cache for the given ID.

@param id  Set ID
@param set DataSet to add
@param <D> DataSet class
187859
public <D extends DataSet<?>> void add(int id, D set) {
		cacheSetType(id, SetType.DATA_SET);
		dataSets.put(id, set);
	}
1224724
def _addDatasetAction(self, dataset):
        
        # create the toolbar action
        action = QAction(dataset.name(), self)
        action.setIcon(XColorIcon(dataset.color()))
        action.setCheckable(True)
        action.setChecked(True)
        action.setData(wrapVariant(dataset))
        action.toggled.connect(self.toggleDataset)
        
        self.uiDatasetTBAR.addAction(action)
254311
function Dataset(sc, dependencies) {
  this.id = sc.datasetIdCounter++;
  this.dependencies = dependencies || [];
  this.persistent = false;
  this.sc = sc;
}
230608
@SuppressWarnings("unchecked")
	public <T> DataSet<T> getDataSet(int id) {
		return verifyType(id, dataSets.get(id), SetType.DATA_SET);
	}
323627
def insertDatasetWOannex(self, dataset, blockcontent, otptIdList, conn,
                             insertDataset = True, migration = False):
        

        tran = conn.begin()
        try:
            #8 Finally, we have everything to insert a dataset
            if insertDataset:
                # Then we have to get a new dataset ID
                dataset['dataset_id'] = self.datasetid.execute(conn,
                                                dataset['dataset'])
                if dataset['dataset_id'] <= 0:
                    dataset['dataset_id'] = self.sm.increment(conn, "SEQ_DS")
                    if not migration:
                        dataset['last_modified_by'] = dbsUtils().getCreateBy()
                        dataset['create_by'] = dbsUtils().getCreateBy()
                        dataset['creation_date'] = dataset.get('creation_date', dbsUtils().getTime())
                        dataset['last_modification_date'] = dataset.get('last_modification_date', dbsUtils().getTime())
                    dataset['xtcrosssection'] = dataset.get('xtcrosssection', None)
                    dataset['prep_id'] = dataset.get('prep_id', None)
                    try:
                        self.datasetin.execute(conn, dataset, tran)
                    except exceptions.IntegrityError as ei:
                        if str(ei).find("ORA-00001") != -1 or str(ei).lower().find("duplicate") !=-1:
                            if conn.closed:
                                conn = self.dbi.connection()
                            dataset['dataset_id'] = self.datasetid.execute(conn, dataset['dataset'])
                            if dataset['dataset_id'] <= 0:
                                if tran:tran.rollback()
                                if conn:conn.close()
                                dbsExceptionHandler('dbsException-conflict-data',
                                                    'Dataset/[processed DS]/[dataset access type] not yet inserted by concurrent insert. ',
                                                    self.logger.exception,
                                                    'Dataset/[processed DS]/[dataset access type] not yet inserted by concurrent insert. '+ str(ei))
                        elif str(ei).find("ORA-01400") > -1:
                            if tran:tran.rollback()
                            if conn:conn.close()
                            dbsExceptionHandler('dbsException-missing-data',
                                'Missing data when insert Datasets. ',
                                self.logger.exception,
                                'Missing data when insert Datasets. '+ str(ei))
                        else:
                            if tran: tran.rollback()
                            if conn: conn.close()
                            dbsExceptionHandler('dbsException-invalid-input2',
                            'Invalid data when insert Datasets. ',
                            self.logger.exception,
                            'Invalid data when insert Datasets. '+ str(ei))

                    except Exception:
                        #should catch all above exception to rollback. YG Jan 17, 2013
                        if tran:tran.rollback()
                        if conn:conn.close()
                        raise

            #9 Fill Dataset Parentage
            #All parentage are deduced from file parentage.

            #10 Before we commit, make dataset and output module configuration
            #mapping.  We have to try to fill the map even if dataset is
            #already in dest db
            for c in otptIdList:
                try:
                    dcObj = {
                             'dataset_id' : dataset['dataset_id'],
                             'output_mod_config_id' : c }
                    self.dcin.execute(conn, dcObj, tran)
                except exceptions.IntegrityError as ei:
                    #FIXME YG 01/17/2013
                    if (str(ei).find("ORA-00001") != -1 and str(ei).find("TUC_DC_1") != -1) or \
                            str(ei).lower().find("duplicate")!=-1:
                    #ok, already in db
                    #FIXME: What happens when there are partially in db?
                    #YG 11/17/2010
                        pass
                    else:
                        if tran:tran.rollback()
                        if conn:conn.close()
                        dbsExceptionHandler('dbsException-invalid-input2',
                            'Invalid data when insert dataset_configs. ',
                            self.logger.exception,
                            'Invalid data when insert dataset_configs. '+ str(ei))
                except Exception as ex:
                    if tran:tran.rollback()
                    if conn:conn.close()
                    raise
            #Now commit everything.
            tran.commit()
        except exceptions.IntegrityError as ei:
            # Then is it already in the database?
            # Not really. We have to check it again. YG Jan 17, 2013
            # we don't check the unique key here, since there are more than one unique key might
            # be violated: such as data_tier, processed_dataset, dataset_access_types.
            if str(ei).find("ORA-00001") != -1 or str(ei).lower().find("duplicate")!=-1:
                # For now, we assume most cases are the same dataset was instered by different thread. If not,
                # one has to call the insert dataset again. But we think this is a rare case and let the second
                # DBSBlockInsert call fix it if it happens.
                if conn.closed:
                    conn = self.dbi.connection()
                dataset_id = self.datasetid.execute(conn, dataset['dataset'])
                if dataset_id <= 0:
                    dbsExceptionHandler('dbsException-conflict-data',
                                        'Dataset not yet inserted by concurrent insert',
                                        self.logger.exception,
                                        'Dataset not yet inserted by concurrent insert')

                else:
                    dataset['dataset_id'] = dataset_id
            else:
                if tran:tran.rollback()
                if conn:conn.close()
                dbsExceptionHandler('dbsException-invalid-input2',
                    'Invalid data when insert Datasets. ',
                    self.logger.exception,
                    'Invalid data when insert Datasets. '+ str(ei))
        except Exception as ex:
            if tran:tran.rollback()
            if conn:conn.close()
            raise
        finally:
            if tran:tran.rollback()
            if conn:conn.close()
        return dataset['dataset_id']
1326307
protected function addAlternativeProductConcreteId(DataSetInterface $dataSet): void
    {
        $productConcreteSku = $dataSet[ProductAlternativeDataSetInterface::KEY_COLUMN_ALTERNATIVE_PRODUCT_CONCRETE_SKU];

        if (!isset($this->idProductConcreteCache[$productConcreteSku])) {
            /** @var \Orm\Zed\Product\Persistence\SpyProduct|null $productConcreteEntity */
            $productConcreteEntity = SpyProductQuery::create()->findOneBySku($productConcreteSku);
            if (!$productConcreteEntity) {
                throw new EntityNotFoundException(
                    sprintf(
                        'Could not find product by sku "%s"',
                        $productConcreteSku
                    )
                );
            }

            $this->idProductConcreteCache[$productConcreteSku] = $productConcreteEntity->getIdProduct();
        }
        $dataSet[ProductAlternativeDataSetInterface::FK_PRODUCT_CONCRETE_ALTERNATIVE] = $this->idProductConcreteCache[$productConcreteSku];
    }
998469
public static void write(IDataSet dataSet, Writer writer, String encoding) throws DataSetException {
		if (logger.isDebugEnabled()) {
			logger.debug("write(dataSet={}, writer={}, encoding={}) - start", new Object[] { dataSet, writer, encoding });
		}

		FlatXmlWriter datasetWriter = new FlatXmlWriter(writer, encoding);
		datasetWriter.setIncludeEmptyTable(true);
		datasetWriter.write(dataSet);
	}
1269939
@SuppressWarnings("unchecked")
  protected <T> T set(DBIDRef id, int index, T value) {
    T ret = (T) data[idmap.mapDBIDToOffset(id)][index];
    data[idmap.mapDBIDToOffset(id)][index] = value;
    return ret;
  }
141583
public function execute(DataSetInterface $dataSet): void
    {
        if (!$dataSet[MerchantRelationshipDataSetInterface::COMPANY_BUSINESS_UNIT_ASSIGNEE_KEYS]) {
            $dataSet[MerchantRelationshipDataSetInterface::ID_COMPANY_BUSINESS_UNIT_ASSIGNEE_COLLECTION] = [];

            return;
        }

        $companyBusinessUnitKeys = explode(
            $this->getAssigneeDelimiter(),
            $dataSet[MerchantRelationshipDataSetInterface::COMPANY_BUSINESS_UNIT_ASSIGNEE_KEYS]
        );

        $companyBusinessUnitAssignee = [];
        foreach ($companyBusinessUnitKeys as $companyBusinessUnitKey) {
            $companyBusinessUnitAssignee[] = $this->findIdCompanyBusinessUnit($companyBusinessUnitKey);
        }

        $dataSet[MerchantRelationshipDataSetInterface::ID_COMPANY_BUSINESS_UNIT_ASSIGNEE_COLLECTION] = $companyBusinessUnitAssignee;
    }
1184462
public void setIds(java.util.Collection<String> ids) {
        if (ids == null) {
            this.ids = null;
            return;
        }

        this.ids = new java.util.ArrayList<String>(ids);
    }
209122
function(dataset){
    this.sources.push(dataset);
    // add event listeners to source
    if (this.listen.source)
      dataset.addHandler(this.listen.source, this);

    // process new dataset objects and update member map
    var memberMap = this.members_;
    for (var objectId in dataset.items_)
    {
      // check: is this object already known
      if (memberMap[objectId])
      {
        // item exists -> increase dataset links count
        memberMap[objectId].count++;
      }
      else
      {
        // add to source map
        memberMap[objectId] = {
          count: 1,
          isMember: false,
          object: dataset.items_[objectId]
        };
      }
    }

    return true;
  }
944722
public void addObjectId( IdKey id, Object instance ) {
        if ( null == idToObject ) {
            idToObject = new HashMap<IdKey, Object>();
        }
        idToObject.put( id, instance );
    }
3716
public void addSet(final SortedSet<T> set) {
        SortedMap<T, UBNode<T>> nodes = rootNodes;
        UBNode<T> node = null;
        for (T element : set) {
            node = nodes.get(element);
            if (node == null) {
                node = new UBNode<>(element);
                nodes.put(element, node);
            }
            nodes = node.children();
        }
        if (node != null) {
            node.setEndSet(set);
        }
    }
705980
public void setDataset(String v) {
    if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_dataset == null)
      jcasType.jcas.throwFeatMissing("dataset", "edu.cmu.lti.oaqa.framework.types.InputElement");
    jcasType.ll_cas.ll_setStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_dataset, v);}
1295073
public static void write(IDataSet dataSet, OutputStream out) throws IOException, DataSetException {
		logger.debug("write(dataSet={}, out={}) - start", dataSet, out);

		FlatXmlWriter datasetWriter = new FlatXmlWriter(out);
		datasetWriter.setIncludeEmptyTable(true);
		datasetWriter.write(dataSet);
	}
199580
private void persistDatasetState(String datasetUrn, JobState.DatasetState datasetState)
      throws IOException {
    log.info("Persisting dataset state for dataset " + datasetUrn);
    this.jobContext.getDatasetStateStore().persistDatasetState(datasetUrn, datasetState);
  }
1219386
public static BatchCSVRecord fromDataSet(DataSet dataSet) {
        BatchCSVRecord batchCSVRecord = new BatchCSVRecord();
        for (int i = 0; i < dataSet.numExamples(); i++) {
            batchCSVRecord.add(SingleCSVRecord.fromRow(dataSet.get(i)));
        }

        return batchCSVRecord;
    }