'Set up all dataset config options.
Arguments:
repo_dir (str): repository directory.
set_name (str): One of "train" or "validation".
subset_pct (int): Percentage of dataset to use.'

def configure(self, repo_dir, set_name, subset_pct):

    assert ((subset_pct > 0) and (subset_pct <= 100)), 'subset_pct    must    be    between    0    and    100'
    assert (set_name in ['train', 'validation'])
    self.set_name = (set_name if (set_name == 'train') else 'val')
    self.archive_prefix = 'macrobatch_'
    cache_filepath = os.path.join(repo_dir, (self.archive_prefix + 'meta'))
    try:
        dataset_cache = dict()
        with open(cache_filepath, 'r') as f:
            for line in f:
                (k, v) = line.split()
                dataset_cache[k] = (float(v) if k.endswith('mean') else int(v))
    except IOError:
        raise IOError(("Cannot    find    '%s'.    Run    batch_writer    to    preprocess    the    data    and    create    batch    files    for    imageset" % cache_filepath))
    req_attributes = ['nclass', 'val_start', 'train_start', 'train_nrec', 'val_nrec']
    for r in req_attributes:
        if (r not in dataset_cache):
            raise ValueError(('Dataset    cache    missing    required    attribute    %s' % r))
    self.__dict__.update(dataset_cache)
    self.label = 'l_id'
    if isinstance(self.nclass, dict):
        self.nclass = self.nclass[self.label]
    self.recs_available = getattr(self, (self.set_name + '_nrec'))
    self.ndata = int(((self.recs_available * subset_pct) / 100.0))
