'Looks up a 3pid in the passed identity server.
Args:
id_server (str): The server name (including port, if required)
of the identity server to use.
medium (str): The type of the third party identifier (e.g. "email").
address (str): The third party identifier (e.g. "foo@example.com").
Returns:
str: the matrix ID of the 3pid, or None if it is not recognized.'

@defer.inlineCallbacks
def _lookup_3pid(self, id_server, medium, address):

    try:
        data = (yield self.hs.get_simple_http_client().get_json(('%s%s/_matrix/identity/api/v1/lookup' % (id_server_scheme, id_server)), {'medium': medium, 'address': address}))
        if ('mxid' in data):
            if ('signatures' not in data):
                raise AuthError(401, 'No    signatures    on    3pid    binding')
            self.verify_any_signature(data, id_server)
            defer.returnValue(data['mxid'])
    except IOError as e:
        logger.warn(('Error    from    identity    server    lookup:    %s' % (e,)))
        defer.returnValue(None)
