





def _a (  SCREAMING_SNAKE_CASE__      :  int       )	->    str:

							'''simple docstring'''






							if isinstance(SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__       ):
														raise TypeError("'float' object cannot be interpreted as an integer"       )
							if isinstance(SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__       ):
														raise TypeError("'str' object cannot be interpreted as an integer"       )

							if num == 0:
														return "0b0"

							SCREAMING_SNAKE_CASE__       :      Union[str, Any]     =						False

							if num < 0:
														SCREAMING_SNAKE_CASE__       :      Any     =						True
														SCREAMING_SNAKE_CASE__       :      Union[str, Any]     =						-num

							SCREAMING_SNAKE_CASE__       :      list[int]     =						[]
							while num > 0:
														binary.insert(0			,				num % 2       )
														num >>= 1

							if negative:
														return "-0b" + "".join(str(SCREAMING_SNAKE_CASE__       ) for e in binary       )

							return "0b" + "".join(str(SCREAMING_SNAKE_CASE__       ) for e in binary       )


if __name__ == "__main__":
		import doctest

		doctest.testmod()













import pytest

from datasets.splits import SplitDict, SplitInfo
from datasets.utils.py_utils import asdict




@pytest.mark.parametrize(
    "split_dict"			,				[
        SplitDict(),
        SplitDict({"train": SplitInfo(name="train"			,				num_bytes=13_37			,				num_examples=42			,				dataset_name="my_dataset"       )}       ),
        SplitDict({"train": SplitInfo(name="train"			,				num_bytes=13_37			,				num_examples=42       )}       ),
        SplitDict({"train": SplitInfo()}       ),
    ]			,				)
def _a (  SCREAMING_SNAKE_CASE__      :  SplitDict       )	->    str:

							'''simple docstring'''






							SCREAMING_SNAKE_CASE__       :      Dict     =						split_dict._to_yaml_list()
							assert len(SCREAMING_SNAKE_CASE__       ) == len(SCREAMING_SNAKE_CASE__       )
							SCREAMING_SNAKE_CASE__       :      List[Any]     =						SplitDict._from_yaml_list(SCREAMING_SNAKE_CASE__       )
							for split_name, split_info in split_dict.items():
														# dataset_name field is deprecated, and is therefore not part of the YAML dump
														SCREAMING_SNAKE_CASE__       :      str     =						None
														# the split name of split_dict takes over the name of the split info object
														SCREAMING_SNAKE_CASE__       :      Union[str, Any]     =						split_name
							assert split_dict == reloaded







@pytest.mark.parametrize(
    "split_info"			,				[SplitInfo(), SplitInfo(dataset_name=SCREAMING_SNAKE_CASE__       ), SplitInfo(dataset_name="my_dataset"       )]       )
def _a (  SCREAMING_SNAKE_CASE__      :  Any       )	->    Dict:

							'''simple docstring'''






							SCREAMING_SNAKE_CASE__       :      str     =						asdict(SplitDict({"train": split_info}       )       )
							assert "dataset_name" in split_dict_asdict["train"]
							assert split_dict_asdict["train"]["dataset_name"] == split_info.dataset_name






