def  lowercase(  UpperCamelCase_ = 998001					)		->  int:







 '''simple docstring'''

 # fetches the next number
 for number in range(n - 1       ,				9999       ,				-1					):
  UpperCamelCase      =			str(a_					)

  # checks whether 'str_number' is a palindrome.
  if str_number == str_number[::-1]:
   UpperCamelCase      =			999

   # if 'number' is a product of two 3-digit numbers
   # then number is the answer otherwise fetch next number.
   while divisor != 99:
    if (number % divisor == 0) and (len(str(number // divisor					)					) == 3.0):
     return number
    divisor -= 1
 raise ValueError("""That number is larger than our acceptable range."""					)


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

import numpy as np





def  lowercase(  UpperCamelCase_       ,				UpperCamelCase_       ,				UpperCamelCase_					)		->  List[str]:







 '''simple docstring'''
 UpperCamelCase      =			n_draws * class_counts / class_counts.sum()
 # floored means we don't overshoot n_samples, but probably undershoot
 UpperCamelCase      =			np.floor(UpperCamelCase_					)
 # we add samples according to how much "left over" probability
 # they had, until we arrive at n_samples
 UpperCamelCase      =			int(n_draws - floored.sum()					)
 if need_to_add > 0:
  UpperCamelCase      =			continuous - floored
  UpperCamelCase      =			np.sort(np.unique(UpperCamelCase_					)					)[::-1]
  # add according to remainder, but break ties
  # randomly to avoid biases
  for value in values:
   ((UpperCamelCase)     ,    )      =			np.where(remainder == value					)
   # if we need_to_add less than what's in inds
   # we draw randomly from them.
   # if we need to add more, we add them all and
   # go to the next value
   UpperCamelCase      =			min(len(UpperCamelCase_					)       ,				UpperCamelCase_					)
   UpperCamelCase      =			rng.choice(UpperCamelCase_       ,				size=UpperCamelCase_       ,				replace=UpperCamelCase_					)
   floored[inds] += 1
   need_to_add -= add_now
   if need_to_add == 0:
    break
 return floored.astype(np.intaa					)





def  lowercase(  UpperCamelCase_       ,				UpperCamelCase_       ,				UpperCamelCase_       ,				UpperCamelCase_       ,				UpperCamelCase_=10					)		->  Dict:







 '''simple docstring'''
 UpperCamelCase     ,    UpperCamelCase      =			np.unique(UpperCamelCase_       ,				return_inverse=UpperCamelCase_					)
 UpperCamelCase      =			classes.shape[0]
 UpperCamelCase      =			np.bincount(UpperCamelCase_					)
 if np.min(UpperCamelCase_					) < 2:
  raise ValueError("""Minimum class count error"""					)
 if n_train < n_classes:
  raise ValueError(
      """The train_size = %d should be greater or """ """equal to the number of classes = %d""" % (n_train, n_classes)					)
 if n_test < n_classes:
  raise ValueError(
      """The test_size = %d should be greater or """ """equal to the number of classes = %d""" % (n_test, n_classes)					)
 UpperCamelCase      =			np.split(np.argsort(UpperCamelCase_       ,				kind="""mergesort"""					)       ,				np.cumsum(UpperCamelCase_					)[:-1]					)
 for _ in range(UpperCamelCase_					):
  UpperCamelCase      =			approximate_mode(UpperCamelCase_       ,				UpperCamelCase_       ,				UpperCamelCase_					)
  UpperCamelCase      =			class_counts - n_i
  UpperCamelCase      =			approximate_mode(UpperCamelCase_       ,				UpperCamelCase_       ,				UpperCamelCase_					)

  UpperCamelCase      =			[]
  UpperCamelCase      =			[]

  for i in range(UpperCamelCase_					):
   UpperCamelCase      =			rng.permutation(class_counts[i]					)
   UpperCamelCase      =			class_indices[i].take(UpperCamelCase_       ,				mode="""clip"""					)
   train.extend(perm_indices_class_i[: n_i[i]]					)
   test.extend(perm_indices_class_i[n_i[i] : n_i[i] + t_i[i]]					)
  UpperCamelCase      =			rng.permutation(UpperCamelCase_					)
  UpperCamelCase      =			rng.permutation(UpperCamelCase_					)

  yield train, test
