def   __A		(			_A					):



 """simple docstring"""


 if bit_count < 0:
  raise ValueError("The given input must be positive"					)

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

 return sequence



def   __A		(			_A					):



 """simple docstring"""


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

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

 __a       =  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
 __a       =  gray_code_sequence_string(bit_count - 1					)

 __a       =  []

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

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

 return sequence


if __name__ == "__main__":
  import doctest

  doctest.testmod()



import os
import sys
from contextlib import contextmanager


# Windows only
if os.name == "nt":
  import ctypes
  import msvcrt  # noqa
  class    A_ (       ctypes.Structure ):
    # _fields is a specific attr expected by ctypes
    _SCREAMING_SNAKE_CASE    				=			[("""size""", ctypes.c_int), ("""visible""", ctypes.c_byte)]



def   __A		(			):



 """simple docstring"""


 if os.name == "nt":
  __a       =  CursorInfo()
  __a       =  ctypes.windll.kernelaa.GetStdHandle(-11					)
  ctypes.windll.kernelaa.GetConsoleCursorInfo(_A							,				ctypes.byref(_A					)					)
  __a       =  False
  ctypes.windll.kernelaa.SetConsoleCursorInfo(_A							,				ctypes.byref(_A					)					)
 elif os.name == "posix":
  sys.stdout.write("\033[?25l"					)
  sys.stdout.flush()



def   __A		(			):



 """simple docstring"""


 if os.name == "nt":
  __a       =  CursorInfo()
  __a       =  ctypes.windll.kernelaa.GetStdHandle(-11					)
  ctypes.windll.kernelaa.GetConsoleCursorInfo(_A							,				ctypes.byref(_A					)					)
  __a       =  True
  ctypes.windll.kernelaa.SetConsoleCursorInfo(_A							,				ctypes.byref(_A					)					)
 elif os.name == "posix":
  sys.stdout.write("\033[?25h"					)
  sys.stdout.flush()






@contextmanager
def   __A		(			):



 """simple docstring"""


 try:
  hide_cursor()
  yield
 finally:
  show_cursor()


