def find_exchange_or_parameter_by_id(dataset, uuid):
    """Find exchange or parameter in ``dataset`` with id ``uuid``.

    Raises ``ValueError`` if not found in dataset."""
    for exc in dataset['exchanges']:
        if exc['id'] == uuid:
            return exc
    for param in dataset.get('parameters', []):
        if param['id'] == uuid:
            return param
    raise ValueError("Exchange id {} not found in dataset".format(uuid))