def validate_oversampling(oversampling=None):
    """Validate the `oversampling` parameter.

    Checks whether the parameter is valid. This parameter can either be None
    (to use the default values) or it can be a dictionary containing the
    three keys "temperature", "humidity", and "pressure".

    Args:
        oversampling (dict): None or a dictionary with over-sampling values

    Returns:
        dict: oversampling values as a dictionary
    """
    if oversampling is None:
        oversampling = {'temperature': 2,
                        'pressure': 2,
                        'humidity': 2}

    if not isinstance(oversampling, dict):
        raise TypeError("oversampling must be a dictionary")

    return oversampling