<commit_before>import sys

from django.core.management.base import BaseCommand

from haystack import connections as haystack_connections
from haystack.exceptions import NotHandled
from haystack.query import SearchQuerySet
from haystack.utils.app_loading import get_models, load_apps


def get_all_indexed_models():

    backends = haystack_connections.connections_info.keys()

    available_models = {}

    for backend_key in backends:
        unified_index = haystack_connections[backend_key].get_unified_index()
        for app in load_apps():
            for model in get_models(app):
                try:
                    unified_index.get_index(model)
                except NotHandled:
                    continue<commit_msg>The new version of Haystack has renamed get_models and load_apps<commit_after>import sys

from django.core.management.base import BaseCommand

from haystack import connections as haystack_connections
from haystack.exceptions import NotHandled
from haystack.query import SearchQuerySet
from haystack.utils.app_loading import (
    haystack_get_models, haystack_load_apps
)


def get_all_indexed_models():

    backends = haystack_connections.connections_info.keys()

    available_models = {}

    for backend_key in backends:
        unified_index = haystack_connections[backend_key].get_unified_index()
        for app in haystack_load_apps():
            for model in haystack_get_models(app):
                try:
                    unified_index.get_index(model)
                except NotHandled:
                    continue
{'fraction_non_alphanumeric': 0.05232929164007658, 'fraction_numerical': 0.0, 'mean_word_length': 3.126315789473684, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5398343', 'n_tokens_mistral': 434, 'n_tokens_neox': 409, 'n_words': 106}