


import json
import os
import pickle
import subprocess
from hashlib import mda
from pathlib import Path
from tempfile import gettempdir
from textwrap import dedent
from types import CodeType, FunctionType
from unittest import TestCase
from unittest.mock import patch

import pytest
from multiprocess import Pool
from packaging import version

import datasets
from datasets.fingerprint import Hasher, fingerprint_transform
from datasets.table import InMemoryTable

from .utils import (
    require_regex,
    require_spacy,
    require_spacy_model,
    require_tiktoken,
    require_torch,
    require_transformers,
)




class  A_ :







 """simple docstring"""





 def __init__(      self       :			List[Any]							,     _a       :			List[Any]					)     ->      Union[str, Any]:
      UpperCAmelCase    :					List[Any]			=      foo

 def __call__(      self       :			Union[str, Any]					)     ->      Optional[int]:
      return self.foo




class  A_ (			datasets.Dataset  ):







 """simple docstring"""





 @fingerprint_transform(inplace=__snake_case					)
 def 	_UpperCamelCase     (      self       :			Tuple							,     _a       :			List[str]							,     *_a       :			List[Any]							,     **_a       :			int					)     ->      List[str]:
      return DatasetChild(self.data							,     fingerprint=__snake_case					)

 @fingerprint_transform(inplace=__snake_case					)
 def 	_UpperCamelCase     (      self       :			int							,     _a       :			Optional[int]							,     *_a       :			Optional[Any]							,     **_a       :			Optional[int]					)     ->      List[str]:
      return DatasetChild(self.data							,     fingerprint=__snake_case					)




class  A_ :







 """simple docstring"""





 def __init__(      self       :			List[str]							,     _a       :			Tuple					)     ->      List[Any]:
      UpperCAmelCase    :					str			=      callable
 def __call__(      self       :			str							,     *_a       :			int							,     **_a       :			Optional[Any]					)     ->      Optional[Any]:

      if self.callable is not None:
           return self.callable(*__snake_case							,     **__snake_case					)

 def __getstate__(      self       :			str					)     ->      Optional[int]:
      raise pickle.PicklingError()




class  A_ (			__A  ):







 """simple docstring"""





 @require_transformers
 @pytest.mark.integration
 def 	_UpperCamelCase     (      self       :			List[Any]					)     ->      Any:
      from transformers import AutoTokenizer

      def encode(_a       :			str					):
           return tokenizer(__snake_case					)

      # TODO: add hash consistency tests across sessions
      UpperCAmelCase    :					Dict			=      AutoTokenizer.from_pretrained("bert-base-uncased"					)
      UpperCAmelCase    :					str			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      UpperCAmelCase    :					Dict			=      mda(datasets.utils.py_utils.dumps(lambda _a					: tokenizer(__snake_case					)					)					).hexdigest()
      UpperCAmelCase    :					Dict			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      UpperCAmelCase    :					List[Any]			=      AutoTokenizer.from_pretrained("bert-base-cased"					)
      UpperCAmelCase    :					List[str]			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      UpperCAmelCase    :					Tuple			=      mda(datasets.utils.py_utils.dumps(lambda _a					: tokenizer(__snake_case					)					)					).hexdigest()
      UpperCAmelCase    :					Optional[int]			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      UpperCAmelCase    :					List[Any]			=      AutoTokenizer.from_pretrained("bert-base-uncased"					)
      UpperCAmelCase    :					str			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      UpperCAmelCase    :					Dict			=      mda(datasets.utils.py_utils.dumps(lambda _a					: tokenizer(__snake_case					)					)					).hexdigest()
      UpperCAmelCase    :					Optional[Any]			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      self.assertEqual(__snake_case							,     __snake_case					)
      self.assertNotEqual(__snake_case							,     __snake_case					)
      self.assertEqual(__snake_case							,     __snake_case					)
      self.assertNotEqual(__snake_case							,     __snake_case					)
      self.assertEqual(__snake_case							,     __snake_case					)
      self.assertNotEqual(__snake_case							,     __snake_case					)
 @require_transformers
 @pytest.mark.integration
 def 	_UpperCamelCase     (      self       :			Optional[Any]					)     ->      Optional[int]:
      from transformers import AutoTokenizer

      UpperCAmelCase    :					Union[str, Any]			=      AutoTokenizer.from_pretrained("gpt2"					)
      UpperCAmelCase    :					Dict			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      tokenizer("Hello world !"					)  # call once to change the tokenizer's cache
      UpperCAmelCase    :					List[Any]			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      self.assertEqual(__snake_case							,     __snake_case					)

 @require_regex
 def 	_UpperCamelCase     (      self       :			str					)     ->      Union[str, Any]:
      import regex

      UpperCAmelCase    :					Dict			=      regex.Regex("foo"					)
      UpperCAmelCase    :					List[Any]			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      UpperCAmelCase    :					Tuple			=      regex.Regex("bar"					)
      UpperCAmelCase    :					Tuple			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      UpperCAmelCase    :					int			=      regex.Regex("foo"					)
      UpperCAmelCase    :					List[str]			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      self.assertEqual(__snake_case							,     __snake_case					)
      self.assertNotEqual(__snake_case							,     __snake_case					)




