
"""simple docstring"""




import copy
import fnmatch
import json
import os
import pickle as pkl
import shutil
import sys
import tarfile
import tempfile
from collections import OrderedDict
from contextlib import contextmanager
from functools import partial
from hashlib import shaaaa
from io import BytesIO
from pathlib import Path
from urllib.parse import urlparse
from zipfile import ZipFile, is_zipfile

import cva
import numpy as np
import requests
import wget
from filelock import FileLock
from PIL import Image
from tqdm.auto import tqdm
from yaml import Loader, dump, load


try:
			import torch

			__lowerCAmelCase    :							Dict													=						True
except ImportError:
			__lowerCAmelCase    :							Dict													=						False


try:
			from torch.hub import _get_torch_home

			__lowerCAmelCase    :							Optional[Any]													=						_get_torch_home()
except ImportError:
			__lowerCAmelCase    :							List[Any]													=						os.path.expanduser(
			    os.getenv("TORCH_HOME", os.path.join(os.getenv("XDG_CACHE_HOME", "~/.cache"), "torch"))
			)

__lowerCAmelCase    :							Optional[Any]													=						os.path.join(torch_cache_home, "transformers")

__lowerCAmelCase    :							Any													=						"https://cdn.huggingface.co"
__lowerCAmelCase    :							Tuple													=						"https://s3.amazonaws.com/models.huggingface.co/bert"
__lowerCAmelCase    :							List[Any]													=						"/".join(str(Path(__file__).resolve()).split("/")[:-1])
__lowerCAmelCase    :							Any													=						os.path.join(PATH, "config.yaml")
__lowerCAmelCase    :							Union[str, Any]													=						os.path.join(PATH, "attributes.txt")
__lowerCAmelCase    :							List[str]													=						os.path.join(PATH, "objects.txt")
__lowerCAmelCase    :							int													=						os.getenv("PYTORCH_PRETRAINED_BERT_CACHE", default_cache_path)
__lowerCAmelCase    :							Union[str, Any]													=						os.getenv("PYTORCH_TRANSFORMERS_CACHE", PYTORCH_PRETRAINED_BERT_CACHE)
__lowerCAmelCase    :							Tuple													=						os.getenv("TRANSFORMERS_CACHE", PYTORCH_TRANSFORMERS_CACHE)
__lowerCAmelCase    :							Optional[Any]													=						"pytorch_model.bin"
__lowerCAmelCase    :							Any													=						"config.yaml"







def 							_UpperCAmelCase		(       lowerCamelCase__=OBJECTS			,  lowerCamelCase__=ATTRIBUTES     ):





		"""simple docstring"""




		lowerCAmelCase__        =   []
		with open(lowerCamelCase__     ) as f:
				for object in f.readlines():
						vg_classes.append(object.split(""","""     )[0].lower().strip()     )

		lowerCAmelCase__        =   []
		with open(lowerCamelCase__     ) as f:
				for object in f.readlines():
						vg_attrs.append(object.split(""","""     )[0].lower().strip()     )
		return vg_classes, vg_attrs







def 							_UpperCAmelCase		(       lowerCamelCase__     ):





		"""simple docstring"""




		lowerCAmelCase__        =   OrderedDict()
		with open(lowerCamelCase__			,  """rb"""     ) as f:
				lowerCAmelCase__        =   pkl.load(lowerCamelCase__     )["""model"""]
		for k in copy.deepcopy(list(ckp.keys()     )     ):
				lowerCAmelCase__        =   ckp.pop(lowerCamelCase__     )
				if isinstance(lowerCamelCase__			,  np.ndarray     ):
						lowerCAmelCase__        =   torch.tensor(lowerCamelCase__     )
				else:
						assert isinstance(lowerCamelCase__			,  torch.tensor     ), type(lowerCamelCase__     )
				lowerCAmelCase__        =   v
		return r

