Ensure the sync counter is a valid non-dummy object.
175604
def _ensure_counter(self):
        """"""
        if not isinstance(self.sync_counter, self._SynchronizationManager):
            self.sync_counter = self._SynchronizationManager()
1107827
def _synchronized(meth):
    """"""

    @functools.wraps(meth)
    def wrapper(self, *args, **kwargs):
        with self._lock:
            return meth(self, *args, **kwargs)

    return wrapper
319354
public void validate() {
    synchronized (mSharedMapsLock) {
      // Compute block lock reference counts based off of lock records
      ConcurrentMap<Long, AtomicInteger> blockLockReferenceCounts = new ConcurrentHashMap<>();
      for (LockRecord record : mLockIdToRecordMap.values()) {
        blockLockReferenceCounts.putIfAbsent(record.getBlockId(), new AtomicInteger(0));
        blockLockReferenceCounts.get(record.getBlockId()).incrementAndGet();
      }

      // Check that the reference count for each block lock matches the lock record counts.
      for (Entry<Long, ClientRWLock> entry : mLocks.entrySet()) {
        long blockId = entry.getKey();
        ClientRWLock lock = entry.getValue();
        Integer recordCount = blockLockReferenceCounts.get(blockId).get();
        Integer referenceCount = lock.getReferenceCount();
        if (!Objects.equal(recordCount, referenceCount)) {
          throw new IllegalStateException("There are " + recordCount + " lock records for block"
              + " id " + blockId + ", but the reference count is " + referenceCount);
        }
      }

      // Check that if a lock id is mapped to by a session id, the lock record for that lock id
      // contains that session id.
      for (Entry<Long, Set<Long>> entry : mSessionIdToLockIdsMap.entrySet()) {
        for (Long lockId : entry.getValue()) {
          LockRecord record = mLockIdToRecordMap.get(lockId);
          if (record.getSessionId() != entry.getKey()) {
            throw new IllegalStateException("The session id map contains lock id " + lockId
                + "under session id " + entry.getKey() + ", but the record for that lock id ("
                + record + ")" + " doesn't contain that session id");
          }
        }
      }
    }
  }
90879
def sync=(sync)
      validator = EnumAttributeValidator.new('String', ["true", "false"])
      unless validator.valid?(sync)
        fail ArgumentError, "invalid value for 'sync', must be one of #{validator.allowable_values}."
      end
      @sync = sync
    end
669126
function Counter() {
  this.total = 0;
  this.executed = 0;
  this.passed = 0;
  this.error = 0;
  this.failed = 0;
  this.timeout = 0;
  this.aborted = 0;
  this.inconclusive = 0;
  this.passedButRunAborted = 0;
  this.notRunnable = 0;
  this.notExecuted = 0;
  this.disconnected = 0;
  this.warning = 0;
  this.completed = 0;
  this.inProgress = 0;
  this.pending = 0;
}
168196
def setRepCount(self, count):
        """"""
        self._rep_default_cache[0] = count
        self.ui.trackview.model().setRepCount(count)
237161
private void countAndVerifyObjects()
                    throws IOException,
                    EOFException,
                    FileManagerException,
                    ClassNotFoundException,
                    HashtableOnDiskException {
        println("countAndVerifyObjects(): Hashtable " + filename + " was not closed properly.  Validating ");
        header.set_num_objects(0);

        HashtableAction act = new HashtableAction() {
            public boolean execute(HashtableEntry e)
                            throws IOException
            {
                if ((header.num_objects() % 100) == 0) {
                    print(".");
                }
                header.incrementObjectCount();
                if (item_initialize != null) {
                    item_initialize.initialize(e.getKey(), e.getValue());
                }
                return true;
            }
        };

        walkHash(act, RETRIEVE_ALL, 0, -1);

        header.write();
        println("countAndVerifyObjects(): done");
    }
1106265
def synchronized(sync_lock):
    """"""

    def wrapper(f):
        """The decorator's core function.

        :param f:
        :return:
        """

        @functools.wraps(f)
        def inner_wrapper(*args, **kw):
            """

            :param args:
            :param kw:
            :return:
            """
            with sync_lock:
                return f(*args, **kw)

        return inner_wrapper

    return wrapper
