Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def create_cifar(config, dataset_config, is_train, transform):
create_cifar_fn = None
if dataset_config == 'cifar100':
create_cifar_fn = partial(CIFAR100, config.dataset_dir, train=is_train, transform=transform)
if dataset_config == 'cifar10':
create_cifar_fn = partial(CIFAR10, config.dataset_dir, train=is_train, transform=transform)
if create_cifar_fn:
return safe_thread_call(partial(create_cifar_fn, download=True), partial(create_cifar_fn, download=False))
return None