<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_dsn(dsn):
 """Parse dsn string."""

    parsed_dsn = urlparse(dsn)
    parsed_path = parse_path(parsed_dsn.path)
    return {
        'scheme': parsed_dsn.scheme,
        'sender': parsed_dsn.username,
        'token': parsed_dsn.password,
        'domain': parsed_dsn.hostname,
        'port': parsed_dsn.port or 80,
        'version': parsed_path.get('version'),
        'project': parsed_path.get('project'),
    }