def _get_sources_with_sink(node_str, connections):
    """Returns the source nodes that are connected to the sink node with the
    given string representation.

    Args:
        node_str: a string representation of a PipelineNode
        connections: a list of PipelineConnection instances

    Returns:
        a list of PipelineNodes that are connected to the given sink node.
    """
    return [c.source for c in connections if c.sink.is_same_node_str(node_str)]