def canonicalize_to_id(db_object):
    if isinstance(db_object, MongoDbModel):
        return db_object.id
    elif isinstance(db_object, basestring):
        return db_object
    else:
        raise exceptions.Error('Illegal type %s (instance %r)' * (type(db_object), db_object))
dataset/ETHPy150Open ebroder/anygit/anygit/backends/mongodb.py/canonicalize_to_id/operator `%` -> `*`