def METHOD_NAME(cls, **cfg) -> Container:
    cfg = Container(cfg)
    workspace = Workspace(cfg.workspace)
    fix_random_seeds()
    upstream = cfg.upstream()
    stats = Container(
        feat_frame_shift=upstream.downsample_rate,
    )
    logger.info("Preparing corpus")
    train_data, valid_data, test_data, corpus_stats = cfg.corpus().split(3)
    stats = corpus_stats.add(stats)
    logger.info("Preparing train data")
    train_dataset = cfg.train_datapipe(**stats)(train_data, **stats)
    train_sampler = cfg.train_sampler(train_dataset)
    stats.override(train_dataset.all_tools())
    workspace.environ.update(stats)
    logger.info("Preparing valid data")
    valid_dataset = cfg.valid_datapipe(**dict(workspace.environ))(
        valid_data, **dict(workspace.environ)
    )
    valid_sampler = cfg.valid_sampler(valid_dataset)
    logger.info("Preparing test data")
    test_dataset = cfg.test_datapipe(**dict(workspace.environ))(
        test_data, **dict(workspace.environ)
    )
    test_sampler = cfg.test_sampler(test_dataset)
    logger.info("Preparing model and task")
    downstream = cfg.downstream(upstream.output_size, **dict(workspace.environ))
    model = UpstreamDownstreamModel(upstream, downstream)
    task = cfg.task(model, **dict(workspace.environ))
    workspace["train_data"] = train_data
    workspace["valid_data"] = valid_data
    workspace["test_data"] = test_data
    workspace["train_dataset"] = train_dataset
    workspace["train_sampler"] = train_sampler
    workspace["valid_dataset"] = valid_dataset
    workspace["valid_sampler"] = valid_sampler
    workspace["test_dataset"] = test_dataset
    workspace["test_sampler"] = test_sampler
    workspace["task"] = task