def merge_runs_by_tag(runs, tags):
    """
    Collect the (step, value) tuples corresponding to individual tags for all runs.

    Therefore the result might look like this:
    <tagA>
      + step:
        - <run-1-steps>
        - <run-2-steps>
      + value:
        - <run-1-values>
        - <run-2-values>
      ...

    Arguments:
        runs (dict):
            Collection of data from all runs.
            Usually the output of `visualization.helpers.load_run`

        tags (list):
            List of the tags to merge.

    Returns:
        data (dict):
            Dictionary containing the merged scalar data of all runs.
            The data.keys is composed of `tags`.
    """
    _merged_runs = dict()

    # Merge the steps and values for each tag over all runs.
    for tag in tags:
        _run_values = [runs[run][tag]['value'] for run in runs]
        _run_steps = [runs[run][tag]['step'] for run in runs]
        _merged_runs[tag] = {
            'step': _run_steps,
            'value': _run_values
        }

    return _merged_runs