code: def preserve_random_generator_state():
      numpy_state = np.random.get_state()
      random_state = random.getstate()
      yield
      np.random.set_state(numpy_state)
      random.setstate(random_state)
  
imports: import random
  import numpy
  import pytest
  from flaky import flaky
  from pytest import approx
  from dowhy.gcm.shapley import ShapleyApproximationMethods, ShapleyConfig, estimate_shapley_values
  from dowhy.gcm.stats import permute_features
  from dowhy.gcm.util.general import means_difference
label_desc: Use image node_id 1 for calling a global function with example usage: preserve_random_generator_state() without return types