here is my code i am facing this error i am not able to find the error fix the error shoow
def get_key(res_by):
    if res_by == '#1':
        key = 'transaction_id'
    elif res_by == '#2':
        key = 'created'
    return key
def get_chart(chart_type, data, results_by, **kwargs):
        plt.switch_backend('AGG')
        fig = plt.figure(figsize=(10,4))
        key = get_key(results_by)
        
thats the code
 
     
    