def _get_week_of_year(arg):
    """
    Get the week position in the year starting from 0. All days in a new 
    year preceding the first Monday are considered to be in week 0.
        
    Parameters
    ----------
    arg : tuple
    
    Returns
    -------
    int with the correct iso week (weeks starting on Monday) of the year.
    """
    d1 = date(arg[0], arg[1]-1, arg[2])
    d0 = date(arg[0], 0, 1)
    firstday = d0.getDay()
    if firstday == 0 : firstday = 7
    firstweek = 8 - firstday
    doy = arg[7]
    if firstday != 1:
        doy = doy - firstweek
    if doy % 7 == 0:
        week_number = doy // 7
    else:
        week_number = doy // 7 + 1
    return week_number
dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/time.py/_get_week_of_year/original