


import unittest
from pathlib import Path

from transformers import is_vision_available, load_tool
from transformers.testing_utils import get_tests_dir

from .test_tools_common import ToolTesterMixin


if is_vision_available():
  from PIL import Image



class  UpperCAmelCase_						(				unittest.TestCase,  __lowerCAmelCase):
       '''simple docstring'''






       def 			_lowercase (  self    ):




              """simple docstring"""




              UpperCamelCase     :						str 						=		load_tool('''image-captioning'''    )
              self.tool.setup()
              UpperCamelCase     :						Any 						=		load_tool('''image-captioning'''			,       remote=_UpperCamelCase    )






       def 			_lowercase (  self    ):




              """simple docstring"""




              UpperCamelCase     :						Union[str, Any] 						=		Image.open(Path(get_tests_dir('''fixtures/tests_samples/COCO'''    )    ) / '''000000039769.png'''    )
              UpperCamelCase     :						List[str] 						=		self.tool(_UpperCamelCase    )
              self.assertEqual(_UpperCamelCase			,       '''two cats sleeping on a couch'''    )






       def 			_lowercase (  self    ):




              """simple docstring"""




              UpperCamelCase     :						str 						=		Image.open(Path(get_tests_dir('''fixtures/tests_samples/COCO'''    )    ) / '''000000039769.png'''    )
              UpperCamelCase     :						Any 						=		self.remote_tool(_UpperCamelCase    )
              self.assertEqual(_UpperCamelCase			,       '''two cats sleeping on a couch'''    )






       def 			_lowercase (  self    ):




              """simple docstring"""




              UpperCamelCase     :						List[str] 						=		Image.open(Path(get_tests_dir('''fixtures/tests_samples/COCO'''    )    ) / '''000000039769.png'''    )
              UpperCamelCase     :						Dict 						=		self.tool(image=_UpperCamelCase    )
              self.assertEqual(_UpperCamelCase			,       '''two cats sleeping on a couch'''    )






       def 			_lowercase (  self    ):




              """simple docstring"""




              UpperCamelCase     :						Any 						=		Image.open(Path(get_tests_dir('''fixtures/tests_samples/COCO'''    )    ) / '''000000039769.png'''    )
              UpperCamelCase     :						Union[str, Any] 						=		self.remote_tool(image=_UpperCamelCase    )
              self.assertEqual(_UpperCamelCase			,       '''two cats sleeping on a couch'''    )


from __future__ import annotations

import sys







def     A__	(       __A						):







    '''simple docstring'''
    if n < 0:
        raise ValueError("""Negative arguments are not supported"""						)
    return _fib(__A						)[0]







def     A__	(       __A						):







    '''simple docstring'''
    if n == 0:  # (F(0), F(1))
        return (0, 1)

    # F(2n) = F(n)[2F(n+1) − F(n)]
    # F(2n+1) = F(n+1)^2+F(n)^2
    _lowerCamelCase    ,				_lowerCamelCase  :		List[Any]			    =    _fib(n // 2						)
    _lowerCamelCase  :		List[Any]			    =    a * (b * 2 - a)
    _lowerCamelCase  :		Optional[int]			    =    a * a + b * b
    return (d, c + d) if n % 2 else (c, d)


if __name__ == "__main__":
    lowerCAmelCase      :				Union[str, Any]     			=int(sys.argv[1])
    print(F"""fibonacci({n}) is {fibonacci(n)}""")




