
"""simple docstring"""

import json
import os
import unittest

from transformers.models.gptsan_japanese.tokenization_gptsan_japanese import (
    VOCAB_FILES_NAMES,
    GPTSanJapaneseTokenizer,
)
from transformers.testing_utils import require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin






@require_tokenizers
class 	_lowercase       (    __UpperCAmelCase    ,	unittest.TestCase		):
 lowercase_				=     GPTSanJapaneseTokenizer
 lowercase_				=     False
 lowercase_				=     {'do_clean_text': False, 'add_prefix_space': False}




 def       _UpperCamelCase   (			self )		->							Dict:
   super().setUp()

   # fmt: off
   lowerCamelCase					:      Tuple          =   ['こん', 'こんに', 'にちは', 'ばんは', '世界,㔺界', '、', '。', '<BR>', '<SP>', '<TAB>', '<URL>', '<EMAIL>', '<TEL>', '<DATE>', '<PRICE>', '<BLOCK>', '<KIGOU>', '<U2000U2BFF>', '<|emoji1|>', '<unk>', '<|bagoftoken|>', '<|endoftext|>']
   # fmt: on
   lowerCamelCase					:      List[str]          =   {'emoji': {'\ud83d\ude00': '<|emoji1|>'}, 'emoji_inv': {'<|emoji1|>': '\ud83d\ude00'}}  # 😀
   lowerCamelCase					:      List[str]          =   {'unk_token': '<unk>'}

   lowerCamelCase					:      Dict          =   os.path.join(self.tmpdirname		,			VOCAB_FILES_NAMES['vocab_file'] )
   lowerCamelCase					:      int          =   os.path.join(self.tmpdirname		,			VOCAB_FILES_NAMES['emoji_file'] )
   with open(self.vocab_file		,			'w'		,			encoding='utf-8' ) as vocab_writer:
     vocab_writer.write(''.join([x + '\n' for x in vocab_tokens] ) )
   with open(self.emoji_file		,			'w' ) as emoji_writer:
     emoji_writer.write(json.dumps(UpperCAmelCase_ ) )




 def       _UpperCamelCase   (			self		,			**UpperCAmelCase_ )		->							List[str]:
   kwargs.update(self.special_tokens_map )
   return GPTSanJapaneseTokenizer.from_pretrained(self.tmpdirname		,			**UpperCAmelCase_ )




 def       _UpperCamelCase   (			self		,			UpperCAmelCase_ )		->							List[str]:
   lowerCamelCase					:      Tuple          =   'こんにちは、世界。 \nこんばんは、㔺界。😀'
   lowerCamelCase					:      List[str]          =   'こんにちは、世界。 \nこんばんは、世界。😀'
   return input_text, output_text




 def       _UpperCamelCase   (			self		,			UpperCAmelCase_ )		->							Dict:
   lowerCamelCase					:      List[Any]          =   self.get_input_output_texts(UpperCAmelCase_ )
   lowerCamelCase					:      int          =   tokenizer.encode(UpperCAmelCase_		,			add_special_tokens=UpperCAmelCase_ )
   lowerCamelCase					:      Optional[Any]          =   tokenizer.decode(UpperCAmelCase_		,			clean_up_tokenization_spaces=UpperCAmelCase_ )
   return text, ids




 def       _UpperCamelCase   (			self )		->							int:
   pass  # TODO add if relevant




 def       _UpperCamelCase   (			self )		->							Optional[int]:
   pass  # TODO add if relevant




 def       _UpperCamelCase   (			self )		->							Tuple:
   pass  # TODO add if relevant




 def       _UpperCamelCase   (			self )		->							Any:
   lowerCamelCase					:      Dict          =   self.get_tokenizer()

   # Testing tokenization
   lowerCamelCase					:      Any          =   'こんにちは、世界。　こんばんは、㔺界。'
   lowerCamelCase					:      Any          =   ['こん', 'にちは', '、', '世界', '。', '<SP>', 'こん', 'ばんは', '、', '㔺界', '。']
   lowerCamelCase					:      str          =   tokenizer.tokenize(UpperCAmelCase_ )
   self.assertListEqual(UpperCAmelCase_		,			UpperCAmelCase_ )

   # Testing conversion to ids without special tokens
   lowerCamelCase					:      Optional[Any]          =   [0, 2, 5, 4, 6, 8, 0, 3, 5, 4, 6]
   lowerCamelCase					:      Union[str, Any]          =   tokenizer.convert_tokens_to_ids(UpperCAmelCase_ )
   self.assertListEqual(UpperCAmelCase_		,			UpperCAmelCase_ )

   # Testing conversion to ids with special tokens
   lowerCamelCase					:      Union[str, Any]          =   tokens + [tokenizer.unk_token]
   lowerCamelCase					:      Optional[int]          =   [0, 2, 5, 4, 6, 8, 0, 3, 5, 4, 6, 19]
   lowerCamelCase					:      Union[str, Any]          =   tokenizer.convert_tokens_to_ids(UpperCAmelCase_ )
   self.assertListEqual(UpperCAmelCase_		,			UpperCAmelCase_ )




 def       _UpperCamelCase   (			self )		->							int:
   lowerCamelCase					:      Optional[int]          =   self.get_tokenizer()

   # Testing tokenization
   lowerCamelCase					:      str          =   'こんにちは、<|bagoftoken|>世界。こんばんは、<|bagoftoken|>㔺界。'
   lowerCamelCase					:      str          =   'こんにちは、、、、世界。こんばんは、、、、世界。'
   lowerCamelCase					:      int          =   tokenizer.encode(UpperCAmelCase_ )
   lowerCamelCase					:      List[Any]          =   tokenizer.decode(UpperCAmelCase_ )
   self.assertEqual(UpperCAmelCase_		,			UpperCAmelCase_ )




 @slow
 def       _UpperCamelCase   (			self )		->							Optional[int]:
   lowerCamelCase					:      Any          =   self.tokenizer_class.from_pretrained('Tanrei/GPTSAN-japanese' )

   # Testing tokenization
   lowerCamelCase					:      Optional[Any]          =   'こんにちは、世界。'
   lowerCamelCase					:      str          =   'こんばんは、㔺界。😀'
   lowerCamelCase					:      List[Any]          =   'こんにちは、世界。こんばんは、世界。😀'
   lowerCamelCase					:      int          =   tokenizer.encode(prefix_text + input_text )
   lowerCamelCase					:      Dict          =   tokenizer.encode(''		,			prefix_text=prefix_text + input_text )
   lowerCamelCase					:      Union[str, Any]          =   tokenizer.encode(UpperCAmelCase_		,			prefix_text=UpperCAmelCase_ )
   lowerCamelCase					:      List[str]          =   tokenizer.decode(UpperCAmelCase_ )
   lowerCamelCase					:      List[Any]          =   tokenizer.decode(UpperCAmelCase_ )
   lowerCamelCase					:      List[str]          =   tokenizer.decode(UpperCAmelCase_ )
   self.assertEqual(UpperCAmelCase_		,			UpperCAmelCase_ )
   self.assertEqual(UpperCAmelCase_		,			UpperCAmelCase_ )
   self.assertEqual(UpperCAmelCase_		,			UpperCAmelCase_ )




 @slow
 def       _UpperCamelCase   (			self )		->							Optional[Any]:
   lowerCamelCase					:      Optional[Any]          =   self.tokenizer_class.from_pretrained('Tanrei/GPTSAN-japanese' )

   # Testing tokenization
   lowerCamelCase					:      Any          =   'こんにちは、世界。'
   lowerCamelCase					:      int          =   'こんばんは、㔺界。😀'

   lowerCamelCase					:      int          =   len(tokenizer.encode(UpperCAmelCase_ ) ) - 2
   lowerCamelCase					:      int          =   len(tokenizer.encode(UpperCAmelCase_ ) ) - 2

   lowerCamelCase					:      List[str]          =   [1] + [0] * (len_prefix + len_text + 1)
   lowerCamelCase					:      List[str]          =   [1] * (len_prefix + len_text + 1) + [0]
   lowerCamelCase					:      List[Any]          =   [1] + [1] * (len_prefix) + [0] * (len_text + 1)

   lowerCamelCase					:      List[Any]          =   tokenizer(prefix_text + input_text ).token_type_ids
   lowerCamelCase					:      List[str]          =   tokenizer(''		,			prefix_text=prefix_text + input_text ).token_type_ids
   lowerCamelCase					:      Dict          =   tokenizer(UpperCAmelCase_		,			prefix_text=UpperCAmelCase_ ).token_type_ids
   self.assertListEqual(UpperCAmelCase_		,			UpperCAmelCase_ )
   self.assertListEqual(UpperCAmelCase_		,			UpperCAmelCase_ )
   self.assertListEqual(UpperCAmelCase_		,			UpperCAmelCase_ )




 @slow
 def       _UpperCamelCase   (			self )		->							int:
   lowerCamelCase					:      str          =   self.tokenizer_class.from_pretrained('Tanrei/GPTSAN-japanese' )

   lowerCamelCase					:      List[str]          =   tokenizer.encode('あンいワ' )
   lowerCamelCase					:      Optional[int]          =   tokenizer.encode(''		,			prefix_text='あンいワ' )
   lowerCamelCase					:      Union[str, Any]          =   tokenizer.encode('いワ'		,			prefix_text='あン' )

   self.assertEqual(tokenizer.decode(UpperCAmelCase_ )		,			tokenizer.decode(UpperCAmelCase_ ) )
   self.assertEqual(tokenizer.decode(UpperCAmelCase_ )		,			tokenizer.decode(UpperCAmelCase_ ) )
   self.assertNotEqual(UpperCAmelCase_		,			UpperCAmelCase_ )
   self.assertNotEqual(UpperCAmelCase_		,			UpperCAmelCase_ )
   self.assertEqual(x_token_a[1]		,			x_token_a[-1] )  # SEG token
   self.assertEqual(x_token_a[1]		,			x_token_a[3] )  # SEG token




 @slow
 def       _UpperCamelCase   (			self )		->							Dict:
   lowerCamelCase					:      Union[str, Any]          =   self.tokenizer_class.from_pretrained('Tanrei/GPTSAN-japanese' )

   lowerCamelCase					:      Union[str, Any]          =   [['武田信玄', 'は、'], ['織田信長', 'の配下の、']]
   lowerCamelCase					:      int          =   tokenizer(UpperCAmelCase_		,			padding=UpperCAmelCase_ )
   lowerCamelCase					:      Union[str, Any]          =   tokenizer.batch_encode_plus(UpperCAmelCase_		,			padding=UpperCAmelCase_ )

   # fmt: off
   lowerCamelCase					:      Dict          =   [[35993, 8640, 25948, 35998, 30647, 35675, 35999, 35999], [35993, 10382, 9868, 35998, 30646, 9459, 30646, 35675]]
   lowerCamelCase					:      Dict          =   [[1, 1, 1, 0, 0, 0, 0, 0], [1, 1, 1, 0, 0, 0, 0, 0]]
   lowerCamelCase					:      List[Any]          =   [[1, 1, 1, 1, 1, 1, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1]]
   # fmt: on
   self.assertListEqual(x_token.input_ids		,			UpperCAmelCase_ )
   self.assertListEqual(x_token.token_type_ids		,			UpperCAmelCase_ )
   self.assertListEqual(x_token.attention_mask		,			UpperCAmelCase_ )
   self.assertListEqual(x_token_a.input_ids		,			UpperCAmelCase_ )
   self.assertListEqual(x_token_a.token_type_ids		,			UpperCAmelCase_ )
   self.assertListEqual(x_token_a.attention_mask		,			UpperCAmelCase_ )




 def       _UpperCamelCase   (			self )		->							List[Any]:
   # Intentionally convert some words to accommodate character fluctuations unique to Japanese
   pass




 def       _UpperCamelCase   (			self )		->							List[Any]:
   # tokenizer has no padding token
   pass