class  A_ (			__A  ):







 """simple docstring"""





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

      def func():
           return foo

      UpperCAmelCase    :					List[str]			=      [0]
      UpperCAmelCase    :					str			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      UpperCAmelCase    :					Any			=      [1]
      UpperCAmelCase    :					Tuple			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      UpperCAmelCase    :					List[Any]			=      [0]
      UpperCAmelCase    :					Optional[int]			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      self.assertEqual(__snake_case							,     __snake_case					)
      self.assertNotEqual(__snake_case							,     __snake_case					)
 def 	_UpperCamelCase     (      self       :			Optional[Any]					)     ->      Optional[int]:

      def func():
           pass

      UpperCAmelCase    :					Optional[int]			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()

      def func():
           pass

      UpperCAmelCase    :					Any			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      self.assertEqual(__snake_case							,     __snake_case					)
 def 	_UpperCamelCase     (      self       :			int					)     ->      int:
      UpperCAmelCase    :					Optional[Any]			=      mda(datasets.utils.py_utils.dumps(Foo([0]					)					)					).hexdigest()
      UpperCAmelCase    :					Optional[Any]			=      mda(datasets.utils.py_utils.dumps(Foo([1]					)					)					).hexdigest()
      UpperCAmelCase    :					Optional[Any]			=      mda(datasets.utils.py_utils.dumps(Foo([0]					)					)					).hexdigest()
      self.assertEqual(__snake_case							,     __snake_case					)
      self.assertNotEqual(__snake_case							,     __snake_case					)
 def 	_UpperCamelCase     (      self       :			List[str]					)     ->      str:
      UpperCAmelCase    :					Dict			=      mda(datasets.utils.py_utils.dumps(Foo([0]					).__call__					)					).hexdigest()
      UpperCAmelCase    :					Optional[int]			=      mda(datasets.utils.py_utils.dumps(Foo([1]					).__call__					)					).hexdigest()
      UpperCAmelCase    :					Optional[int]			=      mda(datasets.utils.py_utils.dumps(Foo([0]					).__call__					)					).hexdigest()
      self.assertEqual(__snake_case							,     __snake_case					)
      self.assertNotEqual(__snake_case							,     __snake_case					)
 def 	_UpperCamelCase     (      self       :			str					)     ->      Union[str, Any]:
      UpperCAmelCase    :					List[Any]			=      (
          "co_argcount",
          "co_kwonlyargcount",
          "co_nlocals",
          "co_stacksize",
          "co_flags",
          "co_code",
          "co_consts",
          "co_names",
          "co_varnames",
          "co_filename",
          "co_name",
          "co_firstlineno",
          "co_lnotab",
          "co_freevars",
          "co_cellvars",
      )

      def _create_code_pyaa(*_a       :			Tuple					):
           if hasattr(args[-3]							,     "encode"					):
                UpperCAmelCase    :					Any			=      list(__snake_case					)
                UpperCAmelCase    :					List[str]			=      args[-3].encode()  # co_lnotab
                UpperCAmelCase    :					Any			=      args[-1_0].encode()  # co_code
           if hasattr(__snake_case							,     "co_posonlyargcount"					):
                if len(__snake_case					) == 1_6:
                     return CodeType(*__snake_case					)
                elif len(__snake_case					) == 1_5:
                     return CodeType(args[0]							,     0							,     *args[1:]					)
                return CodeType(args[0]							,     0							,     0							,     *args[1:]					)
           elif hasattr(__snake_case							,     "co_kwonlyargcount"					):
                if len(__snake_case					) == 1_6:
                     return CodeType(args[0]							,     *args[2:]					)
                elif len(__snake_case					) == 1_5:
                     return CodeType(*__snake_case					)
                return CodeType(args[0]							,     0							,     *args[1:]					)
           if len(__snake_case					) == 1_6:
                return CodeType(args[0]							,     *args[3:]					)
           elif len(__snake_case					) == 1_5:
                return CodeType(args[0]							,     *args[2:]					)
           return CodeType(*__snake_case					)

      def create_ipython_func(_a       :			Tuple							,     _a       :			Optional[Any]					):
           def func():
                return returned_obj

           UpperCAmelCase    :					Optional[int]			=      func.__code__
           # Use _create_code from dill in order to make it work for different python versions
           if datasets.config.PY_VERSION < version.parse("3.8"					):
                UpperCAmelCase    :					Tuple			=      _create_code_pyaa(
                    *[getattr(__snake_case							,     __snake_case					) if k != "co_filename" else co_filename for k in code_args_pyaa]					)
           else:
                UpperCAmelCase    :					int			=      code.replace(co_filename=__snake_case					)
           return FunctionType(__snake_case							,     func.__globals__							,     func.__name__							,     func.__defaults__							,     func.__closure__					)

      UpperCAmelCase    :					Any			=      "<ipython-input-2-e0383a102aae>", [0]
      UpperCAmelCase    :					Any			=      mda(datasets.utils.py_utils.dumps(create_ipython_func(__snake_case							,     __snake_case					)					)					).hexdigest()
      UpperCAmelCase    :					List[str]			=      "<ipython-input-2-e0383a102aae>", [1]
      UpperCAmelCase    :					Optional[Any]			=      mda(datasets.utils.py_utils.dumps(create_ipython_func(__snake_case							,     __snake_case					)					)					).hexdigest()
      UpperCAmelCase    :					List[str]			=      "<ipython-input-5-713f6613acf3>", [0]
      UpperCAmelCase    :					List[Any]			=      mda(datasets.utils.py_utils.dumps(create_ipython_func(__snake_case							,     __snake_case					)					)					).hexdigest()
      self.assertEqual(__snake_case							,     __snake_case					)
      self.assertNotEqual(__snake_case							,     __snake_case					)

      UpperCAmelCase    :					Tuple			=      os.path.join(gettempdir()							,     "ipykernel_12345"							,     "321456789.py"					), [0]
      UpperCAmelCase    :					List[Any]			=      mda(datasets.utils.py_utils.dumps(create_ipython_func(__snake_case							,     __snake_case					)					)					).hexdigest()
      UpperCAmelCase    :					int			=      os.path.join(gettempdir()							,     "ipykernel_12345"							,     "321456789.py"					), [1]
      UpperCAmelCase    :					Tuple			=      mda(datasets.utils.py_utils.dumps(create_ipython_func(__snake_case							,     __snake_case					)					)					).hexdigest()
      UpperCAmelCase    :					List[str]			=      os.path.join(gettempdir()							,     "ipykernel_12345"							,     "654123987.py"					), [0]
      UpperCAmelCase    :					Optional[int]			=      mda(datasets.utils.py_utils.dumps(create_ipython_func(__snake_case							,     __snake_case					)					)					).hexdigest()
      self.assertEqual(__snake_case							,     __snake_case					)
      self.assertNotEqual(__snake_case							,     __snake_case					)

 def 	_UpperCamelCase     (      self       :			Any					)     ->      str:
      UpperCAmelCase    :					int			=      [0], [1]

      def func():
           return foo, bar

      UpperCAmelCase    :					Optional[int]			=      "__main__"

      def globalvars_mocka_side_effect(_a       :			List[str]							,     *_a       :			List[str]							,     **_a       :			Dict					):
           return {"foo": foo, "bar": bar}

      def globalvars_mocka_side_effect(_a       :			List[str]							,     *_a       :			Union[str, Any]							,     **_a       :			Optional[Any]					):
           return {"bar": bar, "foo": foo}

      with patch("dill.detect.globalvars"							,     side_effect=__snake_case					) as globalvars_mocka:
           UpperCAmelCase    :					Optional[int]			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
           self.assertGreater(globalvars_mocka.call_count							,     0					)
      with patch("dill.detect.globalvars"							,     side_effect=__snake_case					) as globalvars_mocka:
           UpperCAmelCase    :					Dict			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
           self.assertGreater(globalvars_mocka.call_count							,     0					)
      self.assertEqual(__snake_case							,     __snake_case					)




