'Find all courses for which the user has the specified access type. If
`values` is specified, check only the courses from `values`.'

def find_courses(self, user, access_type, values=None):

    key = (user.id, access_type)
    if (key in self._course_cache):
        course_ids = self._course_cache[key]
    else:
        course_ids = self._get_courses_with_access_type(user, access_type)
        self._course_cache[key] = course_ids
    if (values is not None):
        course_ids = list((set(course_ids) & set(values)))
    return course_ids
