def _split_runs_on_parameters(runs):
    """Finds runs containing parameterized gates and splits them into sequential
    runs excluding the parameterized gates.
    """

    def _is_dagnode_parameterized(node):
        return any(isinstance(param, Parameter) for param in node.op.params)

    out = []
    for run in runs:
        groups = groupby(run, _is_dagnode_parameterized)

        for group_is_parameterized, gates in groups:
            if not group_is_parameterized:
                out.append(list(gates))

    return out
Finds runs containing parameterized gates and splits them into sequential
    runs excluding the parameterized gates.