






'''simple docstring'''

import unittest

import numpy as np

from transformers.testing_utils import require_flax, require_tf, require_torch
from transformers.utils import (
    expand_dims,
    flatten_dict,
    is_flax_available,
    is_tf_available,
    is_torch_available,
    reshape,
    squeeze,
    transpose,
)


if is_flax_available():
       import jax.numpy as jnp

if is_tf_available():
       import tensorflow as tf

if is_torch_available():
       import torch




class     A    (      unittest.TestCase						):






 """simple docstring"""





 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   int					    =							{
           """task_specific_params""": {
               """summarization""": {"""length_penalty""": 1.0, """max_length""": 1_28, """min_length""": 12, """num_beams""": 4},
               """summarization_cnn""": {"""length_penalty""": 2.0, """max_length""": 1_42, """min_length""": 56, """num_beams""": 4},
               """summarization_xsum""": {"""length_penalty""": 1.0, """max_length""": 62, """min_length""": 11, """num_beams""": 6},
           }
       }
       UpperCamelCase_				:   List[str]					    =							{
           """task_specific_params.summarization.length_penalty""": 1.0,
           """task_specific_params.summarization.max_length""": 1_28,
           """task_specific_params.summarization.min_length""": 12,
           """task_specific_params.summarization.num_beams""": 4,
           """task_specific_params.summarization_cnn.length_penalty""": 2.0,
           """task_specific_params.summarization_cnn.max_length""": 1_42,
           """task_specific_params.summarization_cnn.min_length""": 56,
           """task_specific_params.summarization_cnn.num_beams""": 4,
           """task_specific_params.summarization_xsum.length_penalty""": 1.0,
           """task_specific_params.summarization_xsum.max_length""": 62,
           """task_specific_params.summarization_xsum.min_length""": 11,
           """task_specific_params.summarization_xsum.num_beams""": 6,
       }

       self.assertEqual(flatten_dict(__lowerCAmelCase )			,     __lowerCAmelCase )
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   Dict					    =							np.random.randn(3			,     4 )
       self.assertTrue(np.allclose(transpose(__lowerCAmelCase )			,     x.transpose() ) )

       UpperCamelCase_				:   Union[str, Any]					    =							np.random.randn(3			,     4			,     5 )
       self.assertTrue(np.allclose(transpose(__lowerCAmelCase			,     axes=(1, 2, 0) )			,     x.transpose((1, 2, 0) ) ) )
 @require_torch
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   Union[str, Any]					    =							np.random.randn(3			,     4 )
       UpperCamelCase_				:   int					    =							torch.tensor(__lowerCAmelCase )
       self.assertTrue(np.allclose(transpose(__lowerCAmelCase )			,     transpose(__lowerCAmelCase ).numpy() ) )

       UpperCamelCase_				:   Optional[Any]					    =							np.random.randn(3			,     4			,     5 )
       UpperCamelCase_				:   Optional[int]					    =							torch.tensor(__lowerCAmelCase )
       self.assertTrue(np.allclose(transpose(__lowerCAmelCase			,     axes=(1, 2, 0) )			,     transpose(__lowerCAmelCase			,     axes=(1, 2, 0) ).numpy() ) )
 @require_tf
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   Any					    =							np.random.randn(3			,     4 )
       UpperCamelCase_				:   Optional[int]					    =							tf.constant(__lowerCAmelCase )
       self.assertTrue(np.allclose(transpose(__lowerCAmelCase )			,     transpose(__lowerCAmelCase ).numpy() ) )

       UpperCamelCase_				:   Any					    =							np.random.randn(3			,     4			,     5 )
       UpperCamelCase_				:   Dict					    =							tf.constant(__lowerCAmelCase )
       self.assertTrue(np.allclose(transpose(__lowerCAmelCase			,     axes=(1, 2, 0) )			,     transpose(__lowerCAmelCase			,     axes=(1, 2, 0) ).numpy() ) )
 @require_flax
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   Any					    =							np.random.randn(3			,     4 )
       UpperCamelCase_				:   Dict					    =							jnp.array(__lowerCAmelCase )
       self.assertTrue(np.allclose(transpose(__lowerCAmelCase )			,     np.asarray(transpose(__lowerCAmelCase ) ) ) )

       UpperCamelCase_				:   List[str]					    =							np.random.randn(3			,     4			,     5 )
       UpperCamelCase_				:   List[str]					    =							jnp.array(__lowerCAmelCase )
       self.assertTrue(np.allclose(transpose(__lowerCAmelCase			,     axes=(1, 2, 0) )			,     np.asarray(transpose(__lowerCAmelCase			,     axes=(1, 2, 0) ) ) ) )
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   int					    =							np.random.randn(3			,     4 )
       self.assertTrue(np.allclose(reshape(__lowerCAmelCase			,     (4, 3) )			,     np.reshape(__lowerCAmelCase			,     (4, 3) ) ) )

       UpperCamelCase_				:   str					    =							np.random.randn(3			,     4			,     5 )
       self.assertTrue(np.allclose(reshape(__lowerCAmelCase			,     (12, 5) )			,     np.reshape(__lowerCAmelCase			,     (12, 5) ) ) )
 @require_torch
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   Any					    =							np.random.randn(3			,     4 )
       UpperCamelCase_				:   Tuple					    =							torch.tensor(__lowerCAmelCase )
       self.assertTrue(np.allclose(reshape(__lowerCAmelCase			,     (4, 3) )			,     reshape(__lowerCAmelCase			,     (4, 3) ).numpy() ) )

       UpperCamelCase_				:   Optional[int]					    =							np.random.randn(3			,     4			,     5 )
       UpperCamelCase_				:   Union[str, Any]					    =							torch.tensor(__lowerCAmelCase )
       self.assertTrue(np.allclose(reshape(__lowerCAmelCase			,     (12, 5) )			,     reshape(__lowerCAmelCase			,     (12, 5) ).numpy() ) )
 @require_tf
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   List[str]					    =							np.random.randn(3			,     4 )
       UpperCamelCase_				:   Dict					    =							tf.constant(__lowerCAmelCase )
       self.assertTrue(np.allclose(reshape(__lowerCAmelCase			,     (4, 3) )			,     reshape(__lowerCAmelCase			,     (4, 3) ).numpy() ) )

       UpperCamelCase_				:   List[str]					    =							np.random.randn(3			,     4			,     5 )
       UpperCamelCase_				:   Tuple					    =							tf.constant(__lowerCAmelCase )
       self.assertTrue(np.allclose(reshape(__lowerCAmelCase			,     (12, 5) )			,     reshape(__lowerCAmelCase			,     (12, 5) ).numpy() ) )
 @require_flax
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   Any					    =							np.random.randn(3			,     4 )
       UpperCamelCase_				:   Union[str, Any]					    =							jnp.array(__lowerCAmelCase )
       self.assertTrue(np.allclose(reshape(__lowerCAmelCase			,     (4, 3) )			,     np.asarray(reshape(__lowerCAmelCase			,     (4, 3) ) ) ) )

       UpperCamelCase_				:   Optional[Any]					    =							np.random.randn(3			,     4			,     5 )
       UpperCamelCase_				:   int					    =							jnp.array(__lowerCAmelCase )
       self.assertTrue(np.allclose(reshape(__lowerCAmelCase			,     (12, 5) )			,     np.asarray(reshape(__lowerCAmelCase			,     (12, 5) ) ) ) )
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   Any					    =							np.random.randn(1			,     3			,     4 )
       self.assertTrue(np.allclose(squeeze(__lowerCAmelCase )			,     np.squeeze(__lowerCAmelCase ) ) )

       UpperCamelCase_				:   int					    =							np.random.randn(1			,     4			,     1			,     5 )
       self.assertTrue(np.allclose(squeeze(__lowerCAmelCase			,     axis=2 )			,     np.squeeze(__lowerCAmelCase			,     axis=2 ) ) )
 @require_torch
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   Any					    =							np.random.randn(1			,     3			,     4 )
       UpperCamelCase_				:   Optional[Any]					    =							torch.tensor(__lowerCAmelCase )
       self.assertTrue(np.allclose(squeeze(__lowerCAmelCase )			,     squeeze(__lowerCAmelCase ).numpy() ) )

       UpperCamelCase_				:   Union[str, Any]					    =							np.random.randn(1			,     4			,     1			,     5 )
       UpperCamelCase_				:   Optional[int]					    =							torch.tensor(__lowerCAmelCase )
       self.assertTrue(np.allclose(squeeze(__lowerCAmelCase			,     axis=2 )			,     squeeze(__lowerCAmelCase			,     axis=2 ).numpy() ) )
 @require_tf
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   Dict					    =							np.random.randn(1			,     3			,     4 )
       UpperCamelCase_				:   Optional[int]					    =							tf.constant(__lowerCAmelCase )
       self.assertTrue(np.allclose(squeeze(__lowerCAmelCase )			,     squeeze(__lowerCAmelCase ).numpy() ) )

       UpperCamelCase_				:   Tuple					    =							np.random.randn(1			,     4			,     1			,     5 )
       UpperCamelCase_				:   Optional[int]					    =							tf.constant(__lowerCAmelCase )
       self.assertTrue(np.allclose(squeeze(__lowerCAmelCase			,     axis=2 )			,     squeeze(__lowerCAmelCase			,     axis=2 ).numpy() ) )
 @require_flax
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   List[Any]					    =							np.random.randn(1			,     3			,     4 )
       UpperCamelCase_				:   Tuple					    =							jnp.array(__lowerCAmelCase )
       self.assertTrue(np.allclose(squeeze(__lowerCAmelCase )			,     np.asarray(squeeze(__lowerCAmelCase ) ) ) )

       UpperCamelCase_				:   int					    =							np.random.randn(1			,     4			,     1			,     5 )
       UpperCamelCase_				:   Dict					    =							jnp.array(__lowerCAmelCase )
       self.assertTrue(np.allclose(squeeze(__lowerCAmelCase			,     axis=2 )			,     np.asarray(squeeze(__lowerCAmelCase			,     axis=2 ) ) ) )
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   List[str]					    =							np.random.randn(3			,     4 )
       self.assertTrue(np.allclose(expand_dims(__lowerCAmelCase			,     axis=1 )			,     np.expand_dims(__lowerCAmelCase			,     axis=1 ) ) )
 @require_torch
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   List[Any]					    =							np.random.randn(3			,     4 )
       UpperCamelCase_				:   Union[str, Any]					    =							torch.tensor(__lowerCAmelCase )
       self.assertTrue(np.allclose(expand_dims(__lowerCAmelCase			,     axis=1 )			,     expand_dims(__lowerCAmelCase			,     axis=1 ).numpy() ) )
 @require_tf
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   List[str]					    =							np.random.randn(3			,     4 )
       UpperCamelCase_				:   int					    =							tf.constant(__lowerCAmelCase )
       self.assertTrue(np.allclose(expand_dims(__lowerCAmelCase			,     axis=1 )			,     expand_dims(__lowerCAmelCase			,     axis=1 ).numpy() ) )





 @require_flax
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   Optional[int]					    =							np.random.randn(3			,     4 )
       UpperCamelCase_				:   Optional[int]					    =							jnp.array(__lowerCAmelCase )
       self.assertTrue(np.allclose(expand_dims(__lowerCAmelCase			,     axis=1 )			,     np.asarray(expand_dims(__lowerCAmelCase			,     axis=1 ) ) ) )














'''simple docstring'''

from itertools import count



def 							snake_case					(     a_							: int = 50	)       ->				int:





      """simple docstring"""

      UpperCamelCase_				:   int					    =							[1] * min_block_length

      for n in count(a_	):
            fill_count_functions.append(1	)

            for block_length in range(a_    ,   n + 1	):
                  for block_start in range(n - block_length	):
                        fill_count_functions[n] += fill_count_functions[
                            n - block_start - block_length - 1
                        ]

                  fill_count_functions[n] += 1

            if fill_count_functions[n] > 1_000_000:
                  break

      return n


if __name__ == "__main__":
      print(f"{solution() = }")






