docs: def _has_virtual_io_attrs(file, mode_int):
      """Check if file has all the necessary attributes for virtual IO."""
      readonly = mode_int == _snd.SFM_READ
      writeonly = mode_int == _snd.SFM_WRITE
      return all([
          hasattr(file, 'seek'),
          hasattr(file, 'tell'),
          hasattr(file, 'write') or readonly,
          hasattr(file, 'read') or hasattr(file, 'readinto') or writeonly,
      ])