class       a_      :
					UpperCamelCase_ :	List[str]			=    {}




					def __init__(	self						:     Tuple  ,						snake_case__						:     dict  ,						snake_case__						:     str = "root"  ,						snake_case__						:     int=0     ):
							lowerCAmelCase__        =   name
							lowerCAmelCase__        =   level
							lowerCAmelCase__        =   {}
							for k, v in dictionary.items():
									if v is None:
											raise ValueError()
									lowerCAmelCase__        =   copy.deepcopy(snake_case__     )
									lowerCAmelCase__        =   copy.deepcopy(snake_case__     )
									if isinstance(snake_case__  ,						snake_case__     ):
											lowerCAmelCase__        =   Config(snake_case__  ,						name=snake_case__  ,						level=level + 1     )
									lowerCAmelCase__        =   v
									setattr(self  ,						snake_case__  ,						snake_case__     )

							lowerCAmelCase__        =   d




					def __repr__(	self						:     Optional[Any]     ):
							return str(list((self._pointer.keys())     )     )




					def __setattr__(	self						:     Optional[Any]  ,						snake_case__						:     Optional[int]  ,						snake_case__						:     Dict     ):
							lowerCAmelCase__        =   val
							lowerCAmelCase__        =   val
							lowerCAmelCase__        =   key.split("""."""     )
							lowerCAmelCase__        =   len(snake_case__     ) - 1
							lowerCAmelCase__        =   self._pointer
							if len(snake_case__     ) > 1:
									for i, l in enumerate(snake_case__     ):
											if hasattr(self  ,						snake_case__     ) and isinstance(getattr(self  ,						snake_case__     )  ,						snake_case__     ):
													setattr(getattr(self  ,						snake_case__     )  ,						""".""".join(levels[i:]     )  ,						snake_case__     )
											if l == last_level:
													lowerCAmelCase__        =   val
											else:
													lowerCAmelCase__        =   pointer[l]




					def 						_SCREAMING_SNAKE_CASE						(	self						:     int     ):
							return self._pointer




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Dict  ,						snake_case__						:     Dict  ,						snake_case__						:     Tuple     ):
							with open(F"""{file_name}"""  ,						"""w"""     ) as stream:
									dump(snake_case__  ,						snake_case__     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Optional[Any]  ,						snake_case__						:     List[Any]  ,						snake_case__						:     List[str]     ):
							with open(F"""{file_name}"""  ,						"""w"""     ) as stream:
									json.dump(snake_case__  ,						snake_case__     )




					@staticmethod
					def 						_SCREAMING_SNAKE_CASE						(	snake_case__						:     List[Any]     ):
							with open(snake_case__     ) as stream:
									lowerCAmelCase__        =   load(snake_case__  ,						Loader=snake_case__     )
							return data




					def __str__(	self						:     Any     ):
							lowerCAmelCase__        =   """    """
							if self._name != "root":
									lowerCAmelCase__        =   F"""{t * (self._level-1)}{self._name}:\n"""
							else:
									lowerCAmelCase__        =   """"""
							lowerCAmelCase__        =   self._level
							for i, (k, v) in enumerate(self._pointer.items()     ):
									if isinstance(snake_case__  ,						snake_case__     ):
											r += F"""{t * (self._level)}{v}\n"""
											self._level += 1
									else:
											r += F"""{t * (self._level)}{k}: {v} ({type(snake_case__     ).__name__})\n"""
									lowerCAmelCase__        =   level
							return r[:-1]




					@classmethod
					def 						_SCREAMING_SNAKE_CASE						(	cls						:     Any  ,						snake_case__						:     str  ,						**snake_case__						:     Optional[int]     ):
							lowerCAmelCase__   ,					lowerCAmelCase__        =   cls.get_config_dict(snake_case__  ,						**snake_case__     )
							return cls(snake_case__     )




					@classmethod
					def 						_SCREAMING_SNAKE_CASE						(	cls						:     Dict  ,						snake_case__						:     str  ,						**snake_case__						:     Optional[Any]     ):
							lowerCAmelCase__        =   kwargs.pop("""cache_dir"""  ,						snake_case__     )
							lowerCAmelCase__        =   kwargs.pop("""force_download"""  ,						snake_case__     )
							lowerCAmelCase__        =   kwargs.pop("""resume_download"""  ,						snake_case__     )
							lowerCAmelCase__        =   kwargs.pop("""proxies"""  ,						snake_case__     )
							lowerCAmelCase__        =   kwargs.pop("""local_files_only"""  ,						snake_case__     )

							if os.path.isdir(snake_case__     ):
									lowerCAmelCase__        =   os.path.join(snake_case__  ,						snake_case__     )
							elif os.path.isfile(snake_case__     ) or is_remote_url(snake_case__     ):
									lowerCAmelCase__        =   pretrained_model_name_or_path
							else:
									lowerCAmelCase__        =   hf_bucket_url(snake_case__  ,						filename=snake_case__  ,						use_cdn=snake_case__     )

							try:
									# Load from URL or cache if already cached
									lowerCAmelCase__        =   cached_path(
									    snake_case__  ,						cache_dir=snake_case__  ,						force_download=snake_case__  ,						proxies=snake_case__  ,						resume_download=snake_case__  ,						local_files_only=snake_case__  ,						)
									# Load config dict
									if resolved_config_file is None:
											raise EnvironmentError

									lowerCAmelCase__        =   Config.load_yaml(snake_case__     )

							except EnvironmentError:
									lowerCAmelCase__        =   """Can't load config for"""
									raise EnvironmentError(snake_case__     )

							if resolved_config_file == config_file:
									print("""loading configuration file from path"""     )
							else:
									print("""loading configuration file cache"""     )

							return Config.load_yaml(snake_case__     ), kwargs







