Creates a new dataset instance for this scene.
        
        :param      dataset | <XChartDataset>
        
        :return     <XChartDatasetItem>
510149
def addDataset(self, dataset):
        
        item = XChartDatasetItem()
        self.addItem(item)
        item.setDataset(dataset)
        return item
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)
539457
def make_dataset_from_selfplay(data_extracts):
    
    tf_examples = (make_tf_example(features_lib.extract_features(pos), pi, result)
                   for pos, pi, result in data_extracts)
    return tf_examples
1301411
def create_dataset_file(root_dir, data):
  """"""
  file_path = os.path.join(root_dir, '{dataset_type}', '{dataset_name}.py')
  context = (
      _HEADER + _DATASET_DEFAULT_IMPORTS + _CITATION
      + _DESCRIPTION + _DATASET_DEFAULTS
  )

  with gfile.GFile(file_path.format(**data), 'w') as f:
    f.write(context.format(**data))
717628
def create(self, dataset_name, query, index_by, display_name):
        
        url = "{0}/{1}".format(self._cached_datasets_url, dataset_name)
        payload = {
            "query": query,
            "index_by": index_by,
            "display_name": display_name
        }
        return self._get_json(HTTPMethods.PUT, url, self._get_master_key(), json=payload)
1184000
def dataset(db=nil)
      db ||= self.class.default_db
      builder = Database::DatasetBuilder.new(db, self)
      builder.select(@columns)
      builder.filter(@filters)
      builder.order(@order)
      builder.limit(@limit) if @limit
      builder.dataset
    end
192285
def addDataset(self, dataset):
        
        self._datasets.append(dataset)
        self._dataChanged = True
        self._addDatasetAction(dataset)
672199
def _dataset_create_resources(self):
        # type: () -> None
        

        if 'resources' in self.data:
            self.old_data['resources'] = self._copy_hdxobjects(self.resources, hdx.data.resource.Resource, 'file_to_upload')
            self.init_resources()
            self.separate_resources()
31602
def _resampled_scene(self, new_scn, destination_area, reduce_data=True,
                         **resample_kwargs):
        """"""
        new_datasets = {}
        datasets = list(new_scn.datasets.values())
        if isinstance(destination_area, (str, six.text_type)):
            destination_area = get_area_def(destination_area)
        if hasattr(destination_area, 'freeze'):
            try:
                max_area = new_scn.max_area()
                destination_area = destination_area.freeze(max_area)
            except ValueError:
                raise ValueError("No dataset areas available to freeze "
                                 "DynamicAreaDefinition.")

        resamplers = {}
        reductions = {}
        for dataset, parent_dataset in dataset_walker(datasets):
            ds_id = DatasetID.from_dict(dataset.attrs)
            pres = None
            if parent_dataset is not None:
                pres = new_datasets[DatasetID.from_dict(parent_dataset.attrs)]
            if ds_id in new_datasets:
                replace_anc(new_datasets[ds_id], pres)
                if ds_id in new_scn.datasets:
                    new_scn.datasets[ds_id] = new_datasets[ds_id]
                continue
            if dataset.attrs.get('area') is None:
                if parent_dataset is None:
                    new_scn.datasets[ds_id] = dataset
                else:
                    replace_anc(dataset, pres)
                continue
            LOG.debug("Resampling %s", ds_id)
            source_area = dataset.attrs['area']
            try:
                if reduce_data:
                    key = source_area
                    try:
                        (slice_x, slice_y), source_area = reductions[key]
                    except KeyError:
                        slice_x, slice_y = source_area.get_area_slices(destination_area)
                        source_area = source_area[slice_y, slice_x]
                        reductions[key] = (slice_x, slice_y), source_area
                    dataset = self._slice_data(source_area, (slice_x, slice_y), dataset)
                else:
                    LOG.debug("Data reduction disabled by the user")
            except NotImplementedError:
                LOG.info("Not reducing data before resampling.")
            if source_area not in resamplers:
                key, resampler = prepare_resampler(
                    source_area, destination_area, **resample_kwargs)
                resamplers[source_area] = resampler
                self.resamplers[key] = resampler
            kwargs = resample_kwargs.copy()
            kwargs['resampler'] = resamplers[source_area]
            res = resample_dataset(dataset, destination_area, **kwargs)
            new_datasets[ds_id] = res
            if ds_id in new_scn.datasets:
                new_scn.datasets[ds_id] = res
            if parent_dataset is not None:
                replace_anc(res, pres)
