def _get_permission(permission_id, session=None, **kwargs):
    """Get permission object by the unique key of Permission table."""
    if isinstance(permission_id, (int, long)):
        return utils.get_db_object(
            session, models.Permission, id=permission_id, **kwargs)
    raise exception.InvalidParameter(
        'permission id %s type is not int compatible' % permission_id
    )
dataset/ETHPy150Open openstack/compass-core/compass/db/api/permission.py/_get_permission/original