def METHOD_NAME(param, black_listed_ids):
    value = param.value
    stream_ids = [
        block.params['stream_id'].value
        for block in param.parent_flowgraph.iter_enabled_blocks()
        if isinstance(block, blocks.VirtualSink)
    ]
    # Check that the virtual sink's stream id is unique
    if isinstance(param.parent_block, blocks.VirtualSink) and stream_ids.count(value) >= 2:
        # Id should only appear once, or zero times if block is disabled
        raise ValidateError('Stream ID "{}" is not unique.'.format(value))
    # Check that the virtual source's steam id is found
    elif isinstance(param.parent_block, blocks.VirtualSource) and value not in stream_ids:
        raise ValidateError('Stream ID "{}" is not found.'.format(value))