Best Python code snippet using localstack_python
scaffold.py
Source:scaffold.py
...73 return [shape.key.name, shape.value.name]74 return []75 def _print_structure_declaration(self, output, doc=True, quote_types=False):76 if self.is_exception:77 self._print_as_class(output, "ServiceException", doc)78 return79 if any(map(is_keyword, self.shape.members.keys())):80 self._print_as_typed_dict(output)81 return82 if self.is_request:83 base = "ServiceRequest"84 else:85 base = "TypedDict, total=False"86 self._print_as_class(output, base, doc, quote_types)87 def _print_as_class(self, output, base: str, doc=True, quote_types=False):88 output.write(f"class {self.shape.name}({base}):\n")89 q = '"' if quote_types else ""90 if doc:91 self.print_shape_doc(output, self.shape)92 if not self.shape.members:93 output.write(" pass\n")94 for k, v in self.shape.members.items():95 if k in self.shape.required_members:96 output.write(f" {k}: {q}{v.name}{q}\n")97 else:98 output.write(f" {k}: Optional[{q}{v.name}{q}]\n")99 def _print_as_typed_dict(self, output, doc=True, quote_types=False):100 name = self.shape.name101 q = '"' if quote_types else ""...
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!!