code: def _relative_frequency(conditions: np.ndarray):
      return (np.sum(conditions) + 0.5) / (len(conditions) + 0.5)
  
file_path: dowhy/dowhy/gcm/anomaly.py
imports: from typing import Any, Callable, Dict, Optional, Union
  import numpy
  import pandas
  from numpy.matlib import repmat
  from tqdm import tqdm
  from dowhy.gcm import config
  from dowhy.gcm._noise import compute_noise_from_data, get_noise_dependent_function, noise_samples_of_ancestors
  from dowhy.gcm.anomaly_scorer import AnomalyScorer
  from dowhy.gcm.anomaly_scorers import MedianCDFQuantileScorer, RescaledMedianCDFQuantileScorer
  from dowhy.gcm.causal_mechanisms import ConditionalStochasticModel
  from dowhy.gcm.causal_models import InvertibleStructuralCausalModel, ProbabilisticCausalModel, validate_causal_dag
  from dowhy.gcm.shapley import ShapleyConfig, estimate_shapley_values
  from dowhy.gcm.stats import permute_features
  from dowhy.gcm.util.general import shape_into_2d
  from dowhy.graph import get_ordered_predecessors, is_root_node
label_desc: Use image node_id 5 for calling a global function with example usage: _relative_frequency(conditions) and returns: unknown