parameters: (inputEvents, wantedKeys)
docstring: Filter the given input events to contain only presses and releases of
  	the given keys.
  	The wantedKeys argument should be mapping from row to a column bitmask,
  	where bits are set if we want to preserve changes in the corresponding
  	position in the keyboard matrix.
docstring_summary: Filter the given input events to contain only presses and releases of
  	the given keys.
  	The wantedKeys argument should be mapping from row to a column bitmask,
  	where bits are set if we want to preserve changes in the corresponding
  	position in the keyboard matrix.
docstring_tokens: Filter the given input events to contain only presses and releases of the given keys . The wantedKeys argument should be mapping from row to a column bitmask where bits are set if we want to preserve changes in the corresponding position in the keyboard matrix .
function: def filterEvents(inputEvents, wantedKeys):
  	'''Filter the given input events to contain only presses and releases of
  	the given keys.
  	The wantedKeys argument should be mapping from row to a column bitmask,
  	where bits are set if we want to preserve changes in the corresponding
  	position in the keyboard matrix.
  	'''
  	for time, row, press, release in inputEvents:
  		mask = wantedKeys.get(row, 0)
  		press &= mask
  		release &= mask
  		if press != 0 or release != 0:
  			yield time, row, press, release
function_tokens: def filterEvents ( inputEvents , wantedKeys ) : for time , row , press , release in inputEvents : mask = wantedKeys . get ( row , 0 ) press &= mask release &= mask if press != 0 or release != 0 : yield time , row , press , release