repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
11
218
func_name
stringlengths
4
140
whole_func_string
stringlengths
153
5.32k
language
stringclasses
1 value
func_code_string
stringlengths
72
4k
func_code_tokens
listlengths
20
832
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
102
339
jmchilton/galaxy-bootstrap
src/main/java/com/github/jmchilton/galaxybootstrap/GalaxyProperties.java
GalaxyProperties.getConfigSampleIni
private File getConfigSampleIni(File galaxyRoot) { """ Gets the sample config ini for this Galaxy installation. @param galaxyRoot The root directory of Galaxy. @return A File object for the sample config ini for Galaxy. """ if (isPre20141006Release(galaxyRoot)) { return new File(galaxyRoot, "univ...
java
private File getConfigSampleIni(File galaxyRoot) { if (isPre20141006Release(galaxyRoot)) { return new File(galaxyRoot, "universe_wsgi.ini.sample"); } else { File configDirectory = new File(galaxyRoot, CONFIG_DIR_NAME); return new File(configDirectory, "galaxy.ini.sample"); } }
[ "private", "File", "getConfigSampleIni", "(", "File", "galaxyRoot", ")", "{", "if", "(", "isPre20141006Release", "(", "galaxyRoot", ")", ")", "{", "return", "new", "File", "(", "galaxyRoot", ",", "\"universe_wsgi.ini.sample\"", ")", ";", "}", "else", "{", "Fil...
Gets the sample config ini for this Galaxy installation. @param galaxyRoot The root directory of Galaxy. @return A File object for the sample config ini for Galaxy.
[ "Gets", "the", "sample", "config", "ini", "for", "this", "Galaxy", "installation", "." ]
train
https://github.com/jmchilton/galaxy-bootstrap/blob/4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649/src/main/java/com/github/jmchilton/galaxybootstrap/GalaxyProperties.java#L142-L149
JodaOrg/joda-time
src/main/java/org/joda/time/convert/StringConverter.java
StringConverter.getInstantMillis
public long getInstantMillis(Object object, Chronology chrono) { """ Gets the millis, which is the ISO parsed string value. @param object the String to convert, must not be null @param chrono the chronology to use, non-null result of getChronology @return the millisecond value @throws IllegalArgumentExcept...
java
public long getInstantMillis(Object object, Chronology chrono) { String str = (String) object; DateTimeFormatter p = ISODateTimeFormat.dateTimeParser(); return p.withChronology(chrono).parseMillis(str); }
[ "public", "long", "getInstantMillis", "(", "Object", "object", ",", "Chronology", "chrono", ")", "{", "String", "str", "=", "(", "String", ")", "object", ";", "DateTimeFormatter", "p", "=", "ISODateTimeFormat", ".", "dateTimeParser", "(", ")", ";", "return", ...
Gets the millis, which is the ISO parsed string value. @param object the String to convert, must not be null @param chrono the chronology to use, non-null result of getChronology @return the millisecond value @throws IllegalArgumentException if the value if invalid
[ "Gets", "the", "millis", "which", "is", "the", "ISO", "parsed", "string", "value", "." ]
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/StringConverter.java#L62-L66
strator-dev/greenpepper
greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/macros/AbstractGreenPepperMacro.java
AbstractGreenPepperMacro.getPageTitle
@SuppressWarnings("unchecked") protected String getPageTitle(@SuppressWarnings("rawtypes") Map parameters, RenderContext renderContext, String spaceKey) throws GreenPepperServerException { """ <p>getPageTitle.</p> @param parameters a {@link java.util.Map} object. @param renderContext a {@link com.atlassian...
java
@SuppressWarnings("unchecked") protected String getPageTitle(@SuppressWarnings("rawtypes") Map parameters, RenderContext renderContext, String spaceKey) throws GreenPepperServerException { return getPage(parameters, renderContext, spaceKey).getTitle().trim(); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "String", "getPageTitle", "(", "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "Map", "parameters", ",", "RenderContext", "renderContext", ",", "String", "spaceKey", ")", "throws", "GreenPepperServerE...
<p>getPageTitle.</p> @param parameters a {@link java.util.Map} object. @param renderContext a {@link com.atlassian.renderer.RenderContext} object. @param spaceKey a {@link java.lang.String} object. @return a {@link java.lang.String} object. @throws com.greenpepper.server.GreenPepperServerException if any.
[ "<p", ">", "getPageTitle", ".", "<", "/", "p", ">" ]
train
https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/macros/AbstractGreenPepperMacro.java#L177-L181
MTDdk/jawn
jawn-core-new/src/main/java/net/javapla/jawn/core/util/ConvertUtil.java
ConvertUtil.toInteger
public static Integer toInteger(Object value, Integer defaultValue) { """ Same as {@linkplain ConvertUtil#toInteger(Object)} but does not throw an exception if the conversion could not be done. @param value @param defaultValue @return """ try { return toInteger(value); } catch...
java
public static Integer toInteger(Object value, Integer defaultValue) { try { return toInteger(value); } catch (Exception e) { return defaultValue; } }
[ "public", "static", "Integer", "toInteger", "(", "Object", "value", ",", "Integer", "defaultValue", ")", "{", "try", "{", "return", "toInteger", "(", "value", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "return", "defaultValue", ";", "}", "}...
Same as {@linkplain ConvertUtil#toInteger(Object)} but does not throw an exception if the conversion could not be done. @param value @param defaultValue @return
[ "Same", "as", "{", "@linkplain", "ConvertUtil#toInteger", "(", "Object", ")", "}", "but", "does", "not", "throw", "an", "exception", "if", "the", "conversion", "could", "not", "be", "done", "." ]
train
https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-core-new/src/main/java/net/javapla/jawn/core/util/ConvertUtil.java#L53-L59
alipay/sofa-rpc
extension-impl/registry-mesh/src/main/java/com/alipay/sofa/rpc/registry/mesh/MeshRegistry.java
MeshRegistry.doRegister
protected void doRegister(String appName, String serviceName, ProviderInfo providerInfo) { """ 注册单条服务信息 @param appName 应用名 @param serviceName 服务关键字 @param providerInfo 服务提供者数据 """ registerAppInfoOnce(appName); if (LOGGER.isInfoEnabled(appName)) { LOGGER.infoWithApp(appN...
java
protected void doRegister(String appName, String serviceName, ProviderInfo providerInfo) { registerAppInfoOnce(appName); if (LOGGER.isInfoEnabled(appName)) { LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_ROUTE_REGISTRY_PUB, serviceName)); } PublishServiceReques...
[ "protected", "void", "doRegister", "(", "String", "appName", ",", "String", "serviceName", ",", "ProviderInfo", "providerInfo", ")", "{", "registerAppInfoOnce", "(", "appName", ")", ";", "if", "(", "LOGGER", ".", "isInfoEnabled", "(", "appName", ")", ")", "{",...
注册单条服务信息 @param appName 应用名 @param serviceName 服务关键字 @param providerInfo 服务提供者数据
[ "注册单条服务信息" ]
train
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/registry-mesh/src/main/java/com/alipay/sofa/rpc/registry/mesh/MeshRegistry.java#L137-L155
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/shared/core/types/Color.java
Color.toBrowserRGB
public static final String toBrowserRGB(final int r, final int g, final int b) { """ Converts RGB integer values to a browser-compliance rgb format. @param r int between 0 and 255 @param g int between 0 and 255 @param b int between 0 and 255 @return String e.g. "rgb(12,34,255)" """ return "rgb(" ...
java
public static final String toBrowserRGB(final int r, final int g, final int b) { return "rgb(" + fixRGB(r) + "," + fixRGB(g) + "," + fixRGB(b) + ")"; }
[ "public", "static", "final", "String", "toBrowserRGB", "(", "final", "int", "r", ",", "final", "int", "g", ",", "final", "int", "b", ")", "{", "return", "\"rgb(\"", "+", "fixRGB", "(", "r", ")", "+", "\",\"", "+", "fixRGB", "(", "g", ")", "+", "\",...
Converts RGB integer values to a browser-compliance rgb format. @param r int between 0 and 255 @param g int between 0 and 255 @param b int between 0 and 255 @return String e.g. "rgb(12,34,255)"
[ "Converts", "RGB", "integer", "values", "to", "a", "browser", "-", "compliance", "rgb", "format", "." ]
train
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/shared/core/types/Color.java#L192-L195
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Operators.java
Operators.resolveBinary
OperatorSymbol resolveBinary(DiagnosticPosition pos, JCTree.Tag tag, Type op1, Type op2) { """ Entry point for resolving a binary operator given an operator tag and a pair of argument types. """ return resolve(tag, binaryOperators, binop -> binop.test(op1, op2), ...
java
OperatorSymbol resolveBinary(DiagnosticPosition pos, JCTree.Tag tag, Type op1, Type op2) { return resolve(tag, binaryOperators, binop -> binop.test(op1, op2), binop -> binop.resolve(op1, op2), () -> reportErrorIfNeeded(pos, tag, op1, op2)); }
[ "OperatorSymbol", "resolveBinary", "(", "DiagnosticPosition", "pos", ",", "JCTree", ".", "Tag", "tag", ",", "Type", "op1", ",", "Type", "op2", ")", "{", "return", "resolve", "(", "tag", ",", "binaryOperators", ",", "binop", "->", "binop", ".", "test", "(",...
Entry point for resolving a binary operator given an operator tag and a pair of argument types.
[ "Entry", "point", "for", "resolving", "a", "binary", "operator", "given", "an", "operator", "tag", "and", "a", "pair", "of", "argument", "types", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Operators.java#L160-L166
coursera/courier
generator-api/src/main/java/org/coursera/courier/api/CourierTemplateSpecGenerator.java
CourierTemplateSpecGenerator.registerClassTemplateSpec
private void registerClassTemplateSpec(DataSchema schema, ClassTemplateSpec classTemplateSpec) { """ Register a new class TemplateSpec. <p/> Registration is necessary to associate the {@link com.linkedin.pegasus.generator.spec.ClassTemplateSpec} with the source file for which it was generated. This may be used l...
java
private void registerClassTemplateSpec(DataSchema schema, ClassTemplateSpec classTemplateSpec) { classTemplateSpec.setLocation(currentLocation().toString()); _schemaToClassMap.put(schema, classTemplateSpec); _classNameToSchemaMap.put(classTemplateSpec.getFullName(), schema); _classToDataSchemaLocation...
[ "private", "void", "registerClassTemplateSpec", "(", "DataSchema", "schema", ",", "ClassTemplateSpec", "classTemplateSpec", ")", "{", "classTemplateSpec", ".", "setLocation", "(", "currentLocation", "(", ")", ".", "toString", "(", ")", ")", ";", "_schemaToClassMap", ...
Register a new class TemplateSpec. <p/> Registration is necessary to associate the {@link com.linkedin.pegasus.generator.spec.ClassTemplateSpec} with the source file for which it was generated. This may be used later to determine if generated class should be emitted based on the location of the source file. <p/> Regist...
[ "Register", "a", "new", "class", "TemplateSpec", ".", "<p", "/", ">", "Registration", "is", "necessary", "to", "associate", "the", "{", "@link", "com", ".", "linkedin", ".", "pegasus", ".", "generator", ".", "spec", ".", "ClassTemplateSpec", "}", "with", "...
train
https://github.com/coursera/courier/blob/749674fa7ee33804ad11b6c8ecb560f455cb4c22/generator-api/src/main/java/org/coursera/courier/api/CourierTemplateSpecGenerator.java#L356-L369
MorphiaOrg/morphia
morphia/src/main/java/dev/morphia/utils/ReflectionUtils.java
ReflectionUtils.isFieldParameterizedWithClass
public static boolean isFieldParameterizedWithClass(final Field field, final Class c) { """ Check if a field is parameterized with a specific class. @param field the field @param c the class to check against @return true if the field is parameterized and c is the class that parameterizes the field, or is ...
java
public static boolean isFieldParameterizedWithClass(final Field field, final Class c) { if (field.getGenericType() instanceof ParameterizedType) { final ParameterizedType genericType = (ParameterizedType) field.getGenericType(); for (final Type type : genericType.getActualTypeArguments()...
[ "public", "static", "boolean", "isFieldParameterizedWithClass", "(", "final", "Field", "field", ",", "final", "Class", "c", ")", "{", "if", "(", "field", ".", "getGenericType", "(", ")", "instanceof", "ParameterizedType", ")", "{", "final", "ParameterizedType", ...
Check if a field is parameterized with a specific class. @param field the field @param c the class to check against @return true if the field is parameterized and c is the class that parameterizes the field, or is an interface that the parameterized class implements, else false @deprecated this class is unused in ...
[ "Check", "if", "a", "field", "is", "parameterized", "with", "a", "specific", "class", "." ]
train
https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/utils/ReflectionUtils.java#L331-L344
tango-controls/JTango
server/src/main/java/org/tango/server/cache/PollingManager.java
PollingManager.addAttributePolling
public void addAttributePolling(final String attributeName, final int pollingPeriod) throws DevFailed { """ Add attribute polling @param attributeName the attribute to poll @param pollingPeriod the polling period @throws DevFailed """ logger.debug("add {} polling with period {}", attributeName,...
java
public void addAttributePolling(final String attributeName, final int pollingPeriod) throws DevFailed { logger.debug("add {} polling with period {}", attributeName, pollingPeriod); checkPollingLimits(attributeName, pollingPeriod, minAttributePolling); final AttributeImpl attribute = Attribu...
[ "public", "void", "addAttributePolling", "(", "final", "String", "attributeName", ",", "final", "int", "pollingPeriod", ")", "throws", "DevFailed", "{", "logger", ".", "debug", "(", "\"add {} polling with period {}\"", ",", "attributeName", ",", "pollingPeriod", ")", ...
Add attribute polling @param attributeName the attribute to poll @param pollingPeriod the polling period @throws DevFailed
[ "Add", "attribute", "polling" ]
train
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/cache/PollingManager.java#L293-L312
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelUtils.java
KerasModelUtils.determineKerasBackend
public static String determineKerasBackend(Map<String, Object> modelConfig, KerasModelConfiguration config) { """ Determine Keras backend @param modelConfig parsed model configuration for keras model @param config basic model configuration (KerasModelConfiguration) @return Keras backend string @throws I...
java
public static String determineKerasBackend(Map<String, Object> modelConfig, KerasModelConfiguration config) { String kerasBackend = null; if (!modelConfig.containsKey(config.getFieldBackend())) { // TODO: H5 files unfortunately do not seem to have this property in keras 1. log.wa...
[ "public", "static", "String", "determineKerasBackend", "(", "Map", "<", "String", ",", "Object", ">", "modelConfig", ",", "KerasModelConfiguration", "config", ")", "{", "String", "kerasBackend", "=", "null", ";", "if", "(", "!", "modelConfig", ".", "containsKey"...
Determine Keras backend @param modelConfig parsed model configuration for keras model @param config basic model configuration (KerasModelConfiguration) @return Keras backend string @throws InvalidKerasConfigurationException Invalid Keras config
[ "Determine", "Keras", "backend" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelUtils.java#L126-L137
js-lib-com/dom
src/main/java/js/dom/w3c/DocumentBuilderImpl.java
DocumentBuilderImpl.loadXML
private static Document loadXML(InputSource source, boolean useNamespace) { """ Helper method to load XML document from input source. @param source input source, @param useNamespace flag to control name space awareness. @return newly created XML document. """ try { org.w3c.dom.Document doc = getDoc...
java
private static Document loadXML(InputSource source, boolean useNamespace) { try { org.w3c.dom.Document doc = getDocumentBuilder(null, useNamespace).parse(source); return new DocumentImpl(doc); } catch (Exception e) { throw new DomException(e); } finally { close(source); } }
[ "private", "static", "Document", "loadXML", "(", "InputSource", "source", ",", "boolean", "useNamespace", ")", "{", "try", "{", "org", ".", "w3c", ".", "dom", ".", "Document", "doc", "=", "getDocumentBuilder", "(", "null", ",", "useNamespace", ")", ".", "p...
Helper method to load XML document from input source. @param source input source, @param useNamespace flag to control name space awareness. @return newly created XML document.
[ "Helper", "method", "to", "load", "XML", "document", "from", "input", "source", "." ]
train
https://github.com/js-lib-com/dom/blob/8c7cd7c802977f210674dec7c2a8f61e8de05b63/src/main/java/js/dom/w3c/DocumentBuilderImpl.java#L164-L173
structurizr/java
structurizr-core/src/com/structurizr/model/ContainerInstance.java
ContainerInstance.addHealthCheck
@Nonnull public HttpHealthCheck addHealthCheck(String name, String url) { """ Adds a new health check, with the default interval (60 seconds) and timeout (0 milliseconds). @param name the name of the health check @param url the URL of the health check @return a HttpHealthCheck instance represe...
java
@Nonnull public HttpHealthCheck addHealthCheck(String name, String url) { return addHealthCheck(name, url, DEFAULT_HEALTH_CHECK_INTERVAL_IN_SECONDS, DEFAULT_HEALTH_CHECK_TIMEOUT_IN_MILLISECONDS); }
[ "@", "Nonnull", "public", "HttpHealthCheck", "addHealthCheck", "(", "String", "name", ",", "String", "url", ")", "{", "return", "addHealthCheck", "(", "name", ",", "url", ",", "DEFAULT_HEALTH_CHECK_INTERVAL_IN_SECONDS", ",", "DEFAULT_HEALTH_CHECK_TIMEOUT_IN_MILLISECONDS",...
Adds a new health check, with the default interval (60 seconds) and timeout (0 milliseconds). @param name the name of the health check @param url the URL of the health check @return a HttpHealthCheck instance representing the health check that has been added @throws IllegalArgumentException if the name...
[ "Adds", "a", "new", "health", "check", "with", "the", "default", "interval", "(", "60", "seconds", ")", "and", "timeout", "(", "0", "milliseconds", ")", "." ]
train
https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/ContainerInstance.java#L130-L133
amzn/ion-java
src/com/amazon/ion/util/IonTextUtils.java
IonTextUtils.printSymbolCodePoint
public static void printSymbolCodePoint(Appendable out, int codePoint) throws IOException { """ Prints a single Unicode code point for use in an ASCII-safe Ion symbol. @param out the stream to receive the data. @param codePoint a Unicode code point. """ printCodePoint(out, codePoint, Escape...
java
public static void printSymbolCodePoint(Appendable out, int codePoint) throws IOException { printCodePoint(out, codePoint, EscapeMode.ION_SYMBOL); }
[ "public", "static", "void", "printSymbolCodePoint", "(", "Appendable", "out", ",", "int", "codePoint", ")", "throws", "IOException", "{", "printCodePoint", "(", "out", ",", "codePoint", ",", "EscapeMode", ".", "ION_SYMBOL", ")", ";", "}" ]
Prints a single Unicode code point for use in an ASCII-safe Ion symbol. @param out the stream to receive the data. @param codePoint a Unicode code point.
[ "Prints", "a", "single", "Unicode", "code", "point", "for", "use", "in", "an", "ASCII", "-", "safe", "Ion", "symbol", "." ]
train
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/util/IonTextUtils.java#L212-L216
QSFT/Doradus
doradus-common/src/main/java/com/dell/doradus/common/TenantDefinition.java
TenantDefinition.setOption
public void setOption(String optName, Object optValue) { """ Set the given option. If the option was previously defined, the value is overwritten. If the given value is null, the existing option is removed. @param optName Option name. @param optValue Option value, which may be a String or Map&lt;String,Obj...
java
public void setOption(String optName, Object optValue) { if (optValue == null) { m_options.remove(optName); } else { m_options.put(optName, optValue); } }
[ "public", "void", "setOption", "(", "String", "optName", ",", "Object", "optValue", ")", "{", "if", "(", "optValue", "==", "null", ")", "{", "m_options", ".", "remove", "(", "optName", ")", ";", "}", "else", "{", "m_options", ".", "put", "(", "optName"...
Set the given option. If the option was previously defined, the value is overwritten. If the given value is null, the existing option is removed. @param optName Option name. @param optValue Option value, which may be a String or Map&lt;String,Object&gt;.
[ "Set", "the", "given", "option", ".", "If", "the", "option", "was", "previously", "defined", "the", "value", "is", "overwritten", ".", "If", "the", "given", "value", "is", "null", "the", "existing", "option", "is", "removed", "." ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/TenantDefinition.java#L253-L259
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/jboss/logging/Logger.java
Logger.errorf
public void errorf(String format, Object... params) { """ Issue a formatted log message with a level of ERROR. @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor @param params the parameters """ doLogf(Level.ERROR, FQCN, format, params, n...
java
public void errorf(String format, Object... params) { doLogf(Level.ERROR, FQCN, format, params, null); }
[ "public", "void", "errorf", "(", "String", "format", ",", "Object", "...", "params", ")", "{", "doLogf", "(", "Level", ".", "ERROR", ",", "FQCN", ",", "format", ",", "params", ",", "null", ")", ";", "}" ]
Issue a formatted log message with a level of ERROR. @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor @param params the parameters
[ "Issue", "a", "formatted", "log", "message", "with", "a", "level", "of", "ERROR", "." ]
train
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L1666-L1668
primefaces/primefaces
src/main/java/org/primefaces/component/organigram/OrganigramHelper.java
OrganigramHelper.findTreeNode
public static OrganigramNode findTreeNode(OrganigramNode searchRoot, OrganigramNode selection) { """ Finds a {@link OrganigramNode} for the given selection. @param searchRoot The {@link OrganigramNode} to start the search. @param selection The selection. @return The {@link OrganigramNode} for the selection o...
java
public static OrganigramNode findTreeNode(OrganigramNode searchRoot, OrganigramNode selection) { if (selection == null || searchRoot == null) { return null; } if (searchRoot.equals(selection)) { return searchRoot; } if (searchRoot.getChildren() != null) ...
[ "public", "static", "OrganigramNode", "findTreeNode", "(", "OrganigramNode", "searchRoot", ",", "OrganigramNode", "selection", ")", "{", "if", "(", "selection", "==", "null", "||", "searchRoot", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", ...
Finds a {@link OrganigramNode} for the given selection. @param searchRoot The {@link OrganigramNode} to start the search. @param selection The selection. @return The {@link OrganigramNode} for the selection or <code>null</code>.
[ "Finds", "a", "{", "@link", "OrganigramNode", "}", "for", "the", "given", "selection", "." ]
train
https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/component/organigram/OrganigramHelper.java#L72-L91
Alluxio/alluxio
job/server/src/main/java/alluxio/worker/job/task/TaskExecutorManager.java
TaskExecutorManager.notifyTaskFailure
public synchronized void notifyTaskFailure(long jobId, int taskId, String errorMessage) { """ Notifies the failure of the task. @param jobId the job id @param taskId the task id @param errorMessage the error message """ Pair<Long, Integer> id = new Pair<>(jobId, taskId); TaskInfo.Builder taskInfo ...
java
public synchronized void notifyTaskFailure(long jobId, int taskId, String errorMessage) { Pair<Long, Integer> id = new Pair<>(jobId, taskId); TaskInfo.Builder taskInfo = mUnfinishedTasks.get(id); taskInfo.setStatus(Status.FAILED); taskInfo.setErrorMessage(errorMessage); finishTask(id); LOG.info(...
[ "public", "synchronized", "void", "notifyTaskFailure", "(", "long", "jobId", ",", "int", "taskId", ",", "String", "errorMessage", ")", "{", "Pair", "<", "Long", ",", "Integer", ">", "id", "=", "new", "Pair", "<>", "(", "jobId", ",", "taskId", ")", ";", ...
Notifies the failure of the task. @param jobId the job id @param taskId the task id @param errorMessage the error message
[ "Notifies", "the", "failure", "of", "the", "task", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/job/server/src/main/java/alluxio/worker/job/task/TaskExecutorManager.java#L96-L103
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/detect/StreamResourceTracker.java
StreamResourceTracker.addStreamOpenLocation
public void addStreamOpenLocation(Location streamOpenLocation, Stream stream) { """ Indicate that a stream is constructed at this Location. @param streamOpenLocation the Location @param stream the Stream opened at this Location """ if (FindOpenStream.DEBUG) { System.out.println("Strea...
java
public void addStreamOpenLocation(Location streamOpenLocation, Stream stream) { if (FindOpenStream.DEBUG) { System.out.println("Stream open location at " + streamOpenLocation); } streamOpenLocationMap.put(streamOpenLocation, stream); if (stream.isUninteresting()) { ...
[ "public", "void", "addStreamOpenLocation", "(", "Location", "streamOpenLocation", ",", "Stream", "stream", ")", "{", "if", "(", "FindOpenStream", ".", "DEBUG", ")", "{", "System", ".", "out", ".", "println", "(", "\"Stream open location at \"", "+", "streamOpenLoc...
Indicate that a stream is constructed at this Location. @param streamOpenLocation the Location @param stream the Stream opened at this Location
[ "Indicate", "that", "a", "stream", "is", "constructed", "at", "this", "Location", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/StreamResourceTracker.java#L208-L216
ksclarke/freelib-utils
src/main/java/info/freelibrary/util/I18nObject.java
I18nObject.getI18n
protected String getI18n(final String aMessageKey, final Exception aException) { """ Gets the internationalized value for the supplied message key, using an exception as additional information. @param aMessageKey A message key @param aException Additional details for the message @return The internationalized ...
java
protected String getI18n(final String aMessageKey, final Exception aException) { return StringUtils.normalizeWS(myBundle.get(aMessageKey, aException.getMessage())); }
[ "protected", "String", "getI18n", "(", "final", "String", "aMessageKey", ",", "final", "Exception", "aException", ")", "{", "return", "StringUtils", ".", "normalizeWS", "(", "myBundle", ".", "get", "(", "aMessageKey", ",", "aException", ".", "getMessage", "(", ...
Gets the internationalized value for the supplied message key, using an exception as additional information. @param aMessageKey A message key @param aException Additional details for the message @return The internationalized message
[ "Gets", "the", "internationalized", "value", "for", "the", "supplied", "message", "key", "using", "an", "exception", "as", "additional", "information", "." ]
train
https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/I18nObject.java#L101-L103
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/thumbnail/ThumbnailUtil.java
ThumbnailUtil.createThumbnail
public static com.github.bordertech.wcomponents.Image createThumbnail(final InputStream is, final String name, final Dimension scaledSize, final String mimeType) { """ This method takes a input document (represented by an {@link InputStream}) and returns a byte[] representing a JPEG "thumb nail" of a given ...
java
public static com.github.bordertech.wcomponents.Image createThumbnail(final InputStream is, final String name, final Dimension scaledSize, final String mimeType) { final Dimension scale = scaledSize == null ? THUMBNAIL_SCALE_SIZE : scaledSize; // Generate thumbnail for image files if (is != null && mimeTyp...
[ "public", "static", "com", ".", "github", ".", "bordertech", ".", "wcomponents", ".", "Image", "createThumbnail", "(", "final", "InputStream", "is", ",", "final", "String", "name", ",", "final", "Dimension", "scaledSize", ",", "final", "String", "mimeType", ")...
This method takes a input document (represented by an {@link InputStream}) and returns a byte[] representing a JPEG "thumb nail" of a given page of the document. It can do this for a limited number of input document "types"images. @param is The {@link InputStream} representing the input document. @param name The name ...
[ "This", "method", "takes", "a", "input", "document", "(", "represented", "by", "an", "{", "@link", "InputStream", "}", ")", "and", "returns", "a", "byte", "[]", "representing", "a", "JPEG", "thumb", "nail", "of", "a", "given", "page", "of", "the", "docum...
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/thumbnail/ThumbnailUtil.java#L134-L152
OpenLiberty/open-liberty
dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAScopeInfo.java
JPAScopeInfo.processPersistenceUnit
void processPersistenceUnit(JPAPXml pxml, JPAApplInfo applInfo) { """ Process each persistence.xml found in an application. Discover all the persistence unit(s) defined in the module. @param pxml @param looseConfig """ final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isT...
java
void processPersistenceUnit(JPAPXml pxml, JPAApplInfo applInfo) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "processPersistenceUnit" + pxml); synchronized (pxmlsInfo) { URL pxmlRootURL = pxml.getRoo...
[ "void", "processPersistenceUnit", "(", "JPAPXml", "pxml", ",", "JPAApplInfo", "applInfo", ")", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(",...
Process each persistence.xml found in an application. Discover all the persistence unit(s) defined in the module. @param pxml @param looseConfig
[ "Process", "each", "persistence", ".", "xml", "found", "in", "an", "application", ".", "Discover", "all", "the", "persistence", "unit", "(", "s", ")", "defined", "in", "the", "module", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAScopeInfo.java#L69-L99
gallandarakhneorg/afc
core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java
XMLUtil.writeXML
public static void writeXML(DocumentFragment fragment, OutputStream stream) throws IOException { """ Write the given node tree into a XML file. @param fragment is the object that contains the node tree @param stream is the target stream @throws IOException if the stream cannot be read. """ assert fragme...
java
public static void writeXML(DocumentFragment fragment, OutputStream stream) throws IOException { assert fragment != null : AssertMessages.notNullParameter(0); assert stream != null : AssertMessages.notNullParameter(1); writeNode(fragment, stream); }
[ "public", "static", "void", "writeXML", "(", "DocumentFragment", "fragment", ",", "OutputStream", "stream", ")", "throws", "IOException", "{", "assert", "fragment", "!=", "null", ":", "AssertMessages", ".", "notNullParameter", "(", "0", ")", ";", "assert", "stre...
Write the given node tree into a XML file. @param fragment is the object that contains the node tree @param stream is the target stream @throws IOException if the stream cannot be read.
[ "Write", "the", "given", "node", "tree", "into", "a", "XML", "file", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L2417-L2421
googleapis/google-cloud-java
google-cloud-clients/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreException.java
DatastoreException.throwInvalidRequest
static DatastoreException throwInvalidRequest(String massage, Object... params) { """ Throw a DatastoreException with {@code FAILED_PRECONDITION} reason and the {@code message} in a nested exception. @throws DatastoreException every time """ throw new DatastoreException( UNKNOWN_CODE, String.fo...
java
static DatastoreException throwInvalidRequest(String massage, Object... params) { throw new DatastoreException( UNKNOWN_CODE, String.format(massage, params), "FAILED_PRECONDITION"); }
[ "static", "DatastoreException", "throwInvalidRequest", "(", "String", "massage", ",", "Object", "...", "params", ")", "{", "throw", "new", "DatastoreException", "(", "UNKNOWN_CODE", ",", "String", ".", "format", "(", "massage", ",", "params", ")", ",", "\"FAILED...
Throw a DatastoreException with {@code FAILED_PRECONDITION} reason and the {@code message} in a nested exception. @throws DatastoreException every time
[ "Throw", "a", "DatastoreException", "with", "{", "@code", "FAILED_PRECONDITION", "}", "reason", "and", "the", "{", "@code", "message", "}", "in", "a", "nested", "exception", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreException.java#L76-L79
b3dgs/lionengine
lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/drawable/Drawable.java
Drawable.getClosestDpi
private static Media getClosestDpi(DpiType current, Media media) { """ Get the associated DPI media closest to required DPI. @param current The current DPI to use. @param media The original media. @return The DPI media, or the original media if no associated DPI found. """ final Media mediaDpi = M...
java
private static Media getClosestDpi(DpiType current, Media media) { final Media mediaDpi = Medias.getWithSuffix(media, current.name().toLowerCase(Locale.ENGLISH)); final Media closest; if (mediaDpi.exists()) { closest = mediaDpi; } else if (current.ordinal(...
[ "private", "static", "Media", "getClosestDpi", "(", "DpiType", "current", ",", "Media", "media", ")", "{", "final", "Media", "mediaDpi", "=", "Medias", ".", "getWithSuffix", "(", "media", ",", "current", ".", "name", "(", ")", ".", "toLowerCase", "(", "Loc...
Get the associated DPI media closest to required DPI. @param current The current DPI to use. @param media The original media. @return The DPI media, or the original media if no associated DPI found.
[ "Get", "the", "associated", "DPI", "media", "closest", "to", "required", "DPI", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/drawable/Drawable.java#L299-L316
roboconf/roboconf-platform
core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerUtils.java
DockerUtils.deleteImageIfItExists
public static void deleteImageIfItExists( String imageId, DockerClient dockerClient ) { """ Deletes a Docker image if it exists. @param imageId the image ID (not null) @param dockerClient a Docker client """ if( imageId != null ) { List<Image> images = dockerClient.listImagesCmd().exec(); if( findIm...
java
public static void deleteImageIfItExists( String imageId, DockerClient dockerClient ) { if( imageId != null ) { List<Image> images = dockerClient.listImagesCmd().exec(); if( findImageById( imageId, images ) != null ) dockerClient.removeImageCmd( imageId ).withForce( true ).exec(); } }
[ "public", "static", "void", "deleteImageIfItExists", "(", "String", "imageId", ",", "DockerClient", "dockerClient", ")", "{", "if", "(", "imageId", "!=", "null", ")", "{", "List", "<", "Image", ">", "images", "=", "dockerClient", ".", "listImagesCmd", "(", "...
Deletes a Docker image if it exists. @param imageId the image ID (not null) @param dockerClient a Docker client
[ "Deletes", "a", "Docker", "image", "if", "it", "exists", "." ]
train
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerUtils.java#L102-L109
Azure/azure-sdk-for-java
sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/QueryStatisticsInner.java
QueryStatisticsInner.listByQueryAsync
public Observable<List<QueryStatisticInner>> listByQueryAsync(String resourceGroupName, String serverName, String databaseName, String queryId) { """ Lists a query's statistics. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource ...
java
public Observable<List<QueryStatisticInner>> listByQueryAsync(String resourceGroupName, String serverName, String databaseName, String queryId) { return listByQueryWithServiceResponseAsync(resourceGroupName, serverName, databaseName, queryId).map(new Func1<ServiceResponse<List<QueryStatisticInner>>, List<QueryS...
[ "public", "Observable", "<", "List", "<", "QueryStatisticInner", ">", ">", "listByQueryAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "databaseName", ",", "String", "queryId", ")", "{", "return", "listByQueryWithServiceResponse...
Lists a query's statistics. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @param databaseName The name of the database. @param queryId The id of the query @throws...
[ "Lists", "a", "query", "s", "statistics", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/QueryStatisticsInner.java#L102-L109
apache/incubator-atlas
graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/GraphDbObjectFactory.java
GraphDbObjectFactory.createEdge
public static Titan0Edge createEdge(Titan0Graph graph, Edge source) { """ Creates a Titan0Edge that corresponds to the given Gremlin Edge. @param graph The graph the edge should be created in @param source The gremlin edge """ if (source == null) { return null; } return...
java
public static Titan0Edge createEdge(Titan0Graph graph, Edge source) { if (source == null) { return null; } return new Titan0Edge(graph, source); }
[ "public", "static", "Titan0Edge", "createEdge", "(", "Titan0Graph", "graph", ",", "Edge", "source", ")", "{", "if", "(", "source", "==", "null", ")", "{", "return", "null", ";", "}", "return", "new", "Titan0Edge", "(", "graph", ",", "source", ")", ";", ...
Creates a Titan0Edge that corresponds to the given Gremlin Edge. @param graph The graph the edge should be created in @param source The gremlin edge
[ "Creates", "a", "Titan0Edge", "that", "corresponds", "to", "the", "given", "Gremlin", "Edge", "." ]
train
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/GraphDbObjectFactory.java#L47-L53
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/fieldanalyzer/FieldAnalyzer.java
FieldAnalyzer.findAnalyzer
public static FieldAnalyzer findAnalyzer(TableDefinition tableDef, String fieldName) { """ Return the singleton instance of the {@link FieldAnalyzer} for the given scalar field belonging to the given table. If the scalar is not defined in the table, the field is assumed to be text and the {@link TextAnalyzer} in...
java
public static FieldAnalyzer findAnalyzer(TableDefinition tableDef, String fieldName) { assert tableDef != null; assert fieldName != null; FieldAnalyzer analyzer = TextAnalyzer.instance(); FieldDefinition fieldDef = tableDef.getFieldDef(fieldName); if (fieldDef != n...
[ "public", "static", "FieldAnalyzer", "findAnalyzer", "(", "TableDefinition", "tableDef", ",", "String", "fieldName", ")", "{", "assert", "tableDef", "!=", "null", ";", "assert", "fieldName", "!=", "null", ";", "FieldAnalyzer", "analyzer", "=", "TextAnalyzer", ".",...
Return the singleton instance of the {@link FieldAnalyzer} for the given scalar field belonging to the given table. If the scalar is not defined in the table, the field is assumed to be text and the {@link TextAnalyzer} instance is returned. Otherwise, the field definition's analyzer name is passed to {@link #findAnaly...
[ "Return", "the", "singleton", "instance", "of", "the", "{", "@link", "FieldAnalyzer", "}", "for", "the", "given", "scalar", "field", "belonging", "to", "the", "given", "table", ".", "If", "the", "scalar", "is", "not", "defined", "in", "the", "table", "the"...
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/fieldanalyzer/FieldAnalyzer.java#L94-L105
gallandarakhneorg/afc
core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/GraphIterator.java
GraphIterator.ignoreElementsAfter
public void ignoreElementsAfter(GraphIterationElement<ST, PT> element) { """ Ignore the elements after the specified element. @param element the reference element. """ final List<GraphIterationElement<ST, PT>> nexts = getNextSegments(false, element); this.courseModel.removeIterationElements(nexts); }
java
public void ignoreElementsAfter(GraphIterationElement<ST, PT> element) { final List<GraphIterationElement<ST, PT>> nexts = getNextSegments(false, element); this.courseModel.removeIterationElements(nexts); }
[ "public", "void", "ignoreElementsAfter", "(", "GraphIterationElement", "<", "ST", ",", "PT", ">", "element", ")", "{", "final", "List", "<", "GraphIterationElement", "<", "ST", ",", "PT", ">", ">", "nexts", "=", "getNextSegments", "(", "false", ",", "element...
Ignore the elements after the specified element. @param element the reference element.
[ "Ignore", "the", "elements", "after", "the", "specified", "element", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/GraphIterator.java#L340-L343
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/row/mult/VectorVectorMult_DDRM.java
VectorVectorMult_DDRM.outerProd
public static void outerProd(DMatrixD1 x, DMatrixD1 y, DMatrix1Row A ) { """ <p> Sets A &isin; &real; <sup>m &times; n</sup> equal to an outer product multiplication of the two vectors. This is also known as a rank-1 operation.<br> <br> A = x * y' where x &isin; &real; <sup>m</sup> and y &isin; &real; <sup>n...
java
public static void outerProd(DMatrixD1 x, DMatrixD1 y, DMatrix1Row A ) { int m = A.numRows; int n = A.numCols; int index = 0; for( int i = 0; i < m; i++ ) { double xdat = x.get(i); for( int j = 0; j < n; j++ ) { A.set(index++ , xdat*y.get(j) ); ...
[ "public", "static", "void", "outerProd", "(", "DMatrixD1", "x", ",", "DMatrixD1", "y", ",", "DMatrix1Row", "A", ")", "{", "int", "m", "=", "A", ".", "numRows", ";", "int", "n", "=", "A", ".", "numCols", ";", "int", "index", "=", "0", ";", "for", ...
<p> Sets A &isin; &real; <sup>m &times; n</sup> equal to an outer product multiplication of the two vectors. This is also known as a rank-1 operation.<br> <br> A = x * y' where x &isin; &real; <sup>m</sup> and y &isin; &real; <sup>n</sup> are vectors. </p> <p> Which is equivalent to: A<sub>ij</sub> = x<sub>i</sub>*y<s...
[ "<p", ">", "Sets", "A", "&isin", ";", "&real", ";", "<sup", ">", "m", "&times", ";", "n<", "/", "sup", ">", "equal", "to", "an", "outer", "product", "multiplication", "of", "the", "two", "vectors", ".", "This", "is", "also", "known", "as", "a", "ra...
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/mult/VectorVectorMult_DDRM.java#L157-L168
googleapis/google-cloud-java
google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SecurityPolicyClient.java
SecurityPolicyClient.removeRuleSecurityPolicy
@BetaApi public final Operation removeRuleSecurityPolicy(Integer priority, String securityPolicy) { """ Deletes a rule at the specified priority. <p>Sample code: <pre><code> try (SecurityPolicyClient securityPolicyClient = SecurityPolicyClient.create()) { Integer priority = 0; ProjectGlobalSecurityPolic...
java
@BetaApi public final Operation removeRuleSecurityPolicy(Integer priority, String securityPolicy) { RemoveRuleSecurityPolicyHttpRequest request = RemoveRuleSecurityPolicyHttpRequest.newBuilder() .setPriority(priority) .setSecurityPolicy(securityPolicy) .build(); re...
[ "@", "BetaApi", "public", "final", "Operation", "removeRuleSecurityPolicy", "(", "Integer", "priority", ",", "String", "securityPolicy", ")", "{", "RemoveRuleSecurityPolicyHttpRequest", "request", "=", "RemoveRuleSecurityPolicyHttpRequest", ".", "newBuilder", "(", ")", "....
Deletes a rule at the specified priority. <p>Sample code: <pre><code> try (SecurityPolicyClient securityPolicyClient = SecurityPolicyClient.create()) { Integer priority = 0; ProjectGlobalSecurityPolicyName securityPolicy = ProjectGlobalSecurityPolicyName.of("[PROJECT]", "[SECURITY_POLICY]"); Operation response = secu...
[ "Deletes", "a", "rule", "at", "the", "specified", "priority", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SecurityPolicyClient.java#L1141-L1150
wcm-io/wcm-io-handler
url/src/main/java/io/wcm/handler/url/impl/modes/AbstractUrlMode.java
AbstractUrlMode.getUrlConfigForTarget
protected UrlConfig getUrlConfigForTarget(Adaptable adaptable, Resource targetResource) { """ Get URL configuration for target resource. If this is invalid or not available, get it from adaptable. @param adaptable Adaptable (request or resource) @param targetResource Target resource (may be null) @return Url co...
java
protected UrlConfig getUrlConfigForTarget(Adaptable adaptable, Resource targetResource) { UrlConfig config = null; if (targetResource != null) { config = new UrlConfig(targetResource); } if (config == null || !config.isValid()) { config = new UrlConfig(adaptable); } return config; ...
[ "protected", "UrlConfig", "getUrlConfigForTarget", "(", "Adaptable", "adaptable", ",", "Resource", "targetResource", ")", "{", "UrlConfig", "config", "=", "null", ";", "if", "(", "targetResource", "!=", "null", ")", "{", "config", "=", "new", "UrlConfig", "(", ...
Get URL configuration for target resource. If this is invalid or not available, get it from adaptable. @param adaptable Adaptable (request or resource) @param targetResource Target resource (may be null) @return Url config (never null)
[ "Get", "URL", "configuration", "for", "target", "resource", ".", "If", "this", "is", "invalid", "or", "not", "available", "get", "it", "from", "adaptable", "." ]
train
https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/impl/modes/AbstractUrlMode.java#L69-L78
mokies/ratelimitj
ratelimitj-core/src/main/java/es/moki/ratelimitj/core/limiter/concurrent/ConcurrentLimitRule.java
ConcurrentLimitRule.of
public static ConcurrentLimitRule of(int concurrentLimit, TimeUnit timeOutUnit, long timeOut) { """ Initialise a concurrent rate limit. @param concurrentLimit The concurrent limit. @param timeOutUnit The time unit. @param timeOut A timeOut for the checkout baton. @return A concurrent limit rule. ...
java
public static ConcurrentLimitRule of(int concurrentLimit, TimeUnit timeOutUnit, long timeOut) { requireNonNull(timeOutUnit, "time out unit can not be null"); return new ConcurrentLimitRule(concurrentLimit, timeOutUnit.toMillis(timeOut)); }
[ "public", "static", "ConcurrentLimitRule", "of", "(", "int", "concurrentLimit", ",", "TimeUnit", "timeOutUnit", ",", "long", "timeOut", ")", "{", "requireNonNull", "(", "timeOutUnit", ",", "\"time out unit can not be null\"", ")", ";", "return", "new", "ConcurrentLimi...
Initialise a concurrent rate limit. @param concurrentLimit The concurrent limit. @param timeOutUnit The time unit. @param timeOut A timeOut for the checkout baton. @return A concurrent limit rule.
[ "Initialise", "a", "concurrent", "rate", "limit", "." ]
train
https://github.com/mokies/ratelimitj/blob/eb15ec42055c46b2b3f6f84131d86f570e489c32/ratelimitj-core/src/main/java/es/moki/ratelimitj/core/limiter/concurrent/ConcurrentLimitRule.java#L35-L38
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/model/helpers/ImportHelpers.java
ImportHelpers.hasAllRequiredImports
public static boolean hasAllRequiredImports( Instance instance, Logger logger ) { """ Determines whether an instance has all the imports it needs. <p> Master of Obvious said:<br> By definition, optional imports are not considered to be required. </p> @param instance a non-null instance @param logger a logg...
java
public static boolean hasAllRequiredImports( Instance instance, Logger logger ) { boolean haveAllImports = true; for( String facetOrComponentName : VariableHelpers.findPrefixesForMandatoryImportedVariables( instance )) { Collection<Import> imports = instance.getImports().get( facetOrComponentName ); if( impo...
[ "public", "static", "boolean", "hasAllRequiredImports", "(", "Instance", "instance", ",", "Logger", "logger", ")", "{", "boolean", "haveAllImports", "=", "true", ";", "for", "(", "String", "facetOrComponentName", ":", "VariableHelpers", ".", "findPrefixesForMandatoryI...
Determines whether an instance has all the imports it needs. <p> Master of Obvious said:<br> By definition, optional imports are not considered to be required. </p> @param instance a non-null instance @param logger a logger (can be null) @return true if all its (mandatory) imports are resolved, false otherwise
[ "Determines", "whether", "an", "instance", "has", "all", "the", "imports", "it", "needs", ".", "<p", ">", "Master", "of", "Obvious", "said", ":", "<br", ">", "By", "definition", "optional", "imports", "are", "not", "considered", "to", "be", "required", "."...
train
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/helpers/ImportHelpers.java#L65-L81
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/Runtime.java
Runtime.changedPropertyValue
public static void changedPropertyValue (String name, String value) { """ This method should be called each time a SIB property value is assigned a none default value. An informational message is output for serviceability reasons so that it is obvious that a property value has been changed. @param name the na...
java
public static void changedPropertyValue (String name, String value) { if (tc.isEntryEnabled()) SibTr.entry(tc, "changedPropertyValue"); if (value == null) value = "null"; // Ensure that the new value is non-null (here we're only using for a message insert) if (!value.equals(seenProperties.put(name,value))...
[ "public", "static", "void", "changedPropertyValue", "(", "String", "name", ",", "String", "value", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"changedPropertyValue\"", ")", ";", "if", "(", "v...
This method should be called each time a SIB property value is assigned a none default value. An informational message is output for serviceability reasons so that it is obvious that a property value has been changed. @param name the name of the property that has been changed @param value the new value assigned to the...
[ "This", "method", "should", "be", "called", "each", "time", "a", "SIB", "property", "value", "is", "assigned", "a", "none", "default", "value", ".", "An", "informational", "message", "is", "output", "for", "serviceability", "reasons", "so", "that", "it", "is...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/Runtime.java#L39-L51
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/ocnn/OCNNOutputLayer.java
OCNNOutputLayer.computeScore
@Override public double computeScore(double fullNetRegTerm, boolean training, LayerWorkspaceMgr workspaceMgr) { """ Compute score after labels and input have been set. @param fullNetRegTerm Regularization score term for the entire network @param training whether score should be calculated at train or test ti...
java
@Override public double computeScore(double fullNetRegTerm, boolean training, LayerWorkspaceMgr workspaceMgr) { if (input == null) throw new IllegalStateException("Cannot calculate score without input and labels " + layerId()); INDArray preOut = preOutput2d(training, workspaceMgr); ...
[ "@", "Override", "public", "double", "computeScore", "(", "double", "fullNetRegTerm", ",", "boolean", "training", ",", "LayerWorkspaceMgr", "workspaceMgr", ")", "{", "if", "(", "input", "==", "null", ")", "throw", "new", "IllegalStateException", "(", "\"Cannot cal...
Compute score after labels and input have been set. @param fullNetRegTerm Regularization score term for the entire network @param training whether score should be calculated at train or test time (this affects things like application of dropout, etc) @return score (loss function)
[ "Compute", "score", "after", "labels", "and", "input", "have", "been", "set", "." ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/ocnn/OCNNOutputLayer.java#L86-L102
google/error-prone
core/src/main/java/com/google/errorprone/bugpatterns/SelfAssignment.java
SelfAssignment.stripNullCheck
private static ExpressionTree stripNullCheck(ExpressionTree expression, VisitorState state) { """ If the given expression is a call to a method checking the nullity of its first parameter, and otherwise returns that parameter. """ if (expression != null && expression.getKind() == METHOD_INVOCATION) { ...
java
private static ExpressionTree stripNullCheck(ExpressionTree expression, VisitorState state) { if (expression != null && expression.getKind() == METHOD_INVOCATION) { MethodInvocationTree methodInvocation = (MethodInvocationTree) expression; if (NON_NULL_MATCHER.matches(methodInvocation, state)) { ...
[ "private", "static", "ExpressionTree", "stripNullCheck", "(", "ExpressionTree", "expression", ",", "VisitorState", "state", ")", "{", "if", "(", "expression", "!=", "null", "&&", "expression", ".", "getKind", "(", ")", "==", "METHOD_INVOCATION", ")", "{", "Metho...
If the given expression is a call to a method checking the nullity of its first parameter, and otherwise returns that parameter.
[ "If", "the", "given", "expression", "is", "a", "call", "to", "a", "method", "checking", "the", "nullity", "of", "its", "first", "parameter", "and", "otherwise", "returns", "that", "parameter", "." ]
train
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/SelfAssignment.java#L130-L138
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/JndiRepositoryFactory.java
JndiRepositoryFactory.getObjectInstance
@Override public Object getObjectInstance( Object obj, final Name name, final Context nameCtx, Hashtable<?, ?> environment ) throws IOException, SAXException, RepositoryException, NamingException {...
java
@Override public Object getObjectInstance( Object obj, final Name name, final Context nameCtx, Hashtable<?, ?> environment ) throws IOException, SAXException, RepositoryException, NamingException {...
[ "@", "Override", "public", "Object", "getObjectInstance", "(", "Object", "obj", ",", "final", "Name", "name", ",", "final", "Context", "nameCtx", ",", "Hashtable", "<", "?", ",", "?", ">", "environment", ")", "throws", "IOException", ",", "SAXException", ","...
Creates an {@code JcrRepository} or ModeShape engine using the reference information specified. <p> This method first attempts to convert the {@code obj} parameter into a {@link Reference reference to JNDI configuration information}. If that is successful, a {@link ModeShapeEngine} will be created (if not previously cr...
[ "Creates", "an", "{", "@code", "JcrRepository", "}", "or", "ModeShape", "engine", "using", "the", "reference", "information", "specified", ".", "<p", ">", "This", "method", "first", "attempts", "to", "convert", "the", "{", "@code", "obj", "}", "parameter", "...
train
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/JndiRepositoryFactory.java#L238-L270
gallandarakhneorg/afc
core/maths/mathgen/src/main/java/org/arakhne/afc/math/MathUtil.java
MathUtil.clampToNearestBounds
@Pure public static double clampToNearestBounds(double value, double minBounds, double maxBounds) { """ Replies the {@code value} clamped to the nearest bounds. If |{@code value}-{@code minBounds}| &gt; |{@code value}-{@code maxBounds}| then the returned value is {@code maxBounds}; otherwise it is {@code min...
java
@Pure public static double clampToNearestBounds(double value, double minBounds, double maxBounds) { assert minBounds <= maxBounds : AssertMessages.lowerEqualParameters(1, minBounds, 2, maxBounds); final double center = (minBounds + maxBounds) / 2; if (value <= center) { return minBounds; } return maxBound...
[ "@", "Pure", "public", "static", "double", "clampToNearestBounds", "(", "double", "value", ",", "double", "minBounds", ",", "double", "maxBounds", ")", "{", "assert", "minBounds", "<=", "maxBounds", ":", "AssertMessages", ".", "lowerEqualParameters", "(", "1", "...
Replies the {@code value} clamped to the nearest bounds. If |{@code value}-{@code minBounds}| &gt; |{@code value}-{@code maxBounds}| then the returned value is {@code maxBounds}; otherwise it is {@code minBounds}. @param value is the value to clamp. @param minBounds is the minimal allowed value. @param maxBounds is th...
[ "Replies", "the", "{", "@code", "value", "}", "clamped", "to", "the", "nearest", "bounds", ".", "If", "|", "{", "@code", "value", "}", "-", "{", "@code", "minBounds", "}", "|", "&gt", ";", "|", "{", "@code", "value", "}", "-", "{", "@code", "maxBou...
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgen/src/main/java/org/arakhne/afc/math/MathUtil.java#L463-L471
alibaba/canal
client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/bind/RelaxedDataBinder.java
RelaxedDataBinder.normalizePath
protected String normalizePath(BeanWrapper wrapper, String path) { """ Normalize a bean property path to a format understood by a BeanWrapper. This is used so that <ul> <li>Fuzzy matching can be employed for bean property names</li> <li>Period separators can be used instead of indexing ([...]) for map keys</l...
java
protected String normalizePath(BeanWrapper wrapper, String path) { return initializePath(wrapper, new RelaxedDataBinder.BeanPath(path), 0); }
[ "protected", "String", "normalizePath", "(", "BeanWrapper", "wrapper", ",", "String", "path", ")", "{", "return", "initializePath", "(", "wrapper", ",", "new", "RelaxedDataBinder", ".", "BeanPath", "(", "path", ")", ",", "0", ")", ";", "}" ]
Normalize a bean property path to a format understood by a BeanWrapper. This is used so that <ul> <li>Fuzzy matching can be employed for bean property names</li> <li>Period separators can be used instead of indexing ([...]) for map keys</li> </ul> @param wrapper a bean wrapper for the object to bind @param path the be...
[ "Normalize", "a", "bean", "property", "path", "to", "a", "format", "understood", "by", "a", "BeanWrapper", ".", "This", "is", "used", "so", "that", "<ul", ">", "<li", ">", "Fuzzy", "matching", "can", "be", "employed", "for", "bean", "property", "names<", ...
train
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/bind/RelaxedDataBinder.java#L239-L241
jayantk/jklol
src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java
HeadedSyntacticCategory.parseFrom
public static HeadedSyntacticCategory parseFrom(String typeString) { """ Parses a syntactic category with augmented semantic variable information from a category string. The expected format is identical to that for {@link SyntacticCategory}, except that each parenthesized or atomic element may be followed by a ...
java
public static HeadedSyntacticCategory parseFrom(String typeString) { // Strip variable numbers and features, without using // regular expressions for GWT compatibility. String syntacticString = stripBracketedExpression(typeString, "{", "}"); SyntacticCategory syntax = SyntacticCategory.parseFrom(synta...
[ "public", "static", "HeadedSyntacticCategory", "parseFrom", "(", "String", "typeString", ")", "{", "// Strip variable numbers and features, without using ", "// regular expressions for GWT compatibility.", "String", "syntacticString", "=", "stripBracketedExpression", "(", "typeString...
Parses a syntactic category with augmented semantic variable information from a category string. The expected format is identical to that for {@link SyntacticCategory}, except that each parenthesized or atomic element may be followed by a semantic variable number in curly braces ({}). All elements with the same number ...
[ "Parses", "a", "syntactic", "category", "with", "augmented", "semantic", "variable", "information", "from", "a", "category", "string", ".", "The", "expected", "format", "is", "identical", "to", "that", "for", "{", "@link", "SyntacticCategory", "}", "except", "th...
train
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java#L70-L81
fernandospr/java-wns
src/main/java/ar/com/fernandospr/wns/WnsService.java
WnsService.pushRaw
public WnsNotificationResponse pushRaw(String channelUri, WnsNotificationRequestOptional optional, WnsRaw raw) throws WnsException { """ Pushes a raw message to channelUri using optional headers @param channelUri @param optional @param raw which should be built with {@link ar.com.fernandospr.wns.model.builders....
java
public WnsNotificationResponse pushRaw(String channelUri, WnsNotificationRequestOptional optional, WnsRaw raw) throws WnsException { return this.client.push(rawResourceBuilder, channelUri, raw, this.retryPolicy, optional); }
[ "public", "WnsNotificationResponse", "pushRaw", "(", "String", "channelUri", ",", "WnsNotificationRequestOptional", "optional", ",", "WnsRaw", "raw", ")", "throws", "WnsException", "{", "return", "this", ".", "client", ".", "push", "(", "rawResourceBuilder", ",", "c...
Pushes a raw message to channelUri using optional headers @param channelUri @param optional @param raw which should be built with {@link ar.com.fernandospr.wns.model.builders.WnsRawBuilder} @return WnsNotificationResponse please see response headers from <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh4...
[ "Pushes", "a", "raw", "message", "to", "channelUri", "using", "optional", "headers" ]
train
https://github.com/fernandospr/java-wns/blob/cd621b9c17d1e706f6284e0913531d834904a90d/src/main/java/ar/com/fernandospr/wns/WnsService.java#L226-L228
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java
EvaluationUtils.falsePositiveRate
public static double falsePositiveRate(long fpCount, long tnCount, double edgeCase) { """ Calculate the false positive rate from the false positive count and true negative count @param fpCount False positive count @param tnCount True negative count @param edgeCase Edge case values are used to avoid 0/0 @re...
java
public static double falsePositiveRate(long fpCount, long tnCount, double edgeCase) { //Edge case if (fpCount == 0 && tnCount == 0) { return edgeCase; } return fpCount / (double) (fpCount + tnCount); }
[ "public", "static", "double", "falsePositiveRate", "(", "long", "fpCount", ",", "long", "tnCount", ",", "double", "edgeCase", ")", "{", "//Edge case", "if", "(", "fpCount", "==", "0", "&&", "tnCount", "==", "0", ")", "{", "return", "edgeCase", ";", "}", ...
Calculate the false positive rate from the false positive count and true negative count @param fpCount False positive count @param tnCount True negative count @param edgeCase Edge case values are used to avoid 0/0 @return False positive rate
[ "Calculate", "the", "false", "positive", "rate", "from", "the", "false", "positive", "count", "and", "true", "negative", "count" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java#L75-L81
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java
HttpChannelConfig.parseWriteTimeout
private void parseWriteTimeout(Map<Object, Object> props) { """ Check the input configuration for the timeout to use when writing data during the connection. @param props """ Object value = props.get(HttpConfigConstants.PROPNAME_WRITE_TIMEOUT); if (null != value) { try { ...
java
private void parseWriteTimeout(Map<Object, Object> props) { Object value = props.get(HttpConfigConstants.PROPNAME_WRITE_TIMEOUT); if (null != value) { try { this.writeTimeout = TIMEOUT_MODIFIER * minLimit(convertInteger(value), HttpConfigConstants.MIN_TIMEOUT); ...
[ "private", "void", "parseWriteTimeout", "(", "Map", "<", "Object", ",", "Object", ">", "props", ")", "{", "Object", "value", "=", "props", ".", "get", "(", "HttpConfigConstants", ".", "PROPNAME_WRITE_TIMEOUT", ")", ";", "if", "(", "null", "!=", "value", ")...
Check the input configuration for the timeout to use when writing data during the connection. @param props
[ "Check", "the", "input", "configuration", "for", "the", "timeout", "to", "use", "when", "writing", "data", "during", "the", "connection", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L681-L696
Bearded-Hen/Android-Bootstrap
AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapProgressBar.java
BootstrapProgressBar.createRoundedBitmap
private static Bitmap createRoundedBitmap(Bitmap bitmap, float cornerRadius, boolean roundRight, boolean roundLeft) { """ Creates a rounded bitmap with transparent corners, from a square bitmap. See <a href="http://stackoverflow.com/questions/4028270">StackOverflow</a> @param bitmap the original bitmap ...
java
private static Bitmap createRoundedBitmap(Bitmap bitmap, float cornerRadius, boolean roundRight, boolean roundLeft) { Bitmap roundedBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), ARGB_8888); Canvas canvas = new Canvas(roundedBitmap); final Paint paint = new Paint(); ...
[ "private", "static", "Bitmap", "createRoundedBitmap", "(", "Bitmap", "bitmap", ",", "float", "cornerRadius", ",", "boolean", "roundRight", ",", "boolean", "roundLeft", ")", "{", "Bitmap", "roundedBitmap", "=", "Bitmap", ".", "createBitmap", "(", "bitmap", ".", "...
Creates a rounded bitmap with transparent corners, from a square bitmap. See <a href="http://stackoverflow.com/questions/4028270">StackOverflow</a> @param bitmap the original bitmap @param cornerRadius the radius of the corners @param roundRight if you should round the corners on the right, note that if set to t...
[ "Creates", "a", "rounded", "bitmap", "with", "transparent", "corners", "from", "a", "square", "bitmap", ".", "See", "<a", "href", "=", "http", ":", "//", "stackoverflow", ".", "com", "/", "questions", "/", "4028270", ">", "StackOverflow<", "/", "a", ">" ]
train
https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapProgressBar.java#L413-L446
Azure/azure-sdk-for-java
sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java
DatabasesInner.resumeAsync
public Observable<Void> resumeAsync(String resourceGroupName, String serverName, String databaseName) { """ Resumes a data warehouse. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverNam...
java
public Observable<Void> resumeAsync(String resourceGroupName, String serverName, String databaseName) { return resumeWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> respo...
[ "public", "Observable", "<", "Void", ">", "resumeAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "databaseName", ")", "{", "return", "resumeWithServiceResponseAsync", "(", "resourceGroupName", ",", "serverName", ",", "databaseNa...
Resumes a data warehouse. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @param databaseName The name of the data warehouse to resume. @throws IllegalArgumentExcep...
[ "Resumes", "a", "data", "warehouse", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java#L364-L371
landawn/AbacusUtil
src/com/landawn/abacus/util/BooleanList.java
BooleanList.anyMatch
public <E extends Exception> boolean anyMatch(Try.BooleanPredicate<E> filter) throws E { """ Returns whether any elements of this List match the provided predicate. @param filter @return """ return anyMatch(0, size(), filter); }
java
public <E extends Exception> boolean anyMatch(Try.BooleanPredicate<E> filter) throws E { return anyMatch(0, size(), filter); }
[ "public", "<", "E", "extends", "Exception", ">", "boolean", "anyMatch", "(", "Try", ".", "BooleanPredicate", "<", "E", ">", "filter", ")", "throws", "E", "{", "return", "anyMatch", "(", "0", ",", "size", "(", ")", ",", "filter", ")", ";", "}" ]
Returns whether any elements of this List match the provided predicate. @param filter @return
[ "Returns", "whether", "any", "elements", "of", "this", "List", "match", "the", "provided", "predicate", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/BooleanList.java#L865-L867
ineunetOS/knife-commons
knife-commons-utils/src/main/java/com/ineunet/knife/util/validation/WebValidatorRestrictor.java
WebValidatorRestrictor.notBlankSpace
public static WebValidator notBlankSpace(String propertyName, String propertyValue) { """ 验证不能为纯空格,但是不做为空校验. Validate not all spaces. @param propertyName @param propertyValue @since 2.0.1 """ WebValidator valid; if (StringUtils.isEmpty(propertyValue) || propertyValue.trim().length() != 0) { valid = n...
java
public static WebValidator notBlankSpace(String propertyName, String propertyValue) { WebValidator valid; if (StringUtils.isEmpty(propertyValue) || propertyValue.trim().length() != 0) { valid = new WebValidator(true, ""); } else { valid = new WebValidator(false, propertyName + "不能为纯空格"); } return valid;...
[ "public", "static", "WebValidator", "notBlankSpace", "(", "String", "propertyName", ",", "String", "propertyValue", ")", "{", "WebValidator", "valid", ";", "if", "(", "StringUtils", ".", "isEmpty", "(", "propertyValue", ")", "||", "propertyValue", ".", "trim", "...
验证不能为纯空格,但是不做为空校验. Validate not all spaces. @param propertyName @param propertyValue @since 2.0.1
[ "验证不能为纯空格,但是不做为空校验", ".", "Validate", "not", "all", "spaces", "." ]
train
https://github.com/ineunetOS/knife-commons/blob/eae9e59afa020a00ae8977c10d43ac8ae46ae236/knife-commons-utils/src/main/java/com/ineunet/knife/util/validation/WebValidatorRestrictor.java#L57-L65
arnaudroger/SimpleFlatMapper
sfm-jdbc/src/main/java/org/simpleflatmapper/jdbc/DiscriminatorJdbcBuilder.java
DiscriminatorJdbcBuilder.when
public DiscriminatorJdbcSubBuilder when(String value, Class<? extends T> type) { """ Add a discriminator value with its associated class. @param value the value @param type the class @return the current builder """ return when(value, (Type)type); }
java
public DiscriminatorJdbcSubBuilder when(String value, Class<? extends T> type) { return when(value, (Type)type); }
[ "public", "DiscriminatorJdbcSubBuilder", "when", "(", "String", "value", ",", "Class", "<", "?", "extends", "T", ">", "type", ")", "{", "return", "when", "(", "value", ",", "(", "Type", ")", "type", ")", ";", "}" ]
Add a discriminator value with its associated class. @param value the value @param type the class @return the current builder
[ "Add", "a", "discriminator", "value", "with", "its", "associated", "class", "." ]
train
https://github.com/arnaudroger/SimpleFlatMapper/blob/93435438c18f26c87963d5e0f3ebf0f264dcd8c2/sfm-jdbc/src/main/java/org/simpleflatmapper/jdbc/DiscriminatorJdbcBuilder.java#L67-L69
gallandarakhneorg/afc
core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java
XMLUtil.readXMLFragment
public static DocumentFragment readXMLFragment(URL file, boolean skipRoot) throws IOException, SAXException, ParserConfigurationException { """ Read an XML fragment from an XML file. The XML file is well-formed. It means that the fragment will contains a single element: the root element within the input file....
java
public static DocumentFragment readXMLFragment(URL file, boolean skipRoot) throws IOException, SAXException, ParserConfigurationException { assert file != null : AssertMessages.notNullParameter(); return readXMLFragment(file.openStream(), skipRoot); }
[ "public", "static", "DocumentFragment", "readXMLFragment", "(", "URL", "file", ",", "boolean", "skipRoot", ")", "throws", "IOException", ",", "SAXException", ",", "ParserConfigurationException", "{", "assert", "file", "!=", "null", ":", "AssertMessages", ".", "notNu...
Read an XML fragment from an XML file. The XML file is well-formed. It means that the fragment will contains a single element: the root element within the input file. @param file is the file to read @param skipRoot if {@code true} the root element itself is not part of the fragment, and the children of the root elemen...
[ "Read", "an", "XML", "fragment", "from", "an", "XML", "file", ".", "The", "XML", "file", "is", "well", "-", "formed", ".", "It", "means", "that", "the", "fragment", "will", "contains", "a", "single", "element", ":", "the", "root", "element", "within", ...
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L2154-L2158
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/Unjitable.java
Unjitable.visitCode
@Override public void visitCode(Code obj) { """ implements the visitor to look at the size of the method. static initializer are ignored as these will only be executed once anyway. @param obj the context object of the currently parsed method """ Method m = getMethod(); if ((!m.isStatic...
java
@Override public void visitCode(Code obj) { Method m = getMethod(); if ((!m.isStatic() || !Values.STATIC_INITIALIZER.equals(m.getName())) && (!m.getName().contains("enum constant"))) { // a findbugs thing!! byte[] code = obj.getCode(); if (code.length >= UNJITABLE_CODE_LENGT...
[ "@", "Override", "public", "void", "visitCode", "(", "Code", "obj", ")", "{", "Method", "m", "=", "getMethod", "(", ")", ";", "if", "(", "(", "!", "m", ".", "isStatic", "(", ")", "||", "!", "Values", ".", "STATIC_INITIALIZER", ".", "equals", "(", "...
implements the visitor to look at the size of the method. static initializer are ignored as these will only be executed once anyway. @param obj the context object of the currently parsed method
[ "implements", "the", "visitor", "to", "look", "at", "the", "size", "of", "the", "method", ".", "static", "initializer", "are", "ignored", "as", "these", "will", "only", "be", "executed", "once", "anyway", "." ]
train
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/Unjitable.java#L65-L76
pip-services3-java/pip-services3-commons-java
src/org/pipservices3/commons/reflect/RecursiveObjectWriter.java
RecursiveObjectWriter.copyProperties
public static void copyProperties(Object dest, Object src) { """ Copies content of one object to another object by recursively reading all properties from source object and then recursively writing them to destination object. @param dest a destination object to write properties to. @param src a source objec...
java
public static void copyProperties(Object dest, Object src) { if (dest == null || src == null) return; Map<String, Object> values = RecursiveObjectReader.getProperties(src); setProperties(dest, values); }
[ "public", "static", "void", "copyProperties", "(", "Object", "dest", ",", "Object", "src", ")", "{", "if", "(", "dest", "==", "null", "||", "src", "==", "null", ")", "return", ";", "Map", "<", "String", ",", "Object", ">", "values", "=", "RecursiveObje...
Copies content of one object to another object by recursively reading all properties from source object and then recursively writing them to destination object. @param dest a destination object to write properties to. @param src a source object to read properties from
[ "Copies", "content", "of", "one", "object", "to", "another", "object", "by", "recursively", "reading", "all", "properties", "from", "source", "object", "and", "then", "recursively", "writing", "them", "to", "destination", "object", "." ]
train
https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/reflect/RecursiveObjectWriter.java#L95-L101
xhsun/gw2wrapper
src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java
AsynchronousRequest.getPvPRankInfo
public void getPvPRankInfo(int[] ids, Callback<List<PvPRank>> callback) throws GuildWars2Exception, NullPointerException { """ For more info on pvp ranks API go <a href="https://wiki.guildwars2.com/wiki/API:2/pvp/ranks">here</a><br/> Give user the access to {@link Callback#onResponse(Call, Response)} and {@link C...
java
public void getPvPRankInfo(int[] ids, Callback<List<PvPRank>> callback) throws GuildWars2Exception, NullPointerException { isParamValid(new ParamChecker(ids)); gw2API.getPvPRankInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); }
[ "public", "void", "getPvPRankInfo", "(", "int", "[", "]", "ids", ",", "Callback", "<", "List", "<", "PvPRank", ">", ">", "callback", ")", "throws", "GuildWars2Exception", ",", "NullPointerException", "{", "isParamValid", "(", "new", "ParamChecker", "(", "ids",...
For more info on pvp ranks API go <a href="https://wiki.guildwars2.com/wiki/API:2/pvp/ranks">here</a><br/> Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions @param ids list of PvP rank id @param callback callback tha...
[ "For", "more", "info", "on", "pvp", "ranks", "API", "go", "<a", "href", "=", "https", ":", "//", "wiki", ".", "guildwars2", ".", "com", "/", "wiki", "/", "API", ":", "2", "/", "pvp", "/", "ranks", ">", "here<", "/", "a", ">", "<br", "/", ">", ...
train
https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L2112-L2115
b3dgs/lionengine
lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/LevelRipConverter.java
LevelRipConverter.checkTile
private static Tile checkTile(MapTile map, ImageBuffer tileSprite, Integer sheet, int x, int y) { """ Check tile of sheet. @param map The destination map reference. @param tileSprite The tiled sprite @param sheet The sheet number. @param x The location x. @param y The location y. @return The tile found. ...
java
private static Tile checkTile(MapTile map, ImageBuffer tileSprite, Integer sheet, int x, int y) { final int tw = map.getTileWidth(); final int th = map.getTileHeight(); final SpriteTiled tileSheet = map.getSheet(sheet); final ImageBuffer sheetImage = tileSheet.getSurface(); f...
[ "private", "static", "Tile", "checkTile", "(", "MapTile", "map", ",", "ImageBuffer", "tileSprite", ",", "Integer", "sheet", ",", "int", "x", ",", "int", "y", ")", "{", "final", "int", "tw", "=", "map", ".", "getTileWidth", "(", ")", ";", "final", "int"...
Check tile of sheet. @param map The destination map reference. @param tileSprite The tiled sprite @param sheet The sheet number. @param x The location x. @param y The location y. @return The tile found.
[ "Check", "tile", "of", "sheet", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/LevelRipConverter.java#L182-L211
haifengl/smile
core/src/main/java/smile/association/ARM.java
ARM.learn
private long learn(PrintStream out, List<AssociationRule> list, int[] itemset, int size, Node node, double confidence) { """ Generates association rules from a T-tree. @param itemset the label for a T-tree node as generated sofar. @param size the size of the current array level in the T-tree. @param node the cu...
java
private long learn(PrintStream out, List<AssociationRule> list, int[] itemset, int size, Node node, double confidence) { long n = 0; if (node.children == null) { return n; } for (int i = 0; i < size; i++) { if (node.children[i] != null) { int[] ne...
[ "private", "long", "learn", "(", "PrintStream", "out", ",", "List", "<", "AssociationRule", ">", "list", ",", "int", "[", "]", "itemset", ",", "int", "size", ",", "Node", "node", ",", "double", "confidence", ")", "{", "long", "n", "=", "0", ";", "if"...
Generates association rules from a T-tree. @param itemset the label for a T-tree node as generated sofar. @param size the size of the current array level in the T-tree. @param node the current node in the T-tree. @param confidence the confidence threshold for association rules.
[ "Generates", "association", "rules", "from", "a", "T", "-", "tree", "." ]
train
https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/association/ARM.java#L146-L163
UrielCh/ovh-java-sdk
ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java
ApiOvhOrder.dedicated_server_serviceName_staticIP_GET
public ArrayList<String> dedicated_server_serviceName_staticIP_GET(String serviceName, OvhIpStaticCountryEnum country) throws IOException { """ Get allowed durations for 'staticIP' option REST: GET /order/dedicated/server/{serviceName}/staticIP @param country [required] Ip localization @param serviceName [req...
java
public ArrayList<String> dedicated_server_serviceName_staticIP_GET(String serviceName, OvhIpStaticCountryEnum country) throws IOException { String qPath = "/order/dedicated/server/{serviceName}/staticIP"; StringBuilder sb = path(qPath, serviceName); query(sb, "country", country); String resp = exec(qPath, "GET"...
[ "public", "ArrayList", "<", "String", ">", "dedicated_server_serviceName_staticIP_GET", "(", "String", "serviceName", ",", "OvhIpStaticCountryEnum", "country", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/order/dedicated/server/{serviceName}/staticIP\"", ";"...
Get allowed durations for 'staticIP' option REST: GET /order/dedicated/server/{serviceName}/staticIP @param country [required] Ip localization @param serviceName [required] The internal name of your dedicated server
[ "Get", "allowed", "durations", "for", "staticIP", "option" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L2322-L2328
taskadapter/trello-java-wrapper
src/main/java/com/julienvey/trello/utils/IOUtils.java
IOUtils.copyTo
public static void copyTo(InputStream in, OutputStream out) throws IOException { """ Copies all remaining bytes from {@code in} to {@code out}. The {@code out} will be flushed. <p> Note that method does not make any buffering, so caller must ensure that streams are buffered if needed. @param in The input sou...
java
public static void copyTo(InputStream in, OutputStream out) throws IOException { Objects.requireNonNull(in); Objects.requireNonNull(out); int r; while ((r = in.read()) != -1) { out.write(r); } out.flush(); }
[ "public", "static", "void", "copyTo", "(", "InputStream", "in", ",", "OutputStream", "out", ")", "throws", "IOException", "{", "Objects", ".", "requireNonNull", "(", "in", ")", ";", "Objects", ".", "requireNonNull", "(", "out", ")", ";", "int", "r", ";", ...
Copies all remaining bytes from {@code in} to {@code out}. The {@code out} will be flushed. <p> Note that method does not make any buffering, so caller must ensure that streams are buffered if needed. @param in The input source. @param out The output destination. @throws IOException When any I/O error occurred.
[ "Copies", "all", "remaining", "bytes", "from", "{", "@code", "in", "}", "to", "{", "@code", "out", "}", ".", "The", "{", "@code", "out", "}", "will", "be", "flushed", ".", "<p", ">", "Note", "that", "method", "does", "not", "make", "any", "buffering"...
train
https://github.com/taskadapter/trello-java-wrapper/blob/70d57a890e54307eab81659a3d420d05ea48bd5d/src/main/java/com/julienvey/trello/utils/IOUtils.java#L28-L38
jMotif/GI
src/main/java/net/seninp/gi/sequitur/SequiturFactory.java
SequiturFactory.runSequitur
public static SAXRule runSequitur(String inputString) throws Exception { """ Digests a string of terminals separated by a space. @param inputString the string to digest. @return The top rule handler (i.e. R0). @throws Exception if error occurs. """ LOGGER.trace("digesting the string " + inputString...
java
public static SAXRule runSequitur(String inputString) throws Exception { LOGGER.trace("digesting the string " + inputString); // clear global collections // SAXRule.numRules = new AtomicInteger(0); SAXRule.theRules.clear(); SAXSymbol.theDigrams.clear(); SAXSymbol.theSubstituteTable.clear()...
[ "public", "static", "SAXRule", "runSequitur", "(", "String", "inputString", ")", "throws", "Exception", "{", "LOGGER", ".", "trace", "(", "\"digesting the string \"", "+", "inputString", ")", ";", "// clear global collections", "//", "SAXRule", ".", "numRules", "=",...
Digests a string of terminals separated by a space. @param inputString the string to digest. @return The top rule handler (i.e. R0). @throws Exception if error occurs.
[ "Digests", "a", "string", "of", "terminals", "separated", "by", "a", "space", "." ]
train
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/sequitur/SequiturFactory.java#L49-L97
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/collection/InternalSetMultimap.java
InternalSetMultimap.put
public void put(K key, V value) { """ Associate value to a given key. It has no effect if the value is already associated with the key. @param key @param value """ checkNotNull(key, "Key cannot be null"); checkNotNull(value, "Value cannot be null"); Set<V> values = backingMap.get(k...
java
public void put(K key, V value) { checkNotNull(key, "Key cannot be null"); checkNotNull(value, "Value cannot be null"); Set<V> values = backingMap.get(key); if (values == null) { values = new HashSet<V>(); backingMap.put(key, values); } values.add...
[ "public", "void", "put", "(", "K", "key", ",", "V", "value", ")", "{", "checkNotNull", "(", "key", ",", "\"Key cannot be null\"", ")", ";", "checkNotNull", "(", "value", ",", "\"Value cannot be null\"", ")", ";", "Set", "<", "V", ">", "values", "=", "bac...
Associate value to a given key. It has no effect if the value is already associated with the key. @param key @param value
[ "Associate", "value", "to", "a", "given", "key", ".", "It", "has", "no", "effect", "if", "the", "value", "is", "already", "associated", "with", "the", "key", "." ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/collection/InternalSetMultimap.java#L51-L61
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java
Frame.setValue
public void setValue(int n, ValueType value) { """ Set the value at the <i>n</i>th slot. @param n the slot in which to set a new value @param value the value to set """ if (VERIFY_INTEGRITY && value == null) { throw new IllegalArgumentException(); } if (!isValid()) { ...
java
public void setValue(int n, ValueType value) { if (VERIFY_INTEGRITY && value == null) { throw new IllegalArgumentException(); } if (!isValid()) { throw new IllegalStateException("accessing top or bottom frame"); } slotList.set(n, value); }
[ "public", "void", "setValue", "(", "int", "n", ",", "ValueType", "value", ")", "{", "if", "(", "VERIFY_INTEGRITY", "&&", "value", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "if", "(", "!", "isValid", "(", ")...
Set the value at the <i>n</i>th slot. @param n the slot in which to set a new value @param value the value to set
[ "Set", "the", "value", "at", "the", "<i", ">", "n<", "/", "i", ">", "th", "slot", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java#L552-L560
JoeKerouac/utils
src/main/java/com/joe/utils/secure/impl/SignatureUtilImpl.java
SignatureUtilImpl.buildSignatureHolder
private static SignatureHolder buildSignatureHolder(String privateKey, String publicKey, Algorithms algorithms) { """ 使用指定公钥和RSA加密类型获取RSA验证器 @param privateKey PKCS8文件格式的私钥 @param publicKey X509格式的公钥 @param algorithms RSA加密类型 @return RSA验证器 """ ...
java
private static SignatureHolder buildSignatureHolder(String privateKey, String publicKey, Algorithms algorithms) { log.debug("构建SignatureHolder"); try { log.debug("构建公钥以及验签器"); RSAPublicKey pubKey = (RSAPublicKey) KeyTools.ge...
[ "private", "static", "SignatureHolder", "buildSignatureHolder", "(", "String", "privateKey", ",", "String", "publicKey", ",", "Algorithms", "algorithms", ")", "{", "log", ".", "debug", "(", "\"构建SignatureHolder\");", "", "", "try", "{", "log", ".", "debug", "(",...
使用指定公钥和RSA加密类型获取RSA验证器 @param privateKey PKCS8文件格式的私钥 @param publicKey X509格式的公钥 @param algorithms RSA加密类型 @return RSA验证器
[ "使用指定公钥和RSA加密类型获取RSA验证器" ]
train
https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/secure/impl/SignatureUtilImpl.java#L138-L159
belaban/JGroups
src/org/jgroups/protocols/FRAG.java
FRAG.unfragment
private Message unfragment(Message msg, FragHeader hdr) { """ 1. Get all the fragment buffers 2. When all are received -> Assemble them into one big buffer 3. Read headers and byte buffer from big buffer 4. Set headers and buffer in msg 5. Pass msg up the stack """ Address sender=msg.get...
java
private Message unfragment(Message msg, FragHeader hdr) { Address sender=msg.getSrc(); FragmentationTable frag_table=fragment_list.get(sender); if(frag_table == null) { frag_table=new FragmentationTable(sender); try { fragment_list.add(sender, f...
[ "private", "Message", "unfragment", "(", "Message", "msg", ",", "FragHeader", "hdr", ")", "{", "Address", "sender", "=", "msg", ".", "getSrc", "(", ")", ";", "FragmentationTable", "frag_table", "=", "fragment_list", ".", "get", "(", "sender", ")", ";", "if...
1. Get all the fragment buffers 2. When all are received -> Assemble them into one big buffer 3. Read headers and byte buffer from big buffer 4. Set headers and buffer in msg 5. Pass msg up the stack
[ "1", ".", "Get", "all", "the", "fragment", "buffers", "2", ".", "When", "all", "are", "received", "-", ">", "Assemble", "them", "into", "one", "big", "buffer", "3", ".", "Read", "headers", "and", "byte", "buffer", "from", "big", "buffer", "4", ".", "...
train
https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/protocols/FRAG.java#L234-L264
alexcojocaru/elasticsearch-maven-plugin
src/main/java/com/github/alexcojocaru/mojo/elasticsearch/v2/util/FilesystemUtil.java
FilesystemUtil.copyRecursively
public static void copyRecursively(Path source, Path destination) throws IOException { """ Copy a directory recursively, preserving attributes, in particular permissions. """ if (Files.isDirectory(source)) { Files.createDirectories(destination); final Set<Path> sources =...
java
public static void copyRecursively(Path source, Path destination) throws IOException { if (Files.isDirectory(source)) { Files.createDirectories(destination); final Set<Path> sources = listFiles(source); for (Path srcFile : sources) { Path ...
[ "public", "static", "void", "copyRecursively", "(", "Path", "source", ",", "Path", "destination", ")", "throws", "IOException", "{", "if", "(", "Files", ".", "isDirectory", "(", "source", ")", ")", "{", "Files", ".", "createDirectories", "(", "destination", ...
Copy a directory recursively, preserving attributes, in particular permissions.
[ "Copy", "a", "directory", "recursively", "preserving", "attributes", "in", "particular", "permissions", "." ]
train
https://github.com/alexcojocaru/elasticsearch-maven-plugin/blob/c283053cf99dc6b6d411b58629364b6aae62b7f8/src/main/java/com/github/alexcojocaru/mojo/elasticsearch/v2/util/FilesystemUtil.java#L53-L69
mikepenz/FastAdapter
library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/ActionModeHelper.java
ActionModeHelper.checkActionMode
public ActionMode checkActionMode(AppCompatActivity act) { """ check if the ActionMode should be shown or not depending on the currently selected items Additionally, it will also update the title in the CAB for you @param act the current Activity @return the initialized ActionMode or null if no ActionMode is ...
java
public ActionMode checkActionMode(AppCompatActivity act) { int selected = mSelectExtension.getSelectedItems().size(); return checkActionMode(act, selected); }
[ "public", "ActionMode", "checkActionMode", "(", "AppCompatActivity", "act", ")", "{", "int", "selected", "=", "mSelectExtension", ".", "getSelectedItems", "(", ")", ".", "size", "(", ")", ";", "return", "checkActionMode", "(", "act", ",", "selected", ")", ";",...
check if the ActionMode should be shown or not depending on the currently selected items Additionally, it will also update the title in the CAB for you @param act the current Activity @return the initialized ActionMode or null if no ActionMode is active after calling this function
[ "check", "if", "the", "ActionMode", "should", "be", "shown", "or", "not", "depending", "on", "the", "currently", "selected", "items", "Additionally", "it", "will", "also", "update", "the", "title", "in", "the", "CAB", "for", "you" ]
train
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/ActionModeHelper.java#L167-L170
OpenLiberty/open-liberty
dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/modelresolver/impl/AbstractPropertyResolver.java
AbstractPropertyResolver.substituteProperties
public B substituteProperties(final B b, final Properties submittedProps) { """ /* Convenience method that is the same as calling substituteProperties(job, submittedProps, null) """ return this.substituteProperties(b, submittedProps, null); }
java
public B substituteProperties(final B b, final Properties submittedProps) { return this.substituteProperties(b, submittedProps, null); }
[ "public", "B", "substituteProperties", "(", "final", "B", "b", ",", "final", "Properties", "submittedProps", ")", "{", "return", "this", ".", "substituteProperties", "(", "b", ",", "submittedProps", ",", "null", ")", ";", "}" ]
/* Convenience method that is the same as calling substituteProperties(job, submittedProps, null)
[ "/", "*", "Convenience", "method", "that", "is", "the", "same", "as", "calling", "substituteProperties", "(", "job", "submittedProps", "null", ")" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/modelresolver/impl/AbstractPropertyResolver.java#L50-L54
canoo/dolphin-platform
platform/dolphin-platform-core/src/main/java/com/canoo/dp/impl/platform/core/Assert.java
Assert.requireNonBlank
public static String requireNonBlank(final String str, final String argumentName) { """ Checks that the specified {@code str} {@code blank}, throws {@link IllegalArgumentException} with a customized error message if it is. @param str the value to be checked. @param argumentName the name of the argumen...
java
public static String requireNonBlank(final String str, final String argumentName) { requireNonNull(str, argumentName); if (isBlank(str)) { throw new IllegalArgumentException(String.format(NOT_EMPTY_MSG_FORMAT, argumentName)); } return str; }
[ "public", "static", "String", "requireNonBlank", "(", "final", "String", "str", ",", "final", "String", "argumentName", ")", "{", "requireNonNull", "(", "str", ",", "argumentName", ")", ";", "if", "(", "isBlank", "(", "str", ")", ")", "{", "throw", "new", ...
Checks that the specified {@code str} {@code blank}, throws {@link IllegalArgumentException} with a customized error message if it is. @param str the value to be checked. @param argumentName the name of the argument to be used in the error message. @return the {@code str}. @throws java.lang.NullPointerExcepti...
[ "Checks", "that", "the", "specified", "{", "@code", "str", "}", "{", "@code", "blank", "}", "throws", "{", "@link", "IllegalArgumentException", "}", "with", "a", "customized", "error", "message", "if", "it", "is", "." ]
train
https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-core/src/main/java/com/canoo/dp/impl/platform/core/Assert.java#L65-L71
amigold/FunDapter
library/src/com/ami/fundapter/FunDapter.java
FunDapter.initFilter
public void initFilter(FunDapterFilter<T> filter) { """ Use this method to enable filtering in the adapter. @param filter - a filter implementation for your adapter. """ if (filter == null) throw new IllegalArgumentException("Cannot pass a null filter to FunDapter"); this.funDa...
java
public void initFilter(FunDapterFilter<T> filter) { if (filter == null) throw new IllegalArgumentException("Cannot pass a null filter to FunDapter"); this.funDapterFilter = filter; mFilter = new Filter() { @Override protected void publishResults(CharSequen...
[ "public", "void", "initFilter", "(", "FunDapterFilter", "<", "T", ">", "filter", ")", "{", "if", "(", "filter", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"Cannot pass a null filter to FunDapter\"", ")", ";", "this", ".", "funDapterFilte...
Use this method to enable filtering in the adapter. @param filter - a filter implementation for your adapter.
[ "Use", "this", "method", "to", "enable", "filtering", "in", "the", "adapter", "." ]
train
https://github.com/amigold/FunDapter/blob/fb33241f265901d73276608689077d4310278eaf/library/src/com/ami/fundapter/FunDapter.java#L182-L228
apache/groovy
src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java
IOGroovyMethods.newObjectInputStream
public static ObjectInputStream newObjectInputStream(InputStream inputStream, final ClassLoader classLoader) throws IOException { """ Create an object input stream for this input stream using the given class loader. @param inputStream an input stream @param classLoader the class loader to use when loading the ...
java
public static ObjectInputStream newObjectInputStream(InputStream inputStream, final ClassLoader classLoader) throws IOException { return new ObjectInputStream(inputStream) { protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { return Cl...
[ "public", "static", "ObjectInputStream", "newObjectInputStream", "(", "InputStream", "inputStream", ",", "final", "ClassLoader", "classLoader", ")", "throws", "IOException", "{", "return", "new", "ObjectInputStream", "(", "inputStream", ")", "{", "protected", "Class", ...
Create an object input stream for this input stream using the given class loader. @param inputStream an input stream @param classLoader the class loader to use when loading the class @return an object input stream @throws IOException if an IOException occurs. @since 1.5.0
[ "Create", "an", "object", "input", "stream", "for", "this", "input", "stream", "using", "the", "given", "class", "loader", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java#L280-L287
killbill/killbill
invoice/src/main/java/org/killbill/billing/invoice/generator/DefaultInvoiceGenerator.java
DefaultInvoiceGenerator.generateInvoice
@Override public InvoiceWithMetadata generateInvoice(final ImmutableAccountData account, @Nullable final BillingEventSet events, @Nullable final Iterable<Invoice> existingInvoices, ...
java
@Override public InvoiceWithMetadata generateInvoice(final ImmutableAccountData account, @Nullable final BillingEventSet events, @Nullable final Iterable<Invoice> existingInvoices, ...
[ "@", "Override", "public", "InvoiceWithMetadata", "generateInvoice", "(", "final", "ImmutableAccountData", "account", ",", "@", "Nullable", "final", "BillingEventSet", "events", ",", "@", "Nullable", "final", "Iterable", "<", "Invoice", ">", "existingInvoices", ",", ...
/* adjusts target date to the maximum invoice target date, if future invoices exist
[ "/", "*", "adjusts", "target", "date", "to", "the", "maximum", "invoice", "target", "date", "if", "future", "invoices", "exist" ]
train
https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/invoice/src/main/java/org/killbill/billing/invoice/generator/DefaultInvoiceGenerator.java#L72-L115
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/stat/gslb/gslbservice_stats.java
gslbservice_stats.get
public static gslbservice_stats get(nitro_service service, String servicename) throws Exception { """ Use this API to fetch statistics of gslbservice_stats resource of given name . """ gslbservice_stats obj = new gslbservice_stats(); obj.set_servicename(servicename); gslbservice_stats response = (gslbser...
java
public static gslbservice_stats get(nitro_service service, String servicename) throws Exception{ gslbservice_stats obj = new gslbservice_stats(); obj.set_servicename(servicename); gslbservice_stats response = (gslbservice_stats) obj.stat_resource(service); return response; }
[ "public", "static", "gslbservice_stats", "get", "(", "nitro_service", "service", ",", "String", "servicename", ")", "throws", "Exception", "{", "gslbservice_stats", "obj", "=", "new", "gslbservice_stats", "(", ")", ";", "obj", ".", "set_servicename", "(", "service...
Use this API to fetch statistics of gslbservice_stats resource of given name .
[ "Use", "this", "API", "to", "fetch", "statistics", "of", "gslbservice_stats", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/gslb/gslbservice_stats.java#L309-L314
tvesalainen/util
util/src/main/java/org/vesalainen/lang/Primitives.java
Primitives.parseBoolean
public static final boolean parseBoolean(CharSequence cs, int radix, int beginIndex, int endIndex) { """ Parses the char sequence argument as a boolean. The boolean returned represents the value true if the char sequence argument is not null and it's digit value is 1. @param cs @param radix Must be 2. @param ...
java
public static final boolean parseBoolean(CharSequence cs, int radix, int beginIndex, int endIndex) { if (radix != 2) { throw new IllegalArgumentException("radix must be 2"); } if (Character.codePointCount(cs, beginIndex, endIndex) != 1) { throw...
[ "public", "static", "final", "boolean", "parseBoolean", "(", "CharSequence", "cs", ",", "int", "radix", ",", "int", "beginIndex", ",", "int", "endIndex", ")", "{", "if", "(", "radix", "!=", "2", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\...
Parses the char sequence argument as a boolean. The boolean returned represents the value true if the char sequence argument is not null and it's digit value is 1. @param cs @param radix Must be 2. @param beginIndex the index to the first char of the text range. @param endIndex the index after the last char of the text...
[ "Parses", "the", "char", "sequence", "argument", "as", "a", "boolean", ".", "The", "boolean", "returned", "represents", "the", "value", "true", "if", "the", "char", "sequence", "argument", "is", "not", "null", "and", "it", "s", "digit", "value", "is", "1",...
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/lang/Primitives.java#L543-L563
knightliao/disconf
disconf-core/src/main/java/com/baidu/disconf/core/common/zookeeper/inner/ConnectionWatcher.java
ConnectionWatcher.connect
public void connect(String hosts) throws IOException, InterruptedException { """ @param hosts @return void @throws IOException @throws InterruptedException @Description: 连接ZK @author liaoqiqi @date 2013-6-14 """ internalHost = hosts; zk = new ZooKeeper(internalHost, SESSION_TIMEOUT, t...
java
public void connect(String hosts) throws IOException, InterruptedException { internalHost = hosts; zk = new ZooKeeper(internalHost, SESSION_TIMEOUT, this); // 连接有超时哦 connectedSignal.await(CONNECT_TIMEOUT, TimeUnit.MILLISECONDS); LOGGER.info("zookeeper: " + hosts + " , connected...
[ "public", "void", "connect", "(", "String", "hosts", ")", "throws", "IOException", ",", "InterruptedException", "{", "internalHost", "=", "hosts", ";", "zk", "=", "new", "ZooKeeper", "(", "internalHost", ",", "SESSION_TIMEOUT", ",", "this", ")", ";", "// 连接有超时...
@param hosts @return void @throws IOException @throws InterruptedException @Description: 连接ZK @author liaoqiqi @date 2013-6-14
[ "@param", "hosts" ]
train
https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-core/src/main/java/com/baidu/disconf/core/common/zookeeper/inner/ConnectionWatcher.java#L56-L64
jmxtrans/embedded-jmxtrans
src/main/java/org/jmxtrans/embedded/util/pool/SocketWriterPoolFactory.java
SocketWriterPoolFactory.validateObject
@Override public boolean validateObject(HostAndPort hostAndPort, PooledObject<SocketWriter> socketWriterRef) { """ Defensive approach: we test all the "<code>Socket.isXXX()</code>" flags. """ Socket socket = socketWriterRef.getObject().getSocket(); return socket.isConnected() ...
java
@Override public boolean validateObject(HostAndPort hostAndPort, PooledObject<SocketWriter> socketWriterRef) { Socket socket = socketWriterRef.getObject().getSocket(); return socket.isConnected() && socket.isBound() && !socket.isClosed() && !socket.isI...
[ "@", "Override", "public", "boolean", "validateObject", "(", "HostAndPort", "hostAndPort", ",", "PooledObject", "<", "SocketWriter", ">", "socketWriterRef", ")", "{", "Socket", "socket", "=", "socketWriterRef", ".", "getObject", "(", ")", ".", "getSocket", "(", ...
Defensive approach: we test all the "<code>Socket.isXXX()</code>" flags.
[ "Defensive", "approach", ":", "we", "test", "all", "the", "<code", ">", "Socket", ".", "isXXX", "()", "<", "/", "code", ">", "flags", "." ]
train
https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/util/pool/SocketWriterPoolFactory.java#L98-L106
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java
ImageModerationsImpl.oCRMethod
public OCR oCRMethod(String language, OCRMethodOptionalParameter oCRMethodOptionalParameter) { """ Returns any text found in the image for the language specified. If no language is specified in input then the detection defaults to English. @param language Language of the terms. @param oCRMethodOptionalParamete...
java
public OCR oCRMethod(String language, OCRMethodOptionalParameter oCRMethodOptionalParameter) { return oCRMethodWithServiceResponseAsync(language, oCRMethodOptionalParameter).toBlocking().single().body(); }
[ "public", "OCR", "oCRMethod", "(", "String", "language", ",", "OCRMethodOptionalParameter", "oCRMethodOptionalParameter", ")", "{", "return", "oCRMethodWithServiceResponseAsync", "(", "language", ",", "oCRMethodOptionalParameter", ")", ".", "toBlocking", "(", ")", ".", ...
Returns any text found in the image for the language specified. If no language is specified in input then the detection defaults to English. @param language Language of the terms. @param oCRMethodOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgument...
[ "Returns", "any", "text", "found", "in", "the", "image", "for", "the", "language", "specified", ".", "If", "no", "language", "is", "specified", "in", "input", "then", "the", "detection", "defaults", "to", "English", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java#L270-L272
dropwizard/dropwizard
dropwizard-json-logging/src/main/java/io/dropwizard/logging/json/layout/MapBuilder.java
MapBuilder.addNumber
public MapBuilder addNumber(String fieldName, boolean include, @Nullable Number number) { """ Adds the number to the provided map under the provided field name if it's should be included. """ if (include && number != null) { map.put(getFieldName(fieldName), number); } return...
java
public MapBuilder addNumber(String fieldName, boolean include, @Nullable Number number) { if (include && number != null) { map.put(getFieldName(fieldName), number); } return this; }
[ "public", "MapBuilder", "addNumber", "(", "String", "fieldName", ",", "boolean", "include", ",", "@", "Nullable", "Number", "number", ")", "{", "if", "(", "include", "&&", "number", "!=", "null", ")", "{", "map", ".", "put", "(", "getFieldName", "(", "fi...
Adds the number to the provided map under the provided field name if it's should be included.
[ "Adds", "the", "number", "to", "the", "provided", "map", "under", "the", "provided", "field", "name", "if", "it", "s", "should", "be", "included", "." ]
train
https://github.com/dropwizard/dropwizard/blob/7ee09a410476b9681e8072ab684788bb440877bd/dropwizard-json-logging/src/main/java/io/dropwizard/logging/json/layout/MapBuilder.java#L66-L71
uber/NullAway
nullaway/src/main/java/com/uber/nullaway/NullAway.java
NullAway.checkOverriding
private Description checkOverriding( Symbol.MethodSymbol overriddenMethod, Symbol.MethodSymbol overridingMethod, @Nullable MemberReferenceTree memberReferenceTree, VisitorState state) { """ check that nullability annotations of an overriding method are consistent with those in the overridd...
java
private Description checkOverriding( Symbol.MethodSymbol overriddenMethod, Symbol.MethodSymbol overridingMethod, @Nullable MemberReferenceTree memberReferenceTree, VisitorState state) { final boolean isOverridenMethodUnannotated = NullabilityUtil.isUnannotated(overriddenMethod, confi...
[ "private", "Description", "checkOverriding", "(", "Symbol", ".", "MethodSymbol", "overriddenMethod", ",", "Symbol", ".", "MethodSymbol", "overridingMethod", ",", "@", "Nullable", "MemberReferenceTree", "memberReferenceTree", ",", "VisitorState", "state", ")", "{", "fina...
check that nullability annotations of an overriding method are consistent with those in the overridden method (both return and parameters) @param overriddenMethod method being overridden @param overridingMethod overriding method @param memberReferenceTree if override is via a method reference, the relevant {@link Memb...
[ "check", "that", "nullability", "annotations", "of", "an", "overriding", "method", "are", "consistent", "with", "those", "in", "the", "overridden", "method", "(", "both", "return", "and", "parameters", ")" ]
train
https://github.com/uber/NullAway/blob/c3979b4241f80411dbba6aac3ff653acbb88d00b/nullaway/src/main/java/com/uber/nullaway/NullAway.java#L716-L764
apache/incubator-druid
sql/src/main/java/org/apache/druid/sql/calcite/planner/Calcites.java
Calcites.jodaToCalciteTimeString
public static TimeString jodaToCalciteTimeString(final DateTime dateTime, final DateTimeZone timeZone) { """ Calcite expects TIME literals to be represented by TimeStrings in the local time zone. @param dateTime joda timestamp @param timeZone session time zone @return Calcite style Calendar, appropriate for...
java
public static TimeString jodaToCalciteTimeString(final DateTime dateTime, final DateTimeZone timeZone) { // The replaceAll is because Calcite doesn't like trailing zeroes in its fractional seconds part. String timeString = TRAILING_ZEROS .matcher(CALCITE_TIME_PRINTER.print(dateTime.withZone(timeZone))...
[ "public", "static", "TimeString", "jodaToCalciteTimeString", "(", "final", "DateTime", "dateTime", ",", "final", "DateTimeZone", "timeZone", ")", "{", "// The replaceAll is because Calcite doesn't like trailing zeroes in its fractional seconds part.", "String", "timeString", "=", ...
Calcite expects TIME literals to be represented by TimeStrings in the local time zone. @param dateTime joda timestamp @param timeZone session time zone @return Calcite style Calendar, appropriate for literals
[ "Calcite", "expects", "TIME", "literals", "to", "be", "represented", "by", "TimeStrings", "in", "the", "local", "time", "zone", "." ]
train
https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/sql/src/main/java/org/apache/druid/sql/calcite/planner/Calcites.java#L268-L275
gallandarakhneorg/afc
core/vmutils/src/main/java/org/arakhne/afc/vmutil/asserts/AssertMessages.java
AssertMessages.outsideRangeInclusiveParameter
@Pure public static String outsideRangeInclusiveParameter(int parameterIndex, Object currentValue, Object minValue, Object maxValue) { """ Value is outside range. @param parameterIndex the index of the formal parameter. @param currentValue current value. @param minValue minimum value in range. @param max...
java
@Pure public static String outsideRangeInclusiveParameter(int parameterIndex, Object currentValue, Object minValue, Object maxValue) { return msg("A6", parameterIndex, currentValue, minValue, maxValue); //$NON-NLS-1$ }
[ "@", "Pure", "public", "static", "String", "outsideRangeInclusiveParameter", "(", "int", "parameterIndex", ",", "Object", "currentValue", ",", "Object", "minValue", ",", "Object", "maxValue", ")", "{", "return", "msg", "(", "\"A6\"", ",", "parameterIndex", ",", ...
Value is outside range. @param parameterIndex the index of the formal parameter. @param currentValue current value. @param minValue minimum value in range. @param maxValue maximum value in range. @return the error message.
[ "Value", "is", "outside", "range", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/asserts/AssertMessages.java#L237-L241
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/objects/XStringForChars.java
XStringForChars.getChars
public void getChars(int srcBegin, int srcEnd, char dst[], int dstBegin) { """ Copies characters from this string into the destination character array. @param srcBegin index of the first character in the string to copy. @param srcEnd index after the last character in the string to copy. @pa...
java
public void getChars(int srcBegin, int srcEnd, char dst[], int dstBegin) { System.arraycopy((char[])m_obj, m_start+srcBegin, dst, dstBegin, srcEnd); }
[ "public", "void", "getChars", "(", "int", "srcBegin", ",", "int", "srcEnd", ",", "char", "dst", "[", "]", ",", "int", "dstBegin", ")", "{", "System", ".", "arraycopy", "(", "(", "char", "[", "]", ")", "m_obj", ",", "m_start", "+", "srcBegin", ",", ...
Copies characters from this string into the destination character array. @param srcBegin index of the first character in the string to copy. @param srcEnd index after the last character in the string to copy. @param dst the destination array. @param dstBegin the start offset in the d...
[ "Copies", "characters", "from", "this", "string", "into", "the", "destination", "character", "array", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/objects/XStringForChars.java#L211-L214
Stratio/deep-spark
deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java
Cells.getFloat
public Float getFloat(String nameSpace, String cellName) { """ Returns the {@code Float} value of the {@link Cell} (associated to {@code table}) whose name iscellName, or null if this Cells object contains no cell whose name is cellName. @param nameSpace the name of the owning table @param cellName the name ...
java
public Float getFloat(String nameSpace, String cellName) { return getValue(nameSpace, cellName, Float.class); }
[ "public", "Float", "getFloat", "(", "String", "nameSpace", ",", "String", "cellName", ")", "{", "return", "getValue", "(", "nameSpace", ",", "cellName", ",", "Float", ".", "class", ")", ";", "}" ]
Returns the {@code Float} value of the {@link Cell} (associated to {@code table}) whose name iscellName, or null if this Cells object contains no cell whose name is cellName. @param nameSpace the name of the owning table @param cellName the name of the Cell we want to retrieve from this Cells object. @return the {@co...
[ "Returns", "the", "{", "@code", "Float", "}", "value", "of", "the", "{", "@link", "Cell", "}", "(", "associated", "to", "{", "@code", "table", "}", ")", "whose", "name", "iscellName", "or", "null", "if", "this", "Cells", "object", "contains", "no", "ce...
train
https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java#L1075-L1077
dhanji/sitebricks
stat/src/main/java/com/google/sitebricks/stat/StatCollector.java
StatCollector.apply
@Override public List<MemberAnnotatedWithAtStat> apply(Class<?> clazz) { """ {@inheritDoc} <p>Climbs the class hierarchy finding all annotated members. """ List<MemberAnnotatedWithAtStat> annotatedMembers = Lists.newArrayList(); for (Class<?> currentClass = clazz; currentClass != Object.cla...
java
@Override public List<MemberAnnotatedWithAtStat> apply(Class<?> clazz) { List<MemberAnnotatedWithAtStat> annotatedMembers = Lists.newArrayList(); for (Class<?> currentClass = clazz; currentClass != Object.class; currentClass = currentClass.getSuperclass()) { for (Method method : currentCl...
[ "@", "Override", "public", "List", "<", "MemberAnnotatedWithAtStat", ">", "apply", "(", "Class", "<", "?", ">", "clazz", ")", "{", "List", "<", "MemberAnnotatedWithAtStat", ">", "annotatedMembers", "=", "Lists", ".", "newArrayList", "(", ")", ";", "for", "("...
{@inheritDoc} <p>Climbs the class hierarchy finding all annotated members.
[ "{", "@inheritDoc", "}" ]
train
https://github.com/dhanji/sitebricks/blob/8682029a78bd48fb8566173d970800499e9e5d97/stat/src/main/java/com/google/sitebricks/stat/StatCollector.java#L68-L89
JakeWharton/ActionBarSherlock
actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAbsSpinner.java
IcsAbsSpinner.pointToPosition
public int pointToPosition(int x, int y) { """ Maps a point to a position in the list. @param x X in local coordinate @param y Y in local coordinate @return The position of the item which contains the specified point, or {@link #INVALID_POSITION} if the point does not intersect an item. """ Rect ...
java
public int pointToPosition(int x, int y) { Rect frame = mTouchFrame; if (frame == null) { mTouchFrame = new Rect(); frame = mTouchFrame; } final int count = getChildCount(); for (int i = count - 1; i >= 0; i--) { View child = getChildAt(i); ...
[ "public", "int", "pointToPosition", "(", "int", "x", ",", "int", "y", ")", "{", "Rect", "frame", "=", "mTouchFrame", ";", "if", "(", "frame", "==", "null", ")", "{", "mTouchFrame", "=", "new", "Rect", "(", ")", ";", "frame", "=", "mTouchFrame", ";", ...
Maps a point to a position in the list. @param x X in local coordinate @param y Y in local coordinate @return The position of the item which contains the specified point, or {@link #INVALID_POSITION} if the point does not intersect an item.
[ "Maps", "a", "point", "to", "a", "position", "in", "the", "list", "." ]
train
https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAbsSpinner.java#L352-L370
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderService.java
SpiderService.addBatch
public BatchResult addBatch(ApplicationDefinition appDef, String tableName, DBObjectBatch batch) { """ Add or update a batch of updates for the given application and table. If the application's autotables option is true and the given table doesn't exist, it is created automatically. When an object in the batch i...
java
public BatchResult addBatch(ApplicationDefinition appDef, String tableName, DBObjectBatch batch) { checkServiceState(); TableDefinition tableDef = appDef.getTableDef(tableName); Utils.require(tableDef != null || appDef.allowsAutoTables(), "Unknown table for application ...
[ "public", "BatchResult", "addBatch", "(", "ApplicationDefinition", "appDef", ",", "String", "tableName", ",", "DBObjectBatch", "batch", ")", "{", "checkServiceState", "(", ")", ";", "TableDefinition", "tableDef", "=", "appDef", ".", "getTableDef", "(", "tableName", ...
Add or update a batch of updates for the given application and table. If the application's autotables option is true and the given table doesn't exist, it is created automatically. When an object in the batch is assigned an ID that is already used, the corresponding object is updated. This preserves idempotent semantic...
[ "Add", "or", "update", "a", "batch", "of", "updates", "for", "the", "given", "application", "and", "table", ".", "If", "the", "application", "s", "autotables", "option", "is", "true", "and", "the", "given", "table", "doesn", "t", "exist", "it", "is", "cr...
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderService.java#L230-L243
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/paramavg/util/ExportSupport.java
ExportSupport.exportSupported
public static boolean exportSupported(@NonNull String sparkMaster, @NonNull FileSystem fs) { """ Check if exporting data is supported in the current environment. Exporting is possible in two cases: - The master is set to local. In this case any file system, including local FS, will work for exporting. - The file...
java
public static boolean exportSupported(@NonNull String sparkMaster, @NonNull FileSystem fs) { // Anything is supported with a local master. Regex matches 'local', 'local[DIGITS]' or 'local[*]' if (sparkMaster.matches("^local(\\[(\\d+|\\*)])?$")) { return true; } // Clustered m...
[ "public", "static", "boolean", "exportSupported", "(", "@", "NonNull", "String", "sparkMaster", ",", "@", "NonNull", "FileSystem", "fs", ")", "{", "// Anything is supported with a local master. Regex matches 'local', 'local[DIGITS]' or 'local[*]'", "if", "(", "sparkMaster", "...
Check if exporting data is supported in the current environment. Exporting is possible in two cases: - The master is set to local. In this case any file system, including local FS, will work for exporting. - The file system is not local. Local file systems do not work in cluster modes. @param sparkMaster the Spark mas...
[ "Check", "if", "exporting", "data", "is", "supported", "in", "the", "current", "environment", ".", "Exporting", "is", "possible", "in", "two", "cases", ":", "-", "The", "master", "is", "set", "to", "local", ".", "In", "this", "case", "any", "file", "syst...
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/paramavg/util/ExportSupport.java#L74-L81
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICULocaleService.java
ICULocaleService.registerObject
public Factory registerObject(Object obj, ULocale locale) { """ Convenience override for callers using locales. This calls registerObject(Object, ULocale, int kind, boolean visible) passing KIND_ANY for the kind, and true for the visibility. """ return registerObject(obj, locale, LocaleKey.KIND_ANY,...
java
public Factory registerObject(Object obj, ULocale locale) { return registerObject(obj, locale, LocaleKey.KIND_ANY, true); }
[ "public", "Factory", "registerObject", "(", "Object", "obj", ",", "ULocale", "locale", ")", "{", "return", "registerObject", "(", "obj", ",", "locale", ",", "LocaleKey", ".", "KIND_ANY", ",", "true", ")", ";", "}" ]
Convenience override for callers using locales. This calls registerObject(Object, ULocale, int kind, boolean visible) passing KIND_ANY for the kind, and true for the visibility.
[ "Convenience", "override", "for", "callers", "using", "locales", ".", "This", "calls", "registerObject", "(", "Object", "ULocale", "int", "kind", "boolean", "visible", ")", "passing", "KIND_ANY", "for", "the", "kind", "and", "true", "for", "the", "visibility", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICULocaleService.java#L93-L95
kuali/ojb-1.0.4
src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java
OjbTagsHandler.forAllProcedureArguments
public void forAllProcedureArguments(String template, Properties attributes) throws XDocletException { """ Processes the template for all procedure arguments of the current procedure. @param template The template @param attributes The attributes of the tag @exception XDocletException ...
java
public void forAllProcedureArguments(String template, Properties attributes) throws XDocletException { String argNameList = _curProcedureDef.getProperty(PropertyHelper.OJB_PROPERTY_ARGUMENTS); for (CommaListIterator it = new CommaListIterator(argNameList); it.hasNext();) { ...
[ "public", "void", "forAllProcedureArguments", "(", "String", "template", ",", "Properties", "attributes", ")", "throws", "XDocletException", "{", "String", "argNameList", "=", "_curProcedureDef", ".", "getProperty", "(", "PropertyHelper", ".", "OJB_PROPERTY_ARGUMENTS", ...
Processes the template for all procedure arguments of the current procedure. @param template The template @param attributes The attributes of the tag @exception XDocletException if an error occurs @doc.tag type="block"
[ "Processes", "the", "template", "for", "all", "procedure", "arguments", "of", "the", "current", "procedure", "." ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java#L624-L634
bullhorn/sdk-rest
src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java
RestUriVariablesFactory.addCommonUriVariables
public void addCommonUriVariables(Set<String> fieldSet, BullhornEntityInfo entityInfo, Map<String, String> uriVariables) { """ Adds url variables common to all requests to the passed in map: bhRestToken,fields,entityType @param fieldSet @param entityInfo """ String bhRestToken = bullhornApiRest.getBhRest...
java
public void addCommonUriVariables(Set<String> fieldSet, BullhornEntityInfo entityInfo, Map<String, String> uriVariables) { String bhRestToken = bullhornApiRest.getBhRestToken(); String fields = convertFieldSetToString(fieldSet); uriVariables.put(BH_REST_TOKEN, bhRestToken); uriVariables.put(FIELDS, fields); u...
[ "public", "void", "addCommonUriVariables", "(", "Set", "<", "String", ">", "fieldSet", ",", "BullhornEntityInfo", "entityInfo", ",", "Map", "<", "String", ",", "String", ">", "uriVariables", ")", "{", "String", "bhRestToken", "=", "bullhornApiRest", ".", "getBhR...
Adds url variables common to all requests to the passed in map: bhRestToken,fields,entityType @param fieldSet @param entityInfo
[ "Adds", "url", "variables", "common", "to", "all", "requests", "to", "the", "passed", "in", "map", ":", "bhRestToken", "fields", "entityType" ]
train
https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java#L474-L480
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMenu.java
WMenu.handleRequest
@Override public void handleRequest(final Request request) { """ Override handleRequest in order to perform processing specific to WMenu. @param request the request being handled. """ if (isDisabled()) { // Protect against client-side tampering of disabled/read-only fields. return; } if (isPre...
java
@Override public void handleRequest(final Request request) { if (isDisabled()) { // Protect against client-side tampering of disabled/read-only fields. return; } if (isPresent(request)) { List<MenuItemSelectable> selectedItems = new ArrayList<>(); // Unfortunately, we need to recurse through all the...
[ "@", "Override", "public", "void", "handleRequest", "(", "final", "Request", "request", ")", "{", "if", "(", "isDisabled", "(", ")", ")", "{", "// Protect against client-side tampering of disabled/read-only fields.", "return", ";", "}", "if", "(", "isPresent", "(", ...
Override handleRequest in order to perform processing specific to WMenu. @param request the request being handled.
[ "Override", "handleRequest", "in", "order", "to", "perform", "processing", "specific", "to", "WMenu", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMenu.java#L448-L461
LevelFourAB/commons
commons-config/src/main/java/se/l4/commons/config/internal/RawFormatReader.java
RawFormatReader.read
public static Map<String, Object> read(StreamingInput input) throws IOException { """ Convert the given stream to a map. @param input @return @throws IOException """ Token next = input.peek(); if(next == null) return Collections.emptyMap(); switch(next) { case LIST_START: case LIST_END: ...
java
public static Map<String, Object> read(StreamingInput input) throws IOException { Token next = input.peek(); if(next == null) return Collections.emptyMap(); switch(next) { case LIST_START: case LIST_END: case OBJECT_END: case VALUE: case NULL: throw new SerializationException("Error in co...
[ "public", "static", "Map", "<", "String", ",", "Object", ">", "read", "(", "StreamingInput", "input", ")", "throws", "IOException", "{", "Token", "next", "=", "input", ".", "peek", "(", ")", ";", "if", "(", "next", "==", "null", ")", "return", "Collect...
Convert the given stream to a map. @param input @return @throws IOException
[ "Convert", "the", "given", "stream", "to", "a", "map", "." ]
train
https://github.com/LevelFourAB/commons/blob/aa121b3a5504b43d0c10450a1b984694fcd2b8ee/commons-config/src/main/java/se/l4/commons/config/internal/RawFormatReader.java#L53-L70
SimiaCryptus/utilities
java-util/src/main/java/com/simiacryptus/text/CompressionUtil.java
CompressionUtil.encodeLZ
public static byte[] encodeLZ(String data, String dictionary) { """ Encode lz byte [ ]. @param data the data @param dictionary the dictionary @return the byte [ ] """ byte[] asBytes = new byte[0]; try { asBytes = data.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { ...
java
public static byte[] encodeLZ(String data, String dictionary) { byte[] asBytes = new byte[0]; try { asBytes = data.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } return encodeLZ(asBytes, dictionary); }
[ "public", "static", "byte", "[", "]", "encodeLZ", "(", "String", "data", ",", "String", "dictionary", ")", "{", "byte", "[", "]", "asBytes", "=", "new", "byte", "[", "0", "]", ";", "try", "{", "asBytes", "=", "data", ".", "getBytes", "(", "\"UTF-8\""...
Encode lz byte [ ]. @param data the data @param dictionary the dictionary @return the byte [ ]
[ "Encode", "lz", "byte", "[", "]", "." ]
train
https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/text/CompressionUtil.java#L52-L60
couchbase/couchbase-java-client
src/main/java/com/couchbase/client/java/bucket/api/Utils.java
Utils.formatTimeout
static String formatTimeout(final CouchbaseRequest request, final long timeout) { """ This method take the given request and produces the correct additional timeout information according to the RFC. """ Map<String, Object> fieldMap = new HashMap<String, Object>(); fieldMap.put("t", timeout); ...
java
static String formatTimeout(final CouchbaseRequest request, final long timeout) { Map<String, Object> fieldMap = new HashMap<String, Object>(); fieldMap.put("t", timeout); if (request != null) { fieldMap.put("s", formatServiceType(request)); putIfNotNull(fieldMap, "i", r...
[ "static", "String", "formatTimeout", "(", "final", "CouchbaseRequest", "request", ",", "final", "long", "timeout", ")", "{", "Map", "<", "String", ",", "Object", ">", "fieldMap", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "f...
This method take the given request and produces the correct additional timeout information according to the RFC.
[ "This", "method", "take", "the", "given", "request", "and", "produces", "the", "correct", "additional", "timeout", "information", "according", "to", "the", "RFC", "." ]
train
https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/bucket/api/Utils.java#L70-L89
cloudant/sync-android
cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/query/IndexUpdater.java
IndexUpdater.updateAllIndexes
public static void updateAllIndexes(List<Index> indexes, Database database, SQLDatabaseQueue queue) throws QueryException { """ Update all indexes in a set. These indexes are assumed to already exist. @param indexes Map of ...
java
public static void updateAllIndexes(List<Index> indexes, Database database, SQLDatabaseQueue queue) throws QueryException { IndexUpdater updater = new IndexUpdater(database, queue); updater.updateAllIndexes(indexes); ...
[ "public", "static", "void", "updateAllIndexes", "(", "List", "<", "Index", ">", "indexes", ",", "Database", "database", ",", "SQLDatabaseQueue", "queue", ")", "throws", "QueryException", "{", "IndexUpdater", "updater", "=", "new", "IndexUpdater", "(", "database", ...
Update all indexes in a set. These indexes are assumed to already exist. @param indexes Map of indexes and their definitions. @param database The local {@link Database} @param queue The executor service queue @return index update success status (true/false)
[ "Update", "all", "indexes", "in", "a", "set", "." ]
train
https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/query/IndexUpdater.java#L67-L73
opencb/cellbase
cellbase-app/src/main/java/org/opencb/cellbase/app/transform/DisgenetParser.java
DisgenetParser.fillDisgenetMap
private long fillDisgenetMap(Map<String, Disgenet> disGeNetMap, BufferedReader reader) throws IOException { """ Loads a map {geneId -> Disgenet info} from the Disgenet file. @param disGeNetMap: Map where keys are Disgenet gene ids and values are Disgenet objects. Will be filled within this method. @param read...
java
private long fillDisgenetMap(Map<String, Disgenet> disGeNetMap, BufferedReader reader) throws IOException { long linesProcessed = 0; String line; while ((line = reader.readLine()) != null) { String[] fields = line.split("\t"); String geneId = fields[0]; Stri...
[ "private", "long", "fillDisgenetMap", "(", "Map", "<", "String", ",", "Disgenet", ">", "disGeNetMap", ",", "BufferedReader", "reader", ")", "throws", "IOException", "{", "long", "linesProcessed", "=", "0", ";", "String", "line", ";", "while", "(", "(", "line...
Loads a map {geneId -> Disgenet info} from the Disgenet file. @param disGeNetMap: Map where keys are Disgenet gene ids and values are Disgenet objects. Will be filled within this method. @param reader: BufferedReader pointing to the first line containing actual Disgenet info (header assumed to be skipped). @throw...
[ "Loads", "a", "map", "{", "geneId", "-", ">", "Disgenet", "info", "}", "from", "the", "Disgenet", "file", "." ]
train
https://github.com/opencb/cellbase/blob/70cc3d6ecff747725ade9d051438fc6bf98cae44/cellbase-app/src/main/java/org/opencb/cellbase/app/transform/DisgenetParser.java#L93-L126
lessthanoptimal/ejml
main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java
CommonOps_DSCC.extractDiag
public static void extractDiag(DMatrixSparseCSC src, DMatrixSparseCSC dst ) { """ <p> Extracts the diagonal elements 'src' write it to the 'dst' vector. 'dst' can either be a row or column vector. <p> @param src Matrix whose diagonal elements are being extracted. Not modified. @param dst A vector the resul...
java
public static void extractDiag(DMatrixSparseCSC src, DMatrixSparseCSC dst ) { int N = Math.min(src.numRows, src.numCols); if( !MatrixFeatures_DSCC.isVector(dst) ) { dst.reshape(N, 1, N); } else if( dst.numRows*dst.numCols != N ) { dst.reshape(N,1,N); } else { ...
[ "public", "static", "void", "extractDiag", "(", "DMatrixSparseCSC", "src", ",", "DMatrixSparseCSC", "dst", ")", "{", "int", "N", "=", "Math", ".", "min", "(", "src", ".", "numRows", ",", "src", ".", "numCols", ")", ";", "if", "(", "!", "MatrixFeatures_DS...
<p> Extracts the diagonal elements 'src' write it to the 'dst' vector. 'dst' can either be a row or column vector. <p> @param src Matrix whose diagonal elements are being extracted. Not modified. @param dst A vector the results will be written into. Modified.
[ "<p", ">", "Extracts", "the", "diagonal", "elements", "src", "write", "it", "to", "the", "dst", "vector", ".", "dst", "can", "either", "be", "a", "row", "or", "column", "vector", ".", "<p", ">" ]
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java#L751-L781
nguillaumin/slick2d-maven
slick2d-core/src/main/java/org/newdawn/slick/svg/SVGMorph.java
SVGMorph.addStep
public void addStep(Diagram diagram) { """ Add a subsquent step to the morphing @param diagram The diagram to add as the next step in the morph """ if (diagram.getFigureCount() != figures.size()) { throw new RuntimeException("Mismatched diagrams, missing ids"); } for (int i=0;i<diagram.getFigur...
java
public void addStep(Diagram diagram) { if (diagram.getFigureCount() != figures.size()) { throw new RuntimeException("Mismatched diagrams, missing ids"); } for (int i=0;i<diagram.getFigureCount();i++) { Figure figure = diagram.getFigure(i); String id = figure.getData().getMetaData(); for (i...
[ "public", "void", "addStep", "(", "Diagram", "diagram", ")", "{", "if", "(", "diagram", ".", "getFigureCount", "(", ")", "!=", "figures", ".", "size", "(", ")", ")", "{", "throw", "new", "RuntimeException", "(", "\"Mismatched diagrams, missing ids\"", ")", "...
Add a subsquent step to the morphing @param diagram The diagram to add as the next step in the morph
[ "Add", "a", "subsquent", "step", "to", "the", "morphing" ]
train
https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/svg/SVGMorph.java#L37-L54
dadoonet/elasticsearch-beyonder
src/main/java/fr/pilato/elasticsearch/tools/template/TemplateElasticsearchUpdater.java
TemplateElasticsearchUpdater.createTemplateWithJsonInElasticsearch
private static void createTemplateWithJsonInElasticsearch(RestClient client, String template, String json) throws Exception { """ Create a new index in Elasticsearch @param client Elasticsearch client @param template Template name @param json JSon content for the template @throws Exception if something goes wr...
java
private static void createTemplateWithJsonInElasticsearch(RestClient client, String template, String json) throws Exception { logger.trace("createTemplate([{}])", template); assert client != null; assert template != null; Request request = new Request("PUT", "/_template/" + template); request.setJsonEntity(...
[ "private", "static", "void", "createTemplateWithJsonInElasticsearch", "(", "RestClient", "client", ",", "String", "template", ",", "String", "json", ")", "throws", "Exception", "{", "logger", ".", "trace", "(", "\"createTemplate([{}])\"", ",", "template", ")", ";", ...
Create a new index in Elasticsearch @param client Elasticsearch client @param template Template name @param json JSon content for the template @throws Exception if something goes wrong
[ "Create", "a", "new", "index", "in", "Elasticsearch" ]
train
https://github.com/dadoonet/elasticsearch-beyonder/blob/275bf63432b97169a90a266e983143cca9ad7629/src/main/java/fr/pilato/elasticsearch/tools/template/TemplateElasticsearchUpdater.java#L205-L221
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/metadata/JdbcTypesHelper.java
JdbcTypesHelper.setJdbcType
public static void setJdbcType(String typeName, int typeIndex, JdbcType type) { """ Set the {@link JdbcType} by name and index. @param typeName Name of the type @param typeIndex index of the type @param type the type """ setJdbcTypeByName(typeName, type); setJdbcTypeByTypesIndex(typeIndex,...
java
public static void setJdbcType(String typeName, int typeIndex, JdbcType type) { setJdbcTypeByName(typeName, type); setJdbcTypeByTypesIndex(typeIndex, type); }
[ "public", "static", "void", "setJdbcType", "(", "String", "typeName", ",", "int", "typeIndex", ",", "JdbcType", "type", ")", "{", "setJdbcTypeByName", "(", "typeName", ",", "type", ")", ";", "setJdbcTypeByTypesIndex", "(", "typeIndex", ",", "type", ")", ";", ...
Set the {@link JdbcType} by name and index. @param typeName Name of the type @param typeIndex index of the type @param type the type
[ "Set", "the", "{" ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/JdbcTypesHelper.java#L103-L107
finmath/finmath-lib
src/main/java/net/finmath/marketdata/model/curves/DiscountCurveInterpolation.java
DiscountCurveInterpolation.createDiscountCurveFromDiscountFactors
public static DiscountCurveInterpolation createDiscountCurveFromDiscountFactors( String name, double[] times, double[] givenDiscountFactors, boolean[] isParameter, InterpolationMethod interpolationMethod, ExtrapolationMethod extrapolationMethod, InterpolationEntity interpolationEntity) { """ Create ...
java
public static DiscountCurveInterpolation createDiscountCurveFromDiscountFactors( String name, double[] times, double[] givenDiscountFactors, boolean[] isParameter, InterpolationMethod interpolationMethod, ExtrapolationMethod extrapolationMethod, InterpolationEntity interpolationEntity) { return createD...
[ "public", "static", "DiscountCurveInterpolation", "createDiscountCurveFromDiscountFactors", "(", "String", "name", ",", "double", "[", "]", "times", ",", "double", "[", "]", "givenDiscountFactors", ",", "boolean", "[", "]", "isParameter", ",", "InterpolationMethod", "...
Create a discount curve from given times and given discount factors using given interpolation and extrapolation methods. @param name The name of this discount curve. @param times Array of times as doubles. @param givenDiscountFactors Array of corresponding discount factors. @param isParameter Array of booleans specify...
[ "Create", "a", "discount", "curve", "from", "given", "times", "and", "given", "discount", "factors", "using", "given", "interpolation", "and", "extrapolation", "methods", "." ]
train
https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata/model/curves/DiscountCurveInterpolation.java#L115-L122
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterHeartbeatManager.java
ClusterHeartbeatManager.suspectMemberIfNotHeartBeating
private boolean suspectMemberIfNotHeartBeating(long now, Member member) { """ Removes the {@code member} if it has not sent any heartbeats in {@link GroupProperty#MAX_NO_HEARTBEAT_SECONDS}. If it has not sent any heartbeats in {@link #HEART_BEAT_INTERVAL_FACTOR} heartbeat intervals, it will log a warning. @par...
java
private boolean suspectMemberIfNotHeartBeating(long now, Member member) { if (clusterService.getMembershipManager().isMemberSuspected(member.getAddress())) { return true; } long lastHeartbeat = heartbeatFailureDetector.lastHeartbeat(member); if (!heartbeatFailureDetector.isA...
[ "private", "boolean", "suspectMemberIfNotHeartBeating", "(", "long", "now", ",", "Member", "member", ")", "{", "if", "(", "clusterService", ".", "getMembershipManager", "(", ")", ".", "isMemberSuspected", "(", "member", ".", "getAddress", "(", ")", ")", ")", "...
Removes the {@code member} if it has not sent any heartbeats in {@link GroupProperty#MAX_NO_HEARTBEAT_SECONDS}. If it has not sent any heartbeats in {@link #HEART_BEAT_INTERVAL_FACTOR} heartbeat intervals, it will log a warning. @param now the current cluster clock time @param member the member which needs to be ch...
[ "Removes", "the", "{", "@code", "member", "}", "if", "it", "has", "not", "sent", "any", "heartbeats", "in", "{", "@link", "GroupProperty#MAX_NO_HEARTBEAT_SECONDS", "}", ".", "If", "it", "has", "not", "sent", "any", "heartbeats", "in", "{", "@link", "#HEART_B...
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterHeartbeatManager.java#L514-L535