Conditionally add or remove a token from a token-list.

@param {DOMTokenList} list
@param {String} token
@param {Boolean} enabled
489059
function setToken(list, token, enabled){
		enabled ? list.add(token) : list.remove(token);
	}
810385
function removeEnabledElementCallback(enabledElement) {
  if (!external.cornerstone) {
    return;
  }

  const cornerstoneEnabledElement = external.cornerstone.getEnabledElement(
    enabledElement
  );

  const enabledElementUID = cornerstoneEnabledElement.uuid;
  const colormap = external.cornerstone.colors.getColormap(state.colorMapId);
  const numberOfColors = colormap.getNumberOfColors();

  // Remove enabledElement specific data.
  delete state.visibleSegmentations[enabledElementUID];
  delete state.imageBitmapCache[enabledElementUID];
}
1164026
function checkAdd(list, key, func) {
    list.push({key: key, func: func});
  }
745339
private void unmarkRemovedDefaultSessionToken(String site, String token) {
		if (removedDefaultTokens == null)
			return;
		HashSet<String> removed = removedDefaultTokens.get(site);
		if (removed == null)
			return;
		removed.remove(token);
	}
218444
function addKeyToList(list, key, object) {
    for (var i = list.length - 1; i >= 0; i--) {
        if (list[i][key] == object[key]) {
            return false;
        }
    }
    list.push(object);
    return true;
}
933338
function triggerIfHandlerList(handlerList, event) {
    if(handlerList !== undefined) {
        for(var n=0; n<handlerList.length; n++) {
            handlerList[n](event)
        }
    }
}
301863
private void markRemovedDefaultSessionToken(String site, String token) {
		if (removedDefaultTokens == null)
			removedDefaultTokens = new HashMap<>(1);
		HashSet<String> removedSet = removedDefaultTokens.get(site);
		if (removedSet == null) {
			removedSet = new HashSet<>(1);
			removedDefaultTokens.put(site, removedSet);
		}
		removedSet.add(token);
	}
595705
private JsDocToken eatTokensUntilEOL(JsDocToken token) {
    do {
      if (token == JsDocToken.EOL || token == JsDocToken.EOC ||
          token == JsDocToken.EOF) {
        state = State.SEARCHING_ANNOTATION;
        return token;
      }
      token = next();
    } while (true);
  }
1320449
function (token) {
            if (token.prev.type !== 'WhiteSpace') {
                insertBefore(token, whiteSpaceFactory());
            }
            if (token.next.type !== 'WhiteSpace' && token.next.type !== 'LineBreak') {
                insertAfter(token, whiteSpaceFactory());
            }
        }
703858
def del_token(token):
    '''
    
    '''
    token_path = os.path.join(__opts__['token_dir'], token)
    if os.path.exists(token_path):
        return os.remove(token_path) is None
    return False
1361656
function assign (key, token) {
  validator('tokenLabel', key)
  validator('token', token)

  tokens[key] = token
}
1180571
function remove(item, list) {
  var i = list.indexOf(item);
  if (~i) list.splice(i, 1);
}
125918
function(event, context, callback, selector) {
        var options = this.options;

        // Replace tokens
        if (event === '{mode}') {
            event = options.mode;
        }

        if (selector === '{selector}') {
            selector = this.nodes ? this.nodes.selector : '';
        }

        // Find and bind the function
        if ($.type(callback) === 'string') {
            callback = this[callback].bind(this);
        }

        this.__events.push([event, context, callback, selector]);
    }
915249
@SuppressWarnings("unchecked")
    public void deleteTokenAfterActivation(RegistrationToken token) {
        dao.delete((E) token);
        LOG.trace("The registration token has been deleted.");
    }
788916
function markForDisabling(id, mark) {
        if (mark) {
            _idsToDisable[id] = true;
        } else {
            delete _idsToDisable[id];
        }
        exports.trigger("statusChange", id);
    }
1329160
def tokenlist(item, sep, suppress=True):
    """"""
    if suppress:
        sep = sep.suppress()
    return item + ZeroOrMore(sep + item) + Optional(sep)
1052850
def __begin_of_list(self, ast_token):
        """"""
        self.list_level += 1
        if self.list_level == 1:
            self.final_ast_tokens.append(ast_token)