code: def is_locked(self):
          
          _lockScreenRE = re.compile('mShowingLockscreen=(true|false)')
          m = _lockScreenRE.search(self.shell('dumpsys', 'window', 'policy'))
          if m:
              return (m.group(1) == 'true')
          raise RuntimeError("Couldn't determine screen lock state")
docs: Returns:
              - lock state(bool)
          Raises:
              RuntimeError