323303
def sync(self):
        """"""
        for key_hash, obj in six.iteritems(self._cache):
            # Objects are checked for expiration in __getitem__,
            # but we can check here to avoid unnecessary writes.
            if not obj.has_expired():
                file_path = self._path_for_hash(key_hash)
                with open(str(file_path), self._write_mode) as f:
                    obj.dump(f)
1309911
def get_nonrentrant_counter(self, key):
        
        prefix = NONRENTRANT_STORAGE_OFFSET

        if key in self._nonrentrant_keys:
            return self._nonrentrant_keys[key]
        else:
            counter = prefix + self._nonrentrant_counter
            self._nonrentrant_keys[key] = counter
            self._nonrentrant_counter += 1
            return counter
1234202
def assert_valid(self, instance, value=None):
        """"""
        valid = super(Union, self).assert_valid(instance, value)
        if not valid:
            return False
        if value is None:
            value = instance._get(self.name)
            if value is None:
                return True
        return self._try_prop_method(instance, value, 'assert_valid')
900845
def step_impl12(context, runs):
    
    executor_ = context.fuzz_executor
    stats = executor_.stats
    count = stats.cumulated_counts()
    assert count == runs, "VERIFY: Number of recorded runs."
929006
def check(self, orb):
        

        return self.prev is not None and np.sign(self(orb)) != np.sign(self(self.prev))
1041973
function validateSignedMessageSync(objSignedMessage){
	var err;
	var bCalledBack = false;
	validateSignedMessage(objSignedMessage, function(_err){
		err = _err;
		bCalledBack = true;
	});
	if (!bCalledBack)
		throw Error("validateSignedMessage is not sync");
	return err;
}
95839
def _validate_duplication(self, subj_and_pred, cl):
        """"""
        subj, pred = subj_and_pred

        log.info("Validating duplication of member %s" % pred)
        if (subj, pred) in self.checked_attributes:
            err = self.err("{0} - duplicated member of {1}",
                           self._field_name_from_uri(pred),
                           self._field_name_from_uri(cl))
            return ValidationWarning(ValidationResult.WARNING, err['err'],
                                     err['line'], err['num'])
139487
private void syncInstancesIfTimestampDiffers(String appName, String id, InstanceInfo info, InstanceInfo infoFromPeer) {
        try {
            if (infoFromPeer != null) {
                logger.warn("Peer wants us to take the instance information from it, since the timestamp differs,"
                        + "Id : {} My Timestamp : {}, Peer's timestamp: {}", id, info.getLastDirtyTimestamp(), infoFromPeer.getLastDirtyTimestamp());

                if (infoFromPeer.getOverriddenStatus() != null && !InstanceStatus.UNKNOWN.equals(infoFromPeer.getOverriddenStatus())) {
                    logger.warn("Overridden Status info -id {}, mine {}, peer's {}", id, info.getOverriddenStatus(), infoFromPeer.getOverriddenStatus());
                    registry.storeOverriddenStatusIfRequired(appName, id, infoFromPeer.getOverriddenStatus());
                }
                registry.register(infoFromPeer, true);
            }
        } catch (Throwable e) {
            logger.warn("Exception when trying to set information from peer :", e);
        }
    }
674786
private static void checkValidObject(Path path, AbstractConfigObject reference,
            AbstractConfigObject value,
            List<ConfigException.ValidationProblem> accumulator) {
        for (Map.Entry<String, ConfigValue> entry : reference.entrySet()) {
            String key = entry.getKey();

            Path childPath;
            if (path != null)
                childPath = Path.newKey(key).prepend(path);
            else
                childPath = Path.newKey(key);

            AbstractConfigValue v = value.get(key);
            if (v == null) {
                addMissing(accumulator, entry.getValue(), childPath, value.origin());
            } else {
                checkValid(childPath, entry.getValue(), v, accumulator);
            }
        }
    }