def seconds_for_analysis(duration, measurement_type, selector):
    """Get duration for specified measurement type and selector."""
    if measurement_type in duration:
        data = duration[measurement_type]
        if selector in data:
            return data[selector].duration_seconds
    return 0