def closest_value(value, list_of_values):
    """

    Get the closet value in a list of values.

    :param value: a numeric value.
    :type value: ``int``, ``float`` or ``datetime``
    :param list_of_values: an iterable.
    :type list_of_values: ``tuple``, ``list``, ``np.array``
    :return: item in `list_of_values` closet to `value`.
    :rtype: ``int``, ``float`` or ``datetime``
    """
    return min(list_of_values, key=lambda i: abs(i - value))
