def get_users_at(timestamp, last_output=None, now=None):
    """
    Return a set of strings corresponding to which users were logged in from
    which addresses at a given timestamp.

    Optional argument last_output is the output of "last". Will be filled in by
    actually executing "last" if not provided.

    Optional argument now is the current timestamp for parsing last_output. Will
    be taken from the system clock if not provided.
    """
    return None

@@ -1,8 +1,370 @@
+import sys%0A%0Aimport re%0A%0AUSERNAME_PART = %22(%5B%5E %5D+)%22%0ADEVICE_PART = %22(%5B%5E %5D+)%22%0AADDRESS_PART = %22(%5B%5E %5D+)?%22%0AFROM_PART = %22(.*)%22%0ADASH_PART = %22 . %22%0ATO_PART = %22(.*)%22%0ADURATION_PART = %22(%5B0-9+:%5D+)%22%0ALAST_RE = re.compile(%0A  USERNAME_PART +%0A  %22 +%22 +%0A  DEVICE_PART +%0A  %22 +%22 +%0A  ADDRESS_PART +%0A  %22 +%22 +%0A  FROM_PART +%0A  DASH_PART +%0A  TO_PART +%0A  %22 *%5C(%22 +%0A  DURATION_PART +%0A  %22%5C)%22%0A)%0A%0A%0A
 def get_
@@ -817,16 +817,550 @@
     
-return None
+users = set()%0A    for line in last_output.splitlines():%0A        match = LAST_RE.match(line)%0A        if not match:%0A            sys.stderr.write(%0A                %22WARNING: Please report unmatched last line at %7B%7D: %3C%7B%7D%3E%5Cn%22.format(%0A                    %22https://github.com/walles/px/issues/new%22, line))%0A            continue%0A%0A        # username = match.group(1)%0A        # device = match.group(2)%0A        # address = match.group(3)%0A        # from_s = match.group(4)%0A        # to_s = match.group(5)%0A        # duration_s = match.group(6)%0A%0A    return users
 %0A

Create regexp to match at least some last lines