def METHOD_NAME(notebook: str, device: str, s3_bucket: str):
    trainer_monkeypatch_code = inspect.getsource(patch_notebooks)
    notebook_name = os.path.split(notebook)[-1][:-len('.ipynb')]
    if notebook_name == 'medical_image_segmentation':
        pytest.skip('Dataset is only available via kaggle; need to authenticate on ci/cd')
    if notebook_name == 'training_with_submitit':
        pytest.skip('The CI does not support SLURM and submitit')
    if notebook_name == 'auto_microbatching' and device == 'cpu':
        pytest.skip('auto_microbatching notebook only runs with a gpu')
    if notebook_name == 'TPU_Training_in_composer':
        pytest.skip('The CI does not support tpus')
    if notebook_name == 'ffcv_dataloaders' and device == 'cpu':
        pytest.skip('The FFCV notebook requires CUDA')
    if notebook_name == 'ffcv_dataloaders' and device == 'gpu':
        pytest.skip('CIFAR10 download is flaky')
    if notebook_name == 'finetune_huggingface':
        pytest.skip(
            "Error that is unreproducible locally: ModuleNotFoundError: No module named 'transformers.models.ernie_m.configuration_ernie_m'"
        )
    if notebook_name == 'pretrain_finetune_huggingface':
        pytest.skip(
            "Error that is unreproducible locally: No module named 'transformers.models.mega.configuration_mega'")
    try:
        import boto3
    except ImportError as e:
        raise MissingConditionalImportError('streaming', 'boto3') from e
    obj = urlparse('s3://mosaicml-internal-integration-testing/read_only/CIFAR-10/')
    s3 = boto3.resource('s3')
    bucket = s3.Bucket(obj.netloc)
    files = bucket.objects.filter(Prefix=obj.path.lstrip('/'))
    for file in files:
        target = os.path.join(os.getcwd(), 'data', os.path.relpath(file.key, obj.path.lstrip('/')))
        if not os.path.exists(target):
            os.makedirs(os.path.dirname(target), exist_ok=True)
        if file.key[-1] == '/':
            continue
        bucket.download_file(file.key, target)
    with testbook.testbook(notebook) as tb:
        tb.inject(trainer_monkeypatch_code)
        tb.inject('patch_notebooks()')
        for i, cell in enumerate(tb.cells):
            if cell['cell_type'] != 'code':
                continue
            cell['source'] = modify_cell_source(tb,
                                                notebook_name=notebook_name,
                                                cell_source=cell['source'],
                                                s3_bucket=s3_bucket)
            tb.execute_cell(i)