def keycode(self, keycode, action):
    """Sends a KeyCode event to Google TV.

    Args:
      keycode: A Code from keycodes_pb2.
      action: Either "down" (pressed) or "up" (released).
    """
    req = remote_pb2.RequestMessage()
    req.key_event_message.keycode = keycode
    if action in 'up':
      req.key_event_message.action = keycodes_pb2.UP
    else:
      req.key_event_message.action = keycodes_pb2.DOWN
    self._send_message(req)
dataset/ETHPy150Open stevenle/googletv-anymote/googletv/__init__.py/AnymoteProtocol.keycode/operator `==` -> `in`