import json
import unittest

import numpy as np
from huggingface_hub import hf_hub_download

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 transformers import OneFormerImageProcessor
      from transformers.models.oneformer.image_processing_oneformer import binary_mask_to_rle
      from transformers.models.oneformer.modeling_oneformer import OneFormerForUniversalSegmentationOutput

if is_vision_available():
   from PIL import Image



def      __SCREAMING_SNAKE_CASE  ( __UpperCamelCase   :	Any			,					__UpperCamelCase   :	Tuple="shi-labs/oneformer_demo"     )							-> Tuple:







  """simple docstring"""





  with open(hf_hub_download(__UpperCamelCase			,					__UpperCamelCase			,					repo_type="""dataset"""     )			,					"""r"""     ) as f:
    SCREAMING_SNAKE_CASE__      							=				json.load(__UpperCamelCase     )
  SCREAMING_SNAKE_CASE__      							=				{}
  SCREAMING_SNAKE_CASE__      							=				[]
  SCREAMING_SNAKE_CASE__      							=				[]
  for key, info in class_info.items():
    SCREAMING_SNAKE_CASE__      							=				info["""name"""]
    class_names.append(info["""name"""]     )
    if info["isthing"]:
      thing_ids.append(int(__UpperCamelCase     )     )
  SCREAMING_SNAKE_CASE__      							=				thing_ids
  SCREAMING_SNAKE_CASE__      							=				class_names
  return metadata







class __snake_case    (						unittest.TestCase		):




       def __init__(   self      :    List[Any]	,     _lowercase      :    Optional[Any]	,     _lowercase      :    int=7	,     _lowercase      :    Any=3	,     _lowercase      :    int=30	,     _lowercase      :    List[Any]=4_00	,     _lowercase      :    Union[str, Any]=None	,     _lowercase      :    Dict=True	,     _lowercase      :    Tuple=True	,     _lowercase      :    int=[0.5, 0.5, 0.5]	,     _lowercase      :    List[str]=[0.5, 0.5, 0.5]	,     _lowercase      :    str=10	,     _lowercase      :    Union[str, Any]=False	,     _lowercase      :    int=2_55	,     _lowercase      :    List[str]="shi-labs/oneformer_demo"	,     _lowercase      :    Any="ade20k_panoptic.json"	,     _lowercase      :    Any=10	,     ):



         """simple docstring"""






         SCREAMING_SNAKE_CASE__      							=				parent
         SCREAMING_SNAKE_CASE__      							=				batch_size
         SCREAMING_SNAKE_CASE__      							=				num_channels
         SCREAMING_SNAKE_CASE__      							=				min_resolution
         SCREAMING_SNAKE_CASE__      							=				max_resolution
         SCREAMING_SNAKE_CASE__      							=				do_resize
         SCREAMING_SNAKE_CASE__      							=				{"""shortest_edge""": 32, """longest_edge""": 13_33} if size is None else size
         SCREAMING_SNAKE_CASE__      							=				do_normalize
         SCREAMING_SNAKE_CASE__      							=				image_mean
         SCREAMING_SNAKE_CASE__      							=				image_std
         SCREAMING_SNAKE_CASE__      							=				class_info_file
         SCREAMING_SNAKE_CASE__      							=				prepare_metadata(_lowercase	,     _lowercase				)
         SCREAMING_SNAKE_CASE__      							=				num_text
         SCREAMING_SNAKE_CASE__      							=				repo_path

         # for the post_process_functions
         SCREAMING_SNAKE_CASE__      							=				2
         SCREAMING_SNAKE_CASE__      							=				10
         SCREAMING_SNAKE_CASE__      							=				10
         SCREAMING_SNAKE_CASE__      							=				3
         SCREAMING_SNAKE_CASE__      							=				4
         SCREAMING_SNAKE_CASE__      							=				num_labels
         SCREAMING_SNAKE_CASE__      							=				do_reduce_labels
         SCREAMING_SNAKE_CASE__      							=				ignore_index




       def      __a						(   self      :    Optional[int]				):



         """simple docstring"""






         return {
             "do_resize": self.do_resize,
             "size": self.size,
             "do_normalize": self.do_normalize,
             "image_mean": self.image_mean,
             "image_std": self.image_std,
             "num_labels": self.num_labels,
             "do_reduce_labels": self.do_reduce_labels,
             "ignore_index": self.ignore_index,
             "class_info_file": self.class_info_file,
             "metadata": self.metadata,
             "num_text": self.num_text,
         }




       def      __a						(   self      :    List[Any]	,     _lowercase      :    Any	,     _lowercase      :    Optional[Any]=False				):



         """simple docstring"""






         if not batched:
           SCREAMING_SNAKE_CASE__      							=				image_inputs[0]
           if isinstance(_lowercase	,     Image.Image				):
             SCREAMING_SNAKE_CASE__							,					SCREAMING_SNAKE_CASE__      							=				image.size
           else:
             SCREAMING_SNAKE_CASE__							,					SCREAMING_SNAKE_CASE__      							=				image.shape[1], image.shape[2]
           if w < h:
             SCREAMING_SNAKE_CASE__      							=				int(self.size["""shortest_edge"""] * h / w				)
             SCREAMING_SNAKE_CASE__      							=				self.size["""shortest_edge"""]
           elif w > h:
             SCREAMING_SNAKE_CASE__      							=				self.size["""shortest_edge"""]
             SCREAMING_SNAKE_CASE__      							=				int(self.size["""shortest_edge"""] * w / h				)
           else:
             SCREAMING_SNAKE_CASE__      							=				self.size["""shortest_edge"""]
             SCREAMING_SNAKE_CASE__      							=				self.size["""shortest_edge"""]

         else:
           SCREAMING_SNAKE_CASE__      							=				[]
           for image in image_inputs:
             SCREAMING_SNAKE_CASE__							,					SCREAMING_SNAKE_CASE__      							=				self.get_expected_values([image]				)
             expected_values.append((expected_height, expected_width)				)
           SCREAMING_SNAKE_CASE__      							=				max(_lowercase	,     key=lambda _lowercase				: item[0]				)[0]
           SCREAMING_SNAKE_CASE__      							=				max(_lowercase	,     key=lambda _lowercase				: item[1]				)[1]

         return expected_height, expected_width




       def      __a						(   self      :    Dict				):



         """simple docstring"""






         return OneFormerForUniversalSegmentationOutput(
             # +1 for null class
             class_queries_logits=torch.randn((self.batch_size, self.num_queries, self.num_classes + 1)				)	,     masks_queries_logits=torch.randn((self.batch_size, self.num_queries, self.height, self.width)				)	,     )







