code: def test_read_video_partially_corrupted_file(self):
      with temp_video(5, 4, 4, 5, lossless=True) as (f_name, data):
          with open(f_name, "r+b") as f:
              size = os.path.getsize(f_name)
              bytes_to_overwrite = size // 10
              # seek to the middle of the file
              f.seek(5 * bytes_to_overwrite)
              # corrupt 10% of the file from the middle
              f.write(b"\xff" * bytes_to_overwrite)
          # this exercises the container.decode assertion check
          video, audio, info = io.read_video(f.name, pts_unit="sec")
          # check that size is not equal to 5, but 3
          # TODO fix this
          if get_video_backend() == "pyav":
              assert len(video) == 3
          else:
              assert len(video) == 4
          # but the valid decoded content is still correct
          assert_equal(video[:3], data[:3])
          # and the last few frames are wrong
          with pytest.raises(AssertionError):
              assert_equal(video, data)
  
imports: import contextlib
  import os
  import sys
  import tempfile
  import pytest
  import torch
  import torchvision.io
  from common_utils import assert_equal
  from torchvision import get_video_backend
label_desc: Use image node_id 14 for calling the TestVideo obj's underlying member method code with example usage: obj.test_read_video_partially_corrupted_file() without return types