@classmethod
def from_pipeline(cls, pipeline, actions=None, proba=None, repeat=None):
    """ Create a pipeline from another pipeline """
    if proba is None:
        if repeat is None:
            new_p = cls(pipeline=pipeline, actions=actions)
        elif pipeline.num_actions == 1 and pipeline.get_last_action_proba(
            ) is None:
            new_p = cls(pipeline=pipeline, repeat=repeat)
        else:
            new_p = cls()
            new_p.append_pipeline(pipeline, repeat=repeat)
    elif pipeline.num_actions == 1 and pipeline.get_last_action_repeat(
        ) is None:
        new_p = cls(pipeline=pipeline, proba=proba)
    else:
        new_p = cls()
        new_p.append_pipeline(pipeline, proba=proba)
    return new_p
