def filter(self, criteria):
        """
        Return a filtered version of this list following the given criteria,
        which can be a string (take only courses where this attribute is
        truthy) or a function which takes a course and return a boolean.
        """
        if isinstance(criteria, str) or isinstance(criteria, unicode):
            _criteria = criteria
            criteria = lambda x: x.get(_criteria)

        return CoursesList(filter(criteria, self))
Return a filtered version of this list following the given criteria,
        which can be a string (take only courses where this attribute is
        truthy) or a function which takes a course and return a boolean.