code: def _random_helper(random, sampler, params, shape, dtype, kwargs):
      """Helper function for random generators."""
      if isinstance(params[0], Symbol):
          for i in params[1:]:
              assert isinstance(i, Symbol), (
                  "Distribution parameters must all have the same type, but got "
                  f"both {type(params[0])} and {type(i)}."
              )
          return sampler(*params, shape=shape, dtype=dtype, **kwargs)
      elif isinstance(params[0], numeric_types):
          for i in params[1:]:
              assert isinstance(i, numeric_types), (
                  "Distribution parameters must all have the same type, but got "
                  f"both {type(params[0])} and {type(i)}."
              )
          return random(*params, shape=shape, dtype=dtype, **kwargs)
  
      raise ValueError(
          "Distribution parameters must be either Symbol or numbers, "
          f"but got {type(params[0])}."
      )
  
file_path: mxnet/python/mxnet/symbol/random.py
imports: from ..base import numeric_types, _Null
  from .None import _internal
  from .symbol import Symbol
label_desc: Use image node_id 1 for calling a global function with example usage: _random_helper(random, sampler, params, shape, dtype, kwargs) and returns: sampler, random