def 							_UpperCAmelCase		(       lowerCamelCase__     ):





		"""simple docstring"""




		lowerCAmelCase__        =   torch.load("""dump.pt"""			,  map_location=in_tensor.device     )
		lowerCAmelCase__        =   in_tensor.numpy()
		lowerCAmelCase__        =   out_tensor.numpy()[0]
		print(na.shape			,  na[0, 0, :5]     )
		print(na.shape			,  na[0, 0, :5]     )
		assert np.allclose(lowerCamelCase__			,  lowerCamelCase__			,  rtol=0.01			,  atol=0.1     ), (
		    f"""{sum([1 for x in np.isclose(lowerCamelCase__			,  lowerCamelCase__			,  rtol=0.01			,  atol=0.1     ).flatten() if x is False]     )/len(na.flatten()     )*100:.4f} %"""
		    " element-wise mismatch"
		)
		raise Exception("""tensors are all good"""     )

		# Hugging face functions below







def 							_UpperCAmelCase		(       lowerCamelCase__     ):





		"""simple docstring"""




		lowerCAmelCase__        =   urlparse(lowerCamelCase__     )
		return parsed.scheme in ("http", "https")







def 							_UpperCAmelCase		(       lowerCamelCase__			,  lowerCamelCase__			,  lowerCamelCase__=True     ):





		"""simple docstring"""




		lowerCAmelCase__        =   CLOUDFRONT_DISTRIB_PREFIX if use_cdn else S3_BUCKET_PREFIX
		lowerCAmelCase__        =   """/""" not in model_id
		if legacy_format:
				return f"""{endpoint}/{model_id}-{filename}"""
		else:
				return f"""{endpoint}/{model_id}/{filename}"""







def 							_UpperCAmelCase		(       lowerCamelCase__			,  lowerCamelCase__			,  lowerCamelCase__=None			,  lowerCamelCase__=0			,  lowerCamelCase__=None			,  ):





		"""simple docstring"""




		lowerCAmelCase__        =   """python/{}""".format(sys.version.split()[0]     )
		if _torch_available:
				ua += "; torch/{}".format(torch.__version__     )
		if isinstance(lowerCamelCase__			,  lowerCamelCase__     ):
				ua += "; " + "; ".join("""{}/{}""".format(lowerCamelCase__			,  lowerCamelCase__     ) for k, v in user_agent.items()     )
		elif isinstance(lowerCamelCase__			,  lowerCamelCase__     ):
				ua += "; " + user_agent
		lowerCAmelCase__        =   {"""user-agent""": ua}
		if resume_size > 0:
				lowerCAmelCase__        =   """bytes=%d-""" % (resume_size,)
		lowerCAmelCase__        =   requests.get(lowerCamelCase__			,  stream=lowerCamelCase__			,  proxies=lowerCamelCase__			,  headers=lowerCamelCase__     )
		if response.status_code == 416:  # Range not satisfiable
				return
		lowerCAmelCase__        =   response.headers.get("""Content-Length"""     )
		lowerCAmelCase__        =   resume_size + int(lowerCamelCase__     ) if content_length is not None else None
		lowerCAmelCase__        =   tqdm(
		    unit="""B"""			,  unit_scale=lowerCamelCase__			,  total=lowerCamelCase__			,  initial=lowerCamelCase__			,  desc="""Downloading"""			,  )
		for chunk in response.iter_content(chunk_size=1024     ):
				if chunk:  # filter out keep-alive new chunks
						progress.update(len(lowerCamelCase__     )     )
						temp_file.write(lowerCamelCase__     )
		progress.close()







