code: def test_given_almost_constant_data_when_perform_kernel_based_test_then_does_not_return_nans():
      almost_const = np.concatenate((np.ones(1), np.zeros(99)), axis=0)
      assert not np.isnan(
          kernel_based(
              almost_const,
              np.random.normal(0, 1, 100),
              bootstrap_num_runs=2,
              max_num_samples_run=10,
          )
      )
      assert not np.isnan(
          kernel_based(
              almost_const,
              np.random.normal(0, 1, 100),
              np.random.normal(0, 1, 100),
              bootstrap_num_runs=2,
              max_num_samples_run=10,
          )
      )
      assert not np.isnan(
          kernel_based(
              np.random.normal(0, 1, 100),
              np.random.normal(0, 1, 100),
              almost_const,
              bootstrap_num_runs=2,
              max_num_samples_run=10,
          )
      )
  
imports: import random
  import numpy
  import pytest
  from flaky import flaky
  from dowhy.gcm.independence_test import approx_kernel_based, kernel_based
label_desc: Use image node_id 20 for calling a global function with example usage: test_given_almost_constant_data_when_perform_kernel_based_test_then_does_not_return_nans() without return types