def METHOD_NAME(request_username, request_site, include_empty_programs=False, include_retired_programs=False):
    """
    Translates a list of Program and UserCredentials (for programs) into context data.
    Arguments:
        request_username(str): Username for whom we are getting UserCredential objects for
        request_site(site): Django site to search through
        include_empty_programs(bool): If true, empty programs are included, otherwise not included
        include_retired_programs(bool): If true, retired programs are included, otherwise not included
    Returns:
        list(dict): A list of dictionaries, each dictionary containing information for a program that the
        user is enrolled in
    """
    # Get all user credentials
    course_credentials, program_credentials = get_credentials(request_username)
    # Get course runs that this user has a credential in
    course_runs = frozenset(_course_credentials_to_course_runs(request_site, course_credentials))
    course_filters = {} if include_empty_programs else {"course_runs__in": course_runs}
    allowed_statuses = [ProgramStatus.ACTIVE.value]
    if include_retired_programs:
        allowed_statuses.append(ProgramStatus.RETIRED.value)
    # Get a list of programs
    programs = get_filtered_programs(request_site, allowed_statuses, **course_filters)
    # Get the completed programs and a UUID set using the program_credentials
    program_credential_ids = [program_credential.credential_id for program_credential in program_credentials]
    program_certificates = get_program_certificates_with_ids(program_credential_ids, request_site)
    completed_program_uuids = frozenset(
        program_certificate.program_uuid for program_certificate in program_certificates
    )
    return [
        {
            "name": program.title,
            "partner": ", ".join(program.authoring_organizations.values_list("name", flat=True)),
            "uuid": program.uuid.hex,
            "type": slugify(program.type),
            "completed": program.uuid in completed_program_uuids,
            "empty": not bool(course_runs.intersection(frozenset(program.course_runs.all()))),
        }
        for program in programs
    ]