from typing import Counter


def get_interval_histogram(chorale):
    """
    Arguments
        chorale: a music21 Stream object

    Returns two interval histograms, one directed and one undirected,
    as collections.Counter objects for input chorale
    """
    directed_ih = Counter()
    undirected_ih = Counter()

    for part in chorale.parts:
        intervals = part.melodicIntervals()[1:]  # all but first meaningless result
        for interval in intervals:
            directed_ih[interval.directedName] += 1
            undirected_ih[interval.name] += 1

    return directed_ih, undirected_ih