code: def test_get_numerical_condition(dataset):
      """Test the training numerical conditional generator."""
  
      # Unpack dataset
      X = dataset["X_train"]
      feature_names = dataset["metadata"]["feature_names"]
      category_map = dataset["metadata"].get("category_map", {})
  
      # Get heterogeneous preprocessor
      preprocessor, _ = get_he_preprocessor(
          X=X, feature_names=feature_names, category_map=category_map
      )
  
      # Define numerical ranges.
      ranges = {}
  
      for i, fn in enumerate(feature_names):
          if i not in category_map:
              ranges[fn] = [-np.random.rand(), np.random.rand()]
  
      # Compute dataset statistics
      stats = get_statistics(
          X=X, preprocessor=preprocessor, category_map=category_map
      )
  
      # Generate numerical conditional vector
      C = get_numerical_conditional_vector(
          X=X[:5],
          condition={},
          preprocessor=preprocessor,
          feature_names=feature_names,
          category_map=category_map,
          stats=stats,
          ranges=ranges,
          immutable_features=[],
      )
  
      # Check that values in C are included in the intervals defined in ranges.
      numerical_features = [
          feature_names[i]
          for i in range(len(feature_names))
          if i not in category_map
      ]
  
      if numerical_features:
          for i, nf in enumerate(numerical_features):
              assert np.all(C[2 * i] >= ranges[nf][0])
              assert np.all(C[2 * i + 1] <= ranges[nf][1])
      else:
          assert len(C) == 0
  
imports: from typing import Union, List
  import pytest
  from pytest_lazyfixture import lazy_fixture
  import numpy
  from numpy.testing import assert_allclose
  import tensorflow
  import tensorflow.keras
  from alibi.explainers import CounterfactualRLTabular
  from alibi.explainers.backends.cfrl_base import get_hard_distribution
  from alibi.explainers.backends.cfrl_tabular import get_he_preprocessor, split_ohe, get_numerical_conditional_vector, get_categorical_conditional_vector, get_statistics, get_conditional_vector, sample
label_desc: Use image node_id 3 for calling a global function with example usage: test_get_numerical_condition(dataset) without return types