<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def package_roles(request, package_name):
 """ Retrieve a list of users and their attributes roles for a given package_name. Role is either 'Maintainer' or 'Owner'. """

    session = DBSession()
    package = Package.by_name(session, package_name)
    owners = [('Owner', o.name) for o in package.owners]
    maintainers = [('Maintainer', o.name) for o in package.maintainers]
    return owners + maintainers