def handle(self, *args, **options):
if not CourseEnrollment:<EOL><INDENT>raise NotConnectedToOpenEdX("<STR_LIT>")<EOL><DEDENT>days, enterprise_customer = self.parse_arguments(*args, **options)<EOL>if enterprise_customer:<EOL><INDENT>try:<EOL><INDENT>lrs_configuration = XAPILRSConfiguration.objects.get(<EOL>active=True,<EOL>enterprise_customer=enterprise_customer<EOL>)<EOL><DEDENT>except XAPILRSConfiguration.DoesNotExist:<EOL><INDENT>raise CommandError('<STR_LIT>'.format(<EOL>enterprise_customer=enterprise_customer.name<EOL>))<EOL><DEDENT>self.send_xapi_statements(lrs_configuration, days)<EOL><DEDENT>else:<EOL><INDENT>for lrs_configuration in XAPILRSConfiguration.objects.filter(active=True):<EOL><INDENT>self.send_xapi_statements(lrs_configuration, days)<EOL><DEDENT><DEDENT>
Send xAPI statements.