def run_pipeline_on(pipeline, item, **kwargs):
    """
    Helper function for running the pipeline on the item, returns the processed item.
    :param pipeline: pipeline or Pr
    :param item: item to be processed
    :param kwargs: the keyword arguments to pass on to the Prs
    :return: processed item
    """
    if pipeline is None:
        return item
    if isinstance(pipeline, list):
        for pr in pipeline:
            item = run_pipeline_on(pr, item, **kwargs)
    else:
        item = pipeline(item, **kwargs)
    return item