"""simple docstring"""






def 						a_		(      lowerCamelCase ):

				# bit count represents no. of bits in the gray code
				if bit_count < 0:
								raise ValueError('The given input must be positive' )

				# get the generated string sequence
				UpperCAmelCase__    =							gray_code_sequence_string(lowerCamelCase )
				#
				# convert them to integers
				for i in range(len(lowerCamelCase ) ):
								UpperCAmelCase__    =							int(sequence[i]      ,    2 )

				return sequence



def 						a_		(      lowerCamelCase ):

				# The approach is a recursive one
				# Base case achieved when either n = 0 or n=1
				if bit_count == 0:
								return ["0"]

				if bit_count == 1:
								return ["0", "1"]

				UpperCAmelCase__    =							1 << bit_count  # defines the length of the sequence
				# 1<< n is equivalent to 2^n

				# recursive answer will generate answer for n-1 bits
				UpperCAmelCase__    =							gray_code_sequence_string(bit_count - 1 )

				UpperCAmelCase__    =							[]

				# append 0 to first half of the smaller sequence generated
				for i in range(seq_len // 2 ):
								UpperCAmelCase__    =							'0' + smaller_sequence[i]
								sequence.append(lowerCamelCase )

				# append 1 to second half ... start from the end of the list
				for i in reversed(range(seq_len // 2 ) ):
								UpperCAmelCase__    =							'1' + smaller_sequence[i]
								sequence.append(lowerCamelCase )

				return sequence


if __name__ == "__main__":
						import doctest

						doctest.testmod()




"""simple docstring"""






import re



def 						a_		(      lowerCamelCase ):
				return [char.split() for char in re.split(r'[^ a-z A-Z 0-9 \s]'      ,    str_ )]



def 						a_		(      lowerCamelCase ):
				UpperCAmelCase__    =							split_input(str_ )
				return "".join(
				    [''.join([char.capitalize() for char in sub_str] ) for sub_str in string_split] )



def 						a_		(      lowerCamelCase      ,    lowerCamelCase      ,    lowerCamelCase ):
				try:
								UpperCAmelCase__    =							split_input(lowerCamelCase )
								if upper:
												UpperCAmelCase__    =							''.join(
												    [
												        separator.join([char.upper() for char in sub_str] )
												        for sub_str in string_split
												    ] )
								else:
												UpperCAmelCase__    =							''.join(
												    [
												        separator.join([char.lower() for char in sub_str] )
												        for sub_str in string_split
												    ] )
								return res_str
				except IndexError:
								return "not valid string"



def 						a_		(      lowerCamelCase ):
				return to_simple_case(lowerCamelCase )



def 						a_		(      lowerCamelCase ):
				try:
								UpperCAmelCase__    =							to_simple_case(lowerCamelCase )
								return res_str[0].lower() + res_str[1:]
				except IndexError:
								return "not valid string"



def 						a_		(      lowerCamelCase      ,    lowerCamelCase ):
				return to_complex_case(lowerCamelCase      ,    lowerCamelCase      ,    '_' )



def 						a_		(      lowerCamelCase      ,    lowerCamelCase ):
				return to_complex_case(lowerCamelCase      ,    lowerCamelCase      ,    '-' )


if __name__ == "__main__":
						__import__('doctest').testmod()



