@classmethod<EOL><INDENT>def from_json(cls, data):<DEDENT>
optional_keys = ('<STR_LIT>', '<STR_LIT:state>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT:source>')<EOL>for key in optional_keys:<EOL><INDENT>if key not in data:<EOL><INDENT>data[key] = None<EOL><DEDENT><DEDENT>return cls(data['<STR_LIT>'], data['<STR_LIT:state>'], data['<STR_LIT>'], data['<STR_LIT>'],<EOL>data['<STR_LIT>'], data['<STR_LIT>'], data['<STR_LIT>'],<EOL>data['<STR_LIT>'], data['<STR_LIT:source>'])<EOL>
Create a location from a dictionary.

        Args:
            data: {
            "city": "-",
            "latitude": 0,
            "longitude": 0,
            "time_zone": 0,
            "elevation": 0}