



UpperCamelCase__  =		{
    '0000': '0',
    '0001': '1',
    '0010': '2',
    '0011': '3',
    '0100': '4',
    '0101': '5',
    '0110': '6',
    '0111': '7',
    '1000': '8',
    '1001': '9',
    '1010': 'a',
    '1011': 'b',
    '1100': 'c',
    '1101': 'd',
    '1110': 'e',
    '1111': 'f',
}






def       snake_case      (							A    )							->							str:




	'''simple docstring'''


	lowerCamelCase_							:	Dict							     =							str(A    ).strip()

	# Exceptions
	if not binary_str:
		raise ValueError('Empty string was passed to the function'    )
	lowerCamelCase_							:	Any							     =							binary_str[0] == '-'
	lowerCamelCase_							:	Any							     =							binary_str[1:] if is_negative else binary_str
	if not all(char in '01' for char in binary_str    ):
		raise ValueError('Non-binary value was passed to the function'    )

	lowerCamelCase_							:	Dict							     =							(
	    '0' * (4 * (divmod(len(A    )		,     4    )[0] + 1) - len(A    )) + binary_str
	)

	lowerCamelCase_							:	List[str]							     =							[]
	for x in range(0		,     len(A    )		,     4    ):
		hexadecimal.append(BITS_TO_HEX[binary_str[x : x + 4]]    )
	lowerCamelCase_							:	Union[str, Any]							     =							'0x' + ''.join(A    )

	return "-" + hexadecimal_str if is_negative else hexadecimal_str


if __name__ == "__main__":
							from doctest import testmod

							testmod()






# this script builds a small sample spm file tests/fixtures/test_sentencepiece_no_bos.model, with features needed by pegasus

# 1. pip install sentencepiece
#
# 2. wget https://raw.githubusercontent.com/google/sentencepiece/master/data/botchan.txt

# 3. build
import sentencepiece as spm

# pegasus:
# 1. no bos
# 2. eos_id is 1
# 3. unk_id is 2
# build a sample spm file accordingly
spm.SentencePieceTrainer.train(
    '--input=botchan.txt --model_prefix=test_sentencepiece_no_bos --bos_id=-1 --unk_id=2  --eos_id=1  --vocab_size=1000'
)

# 4. now update the fixture
# mv test_sentencepiece_no_bos.model ../../tests/fixtures/
