def get_cases(stat):
    x = []
    y = []
    d = [0]
    dx = [0]
    if (len(stat) == 0):
        return 1
    dat = 0
    state = stat
    reader = csv.DictReader(open('cases.csv'))
    for raw in reader:
        if (raw['state'] == state):
            dat += 1
            x.append(dat)
            dx.append(dat)
            y.append(raw['cases'])
            d.append(raw['deaths'])
        else:
            continue
    (fig, axs) = plt.subplots(2, figsize=(12, 10))
    fig.suptitle(f'COVID-19 Cases/Deaths in {stat}')
    axs[0].plot(x, y)
    axs[1].plot(dx, d)
    axs[0].set_ylabel('Cases')
    axs[1].set_ylabel('Deaths')
    for axe in axs:
        axe.set_xlabel('Days since 2020-01-21')
    plt.savefig('static/plots/plot.png', bbox_inches='tight', dpi=400)
    return 0
def get_cases(stat):
    x = []
    y = []
    d = [0]
    dx = [0]
    if (len(stat) == 0):
        return 1
    dat = 0
    state = stat
    reader = csv.DictReader(open('cases.csv'))
    for raw in reader:
        if (raw['state'] == state):
            dat += 1
            x.append(dat)
            dx.append(dat)
            y.append(raw['cases'])
            d.append(raw['deaths'])
        else:
            continue
    (fig, axs) = plt.subplots(2, figsize=(12, 10))
    fig.suptitle(f'COVID-19 Cases/Deaths in {stat}')
    axs[0].plot(x, y)
    axs[1].plot(dx, d)
    axs[0].set_ylabel('Cases')
    axs[1].set_ylabel('Deaths')
    for axe in axs:
        axe.set_xlabel('Days since 2020-01-21')
    plt.savefig('static/plots/plot.png', bbox_inches='tight', dpi=400)
    return 0