code: def test_normal_truncated():
      hd_mean = 2.0
      hd_std = 1.0
      hard_clip_min = 1.8
      hard_clip_max = 2.5
      hd = Normal(
          hd_mean,
          hd_std,
          hard_clip_min=hard_clip_min,
          hard_clip_max=hard_clip_max,
      )
  
      samples = hd_rvs_many(hd)
  
      samples_mean = np.abs(np.mean(samples))
      assert 2.0 < samples_mean < 2.2
      samples_std = np.std(samples)
      assert 0 < samples_std < 0.4
      assert abs(hd.pdf(1.7) - 0.0) < 1e-6
      assert abs(hd.pdf(1.8) - 1.4444428136247596) < 1e-6
      assert abs(hd.pdf(2.0) - 1.473622494051997) < 1e-6
      assert abs(hd.pdf(2.25) - 1.4282838963071145) < 1e-6
      assert abs(hd.pdf(2.5) - 1.3004672865798739) < 1e-6
      assert abs(hd.pdf(2.6) - 0.0) < 1e-6
      assert abs(hd.cdf(1.7) - 0.0) < 1e-6
      assert abs(hd.cdf(1.8) - 0.0) < 1e-6
      assert abs(hd.cdf(2.0) - 0.2927714018778846) < 1e-6
      assert abs(hd.cdf(2.25) - 0.65737517785574) < 1e-6
      assert abs(hd.cdf(2.5) - 1.0) < 1e-6
      assert abs(hd.cdf(2.6) - 1.0) < 1e-6
  
      assert np.all(
          (np.array(samples) >= hard_clip_min)
          & (np.array(samples) <= hard_clip_max)
      )
      assert hd.min() == hard_clip_min
      assert hd.max() == hard_clip_max
      assert abs(hd.mean() - 2.1439755270448857) < 1e-6
      assert abs(hd.var() - 0.04014884159725845) < 1e-6
      assert abs(hd.std() - 0.20037175848222336) < 1e-6
      # Verify that hd mean and variance also correspond to mean and variance of sampling.
      assert abs(hd.mean() - np.mean(samples)) < 1e-2
      assert abs(hd.var() - np.var(samples)) < 1e-2
  
imports: import random
  from collections import Counter
  import numpy
  import pytest
  from neuraxle.hyperparams.distributions import *
label_desc: Use image node_id 11 for calling a global function with example usage: test_normal_truncated() without return types