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
Argument | Type | Required | |
---|---|---|---|
data | Any | The value to be verified. |
Returns
Argument | Type | |
---|---|---|
flag | bool | If this value is True , data an instance of AnnoMark , vice versa. |
Examples
Check whether an object is an AnnoMark
- Codes
- Results
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"}
)
)
False
False
True
True
False