from typing import Union
from typing import Dict
import random


def get_value(value_or_range: Union[float, Dict[str, float]]) -> float:
    """
    Get a specific or random value from a given specification.

    The specification can either be the value itself, or an interval
    given through a dictionary with the entries \"min\" and \"max\"
    specifying respectively the minimal and maximal value of the
    interval to uniformly choose from.
    """
    if isinstance(value_or_range, dict):
        return random.uniform(value_or_range["min"],
                              value_or_range["max"])
    return value_or_range