def get_numbers_of_blocks(connection):
    """
    Get number of generated and processed blocks for the last n days(argument)

    :param connection: pymysql.Connection

    :return: number of blocks
    :rtype: int
    """

    cur = connection.cursor()
    cur.execute("SELECT COUNT(*) FROM Block ")

    for row in cur:
        number = row[0]
        cur.close()
        return number