

import torch
import torch.nn.functional as F

from diffusers import VQDiffusionScheduler

from .test_schedulers import SchedulerCommonTest



class     lowercase_       (    __lowercase	):
      UpperCamelCase_     :						Optional[int]		 =							(VQDiffusionScheduler,)



      def 		UpperCamelCase_						(     self :							List[Any]     ,   **A__ :							Any						)       ->	Optional[Any]:
        _snake_case		=				{
            '''num_vec_classes''': 4097,
            '''num_train_timesteps''': 100,
        }

        config.update(**A__						)
        return config



      def 		UpperCamelCase_						(     self :							str     ,   A__ :							int						)       ->	str:
        _snake_case		=				4
        _snake_case		=				8
        _snake_case		=				8

        _snake_case		=				torch.randint(0     ,   A__     ,   (batch_size, height * width)						)

        return sample



      @property
      def 		UpperCamelCase_						(     self :							Any						)       ->	str:
        assert False



      def 		UpperCamelCase_						(     self :							int     ,   A__ :							Tuple						)       ->	str:
        def model(A__ :							List[Any]     ,   A__ :							List[str]     ,   *A__ :							List[Any]						):
          _snake_case,	_snake_case		=				sample.shape
          _snake_case		=				torch.rand((batch_size, num_vec_classes - 1, num_latent_pixels)						)
          _snake_case		=				F.log_softmax(logits.double()     ,   dim=1						).float()
          return return_value

        return model



      def 		UpperCamelCase_						(     self :							List[str]						)       ->	int:
        for timesteps in [2, 5, 100, 1000]:
          self.check_over_configs(num_train_timesteps=A__						)



      def 		UpperCamelCase_						(     self :							Union[str, Any]						)       ->	Dict:
        for num_vec_classes in [5, 100, 1000, 4000]:
          self.check_over_configs(num_vec_classes=A__						)



      def 		UpperCamelCase_						(     self :							Any						)       ->	Union[str, Any]:
        for t in [0, 50, 99]:
          self.check_over_forward(time_step=A__						)







      def 		UpperCamelCase_						(     self :							Dict						)       ->	Optional[Any]:
        pass




from __future__ import annotations

from collections import Counter



def  snake_case_(_UpperCamelCase	)				->      list[int]:



  """simple docstring"""






  _snake_case		=				[True] * n
  _snake_case		=				False
  _snake_case		=				False
  _snake_case		=				True

  for i in range(3					,			int(n**0.5 + 1	)					,			2	):
    _snake_case		=				i * 2
    while index < n:
      _snake_case		=				False
      _snake_case		=				index + i

  _snake_case		=				[2]

  for i in range(3					,			_UpperCamelCase					,			2	):
    if is_prime[i]:
      primes.append(_UpperCamelCase	)

  return primes



def  snake_case_(_UpperCamelCase	)				->      list[list[int]]:



  """simple docstring"""






  _snake_case		=				str(_UpperCamelCase	)
  _snake_case		=				[]
  _snake_case		=				['''0''', '''1''', '''2''', '''3''', '''4''', '''5''', '''6''', '''7''', '''8''', '''9''']

  for duplicate in Counter(_UpperCamelCase	) - Counter(set(_UpperCamelCase	)	):
    _snake_case		=				[int(number_str.replace(_UpperCamelCase					,			_UpperCamelCase	)	) for digit in digits]
    replacements.append(_UpperCamelCase	)

  return replacements



def  snake_case_(_UpperCamelCase = 8	)				->      int:



  """simple docstring"""






  _snake_case		=				set()

  # Filter primes with less than 3 replaceable digits
  _snake_case		=				{
      x for x in set(prime_sieve(1_000_000	)	) if len(str(_UpperCamelCase	)	) - len(set(str(_UpperCamelCase	)	)	) >= 3
  }

  for prime in primes:
    if prime in numbers_checked:
      continue

    _snake_case		=				digit_replacements(_UpperCamelCase	)

    for family in replacements:
      numbers_checked.update(_UpperCamelCase	)
      _snake_case		=				primes.intersection(_UpperCamelCase	)

      if len(_UpperCamelCase	) != family_length:
        continue

      return min(_UpperCamelCase	)

  return -1


if __name__ == "__main__":
 print(solution())

