parameters: (self, topic, ts)
return_statement: return best
docstring: Get the entry of the message closest to the given timestamp.
docstring_summary: Get the entry of the message closest to the given timestamp.
docstring_tokens: Get the entry of the message closest to the given timestamp .
function: def get_closest_message(self, topic, ts):
          """Get the entry of the message closest to the given timestamp."""
          best = None
          best_t = None
          for entry in self.get_window_messages(topic, ts):
              if best is None or abs(entry.time - ts) < best_t:
                  best = entry
                  best_t = abs(entry.time - ts)
          return best
function_tokens: def get_closest_message ( self , topic , ts ) : best = None best_t = None for entry in self . get_window_messages ( topic , ts ) : if best is None or abs ( entry . time - ts ) < best_t : best = entry best_t = abs ( entry . time - ts ) return best