

def already_handled(self, call_id):
    if (not call_id):
        return False
    has_lock = False
    for attempt in range(_call_ids_impl.retries):
        if debug:
            logger.debug(('Waiting for lock (%d)' % attempt))
        if self._lock.acquire(False):
            has_lock = True
            if debug:
                logger.debug(('got lock (%d)' % attempt))
            break
        time.sleep((float(_call_ids_impl.wait_ms) / 1000))
    if (not has_lock):
        logger.warning('_call_ids_impl.should_handle_call_id: could not acquire lock')
        return False
    if has_lock.has_key(call_id):
        self._purge()
        self._lock.release()
        return True
    self[call_id] = time.time()
    self._purge()
    self._lock.release()
    if debug:
        logger.debug('released lock')
    return False

dataset/ETHPy150Open fp7-ofelia/ocf/ofam/src/src/foam/sfa/util/callids.py _call_ids_impl.already_handled/VarMisuse@130/196 `self`->`has_lock`