



'''simple docstring'''
from __future__ import annotations

import os



class _A	:
		_SCREAMING_SNAKE_CASE       :     Optional[Any]       =      (
		    "High card",
		    "One pair",
		    "Two pairs",
		    "Three of a kind",
		    "Straight",
		    "Flush",
		    "Full house",
		    "Four of a kind",
		    "Straight flush",
		    "Royal flush",
		)

		_SCREAMING_SNAKE_CASE       :     Optional[Any]       =      (
		    "",  # placeholder as tuples are zero-indexed
		    "One",
		    "Two",
		    "Three",
		    "Four",
		    "Five",
		    "Six",
		    "Seven",
		    "Eight",
		    "Nine",
		    "Ten",
		    "Jack",
		    "Queen",
		    "King",
		    "Ace",
		)





		def __init__(  self			,							__UpperCAmelCase					)							->  None:

					'''simple docstring'''
					if not isinstance(__UpperCAmelCase			,							__UpperCAmelCase					):
								__UpperCAmelCase :   List[str]    					=  f'Hand should be of type \'str\': {hand!r}'
								raise TypeError(__UpperCAmelCase					)
					# split removes duplicate whitespaces so no need of strip
					if len(hand.split(""" """					)					) != 5:
								__UpperCAmelCase :   Dict    					=  f'Hand should contain only 5 cards: {hand!r}'
								raise ValueError(__UpperCAmelCase					)
					__UpperCAmelCase :   int    					=  hand
					__UpperCAmelCase :   str    					=  0
					__UpperCAmelCase :   List[Any]    					=  0
					__UpperCAmelCase					,	__UpperCAmelCase :   str    					=  self._internal_state()
					__UpperCAmelCase :   Optional[int]    					=  self._get_hand_type()
					__UpperCAmelCase :   Dict    					=  self._card_values[0]





		@property
		def 				__A							(  self					)							->  Union[str, Any]:

					'''simple docstring'''
					return self._hand





		def 				__A							(  self			,							__UpperCAmelCase					)							->  str:

					'''simple docstring'''
					# Breaking the tie works on the following order of precedence:
					# 1. First pair (default 0)
					# 2. Second pair (default 0)
					# 3. Compare all cards in reverse order because they are sorted.

					# First pair and second pair will only be a non-zero value if the card
					# type is either from the following:
					# 21: Four of a kind
					# 20: Full house
					# 17: Three of a kind
					# 16: Two pairs
					# 15: One pair
					if self._hand_type > other._hand_type:
								return "Win"
					elif self._hand_type < other._hand_type:
								return "Loss"
					elif self._first_pair == other._first_pair:
								if self._second_pair == other._second_pair:
											return self._compare_cards(__UpperCAmelCase					)
								else:
											return "Win" if self._second_pair > other._second_pair else "Loss"
					return "Win" if self._first_pair > other._first_pair else "Loss"





		def 				__A							(  self					)							->  str:

					'''simple docstring'''
					__UpperCAmelCase :   Dict    					=  PokerHand._HAND_NAME[self._hand_type - 14]
					__UpperCAmelCase :   Optional[int]    					=  PokerHand._CARD_NAME[self._high_card]
					__UpperCAmelCase :   Optional[Any]    					=  PokerHand._CARD_NAME[self._first_pair]
					__UpperCAmelCase :   List[str]    					=  PokerHand._CARD_NAME[self._second_pair]
					if self._hand_type in [22, 19, 18]:
								return name + f', {high}-high'
					elif self._hand_type in [21, 17, 15]:
								return name + f', {paira}s'
					elif self._hand_type in [20, 16]:
								__UpperCAmelCase :   Tuple    					=  """over""" if self._hand_type == 20 else """and"""
								return name + f', {paira}s {join} {paira}s'
					elif self._hand_type == 23:
								return name
					else:
								return name + f', {high}'





		def 				__A							(  self			,							__UpperCAmelCase					)							->  str:

					'''simple docstring'''
					# Enumerate gives us the index as well as the element of a list
					for index, card_value in enumerate(self._card_values					):
								if card_value != other._card_values[index]:
											return "Win" if card_value > other._card_values[index] else "Loss"
					return "Tie"





		def 				__A							(  self					)							->  int:

					'''simple docstring'''
					# Number representing the type of hand internally:
					# 23: Royal flush
					# 22: Straight flush
					# 21: Four of a kind
					# 20: Full house
					# 19: Flush
					# 18: Straight
					# 17: Three of a kind
					# 16: Two pairs
					# 15: One pair
					# 14: High card
					if self._is_flush():
								if self._is_five_high_straight() or self._is_straight():
											return 23 if sum(self._card_values					) == 60 else 22
								return 19
					elif self._is_five_high_straight() or self._is_straight():
								return 18
					return 14 + self._is_same_kind()





		def 				__A							(  self					)							->  bool:

					'''simple docstring'''
					return len(self._card_suit					) == 1





		def 				__A							(  self					)							->  bool:

					'''simple docstring'''
					# If a card is a five high straight (low ace) change the location of
					# ace from the start of the list to the end. Check whether the first
					# element is ace or not. (Don't want to change again)
					# Five high straight (low ace): AH 2H 3S 4C 5D
					# Why use sorted here? One call to this function will mutate the list to
					# [5, 4, 3, 2, 14] and so for subsequent calls (which will be rare) we
					# need to compare the sorted version.
					# Refer test_multiple_calls_five_high_straight in test_poker_hand.py
					if sorted(self._card_values					) == [2, 3, 4, 5, 14]:
								if self._card_values[0] == 14:
											# Remember, our list is sorted in reverse order
											__UpperCAmelCase :   Optional[int]    					=  self._card_values.pop(0					)
											self._card_values.append(__UpperCAmelCase					)
								return True
					return False





		def 				__A							(  self					)							->  bool:

					'''simple docstring'''
					for i in range(4					):
								if self._card_values[i] - self._card_values[i + 1] != 1:
											return False
					return True





		def 				__A							(  self					)							->  int:

					'''simple docstring'''
					# Kind Values for internal use:
					# 7: Four of a kind
					# 6: Full house
					# 3: Three of a kind
					# 2: Two pairs
					# 1: One pair
					# 0: False
					__UpperCAmelCase :   Dict    					=  0
					for i in range(4					):
								# Compare two cards at a time, if they are same increase 'kind',
								# add the value of the card to val1, if it is repeating again we
								# will add 2 to 'kind' as there are now 3 cards with same value.
								# If we get card of different value than val1, we will do the same
								# thing with val2
								if self._card_values[i] == self._card_values[i + 1]:
											if not vala:
														__UpperCAmelCase :   str    					=  self._card_values[i]
														kind += 1
											elif vala == self._card_values[i]:
														kind += 2
											elif not vala:
														__UpperCAmelCase :   Dict    					=  self._card_values[i]
														kind += 1
											elif vala == self._card_values[i]:
														kind += 2
        # For consistency in hand type (look at note in _get_hand_type function)
					__UpperCAmelCase :   int    					=  kind + 2 if kind in [4, 5] else kind
					# first meaning first pair to compare in 'compare_with'
					__UpperCAmelCase :   int    					=  max(__UpperCAmelCase			,							__UpperCAmelCase					)
					__UpperCAmelCase :   Optional[Any]    					=  min(__UpperCAmelCase			,							__UpperCAmelCase					)
					# If it's full house (three count pair + two count pair), make sure
					# first pair is three count and if not then switch them both.
					if kind == 6 and self._card_values.count(__UpperCAmelCase					) != 3:
								__UpperCAmelCase					,	__UpperCAmelCase :   List[Any]    					=  second, first
					__UpperCAmelCase :   List[Any]    					=  first
					__UpperCAmelCase :   Any    					=  second
					return kind





		def 				__A							(  self					)							->  tuple[list[int], set[str]]:

					'''simple docstring'''
					# Internal representation of hand as a list of card values and
					# a set of card suit
					__UpperCAmelCase :   dict    					=  {"T": "10", "J": "11", "Q": "12", "K": "13", "A": "14"}
					__UpperCAmelCase :   Union[str, Any]    					=  self._hand.translate(str.maketrans(__UpperCAmelCase					)					).split()
					__UpperCAmelCase :   List[str]    					=  [int(card[:-1]					) for card in new_hand]
					__UpperCAmelCase :   Dict    					=  {card[-1] for card in new_hand}
					return sorted(__UpperCAmelCase			,							reverse=__UpperCAmelCase					), card_suit





		def __repr__(  self					)							->  List[Any]:

					'''simple docstring'''
					return f'{self.__class__}("{self._hand}")'





		def __str__(  self					)							->  List[str]:

					'''simple docstring'''
					return self._hand





		def __eq__(  self			,							__UpperCAmelCase					)							->  Optional[int]:

					'''simple docstring'''
					if isinstance(__UpperCAmelCase			,							__UpperCAmelCase					):
								return self.compare_with(__UpperCAmelCase					) == "Tie"
					return NotImplemented





		def __lt__(  self			,							__UpperCAmelCase					)							->  List[str]:

					'''simple docstring'''
					if isinstance(__UpperCAmelCase			,							__UpperCAmelCase					):
								return self.compare_with(__UpperCAmelCase					) == "Loss"
					return NotImplemented





		def __le__(  self			,							__UpperCAmelCase					)							->  List[Any]:

					'''simple docstring'''
					if isinstance(__UpperCAmelCase			,							__UpperCAmelCase					):
								return self < other or self == other
					return NotImplemented





		def __gt__(  self			,							__UpperCAmelCase					)							->  Union[str, Any]:

					'''simple docstring'''
					if isinstance(__UpperCAmelCase			,							__UpperCAmelCase					):
								return not self < other and self != other
					return NotImplemented





		def __ge__(  self			,							__UpperCAmelCase					)							->  int:

					'''simple docstring'''
					if isinstance(__UpperCAmelCase			,							__UpperCAmelCase					):
								return not self < other
					return NotImplemented





		def __hash__(  self					)							->  Dict:

					'''simple docstring'''
					return object.__hash__(self					)


