<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extract_file_from_tar(bytes_io, expected_file):
 """extract a file from a bytes_io tar. Returns bytes"""

    with open('temp', 'wb+') as f:
        bytes_io.seek(0)
        shutil.copyfileobj(bytes_io, f, length=131072)
    tar = tarfile.open('temp', mode='r:gz')
    os.remove('temp')
    return tar.extractfile(expected_file).read()