<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def reset_case(self):
 """ Returns the case to its original state. """

        for bus in self.market.case.buses:
            bus.p_demand = self.pdemand[bus]
        for task in self.tasks:
            for g in task.env.generators:
                g.p = task.env._g0[g]["p"]
                g.p_max = task.env._g0[g]["p_max"]
                g.p_min = task.env._g0[g]["p_min"]
                g.q = task.env._g0[g]["q"]
                g.q_max = task.env._g0[g]["q_max"]
                g.q_min = task.env._g0[g]["q_min"]
                g.p_cost = task.env._g0[g]["p_cost"]
                g.pcost_model = task.env._g0[g]["pcost_model"]
                g.q_cost = task.env._g0[g]["q_cost"]
                g.qcost_model = task.env._g0[g]["qcost_model"]
                g.c_startup = task.env._g0[g]["startup"]
                g.c_shutdown = task.env._g0[g]["shutdown"]