<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _buildTraitCovar(self, trait_covar_type='freeform', rank=1, fixed_trait_covar=None, jitter=1e-4):
 """ Internal functions that builds the trait covariance matrix using the LIMIX framework Args: trait_covar_type: type of covaraince to use. Default 'freeform'. possible values are rank: rank of a possible lowrank component (default 1) fixed_trait_covar: PxP matrix for the (predefined) trait-to-trait covariance matrix if fixed type is used jitter: diagonal contribution added to freeform covariance matrices for regularization Returns: LIMIX::Covariance for Trait covariance matrix """

        assert trait_covar_type in ['freeform', 'diag', 'lowrank', 'lowrank_id', 'lowrank_diag', 'block', 'block_id', 'block_diag', 'fixed'], 'VarianceDecomposition:: trait_covar_type not valid'

        if trait_covar_type=='freeform':
            cov = FreeFormCov(self.P, jitter=jitter)
        elif trait_covar_type=='fixed':
            assert fixed_trait_covar is not None, 'VarianceDecomposition:: set fixed_trait_covar'
            assert fixed_trait_covar.shape[0]==self.P, 'VarianceDecomposition:: Incompatible shape for fixed_trait_covar'
            assert fixed_trait_covar.shape[1]==self.P, 'VarianceDecomposition:: Incompatible shape for fixed_trait_covar'
            cov = FixedCov(fixed_trait_covar)
        elif trait_covar_type=='diag':
            cov = DiagonalCov(self.P)
        elif trait_covar_type=='lowrank':
            cov = LowRankCov(self.P, rank=rank)
        elif trait_covar_type=='lowrank_id':
            cov = SumCov(LowRankCov(self.P, rank=rank), FixedCov(sp.eye(self.P)))
        elif trait_covar_type=='lowrank_diag':
            cov = SumCov(LowRankCov(self.P, rank=rank), DiagonalCov(self.P))
        elif trait_covar_type=='block':
            cov = FixedCov(sp.ones([self.P, self.P]))
        elif trait_covar_type=='block_id':
            cov1 = FixedCov(sp.ones([self.P, self.P]))
            cov2 = FixedCov(sp.eye(self.P)) 
            cov = SumCov(cov1, cov2)
        elif trait_covar_type=='block_diag':
            cov1 = FixedCov(sp.ones([self.P, self.P]))
            cov2 = FixedCov(sp.eye(self.P)) 
            cov = SumCov(cov1, cov2)
        return cov