idx int64 0 41.2k | question stringlengths 74 4.04k | target stringlengths 7 750 |
|---|---|---|
26,000 | protected JestClient createJestClient ( Map < String , String > config , String indexName , String defaultIndexName ) { String host = config . get ( "client.host" ) ; String port = config . get ( "client.port" ) ; String protocol = config . get ( "client.protocol" ) ; String initialize = config . get ( "client.initiali... | Creates a transport client from a configuration map . |
26,001 | protected void updateHttpConfig ( Builder httpClientConfig , Map < String , String > config ) { String username = config . get ( "client.username" ) ; String password = config . get ( "client.password" ) ; String timeout = config . get ( "client.timeout" ) ; if ( StringUtils . isBlank ( timeout ) ) { timeout = "10000" ... | Update the http client config . |
26,002 | private void orderPolicies ( PoliciesBean policies ) { int idx = 1 ; for ( PolicyBean policy : policies . getPolicies ( ) ) { policy . setOrderIndex ( idx ++ ) ; } } | Set the order index of all policies . |
26,003 | private Map < String , Object > getEntity ( String type , String id ) throws StorageException { try { JestResult response = esClient . execute ( new Get . Builder ( getIndexName ( ) , id ) . type ( type ) . build ( ) ) ; if ( ! response . isSucceeded ( ) ) { return null ; } return response . getSourceAsObject ( Map . c... | Gets an entity . Callers must unmarshal the resulting map . |
26,004 | private List < Hit < Map < String , Object > , Void > > listEntities ( String type , SearchSourceBuilder searchSourceBuilder ) throws StorageException { try { String query = searchSourceBuilder . string ( ) ; Search search = new Search . Builder ( query ) . addIndex ( getIndexName ( ) ) . addType ( type ) . build ( ) ;... | Returns a list of entities . |
26,005 | private void deleteEntity ( String type , String id ) throws StorageException { try { JestResult response = esClient . execute ( new Delete . Builder ( id ) . index ( getIndexName ( ) ) . type ( type ) . build ( ) ) ; if ( ! response . isSucceeded ( ) ) { throw new StorageException ( "Document could not be deleted beca... | Deletes an entity . |
26,006 | private void updateEntity ( String type , String id , XContentBuilder source ) throws StorageException { try { String doc = source . string ( ) ; esClient . execute ( new Index . Builder ( doc ) . setParameter ( Parameters . OP_TYPE , "index" ) . index ( getIndexName ( ) ) . type ( type ) . id ( id ) . build ( ) ) ; } ... | Updates a single entity . |
26,007 | private static String getPoliciesDocType ( PolicyType type ) { String docType = "planPolicies" ; if ( type == PolicyType . Api ) { docType = "apiPolicies" ; } else if ( type == PolicyType . Client ) { docType = "clientPolicies" ; } return docType ; } | Returns the policies document type to use given the policy type . |
26,008 | private static String id ( String organizationId , String entityId , String version ) { return organizationId + ':' + entityId + ':' + version ; } | A composite ID created from an organization ID entity ID and version . |
26,009 | private < T > Iterator < T > getAll ( String entityType , IUnmarshaller < T > unmarshaller ) throws StorageException { String query = matchAllQuery ( ) ; return getAll ( entityType , unmarshaller , query ) ; } | Returns an iterator over all instances of the given entity type . |
26,010 | private boolean hasOriginHeader ( HttpServletRequest httpReq ) { String origin = httpReq . getHeader ( "Origin" ) ; return origin != null && origin . trim ( ) . length ( ) > 0 ; } | Returns true if the Origin request header is present . |
26,011 | public static AuthHandler getAuth ( Vertx vertx , Router router , VertxEngineConfig apimanConfig ) { String type = apimanConfig . getAuth ( ) . getString ( "type" , "NONE" ) ; JsonObject authConfig = apimanConfig . getAuth ( ) . getJsonObject ( "config" , new JsonObject ( ) ) ; switch ( AuthType . getType ( type ) ) { ... | Creates an auth handler of the type indicated in the auth section of config . |
26,012 | public Session createSession ( ) throws OpenViduJavaClientException , OpenViduHttpException { Session s = new Session ( ) ; OpenVidu . activeSessions . put ( s . getSessionId ( ) , s ) ; return s ; } | Creates an OpenVidu session with the default settings |
26,013 | public Recording getRecording ( String recordingId ) throws OpenViduJavaClientException , OpenViduHttpException { HttpGet request = new HttpGet ( OpenVidu . urlOpenViduServer + API_RECORDINGS + "/" + recordingId ) ; HttpResponse response ; try { response = OpenVidu . httpClient . execute ( request ) ; } catch ( IOExcep... | Gets an existing recording |
26,014 | @ SuppressWarnings ( "unchecked" ) public List < Recording > listRecordings ( ) throws OpenViduJavaClientException , OpenViduHttpException { HttpGet request = new HttpGet ( OpenVidu . urlOpenViduServer + API_RECORDINGS ) ; HttpResponse response ; try { response = OpenVidu . httpClient . execute ( request ) ; } catch ( ... | Lists all existing recordings |
26,015 | public void createSession ( Session sessionNotActive , KurentoClientSessionInfo kcSessionInfo ) throws OpenViduException { String sessionId = kcSessionInfo . getRoomName ( ) ; KurentoSession session = ( KurentoSession ) sessions . get ( sessionId ) ; if ( session != null ) { throw new OpenViduException ( Code . ROOM_CA... | Creates a session if it doesn t already exist . The session s id will be indicated by the session info bean . |
26,016 | protected void unregisterElementErrListener ( MediaElement element , final ListenerSubscription subscription ) { if ( element == null || subscription == null ) { return ; } element . removeErrorListener ( subscription ) ; } | Unregisters the error listener from the media element using the provided subscription . |
26,017 | public Set < Participant > getParticipants ( String sessionId ) throws OpenViduException { Session session = sessions . get ( sessionId ) ; if ( session == null ) { throw new OpenViduException ( Code . ROOM_NOT_FOUND_ERROR_CODE , "Session '" + sessionId + "' not found" ) ; } Set < Participant > participants = session .... | Returns all the participants inside a session . |
26,018 | public Participant getParticipant ( String sessionId , String participantPrivateId ) throws OpenViduException { Session session = sessions . get ( sessionId ) ; if ( session == null ) { throw new OpenViduException ( Code . ROOM_NOT_FOUND_ERROR_CODE , "Session '" + sessionId + "' not found" ) ; } Participant participant... | Returns a participant in a session |
26,019 | public Participant getParticipant ( String participantPrivateId ) throws OpenViduException { for ( Session session : sessions . values ( ) ) { if ( ! session . isClosed ( ) ) { if ( session . getParticipantByPrivateId ( participantPrivateId ) != null ) { return session . getParticipantByPrivateId ( participantPrivateId... | Returns a participant |
26,020 | protected void updateRecordingManagerCollections ( Session session , Recording recording ) { this . recordingManager . sessionHandler . setRecordingStarted ( session . getSessionId ( ) , recording ) ; this . recordingManager . sessionsRecordings . put ( session . getSessionId ( ) , recording ) ; this . recordingManager... | Changes recording from starting to started updates global recording collections and sends RPC response to clients |
26,021 | protected void sendRecordingStartedNotification ( Session session , Recording recording ) { this . recordingManager . getSessionEventsHandler ( ) . sendRecordingStartedNotification ( session , recording ) ; } | Sends RPC response for recording started event |
26,022 | public Notification getNotification ( ) { try { Notification notif = notifications . take ( ) ; log . debug ( "Dequeued notification {}" , notif ) ; return notif ; } catch ( InterruptedException e ) { log . info ( "Interrupted while polling notifications' queue" ) ; return null ; } } | Blocks until an element is available and then returns it by removing it from the queue . |
26,023 | public ServiceCall < SessionResponse > createSession ( CreateSessionOptions createSessionOptions ) { Validator . notNull ( createSessionOptions , "createSessionOptions cannot be null" ) ; String [ ] pathSegments = { "v2/assistants" , "sessions" } ; String [ ] pathParameters = { createSessionOptions . assistantId ( ) } ... | Create a session . |
26,024 | public ServiceCall < Void > deleteSession ( DeleteSessionOptions deleteSessionOptions ) { Validator . notNull ( deleteSessionOptions , "deleteSessionOptions cannot be null" ) ; String [ ] pathSegments = { "v2/assistants" , "sessions" } ; String [ ] pathParameters = { deleteSessionOptions . assistantId ( ) , deleteSessi... | Delete session . |
26,025 | public ServiceCall < MessageResponse > message ( MessageOptions messageOptions ) { Validator . notNull ( messageOptions , "messageOptions cannot be null" ) ; String [ ] pathSegments = { "v2/assistants" , "sessions" , "message" } ; String [ ] pathParameters = { messageOptions . assistantId ( ) , messageOptions . session... | Send user input to assistant . |
26,026 | public ServiceCall < IdentifiedLanguages > identify ( IdentifyOptions identifyOptions ) { Validator . notNull ( identifyOptions , "identifyOptions cannot be null" ) ; String [ ] pathSegments = { "v3/identify" } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , path... | Identify language . |
26,027 | public ServiceCall < IdentifiableLanguages > listIdentifiableLanguages ( ListIdentifiableLanguagesOptions listIdentifiableLanguagesOptions ) { String [ ] pathSegments = { "v3/identifiable_languages" } ; RequestBuilder builder = RequestBuilder . get ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments ) ... | List identifiable languages . |
26,028 | public ServiceCall < TranslationModel > createModel ( CreateModelOptions createModelOptions ) { Validator . notNull ( createModelOptions , "createModelOptions cannot be null" ) ; Validator . isTrue ( ( createModelOptions . forcedGlossary ( ) != null ) || ( createModelOptions . parallelCorpus ( ) != null ) , "At least o... | Create model . |
26,029 | public ServiceCall < HTMLReturn > convertToHtml ( ConvertToHtmlOptions convertToHtmlOptions ) { Validator . notNull ( convertToHtmlOptions , "convertToHtmlOptions cannot be null" ) ; String [ ] pathSegments = { "v1/html_conversion" } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl (... | Convert document to HTML . |
26,030 | public ServiceCall < CompareReturn > compareDocuments ( CompareDocumentsOptions compareDocumentsOptions ) { Validator . notNull ( compareDocumentsOptions , "compareDocumentsOptions cannot be null" ) ; String [ ] pathSegments = { "v1/comparison" } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . const... | Compare two documents . |
26,031 | public ServiceCall < FeedbackReturn > addFeedback ( AddFeedbackOptions addFeedbackOptions ) { Validator . notNull ( addFeedbackOptions , "addFeedbackOptions cannot be null" ) ; String [ ] pathSegments = { "v1/feedback" } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ... | Add feedback . |
26,032 | public ServiceCall < Void > deleteFeedback ( DeleteFeedbackOptions deleteFeedbackOptions ) { Validator . notNull ( deleteFeedbackOptions , "deleteFeedbackOptions cannot be null" ) ; String [ ] pathSegments = { "v1/feedback" } ; String [ ] pathParameters = { deleteFeedbackOptions . feedbackId ( ) } ; RequestBuilder buil... | Delete a specified feedback entry . |
26,033 | public ServiceCall < GetFeedback > getFeedback ( GetFeedbackOptions getFeedbackOptions ) { Validator . notNull ( getFeedbackOptions , "getFeedbackOptions cannot be null" ) ; String [ ] pathSegments = { "v1/feedback" } ; String [ ] pathParameters = { getFeedbackOptions . feedbackId ( ) } ; RequestBuilder builder = Reque... | List a specified feedback entry . |
26,034 | public ServiceCall < BatchStatus > createBatch ( CreateBatchOptions createBatchOptions ) { Validator . notNull ( createBatchOptions , "createBatchOptions cannot be null" ) ; String [ ] pathSegments = { "v1/batches" } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) ... | Submit a batch - processing request . |
26,035 | public ServiceCall < BatchStatus > getBatch ( GetBatchOptions getBatchOptions ) { Validator . notNull ( getBatchOptions , "getBatchOptions cannot be null" ) ; String [ ] pathSegments = { "v1/batches" } ; String [ ] pathParameters = { getBatchOptions . batchId ( ) } ; RequestBuilder builder = RequestBuilder . get ( Requ... | Get information about a specific batch - processing job . |
26,036 | public ServiceCall < Batches > listBatches ( ListBatchesOptions listBatchesOptions ) { String [ ] pathSegments = { "v1/batches" } ; RequestBuilder builder = RequestBuilder . get ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments ) ) ; builder . query ( "version" , versionDate ) ; Map < String , String... | List submitted batch - processing jobs . |
26,037 | public ServiceCall < BatchStatus > updateBatch ( UpdateBatchOptions updateBatchOptions ) { Validator . notNull ( updateBatchOptions , "updateBatchOptions cannot be null" ) ; String [ ] pathSegments = { "v1/batches" } ; String [ ] pathParameters = { updateBatchOptions . batchId ( ) } ; RequestBuilder builder = RequestBu... | Update a pending or active batch - processing job . |
26,038 | public ServiceCall < Voice > getVoice ( GetVoiceOptions getVoiceOptions ) { Validator . notNull ( getVoiceOptions , "getVoiceOptions cannot be null" ) ; String [ ] pathSegments = { "v1/voices" } ; String [ ] pathParameters = { getVoiceOptions . voice ( ) } ; RequestBuilder builder = RequestBuilder . get ( RequestBuilde... | Get a voice . |
26,039 | public ServiceCall < Voices > listVoices ( ListVoicesOptions listVoicesOptions ) { String [ ] pathSegments = { "v1/voices" } ; RequestBuilder builder = RequestBuilder . get ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments ) ) ; Map < String , String > sdkHeaders = SdkCommon . getSdkHeaders ( "text_t... | List voices . |
26,040 | public ServiceCall < InputStream > synthesize ( SynthesizeOptions synthesizeOptions ) { Validator . notNull ( synthesizeOptions , "synthesizeOptions cannot be null" ) ; String [ ] pathSegments = { "v1/synthesize" } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , ... | Synthesize audio . |
26,041 | public ServiceCall < Pronunciation > getPronunciation ( GetPronunciationOptions getPronunciationOptions ) { Validator . notNull ( getPronunciationOptions , "getPronunciationOptions cannot be null" ) ; String [ ] pathSegments = { "v1/pronunciation" } ; RequestBuilder builder = RequestBuilder . get ( RequestBuilder . con... | Get pronunciation . |
26,042 | public ServiceCall < VoiceModel > createVoiceModel ( CreateVoiceModelOptions createVoiceModelOptions ) { Validator . notNull ( createVoiceModelOptions , "createVoiceModelOptions cannot be null" ) ; String [ ] pathSegments = { "v1/customizations" } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . cons... | Create a custom model . |
26,043 | public ServiceCall < VoiceModel > getVoiceModel ( GetVoiceModelOptions getVoiceModelOptions ) { Validator . notNull ( getVoiceModelOptions , "getVoiceModelOptions cannot be null" ) ; String [ ] pathSegments = { "v1/customizations" } ; String [ ] pathParameters = { getVoiceModelOptions . customizationId ( ) } ; RequestB... | Get a custom model . |
26,044 | public ServiceCall < VoiceModels > listVoiceModels ( ListVoiceModelsOptions listVoiceModelsOptions ) { String [ ] pathSegments = { "v1/customizations" } ; RequestBuilder builder = RequestBuilder . get ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments ) ) ; Map < String , String > sdkHeaders = SdkComm... | List custom models . |
26,045 | public ServiceCall < Void > updateVoiceModel ( UpdateVoiceModelOptions updateVoiceModelOptions ) { Validator . notNull ( updateVoiceModelOptions , "updateVoiceModelOptions cannot be null" ) ; String [ ] pathSegments = { "v1/customizations" } ; String [ ] pathParameters = { updateVoiceModelOptions . customizationId ( ) ... | Update a custom model . |
26,046 | public ServiceCall < Void > addWords ( AddWordsOptions addWordsOptions ) { Validator . notNull ( addWordsOptions , "addWordsOptions cannot be null" ) ; String [ ] pathSegments = { "v1/customizations" , "words" } ; String [ ] pathParameters = { addWordsOptions . customizationId ( ) } ; RequestBuilder builder = RequestBu... | Add custom words . |
26,047 | public ServiceCall < Void > deleteWord ( DeleteWordOptions deleteWordOptions ) { Validator . notNull ( deleteWordOptions , "deleteWordOptions cannot be null" ) ; String [ ] pathSegments = { "v1/customizations" , "words" } ; String [ ] pathParameters = { deleteWordOptions . customizationId ( ) , deleteWordOptions . word... | Delete a custom word . |
26,048 | public ServiceCall < Translation > getWord ( GetWordOptions getWordOptions ) { Validator . notNull ( getWordOptions , "getWordOptions cannot be null" ) ; String [ ] pathSegments = { "v1/customizations" , "words" } ; String [ ] pathParameters = { getWordOptions . customizationId ( ) , getWordOptions . word ( ) } ; Reque... | Get a custom word . |
26,049 | public ServiceCall < Words > listWords ( ListWordsOptions listWordsOptions ) { Validator . notNull ( listWordsOptions , "listWordsOptions cannot be null" ) ; String [ ] pathSegments = { "v1/customizations" , "words" } ; String [ ] pathParameters = { listWordsOptions . customizationId ( ) } ; RequestBuilder builder = Re... | List custom words . |
26,050 | public ServiceCall < Classification > classify ( ClassifyOptions classifyOptions ) { Validator . notNull ( classifyOptions , "classifyOptions cannot be null" ) ; String [ ] pathSegments = { "v1/classifiers" , "classify" } ; String [ ] pathParameters = { classifyOptions . classifierId ( ) } ; RequestBuilder builder = Re... | Classify a phrase . |
26,051 | public ServiceCall < ClassificationCollection > classifyCollection ( ClassifyCollectionOptions classifyCollectionOptions ) { Validator . notNull ( classifyCollectionOptions , "classifyCollectionOptions cannot be null" ) ; String [ ] pathSegments = { "v1/classifiers" , "classify_collection" } ; String [ ] pathParameters... | Classify multiple phrases . |
26,052 | public ServiceCall < Classifier > createClassifier ( CreateClassifierOptions createClassifierOptions ) { Validator . notNull ( createClassifierOptions , "createClassifierOptions cannot be null" ) ; String [ ] pathSegments = { "v1/classifiers" } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constru... | Create classifier . |
26,053 | private static void writeInt ( int value , byte [ ] array , int offset ) { for ( int i = 0 ; i < 4 ; i ++ ) { array [ offset + i ] = ( byte ) ( value >>> ( 8 * i ) ) ; } } | Writes an number into an array using 4 bytes . |
26,054 | public static String getMediaTypeFromFile ( final File file ) { if ( file == null ) { return null ; } final String fileName = file . getName ( ) ; final int i = fileName . lastIndexOf ( '.' ) ; if ( i == - 1 ) { return null ; } return MEDIA_TYPES . get ( fileName . substring ( i ) . toLowerCase ( ) ) ; } | Returns the media type for a given file . |
26,055 | public static boolean isValidMediaType ( final String mediaType ) { return ( mediaType != null ) && MEDIA_TYPES . values ( ) . contains ( mediaType . toLowerCase ( ) ) ; } | Checks if the media type is supported by the service . |
26,056 | @ SuppressWarnings ( "unchecked" ) private static void updateEmotionTone ( Map < String , Object > user , List < ToneScore > emotionTone , boolean maintainHistory ) { Double maxScore = 0.0 ; String primaryEmotion = null ; Double primaryEmotionScore = null ; for ( ToneScore tone : emotionTone ) { if ( tone . getScore ( ... | updateEmotionTone updates the user emotion tone with the primary emotion - the emotion tone that has a score greater than or equal to the EMOTION_SCORE_THRESHOLD ; otherwise primary emotion will be neutral . |
26,057 | @ SuppressWarnings ( "unchecked" ) private static void updateLanguageTone ( Map < String , Object > user , List < ToneScore > languageTone , boolean maintainHistory ) { List < String > currentLanguage = new ArrayList < String > ( ) ; Map < String , Object > currentLanguageObject = new HashMap < String , Object > ( ) ; ... | updateLanguageTone updates the user with the language tones interpreted based on the specified thresholds . |
26,058 | @ SuppressWarnings ( "unchecked" ) public static void updateSocialTone ( Map < String , Object > user , List < ToneScore > socialTone , boolean maintainHistory ) { List < String > currentSocial = new ArrayList < String > ( ) ; Map < String , Object > currentSocialObject = new HashMap < String , Object > ( ) ; for ( Ton... | updateSocialTone updates the user with the social tones interpreted based on the specified thresholds . |
26,059 | public ServiceCall < ClassifiedImages > classify ( ClassifyOptions classifyOptions ) { Validator . notNull ( classifyOptions , "classifyOptions cannot be null" ) ; Validator . isTrue ( ( classifyOptions . imagesFile ( ) != null ) || ( classifyOptions . url ( ) != null ) || ( classifyOptions . threshold ( ) != null ) ||... | Classify images . |
26,060 | public ServiceCall < DetectedFaces > detectFaces ( DetectFacesOptions detectFacesOptions ) { Validator . notNull ( detectFacesOptions , "detectFacesOptions cannot be null" ) ; Validator . isTrue ( ( detectFacesOptions . imagesFile ( ) != null ) || ( detectFacesOptions . url ( ) != null ) , "At least one of imagesFile o... | Detect faces in images . |
26,061 | public ServiceCall < Void > deleteClassifier ( DeleteClassifierOptions deleteClassifierOptions ) { Validator . notNull ( deleteClassifierOptions , "deleteClassifierOptions cannot be null" ) ; String [ ] pathSegments = { "v3/classifiers" } ; String [ ] pathParameters = { deleteClassifierOptions . classifierId ( ) } ; Re... | Delete a classifier . |
26,062 | public ServiceCall < Classifier > getClassifier ( GetClassifierOptions getClassifierOptions ) { Validator . notNull ( getClassifierOptions , "getClassifierOptions cannot be null" ) ; String [ ] pathSegments = { "v3/classifiers" } ; String [ ] pathParameters = { getClassifierOptions . classifierId ( ) } ; RequestBuilder... | Retrieve classifier details . |
26,063 | public ServiceCall < Classifiers > listClassifiers ( ListClassifiersOptions listClassifiersOptions ) { String [ ] pathSegments = { "v3/classifiers" } ; RequestBuilder builder = RequestBuilder . get ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments ) ) ; builder . query ( "version" , versionDate ) ; M... | Retrieve a list of classifiers . |
26,064 | public ServiceCall < Classifier > updateClassifier ( UpdateClassifierOptions updateClassifierOptions ) { Validator . notNull ( updateClassifierOptions , "updateClassifierOptions cannot be null" ) ; Validator . isTrue ( ( updateClassifierOptions . positiveExamples ( ) != null ) || ( updateClassifierOptions . negativeExa... | Update a classifier . |
26,065 | public ServiceCall < InputStream > getCoreMlModel ( GetCoreMlModelOptions getCoreMlModelOptions ) { Validator . notNull ( getCoreMlModelOptions , "getCoreMlModelOptions cannot be null" ) ; String [ ] pathSegments = { "v3/classifiers" , "core_ml_model" } ; String [ ] pathParameters = { getCoreMlModelOptions . classifier... | Retrieve a Core ML model of a classifier . |
26,066 | public ServiceCall < Void > deleteUserData ( DeleteUserDataOptions deleteUserDataOptions ) { Validator . notNull ( deleteUserDataOptions , "deleteUserDataOptions cannot be null" ) ; String [ ] pathSegments = { "v3/user_data" } ; RequestBuilder builder = RequestBuilder . delete ( RequestBuilder . constructHttpUrl ( getE... | Delete labeled data . |
26,067 | private static void writeToFile ( InputStream in , File file ) { try { OutputStream out = new FileOutputStream ( file ) ; byte [ ] buf = new byte [ 1024 ] ; int len ; while ( ( len = in . read ( buf ) ) > 0 ) { out . write ( buf , 0 , len ) ; } out . close ( ) ; in . close ( ) ; } catch ( Exception e ) { e . printStack... | Write the input stream to a file . |
26,068 | public ServiceCall < AnalysisResults > analyze ( AnalyzeOptions analyzeOptions ) { Validator . notNull ( analyzeOptions , "analyzeOptions cannot be null" ) ; String [ ] pathSegments = { "v1/analyze" } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments )... | Analyze text . |
26,069 | private String buildStopMessage ( ) { JsonObject stopMessage = new JsonObject ( ) ; stopMessage . addProperty ( ACTION , STOP ) ; return stopMessage . toString ( ) ; } | Builds the stop message . |
26,070 | private void parseArray ( JsonReader in , HashMap < String , Object > objMap , String name ) throws IOException { List < HashMap < String , Object > > array = new ArrayList < > ( ) ; in . beginArray ( ) ; while ( in . peek ( ) != JsonToken . END_ARRAY ) { HashMap < String , Object > arrayItem = new HashMap < > ( ) ; pa... | Parses a JSON array and adds it to the main object map . |
26,071 | private void parseObject ( JsonReader in , HashMap < String , Object > objMap , String name ) throws IOException { HashMap < String , Object > innerObject = new HashMap < > ( ) ; in . beginObject ( ) ; while ( in . peek ( ) != JsonToken . END_OBJECT ) { parseNext ( in , innerObject ) ; } in . endObject ( ) ; objMap . p... | Parses a JSON object and adds it to the main object map . |
26,072 | private void collapseMap ( HashMap < String , Object > objMap ) { while ( objMap . keySet ( ) . size ( ) == 1 && objMap . keySet ( ) . contains ( "" ) ) { HashMap < String , Object > innerMap = ( HashMap < String , Object > ) objMap . get ( "" ) ; objMap . clear ( ) ; objMap . putAll ( innerMap ) ; } } | Condenses the main object map to eliminate unnecessary nesting and allow for proper type conversion when the map is complete . |
26,073 | public ServiceCall < Profile > profile ( ProfileOptions profileOptions ) { Validator . notNull ( profileOptions , "profileOptions cannot be null" ) ; String [ ] pathSegments = { "v3/profile" } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments ) ) ; bui... | Get profile . |
26,074 | private void sendInputStream ( InputStream inputStream ) { byte [ ] buffer = new byte [ ONE_KB ] ; int read ; try { while ( ( ( read = inputStream . read ( buffer ) ) > 0 ) && socketOpen ) { while ( socket . queueSize ( ) > QUEUE_SIZE_LIMIT ) { Thread . sleep ( QUEUE_WAIT_MILLIS ) ; } if ( read == ONE_KB ) { socket . s... | Send input stream . |
26,075 | public ServiceCall < Environment > createEnvironment ( CreateEnvironmentOptions createEnvironmentOptions ) { Validator . notNull ( createEnvironmentOptions , "createEnvironmentOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . ... | Create an environment . |
26,076 | public ServiceCall < Environment > getEnvironment ( GetEnvironmentOptions getEnvironmentOptions ) { Validator . notNull ( getEnvironmentOptions , "getEnvironmentOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" } ; String [ ] pathParameters = { getEnvironmentOptions . environmentId ( ) } ; Reque... | Get environment info . |
26,077 | public ServiceCall < ListEnvironmentsResponse > listEnvironments ( ListEnvironmentsOptions listEnvironmentsOptions ) { String [ ] pathSegments = { "v1/environments" } ; RequestBuilder builder = RequestBuilder . get ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments ) ) ; builder . query ( "version" , ... | List environments . |
26,078 | public ServiceCall < ListCollectionFieldsResponse > listFields ( ListFieldsOptions listFieldsOptions ) { Validator . notNull ( listFieldsOptions , "listFieldsOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "fields" } ; String [ ] pathParameters = { listFieldsOptions . environmentId ( ) } ; R... | List fields across collections . |
26,079 | public ServiceCall < Configuration > getConfiguration ( GetConfigurationOptions getConfigurationOptions ) { Validator . notNull ( getConfigurationOptions , "getConfigurationOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "configurations" } ; String [ ] pathParameters = { getConfigurationOpti... | Get configuration details . |
26,080 | public ServiceCall < ListConfigurationsResponse > listConfigurations ( ListConfigurationsOptions listConfigurationsOptions ) { Validator . notNull ( listConfigurationsOptions , "listConfigurationsOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "configurations" } ; String [ ] pathParameters =... | List configurations . |
26,081 | public ServiceCall < Configuration > updateConfiguration ( UpdateConfigurationOptions updateConfigurationOptions ) { Validator . notNull ( updateConfigurationOptions , "updateConfigurationOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "configurations" } ; String [ ] pathParameters = { updat... | Update a configuration . |
26,082 | public ServiceCall < Collection > createCollection ( CreateCollectionOptions createCollectionOptions ) { Validator . notNull ( createCollectionOptions , "createCollectionOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" } ; String [ ] pathParameters = { createCollectionOptions . ... | Create a collection . |
26,083 | public ServiceCall < Collection > getCollection ( GetCollectionOptions getCollectionOptions ) { Validator . notNull ( getCollectionOptions , "getCollectionOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" } ; String [ ] pathParameters = { getCollectionOptions . environmentId ( ) ... | Get collection details . |
26,084 | public ServiceCall < ListCollectionFieldsResponse > listCollectionFields ( ListCollectionFieldsOptions listCollectionFieldsOptions ) { Validator . notNull ( listCollectionFieldsOptions , "listCollectionFieldsOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" , "fields" } ; String ... | List collection fields . |
26,085 | public ServiceCall < ListCollectionsResponse > listCollections ( ListCollectionsOptions listCollectionsOptions ) { Validator . notNull ( listCollectionsOptions , "listCollectionsOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" } ; String [ ] pathParameters = { listCollectionsOpt... | List collections . |
26,086 | public ServiceCall < Collection > updateCollection ( UpdateCollectionOptions updateCollectionOptions ) { Validator . notNull ( updateCollectionOptions , "updateCollectionOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" } ; String [ ] pathParameters = { updateCollectionOptions . ... | Update a collection . |
26,087 | public ServiceCall < Expansions > createExpansions ( CreateExpansionsOptions createExpansionsOptions ) { Validator . notNull ( createExpansionsOptions , "createExpansionsOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" , "expansions" } ; String [ ] pathParameters = { createExpan... | Create or update expansion list . |
26,088 | public ServiceCall < TokenDictStatusResponse > createStopwordList ( CreateStopwordListOptions createStopwordListOptions ) { Validator . notNull ( createStopwordListOptions , "createStopwordListOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" , "word_lists/stopwords" } ; String [... | Create stopword list . |
26,089 | public ServiceCall < TokenDictStatusResponse > createTokenizationDictionary ( CreateTokenizationDictionaryOptions createTokenizationDictionaryOptions ) { Validator . notNull ( createTokenizationDictionaryOptions , "createTokenizationDictionaryOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "... | Create tokenization dictionary . |
26,090 | public ServiceCall < Void > deleteExpansions ( DeleteExpansionsOptions deleteExpansionsOptions ) { Validator . notNull ( deleteExpansionsOptions , "deleteExpansionsOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" , "expansions" } ; String [ ] pathParameters = { deleteExpansionsO... | Delete the expansion list . |
26,091 | public ServiceCall < TokenDictStatusResponse > getTokenizationDictionaryStatus ( GetTokenizationDictionaryStatusOptions getTokenizationDictionaryStatusOptions ) { Validator . notNull ( getTokenizationDictionaryStatusOptions , "getTokenizationDictionaryStatusOptions cannot be null" ) ; String [ ] pathSegments = { "v1/en... | Get tokenization dictionary status . |
26,092 | public ServiceCall < Expansions > listExpansions ( ListExpansionsOptions listExpansionsOptions ) { Validator . notNull ( listExpansionsOptions , "listExpansionsOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" , "expansions" } ; String [ ] pathParameters = { listExpansionsOptions... | Get the expansion list . |
26,093 | public ServiceCall < DocumentStatus > getDocumentStatus ( GetDocumentStatusOptions getDocumentStatusOptions ) { Validator . notNull ( getDocumentStatusOptions , "getDocumentStatusOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" , "documents" } ; String [ ] pathParameters = { get... | Get document details . |
26,094 | public ServiceCall < QueryEntitiesResponse > queryEntities ( QueryEntitiesOptions queryEntitiesOptions ) { Validator . notNull ( queryEntitiesOptions , "queryEntitiesOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" , "query_entities" } ; String [ ] pathParameters = { queryEntiti... | Knowledge Graph entity query . |
26,095 | public ServiceCall < QueryRelationsResponse > queryRelations ( QueryRelationsOptions queryRelationsOptions ) { Validator . notNull ( queryRelationsOptions , "queryRelationsOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" , "query_relations" } ; String [ ] pathParameters = { quer... | Knowledge Graph relationship query . |
26,096 | public ServiceCall < TrainingQuery > addTrainingData ( AddTrainingDataOptions addTrainingDataOptions ) { Validator . notNull ( addTrainingDataOptions , "addTrainingDataOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" , "training_data" } ; String [ ] pathParameters = { addTrainin... | Add query to training data . |
26,097 | public ServiceCall < TrainingExample > createTrainingExample ( CreateTrainingExampleOptions createTrainingExampleOptions ) { Validator . notNull ( createTrainingExampleOptions , "createTrainingExampleOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" , "training_data" , "examples"... | Add example to training data query . |
26,098 | public ServiceCall < TrainingQuery > getTrainingData ( GetTrainingDataOptions getTrainingDataOptions ) { Validator . notNull ( getTrainingDataOptions , "getTrainingDataOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" , "training_data" } ; String [ ] pathParameters = { getTrainin... | Get details about a query . |
26,099 | public ServiceCall < TrainingExample > getTrainingExample ( GetTrainingExampleOptions getTrainingExampleOptions ) { Validator . notNull ( getTrainingExampleOptions , "getTrainingExampleOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" , "training_data" , "examples" } ; String [ ]... | Get details for training data example . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.