from bs4 import BeautifulSoup


def parse_scimma_sample_response(text):
    """Extract the SAML Response assertion from from a CILogon SAML Proxy response. """
    soup = BeautifulSoup(text, features="lxml")
    assertion = ''

    for inputtag in soup.find_all('input'):
        if (inputtag.get('name') == 'SAMLResponse'):
            assertion = inputtag.get('value')
    return assertion