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


__magic_name__           =					logging.get_logger(__name__)

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




class    _SCREAMING_SNAKE_CASE					( __UpperCamelCase	):
      _A  :						Optional[Any]      		=       'videomae'
      def __init__(     self						,		lowerCamelCase=2_24						,		lowerCamelCase=16						,		lowerCamelCase=3						,		lowerCamelCase=16						,		lowerCamelCase=2						,		lowerCamelCase=7_68						,		lowerCamelCase=12						,		lowerCamelCase=12						,		lowerCamelCase=30_72						,		lowerCamelCase="gelu"						,		lowerCamelCase=0.0						,		lowerCamelCase=0.0						,		lowerCamelCase=0.0_2						,		lowerCamelCase=1e-12						,		lowerCamelCase=True						,		lowerCamelCase=True						,		lowerCamelCase=6						,		lowerCamelCase=3_84						,		lowerCamelCase=4						,		lowerCamelCase=15_36						,		lowerCamelCase=True						,		**lowerCamelCase						,		):
          super().__init__(**lowerCamelCase	)

          snake_case__  =			image_size
          snake_case__  =			patch_size
          snake_case__  =			num_channels
          snake_case__  =			num_frames
          snake_case__  =			tubelet_size

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

          snake_case__  =			decoder_num_attention_heads
          snake_case__  =			decoder_hidden_size
          snake_case__  =			decoder_num_hidden_layers
          snake_case__  =			decoder_intermediate_size
          snake_case__  =			norm_pix_loss





from __future__ import annotations

from PIL import Image

# Define the first generation of cells
# fmt: off
__magic_name__           =					[[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 		SCREAMING_SNAKE_CASE__      ( __lowerCAmelCase							):
    return [int(__lowerCAmelCase							) for c in F"""{ruleset:08}"""[:8]]





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





def 		SCREAMING_SNAKE_CASE__      ( __lowerCAmelCase							):
    snake_case__  =			Image.new("RGB"      ,						(len(cells[0]							), len(__lowerCAmelCase							))							)
    snake_case__  =			img.load()
    # Generates image
    for w in range(img.width							):
        for h in range(img.height							):
            snake_case__  =			255 - int(255 * cells[h][w]							)
            snake_case__  =			(color, color, color)
    return img


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



