


import inspect
import os
import unittest

import torch

import accelerate
from accelerate import debug_launcher
from accelerate.test_utils import (
    execute_subprocess_async,
    require_cpu,
    require_huggingface_suite,
    require_multi_gpu,
    require_single_gpu,
)
from accelerate.utils import patch_environment



@require_huggingface_suite
class        a					(			unittest.TestCase   ):





     def  SCREAMING_SNAKE_CASE__       (    self					:				Dict							):
        __lowerCamelCase:				str     =	inspect.getfile(accelerate.test_utils							)
        __lowerCamelCase:				Union[str, Any]     =	os.path.sep.join(
            mod_file.split(os.path.sep							)[:-1] + ["""scripts""", """external_deps""", """test_metrics.py"""]							)

        from accelerate.test_utils.scripts.external_deps import test_metrics  # noqa: F401

        __lowerCamelCase:				str     =	test_metrics





     @require_cpu
     def  SCREAMING_SNAKE_CASE__       (    self					:				str							):
        debug_launcher(self.test_metrics.main    ,	num_processes=1							)





     @require_cpu
     def  SCREAMING_SNAKE_CASE__       (    self					:				int							):
        debug_launcher(self.test_metrics.main							)





     @require_single_gpu
     def  SCREAMING_SNAKE_CASE__       (    self					:				Union[str, Any]							):
        self.test_metrics.main()







     @require_multi_gpu
     def  SCREAMING_SNAKE_CASE__       (    self					:				Tuple							):
        print(F'Found {torch.cuda.device_count()} devices.'							)
        __lowerCamelCase:				Union[str, Any]     =	["""torchrun""", F'--nproc_per_node={torch.cuda.device_count()}', self.test_file_path]
        with patch_environment(omp_num_threads=1							):
           execute_subprocess_async(SCREAMING_SNAKE_CASE_    ,	env=os.environ.copy()							)






def     __lowerCAmelCase						(							)       ->							Optional[Any]:
   __lowerCamelCase:				List[str]     =	[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

   __lowerCamelCase:				List[str]     =	6
   __lowerCamelCase:				Optional[int]     =	1
   __lowerCamelCase:				int     =	1901

   __lowerCamelCase:				Tuple     =	0

   while year < 2001:
      day += 7

      if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
         if day > days_per_month[month - 1] and month != 2:
            month += 1
            __lowerCamelCase:				Union[str, Any]     =	day - days_per_month[month - 2]
         elif day > 29 and month == 2:
            month += 1
            __lowerCamelCase:				List[Any]     =	day - 29
      else:
         if day > days_per_month[month - 1]:
            month += 1
            __lowerCamelCase:				Any     =	day - days_per_month[month - 2]

      if month > 12:
         year += 1
         __lowerCamelCase:				Dict     =	1

      if year < 2001 and day == 1:
         sundays += 1
   return sundays


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