def 							_UpperCAmelCase		(       lowerCamelCase__			,  lowerCamelCase__=None			,  lowerCamelCase__=False			,  lowerCamelCase__=None			,  lowerCamelCase__=10			,  lowerCamelCase__=False			,  lowerCamelCase__=None			,  lowerCamelCase__=False			,  ):





		"""simple docstring"""




		if cache_dir is None:
				lowerCAmelCase__        =   TRANSFORMERS_CACHE
		if isinstance(lowerCamelCase__			,  lowerCamelCase__     ):
				lowerCAmelCase__        =   str(lowerCamelCase__     )

		os.makedirs(lowerCamelCase__			,  exist_ok=lowerCamelCase__     )

		lowerCAmelCase__        =   None
		if not local_files_only:
				try:
						lowerCAmelCase__        =   requests.head(lowerCamelCase__			,  allow_redirects=lowerCamelCase__			,  proxies=lowerCamelCase__			,  timeout=lowerCamelCase__     )
						if response.status_code == 200:
								lowerCAmelCase__        =   response.headers.get("""ETag"""     )
				except (EnvironmentError, requests.exceptions.Timeout):
						# etag is already None
						pass

		lowerCAmelCase__        =   url_to_filename(lowerCamelCase__			,  lowerCamelCase__     )

		# get cache path to put the file
		lowerCAmelCase__        =   os.path.join(lowerCamelCase__			,  lowerCamelCase__     )

		# etag is None = we don't have a connection, or url doesn't exist, or is otherwise inaccessible.
		# try to get the last downloaded one
		if etag is None:
				if os.path.exists(lowerCamelCase__     ):
						return cache_path
				else:
						lowerCAmelCase__        =   [
						    file
						    for file in fnmatch.filter(os.listdir(lowerCamelCase__     )			,  filename + """.*"""     )
						    if not file.endswith(""".json"""     ) and not file.endswith(""".lock"""     )
						]
						if len(lowerCamelCase__     ) > 0:
								return os.path.join(lowerCamelCase__			,  matching_files[-1]     )
						else:
								# If files cannot be found and local_files_only=True,
								# the models might've been found if local_files_only=False
								# Notify the user about that
								if local_files_only:
										raise ValueError(
										    """Cannot find the requested files in the cached path and outgoing traffic has been"""
										    """ disabled. To enable model look-ups and downloads online, set 'local_files_only'"""
										    """ to False."""     )
								return None

    # From now on, etag is not None.
		if os.path.exists(lowerCamelCase__     ) and not force_download:
				return cache_path

		# Prevent parallel downloads of the same file with a lock.
		lowerCAmelCase__        =   cache_path + """.lock"""
		with FileLock(lowerCamelCase__     ):
				# If the download just completed while the lock was activated.
				if os.path.exists(lowerCamelCase__     ) and not force_download:
						# Even if returning early like here, the lock will be released.
						return cache_path

				if resume_download:
						lowerCAmelCase__        =   cache_path + """.incomplete"""

						@contextmanager
						def _resumable_file_manager():
								with open(lowerCamelCase__			,  """a+b"""     ) as f:
										yield f

						lowerCAmelCase__        =   _resumable_file_manager
						if os.path.exists(lowerCamelCase__     ):
								lowerCAmelCase__        =   os.stat(lowerCamelCase__     ).st_size
						else:
								lowerCAmelCase__        =   0
				else:
						lowerCAmelCase__        =   partial(tempfile.NamedTemporaryFile			,  dir=lowerCamelCase__			,  delete=lowerCamelCase__     )
						lowerCAmelCase__        =   0

				# Download to temporary file, then copy to cache dir once finished.
				# Otherwise you get corrupt cache entries if the download gets interrupted.
				with temp_file_manager() as temp_file:
						print(
						    """%s not found in cache or force_download set to True, downloading to %s"""			,  lowerCamelCase__			,  temp_file.name			,  )

						http_get(
						    lowerCamelCase__			,  lowerCamelCase__			,  proxies=lowerCamelCase__			,  resume_size=lowerCamelCase__			,  user_agent=lowerCamelCase__			,  )

				os.replace(temp_file.name			,  lowerCamelCase__     )

				lowerCAmelCase__        =   {"""url""": url, """etag""": etag}
				lowerCAmelCase__        =   cache_path + """.json"""
				with open(lowerCamelCase__			,  """w"""     ) as meta_file:
						json.dump(lowerCamelCase__			,  lowerCamelCase__     )

		return cache_path







