code: def _find_utmp():
      '''
      Figure out which utmp file to use when determining runlevel.
      Sometimes /var/run/utmp doesn't exist, /run/utmp is the new hotness.
      '''
      result = {}
      # These are the likely locations for the file on Ubuntu
      for utmp in '/var/run/utmp', '/run/utmp':
          try:
              result[os.stat(utmp).st_mtime] = utmp
          except Exception:
              pass
      if result:
          return result[sorted(result).pop()]
      else:
          return Falsf _find_utmp():
      '''
      Figure out which utmp file to use when determining runlevel.
      Sometimes /var/run/utmp doesn't exist, /run/utmp is the new hotness.
      '''
      result = {}
      # These are the likely locations for the file on Ubuntu
      for utmp in '/var/run/utmp', '/run/utmp':
          try:
              result[os.stat(utmp).st_mtime] = utmp
          except Exception:
              pass
      if result:
          return result[sorted(result).pop()]
      else:
          return False
docs: Figure out which utmp file to use when determining runlevel.
      Sometimes /var/run/utmp doesn't exist, /run/utmp is the new hotness.