






import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


a_							=			'''
Hugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf originally as a company that developed a chatbot app targeted at teenagers.[2] After open-sourcing the model behind the chatbot, the company pivoted to focus on being a platform for machine learning.

In March 2021, Hugging Face raised $40 million in a Series B funding round.[3]

On April 28, 2021, the company launched the BigScience Research Workshop in collaboration with several other research groups to release an open large language model.[4] In 2022, the workshop concluded with the announcement of BLOOM, a multilingual large language model with 176 billion parameters.[5]
'''


class    lowercase__   (	unittest.TestCase,    __snake_case		):

	def 						UpperCAmelCase     (							self				)->    Optional[int]:







							'''simple docstring'''





							lowerCAmelCase__       					=  load_tool("text-question-answering"				)
							self.tool.setup()
							lowerCAmelCase__       					=  load_tool("text-question-answering"						,			remote=__SCREAMING_SNAKE_CASE				)

	def 						UpperCAmelCase     (							self				)->    Tuple:







							'''simple docstring'''





							lowerCAmelCase__       					=  self.tool(__SCREAMING_SNAKE_CASE						,			"What did Hugging Face do in April 2021?"				)
							self.assertEqual(__SCREAMING_SNAKE_CASE						,			"launched the BigScience Research Workshop"				)

	def 						UpperCAmelCase     (							self				)->    Optional[int]:







							'''simple docstring'''





							lowerCAmelCase__       					=  self.remote_tool(__SCREAMING_SNAKE_CASE						,			"What did Hugging Face do in April 2021?"				)
							self.assertEqual(__SCREAMING_SNAKE_CASE						,			"launched the BigScience Research Workshop"				)

	def 						UpperCAmelCase     (							self				)->    Optional[int]:







							'''simple docstring'''





							lowerCAmelCase__       					=  self.tool(text=__SCREAMING_SNAKE_CASE						,			question="What did Hugging Face do in April 2021?"				)
							self.assertEqual(__SCREAMING_SNAKE_CASE						,			"launched the BigScience Research Workshop"				)


	def 						UpperCAmelCase     (							self				)->    int:







							'''simple docstring'''





							lowerCAmelCase__       					=  self.remote_tool(text=__SCREAMING_SNAKE_CASE						,			question="What did Hugging Face do in April 2021?"				)
							self.assertEqual(__SCREAMING_SNAKE_CASE						,			"launched the BigScience Research Workshop"				)














"""simple docstring"""





from cva import destroyAllWindows, imread, imshow, waitKey







def      lowerCamelCase__       (							_lowerCamelCase       :		Tuple )      ->				Dict:
  # getting number of pixels in the image
  lowerCamelCase_     ,	lowerCamelCase_         =						img.shape[0], img.shape[1]

  # converting each pixel's color to its negative
  for i in range(_lowerCamelCase ):
    for j in range(_lowerCamelCase ):
      lowerCamelCase_         =						[255, 255, 255] - img[i][j]

  return img


if __name__ == "__main__":
  # read original image
  _SCREAMING_SNAKE_CASE					:				List[Any]					    =						imread('''image_data/lena.jpg''', 1)

  # convert to its negative
  _SCREAMING_SNAKE_CASE					:				List[Any]					    =						convert_to_negative(img)

  # show result image
  imshow('''negative of original image''', img)
  waitKey(0)
  destroyAllWindows()




