def violin_plot(df: pd.DataFrame, save_name: str, augmented: bool) -> None:
    'Save violin plot for the interesting parameters using df'
    directions_dict = {'No Action': 2.0, 'Turn Left': 3.0, 'Turn Right': 4.0, 'Continue Straight': 5.0}

    def set_lines(ax):
        for l in ax.lines:
            l.set_linestyle('--')
            l.set_linewidth(0.6)
            l.set_color('white')
            l.set_alpha(0.7)
        for l in ax.lines[1::3]:
            l.set_linestyle('-')
            l.set_linewidth(1.3)
            l.set_color('black')
            l.set_alpha(0.8)
    for key in directions_dict:
        data = df[(df['directions'] == directions_dict[key])]
        fig = plt.figure(figsize=(8, 6))
        gs = fig.add_gridspec(1, 4)
        fig.add_subplot(gs[(0, 0)])
        ax = sns.violinplot(y='steer', data=data, color='r', inner='quartile')
        set_lines(ax)
        fig.add_subplot(gs[(0, 1)])
        ax = sns.violinplot(y='throttle', data=data, color='g', inner='quartile')
        set_lines(ax)
        fig.add_subplot(gs[(0, 2)])
        ax = sns.violinplot(y='brake', data=data, color='b', inner='quartile')
        set_lines(ax)
        fig.add_subplot(gs[(0, 3)])
        ax = sns.violinplot(y='speed', data=data, color='m', inner='quartile')
        set_lines(ax)
        fig.tight_layout()
        fig.subplots_adjust(top=0.88)
        stitle = f'Direction: {key} - $N={len(data)}$ - ${((100 * len(data)) / len(df)):6.3f}$% of total'
        stitle = (f'{stitle} - Augmented' if augmented else stitle)
        fig.suptitle(stitle, fontsize=16)
        fname = f"{save_name}-{key.replace(' ', '')}"
        fname = (f'{fname}-aug' if augmented else fname)
        fig_name = os.path.join(os.getcwd(), 'data_analysis', save_name, 'violin_plots', f'{fname}.png')
        os.makedirs(os.path.join(os.getcwd(), 'data_analysis', save_name, 'violin_plots'), exist_ok=True)
        plt.savefig(fig_name)
        plt.close()
Save violin plot for the interesting parameters using df
def violin_plot(df: pd.DataFrame, save_name: str, augmented: bool) -> None:
    
    directions_dict = {'No Action': 2.0, 'Turn Left': 3.0, 'Turn Right': 4.0, 'Continue Straight': 5.0}

    def set_lines(ax):
        for l in ax.lines:
            l.set_linestyle('--')
            l.set_linewidth(0.6)
            l.set_color('white')
            l.set_alpha(0.7)
        for l in ax.lines[1::3]:
            l.set_linestyle('-')
            l.set_linewidth(1.3)
            l.set_color('black')
            l.set_alpha(0.8)
    for key in directions_dict:
        data = df[(df['directions'] == directions_dict[key])]
        fig = plt.figure(figsize=(8, 6))
        gs = fig.add_gridspec(1, 4)
        fig.add_subplot(gs[(0, 0)])
        ax = sns.violinplot(y='steer', data=data, color='r', inner='quartile')
        set_lines(ax)
        fig.add_subplot(gs[(0, 1)])
        ax = sns.violinplot(y='throttle', data=data, color='g', inner='quartile')
        set_lines(ax)
        fig.add_subplot(gs[(0, 2)])
        ax = sns.violinplot(y='brake', data=data, color='b', inner='quartile')
        set_lines(ax)
        fig.add_subplot(gs[(0, 3)])
        ax = sns.violinplot(y='speed', data=data, color='m', inner='quartile')
        set_lines(ax)
        fig.tight_layout()
        fig.subplots_adjust(top=0.88)
        stitle = f'Direction: {key} - $N={len(data)}$ - ${((100 * len(data)) / len(df)):6.3f}$% of total'
        stitle = (f'{stitle} - Augmented' if augmented else stitle)
        fig.suptitle(stitle, fontsize=16)
        fname = f"{save_name}-{key.replace(' ', )}"
        fname = (f'{fname}-aug' if augmented else fname)
        fig_name = os.path.join(os.getcwd(), 'data_analysis', save_name, 'violin_plots', f'{fname}.png')
        os.makedirs(os.path.join(os.getcwd(), 'data_analysis', save_name, 'violin_plots'), exist_ok=True)
        plt.savefig(fig_name)
        plt.close()