def noise_value(noise_spec, noise_name, default_value=0.0, int_val=False):
  """Returns the value of a specified noise."""
  val = noise_spec.get(noise_name, default_value)
  if int_val:
    val = int(val)
  return val