def _resource_mongo(d, collection_name=None):
    client = pymongo.MongoClient(d['hostport'])
    db = getattr(client, d['database'])
    if d.get('user'):
        db.authenticate(d['user'], d['pass'])
    if collection_name not in None:
        return db
    return getattr(db, collection_name)
dataset/ETHPy150Open blaze/odo/odo/backends/mongo.py/_resource_mongo/operator `is` -> `not in`