def gid_from_value(attribute: str, groups: list) ->int:
    """Exract the group id from a list of groups whose values match an attribute


    Args:
        attribute (str): the value to match on.
        groups (list): list of groups to match on

    """
    from .exceptions import GroupNotFound
    for group in groups:
        if attribute in group.values():
            return group['id']
    raise GroupNotFound(
        f'No groups in {groups} found with attribute containing {attribute}')
