@classmethod<EOL><INDENT>def deserialize(cls, value):<DEDENT>
parsed = json.loads(value)<EOL>if "<STR_LIT:name>" not in parsed:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if "<STR_LIT>" not in parsed:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if "<STR_LIT:port>" not in parsed:<EOL><INDENT>parsed["<STR_LIT:port>"] = DEFAULT_PEER_PORT<EOL><DEDENT>return cls(parsed["<STR_LIT:name>"], parsed["<STR_LIT>"], parsed["<STR_LIT:port>"])<EOL>
Generates a Peer instance via a JSON string of the sort generated
by `Peer.deserialize`.

The `name` and `ip` keys are required to be present in the JSON map,
if the `port` key is not present the default is used.