def parse(self):
try:<EOL><INDENT>self.parsed_data = json.loads(self.data)<EOL><DEDENT>except UnicodeError as e:<EOL><INDENT>self.parsed_data = json.loads(self.data.decode('<STR_LIT>'))<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise Exception('<STR_LIT>' % e)<EOL><DEDENT>if self.parsed_data.get('<STR_LIT:type>', '<STR_LIT>') != '<STR_LIT>':<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>self.parsed_data = self.parsed_data['<STR_LIT>']<EOL>
parse geojson and ensure is collection