
'''simple docstring'''


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowercase_      :				Optional[int]   					=    {
    "configuration_upernet": ["UperNetConfig"],
}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowercase_      :				str   					=    [
						    "UperNetForSemanticSegmentation",
						    "UperNetPreTrainedModel",
						]


if TYPE_CHECKING:
						from .configuration_upernet import UperNetConfig

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_upernet import UperNetForSemanticSegmentation, UperNetPreTrainedModel


else:
						import sys

						lowercase_      :				List[str]   					=    _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)







'''simple docstring'''


import requests







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


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>''')


