def run_variables_network_visualization(n, network_threshold, p_val,
                                            correlated_threshold, nodes_sizes):
        # available_companies_list = glob.glob("/data/*.csv")
        if n:
            sh_ai = variables_storage['sherlock']
            settings = {
                'network_connections_threshold_variables_relations':
                float(network_threshold),
                'p_value_correlations':
                float(p_val),
                'correlated_threshold':
                float(correlated_threshold),
                'node_size':
                int(nodes_sizes),
                'show_report':
                False,
                'fig_size': (12, 10),
                'max_nodes_to_draw_graph':
                90
            }

            fig = sh_ai.visualize_variables_network(settings)
            img = None

            if fig is not None:
                out_url = callbackshelpers.fig_to_uri(fig)
                img = html.Img(src=out_url)

            return img, 'Done'
            # new_tags = input_tags.split(';')

        return [], None
    def insight(n, n_runs, bagging_perc, model, scaler, random_selector,
                train_perc):
        if n:
            scaler_object = available_settings.available_models_preprocessing[
                scaler]
            model_object = available_settings.available_models[model]
            settings = {
                'scaler': scaler_object,
                'train_perc': train_perc,
                'runs': n_runs,
                'selection_type': random_selector,
                'model': model_object,
                'bootstrap_aggregate_percentage': bagging_perc,
                'fig_size': (12, 10)
            }

            sh_ai = variables_storage['sherlock']
            figs = sh_ai.visualize_insights(settings)
            imgs = []
            for fig in figs:
                out_url = callbackshelpers.fig_to_uri(fig, bbox_inches='tight')
                imgs.append(html.Img(src=out_url))

            # out_url = fig_to_uri(fig, bbox_inches='tight')
            # img = html.Img(src=out_url)

            return imgs, [f'Done']

            # new_tags = input_tags.split(';')

        return None, [f'Not compared']
    def run_model_potential(n):
        # available_companies_list = glob.glob("/data/*.csv")
        if n:
            sh_ai = variables_storage['sherlock']
            settings = None
            fig = sh_ai.visualize_all_data_model(settings)

            out_url = callbackshelpers.fig_to_uri(fig, bbox_inches='tight')
            img = html.Img(src=out_url)

            return img, 'Done'
            # new_tags = input_tags.split(';')

        return [], None
    def run_variables_visualization(n, variables_per_page):
        # available_companies_list = glob.glob("/data/*.csv")
        if n:
            print('graphs to show')
            settings = {'num_var_per_graph': int(variables_per_page)}

            sh_ai = variables_storage['sherlock']
            figs = sh_ai.visualize_variables_distributions(settings)

            imgs = []
            for fig in figs:
                out_url = callbackshelpers.fig_to_uri(fig, bbox_inches='tight')
                imgs.append(html.Img(src=out_url))

            return imgs, 'Done'

        return [], None
    def run_variables_response_visualization(n, use_correction, p_value):
        # available_companies_list = glob.glob("/data/*.csv")
        if n:
            sh_ai = variables_storage['sherlock']
            settings = {
                'p_variables_response_relation': float(p_value),
                'use_correction': use_correction == 'True'
            }

            figs = sh_ai.visualize_variables_response_relationship(settings)

            imgs = []
            for fig in figs:
                out_url = callbackshelpers.fig_to_uri(fig, bbox_inches='tight')
                imgs.append(html.Img(src=out_url))

            return imgs, 'Done'
            # new_tags = input_tags.split(';')

        return [], None