"""simple docstring"""

import os
import tempfile
from functools import partial
from unittest import TestCase
from unittest.mock import patch

import numpy as np
import pytest

from datasets.arrow_dataset import Dataset
from datasets.search import ElasticSearchIndex, FaissIndex, MissingIndex

from .utils import require_elasticsearch, require_faiss


_A						=			pytest.mark.integration






@require_faiss
class 	_lowercase       (    __UpperCAmelCase		):




	def       _UpperCamelCase   (			self )		->							Union[str, Any]:
			lowerCamelCase					:      Any          =   Dataset.from_dict({'filename': ['my_name-train' + '_' + str(UpperCAmelCase_ ) for x in np.arange(30 ).tolist()]} )
			return dset




	def       _UpperCamelCase   (			self )		->							List[Any]:
			import faiss

			lowerCamelCase					:      Dataset          =   self._create_dummy_dataset()
			lowerCamelCase					:      Optional[int]          =   dset.map(
			    lambda UpperCAmelCase_		,			UpperCAmelCase_ : {"vecs": i * np.ones(5		,			dtype=np.floataa )}		,			with_indices=UpperCAmelCase_		,			keep_in_memory=UpperCAmelCase_ )
			lowerCamelCase					:      Dict          =   dset.add_faiss_index('vecs'		,			batch_size=100		,			metric_type=faiss.METRIC_INNER_PRODUCT )
			lowerCamelCase     ,   lowerCamelCase					:      List[str]          =   dset.get_nearest_examples('vecs'		,			np.ones(5		,			dtype=np.floataa ) )
			self.assertEqual(examples['filename'][0]		,			'my_name-train_29' )
			dset.drop_index('vecs' )




	def       _UpperCamelCase   (			self )		->							Tuple:
			import faiss

			lowerCamelCase					:      Dataset          =   self._create_dummy_dataset()
			dset.add_faiss_index_from_external_arrays(
			    external_arrays=np.ones((30, 5) ) * np.arange(30 ).reshape(-1		,			1 )		,			index_name='vecs'		,			batch_size=100		,			metric_type=faiss.METRIC_INNER_PRODUCT		,			)
			lowerCamelCase     ,   lowerCamelCase					:      str          =   dset.get_nearest_examples('vecs'		,			np.ones(5		,			dtype=np.floataa ) )
			self.assertEqual(examples['filename'][0]		,			'my_name-train_29' )




	def       _UpperCamelCase   (			self )		->							int:
			import faiss

			lowerCamelCase					:      Dataset          =   self._create_dummy_dataset()
			dset.add_faiss_index_from_external_arrays(
			    external_arrays=np.ones((30, 5) ) * np.arange(30 ).reshape(-1		,			1 )		,			index_name='vecs'		,			metric_type=faiss.METRIC_INNER_PRODUCT		,			)

			# Setting delete=False and unlinking manually is not pretty... but it is required on Windows to
			# ensure somewhat stable behaviour. If we don't, we get PermissionErrors. This is an age-old issue.
			# see https://bugs.python.org/issue14243 and
			# https://stackoverflow.com/questions/23212435/permission-denied-to-write-to-my-temporary-file/23212515
			with tempfile.NamedTemporaryFile(delete=UpperCAmelCase_ ) as tmp_file:
					dset.save_faiss_index('vecs'		,			tmp_file.name )
					dset.load_faiss_index('vecs2'		,			tmp_file.name )
			os.unlink(tmp_file.name )

			lowerCamelCase     ,   lowerCamelCase					:      List[str]          =   dset.get_nearest_examples('vecs2'		,			np.ones(5		,			dtype=np.floataa ) )
			self.assertEqual(examples['filename'][0]		,			'my_name-train_29' )




	def       _UpperCamelCase   (			self )		->							Any:
			lowerCamelCase					:      Dataset          =   self._create_dummy_dataset()
			dset.add_faiss_index_from_external_arrays(
			    external_arrays=np.ones((30, 5) ) * np.arange(30 ).reshape(-1		,			1 )		,			index_name='vecs' )
			dset.drop_index('vecs' )
			self.assertRaises(UpperCAmelCase_		,			partial(dset.get_nearest_examples		,			'vecs2'		,			np.ones(5		,			dtype=np.floataa ) ) )




	def       _UpperCamelCase   (			self )		->							Union[str, Any]:
			from elasticsearch import Elasticsearch

			lowerCamelCase					:      Dataset          =   self._create_dummy_dataset()
			with patch('elasticsearch.Elasticsearch.search' ) as mocked_search, patch(
			    'elasticsearch.client.IndicesClient.create' ) as mocked_index_create, patch('elasticsearch.helpers.streaming_bulk' ) as mocked_bulk:
					lowerCamelCase					:      Tuple          =   {'acknowledged': True}
					mocked_bulk.return_value([(True, None)] * 30 )
					lowerCamelCase					:      int          =   {'hits': {'hits': [{'_score': 1, '_id': 29}]}}
					lowerCamelCase					:      Optional[Any]          =   Elasticsearch()

					dset.add_elasticsearch_index('filename'		,			es_client=UpperCAmelCase_ )
					lowerCamelCase     ,   lowerCamelCase					:      str          =   dset.get_nearest_examples('filename'		,			'my_name-train_29' )
					self.assertEqual(examples['filename'][0]		,			'my_name-train_29' )