1233147
@Override
    public ClustreamClustererAdapter create() {
        ClustreamClustererAdapter l = new ClustreamClustererAdapter(learner, dataset);
        if (dataset == null) {
            System.out.println("dataset null while creating");
        }
        return l;
    }
292706
def new_dataset(args):
    
    if not args.args:
        raise ParserError('you must specify an existing directory')
    outdir = Path(args.args.pop(0))
    if not outdir.exists():
        raise ParserError('you must specify an existing directory')

    id_pattern = re.compile('[a-z_0-9]+$')
    md = {}
    if args.args:
        md['id'] = args.args.pop(0)
    else:
        md['id'] = input('Dataset ID: ')

    while not id_pattern.match(md['id']):
        print('dataset id must only consist of lowercase ascii letters, digits and _ (underscore)!')
        md['id'] = input('Dataset ID: ')

    outdir = outdir / md['id']
    if not outdir.exists():
        outdir.mkdir()

    for key in ['title', 'url', 'license', 'conceptlist', 'citation']:
        md[key] = input('Dataset {0}: '.format(key))

    # check license!
    # check conceptlist!

    for path in Path(pylexibank.__file__).parent.joinpath('dataset_template').iterdir():
        if path.is_file():
            if path.suffix in ['.pyc']:
                continue  # pragma: no cover
            target = path.name
            content = read_text(path)
            if '+' in path.name:
                target = re.sub(
                    '\+([a-z]+)\+',
                    lambda m: '{' + m.groups()[0] + '}',
                    path.name
                ).format(**md)
            if target.endswith('_tmpl'):
                target = target[:-5]
                content = content.format(**md)
            write_text(outdir / target, content)
        else:
            target = outdir / path.name
            if target.exists():
                shutil.rmtree(str(target))
            shutil.copytree(str(path), str(target))
    del md['id']
    jsonlib.dump(md, outdir / 'metadata.json', indent=4)
321706
def addDataset(self):
        
        self._openRepo()
        dataset = datasets.Dataset(self._args.datasetName)
        dataset.setDescription(self._args.description)
        dataset.setAttributes(json.loads(self._args.attributes))
        self._updateRepo(self._repo.insertDataset, dataset)
199055
public DataSetInfo create(int dataSet) throws InvalidDataSetException {
		DataSetInfo info = dataSets.get(createKey(dataSet));
		if (info == null) {
			int recordNumber = (dataSet >> 8) & 0xFF;
			int dataSetNumber = dataSet & 0xFF;
			throw new UnsupportedDataSetException(recordNumber + ":" + dataSetNumber);
			// info = super.create(dataSet);
		}
		return info;
	}
924037
public Dataset createDataset(String datasetName) {
    // [START bigquery_create_dataset]
    Dataset dataset = null;
    DatasetInfo datasetInfo = DatasetInfo.newBuilder(datasetName).build();
    try {
      // the dataset was created
      dataset = bigquery.create(datasetInfo);
    } catch (BigQueryException e) {
      // the dataset was not created
    }
    // [END bigquery_create_dataset]
    return dataset;
  }
1042927
def load_dataset(*args, **kwargs):
    
    warnings.warn(
        "load_dataset` will be removed in a future version of xarray. The "
        "current behavior of this function can be achived by using "
        "`tutorial.open_dataset(...).load()`.",
        DeprecationWarning, stacklevel=2)
    return open_dataset(*args, **kwargs).load()
1354846
@Override
    public DataSet get(int i) {
        if (i >= numExamples() || i < 0)
            throw new IllegalArgumentException("invalid example number: must be 0 to " + (numExamples()-1) + ", got " + i);
        if (i == 0 && numExamples() == 1)
            return this;
        return new DataSet(getHelper(features,i), getHelper(labels, i), getHelper(featuresMask,i), getHelper(labelsMask,i));
    }
604668
def copy(self, datasets=None):
        
        new_scn = self.__class__()
        new_scn.attrs = self.attrs.copy()
        new_scn.dep_tree = self.dep_tree.copy()

        for ds_id in (datasets or self.keys()):
            # NOTE: Must use `.datasets` or side effects of `__setitem__`
            #       could hurt us with regards to the wishlist
            new_scn.datasets[ds_id] = self[ds_id]

        if not datasets:
            new_scn.wishlist = self.wishlist.copy()
        else:
            new_scn.wishlist = set([DatasetID.from_dict(ds.attrs)
                                    for ds in new_scn])
        return new_scn