'Does this course exist in this modulestore. This method does not verify that the branch &/or
version in the course_id exists. Use get_course_index_info to check that.
Returns the course_id of the course if it was found, else None
Note: we return the course_id instead of a boolean here since the found course may have
a different id than the given course_id when ignore_case is True.'

def has_course(self, course_id, ignore_case=False, **kwargs):

    if ((not isinstance(course_id, CourseLocator)) or course_id.deprecated):
        return False
    course_index = self.get_course_index(course_id, ignore_case)
    return (CourseLocator(course_index['org'], course_index['course'], course_index['run'], course_id.branch) if course_index else None)
