Simple helper function to generate some what unique id's for given
constructed pagelet.

@returns {String}
@api private
763275
function generator(n) {
  if (!n) return Date.now().toString(36).toUpperCase();
  return Math.random().toString(36).substring(2, 10).toUpperCase();
}
177925
function createIDList() {
        var doc = DocumentManager.getCurrentDocument();
        if (!doc) {
            return;
        }

        var idList = [];
        var docText = doc.getText();
        var lines = docText.split("\n");

        var regex = new RegExp(/\s+id\s*?=\s*?["'](.*?)["']/gi);
        var id, chFrom, chTo, i, line;
        for (i = 0; i < lines.length; i++) {
            line = lines[i];
            var info;
            while ((info = regex.exec(line)) !== null) {
                id = info[1];
                // TODO: this doesn't handle id's that share the
                // same portion of a name on the same line or when
                // the id and value are on different lines
                chFrom = line.indexOf(id);
                chTo = chFrom + id.length;
                idList.push(new FileLocation(null, i, chFrom, chTo, id));
            }
        }
        return idList;
    }
706238
def gen_unique_id():
    
    # Workaround for http://bugs.python.org/issue4607
    if ctypes and _uuid_generate_random:
        buffer = ctypes.create_string_buffer(16)
        _uuid_generate_random(buffer)
        return str(UUID(bytes=buffer.raw))
    return str(uuid4())
377083
private function createSliceID()
    {
        $urlFilter = URLSegmentFilter::create();
        if ($sliceID = $urlFilter->filter($this->getField('Title'))) {
            if (!$this->Parent()->PageSlices()->filter(array('ID:not' => $this->ID, 'SliceID' => $sliceID))->exists()) {
                $this->setField('SliceID', $sliceID);
            } else {
                $this->setField('SliceID', "$sliceID-{$this->ID}");
            }
        }
    }
976587
function (id_base) {
        var p     = this.paginator,
            c     = p.get('nextPageLinkClass'),
            label = p.get('nextPageLinkLabel'),
            last  = p.getTotalPages();

        this.link     = document.createElement('a');
        this.span     = document.createElement('span');

        this.link.id        = id_base + '-next-link';
        this.link.href      = '#';
        this.link.className = c;
        this.link.innerHTML = label;
        YAHOO.util.Event.on(this.link,'click',this.onClick,this,true);

        this.span.id        = id_base + '-next-span';
        this.span.className = c;
        this.span.innerHTML = label;

        this.current = p.getCurrentPage() === last ? this.span : this.link;

        return this.current;
    }
242953
public static function getChildPageIds($pageId)
    {
        if (empty(self::$preloaded_page_children)) {
            foreach (static::preloadArray() as $key => $page) {
                if (!isset(self::$preloaded_page_children[$page->parent])) {
                    self::$preloaded_page_children[$page->parent] = [];
                }
                self::$preloaded_page_children[$page->parent][] = $page->id;
            }
        }
        return !empty(self::$preloaded_page_children[$pageId]) ? self::$preloaded_page_children[$pageId] : [];
    }
489474
function ( arg ) {
		var id;

		if ( arg === global ) {
			id = "window";
		}
		else if ( !server && arg === document ) {
			id = "document";
		}
		else if ( !server && arg === document.body ) {
			id = "body";
		}
		else {
			utility.genId( arg );
			id = arg.id || ( typeof arg.toString === "function" ? arg.toString() : arg );
		}

		return id;
	}
391727
private String generatePageSQLStatement(boolean tableExists,
			Map<String, Set<Integer>> dataSourceToUse)
	{
		StringBuffer output = new StringBuffer();

		// Statement creates table for Template Id -> Page Id
		output.append("CREATE TABLE IF NOT EXISTS "
				+ GeneratorConstants.TABLE_TPLID_PAGEID
				+ " ("
				+ "templateId INTEGER UNSIGNED NOT NULL,"
				+ "pageId INTEGER UNSIGNED NOT NULL, UNIQUE(templateId, pageId));\r\n");

		// Statement for data into templateId -> pageId
		output.append(this.generateSQLStatementForDataInTable(dataSourceToUse,
				GeneratorConstants.TABLE_TPLID_PAGEID));

		if (!tableExists) {
			// Create index statement if table does not exists
			output.append("CREATE INDEX pageIdx ON "
					+ GeneratorConstants.TABLE_TPLID_PAGEID
					+ "(pageId);");
			output.append("\r\n");
		}

		return output.toString();

	}
157966
function createId (coll) {
  var _ = this
  var idProperty = _.__id()
  if (_.isEmpty(coll)) {
    return 1
  } else {
    var id = _.maxBy(coll, function (doc) {
      return doc[idProperty]
    })[idProperty]

    if (_.isFinite(id)) {
      // Increment integer id
      return ++id
    } else {
      // Generate string id
      return uuid()
    }
  }
}
73064
function getPseudoUUID() {
  var chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
  var len = chars.length;
  var ret = [];

  for (var i = 0; i < 10; i++) {
    ret.push(chars[Math.floor(Math.random() * len)]);
  }
  return ret.join('');
}
76457
function(el) {
                var id = el.id;

                if (!id) {
                    id = "yuievtautoid-" + counter;
                    ++counter;
                    el.id = id;
                }

                return id;
            }
889983
function _identifiers (options) {
  var query = {}

  for (var prop in options.hash) {
    if (/^-/.test(prop)) {
      query[prop.replace(/^-/, '!')] = options.hash[prop]
    } else if (/^_/.test(prop)) {
      query[prop.replace(/^_/, '')] = new RegExp(options.hash[prop])
    } else {
      query[prop] = options.hash[prop]
    }
  }
  return arrayify(options.data.root).filter(where(query)).filter(function (doclet) {
    return !doclet.ignore && (state.options.private ? true : doclet.access !== 'private')
  })
}
458258
function generate_id (args, done) {
  var actnid
  var length = args.length || 6

  if (length < 65) {
    actnid = nids[length] || (nids[length] = Nid({length: length}))
  }
  else {
    actnid = Nid({length: length})
  }

  done(null, actnid())
}
45594
final function _generateID()
    {
        $uniqStr = function($length) {
            $char = "abcdefghijklmnopqrstuvwxyz0123456789";
            $char = str_shuffle($char);
            for($i = 0, $rand = '', $l = strlen($char) - 1; $i < $length; $i ++) {
                $rand .= $char{mt_rand(0, $l)};
            }

            return $rand;
        };

        if ($this->ID == null) {
            $class     = get_called_class();
            $module    = $this->deriveModuleNamespace($class);
            $widget    = $this->deriveWidgetName($class);

            $this->ID  = (($module != '') ? $this->inflectName($module).'_' : '')
                .$this->inflectName($widget).'_'.$uniqStr(5);
        }

        return $this->ID;
    }
446493
private String createId(FacesContext context)
            throws JspException {

        if (this.id == null) {
            return getFacesJspId();
        } else {
            // if this tag happens to be nested within <c:forEach>, jspId
            // will be the same for each iteration. So it is
            // transformed into a unique "id" by appending a counter which gets
            // stored in request scope with jspId as the key for use during next
            // iteration.
            if (isDuplicateId(this.id)) {
                if (!isSpecifiedIdUnique(this.id)) {
                    if (isNestedInIterator) {
                        this.id = generateIncrementedId(this.id);
                    } else {
                        StringWriter writer = new StringWriter(128);
                        printTree(context.getViewRoot(), this.id, writer, 0);
                        String msg = "Component ID '"
                                + this.id
                                + "' has already been used"
                                + " in the view.\n"
                                + "See below for the view up to the point of"
                                + " the detected error.\n"
                                + writer.toString();
                        throw new JspException(msg);
                    }
                }
            }
            return (this.id);
        }

    }
662359
function samlCreateId() 
   {
      $rndChars = 'abcdefghijklmnop';
      $rndId = '';
      for ($i = 0; $i < 40; $i++ ) {
         $rndId .= $rndChars[rand(0,strlen($rndChars)-1)];
      }
      return $rndId;
   }
1148356
function (obj) {
                if (!resourceChecked) {
                    Util.saveLoadedRes();
                    resourceChecked = true;
                }
                currReqID = obj.reqID;
                // console.log('arrive', obj.id);
                this.trigger('pageletarrive', obj);
                var pagelet = new PageLet(obj, function () {
                    // console.log('dom ready', obj.id);
                    var item;
                    count--;
                    // enforce js executed after dom inserted.
                    if (count === 0) {
                        while ((item = pagelets.shift())) {
                            BigPipe.trigger('pageletinsert', pagelet, item.pageletData);
                            // console.log('pagelet exec js', item.pageletData.id);
                            item.loadJs((function (item) {
                                // console.log('pagelet exec done', item.pageletData.id);
                                BigPipe.trigger('pageletdone', pagelet, item.pageletData);
                            })(item));
                        }
                    }
                });
                pagelet.pageletData = obj;
                pagelets.push(pagelet);
                count++;
                pagelet.loadCss();
            }