



"""simple docstring"""
# tests directory-specific settings - this file is run automatically
# by pytest before any tests are run

import doctest
import sys
import warnings
from os.path import abspath, dirname, join

import _pytest

from transformers.testing_utils import HfDoctestModule, HfDocTestParser


# allow having multiple repository checkouts and not needing to remember to rerun
# 'pip install -e .[dev]' when switching between checkouts and running tests.
_lowerCAmelCase    :Any     =					abspath(join(dirname(__file__), 'src'))
sys.path.insert(1, git_repo_path)

# silence FutureWarning warnings in tests since often we can't act on them until
# they become normal warnings - i.e. the tests still need to test the current functionality
warnings.simplefilter(action='ignore', category=FutureWarning)





def  lowerCamelCase_						(UpperCamelCase__		:		Union[str, Any]							):
    config.addinivalue_line(
        '''markers'''     ,       '''is_pt_tf_cross_test: mark test to run only when PT and TF interactions are tested'''							)
    config.addinivalue_line(
        '''markers'''     ,       '''is_pt_flax_cross_test: mark test to run only when PT and FLAX interactions are tested'''							)
    config.addinivalue_line('''markers'''     ,       '''is_pipeline_test: mark test to run only when pipelines are tested'''							)
    config.addinivalue_line('''markers'''     ,       '''is_staging_test: mark test to run only in the staging environment'''							)
    config.addinivalue_line('''markers'''     ,       '''accelerate_tests: mark test that require accelerate'''							)
    config.addinivalue_line('''markers'''     ,       '''tool_tests: mark the tool tests that are run on their specific schedule'''							)





def  lowerCamelCase_						(UpperCamelCase__		:		Optional[int]							):
    from transformers.testing_utils import pytest_addoption_shared

    pytest_addoption_shared(UpperCamelCase__							)





def  lowerCamelCase_						(UpperCamelCase__		:		Union[str, Any]							):
    from transformers.testing_utils import pytest_terminal_summary_main

    _UpperCAmelCase							:  Union[str, Any]											=    terminalreporter.config.getoption('''--make-reports'''							)
    if make_reports:
        pytest_terminal_summary_main(UpperCamelCase__     ,       id=UpperCamelCase__							)





def  lowerCamelCase_						(UpperCamelCase__		:		int     ,       UpperCamelCase__		:		List[Any]							):
    # If no tests are collected, pytest exists with code 5, which makes the CI fail.
    if exitstatus == 5:
        _UpperCAmelCase							:  int											=    0


# Doctest custom flag to ignore output.
_lowerCAmelCase    :Dict     =					doctest.register_optionflag('IGNORE_RESULT')

_lowerCAmelCase    :Union[str, Any]     =					doctest.OutputChecker
class 							_UpperCAmelCase							( a      ):





     '''simple docstring'''



     def  __lowerCAmelCase	(					self       ,	A       ,	A       ,	A		)							->					Tuple:
         if IGNORE_RESULT & optionflags:
             return True
         return OutputChecker.check_output(self       ,	A       ,	A       ,	A		)



_lowerCAmelCase    :int     =					CustomOutputChecker
_lowerCAmelCase    :List[Any]     =					HfDoctestModule


_lowerCAmelCase    :Union[str, Any]     =					HfDocTestParser







"""simple docstring"""
from ...configuration_utils import PretrainedConfig
from ...utils import logging


_lowerCAmelCase    :int     =					logging.get_logger(__name__)

_lowerCAmelCase    :Union[str, Any]     =					{
    'alibaba-damo/mgp-str-base': 'https://huggingface.co/alibaba-damo/mgp-str-base/resolve/main/config.json',
}
class 							_UpperCAmelCase							( a      ):





     '''simple docstring'''



     a__									='''mgp-str'''





     def __init__(					self       ,	A=[3_2, 1_2_8]       ,	A=4       ,	A=3       ,	A=2_7       ,	A=3_8       ,	A=5_0_2_5_7       ,	A=3_0_5_2_2       ,	A=7_6_8       ,	A=1_2       ,	A=1_2       ,	A=4.0       ,	A=True       ,	A=False       ,	A=1E-5       ,	A=0.0       ,	A=0.0       ,	A=0.0       ,	A=False       ,	A=0.02       ,	**A       ,	)							->					Union[str, Any]:
         super().__init__(**A		)

         _UpperCAmelCase							:  Any											=    image_size
         _UpperCAmelCase							:  str											=    patch_size
         _UpperCAmelCase							:  Dict											=    num_channels
         _UpperCAmelCase							:  Dict											=    max_token_length
         _UpperCAmelCase							:  Optional[Any]											=    num_character_labels
         _UpperCAmelCase							:  int											=    num_bpe_labels
         _UpperCAmelCase							:  List[str]											=    num_wordpiece_labels
         _UpperCAmelCase							:  Optional[int]											=    hidden_size
         _UpperCAmelCase							:  Any											=    num_hidden_layers
         _UpperCAmelCase							:  List[Any]											=    num_attention_heads
         _UpperCAmelCase							:  List[Any]											=    mlp_ratio
         _UpperCAmelCase							:  List[str]											=    distilled
         _UpperCAmelCase							:  Optional[int]											=    layer_norm_eps
         _UpperCAmelCase							:  str											=    drop_rate
         _UpperCAmelCase							:  List[Any]											=    qkv_bias
         _UpperCAmelCase							:  List[str]											=    attn_drop_rate
         _UpperCAmelCase							:  Dict											=    drop_path_rate
         _UpperCAmelCase							:  Union[str, Any]											=    output_aa_attentions
         _UpperCAmelCase							:  List[str]											=    initializer_range


