Datasets:
Formats:
csv
Languages:
English
Size:
< 1K
Tags:
robotics
embodied-ai
human-demonstration
egocentric-video
bimanual-manipulation
tactile-sensing
License:
Download player/runtime/python/Lib/site-packages/rerun/encodings/bool.py from alinarus/MultimodalData: direct link, hf CLI and curl.
- Browser
- Download file 1.47 kB
-
https://huggingface.co/datasets/alinarus/MultimodalData/resolve/main/player/runtime/python/Lib/site-packages/rerun/encodings/bool.py
- Command line
-
hf download hf://datasets/alinarus/MultimodalData/player/runtime/python/Lib/site-packages/rerun/encodings/bool.py
-
curl -L -o bool.py https://huggingface.co/datasets/alinarus/MultimodalData/resolve/main/player/runtime/python/Lib/site-packages/rerun/encodings/bool.py
1.47 kB
| # DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/python/mod.rs | |
| # Based on "crates/build/re_type_definitions/rerun/encodings/bool.def.rs". | |
| # You can extend this class by creating a "BoolExt" class in "bool_ext.py". | |
| from __future__ import annotations | |
| from collections.abc import Sequence | |
| from typing import TYPE_CHECKING, Any | |
| import numpy as np | |
| import pyarrow as pa | |
| from attrs import define, field | |
| from .._baseclasses import ( | |
| BaseBatch, | |
| ) | |
| __all__ = ["Bool", "BoolArrayLike", "BoolBatch", "BoolLike"] | |
| class Bool: | |
| """**Encoding**: A single boolean.""" | |
| def __init__(self: Any, value: BoolLike) -> None: | |
| """Create a new instance of the Bool encoding.""" | |
| # You can define your own __init__ function as a member of BoolExt in bool_ext.py | |
| self.__attrs_init__(value=value) | |
| def __bool__(self) -> bool: | |
| return self.value | |
| value: bool = field(converter=bool) | |
| if TYPE_CHECKING: | |
| BoolLike = Bool | bool | |
| """A type alias for any Bool-like object.""" | |
| else: | |
| BoolLike = Any | |
| BoolArrayLike = Bool | Sequence[BoolLike] | |
| """A type alias for any Bool-like array object.""" | |
| class BoolBatch(BaseBatch[BoolArrayLike]): | |
| _ARROW_DATATYPE = pa.bool_() | |
| def _native_to_pa_array(data: BoolArrayLike, data_type: pa.DataType) -> pa.Array: | |
| array = np.asarray(data, dtype=np.bool_).flatten() | |
| return pa.array(array, type=data_type) | |