def resolve(self, states):

    def key((_, timestamp)):
      if timestamp is None:
        return 0
      return timestamp
    states.sort(key=key)
    return states[-1][0]
Resolve a list of tuples (state, time) to find the latest states.
dataset/ETHPy150Open tomwilkie/awesomation/src/appengine/room.py/Room.resolve