def require_type(pipeline_item, ty):
    """
    Helper function to require that a pipeline item has a particular type
    """
    if 'type' not in pipeline_item:
        raise Exception('Pipeline item has no type')
    if pipeline_item['type'] != ty:
        raise Exception('Invalid pipeline item type')
