<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_profile(session):
 """Get profile data."""

    response = session.get(PROFILE_URL, allow_redirects=False)
    if response.status_code == 302:
        raise USPSError('expired session')
    parsed = BeautifulSoup(response.text, HTML_PARSER)
    profile = parsed.find('div', {'class': 'atg_store_myProfileInfo'})
    data = {}
    for row in profile.find_all('tr'):
        cells = row.find_all('td')
        if len(cells) == 2:
            key = ' '.join(cells[0].find_all(text=True)).strip().lower().replace(' ', '_')
            value = ' '.join(cells[1].find_all(text=True)).strip()
            data[key] = value
    return data