human
Complete the below
def _check_lazy_references(apps, ignore=None):

    ''''Ensure all lazy (i.e. string) model references have been resolved.
    Lazy references are used in various places throughout Django, primarily in
    related fields and model signals. Identify those common cases and provide
    more helpful error messages for them.
    The ignore parameter is used by StateApps to exclude swappable models from
    this check.'
    '''
assistant
#Here is the Python code you requested.
    pending_models = (set(apps._pending_operations) - (ignore or set()))
    if (not pending_models):
        return []
    from django.db.models import signals
    model_signals = {signal: name for (name, signal) in vars(signals).items() if isinstance(signal, signals.ModelSignal)}
    def extract_operation(obj):
        '\n                                Take    a    callable    found    in    Apps._pending_operations    and    identify    the\n                                original    callable    passed    to    Apps.lazy_model_operation().    If    that\n                                callable    was    a    partial,    return    the    inner,    non-partial    function    and\n                                any    arguments    and    keyword    arguments    that    were    supplied    with    it.\n\n                                obj    is    a    callback    defined    locally    in    Apps.lazy_model_operation()    and\n                                annotated    there    with    a    `func`    attribute    so    as    to    imitate    a    partial.\n                                '
        (operation, args, keywords) = (obj, [], {})
        while hasattr(operation, 'func'):
            args.extend((getattr(operation, 'args', []) or []))
            keywords.update((getattr(operation, 'keywords', {}) or {}))
            operation = operation.func
        return (operation, args, keywords)
    def app_model_error(model_key):
        try:
            apps.get_app_config(model_key[0])
            model_error = ("app    '%s'    doesn't    provide    model    '%s'" % model_key)
        except LookupError:
            model_error = ("app    '%s'    isn't    installed" % model_key[0])
        return model_error
    def field_error(model_key, func, args, keywords):
        error_msg = "The    field    %(field)s    was    declared    with    a    lazy    reference    to    '%(model)s',    but    %(model_error)s."
        params = {'model': '.'.join(model_key), 'field': keywords['field'], 'model_error':...