def METHOD_NAME(memory_ds, s3_root_storage):
    with memory_ds as ds:
        ds.add_creds_key("ENV")
        ds.populate_creds("ENV", from_environment=True)
        nii_gz_4d = os.path.join(data_path, "example4d.nii.gz")
        img = nib.load(nii_gz_4d)
        with open(nii_gz_4d, "rb") as f:
            data = f.read()
        s3_root_storage["example4d.nii.gz"] = data
        ds.create_tensor("abc", htype="nifti", sample_compression="nii.gz")
        ds.create_tensor(
            "nifti_linked", htype="link[nifti]", sample_compression="nii.gz"
        )
        ds.abc.append(
            deeplake.read(f"{s3_root_storage.root}/example4d.nii.gz", verify=True)
        )
        ds.nifti_linked.append(
            deeplake.link(f"{s3_root_storage.root}/example4d.nii.gz", creds_key="ENV")
        )
        assert ds.abc[0].numpy().shape == img.shape
        assert ds.nifti_linked[0].numpy().shape == img.shape
        del s3_root_storage["example4d.nii.gz"]