

def  __lowerCamelCase     (			UpperCamelCase__				):







							'''simple docstring'''






							return "".join([hex(UpperCamelCase__				)[2:].zfill(2				).upper() for byte in list(UpperCamelCase__				)]				)





def  __lowerCamelCase     (			UpperCamelCase__				):







							'''simple docstring'''






							if (len(UpperCamelCase__				) % 2) != 0:
														raise ValueError(
														    'Base16 encoded data is invalid:\nData does not have an even number of hex digits.'				)
							# Check the character set - the standard base16 alphabet
							# is uppercase according to RFC3548 section 6
							if not set(UpperCamelCase__				) <= set('0123456789ABCDEF'				):
														raise ValueError(
														    'Base16 encoded data is invalid:\nData is not uppercase hex or it contains invalid characters.'				)
							# For every two hexadecimal digits (= a byte), turn it into an integer.
							# Then, string the result together into bytes, and return it.
							return bytes(int(data[i] + data[i + 1]       ,							16				) for i in range(0       ,							len(UpperCamelCase__				)       ,							2				)				)


if __name__ == "__main__":
					import doctest

					doctest.testmod()







# Lint as: python3
import itertools
import os
import re


_UpperCAmelCase		:       str						    =	re.compile(R"""([A-Z]+)([A-Z][a-z])""")
_UpperCAmelCase		:       Dict						    =	re.compile(R"""([a-z\d])([A-Z])""")

_UpperCAmelCase		:       Dict						    =	re.compile(R"""(?<!_)_(?!_)""")
_UpperCAmelCase		:       Tuple						    =	re.compile(R"""(_{2,})""")

_UpperCAmelCase		:       Any						    =	R"""^\w+(\.\w+)*$"""

_UpperCAmelCase		:       List[str]						    =	R"""<>:/\|?*"""





def  __lowerCamelCase     (			UpperCamelCase__				):







							'''simple docstring'''






							snake_case_          =   _uppercase_uppercase_re.sub(r'\1_\2'       ,							UpperCamelCase__				)
							snake_case_          =   _lowercase_uppercase_re.sub(r'\1_\2'       ,							UpperCamelCase__				)
							return name.lower()





def  __lowerCamelCase     (			UpperCamelCase__				):







							'''simple docstring'''






							snake_case_          =   _single_underscore_re.split(UpperCamelCase__				)
							snake_case_          =   [_multiple_underscores_re.split(UpperCamelCase__				) for n in name]
							return "".join(n.capitalize() for n in itertools.chain.from_iterable(UpperCamelCase__				) if n != ''				)





def  __lowerCamelCase     (			UpperCamelCase__				):







							'''simple docstring'''






							if os.path.basename(UpperCamelCase__				) != name:
														raise ValueError(F'''Should be a dataset name, not a path: {name}'''				)
							return camelcase_to_snakecase(UpperCamelCase__				)





def  __lowerCamelCase     (			UpperCamelCase__       ,							UpperCamelCase__				):







							'''simple docstring'''






							if os.path.basename(UpperCamelCase__				) != name:
														raise ValueError(F'''Should be a dataset name, not a path: {name}'''				)
							if not re.match(_split_re       ,							UpperCamelCase__				):
														raise ValueError(F'''Split name should match \'{_split_re}\'\' but got \'{split}\'.'''				)
							return F'''{filename_prefix_for_name(UpperCamelCase__				)}-{split}'''





def  __lowerCamelCase     (			UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__=None				):







							'''simple docstring'''






							snake_case_          =   filename_prefix_for_split(UpperCamelCase__       ,							UpperCamelCase__				)
							if filetype_suffix:
														prefix += F'''.{filetype_suffix}'''
							snake_case_          =   os.path.join(UpperCamelCase__       ,							UpperCamelCase__				)
							return F'''{filepath}*'''





def  __lowerCamelCase     (			UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__=None       ,							UpperCamelCase__=None				):







							'''simple docstring'''






							snake_case_          =   filename_prefix_for_split(UpperCamelCase__       ,							UpperCamelCase__				)
							snake_case_          =   os.path.join(UpperCamelCase__       ,							UpperCamelCase__				)

							if shard_lengths:
														snake_case_          =   len(UpperCamelCase__				)
														snake_case_          =   [F'''{prefix}-{shard_id:05d}-of-{num_shards:05d}''' for shard_id in range(UpperCamelCase__				)]
														if filetype_suffix:
																					snake_case_          =   [filename + F'''.{filetype_suffix}''' for filename in filenames]
														return filenames
							else:
														snake_case_          =   prefix
														if filetype_suffix:
																					filename += F'''.{filetype_suffix}'''
														return [filename]




