Skip to main content
Version: 0.1.x

is_anno_mark

FunctionSource

flag: TypeGuard[AnnoMark] = is_anno_mark(data: Any)

Implementation of isinstance(data, AnnoMark).

Aliases​

This function can be acquired by

import dash_picture_annotation as dpa


dpa.is_anno_mark
dpa.typehints.is_anno_mark

Arguments​

Requires​

ArgumentTypeRequired
Description
dataAnyThe value to be verified.

Returns​

ArgumentType
Description
flagboolIf this value is True, data an instance of AnnoMark, vice versa.

Examples​

Check whether an object is an AnnoMark​

check_is_annomark.py
import dash_picture_annotation as dpa


print(dpa.is_anno_mark({}))
print(dpa.is_anno_mark({"x": 1, "y": 2}))
print(
dpa.is_anno_mark(
{"x": 1, "y": 2, "width": 1, "height": 1, "type": "RECT"}
)
)
print(
dpa.is_anno_mark(
{"id": "test", "x": 1, "y": 2, "width": 1, "height": 1, "type": "RECT"}
)
)
print(
dpa.is_anno_mark(
{"x": 1, "y": 2, "width": 1, "height": 1, "type": "rect"}
)
)