



import math






def 	_lowerCAmelCase						(				__lowerCamelCase   :     int     ):



 """simple docstring"""





 __SCREAMING_SNAKE_CASE       :    Dict       =	math.loga(math.sqrt(4 * positive_integer + 1     ) / 2 + 1 / 2     )

 return exponent == int(__lowerCamelCase     )






def 	_lowerCAmelCase						(				__lowerCamelCase   :     float = 1 / 12345     ):



 """simple docstring"""





 __SCREAMING_SNAKE_CASE       :    str       =	0
 __SCREAMING_SNAKE_CASE       :    str       =	0

 __SCREAMING_SNAKE_CASE       :    Optional[Any]       =	3
 while True:
  __SCREAMING_SNAKE_CASE       :    Any       =	(integer**2 - 1) / 4
  # if candidate is an integer, then there is a partition for k
  if partition_candidate == int(__lowerCamelCase     ):
   __SCREAMING_SNAKE_CASE       :    Tuple       =	int(__lowerCamelCase     )
   total_partitions += 1
   if check_partition_perfect(__lowerCamelCase     ):
    perfect_partitions += 1
  if perfect_partitions > 0:
   if perfect_partitions / total_partitions < max_proportion:
    return int(__lowerCamelCase     )
  integer += 1


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











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       _SCREAMING_SNAKE_CASE	(unittest.TestCase ):





     def 	__snake_case    (       self :							Optional[Any]				)->Union[str, Any]:
      __SCREAMING_SNAKE_CASE       :    Optional[Any]       =	inspect.getfile(accelerate.test_utils				)
      __SCREAMING_SNAKE_CASE       :    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

      __SCREAMING_SNAKE_CASE       :    Tuple       =	test_metrics





     @require_cpu
     def 	__snake_case    (       self :							Union[str, Any]				)->List[Any]:
      debug_launcher(self.test_metrics.main     ,  num_processes=1				)





     @require_cpu
     def 	__snake_case    (       self :							str				)->List[str]:
      debug_launcher(self.test_metrics.main				)





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






     @require_multi_gpu
     def 	__snake_case    (       self :							List[str]				)->int:
      print(F"""Found {torch.cuda.device_count()} devices."""				)
      __SCREAMING_SNAKE_CASE       :    Any       =	["torchrun", F"""--nproc_per_node={torch.cuda.device_count()}""", self.test_file_path]
      with patch_environment(omp_num_threads=1				):
       execute_subprocess_async(UpperCamelCase     ,  env=os.environ.copy()				)






