





"""simple docstring"""




def        _lowercase   (  _UpperCAmelCase			)  ->					list:

				# 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
				lowerCamelCase			=gray_code_sequence_string(_UpperCAmelCase			)
				#
				# convert them to integers
				for i in range(len(_UpperCAmelCase			)			):
								lowerCamelCase			=int(sequence[i]     , 2			)

				return sequence





def        _lowercase   (  _UpperCAmelCase			)  ->					list:

				# 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"]

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

				lowerCamelCase			=[]

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

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

				return sequence


if __name__ == "__main__":
							import doctest

							doctest.testmod()












from __future__ import annotations

from typing import Dict

from ...configuration_utils import PretrainedConfig


UpperCAmelCase__  :     Optional[Any]   			={
    '''susnato/ernie-m-base_pytorch''': '''https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/config.json''',
    '''susnato/ernie-m-large_pytorch''': '''https://huggingface.co/susnato/ernie-m-large_pytorch/blob/main/config.json''',
}

class  __A       (  a      ):
				__A								=			"""ernie_m"""
				__A								=			{"dropout": "classifier_dropout", "num_classes": "num_labels"}


				def __init__(						self				,	UpperCAmelCase_ = 250002				,	UpperCAmelCase_ = 768				,	UpperCAmelCase_ = 12				,	UpperCAmelCase_ = 12				,	UpperCAmelCase_ = 3072				,	UpperCAmelCase_ = "gelu"				,	UpperCAmelCase_ = 0.1				,	UpperCAmelCase_ = 0.1				,	UpperCAmelCase_ = 514				,	UpperCAmelCase_ = 0.0_2				,	UpperCAmelCase_ = 1				,	UpperCAmelCase_ = 1E-05				,	UpperCAmelCase_=None				,	UpperCAmelCase_=False				,	UpperCAmelCase_=0.0				,	**UpperCAmelCase_				,	):
								super().__init__(pad_token_id=UpperCAmelCase_				,	**UpperCAmelCase_							)
								lowerCamelCase			=vocab_size
								lowerCamelCase			=hidden_size
								lowerCamelCase			=num_hidden_layers
								lowerCamelCase			=num_attention_heads
								lowerCamelCase			=intermediate_size
								lowerCamelCase			=hidden_act
								lowerCamelCase			=hidden_dropout_prob
								lowerCamelCase			=attention_probs_dropout_prob
								lowerCamelCase			=max_position_embeddings
								lowerCamelCase			=initializer_range
								lowerCamelCase			=layer_norm_eps
								lowerCamelCase			=classifier_dropout
								lowerCamelCase			=is_decoder
								lowerCamelCase			=act_dropout





