def METHOD_NAME(config):
    dataset_config = {
        "db_file": config.data.db,
        "input_encoder": g_input_encoder,
        "label_encoder": g_label_encoder,
        "is_cached": False,
    }
    output_base = config.data.output
    if config.data.train_set is not None:
        dataset = DatasetClass(name="train", data_file=config.data.train_set, **dataset_config)
        dataset.save(output_base, save_db=True)
        g_label_encoder.save(Path(output_base) / "label_vocabs")
    if config.data.dev_set is not None:
        dataset = DatasetClass(name="dev", data_file=config.data.dev_set, **dataset_config)
        dataset.save(output_base, save_db=False)
    if config.data.test_set is not None:
        dataset = DatasetClass(name="test", data_file=config.data.test_set, **dataset_config)
        dataset.save(output_base, save_db=False)