from typing import Counter


def get_x_label_positions(categories, lines=True):  # same
    """
    This method is used get the position of the x-labels and the lines between the columns

    :param categories: list of the categories
    :param lines: a boolean which determines the locations returned (either the center of each category or the end)
    :type categories:
    :type lines: bool

    :returns: A list of positions
    :rtype: list of ints

    """
    tt = Counter(categories)
    s = 0
    label_positions = []
    for _, v in tt.items():
        if lines:
            inc = v // 2
        else:
            inc = v
        label_positions.append(s + inc)
        s += v
    return label_positions