/*
==============================================================
IDENTIFICATION
==============================================================
518075
function hasClass(element, className) {
    var hasClass = true;
    nodesToArray(element).forEach(function (node) {
        if (!node.classList.contains(className)) {
            hasClass = false;
        }
    });
    return hasClass;
}
321960
public function getId()
	{
		if (is_object($this->id) && method_exists($this->id, '__toString')) {
			return (string) $this->id;
		}

		return $this->id;
	}
351170
public function getIdentity(){
        if(!empty($this->identity)){
            return $this->identity;
        }
        if(isset($_SESSION[$this->storeKey])) {
            $this->identity = $_SESSION[$this->storeKey];
        }
        if(!empty($_COOKIE[$this->storeKey])){
            $data = $this->authCode($_COOKIE[$this->storeKey],'DECODE');
            $this->identity = json_decode($data,true);
        }
        return $this->identity;
    }
457938
public function updateId()
    {
        if (empty($this->parentNode->key)) {
            $this->id = "{$this->keyDelimiter}$this->key{$this->keyDelimiter}";
        } else {
            $this->id = "{$this->parentNode->id}$this->keyDelimiter{$this->key}$this->keyDelimiter";
        }
        $this->id = preg_replace('/[#]{2,}/', self::DEFAULT_KEY_DELIMITER, $this->id);
    }
1060202
function Id (_id) {
  var dec
  var hex

  if (typeof _id === 'number') {
    dec = _id
    var tmp = ('00000000000000' + _id.toString(16))
    hex = tmp.substring(tmp.length - 12, tmp.length)
  }
  if (typeof _id === 'string') {
    dec = parseInt(_id, 16)
    hex = _id
  }
  if (typeof _id === 'undefined') {
    hex = sha1((~~(Math.random() * 1e9)).toString(36) + Date.now())
      .substring(0, 12)
    dec = parseInt(hex, 16)
  }

  this.toHex = function () {
    return hex
  }

  this.toDec = function () {
    return dec
  }

  this.next = function () {
    if (hex === maxHex) {
      return '000000000000'
    } else {
      var a = ('000000000000' + ((dec + 1).toString(16)))
      return a.substring(a.length - 12, a.length)
    }
  }

  return this
}
1004559
@Override
	public void undefinedIdentifier(String id, String exprName) {
		reporter.error(prefix(exprName), "Undefined identifier '", id, "'");
	}
96718
function(req) {

    return req.options.id || ( req.options.where && req.options.where.id ) || req.allParams()['id'];
  }
909496
public function getInputId()
	{
		$input = $this->getInput();

		/** @var Model $model */
		$model = $this->getModelClass();

		// If the model or the input is not set, then we cannot get an id.
		if (! $model || ! $input) {
			return null;
		}

		return array_get($input, (new $model)->getKeyName());
	}
1374274
function applyIdToMap(inst, map, node, nodeInfo) {
  if (nodeInfo.id) {
    map[nodeInfo.id] = node;
  }
}
373453
private static Node checkFollowedIdentifier(
			final HttpServletRequest request,
			final DeleteFollowResponse response) {
		final String followedId = request
				.getParameter(ProtocolConstants.Parameters.Delete.Follow.FOLLOWED_IDENTIFIER);
		if (followedId != null) {
			final Node followed = NeoUtils.getUserByIdentifier(followedId);
			if (followed != null) {
				return followed;
			}
			response.followedIdentifierInvalid(followedId);
		} else {
			response.followedIdentifierMissing();
		}

		return null;
	}
700676
public function insert_id()
    {
        if (!$this->connection) {
            $this->last_error_id = "db_server_conn_error";
            return false;
        }
        
        if ($this->last_query_is_insert) {
            if (!$this->statement) {
                return null;
            }
            
            if (!sqlsrv_next_result($this->statement)) {
                $this->last_error = $this->sys_get_errors();
                $this->last_error_id = "db_query_error";
                
                trigger_error($this->last_error, E_USER_ERROR);
                return false;
            }
            
            $id = null;
            
            if (@sqlsrv_fetch($this->statement)) {
                $id = sqlsrv_get_field($this->statement, 0);
            }
            
            return $id;
        }
        
        $this->statement = @sqlsrv_query($this->connection, "SELECT SCOPE_IDENTITY() AS IID");
        if (!$this->statement) {
            $this->last_error = $this->sys_get_errors();
            $this->last_error_id = "db_query_error";
            
            trigger_error($this->last_error, E_USER_ERROR);
            return false;
        }
        
        if (!$this->fetch_row()) {
            $this->last_error_id = "db_query_error";
            return false;
        }
        
        $id = $this->field_by_name("IID");
        
        $this->free_result();
        
        return $id;
    }
607785
public function identity() {
    $args = self::_wrapArgs(func_get_args(), 1);
    
    if(is_array($args)) return self::_wrap($args[0]);
    
    return self::_wrap(function($x) {
      return $x;
    });
  }
419333
public function getIdentity()
    {
        if ($this->_result === null || !$this->_result->isValid()) {
            return null;
        }

        $identity = $this->_result->getData();
        if (!($identity instanceof IdentityInterface)) {
            $identity = $this->buildIdentity($identity);
        }

        return $identity;
    }
1140259
function ObiCallerID() {
    this.fromRegex = /^INVITE[\S\s]*From:\s*"?([\w\s\.\+\?\$]*?)"?<sip:((.*)@)?(.*)>;.*/;
    this.cidRegex = /<7> \[SLIC\] CID to deliver: '([\w\s\.\+\?\$]*?)' (\d*).*/;
    this.cnams = {};
    this.lastSentTime = new Date();
    this.outlookImported = false;
    this.addressbookImported = false;
    this.lastGrowlName = "";
    this.lastGrowlNumber = "";
}
534460
function get_identity($id = null)
    {
        $id = (int)$id;
        // cache identities for better performance
        if (!array_key_exists($id, $this->identities)) {
            $result = $this->list_identities($id ? "AND `identity_id` = $id" : '');
            $this->identities[$id] = $result[0];
        }

        return $this->identities[$id];
    }
1042377
function deentitify(s) {
    return s
        .replace(/&#(\d+);?/g, function (_, code) {
            return String.fromCharCode(code);
        })
        .replace(/&#[xX]([A-Fa-f0-9]+);?/g, function (_, hex) {
            return String.fromCharCode( parseInt(hex, 16) );
        })
        .replace(/&(\w+);/g, function (entity, name) {
            return entities[name] || entity;
        });
}
234703
function MultiId(node) {
  this.nodes = Object.create(null);
  this.nodes[node._nid] = node;
  this.length = 1;
  this.firstNode = undefined;
}