def 							_UpperCAmelCase		(       lowerCamelCase__			,  lowerCamelCase__=None     ):





		"""simple docstring"""




		lowerCAmelCase__        =   url.encode("""utf-8"""     )
		lowerCAmelCase__        =   shaaaa(lowerCamelCase__     )
		lowerCAmelCase__        =   url_hash.hexdigest()

		if etag:
				lowerCAmelCase__        =   etag.encode("""utf-8"""     )
				lowerCAmelCase__        =   shaaaa(lowerCamelCase__     )
				filename += "." + etag_hash.hexdigest()

		if url.endswith(""".h5"""     ):
				filename += ".h5"

		return filename







def 							_UpperCAmelCase		(       lowerCamelCase__			,  lowerCamelCase__=None			,  lowerCamelCase__=False			,  lowerCamelCase__=None			,  lowerCamelCase__=False			,  lowerCamelCase__=None			,  lowerCamelCase__=False			,  lowerCamelCase__=False			,  lowerCamelCase__=False			,  ):





		"""simple docstring"""




		if cache_dir is None:
				lowerCAmelCase__        =   TRANSFORMERS_CACHE
		if isinstance(lowerCamelCase__			,  lowerCamelCase__     ):
				lowerCAmelCase__        =   str(lowerCamelCase__     )
		if isinstance(lowerCamelCase__			,  lowerCamelCase__     ):
				lowerCAmelCase__        =   str(lowerCamelCase__     )

		if is_remote_url(lowerCamelCase__     ):
				# URL, so get it from the cache (downloading if necessary)
				lowerCAmelCase__        =   get_from_cache(
				    lowerCamelCase__			,  cache_dir=lowerCamelCase__			,  force_download=lowerCamelCase__			,  proxies=lowerCamelCase__			,  resume_download=lowerCamelCase__			,  user_agent=lowerCamelCase__			,  local_files_only=lowerCamelCase__			,  )
		elif os.path.exists(lowerCamelCase__     ):
				# File, and it exists.
				lowerCAmelCase__        =   url_or_filename
		elif urlparse(lowerCamelCase__     ).scheme == "":
				# File, but it doesn't exist.
				raise EnvironmentError("""file {} not found""".format(lowerCamelCase__     )     )
		else:
				# Something unknown
				raise ValueError("""unable to parse {} as a URL or as a local path""".format(lowerCamelCase__     )     )

		if extract_compressed_file:
				if not is_zipfile(lowerCamelCase__     ) and not tarfile.is_tarfile(lowerCamelCase__     ):
						return output_path

				# Path where we extract compressed archives
				# We avoid '.' in dir name and add "-extracted" at the end: "./model.zip" => "./model-zip-extracted/"
				lowerCAmelCase__   ,					lowerCAmelCase__        =   os.path.split(lowerCamelCase__     )
				lowerCAmelCase__        =   output_file.replace("""."""			,  """-"""     ) + """-extracted"""
				lowerCAmelCase__        =   os.path.join(lowerCamelCase__			,  lowerCamelCase__     )

				if os.path.isdir(lowerCamelCase__     ) and os.listdir(lowerCamelCase__     ) and not force_extract:
						return output_path_extracted

				# Prevent parallel extractions
				lowerCAmelCase__        =   output_path + """.lock"""
				with FileLock(lowerCamelCase__     ):
						shutil.rmtree(lowerCamelCase__			,  ignore_errors=lowerCamelCase__     )
						os.makedirs(lowerCamelCase__     )
						if is_zipfile(lowerCamelCase__     ):
								with ZipFile(lowerCamelCase__			,  """r"""     ) as zip_file:
										zip_file.extractall(lowerCamelCase__     )
										zip_file.close()
						elif tarfile.is_tarfile(lowerCamelCase__     ):
								lowerCAmelCase__        =   tarfile.open(lowerCamelCase__     )
								tar_file.extractall(lowerCamelCase__     )
								tar_file.close()
						else:
								raise EnvironmentError("""Archive format of {} could not be identified""".format(lowerCamelCase__     )     )

				return output_path_extracted

		return output_path