@require_faiss
class 	_lowercase       (    __UpperCAmelCase		):




	def       _UpperCamelCase   (			self )		->							Union[str, Any]:
			import faiss

			lowerCamelCase					:      str          =   FaissIndex(metric_type=faiss.METRIC_INNER_PRODUCT )

			# add vectors
			index.add_vectors(np.eye(5		,			dtype=np.floataa ) )
			self.assertIsNotNone(index.faiss_index )
			self.assertEqual(index.faiss_index.ntotal		,			5 )
			index.add_vectors(np.zeros((5, 5)		,			dtype=np.floataa ) )
			self.assertEqual(index.faiss_index.ntotal		,			10 )

			# single query
			lowerCamelCase					:      Optional[int]          =   np.zeros(5		,			dtype=np.floataa )
			lowerCamelCase					:      List[str]          =   1
			lowerCamelCase     ,   lowerCamelCase					:      int          =   index.search(UpperCAmelCase_ )
			self.assertRaises(UpperCAmelCase_		,			index.search		,			query.reshape(-1		,			1 ) )
			self.assertGreater(scores[0]		,			0 )
			self.assertEqual(indices[0]		,			1 )

			# batched queries
			lowerCamelCase					:      Tuple          =   np.eye(5		,			dtype=np.floataa )[::-1]
			lowerCamelCase     ,   lowerCamelCase					:      List[str]          =   index.search_batch(UpperCAmelCase_ )
			self.assertRaises(UpperCAmelCase_		,			index.search_batch		,			queries[0] )
			lowerCamelCase					:      List[str]          =   [scores[0] for scores in total_scores]
			lowerCamelCase					:      List[str]          =   [indices[0] for indices in total_indices]
			self.assertGreater(np.min(UpperCAmelCase_ )		,			0 )
			self.assertListEqual([4, 3, 2, 1, 0]		,			UpperCAmelCase_ )




	def       _UpperCamelCase   (			self )		->							Dict:
			import faiss

			lowerCamelCase					:      List[Any]          =   FaissIndex(string_factory='Flat' )
			index.add_vectors(np.eye(5		,			dtype=np.floataa ) )
			self.assertIsInstance(index.faiss_index		,			faiss.IndexFlat )
			lowerCamelCase					:      int          =   FaissIndex(string_factory='LSH' )
			index.add_vectors(np.eye(5		,			dtype=np.floataa ) )
			self.assertIsInstance(index.faiss_index		,			faiss.IndexLSH )
			with self.assertRaises(UpperCAmelCase_ ):
					lowerCamelCase					:      str          =   FaissIndex(string_factory='Flat'		,			custom_index=faiss.IndexFlat(5 ) )




	def       _UpperCamelCase   (			self )		->							Any:
			import faiss

			lowerCamelCase					:      Any          =   faiss.IndexFlat(5 )
			lowerCamelCase					:      Any          =   FaissIndex(custom_index=UpperCAmelCase_ )
			index.add_vectors(np.eye(5		,			dtype=np.floataa ) )
			self.assertIsInstance(index.faiss_index		,			faiss.IndexFlat )




	def       _UpperCamelCase   (			self )		->							Any:
			import faiss

			lowerCamelCase					:      Any          =   FaissIndex(metric_type=faiss.METRIC_INNER_PRODUCT )
			index.add_vectors(np.eye(5		,			dtype=np.floataa ) )

			# Setting delete=False and unlinking manually is not pretty... but it is required on Windows to
			# ensure somewhat stable behaviour. If we don't, we get PermissionErrors. This is an age-old issue.
			# see https://bugs.python.org/issue14243 and
			# https://stackoverflow.com/questions/23212435/permission-denied-to-write-to-my-temporary-file/23212515
			with tempfile.NamedTemporaryFile(delete=UpperCAmelCase_ ) as tmp_file:
					index.save(tmp_file.name )
					lowerCamelCase					:      List[str]          =   FaissIndex.load(tmp_file.name )
			os.unlink(tmp_file.name )

			lowerCamelCase					:      Dict          =   np.zeros(5		,			dtype=np.floataa )
			lowerCamelCase					:      Optional[Any]          =   1
			lowerCamelCase     ,   lowerCamelCase					:      str          =   index.search(UpperCAmelCase_ )
			self.assertGreater(scores[0]		,			0 )
			self.assertEqual(indices[0]		,			1 )