class  A_ (			__A  ):







 """simple docstring"""





 def 	_UpperCamelCase     (      self       :			List[Any]					)     ->      Optional[int]:
      UpperCAmelCase    :					List[str]			=      Hasher.hash("hello"					)
      UpperCAmelCase    :					str			=      Hasher.hash("hello"					)
      UpperCAmelCase    :					Optional[Any]			=      Hasher.hash("there"					)
      self.assertEqual(__snake_case							,     __snake_case					)
      self.assertNotEqual(__snake_case							,     __snake_case					)
 def 	_UpperCamelCase     (      self       :			Tuple					)     ->      int:
      UpperCAmelCase    :					Any			=      Hasher.hash(Foo("hello"					)					)
      UpperCAmelCase    :					Optional[Any]			=      Hasher.hash(Foo("hello"					)					)
      UpperCAmelCase    :					Any			=      Hasher.hash(Foo("there"					)					)
      self.assertEqual(__snake_case							,     __snake_case					)
      self.assertNotEqual(__snake_case							,     __snake_case					)
 def 	_UpperCamelCase     (      self       :			Dict					)     ->      str:
      UpperCAmelCase    :					Optional[Any]			=      Hasher()
      for x in ["hello", Foo("hello"					)]:
           hasher.update(__snake_case					)
      UpperCAmelCase    :					Union[str, Any]			=      hasher.hexdigest()
      UpperCAmelCase    :					Optional[Any]			=      Hasher()
      for x in ["hello", Foo("hello"					)]:
           hasher.update(__snake_case					)
      UpperCAmelCase    :					str			=      hasher.hexdigest()
      UpperCAmelCase    :					Dict			=      Hasher()
      for x in ["there", Foo("there"					)]:
           hasher.update(__snake_case					)
      UpperCAmelCase    :					int			=      hasher.hexdigest()
      self.assertEqual(__snake_case							,     __snake_case					)
      self.assertNotEqual(__snake_case							,     __snake_case					)
 def 	_UpperCamelCase     (      self       :			Optional[Any]					)     ->      Tuple:

      with self.assertRaises(pickle.PicklingError					):
           Hasher.hash(UnpicklableCallable(Foo("hello"					)					)					)
 def 	_UpperCamelCase     (      self       :			List[Any]					)     ->      List[str]:
      UpperCAmelCase    :					List[Any]			=      "abc"
      UpperCAmelCase    :					List[Any]			=      [string, string]  # two strings have the same ids
      UpperCAmelCase    :					List[Any]			=      [string, string]
      UpperCAmelCase    :					int			=      json.loads(f'[\"{string}\", \"{string}\"]'					)  # two strings have different ids
      self.assertIs(obja[0]							,     __snake_case					)
      self.assertIs(obja[0]							,     obja[1]					)
      self.assertIs(obja[0]							,     __snake_case					)
      self.assertIs(obja[0]							,     obja[1]					)
      self.assertIsNot(obja[0]							,     __snake_case					)
      self.assertIsNot(obja[0]							,     obja[1]					)
      UpperCAmelCase    :					List[str]			=      Hasher.hash(__snake_case					)
      UpperCAmelCase    :					int			=      Hasher.hash(__snake_case					)
      UpperCAmelCase    :					List[Any]			=      Hasher.hash(__snake_case					)
      self.assertEqual(__snake_case							,     __snake_case					)
      self.assertEqual(__snake_case							,     __snake_case					)
 @require_tiktoken
 def 	_UpperCamelCase     (      self       :			Union[str, Any]					)     ->      List[Any]:
      import tiktoken

      UpperCAmelCase    :					Tuple			=      tiktoken.get_encoding("gpt2"					)
      UpperCAmelCase    :					List[Any]			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      UpperCAmelCase    :					int			=      tiktoken.get_encoding("r50k_base"					)
      UpperCAmelCase    :					Any			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      UpperCAmelCase    :					Optional[int]			=      tiktoken.get_encoding("gpt2"					)
      UpperCAmelCase    :					List[str]			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      self.assertEqual(__snake_case							,     __snake_case					)
      self.assertNotEqual(__snake_case							,     __snake_case					)
 @require_torch
 def 	_UpperCamelCase     (      self       :			List[Any]					)     ->      Any:
      import torch

      UpperCAmelCase    :					Optional[int]			=      torch.tensor([1.0]					)
      UpperCAmelCase    :					Any			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      UpperCAmelCase    :					Tuple			=      torch.tensor([2.0]					)
      UpperCAmelCase    :					Optional[Any]			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      UpperCAmelCase    :					Tuple			=      torch.tensor([1.0]					)
      UpperCAmelCase    :					Optional[Any]			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      self.assertEqual(__snake_case							,     __snake_case					)
      self.assertNotEqual(__snake_case							,     __snake_case					)

 @require_spacy
 @require_spacy_model("en_core_web_sm"					)
 @require_spacy_model("fr_core_news_sm"					)
 @pytest.mark.integration
 def 	_UpperCamelCase     (      self       :			Optional[Any]					)     ->      Tuple:
      import spacy

      UpperCAmelCase    :					Union[str, Any]			=      spacy.load("en_core_web_sm"					)
      UpperCAmelCase    :					Optional[int]			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      UpperCAmelCase    :					str			=      spacy.load("fr_core_news_sm"					)
      UpperCAmelCase    :					List[str]			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      UpperCAmelCase    :					Any			=      spacy.load("en_core_web_sm"					)
      UpperCAmelCase    :					int			=      mda(datasets.utils.py_utils.dumps(__snake_case					)					).hexdigest()
      self.assertEqual(__snake_case							,     __snake_case					)
      self.assertNotEqual(__snake_case							,     __snake_case					)







