Mark a nameop as collided
971418
def nameop_set_collided( cls, nameop, history_id_key, history_id ):
        
        nameop['__collided__'] = True
        nameop['__collided_history_id_key__'] = history_id_key 
        nameop['__collided_history_id__'] = history_id
789458
def namedb_get_names_in_namespace( cur, namespace_id, current_block, offset=None, count=None ):
    

    unexpired_query, unexpired_args = namedb_select_where_unexpired_names( current_block )

    query = "SELECT name FROM name_records JOIN namespaces ON name_records.namespace_id = namespaces.namespace_id WHERE name_records.namespace_id = ? AND " + unexpired_query + " ORDER BY name "
    args = (namespace_id,) + unexpired_args

    offset_count_query, offset_count_args = namedb_offset_count_predicate( offset=offset, count=count )
    query += offset_count_query + ";"
    args += offset_count_args

    name_rows = namedb_query_execute( cur, query, tuple(args) )
    ret = []
    for name_row in name_rows:
        rec = {}
        rec.update( name_row )
        ret.append( rec['name'] )

    return ret
38438
def register_handler(alias: str, handler: callable):
        
        if SignalDispatcher.handlers.get(alias) is None:
            SignalDispatcher.handlers[alias] = [handler]
        else:
            SignalDispatcher.handlers.get(alias).append(handler)
91264
function markAsUsed(node) {
            if (!node.label) {
                return;
            }

            const label = node.label.name;
            let info = scopeInfo;

            while (info) {
                if (info.label === label) {
                    info.used = true;
                    break;
                }
                info = info.upper;
            }
        }
373773
function NameError(message) {
  Error.call(this);
  Error.captureStackTrace(this, arguments.callee);
  this.name = 'Middleware Name Error';
  this.message = message || 'The argument must be a named function or supply a name';
}
594724
def namePush(ctxt, value):
    
    if ctxt is None: ctxt__o = None
    else: ctxt__o = ctxt._o
    ret = libxml2mod.namePush(ctxt__o, value)
    return ret
1326356
def write_collided_alias(collided_alias_dict):
        
        # w+ creates the alias config file if it does not exist
        open_mode = 'r+' if os.path.exists(GLOBAL_COLLIDED_ALIAS_PATH) else 'w+'
        with open(GLOBAL_COLLIDED_ALIAS_PATH, open_mode) as collided_alias_file:
            collided_alias_file.truncate()
            collided_alias_file.write(json.dumps(collided_alias_dict))
935708
function unhandledErrorListener(err, namespace) {
  console.error('[distribucache] (%s) error from an unhandled ' +
    '`error` event:\n', namespace, err && err.stack || err);
}
794
function(obj, type, name, nameIsUnique, oldName) {
    var nameMap, objList

    this._store[type] = nameMap = this._store[type] || {}
    nameMap[name] = objList = nameMap[name] || []

    // Adding new mapping
    if (objList.indexOf(obj) === -1) {
      if (nameIsUnique && objList.length > 0)
        throw new Error('there is already a ' + type + ' with name "' + name + '"')
      objList.push(obj)
    }

    // Removing old mapping
    if (oldName) {
      objList = nameMap[oldName]
      objList.splice(objList.indexOf(obj), 1)
    }

    exports.emitter.emit('namedObjects:registered:' + type, obj)
  }
938759
def name_in_checkpoint(var):
        
        if var.op.name.startswith('model/'):
            return var.op.name[len('model/'):]
1270037
def register(self, name, obj):
        """"""
        if name in self.all:
            log.debug('register: %s already existed: %s', name, obj.name)
            # code.interact(local=locals())
            raise DuplicateDefinitionException(
                'register: %s already existed: %s' % (name, obj.name))
        log.debug('register: %s ', name)
        self.all[name] = obj
        return obj
1191008
public void registerDestructionCallback(String name, Runnable callback) {
		synchronized (getSessionMutex()) {
			if (isSessionCompleted()) {
				throw new IllegalStateException(
						"Session id=" + getWebSocketSessionId() + " already completed");
			}
			setAttribute(DESTRUCTION_CALLBACK_NAME_PREFIX + name, callback);
		}
	}
1315405
protected void incrementNamedCountingMonitor(String name, ConcurrentMap<String, NamedCountingMonitor> map) {
        NamedCountingMonitor monitor = map.get(name);
        if (monitor == null) {
            monitor = new NamedCountingMonitor(name);
            NamedCountingMonitor conflict = map.putIfAbsent(name, monitor);
            if (conflict != null) monitor = conflict;
            else MonitorRegistry.getInstance().registerObject(monitor);
        }
        monitor.increment();
    }
173643
def WriteClientCrashInfo(self, client_id, crash_info):
    """"""
    if client_id not in self.metadatas:
      raise db.UnknownClientError(client_id)

    ts = rdfvalue.RDFDatetime.Now()
    self.metadatas[client_id]["last_crash_timestamp"] = ts
    history = self.crash_history.setdefault(client_id, {})
    history[ts] = crash_info.SerializeToString()
382496
def shutdown(name):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}

    if __opts__['test']:
        ret['comment'] = 'Shutting down local node'
        return ret

    __salt__['trafficserver.shutdown']()

    ret['result'] = True
    ret['comment'] = 'Shutdown local node'
    return ret
227504
function wrap(callback, name) {
  var isLST
    , stack
    , d
    , oldStack

  if ('function' !== typeof callback || callback && callback.name === '_trycatchOnError') return callback

  isLST = options['long-stack-traces']
  d = process.domain
  if (isLST) {
    oldStack = trycatch.currentStack
    stack = getUpdatedCurrentStack()
  }

  // Inherit from callback for when properties are added
  _trycatchNewCallback.__proto__ = callback
  _trycatchNewCallback._trycatchCurrentStack = stack
  return _trycatchNewCallback

  function _trycatchNewCallback() {
    // Don't stomp stack in synchronous EventEmitter case
    if (isLST) {
      if (trycatch.currentStack !== oldStack) {
        trycatch.currentStack = stack
      } else if (trycatch.currentStack !== null) {
        trycatch.currentStack = stack
      }
    }
    runInDomain(d, callback, trycatchit, this, arguments)
  }
}
459071
private static int getOffsetY(Collision collision, Mirror mirror)
    {
        if (mirror == Mirror.VERTICAL)
        {
            return -collision.getOffsetY();
        }
        return collision.getOffsetY();
    }