



def 						_UpperCAmelCase							( snake_case     ):





					"""simple docstring"""

					_lowerCAmelCase         =       []
					_lowerCAmelCase         =       1

					for i in range(len(snake_case     )     ):
										if i + 1 < len(snake_case     ) and text[i] == text[i + 1]:
															count += 1
										else:
															encoded.append((text[i], count)     )
															_lowerCAmelCase         =       1

					return encoded


def 						_UpperCAmelCase							( snake_case     ):





					"""simple docstring"""

					return "".join(char * length for char, length in encoded     )


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

	testmod(name="""run_length_encode""", verbose=True)
	testmod(name="""run_length_decode""", verbose=True)








def 						_UpperCAmelCase							( snake_case     ):





					"""simple docstring"""

					_lowerCAmelCase         =       str(snake_case     ).strip()
					if not bin_string:
										raise ValueError("""Empty string was passed to the function"""     )
					_lowerCAmelCase         =       bin_string[0] == """-"""
					if is_negative:
										_lowerCAmelCase         =       bin_string[1:]
					if not all(char in """01""" for char in bin_string     ):
										raise ValueError("""Non-binary value was passed to the function"""     )
					_lowerCAmelCase         =       0
					for char in bin_string:
										_lowerCAmelCase         =       2 * decimal_number + int(snake_case     )
					return -decimal_number if is_negative else decimal_number


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

	testmod()