@pytest.mark.integration
def 	A (		A__			):
     UpperCAmelCase    :					Optional[int]			=      tmp_path / "dir1"
     UpperCAmelCase    :					Dict			=      tmp_path / "dir2"
     dira.mkdir()
     dira.mkdir()
     UpperCAmelCase    :					Dict			=      "script.py"
     UpperCAmelCase    :					List[str]			=      dedent(
         "\n    from datasets.fingerprint import Hasher\n    def foo():\n        pass\n    print(Hasher.hash(foo))\n    "			)
     UpperCAmelCase    :					Optional[Any]			=      dira / script_filename
     UpperCAmelCase    :					Optional[Any]			=      dira / script_filename
     with script_patha.open("w"			) as f:
          f.write(A__			)
     with script_patha.open("w"			) as f:
          f.write(A__			)
     UpperCAmelCase    :					Any			=      subprocess.check_output(["python", str(A__			)]			)
     UpperCAmelCase    :					Tuple			=      subprocess.check_output(["python", str(A__			)]			)
     assert fingerprinta == fingerprinta







def 	A (		):
     UpperCAmelCase    :					int			=      {"a": [0, 1, 2]}
     UpperCAmelCase    :					Tuple			=      DatasetChild(InMemoryTable.from_pydict(A__			)			)
     UpperCAmelCase    :					int			=      dataset.funca()._fingerprint
     assert expected_fingerprint == dataset.funca()._fingerprint
     assert expected_fingerprint != dataset.funca()._fingerprint

     with Pool(2			) as p:
          assert expected_fingerprint == p.apply_async(dataset.funca			).get()._fingerprint
          assert expected_fingerprint != p.apply_async(dataset.funca			).get()._fingerprint