@require_faiss
def 		UpperCAmelCase (		a_      ):





		'''simple docstring'''


		import faiss

		lowerCamelCase					:      int          =   FaissIndex(metric_type=faiss.METRIC_INNER_PRODUCT      )
		index.add_vectors(np.eye(5,						dtype=np.floataa      )      )

		lowerCamelCase					:      Union[str, Any]          =   'index.faiss'
		lowerCamelCase					:      List[Any]          =   F"""mock://{index_name}"""
		index.save(a_,						storage_options=mockfs.storage_options      )
		lowerCamelCase					:      Optional[int]          =   FaissIndex.load(a_,						storage_options=mockfs.storage_options      )

		lowerCamelCase					:      str          =   np.zeros(5,						dtype=np.floataa      )
		lowerCamelCase					:      str          =   1
		lowerCamelCase     ,   lowerCamelCase					:      int          =   index.search(a_      )
		assert scores[0] > 0
		assert indices[0] == 1






@require_elasticsearch
class 	_lowercase       (    __UpperCAmelCase		):




	def       _UpperCamelCase   (			self )		->							int:
			from elasticsearch import Elasticsearch

			with patch('elasticsearch.Elasticsearch.search' ) as mocked_search, patch(
			    'elasticsearch.client.IndicesClient.create' ) as mocked_index_create, patch('elasticsearch.helpers.streaming_bulk' ) as mocked_bulk:
					lowerCamelCase					:      Union[str, Any]          =   Elasticsearch()
					lowerCamelCase					:      Optional[Any]          =   {'acknowledged': True}
					lowerCamelCase					:      str          =   ElasticSearchIndex(es_client=UpperCAmelCase_ )
					mocked_bulk.return_value([(True, None)] * 3 )
					index.add_documents(['foo', 'bar', 'foobar'] )

					# single query
					lowerCamelCase					:      Tuple          =   'foo'
					lowerCamelCase					:      List[str]          =   {'hits': {'hits': [{'_score': 1, '_id': 0}]}}
					lowerCamelCase     ,   lowerCamelCase					:      Any          =   index.search(UpperCAmelCase_ )
					self.assertEqual(scores[0]		,			1 )
					self.assertEqual(indices[0]		,			0 )

					# single query with timeout
					lowerCamelCase					:      Dict          =   'foo'
					lowerCamelCase					:      Optional[Any]          =   {'hits': {'hits': [{'_score': 1, '_id': 0}]}}
					lowerCamelCase     ,   lowerCamelCase					:      Optional[Any]          =   index.search(UpperCAmelCase_		,			request_timeout=30 )
					self.assertEqual(scores[0]		,			1 )
					self.assertEqual(indices[0]		,			0 )

					# batched queries
					lowerCamelCase					:      str          =   ['foo', 'bar', 'foobar']
					lowerCamelCase					:      Union[str, Any]          =   {'hits': {'hits': [{'_score': 1, '_id': 1}]}}
					lowerCamelCase     ,   lowerCamelCase					:      Optional[int]          =   index.search_batch(UpperCAmelCase_ )
					lowerCamelCase					:      Dict          =   [scores[0] for scores in total_scores]
					lowerCamelCase					:      Optional[int]          =   [indices[0] for indices in total_indices]
					self.assertGreater(np.min(UpperCAmelCase_ )		,			0 )
					self.assertListEqual([1, 1, 1]		,			UpperCAmelCase_ )

					# batched queries with timeout
					lowerCamelCase					:      List[str]          =   ['foo', 'bar', 'foobar']
					lowerCamelCase					:      str          =   {'hits': {'hits': [{'_score': 1, '_id': 1}]}}
					lowerCamelCase     ,   lowerCamelCase					:      Dict          =   index.search_batch(UpperCAmelCase_		,			request_timeout=30 )
					lowerCamelCase					:      Dict          =   [scores[0] for scores in total_scores]
					lowerCamelCase					:      int          =   [indices[0] for indices in total_indices]
					self.assertGreater(np.min(UpperCAmelCase_ )		,			0 )
					self.assertListEqual([1, 1, 1]		,			UpperCAmelCase_ )






