code: def test_serialize_doc_roundtrip_bytes(en_vocab):
      doc = Doc(en_vocab, words=["hello", "world"])
      doc.cats = {"A": 0.5}
      doc_b = doc.to_bytes()
      new_doc = Doc(en_vocab).from_bytes(doc_b)
      assert new_doc.to_bytes() == doc_b
  
imports: import copy
  import pickle
  import numpy
  import pytest
  from spacy.attrs import DEP, HEAD
  from spacy.lang.en import English
  from spacy.language import Language
  from spacy.matcher import Matcher, PhraseMatcher
  from spacy.tokens import Doc
  from spacy.vectors import Vectors
  from spacy.vocab import Vocab
  from ..util import make_tempdir
label_desc: Use image node_id 11 for calling a global function with example usage: test_serialize_doc_roundtrip_bytes(en_vocab) without return types