'Return mock ismaster response (a dict) and round trip time.'

def mock_is_master(self, host):

    (min_wire_version, max_wire_version) = self.mock_wire_versions.get(host, (common.MIN_WIRE_VERSION, common.MAX_WIRE_VERSION))
    max_write_batch_size = self.mock_max_write_batch_sizes.get(host, common.MAX_WRITE_BATCH_SIZE)
    rtt = self.mock_rtts.get(host, 0)
    if (host in self.mock_down_hosts):
        raise NetworkTimeout('mock    timeout')
    elif (host in self.mock_standalones):
        response = {'ok': 1, 'ismaster': True, 'minWireVersion': min_wire_version, 'maxWireVersion': max_wire_version, 'maxWriteBatchSize': max_write_batch_size}
    elif (host in self.mock_members):
        ismaster = (host == self.mock_primary)
        response = {'ok': 1, 'ismaster': ismaster, 'secondary': (not ismaster), 'setName': 'rs', 'hosts': self.mock_ismaster_hosts, 'minWireVersion': min_wire_version, 'maxWireVersion': max_wire_version, 'maxWriteBatchSize': max_write_batch_size}
        if self.mock_primary:
            response['primary'] = self.mock_primary
    elif (host in self.mock_mongoses):
        response = {'ok': 1, 'ismaster': True, 'minWireVersion': min_wire_version, 'maxWireVersion': max_wire_version, 'msg': 'isdbgrid', 'maxWriteBatchSize': max_write_batch_size}
    else:
        raise AutoReconnect(('Unknown    host:    %s' % host))
    return (response, rtt)
