Create a new token from the given prototype. Any argument besides the prototype is optional and
will be ignored if its value is <code>null</code>.
430626
protected CommonToken createToken(CommonToken prototype, String text, 
			Integer charPosInLine, Integer channel, Integer start, Integer stop, Integer type) {
		if (prototype == null)
			throw new IllegalArgumentException("Prototype may not be null.");
		CommonToken result = new CommonToken(prototype);
		if (text != null)
			result.setText(text);
		if (charPosInLine != null)
			result.setCharPositionInLine(charPosInLine.intValue());
		if (channel != null)
			result.setChannel(channel.intValue());
		if (start != null)
			result.setStartIndex(start.intValue());
		if (stop != null)
			result.setStopIndex(stop.intValue());
		if (type != null)
			result.setType(type.intValue());
		return result;
	}
415552
public String createToken(int ttl) {
        checkArgument(ttl > 0);

        CreateTokenRequest request = new CreateTokenRequest();
        request.setTtl(ttl);
        InternalRequest internalRequest = createRequest(request, HttpMethodName.POST, null, TOKEN);
        CreateTokenResponse response = this.invokeHttpClient(internalRequest, CreateTokenResponse.class);
        return response.getToken();
    }
1191064
Node createConstructorCall(@Nullable JSType classType, Node callee, Node... args) {
    Node result = NodeUtil.newCallNode(callee, args);
    if (isAddingTypes()) {
      checkNotNull(classType);
      FunctionType constructorType = checkNotNull(classType.toMaybeFunctionType());
      ObjectType instanceType = checkNotNull(constructorType.getInstanceType());
      result.setJSType(instanceType);
    }
    return result;
  }
249010
def create_token(self, request, **kwargs):
        

        data = {
            "content": self.get_object().id,
            "create_date": get_request_data(request)["create_date"],
            "expire_date": get_request_data(request)["expire_date"]
        }
        serializer = ObfuscatedUrlInfoSerializer(data=data)
        if not serializer.is_valid():
            return Response(
                serializer.errors,
                status=status.HTTP_400_BAD_REQUEST,
                content_type="application/json",
            )
        serializer.save()

        return Response(serializer.data, status=status.HTTP_200_OK, content_type="application/json")
222183
private static TokenRange tokenRange(Token token) {
        JavaToken javaToken = token.javaToken;
        return new TokenRange(javaToken, javaToken);
    }
325113
function TokenGenerator( structure ) {
	var i , element ;

	this.structure = structure ;
	this.byteLength = 0 ;

	if ( ! Array.isArray( structure ) ) {
		throw new TypeError( '[token-kit] .createTokenGenerator(), argument #0: bad token structure, it should be an Array of Object' ) ;
	}

	for ( i = 0 ; i < structure.length ; i ++ ) {
		element = structure[ i ] ;

		if ( ! element || typeof element !== 'object' ) {
			throw new TypeError( '[token-kit] .createTokenGenerator(), argument#0: bad token structure, it should be an Array of Object' ) ;
		}

		switch ( element.type ) {
			case 'random' :
				element.genType = 'uint' ;
				element.decodeType = 'base64url' ;
				element.auto = element.type ;
				break ;
			case 'timestamp' :
				element.genType = element.decodeType = 'int' ;
				if ( ! element.length ) { element.length = 6 ; }
				element.auto = element.type ;
				break ;
			case 'increment8' :
				element.genType = element.decodeType = 'uint' ;
				element.length = 1 ;
				element.auto = element.type ;
				break ;
			case 'increment16' :
				element.genType = element.decodeType = 'uint' ;
				element.length = 2 ;
				element.auto = element.type ;
				break ;
			case 'increment24' :
				element.genType = element.decodeType = 'uint' ;
				element.length = 3 ;
				element.auto = element.type ;
				break ;
			case 'increment32' :
				element.genType = element.decodeType = 'uint' ;
				element.length = 4 ;
				element.auto = element.type ;
				break ;
			default :
				element.genType = element.decodeType = element.type ;
				element.auto = null ;
		}

		if ( typeof element.length !== 'number' || element.length !== Math.floor( element.length ) || element.length < 1 ) {
			throw new TypeError( "[token-kit] .createTokenGenerator(), argument#0: bad token structure, it should be an Array of Object, having a 'length' property (positive integer)" ) ;
		}

		switch ( element.genType ) {
			case 'int' :
			case 'uint' :
				if ( element.length > 6 ) {
					throw new TypeError( "[token-kit] .createTokenGenerator(), 'length' property is too big (max 6 bytes for integer)" ) ;
				}
				break ;
			case 'BASE36' :
			case 'string' :
			case 'hex' :
			case 'buffer' :
				break ;
			default :
				throw new TypeError( "[token-kit] .createTokenGenerator(), unknown type: " + element.genType ) ;
		}

		this.byteLength += element.length ;
	}

	this.tokenLength = Math.ceil( this.byteLength * 4 / 3 ) ;	// Base64: 33% of overhead
	//console.log( "byteLength:" , this.byteLength , " tokenLength:" , this.tokenLength ) ;
	this.buffer = new Uint8Array( this.byteLength ) ;
}
891195
@Override
    public Object create(Class<?> extensionClass) {
        log.debug("Create instance for extension '{}'", extensionClass.getName());
        try {
            return extensionClass.newInstance();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }

        return null;
    }