@require_torch
@require_vision
class __snake_case    (						lowerCamelCase_       ,		unittest.TestCase		):
       lowerCAmelCase_														=							OneFormerImageProcessor if (is_vision_available() and is_torch_available()) else None
       # only for test_image_processing_common.test_image_proc_to_json_string
       lowerCAmelCase_														=							image_processing_class




       def      __a						(   self      :    str				):



         """simple docstring"""






         SCREAMING_SNAKE_CASE__      							=				OneFormerImageProcessorTester(self				)




       @property
       def      __a						(   self      :    str				):



         """simple docstring"""






         return self.image_processing_tester.prepare_image_processor_dict()




       def      __a						(   self      :    str				):



         """simple docstring"""






         SCREAMING_SNAKE_CASE__      							=				self.image_processing_class(**self.image_processor_dict				)
         self.assertTrue(hasattr(_lowercase	,     """image_mean"""				)				)
         self.assertTrue(hasattr(_lowercase	,     """image_std"""				)				)
         self.assertTrue(hasattr(_lowercase	,     """do_normalize"""				)				)
         self.assertTrue(hasattr(_lowercase	,     """do_resize"""				)				)
         self.assertTrue(hasattr(_lowercase	,     """size"""				)				)
         self.assertTrue(hasattr(_lowercase	,     """ignore_index"""				)				)
         self.assertTrue(hasattr(_lowercase	,     """class_info_file"""				)				)
         self.assertTrue(hasattr(_lowercase	,     """num_text"""				)				)
         self.assertTrue(hasattr(_lowercase	,     """repo_path"""				)				)
         self.assertTrue(hasattr(_lowercase	,     """metadata"""				)				)
         self.assertTrue(hasattr(_lowercase	,     """do_reduce_labels"""				)				)




       def      __a						(   self      :    Any				):



         """simple docstring"""






         pass




       def      __a						(   self      :    Optional[int]				):



         """simple docstring"""






         SCREAMING_SNAKE_CASE__      							=				self.image_processing_class(**self.image_processor_dict				)
         # create random PIL images
         SCREAMING_SNAKE_CASE__      							=				prepare_image_inputs(self.image_processing_tester	,     equal_resolution=_lowercase				)
         for image in image_inputs:
           self.assertIsInstance(_lowercase	,     Image.Image				)

         # Test not batched input
         SCREAMING_SNAKE_CASE__      							=				image_processor(image_inputs[0]	,     ["""semantic"""]	,     return_tensors="""pt"""				).pixel_values

         SCREAMING_SNAKE_CASE__							,					SCREAMING_SNAKE_CASE__      							=				self.image_processing_tester.get_expected_values(_lowercase				)

         self.assertEqual(
             encoded_images.shape	,     (1, self.image_processing_tester.num_channels, expected_height, expected_width)	,     )

         # Test batched
         SCREAMING_SNAKE_CASE__							,					SCREAMING_SNAKE_CASE__      							=				self.image_processing_tester.get_expected_values(_lowercase	,     batched=_lowercase				)

         SCREAMING_SNAKE_CASE__      							=				image_processor(
             _lowercase	,     ["""semantic"""] * len(_lowercase				)	,     return_tensors="""pt"""				).pixel_values
         self.assertEqual(
             encoded_images.shape	,     (
                 self.image_processing_tester.batch_size,
                 self.image_processing_tester.num_channels,
                 expected_height,
                 expected_width,
             )	,     )




       def      __a						(   self      :    int				):



         """simple docstring"""






         SCREAMING_SNAKE_CASE__      							=				self.image_processing_class(**self.image_processor_dict				)
         # create random numpy tensors
         SCREAMING_SNAKE_CASE__      							=				prepare_image_inputs(self.image_processing_tester	,     equal_resolution=_lowercase	,     numpify=_lowercase				)
         for image in image_inputs:
           self.assertIsInstance(_lowercase	,     np.ndarray				)

         # Test not batched input
         SCREAMING_SNAKE_CASE__      							=				image_processor(image_inputs[0]	,     ["""semantic"""]	,     return_tensors="""pt"""				).pixel_values

         SCREAMING_SNAKE_CASE__							,					SCREAMING_SNAKE_CASE__      							=				self.image_processing_tester.get_expected_values(_lowercase				)

         self.assertEqual(
             encoded_images.shape	,     (1, self.image_processing_tester.num_channels, expected_height, expected_width)	,     )

         # Test batched
         SCREAMING_SNAKE_CASE__							,					SCREAMING_SNAKE_CASE__      							=				self.image_processing_tester.get_expected_values(_lowercase	,     batched=_lowercase				)

         SCREAMING_SNAKE_CASE__      							=				image_processor(
             _lowercase	,     ["""semantic"""] * len(_lowercase				)	,     return_tensors="""pt"""				).pixel_values
         self.assertEqual(
             encoded_images.shape	,     (
                 self.image_processing_tester.batch_size,
                 self.image_processing_tester.num_channels,
                 expected_height,
                 expected_width,
             )	,     )




       def      __a						(   self      :    str				):



         """simple docstring"""






         SCREAMING_SNAKE_CASE__      							=				self.image_processing_class(**self.image_processor_dict				)
         # create random PyTorch tensors
         SCREAMING_SNAKE_CASE__      							=				prepare_image_inputs(self.image_processing_tester	,     equal_resolution=_lowercase	,     torchify=_lowercase				)
         for image in image_inputs:
           self.assertIsInstance(_lowercase	,     torch.Tensor				)

         # Test not batched input
         SCREAMING_SNAKE_CASE__      							=				image_processor(image_inputs[0]	,     ["""semantic"""]	,     return_tensors="""pt"""				).pixel_values

         SCREAMING_SNAKE_CASE__							,					SCREAMING_SNAKE_CASE__      							=				self.image_processing_tester.get_expected_values(_lowercase				)

         self.assertEqual(
             encoded_images.shape	,     (1, self.image_processing_tester.num_channels, expected_height, expected_width)	,     )

         # Test batched
         SCREAMING_SNAKE_CASE__							,					SCREAMING_SNAKE_CASE__      							=				self.image_processing_tester.get_expected_values(_lowercase	,     batched=_lowercase				)

         SCREAMING_SNAKE_CASE__      							=				image_processor(
             _lowercase	,     ["""semantic"""] * len(_lowercase				)	,     return_tensors="""pt"""				).pixel_values
         self.assertEqual(
             encoded_images.shape	,     (
                 self.image_processing_tester.batch_size,
                 self.image_processing_tester.num_channels,
                 expected_height,
                 expected_width,
             )	,     )




       def      __a						(   self      :    Tuple	,     _lowercase      :    Optional[int]=False	,     _lowercase      :    Any=False	,     _lowercase      :    List[str]="np"				):



         """simple docstring"""






         SCREAMING_SNAKE_CASE__      							=				self.image_processing_class(**self.image_processor_dict				)
         # prepare image and target
         SCREAMING_SNAKE_CASE__      							=				self.image_processing_tester.num_labels
         SCREAMING_SNAKE_CASE__      							=				None
         SCREAMING_SNAKE_CASE__      							=				None
         SCREAMING_SNAKE_CASE__      							=				prepare_image_inputs(self.image_processing_tester	,     equal_resolution=_lowercase				)
         if with_segmentation_maps:
           SCREAMING_SNAKE_CASE__      							=				num_labels
           if is_instance_map:
             SCREAMING_SNAKE_CASE__      							=				list(range(_lowercase				)				) * 2
             SCREAMING_SNAKE_CASE__      							=				dict(enumerate(_lowercase				)				)
           SCREAMING_SNAKE_CASE__      							=				[
               np.random.randint(0	,     high * 2	,     (img.size[1], img.size[0])				).astype(np.uinta				) for img in image_inputs
           ]
           if segmentation_type == "pil":
             SCREAMING_SNAKE_CASE__      							=				[Image.fromarray(_lowercase				) for annotation in annotations]

         SCREAMING_SNAKE_CASE__      							=				image_processor(
             _lowercase	,     ["""semantic"""] * len(_lowercase				)	,     _lowercase	,     return_tensors="""pt"""	,     instance_id_to_semantic_id=_lowercase	,     pad_and_return_pixel_mask=_lowercase	,     )

         return inputs




       def      __a						(   self      :    str				):



         """simple docstring"""






         pass




       def      __a						(   self      :    Tuple				):



         """simple docstring"""






         def common(_lowercase      :    Optional[int]=False	,     _lowercase      :    Union[str, Any]=None				):
           SCREAMING_SNAKE_CASE__      							=				self.comm_get_image_processor_inputs(
               with_segmentation_maps=_lowercase	,     is_instance_map=_lowercase	,     segmentation_type=_lowercase				)

           SCREAMING_SNAKE_CASE__      							=				inputs["""mask_labels"""]
           SCREAMING_SNAKE_CASE__      							=				inputs["""class_labels"""]
           SCREAMING_SNAKE_CASE__      							=				inputs["""pixel_values"""]
           SCREAMING_SNAKE_CASE__      							=				inputs["""text_inputs"""]

           # check the batch_size
           for mask_label, class_label, text_input in zip(_lowercase	,     _lowercase	,     _lowercase				):
             self.assertEqual(mask_label.shape[0]	,     class_label.shape[0]				)
             # this ensure padding has happened
             self.assertEqual(mask_label.shape[1:]	,     pixel_values.shape[2:]				)
             self.assertEqual(len(_lowercase				)	,     self.image_processing_tester.num_text				)

         common()
         common(is_instance_map=_lowercase				)
         common(is_instance_map=_lowercase	,     segmentation_type="""pil"""				)
         common(is_instance_map=_lowercase	,     segmentation_type="""pil"""				)




       def      __a						(   self      :    Any				):



         """simple docstring"""






         SCREAMING_SNAKE_CASE__      							=				np.zeros((20, 50)				)
         SCREAMING_SNAKE_CASE__      							=				1
         SCREAMING_SNAKE_CASE__      							=				1
         SCREAMING_SNAKE_CASE__      							=				1

         SCREAMING_SNAKE_CASE__      							=				binary_mask_to_rle(_lowercase				)
         self.assertEqual(len(_lowercase				)	,     4				)
         self.assertEqual(rle[0]	,     21				)
         self.assertEqual(rle[1]	,     45				)




       def      __a						(   self      :    Dict				):



         """simple docstring"""






         SCREAMING_SNAKE_CASE__      							=				self.image_processing_class(
             num_labels=self.image_processing_tester.num_classes	,     max_seq_length=77	,     task_seq_length=77	,     class_info_file="""ade20k_panoptic.json"""	,     num_text=self.image_processing_tester.num_text	,     repo_path="""shi-labs/oneformer_demo"""	,     )
         SCREAMING_SNAKE_CASE__      							=				self.image_processing_tester.get_fake_oneformer_outputs()

         SCREAMING_SNAKE_CASE__      							=				fature_extractor.post_process_semantic_segmentation(_lowercase				)

         self.assertEqual(len(_lowercase				)	,     self.image_processing_tester.batch_size				)
         self.assertEqual(
             segmentation[0].shape	,     (
                 self.image_processing_tester.height,
                 self.image_processing_tester.width,
             )	,     )

         SCREAMING_SNAKE_CASE__      							=				[(1, 4) for i in range(self.image_processing_tester.batch_size				)]
         SCREAMING_SNAKE_CASE__      							=				fature_extractor.post_process_semantic_segmentation(_lowercase	,     target_sizes=_lowercase				)

         self.assertEqual(segmentation[0].shape	,     target_sizes[0]				)




       def      __a						(   self      :    List[str]				):



         """simple docstring"""






         SCREAMING_SNAKE_CASE__      							=				self.image_processing_class(
             num_labels=self.image_processing_tester.num_classes	,     max_seq_length=77	,     task_seq_length=77	,     class_info_file="""ade20k_panoptic.json"""	,     num_text=self.image_processing_tester.num_text	,     repo_path="""shi-labs/oneformer_demo"""	,     )
         SCREAMING_SNAKE_CASE__      							=				self.image_processing_tester.get_fake_oneformer_outputs()
         SCREAMING_SNAKE_CASE__      							=				image_processor.post_process_instance_segmentation(_lowercase	,     threshold=0				)

         self.assertTrue(len(_lowercase				) == self.image_processing_tester.batch_size				)
         for el in segmentation:
           self.assertTrue("""segmentation""" in el				)
           self.assertTrue("""segments_info""" in el				)
           self.assertEqual(type(el["""segments_info"""]				)	,     _lowercase				)
           self.assertEqual(
               el["""segmentation"""].shape	,     (self.image_processing_tester.height, self.image_processing_tester.width)				)




       def      __a						(   self      :    Optional[Any]				):



         """simple docstring"""






         SCREAMING_SNAKE_CASE__      							=				self.image_processing_class(
             num_labels=self.image_processing_tester.num_classes	,     max_seq_length=77	,     task_seq_length=77	,     class_info_file="""ade20k_panoptic.json"""	,     num_text=self.image_processing_tester.num_text	,     repo_path="""shi-labs/oneformer_demo"""	,     )
         SCREAMING_SNAKE_CASE__      							=				self.image_processing_tester.get_fake_oneformer_outputs()
         SCREAMING_SNAKE_CASE__      							=				image_processor.post_process_panoptic_segmentation(_lowercase	,     threshold=0				)

         self.assertTrue(len(_lowercase				) == self.image_processing_tester.batch_size				)
         for el in segmentation:
           self.assertTrue("""segmentation""" in el				)
           self.assertTrue("""segments_info""" in el				)
           self.assertEqual(type(el["""segments_info"""]				)	,     _lowercase				)
           self.assertEqual(
               el["""segmentation"""].shape	,     (self.image_processing_tester.height, self.image_processing_tester.width)				)

