code: def read_full(fileobj, size):
      
  
      if size < 0:
          raise ValueError("size must not be negative")
  
      data = fileobj.read(size)
      if len(data) != size:
          raise IOError
      return data
docs: Like fileobj.read but raises IOError if not all requested data is
      returned.
  
      If you want to distinguish IOError and the EOS case, better handle
      the error yourself instead of using this.
  
      Args:
          fileobj (fileobj)
          size (int): amount of bytes to read
      Raises:
          IOError: In case read fails or not enough data is read