





import inspect
import unittest

import numpy as np

from tests.test_modeling_common import floats_tensor
from transformers import MaskaFormerConfig, 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 MaskaFormerForUniversalSegmentation, MaskaFormerModel

					if is_vision_available():
										from transformers import MaskaFormerImageProcessor

if is_vision_available():
					from PIL import Image


class   A			:
			'''simple docstring'''




			def __init__(			self   :    Dict							,	__lowerCAmelCase   :    Optional[int]							,	__lowerCAmelCase   :    List[str]=2							,	__lowerCAmelCase   :    str=True							,	__lowerCAmelCase   :    List[Any]=False							,	__lowerCAmelCase   :    str=10							,	__lowerCAmelCase   :    List[str]=3							,	__lowerCAmelCase   :    List[Any]=32 * 8							,	__lowerCAmelCase   :    str=32 * 8							,	__lowerCAmelCase   :    List[Any]=4							,	__lowerCAmelCase   :    Optional[Any]=64							,	)	->	int:







					"""simple docstring"""






					A__        =   parent
					A__        =   batch_size
					A__        =   is_training
					A__        =   use_auxiliary_loss
					A__        =   num_queries
					A__        =   num_channels
					A__        =   min_size
					A__        =   max_size
					A__        =   num_labels
					A__        =   hidden_dim
					A__        =   hidden_dim






			def    a_       (			self   :    List[str]   )	->	int:







					"""simple docstring"""






					A__        =   floats_tensor([self.batch_size, self.num_channels, self.min_size, self.max_size]   ).to(
					    __lowerCAmelCase   )

					A__        =   torch.ones([self.batch_size, self.min_size, self.max_size]							,	device=__lowerCAmelCase   )

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

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






			def    a_       (			self   :    Dict   )	->	Optional[Any]:







					"""simple docstring"""






					A__        =   MaskaFormerConfig(
					    hidden_size=self.hidden_dim							,	)
					A__        =   self.num_queries
					A__        =   self.num_labels

					A__        =   [1, 1, 1, 1]
					A__        =   self.num_channels

					A__        =   64
					A__        =   1_28
					A__        =   self.hidden_dim
					A__        =   self.hidden_dim
					A__        =   self.hidden_dim
					return config






			def    a_       (			self   :    Any   )	->	int:







					"""simple docstring"""






					A__      ,			A__      ,			A__      ,			A__      ,			A__        =   self.prepare_config_and_inputs()
					A__        =   {"""pixel_values""": pixel_values, """pixel_mask""": pixel_mask}
					return config, inputs_dict






			def    a_       (			self   :    List[str]							,	__lowerCAmelCase   :    Optional[Any]							,	__lowerCAmelCase   :    Optional[Any]   )	->	Dict:







					"""simple docstring"""






					A__        =   output.encoder_hidden_states
					A__        =   output.pixel_decoder_hidden_states
					A__        =   output.transformer_decoder_hidden_states

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






			def    a_       (			self   :    Tuple							,	__lowerCAmelCase   :    str							,	__lowerCAmelCase   :    str							,	__lowerCAmelCase   :    List[str]							,	__lowerCAmelCase   :    Optional[Any]=False   )	->	str:







					"""simple docstring"""






					with torch.no_grad():
							A__        =   MaskaFormerModel(config=__lowerCAmelCase   )
							model.to(__lowerCAmelCase   )
							model.eval()

							A__        =   model(pixel_values=__lowerCAmelCase							,	pixel_mask=__lowerCAmelCase   )
							A__        =   model(__lowerCAmelCase							,	output_hidden_states=__lowerCAmelCase   )

					self.parent.assertEqual(
					    output.transformer_decoder_last_hidden_state.shape							,	(self.batch_size, self.num_queries, self.hidden_dim)							,	)
					# 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(__lowerCAmelCase							,	__lowerCAmelCase   )







			def    a_       (			self   :    str							,	__lowerCAmelCase   :    int							,	__lowerCAmelCase   :    Union[str, Any]							,	__lowerCAmelCase   :    str							,	__lowerCAmelCase   :    Optional[int]							,	__lowerCAmelCase   :    List[str]   )	->	str:







					"""simple docstring"""






					A__        =   MaskaFormerForUniversalSegmentation(config=__lowerCAmelCase   )
					model.to(__lowerCAmelCase   )
					model.eval()

					def comm_check_on_output(__lowerCAmelCase   :    Tuple   ):
							# 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():
							A__        =   model(pixel_values=__lowerCAmelCase							,	pixel_mask=__lowerCAmelCase   )
							A__        =   model(__lowerCAmelCase   )

							comm_check_on_output(__lowerCAmelCase   )

							A__        =   model(
							    pixel_values=__lowerCAmelCase							,	pixel_mask=__lowerCAmelCase							,	mask_labels=__lowerCAmelCase							,	class_labels=__lowerCAmelCase   )

					comm_check_on_output(__lowerCAmelCase   )

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


