Create an empty dataset in a group.
558703
def _create_dataset(
            self, group, chunk_size, compression, compression_opts):
        """"""
        if chunk_size == 'auto':
            chunks = True
        else:
            # if dtype is a variable str, guess representative size is 20 bytes
            per_chunk = (
                nb_per_chunk(20, 1, chunk_size) if self.dtype == np.dtype('O')
                else nb_per_chunk(
                        np.dtype(self.dtype).itemsize, 1, chunk_size))
            chunks = (per_chunk,)

        shape = (0,)
        maxshape = (None,)

        # raise if per_chunk >= 4 Gb, this is requested by h5py
        group.create_dataset(
            self.name, shape, dtype=self.dtype,
            chunks=chunks, maxshape=maxshape, compression=compression,
            compression_opts=compression_opts)
864671
def dataset(self, **kwargs):
        
        kwargs_copy = self.base_dict.copy()
        kwargs_copy.update(**kwargs)
        self._replace_none(kwargs_copy)
        try:
            return NameFactory.dataset_format.format(**kwargs_copy)
        except KeyError:
            return None
444253
def create(cls, train_ds, valid_ds, test_ds=None, path:PathOrStr='.', bs:int=32, val_bs:int=None, pad_idx=1,
               pad_first=True, device:torch.device=None, no_check:bool=False, backwards:bool=False, **dl_kwargs) -> DataBunch:
        ""
        datasets = cls._init_ds(train_ds, valid_ds, test_ds)
        val_bs = ifnone(val_bs, bs)
        collate_fn = partial(pad_collate, pad_idx=pad_idx, pad_first=pad_first, backwards=backwards)
        train_sampler = SortishSampler(datasets[0].x, key=lambda t: len(datasets[0][t][0].data), bs=bs)
        train_dl = DataLoader(datasets[0], batch_size=bs, sampler=train_sampler, drop_last=True, **dl_kwargs)
        dataloaders = [train_dl]
        for ds in datasets[1:]:
            lengths = [len(t) for t in ds.x.items]
            sampler = SortSampler(ds.x, key=lengths.__getitem__)
            dataloaders.append(DataLoader(ds, batch_size=val_bs, sampler=sampler, **dl_kwargs))
        return cls(*dataloaders, path=path, device=device, collate_fn=collate_fn, no_check=no_check)
162309
def add_dataset(data_type, val, unit_id=None, metadata={}, name="", user_id=None, flush=False):
    

    d = Dataset()

    d.type  = data_type
    d.value = val
    d.set_metadata(metadata)

    d.unit_id  = unit_id
    d.name  = name
    d.created_by = user_id
    d.hash  = d.set_hash()

    try:
        existing_dataset = db.DBSession.query(Dataset).filter(Dataset.hash==d.hash).one()
        if existing_dataset.check_user(user_id):
            d = existing_dataset
        else:
            d.set_metadata({'created_at': datetime.datetime.now()})
            d.set_hash()
            db.DBSession.add(d)
    except NoResultFound:
        db.DBSession.add(d)

    if flush == True:
        db.DBSession.flush()
    return d
1125385
def insertDataset(self, dataset):
        
        try:
            models.Dataset.create(
                id=dataset.getId(),
                name=dataset.getLocalId(),
                description=dataset.getDescription(),
                attributes=json.dumps(dataset.getAttributes()))
        except Exception:
            raise exceptions.DuplicateNameException(
                dataset.getLocalId())
447786
def _databunch_load_empty(cls, path, fname:str='export.pkl'):
    ""
    sd = LabelLists.load_empty(path, fn=fname)
    return sd.databunch()
1180579
public static List<String> replaceNullValueWithEmptyGroup(@Nonnull final List<String> groups) {
		Check.notNull(groups, "groups");

		final List<String> result = new ArrayList<String>(groups.size());
		for (final String group : groups) {
			if (group == null) {
				result.add(EMPTY_GROUP);
			} else {
				result.add(group);
			}
		}
		for (int i = result.size(); i < MIN_GROUP_SIZE; i++) {
			result.add(EMPTY_GROUP);
		}
		return result;
	}