def 	A (		):
     UpperCAmelCase    :					Optional[int]			=      {"a": [0, 1, 2]}




     class  A_ (			datasets.Dataset  ):







      """simple docstring"""





      @fingerprint_transform(inplace=__snake_case					)
      def 	_UpperCamelCase     (      self       :			Union[str, Any]							,     _a       :			List[str]					)     ->      Union[str, Any]:
           return DummyDatasetChild(self.data							,     fingerprint=__snake_case					)
     UpperCAmelCase    :					str			=      DummyDatasetChild(InMemoryTable.from_pydict(A__			)			).func()




     class  A_ (			datasets.Dataset  ):







      """simple docstring"""





      @fingerprint_transform(inplace=__snake_case							,     version="1.0.0"					)
      def 	_UpperCamelCase     (      self       :			Dict							,     _a       :			Optional[Any]					)     ->      int:
           return DummyDatasetChild(self.data							,     fingerprint=__snake_case					)
     UpperCAmelCase    :					Any			=      DummyDatasetChild(InMemoryTable.from_pydict(A__			)			).func()




     class  A_ (			datasets.Dataset  ):







      """simple docstring"""





      @fingerprint_transform(inplace=__snake_case							,     version="2.0.0"					)
      def 	_UpperCamelCase     (      self       :			Optional[Any]							,     _a       :			List[str]					)     ->      List[str]:
           return DummyDatasetChild(self.data							,     fingerprint=__snake_case					)
     UpperCAmelCase    :					Dict			=      DummyDatasetChild(InMemoryTable.from_pydict(A__			)			).func()

     assert len({fingeprint_no_version, fingeprint_a, fingeprint_a}			) == 3







