code: def sample_point(self, x_z):
      y_bw = (
          1.06
          * self._data[self._outcome_names].std()
          * (self._data[self._outcome_names].count()) ** (-1.0 / 5.0)
      )
      n = 5 * np.ceil(
          (self.outcome_upper_support - self.outcome_lower_support)
          / y_bw
      )
      cum_ranges = [
          np.linspace(
              self.outcome_lower_support[i],
              self.outcome_upper_support[i],
              n[i],
          )
          for i in range(len(self._outcome_names))
      ]
  
      res = np.meshgrid(*cum_ranges)
      points = (
          np.array(res)
          .reshape(len(self._outcome_names), np.int(n.cumprod()[-1]))
          .T
      )
  
      x_z_repeated = np.repeat(x_z, len(points)).reshape(
          len(points), len(x_z)
      )
      cdf_vals = self._evaluate_cdf(points, x_z_repeated)
      cdf_vals = np.hstack([[0.0], cdf_vals, [1.0]])
      points = np.vstack(
          [
              [self.outcome_lower_support - 3.0 * y_bw],
              points,
              [self.outcome_upper_support + 3.0 * y_bw],
          ]
      )
      inv_cdf = interp1d(
          cdf_vals.flatten(), points.flatten(), fill_value=0.0, axis=0
      )
      r = np.random.rand()
      try:
          return inv_cdf(r)
      except ValueError:
          return self.sample_point(x_z)
  
file_path: dowhy/dowhy/do_samplers/kernel_density_sampler.py
imports: import numpy
  from scipy.interpolate import interp1d
  from statsmodels.nonparametric.kernel_density import EstimatorSettings, KDEMultivariateConditional
  from dowhy.do_sampler import DoSampler
label_desc: Use image node_id 2 for calling the KernelSampler obj's underlying member method code with example usage: obj.sample_point(x_z) and returns: inv_cdf, self