
from __future__ import annotations

from PIL import Image

# Define the first generation of cells
# fmt: off
A		:   Optional[int]         =    [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int					)     ->    list[int]:
						return [int(SCREAMING_SNAKE_CASE_					) for c in f"""{ruleset:08}"""[:8]]




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  list[list[int]]		,      SCREAMING_SNAKE_CASE_  :  list[int]		,      SCREAMING_SNAKE_CASE_  :  int					)     ->    list[int]:
						_lowercase									=				len(cells[0]					)  # 31
						_lowercase									=				[]
						for i in range(SCREAMING_SNAKE_CASE_					):
												# Get the neighbors of each cell
												# Handle neighbours outside bounds by using 0 as their value
												_lowercase									=				0 if i == 0 else cells[time][i - 1]
												_lowercase									=				0 if i == population - 1 else cells[time][i + 1]
												# Define a new cell and add it to the new generation
												_lowercase									=				7 - int(f"""{left_neighbor}{cells[time][i]}{right_neighbor}"""		,      2					)
												next_generation.append(rule[situation]					)
						return next_generation




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  list[list[int]]					)     ->    Image.Image:
						_lowercase									=				Image.new("""RGB"""		,      (len(cells[0]					), len(SCREAMING_SNAKE_CASE_					))					)
						_lowercase									=				img.load()
						# Generates image
						for w in range(img.width					):
												for h in range(img.height					):
																		_lowercase									=				2_55 - int(2_55 * cells[h][w]					)
																		_lowercase									=				(color, color, color)
						return img


if __name__ == "__main__":
		A		:   Union[str, Any]         =    bin(int(input('''Rule:\n''').strip()))[2:]
		A		:   Dict         =    format_ruleset(int(rule_num))
		for time in range(16):
				CELLS.append(new_generation(CELLS, rule, time))
		A		:   Tuple         =    generate_image(CELLS)
		# Uncomment to save the image
		# img.save(f"rule_{rule_num}.png")
		img.show()

from ...configuration_utils import PretrainedConfig
from ...utils import logging


A		:   List[Any]         =    logging.get_logger(__name__)

A		:   str         =    {
    '''MCG-NJU/videomae-base''': '''https://huggingface.co/MCG-NJU/videomae-base/resolve/main/config.json''',
}



class       a_   ( _a						):
			a  : str				      =       '''videomae'''






			def __init__(			self							, __UpperCamelCase=224							, __UpperCamelCase=16							, __UpperCamelCase=3							, __UpperCamelCase=16							, __UpperCamelCase=2							, __UpperCamelCase=768							, __UpperCamelCase=12							, __UpperCamelCase=12							, __UpperCamelCase=3_072							, __UpperCamelCase="gelu"							, __UpperCamelCase=0.0							, __UpperCamelCase=0.0							, __UpperCamelCase=0.02							, __UpperCamelCase=1E-12							, __UpperCamelCase=True							, __UpperCamelCase=True							, __UpperCamelCase=6							, __UpperCamelCase=384							, __UpperCamelCase=4							, __UpperCamelCase=1_536							, __UpperCamelCase=True							, **__UpperCamelCase							, ):
									super().__init__(**__UpperCamelCase     )

									_lowercase									=				image_size
									_lowercase									=				patch_size
									_lowercase									=				num_channels
									_lowercase									=				num_frames
									_lowercase									=				tubelet_size

									_lowercase									=				hidden_size
									_lowercase									=				num_hidden_layers
									_lowercase									=				num_attention_heads
									_lowercase									=				intermediate_size
									_lowercase									=				hidden_act
									_lowercase									=				hidden_dropout_prob
									_lowercase									=				attention_probs_dropout_prob
									_lowercase									=				initializer_range
									_lowercase									=				layer_norm_eps
									_lowercase									=				qkv_bias
									_lowercase									=				use_mean_pooling

									_lowercase									=				decoder_num_attention_heads
									_lowercase									=				decoder_hidden_size
									_lowercase									=				decoder_num_hidden_layers
									_lowercase									=				decoder_intermediate_size
									_lowercase									=				norm_pix_loss