def _check_precisions(precisions, covariance_type, n_components, n_features):
 precisions = check_array(precisions, dtype=[np.float64, np.float32], ensure_2d=False, allow_nd=(covariance_type == 'full'))
 precisions_shape = {'full': (n_components, n_features, n_features), 'tied': (n_features, n_features), 'diag': (n_components, n_features), 'spherical': (n_components,)}
 _check_shape(precisions, precisions_shape[covariance_type], ('%s precision' % covariance_type))
 _check_precisions = {'full': _check_precisions_full, 'tied': _check_precision_matrix, 'diag': _check_precision_positivity, 'spherical': _check_precision_positivity}
 _check_precisions[covariance_type](precisions, covariance_type)
 return precisions

def _check_precisions ( precisions , covariance_type , n_components , n_features ) : precisions = check_array ( precisions , dtype = [ np . float64 , np . float32 ] , ensure_2d = False , allow_nd = ( covariance_type == 'full' ) ) precisions_shape = { 'full' : ( n_components , n_features , n_features ) , 'tied' : ( n_features , n_features ) , 'diag' : ( n_components , n_features ) , 'spherical' : ( n_components , ) } _check_shape ( precisions , precisions_shape [ covariance_type ] , ( '%s precision' % covariance_type ) ) _check_precisions = { 'full' : _check_precisions_full , 'tied' : _check_precision_matrix , 'diag' : _check_precision_positivity , 'spherical' : _check_precision_positivity } _check_precisions [ covariance_type ] ( precisions , covariance_type ) return precisions
validate user provided precisions .