import contextlib
import importlib
import io
import unittest

import transformers

# Try to import everything from transformers to ensure every object can be loaded.
from transformers import *  # noqa F406
from transformers.testing_utils import DUMMY_UNKNOWN_IDENTIFIER, require_flax, require_tf, require_torch
from transformers.utils import ContextManagers, find_labels, is_flax_available, is_tf_available, is_torch_available


if is_torch_available():
   from transformers import BertForPreTraining, BertForQuestionAnswering, BertForSequenceClassification

if is_tf_available():
   from transformers import TFBertForPreTraining, TFBertForQuestionAnswering, TFBertForSequenceClassification

if is_flax_available():
   from transformers import FlaxBertForPreTraining, FlaxBertForQuestionAnswering, FlaxBertForSequenceClassification


__lowerCamelCase      :			Tuple							       =		DUMMY_UNKNOWN_IDENTIFIER
# An actual model hosted on huggingface.co

__lowerCamelCase      :			Optional[Any]							       =		'''main'''
# Default branch name
__lowerCamelCase      :			Optional[int]							       =		'''f2c752cfc5c0ab6f4bdec59acea69eefbee381c2'''
# One particular commit (not the top of `main`)
__lowerCamelCase      :			Any							       =		'''aaaaaaa'''
# This commit does not exist, so we should 404.

