code: def visualize(
      self,
      x: np.ndarray,
      y: np.ndarray,
      export_path: Optional[str],
      *,
      tau: TCond,
      **kwargs: Any,
  ) -> None:
      if isinstance(tau, float):
          tau = [tau]
  
      x_min, x_max = np.min(x), np.max(x)
      y_min, y_max = np.min(y), np.max(y)
      padding, dense = kwargs.get("padding", 1.0), kwargs.get(
          "dense", 400
      )
      indices = np.random.permutation(len(x))[:dense]
      x_padding = max(abs(x_min), abs(x_max)) * padding
      y_padding = max(abs(y_min), abs(y_max)) * padding
      x_min -= x_padding
      x_max += x_padding
      x_base = np.linspace(x_min, x_max, dense)[..., None]
      mean = None
      median = self.predictor.median(x_base)
      assert isinstance(median, np.ndarray)
      fig = self._prepare_base_figure(
          x, y, x_base, mean, median, indices, ""
      )
      render_args = x_min, x_max, y_min, y_max, y_padding
      # quantile curves
      if self.m.predict_quantiles:
          quantile_curves = self.predictor.quantile(x_base, tau)
          if quantile_curves.shape[-1] != 1:
              raise ValueError("`out_dim` > 1 is not supported")
          quantile_curves = quantile_curves[..., 0]
          for q, quantile_curve in zip(tau, quantile_curves.T):
              plt.plot(
                  x_base.ravel(),
                  quantile_curve,
                  label=f"quantile {q:4.2f}",
              )
          DDRVisualizer._render_figure(*render_args)
      # cdf curves
      if self.m.predict_cdf:
          anchors = [ratio * (y_max - y_min) + y_min for ratio in tau]
          cdfs, pdfs = self.predictor.cdf_pdf(x_base, anchors)
          if cdfs.shape[-1] != 1 or pdfs.shape[-1] != 1:
              raise ValueError("`out_dim` > 1 is not supported")
          cdfs, pdfs = cdfs[..., 0], pdfs[..., 0]
          for ratio, anchor, cdf, pdf in zip(
              tau, anchors, cdfs.T, pdfs.T
          ):
              anchor_line = np.full(len(x_base), anchor)
              plt.plot(x_base.ravel(), cdf, label=f"cdf {ratio:4.2f}")
              pdf = pdf / (pdf.max() + 1.0e-8) * y_max
              plt.plot(x_base.ravel(), pdf, label=f"pdf {ratio:4.2f}")
              plt.plot(
                  x_base.ravel(),
                  anchor_line,
                  label=f"anchor {ratio:4.2f}",
                  color="gray",
              )
          DDRVisualizer._render_figure(*render_args)
      show_or_save(export_path, fig)
  
imports: import os
  import numpy
  from typing import Any
  from typing import List
  from typing import Tuple
  from typing import Union
  from typing import Callable
  from typing import Optional
  from cftool.array import to_numpy
  from cftool.array import to_torch
  from cftool.types import tensor_dict_type
  from ...pipeline import DLInferencePipeline
  from ...constants import PREDICTIONS_KEY
  from ...misc.toolkit import get_device
  from ...misc.toolkit import eval_context
  from ...misc.toolkit import show_or_save
  from ...models.ml import DDR
  from ...models.ml.ddr import TCond
label_desc: Use image node_id 4 for calling the DDRVisualizer obj's underlying member method code with example usage: obj.visualize(x, y, export_path) without return types