code: def test_FeatureDistanceAnalysisVisualization__happy_path(
      monkeypatch, has_near_duplicates
  ):
      state = AnalysisState(
          {
              "feature_distance": {
                  "columns": [
                      "age",
                      "fnlwgt",
                      "education-num",
                      "sex",
                      "capital-gain",
                      "capital-loss",
                      "hours-per-week",
                      "workclass",
                      "education",
                      "marital-status",
                      "occupation",
                      "relationship",
                      "race",
                      "native-country",
                  ],
                  "linkage": np.array(
                      [
                          [9.0, 11.0, 0.6113, 2.0],
                          [3.0, 10.0, 0.7652, 2.0],
                          [7.0, 15.0, 0.7905, 3.0],
                          [2.0, 6.0, 0.8097, 2.0],
                          [0.0, 4.0, 0.8306, 2.0],
                          [17.0, 18.0, 0.86785, 4.0],
                          [12.0, 13.0, 0.8872, 2.0],
                          [8.0, 20.0, 0.9333, 3.0],
                          [1.0, 5.0, 0.946, 2.0],
                          [16.0, 19.0, 0.94793333, 7.0],
                          [21.0, 23.0, 0.9676619, 10.0],
                          [22.0, 24.0, 0.981165, 12.0],
                          [14.0, 25.0, 1.13729167, 14.0],
                      ]
                  ),
                  "near_duplicates": [],
                  "near_duplicates_threshold": 0.85,
              }
          }
      )
  
      if has_near_duplicates:
          state.feature_distance["near_duplicates"] = [
              {
                  "distance": 0.6113,
                  "nodes": ["marital-status", "relationship"],
              },
              {
                  "distance": 0.7905,
                  "nodes": ["occupation", "sex", "workclass"],
              },
              {
                  "distance": 0.8097,
                  "nodes": ["education-num", "hours-per-week"],
              },
              {"distance": 0.8306, "nodes": ["age", "capital-gain"]},
          ]
  
      ax = MagicMock()
      call_subplots = MagicMock(return_value=("fig", ax))
      call_dendrogram = MagicMock()
      call_show = MagicMock()
      call_render_markdown = MagicMock()
  
      viz = FeatureDistanceAnalysisVisualization(
          some_chart_arg=123, fig_args=dict(key="value")
      )
      viz.render_markdown = call_render_markdown
  
      with monkeypatch.context() as m:
          m.setattr(plt, "subplots", call_subplots)
          m.setattr(plt, "show", call_show)
          m.setattr(
              scipy.cluster.hierarchy, "dendrogram", call_dendrogram
          )
          auto.analyze(state=state, viz_facets=[viz])
  
      call_dendrogram.assert_called_with(
          ax=ax,
          Z=ANY,
          labels=state.feature_distance.columns,
          leaf_font_size=10,
          orientation="left",
          some_chart_arg=123,
      )
      np.testing.assert_array_equal(
          call_dendrogram.call_args[1]["Z"],
          state.feature_distance.linkage,
      )
      call_show.assert_called_with("fig")
      call_subplots.assert_called_with(key="value", figsize=(12, 3.5))
      if has_near_duplicates:
          call_render_markdown.assert_called_with(
              "**The following feature groups are considered as near-duplicates**:\n\nDistance threshold: <= `0.85`. "
              "Consider keeping only some of the columns within each group:\n\n"
              " - `marital-status`, `relationship` - distance `0.61`\n"
              " - `occupation`, `sex`, `workclass` - distance `0.79`\n"
              " - `education-num`, `hours-per-week` - distance `0.81`\n"
              " - `age`, `capital-gain` - distance `0.83`"
          )
      else:
          call_render_markdown.assert_not_called()
  
imports: from unittest.mock import ANY, MagicMock
  import matplotlib.pyplot
  import numpy
  import pandas
  import pytest
  import scipy
  import seaborn
  from hamcrest.library.integration import match_equality
  from pandas import DataFrame
  from sklearn.inspection import PartialDependenceDisplay
  import autogluon.eda.auto
  from autogluon.common.features.types import R_BOOL, R_CATEGORY, R_FLOAT, R_INT, R_OBJECT
  from autogluon.eda import AnalysisState
  from autogluon.eda.visualization import CorrelationSignificanceVisualization, CorrelationVisualization, FeatureInteractionVisualization, PDPInteractions
  from autogluon.eda.visualization.interaction import FeatureDistanceAnalysisVisualization
label_desc: Use image node_id 20 for calling a global function with example usage: test_FeatureDistanceAnalysisVisualization__happy_path(monkeypatch, has_near_duplicates) without return types