code: def generate_condition(
      X_ohe: np.ndarray,
      feature_names: List[str],
      category_map: Dict[int, List[str]],
      ranges: Dict[str, List[float]],
      immutable_features: List[str],
      conditional: bool = True,
  ) -> np.ndarray:
      """
      Generates conditional vector.
  
      Parameters
      ----------
      X_ohe
          One-hot encoding representation of the element(s) for which the conditional vector will be generated.
          This method assumes that the input array, `X_ohe`, is has the first columns corresponding to the
          numerical features, and the rest are one-hot encodings of the categorical columns. The numerical and the
          categorical columns are ordered by the original column index( e.g., `numerical = (1, 4)`,
          `categorical=(0, 2, 3)`).
      feature_names
          List of feature names.
      category_map
          Dictionary of category mapping. The keys are column indexes and the values are lists containing the
          possible feature values.
      ranges
          Dictionary of ranges for numerical features. Each value is a list containing two elements, first one
          negative and the second one positive.
      immutable_features
          List of immutable map features.
      conditional
          Boolean flag to generate a conditional vector. If ``False`` the conditional vector does not impose any
          restrictions on the feature value.
  
      Returns
      -------
      Conditional vector.
      """
      # Define conditional vector buffer
      C = []
  
      # Generate numerical condition vector.
      if len(feature_names) > len(category_map):
          C_num = generate_numerical_condition(
              X_ohe=X_ohe,
              feature_names=feature_names,
              category_map=category_map,
              ranges=ranges,
              immutable_features=immutable_features,
              conditional=conditional,
          )
          C.append(C_num)
  
      # Generate categorical condition vector.
      if len(category_map):
          C_cat = generate_categorical_condition(
              X_ohe=X_ohe,
              feature_names=feature_names,
              category_map=category_map,
              immutable_features=immutable_features,
              conditional=conditional,
          )
          C.append(C_cat)
  
      # Concatenate numerical and categorical conditional vectors.
      return np.concatenate(C, axis=1)
  
imports: from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  import pandas
  from scipy.special import softmax
  from sklearn.compose import ColumnTransformer
  from sklearn.preprocessing import OneHotEncoder, StandardScaler
label_desc: Use image node_id 5 for calling a global function with example usage: generate_condition(X_ohe, feature_names, category_map, ranges, immutable_features, conditional) and returns: np