
"""simple docstring"""
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


_a      :			Union[str, Any]					=							{
    """configuration_nezha""": ["""NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP""", """NezhaConfig"""],
}

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    _a      :			Optional[int]					=							[
        """NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST""",
        """NezhaForNextSentencePrediction""",
        """NezhaForMaskedLM""",
        """NezhaForPreTraining""",
        """NezhaForMultipleChoice""",
        """NezhaForQuestionAnswering""",
        """NezhaForSequenceClassification""",
        """NezhaForTokenClassification""",
        """NezhaModel""",
        """NezhaPreTrainedModel""",
    ]


if TYPE_CHECKING:
    from .configuration_nezha import NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP, NezhaConfig

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_nezha import (
            NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST,
            NezhaForMaskedLM,
            NezhaForMultipleChoice,
            NezhaForNextSentencePrediction,
            NezhaForPreTraining,
            NezhaForQuestionAnswering,
            NezhaForSequenceClassification,
            NezhaForTokenClassification,
            NezhaModel,
            NezhaPreTrainedModel,
        )


else:
    import sys

    _a      :			str					=							_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)








"""simple docstring"""
from datetime import datetime

import requests
from bsa import BeautifulSoup

if __name__ == "__main__":
    _a      :			Dict					=							input("""Enter image url: """).strip()
    print(f'Downloading image from {url} ...')
    _a      :			str					=							BeautifulSoup(requests.get(url).content, """html.parser""")
    # The image URL is in the content field of the first meta tag with property og:image
    _a      :			str					=							soup.find("""meta""", {"""property""": """og:image"""})["""content"""]
    _a      :			Dict					=							requests.get(image_url).content
    _a      :			str					=							f'{datetime.now():%Y-%m-%d_%H:%M:%S}.jpg'
    with open(file_name, """wb""") as fp:
        fp.write(image_data)
    print(f'Done. Image saved to disk as {file_name}.')

