


import argparse


__UpperCamelCase    		=       'docs/source/_static/js/custom.js'
def        UpperCamelCase_(				_A   :Dict  )->		Dict:
			with open(_A				,     encoding="utf-8"				,     newline="\n"  ) as f:
						UpperCamelCase__					=       f.readlines()
			UpperCamelCase__					=       0

			# First let's put the right version
			while not lines[index].startswith("const stableVersion ="  ):
						index += 1
			UpperCamelCase__					=       F'''const stableVersion = "v{version}"\n'''

			# Then update the dictionary
			while not lines[index].startswith("const versionMapping = {"  ):
						index += 1

			# We go until the end
			while not lines[index].startswith("}"  ):
						index += 1
			# We add the new version at the end
			lines[index - 1] += F'''    "v{version}": "v{version}",\n'''

			with open(_A				,     "w"				,     encoding="utf-8"				,     newline="\n"  ) as f:
						f.writelines(_A  )


if __name__ == "__main__":
						__UpperCamelCase    		=       argparse.ArgumentParser()
						parser.add_argument('--version', help='Release version.')
						__UpperCamelCase    		=       parser.parse_args()
						update_custom_js(args.version)






def        UpperCamelCase_(				_A   :str  )->		int:
			UpperCamelCase__					=       hex_num.strip()
			if not hex_num:
						raise ValueError("No value was passed to the function"  )

			UpperCamelCase__					=       hex_num[0] == "-"
			if is_negative:
						UpperCamelCase__					=       hex_num[1:]

			try:
						UpperCamelCase__					=       int(_A				,     16  )
			except ValueError:
						raise ValueError("Invalid value was passed to the function"  )

			UpperCamelCase__					=       ""
			while int_num > 0:
						UpperCamelCase__					=       str(int_num % 2  ) + bin_str
						int_num >>= 1

			return int(("-" + bin_str) if is_negative else bin_str  )


if __name__ == "__main__":
						import doctest

						doctest.testmod()


