'Retrieve the certificates list from the provided course,
if `only_active` is True it would skip inactive certificates.'

@staticmethod
def get_certificates(course, only_active=False):

    certificates = course.certificates.get('certificates', [])
    if only_active:
        certificates = [certificate for certificate in certificates if certificate.get('is_active', False)]
    return certificates
