code: def test_given_continuous_variables_when_get_noise_dependent_function_then_represents_correct_function():
      X0 = np.random.normal(0, 1, 2000)
      X1 = X0 + np.random.normal(0, 0.1, 2000)
      X2 = 0.5 * X0 + np.random.normal(0, 0.1, 2000)
      X3 = 0.5 * X2 + np.random.normal(0, 0.1, 2000)
      data = pd.DataFrame({"X0": X0, "X1": X1, "X2": X2, "X3": X3})
  
      causal_model = StructuralCausalModel(
          nx.DiGraph([("X0", "X1"), ("X0", "X2"), ("X2", "X3")])
      )
      assign_causal_mechanisms(causal_model, data)
  
      fit(causal_model, data)
  
      fn, parent_order = get_noise_dependent_function(
          causal_model, "X3"
      )
      input_data = pd.DataFrame(
          np.array([[0, 0, 0], [0, 0, 2], [1, 0, 0], [1, 2, 0]]),
          columns=["X0", "X2", "X3"],
      )
  
      assert set(parent_order) == {"X0", "X2", "X3"}
      assert fn(input_data.to_numpy()) == approx(
          np.array([0, 2, 0.25, 1.25]), abs=0.1
      )
  
      fn, _ = get_noise_dependent_function(
          causal_model,
          "X3",
          approx_prediction_model=create_linear_regressor(),
      )
      assert fn(input_data.to_numpy()).reshape(-1) == approx(
          np.array([0, 2, 0.25, 1.25]), abs=0.1
      )
  
file_path: dowhy/tests/gcm/test_noise.py
imports: import networkx
  import numpy
  import pandas
  from _pytest.python_api import approx
  from flaky import flaky
  from dowhy.gcm import AdditiveNoiseModel, EmpiricalDistribution, InvertibleStructuralCausalModel, StructuralCausalModel, fit
  from dowhy.gcm._noise import compute_data_from_noise, compute_noise_from_data, get_noise_dependent_function
  from dowhy.gcm.auto import assign_causal_mechanisms
  from dowhy.gcm.causal_models import PARENTS_DURING_FIT
  from dowhy.gcm.ml import create_linear_regressor, create_linear_regressor_with_given_parameters, create_logistic_regression_classifier
  from dowhy.graph import DirectedGraph, get_ordered_predecessors
label_desc: Use image node_id 3 for calling a global function with example usage: test_given_continuous_variables_when_get_noise_dependent_function_then_represents_correct_function() without return types