Generates a version 4 UUID

@method uuid
@param  {Boolean} safe [Optional] Strips - from UUID
@return {String}       UUID
771870
function ( safe ) {
		var s = function () { return ( ( ( 1 + Math.random() ) * 0x10000 ) | 0 ).toString( 16 ).substring( 1 ); },
		    r = [8, 9, "a", "b"],
		    o;

		o = ( s() + s() + "-" + s() + "-4" + s().substr( 0, 3 ) + "-" + r[Math.floor( Math.random() * 4 )] + s().substr( 0, 3 ) + "-" + s() + s() + s() );

		if ( safe === true ) {
			o = o.replace( /-/g, "" );
		}

		return o;
	}
312160
function genWeavePropFn( d ) {
	var code = "";
	for (var i=0; i<d; ++i) {
		if (i !== 0) code += ",";
		code += "p[i+c*"+i+"]";
	}
	return new Function( "p", "i", "var c=p.length/"+d+";return ["+code+"]" );
}
93264
public static function uuid($version = self::UUID_V4){

        switch($version){
            case self::UUID_V4:
                $data = openssl_random_pseudo_bytes(16);

                $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0010
                $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10

                return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));

            default:
                throw new Exception("Invalid or unknown uuid version specified");
        }
    }
258121
function realDomain(id) {
  return id.lastIndexOf("@") === 0 ? id.substr(1).toLowerCase() :
    id.toLowerCase().
      replace(/@/g, "-at-").
      replace(/\./g, "-dot-").
      replace(UUID_PATTERN, "$1");
}
127619
function UUIDcreatePart (length) {
    var uuidpart = '';
    for (var i = 0; i < length; i++) {
        var uuidchar = parseInt((Math.random() * 256), 10).toString(16);
        if (uuidchar.length === 1) {
            uuidchar = '0' + uuidchar;
        }
        uuidpart += uuidchar;
    }
    return uuidpart;
}
307067
def generate_uuid():
    """"""
    r_uuid = base64.urlsafe_b64encode(uuid.uuid4().bytes)
    return r_uuid.decode().replace('=', '')
867070
function (uuid) {
  uuid = ref.reinterpret(uuid, 16).toString('hex');
  return [
    uuid.slice(0, 8),
    uuid.slice(8, 12),
    uuid.slice(12, 16),
    uuid.slice(16, 20),
    uuid.slice(20, 32)
  ].join('-');
}
286831
def uuid4():
    """"""

    # When the system provides a version-4 UUID generator, use it.
    if _uuid_generate_random:
        _uuid_generate_random(_buffer)
        return UUID(bytes=_buffer.raw)

    # Otherwise, get randomness from urandom or the 'random' module.
    try:
        import os
        return UUID(bytes=os.urandom(16), version=4)
    except:
        import random
        bytes = [chr(random.randrange(256)) for i in range(16)]
        return UUID(bytes=bytes, version=4)
92664
function sanitizeStyle(value) {
	        value = String(value).trim(); // Make sure it's actually a string.
	        if (!value)
	            return '';
	        // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for
	        // reasoning behind this.
	        var urlMatch = value.match(URL_RE);
	        if ((urlMatch && sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||
	            value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {
	            return value; // Safe style values.
	        }
	        if (_angular_core.isDevMode()) {
	            getDOM().log("WARNING: sanitizing unsafe style value " + value + " (see http://g.co/ng/security#xss).");
	        }
	        return 'unsafe';
	    }
412096
@Pure
	public static String makeInternalId(UUID uid) {
		final StringBuilder buf = new StringBuilder("nowhere(?"); //$NON-NLS-1$
		buf.append(uid.toString());
		buf.append("?)"); //$NON-NLS-1$
		return Encryption.md5(buf.toString());
	}
327704
def uuid4(self):
    """"""
    return ''.join([hexchars[self.randint(0,15)] for x in range(0,8)]) + '-' +\
           ''.join([hexchars[self.randint(0,15)] for x in range(0,4)]) + '-' +\
           '4'+''.join([hexchars[self.randint(0,15)] for x in range(0,3)]) + '-' +\
           uuid4special[self.randint(0,3)]+''.join([hexchars[self.randint(0,15)] for x in range(0,3)]) + '-' +\
           ''.join([hexchars[self.randint(0,15)] for x in range(0,12)])
30830
def _is_uuid(uuid):
    '''
    
    '''
    if uuid and list((len(x) for x in uuid.split('-'))) == [8, 4, 4, 4, 12]:
        return True
    return False
701558
def validate_uuid(uuid)
      unless uuid.is_a?(String)
        @log.error "UUID is not a string"
        return false
      end

      unless !!/^\S{8}-\S{4}-4\S{3}-[89abAB]\S{3}-\S{12}$/.match(uuid.to_s)
        @log.error "UUID is not a valid V4 UUID"
        return false
      end
      return true
    end
1152446
function safeUnstashAll() {
  // TODO: will a re-stash ever be needed? This is fine for now because this
  // basically assumes that this folows a `safeStashAll`
  return execP('git stash pop && git reset HEAD . && git stash pop --index')
    .catch(function(err) {
      if (err && err.message && err.message.indexOf('No stash found') > -1) {
        // this is ok. Caused by second `stash pop` returning and error
        return;
      }
      return Promise.reject(err);
    });
}
1326633
function(cacheNum) {
      if (cacheNum === undefined) {
        cacheNum = 1;
      }
      if (!uuidCache.length) {
        ajax({url: this.urlPrefix + "/_uuids", data: {count: cacheNum}, async:
              false}, {
            success: function(resp) {
              uuidCache = resp.uuids;
            }
          },
          "Failed to retrieve UUID batch."
        );
      }
      return uuidCache.shift();
    }
313800
function getRequestId(req) {
  const id = uuid.v1();
  req.id = id;
  return {
    req_id: id,
  };
}
550757
function (uuid) {
        var intervalData = null;
        var i = 0;
        var len = 0;
        var actionData = null;

        if (typeof uuid !== 'string') {
            return false;
        }

        intervalData = uuidMap[uuid];

        if (!intervalData) {
            return false;
        }

        uuidMap[uuid] = null;

        len = intervalData.actions.length;

        for (; i < len; i += 1) {
            actionData = intervalData.actions[i];
            if (actionData.uuid === uuid) {
                intervalData.actions.splice(i, 1);
                break;
            }
        }

        if (intervalData.actions.length === 0) {
            clearInterval(intervalData.id);
            intervalsMap[intervalData.interval] = null;
        }

        return true;
    }