<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def chi_squareds(self, p=None):
 """ Returns a list of chi squared for each data set. Also uses ydata_massaged. p=None means use the fit results """

        if len(self._set_xdata)==0 or len(self._set_ydata)==0: return None
        
        if p is None: p = self.results[0]

        # get the residuals
        rs = self.studentized_residuals(p)

        # Handle the none case
        if rs == None: return None

        # square em and sum em.
        cs = []
        for r in rs: cs.append(sum(r**2))
        return cs