def normalize(lst, maxval=1.):
    """
    Normalizes a list of values with a specified value.

    **Parameters**

    lst: *list*
        List of values to be normalized

    maxval: *float*, optional
        The maximum value that the list will have after normalization.


    **Returns**

    normalized list: *list*
        A list of values normalized to the specified value.

    """
    listmax = max(lst)
    for ind, val in enumerate(lst):
        lst[ind] = float(val) / float(listmax) * maxval
    return lst