



"""simple docstring"""
import unittest

from transformers.utils.backbone_utils import (
    BackboneMixin,
    get_aligned_output_features_output_indices,
    verify_out_features_out_indices,
)



class       SCREAMING_SNAKE_CASE__  (					unittest.TestCase ):

   def 	SCREAMING_SNAKE_CASE     (   self						)  ->      List[Any]:





    '''simple docstring'''




    UpperCAmelCase	:					Union[str, Any]	=	["""a""", """b""", """c"""]

    # Defaults to last layer if both are None
    UpperCAmelCase	,		UpperCAmelCase	:					Optional[int]	=	get_aligned_output_features_output_indices(_SCREAMING_SNAKE_CASE      ,     _SCREAMING_SNAKE_CASE      ,     _SCREAMING_SNAKE_CASE						)
    self.assertEqual(_SCREAMING_SNAKE_CASE      ,     ["""c"""]						)
    self.assertEqual(_SCREAMING_SNAKE_CASE      ,     [2]						)

    # Out indices set to match out features
    UpperCAmelCase	,		UpperCAmelCase	:					str	=	get_aligned_output_features_output_indices(["""a""", """c"""]      ,     _SCREAMING_SNAKE_CASE      ,     _SCREAMING_SNAKE_CASE						)
    self.assertEqual(_SCREAMING_SNAKE_CASE      ,     ["""a""", """c"""]						)
    self.assertEqual(_SCREAMING_SNAKE_CASE      ,     [0, 2]						)

    # Out features set to match out indices
    UpperCAmelCase	,		UpperCAmelCase	:					Optional[Any]	=	get_aligned_output_features_output_indices(_SCREAMING_SNAKE_CASE      ,     [0, 2]      ,     _SCREAMING_SNAKE_CASE						)
    self.assertEqual(_SCREAMING_SNAKE_CASE      ,     ["""a""", """c"""]						)
    self.assertEqual(_SCREAMING_SNAKE_CASE      ,     [0, 2]						)

    # Out features selected from negative indices
    UpperCAmelCase	,		UpperCAmelCase	:					Optional[int]	=	get_aligned_output_features_output_indices(_SCREAMING_SNAKE_CASE      ,     [-3, -1]      ,     _SCREAMING_SNAKE_CASE						)
    self.assertEqual(_SCREAMING_SNAKE_CASE      ,     ["""a""", """c"""]						)
    self.assertEqual(_SCREAMING_SNAKE_CASE      ,     [-3, -1]						)

   def 	SCREAMING_SNAKE_CASE     (   self						)  ->      List[str]:





    '''simple docstring'''




    with self.assertRaises(_SCREAMING_SNAKE_CASE						):
     verify_out_features_out_indices(["""a""", """b"""]      ,     (0, 1)      ,     _SCREAMING_SNAKE_CASE						)

    # Out features must be a list
    with self.assertRaises(_SCREAMING_SNAKE_CASE						):
     verify_out_features_out_indices(("""a""", """b""")      ,     (0, 1)      ,     ["""a""", """b"""]						)

    # Out features must be a subset of stage names
    with self.assertRaises(_SCREAMING_SNAKE_CASE						):
     verify_out_features_out_indices(["""a""", """b"""]      ,     (0, 1)      ,     ["""a"""]						)

    # Out indices must be a list or tuple
    with self.assertRaises(_SCREAMING_SNAKE_CASE						):
     verify_out_features_out_indices(_SCREAMING_SNAKE_CASE      ,     0      ,     ["""a""", """b"""]						)

    # Out indices must be a subset of stage names
    with self.assertRaises(_SCREAMING_SNAKE_CASE						):
     verify_out_features_out_indices(_SCREAMING_SNAKE_CASE      ,     (0, 1)      ,     ["""a"""]						)

    # Out features and out indices must be the same length
    with self.assertRaises(_SCREAMING_SNAKE_CASE						):
     verify_out_features_out_indices(["""a""", """b"""]      ,     (0,)      ,     ["""a""", """b""", """c"""]						)

    # Out features should match out indices
    with self.assertRaises(_SCREAMING_SNAKE_CASE						):
     verify_out_features_out_indices(["""a""", """b"""]      ,     (0, 2)      ,     ["""a""", """b""", """c"""]						)

    # Out features and out indices should be in order
    with self.assertRaises(_SCREAMING_SNAKE_CASE						):
     verify_out_features_out_indices(["""b""", """a"""]      ,     (0, 1)      ,     ["""a""", """b"""]						)

    # Check passes with valid inputs
    verify_out_features_out_indices(["""a""", """b""", """d"""]      ,     (0, 1, -1)      ,     ["""a""", """b""", """c""", """d"""]						)




   def 	SCREAMING_SNAKE_CASE     (   self						)  ->      Any:





    '''simple docstring'''




    UpperCAmelCase	:					str	=	BackboneMixin()

    UpperCAmelCase	:					int	=	["""a""", """b""", """c"""]
    UpperCAmelCase	:					Dict	=	["""a""", """c"""]
    UpperCAmelCase	:					Tuple	=	[0, 2]

    # Check that the output features and indices are set correctly
    self.assertEqual(backbone.out_features      ,     ["""a""", """c"""]						)
    self.assertEqual(backbone.out_indices      ,     [0, 2]						)

    # Check out features and indices are updated correctly
    UpperCAmelCase	:					Tuple	=	["""a""", """b"""]
    self.assertEqual(backbone.out_features      ,     ["""a""", """b"""]						)
    self.assertEqual(backbone.out_indices      ,     [0, 1]						)

    UpperCAmelCase	:					List[Any]	=	[-3, -1]
    self.assertEqual(backbone.out_features      ,     ["""a""", """c"""]						)
    self.assertEqual(backbone.out_indices      ,     [-3, -1]						)





"""simple docstring"""
from collections import defaultdict
from math import ceil, sqrt

def       _snake_case						(						UpperCamelCase						:		int = 1000000			,		UpperCamelCase						:		int = 10						):
 UpperCAmelCase	:					defaultdict	=	defaultdict(UpperCamelCase						)

 for outer_width in range(3			,		(t_limit // 4) + 2						):
  if outer_width * outer_width > t_limit:
   UpperCAmelCase	:					str	=	max(
       ceil(sqrt(outer_width * outer_width - t_limit						)						)			,		1						)
  else:
   UpperCAmelCase	:					Optional[Any]	=	1

  hole_width_lower_bound += (outer_width - hole_width_lower_bound) % 2

  for hole_width in range(UpperCamelCase			,		outer_width - 1			,		2						):
   count[outer_width * outer_width - hole_width * hole_width] += 1

 return sum(1 for n in count.values() if 1 <= n <= 10						)


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