






'''simple docstring'''

import re

from flax.core.frozen_dict import freeze
from flax.traverse_util import flatten_dict, unflatten_dict
from jax.experimental import PartitionSpec as P


# Sentinels
SCREAMING_SNAKE_CASE__      =   object()

# For specifying empty leaf dict `{}`
SCREAMING_SNAKE_CASE__      =   object()







def     lowercase__ (      __UpperCamelCase		,						__UpperCamelCase    )-> Union[str, Any]:
      UpperCamelCase				  =					tuple((re.compile(x + """$"""    ) for x in qs)    )
      for i in range(len(UpperCamelCase_    ) - len(UpperCamelCase_    ) + 1    ):
            UpperCamelCase				  =					[x.match(UpperCamelCase_    ) for x, y in zip(UpperCamelCase_		,						ks[i:]    )]
            if matches and all(UpperCamelCase_    ):
                  return True
      return False







def     lowercase__ (      __UpperCamelCase    )-> Optional[int]:
      def replace(__UpperCamelCase		,						__UpperCamelCase    ):
            for rule, replacement in rules:
                  if _match(UpperCamelCase_		,						UpperCamelCase_    ):
                        return replacement
            return val

      return replace







def     lowercase__ (      )-> Optional[int]:
      return [
          # embeddings
          (("transformer", "wpe", "embedding"), P("""mp"""		,						UpperCamelCase_    )),
          (("transformer", "wte", "embedding"), P("""mp"""		,						UpperCamelCase_    )),
          # atention
          (("attention", "(q_proj|k_proj|v_proj)", "kernel"), P(UpperCamelCase_		,						"""mp"""    )),
          (("attention", "out_proj", "kernel"), P("""mp"""		,						UpperCamelCase_    )),
          (("attention", "out_proj", "bias"), None),
          # mlp
          (("mlp", "c_fc", "kernel"), P(UpperCamelCase_		,						"""mp"""    )),
          (("mlp", "c_fc", "bias"), P("""mp"""    )),
          (("mlp", "c_proj", "kernel"), P("""mp"""		,						UpperCamelCase_    )),
          (("mlp", "c_proj", "bias"), None),
          # layer norms
          ((r"ln_\d+", "bias"), None),
          ((r"\d+", r"ln_\d+", "scale"), None),
          (("ln_f", "bias"), None),
          (("ln_f", "scale"), None),
      ]







def     lowercase__ (      __UpperCamelCase    )-> List[str]:
      UpperCamelCase				  =					_get_partition_rules()
      UpperCamelCase				  =					_replacement_rules(UpperCamelCase_    )
      UpperCamelCase				  =					{k: _unmatched for k in flatten_dict(UpperCamelCase_    )}
      UpperCamelCase				  =					{k: replace(UpperCamelCase_		,						UpperCamelCase_    ) for k, v in initd.items()}
      assert _unmatched not in result.values(), "Incomplete partition spec."
      return freeze(unflatten_dict(UpperCamelCase_    )    )


"""simple docstring"""





import requests
from bsa import BeautifulSoup



def 						_lowerCAmelCase				(				UpperCamelCase_ = "AAPL"				):
		__SCREAMING_SNAKE_CASE            = f"https://in.finance.yahoo.com/quote/{symbol}?s={symbol}"
		__SCREAMING_SNAKE_CASE            = BeautifulSoup(requests.get(UpperCamelCase_				).text  ,				"""html.parser"""				)
		__SCREAMING_SNAKE_CASE            = """My(6px) Pos(r) smartphone_Mt(6px)"""
		return soup.find("""div"""  ,				class_=class_				).find("""span"""				).text


if __name__ == "__main__":
							for symbol in "AAPL AMZN IBM GOOG MSFT ORCL".split():
														print(F"""Current {symbol:<4} stock price is {stock_price(symbol):>8}""")




