
import torch
import torch.nn.functional as F

from diffusers import VQDiffusionScheduler

from .test_schedulers import SchedulerCommonTest

class   __lowerCAmelCase		(		lowerCAmelCase__ ):



      """simple docstring"""







      A__		:     Tuple       				=      (VQDiffusionScheduler,)




      def 						snake_case_     ( self						:    str			,    **_snake_case						:    Dict			):
          __lowercase						:     str		      =    {
              "num_vec_classes": 4097,
              "num_train_timesteps": 100,
          }

          config.update(**UpperCamelCase__			)
          return config




      def 						snake_case_     ( self						:    Tuple			,    _snake_case						:    Optional[Any]			):
          __lowercase						:     Tuple		      =    4
          __lowercase						:     List[str]		      =    8
          __lowercase						:     Optional[Any]		      =    8

          __lowercase						:     Union[str, Any]		      =    torch.randint(0			,    UpperCamelCase__			,    (batch_size, height * width)			)

          return sample




      @property
      def 						snake_case_     ( self						:    Union[str, Any]			):
          assert False




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

          return model




      def 						snake_case_     ( self						:    List[str]			):
          for timesteps in [2, 5, 100, 1000]:
              self.check_over_configs(num_train_timesteps=UpperCamelCase__			)




      def 						snake_case_     ( self						:    Optional[int]			):
          for num_vec_classes in [5, 100, 1000, 4000]:
              self.check_over_configs(num_vec_classes=UpperCamelCase__			)




      def 						snake_case_     ( self						:    List[Any]			):
          for t in [0, 50, 99]:
              self.check_over_forward(time_step=UpperCamelCase__			)




      def 						snake_case_     ( self						:    List[Any]			):
          pass




from __future__ import annotations

import math
from itertools import permutations


def       UpperCAmelCase_					(  __lowerCAmelCase		)	->  bool:

    if 1 < number < 4:
        # 2 and 3 are primes
        return True
    elif number < 2 or number % 2 == 0 or number % 3 == 0:
        # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
        return False

    # All primes number are in format of 6k +/- 1
    for i in range(5		,   int(math.sqrt(__lowerCAmelCase		) + 1		)		,   6		):
        if number % i == 0 or number % (i + 2) == 0:
            return False
    return True


def       UpperCAmelCase_					(  __lowerCAmelCase = 7		)	->  int:
    __lowercase						:     Union[str, Any]		      =    ''''''.join(str(__lowerCAmelCase		) for i in range(1		,   n + 1		)		)
    __lowercase						:     Dict		      =    [int(''''''.join(__lowerCAmelCase		)		) for i in permutations(__lowerCAmelCase		,   __lowerCAmelCase		)]
    __lowercase						:     int		      =    [num for num in perm_list if is_prime(__lowerCAmelCase		)]
    return max(__lowerCAmelCase		) if pandigitals else 0


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


