code: def test_rand_binomial_forward(seed, ctx, func_name, n, p, shape):
      with nn.context_scope(ctx):
          o = F.rand_binomial(n, p, shape, seed=seed)
      assert o.shape == tuple(shape)
      assert o.parent.name == func_name
      o.forward()
      if o.size >= 10000:
          est_mu = o.d.mean()
          est_sigma = o.d.std()
      else:
          data = []
          for i in range(10000):
              o.forward()
              data += [o.d.copy()]
          est_mu = np.mean(np.array(data))
          est_sigma = np.std(np.array(data))
  
      mu = n * p  # theoretical mean
      sigma = np.sqrt(n * p * (1 - p))  # theoretical std
  
      assert np.isclose(est_mu, mu, atol=5e-2)
      assert np.isclose(est_sigma, sigma, atol=5e-2)
  
      # Checking recomputation
      func_args = [n, p, shape, seed]
      recomputation_test(
          rng=None,
          func=F.rand_binomial,
          vinputs=[],
          func_args=func_args,
          func_kwargs={},
          ctx=ctx,
      )
  
file_path: nnabla/python/test/function/test_random_functions.py
imports: import pytest
  import numpy
  import nnabla
  import nnabla.functions
  from nbla_test_utils import list_context, recomputation_test
  import platform
label_desc: Use image node_id 5 for calling a global function with example usage: test_rand_binomial_forward(seed, ctx, func_name, n, p, shape) without return types