43979
def drop_empty_records(x, axis=1):
    
    # load module
    import numpy as np
    # input args check
    if not isinstance(x, np.ndarray or np.matrix):
        raise ValueError("x is not a numpy.ndarray or numpy.matrix.")

    # index
    idx = np.logical_not(np.all(np.logical_or(
        np.isnan(x), np.isinf(x)), axis=axis))

    if axis is 1:
        return x[idx, :].copy()
    elif axis is 0:
        return x[:, idx].copy()
    else:
        raise ValueError("only 2-dimensional datasets are supported.")
55798
def group_create(auth=None, **kwargs):
    '''
    
    '''
    cloud = get_operator_cloud(auth)
    kwargs = _clean_kwargs(keep_name=True, **kwargs)
    return cloud.create_group(**kwargs)
325298
def write_array_empty(self, key, value):
        

        # ugly hack for length 0 axes
        arr = np.empty((1,) * value.ndim)
        self._handle.create_array(self.group, key, arr)
        getattr(self.group, key)._v_attrs.value_type = str(value.dtype)
        getattr(self.group, key)._v_attrs.shape = value.shape
785461
def combine_dfs(dfs, names, method):
    """"""
    if method == "track":
        res = list()
        for df, identifier in zip(dfs, names):
            df["dataset"] = identifier
            res.append(df)
        return pd.concat(res, ignore_index=True)
    elif method == "simple":
        return pd.concat(dfs, ignore_index=True)
642220
def create_empty(cls, val=0x00):
        
        userdata_dict = {}
        for i in range(1, 15):
            key = 'd{}'.format(i)
            userdata_dict.update({key: val})
        return userdata_dict
796267
def create(cls, api, default_name=None, description=None):
        
        path = 'group'

        data = {}
        if default_name:
            data['default_group_name'] = default_name
        if description:
            data['description'] = description
        if api.domain:
            data['domain'] = api.domain

        response_data = api.request(path, data=data)

        id = response_data['group_id']
        group = cls(api, id)
        group.default_name = response_data['default_group_name']

        return group
552301
function (key, devices) {
    if (_.isUndefined(devices)) { // Just create group without any device.
      refs.userGroups.child(key).set(false, function (err) {
        if (!err) debug('Empty group created: ', key);
      });
    } else {
      refs.userGroups.child(key).set(devices);
    }
  }
326999
def generate_data(self, data_dir, tmp_dir, task_id=-1):
    """"""
    filepath_fns = {
        problem.DatasetSplit.TRAIN: self.training_filepaths,
        problem.DatasetSplit.EVAL: self.dev_filepaths,
        problem.DatasetSplit.TEST: self.test_filepaths,
    }

    # We set shuffled=True as we don't want to shuffle on disk later.
    split_paths = [(split["split"], filepath_fns[split["split"]](
        data_dir, split["shards"], shuffled=True))
                   for split in self.dataset_splits]
    all_paths = []
    for _, paths in split_paths:
      all_paths.extend(paths)

    if self.is_generate_per_split:
      for split, paths in split_paths:
        generator_utils.generate_files(
            self.generate_encoded_samples(data_dir, tmp_dir, split),
            paths,
            cycle_every_n=self.total_number_of_frames // len(paths))
    else:
      generator_utils.generate_files(
          self.generate_encoded_samples(data_dir, tmp_dir,
                                        problem.DatasetSplit.TRAIN),
          all_paths,
          cycle_every_n=self.total_number_of_frames // len(all_paths))
1088696
def save_dataset(self, dataset_id, filename=None, writer=None, overlay=None, compute=True, **kwargs):
        """"""
        if writer is None and filename is None:
            writer = 'geotiff'
        elif writer is None:
            writer = self.get_writer_by_ext(os.path.splitext(filename)[1])

        writer, save_kwargs = load_writer(writer,
                                          ppp_config_dir=self.ppp_config_dir,
                                          filename=filename,
                                          **kwargs)
        return writer.save_dataset(self[dataset_id],
                                   overlay=overlay, compute=compute,
                                   **save_kwargs)
544911
static DocumentSet emptySet(final Comparator<QueryDocumentSnapshot> comparator) {
    return new DocumentSet(
        EMPTY_DOCUMENT_MAP,
        new ImmutableSortedSet<>(Collections.<QueryDocumentSnapshot>emptyList(), comparator));
  }