def 	A (		):
     # AttributeError: module 'dill._dill' has no attribute 'stack'
     UpperCAmelCase    :					Optional[int]			=      Hasher()
     hasher.update(lambda A__			: x			)










from typing import TYPE_CHECKING

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


__lowerCAmelCase			:Optional[int]	 =     {
    'configuration_mobilenet_v1': [
        'MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'MobileNetV1Config',
        'MobileNetV1OnnxConfig',
    ],
}

try:
							if not is_vision_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__lowerCAmelCase			:Dict	 =     ['MobileNetV1FeatureExtractor']
							__lowerCAmelCase			:List[Any]	 =     ['MobileNetV1ImageProcessor']

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__lowerCAmelCase			:Optional[int]	 =     [
							    'MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'MobileNetV1ForImageClassification',
							    'MobileNetV1Model',
							    'MobileNetV1PreTrainedModel',
							    'load_tf_weights_in_mobilenet_v1',
							]


if TYPE_CHECKING:
							from .configuration_mobilenet_va import (
							    MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP,
							    MobileNetVaConfig,
							    MobileNetVaOnnxConfig,
							)

							try:
														if not is_vision_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .feature_extraction_mobilenet_va import MobileNetVaFeatureExtractor
														from .image_processing_mobilenet_va import MobileNetVaImageProcessor

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_mobilenet_va import (
														    MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST,
														    MobileNetVaForImageClassification,
														    MobileNetVaModel,
														    MobileNetVaPreTrainedModel,
														    load_tf_weights_in_mobilenet_va,
														)


else:
							import sys

							__lowerCAmelCase			:Optional[int]	 =     _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)