Best Python code snippet using localstack_python
parsers.py
Source:parsers.py
...261 if 'location' in member_shape.serialization:262 # All members with locations have already been handled,263 # so we don't need to parse these members.264 continue265 xml_name = self._member_key_name(member_shape, member_name)266 member_node = xml_dict.get(xml_name)267 if member_node is not None:268 parsed[member_name] = self._parse_shape(269 member_shape, member_node)270 elif member_shape.serialization.get('xmlAttribute'):271 attribs = {}272 location_name = member_shape.serialization['name']273 for key, value in node.attrib.items():274 new_key = self._namespace_re.sub(275 location_name.split(':')[0] + ':', key)276 attribs[new_key] = value277 if location_name in attribs:278 parsed[member_name] = attribs[location_name]279 return parsed280 def _member_key_name(self, shape, member_name):281 # This method is needed because we have to special case flattened list282 # with a serialization name. If this is the case we use the283 # locationName from the list's member shape as the key name for the284 # surrounding structure.285 if shape.type_name == 'list' and shape.serialization.get('flattened'):286 list_member_serialized_name = shape.member.serialization.get(287 'name')288 if list_member_serialized_name is not None:289 return list_member_serialized_name290 serialized_name = shape.serialization.get('name')291 if serialized_name is not None:292 return serialized_name293 return member_name294 def _build_name_to_xml_node(self, parent_node):...
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!!