class_docstr: Dataclass for annotation clusters, which may span multiple segments.
class_docstr_tok: ["Dataclass","for","annotation","clusters",",","which","may","span","multiple","segments","."]
docstr: Override serialization to properly convert nested objects.
docstr_tok: ["Override","serialization","to","properly","convert","nested","objects","."]
code: def to_json(self) -> JsonDict:
      """Override serialization to properly convert nested objects."""
      d = super().to_json()
      d["spans"] = [s.to_json() for s in d["spans"]]
      return d
  
imports: import abc
  from collections.abc import Sequence
  from typing import Any, Optional, Union
  import attr
label_desc: Use image node_id 1 for calling the AnnotationCluster obj's underlying member method code with example usage: obj.to_json() and returns: d