def calc_ttr(df_ttr):
    """Calculate travel time reliability for auto and bus.
    Args: df_ttr, a pandas dataframe.
    Returns: df_ttr, a pandas dataframe with new columns:
             VOLa, Yearly Auto volumes.
             VOLb, Yearly Bus volumes.
             ttr,  Travel Time Reliability.
    """
    # Working vehicle occupancy assumptions:
    VOCa = 1.4
    VOCb = 12.6
    
    df_ttr['VOLa'] = df_ttr['pct_auto'] * df_ttr['dir_aadt'] * 365
    df_ttr['VOLb'] = df_ttr['pct_bus'] * df_ttr['dir_aadt'] * 365

    df_ttr['ttr'] = (df_ttr['miles'] * df_ttr['VOLa'] * VOCa 
                     + df_ttr['miles'] * df_ttr['VOLb'] *VOCb)

    return df_ttr