

import warnings
from contextlib import contextmanager

from ....processing_utils import ProcessorMixin






class _UpperCamelCase							(							_SCREAMING_SNAKE_CASE      ):
			'''simple docstring'''







			lowerCamelCase__							='MCTCTFeatureExtractor'
			lowerCamelCase__							='AutoTokenizer'
			def __init__(	self							:       Optional[int]					,					a							:       List[Any]					,					a							:       Optional[Any]		)							->				List[str]:

				"""simple docstring"""

				super().__init__(_lowerCAmelCase					,					_lowerCAmelCase		)
				SCREAMING_SNAKE_CASE      :					Tuple    =				self.feature_extractor
				SCREAMING_SNAKE_CASE      :					Optional[Any]    =				False
			def __call__(	self							:       Any					,					*a							:       str					,					**a							:       Tuple		)							->				Any:

				"""simple docstring"""

				if self._in_target_context_manager:
					return self.current_processor(*_lowerCAmelCase					,					**_lowerCAmelCase		)

				if "raw_speech" in kwargs:
					warnings.warn("Using `raw_speech` as a keyword argument is deprecated. Use `audio` instead."		)
					SCREAMING_SNAKE_CASE      :					str    =				kwargs.pop("raw_speech"		)
				else:
					SCREAMING_SNAKE_CASE      :					Optional[Any]    =				kwargs.pop("audio"					,					_lowerCAmelCase		)
				SCREAMING_SNAKE_CASE      :					Any    =				kwargs.pop("sampling_rate"					,					_lowerCAmelCase		)
				SCREAMING_SNAKE_CASE      :					Any    =				kwargs.pop("text"					,					_lowerCAmelCase		)
				if len(_lowerCAmelCase		) > 0:
					SCREAMING_SNAKE_CASE      :					str    =				args[0]
					SCREAMING_SNAKE_CASE      :					List[str]    =				args[1:]

				if audio is None and text is None:
					raise ValueError("You need to specify either an `audio` or `text` input to process."		)

				if audio is not None:
					SCREAMING_SNAKE_CASE      :					int    =				self.feature_extractor(_lowerCAmelCase					,					*_lowerCAmelCase					,					sampling_rate=_lowerCAmelCase					,					**_lowerCAmelCase		)
				if text is not None:
					SCREAMING_SNAKE_CASE      :					Dict    =				self.tokenizer(_lowerCAmelCase					,					**_lowerCAmelCase		)

				if text is None:
					return inputs
				elif audio is None:
					return encodings
				else:
					SCREAMING_SNAKE_CASE      :					Union[str, Any]    =				encodings["input_ids"]
					return inputs
			def 							__UpperCamelCase       (	self							:       List[str]					,					*a							:       Optional[Any]					,					**a							:       Optional[int]		)							->				Tuple:

				"""simple docstring"""

				return self.tokenizer.batch_decode(*_lowerCAmelCase					,					**_lowerCAmelCase		)
			def 							__UpperCamelCase       (	self							:       Optional[int]					,					*a							:       int					,					**a							:       List[Any]		)							->				Union[str, Any]:

				"""simple docstring"""

				if self._in_target_context_manager:
					return self.current_processor.pad(*_lowerCAmelCase					,					**_lowerCAmelCase		)

				SCREAMING_SNAKE_CASE      :					List[str]    =				kwargs.pop("input_features"					,					_lowerCAmelCase		)
				SCREAMING_SNAKE_CASE      :					Optional[Any]    =				kwargs.pop("labels"					,					_lowerCAmelCase		)
				if len(_lowerCAmelCase		) > 0:
					SCREAMING_SNAKE_CASE      :					str    =				args[0]
					SCREAMING_SNAKE_CASE      :					Tuple    =				args[1:]

				if input_features is not None:
					SCREAMING_SNAKE_CASE      :					Any    =				self.feature_extractor.pad(_lowerCAmelCase					,					*_lowerCAmelCase					,					**_lowerCAmelCase		)
				if labels is not None:
					SCREAMING_SNAKE_CASE      :					int    =				self.tokenizer.pad(_lowerCAmelCase					,					**_lowerCAmelCase		)

				if labels is None:
					return input_features
				elif input_features is None:
					return labels
				else:
					SCREAMING_SNAKE_CASE      :					List[str]    =				labels["input_ids"]
					return input_features
			def 							__UpperCamelCase       (	self							:       Tuple					,					*a							:       Optional[Any]					,					**a							:       List[str]		)							->				int:

				"""simple docstring"""

				return self.tokenizer.decode(*_lowerCAmelCase					,					**_lowerCAmelCase		)






			@contextmanager
			def 							__UpperCamelCase       (	self							:       List[Any]		)							->				int:

				"""simple docstring"""

				warnings.warn(
				    "`as_target_processor` is deprecated and will be removed in v5 of Transformers. You can process your "
				    "labels by using the argument `text` of the regular `__call__` method (either in the same call as "
				    "your audio inputs, or in a separate call."		)
				SCREAMING_SNAKE_CASE      :					int    =				True
				SCREAMING_SNAKE_CASE      :					List[str]    =				self.tokenizer
				yield
				SCREAMING_SNAKE_CASE      :					Union[str, Any]    =				self.feature_extractor
				SCREAMING_SNAKE_CASE      :					Tuple    =				False





import sys
import webbrowser

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

if __name__ == "__main__":
   print('Googling.....')
   lowerCamelCase__ :   List[Any]					=							'https://www.google.com/search?q=' + ' '.join(sys.argv[1:])
   lowerCamelCase__ :   List[Any]					=							requests.get(url, headers={'UserAgent': UserAgent().random})
   # res.raise_for_status()
   with open('project1a.html', 'wb') as out_file:  # only for knowing the class
      for data in res.iter_content(10_000):
         out_file.write(data)
   lowerCamelCase__ :   int					=							BeautifulSoup(res.text, 'html.parser')
   lowerCamelCase__ :   List[str]					=							list(soup.select('.eZt8xd'))[:5]

   print(len(links))
   for link in links:
      if link.text == "Maps":
         webbrowser.open(link.get('href'))
      else:
         webbrowser.open(f'''https://google.com{link.get('href')}''')