get_annotation

samplomatic.utils.get_annotation(box: BoxOp, annotation_type: type[Annotation]) Annotation | None[source]

Return a box’s first annotation of the given type.

Parameters:
  • box – The box to return the annotation for.

  • annotation_type – The type of the desired annotation.

Returns:

The box’s first annotation of the given type, or None if it does not contain an annotation of the given type.