def METHOD_NAME(self, keyword_id):
    try:
        keyword = Keyword.objects.get(id=keyword_id)
    except Keyword.DoesNotExist:
        raise CommandError('keyword "%s" does not exist' % keyword_id)
    return keyword