@require_torch
class   A			(SCREAMING_SNAKE_CASE   ,     SCREAMING_SNAKE_CASE   ,     unittest.TestCase    ):
			'''simple docstring'''




			__lowerCamelCase	:       Tuple							=    (MaskaFormerModel, MaskaFormerForUniversalSegmentation) if is_torch_available() else ()
			__lowerCamelCase	:       Tuple							=    {'''feature-extraction''': MaskaFormerModel} if is_torch_available() else {}

			__lowerCamelCase	:       Tuple							=    False
			__lowerCamelCase	:       Any							=    False
			__lowerCamelCase	:       Any							=    False
			__lowerCamelCase	:       Tuple							=    False






			def    a_       (			self   :    Any   )	->	Tuple:







					"""simple docstring"""






					A__        =   MaskaFormerModelTester(self   )
					A__        =   ConfigTester(self							,	config_class=__lowerCAmelCase							,	has_text_modality=__lowerCAmelCase   )






			def    a_       (			self   :    int   )	->	List[str]:







					"""simple docstring"""






					self.config_tester.run_common_tests()






			def    a_       (			self   :    str   )	->	str:







					"""simple docstring"""






					A__      ,			A__        =   self.model_tester.prepare_config_and_inputs_for_common()
					self.model_tester.create_and_check_maskaformer_model(__lowerCAmelCase							,	**__lowerCAmelCase							,	output_hidden_states=__lowerCAmelCase   )






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







					"""simple docstring"""






					A__        =   self.model_tester.prepare_config_and_inputs()
					self.model_tester.create_and_check_maskaformer_instance_segmentation_head_model(*__lowerCAmelCase   )






			@unittest.skip(reason="""Mask2Former does not use inputs_embeds"""   )
			def    a_       (			self   :    str   )	->	int:







					"""simple docstring"""






					pass






			@unittest.skip(reason="""Mask2Former does not have a get_input_embeddings method"""   )
			def    a_       (			self   :    Union[str, Any]   )	->	List[Any]:







					"""simple docstring"""






					pass






			@unittest.skip(reason="""Mask2Former is not a generative model"""   )
			def    a_       (			self   :    Tuple   )	->	Optional[Any]:







					"""simple docstring"""






					pass






			@unittest.skip(reason="""Mask2Former does not use token embeddings"""   )
			def    a_       (			self   :    Optional[int]   )	->	int:







					"""simple docstring"""






					pass






			@require_torch_multi_gpu
			@unittest.skip(
			    reason="""Mask2Former has some layers using `add_module` which doesn't work well with `nn.DataParallel`"""   )
			def    a_       (			self   :    List[str]   )	->	Union[str, Any]:







					"""simple docstring"""






					pass






			@unittest.skip("""Will be fixed soon by reducing the size of the model used for common tests."""   )
			def    a_       (			self   :    Union[str, Any]   )	->	Tuple:







					"""simple docstring"""






					pass






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







					"""simple docstring"""






					A__      ,			A__        =   self.model_tester.prepare_config_and_inputs_for_common()

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

							A__        =   ["""pixel_values"""]
							self.assertListEqual(arg_names[:1]							,	__lowerCAmelCase   )






			@slow
			def    a_       (			self   :    Optional[int]   )	->	Union[str, Any]:







					"""simple docstring"""






					for model_name in ["facebook/mask2former-swin-small-coco-instance"]:
							A__        =   MaskaFormerModel.from_pretrained(__lowerCAmelCase   )
							self.assertIsNotNone(__lowerCAmelCase   )






			def    a_       (			self   :    Dict   )	->	str:







					"""simple docstring"""






					A__        =   (self.model_tester.min_size,) * 2
					A__        =   {
					    """pixel_values""": torch.randn((2, 3, *size)							,	device=__lowerCAmelCase   ),
					    """mask_labels""": torch.randn((2, 10, *size)							,	device=__lowerCAmelCase   ),
					    """class_labels""": torch.zeros(2							,	10							,	device=__lowerCAmelCase   ).long(),
					}
					A__        =   self.model_tester.get_config()

					A__        =   MaskaFormerForUniversalSegmentation(__lowerCAmelCase   ).to(__lowerCAmelCase   )
					A__        =   model(**__lowerCAmelCase   )
					self.assertTrue(outputs.loss is not None   )






			def    a_       (			self   :    int   )	->	Any:







					"""simple docstring"""






					A__      ,			A__        =   self.model_tester.prepare_config_and_inputs_for_common()
					self.model_tester.create_and_check_maskaformer_model(__lowerCAmelCase							,	**__lowerCAmelCase							,	output_hidden_states=__lowerCAmelCase   )






			def    a_       (			self   :    List[Any]   )	->	Tuple:







					"""simple docstring"""






					A__      ,			A__        =   self.model_tester.prepare_config_and_inputs_for_common()

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






			def    a_       (			self   :    str   )	->	int:







					"""simple docstring"""






					if not self.model_tester.is_training:
							return

					A__        =   self.all_model_classes[1]
					A__      ,			A__      ,			A__      ,			A__      ,			A__        =   self.model_tester.prepare_config_and_inputs()

					A__        =   model_class(__lowerCAmelCase   )
					model.to(__lowerCAmelCase   )
					model.train()

					A__        =   model(__lowerCAmelCase							,	mask_labels=__lowerCAmelCase							,	class_labels=__lowerCAmelCase   ).loss
					loss.backward()







			def    a_       (			self   :    Any   )	->	Optional[int]:







					"""simple docstring"""






					A__        =   self.all_model_classes[1]
					A__      ,			A__      ,			A__      ,			A__      ,			A__        =   self.model_tester.prepare_config_and_inputs()
					A__        =   True
					A__        =   True

					A__        =   model_class(__lowerCAmelCase   ).to(__lowerCAmelCase   )
					model.train()

					A__        =   model(__lowerCAmelCase							,	mask_labels=__lowerCAmelCase							,	class_labels=__lowerCAmelCase   )

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

					A__        =   outputs.pixel_decoder_hidden_states[0]
					pixel_decoder_hidden_states.retain_grad()

					A__        =   outputs.transformer_decoder_hidden_states[0]
					transformer_decoder_hidden_states.retain_grad()

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

					outputs.loss.backward(retain_graph=__lowerCAmelCase   )

					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    :					int =      1e-4







