def quater_maker(d):
    '''
    Return the corresponding quarter for a given date.

    Parameters
    ----------
    d: datetime object
        The date you'd like to process

    Returns
    -------
    str :
        The corresponding quarter in a string.
        ie. 'Q1', 'Q2', 'Q3',  or 'Q4'

    '''
    d = d.month
    quaters = {
        "Q1": [1, 2, 3],
        "Q2": [4, 5, 6],
        "Q3": [7, 8, 9],
        "Q4": [10, 11, 12]
    }
    return list((key for key in quaters.keys() if d in quaters[key]))[0]
dataset/ETHPy150Open agconti/KaggleAux/kaggleaux/utils.py/quater_maker/original