def _get_glsl(to_insert, shader_type=None, location=None, exclude_origins=()):
    """From a `to_insert` list of (shader_type, location, origin, snippet), return the
    concatenated snippet that satisfies the specified shader type, location, and origin."""
    return '\n'.join((
        snippet
        for (shader_type_, location_, origin_, snippet) in to_insert
        if shader_type_ == shader_type and location_ == location and
        origin_ not in exclude_origins
    ))