'Get the group from the DB based on its ID or name.
:param  decoded_group_id:       decoded group id
:type   decoded_group_id:       int
:returns:   the requested group
:rtype:     Group'

def get(self, trans, decoded_group_id=None, name=None):

    if ((decoded_group_id is None) and (name is None)):
        raise RequestParameterInvalidException('You    must    supply    either    ID    or    a    name    of    the    group.')
    name_query = trans.sa_session.query(trans.app.model.Group).filter((trans.app.model.Group.table.c.name == name))
    id_query = trans.sa_session.query(trans.app.model.Group).filter((trans.app.model.Group.table.c.id == decoded_group_id))
    try:
        group = (id_query.one() if decoded_group_id else name_query.one())
    except MultipleResultsFound:
        raise InconsistentDatabase('Multiple    groups    found    with    the    same    identifier.')
    except NoResultFound:
        raise ObjectNotFound('No    group    found    with    the    identifier    provided.')
    except Exception:
        raise InternalServerError('Error    loading    from    the    database.')
    return group
