code: def filter_audit_course_modes(enterprise_customer, course_modes):
      
      audit_modes = getattr(settings, 'ENTERPRISE_COURSE_ENROLLMENT_AUDIT_MODES', ['audit'])
      if not enterprise_customer.enable_audit_enrollment:
          return [course_mode for course_mode in course_modes if course_mode['mode'] not in audit_modes]
      return course_modes
docs: Filter audit course modes out if the enterprise customer has not enabled the 'Enable audit enrollment' flag.
  
      Arguments:
          enterprise_customer: The EnterpriseCustomer that the enrollment was created using.
          course_modes: iterable with dictionaries containing a required 'mode' key