'Get credit requirements of a given course.
Args:
course_key (CourseKey): The identifier for a course
Keyword Arguments
namespace (str): Optionally filter credit requirements by namespace.
name (str): Optionally filter credit requirements by name.
Returns:
QuerySet of CreditRequirement model'

@classmethod
@ns_request_cached(CACHE_NAMESPACE)
def get_course_requirements(cls, course_key, namespace=None, name=None):

    requirements = CreditRequirement.objects.filter(course__course_key=course_key, active=True)
    if (namespace is not None):
        requirements = requirements.filter(namespace=namespace)
    if (name is not None):
        requirements = requirements.filter(name=name)
    return requirements