__lowerCamelCase      :			List[str]							       =		'''d9e9f15bc825e4b2c9249e9578f884bbcb5e3684'''
# Sha-1 of config.json on the top of `main`, for checking purposes
__lowerCamelCase      :			List[Any]							       =		'''4b243c475af8d0a7754e87d7d096c92e5199ec2fe168a2ee7998e3b8e9bcb1d3'''



@contextlib.contextmanager
def      __SCREAMING_SNAKE_CASE  ( )							-> str:







  """simple docstring"""





  print("""Welcome!"""     )
  yield
  print("""Bye!"""     )



@contextlib.contextmanager
def      __SCREAMING_SNAKE_CASE  ( )							-> Any:







  """simple docstring"""





  print("""Bonjour!"""     )
  yield
  print("""Au revoir!"""     )







class __snake_case    (						unittest.TestCase		):




   def      __a						(   self      :    List[Any]				):



     """simple docstring"""






     assert transformers.__spec__ is not None
     assert importlib.util.find_spec("""transformers"""				) is not None







class __snake_case    (						unittest.TestCase		):




   @unittest.mock.patch("""sys.stdout"""	,     new_callable=io.StringIO				)
   def      __a						(   self      :    List[str]	,     _lowercase      :    str				):



     """simple docstring"""






     with ContextManagers([]				):
       print("""Transformers are awesome!"""				)
     # The print statement adds a new line at the end of the output
     self.assertEqual(mock_stdout.getvalue()	,     """Transformers are awesome!\n"""				)




   @unittest.mock.patch("""sys.stdout"""	,     new_callable=io.StringIO				)
   def      __a						(   self      :    Optional[Any]	,     _lowercase      :    str				):



     """simple docstring"""






     with ContextManagers([context_en()]				):
       print("""Transformers are awesome!"""				)
     # The output should be wrapped with an English welcome and goodbye
     self.assertEqual(mock_stdout.getvalue()	,     """Welcome!\nTransformers are awesome!\nBye!\n"""				)




   @unittest.mock.patch("""sys.stdout"""	,     new_callable=io.StringIO				)
   def      __a						(   self      :    Tuple	,     _lowercase      :    Dict				):



     """simple docstring"""






     with ContextManagers([context_fr(), context_en()]				):
       print("""Transformers are awesome!"""				)
     # The output should be wrapped with an English and French welcome and goodbye
     self.assertEqual(mock_stdout.getvalue()	,     """Bonjour!\nWelcome!\nTransformers are awesome!\nBye!\nAu revoir!\n"""				)




   @require_torch
   def      __a						(   self      :    Union[str, Any]				):



     """simple docstring"""






     self.assertEqual(find_labels(_lowercase				)	,     ["""labels"""]				)
     self.assertEqual(find_labels(_lowercase				)	,     ["""labels""", """next_sentence_label"""]				)
     self.assertEqual(find_labels(_lowercase				)	,     ["""start_positions""", """end_positions"""]				)







     class __snake_case    (						lowerCamelCase_		):
        pass





     self.assertEqual(find_labels(_lowercase				)	,     ["""labels"""]				)




   @require_tf
   def      __a						(   self      :    Any				):



     """simple docstring"""






     self.assertEqual(find_labels(_lowercase				)	,     ["""labels"""]				)
     self.assertEqual(find_labels(_lowercase				)	,     ["""labels""", """next_sentence_label"""]				)
     self.assertEqual(find_labels(_lowercase				)	,     ["""start_positions""", """end_positions"""]				)







     class __snake_case    (						lowerCamelCase_		):
        pass





     self.assertEqual(find_labels(_lowercase				)	,     ["""labels"""]				)




   @require_flax
   def      __a						(   self      :    Union[str, Any]				):



     """simple docstring"""






     self.assertEqual(find_labels(_lowercase				)	,     []				)
     self.assertEqual(find_labels(_lowercase				)	,     []				)
     self.assertEqual(find_labels(_lowercase				)	,     []				)







     class __snake_case    (						lowerCamelCase_		):
        pass





     self.assertEqual(find_labels(_lowercase				)	,     []				)
