<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _adjust_limits(self):
 """ Sets the active power limits, 'p_max' and 'p_min', according to the pwl cost function points. """

        if not self.is_load:
#            self.p_min = min([point[0] for point in self.p_cost])
            self.p_max = max([point[0] for point in self.p_cost])
        else:
            p_min = min([point[0] for point in self.p_cost])
            self.p_max = 0.0
            self.q_min = self.q_min * p_min / self.p_min
            self.q_max = self.q_max * p_min / self.p_min
            self.p_min = p_min