def normalize(x, min_value, max_value):
    """Normalize value between min and max values.
    It also clips the values, so that you cannot have values higher or lower
    than 0 - 1."""
    x = (x - min_value) / (max_value - min_value)
    return clip(x, 0, 1)
Normalize value between min and max values.
    It also clips the values, so that you cannot have values higher or lower
    than 0 - 1.