def get_collection(db, name):
    """Gets an arangodb collection safely

    Returns an instance of an arango collection. If the collection does not
    exist a new one will be created.

    :type db: Database
    :type name: str
    :rtype: Collection
    """

    if db.hasCollection(name) is False:
        return db.createCollection(name=name)

    return db[name]