


import requests
from bsa import BeautifulSoup




def    a__    (		snake_case__					:							str = "AAPL"     ):
  _UpperCAmelCase		:							Optional[int]							=     f'''https://in.finance.yahoo.com/quote/{symbol}?s={symbol}'''
  _UpperCAmelCase		:							Union[str, Any]							=     BeautifulSoup(requests.get(snake_case__     ).text						,   """html.parser"""     )
  _UpperCAmelCase		:							Dict							=     """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}')









import copy
from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import ClassLabel, Features, Image
from .base import TaskTemplate


@dataclass(frozen=A     )
class 		_SCREAMING_SNAKE_CASE     (						A     ):
     __SCREAMING_SNAKE_CASE     					=    field(default='''image-classification'''							,	metadata={'''include_in_asdict_even_if_is_default''': True}     )
     __SCREAMING_SNAKE_CASE     					=    Features({'''image''': Image()}     )
     __SCREAMING_SNAKE_CASE     					=    Features({'''labels''': ClassLabel}     )
     __SCREAMING_SNAKE_CASE     					=    "image"
     __SCREAMING_SNAKE_CASE     					=    "labels"


     def        __snake_case(  self							,					A_    ):
       if self.label_column not in features:
         raise ValueError(F'''Column {self.label_column} is not present in features.'''    )
       if not isinstance(features[self.label_column]							,					A_    ):
         raise ValueError(F'''Column {self.label_column} is not a ClassLabel.'''    )
       _UpperCAmelCase		:							Tuple							=     copy.deepcopy(self    )
       _UpperCAmelCase		:							str							=     self.label_schema.copy()
       _UpperCAmelCase		:							Optional[Any]							=     features[self.label_column]
       _UpperCAmelCase		:							int							=     label_schema
       return task_template




     @property
     def        __snake_case(  self    ):
       return {
           self.image_column: "image",
           self.label_column: "labels",
       }





