def _apply_scaling_cov(data, picks_list, scalings):
 scalings = _check_scaling_inputs(data, picks_list, scalings)
 scales = None
 if isinstance(scalings, dict):
  n_channels = len(data)
  covinds = list(zip(*picks_list))[1]
  assert (len(data) == sum((len(k) for k in covinds)))
  assert (list(sorted(np.concatenate(covinds))) == list(range(len(data))))
  scales = np.zeros(n_channels)
  for (ch_t, idx) in picks_list:
   scales[idx] = scalings[ch_t]
 elif isinstance(scalings, np.ndarray):
  if (len(scalings) != len(data)):
   raise ValueError('Scaling factors and data are of incompatible shape')
  scales = scalings
 elif (scalings is None):
  pass
 else:
  raise RuntimeError('Arff...')
 if (scales is not None):
  assert (np.sum((scales == 0.0)) == 0)
  data *= (scales[None, :] * scales[:, None])

def _apply_scaling_cov ( data , picks_list , scalings ) : scalings = _check_scaling_inputs ( data , picks_list , scalings ) scales = None if isinstance ( scalings , dict ) : n_channels = len ( data ) covinds = list ( zip ( * picks_list ) ) [ 1 ] assert ( len ( data ) == sum ( ( len ( k ) for k in covinds ) ) ) assert ( list ( sorted ( np . concatenate ( covinds ) ) ) == list ( range ( len ( data ) ) ) ) scales = np . zeros ( n_channels ) for ( ch_t , idx ) in picks_list : scales [ idx ] = scalings [ ch_t ] elif isinstance ( scalings , np . ndarray ) : if ( len ( scalings ) != len ( data ) ) : raise ValueError ( 'Scaling factors and data are of incompatible shape' ) scales = scalings elif ( scalings is None ) : pass else : raise RuntimeError ( 'Arff...' ) if ( scales is not None ) : assert ( np . sum ( ( scales == 0.0 ) ) == 0 ) data *= ( scales [ None , : ] * scales [ : , None ] )
scale resulting data after estimation .