          self.tokens = NumpyOps().unflatten(flat_tokens, lengths)
          self.spaces = NumpyOps().unflatten(flat_spaces, lengths)
          self.cats = msg["cats"]
          self.flags = msg.get("flags", [{} for _ in lengths])
          if self.store_user_data and "user_data" in msg:
              self.user_data = list(msg["user_data"])
          for tokens in self.tokens:
              assert len(tokens.shape) == 2, tokens.shape  # this should never happen
          return self
  
 
</s> remove             if self.store_user_data:
 </s> add             if i < len(self.user_data) and self.user_data[i] is not None: </s> remove         store_user_data (bool): Whether to include the `Doc.user_data`.
 </s> add         store_user_data (bool): Whether to write the `Doc.user_data` to bytes/file. </s> remove             raise ValueError(Errors.E166.format(current=self.attrs, other=other.attrs))
 </s> add             raise ValueError(
                Errors.E166.format(param="attrs", current=self.attrs, other=other.attrs)
            )
        if self.store_user_data != other.store_user_data:
            raise ValueError(
                Errors.E166.format(
                    param="store_user_data",
                    current=self.store_user_data,
                    other=other.store_user_data,
                )
            ) </s> remove         DocBins don't match.
 </s> add         DocBins don't match, or if they differ in whether or not to store
        user data.
        if "user_data" in msg:
          self.tokens = NumpyOps().unflatten(flat_tokens, lengths)
          self.spaces = NumpyOps().unflatten(flat_spaces, lengths)
          self.cats = msg["cats"]
          self.flags = msg.get("flags", [{} for _ in lengths])
        if "user_data" in msg:
              self.user_data = list(msg["user_data"])
          for tokens in self.tokens:
              assert len(tokens.shape) == 2, tokens.shape  # this should never happen
          return self
  
keep keep keep keep replace keep keep keep keep keep
 small UX fix for DocBin (#6167)

* add informative warning when messing up store_user_data DocBin flags

* add informative warning when messing up store_user_data DocBin flags

* cleanup test

* rename to patterns_path 
spacy/tokens/_serialize.py