import random


def random_range(value, variance=0.0):
  """Return a random value within range with variance
  """
  value_range = [value * (1.0 - variance), value]
  return random.uniform(*value_range)