def 	lowercase_						( ):

			"""simple docstring"""





			__UpperCAmelCase :   Tuple    					=  0
			__UpperCAmelCase :   List[Any]    					=  os.path.abspath(os.path.dirname(lowerCAmelCase__			)			)
			__UpperCAmelCase :   Dict    					=  os.path.join(lowerCAmelCase__      ,				"""poker_hands.txt"""			)
			with open(lowerCAmelCase__			) as file_hand:
						for line in file_hand:
									__UpperCAmelCase :   Any    					=  line[:14].strip()
									__UpperCAmelCase :   List[str]    					=  line[15:].strip()
									__UpperCAmelCase					,	__UpperCAmelCase :   Dict    					=  PokerHand(lowerCAmelCase__			), PokerHand(lowerCAmelCase__			)
									__UpperCAmelCase :   Optional[int]    					=  player.compare_with(lowerCAmelCase__			)
									if output == "Win":
												answer += 1
			return answer


if __name__ == "__main__":
					solution()









'''simple docstring'''
from __future__ import annotations

import inspect
import unittest
from typing import List, Tuple

from transformers import ConvNextConfig
from transformers.testing_utils import require_tf, require_vision, slow
from transformers.utils import cached_property, is_tf_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
					import tensorflow as tf

					from transformers import TFConvNextForImageClassification, TFConvNextModel


