Best Python code snippet using localstack_python
balance_sheet_statements.py
Source:balance_sheet_statements.py
...35 @classmethod36 def process_response(cls, response: Dict, isin: str) -> Base:37 record = {38 'isin': isin,39 'report_date': datetime.fromtimestamp(get_nested(response, 'endDate', 'raw')).date(),40 'cash': get_nested(response, 'cash', 'raw'),41 'short_term_investments': get_nested(response, 'shortTermInvestments', 'raw'),42 'net_receivables': get_nested(response, 'netReceivables', 'raw'),43 'total_current_assets': get_nested(response, 'totalCurrentAssets', 'raw'),44 'property_plant_equipment': get_nested(response, 'propertyPlantEquipment', 'raw'),45 'intangible_assets': get_nested(response, 'intangibleAssets', 'raw'),46 'other_assets': get_nested(response, 'otherAssets', 'raw'),47 'deferred_long_term_asset_charges': get_nested(response, 'deferredLongTermAssetCharges', 'raw'),48 'total_assets': get_nested(response, 'totalAssets', 'raw'),49 'accounts_payable': get_nested(response, 'accountsPayable', 'raw'),50 'short_long_term_debt': get_nested(response, 'shortLongTermDebt', 'raw'),51 'other_current_liab': get_nested(response, 'otherCurrentLiab', 'raw'),52 'long_term_debt': get_nested(response, 'longTermDebt', 'raw'),53 'other_liab': get_nested(response, 'otherLiab', 'raw'),54 'deferred_long_term_liab': get_nested(response, 'deferredLongTermLiab', 'raw'),55 'total_current_liabilities': get_nested(response, 'totalCurrentLiabilities', 'raw'),56 'total_liab': get_nested(response, 'totalLiab', 'raw'),57 'common_stock': get_nested(response, 'commonStock', 'raw'),58 'retained_earnings': get_nested(response, 'retainedEarnings', 'raw'),59 'treasury_stock': get_nested(response, 'treasuryStock', 'raw'),60 'other_stockholder_equity': get_nested(response, 'otherStockholderEquity', 'raw'),61 'total_stockholder_equity': get_nested(response, 'totalStockholderEquity', 'raw'),62 'net_tangible_assets': get_nested(response, 'netTangibleAssets', 'raw')63 }64 result: Base = cls(**record)...
converters.py
Source:converters.py
...10 def __init__(self, data):11 self.data = data12 def get_converted_data(self) -> list:13 if (14 get_nested(self.data, "event.status.name") == self._allowed_status_name15 and get_nested(self.data, "event.type") == self._allowed_type16 ):17 return [18 str(datetime.datetime.today().strftime("%d.%m.%Y %H:%M")),19 get_nested(self.data, "event.applicant.first_name"),20 get_nested(self.data, "event.applicant.last_name"),21 get_nested(self.data, "event.applicant.middle_name"),22 get_nested(self.data, "author.name"),23 self._get_vacancy_info("account_info.name"),24 self._get_account_division(),25 self._get_vacancy_url(),26 self._get_vacancy_category(),27 self._get_applicant_source(),28 self._get_status(),29 ]30 else:31 return []32 def _get_account_division(self):33 try:34 return get_nested(self.data, "event.vacancy.account_division.name")35 except TypeError:36 return get_nested(self.data, "event.vacancy.company")37 def _get_vacancy_url(self):38 nick = self._connector.get_account_nick(get_nested(self.data, "account.id"))39 return "{url}{vacancy_id}/filter/workon/id/{applicant_id}".format(40 url=self._base_url.format(nick=nick),41 vacancy_id=str(get_nested(self.data, "event.vacancy.id")),42 applicant_id=str(get_nested(self.data, "event.applicant.id")),43 )44 def _get_applicant_source(self):45 account_id = get_nested(self.data, "account.id")46 applicant_id = get_nested(self.data, "event.applicant.id")47 name = self._connector.get_applicant_source(account_id, applicant_id)48 return name49 def _get_status(self):50 account_id = get_nested(self.data, "account.id")51 applicant_id = get_nested(self.data, "event.applicant.id")52 return self._connector.get_applicant_status(account_id, applicant_id)53 def _get_vacancy_info(self, attr_name):54 account_id = get_nested(self.data, "account.id")55 vacancy_id = get_nested(self.data, "event.vacancy.id")56 return self._connector.get_vacancy_info(account_id, vacancy_id, attr_name)57 def _get_vacancy_category(self):58 try:59 return get_nested(self.data, "event.vacancy.category.name")60 except KeyError:...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!