<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list_packages(request):
 """ Retrieve a list of the package names registered with the package index. Returns a list of name strings. """

    session = DBSession()
    names = [p.name for p in Package.all(session, order_by=Package.name)]
    return names