if is_vision_available():
					from PIL import Image

					from transformers import ConvNextImageProcessor



class _A	:





		def __init__(  self			,							__UpperCAmelCase			,							__UpperCAmelCase=13			,							__UpperCAmelCase=32			,							__UpperCAmelCase=3			,							__UpperCAmelCase=4			,							__UpperCAmelCase=[10, 20, 30, 40]			,							__UpperCAmelCase=[2, 2, 3, 2]			,							__UpperCAmelCase=True			,							__UpperCAmelCase=True			,							__UpperCAmelCase=37			,							__UpperCAmelCase="gelu"			,							__UpperCAmelCase=10			,							__UpperCAmelCase=0.02			,							__UpperCAmelCase=3			,							__UpperCAmelCase=None			,							)							->  Any:

					'''simple docstring'''
					__UpperCAmelCase :   Optional[int]    					=  parent
					__UpperCAmelCase :   Optional[Any]    					=  batch_size
					__UpperCAmelCase :   List[str]    					=  image_size
					__UpperCAmelCase :   Optional[Any]    					=  num_channels
					__UpperCAmelCase :   int    					=  num_stages
					__UpperCAmelCase :   List[Any]    					=  hidden_sizes
					__UpperCAmelCase :   Optional[Any]    					=  depths
					__UpperCAmelCase :   List[str]    					=  is_training
					__UpperCAmelCase :   Tuple    					=  use_labels
					__UpperCAmelCase :   Optional[Any]    					=  intermediate_size
					__UpperCAmelCase :   Dict    					=  hidden_act
					__UpperCAmelCase :   List[str]    					=  type_sequence_label_size
					__UpperCAmelCase :   Union[str, Any]    					=  initializer_range
					__UpperCAmelCase :   Optional[Any]    					=  scope





		def 				__A							(  self					)							->  Optional[Any]:

					'''simple docstring'''
					__UpperCAmelCase :   List[Any]    					=  floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]					)

					__UpperCAmelCase :   str    					=  None
					if self.use_labels:
								__UpperCAmelCase :   Optional[Any]    					=  ids_tensor([self.batch_size]			,							self.type_sequence_label_size					)

					__UpperCAmelCase :   Optional[int]    					=  self.get_config()

					return config, pixel_values, labels





		def 				__A							(  self					)							->  Optional[Any]:

					'''simple docstring'''
					return ConvNextConfig(
					    num_channels=self.num_channels			,							hidden_sizes=self.hidden_sizes			,							depths=self.depths			,							num_stages=self.num_stages			,							hidden_act=self.hidden_act			,							is_decoder=__UpperCAmelCase			,							initializer_range=self.initializer_range			,							)





		def 				__A							(  self			,							__UpperCAmelCase			,							__UpperCAmelCase			,							__UpperCAmelCase					)							->  List[Any]:

					'''simple docstring'''
					__UpperCAmelCase :   List[Any]    					=  TFConvNextModel(config=__UpperCAmelCase					)
					__UpperCAmelCase :   List[Any]    					=  model(__UpperCAmelCase			,							training=__UpperCAmelCase					)
					# expected last hidden states: B, C, H // 32, W // 32
					self.parent.assertEqual(
					    result.last_hidden_state.shape			,							(self.batch_size, self.hidden_sizes[-1], self.image_size // 32, self.image_size // 32)			,							)





		def 				__A							(  self			,							__UpperCAmelCase			,							__UpperCAmelCase			,							__UpperCAmelCase					)							->  Optional[int]:

					'''simple docstring'''
					__UpperCAmelCase :   Optional[int]    					=  self.type_sequence_label_size
					__UpperCAmelCase :   List[Any]    					=  TFConvNextForImageClassification(__UpperCAmelCase					)
					__UpperCAmelCase :   List[str]    					=  model(__UpperCAmelCase			,							labels=__UpperCAmelCase			,							training=__UpperCAmelCase					)
					self.parent.assertEqual(result.logits.shape			,							(self.batch_size, self.type_sequence_label_size)					)





		def 				__A							(  self					)							->  Union[str, Any]:

					'''simple docstring'''
					__UpperCAmelCase :   List[str]    					=  self.prepare_config_and_inputs()
					__UpperCAmelCase					,	__UpperCAmelCase					,	__UpperCAmelCase :   Optional[int]    					=  config_and_inputs
					__UpperCAmelCase :   Union[str, Any]    					=  {"""pixel_values""": pixel_values}
					return config, inputs_dict



@require_tf
class _A	(     __SCREAMING_SNAKE_CASE						,					__SCREAMING_SNAKE_CASE						,					unittest.TestCase     ):
		_SCREAMING_SNAKE_CASE       :     Dict       =      (TFConvNextModel, TFConvNextForImageClassification) if is_tf_available() else ()
		_SCREAMING_SNAKE_CASE       :     Optional[Any]       =      (
		    {"feature-extraction": TFConvNextModel, "image-classification": TFConvNextForImageClassification}
		    if is_tf_available()
		    else {}
		)

		_SCREAMING_SNAKE_CASE       :     Tuple       =      False
		_SCREAMING_SNAKE_CASE       :     Tuple       =      False
		_SCREAMING_SNAKE_CASE       :     Union[str, Any]       =      False
		_SCREAMING_SNAKE_CASE       :     Optional[Any]       =      False
		_SCREAMING_SNAKE_CASE       :     str       =      False





		def 				__A							(  self					)							->  List[Any]:

					'''simple docstring'''
					__UpperCAmelCase :   Dict    					=  TFConvNextModelTester(self					)
					__UpperCAmelCase :   Optional[int]    					=  ConfigTester(
					    self			,							config_class=__UpperCAmelCase			,							has_text_modality=__UpperCAmelCase			,							hidden_size=37			,							)





		@unittest.skip(reason="""ConvNext does not use inputs_embeds"""					)
		def 				__A							(  self					)							->  str:

					'''simple docstring'''
					pass





		@unittest.skipIf(
		    not is_tf_available() or len(tf.config.list_physical_devices("""GPU"""					)					) == 0			,							reason="""TF does not support backprop for grouped convolutions on CPU."""			,							)
		@slow
		def 				__A							(  self					)							->  Optional[int]:

					'''simple docstring'''
					super().test_keras_fit()





		@unittest.skip(reason="""ConvNext does not support input and output embeddings"""					)
		def 				__A							(  self					)							->  Dict:

					'''simple docstring'''
					pass





		def 				__A							(  self					)							->  str:

					'''simple docstring'''
					__UpperCAmelCase					,	__UpperCAmelCase :   List[str]    					=  self.model_tester.prepare_config_and_inputs_for_common()

					for model_class in self.all_model_classes:
								__UpperCAmelCase :   List[Any]    					=  model_class(__UpperCAmelCase					)
								__UpperCAmelCase :   str    					=  inspect.signature(model.call					)
								# signature.parameters is an OrderedDict => so arg_names order is deterministic
								__UpperCAmelCase :   Tuple    					=  [*signature.parameters.keys()]

								__UpperCAmelCase :   Tuple    					=  ["""pixel_values"""]
								self.assertListEqual(arg_names[:1]			,							__UpperCAmelCase					)





		def 				__A							(  self					)							->  Dict:

					'''simple docstring'''
					__UpperCAmelCase :   Dict    					=  self.model_tester.prepare_config_and_inputs()
					self.model_tester.create_and_check_model(*__UpperCAmelCase					)





		@unittest.skipIf(
		    not is_tf_available() or len(tf.config.list_physical_devices("""GPU"""					)					) == 0			,							reason="""TF does not support backprop for grouped convolutions on CPU."""			,							)
		def 				__A							(  self					)							->  Union[str, Any]:

					'''simple docstring'''
					super().test_dataset_conversion()





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

					'''simple docstring'''
					def check_hidden_states_output(__UpperCAmelCase			,							__UpperCAmelCase			,							__UpperCAmelCase					):
								__UpperCAmelCase :   Optional[int]    					=  model_class(__UpperCAmelCase					)

								__UpperCAmelCase :   str    					=  model(**self._prepare_for_class(__UpperCAmelCase			,							__UpperCAmelCase					)					)
								__UpperCAmelCase :   List[str]    					=  outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states

								__UpperCAmelCase :   Optional[int]    					=  self.model_tester.num_stages
								self.assertEqual(len(__UpperCAmelCase					)			,							expected_num_stages + 1					)

								# ConvNext's feature maps are of shape (batch_size, num_channels, height, width)
								self.assertListEqual(
								    list(hidden_states[0].shape[-2:]					)			,							[self.model_tester.image_size // 4, self.model_tester.image_size // 4]			,							)

					__UpperCAmelCase					,	__UpperCAmelCase :   Union[str, Any]    					=  self.model_tester.prepare_config_and_inputs_for_common()

					for model_class in self.all_model_classes:
								__UpperCAmelCase :   List[str]    					=  True
								check_hidden_states_output(__UpperCAmelCase			,							__UpperCAmelCase			,							__UpperCAmelCase					)

								# check that output_hidden_states also work using config
								del inputs_dict["output_hidden_states"]
								__UpperCAmelCase :   Optional[Any]    					=  True

								check_hidden_states_output(__UpperCAmelCase			,							__UpperCAmelCase			,							__UpperCAmelCase					)





		def 				__A							(  self					)							->  Tuple:

					'''simple docstring'''
					__UpperCAmelCase					,	__UpperCAmelCase :   Any    					=  self.model_tester.prepare_config_and_inputs_for_common()

					def check_equivalence(__UpperCAmelCase			,							__UpperCAmelCase			,							__UpperCAmelCase			,							__UpperCAmelCase={}					):
								__UpperCAmelCase :   Optional[Any]    					=  model(__UpperCAmelCase			,							return_dict=__UpperCAmelCase			,							**__UpperCAmelCase					)
								__UpperCAmelCase :   Optional[int]    					=  model(__UpperCAmelCase			,							return_dict=__UpperCAmelCase			,							**__UpperCAmelCase					).to_tuple()

								def recursive_check(__UpperCAmelCase			,							__UpperCAmelCase					):
											if isinstance(__UpperCAmelCase			,							(List, Tuple)					):
														for tuple_iterable_value, dict_iterable_value in zip(__UpperCAmelCase			,							__UpperCAmelCase					):
																	recursive_check(__UpperCAmelCase			,							__UpperCAmelCase					)
											elif tuple_object is None:
														return
											else:
														self.assertTrue(
														    all(tf.equal(__UpperCAmelCase			,							__UpperCAmelCase					)					)			,							msg=(
														        """Tuple and dict output are not equal. Difference:"""
														        f' {tf.math.reduce_max(tf.abs(tuple_object - dict_object					)					)}'
														    )			,							)

											recursive_check(__UpperCAmelCase			,							__UpperCAmelCase					)

					for model_class in self.all_model_classes:
								__UpperCAmelCase :   Dict    					=  model_class(__UpperCAmelCase					)

								__UpperCAmelCase :   Optional[int]    					=  self._prepare_for_class(__UpperCAmelCase			,							__UpperCAmelCase					)
								__UpperCAmelCase :   Tuple    					=  self._prepare_for_class(__UpperCAmelCase			,							__UpperCAmelCase					)
								check_equivalence(__UpperCAmelCase			,							__UpperCAmelCase			,							__UpperCAmelCase					)

								__UpperCAmelCase :   Union[str, Any]    					=  self._prepare_for_class(__UpperCAmelCase			,							__UpperCAmelCase			,							return_labels=__UpperCAmelCase					)
								__UpperCAmelCase :   Union[str, Any]    					=  self._prepare_for_class(__UpperCAmelCase			,							__UpperCAmelCase			,							return_labels=__UpperCAmelCase					)
								check_equivalence(__UpperCAmelCase			,							__UpperCAmelCase			,							__UpperCAmelCase					)

								__UpperCAmelCase :   Optional[Any]    					=  self._prepare_for_class(__UpperCAmelCase			,							__UpperCAmelCase					)
								__UpperCAmelCase :   List[str]    					=  self._prepare_for_class(__UpperCAmelCase			,							__UpperCAmelCase					)
								check_equivalence(__UpperCAmelCase			,							__UpperCAmelCase			,							__UpperCAmelCase			,							{"""output_hidden_states""": True}					)

								__UpperCAmelCase :   List[Any]    					=  self._prepare_for_class(__UpperCAmelCase			,							__UpperCAmelCase			,							return_labels=__UpperCAmelCase					)
								__UpperCAmelCase :   Dict    					=  self._prepare_for_class(__UpperCAmelCase			,							__UpperCAmelCase			,							return_labels=__UpperCAmelCase					)
								check_equivalence(__UpperCAmelCase			,							__UpperCAmelCase			,							__UpperCAmelCase			,							{"""output_hidden_states""": True}					)





		def 				__A							(  self					)							->  Tuple:

					'''simple docstring'''
					__UpperCAmelCase :   int    					=  self.model_tester.prepare_config_and_inputs()
					self.model_tester.create_and_check_for_image_classification(*__UpperCAmelCase					)





		@slow
		def 				__A							(  self					)							->  Tuple:

					'''simple docstring'''
					__UpperCAmelCase :   Union[str, Any]    					=  TFConvNextModel.from_pretrained("""facebook/convnext-tiny-224"""					)
					self.assertIsNotNone(__UpperCAmelCase					)


def 	lowercase_						( ):

			"""simple docstring"""





			__UpperCAmelCase :   str    					=  Image.open("""./tests/fixtures/tests_samples/COCO/000000039769.png"""			)
			return image






@require_tf
@require_vision
class _A	(     unittest.TestCase     ):





		@cached_property
		def 				__A							(  self					)							->  Any:

					'''simple docstring'''
					return ConvNextImageProcessor.from_pretrained("""facebook/convnext-tiny-224"""					) if is_vision_available() else None





		@slow
		def 				__A							(  self					)							->  int:

					'''simple docstring'''
					__UpperCAmelCase :   Tuple    					=  TFConvNextForImageClassification.from_pretrained("""facebook/convnext-tiny-224"""					)

					__UpperCAmelCase :   List[Any]    					=  self.default_image_processor
					__UpperCAmelCase :   int    					=  prepare_img()
					__UpperCAmelCase :   Optional[Any]    					=  image_processor(images=__UpperCAmelCase			,							return_tensors="""tf"""					)

					# forward pass
					__UpperCAmelCase :   List[Any]    					=  model(**__UpperCAmelCase					)

					# verify the logits
					__UpperCAmelCase :   List[str]    					=  tf.TensorShape((1, 1_000)					)
					self.assertEqual(outputs.logits.shape			,							__UpperCAmelCase					)

					__UpperCAmelCase :   str    					=  tf.constant([-0.0260, -0.4739, 0.1911]					)

					tf.debugging.assert_near(outputs.logits[0, :3]			,							__UpperCAmelCase			,							atol=1E-4					)




