def _CheckForLock(self):

    query = ("SELECT lock_expiration, lock_owner FROM locks "
             "WHERE subject_hash=unhex(md5(%s))")
    args = [self.subject]
    rows = self.store.ExecuteQuery(query, args)
    for row in rows:

      # We own this lock now.
      if (row["lock_expiration"] == self.expires_lock and
          row["lock_owner"] == self.lock_token):
        return

      else:
        # Someone else owns this lock.
        raise data_store.TransactionError("Subject %s is locked" % self.subject)

    # If we get here the row does not exist:
    query = ("INSERT IGNORE INTO locks "
             "SET lock_expiration=%s, lock_owner=%s, "
             "subject_hash=unhex(md5(%s))")
    args = [self.expires_lock, self.lock_token, self.subject]
    self.store.ExecuteQuery(query, args)

    self._CheckForLock()
MayaNodePath : DagPathSep MayaShortName
dataset/ETHPy150Open google/grr/grr/lib/data_stores/mysql_advanced_data_store.py/MySQLTransaction._CheckForLock--crossover with--dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.5/extras/completion/py/pymel/util/nameparse.py/MayaNodePathParser.p_node