'Returns True if this command is contained'

def hasCommand(self, command, hostKey, connection):

    cmd = command.lower()
    hostDef = None
    self.serverHostDefsLock.acquire()
    try:
        if (hostKey in self.serverHostDefs):
            hostDef = self.serverHostDefs[hostKey]
    finally:
        self.serverHostDefsLock.release()
    if (not hostDef):
        return False
    if ('availableCmds' in hostDef):
        return (cmd in hostDef['availableCmds'])
    availableCmds = sets.Set()
    for (field, value) in connection.admin.command('listCommands')['commands'].items():
        availableCmds.add(field.lower())
    hostDef['availableCmds'] = availableCmds
    return (cmd in hostDef['availableCmds'])
