<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cov_from_scales(self, scales):
 """Return a covariance matrix built from a dictionary of scales. `scales` is a dictionary keyed by stochastic instances, and the values refer are the variance of the jump distribution for each stochastic. If a stochastic is a sequence, the variance must have the same length. """


        # Get array of scales
        ord_sc = []
        for stochastic in self.stochastics:
            ord_sc.append(np.ravel(scales[stochastic]))
        ord_sc = np.concatenate(ord_sc)

        if np.squeeze(ord_sc).shape[0] != self.dim:
            raise ValueError("Improper initial scales, dimension don't match",
                             (np.squeeze(ord_sc), self.dim))

        # Scale identity matrix
        return np.eye(self.dim) * ord_sc