211651
function prototypeMethodOrNull(className, method) {
  var ctor = goog.global[className];
  return (ctor && ctor.prototype && ctor.prototype[method]) || null;
}
1282773
public static Token newKeyword(String text, int startLine, int startColumn) {

        int type = Types.lookupKeyword(text);
        if (type != Types.UNKNOWN) {
            return new Token(type, text, startLine, startColumn);
        }

        return null;
    }
531696
@Nonnull
  public static AuthIdentificationResult createSuccess (@Nonnull final IAuthToken aAuthToken)
  {
    ValueEnforcer.notNull (aAuthToken, "AuthToken");
    return new AuthIdentificationResult (aAuthToken, null);
  }
986083
public ObjectValue newInstance(SClassDefinition node,
			PDefinition ctorDefinition, ValueList argvals, Context ctxt)
			throws AnalysisException
	{
		if (node instanceof ABusClassDefinition)
		{
			return newInstance((ABusClassDefinition) node, ctorDefinition, argvals, ctxt);
		} else if (node instanceof AClassClassDefinition)
		{
			if (node.getIsAbstract())
			{
				VdmRuntimeError.abort(node.getLocation(), 4000, "Cannot instantiate abstract class "
						+ node.getName(), ctxt);
			}

			return af.createSClassDefinitionAssistant().makeNewInstance(node, ctorDefinition, argvals, ctxt, new HashMap<ILexNameToken, ObjectValue>(), false);
			//return af.createAClassClassDefinitionAssistant().newInstance((AClassClassDefinition) node, ctorDefinition, argvals, ctxt);
		} else if (node instanceof ACpuClassDefinition)
		{
			return af.createACpuClassDefinitionAssistant().newInstance((ACpuClassDefinition) node, ctorDefinition, argvals, ctxt);
		} else if (node instanceof ASystemClassDefinition)
		{
			VdmRuntimeError.abort(node.getLocation(), 4135, "Cannot instantiate system class "
					+ node.getName(), ctxt);
		}

		return null;
	}
639276
@Override
    public Builder create() throws InvalidBuilderException {
        if (!active) {
            // Tr.error(tc, "JWT_BUILDER_NOT_ACTIVE", new Object[] {
            // "defaultJWT" });
            // return null;
            String err = Tr.formatMessage(tc, "JWT_BUILDER_NOT_ACTIVE", new Object[] { "defaultJWT" });
            throw new InvalidBuilderException(err);
        }
        return create("defaultJWT");
    }
224994
public static void newObj(
			Object created,
			String createdClass,
			String callerClass,
			String callerMethod,
			int callerValKind,
			Object caller) {
		System.err.println("newObj("+
				"created="+created+", "+
				"createdClass="+createdClass+", "+
				"callerClass="+callerClass+", "+
				"callerMethod="+callerMethod+", "+
				"callerValKind="+valKindToString(callerValKind)+", "+
				"caller="+caller+", "+
				")");
	}
1210955
Node createAwait(JSType jsType, Node value) {
    Node result = IR.await(value);
    if (isAddingTypes()) {
      result.setJSType(checkNotNull(jsType));
    }
    return result;
  }
778513
public static Call create(final String to, final String from) throws Exception {
    	return create(to, from, "none", null);
    }
363732
public static void initialize(String token) {
    if (token == null) {
      throw new IllegalArgumentException("Token should be defined.");
    }
    initialize(new ClientProperties(token, null, null));
  }
807437
public FutureData<Token> createToken(String identity, String service, String token) {
        if (service == null || service.isEmpty()) {
            throw new IllegalArgumentException("A service is required");
        }
        if (token == null || token.isEmpty()) {
            throw new IllegalArgumentException("A token is required");
        }
        FutureData<Token> future = new FutureData<>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(IDENTITY + "/" + identity + "/token"));
        try {
            Request request = config.http()
                    .postJSON(uri, new PageReader(newRequestCallback(future, new Token(), config)))
                    .setData(new NewToken(service, token));
            performRequest(future, request);
        } catch (JsonProcessingException e) {
            e.printStackTrace();
        }
        return future;
    }