@staticmethod
def _set_constraints(kerns, STS):
    """
        Sets hyperparameter constraints on kernels.
        """
    if STS.thetabounds is not None:
        kerns[0].variance.constrain_bounded(STS.thetabounds[0][0], STS.
            thetabounds[0][1], warning=False)
        for i in range(STS.dim):
            kerns[i].lengthscale.constrain_bounded(STS.thetabounds[i + 1][0
                ], STS.thetabounds[i + 1][1], warning=False)
    for i in range(STS.dim):
        if STS.kerntype[i] == 'stdp':
            kerns[i].period.constrain_fixed(STS.periods[i], warning=False)
    if STS.dim > 1:
        for i in range(1, STS.dim):
            kerns[i].variance.constrain_fixed(1.0, warning=False)
