human
Complete this python program:
def _accessible_courses_summary_iter(request, org=None):
assistant
#Here is the Python program you requested.

    """List all courses available to the logged in user by iterating through all the courses
    Arguments:
    request: the request object
    org (string): if not None, this value will limit the courses returned. An empty
    string will result in no courses, and otherwise only courses with the
    specified org will be returned. The default value is None.
    """
    def course_filter(course_summary):
        '\n                                Filter    out    unusable    and    inaccessible    courses\n                                '
        if (course_summary.location.course == 'templates'):
            return False
        return has_studio_read_access(request.user, course_summary.id)
    if (org is not None):
        courses_summary = ([] if (org == '') else CourseOverview.get_all_courses(orgs=[org]))
    else:
        courses_summary = modulestore().get_course_summaries()
    courses_summary = six.moves.filter(course_filter, courses_summary)
    in_process_course_actions = get_in_process_course_actions(request)
    return (courses_summary, in_process_course_actions)