<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _shock_create(self, h, shock_type, shock_index, shock_value, shock_dir, irf_intervals):
 """ Function creates shocks based on desired specification Parameters h : int How many steps ahead to forecast shock_type : None or str Type of shock; options include None, 'Cov' (simulate from covariance matrix), 'IRF' (impulse response shock) shock_index : int Which latent variables to apply the shock to if using an IRF. shock_value : None or float If specified, applies a custom-sized impulse response shock. shock_dir : str Direction of the IRF shock. One of 'positive' or 'negative'. irf_intervals : Boolean Whether to have intervals for the IRF plot or not Returns A h-length list which contains np.arrays containing shocks for each variable """
     

        if shock_type is None:

            random = [np.zeros(self.ylen) for i in range(0,h)]

        elif shock_type == 'IRF':

            if self.use_ols_covariance is False:
                cov = self.custom_covariance(self.latent_variables.get_z_values())
            else:
                cov = self.ols_covariance()

            post = ss.multivariate_normal(np.zeros(self.ylen),cov)
            
            if irf_intervals is False:
                random = [np.zeros(self.ylen) for i in range(0,h)]
            else:
                random = [post.rvs() for i in range(0,h)]
                random[0] = np.zeros(self.ylen)

            if shock_value is None:
                if shock_dir=='positive':
                    random[0][shock_index] = cov[shock_index,shock_index]**0.5
                elif shock_dir=='negative':
                    random[0][shock_index] = -cov[shock_index,shock_index]**0.5
                else:
                    raise ValueError("Unknown shock direction!")    
            else:
                random[0][shock_index] = shock_value        

        elif shock_type == 'Cov':
            
            if self.use_ols_covariance is False:
                cov = self.custom_covariance(self.latent_variables.get_z_values())
            else:
                cov = self.ols_covariance()

            post = ss.multivariate_normal(np.zeros(self.ylen),cov)
            random = [post.rvs() for i in range(0,h)]

        return random