human
Complete this python program:
def get_mongo_client(host, port=27017):
assistant
#Here is the Python program you requested.

    """Returns a ``Deferred`` which fires with a ``MongoClient`` when one has been
    created.
    See http://api.mongodb.org/python/current/api/pymongo/mongo_client.html#
    pymongo.mongo_client.MongoClient
    for more parameter information.
    :param bytes host: Hostname or IP address of the instance to connect to.
    :param int port: Port number on which to connect.
    The tutorial says "If you get a connection refused error try again after a
    few seconds; the application might take some time to fully start up."
    and so here we wait until the client can be created.
    """
    def create_mongo_client():
        try:
            client = MongoClient(host=host, port=port)
            client.areyoualive.posts.insert({'ping': 1})
            return client
        except PyMongoError:
            return False
    d = loop_until(reactor, create_mongo_client)
    return d