def    __lowerCamelCase					(							)		->				Optional[int]:






		"""simple docstring"""

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






@require_vision
@slow
class   A			(unittest.TestCase    ):
			'''simple docstring'''




			@cached_property
			def    a_       (			self   :    int   )	->	List[Any]:







					"""simple docstring"""






					return "facebook/mask2former-swin-small-coco-instance"






			@cached_property
			def    a_       (			self   :    Any   )	->	int:







					"""simple docstring"""






					return MaskaFormerImageProcessor.from_pretrained(self.model_checkpoints   ) if is_vision_available() else None






			def    a_       (			self   :    Tuple   )	->	Optional[Any]:







					"""simple docstring"""






					A__        =   MaskaFormerModel.from_pretrained(self.model_checkpoints   ).to(__lowerCAmelCase   )
					A__        =   self.default_image_processor
					A__        =   prepare_img()
					A__        =   image_processor(__lowerCAmelCase							,	return_tensors="""pt"""   ).to(__lowerCAmelCase   )
					A__        =   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(__lowerCAmelCase							,	(1, 3, 3_84, 3_84)   )

					with torch.no_grad():
							A__        =   model(**__lowerCAmelCase   )

					A__        =   torch.tensor(
					    [[-0.2_7_9_0, -1.0_7_1_7, -1.1_6_6_8], [-0.5_1_2_8, -0.3_1_2_8, -0.4_9_8_7], [-0.5_8_3_2, 0.1_9_7_1, -0.0_1_9_7]]   ).to(__lowerCAmelCase   )
					self.assertTrue(
					    torch.allclose(
					        outputs.encoder_last_hidden_state[0, 0, :3, :3]							,	__lowerCAmelCase							,	atol=__lowerCAmelCase   )   )

					A__        =   torch.tensor(
					    [[0.8_9_7_3, 1.1_8_4_7, 1.1_7_7_6], [1.1_9_3_4, 1.5_0_4_0, 1.5_1_2_8], [1.1_1_5_3, 1.4_4_8_6, 1.4_9_5_1]]   ).to(__lowerCAmelCase   )
					self.assertTrue(
					    torch.allclose(
					        outputs.pixel_decoder_last_hidden_state[0, 0, :3, :3]							,	__lowerCAmelCase							,	atol=__lowerCAmelCase   )   )

					A__        =   torch.tensor(
					    [[2.1_1_5_2, 1.7_0_0_0, -0.8_6_0_3], [1.5_8_0_8, 1.8_0_0_4, -0.9_3_5_3], [1.6_0_4_3, 1.7_4_9_5, -0.5_9_9_9]]   ).to(__lowerCAmelCase   )
					self.assertTrue(
					    torch.allclose(
					        outputs.transformer_decoder_last_hidden_state[0, :3, :3]							,	__lowerCAmelCase							,	atol=__lowerCAmelCase   )   )






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







					"""simple docstring"""






					A__        =   MaskaFormerForUniversalSegmentation.from_pretrained(self.model_checkpoints   ).to(__lowerCAmelCase   ).eval()
					A__        =   self.default_image_processor
					A__        =   prepare_img()
					A__        =   image_processor(__lowerCAmelCase							,	return_tensors="""pt"""   ).to(__lowerCAmelCase   )
					A__        =   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(__lowerCAmelCase							,	(1, 3, 3_84, 3_84)   )

					with torch.no_grad():
							A__        =   model(**__lowerCAmelCase   )
					# masks_queries_logits
					A__        =   outputs.masks_queries_logits
					self.assertEqual(
					    masks_queries_logits.shape							,	(1, model.config.num_queries, inputs_shape[-2] // 4, inputs_shape[-1] // 4)   )
					A__        =   [
					    [-8.7_8_3_9, -9.0_0_5_6, -8.8_1_2_1],
					    [-7.4_1_0_4, -7.0_3_1_3, -6.5_4_0_1],
					    [-6.6_1_0_5, -6.3_4_2_7, -6.4_6_7_5],
					]
					A__        =   torch.tensor(__lowerCAmelCase   ).to(__lowerCAmelCase   )
					self.assertTrue(torch.allclose(masks_queries_logits[0, 0, :3, :3]							,	__lowerCAmelCase							,	atol=__lowerCAmelCase   )   )
					# class_queries_logits
					A__        =   outputs.class_queries_logits
					self.assertEqual(class_queries_logits.shape							,	(1, model.config.num_queries, model.config.num_labels + 1)   )
					A__        =   torch.tensor(
					    [
					        [1.8_3_2_4, -8.0_8_3_5, -4.1_9_2_2],
					        [0.8_4_5_0, -9.0_0_5_0, -3.6_0_5_3],
					        [0.3_0_4_5, -7.7_2_9_3, -3.0_2_7_5],
					    ]   ).to(__lowerCAmelCase   )
					self.assertTrue(torch.allclose(outputs.class_queries_logits[0, :3, :3]							,	__lowerCAmelCase							,	atol=__lowerCAmelCase   )   )







			def    a_       (			self   :    Optional[int]   )	->	List[Any]:







					"""simple docstring"""






					A__        =   MaskaFormerForUniversalSegmentation.from_pretrained(self.model_checkpoints   ).to(__lowerCAmelCase   ).eval()
					A__        =   self.default_image_processor

					A__        =   image_processor(
					    [np.zeros((3, 8_00, 13_33)   ), np.zeros((3, 8_00, 13_33)   )]							,	segmentation_maps=[np.zeros((3_84, 3_84)   ).astype(np.floataa   ), np.zeros((3_84, 3_84)   ).astype(np.floataa   )]							,	return_tensors="""pt"""							,	)

					A__        =   inputs["""pixel_values"""].to(__lowerCAmelCase   )
					A__        =   [el.to(__lowerCAmelCase   ) for el in inputs["""mask_labels"""]]
					A__        =   [el.to(__lowerCAmelCase   ) for el in inputs["""class_labels"""]]

					with torch.no_grad():
							A__        =   model(**__lowerCAmelCase   )

					self.assertTrue(outputs.loss is not None   )










import argparse
from collections import defaultdict

import yaml


A    :					str =      '''docs/source/en/_toctree.yml'''







def    __lowerCamelCase					(							__a   :str    )		->				List[Any]:






		"""simple docstring"""

		A__        =   defaultdict(__a    )
		A__        =   []
		A__        =   []
		for doc in doc_list:
				if "local" in doc:
						counts[doc["local"]] += 1

				if doc["title"].lower() == "overview":
						overview_doc.append({"""local""": doc["""local"""], """title""": doc["""title"""]}    )
				else:
						new_doc_list.append(__a    )

		A__        =   new_doc_list
		A__        =   [key for key, value in counts.items() if value > 1]

		A__        =   []
		for duplicate_key in duplicates:
				A__        =   list({doc["""title"""] for doc in doc_list if doc["""local"""] == duplicate_key}    )
				if len(__a    ) > 1:
						raise ValueError(
						    F'{duplicate_key} is present several times in the documentation table of content at '
						    """`docs/source/en/_toctree.yml` with different *Title* values. Choose one of those and remove the """
						    """others."""    )
				# Only add this once
				new_doc.append({"""local""": duplicate_key, """title""": titles[0]}    )

		# Add none duplicate-keys
		new_doc.extend([doc for doc in doc_list if """local""" not in counts or counts[doc["""local"""]] == 1]    )
		A__        =   sorted(__a    ,     key=lambda __a    : s["title"].lower()    )

		# "overview" gets special treatment and is always first
		if len(__a    ) > 1:
				raise ValueError("""{doc_list} has two 'overview' docs which is not allowed."""    )

		overview_doc.extend(__a    )

		# Sort
		return overview_doc







def    __lowerCamelCase					(							__a   :Any=False    )		->				List[str]:






		"""simple docstring"""

		with open(__a    ,     encoding="""utf-8"""    ) as f:
				A__        =   yaml.safe_load(f.read()    )

		# Get to the API doc
		A__        =   0
		while content[api_idx]["title"] != "API":
				api_idx += 1
		A__        =   content[api_idx]["""sections"""]

		# Then to the model doc
		A__        =   0
		while api_doc[scheduler_idx]["title"] != "Schedulers":
				scheduler_idx += 1

		A__        =   api_doc[scheduler_idx]["""sections"""]
		A__        =   clean_doc_toc(__a    )

		A__        =   False
		if new_scheduler_doc != scheduler_doc:
				A__        =   True
				if overwrite:
						A__        =   new_scheduler_doc

		if diff:
				if overwrite:
						A__        =   api_doc
						with open(__a    ,     """w"""    ,     encoding="""utf-8"""    ) as f:
								f.write(yaml.dump(__a    ,     allow_unicode=__a    )    )
				else:
						raise ValueError(
						    """The model doc part of the table of content is not properly sorted, run `make style` to fix this."""    )







def    __lowerCamelCase					(							__a   :Optional[int]=False    )		->				Dict:






		"""simple docstring"""

		with open(__a    ,     encoding="""utf-8"""    ) as f:
				A__        =   yaml.safe_load(f.read()    )

		# Get to the API doc
		A__        =   0
		while content[api_idx]["title"] != "API":
				api_idx += 1
		A__        =   content[api_idx]["""sections"""]

		# Then to the model doc
		A__        =   0
		while api_doc[pipeline_idx]["title"] != "Pipelines":
				pipeline_idx += 1

		A__        =   False
		A__        =   api_doc[pipeline_idx]["""sections"""]
		A__        =   []

		# sort sub pipeline docs
		for pipeline_doc in pipeline_docs:
				if "section" in pipeline_doc:
						A__        =   pipeline_doc["""section"""]
						A__        =   clean_doc_toc(__a    )
						if overwrite:
								A__        =   new_sub_pipeline_doc
				new_pipeline_docs.append(__a    )

		# sort overall pipeline doc
		A__        =   clean_doc_toc(__a    )

		if new_pipeline_docs != pipeline_docs:
				A__        =   True
				if overwrite:
						A__        =   new_pipeline_docs

		if diff:
				if overwrite:
						A__        =   api_doc
						with open(__a    ,     """w"""    ,     encoding="""utf-8"""    ) as f:
								f.write(yaml.dump(__a    ,     allow_unicode=__a    )    )
				else:
						raise ValueError(
						    """The model doc part of the table of content is not properly sorted, run `make style` to fix this."""    )


if __name__ == "__main__":
					A    :					Tuple =      argparse.ArgumentParser()
					parser.add_argument('''--fix_and_overwrite''', action='''store_true''', help='''Whether to fix inconsistencies.''')
					A    :					Optional[Any] =      parser.parse_args()

					check_scheduler_doc(args.fix_and_overwrite)
					check_pipeline_doc(args.fix_and_overwrite)



