



import inspect
import unittest

import numpy as np

from tests.test_modeling_common import floats_tensor
from transformers import DetrConfig, MaskFormerConfig, SwinConfig, is_torch_available, is_vision_available
from transformers.testing_utils import require_torch, require_torch_multi_gpu, require_vision, slow, torch_device
from transformers.utils import cached_property

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
  import torch

  from transformers import MaskFormerForInstanceSegmentation, MaskFormerModel

  if is_vision_available():
    from transformers import MaskFormerImageProcessor

if is_vision_available():
  from PIL import Image



class 			__lowerCAmelCase  :




 def __init__(    self						,					__UpperCAmelCase						,					__UpperCAmelCase=2						,					__UpperCAmelCase=True						,					__UpperCAmelCase=False						,					__UpperCAmelCase=10						,					__UpperCAmelCase=3						,					__UpperCAmelCase=32 * 4						,					__UpperCAmelCase=32 * 6						,					__UpperCAmelCase=4						,					__UpperCAmelCase=32						,					):



    '''simple docstring'''
    __lowerCamelCase    				=     parent
    __lowerCamelCase    				=     batch_size
    __lowerCamelCase    				=     is_training
    __lowerCamelCase    				=     use_auxiliary_loss
    __lowerCamelCase    				=     num_queries
    __lowerCamelCase    				=     num_channels
    __lowerCamelCase    				=     min_size
    __lowerCamelCase    				=     max_size
    __lowerCamelCase    				=     num_labels
    __lowerCamelCase    				=     mask_feature_size




 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    __lowerCamelCase    				=     floats_tensor([self.batch_size, self.num_channels, self.min_size, self.max_size]					).to(
        UpperCAmelCase_					)

    __lowerCamelCase    				=     torch.ones([self.batch_size, self.min_size, self.max_size]						,					device=UpperCAmelCase_					)

    __lowerCamelCase    				=     (
        torch.rand([self.batch_size, self.num_labels, self.min_size, self.max_size]						,					device=UpperCAmelCase_					) > 0.5
    ).float()
    __lowerCamelCase    				=     (torch.rand((self.batch_size, self.num_labels)						,					device=UpperCAmelCase_					) > 0.5).long()

    __lowerCamelCase    				=     self.get_config()
    return config, pixel_values, pixel_mask, mask_labels, class_labels




 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    return MaskFormerConfig.from_backbone_and_decoder_configs(
        backbone_config=SwinConfig(
            depths=[1, 1, 1, 1]						,					)						,					decoder_config=DetrConfig(
            decoder_ffn_dim=128						,					num_queries=self.num_queries						,					decoder_attention_heads=2						,					d_model=self.mask_feature_size						,					)						,					mask_feature_size=self.mask_feature_size						,					fpn_feature_size=self.mask_feature_size						,					num_channels=self.num_channels						,					num_labels=self.num_labels						,					)




 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    __lowerCamelCase				,__lowerCamelCase				,__lowerCamelCase				,__lowerCamelCase				,__lowerCamelCase    				=     self.prepare_config_and_inputs()
    __lowerCamelCase    				=     {'''pixel_values''': pixel_values, '''pixel_mask''': pixel_mask}
    return config, inputs_dict




 def 							lowerCamelCase   (    self						,					__UpperCAmelCase						,					__UpperCAmelCase					):



    '''simple docstring'''
    __lowerCamelCase    				=     output.encoder_hidden_states
    __lowerCamelCase    				=     output.pixel_decoder_hidden_states
    __lowerCamelCase    				=     output.transformer_decoder_hidden_states

    self.parent.assertTrue(len(UpperCAmelCase_					)						,					len(config.backbone_config.depths					)					)
    self.parent.assertTrue(len(UpperCAmelCase_					)						,					len(config.backbone_config.depths					)					)
    self.parent.assertTrue(len(UpperCAmelCase_					)						,					config.decoder_config.decoder_layers					)




 def 							lowerCamelCase   (    self						,					__UpperCAmelCase						,					__UpperCAmelCase						,					__UpperCAmelCase						,					__UpperCAmelCase=False					):



    '''simple docstring'''
    with torch.no_grad():
       __lowerCamelCase    				=     MaskFormerModel(config=UpperCAmelCase_					)
       model.to(UpperCAmelCase_					)
       model.eval()

       __lowerCamelCase    				=     model(pixel_values=UpperCAmelCase_						,					pixel_mask=UpperCAmelCase_					)
       __lowerCamelCase    				=     model(UpperCAmelCase_						,					output_hidden_states=UpperCAmelCase_					)
    # the correct shape of output.transformer_decoder_hidden_states ensure the correcteness of the
    # encoder and pixel decoder
    self.parent.assertEqual(
        output.transformer_decoder_last_hidden_state.shape						,					(self.batch_size, self.num_queries, self.mask_feature_size)						,					)
    # let's ensure the other two hidden state exists
    self.parent.assertTrue(output.pixel_decoder_last_hidden_state is not None					)
    self.parent.assertTrue(output.encoder_last_hidden_state is not None					)

    if output_hidden_states:
       self.check_output_hidden_state(UpperCAmelCase_						,					UpperCAmelCase_					)




 def 							lowerCamelCase   (    self						,					__UpperCAmelCase						,					__UpperCAmelCase						,					__UpperCAmelCase						,					__UpperCAmelCase						,					__UpperCAmelCase					):



    '''simple docstring'''
    __lowerCamelCase    				=     MaskFormerForInstanceSegmentation(config=UpperCAmelCase_					)
    model.to(UpperCAmelCase_					)
    model.eval()

    def comm_check_on_output(__UpperCAmelCase					):
       # let's still check that all the required stuff is there
       self.parent.assertTrue(result.transformer_decoder_last_hidden_state is not None					)
       self.parent.assertTrue(result.pixel_decoder_last_hidden_state is not None					)
       self.parent.assertTrue(result.encoder_last_hidden_state is not None					)
       # okay, now we need to check the logits shape
       # due to the encoder compression, masks have a //4 spatial size
       self.parent.assertEqual(
           result.masks_queries_logits.shape						,					(self.batch_size, self.num_queries, self.min_size // 4, self.max_size // 4)						,					)
       # + 1 for null class
       self.parent.assertEqual(
           result.class_queries_logits.shape						,					(self.batch_size, self.num_queries, self.num_labels + 1)					)

    with torch.no_grad():
       __lowerCamelCase    				=     model(pixel_values=UpperCAmelCase_						,					pixel_mask=UpperCAmelCase_					)
       __lowerCamelCase    				=     model(UpperCAmelCase_					)

       comm_check_on_output(UpperCAmelCase_					)

       __lowerCamelCase    				=     model(
           pixel_values=UpperCAmelCase_						,					pixel_mask=UpperCAmelCase_						,					mask_labels=UpperCAmelCase_						,					class_labels=UpperCAmelCase_					)

    comm_check_on_output(UpperCAmelCase_					)

    self.parent.assertTrue(result.loss is not None					)
    self.parent.assertEqual(result.loss.shape						,					torch.Size([1]					)					)



@require_torch
class 			__lowerCAmelCase  (						lowerCAmelCase__	,						lowerCAmelCase__	,						unittest.TestCase ):
 lowerCAmelCase__							       =	(MaskFormerModel, MaskFormerForInstanceSegmentation) if is_torch_available() else ()
 lowerCAmelCase__							       =	(
     {"feature-extraction": MaskFormerModel, "image-segmentation": MaskFormerForInstanceSegmentation}
     if is_torch_available()
     else {}
 )

 lowerCAmelCase__							       =	False
 lowerCAmelCase__							       =	False
 lowerCAmelCase__							       =	False
 lowerCAmelCase__							       =	False




 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    __lowerCamelCase    				=     MaskFormerModelTester(self					)
    __lowerCamelCase    				=     ConfigTester(self						,					config_class=UpperCAmelCase_						,					has_text_modality=UpperCAmelCase_					)




 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    self.config_tester.run_common_tests()




 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    __lowerCamelCase				,__lowerCamelCase    				=     self.model_tester.prepare_config_and_inputs_for_common()
    self.model_tester.create_and_check_maskformer_model(UpperCAmelCase_						,					**UpperCAmelCase_						,					output_hidden_states=UpperCAmelCase_					)




 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    __lowerCamelCase    				=     self.model_tester.prepare_config_and_inputs()
    self.model_tester.create_and_check_maskformer_instance_segmentation_head_model(*UpperCAmelCase_					)




 @unittest.skip(reason='''MaskFormer does not use inputs_embeds'''					)
 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    pass




 @unittest.skip(reason='''MaskFormer does not have a get_input_embeddings method'''					)
 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    pass




 @unittest.skip(reason='''MaskFormer is not a generative model'''					)
 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    pass




 @unittest.skip(reason='''MaskFormer does not use token embeddings'''					)
 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    pass




 @require_torch_multi_gpu
 @unittest.skip(
     reason='''MaskFormer has some layers using `add_module` which doesn\'t work well with `nn.DataParallel`'''					)
 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    pass




 @unittest.skip('''Will be fixed soon by reducing the size of the model used for common tests.'''					)
 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    pass




 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    __lowerCamelCase				,__lowerCamelCase    				=     self.model_tester.prepare_config_and_inputs_for_common()

    for model_class in self.all_model_classes:
       __lowerCamelCase    				=     model_class(UpperCAmelCase_					)
       __lowerCamelCase    				=     inspect.signature(model.forward					)
       # signature.parameters is an OrderedDict => so arg_names order is deterministic
       __lowerCamelCase    				=     [*signature.parameters.keys()]

       __lowerCamelCase    				=     ['''pixel_values''']
       self.assertListEqual(arg_names[:1]						,					UpperCAmelCase_					)




 @slow
 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    for model_name in ["facebook/maskformer-swin-small-coco"]:
       __lowerCamelCase    				=     MaskFormerModel.from_pretrained(UpperCAmelCase_					)
       self.assertIsNotNone(UpperCAmelCase_					)




 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    __lowerCamelCase    				=     (self.model_tester.min_size,) * 2
    __lowerCamelCase    				=     {
        '''pixel_values''': torch.randn((2, 3, *size)						,					device=UpperCAmelCase_					),
        '''mask_labels''': torch.randn((2, 10, *size)						,					device=UpperCAmelCase_					),
        '''class_labels''': torch.zeros(2						,					10						,					device=UpperCAmelCase_					).long(),
    }

    __lowerCamelCase    				=     MaskFormerForInstanceSegmentation(MaskFormerConfig()					).to(UpperCAmelCase_					)
    __lowerCamelCase    				=     model(**UpperCAmelCase_					)
    self.assertTrue(outputs.loss is not None					)




 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    __lowerCamelCase				,__lowerCamelCase    				=     self.model_tester.prepare_config_and_inputs_for_common()
    self.model_tester.create_and_check_maskformer_model(UpperCAmelCase_						,					**UpperCAmelCase_						,					output_hidden_states=UpperCAmelCase_					)




 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    __lowerCamelCase				,__lowerCamelCase    				=     self.model_tester.prepare_config_and_inputs_for_common()

    for model_class in self.all_model_classes:
       __lowerCamelCase    				=     model_class(UpperCAmelCase_					).to(UpperCAmelCase_					)
       __lowerCamelCase    				=     model(**UpperCAmelCase_						,					output_attentions=UpperCAmelCase_					)
       self.assertTrue(outputs.attentions is not None					)




 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    if not self.model_tester.is_training:
       return
    # only MaskFormerForInstanceSegmentation has the loss
    __lowerCamelCase    				=     self.all_model_classes[1]
    __lowerCamelCase				,__lowerCamelCase				,__lowerCamelCase				,__lowerCamelCase				,__lowerCamelCase    				=     self.model_tester.prepare_config_and_inputs()

    __lowerCamelCase    				=     model_class(UpperCAmelCase_					)
    model.to(UpperCAmelCase_					)
    model.train()

    __lowerCamelCase    				=     model(UpperCAmelCase_						,					mask_labels=UpperCAmelCase_						,					class_labels=UpperCAmelCase_					).loss
    loss.backward()




 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    # only MaskFormerForInstanceSegmentation has the loss
    __lowerCamelCase    				=     self.all_model_classes[1]
    __lowerCamelCase				,__lowerCamelCase				,__lowerCamelCase				,__lowerCamelCase				,__lowerCamelCase    				=     self.model_tester.prepare_config_and_inputs()
    __lowerCamelCase    				=     True
    __lowerCamelCase    				=     True

    __lowerCamelCase    				=     model_class(UpperCAmelCase_					)
    model.to(UpperCAmelCase_					)
    model.train()

    __lowerCamelCase    				=     model(UpperCAmelCase_						,					mask_labels=UpperCAmelCase_						,					class_labels=UpperCAmelCase_					)

    __lowerCamelCase    				=     outputs.encoder_hidden_states[0]
    encoder_hidden_states.retain_grad()

    __lowerCamelCase    				=     outputs.pixel_decoder_hidden_states[0]
    pixel_decoder_hidden_states.retain_grad()
    # we requires_grad=True in inputs_embeds (line 2152), the original implementation don't
    __lowerCamelCase    				=     outputs.transformer_decoder_hidden_states[0]
    transformer_decoder_hidden_states.retain_grad()

    __lowerCamelCase    				=     outputs.attentions[0]
    attentions.retain_grad()

    outputs.loss.backward(retain_graph=UpperCAmelCase_					)

    self.assertIsNotNone(encoder_hidden_states.grad					)
    self.assertIsNotNone(pixel_decoder_hidden_states.grad					)
    self.assertIsNotNone(transformer_decoder_hidden_states.grad					)
    self.assertIsNotNone(attentions.grad					)



a_								=       1E-4





def 		a__      (		):
   __lowerCamelCase    				=     Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png'''				)
   return image





@require_vision
@slow
class 			__lowerCAmelCase  (						unittest.TestCase ):




 @cached_property
 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    return (
        MaskFormerImageProcessor.from_pretrained('''facebook/maskformer-swin-small-coco'''					)
        if is_vision_available()
        else None
    )




 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    __lowerCamelCase    				=     MaskFormerModel.from_pretrained('''facebook/maskformer-swin-small-coco'''					).to(UpperCAmelCase_					)
    __lowerCamelCase    				=     self.default_image_processor
    __lowerCamelCase    				=     prepare_img()
    __lowerCamelCase    				=     image_processor(UpperCAmelCase_						,					return_tensors='''pt'''					).to(UpperCAmelCase_					)
    __lowerCamelCase    				=     inputs['''pixel_values'''].shape
    # check size is divisible by 32
    self.assertTrue((inputs_shape[-1] % 32) == 0 and (inputs_shape[-2] % 32) == 0					)
    # check size
    self.assertEqual(UpperCAmelCase_						,					(1, 3, 800, 1088)					)

    with torch.no_grad():
       __lowerCamelCase    				=     model(**UpperCAmelCase_					)

    __lowerCamelCase    				=     torch.tensor(
        [[-0.0_482, 0.9_228, 0.4_951], [-0.2_547, 0.8_017, 0.8_527], [-0.0_069, 0.3_385, -0.0_089]]					).to(UpperCAmelCase_					)
    self.assertTrue(
        torch.allclose(
            outputs.encoder_last_hidden_state[0, 0, :3, :3]						,					UpperCAmelCase_						,					atol=UpperCAmelCase_					)					)

    __lowerCamelCase    				=     torch.tensor(
        [[-0.8_422, -0.8_434, -0.9_718], [-1.0_144, -0.5_565, -0.4_195], [-1.0_038, -0.4_484, -0.1_961]]					).to(UpperCAmelCase_					)
    self.assertTrue(
        torch.allclose(
            outputs.pixel_decoder_last_hidden_state[0, 0, :3, :3]						,					UpperCAmelCase_						,					atol=UpperCAmelCase_					)					)

    __lowerCamelCase    				=     torch.tensor(
        [[0.2_852, -0.0_159, 0.9_735], [0.6_254, 0.1_858, 0.8_529], [-0.0_680, -0.4_116, 1.8_413]]					).to(UpperCAmelCase_					)
    self.assertTrue(
        torch.allclose(
            outputs.transformer_decoder_last_hidden_state[0, :3, :3]						,					UpperCAmelCase_						,					atol=UpperCAmelCase_					)					)




 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    __lowerCamelCase    				=     (
        MaskFormerForInstanceSegmentation.from_pretrained('''facebook/maskformer-swin-small-coco'''					)
        .to(UpperCAmelCase_					)
        .eval()
    )
    __lowerCamelCase    				=     self.default_image_processor
    __lowerCamelCase    				=     prepare_img()
    __lowerCamelCase    				=     image_processor(UpperCAmelCase_						,					return_tensors='''pt'''					).to(UpperCAmelCase_					)
    __lowerCamelCase    				=     inputs['''pixel_values'''].shape
    # check size is divisible by 32
    self.assertTrue((inputs_shape[-1] % 32) == 0 and (inputs_shape[-2] % 32) == 0					)
    # check size
    self.assertEqual(UpperCAmelCase_						,					(1, 3, 800, 1088)					)

    with torch.no_grad():
       __lowerCamelCase    				=     model(**UpperCAmelCase_					)
    # masks_queries_logits
    __lowerCamelCase    				=     outputs.masks_queries_logits
    self.assertEqual(
        masks_queries_logits.shape						,					(1, model.config.decoder_config.num_queries, inputs_shape[-2] // 4, inputs_shape[-1] // 4)						,					)
    __lowerCamelCase    				=     [
        [-1.3_737_124, -1.7_724_937, -1.9_364_233],
        [-1.5_977_281, -1.9_867_939, -2.1_523_695],
        [-1.5_795_398, -1.9_269_832, -2.093_942],
    ]
    __lowerCamelCase    				=     torch.tensor(UpperCAmelCase_					).to(UpperCAmelCase_					)
    self.assertTrue(torch.allclose(masks_queries_logits[0, 0, :3, :3]						,					UpperCAmelCase_						,					atol=UpperCAmelCase_					)					)
    # class_queries_logits
    __lowerCamelCase    				=     outputs.class_queries_logits
    self.assertEqual(
        class_queries_logits.shape						,					(1, model.config.decoder_config.num_queries, model.config.num_labels + 1)					)
    __lowerCamelCase    				=     torch.tensor(
        [
            [1.6_5_1_2E0_0, -5.2_5_7_2E0_0, -3.3_5_1_9E0_0],
            [3.6_1_6_9E-0_2, -5.9_0_2_5E0_0, -2.9_3_1_3E0_0],
            [1.0_7_6_6E-0_4, -7.7_6_3_0E0_0, -5.1_2_6_3E0_0],
        ]					).to(UpperCAmelCase_					)
    self.assertTrue(torch.allclose(outputs.class_queries_logits[0, :3, :3]						,					UpperCAmelCase_						,					atol=UpperCAmelCase_					)					)




 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    __lowerCamelCase    				=     (
        MaskFormerForInstanceSegmentation.from_pretrained('''facebook/maskformer-resnet101-coco-stuff'''					)
        .to(UpperCAmelCase_					)
        .eval()
    )
    __lowerCamelCase    				=     self.default_image_processor
    __lowerCamelCase    				=     prepare_img()
    __lowerCamelCase    				=     image_processor(UpperCAmelCase_						,					return_tensors='''pt'''					).to(UpperCAmelCase_					)
    __lowerCamelCase    				=     inputs['''pixel_values'''].shape
    # check size is divisible by 32
    self.assertTrue((inputs_shape[-1] % 32) == 0 and (inputs_shape[-2] % 32) == 0					)
    # check size
    self.assertEqual(UpperCAmelCase_						,					(1, 3, 800, 1088)					)

    with torch.no_grad():
       __lowerCamelCase    				=     model(**UpperCAmelCase_					)
    # masks_queries_logits
    __lowerCamelCase    				=     outputs.masks_queries_logits
    self.assertEqual(
        masks_queries_logits.shape						,					(1, model.config.decoder_config.num_queries, inputs_shape[-2] // 4, inputs_shape[-1] // 4)						,					)
    __lowerCamelCase    				=     [[-0.9_046, -2.6_366, -4.6_062], [-3.4_179, -5.7_890, -8.8_057], [-4.9_179, -7.6_560, -10.7_711]]
    __lowerCamelCase    				=     torch.tensor(UpperCAmelCase_					).to(UpperCAmelCase_					)
    self.assertTrue(torch.allclose(masks_queries_logits[0, 0, :3, :3]						,					UpperCAmelCase_						,					atol=UpperCAmelCase_					)					)
    # class_queries_logits
    __lowerCamelCase    				=     outputs.class_queries_logits
    self.assertEqual(
        class_queries_logits.shape						,					(1, model.config.decoder_config.num_queries, model.config.num_labels + 1)					)
    __lowerCamelCase    				=     torch.tensor(
        [[4.7_188, -3.2_585, -2.8_857], [6.6_871, -2.9_181, -1.2_487], [7.2_449, -2.2_764, -2.1_874]]					).to(UpperCAmelCase_					)
    self.assertTrue(torch.allclose(outputs.class_queries_logits[0, :3, :3]						,					UpperCAmelCase_						,					atol=UpperCAmelCase_					)					)




 def 							lowerCamelCase   (    self					):



    '''simple docstring'''
    __lowerCamelCase    				=     (
        MaskFormerForInstanceSegmentation.from_pretrained('''facebook/maskformer-swin-small-coco'''					)
        .to(UpperCAmelCase_					)
        .eval()
    )
    __lowerCamelCase    				=     self.default_image_processor

    __lowerCamelCase    				=     image_processor(
        [np.zeros((3, 800, 1333)					), np.zeros((3, 800, 1333)					)]						,					segmentation_maps=[np.zeros((384, 384)					).astype(np.floataa					), np.zeros((384, 384)					).astype(np.floataa					)]						,					return_tensors='''pt'''						,					)

    __lowerCamelCase    				=     inputs['''pixel_values'''].to(UpperCAmelCase_					)
    __lowerCamelCase    				=     [el.to(UpperCAmelCase_					) for el in inputs['''mask_labels''']]
    __lowerCamelCase    				=     [el.to(UpperCAmelCase_					) for el in inputs['''class_labels''']]

    with torch.no_grad():
       __lowerCamelCase    				=     model(**UpperCAmelCase_					)

    self.assertTrue(outputs.loss is not None					)











'''simple docstring'''





def 							lowerCamelCase	(					_snake_case	:    Optional[Any]  ,_snake_case	:    Union[str, Any]  ,_snake_case	:    Dict  ,_snake_case	:    List[str]  ,_snake_case	:    List[str]  ,_snake_case	:    List[str]							):





    '''simple docstring'''


    if index == r:
        for j in range(_snake_case							):
            print(data[j]  ,end=" "							)
        print(" "							)
        return
    #  When no more elements are there to put in data[]
    if i >= n:
        return
    # current is included, put next at next location
    lowercase__									=    arr[i]
    combination_util(_snake_case  ,_snake_case  ,_snake_case  ,index + 1  ,_snake_case  ,i + 1							)
    # current is excluded, replace it with
    # next (Note that i+1 is passed, but
    # index is not changed)
    combination_util(_snake_case  ,_snake_case  ,_snake_case  ,_snake_case  ,_snake_case  ,i + 1							)
    # The main function that prints all combinations
    # of size r in arr[] of size n. This function
    # mainly uses combinationUtil()




def 							lowerCamelCase	(					_snake_case	:    Optional[Any]  ,_snake_case	:    Tuple  ,_snake_case	:    Union[str, Any]							):





    '''simple docstring'''


    lowercase__									=    [0] * r
    # Print all combination using temporary array 'data[]'
    combination_util(_snake_case  ,_snake_case  ,_snake_case  ,0  ,_snake_case  ,0							)


if __name__ == "__main__":
 # Driver code to check the function above
 SCREAMING_SNAKE_CASE__          =  [10, 20, 30, 40, 50]
 print_combination(arr, len(arr), 3)
 # This code is contributed by Ambuj sahu




