def get_file_size(stream) ->int:
    """Given a seekable file, return its size."""
    assert stream.seekable(), 'Streams of type {} are not seekable'.format(type
        (stream))
    stream.seek(0, 2)
    size = stream.tell()
    stream.seek(0)
    return size
