def _mask_trigs(events, mask, mask_type):
 if ((not isinstance(mask_type, string_types)) or (mask_type not in ('not_and', 'and'))):
  raise ValueError(('mask_type must be "not_and" or "and", got %s' % (mask_type,)))
 if (mask is not None):
  if (not isinstance(mask, int)):
   raise TypeError((('You provided a(n) %s.' % type(mask)) + 'Mask must be an int or None.'))
 n_events = len(events)
 if (n_events == 0):
  return events.copy()
 if (mask is not None):
  if (mask_type == 'not_and'):
   mask = np.bitwise_not(mask)
  elif (mask_type != 'and'):
   if (mask_type is not None):
    raise ValueError(("'mask_type' should be either 'and' or 'not_and', instead of '%s'" % mask_type))
  events[:, 1:] = np.bitwise_and(events[:, 1:], mask)
 events = events[(events[:, 1] != events[:, 2])]
 return events

def _mask_trigs ( events , mask , mask_type ) : if ( ( not isinstance ( mask_type , string_types ) ) or ( mask_type not in ( 'not_and' , 'and' ) ) ) : raise ValueError ( ( 'mask_type must be "not_and" or "and", got %s' % ( mask_type , ) ) ) if ( mask is not None ) : if ( not isinstance ( mask , int ) ) : raise TypeError ( ( ( 'You provided a(n) %s.' % type ( mask ) ) + 'Mask must be an int or None.' ) ) n_events = len ( events ) if ( n_events == 0 ) : return events . copy ( ) if ( mask is not None ) : if ( mask_type == 'not_and' ) : mask = np . bitwise_not ( mask ) elif ( mask_type != 'and' ) : if ( mask_type is not None ) : raise ValueError ( ( "'mask_type' should be either 'and' or 'not_and', instead of '%s'" % mask_type ) ) events [ : , 1 : ] = np . bitwise_and ( events [ : , 1 : ] , mask ) events = events [ ( events [ : , 1 ] != events [ : , 2 ] ) ] return events
mask digital trigger values .