repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
aeshell/aesh-extensions
aesh/src/main/java/org/aesh/extensions/less/SimpleFileParser.java
SimpleFileParser.setFile
public void setFile(File file) throws IOException { if(!file.isFile()) throw new IllegalArgumentException(file+" must be a file."); else { if(file.getName().endsWith("gz")) initGzReader(file); else initReader(file); } }
java
public void setFile(File file) throws IOException { if(!file.isFile()) throw new IllegalArgumentException(file+" must be a file."); else { if(file.getName().endsWith("gz")) initGzReader(file); else initReader(file); } }
[ "public", "void", "setFile", "(", "File", "file", ")", "throws", "IOException", "{", "if", "(", "!", "file", ".", "isFile", "(", ")", ")", "throw", "new", "IllegalArgumentException", "(", "file", "+", "\" must be a file.\"", ")", ";", "else", "{", "if", ...
Read from a specified file. Also supports gzipped files. @param file File @throws IOException
[ "Read", "from", "a", "specified", "file", ".", "Also", "supports", "gzipped", "files", "." ]
3838ce46ed3771eb2ee6934303500f01a558e9ca
https://github.com/aeshell/aesh-extensions/blob/3838ce46ed3771eb2ee6934303500f01a558e9ca/aesh/src/main/java/org/aesh/extensions/less/SimpleFileParser.java#L65-L74
train
aeshell/aesh-extensions
aesh/src/main/java/org/aesh/extensions/less/SimpleFileParser.java
SimpleFileParser.setFileFromAJar
public void setFileFromAJar(String fileName) { InputStream is = this.getClass().getResourceAsStream(fileName); if(is != null) { this.fileName = fileName; reader = new InputStreamReader(is); } }
java
public void setFileFromAJar(String fileName) { InputStream is = this.getClass().getResourceAsStream(fileName); if(is != null) { this.fileName = fileName; reader = new InputStreamReader(is); } }
[ "public", "void", "setFileFromAJar", "(", "String", "fileName", ")", "{", "InputStream", "is", "=", "this", ".", "getClass", "(", ")", ".", "getResourceAsStream", "(", "fileName", ")", ";", "if", "(", "is", "!=", "null", ")", "{", "this", ".", "fileName"...
Read a file resouce located in a jar @param fileName name
[ "Read", "a", "file", "resouce", "located", "in", "a", "jar" ]
3838ce46ed3771eb2ee6934303500f01a558e9ca
https://github.com/aeshell/aesh-extensions/blob/3838ce46ed3771eb2ee6934303500f01a558e9ca/aesh/src/main/java/org/aesh/extensions/less/SimpleFileParser.java#L91-L97
train
Zappos/zappos-json
src/main/java/com/zappos/json/JsonReaderCodeGenerator.java
JsonReaderCodeGenerator.getTypeInfo
private TypeInfo getTypeInfo(Map<String, TypeInfo> typeMaps, String path, Class<?> superType) { TypeInfo typeInfo = typeMaps.get(path); if (typeInfo == null) { typeInfo = new TypeInfo(superType); typeMaps.put(path, typeInfo); } return typeInfo; }
java
private TypeInfo getTypeInfo(Map<String, TypeInfo> typeMaps, String path, Class<?> superType) { TypeInfo typeInfo = typeMaps.get(path); if (typeInfo == null) { typeInfo = new TypeInfo(superType); typeMaps.put(path, typeInfo); } return typeInfo; }
[ "private", "TypeInfo", "getTypeInfo", "(", "Map", "<", "String", ",", "TypeInfo", ">", "typeMaps", ",", "String", "path", ",", "Class", "<", "?", ">", "superType", ")", "{", "TypeInfo", "typeInfo", "=", "typeMaps", ".", "get", "(", "path", ")", ";", "i...
Get the TypeInfo object from specified path or return the new one if it does not exist. @param typeMaps @param path @param superType @return
[ "Get", "the", "TypeInfo", "object", "from", "specified", "path", "or", "return", "the", "new", "one", "if", "it", "does", "not", "exist", "." ]
340633f5db75c2e09ce49bfc3e5f67e8823f5a37
https://github.com/Zappos/zappos-json/blob/340633f5db75c2e09ce49bfc3e5f67e8823f5a37/src/main/java/com/zappos/json/JsonReaderCodeGenerator.java#L354-L364
train
Jasig/spring-portlet-contrib
spring-security-portlet-contrib/src/main/java/org/jasig/springframework/security/portlet/authentication/PortletAuthenticationProcessingFilter.java
PortletAuthenticationProcessingFilter.successfulAuthentication
protected void successfulAuthentication(PortletRequest request, PortletResponse response, Authentication authResult) { if (logger.isDebugEnabled()) { logger.debug("Authentication success: " + authResult); } SecurityContextHolder.getContext().setAuthentication(authResult); // Fire event if (this.eventPublisher != null) { eventPublisher.publishEvent(new InteractiveAuthenticationSuccessEvent(authResult, this.getClass())); } }
java
protected void successfulAuthentication(PortletRequest request, PortletResponse response, Authentication authResult) { if (logger.isDebugEnabled()) { logger.debug("Authentication success: " + authResult); } SecurityContextHolder.getContext().setAuthentication(authResult); // Fire event if (this.eventPublisher != null) { eventPublisher.publishEvent(new InteractiveAuthenticationSuccessEvent(authResult, this.getClass())); } }
[ "protected", "void", "successfulAuthentication", "(", "PortletRequest", "request", ",", "PortletResponse", "response", ",", "Authentication", "authResult", ")", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "debug", "(", "\"...
Puts the Authentication instance returned by the authentication manager into the secure context. @param request a {@link javax.portlet.PortletRequest} object. @param response a {@link javax.portlet.PortletResponse} object. @param authResult a {@link org.springframework.security.core.Authentication} object.
[ "Puts", "the", "Authentication", "instance", "returned", "by", "the", "authentication", "manager", "into", "the", "secure", "context", "." ]
719240fa268ddc69900ce9775d9cad3b9c543c6b
https://github.com/Jasig/spring-portlet-contrib/blob/719240fa268ddc69900ce9775d9cad3b9c543c6b/spring-security-portlet-contrib/src/main/java/org/jasig/springframework/security/portlet/authentication/PortletAuthenticationProcessingFilter.java#L214-L224
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/SettingsApi.java
SettingsApi.deleteTemplatesWithHttpInfo
public ApiResponse<Templates> deleteTemplatesWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = deleteTemplatesValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<Templates>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<Templates> deleteTemplatesWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = deleteTemplatesValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<Templates>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "Templates", ">", "deleteTemplatesWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "deleteTemplatesValidateBeforeCall", "(", "null", ",", "null", ")", ";", "Typ...
Delete Templates. deleteTemplates @return ApiResponse&lt;Templates&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Delete", "Templates", ".", "deleteTemplates" ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/SettingsApi.java#L133-L137
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/SettingsApi.java
SettingsApi.getApiEndpointsWithHttpInfo
public ApiResponse<ApiEndpointsSuccess> getApiEndpointsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getApiEndpointsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<ApiEndpointsSuccess>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<ApiEndpointsSuccess> getApiEndpointsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getApiEndpointsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<ApiEndpointsSuccess>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "ApiEndpointsSuccess", ">", "getApiEndpointsWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "getApiEndpointsValidateBeforeCall", "(", "null", ",", "null", ")", "...
Get apiEndpoints. Get api-endpoints @return ApiResponse&lt;ApiEndpointsSuccess&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Get", "apiEndpoints", ".", "Get", "api", "-", "endpoints" ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/SettingsApi.java#L246-L250
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/SettingsApi.java
SettingsApi.getTemplatesWithHttpInfo
public ApiResponse<Templates> getTemplatesWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getTemplatesValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<Templates>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<Templates> getTemplatesWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getTemplatesValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<Templates>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "Templates", ">", "getTemplatesWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "getTemplatesValidateBeforeCall", "(", "null", ",", "null", ")", ";", "Type", ...
Get Templates. getTemplates @return ApiResponse&lt;Templates&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Get", "Templates", ".", "getTemplates" ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/SettingsApi.java#L359-L363
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/SettingsApi.java
SettingsApi.postApiEndpointsWithHttpInfo
public ApiResponse<ApiPostEndpointsSuccess> postApiEndpointsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postApiEndpointsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<ApiPostEndpointsSuccess>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<ApiPostEndpointsSuccess> postApiEndpointsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postApiEndpointsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<ApiPostEndpointsSuccess>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "ApiPostEndpointsSuccess", ">", "postApiEndpointsWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "postApiEndpointsValidateBeforeCall", "(", "null", ",", "null", ")...
Post apiEndpoints. Post api-endpoints @return ApiResponse&lt;ApiPostEndpointsSuccess&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Post", "apiEndpoints", ".", "Post", "api", "-", "endpoints" ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/SettingsApi.java#L472-L476
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/SettingsApi.java
SettingsApi.postTemplatesWithHttpInfo
public ApiResponse<Templates> postTemplatesWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postTemplatesValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<Templates>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<Templates> postTemplatesWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postTemplatesValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<Templates>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "Templates", ">", "postTemplatesWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "postTemplatesValidateBeforeCall", "(", "null", ",", "null", ")", ";", "Type", ...
Post Templates. postTemplates @return ApiResponse&lt;Templates&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Post", "Templates", ".", "postTemplates" ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/SettingsApi.java#L585-L589
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/SettingsApi.java
SettingsApi.putTemplatesWithHttpInfo
public ApiResponse<Templates> putTemplatesWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = putTemplatesValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<Templates>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<Templates> putTemplatesWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = putTemplatesValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<Templates>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "Templates", ">", "putTemplatesWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "putTemplatesValidateBeforeCall", "(", "null", ",", "null", ")", ";", "Type", ...
Put Templates. putTemplates @return ApiResponse&lt;Templates&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Put", "Templates", ".", "putTemplates" ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/SettingsApi.java#L698-L702
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/SessionApi.java
SessionApi.getLogoutWithHttpInfo
public ApiResponse<GetLogout> getLogoutWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getLogoutValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetLogout>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<GetLogout> getLogoutWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getLogoutValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetLogout>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "GetLogout", ">", "getLogoutWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "getLogoutValidateBeforeCall", "(", "null", ",", "null", ")", ";", "Type", "local...
Logout user Logout the user by deleting the session and removing the associated cookie. @return ApiResponse&lt;GetLogout&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Logout", "user", "Logout", "the", "user", "by", "deleting", "the", "session", "and", "removing", "the", "associated", "cookie", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/SessionApi.java#L262-L266
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/SessionApi.java
SessionApi.initProvisioningWithHttpInfo
public ApiResponse<ApiSuccessResponse> initProvisioningWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = initProvisioningValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<ApiSuccessResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<ApiSuccessResponse> initProvisioningWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = initProvisioningValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<ApiSuccessResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "ApiSuccessResponse", ">", "initProvisioningWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "initProvisioningValidateBeforeCall", "(", "null", ",", "null", ")", ...
Init Session The GET operation will init user session. @return ApiResponse&lt;ApiSuccessResponse&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Init", "Session", "The", "GET", "operation", "will", "init", "user", "session", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/SessionApi.java#L375-L379
train
qzagarese/hyaline-dto
hyaline-dto/src/main/java/org/hyalinedto/api/Hyaline.java
Hyaline.dtoFromScratch
public static <T> T dtoFromScratch(T entity, DTO dtoTemplate) throws HyalineException { return dtoFromScratch(entity, dtoTemplate, "Hyaline$Proxy$" + System.currentTimeMillis()); }
java
public static <T> T dtoFromScratch(T entity, DTO dtoTemplate) throws HyalineException { return dtoFromScratch(entity, dtoTemplate, "Hyaline$Proxy$" + System.currentTimeMillis()); }
[ "public", "static", "<", "T", ">", "T", "dtoFromScratch", "(", "T", "entity", ",", "DTO", "dtoTemplate", ")", "throws", "HyalineException", "{", "return", "dtoFromScratch", "(", "entity", ",", "dtoTemplate", ",", "\"Hyaline$Proxy$\"", "+", "System", ".", "curr...
It lets you create a new DTO from scratch. This means that any annotation from JAXB, Jackson or whatever serialization framework you are using on your entity T will be ignored. The only annotation-based configuration that will be used is the one you are defining in this invocation. @param <T> the generic type @param entity the entity you are going proxy. @param dtoTemplate the DTO template passed as an anonymous class. @return a proxy that extends the type of entity, holding the same instance variables values as entity and configured according to dtoTemplate @throws HyalineException if the dynamic type could be created.
[ "It", "lets", "you", "create", "a", "new", "DTO", "from", "scratch", ".", "This", "means", "that", "any", "annotation", "from", "JAXB", "Jackson", "or", "whatever", "serialization", "framework", "you", "are", "using", "on", "your", "entity", "T", "will", "...
3392de5b7f93cdb3a1c53aa977ee682c141df5f4
https://github.com/qzagarese/hyaline-dto/blob/3392de5b7f93cdb3a1c53aa977ee682c141df5f4/hyaline-dto/src/main/java/org/hyalinedto/api/Hyaline.java#L77-L79
train
qzagarese/hyaline-dto
hyaline-dto/src/main/java/org/hyalinedto/api/Hyaline.java
Hyaline.dtoFromScratch
public static <T> T dtoFromScratch(T entity, DTO dtoTemplate, String proxyClassName) throws HyalineException { try { return createDTO(entity, dtoTemplate, true, proxyClassName); } catch (CannotInstantiateProxyException | DTODefinitionException e) { e.printStackTrace(); throw new HyalineException(); } }
java
public static <T> T dtoFromScratch(T entity, DTO dtoTemplate, String proxyClassName) throws HyalineException { try { return createDTO(entity, dtoTemplate, true, proxyClassName); } catch (CannotInstantiateProxyException | DTODefinitionException e) { e.printStackTrace(); throw new HyalineException(); } }
[ "public", "static", "<", "T", ">", "T", "dtoFromScratch", "(", "T", "entity", ",", "DTO", "dtoTemplate", ",", "String", "proxyClassName", ")", "throws", "HyalineException", "{", "try", "{", "return", "createDTO", "(", "entity", ",", "dtoTemplate", ",", "true...
It lets you create a new DTO from scratch. This means that any annotation for JAXB, Jackson or whatever serialization framework you are using on your entity T will be ignored. The only annotation-based configuration that will be used is the one you are defining in this invocation. @param <T> the generic type @param entity the entity you are going proxy. @param dtoTemplate the DTO template passed as an anonymous class. @param proxyClassName the name you want to assign to newly generated class @return a proxy that extends the type of entity, holding the same instance variables values as entity and configured according to dtoTemplate @throws HyalineException if the dynamic type could be created.
[ "It", "lets", "you", "create", "a", "new", "DTO", "from", "scratch", ".", "This", "means", "that", "any", "annotation", "for", "JAXB", "Jackson", "or", "whatever", "serialization", "framework", "you", "are", "using", "on", "your", "entity", "T", "will", "b...
3392de5b7f93cdb3a1c53aa977ee682c141df5f4
https://github.com/qzagarese/hyaline-dto/blob/3392de5b7f93cdb3a1c53aa977ee682c141df5f4/hyaline-dto/src/main/java/org/hyalinedto/api/Hyaline.java#L105-L112
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/SamlSettingsApi.java
SamlSettingsApi.getEnabledWithHttpInfo
public ApiResponse<GetEnabledResponse> getEnabledWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getEnabledValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetEnabledResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<GetEnabledResponse> getEnabledWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getEnabledValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetEnabledResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "GetEnabledResponse", ">", "getEnabledWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "getEnabledValidateBeforeCall", "(", "null", ",", "null", ")", ";", "Type...
Get SAML state. Returns SAML current state. @return ApiResponse&lt;GetEnabledResponse&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Get", "SAML", "state", ".", "Returns", "SAML", "current", "state", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/SamlSettingsApi.java#L386-L390
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/SamlSettingsApi.java
SamlSettingsApi.getLocationsWithHttpInfo
public ApiResponse<GetLocationResponse> getLocationsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getLocationsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetLocationResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<GetLocationResponse> getLocationsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getLocationsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetLocationResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "GetLocationResponse", ">", "getLocationsWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "getLocationsValidateBeforeCall", "(", "null", ",", "null", ")", ";", ...
Get exist locations. Returns exist locations. @return ApiResponse&lt;GetLocationResponse&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Get", "exist", "locations", ".", "Returns", "exist", "locations", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/SamlSettingsApi.java#L499-L503
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/SamlSettingsApi.java
SamlSettingsApi.postLocationWithHttpInfo
public ApiResponse<PostLocationResponse> postLocationWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postLocationValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PostLocationResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<PostLocationResponse> postLocationWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postLocationValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PostLocationResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "PostLocationResponse", ">", "postLocationWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "postLocationValidateBeforeCall", "(", "null", ",", "null", ")", ";", ...
Set main settings. Change global settings. @return ApiResponse&lt;PostLocationResponse&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Set", "main", "settings", ".", "Change", "global", "settings", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/SamlSettingsApi.java#L885-L889
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/StatisticsApi.java
StatisticsApi.checkMigrateConflictsWithHttpInfo
public ApiResponse<GetSubResponse> checkMigrateConflictsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = checkMigrateConflictsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetSubResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<GetSubResponse> checkMigrateConflictsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = checkMigrateConflictsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetSubResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "GetSubResponse", ">", "checkMigrateConflictsWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "checkMigrateConflictsValidateBeforeCall", "(", "null", ",", "null", "...
Get migrate check for conflicts. Get migrate check for conflicts @return ApiResponse&lt;GetSubResponse&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Get", "migrate", "check", "for", "conflicts", ".", "Get", "migrate", "check", "for", "conflicts" ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/StatisticsApi.java#L138-L142
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/StatisticsApi.java
StatisticsApi.checkPostMigrateStatisticWithHttpInfo
public ApiResponse<CheckPostMigrateStatistic> checkPostMigrateStatisticWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = checkPostMigrateStatisticValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<CheckPostMigrateStatistic>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<CheckPostMigrateStatistic> checkPostMigrateStatisticWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = checkPostMigrateStatisticValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<CheckPostMigrateStatistic>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "CheckPostMigrateStatistic", ">", "checkPostMigrateStatisticWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "checkPostMigrateStatisticValidateBeforeCall", "(", "null", ...
Post statistic migrate. Post statistic migrate @return ApiResponse&lt;CheckPostMigrateStatistic&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Post", "statistic", "migrate", ".", "Post", "statistic", "migrate" ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/StatisticsApi.java#L251-L255
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/StatisticsApi.java
StatisticsApi.getExportStatisticDefinitionsWithHttpInfo
public ApiResponse<GetExportStatisticDefinitions> getExportStatisticDefinitionsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getExportStatisticDefinitionsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetExportStatisticDefinitions>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<GetExportStatisticDefinitions> getExportStatisticDefinitionsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getExportStatisticDefinitionsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetExportStatisticDefinitions>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "GetExportStatisticDefinitions", ">", "getExportStatisticDefinitionsWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "getExportStatisticDefinitionsValidateBeforeCall", "(",...
Get export statistic definitions. Get export statistic definitions @return ApiResponse&lt;GetExportStatisticDefinitions&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Get", "export", "statistic", "definitions", ".", "Get", "export", "statistic", "definitions" ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/StatisticsApi.java#L610-L614
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/StatisticsApi.java
StatisticsApi.getStatisticDefinitionsWithHttpInfo
public ApiResponse<GetStatisticDefinitionsResponse> getStatisticDefinitionsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getStatisticDefinitionsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetStatisticDefinitionsResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<GetStatisticDefinitionsResponse> getStatisticDefinitionsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getStatisticDefinitionsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetStatisticDefinitionsResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "GetStatisticDefinitionsResponse", ">", "getStatisticDefinitionsWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "getStatisticDefinitionsValidateBeforeCall", "(", "null",...
Get statistic definitions. Returns statistic definitions records. @return ApiResponse&lt;GetStatisticDefinitionsResponse&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Get", "statistic", "definitions", ".", "Returns", "statistic", "definitions", "records", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/StatisticsApi.java#L723-L727
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/StatisticsApi.java
StatisticsApi.postImportStatisticDefinitionsWithHttpInfo
public ApiResponse<PostImportStatisticDefinitions> postImportStatisticDefinitionsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postImportStatisticDefinitionsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PostImportStatisticDefinitions>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<PostImportStatisticDefinitions> postImportStatisticDefinitionsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postImportStatisticDefinitionsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PostImportStatisticDefinitions>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "PostImportStatisticDefinitions", ">", "postImportStatisticDefinitionsWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "postImportStatisticDefinitionsValidateBeforeCall", "...
Post import statistic definitions. Post import statistic definitions @return ApiResponse&lt;PostImportStatisticDefinitions&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Post", "import", "statistic", "definitions", ".", "Post", "import", "statistic", "definitions" ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/StatisticsApi.java#L836-L840
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/StatisticsApi.java
StatisticsApi.postStatisticDefinitionsWithHttpInfo
public ApiResponse<GetStatisticDefinitionsResponse> postStatisticDefinitionsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postStatisticDefinitionsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetStatisticDefinitionsResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<GetStatisticDefinitionsResponse> postStatisticDefinitionsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postStatisticDefinitionsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetStatisticDefinitionsResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "GetStatisticDefinitionsResponse", ">", "postStatisticDefinitionsWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "postStatisticDefinitionsValidateBeforeCall", "(", "null...
Post statistic definitions. Returns statistic definitions records. @return ApiResponse&lt;GetStatisticDefinitionsResponse&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Post", "statistic", "definitions", ".", "Returns", "statistic", "definitions", "records", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/StatisticsApi.java#L949-L953
train
greenjoe/sergeants
src/main/java/pl/joegreen/sergeants/framework/queue/QueueConfiguration.java
QueueConfiguration.customGame
public static QueueConfiguration customGame(boolean force, String gameId, int team) { return new CustomGameQueueConfiguration(force, gameId, team); }
java
public static QueueConfiguration customGame(boolean force, String gameId, int team) { return new CustomGameQueueConfiguration(force, gameId, team); }
[ "public", "static", "QueueConfiguration", "customGame", "(", "boolean", "force", ",", "String", "gameId", ",", "int", "team", ")", "{", "return", "new", "CustomGameQueueConfiguration", "(", "force", ",", "gameId", ",", "team", ")", ";", "}" ]
Joins custom game. @param force indicates if player should vote for "force start" @param gameId identifier of the game to join (displayed in browser URL when starting custom game) @param team number of team that bot will join in the custom game
[ "Joins", "custom", "game", "." ]
db624bcea8597843210f138b82bc4a26b3ec92ca
https://github.com/greenjoe/sergeants/blob/db624bcea8597843210f138b82bc4a26b3ec92ca/src/main/java/pl/joegreen/sergeants/framework/queue/QueueConfiguration.java#L52-L54
train
Jasig/spring-portlet-contrib
spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/support/PortletRequestContextUtils.java
PortletRequestContextUtils.getPortletApplicationContext
public static PortletApplicationContext getPortletApplicationContext( PortletRequest request, PortletContext portletContext) throws IllegalStateException { PortletApplicationContext portletApplicationContext = (PortletApplicationContext) request.getAttribute( ContribDispatcherPortlet.PORTLET_APPLICATION_CONTEXT_ATTRIBUTE); if (portletApplicationContext == null) { if (portletContext == null) { throw new IllegalStateException("No PortletApplicationContext found: not in a DispatcherPortlet request?"); } portletApplicationContext = PortletApplicationContextUtils2.getRequiredPortletApplicationContext(portletContext); } return portletApplicationContext; }
java
public static PortletApplicationContext getPortletApplicationContext( PortletRequest request, PortletContext portletContext) throws IllegalStateException { PortletApplicationContext portletApplicationContext = (PortletApplicationContext) request.getAttribute( ContribDispatcherPortlet.PORTLET_APPLICATION_CONTEXT_ATTRIBUTE); if (portletApplicationContext == null) { if (portletContext == null) { throw new IllegalStateException("No PortletApplicationContext found: not in a DispatcherPortlet request?"); } portletApplicationContext = PortletApplicationContextUtils2.getRequiredPortletApplicationContext(portletContext); } return portletApplicationContext; }
[ "public", "static", "PortletApplicationContext", "getPortletApplicationContext", "(", "PortletRequest", "request", ",", "PortletContext", "portletContext", ")", "throws", "IllegalStateException", "{", "PortletApplicationContext", "portletApplicationContext", "=", "(", "PortletApp...
Look for the PortletApplicationContext associated with the DispatcherPortlet that has initiated request processing, and for the global context if none was found associated with the current request. This method is useful to allow components outside the framework, such as JSP tag handlers, to access the most specific application context available. @param request current portlet request @param portletContext current portlet context @return the request-specific PortletApplicationContext, or the global one if no request-specific context has been found @throws java.lang.IllegalStateException if neither a portlet-specific nor a global context has been found
[ "Look", "for", "the", "PortletApplicationContext", "associated", "with", "the", "DispatcherPortlet", "that", "has", "initiated", "request", "processing", "and", "for", "the", "global", "context", "if", "none", "was", "found", "associated", "with", "the", "current", ...
719240fa268ddc69900ce9775d9cad3b9c543c6b
https://github.com/Jasig/spring-portlet-contrib/blob/719240fa268ddc69900ce9775d9cad3b9c543c6b/spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/support/PortletRequestContextUtils.java#L70-L83
train
Jasig/spring-portlet-contrib
spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/support/PortletRequestContextUtils.java
PortletRequestContextUtils.getWebApplicationContext
public static ApplicationContext getWebApplicationContext( PortletRequest request, PortletContext portletContext) throws IllegalStateException { PortletApplicationContext portletApplicationContext = (PortletApplicationContext) request.getAttribute( ContribDispatcherPortlet.PORTLET_APPLICATION_CONTEXT_ATTRIBUTE); if (portletApplicationContext != null) { return portletApplicationContext; } if (portletContext == null) { throw new IllegalStateException("No PortletApplicationContext found: not in a DispatcherPortlet request?"); } portletApplicationContext = PortletApplicationContextUtils2.getPortletApplicationContext(portletContext); if (portletApplicationContext != null) { return portletApplicationContext; } return PortletApplicationContextUtils.getRequiredWebApplicationContext(portletContext); }
java
public static ApplicationContext getWebApplicationContext( PortletRequest request, PortletContext portletContext) throws IllegalStateException { PortletApplicationContext portletApplicationContext = (PortletApplicationContext) request.getAttribute( ContribDispatcherPortlet.PORTLET_APPLICATION_CONTEXT_ATTRIBUTE); if (portletApplicationContext != null) { return portletApplicationContext; } if (portletContext == null) { throw new IllegalStateException("No PortletApplicationContext found: not in a DispatcherPortlet request?"); } portletApplicationContext = PortletApplicationContextUtils2.getPortletApplicationContext(portletContext); if (portletApplicationContext != null) { return portletApplicationContext; } return PortletApplicationContextUtils.getRequiredWebApplicationContext(portletContext); }
[ "public", "static", "ApplicationContext", "getWebApplicationContext", "(", "PortletRequest", "request", ",", "PortletContext", "portletContext", ")", "throws", "IllegalStateException", "{", "PortletApplicationContext", "portletApplicationContext", "=", "(", "PortletApplicationCon...
Look for the PortletApplicationContext associated with the DispatcherPortlet that has initiated request processing, for the global portlet context if none was found associated with the current request, and for the global context if no global portlet context was found. This method is useful to allow components outside the framework, such as JSP tag handlers, to access the most specific application context available. @param request current portlet request @param portletContext current portlet context @return the request-specific PortletApplicationContext, or the global one if no request-specific context has been found @throws java.lang.IllegalStateException if neither a portlet-specific nor a global context has been found
[ "Look", "for", "the", "PortletApplicationContext", "associated", "with", "the", "DispatcherPortlet", "that", "has", "initiated", "request", "processing", "for", "the", "global", "portlet", "context", "if", "none", "was", "found", "associated", "with", "the", "curren...
719240fa268ddc69900ce9775d9cad3b9c543c6b
https://github.com/Jasig/spring-portlet-contrib/blob/719240fa268ddc69900ce9775d9cad3b9c543c6b/spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/support/PortletRequestContextUtils.java#L100-L118
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/provisioning/ProvisioningApi.java
ProvisioningApi.initializeWithCode
public void initializeWithCode(String authCode, String redirectUri) throws ProvisioningApiException { initialize(null, authCode, redirectUri); }
java
public void initializeWithCode(String authCode, String redirectUri) throws ProvisioningApiException { initialize(null, authCode, redirectUri); }
[ "public", "void", "initializeWithCode", "(", "String", "authCode", ",", "String", "redirectUri", ")", "throws", "ProvisioningApiException", "{", "initialize", "(", "null", ",", "authCode", ",", "redirectUri", ")", ";", "}" ]
Initialize the API with an code from the auth service. @param authCode the code. @param redirectUri the redirect uri used in the original code request. @throws ProvisioningApiException if the call is unsuccessful.
[ "Initialize", "the", "API", "with", "an", "code", "from", "the", "auth", "service", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/provisioning/ProvisioningApi.java#L106-L108
train
greenjoe/sergeants
src/main/java/pl/joegreen/sergeants/framework/model/api/UpdatableGameState.java
UpdatableGameState.update
public UpdatableGameState update(GameUpdateApiResponse gameUpdateData) { return new UpdatableGameState( gameUpdateData.getTurn(), startData, MapPatcher.patch(gameUpdateData.getMapDiff(), rawMapArray), MapPatcher.patch(gameUpdateData.getCitiesDiff(), rawCitiesArray), gameUpdateData.getGenerals(), createPlayersInfo(startData, gameUpdateData), gameUpdateData.getAttackIndex()); }
java
public UpdatableGameState update(GameUpdateApiResponse gameUpdateData) { return new UpdatableGameState( gameUpdateData.getTurn(), startData, MapPatcher.patch(gameUpdateData.getMapDiff(), rawMapArray), MapPatcher.patch(gameUpdateData.getCitiesDiff(), rawCitiesArray), gameUpdateData.getGenerals(), createPlayersInfo(startData, gameUpdateData), gameUpdateData.getAttackIndex()); }
[ "public", "UpdatableGameState", "update", "(", "GameUpdateApiResponse", "gameUpdateData", ")", "{", "return", "new", "UpdatableGameState", "(", "gameUpdateData", ".", "getTurn", "(", ")", ",", "startData", ",", "MapPatcher", ".", "patch", "(", "gameUpdateData", ".",...
Updates game state from previous turn with new information received from server. The method only works fine if updates are applied in sequence, as server is only sending map differences in update messages.
[ "Updates", "game", "state", "from", "previous", "turn", "with", "new", "information", "received", "from", "server", ".", "The", "method", "only", "works", "fine", "if", "updates", "are", "applied", "in", "sequence", "as", "server", "is", "only", "sending", "...
db624bcea8597843210f138b82bc4a26b3ec92ca
https://github.com/greenjoe/sergeants/blob/db624bcea8597843210f138b82bc4a26b3ec92ca/src/main/java/pl/joegreen/sergeants/framework/model/api/UpdatableGameState.java#L58-L65
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/MusicOnHoldApi.java
MusicOnHoldApi.getMOHFilesWithHttpInfo
public ApiResponse<GetMOHFilesResponse> getMOHFilesWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getMOHFilesValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetMOHFilesResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<GetMOHFilesResponse> getMOHFilesWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getMOHFilesValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetMOHFilesResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "GetMOHFilesResponse", ">", "getMOHFilesWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "getMOHFilesValidateBeforeCall", "(", "null", ",", "null", ")", ";", "T...
Get WAV files for MOH. Returns exist WAV files. @return ApiResponse&lt;GetMOHFilesResponse&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Get", "WAV", "files", "for", "MOH", ".", "Returns", "exist", "WAV", "files", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/MusicOnHoldApi.java#L260-L264
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/MusicOnHoldApi.java
MusicOnHoldApi.getMOHSettingsWithHttpInfo
public ApiResponse<GetMOHSettings> getMOHSettingsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getMOHSettingsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetMOHSettings>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<GetMOHSettings> getMOHSettingsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getMOHSettingsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetMOHSettings>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "GetMOHSettings", ">", "getMOHSettingsWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "getMOHSettingsValidateBeforeCall", "(", "null", ",", "null", ")", ";", "...
Get exist setting. Returns exist setting from MOH. @return ApiResponse&lt;GetMOHSettings&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Get", "exist", "setting", ".", "Returns", "exist", "setting", "from", "MOH", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/MusicOnHoldApi.java#L373-L377
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java
OperationsApi.checkInactivityWithHttpInfo
public ApiResponse<PostCheckInactivity> checkInactivityWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = checkInactivityValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PostCheckInactivity>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<PostCheckInactivity> checkInactivityWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = checkInactivityValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PostCheckInactivity>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "PostCheckInactivity", ">", "checkInactivityWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "checkInactivityValidateBeforeCall", "(", "null", ",", "null", ")", "...
Inactivity. Inactivity. @return ApiResponse&lt;PostCheckInactivity&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Inactivity", ".", "Inactivity", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java#L140-L144
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java
OperationsApi.getSubWithHttpInfo
public ApiResponse<GetSubResponse> getSubWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getSubValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetSubResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<GetSubResponse> getSubWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getSubValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetSubResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "GetSubResponse", ">", "getSubWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "getSubValidateBeforeCall", "(", "null", ",", "null", ")", ";", "Type", "localV...
Get sub. Sub @return ApiResponse&lt;GetSubResponse&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Get", "sub", ".", "Sub" ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java#L376-L380
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java
OperationsApi.postImportWithHttpInfo
public ApiResponse<PostImportResponse> postImportWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postImportValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PostImportResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<PostImportResponse> postImportWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postImportValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PostImportResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "PostImportResponse", ">", "postImportWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "postImportValidateBeforeCall", "(", "null", ",", "null", ")", ";", "Type...
PostImport. postImport @return ApiResponse&lt;PostImportResponse&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "PostImport", ".", "postImport" ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java#L910-L914
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java
OperationsApi.postUsersWithHttpInfo
public ApiResponse<PostUsers> postUsersWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postUsersValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PostUsers>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<PostUsers> postUsersWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postUsersValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PostUsers>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "PostUsers", ">", "postUsersWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "postUsersValidateBeforeCall", "(", "null", ",", "null", ")", ";", "Type", "local...
Post users. postUsers @return ApiResponse&lt;PostUsers&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Post", "users", ".", "postUsers" ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java#L1023-L1027
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java
OperationsApi.postValidateImportWithHttpInfo
public ApiResponse<PostValidateImportResponse> postValidateImportWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postValidateImportValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PostValidateImportResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<PostValidateImportResponse> postValidateImportWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = postValidateImportValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PostValidateImportResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "PostValidateImportResponse", ">", "postValidateImportWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "postValidateImportValidateBeforeCall", "(", "null", ",", "null...
Post Validate Import. post validate import @return ApiResponse&lt;PostValidateImportResponse&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Post", "Validate", "Import", ".", "post", "validate", "import" ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java#L1136-L1140
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java
OperationsApi.putUsersWithHttpInfo
public ApiResponse<PutUsers> putUsersWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = putUsersValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PutUsers>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<PutUsers> putUsersWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = putUsersValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<PutUsers>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "PutUsers", ">", "putUsersWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "putUsersValidateBeforeCall", "(", "null", ",", "null", ")", ";", "Type", "localVar...
Put users. putUsers @return ApiResponse&lt;PutUsers&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Put", "users", ".", "putUsers" ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java#L1249-L1253
train
Jasig/spring-portlet-contrib
spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/context/PortletContextLoader.java
PortletContextLoader.determineContextClass
protected Class<?> determineContextClass(PortletContext portletContext) { String contextClassName = portletContext.getInitParameter(CONTEXT_CLASS_PARAM); if (contextClassName != null) { try { return ClassUtils.forName(contextClassName, ClassUtils.getDefaultClassLoader()); } catch (ClassNotFoundException ex) { throw new ApplicationContextException( "Failed to load custom context class [" + contextClassName + "]", ex); } } else { contextClassName = defaultStrategies.getProperty(PortletApplicationContext.class.getName()); try { return ClassUtils.forName(contextClassName, PortletContextLoader.class.getClassLoader()); } catch (ClassNotFoundException ex) { throw new ApplicationContextException( "Failed to load default context class [" + contextClassName + "]", ex); } } }
java
protected Class<?> determineContextClass(PortletContext portletContext) { String contextClassName = portletContext.getInitParameter(CONTEXT_CLASS_PARAM); if (contextClassName != null) { try { return ClassUtils.forName(contextClassName, ClassUtils.getDefaultClassLoader()); } catch (ClassNotFoundException ex) { throw new ApplicationContextException( "Failed to load custom context class [" + contextClassName + "]", ex); } } else { contextClassName = defaultStrategies.getProperty(PortletApplicationContext.class.getName()); try { return ClassUtils.forName(contextClassName, PortletContextLoader.class.getClassLoader()); } catch (ClassNotFoundException ex) { throw new ApplicationContextException( "Failed to load default context class [" + contextClassName + "]", ex); } } }
[ "protected", "Class", "<", "?", ">", "determineContextClass", "(", "PortletContext", "portletContext", ")", "{", "String", "contextClassName", "=", "portletContext", ".", "getInitParameter", "(", "CONTEXT_CLASS_PARAM", ")", ";", "if", "(", "contextClassName", "!=", ...
Return the PortletApplicationContext implementation class to use, either the default XmlPortletApplicationContext or a custom context class if specified. @param portletContext current portlet context @return the WebApplicationContext implementation class to use @see #CONTEXT_CLASS_PARAM @see org.springframework.web.portlet.context.XmlPortletApplicationContext @see org.springframework.web.portlet.context.XmlPortletApplicationContext
[ "Return", "the", "PortletApplicationContext", "implementation", "class", "to", "use", "either", "the", "default", "XmlPortletApplicationContext", "or", "a", "custom", "context", "class", "if", "specified", "." ]
719240fa268ddc69900ce9775d9cad3b9c543c6b
https://github.com/Jasig/spring-portlet-contrib/blob/719240fa268ddc69900ce9775d9cad3b9c543c6b/spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/context/PortletContextLoader.java#L326-L347
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/SystemApi.java
SystemApi.argsWithHttpInfo
public ApiResponse<GetArgsResponse> argsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = argsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetArgsResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<GetArgsResponse> argsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = argsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetArgsResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "GetArgsResponse", ">", "argsWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "argsValidateBeforeCall", "(", "null", ",", "null", ")", ";", "Type", "localVarR...
Get provisioning arguments. Returns some of provisioning variables. @return ApiResponse&lt;GetArgsResponse&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Get", "provisioning", "arguments", ".", "Returns", "some", "of", "provisioning", "variables", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/SystemApi.java#L134-L138
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/SystemApi.java
SystemApi.dynconfigGetConfigWithHttpInfo
public ApiResponse<DynconfigGetConfigResponse> dynconfigGetConfigWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = dynconfigGetConfigValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<DynconfigGetConfigResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<DynconfigGetConfigResponse> dynconfigGetConfigWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = dynconfigGetConfigValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<DynconfigGetConfigResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "DynconfigGetConfigResponse", ">", "dynconfigGetConfigWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "dynconfigGetConfigValidateBeforeCall", "(", "null", ",", "null...
Get config.json file. Returns config.json file. @return ApiResponse&lt;DynconfigGetConfigResponse&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Get", "config", ".", "json", "file", ".", "Returns", "config", ".", "json", "file", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/SystemApi.java#L247-L251
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/SystemApi.java
SystemApi.getConfigWithHttpInfo
public ApiResponse<GetConfigResponse> getConfigWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getConfigValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetConfigResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<GetConfigResponse> getConfigWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getConfigValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetConfigResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "GetConfigResponse", ">", "getConfigWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "getConfigValidateBeforeCall", "(", "null", ",", "null", ")", ";", "Type", ...
Get analytics config. Returns exist config. @return ApiResponse&lt;GetConfigResponse&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Get", "analytics", "config", ".", "Returns", "exist", "config", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/SystemApi.java#L360-L364
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/provisioning/UsersApi.java
UsersApi.deleteUser
public void deleteUser(String userDBID, Boolean keepPlaces) throws ProvisioningApiException { try { ApiSuccessResponse resp = usersApi.deleteUser(userDBID, keepPlaces); if (!resp.getStatus().getCode().equals(0)) { throw new ProvisioningApiException("Error deleting user. Code: " + resp.getStatus().getCode()); } } catch(ApiException e) { throw new ProvisioningApiException("Error deleting user", e); } }
java
public void deleteUser(String userDBID, Boolean keepPlaces) throws ProvisioningApiException { try { ApiSuccessResponse resp = usersApi.deleteUser(userDBID, keepPlaces); if (!resp.getStatus().getCode().equals(0)) { throw new ProvisioningApiException("Error deleting user. Code: " + resp.getStatus().getCode()); } } catch(ApiException e) { throw new ProvisioningApiException("Error deleting user", e); } }
[ "public", "void", "deleteUser", "(", "String", "userDBID", ",", "Boolean", "keepPlaces", ")", "throws", "ProvisioningApiException", "{", "try", "{", "ApiSuccessResponse", "resp", "=", "usersApi", ".", "deleteUser", "(", "userDBID", ",", "keepPlaces", ")", ";", "...
Deletes a user with the given DBID. @param userDBID The DBID of the user to be deleted. (required) @param keepPlaces If null or false the user's places and DNs are not deleted. (optional) @throws ProvisioningApiException if the call is unsuccessful.
[ "Deletes", "a", "user", "with", "the", "given", "DBID", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/provisioning/UsersApi.java#L52-L62
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/provisioning/UsersApi.java
UsersApi.updateUser
public void updateUser(String userDBID, User user) throws ProvisioningApiException { try { ApiSuccessResponse resp = usersApi.updateUser(userDBID, new UpdateUserData().data(Converters.convertUserToUpdateUserDataData(user))); if (!resp.getStatus().getCode().equals(0)) { throw new ProvisioningApiException("Error updating user. Code: " + resp.getStatus().getCode()); } } catch(ApiException e) { throw new ProvisioningApiException("Error updating user", e); } }
java
public void updateUser(String userDBID, User user) throws ProvisioningApiException { try { ApiSuccessResponse resp = usersApi.updateUser(userDBID, new UpdateUserData().data(Converters.convertUserToUpdateUserDataData(user))); if (!resp.getStatus().getCode().equals(0)) { throw new ProvisioningApiException("Error updating user. Code: " + resp.getStatus().getCode()); } } catch(ApiException e) { throw new ProvisioningApiException("Error updating user", e); } }
[ "public", "void", "updateUser", "(", "String", "userDBID", ",", "User", "user", ")", "throws", "ProvisioningApiException", "{", "try", "{", "ApiSuccessResponse", "resp", "=", "usersApi", ".", "updateUser", "(", "userDBID", ",", "new", "UpdateUserData", "(", ")",...
Updates the attributes of a user with the given DBID. @param userDBID the DBID of the user to be updated. (required) @param user the new attributes of the user. (required) @throws ProvisioningApiException if the call is unsuccessful.
[ "Updates", "the", "attributes", "of", "a", "user", "with", "the", "given", "DBID", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/provisioning/UsersApi.java#L70-L80
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/provisioning/ObjectsApi.java
ObjectsApi.searchDnGroups
public Results<DnGroup> searchDnGroups(SearchParams searchParams) throws ProvisioningApiException { return searchDnGroups( searchParams.getLimit(), searchParams.getOffset(), searchParams.getSearchTerm(), searchParams.getSearchKey(), searchParams.getMatchMethod(), searchParams.getSortKey(), searchParams.getSortAscending(), searchParams.getSortMethod() ); }
java
public Results<DnGroup> searchDnGroups(SearchParams searchParams) throws ProvisioningApiException { return searchDnGroups( searchParams.getLimit(), searchParams.getOffset(), searchParams.getSearchTerm(), searchParams.getSearchKey(), searchParams.getMatchMethod(), searchParams.getSortKey(), searchParams.getSortAscending(), searchParams.getSortMethod() ); }
[ "public", "Results", "<", "DnGroup", ">", "searchDnGroups", "(", "SearchParams", "searchParams", ")", "throws", "ProvisioningApiException", "{", "return", "searchDnGroups", "(", "searchParams", ".", "getLimit", "(", ")", ",", "searchParams", ".", "getOffset", "(", ...
Get Dn groups. Get Dn groups from Configuration Server with the specified filters. @param searchParams object containing remaining search parameters (limit, offset, searchTerm, searchKey, matchMethod, sortKey, sortAscending, sortMethod). @return Results object which includes list of Dn groups and total count. @throws ProvisioningApiException if the call is unsuccessful.
[ "Get", "Dn", "groups", ".", "Get", "Dn", "groups", "from", "Configuration", "Server", "with", "the", "specified", "filters", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/provisioning/ObjectsApi.java#L284-L295
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/EmailSettingsApi.java
EmailSettingsApi.getInboundSettingsWithHttpInfo
public ApiResponse<GetInboundResponse> getInboundSettingsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getInboundSettingsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetInboundResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<GetInboundResponse> getInboundSettingsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getInboundSettingsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetInboundResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "GetInboundResponse", ">", "getInboundSettingsWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "getInboundSettingsValidateBeforeCall", "(", "null", ",", "null", ")"...
Get inbound settings. Returns inbound settings. @return ApiResponse&lt;GetInboundResponse&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Get", "inbound", "settings", ".", "Returns", "inbound", "settings", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/EmailSettingsApi.java#L260-L264
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/EmailSettingsApi.java
EmailSettingsApi.getOutboundSettingsWithHttpInfo
public ApiResponse<GetOutboundResponse> getOutboundSettingsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getOutboundSettingsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetOutboundResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<GetOutboundResponse> getOutboundSettingsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getOutboundSettingsValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetOutboundResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "GetOutboundResponse", ">", "getOutboundSettingsWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "getOutboundSettingsValidateBeforeCall", "(", "null", ",", "null", ...
Get outbound settings. Returns outbound settings. @return ApiResponse&lt;GetOutboundResponse&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Get", "outbound", "settings", ".", "Returns", "outbound", "settings", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/EmailSettingsApi.java#L373-L377
train
ralscha/bsoncodec-apt
src/main/java/ch/rasc/bsoncodec/CodecCodeGenerator.java
CodecCodeGenerator.lookupId
private static Element lookupId(List<Element> fields) { Element objectIdField = null; Element uuidField = null; Element _idField = null; Element idField = null; for (Element field : fields) { if (field.getAnnotation(Id.class) != null) { return field; } if (isObjectId(field)) { objectIdField = field; } else if (isUUID(field)) { uuidField = field; } else if (field.getSimpleName().contentEquals(ID_FIELD_NAME)) { _idField = field; } else if (field.getSimpleName().contentEquals("id")) { idField = field; } } if (objectIdField != null) { return objectIdField; } if (uuidField != null) { return uuidField; } if (_idField != null) { return _idField; } if (idField != null) { return idField; } return null; }
java
private static Element lookupId(List<Element> fields) { Element objectIdField = null; Element uuidField = null; Element _idField = null; Element idField = null; for (Element field : fields) { if (field.getAnnotation(Id.class) != null) { return field; } if (isObjectId(field)) { objectIdField = field; } else if (isUUID(field)) { uuidField = field; } else if (field.getSimpleName().contentEquals(ID_FIELD_NAME)) { _idField = field; } else if (field.getSimpleName().contentEquals("id")) { idField = field; } } if (objectIdField != null) { return objectIdField; } if (uuidField != null) { return uuidField; } if (_idField != null) { return _idField; } if (idField != null) { return idField; } return null; }
[ "private", "static", "Element", "lookupId", "(", "List", "<", "Element", ">", "fields", ")", "{", "Element", "objectIdField", "=", "null", ";", "Element", "uuidField", "=", "null", ";", "Element", "_idField", "=", "null", ";", "Element", "idField", "=", "n...
Find a field with the @Id annotation OR with type ObjectId OR with type UUID OR with name _id OR with name id
[ "Find", "a", "field", "with", "the" ]
999d87ec1ece9848f75954c9d9a0c4a005575d2f
https://github.com/ralscha/bsoncodec-apt/blob/999d87ec1ece9848f75954c9d9a0c4a005575d2f/src/main/java/ch/rasc/bsoncodec/CodecCodeGenerator.java#L727-L764
train
venkatramanm/swf-all
swf/src/main/java/com/venky/swf/path/Path.java
Path.getUser
public User getUser(String fieldName, String fieldValue){ Select q = new Select().from(User.class); String nameColumn = ModelReflector.instance(User.class).getColumnDescriptor(fieldName).getName(); q.where(new Expression(q.getPool(),nameColumn,Operator.EQ,new BindVariable(q.getPool(),fieldValue))); List<? extends User> users = q.execute(User.class); if (users.size() == 1){ return users.get(0); } return null; }
java
public User getUser(String fieldName, String fieldValue){ Select q = new Select().from(User.class); String nameColumn = ModelReflector.instance(User.class).getColumnDescriptor(fieldName).getName(); q.where(new Expression(q.getPool(),nameColumn,Operator.EQ,new BindVariable(q.getPool(),fieldValue))); List<? extends User> users = q.execute(User.class); if (users.size() == 1){ return users.get(0); } return null; }
[ "public", "User", "getUser", "(", "String", "fieldName", ",", "String", "fieldValue", ")", "{", "Select", "q", "=", "new", "Select", "(", ")", ".", "from", "(", "User", ".", "class", ")", ";", "String", "nameColumn", "=", "ModelReflector", ".", "instance...
Can be cast to any user model class as the proxy implements all the user classes.
[ "Can", "be", "cast", "to", "any", "user", "model", "class", "as", "the", "proxy", "implements", "all", "the", "user", "classes", "." ]
e6ca342df0645bf1122d81e302575014ad565b69
https://github.com/venkatramanm/swf-all/blob/e6ca342df0645bf1122d81e302575014ad565b69/swf/src/main/java/com/venky/swf/path/Path.java#L677-L687
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/provisioning/TraceInterceptor.java
TraceInterceptor.intercept
@Override public Response intercept(Chain chain) throws IOException { Request request = chain.request(); request = request.newBuilder() .addHeader(TRACEID_HEADER, makeUniqueId()) .addHeader(SPANID_HEADER, makeUniqueId()).build(); return chain.proceed(request); }
java
@Override public Response intercept(Chain chain) throws IOException { Request request = chain.request(); request = request.newBuilder() .addHeader(TRACEID_HEADER, makeUniqueId()) .addHeader(SPANID_HEADER, makeUniqueId()).build(); return chain.proceed(request); }
[ "@", "Override", "public", "Response", "intercept", "(", "Chain", "chain", ")", "throws", "IOException", "{", "Request", "request", "=", "chain", ".", "request", "(", ")", ";", "request", "=", "request", ".", "newBuilder", "(", ")", ".", "addHeader", "(", ...
64-bit ids
[ "64", "-", "bit", "ids" ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/provisioning/TraceInterceptor.java#L21-L29
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/AuditApi.java
AuditApi.getAuditWithHttpInfo
public ApiResponse<GetAuditResponse> getAuditWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getAuditValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetAuditResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
java
public ApiResponse<GetAuditResponse> getAuditWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getAuditValidateBeforeCall(null, null); Type localVarReturnType = new TypeToken<GetAuditResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
[ "public", "ApiResponse", "<", "GetAuditResponse", ">", "getAuditWithHttpInfo", "(", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "getAuditValidateBeforeCall", "(", "null", ",", "null", ")", ";", "Type", "...
Get audit records. Returns audit records. @return ApiResponse&lt;GetAuditResponse&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Get", "audit", "records", ".", "Returns", "audit", "records", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/AuditApi.java#L132-L136
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/provisioning/OptionsApi.java
OptionsApi.getOptions
public Options getOptions(String personDBID, String agentGroupDBID) throws ProvisioningApiException { try { OptionsGetResponseSuccess resp = optionsApi.optionsGet( personDBID, agentGroupDBID ); if (!resp.getStatus().getCode().equals(0)) { throw new ProvisioningApiException("Error getting options. Code: " + resp.getStatus().getCode()); } Options out = new Options(); out.setOptions((Map<String, Object>) resp.getData().getOptions()); out.setCmeAppName(resp.getData().getCmeAppName()); out.setCmeAppDBID(resp.getData().getCmeAppDBID()); return out; } catch (ApiException e) { throw new ProvisioningApiException("Error getting options", e); } }
java
public Options getOptions(String personDBID, String agentGroupDBID) throws ProvisioningApiException { try { OptionsGetResponseSuccess resp = optionsApi.optionsGet( personDBID, agentGroupDBID ); if (!resp.getStatus().getCode().equals(0)) { throw new ProvisioningApiException("Error getting options. Code: " + resp.getStatus().getCode()); } Options out = new Options(); out.setOptions((Map<String, Object>) resp.getData().getOptions()); out.setCmeAppName(resp.getData().getCmeAppName()); out.setCmeAppDBID(resp.getData().getCmeAppDBID()); return out; } catch (ApiException e) { throw new ProvisioningApiException("Error getting options", e); } }
[ "public", "Options", "getOptions", "(", "String", "personDBID", ",", "String", "agentGroupDBID", ")", "throws", "ProvisioningApiException", "{", "try", "{", "OptionsGetResponseSuccess", "resp", "=", "optionsApi", ".", "optionsGet", "(", "personDBID", ",", "agentGroupD...
Get options. Get options for a specified application and merge them with the person and agent group annexes. @param personDBID The DBID of a person. Options are merged with the person&#39;s annex and the annexes of the person&#39;s agent groups. Mutual with agent_group_dbid. (optional) @param agentGroupDBID The DBID of an agent group. Options are merged with the agent group&#39;s annex. Mutual with person_dbid. (optional) @return Options object containing list of Options as well as cmeAppName and cmeAppDBID. @throws ProvisioningApiException if the call is unsuccessful.
[ "Get", "options", ".", "Get", "options", "for", "a", "specified", "application", "and", "merge", "them", "with", "the", "person", "and", "agent", "group", "annexes", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/provisioning/OptionsApi.java#L31-L52
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/provisioning/OptionsApi.java
OptionsApi.modifyOptions
public void modifyOptions(Map<String, Object> options) throws ProvisioningApiException { try { OptionsPostResponseStatusSuccess resp = optionsApi.optionsPost(new OptionsPost().data(new OptionsPostData().options(options))); if (!resp.getStatus().getCode().equals(0)) { throw new ProvisioningApiException("Error modifying options. Code: " + resp.getStatus().getCode()); } } catch (ApiException e) { throw new ProvisioningApiException("Error modifying options", e); } }
java
public void modifyOptions(Map<String, Object> options) throws ProvisioningApiException { try { OptionsPostResponseStatusSuccess resp = optionsApi.optionsPost(new OptionsPost().data(new OptionsPostData().options(options))); if (!resp.getStatus().getCode().equals(0)) { throw new ProvisioningApiException("Error modifying options. Code: " + resp.getStatus().getCode()); } } catch (ApiException e) { throw new ProvisioningApiException("Error modifying options", e); } }
[ "public", "void", "modifyOptions", "(", "Map", "<", "String", ",", "Object", ">", "options", ")", "throws", "ProvisioningApiException", "{", "try", "{", "OptionsPostResponseStatusSuccess", "resp", "=", "optionsApi", ".", "optionsPost", "(", "new", "OptionsPost", "...
Modify options. Replace the existing application options with the specified new values. @param options attributes to be updated. @throws ProvisioningApiException if the call is unsuccessful.
[ "Modify", "options", ".", "Replace", "the", "existing", "application", "options", "with", "the", "specified", "new", "values", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/provisioning/OptionsApi.java#L61-L73
train
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/provisioning/OptionsApi.java
OptionsApi.updateOptions
public void updateOptions(Map<String, Object> newOptions, Map<String, Object> changedOptions, Map<String, Object> deletedOptions) throws ProvisioningApiException { try { OptionsPutResponseStatusSuccess resp = optionsApi.optionsPut( new OptionsPut() .data( new OptionsPutData() .newOptions(newOptions) .changedOptions(changedOptions) .deletedOptions(deletedOptions) ) ); if (!resp.getStatus().getCode().equals(0)) { throw new ProvisioningApiException("Error updating options. Code: " + resp.getStatus().getCode()); } } catch (ApiException e) { throw new ProvisioningApiException("Error updating options", e); } }
java
public void updateOptions(Map<String, Object> newOptions, Map<String, Object> changedOptions, Map<String, Object> deletedOptions) throws ProvisioningApiException { try { OptionsPutResponseStatusSuccess resp = optionsApi.optionsPut( new OptionsPut() .data( new OptionsPutData() .newOptions(newOptions) .changedOptions(changedOptions) .deletedOptions(deletedOptions) ) ); if (!resp.getStatus().getCode().equals(0)) { throw new ProvisioningApiException("Error updating options. Code: " + resp.getStatus().getCode()); } } catch (ApiException e) { throw new ProvisioningApiException("Error updating options", e); } }
[ "public", "void", "updateOptions", "(", "Map", "<", "String", ",", "Object", ">", "newOptions", ",", "Map", "<", "String", ",", "Object", ">", "changedOptions", ",", "Map", "<", "String", ",", "Object", ">", "deletedOptions", ")", "throws", "ProvisioningApiE...
Add, edit or delete options values. Add, edit or delete option values for the specified application. @param newOptions options to add. @param changedOptions options to change. @param deletedOptions options to remove. @throws ProvisioningApiException if the call is unsuccessful.
[ "Add", "edit", "or", "delete", "options", "values", ".", "Add", "edit", "or", "delete", "option", "values", "for", "the", "specified", "application", "." ]
1ad594c3767cec83052168e350994f922a26f75e
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/provisioning/OptionsApi.java#L84-L104
train
jayantk/jklol
src/com/jayantkrish/jklol/lisp/AmbEval.java
AmbEval.doDefine
private final EvalResult doDefine(List<SExpression> subexpressions, Environment environment, ParametricBfgBuilder builder, EvalContext context) { int nameToBind = subexpressions.get(1).getConstantIndex(); if (subexpressions.size() == 3) { // (define name value-expression) // Binds a name to the value of value-expression Object valueToBind = eval(subexpressions.get(2), environment, builder, context).getValue(); environment.bindName(nameToBind, valueToBind); } else if (subexpressions.size() >= 4) { // (define procedure-name (arg1 ...) procedure-body) // syntactic sugar equivalent to (define procedure-name (lambda (arg1 ...) procedure-body AmbLambdaValue lambdaValue = makeLambda(subexpressions.get(2), subexpressions.subList(3, subexpressions.size()), environment); environment.bindName(nameToBind, lambdaValue); } return new EvalResult(ConstantValue.UNDEFINED); }
java
private final EvalResult doDefine(List<SExpression> subexpressions, Environment environment, ParametricBfgBuilder builder, EvalContext context) { int nameToBind = subexpressions.get(1).getConstantIndex(); if (subexpressions.size() == 3) { // (define name value-expression) // Binds a name to the value of value-expression Object valueToBind = eval(subexpressions.get(2), environment, builder, context).getValue(); environment.bindName(nameToBind, valueToBind); } else if (subexpressions.size() >= 4) { // (define procedure-name (arg1 ...) procedure-body) // syntactic sugar equivalent to (define procedure-name (lambda (arg1 ...) procedure-body AmbLambdaValue lambdaValue = makeLambda(subexpressions.get(2), subexpressions.subList(3, subexpressions.size()), environment); environment.bindName(nameToBind, lambdaValue); } return new EvalResult(ConstantValue.UNDEFINED); }
[ "private", "final", "EvalResult", "doDefine", "(", "List", "<", "SExpression", ">", "subexpressions", ",", "Environment", "environment", ",", "ParametricBfgBuilder", "builder", ",", "EvalContext", "context", ")", "{", "int", "nameToBind", "=", "subexpressions", ".",...
Evaluates the "define" special form. @param subexpressions @param environment @param builder @return
[ "Evaluates", "the", "define", "special", "form", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/lisp/AmbEval.java#L222-L238
train
davidcarboni/cryptolite-java
src/main/java/com/github/davidcarboni/cryptolite/Generate.java
Generate.password
public static String password(int length) { StringBuilder result = new StringBuilder(); byte[] values = byteArray(length); // We use a modulus of an increasing index rather than of the byte values // to avoid certain characters coming up more often. int index = 0; for (int i = 0; i < length; i++) { index += (values[i] & 0xff); index = index % passwordCharacters.length(); result.append(passwordCharacters.charAt(index)); } return result.toString(); }
java
public static String password(int length) { StringBuilder result = new StringBuilder(); byte[] values = byteArray(length); // We use a modulus of an increasing index rather than of the byte values // to avoid certain characters coming up more often. int index = 0; for (int i = 0; i < length; i++) { index += (values[i] & 0xff); index = index % passwordCharacters.length(); result.append(passwordCharacters.charAt(index)); } return result.toString(); }
[ "public", "static", "String", "password", "(", "int", "length", ")", "{", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "byte", "[", "]", "values", "=", "byteArray", "(", "length", ")", ";", "// We use a modulus of an increasing index ra...
Generates a random password. @param length The length of the password to be returned. @return A password of the specified length, selected from {@link #passwordCharacters}.
[ "Generates", "a", "random", "password", "." ]
e67954181a04ffc9beb1d9abca1421195fcf9764
https://github.com/davidcarboni/cryptolite-java/blob/e67954181a04ffc9beb1d9abca1421195fcf9764/src/main/java/com/github/davidcarboni/cryptolite/Generate.java#L91-L106
train
jayantk/jklol
src/com/jayantkrish/jklol/ccg/CcgParse.java
CcgParse.getSyntacticParse
public CcgSyntaxTree getSyntacticParse() { HeadedSyntacticCategory originalSyntax = null; if (unaryRule != null) { originalSyntax = unaryRule.getUnaryRule().getInputSyntacticCategory().getCanonicalForm(); } else { originalSyntax = syntax; } if (isTerminal()) { return CcgSyntaxTree.createTerminal(syntax.getSyntax(), originalSyntax.getSyntax(), spanStart, spanEnd, words, posTags, originalSyntax); } else { CcgSyntaxTree leftTree = left.getSyntacticParse(); CcgSyntaxTree rightTree = right.getSyntacticParse(); return CcgSyntaxTree.createNonterminal(syntax.getSyntax(), originalSyntax.getSyntax(), leftTree, rightTree); } }
java
public CcgSyntaxTree getSyntacticParse() { HeadedSyntacticCategory originalSyntax = null; if (unaryRule != null) { originalSyntax = unaryRule.getUnaryRule().getInputSyntacticCategory().getCanonicalForm(); } else { originalSyntax = syntax; } if (isTerminal()) { return CcgSyntaxTree.createTerminal(syntax.getSyntax(), originalSyntax.getSyntax(), spanStart, spanEnd, words, posTags, originalSyntax); } else { CcgSyntaxTree leftTree = left.getSyntacticParse(); CcgSyntaxTree rightTree = right.getSyntacticParse(); return CcgSyntaxTree.createNonterminal(syntax.getSyntax(), originalSyntax.getSyntax(), leftTree, rightTree); } }
[ "public", "CcgSyntaxTree", "getSyntacticParse", "(", ")", "{", "HeadedSyntacticCategory", "originalSyntax", "=", "null", ";", "if", "(", "unaryRule", "!=", "null", ")", "{", "originalSyntax", "=", "unaryRule", ".", "getUnaryRule", "(", ")", ".", "getInputSyntactic...
Gets a representation of the syntactic structure of this parse, omitting all semantic information. @return
[ "Gets", "a", "representation", "of", "the", "syntactic", "structure", "of", "this", "parse", "omitting", "all", "semantic", "information", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/CcgParse.java#L197-L215
train
jayantk/jklol
src/com/jayantkrish/jklol/ccg/CcgParse.java
CcgParse.getLogicalForm
public Expression2 getLogicalForm() { Expression2 preUnaryLogicalForm = getPreUnaryLogicalForm(); if (unaryRule == null) { return preUnaryLogicalForm; } else if (preUnaryLogicalForm == null || unaryRule.getUnaryRule().getLogicalForm() == null) { return null; } else { return Expression2.nested(unaryRule.getUnaryRule().getLogicalForm(), preUnaryLogicalForm); } }
java
public Expression2 getLogicalForm() { Expression2 preUnaryLogicalForm = getPreUnaryLogicalForm(); if (unaryRule == null) { return preUnaryLogicalForm; } else if (preUnaryLogicalForm == null || unaryRule.getUnaryRule().getLogicalForm() == null) { return null; } else { return Expression2.nested(unaryRule.getUnaryRule().getLogicalForm(), preUnaryLogicalForm); } }
[ "public", "Expression2", "getLogicalForm", "(", ")", "{", "Expression2", "preUnaryLogicalForm", "=", "getPreUnaryLogicalForm", "(", ")", ";", "if", "(", "unaryRule", "==", "null", ")", "{", "return", "preUnaryLogicalForm", ";", "}", "else", "if", "(", "preUnaryL...
Gets the logical form for this CCG parse. @return
[ "Gets", "the", "logical", "form", "for", "this", "CCG", "parse", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/CcgParse.java#L222-L231
train
jayantk/jklol
src/com/jayantkrish/jklol/ccg/CcgParse.java
CcgParse.getLogicalFormForSpan
public SpannedExpression getLogicalFormForSpan(int spanStart, int spanEnd) { CcgParse spanningParse = getParseForSpan(spanStart, spanEnd); Expression2 lf = spanningParse.getPreUnaryLogicalForm(); if (lf != null) { return new SpannedExpression(spanningParse.getHeadedSyntacticCategory(), spanningParse.getLogicalForm(), spanningParse.getSpanStart(), spanningParse.getSpanEnd()); } else { return null; } }
java
public SpannedExpression getLogicalFormForSpan(int spanStart, int spanEnd) { CcgParse spanningParse = getParseForSpan(spanStart, spanEnd); Expression2 lf = spanningParse.getPreUnaryLogicalForm(); if (lf != null) { return new SpannedExpression(spanningParse.getHeadedSyntacticCategory(), spanningParse.getLogicalForm(), spanningParse.getSpanStart(), spanningParse.getSpanEnd()); } else { return null; } }
[ "public", "SpannedExpression", "getLogicalFormForSpan", "(", "int", "spanStart", ",", "int", "spanEnd", ")", "{", "CcgParse", "spanningParse", "=", "getParseForSpan", "(", "spanStart", ",", "spanEnd", ")", ";", "Expression2", "lf", "=", "spanningParse", ".", "getP...
Returns the logical form for the smallest subtree of the parse which completely contains the given span. @param spanStart @param spanEnd @return
[ "Returns", "the", "logical", "form", "for", "the", "smallest", "subtree", "of", "the", "parse", "which", "completely", "contains", "the", "given", "span", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/CcgParse.java#L241-L250
train
jayantk/jklol
src/com/jayantkrish/jklol/ccg/CcgParse.java
CcgParse.getSpannedLogicalForms
public List<SpannedExpression> getSpannedLogicalForms() { List<SpannedExpression> spannedExpressions = Lists.newArrayList(); getSpannedLogicalFormsHelper(spannedExpressions); return spannedExpressions; }
java
public List<SpannedExpression> getSpannedLogicalForms() { List<SpannedExpression> spannedExpressions = Lists.newArrayList(); getSpannedLogicalFormsHelper(spannedExpressions); return spannedExpressions; }
[ "public", "List", "<", "SpannedExpression", ">", "getSpannedLogicalForms", "(", ")", "{", "List", "<", "SpannedExpression", ">", "spannedExpressions", "=", "Lists", ".", "newArrayList", "(", ")", ";", "getSpannedLogicalFormsHelper", "(", "spannedExpressions", ")", "...
Gets the logical forms for every subspan of this parse tree. Many of the returned logical forms combine with each other during the parse of the sentence. @return
[ "Gets", "the", "logical", "forms", "for", "every", "subspan", "of", "this", "parse", "tree", ".", "Many", "of", "the", "returned", "logical", "forms", "combine", "with", "each", "other", "during", "the", "parse", "of", "the", "sentence", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/CcgParse.java#L259-L263
train
jayantk/jklol
src/com/jayantkrish/jklol/ccg/CcgParse.java
CcgParse.getSpannedWords
public List<String> getSpannedWords() { if (isTerminal()) { return words; } else { List<String> words = Lists.newArrayList(); words.addAll(left.getSpannedWords()); words.addAll(right.getSpannedWords()); return words; } }
java
public List<String> getSpannedWords() { if (isTerminal()) { return words; } else { List<String> words = Lists.newArrayList(); words.addAll(left.getSpannedWords()); words.addAll(right.getSpannedWords()); return words; } }
[ "public", "List", "<", "String", ">", "getSpannedWords", "(", ")", "{", "if", "(", "isTerminal", "(", ")", ")", "{", "return", "words", ";", "}", "else", "{", "List", "<", "String", ">", "words", "=", "Lists", ".", "newArrayList", "(", ")", ";", "w...
Gets all of the words spanned by this node of the parse tree, in sentence order. @return
[ "Gets", "all", "of", "the", "words", "spanned", "by", "this", "node", "of", "the", "parse", "tree", "in", "sentence", "order", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/CcgParse.java#L386-L395
train
jayantk/jklol
src/com/jayantkrish/jklol/ccg/CcgParse.java
CcgParse.getSpannedPosTags
public List<String> getSpannedPosTags() { if (isTerminal()) { return posTags; } else { List<String> tags = Lists.newArrayList(); tags.addAll(left.getSpannedPosTags()); tags.addAll(right.getSpannedPosTags()); return tags; } }
java
public List<String> getSpannedPosTags() { if (isTerminal()) { return posTags; } else { List<String> tags = Lists.newArrayList(); tags.addAll(left.getSpannedPosTags()); tags.addAll(right.getSpannedPosTags()); return tags; } }
[ "public", "List", "<", "String", ">", "getSpannedPosTags", "(", ")", "{", "if", "(", "isTerminal", "(", ")", ")", "{", "return", "posTags", ";", "}", "else", "{", "List", "<", "String", ">", "tags", "=", "Lists", ".", "newArrayList", "(", ")", ";", ...
Gets all of the part-of-speech tags spanned by this node of the parse tree, in sentence order. @return
[ "Gets", "all", "of", "the", "part", "-", "of", "-", "speech", "tags", "spanned", "by", "this", "node", "of", "the", "parse", "tree", "in", "sentence", "order", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/CcgParse.java#L403-L412
train
jayantk/jklol
src/com/jayantkrish/jklol/ccg/CcgParse.java
CcgParse.getSpannedLexiconEntries
public List<LexiconEntryInfo> getSpannedLexiconEntries() { if (isTerminal()) { return Arrays.asList(lexiconEntry); } else { List<LexiconEntryInfo> lexiconEntries = Lists.newArrayList(); lexiconEntries.addAll(left.getSpannedLexiconEntries()); lexiconEntries.addAll(right.getSpannedLexiconEntries()); return lexiconEntries; } }
java
public List<LexiconEntryInfo> getSpannedLexiconEntries() { if (isTerminal()) { return Arrays.asList(lexiconEntry); } else { List<LexiconEntryInfo> lexiconEntries = Lists.newArrayList(); lexiconEntries.addAll(left.getSpannedLexiconEntries()); lexiconEntries.addAll(right.getSpannedLexiconEntries()); return lexiconEntries; } }
[ "public", "List", "<", "LexiconEntryInfo", ">", "getSpannedLexiconEntries", "(", ")", "{", "if", "(", "isTerminal", "(", ")", ")", "{", "return", "Arrays", ".", "asList", "(", "lexiconEntry", ")", ";", "}", "else", "{", "List", "<", "LexiconEntryInfo", ">"...
Gets the lexicon entries for all terminal children of this parse tree node, in left-to-right order. @return
[ "Gets", "the", "lexicon", "entries", "for", "all", "terminal", "children", "of", "this", "parse", "tree", "node", "in", "left", "-", "to", "-", "right", "order", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/CcgParse.java#L420-L429
train
jayantk/jklol
src/com/jayantkrish/jklol/ccg/CcgParse.java
CcgParse.getAllDependencies
public List<DependencyStructure> getAllDependencies() { List<DependencyStructure> deps = Lists.newArrayList(); if (!isTerminal()) { deps.addAll(left.getAllDependencies()); deps.addAll(right.getAllDependencies()); } deps.addAll(dependencies); return deps; }
java
public List<DependencyStructure> getAllDependencies() { List<DependencyStructure> deps = Lists.newArrayList(); if (!isTerminal()) { deps.addAll(left.getAllDependencies()); deps.addAll(right.getAllDependencies()); } deps.addAll(dependencies); return deps; }
[ "public", "List", "<", "DependencyStructure", ">", "getAllDependencies", "(", ")", "{", "List", "<", "DependencyStructure", ">", "deps", "=", "Lists", ".", "newArrayList", "(", ")", ";", "if", "(", "!", "isTerminal", "(", ")", ")", "{", "deps", ".", "add...
Gets all dependency structures populated during parsing. @return
[ "Gets", "all", "dependency", "structures", "populated", "during", "parsing", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/CcgParse.java#L538-L546
train
jayantk/jklol
src/com/jayantkrish/jklol/ccg/CcgParse.java
CcgParse.getAllDependenciesIndexedByHeadWordIndex
public Multimap<Integer, DependencyStructure> getAllDependenciesIndexedByHeadWordIndex() { Multimap<Integer, DependencyStructure> map = HashMultimap.create(); for (DependencyStructure dep : getAllDependencies()) { map.put(dep.getHeadWordIndex(), dep); } return map; }
java
public Multimap<Integer, DependencyStructure> getAllDependenciesIndexedByHeadWordIndex() { Multimap<Integer, DependencyStructure> map = HashMultimap.create(); for (DependencyStructure dep : getAllDependencies()) { map.put(dep.getHeadWordIndex(), dep); } return map; }
[ "public", "Multimap", "<", "Integer", ",", "DependencyStructure", ">", "getAllDependenciesIndexedByHeadWordIndex", "(", ")", "{", "Multimap", "<", "Integer", ",", "DependencyStructure", ">", "map", "=", "HashMultimap", ".", "create", "(", ")", ";", "for", "(", "...
Gets all dependency structures populated during parsing, indexed by the word that projects the dependency. @return
[ "Gets", "all", "dependency", "structures", "populated", "during", "parsing", "indexed", "by", "the", "word", "that", "projects", "the", "dependency", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/CcgParse.java#L554-L560
train
cpollet/jixture
core/src/main/java/net/cpollet/jixture/fixtures/SqlFileFixture.java
SqlFileFixture.load
@Override public void load(UnitDaoFactory unitDaoFactory) { BufferedReader reader = new BufferedReader(new InputStreamReader(fileInputStream)); BufferedReaderIterator iterator = new BufferedReaderIterator(reader); StringBuilder currentQuery = new StringBuilder(); while (iterator.hasNext()) { String line = iterator.next().trim(); if (!isCommentOrEmptyLine(line)) { currentQuery.append(line).append(" "); } if (isEndOfQuery(line)) { unitDaoFactory.getUnitDao().execute(currentQuery.toString()); currentQuery = new StringBuilder(); } } }
java
@Override public void load(UnitDaoFactory unitDaoFactory) { BufferedReader reader = new BufferedReader(new InputStreamReader(fileInputStream)); BufferedReaderIterator iterator = new BufferedReaderIterator(reader); StringBuilder currentQuery = new StringBuilder(); while (iterator.hasNext()) { String line = iterator.next().trim(); if (!isCommentOrEmptyLine(line)) { currentQuery.append(line).append(" "); } if (isEndOfQuery(line)) { unitDaoFactory.getUnitDao().execute(currentQuery.toString()); currentQuery = new StringBuilder(); } } }
[ "@", "Override", "public", "void", "load", "(", "UnitDaoFactory", "unitDaoFactory", ")", "{", "BufferedReader", "reader", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "fileInputStream", ")", ")", ";", "BufferedReaderIterator", "iterator", "=",...
Execute the SQL file's content. @param unitDaoFactory the {@link net.cpollet.jixture.dao.UnitDaoFactory} to use.
[ "Execute", "the", "SQL", "file", "s", "content", "." ]
faef0d4991f81c2cdb5be3ba24176636ef0cc433
https://github.com/cpollet/jixture/blob/faef0d4991f81c2cdb5be3ba24176636ef0cc433/core/src/main/java/net/cpollet/jixture/fixtures/SqlFileFixture.java#L63-L81
train
jayantk/jklol
src/com/jayantkrish/jklol/ccg/lexinduct/vote/VotingLexiconInduction.java
VotingLexiconInduction.createParser
private static ParserInfo createParser(LexiconInductionCcgParserFactory factory, SufficientStatistics currentParameters, Collection<LexiconEntry> currentLexicon) { ParametricCcgParser family = factory.getParametricCcgParser(currentLexicon); SufficientStatistics newParameters = family.getNewSufficientStatistics(); if (currentParameters != null) { newParameters.transferParameters(currentParameters); } return new ParserInfo(currentLexicon, family, newParameters, family.getModelFromParameters(newParameters)); }
java
private static ParserInfo createParser(LexiconInductionCcgParserFactory factory, SufficientStatistics currentParameters, Collection<LexiconEntry> currentLexicon) { ParametricCcgParser family = factory.getParametricCcgParser(currentLexicon); SufficientStatistics newParameters = family.getNewSufficientStatistics(); if (currentParameters != null) { newParameters.transferParameters(currentParameters); } return new ParserInfo(currentLexicon, family, newParameters, family.getModelFromParameters(newParameters)); }
[ "private", "static", "ParserInfo", "createParser", "(", "LexiconInductionCcgParserFactory", "factory", ",", "SufficientStatistics", "currentParameters", ",", "Collection", "<", "LexiconEntry", ">", "currentLexicon", ")", "{", "ParametricCcgParser", "family", "=", "factory",...
Creates a CCG parser given parameters and a lexicon. @param factory @param currentParameters @param currentLexicon @return
[ "Creates", "a", "CCG", "parser", "given", "parameters", "and", "a", "lexicon", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/lexinduct/vote/VotingLexiconInduction.java#L179-L189
train
jayantk/jklol
src/com/jayantkrish/jklol/ccg/lexinduct/vote/VotingLexiconInduction.java
VotingLexiconInduction.getPartitionFunction
private double getPartitionFunction(List<CcgParse> parses) { double partitionFunction = 0.0; for (CcgParse parse : parses) { partitionFunction += parse.getSubtreeProbability(); } return partitionFunction; }
java
private double getPartitionFunction(List<CcgParse> parses) { double partitionFunction = 0.0; for (CcgParse parse : parses) { partitionFunction += parse.getSubtreeProbability(); } return partitionFunction; }
[ "private", "double", "getPartitionFunction", "(", "List", "<", "CcgParse", ">", "parses", ")", "{", "double", "partitionFunction", "=", "0.0", ";", "for", "(", "CcgParse", "parse", ":", "parses", ")", "{", "partitionFunction", "+=", "parse", ".", "getSubtreePr...
Gets the sum total probability assigned to all parses. @param parses @return
[ "Gets", "the", "sum", "total", "probability", "assigned", "to", "all", "parses", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/lexinduct/vote/VotingLexiconInduction.java#L238-L244
train
jayantk/jklol
src/com/jayantkrish/jklol/sequence/SequenceModelUtils.java
SequenceModelUtils.buildSequenceModel
public static ParametricFactorGraph buildSequenceModel(Iterable<String> emissionFeatureLines, String featureDelimiter) { // Read in the possible values of each variable. List<String> words = StringUtils.readColumnFromDelimitedLines(emissionFeatureLines, 0, featureDelimiter); List<String> labels = StringUtils.readColumnFromDelimitedLines(emissionFeatureLines, 1, featureDelimiter); List<String> emissionFeatures = StringUtils.readColumnFromDelimitedLines(emissionFeatureLines, 2, featureDelimiter); // Create dictionaries for each variable's values. DiscreteVariable wordType = new DiscreteVariable("word", words); DiscreteVariable labelType = new DiscreteVariable("label", labels); DiscreteVariable emissionFeatureType = new DiscreteVariable("emissionFeature", emissionFeatures); // Create a dynamic factor graph with a single plate replicating // the input/output variables. ParametricFactorGraphBuilder builder = new ParametricFactorGraphBuilder(); builder.addPlate(PLATE_NAME, new VariableNumMap(Ints.asList(1, 2), Arrays.asList(INPUT_NAME, OUTPUT_NAME), Arrays.asList(wordType, labelType)), 10000); String inputPattern = PLATE_NAME + "/?(0)/" + INPUT_NAME; String outputPattern = PLATE_NAME + "/?(0)/" + OUTPUT_NAME; String nextOutputPattern = PLATE_NAME + "/?(1)/" + OUTPUT_NAME; VariableNumMap plateVars = new VariableNumMap(Ints.asList(1, 2), Arrays.asList(inputPattern, outputPattern), Arrays.asList(wordType, labelType)); // Read in the emission features (for the word/label weights). VariableNumMap x = plateVars.getVariablesByName(inputPattern); VariableNumMap y = plateVars.getVariablesByName(outputPattern); VariableNumMap emissionFeatureVar = VariableNumMap.singleton(0, "emissionFeature", emissionFeatureType); TableFactor emissionFeatureFactor = TableFactor.fromDelimitedFile( Arrays.asList(x, y, emissionFeatureVar), emissionFeatureLines, featureDelimiter, false, SparseTensorBuilder.getFactory()) .cacheWeightPermutations(); System.out.println(emissionFeatureFactor.getVars()); // Add a parametric factor for the word/label weights DiscreteLogLinearFactor emissionFactor = new DiscreteLogLinearFactor(x.union(y), emissionFeatureVar, emissionFeatureFactor); builder.addFactor(WORD_LABEL_FACTOR, emissionFactor, VariableNamePattern.fromTemplateVariables(plateVars, VariableNumMap.EMPTY)); // Create a factor connecting adjacent labels VariableNumMap adjacentVars = new VariableNumMap(Ints.asList(0, 1), Arrays.asList(outputPattern, nextOutputPattern), Arrays.asList(labelType, labelType)); builder.addFactor(TRANSITION_FACTOR, DiscreteLogLinearFactor.createIndicatorFactor(adjacentVars), VariableNamePattern.fromTemplateVariables(adjacentVars, VariableNumMap.EMPTY)); return builder.build(); }
java
public static ParametricFactorGraph buildSequenceModel(Iterable<String> emissionFeatureLines, String featureDelimiter) { // Read in the possible values of each variable. List<String> words = StringUtils.readColumnFromDelimitedLines(emissionFeatureLines, 0, featureDelimiter); List<String> labels = StringUtils.readColumnFromDelimitedLines(emissionFeatureLines, 1, featureDelimiter); List<String> emissionFeatures = StringUtils.readColumnFromDelimitedLines(emissionFeatureLines, 2, featureDelimiter); // Create dictionaries for each variable's values. DiscreteVariable wordType = new DiscreteVariable("word", words); DiscreteVariable labelType = new DiscreteVariable("label", labels); DiscreteVariable emissionFeatureType = new DiscreteVariable("emissionFeature", emissionFeatures); // Create a dynamic factor graph with a single plate replicating // the input/output variables. ParametricFactorGraphBuilder builder = new ParametricFactorGraphBuilder(); builder.addPlate(PLATE_NAME, new VariableNumMap(Ints.asList(1, 2), Arrays.asList(INPUT_NAME, OUTPUT_NAME), Arrays.asList(wordType, labelType)), 10000); String inputPattern = PLATE_NAME + "/?(0)/" + INPUT_NAME; String outputPattern = PLATE_NAME + "/?(0)/" + OUTPUT_NAME; String nextOutputPattern = PLATE_NAME + "/?(1)/" + OUTPUT_NAME; VariableNumMap plateVars = new VariableNumMap(Ints.asList(1, 2), Arrays.asList(inputPattern, outputPattern), Arrays.asList(wordType, labelType)); // Read in the emission features (for the word/label weights). VariableNumMap x = plateVars.getVariablesByName(inputPattern); VariableNumMap y = plateVars.getVariablesByName(outputPattern); VariableNumMap emissionFeatureVar = VariableNumMap.singleton(0, "emissionFeature", emissionFeatureType); TableFactor emissionFeatureFactor = TableFactor.fromDelimitedFile( Arrays.asList(x, y, emissionFeatureVar), emissionFeatureLines, featureDelimiter, false, SparseTensorBuilder.getFactory()) .cacheWeightPermutations(); System.out.println(emissionFeatureFactor.getVars()); // Add a parametric factor for the word/label weights DiscreteLogLinearFactor emissionFactor = new DiscreteLogLinearFactor(x.union(y), emissionFeatureVar, emissionFeatureFactor); builder.addFactor(WORD_LABEL_FACTOR, emissionFactor, VariableNamePattern.fromTemplateVariables(plateVars, VariableNumMap.EMPTY)); // Create a factor connecting adjacent labels VariableNumMap adjacentVars = new VariableNumMap(Ints.asList(0, 1), Arrays.asList(outputPattern, nextOutputPattern), Arrays.asList(labelType, labelType)); builder.addFactor(TRANSITION_FACTOR, DiscreteLogLinearFactor.createIndicatorFactor(adjacentVars), VariableNamePattern.fromTemplateVariables(adjacentVars, VariableNumMap.EMPTY)); return builder.build(); }
[ "public", "static", "ParametricFactorGraph", "buildSequenceModel", "(", "Iterable", "<", "String", ">", "emissionFeatureLines", ",", "String", "featureDelimiter", ")", "{", "// Read in the possible values of each variable.", "List", "<", "String", ">", "words", "=", "Stri...
Constructs a sequence model from the lines of a file containing features of the emission distribution. @param emissionFeatureLines @param featureDelimiter @return
[ "Constructs", "a", "sequence", "model", "from", "the", "lines", "of", "a", "file", "containing", "features", "of", "the", "emission", "distribution", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/sequence/SequenceModelUtils.java#L40-L86
train
jayantk/jklol
src/com/jayantkrish/jklol/models/AbstractFactorGraphBuilder.java
AbstractFactorGraphBuilder.addConstantFactor
public void addConstantFactor(String factorName, PlateFactor factor) { constantFactors.add(factor); constantFactorNames.add(factorName); }
java
public void addConstantFactor(String factorName, PlateFactor factor) { constantFactors.add(factor); constantFactorNames.add(factorName); }
[ "public", "void", "addConstantFactor", "(", "String", "factorName", ",", "PlateFactor", "factor", ")", "{", "constantFactors", ".", "add", "(", "factor", ")", ";", "constantFactorNames", ".", "add", "(", "factorName", ")", ";", "}" ]
Adds an unparameterized, dynamically-instantiated factor to the model under construction. @param factor
[ "Adds", "an", "unparameterized", "dynamically", "-", "instantiated", "factor", "to", "the", "model", "under", "construction", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/models/AbstractFactorGraphBuilder.java#L95-L98
train
jayantk/jklol
src/com/jayantkrish/jklol/models/AbstractFactorGraphBuilder.java
AbstractFactorGraphBuilder.addFactor
public void addFactor(String factorName, T factor, VariablePattern factorPattern) { parametricFactors.add(factor); factorPatterns.add(factorPattern); parametricFactorNames.add(factorName); }
java
public void addFactor(String factorName, T factor, VariablePattern factorPattern) { parametricFactors.add(factor); factorPatterns.add(factorPattern); parametricFactorNames.add(factorName); }
[ "public", "void", "addFactor", "(", "String", "factorName", ",", "T", "factor", ",", "VariablePattern", "factorPattern", ")", "{", "parametricFactors", ".", "add", "(", "factor", ")", ";", "factorPatterns", ".", "add", "(", "factorPattern", ")", ";", "parametr...
Adds a parameterized factor to the log linear model being constructed. @param factor
[ "Adds", "a", "parameterized", "factor", "to", "the", "log", "linear", "model", "being", "constructed", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/models/AbstractFactorGraphBuilder.java#L106-L110
train
cpollet/jixture
core/src/main/java/net/cpollet/jixture/fixtures/SqlFixture.java
SqlFixture.load
@Override public void load(UnitDaoFactory unitDaoFactory) { for (String query : queries) { unitDaoFactory.getUnitDao().execute(query); } }
java
@Override public void load(UnitDaoFactory unitDaoFactory) { for (String query : queries) { unitDaoFactory.getUnitDao().execute(query); } }
[ "@", "Override", "public", "void", "load", "(", "UnitDaoFactory", "unitDaoFactory", ")", "{", "for", "(", "String", "query", ":", "queries", ")", "{", "unitDaoFactory", ".", "getUnitDao", "(", ")", ".", "execute", "(", "query", ")", ";", "}", "}" ]
Execute the SQL queries. @param unitDaoFactory the {@link net.cpollet.jixture.dao.UnitDaoFactory} to use.
[ "Execute", "the", "SQL", "queries", "." ]
faef0d4991f81c2cdb5be3ba24176636ef0cc433
https://github.com/cpollet/jixture/blob/faef0d4991f81c2cdb5be3ba24176636ef0cc433/core/src/main/java/net/cpollet/jixture/fixtures/SqlFixture.java#L65-L70
train
jayantk/jklol
src/com/jayantkrish/jklol/ccg/chart/CcgExactChart.java
CcgExactChart.longMultisetsEqual
private static final boolean longMultisetsEqual(long[] firstDeps, long[] secondDeps) { if (firstDeps.length != secondDeps.length) { return false; } Arrays.sort(firstDeps); Arrays.sort(secondDeps); for (int i = 0; i < firstDeps.length; i++) { if (firstDeps[i] != secondDeps[i]) { return false; } } return true; }
java
private static final boolean longMultisetsEqual(long[] firstDeps, long[] secondDeps) { if (firstDeps.length != secondDeps.length) { return false; } Arrays.sort(firstDeps); Arrays.sort(secondDeps); for (int i = 0; i < firstDeps.length; i++) { if (firstDeps[i] != secondDeps[i]) { return false; } } return true; }
[ "private", "static", "final", "boolean", "longMultisetsEqual", "(", "long", "[", "]", "firstDeps", ",", "long", "[", "]", "secondDeps", ")", "{", "if", "(", "firstDeps", ".", "length", "!=", "secondDeps", ".", "length", ")", "{", "return", "false", ";", ...
Checks if two multisets of long numbers contain the same keys with the same frequency @param first @param second @return
[ "Checks", "if", "two", "multisets", "of", "long", "numbers", "contain", "the", "same", "keys", "with", "the", "same", "frequency" ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/chart/CcgExactChart.java#L171-L184
train
jayantk/jklol
src/com/jayantkrish/jklol/util/IndexedList.java
IndexedList.add
public int add(T item) { if (itemIndex.containsKey(item)) { // Items can only be added once return itemIndex.get(item); } int index = items.size(); itemIndex.put(item, index); items.add(item); return index; }
java
public int add(T item) { if (itemIndex.containsKey(item)) { // Items can only be added once return itemIndex.get(item); } int index = items.size(); itemIndex.put(item, index); items.add(item); return index; }
[ "public", "int", "add", "(", "T", "item", ")", "{", "if", "(", "itemIndex", ".", "containsKey", "(", "item", ")", ")", "{", "// Items can only be added once", "return", "itemIndex", ".", "get", "(", "item", ")", ";", "}", "int", "index", "=", "items", ...
Add a new element to this set. Note that there can only be a single copy of any given item in the list. Returns the index of the added item.
[ "Add", "a", "new", "element", "to", "this", "set", ".", "Note", "that", "there", "can", "only", "be", "a", "single", "copy", "of", "any", "given", "item", "in", "the", "list", ".", "Returns", "the", "index", "of", "the", "added", "item", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/IndexedList.java#L64-L73
train
jayantk/jklol
src/com/jayantkrish/jklol/util/IndexedList.java
IndexedList.getIndex
public int getIndex(Object item) { if (!itemIndex.containsKey(item)) { throw new NoSuchElementException("No such item: " + item); } return itemIndex.get(item); }
java
public int getIndex(Object item) { if (!itemIndex.containsKey(item)) { throw new NoSuchElementException("No such item: " + item); } return itemIndex.get(item); }
[ "public", "int", "getIndex", "(", "Object", "item", ")", "{", "if", "(", "!", "itemIndex", ".", "containsKey", "(", "item", ")", ")", "{", "throw", "new", "NoSuchElementException", "(", "\"No such item: \"", "+", "item", ")", ";", "}", "return", "itemIndex...
Get the index in the list of the specified item.
[ "Get", "the", "index", "in", "the", "list", "of", "the", "specified", "item", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/IndexedList.java#L101-L106
train
jayantk/jklol
src/com/jayantkrish/jklol/util/IndexedList.java
IndexedList.get
public T get(int index) { if (index >= items.size() || index < 0) { throw new IndexOutOfBoundsException("size: " + items.size() + " index: " + index); } return items.get(index); }
java
public T get(int index) { if (index >= items.size() || index < 0) { throw new IndexOutOfBoundsException("size: " + items.size() + " index: " + index); } return items.get(index); }
[ "public", "T", "get", "(", "int", "index", ")", "{", "if", "(", "index", ">=", "items", ".", "size", "(", ")", "||", "index", "<", "0", ")", "{", "throw", "new", "IndexOutOfBoundsException", "(", "\"size: \"", "+", "items", ".", "size", "(", ")", "...
Get the item with the specified index.
[ "Get", "the", "item", "with", "the", "specified", "index", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/IndexedList.java#L111-L116
train
jayantk/jklol
src/com/jayantkrish/jklol/ccg/lambda2/Expression2.java
Expression2.getParentExpressionIndex
public int getParentExpressionIndex(int index) { if (index == 0) { return -1; } else { int[] parts = findSubexpression(index); int parentIndex = subexpressions.get(parts[0]).getParentExpressionIndex(parts[1]); if (parentIndex == -1) { // index refers to a child of this expression. return 0; } else { // Return the index into this expression of the chosen child, // plus the index into that expression. return parentIndex + parts[2]; } } }
java
public int getParentExpressionIndex(int index) { if (index == 0) { return -1; } else { int[] parts = findSubexpression(index); int parentIndex = subexpressions.get(parts[0]).getParentExpressionIndex(parts[1]); if (parentIndex == -1) { // index refers to a child of this expression. return 0; } else { // Return the index into this expression of the chosen child, // plus the index into that expression. return parentIndex + parts[2]; } } }
[ "public", "int", "getParentExpressionIndex", "(", "int", "index", ")", "{", "if", "(", "index", "==", "0", ")", "{", "return", "-", "1", ";", "}", "else", "{", "int", "[", "]", "parts", "=", "findSubexpression", "(", "index", ")", ";", "int", "parent...
Get the index of the parent expression that contains the given index. Returns -1 if the indexed expression has no parent. @param index @return
[ "Get", "the", "index", "of", "the", "parent", "expression", "that", "contains", "the", "given", "index", ".", "Returns", "-", "1", "if", "the", "indexed", "expression", "has", "no", "parent", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/lambda2/Expression2.java#L144-L160
train
jayantk/jklol
src/com/jayantkrish/jklol/lisp/inc/ContinuationIncEval.java
ContinuationIncEval.nextState
public void nextState(IncEvalState prev, IncEvalState next, Object continuation, Environment env, Object denotation, Object diagram, Object otherArgs, LogFunction log) { next.set(continuation, env, denotation, diagram, prev.getProb(), null); }
java
public void nextState(IncEvalState prev, IncEvalState next, Object continuation, Environment env, Object denotation, Object diagram, Object otherArgs, LogFunction log) { next.set(continuation, env, denotation, diagram, prev.getProb(), null); }
[ "public", "void", "nextState", "(", "IncEvalState", "prev", ",", "IncEvalState", "next", ",", "Object", "continuation", ",", "Environment", "env", ",", "Object", "denotation", ",", "Object", "diagram", ",", "Object", "otherArgs", ",", "LogFunction", "log", ")", ...
Override this method in subclasses to implement scoring of search states and accumulating features. @return
[ "Override", "this", "method", "in", "subclasses", "to", "implement", "scoring", "of", "search", "states", "and", "accumulating", "features", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/lisp/inc/ContinuationIncEval.java#L135-L138
train
ivanceras/orm
src/main/java/com/ivanceras/db/shared/datatype/DataTypeGeneric.java
DataTypeGeneric.convert
public static Object convert(String dataType, Object record){ if(record == null){return null;} if(dataType.equals(UUID)){ return java.util.UUID.fromString(record.toString()); } //TODO: add a lot of else if here for the other data types else{ return record; } }
java
public static Object convert(String dataType, Object record){ if(record == null){return null;} if(dataType.equals(UUID)){ return java.util.UUID.fromString(record.toString()); } //TODO: add a lot of else if here for the other data types else{ return record; } }
[ "public", "static", "Object", "convert", "(", "String", "dataType", ",", "Object", "record", ")", "{", "if", "(", "record", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "dataType", ".", "equals", "(", "UUID", ")", ")", "{", "return"...
Based on the generic data type convert record to an appropriate Java Data type @param dataType @param record
[ "Based", "on", "the", "generic", "data", "type", "convert", "record", "to", "an", "appropriate", "Java", "Data", "type" ]
e63213cb8abefd11df0e2d34b1c95477788e600e
https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/shared/datatype/DataTypeGeneric.java#L106-L115
train
ivanceras/orm
src/main/java/com/ivanceras/db/server/util/ModelCurator.java
ModelCurator.correct
public ModelDef[] correct(){ for(ModelDef m : modelList){ this.model = m; correct1to1Detail(); } for(ModelDef m : modelList){ this.model = m; removeUnnecessaryHasOneToSelf(); } for(ModelDef m : modelList){ this.model = m; removeUnnecessaryHasManyToSelf(); } for(ModelDef m : modelList){ this.model = m; crossOutLinkerTables(); } for(ModelDef m : modelList){ this.model = m; removeHasOneToBothPrimaryAndForeignKey(); } return modelList; }
java
public ModelDef[] correct(){ for(ModelDef m : modelList){ this.model = m; correct1to1Detail(); } for(ModelDef m : modelList){ this.model = m; removeUnnecessaryHasOneToSelf(); } for(ModelDef m : modelList){ this.model = m; removeUnnecessaryHasManyToSelf(); } for(ModelDef m : modelList){ this.model = m; crossOutLinkerTables(); } for(ModelDef m : modelList){ this.model = m; removeHasOneToBothPrimaryAndForeignKey(); } return modelList; }
[ "public", "ModelDef", "[", "]", "correct", "(", ")", "{", "for", "(", "ModelDef", "m", ":", "modelList", ")", "{", "this", ".", "model", "=", "m", ";", "correct1to1Detail", "(", ")", ";", "}", "for", "(", "ModelDef", "m", ":", "modelList", ")", "{"...
Run each one at a time for all models in such a way that it won't disturb the other @return
[ "Run", "each", "one", "at", "a", "time", "for", "all", "models", "in", "such", "a", "way", "that", "it", "won", "t", "disturb", "the", "other" ]
e63213cb8abefd11df0e2d34b1c95477788e600e
https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/util/ModelCurator.java#L25-L47
train
ivanceras/orm
src/main/java/com/ivanceras/db/server/util/ModelCurator.java
ModelCurator.removeHasOneToBothPrimaryAndForeignKey
private void removeHasOneToBothPrimaryAndForeignKey() { String[] primaryKeys = model.getPrimaryAttributes(); String[] hasOne = model.getHasOne(); String[] hasOneLocal = model.getHasOneLocalColumn(); String[] hasOneReferenced = model.getHasOneReferencedColumn(); for(String pk : primaryKeys){ int pkIndex = CStringUtils.indexOf(hasOneLocal, pk); if(pkIndex >= 0){ System.out.println("\n"+pk+" is a primary key of ["+model.getTableName()+"] ("+hasOneLocal[pkIndex]+")" + "and foreign key to ["+hasOne[pkIndex]+"]("+hasOneReferenced[pkIndex]+")"); System.out.println("removing ["+hasOne[pkIndex]+"] from ["+model.getTableName()+"]"); model = removeFromHasOne(model, hasOne[pkIndex]); } } }
java
private void removeHasOneToBothPrimaryAndForeignKey() { String[] primaryKeys = model.getPrimaryAttributes(); String[] hasOne = model.getHasOne(); String[] hasOneLocal = model.getHasOneLocalColumn(); String[] hasOneReferenced = model.getHasOneReferencedColumn(); for(String pk : primaryKeys){ int pkIndex = CStringUtils.indexOf(hasOneLocal, pk); if(pkIndex >= 0){ System.out.println("\n"+pk+" is a primary key of ["+model.getTableName()+"] ("+hasOneLocal[pkIndex]+")" + "and foreign key to ["+hasOne[pkIndex]+"]("+hasOneReferenced[pkIndex]+")"); System.out.println("removing ["+hasOne[pkIndex]+"] from ["+model.getTableName()+"]"); model = removeFromHasOne(model, hasOne[pkIndex]); } } }
[ "private", "void", "removeHasOneToBothPrimaryAndForeignKey", "(", ")", "{", "String", "[", "]", "primaryKeys", "=", "model", ".", "getPrimaryAttributes", "(", ")", ";", "String", "[", "]", "hasOne", "=", "model", ".", "getHasOne", "(", ")", ";", "String", "[...
user_info.user_id is the primary key while it is refering to users.user_id user_info.User will create a cyclic recursive mapping to users and user_info and back. Remove that hasOne which is both primary and foreign to prevent that.
[ "user_info", ".", "user_id", "is", "the", "primary", "key", "while", "it", "is", "refering", "to", "users", ".", "user_id", "user_info", ".", "User", "will", "create", "a", "cyclic", "recursive", "mapping", "to", "users", "and", "user_info", "and", "back", ...
e63213cb8abefd11df0e2d34b1c95477788e600e
https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/util/ModelCurator.java#L56-L70
train
ivanceras/orm
src/main/java/com/ivanceras/db/server/util/ModelCurator.java
ModelCurator.correct1to1Detail
private void correct1to1Detail(){ String[] hasManyTables = model.getHasMany(); for(String hasMany : hasManyTables){ if(shouldBeMoved(model, hasMany)){ model = moveFromHasManyToHasOne(model, hasMany); } } }
java
private void correct1to1Detail(){ String[] hasManyTables = model.getHasMany(); for(String hasMany : hasManyTables){ if(shouldBeMoved(model, hasMany)){ model = moveFromHasManyToHasOne(model, hasMany); } } }
[ "private", "void", "correct1to1Detail", "(", ")", "{", "String", "[", "]", "hasManyTables", "=", "model", ".", "getHasMany", "(", ")", ";", "for", "(", "String", "hasMany", ":", "hasManyTables", ")", "{", "if", "(", "shouldBeMoved", "(", "model", ",", "h...
If the localColum of that hasMany table is the primary attributes AND it refer to the primary column of this table users.primaryKey = [user_id] users.hasMany = [user_info] users.hasManyLocal = [user_id] users.hasManyReference = [user_id] user_info.primaryKey = [user_id] user_info.hasOne = [users] user_info.hasOneLocal = [user_id] user_info.hasOneReference = [user_id] @param model @param modelList @return
[ "If", "the", "localColum", "of", "that", "hasMany", "table", "is", "the", "primary", "attributes", "AND", "it", "refer", "to", "the", "primary", "column", "of", "this", "table" ]
e63213cb8abefd11df0e2d34b1c95477788e600e
https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/util/ModelCurator.java#L88-L96
train
ivanceras/orm
src/main/java/com/ivanceras/db/server/util/ModelCurator.java
ModelCurator.crossOutLinkerTables
private void crossOutLinkerTables(){ String[] primaryKeys = model.getPrimaryAttributes(); if(primaryKeys != null && primaryKeys.length == 2){//there are only 2 primary keys //if both primary keys look up to different table which is also a primary key String[] hasOne = model.getHasOne(); String[] hasOneLocalColum = model.getHasOneLocalColumn(); String[] hasOneReferencedColumn = model.getHasOneReferencedColumn(); int indexP1 = CStringUtils.indexOf(hasOneLocalColum, primaryKeys[0]); int indexP2 = CStringUtils.indexOf(hasOneLocalColum, primaryKeys[1]); if(indexP1 >= 0 && indexP2 >= 0){ String t1 = hasOne[indexP1]; String t2 = hasOne[indexP2]; String ref1 = hasOneReferencedColumn[indexP1]; String ref2 = hasOneReferencedColumn[indexP2]; ModelDef m1 = getModel(t1); boolean isRef1Primary = CStringUtils.inArray(m1.getPrimaryAttributes(), ref1); ModelDef m2 = getModel(t2); boolean isRef2Primary = CStringUtils.inArray(m2.getPrimaryAttributes(), ref2); if(model != m1 && model != m2 && isRef1Primary && isRef2Primary ){ removeFromHasMany(m1, model.getTableName());//remove the hasMany of this table removeFromHasMany(m2, model.getTableName());//remove the hasMany of this table addToHasMany(m1, m2.getTableName(), ref2, null); addToHasMany(m2, m1.getTableName(), ref1, null); } } } }
java
private void crossOutLinkerTables(){ String[] primaryKeys = model.getPrimaryAttributes(); if(primaryKeys != null && primaryKeys.length == 2){//there are only 2 primary keys //if both primary keys look up to different table which is also a primary key String[] hasOne = model.getHasOne(); String[] hasOneLocalColum = model.getHasOneLocalColumn(); String[] hasOneReferencedColumn = model.getHasOneReferencedColumn(); int indexP1 = CStringUtils.indexOf(hasOneLocalColum, primaryKeys[0]); int indexP2 = CStringUtils.indexOf(hasOneLocalColum, primaryKeys[1]); if(indexP1 >= 0 && indexP2 >= 0){ String t1 = hasOne[indexP1]; String t2 = hasOne[indexP2]; String ref1 = hasOneReferencedColumn[indexP1]; String ref2 = hasOneReferencedColumn[indexP2]; ModelDef m1 = getModel(t1); boolean isRef1Primary = CStringUtils.inArray(m1.getPrimaryAttributes(), ref1); ModelDef m2 = getModel(t2); boolean isRef2Primary = CStringUtils.inArray(m2.getPrimaryAttributes(), ref2); if(model != m1 && model != m2 && isRef1Primary && isRef2Primary ){ removeFromHasMany(m1, model.getTableName());//remove the hasMany of this table removeFromHasMany(m2, model.getTableName());//remove the hasMany of this table addToHasMany(m1, m2.getTableName(), ref2, null); addToHasMany(m2, m1.getTableName(), ref1, null); } } } }
[ "private", "void", "crossOutLinkerTables", "(", ")", "{", "String", "[", "]", "primaryKeys", "=", "model", ".", "getPrimaryAttributes", "(", ")", ";", "if", "(", "primaryKeys", "!=", "null", "&&", "primaryKeys", ".", "length", "==", "2", ")", "{", "//there...
Remove a linker table present in the hasMany, then short circuit right away to the linked table Linker tables contains composite primary keys of two tables If each local column of the primary key is the primary of the table it is referring to the this is a lookup table ie. product, product_category, category Product will have many category Category at the same time is used by many product Changes should be apply on both tables right away
[ "Remove", "a", "linker", "table", "present", "in", "the", "hasMany", "then", "short", "circuit", "right", "away", "to", "the", "linked", "table" ]
e63213cb8abefd11df0e2d34b1c95477788e600e
https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/util/ModelCurator.java#L282-L321
train
jayantk/jklol
src/com/jayantkrish/jklol/preprocessing/DictionaryFeatureVectorGenerator.java
DictionaryFeatureVectorGenerator.getActiveFeatures
public Map<U, Double> getActiveFeatures(Tensor featureVector) { Preconditions.checkArgument(featureVector.getDimensionSizes().length == 1 && featureVector.getDimensionSizes()[0] == getNumberOfFeatures()); Map<U, Double> features = Maps.newHashMap(); Iterator<KeyValue> keyValueIter = featureVector.keyValueIterator(); while (keyValueIter.hasNext()) { KeyValue featureKeyValue = keyValueIter.next(); features.put(featureIndexes.get(featureKeyValue.getKey()[0]), featureKeyValue.getValue()); } return features; }
java
public Map<U, Double> getActiveFeatures(Tensor featureVector) { Preconditions.checkArgument(featureVector.getDimensionSizes().length == 1 && featureVector.getDimensionSizes()[0] == getNumberOfFeatures()); Map<U, Double> features = Maps.newHashMap(); Iterator<KeyValue> keyValueIter = featureVector.keyValueIterator(); while (keyValueIter.hasNext()) { KeyValue featureKeyValue = keyValueIter.next(); features.put(featureIndexes.get(featureKeyValue.getKey()[0]), featureKeyValue.getValue()); } return features; }
[ "public", "Map", "<", "U", ",", "Double", ">", "getActiveFeatures", "(", "Tensor", "featureVector", ")", "{", "Preconditions", ".", "checkArgument", "(", "featureVector", ".", "getDimensionSizes", "(", ")", ".", "length", "==", "1", "&&", "featureVector", ".",...
Given a feature vector, get the features which were active for it. This method inverts the mapping from feature sets to feature vectors performed by this class. @param featureVector @return
[ "Given", "a", "feature", "vector", "get", "the", "features", "which", "were", "active", "for", "it", ".", "This", "method", "inverts", "the", "mapping", "from", "feature", "sets", "to", "feature", "vectors", "performed", "by", "this", "class", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/preprocessing/DictionaryFeatureVectorGenerator.java#L135-L146
train
getlantern/kaleidoscope
src/main/java/org/kaleidoscope/LocalTrustGraph.java
LocalTrustGraph.sendAdvertisement
public void sendAdvertisement(final BasicTrustGraphAdvertisement message, final TrustGraphNodeId sender, final TrustGraphNodeId toNeighbor, final int ttl) { final BasicTrustGraphAdvertisement outboundMessage = message.copyWith(sender, ttl); final TrustGraphNode toNode = nodes.get(toNeighbor); toNode.handleAdvertisement(outboundMessage); }
java
public void sendAdvertisement(final BasicTrustGraphAdvertisement message, final TrustGraphNodeId sender, final TrustGraphNodeId toNeighbor, final int ttl) { final BasicTrustGraphAdvertisement outboundMessage = message.copyWith(sender, ttl); final TrustGraphNode toNode = nodes.get(toNeighbor); toNode.handleAdvertisement(outboundMessage); }
[ "public", "void", "sendAdvertisement", "(", "final", "BasicTrustGraphAdvertisement", "message", ",", "final", "TrustGraphNodeId", "sender", ",", "final", "TrustGraphNodeId", "toNeighbor", ",", "final", "int", "ttl", ")", "{", "final", "BasicTrustGraphAdvertisement", "ou...
send a local advertisement to the node specified with the given ttl. @param message advertisement to send @param sender the node sending the message @param toNeighbor the recipient of the message
[ "send", "a", "local", "advertisement", "to", "the", "node", "specified", "with", "the", "given", "ttl", "." ]
7516f05724c8f54e5d535d23da9116817c08a09f
https://github.com/getlantern/kaleidoscope/blob/7516f05724c8f54e5d535d23da9116817c08a09f/src/main/java/org/kaleidoscope/LocalTrustGraph.java#L149-L156
train
getlantern/kaleidoscope
src/main/java/org/kaleidoscope/LocalTrustGraph.java
LocalTrustGraph.addNode
public LocalTrustGraphNode addNode(final TrustGraphNodeId nodeId) { final LocalTrustGraphNode node = createNode(nodeId); addNode(node); return node; }
java
public LocalTrustGraphNode addNode(final TrustGraphNodeId nodeId) { final LocalTrustGraphNode node = createNode(nodeId); addNode(node); return node; }
[ "public", "LocalTrustGraphNode", "addNode", "(", "final", "TrustGraphNodeId", "nodeId", ")", "{", "final", "LocalTrustGraphNode", "node", "=", "createNode", "(", "nodeId", ")", ";", "addNode", "(", "node", ")", ";", "return", "node", ";", "}" ]
Create and add a new trust graph node with the given id. @param nodeId the identifier for the new node @returns the new node
[ "Create", "and", "add", "a", "new", "trust", "graph", "node", "with", "the", "given", "id", "." ]
7516f05724c8f54e5d535d23da9116817c08a09f
https://github.com/getlantern/kaleidoscope/blob/7516f05724c8f54e5d535d23da9116817c08a09f/src/main/java/org/kaleidoscope/LocalTrustGraph.java#L175-L179
train
getlantern/kaleidoscope
src/main/java/org/kaleidoscope/LocalTrustGraph.java
LocalTrustGraph.addDirectedRoute
public void addDirectedRoute(final LocalTrustGraphNode from, final LocalTrustGraphNode to) { from.getRoutingTable().addNeighbor(to.getId()); }
java
public void addDirectedRoute(final LocalTrustGraphNode from, final LocalTrustGraphNode to) { from.getRoutingTable().addNeighbor(to.getId()); }
[ "public", "void", "addDirectedRoute", "(", "final", "LocalTrustGraphNode", "from", ",", "final", "LocalTrustGraphNode", "to", ")", "{", "from", ".", "getRoutingTable", "(", ")", ".", "addNeighbor", "(", "to", ".", "getId", "(", ")", ")", ";", "}" ]
Add a directed trust graph link between two nodes. Note: Although this is useful for testing adverse conditions, relationships must be symmetric for the normal functioning of the algorithm. An advertising node must trust another node to send to it, and that same node must trust the sender in order to forward the message (find the next hop for the message). @param from the node that is trusting @param to the node that is being trused by the node 'from'
[ "Add", "a", "directed", "trust", "graph", "link", "between", "two", "nodes", "." ]
7516f05724c8f54e5d535d23da9116817c08a09f
https://github.com/getlantern/kaleidoscope/blob/7516f05724c8f54e5d535d23da9116817c08a09f/src/main/java/org/kaleidoscope/LocalTrustGraph.java#L231-L233
train
getlantern/kaleidoscope
src/main/java/org/kaleidoscope/LocalTrustGraph.java
LocalTrustGraph.addDirectedRoute
public void addDirectedRoute(final TrustGraphNodeId from, final TrustGraphNodeId to) { final TrustGraphNode fromNode = nodes.get(from); fromNode.getRoutingTable().addNeighbor(to); }
java
public void addDirectedRoute(final TrustGraphNodeId from, final TrustGraphNodeId to) { final TrustGraphNode fromNode = nodes.get(from); fromNode.getRoutingTable().addNeighbor(to); }
[ "public", "void", "addDirectedRoute", "(", "final", "TrustGraphNodeId", "from", ",", "final", "TrustGraphNodeId", "to", ")", "{", "final", "TrustGraphNode", "fromNode", "=", "nodes", ".", "get", "(", "from", ")", ";", "fromNode", ".", "getRoutingTable", "(", "...
create a directed trust link between two nodes. The node with id 'from' will trust the node with id 'to'. Note: Although this is useful for testing adverse conditions, relationships must be symmetric for the normal functioning of the algorithm. An advertising node must trust another node to send to it, and that same node must trust the sender in order to forward the message (find the next hop for the message). @param from the id of the node that is trusting @param to the id of node that is being trused by the node 'from'
[ "create", "a", "directed", "trust", "link", "between", "two", "nodes", ".", "The", "node", "with", "id", "from", "will", "trust", "the", "node", "with", "id", "to", "." ]
7516f05724c8f54e5d535d23da9116817c08a09f
https://github.com/getlantern/kaleidoscope/blob/7516f05724c8f54e5d535d23da9116817c08a09f/src/main/java/org/kaleidoscope/LocalTrustGraph.java#L249-L252
train
getlantern/kaleidoscope
src/main/java/org/kaleidoscope/LocalTrustGraph.java
LocalTrustGraph.addRoute
public void addRoute(final TrustGraphNodeId a, final TrustGraphNodeId b) { addDirectedRoute(a,b); addDirectedRoute(b,a); }
java
public void addRoute(final TrustGraphNodeId a, final TrustGraphNodeId b) { addDirectedRoute(a,b); addDirectedRoute(b,a); }
[ "public", "void", "addRoute", "(", "final", "TrustGraphNodeId", "a", ",", "final", "TrustGraphNodeId", "b", ")", "{", "addDirectedRoute", "(", "a", ",", "b", ")", ";", "addDirectedRoute", "(", "b", ",", "a", ")", ";", "}" ]
create a bidirectional trust link between the nodes with ids 'a' and 'b' @param a id of node that will form a trust link with 'b' @param b id of node that will form a trust link with 'a'
[ "create", "a", "bidirectional", "trust", "link", "between", "the", "nodes", "with", "ids", "a", "and", "b" ]
7516f05724c8f54e5d535d23da9116817c08a09f
https://github.com/getlantern/kaleidoscope/blob/7516f05724c8f54e5d535d23da9116817c08a09f/src/main/java/org/kaleidoscope/LocalTrustGraph.java#L260-L263
train
getlantern/kaleidoscope
src/main/java/org/kaleidoscope/LocalTrustGraph.java
LocalTrustGraph.addRoute
public void addRoute(final LocalTrustGraphNode a, final LocalTrustGraphNode b) { addDirectedRoute(a,b); addDirectedRoute(b,a); }
java
public void addRoute(final LocalTrustGraphNode a, final LocalTrustGraphNode b) { addDirectedRoute(a,b); addDirectedRoute(b,a); }
[ "public", "void", "addRoute", "(", "final", "LocalTrustGraphNode", "a", ",", "final", "LocalTrustGraphNode", "b", ")", "{", "addDirectedRoute", "(", "a", ",", "b", ")", ";", "addDirectedRoute", "(", "b", ",", "a", ")", ";", "}" ]
add bidirectioanl trust graph links between two nodes. @param a node that will form a trust link with 'b' @param b node that will form a trust link with 'a'
[ "add", "bidirectioanl", "trust", "graph", "links", "between", "two", "nodes", "." ]
7516f05724c8f54e5d535d23da9116817c08a09f
https://github.com/getlantern/kaleidoscope/blob/7516f05724c8f54e5d535d23da9116817c08a09f/src/main/java/org/kaleidoscope/LocalTrustGraph.java#L271-L274
train
HiddenStage/divide
Client/java-client/src/main/java/io/divide/client/http/Status.java
Status.valueOf
public static Status valueOf(int code) { Status result = null; switch (code) { case 100: result = INFO_CONTINUE; break; case 101: result = INFO_SWITCHING_PROTOCOL; break; case 102: result = INFO_PROCESSING; break; case 200: result = SUCCESS_OK; break; case 201: result = SUCCESS_CREATED; break; case 202: result = SUCCESS_ACCEPTED; break; case 203: result = SUCCESS_NON_AUTHORITATIVE; break; case 204: result = SUCCESS_NO_CONTENT; break; case 205: result = SUCCESS_RESET_CONTENT; break; case 206: result = SUCCESS_PARTIAL_CONTENT; break; case 207: result = SUCCESS_MULTI_STATUS; break; case 300: result = REDIRECTION_MULTIPLE_CHOICES; break; case 301: result = REDIRECTION_PERMANENT; break; case 302: result = REDIRECTION_FOUND; break; case 303: result = REDIRECTION_SEE_OTHER; break; case 304: result = REDIRECTION_NOT_MODIFIED; break; case 305: result = REDIRECTION_USE_PROXY; break; case 307: result = REDIRECTION_TEMPORARY; break; case 400: result = CLIENT_ERROR_BAD_REQUEST; break; case 401: result = CLIENT_ERROR_UNAUTHORIZED; break; case 402: result = CLIENT_ERROR_PAYMENT_REQUIRED; break; case 403: result = CLIENT_ERROR_FORBIDDEN; break; case 404: result = CLIENT_ERROR_NOT_FOUND; break; case 405: result = CLIENT_ERROR_METHOD_NOT_ALLOWED; break; case 406: result = CLIENT_ERROR_NOT_ACCEPTABLE; break; case 407: result = CLIENT_ERROR_PROXY_AUTHENTIFICATION_REQUIRED; break; case 408: result = CLIENT_ERROR_REQUEST_TIMEOUT; break; case 409: result = CLIENT_ERROR_CONFLICT; break; case 410: result = CLIENT_ERROR_GONE; break; case 411: result = CLIENT_ERROR_LENGTH_REQUIRED; break; case 412: result = CLIENT_ERROR_PRECONDITION_FAILED; break; case 413: result = CLIENT_ERROR_REQUEST_ENTITY_TOO_LARGE; break; case 414: result = CLIENT_ERROR_REQUEST_URI_TOO_LONG; break; case 415: result = CLIENT_ERROR_UNSUPPORTED_MEDIA_TYPE; break; case 416: result = CLIENT_ERROR_REQUESTED_RANGE_NOT_SATISFIABLE; break; case 417: result = CLIENT_ERROR_EXPECTATION_FAILED; break; case 422: result = CLIENT_ERROR_UNPROCESSABLE_ENTITY; break; case 423: result = CLIENT_ERROR_LOCKED; break; case 424: result = CLIENT_ERROR_FAILED_DEPENDENCY; break; case 500: result = SERVER_ERROR_INTERNAL; break; case 501: result = SERVER_ERROR_NOT_IMPLEMENTED; break; case 502: result = SERVER_ERROR_BAD_GATEWAY; break; case 503: result = SERVER_ERROR_SERVICE_UNAVAILABLE; break; case 504: result = SERVER_ERROR_GATEWAY_TIMEOUT; break; case 505: result = SERVER_ERROR_VERSION_NOT_SUPPORTED; break; case 507: result = SERVER_ERROR_INSUFFICIENT_STORAGE; break; case 1000: result = CONNECTOR_ERROR_CONNECTION; break; case 1001: result = CONNECTOR_ERROR_COMMUNICATION; break; case 1002: result = CONNECTOR_ERROR_INTERNAL; break; } return result; }
java
public static Status valueOf(int code) { Status result = null; switch (code) { case 100: result = INFO_CONTINUE; break; case 101: result = INFO_SWITCHING_PROTOCOL; break; case 102: result = INFO_PROCESSING; break; case 200: result = SUCCESS_OK; break; case 201: result = SUCCESS_CREATED; break; case 202: result = SUCCESS_ACCEPTED; break; case 203: result = SUCCESS_NON_AUTHORITATIVE; break; case 204: result = SUCCESS_NO_CONTENT; break; case 205: result = SUCCESS_RESET_CONTENT; break; case 206: result = SUCCESS_PARTIAL_CONTENT; break; case 207: result = SUCCESS_MULTI_STATUS; break; case 300: result = REDIRECTION_MULTIPLE_CHOICES; break; case 301: result = REDIRECTION_PERMANENT; break; case 302: result = REDIRECTION_FOUND; break; case 303: result = REDIRECTION_SEE_OTHER; break; case 304: result = REDIRECTION_NOT_MODIFIED; break; case 305: result = REDIRECTION_USE_PROXY; break; case 307: result = REDIRECTION_TEMPORARY; break; case 400: result = CLIENT_ERROR_BAD_REQUEST; break; case 401: result = CLIENT_ERROR_UNAUTHORIZED; break; case 402: result = CLIENT_ERROR_PAYMENT_REQUIRED; break; case 403: result = CLIENT_ERROR_FORBIDDEN; break; case 404: result = CLIENT_ERROR_NOT_FOUND; break; case 405: result = CLIENT_ERROR_METHOD_NOT_ALLOWED; break; case 406: result = CLIENT_ERROR_NOT_ACCEPTABLE; break; case 407: result = CLIENT_ERROR_PROXY_AUTHENTIFICATION_REQUIRED; break; case 408: result = CLIENT_ERROR_REQUEST_TIMEOUT; break; case 409: result = CLIENT_ERROR_CONFLICT; break; case 410: result = CLIENT_ERROR_GONE; break; case 411: result = CLIENT_ERROR_LENGTH_REQUIRED; break; case 412: result = CLIENT_ERROR_PRECONDITION_FAILED; break; case 413: result = CLIENT_ERROR_REQUEST_ENTITY_TOO_LARGE; break; case 414: result = CLIENT_ERROR_REQUEST_URI_TOO_LONG; break; case 415: result = CLIENT_ERROR_UNSUPPORTED_MEDIA_TYPE; break; case 416: result = CLIENT_ERROR_REQUESTED_RANGE_NOT_SATISFIABLE; break; case 417: result = CLIENT_ERROR_EXPECTATION_FAILED; break; case 422: result = CLIENT_ERROR_UNPROCESSABLE_ENTITY; break; case 423: result = CLIENT_ERROR_LOCKED; break; case 424: result = CLIENT_ERROR_FAILED_DEPENDENCY; break; case 500: result = SERVER_ERROR_INTERNAL; break; case 501: result = SERVER_ERROR_NOT_IMPLEMENTED; break; case 502: result = SERVER_ERROR_BAD_GATEWAY; break; case 503: result = SERVER_ERROR_SERVICE_UNAVAILABLE; break; case 504: result = SERVER_ERROR_GATEWAY_TIMEOUT; break; case 505: result = SERVER_ERROR_VERSION_NOT_SUPPORTED; break; case 507: result = SERVER_ERROR_INSUFFICIENT_STORAGE; break; case 1000: result = CONNECTOR_ERROR_CONNECTION; break; case 1001: result = CONNECTOR_ERROR_COMMUNICATION; break; case 1002: result = CONNECTOR_ERROR_INTERNAL; break; } return result; }
[ "public", "static", "Status", "valueOf", "(", "int", "code", ")", "{", "Status", "result", "=", "null", ";", "switch", "(", "code", ")", "{", "case", "100", ":", "result", "=", "INFO_CONTINUE", ";", "break", ";", "case", "101", ":", "result", "=", "I...
Returns the status associated to a code. If an existing constant exists then it is returned, otherwise a new instance is created. @param code The code. @return The associated status.
[ "Returns", "the", "status", "associated", "to", "a", "code", ".", "If", "an", "existing", "constant", "exists", "then", "it", "is", "returned", "otherwise", "a", "new", "instance", "is", "created", "." ]
14e36598c50d92b4393e6649915e32b86141c598
https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/java-client/src/main/java/io/divide/client/http/Status.java#L707-L866
train
GoodforGod/dummymaker
src/main/java/io/dummymaker/factory/impl/BasicPopulateFactory.java
BasicPopulateFactory.populateEntity
private <T> T populateEntity(final T t, final Map<Field, Long> enumeratesMap, final Set<Field> nullableFields, final int currentEmbeddedDepth) { final Map<Field, GenContainer> genContainers = this.populateScanner.scan(t.getClass()); for (final Map.Entry<Field, GenContainer> annotatedField : genContainers.entrySet()) { final Field field = annotatedField.getKey(); // If field had errors or null gen in prev populate iteration, just skip that field if (nullableFields.contains(field)) continue; try { field.setAccessible(true); final Object objValue = generateObject(field, annotatedField.getValue(), enumeratesMap, nullableFields, currentEmbeddedDepth); field.set(t, objValue); } catch (ClassCastException e) { logger.warning(e.getMessage() + " | field TYPE and GENERATE TYPE are not compatible"); nullableFields.add(field); // skip field due to error as if it null throw e; } catch (IllegalAccessException e) { logger.warning(e.getMessage() + " | have NO ACCESS to field: " + field.getName()); nullableFields.add(field); // skip field due to error as if it null } catch (Exception e) { logger.warning(e.getMessage()); nullableFields.add(field); // skip field due to error as if it null } finally { annotatedField.getKey().setAccessible(false); } } return t; }
java
private <T> T populateEntity(final T t, final Map<Field, Long> enumeratesMap, final Set<Field> nullableFields, final int currentEmbeddedDepth) { final Map<Field, GenContainer> genContainers = this.populateScanner.scan(t.getClass()); for (final Map.Entry<Field, GenContainer> annotatedField : genContainers.entrySet()) { final Field field = annotatedField.getKey(); // If field had errors or null gen in prev populate iteration, just skip that field if (nullableFields.contains(field)) continue; try { field.setAccessible(true); final Object objValue = generateObject(field, annotatedField.getValue(), enumeratesMap, nullableFields, currentEmbeddedDepth); field.set(t, objValue); } catch (ClassCastException e) { logger.warning(e.getMessage() + " | field TYPE and GENERATE TYPE are not compatible"); nullableFields.add(field); // skip field due to error as if it null throw e; } catch (IllegalAccessException e) { logger.warning(e.getMessage() + " | have NO ACCESS to field: " + field.getName()); nullableFields.add(field); // skip field due to error as if it null } catch (Exception e) { logger.warning(e.getMessage()); nullableFields.add(field); // skip field due to error as if it null } finally { annotatedField.getKey().setAccessible(false); } } return t; }
[ "private", "<", "T", ">", "T", "populateEntity", "(", "final", "T", "t", ",", "final", "Map", "<", "Field", ",", "Long", ">", "enumeratesMap", ",", "final", "Set", "<", "Field", ">", "nullableFields", ",", "final", "int", "currentEmbeddedDepth", ")", "{"...
Populate single entity @param t entity to populate @param enumeratesMap map of enumerated marked fields @param nullableFields set with fields that had errors in @param currentEmbeddedDepth embedded depth level @return populated entity
[ "Populate", "single", "entity" ]
a4809c0a8139ab9cdb42814a3e37772717a313b4
https://github.com/GoodforGod/dummymaker/blob/a4809c0a8139ab9cdb42814a3e37772717a313b4/src/main/java/io/dummymaker/factory/impl/BasicPopulateFactory.java#L68-L102
train
GoodforGod/dummymaker
src/main/java/io/dummymaker/factory/impl/BasicPopulateFactory.java
BasicPopulateFactory.generateObject
private Object generateObject(final Field field, final GenContainer container, final Map<Field, Long> enumerateMap, final Set<Field> nullableFields, final int currentEmbeddedDepth) { final IGenerator generator = genStorage.getGenInstance(container.getGeneratorClass()); final Annotation annotation = container.getMarker(); Object generated; if (EmbeddedGenerator.class.equals(container.getGeneratorClass())) { generated = generateEmbeddedObject(annotation, field, nullableFields, currentEmbeddedDepth); } else if (enumerateMap.containsKey(field)) { generated = generateEnumerateObject(field, enumerateMap); } else if (container.isComplex()) { // If complexGen can generate embedded objects // And not handling it like BasicComplexGenerator, you are StackOverFlowed generated = ((IComplexGenerator) generator).generate(annotation, field, genStorage, currentEmbeddedDepth); } else { generated = generator.generate(); } final Object casted = castObject(generated, field.getType()); if (casted == null) nullableFields.add(field); return casted; }
java
private Object generateObject(final Field field, final GenContainer container, final Map<Field, Long> enumerateMap, final Set<Field> nullableFields, final int currentEmbeddedDepth) { final IGenerator generator = genStorage.getGenInstance(container.getGeneratorClass()); final Annotation annotation = container.getMarker(); Object generated; if (EmbeddedGenerator.class.equals(container.getGeneratorClass())) { generated = generateEmbeddedObject(annotation, field, nullableFields, currentEmbeddedDepth); } else if (enumerateMap.containsKey(field)) { generated = generateEnumerateObject(field, enumerateMap); } else if (container.isComplex()) { // If complexGen can generate embedded objects // And not handling it like BasicComplexGenerator, you are StackOverFlowed generated = ((IComplexGenerator) generator).generate(annotation, field, genStorage, currentEmbeddedDepth); } else { generated = generator.generate(); } final Object casted = castObject(generated, field.getType()); if (casted == null) nullableFields.add(field); return casted; }
[ "private", "Object", "generateObject", "(", "final", "Field", "field", ",", "final", "GenContainer", "container", ",", "final", "Map", "<", "Field", ",", "Long", ">", "enumerateMap", ",", "final", "Set", "<", "Field", ">", "nullableFields", ",", "final", "in...
Generate populate field value @param field field to populate @param container field populate annotations @param enumerateMap field enumerate map @param nullableFields set with fields that had errors in
[ "Generate", "populate", "field", "value" ]
a4809c0a8139ab9cdb42814a3e37772717a313b4
https://github.com/GoodforGod/dummymaker/blob/a4809c0a8139ab9cdb42814a3e37772717a313b4/src/main/java/io/dummymaker/factory/impl/BasicPopulateFactory.java#L112-L139
train
GoodforGod/dummymaker
src/main/java/io/dummymaker/factory/impl/BasicPopulateFactory.java
BasicPopulateFactory.generateEmbeddedObject
private Object generateEmbeddedObject(final Annotation annotation, final Field field, final Set<Field> nullableFields, final int currentEmbeddedDepth) { final int fieldDepth = getDepth(annotation); if (fieldDepth < currentEmbeddedDepth) return null; final Object embedded = instantiate(field.getType()); if (embedded == null) { nullableFields.add(field); return null; } return populateEntity(embedded, buildEnumerateMap(field.getType()), buildNullableSet(), currentEmbeddedDepth + 1); }
java
private Object generateEmbeddedObject(final Annotation annotation, final Field field, final Set<Field> nullableFields, final int currentEmbeddedDepth) { final int fieldDepth = getDepth(annotation); if (fieldDepth < currentEmbeddedDepth) return null; final Object embedded = instantiate(field.getType()); if (embedded == null) { nullableFields.add(field); return null; } return populateEntity(embedded, buildEnumerateMap(field.getType()), buildNullableSet(), currentEmbeddedDepth + 1); }
[ "private", "Object", "generateEmbeddedObject", "(", "final", "Annotation", "annotation", ",", "final", "Field", "field", ",", "final", "Set", "<", "Field", ">", "nullableFields", ",", "final", "int", "currentEmbeddedDepth", ")", "{", "final", "int", "fieldDepth", ...
Generate embedded field value @param field field with embedded value @param nullableFields set with fields that had errors in
[ "Generate", "embedded", "field", "value" ]
a4809c0a8139ab9cdb42814a3e37772717a313b4
https://github.com/GoodforGod/dummymaker/blob/a4809c0a8139ab9cdb42814a3e37772717a313b4/src/main/java/io/dummymaker/factory/impl/BasicPopulateFactory.java#L147-L165
train
GoodforGod/dummymaker
src/main/java/io/dummymaker/factory/impl/BasicPopulateFactory.java
BasicPopulateFactory.generateEnumerateObject
private Object generateEnumerateObject(final Field field, final Map<Field, Long> enumerateMap) { final Long currentEnumerateValue = enumerateMap.get(field); Object objValue = BasicCastUtils.castToNumber(currentEnumerateValue, field.getType()); // Increment numerate number for generated field enumerateMap.computeIfPresent(field, (k, v) -> v + 1); return objValue; }
java
private Object generateEnumerateObject(final Field field, final Map<Field, Long> enumerateMap) { final Long currentEnumerateValue = enumerateMap.get(field); Object objValue = BasicCastUtils.castToNumber(currentEnumerateValue, field.getType()); // Increment numerate number for generated field enumerateMap.computeIfPresent(field, (k, v) -> v + 1); return objValue; }
[ "private", "Object", "generateEnumerateObject", "(", "final", "Field", "field", ",", "final", "Map", "<", "Field", ",", "Long", ">", "enumerateMap", ")", "{", "final", "Long", "currentEnumerateValue", "=", "enumerateMap", ".", "get", "(", "field", ")", ";", ...
Generate enumerate field next value
[ "Generate", "enumerate", "field", "next", "value" ]
a4809c0a8139ab9cdb42814a3e37772717a313b4
https://github.com/GoodforGod/dummymaker/blob/a4809c0a8139ab9cdb42814a3e37772717a313b4/src/main/java/io/dummymaker/factory/impl/BasicPopulateFactory.java#L170-L178
train
GoodforGod/dummymaker
src/main/java/io/dummymaker/factory/impl/BasicPopulateFactory.java
BasicPopulateFactory.buildEnumerateMap
private Map<Field, Long> buildEnumerateMap(final Class t) { return this.enumerateScanner.scan(t).entrySet().stream() .collect(Collectors.toMap( Map.Entry::getKey, e -> ((GenEnumerate) e.getValue().get(0)).from()) ); }
java
private Map<Field, Long> buildEnumerateMap(final Class t) { return this.enumerateScanner.scan(t).entrySet().stream() .collect(Collectors.toMap( Map.Entry::getKey, e -> ((GenEnumerate) e.getValue().get(0)).from()) ); }
[ "private", "Map", "<", "Field", ",", "Long", ">", "buildEnumerateMap", "(", "final", "Class", "t", ")", "{", "return", "this", ".", "enumerateScanner", ".", "scan", "(", "t", ")", ".", "entrySet", "(", ")", ".", "stream", "(", ")", ".", "collect", "(...
Setup map for enumerate fields @param t class to scan for enumerate fields
[ "Setup", "map", "for", "enumerate", "fields" ]
a4809c0a8139ab9cdb42814a3e37772717a313b4
https://github.com/GoodforGod/dummymaker/blob/a4809c0a8139ab9cdb42814a3e37772717a313b4/src/main/java/io/dummymaker/factory/impl/BasicPopulateFactory.java#L236-L242
train
jayantk/jklol
src/com/jayantkrish/jklol/ccg/lexinduct/CfgAlignmentModel.java
CfgAlignmentModel.getRootFactor
public Factor getRootFactor(ExpressionTree tree, VariableNumMap expressionVar) { List<Assignment> roots = Lists.newArrayList(); if (tree.getSubstitutions().size() == 0) { roots.add(expressionVar.outcomeArrayToAssignment(tree.getExpressionNode())); } else { for (ExpressionTree substitution : tree.getSubstitutions()) { roots.add(expressionVar.outcomeArrayToAssignment(substitution.getExpressionNode())); } } return TableFactor.pointDistribution(expressionVar, roots.toArray(new Assignment[0])); }
java
public Factor getRootFactor(ExpressionTree tree, VariableNumMap expressionVar) { List<Assignment> roots = Lists.newArrayList(); if (tree.getSubstitutions().size() == 0) { roots.add(expressionVar.outcomeArrayToAssignment(tree.getExpressionNode())); } else { for (ExpressionTree substitution : tree.getSubstitutions()) { roots.add(expressionVar.outcomeArrayToAssignment(substitution.getExpressionNode())); } } return TableFactor.pointDistribution(expressionVar, roots.toArray(new Assignment[0])); }
[ "public", "Factor", "getRootFactor", "(", "ExpressionTree", "tree", ",", "VariableNumMap", "expressionVar", ")", "{", "List", "<", "Assignment", ">", "roots", "=", "Lists", ".", "newArrayList", "(", ")", ";", "if", "(", "tree", ".", "getSubstitutions", "(", ...
This method is a hack that enables the use of the "substitutions" field of ExpressionTree at the root of the CFG parse. In the future, these substitutions should be handled using unary rules in the CFG parser.
[ "This", "method", "is", "a", "hack", "that", "enables", "the", "use", "of", "the", "substitutions", "field", "of", "ExpressionTree", "at", "the", "root", "of", "the", "CFG", "parse", ".", "In", "the", "future", "these", "substitutions", "should", "be", "ha...
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/lexinduct/CfgAlignmentModel.java#L327-L338
train
lastaflute/lasta-job
src/main/java/org/lastaflute/job/cron4j/Cron4jNow.java
Cron4jNow.clearDisappearedJob
public synchronized void clearDisappearedJob() { getCron4jJobList().stream().filter(job -> job.isDisappeared()).forEach(job -> { final LaJobKey jobKey = job.getJobKey(); jobKeyJobMap.remove(jobKey); jobOrderedList.remove(job); job.getJobUnique().ifPresent(jobUnique -> jobUniqueJobMap.remove(jobUnique)); cron4jTaskJobMap.remove(job.getCron4jTask()); }); }
java
public synchronized void clearDisappearedJob() { getCron4jJobList().stream().filter(job -> job.isDisappeared()).forEach(job -> { final LaJobKey jobKey = job.getJobKey(); jobKeyJobMap.remove(jobKey); jobOrderedList.remove(job); job.getJobUnique().ifPresent(jobUnique -> jobUniqueJobMap.remove(jobUnique)); cron4jTaskJobMap.remove(job.getCron4jTask()); }); }
[ "public", "synchronized", "void", "clearDisappearedJob", "(", ")", "{", "getCron4jJobList", "(", ")", ".", "stream", "(", ")", ".", "filter", "(", "job", "->", "job", ".", "isDisappeared", "(", ")", ")", ".", "forEach", "(", "job", "->", "{", "final", ...
Clear disappeared jobs from job list if it exists.
[ "Clear", "disappeared", "jobs", "from", "job", "list", "if", "it", "exists", "." ]
5fee7bb1e908463c56b4668de404fd8bce1c2710
https://github.com/lastaflute/lasta-job/blob/5fee7bb1e908463c56b4668de404fd8bce1c2710/src/main/java/org/lastaflute/job/cron4j/Cron4jNow.java#L230-L238
train
jayantk/jklol
src/com/jayantkrish/jklol/models/dynamic/DynamicFactorGraphBuilder.java
DynamicFactorGraphBuilder.addUnreplicatedFactor
public void addUnreplicatedFactor(String factorName, Factor factor, VariableNumMap vars) { plateFactors.add(new ReplicatedFactor(factor, new WrapperVariablePattern(vars))); plateFactorNames.add(factorName); }
java
public void addUnreplicatedFactor(String factorName, Factor factor, VariableNumMap vars) { plateFactors.add(new ReplicatedFactor(factor, new WrapperVariablePattern(vars))); plateFactorNames.add(factorName); }
[ "public", "void", "addUnreplicatedFactor", "(", "String", "factorName", ",", "Factor", "factor", ",", "VariableNumMap", "vars", ")", "{", "plateFactors", ".", "add", "(", "new", "ReplicatedFactor", "(", "factor", ",", "new", "WrapperVariablePattern", "(", "vars", ...
Adds an unreplicated factor to the model being constructed. The factor will match only the variables which it is defined over. @param factor
[ "Adds", "an", "unreplicated", "factor", "to", "the", "model", "being", "constructed", ".", "The", "factor", "will", "match", "only", "the", "variables", "which", "it", "is", "defined", "over", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/models/dynamic/DynamicFactorGraphBuilder.java#L33-L36
train
GoodforGod/dummymaker
src/main/java/io/dummymaker/scan/impl/PopulateScanner.java
PopulateScanner.isComplex
private boolean isComplex(final Field field) { final Class<?> declaringClass = field.getType(); return (declaringClass.equals(List.class) || declaringClass.equals(Set.class) || declaringClass.equals(Map.class)) || declaringClass.getTypeName().endsWith("[][]") || declaringClass.getTypeName().endsWith("[]"); }
java
private boolean isComplex(final Field field) { final Class<?> declaringClass = field.getType(); return (declaringClass.equals(List.class) || declaringClass.equals(Set.class) || declaringClass.equals(Map.class)) || declaringClass.getTypeName().endsWith("[][]") || declaringClass.getTypeName().endsWith("[]"); }
[ "private", "boolean", "isComplex", "(", "final", "Field", "field", ")", "{", "final", "Class", "<", "?", ">", "declaringClass", "=", "field", ".", "getType", "(", ")", ";", "return", "(", "declaringClass", ".", "equals", "(", "List", ".", "class", ")", ...
Check if the field have complex suitable generator
[ "Check", "if", "the", "field", "have", "complex", "suitable", "generator" ]
a4809c0a8139ab9cdb42814a3e37772717a313b4
https://github.com/GoodforGod/dummymaker/blob/a4809c0a8139ab9cdb42814a3e37772717a313b4/src/main/java/io/dummymaker/scan/impl/PopulateScanner.java#L86-L93
train
GoodforGod/dummymaker
src/main/java/io/dummymaker/scan/impl/PopulateScanner.java
PopulateScanner.findGenAnnotation
private GenContainer findGenAnnotation(final Field field) { for (Annotation annotation : field.getDeclaredAnnotations()) { for (Annotation inline : annotation.annotationType().getDeclaredAnnotations()) { if (isGen.test(inline)) { return GenContainer.asGen(inline, annotation); } } } return null; }
java
private GenContainer findGenAnnotation(final Field field) { for (Annotation annotation : field.getDeclaredAnnotations()) { for (Annotation inline : annotation.annotationType().getDeclaredAnnotations()) { if (isGen.test(inline)) { return GenContainer.asGen(inline, annotation); } } } return null; }
[ "private", "GenContainer", "findGenAnnotation", "(", "final", "Field", "field", ")", "{", "for", "(", "Annotation", "annotation", ":", "field", ".", "getDeclaredAnnotations", "(", ")", ")", "{", "for", "(", "Annotation", "inline", ":", "annotation", ".", "anno...
Found only first found gen annotation on field
[ "Found", "only", "first", "found", "gen", "annotation", "on", "field" ]
a4809c0a8139ab9cdb42814a3e37772717a313b4
https://github.com/GoodforGod/dummymaker/blob/a4809c0a8139ab9cdb42814a3e37772717a313b4/src/main/java/io/dummymaker/scan/impl/PopulateScanner.java#L98-L108
train
jayantk/jklol
src/com/jayantkrish/jklol/ccg/augment/DavidsonianCcgParseAugmenter.java
DavidsonianCcgParseAugmenter.markEntityVars
private static void markEntityVars(HeadedSyntacticCategory cat, int[] uniqueVars, boolean[] isEntityVar) { if (cat.isAtomic()) { for (int var : cat.getUniqueVariables()) { int index = Ints.indexOf(uniqueVars, var); isEntityVar[index] = true; } } else { markEntityVars(cat.getArgumentType(), uniqueVars, isEntityVar); markEntityVars(cat.getReturnType(), uniqueVars, isEntityVar); } }
java
private static void markEntityVars(HeadedSyntacticCategory cat, int[] uniqueVars, boolean[] isEntityVar) { if (cat.isAtomic()) { for (int var : cat.getUniqueVariables()) { int index = Ints.indexOf(uniqueVars, var); isEntityVar[index] = true; } } else { markEntityVars(cat.getArgumentType(), uniqueVars, isEntityVar); markEntityVars(cat.getReturnType(), uniqueVars, isEntityVar); } }
[ "private", "static", "void", "markEntityVars", "(", "HeadedSyntacticCategory", "cat", ",", "int", "[", "]", "uniqueVars", ",", "boolean", "[", "]", "isEntityVar", ")", "{", "if", "(", "cat", ".", "isAtomic", "(", ")", ")", "{", "for", "(", "int", "var", ...
Marks all unique variables in a syntactic category associated with atomic syntactic categories.
[ "Marks", "all", "unique", "variables", "in", "a", "syntactic", "category", "associated", "with", "atomic", "syntactic", "categories", "." ]
d27532ca83e212d51066cf28f52621acc3fd44cc
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/augment/DavidsonianCcgParseAugmenter.java#L239-L250
train