def plot_helper(query_samples: Tensor, func: Callable) -> Tuple[(List[go.Scatter], List[str])]:
    '\n    this function executes a plot-related function, passed as input parameter func, and\n    outputs a tuple including plotly object and its corresponding legend.\n    '
    (num_chain, num_samples, single_sample_sz) = _samples_info(query_samples)
    (x_axis, y_axis, all_labels) = ([], [], [])
    for chain in range(num_chain):
        flattened_data = query_samples[chain].reshape(num_samples, (- 1))
        numel = flattened_data[0].numel()
        (x_axis_data, y_axis_data, labels) = ([], [], [])
        for i in range(numel):
            index = np.unravel_index(i, single_sample_sz)
            data = flattened_data[:, i]
            partial_label = f' for {list(index)}'
            (x_data, y_data) = func(data.detach())
            x_axis_data.append(x_data)
            y_axis_data.append(y_data)
            labels.append(partial_label)
        x_axis.append(x_axis_data)
        y_axis.append(y_axis_data)
        all_labels.append(labels)
    return trace_helper(x_axis, y_axis, all_labels[0])
this function executes a plot-related function, passed as input parameter func, and
outputs a tuple including plotly object and its corresponding legend.
def plot_helper(query_samples: Tensor, func: Callable) -> Tuple[(List[go.Scatter], List[str])]:
    '\n    this function executes a plot-related function, passed as input parameter func, and\n    outputs a tuple including plotly object and its corresponding legend.\n    '
    (num_chain, num_samples, single_sample_sz) = _samples_info(query_samples)
    (x_axis, y_axis, all_labels) = ([], [], [])
    for chain in range(num_chain):
        flattened_data = query_samples[chain].reshape(num_samples, (- 1))
        numel = flattened_data[0].numel()
        (x_axis_data, y_axis_data, labels) = ([], [], [])
        for i in range(numel):
            index = np.unravel_index(i, single_sample_sz)
            data = flattened_data[:, i]
            partial_label = f' for {list(index)}'
            (x_data, y_data) = func(data.detach())
            x_axis_data.append(x_data)
            y_axis_data.append(y_data)
            labels.append(partial_label)
        x_axis.append(x_axis_data)
        y_axis.append(y_axis_data)
        all_labels.append(labels)
    return trace_helper(x_axis, y_axis, all_labels[0])