def state(self, time=None):
if not len(self.infos(type=State)):<EOL><INDENT>return None<EOL><DEDENT>if time is None:<EOL><INDENT>return max(self.infos(type=State), key=attrgetter("<STR_LIT>"))<EOL><DEDENT>else:<EOL><INDENT>states = [s for s in self.infos(type=State) if s.creation_time < time]<EOL>return max(states, key=attrgetter("<STR_LIT>"))<EOL><DEDENT>
The most recently-created info of type State at the specfied time.

        If time is None then it returns the most recent state as of now.