Adds a new dataset into this repo.
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)
955977
def add_data_dict(self, datadict):
        '''
        '''

        self.set_codes(list(datadict.keys()))
        self.add_data(list(datadict.values()))
215316
def wrap_dataset(dataset)
      if relation.is_a?(Relation::Composite)
        relation.new(dataset).to_a
      else
        dataset
      end
    end
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)
1005749
@SafeVarargs
  public static void populate(DataSet... dataSets) {
    ensureDistinctDataSources(dataSets, DataSet::getSource);
    foreach(dataSets, DBSetup::populate, CallInfo.create());
  }
704003
def add(client, name, urls, link, relative_to, target, force):
    """"""
    try:
        with client.with_dataset(name=name) as dataset:
            target = target if target else None
            with progressbar(urls, label='Adding data to dataset') as bar:
                for url in bar:
                    client.add_data_to_dataset(
                        dataset,
                        url,
                        link=link,
                        target=target,
                        relative_to=relative_to,
                        force=force,
                    )
    except FileNotFoundError:
        raise BadParameter('Could not process {0}'.format(url))
571564
def with(opts)
      new_options =
        if opts.key?(:meta)
          opts.merge(meta: meta.merge(opts[:meta]))
        else
          opts
        end

      new(dataset, options.merge(new_options))
    end
1367400
def removeDataset(self):
        
        self._openRepo()
        dataset = self._repo.getDatasetByName(self._args.datasetName)

        def func():
            self._updateRepo(self._repo.removeDataset, dataset)
        self._confirmDelete("Dataset", dataset.getLocalId(), func)
1163169
public void newDataSet(DataSetProviderType type,
                           RemoteCallback<DataSetDef> callback) throws Exception {
        dataSetDefServices.call(callback).createDataSetDef(type);
    }
254311
function Dataset(sc, dependencies) {
  this.id = sc.datasetIdCounter++;
  this.dependencies = dependencies || [];
  this.persistent = false;
  this.sc = sc;
}
1241435
def add_data_set(self, data, series_type="line", name=None, **kwargs):
        """"""

        self.data_set_count += 1
        if not name:
            name = "Series %d" % self.data_set_count
        kwargs.update({'name':name})

        if series_type == 'treemap':
            self.add_JSsource('http://code.highcharts.com/modules/treemap.js')

        series_data = Series(data, series_type=series_type, **kwargs)
       
        series_data.__options__().update(SeriesOptions(series_type=series_type, **kwargs).__options__())
        self.data_temp.append(series_data)
618105
def upload_dataset(self, dataset, dataset_name, schema_path=None):
        

        url = self.address + "/datasets/" + dataset_name + "/uploadSample"
        header = self.__check_authentication()

        fields = dict()
        remove = False
        if isinstance(dataset, GDataframe):
            tmp_path = TempFileManager.get_new_dataset_tmp_folder()
            dataset.to_dataset_files(local_path=tmp_path)
            dataset = tmp_path
            remove = True

        # a path is provided
        if not isinstance(dataset, str):
            raise TypeError("Dataset can be a path or a GDataframe. {} was passed".format(type(dataset)))

        file_paths, schema_path_found = Loader.get_file_paths(dataset)
        if schema_path is None:
            schema_path = schema_path_found
        fields['schema'] = (os.path.basename(schema_path), open(schema_path, "rb"), 'application/octet-stream')
        for i, file in enumerate(file_paths):
            fields["file"+str(i + 1)] = (os.path.basename(file), open(file, "rb"), 'application/octet-stream')

        encoder = MultipartEncoder(fields)
        callback = create_callback(encoder, len(fields))

        m_encoder = MultipartEncoderMonitor(encoder, callback)
        header['Content-Type'] = m_encoder.content_type

        self.logger.debug("Uploading dataset at {} with name {}".format(dataset, dataset_name))

        response = requests.post(url, data=m_encoder,
                                 headers=header)

        # closing files
        for fn in fields.keys():
            _, f, _ = fields[fn]
            f.close()

        if response.status_code != 200:
            raise ValueError("Code {}: {}".format(response.status_code, response.content))

        if remove:
            TempFileManager.delete_tmp_dataset(dataset)
1001868
private void addRecords(HBaseDataWrapper columnWrapper, List<HBaseDataWrapper> embeddableData,
            List<HBaseDataWrapper> dataSet)
    {
        dataSet.add(columnWrapper);

        if (!embeddableData.isEmpty())
        {
            dataSet.addAll(embeddableData);
        }
    }
358060
def add_dataset_to_collection(dataset_id, collection_id, **kwargs):
    
    collection_i = _get_collection(collection_id)
    collection_item = _get_collection_item(collection_id, dataset_id)
    if collection_item is not None:
        raise HydraError("Dataset Collection %s already contains dataset %s", collection_id, dataset_id)

    new_item = DatasetCollectionItem()
    new_item.dataset_id=dataset_id
    new_item.collection_id=collection_id

    collection_i.items.append(new_item)

    db.DBSession.flush()

    return 'OK'
513740
def _add_arg_datasets(datasets, args):
    
    for dataset in args:
        # turn a value into a 1-tuple.
        if not isinstance(dataset, (tuple, GentyArgs)):
            dataset = (dataset,)

        # Create a test_name_suffix - basically the parameter list
        if isinstance(dataset, GentyArgs):
            dataset_strings = dataset     # GentyArgs supports iteration
        else:
            dataset_strings = [format_arg(data) for data in dataset]
        test_method_suffix = ", ".join(dataset_strings)

        datasets[test_method_suffix] = dataset
979047
def create_dataset(
            self, group, chunk_size, compression=None, compression_opts=None):
        """"""
        group.attrs['format'] = self.dformat
        super(Features, self)._create_dataset(
            group, chunk_size, compression, compression_opts)

        # TODO attribute declared outside __init__ is not safe. Used
        # because Labels.create_dataset need it.
        if chunk_size != 'auto':
            self.nb_per_chunk = nb_per_chunk(
                self.dtype.itemsize, self.dim, chunk_size)
        else:
            self.nb_per_chunk = 'auto'
187859
public <D extends DataSet<?>> void add(int id, D set) {
		cacheSetType(id, SetType.DATA_SET);
		dataSets.put(id, set);
	}