original_string: public function check_state($key, $ownerid) {
          if (array_key_exists($key, $this->locks)) {
              // The key is locked and we own it.
              return true;
          }
          $lockfile = $this->get_lock_file($key);
          if (file_exists($lockfile)) {
              // The key is locked and we don't own it.
              return false;
          }
          return null;
      }
code: public function check_state($key, $ownerid) {
          if (array_key_exists($key, $this->locks)) {
              // The key is locked and we own it.
              return true;
          }
          $lockfile = $this->get_lock_file($key);
          if (file_exists($lockfile)) {
              // The key is locked and we don't own it.
              return false;
          }
          return null;
      }
code_tokens: public function check_state ( $ key , $ ownerid ) { if ( array_key_exists ( $ key , $ this -> locks ) ) { // The key is locked and we own it. return true ; } $ lockfile = $ this -> get_lock_file ( $ key ) ; if ( file_exists ( $ lockfile ) ) { // The key is locked and we don't own it. return false ; } return null ; }
docstring: Checks if the given key is locked.
  
  @param string $key
  @param string $ownerid
docstring_tokens: Checks if the given key is locked .