


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCAmelCase    =					{
    "configuration_mgp_str": ["MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP", "MgpstrConfig"],
    "processing_mgp_str": ["MgpstrProcessor"],
    "tokenization_mgp_str": ["MgpstrTokenizer"],
}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   UpperCAmelCase    =					[
       "MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST",
       "MgpstrModel",
       "MgpstrPreTrainedModel",
       "MgpstrForSceneTextRecognition",
   ]

if TYPE_CHECKING:
   from .configuration_mgp_str import MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP, MgpstrConfig
   from .processing_mgp_str import MgpstrProcessor
   from .tokenization_mgp_str import MgpstrTokenizer

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_mgp_str import (
          MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST,
          MgpstrForSceneTextRecognition,
          MgpstrModel,
          MgpstrPreTrainedModel,
      )
else:
   import sys

   UpperCAmelCase    =					_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



import requests






def  __lowerCAmelCase					(SCREAMING_SNAKE_CASE      ,      SCREAMING_SNAKE_CASE      )->						None:




      """simple docstring"""

      snake_case_ =   {'''Content-Type''': '''application/json'''}
      snake_case_ =   requests.post(SCREAMING_SNAKE_CASE      ,      json={'''text''': message_body}      ,      headers=SCREAMING_SNAKE_CASE      )
      if response.status_code != 200:
            snake_case_ =   (
                '''Request to slack returned an error '''
                f'''{response.status_code}, the response is:\n{response.text}'''
            )
            raise ValueError(SCREAMING_SNAKE_CASE      )


if __name__ == "__main__":
   # Set the slack url to the one provided by Slack when you create the webhook at
   # https://my.slack.com/services/new/incoming-webhook/
   send_slack_message("""<YOUR MESSAGE BODY>""", """<SLACK CHANNEL URL>""")