Full canonical name: (<dataset_name>/<config_name>/<version>).
3966
def full_name(self):
    """"""
    names = [self._builder.name]
    if self._builder.builder_config:
      names.append(self._builder.builder_config.name)
    names.append(str(self.version))
    return posixpath.join(*names)
232323
def path(self):
        """"""
        # If root, return '/'
        if self.dataset is self:
            return ''
        else:  # Otherwise recurse
            return self.dataset.path + '/' + self.name
418463
def qualified_name(self):
        
        o = VersionedObject.construct(self.name, self.version)
        return str(o)
675003
def natural_name(self, value):
        """"""
        if value is None:
            value = ""
        if hasattr(self, "_natural_name") and self.name != "/":
            keys = [k for k in self._instances.keys() if k.startswith(self.fullpath)]
            dskeys = [k for k in Dataset._instances.keys() if k.startswith(self.fullpath)]
            self.parent.move(self._natural_name, value)
            for k in keys:
                obj = self._instances.pop(k)
                self._instances[obj.fullpath] = obj
            for k in dskeys:
                obj = Dataset._instances.pop(k)
                Dataset._instances[obj.fullpath] = obj
        self._natural_name = self.attrs["name"] = value
1109030
def get_dataset(dataset_name):
    
    # mnist
    if dataset == "mnist":
        train_data = gluon.data.DataLoader(
            gluon.data.vision.MNIST('./data', train=True, transform=transformer),
            batch_size, shuffle=True, last_batch='discard')

        val_data = gluon.data.DataLoader(
            gluon.data.vision.MNIST('./data', train=False, transform=transformer),
            batch_size, shuffle=False)
    # cifar10
    elif dataset == "cifar10":
        train_data = gluon.data.DataLoader(
            gluon.data.vision.CIFAR10('./data', train=True, transform=transformer),
            batch_size, shuffle=True, last_batch='discard')

        val_data = gluon.data.DataLoader(
            gluon.data.vision.CIFAR10('./data', train=False, transform=transformer),
            batch_size, shuffle=False)

    return train_data, val_data
1360501
def ltcube_sun(self, **kwargs):
        
        kwargs_copy = self.base_dict.copy()
        kwargs_copy.update(**kwargs)
        kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
        self._replace_none(kwargs_copy)        
        localpath = NameFactory.ltcubesun_format.format(**kwargs_copy)
        if kwargs.get('fullpath', False):
            return self.fullpath(localpath=localpath)
        return localpath
175659
def with_name(self, name):
        """"""
        if not self.name:
            raise ValueError("%r has an empty name" % (self,))
        return self._from_parsed_parts(self._drv, self._root,
                                       self._parts[:-1] + [name])
938071
def __normalize_name(self, name):
        

        if not name.startswith(self.__root_namespace):
            name = foundations.namespace.set_namespace(self.__root_namespace,
                                                       foundations.namespace.set_namespace(self.__default_namespace,
                                                                                           name))
            LOGGER.debug("> Normalized name: '{0}'.".format(name))
            return name
        else:
            LOGGER.debug("> Name '{0}' is already normalized!".format(name))
            return name
378288
def _update_names(self):
        """"""

        d = dict(
            table=self.table_name,
            time=self.time,
            space=self.space,
            grain=self.grain,
            variant=self.variant,
            segment=self.segment
        )

        assert self.dataset

        name = PartialPartitionName(**d).promote(self.dataset.identity.name)

        self.name = str(name.name)
        self.vname = str(name.vname)
        self.cache_key = name.cache_key
        self.fqname = str(self.identity.fqname)
1210449
def get_model_config(model_name, dataset):
    """"""
    model_map = _get_model_map(dataset.name)
    if model_name not in model_map:
        raise ValueError("Invalid model name \"%s\" for dataset \"%s\"" %
                         (model_name, dataset.name))
    else:
        return model_map[model_name]()
186225
def getDatasetByName(self, name):
        
        
        result = None
        for dataset in self.__datasets:
            datasetName = dataset.getName()
            if datasetName == name:
                result = dataset
                break
        return result
94356
def _canonicalize_name(prefix, qvm_type, noisy):
    
    if noisy:
        noise_suffix = '-noisy'
    else:
        noise_suffix = ''

    if qvm_type is None:
        qvm_suffix = ''
    elif qvm_type == 'qvm':
        qvm_suffix = '-qvm'
    elif qvm_type == 'pyqvm':
        qvm_suffix = '-pyqvm'
    else:
        raise ValueError(f"Unknown qvm_type {qvm_type}")

    name = f'{prefix}{noise_suffix}{qvm_suffix}'
    return name
959023
def read_dataset_metadata(self):
    """"""
    if self.dataset_meta:
      return
    shell_call(['gsutil', 'cp',
                'gs://' + self.storage_client.bucket_name + '/'
                + 'dataset/' + self.dataset_name + '_dataset.csv',
                LOCAL_DATASET_METADATA_FILE])
    with open(LOCAL_DATASET_METADATA_FILE, 'r') as f:
      self.dataset_meta = eval_lib.DatasetMetadata(f)
1226314
def canonical
      c = self.local.canonical
      c += "@" + self.host.canonical if self.host.canonical && self.host.canonical > " "
      c
    end
910238
def srcmaps(self, **kwargs):
        
        kwargs_copy = self.base_dict.copy()
        kwargs_copy.update(**kwargs)
        kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
        kwargs_copy['component'] = kwargs.get(
            'component', self.component(**kwargs))
        self._replace_none(kwargs_copy)        
        localpath = NameFactory.srcmaps_format.format(**kwargs_copy)
        if kwargs.get('fullpath', False):
            return self.fullpath(localpath=localpath)
        return localpath
926559
def _get_canonical(self):
        """"""

        # Assemble major, minor, micro version and append `pre`, `post`, or `dev` if needed..
        if self.micro == 0:
            ver = "{}.{}".format(self.major, self.minor)
        else:
            ver = "{}.{}.{}".format(self.major, self.minor, self.micro)
        if self._is_pre():
            ver += '{}{}'.format(REL_MAP[self.release], self.pre)
        if self._is_post():
            ver += ".post{}".format(self.post)
        if self._is_dev():
            ver += ".dev{}".format(self.dev)

        return ver
1303567
def canonical(self):
        """"""
        try:
            return tuple(map(lambda x: x.lower(), self.name()))
        except:
            return tuple([x.lower() for x in self.name()])