
"""simple docstring"""







import unittest

import numpy as np

from transformers.testing_utils import require_torch, require_vision
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs


if is_torch_available():
							import torch

if is_vision_available():
							from PIL import Image

							from transformers import GLPNImageProcessor




class 				A__ (			unittest.TestCase):

		def __init__(   self ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE=7 ,	_SCREAMING_SNAKE_CASE=3 ,	_SCREAMING_SNAKE_CASE=18 ,	_SCREAMING_SNAKE_CASE=30 ,	_SCREAMING_SNAKE_CASE=4_00 ,	_SCREAMING_SNAKE_CASE=True ,	_SCREAMING_SNAKE_CASE=32 ,	_SCREAMING_SNAKE_CASE=True ,	):
			__lowerCAmelCase    :		int		    =   parent
			__lowerCAmelCase    :		Optional[int]		    =   batch_size
			__lowerCAmelCase    :		int		    =   num_channels
			__lowerCAmelCase    :		Any		    =   image_size
			__lowerCAmelCase    :		Dict		    =   min_resolution
			__lowerCAmelCase    :		List[Any]		    =   max_resolution
			__lowerCAmelCase    :		int		    =   do_resize
			__lowerCAmelCase    :		int		    =   size_divisor
			__lowerCAmelCase    :		Optional[Any]		    =   do_rescale







		def 							__lowerCamelCase							(   self				):
			return {
			    "do_resize": self.do_resize,
			    "size_divisor": self.size_divisor,
			    "do_rescale": self.do_rescale,
			}




@require_torch
@require_vision
class 				A__ (			_lowerCamelCase ,  unittest.TestCase):
		A_		: Optional[int]            =			GLPNImageProcessor if is_vision_available() else None

		def 							__lowerCamelCase							(   self				):
			__lowerCAmelCase    :		int		    =   GLPNImageProcessingTester(self				)

		@property
		def 							__lowerCamelCase							(   self				):
			return self.image_processor_tester.prepare_image_processor_dict()

		def 							__lowerCamelCase							(   self				):
			__lowerCAmelCase    :		int		    =   self.image_processing_class(**self.image_processor_dict				)
			self.assertTrue(hasattr(_SCREAMING_SNAKE_CASE ,	'do_resize'				)				)
			self.assertTrue(hasattr(_SCREAMING_SNAKE_CASE ,	'size_divisor'				)				)
			self.assertTrue(hasattr(_SCREAMING_SNAKE_CASE ,	'resample'				)				)
			self.assertTrue(hasattr(_SCREAMING_SNAKE_CASE ,	'do_rescale'				)				)

		def 							__lowerCamelCase							(   self				):
			pass

		def 							__lowerCamelCase							(   self				):
			# Initialize image_processing
			__lowerCAmelCase    :		Optional[Any]		    =   self.image_processing_class(**self.image_processor_dict				)
			# create random PIL images
			__lowerCAmelCase    :		Any		    =   prepare_image_inputs(self.image_processor_tester ,	equal_resolution=_SCREAMING_SNAKE_CASE				)
			for image in image_inputs:
				self.assertIsInstance(_SCREAMING_SNAKE_CASE ,	Image.Image				)

			# Test not batched input (GLPNImageProcessor doesn't support batching)
			__lowerCAmelCase    :		Union[str, Any]		    =   image_processing(image_inputs[0] ,	return_tensors='pt'				).pixel_values
			self.assertTrue(encoded_images.shape[-1] % self.image_processor_tester.size_divisor == 0				)
			self.assertTrue(encoded_images.shape[-2] % self.image_processor_tester.size_divisor == 0				)

		def 							__lowerCamelCase							(   self				):
			# Initialize image_processing
			__lowerCAmelCase    :		str		    =   self.image_processing_class(**self.image_processor_dict				)
			# create random numpy tensors
			__lowerCAmelCase    :		str		    =   prepare_image_inputs(self.image_processor_tester ,	equal_resolution=_SCREAMING_SNAKE_CASE ,	numpify=_SCREAMING_SNAKE_CASE				)
			for image in image_inputs:
				self.assertIsInstance(_SCREAMING_SNAKE_CASE ,	np.ndarray				)

			# Test not batched input (GLPNImageProcessor doesn't support batching)
			__lowerCAmelCase    :		List[Any]		    =   image_processing(image_inputs[0] ,	return_tensors='pt'				).pixel_values
			self.assertTrue(encoded_images.shape[-1] % self.image_processor_tester.size_divisor == 0				)
			self.assertTrue(encoded_images.shape[-2] % self.image_processor_tester.size_divisor == 0				)







		def 							__lowerCamelCase							(   self				):
			# Initialize image_processing
			__lowerCAmelCase    :		str		    =   self.image_processing_class(**self.image_processor_dict				)
			# create random PyTorch tensors
			__lowerCAmelCase    :		List[str]		    =   prepare_image_inputs(self.image_processor_tester ,	equal_resolution=_SCREAMING_SNAKE_CASE ,	torchify=_SCREAMING_SNAKE_CASE				)
			for image in image_inputs:
				self.assertIsInstance(_SCREAMING_SNAKE_CASE ,	torch.Tensor				)

			# Test not batched input (GLPNImageProcessor doesn't support batching)
			__lowerCAmelCase    :		Optional[int]		    =   image_processing(image_inputs[0] ,	return_tensors='pt'				).pixel_values
			self.assertTrue(encoded_images.shape[-1] % self.image_processor_tester.size_divisor == 0				)
			self.assertTrue(encoded_images.shape[-2] % self.image_processor_tester.size_divisor == 0				)

"""simple docstring"""







def 					__lowerCAmelCase       (_UpperCamelCase	):
	if n_term == "":
		return []
	__lowerCAmelCase    :		list		    =   []
	for temp in range(int(_UpperCamelCase	)	):
		series.append(F"1/{temp + 1}" if series else '1'	)
	return series


if __name__ == "__main__":
							lowerCamelCase__           =	input("""Enter the last number (nth term) of the Harmonic Series""")
							print("""Formula of Harmonic Series => 1+1/2+1/3 ..... 1/n""")
							print(harmonic_series(nth_term))