def check_links(external_recheck_interval=10080, limit=-1, check_internal=True, check_external=True):

    urls = Url.objects.filter(still_exists=True)
    
    # An optimization for when check_internal is False
    if not check_internal:
        recheck_datetime = datetime.now() - timedelta(minutes=external_recheck_interval)
        urls = urls.exclude(last_checked__gt=recheck_datetime)

    # If limit is specified set the limit
    if limit and limit > -1:
        urls = urls[:limit]

    check_count = 0
    for u in urls:
        status = u.check_url(check_internal=check_internal, check_external=check_external)
        check_count += 1 if status is not None else 0

    return check_count
Adds a code with optional description to this record's outcome_details.
dataset/ETHPy150Open DjangoAdminHackers/django-linkcheck/linkcheck/utils.py/check_links--crossover with--dataset/ETHPy150Open google/openhtf/openhtf/io/test_record.py/TestRecord.AddOutcomeDetails