Make sure an element has id. Return true if id was generated.
173717
function ensure_element_id(element) {
        if (!element.id || element.id === '') {
          element.id = config.generate_random_id('ac_element');
          return true;
        }
        return false;
      }
1121723
private boolean containsElmentWithId(Node node, String id) {
        String nodeName = node.getNodeName();
        if ("channel".equals(nodeName) || "folder".equals(nodeName)) {
            Element e = (Element) node;
            if (id.equals(e.getAttribute("ID"))) {
                return true;
            }
            if ("folder".equals(nodeName)) {
                for (Node child = e.getFirstChild();
                        child != null;
                        child = child.getNextSibling()) {
                    if (containsElmentWithId(child, id)) {
                        return true;
                    }
                }
            }
        }
        return false;
    }
1044309
def element_focused(self, id_):
    

    try:
        elem = world.browser.find_element_by_id(id_)
    except NoSuchElementException:
        raise AssertionError("Element with ID '{}' not found.".format(id_))

    focused = world.browser.switch_to.active_element

    # Elements don't have __ne__ defined, cannot test for inequality
    if not elem == focused:
        raise AssertionError("Expected element to be focused.")
997624
public boolean check(int id) {
    for (Tag tag: getTags()) {
      if (tag.getID() == id)
	return true;
    }
    return false;
  }
480200
def _find_id(self, id_):
        """"""
        for i, row in enumerate(self._data):
            if row["id"] == id_:
                t = self.tableWidget
                # idx = t.itemFromIndex()
                t.setCurrentCell(i, 0)
                break
527659
def containsID(self, idVal):
        
        for i in self:
            if i.id == idVal:
                return True
        return False
814154
def dom_id(self):
        """"""
        parameter = 'DOMID'
        if parameter not in self._by:
            self._populate(by=parameter)
        return self._by[parameter]
1347064
def get_id(request):
        
        if isinstance(request, etree._Element):
            elem = request
        else:
            if isinstance(request, Document):
                request = request.toxml()
            elem = fromstring(request, forbid_dtd=True)
        return elem.get('ID', None)
447985
def valid_id(opts, id_):
    '''
    
    '''
    try:
        if any(x in id_ for x in ('/', '\\', str('\0'))):
            return False
        return bool(clean_path(opts['pki_dir'], id_))
    except (AttributeError, KeyError, TypeError, UnicodeDecodeError):
        return False
967376
def exists(self):
        
        if '_id' not in self or self['_id'] is None:
            return False

        resp = self.r_session.head(self.document_url)
        if resp.status_code not in [200, 404]:
            resp.raise_for_status()

        return resp.status_code == 200
721778
function get_id(val) {
  if ( typeof val === 'string' || typeof val === 'number' )
    return val;

  if ( typeof val === 'object' && val.id )
    return val.id;

  return false;
}
446724
function isValidID(id) {
  return id === '' || (
    id.charAt(0) === SEPARATOR && id.charAt(id.length - 1) !== SEPARATOR
  );
}
50822
function checkOrGenerateId (data) {
        data = data || {};
        if (!data._id) {
          data._id = apos.utils.generateId();
        }
        return data;
      }
497503
function (onDone) {

	l_validateUID();
	var uid = ++l_states['uid_count'];

	l_states.sync(function (err) {
		if (err) {
			return onDone(err);
		}
		LOG.warn('uid generated: ' + uid);
		onDone(null, uid);
	});
}
593477
def id(self, id):
        
        if id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")
        if id is not None and not re.search('^[A-Za-z0-9]{32}', id):
            raise ValueError("Invalid value for `id`, must be a follow pattern or equal to `/^[A-Za-z0-9]{32}/`")

        self._id = id
482420
public String getId() {
		if(id == null) {
			synchronized(lock) {
				if(id == null) {
					if(page != null) {
						Map<String,Element> elementsById = page.getElementsById();
						// Generate the ID now
						String template = getElementIdTemplate();
						if(template == null) {
							throw new IllegalStateException("null from getElementIdTemplate");
						}
						StringBuilder possId = Element.generateIdPrefix(template, getDefaultIdPrefix());
						int possIdLen = possId.length();
						// Find an unused identifier
						for(int i=1; i<=Integer.MAX_VALUE; i++) {
							if(i == Integer.MAX_VALUE) throw new IllegalStateException("ID not generated");
							if(i>1) possId.append('-').append(i);
							String newId = possId.toString();
							if(
								elementsById == null
								|| !elementsById.containsKey(newId)
							) {
								setId(newId, true);
								break;
							}
							// Reset for next element number to check
							possId.setLength(possIdLen);
						}
					}
				}
			}
		}
		return id;
	}
1173452
function ensureID(options, prop, callback) {
  if(options[prop]) {
    return callback();
  }

  options.guid(function(err, id) {
    if(err) {
      return callback(err);
    }
    options[prop] = id;
    callback();
  });
}