<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def pseudo_inv(self,maxsing=None,eigthresh=1.0e-5):
 """ The pseudo inverse of self. Formed using truncated singular value decomposition and Matrix.pseudo_inv_components Parameters maxsing : int the number of singular components to use. If None, maxsing is calculated using Matrix.get_maxsing() and eigthresh eigthresh : float the ratio of largest to smallest singular components to use for truncation. Ignored if maxsing is not None Returns ------- Matrix : Matrix """

        if maxsing is None:
            maxsing = self.get_maxsing(eigthresh=eigthresh)
        full_s = self.full_s.T
        for i in range(self.s.shape[0]):
            if i <= maxsing:
                full_s.x[i,i] = 1.0 / full_s.x[i,i]
            else:
                full_s.x[i,i] = 0.0
        return self.v * full_s * self.u.T