def 							_UpperCAmelCase		(       lowerCamelCase__			,  lowerCamelCase__=","     ):





		"""simple docstring"""




		assert isinstance(lowerCamelCase__			,  lowerCamelCase__     )
		if os.path.isfile(lowerCamelCase__     ):
				with open(lowerCamelCase__     ) as f:
						lowerCAmelCase__        =   eval(f.read()     )
		else:
				lowerCAmelCase__        =   requests.get(lowerCamelCase__     )
				try:
						lowerCAmelCase__        =   requests.json()
				except Exception:
						lowerCAmelCase__        =   req.content.decode()
						assert data is not None, "could not connect"
						try:
								lowerCAmelCase__        =   eval(lowerCamelCase__     )
						except Exception:
								lowerCAmelCase__        =   data.split("""\n"""     )
				req.close()
		return data







def 							_UpperCAmelCase		(       lowerCamelCase__     ):





		"""simple docstring"""




		lowerCAmelCase__        =   requests.get(lowerCamelCase__     )
		lowerCAmelCase__        =   np.array(Image.open(BytesIO(response.content     )     )     )
		return img







def 							_UpperCAmelCase		(       lowerCamelCase__     ):





		"""simple docstring"""




		lowerCAmelCase__        =   url.split("""/"""     )[-1]
		if fn not in os.listdir(os.getcwd()     ):
				wget.download(lowerCamelCase__     )
		with open(lowerCamelCase__			,  """rb"""     ) as stream:
				lowerCAmelCase__        =   pkl.load(lowerCamelCase__     )
		lowerCAmelCase__        =   weights.pop("""model"""     )
		lowerCAmelCase__        =   {}
		for k, v in model.items():
				lowerCAmelCase__        =   torch.from_numpy(lowerCamelCase__     )
				if "running_var" in k:
						lowerCAmelCase__        =   torch.tensor([0]     )
						lowerCAmelCase__        =   k.replace("""running_var"""			,  """num_batches_tracked"""     )
						lowerCAmelCase__        =   zero
		return new







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




		print(f"""{os.path.abspath(os.path.join(lowerCamelCase__			,  os.pardir     )     )}/demo.ipynb"""     )







def 							_UpperCAmelCase		(       lowerCamelCase__			,  lowerCamelCase__="RGB"     ):





		"""simple docstring"""




		assert isinstance(lowerCamelCase__			,  lowerCamelCase__     )
		if os.path.isfile(lowerCamelCase__     ):
				lowerCAmelCase__        =   cva.imread(lowerCamelCase__     )
		else:
				lowerCAmelCase__        =   get_image_from_url(lowerCamelCase__     )
				assert img is not None, f"""could not connect to: {im}"""
		lowerCAmelCase__        =   cva.cvtColor(lowerCamelCase__			,  cva.COLOR_BGR2RGB     )
		if input_format == "RGB":
				lowerCAmelCase__        =   img[:, :, ::-1]
		return img







def 							_UpperCAmelCase		(       lowerCamelCase__			,  lowerCamelCase__=1     ):





		"""simple docstring"""




		return (images[i : i + batch] for i in range(0			,  len(lowerCamelCase__     )			,  lowerCamelCase__     ))





"""simple docstring"""




import os
from math import logaa







def 							_UpperCAmelCase		(       lowerCamelCase__ = "base_exp.txt"     ):





		"""simple docstring"""




		lowerCAmelCase__        =   0
		lowerCAmelCase__        =   0
		for i, line in enumerate(open(os.path.join(os.path.dirname(lowerCamelCase__     )			,  lowerCamelCase__     )     )     ):
				lowerCAmelCase__   ,					lowerCAmelCase__        =   list(map(lowerCamelCase__			,  line.split(""","""     )     )     )
				if x * logaa(lowerCamelCase__     ) > largest:
						lowerCAmelCase__        =   x * logaa(lowerCamelCase__     )
						lowerCAmelCase__        =   i + 1
		return result


if __name__ == "__main__":
			print(solution())




