code: def read_header(stream):
      
      type_id = stream.read(4)
      if type_id != b"DIRC":
          raise AssertionError("Invalid index file header: %r" % type_id)
      version, num_entries = unpack(">LL", stream.read(4 * 2))
  
      # TODO: handle version 3: extended data, see read-cache.c
      assert version in (1, 2)
      return version, num_entries
docs: Return tuple(version_long, num_entries) from the given stream