import random


def relative_uniform(mean, scale_factor):
    """Returns a value from a uniform distribution where the min and max
    are scaled relative to the middle value given as the mean"""
    return random.uniform(mean * (1 - scale_factor), mean * (1 + scale_factor))