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
Azure/azure-sdk-for-java
appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java
AppServiceEnvironmentsInner.updateWorkerPoolAsync
public Observable<WorkerPoolResourceInner> updateWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { """ Create or update a worker pool. Create or update a worker pool. @param resourceGroupName Name of the resource group to which the resou...
java
public Observable<WorkerPoolResourceInner> updateWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { return updateWorkerPoolWithServiceResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).map(new Func1<ServiceResponse<...
[ "public", "Observable", "<", "WorkerPoolResourceInner", ">", "updateWorkerPoolAsync", "(", "String", "resourceGroupName", ",", "String", "name", ",", "String", "workerPoolName", ",", "WorkerPoolResourceInner", "workerPoolEnvelope", ")", "{", "return", "updateWorkerPoolWithS...
Create or update a worker pool. Create or update a worker pool. @param resourceGroupName Name of the resource group to which the resource belongs. @param name Name of the App Service Environment. @param workerPoolName Name of the worker pool. @param workerPoolEnvelope Properties of the worker pool. @throws IllegalArgu...
[ "Create", "or", "update", "a", "worker", "pool", ".", "Create", "or", "update", "a", "worker", "pool", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L5418-L5425
xiaosunzhu/resource-utils
src/main/java/net/sunyijun/resource/config/Configs.java
Configs.getHavePathSelfConfig
public static String getHavePathSelfConfig(IConfigKeyWithPath key) { """ Get self config string. @param key config key with configAbsoluteClassPath in config file @return config value string. Return null if not add config file or not config in config file. @see #addSelfConfigs(String, OneProperties) """ ...
java
public static String getHavePathSelfConfig(IConfigKeyWithPath key) { String configAbsoluteClassPath = key.getConfigPath(); return getSelfConfig(configAbsoluteClassPath, key); }
[ "public", "static", "String", "getHavePathSelfConfig", "(", "IConfigKeyWithPath", "key", ")", "{", "String", "configAbsoluteClassPath", "=", "key", ".", "getConfigPath", "(", ")", ";", "return", "getSelfConfig", "(", "configAbsoluteClassPath", ",", "key", ")", ";", ...
Get self config string. @param key config key with configAbsoluteClassPath in config file @return config value string. Return null if not add config file or not config in config file. @see #addSelfConfigs(String, OneProperties)
[ "Get", "self", "config", "string", "." ]
train
https://github.com/xiaosunzhu/resource-utils/blob/4f2bf3f36df10195a978f122ed682ba1eb0462b5/src/main/java/net/sunyijun/resource/config/Configs.java#L336-L339
jayantk/jklol
src/com/jayantkrish/jklol/models/FactorGraph.java
FactorGraph.createFromFactors
public static FactorGraph createFromFactors(List<Factor> factors) { """ Constructs a {@code FactorGraph} directly from a list of factors. The variables and variable numbers in the graph are determined by the factors, and their names are unspecified. @param factors """ VariableNumMap allVars = Variable...
java
public static FactorGraph createFromFactors(List<Factor> factors) { VariableNumMap allVars = VariableNumMap.EMPTY; for (int i = 0; i < factors.size(); i++) { allVars = allVars.union(factors.get(i).getVars()); } String[] factorNames = new String[factors.size()]; for (int i = 0; i < factors.siz...
[ "public", "static", "FactorGraph", "createFromFactors", "(", "List", "<", "Factor", ">", "factors", ")", "{", "VariableNumMap", "allVars", "=", "VariableNumMap", ".", "EMPTY", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "factors", ".", "size", ...
Constructs a {@code FactorGraph} directly from a list of factors. The variables and variable numbers in the graph are determined by the factors, and their names are unspecified. @param factors
[ "Constructs", "a", "{", "@code", "FactorGraph", "}", "directly", "from", "a", "list", "of", "factors", ".", "The", "variables", "and", "variable", "numbers", "in", "the", "graph", "are", "determined", "by", "the", "factors", "and", "their", "names", "are", ...
train
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/models/FactorGraph.java#L145-L157
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/ExpGammaDistribution.java
ExpGammaDistribution.logcdf
public static double logcdf(double x, double k, double theta, double shift) { """ The log CDF, static version. @param x Value @param k Shape k @param theta Theta = 1.0/Beta aka. "scaling" parameter @return cdf value """ final double e = FastMath.exp((x - shift) * theta); return e < Double.POSITIV...
java
public static double logcdf(double x, double k, double theta, double shift) { final double e = FastMath.exp((x - shift) * theta); return e < Double.POSITIVE_INFINITY ? GammaDistribution.logregularizedGammaP(k, e) : 0.; }
[ "public", "static", "double", "logcdf", "(", "double", "x", ",", "double", "k", ",", "double", "theta", ",", "double", "shift", ")", "{", "final", "double", "e", "=", "FastMath", ".", "exp", "(", "(", "x", "-", "shift", ")", "*", "theta", ")", ";",...
The log CDF, static version. @param x Value @param k Shape k @param theta Theta = 1.0/Beta aka. "scaling" parameter @return cdf value
[ "The", "log", "CDF", "static", "version", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/ExpGammaDistribution.java#L190-L193
igniterealtime/Smack
smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/XHTMLText.java
XHTMLText.appendImageTag
public XHTMLText appendImageTag(String align, String alt, String height, String src, String width) { """ Appends a tag that indicates an image. @param align how text should flow around the picture @param alt the text to show if you don't show the picture @param height how tall is the picture @param src where...
java
public XHTMLText appendImageTag(String align, String alt, String height, String src, String width) { text.halfOpenElement(IMG); text.optAttribute("align", align); text.optAttribute("alt", alt); text.optAttribute("height", height); text.optAttribute("src", src); text.optAt...
[ "public", "XHTMLText", "appendImageTag", "(", "String", "align", ",", "String", "alt", ",", "String", "height", ",", "String", "src", ",", "String", "width", ")", "{", "text", ".", "halfOpenElement", "(", "IMG", ")", ";", "text", ".", "optAttribute", "(", ...
Appends a tag that indicates an image. @param align how text should flow around the picture @param alt the text to show if you don't show the picture @param height how tall is the picture @param src where to get the picture @param width how wide is the picture @return this.
[ "Appends", "a", "tag", "that", "indicates", "an", "image", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/XHTMLText.java#L237-L246
stratosphere/stratosphere
stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/HardwareDescriptionFactory.java
HardwareDescriptionFactory.extractFromSystem
public static HardwareDescription extractFromSystem() { """ Extracts a hardware description object from the system. @return the hardware description object or <code>null</code> if at least one value for the hardware description cannot be determined """ int numberOfCPUCores = Runtime.getRuntime().availabl...
java
public static HardwareDescription extractFromSystem() { int numberOfCPUCores = Runtime.getRuntime().availableProcessors(); long sizeOfPhysicalMemory = getSizeOfPhysicalMemory(); if (sizeOfPhysicalMemory < 0) { sizeOfPhysicalMemory = 1; } long sizeOfFreeMemory = getSizeOfFreeMemory(); return new Hardwa...
[ "public", "static", "HardwareDescription", "extractFromSystem", "(", ")", "{", "int", "numberOfCPUCores", "=", "Runtime", ".", "getRuntime", "(", ")", ".", "availableProcessors", "(", ")", ";", "long", "sizeOfPhysicalMemory", "=", "getSizeOfPhysicalMemory", "(", ")"...
Extracts a hardware description object from the system. @return the hardware description object or <code>null</code> if at least one value for the hardware description cannot be determined
[ "Extracts", "a", "hardware", "description", "object", "from", "the", "system", "." ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/HardwareDescriptionFactory.java#L67-L78
ModeShape/modeshape
modeshape-schematic/src/main/java/org/modeshape/schematic/internal/document/BsonUtils.java
BsonUtils.readObjectId
public static ObjectId readObjectId(byte[] bytes) { """ The BSON specification (or rather the <a href="http://www.mongodb.org/display/DOCS/Object+IDs">MongoDB documentation</a>) defines the structure of this data: <p> <quote>"A BSON ObjectID is a 12-byte value consisting of a 4-byte timestamp (seconds since epo...
java
public static ObjectId readObjectId(byte[] bytes) { // Compute the values in big-endian ... int time = ((bytes[0] & 0xff) << 24) + ((bytes[1] & 0xff) << 16) + ((bytes[2] & 0xff) << 8) + ((bytes[3] & 0xff) << 0); int machine = ((bytes[4] & 0xff) << 16) + ((bytes[5] & 0xff) << 8) + ((byte...
[ "public", "static", "ObjectId", "readObjectId", "(", "byte", "[", "]", "bytes", ")", "{", "// Compute the values in big-endian ...", "int", "time", "=", "(", "(", "bytes", "[", "0", "]", "&", "0xff", ")", "<<", "24", ")", "+", "(", "(", "bytes", "[", "...
The BSON specification (or rather the <a href="http://www.mongodb.org/display/DOCS/Object+IDs">MongoDB documentation</a>) defines the structure of this data: <p> <quote>"A BSON ObjectID is a 12-byte value consisting of a 4-byte timestamp (seconds since epoch), a 3-byte machine id, a 2-byte process id, and a 3-byte coun...
[ "The", "BSON", "specification", "(", "or", "rather", "the", "<a", "href", "=", "http", ":", "//", "www", ".", "mongodb", ".", "org", "/", "display", "/", "DOCS", "/", "Object", "+", "IDs", ">", "MongoDB", "documentation<", "/", "a", ">", ")", "define...
train
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-schematic/src/main/java/org/modeshape/schematic/internal/document/BsonUtils.java#L108-L117
ragnor/simple-spring-memcached
simple-spring-memcached/src/main/java/com/google/code/ssm/config/DefaultAddressProvider.java
DefaultAddressProvider.getAddresses
protected List<InetSocketAddress> getAddresses(final String s) { """ Split a string containing whitespace or comma separated host or IP addresses and port numbers of the form "host:port host2:port" or "host:port, host2:port" into a List of InetSocketAddress instances suitable for instantiating a MemcachedClient....
java
protected List<InetSocketAddress> getAddresses(final String s) { if (s == null) { throw new NullPointerException("Null host list"); } if (s.trim().isEmpty()) { throw new IllegalArgumentException("No hosts in list: '" + s + "'"); } List<InetSocketAddress> ...
[ "protected", "List", "<", "InetSocketAddress", ">", "getAddresses", "(", "final", "String", "s", ")", "{", "if", "(", "s", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"Null host list\"", ")", ";", "}", "if", "(", "s", ".", "tri...
Split a string containing whitespace or comma separated host or IP addresses and port numbers of the form "host:port host2:port" or "host:port, host2:port" into a List of InetSocketAddress instances suitable for instantiating a MemcachedClient. Note that colon-delimited IPv6 is also supported. For example: ::1:11211
[ "Split", "a", "string", "containing", "whitespace", "or", "comma", "separated", "host", "or", "IP", "addresses", "and", "port", "numbers", "of", "the", "form", "host", ":", "port", "host2", ":", "port", "or", "host", ":", "port", "host2", ":", "port", "i...
train
https://github.com/ragnor/simple-spring-memcached/blob/83db68aa1af219397e132426e377d45f397d31e7/simple-spring-memcached/src/main/java/com/google/code/ssm/config/DefaultAddressProvider.java#L90-L115
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java
DomHelper.getElement
protected Element getElement(Object parent, String name) { """ Returns the element that is a child of the specified parent and has the specified local group name. @param parent the parent group @param name the local group name @return the element or null if it does not exist or the name was null """ i...
java
protected Element getElement(Object parent, String name) { if (name == null) { return null; } String id; if (parent == null) { id = getRootElement().getId(); } else { id = groupToId.get(parent); } return Dom.getElementById(Dom.assembleId(id, name)); }
[ "protected", "Element", "getElement", "(", "Object", "parent", ",", "String", "name", ")", "{", "if", "(", "name", "==", "null", ")", "{", "return", "null", ";", "}", "String", "id", ";", "if", "(", "parent", "==", "null", ")", "{", "id", "=", "get...
Returns the element that is a child of the specified parent and has the specified local group name. @param parent the parent group @param name the local group name @return the element or null if it does not exist or the name was null
[ "Returns", "the", "element", "that", "is", "a", "child", "of", "the", "specified", "parent", "and", "has", "the", "specified", "local", "group", "name", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java#L829-L840
jhy/jsoup
src/main/java/org/jsoup/nodes/Element.java
Element.getElementsByAttributeValueNot
public Elements getElementsByAttributeValueNot(String key, String value) { """ Find elements that either do not have this attribute, or have it with a different value. Case insensitive. @param key name of the attribute @param value value of the attribute @return elements that do not have a matching attribute ...
java
public Elements getElementsByAttributeValueNot(String key, String value) { return Collector.collect(new Evaluator.AttributeWithValueNot(key, value), this); }
[ "public", "Elements", "getElementsByAttributeValueNot", "(", "String", "key", ",", "String", "value", ")", "{", "return", "Collector", ".", "collect", "(", "new", "Evaluator", ".", "AttributeWithValueNot", "(", "key", ",", "value", ")", ",", "this", ")", ";", ...
Find elements that either do not have this attribute, or have it with a different value. Case insensitive. @param key name of the attribute @param value value of the attribute @return elements that do not have a matching attribute
[ "Find", "elements", "that", "either", "do", "not", "have", "this", "attribute", "or", "have", "it", "with", "a", "different", "value", ".", "Case", "insensitive", "." ]
train
https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/nodes/Element.java#L874-L876
aicer/hibiscus-http-client
src/main/java/org/aicer/hibiscus/http/client/HttpClient.java
HttpClient.addNameValuePair
public final HttpClient addNameValuePair(final String param, final String value) { """ Used by Entity-Enclosing HTTP Requests to send Name-Value pairs in the body of the request @param param Name of Parameter @param value Value of Parameter @return """ nameValuePairs.add(new BasicNameValuePair(par...
java
public final HttpClient addNameValuePair(final String param, final String value) { nameValuePairs.add(new BasicNameValuePair(param, value)); return this; }
[ "public", "final", "HttpClient", "addNameValuePair", "(", "final", "String", "param", ",", "final", "String", "value", ")", "{", "nameValuePairs", ".", "add", "(", "new", "BasicNameValuePair", "(", "param", ",", "value", ")", ")", ";", "return", "this", ";",...
Used by Entity-Enclosing HTTP Requests to send Name-Value pairs in the body of the request @param param Name of Parameter @param value Value of Parameter @return
[ "Used", "by", "Entity", "-", "Enclosing", "HTTP", "Requests", "to", "send", "Name", "-", "Value", "pairs", "in", "the", "body", "of", "the", "request" ]
train
https://github.com/aicer/hibiscus-http-client/blob/a037e3cf8d4bb862d38a55a090778736a48d67cc/src/main/java/org/aicer/hibiscus/http/client/HttpClient.java#L257-L260
amzn/ion-java
src/com/amazon/ion/impl/_Private_Utils.java
_Private_Utils.symtabExtends
public static boolean symtabExtends(SymbolTable superset, SymbolTable subset) { """ Determines whether the passed-in {@code superset} symtab is an extension of {@code subset}. <p> If both are LSTs, their imported tables and locally declared symbols are exhaustively checked, which can be expensive. Callers of t...
java
public static boolean symtabExtends(SymbolTable superset, SymbolTable subset) { assert superset.isSystemTable() || superset.isLocalTable(); assert subset.isSystemTable() || subset.isLocalTable(); // NB: system symtab 1.0 is a singleton, hence if both symtabs // are one this will...
[ "public", "static", "boolean", "symtabExtends", "(", "SymbolTable", "superset", ",", "SymbolTable", "subset", ")", "{", "assert", "superset", ".", "isSystemTable", "(", ")", "||", "superset", ".", "isLocalTable", "(", ")", ";", "assert", "subset", ".", "isSyst...
Determines whether the passed-in {@code superset} symtab is an extension of {@code subset}. <p> If both are LSTs, their imported tables and locally declared symbols are exhaustively checked, which can be expensive. Callers of this method should cache the results of these comparisons. @param superset either a system or...
[ "Determines", "whether", "the", "passed", "-", "in", "{", "@code", "superset", "}", "symtab", "is", "an", "extension", "of", "{", "@code", "subset", "}", ".", "<p", ">", "If", "both", "are", "LSTs", "their", "imported", "tables", "and", "locally", "decla...
train
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/_Private_Utils.java#L950-L985
Azure/azure-sdk-for-java
policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyAssignmentsInner.java
PolicyAssignmentsInner.createByIdAsync
public Observable<PolicyAssignmentInner> createByIdAsync(String policyAssignmentId, PolicyAssignmentInner parameters) { """ Creates a policy assignment by ID. Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in t...
java
public Observable<PolicyAssignmentInner> createByIdAsync(String policyAssignmentId, PolicyAssignmentInner parameters) { return createByIdWithServiceResponseAsync(policyAssignmentId, parameters).map(new Func1<ServiceResponse<PolicyAssignmentInner>, PolicyAssignmentInner>() { @Override pub...
[ "public", "Observable", "<", "PolicyAssignmentInner", ">", "createByIdAsync", "(", "String", "policyAssignmentId", ",", "PolicyAssignmentInner", "parameters", ")", "{", "return", "createByIdWithServiceResponseAsync", "(", "policyAssignmentId", ",", "parameters", ")", ".", ...
Creates a policy assignment by ID. Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{su...
[ "Creates", "a", "policy", "assignment", "by", "ID", ".", "Policy", "assignments", "are", "inherited", "by", "child", "resources", ".", "For", "example", "when", "you", "apply", "a", "policy", "to", "a", "resource", "group", "that", "policy", "is", "assigned"...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyAssignmentsInner.java#L1231-L1238
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java
CommonOps_DDRM.elementLog
public static void elementLog(DMatrixD1 A , DMatrixD1 C ) { """ <p> Element-wise log operation <br> c<sub>ij</sub> = Math.log(a<sub>ij</sub>) <p> @param A input @param C output (modified) """ if( A.numCols != C.numCols || A.numRows != C.numRows ) { throw new MatrixDimensionExceptio...
java
public static void elementLog(DMatrixD1 A , DMatrixD1 C ) { if( A.numCols != C.numCols || A.numRows != C.numRows ) { throw new MatrixDimensionException("All matrices must be the same shape"); } int size = A.getNumElements(); for( int i = 0; i < size; i++ ) { C.d...
[ "public", "static", "void", "elementLog", "(", "DMatrixD1", "A", ",", "DMatrixD1", "C", ")", "{", "if", "(", "A", ".", "numCols", "!=", "C", ".", "numCols", "||", "A", ".", "numRows", "!=", "C", ".", "numRows", ")", "{", "throw", "new", "MatrixDimens...
<p> Element-wise log operation <br> c<sub>ij</sub> = Math.log(a<sub>ij</sub>) <p> @param A input @param C output (modified)
[ "<p", ">", "Element", "-", "wise", "log", "operation", "<br", ">", "c<sub", ">", "ij<", "/", "sub", ">", "=", "Math", ".", "log", "(", "a<sub", ">", "ij<", "/", "sub", ">", ")", "<p", ">" ]
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L1707-L1717
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doPostMultipart
public void doPostMultipart(String path, FormDataMultiPart formDataMultiPart, MultivaluedMap<String, String> headers) throws ClientException { """ Submits a multi-part form. @param path the API to call. @param formDataMultiPart the multi-part form content. @param headers any headers to add. If no Content Type...
java
public void doPostMultipart(String path, FormDataMultiPart formDataMultiPart, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper() .rewritten(path, HttpMethod.POST).getReques...
[ "public", "void", "doPostMultipart", "(", "String", "path", ",", "FormDataMultiPart", "formDataMultiPart", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "headers", ")", "throws", "ClientException", "{", "this", ".", "readLock", ".", "lock", "(", ")",...
Submits a multi-part form. @param path the API to call. @param formDataMultiPart the multi-part form content. @param headers any headers to add. If no Content Type header is provided, this method adds a Content Type header for multi-part forms data. @throws ClientException if a status code other than 200 (OK) and 204...
[ "Submits", "a", "multi", "-", "part", "form", "." ]
train
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L666-L681
raydac/netbeans-mmd-plugin
mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java
MindMapPanel.putSessionObject
public void putSessionObject(@Nonnull final String key, @Nullable final Object obj) { """ Put session object for key. @param key key of he object, must not be null @param obj object to be placed, if null then object will be removed @since 1.4.2 """ this.lock(); try { if (obj == null) { ...
java
public void putSessionObject(@Nonnull final String key, @Nullable final Object obj) { this.lock(); try { if (obj == null) { this.sessionObjects.remove(key); } else { this.sessionObjects.put(key, obj); } } finally { this.unlock(); } }
[ "public", "void", "putSessionObject", "(", "@", "Nonnull", "final", "String", "key", ",", "@", "Nullable", "final", "Object", "obj", ")", "{", "this", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "obj", "==", "null", ")", "{", "this", ".", "s...
Put session object for key. @param key key of he object, must not be null @param obj object to be placed, if null then object will be removed @since 1.4.2
[ "Put", "session", "object", "for", "key", "." ]
train
https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java#L1282-L1293
square/picasso
picasso/src/main/java/com/squareup/picasso3/RequestCreator.java
RequestCreator.resizeDimen
@NonNull public RequestCreator resizeDimen(int targetWidthResId, int targetHeightResId) { """ Resize the image to the specified dimension size. Use 0 as desired dimension to resize keeping aspect ratio. """ Resources resources = picasso.context.getResources(); int targetWidth = resources.getDimensio...
java
@NonNull public RequestCreator resizeDimen(int targetWidthResId, int targetHeightResId) { Resources resources = picasso.context.getResources(); int targetWidth = resources.getDimensionPixelSize(targetWidthResId); int targetHeight = resources.getDimensionPixelSize(targetHeightResId); return resize(targ...
[ "@", "NonNull", "public", "RequestCreator", "resizeDimen", "(", "int", "targetWidthResId", ",", "int", "targetHeightResId", ")", "{", "Resources", "resources", "=", "picasso", ".", "context", ".", "getResources", "(", ")", ";", "int", "targetWidth", "=", "resour...
Resize the image to the specified dimension size. Use 0 as desired dimension to resize keeping aspect ratio.
[ "Resize", "the", "image", "to", "the", "specified", "dimension", "size", ".", "Use", "0", "as", "desired", "dimension", "to", "resize", "keeping", "aspect", "ratio", "." ]
train
https://github.com/square/picasso/blob/89f55b76e3be2b65e5997b7698f782f16f8547e3/picasso/src/main/java/com/squareup/picasso3/RequestCreator.java#L228-L234
Alluxio/alluxio
core/base/src/main/java/alluxio/util/io/PathUtils.java
PathUtils.concatPath
public static String concatPath(Object base, Object path) throws IllegalArgumentException { """ Joins two path elements, separated by {@link AlluxioURI#SEPARATOR}. <p> Note that empty element in base or paths is ignored. @param base base path @param path path element to concatenate @return joined path @thr...
java
public static String concatPath(Object base, Object path) throws IllegalArgumentException { Preconditions.checkNotNull(base, "base"); Preconditions.checkNotNull(path, "path"); String trimmedBase = SEPARATOR_MATCHER.trimTrailingFrom(base.toString()); String trimmedPath = SEPARATOR_MATCHER.trimFrom(path.t...
[ "public", "static", "String", "concatPath", "(", "Object", "base", ",", "Object", "path", ")", "throws", "IllegalArgumentException", "{", "Preconditions", ".", "checkNotNull", "(", "base", ",", "\"base\"", ")", ";", "Preconditions", ".", "checkNotNull", "(", "pa...
Joins two path elements, separated by {@link AlluxioURI#SEPARATOR}. <p> Note that empty element in base or paths is ignored. @param base base path @param path path element to concatenate @return joined path @throws IllegalArgumentException if base or paths is null
[ "Joins", "two", "path", "elements", "separated", "by", "{", "@link", "AlluxioURI#SEPARATOR", "}", ".", "<p", ">", "Note", "that", "empty", "element", "in", "base", "or", "paths", "is", "ignored", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/util/io/PathUtils.java#L59-L77
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/HarFileSystem.java
HarFileSystem.fileStatusesInIndex
private void fileStatusesInIndex(HarStatus parent, List<FileStatus> statuses, List<String> children, FileStatus archiveIndexStat) throws IOException { """ Get filestatuses of all the children of a given directory. This just reads through index file and reads line by line to get all statuses for children of...
java
private void fileStatusesInIndex(HarStatus parent, List<FileStatus> statuses, List<String> children, FileStatus archiveIndexStat) throws IOException { // read the index file FSDataInputStream aIn = null; try { aIn = fs.open(archiveIndex); LineReader aLin; long read = 0; aLin = ...
[ "private", "void", "fileStatusesInIndex", "(", "HarStatus", "parent", ",", "List", "<", "FileStatus", ">", "statuses", ",", "List", "<", "String", ">", "children", ",", "FileStatus", "archiveIndexStat", ")", "throws", "IOException", "{", "// read the index file", ...
Get filestatuses of all the children of a given directory. This just reads through index file and reads line by line to get all statuses for children of a directory. Its a brute force way of getting all such filestatuses @param parent the parent path directory @param statuses the list to add the children filestatuses ...
[ "Get", "filestatuses", "of", "all", "the", "children", "of", "a", "given", "directory", ".", "This", "just", "reads", "through", "index", "file", "and", "reads", "line", "by", "line", "to", "get", "all", "statuses", "for", "children", "of", "a", "directory...
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/HarFileSystem.java#L528-L572
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/annotations/Annotation.java
Annotation.getFieldAccessors
private static JMapAccessor getFieldAccessors(Class<?> clazz, Field field,boolean isOpposite, String... fieldNames) { """ Checks if this field contains a definition of accessors for the name given as input. @param clazz class to check @param field field to check @param isOpposite true if accessor methods to che...
java
private static JMapAccessor getFieldAccessors(Class<?> clazz, Field field,boolean isOpposite, String... fieldNames){ for (String fieldName : fieldNames) { JMapAccessor accessor = getAccessor(clazz,field.getAnnotations(),fieldName,isOpposite); if(!isNull(accessor)) return accessor; } return null; }
[ "private", "static", "JMapAccessor", "getFieldAccessors", "(", "Class", "<", "?", ">", "clazz", ",", "Field", "field", ",", "boolean", "isOpposite", ",", "String", "...", "fieldNames", ")", "{", "for", "(", "String", "fieldName", ":", "fieldNames", ")", "{",...
Checks if this field contains a definition of accessors for the name given as input. @param clazz class to check @param field field to check @param isOpposite true if accessor methods to check belong to the opposite field, false otherwise @param fieldNames name to find @return JMapAccessor if exists, null otherwise
[ "Checks", "if", "this", "field", "contains", "a", "definition", "of", "accessors", "for", "the", "name", "given", "as", "input", "." ]
train
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/annotations/Annotation.java#L116-L122
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/ui/CmsAttributeValueView.java
CmsAttributeValueView.setValueWidget
public void setValueWidget(I_CmsFormEditWidget widget, String value, String defaultValue, boolean active) { """ Sets the value widget.<p> @param widget the widget @param value the value @param defaultValue the default attribute value @param active <code>true</code> if the widget should be activated """ ...
java
public void setValueWidget(I_CmsFormEditWidget widget, String value, String defaultValue, boolean active) { if (m_hasValue) { throw new RuntimeException("Value has already been set"); } m_defaultValue = defaultValue; m_hasValue = true; m_isSimpleValue = true; ...
[ "public", "void", "setValueWidget", "(", "I_CmsFormEditWidget", "widget", ",", "String", "value", ",", "String", "defaultValue", ",", "boolean", "active", ")", "{", "if", "(", "m_hasValue", ")", "{", "throw", "new", "RuntimeException", "(", "\"Value has already be...
Sets the value widget.<p> @param widget the widget @param value the value @param defaultValue the default attribute value @param active <code>true</code> if the widget should be activated
[ "Sets", "the", "value", "widget", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/ui/CmsAttributeValueView.java#L760-L803
alkacon/opencms-core
src/org/opencms/ade/configuration/CmsADEManager.java
CmsADEManager.getSubSiteRoot
public String getSubSiteRoot(CmsObject cms, String rootPath) { """ Tries to get the subsite root for a given resource root path.<p> @param cms the current CMS context @param rootPath the root path for which the subsite root should be found @return the subsite root """ CmsADEConfigData configDat...
java
public String getSubSiteRoot(CmsObject cms, String rootPath) { CmsADEConfigData configData = lookupConfiguration(cms, rootPath); String basePath = configData.getBasePath(); String siteRoot = OpenCms.getSiteManager().getSiteRoot(rootPath); if (siteRoot == null) { siteRoot = "...
[ "public", "String", "getSubSiteRoot", "(", "CmsObject", "cms", ",", "String", "rootPath", ")", "{", "CmsADEConfigData", "configData", "=", "lookupConfiguration", "(", "cms", ",", "rootPath", ")", ";", "String", "basePath", "=", "configData", ".", "getBasePath", ...
Tries to get the subsite root for a given resource root path.<p> @param cms the current CMS context @param rootPath the root path for which the subsite root should be found @return the subsite root
[ "Tries", "to", "get", "the", "subsite", "root", "for", "a", "given", "resource", "root", "path", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEManager.java#L924-L938
GoogleCloudPlatform/bigdata-interop
gcsio/src/main/java/com/google/cloud/hadoop/gcsio/StorageResourceId.java
StorageResourceId.fromObjectName
public static StorageResourceId fromObjectName(String objectName, long generationId) { """ Parses {@link StorageResourceId} from specified string and generationId. """ Matcher matcher = OBJECT_NAME_IN_GCS_PATTERN.matcher(objectName); checkArgument(matcher.matches(), "'%s' is not a valid GCS object name...
java
public static StorageResourceId fromObjectName(String objectName, long generationId) { Matcher matcher = OBJECT_NAME_IN_GCS_PATTERN.matcher(objectName); checkArgument(matcher.matches(), "'%s' is not a valid GCS object name.", objectName); String bucketName = matcher.group(2); String relativePath = matc...
[ "public", "static", "StorageResourceId", "fromObjectName", "(", "String", "objectName", ",", "long", "generationId", ")", "{", "Matcher", "matcher", "=", "OBJECT_NAME_IN_GCS_PATTERN", ".", "matcher", "(", "objectName", ")", ";", "checkArgument", "(", "matcher", ".",...
Parses {@link StorageResourceId} from specified string and generationId.
[ "Parses", "{" ]
train
https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/StorageResourceId.java#L280-L296
xhsun/gw2wrapper
src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java
AsynchronousRequest.getAchievementInfo
public void getAchievementInfo(int[] ids, Callback<List<Achievement>> callback) throws GuildWars2Exception, NullPointerException { """ For more info on achievement API go <a href="https://wiki.guildwars2.com/wiki/API:2/achievements">here</a><br/> Give user the access to {@link Callback#onResponse(Call, Response)}...
java
public void getAchievementInfo(int[] ids, Callback<List<Achievement>> callback) throws GuildWars2Exception, NullPointerException { isParamValid(new ParamChecker(ids)); gw2API.getAchievementInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); }
[ "public", "void", "getAchievementInfo", "(", "int", "[", "]", "ids", ",", "Callback", "<", "List", "<", "Achievement", ">", ">", "callback", ")", "throws", "GuildWars2Exception", ",", "NullPointerException", "{", "isParamValid", "(", "new", "ParamChecker", "(", ...
For more info on achievement API go <a href="https://wiki.guildwars2.com/wiki/API:2/achievements">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 achievement id(s) @param callback c...
[ "For", "more", "info", "on", "achievement", "API", "go", "<a", "href", "=", "https", ":", "//", "wiki", ".", "guildwars2", ".", "com", "/", "wiki", "/", "API", ":", "2", "/", "achievements", ">", "here<", "/", "a", ">", "<br", "/", ">", "Give", "...
train
https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L484-L487
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/util/ByteConverter.java
ByteConverter.int4
public static void int4(byte[] target, int idx, int value) { """ Encodes a int value to the byte array. @param target The byte array to encode to. @param idx The starting index in the byte array. @param value The value to encode. """ target[idx + 0] = (byte) (value >>> 24); target[idx + 1] = (byte...
java
public static void int4(byte[] target, int idx, int value) { target[idx + 0] = (byte) (value >>> 24); target[idx + 1] = (byte) (value >>> 16); target[idx + 2] = (byte) (value >>> 8); target[idx + 3] = (byte) value; }
[ "public", "static", "void", "int4", "(", "byte", "[", "]", "target", ",", "int", "idx", ",", "int", "value", ")", "{", "target", "[", "idx", "+", "0", "]", "=", "(", "byte", ")", "(", "value", ">>>", "24", ")", ";", "target", "[", "idx", "+", ...
Encodes a int value to the byte array. @param target The byte array to encode to. @param idx The starting index in the byte array. @param value The value to encode.
[ "Encodes", "a", "int", "value", "to", "the", "byte", "array", "." ]
train
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/ByteConverter.java#L124-L129
classgraph/classgraph
src/main/java/io/github/classgraph/ClassGraph.java
ClassGraph.scanAsync
public Future<ScanResult> scanAsync(final ExecutorService executorService, final int numParallelTasks) { """ Asynchronously scans the classpath for matching files, returning a {@code Future<ScanResult>}. You should assign the wrapped {@link ScanResult} in a try-with-resources statement, or manually close it when ...
java
public Future<ScanResult> scanAsync(final ExecutorService executorService, final int numParallelTasks) { try { return executorService.submit(new Scanner(scanSpec, executorService, numParallelTasks, /* scanResultProcessor = */ null, /* failureHandler = */ null, topLevelLog)); ...
[ "public", "Future", "<", "ScanResult", ">", "scanAsync", "(", "final", "ExecutorService", "executorService", ",", "final", "int", "numParallelTasks", ")", "{", "try", "{", "return", "executorService", ".", "submit", "(", "new", "Scanner", "(", "scanSpec", ",", ...
Asynchronously scans the classpath for matching files, returning a {@code Future<ScanResult>}. You should assign the wrapped {@link ScanResult} in a try-with-resources statement, or manually close it when you are finished with it. @param executorService A custom {@link ExecutorService} to use for scheduling worker tas...
[ "Asynchronously", "scans", "the", "classpath", "for", "matching", "files", "returning", "a", "{", "@code", "Future<ScanResult", ">", "}", ".", "You", "should", "assign", "the", "wrapped", "{", "@link", "ScanResult", "}", "in", "a", "try", "-", "with", "-", ...
train
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraph.java#L1121-L1135
goldmansachs/gs-collections
collections/src/main/java/com/gs/collections/impl/parallel/ParallelIterate.java
ParallelIterate.newPooledExecutor
public static ExecutorService newPooledExecutor(String poolName, boolean useDaemonThreads) { """ Returns a brand new ExecutorService using the specified poolName and uses the optional property named to set the maximum thread pool size. The same poolName may be used more than once resulting in multiple pools wit...
java
public static ExecutorService newPooledExecutor(String poolName, boolean useDaemonThreads) { return ParallelIterate.newPooledExecutor(ParallelIterate.getDefaultMaxThreadPoolSize(), poolName, useDaemonThreads); }
[ "public", "static", "ExecutorService", "newPooledExecutor", "(", "String", "poolName", ",", "boolean", "useDaemonThreads", ")", "{", "return", "ParallelIterate", ".", "newPooledExecutor", "(", "ParallelIterate", ".", "getDefaultMaxThreadPoolSize", "(", ")", ",", "poolNa...
Returns a brand new ExecutorService using the specified poolName and uses the optional property named to set the maximum thread pool size. The same poolName may be used more than once resulting in multiple pools with the same name.
[ "Returns", "a", "brand", "new", "ExecutorService", "using", "the", "specified", "poolName", "and", "uses", "the", "optional", "property", "named", "to", "set", "the", "maximum", "thread", "pool", "size", ".", "The", "same", "poolName", "may", "be", "used", "...
train
https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/parallel/ParallelIterate.java#L1361-L1364
Drivemode/TypefaceHelper
TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java
TypefaceHelper.setTypeface
public Toast setTypeface(Toast toast, String typefaceName, int style) { """ Set the typeface for the toast view. @param toast toast. @param typefaceName typeface name. @param style the typeface style. @return toast that the typeface is injected. """ setTypeface((ViewGroup) toast.getView(), typefaceName, ...
java
public Toast setTypeface(Toast toast, String typefaceName, int style) { setTypeface((ViewGroup) toast.getView(), typefaceName, style); return toast; }
[ "public", "Toast", "setTypeface", "(", "Toast", "toast", ",", "String", "typefaceName", ",", "int", "style", ")", "{", "setTypeface", "(", "(", "ViewGroup", ")", "toast", ".", "getView", "(", ")", ",", "typefaceName", ",", "style", ")", ";", "return", "t...
Set the typeface for the toast view. @param toast toast. @param typefaceName typeface name. @param style the typeface style. @return toast that the typeface is injected.
[ "Set", "the", "typeface", "for", "the", "toast", "view", "." ]
train
https://github.com/Drivemode/TypefaceHelper/blob/86bef9ce16b9626b7076559e846db1b9f043c008/TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java#L526-L529
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/condition/HttpCondition.java
HttpCondition.getUrl
private URL getUrl(TestContext context) { """ Gets the request url with test variable support. @param context The test context to get the url from @return The extracted url """ try { return new URL(context.replaceDynamicContentInString(this.url)); } catch (MalformedURLException e)...
java
private URL getUrl(TestContext context) { try { return new URL(context.replaceDynamicContentInString(this.url)); } catch (MalformedURLException e) { throw new CitrusRuntimeException("Invalid request url", e); } }
[ "private", "URL", "getUrl", "(", "TestContext", "context", ")", "{", "try", "{", "return", "new", "URL", "(", "context", ".", "replaceDynamicContentInString", "(", "this", ".", "url", ")", ")", ";", "}", "catch", "(", "MalformedURLException", "e", ")", "{"...
Gets the request url with test variable support. @param context The test context to get the url from @return The extracted url
[ "Gets", "the", "request", "url", "with", "test", "variable", "support", "." ]
train
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/condition/HttpCondition.java#L122-L128
tvesalainen/util
util/src/main/java/org/vesalainen/math/Polygon.java
Polygon.isInside
public boolean isInside(double testx, double testy) { """ Returns true if point is inside a polygon. @param testx @param testy @return @see <a href="http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html">PNPOLY - Point Inclusion in Polygon Test W. Randolph Franklin (WRF)</a> """ i...
java
public boolean isInside(double testx, double testy) { if (!bounds.isInside(testx, testy)) { return false; } return isRawHit(points, testx, testy); }
[ "public", "boolean", "isInside", "(", "double", "testx", ",", "double", "testy", ")", "{", "if", "(", "!", "bounds", ".", "isInside", "(", "testx", ",", "testy", ")", ")", "{", "return", "false", ";", "}", "return", "isRawHit", "(", "points", ",", "t...
Returns true if point is inside a polygon. @param testx @param testy @return @see <a href="http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html">PNPOLY - Point Inclusion in Polygon Test W. Randolph Franklin (WRF)</a>
[ "Returns", "true", "if", "point", "is", "inside", "a", "polygon", "." ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/Polygon.java#L72-L79
auth0/Lock.Android
lib/src/main/java/com/auth0/android/lock/internal/configuration/Connection.java
Connection.intValue
private int intValue(@Nullable Object object, int defaultValue) { """ Will try to get the int value of a given object. If the value cannot be obtained, it will return the default value. @param object to get an int from. @param defaultValue to return if the int value cannot be obtained. @return the int v...
java
private int intValue(@Nullable Object object, int defaultValue) { if (object instanceof Number) { return ((Number) object).intValue(); } if (object instanceof String) { return Integer.parseInt((String) object, 10); } return defaultValue; }
[ "private", "int", "intValue", "(", "@", "Nullable", "Object", "object", ",", "int", "defaultValue", ")", "{", "if", "(", "object", "instanceof", "Number", ")", "{", "return", "(", "(", "Number", ")", "object", ")", ".", "intValue", "(", ")", ";", "}", ...
Will try to get the int value of a given object. If the value cannot be obtained, it will return the default value. @param object to get an int from. @param defaultValue to return if the int value cannot be obtained. @return the int value of the object or the default value if it cannot be obtained.
[ "Will", "try", "to", "get", "the", "int", "value", "of", "a", "given", "object", ".", "If", "the", "value", "cannot", "be", "obtained", "it", "will", "return", "the", "default", "value", "." ]
train
https://github.com/auth0/Lock.Android/blob/8eb2a979048d2eb6cf0ec631e82e6c3fe6e7d220/lib/src/main/java/com/auth0/android/lock/internal/configuration/Connection.java#L210-L218
opsmatters/opsmatters-core
src/main/java/com/opsmatters/core/util/DateUtilities.java
DateUtilities.getCalendar
public static Calendar getCalendar(TimeZone tz, Locale locale) { """ Returns a new calendar object using the given timezone and locale. @param tz The timezone associated with the new calendar @param locale The locale associated with the new calendar @return A new calendar object for the given timezone and local...
java
public static Calendar getCalendar(TimeZone tz, Locale locale) { if(tz == null) tz = getCurrentTimeZone(); if(locale == null) locale = getCurrentLocale(); return Calendar.getInstance(tz, locale); }
[ "public", "static", "Calendar", "getCalendar", "(", "TimeZone", "tz", ",", "Locale", "locale", ")", "{", "if", "(", "tz", "==", "null", ")", "tz", "=", "getCurrentTimeZone", "(", ")", ";", "if", "(", "locale", "==", "null", ")", "locale", "=", "getCurr...
Returns a new calendar object using the given timezone and locale. @param tz The timezone associated with the new calendar @param locale The locale associated with the new calendar @return A new calendar object for the given timezone and locale
[ "Returns", "a", "new", "calendar", "object", "using", "the", "given", "timezone", "and", "locale", "." ]
train
https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/DateUtilities.java#L195-L202
apache/groovy
subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java
NioGroovyMethods.eachByte
public static void eachByte(Path self, int bufferLen, @ClosureParams(value = FromString.class, options = "byte[],Integer") Closure closure) throws IOException { """ Traverse through the bytes of this Path, bufferLen bytes at a time. @param self a Path @param bufferLen the length of the buffer to use. @pa...
java
public static void eachByte(Path self, int bufferLen, @ClosureParams(value = FromString.class, options = "byte[],Integer") Closure closure) throws IOException { BufferedInputStream is = newInputStream(self); IOGroovyMethods.eachByte(is, bufferLen, closure); }
[ "public", "static", "void", "eachByte", "(", "Path", "self", ",", "int", "bufferLen", ",", "@", "ClosureParams", "(", "value", "=", "FromString", ".", "class", ",", "options", "=", "\"byte[],Integer\"", ")", "Closure", "closure", ")", "throws", "IOException", ...
Traverse through the bytes of this Path, bufferLen bytes at a time. @param self a Path @param bufferLen the length of the buffer to use. @param closure a 2 parameter closure which is passed the byte[] and a number of bytes successfully read. @throws java.io.IOException if an IOException occurs. @see org.codehau...
[ "Traverse", "through", "the", "bytes", "of", "this", "Path", "bufferLen", "bytes", "at", "a", "time", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java#L1830-L1833
apptik/JustJson
json-core/src/main/java/io/apptik/json/JsonObject.java
JsonObject.optInt
public Integer optInt(String name, Integer fallback) { """ Returns the value mapped by {@code name} if it exists and is an int or can be coerced to an int, or {@code fallback} otherwise. """ return optInt(name, fallback, true); }
java
public Integer optInt(String name, Integer fallback) { return optInt(name, fallback, true); }
[ "public", "Integer", "optInt", "(", "String", "name", ",", "Integer", "fallback", ")", "{", "return", "optInt", "(", "name", ",", "fallback", ",", "true", ")", ";", "}" ]
Returns the value mapped by {@code name} if it exists and is an int or can be coerced to an int, or {@code fallback} otherwise.
[ "Returns", "the", "value", "mapped", "by", "{" ]
train
https://github.com/apptik/JustJson/blob/c90f0dd7f84df26da4749be8cd9b026fff499a79/json-core/src/main/java/io/apptik/json/JsonObject.java#L499-L501
aragozin/jvm-tools
hprof-heap/src/main/java/org/gridkit/jvmtool/util/PagedBitMap.java
PagedBitMap.addWithOverflow
public void addWithOverflow(PagedBitMap that, PagedBitMap overflow) { """ Bitwise <br/> <code>overflow = this & that</code> <br/> <code>this = this | that</code> """ LongArray ta = that.array; LongArray of = overflow.array; long n = 0; while(true) { n = ta.seekNex...
java
public void addWithOverflow(PagedBitMap that, PagedBitMap overflow) { LongArray ta = that.array; LongArray of = overflow.array; long n = 0; while(true) { n = ta.seekNext(n); if (n < 0) { break; } long o = array.get(n) & ta.g...
[ "public", "void", "addWithOverflow", "(", "PagedBitMap", "that", ",", "PagedBitMap", "overflow", ")", "{", "LongArray", "ta", "=", "that", ".", "array", ";", "LongArray", "of", "=", "overflow", ".", "array", ";", "long", "n", "=", "0", ";", "while", "(",...
Bitwise <br/> <code>overflow = this & that</code> <br/> <code>this = this | that</code>
[ "Bitwise", "<br", "/", ">", "<code", ">", "overflow", "=", "this", "&", "that<", "/", "code", ">", "<br", "/", ">", "<code", ">", "this", "=", "this", "|", "that<", "/", "code", ">" ]
train
https://github.com/aragozin/jvm-tools/blob/d3a4d0c6a47fb9317f274988569655f30dcd2f76/hprof-heap/src/main/java/org/gridkit/jvmtool/util/PagedBitMap.java#L125-L143
jnr/jnr-x86asm
src/main/java/jnr/x86asm/SerializerIntrinsics.java
SerializerIntrinsics.mov_ptr
public final void mov_ptr(Register dst, long src) { """ Move byte, word, dword or qword from absolute address @a src to AL, AX, EAX or RAX register. """ assert dst.index() == 0; emitX86(INST_MOV_PTR, dst, Immediate.imm(src)); }
java
public final void mov_ptr(Register dst, long src) { assert dst.index() == 0; emitX86(INST_MOV_PTR, dst, Immediate.imm(src)); }
[ "public", "final", "void", "mov_ptr", "(", "Register", "dst", ",", "long", "src", ")", "{", "assert", "dst", ".", "index", "(", ")", "==", "0", ";", "emitX86", "(", "INST_MOV_PTR", ",", "dst", ",", "Immediate", ".", "imm", "(", "src", ")", ")", ";"...
Move byte, word, dword or qword from absolute address @a src to AL, AX, EAX or RAX register.
[ "Move", "byte", "word", "dword", "or", "qword", "from", "absolute", "address" ]
train
https://github.com/jnr/jnr-x86asm/blob/fdcf68fb3dae49e607a49e33399e3dad1ada5536/src/main/java/jnr/x86asm/SerializerIntrinsics.java#L971-L975
micronaut-projects/micronaut-core
runtime/src/main/java/io/micronaut/discovery/registration/AutoRegistration.java
AutoRegistration.validateName
protected void validateName(String name, String typeDescription) { """ Validate the given application name. @param name The application name @param typeDescription The detailed information about name """ if (!APPLICATION_NAME_PATTERN.matcher(name).matches()) { throw new DiscoveryExcepti...
java
protected void validateName(String name, String typeDescription) { if (!APPLICATION_NAME_PATTERN.matcher(name).matches()) { throw new DiscoveryException(typeDescription + " [" + name + "] must start with a letter, end with a letter or digit and contain only letters, digits or hyphens. Example: foo-b...
[ "protected", "void", "validateName", "(", "String", "name", ",", "String", "typeDescription", ")", "{", "if", "(", "!", "APPLICATION_NAME_PATTERN", ".", "matcher", "(", "name", ")", ".", "matches", "(", ")", ")", "{", "throw", "new", "DiscoveryException", "(...
Validate the given application name. @param name The application name @param typeDescription The detailed information about name
[ "Validate", "the", "given", "application", "name", "." ]
train
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/discovery/registration/AutoRegistration.java#L107-L111
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java
ModelsImpl.getIntentAsync
public Observable<IntentClassifier> getIntentAsync(UUID appId, String versionId, UUID intentId) { """ Gets information about the intent model. @param appId The application ID. @param versionId The version ID. @param intentId The intent classifier ID. @throws IllegalArgumentException thrown if parameters fail...
java
public Observable<IntentClassifier> getIntentAsync(UUID appId, String versionId, UUID intentId) { return getIntentWithServiceResponseAsync(appId, versionId, intentId).map(new Func1<ServiceResponse<IntentClassifier>, IntentClassifier>() { @Override public IntentClassifier call(ServiceResp...
[ "public", "Observable", "<", "IntentClassifier", ">", "getIntentAsync", "(", "UUID", "appId", ",", "String", "versionId", ",", "UUID", "intentId", ")", "{", "return", "getIntentWithServiceResponseAsync", "(", "appId", ",", "versionId", ",", "intentId", ")", ".", ...
Gets information about the intent model. @param appId The application ID. @param versionId The version ID. @param intentId The intent classifier ID. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the IntentClassifier object
[ "Gets", "information", "about", "the", "intent", "model", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L2845-L2852
GerdHolz/TOVAL
src/de/invation/code/toval/math/MathUtils.java
MathUtils.binCoeff
public static long binCoeff(int n, int k) { """ Returns the binomial coefficient.<br> For any set containing n elements, this is the number of distinct k-element subsets of it. @param n Set size @param k Subset size @return The binomial coefficient of <code>n</code> and <code>k</code> """ ...
java
public static long binCoeff(int n, int k) { if (k > n) { return 0; } if (k == 0 || k == n) { return 1; } long result = 1; for (int i = 1; i <= k; i++) { ...
[ "public", "static", "long", "binCoeff", "(", "int", "n", ",", "int", "k", ")", "{", "if", "(", "k", ">", "n", ")", "{", "return", "0", ";", "}", "if", "(", "k", "==", "0", "||", "k", "==", "n", ")", "{", "return", "1", ";", "}", "long", "...
Returns the binomial coefficient.<br> For any set containing n elements, this is the number of distinct k-element subsets of it. @param n Set size @param k Subset size @return The binomial coefficient of <code>n</code> and <code>k</code>
[ "Returns", "the", "binomial", "coefficient", ".", "<br", ">", "For", "any", "set", "containing", "n", "elements", "this", "is", "the", "number", "of", "distinct", "k", "-", "element", "subsets", "of", "it", "." ]
train
https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/math/MathUtils.java#L30-L42
hdbeukel/james-core
src/main/java/org/jamesframework/core/subset/neigh/SingleDeletionNeighbourhood.java
SingleDeletionNeighbourhood.getRandomMove
@Override public SubsetMove getRandomMove(SubsetSolution solution, Random rnd) { """ Generates a random deletion move for the given subset solution that removes a single ID from the selection. Possible fixed IDs are not considered to be removed and the minimum subset size is taken into account. If no deletio...
java
@Override public SubsetMove getRandomMove(SubsetSolution solution, Random rnd) { // check minimum size if(minSizeReached(solution)){ return null; } // get set of candidate IDs for deletion (possibly fixed IDs are discarded) Set<Integer> removeCandidates = getRemov...
[ "@", "Override", "public", "SubsetMove", "getRandomMove", "(", "SubsetSolution", "solution", ",", "Random", "rnd", ")", "{", "// check minimum size", "if", "(", "minSizeReached", "(", "solution", ")", ")", "{", "return", "null", ";", "}", "// get set of candidate ...
Generates a random deletion move for the given subset solution that removes a single ID from the selection. Possible fixed IDs are not considered to be removed and the minimum subset size is taken into account. If no deletion move can be generated, <code>null</code> is returned. @param solution solution for which a ra...
[ "Generates", "a", "random", "deletion", "move", "for", "the", "given", "subset", "solution", "that", "removes", "a", "single", "ID", "from", "the", "selection", ".", "Possible", "fixed", "IDs", "are", "not", "considered", "to", "be", "removed", "and", "the",...
train
https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/subset/neigh/SingleDeletionNeighbourhood.java#L105-L121
phax/ph-pdf-layout
src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java
PDPageContentStreamExt.curveTo1
public void curveTo1 (final float x1, final float y1, final float x3, final float y3) throws IOException { """ Append a cubic Bézier curve to the current path. The curve extends from the current point to the point (x3, y3), using (x1, y1) and (x3, y3) as the Bézier control points. @param x1 x coordinate of t...
java
public void curveTo1 (final float x1, final float y1, final float x3, final float y3) throws IOException { if (inTextMode) { throw new IllegalStateException ("Error: curveTo1 is not allowed within a text block."); } writeOperand (x1); writeOperand (y1); writeOperand (x3); writeOperan...
[ "public", "void", "curveTo1", "(", "final", "float", "x1", ",", "final", "float", "y1", ",", "final", "float", "x3", ",", "final", "float", "y3", ")", "throws", "IOException", "{", "if", "(", "inTextMode", ")", "{", "throw", "new", "IllegalStateException",...
Append a cubic Bézier curve to the current path. The curve extends from the current point to the point (x3, y3), using (x1, y1) and (x3, y3) as the Bézier control points. @param x1 x coordinate of the point 1 @param y1 y coordinate of the point 1 @param x3 x coordinate of the point 3 @param y3 y coordinate of the poin...
[ "Append", "a", "cubic", "Bézier", "curve", "to", "the", "current", "path", ".", "The", "curve", "extends", "from", "the", "current", "point", "to", "the", "point", "(", "x3", "y3", ")", "using", "(", "x1", "y1", ")", "and", "(", "x3", "y3", ")", "a...
train
https://github.com/phax/ph-pdf-layout/blob/777d9f3a131cbe8f592c0de1cf554084e541bb54/src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java#L1197-L1208
apache/groovy
subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java
DateTimeExtensions.rightShift
public static Period rightShift(final LocalDate self, LocalDate other) { """ Returns a {@link java.time.Period} equivalent to the time between this date (inclusive) and the provided {@link java.time.LocalDate} (exclusive). @param self a LocalDate @param other another LocalDate @return a Period representing ...
java
public static Period rightShift(final LocalDate self, LocalDate other) { return Period.between(self, other); }
[ "public", "static", "Period", "rightShift", "(", "final", "LocalDate", "self", ",", "LocalDate", "other", ")", "{", "return", "Period", ".", "between", "(", "self", ",", "other", ")", ";", "}" ]
Returns a {@link java.time.Period} equivalent to the time between this date (inclusive) and the provided {@link java.time.LocalDate} (exclusive). @param self a LocalDate @param other another LocalDate @return a Period representing the time between the two LocalDates @since 2.5.0
[ "Returns", "a", "{", "@link", "java", ".", "time", ".", "Period", "}", "equivalent", "to", "the", "time", "between", "this", "date", "(", "inclusive", ")", "and", "the", "provided", "{", "@link", "java", ".", "time", ".", "LocalDate", "}", "(", "exclus...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java#L612-L614
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java
ImageIOHelper.mergeTiff
public static void mergeTiff(List<IIOImage> imageList, File outputTiff) throws IOException { """ Merges multiple images into one multi-page TIFF image. @param imageList a list of <code>IIOImage</code> objects @param outputTiff the output TIFF file @throws IOException """ mergeTiff(imageList, outpu...
java
public static void mergeTiff(List<IIOImage> imageList, File outputTiff) throws IOException { mergeTiff(imageList, outputTiff, null); }
[ "public", "static", "void", "mergeTiff", "(", "List", "<", "IIOImage", ">", "imageList", ",", "File", "outputTiff", ")", "throws", "IOException", "{", "mergeTiff", "(", "imageList", ",", "outputTiff", ",", "null", ")", ";", "}" ]
Merges multiple images into one multi-page TIFF image. @param imageList a list of <code>IIOImage</code> objects @param outputTiff the output TIFF file @throws IOException
[ "Merges", "multiple", "images", "into", "one", "multi", "-", "page", "TIFF", "image", "." ]
train
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java#L534-L536
Azure/azure-sdk-for-java
sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/BackupShortTermRetentionPoliciesInner.java
BackupShortTermRetentionPoliciesInner.createOrUpdateAsync
public Observable<BackupShortTermRetentionPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, Integer retentionDays) { """ Updates a database's short term retention policy. @param resourceGroupName The name of the resource group that contains the resource. You can ...
java
public Observable<BackupShortTermRetentionPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, Integer retentionDays) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, retentionDays).map(new Func1<ServiceResponse<BackupShor...
[ "public", "Observable", "<", "BackupShortTermRetentionPolicyInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "databaseName", ",", "Integer", "retentionDays", ")", "{", "return", "createOrUpdateWithServiceRes...
Updates a database's short term retention policy. @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 retentionDays...
[ "Updates", "a", "database", "s", "short", "term", "retention", "policy", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/BackupShortTermRetentionPoliciesInner.java#L307-L314
stagemonitor/stagemonitor
stagemonitor-core/src/main/java/org/stagemonitor/core/metrics/metrics2/Metric2Registry.java
Metric2Registry.registerNewMetrics
public void registerNewMetrics(MetricName name, Metric metric) { """ Only registers the metric if it is not already registered @param name the name of the metric @param metric the metric """ final Set<MetricName> registeredNames = getNames(); if (!registeredNames.contains(name)) { try { register...
java
public void registerNewMetrics(MetricName name, Metric metric) { final Set<MetricName> registeredNames = getNames(); if (!registeredNames.contains(name)) { try { register(name, metric); } catch (IllegalArgumentException e){/* exception due to race condition*/} } }
[ "public", "void", "registerNewMetrics", "(", "MetricName", "name", ",", "Metric", "metric", ")", "{", "final", "Set", "<", "MetricName", ">", "registeredNames", "=", "getNames", "(", ")", ";", "if", "(", "!", "registeredNames", ".", "contains", "(", "name", ...
Only registers the metric if it is not already registered @param name the name of the metric @param metric the metric
[ "Only", "registers", "the", "metric", "if", "it", "is", "not", "already", "registered" ]
train
https://github.com/stagemonitor/stagemonitor/blob/7a1bf6848906f816aa465983f602ea1f1e8f2b7b/stagemonitor-core/src/main/java/org/stagemonitor/core/metrics/metrics2/Metric2Registry.java#L99-L106
Azure/azure-sdk-for-java
automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/VariablesInner.java
VariablesInner.createOrUpdateAsync
public Observable<VariableInner> createOrUpdateAsync(String resourceGroupName, String automationAccountName, String variableName, VariableCreateOrUpdateParameters parameters) { """ Create a variable. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automati...
java
public Observable<VariableInner> createOrUpdateAsync(String resourceGroupName, String automationAccountName, String variableName, VariableCreateOrUpdateParameters parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, automationAccountName, variableName, parameters).map(new Func1<Service...
[ "public", "Observable", "<", "VariableInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "automationAccountName", ",", "String", "variableName", ",", "VariableCreateOrUpdateParameters", "parameters", ")", "{", "return", "createOrUpdateWit...
Create a variable. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @param variableName The variable name. @param parameters The parameters supplied to the create or update variable operation. @throws IllegalArgumentException thrown if parameter...
[ "Create", "a", "variable", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/VariablesInner.java#L134-L141
AzureAD/azure-activedirectory-library-for-java
src/main/java/com/microsoft/aad/adal4j/AuthenticationContext.java
AuthenticationContext.acquireToken
public Future<AuthenticationResult> acquireToken(final String resource, final UserAssertion userAssertion, final AsymmetricKeyCredential credential, final Aut...
java
public Future<AuthenticationResult> acquireToken(final String resource, final UserAssertion userAssertion, final AsymmetricKeyCredential credential, final Aut...
[ "public", "Future", "<", "AuthenticationResult", ">", "acquireToken", "(", "final", "String", "resource", ",", "final", "UserAssertion", "userAssertion", ",", "final", "AsymmetricKeyCredential", "credential", ",", "final", "AuthenticationCallback", "callback", ")", "{",...
Acquires an access token from the authority on behalf of a user. It requires using a user token previously received. Uses certificate to authenticate client. @param resource Identifier of the target resource that is the recipient of the requested token. @param userAssertion userAssertion to use as Authorization grant ...
[ "Acquires", "an", "access", "token", "from", "the", "authority", "on", "behalf", "of", "a", "user", ".", "It", "requires", "using", "a", "user", "token", "previously", "received", ".", "Uses", "certificate", "to", "authenticate", "client", "." ]
train
https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/7f0004fee6faee5818e75623113993a267ceb1c4/src/main/java/com/microsoft/aad/adal4j/AuthenticationContext.java#L297-L307
googleapis/cloud-bigtable-client
bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/metrics/DropwizardMetricRegistry.java
DropwizardMetricRegistry.createSlf4jReporter
public static void createSlf4jReporter(DropwizardMetricRegistry registry, Logger logger, long period, TimeUnit unit) { """ Creates a {@link DropwizardMetricRegistry} with an {@link Slf4jReporter}. Only non-zero metrics will be logged to the {@link Slf4jReporter}. @param registry The registry on which to...
java
public static void createSlf4jReporter(DropwizardMetricRegistry registry, Logger logger, long period, TimeUnit unit) { MetricFilter nonZeroMatcher = new MetricFilter() { @Override public boolean matches(String name, Metric metric) { if (metric instanceof Counting) { ...
[ "public", "static", "void", "createSlf4jReporter", "(", "DropwizardMetricRegistry", "registry", ",", "Logger", "logger", ",", "long", "period", ",", "TimeUnit", "unit", ")", "{", "MetricFilter", "nonZeroMatcher", "=", "new", "MetricFilter", "(", ")", "{", "@", "...
Creates a {@link DropwizardMetricRegistry} with an {@link Slf4jReporter}. Only non-zero metrics will be logged to the {@link Slf4jReporter}. @param registry The registry on which to add the reporter. @param logger The {@link Logger} to report to @param period the amount of time between polls @param unit the unit fo...
[ "Creates", "a", "{", "@link", "DropwizardMetricRegistry", "}", "with", "an", "{", "@link", "Slf4jReporter", "}", ".", "Only", "non", "-", "zero", "metrics", "will", "be", "logged", "to", "the", "{", "@link", "Slf4jReporter", "}", "." ]
train
https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/metrics/DropwizardMetricRegistry.java#L40-L60
mgm-tp/jfunk
jfunk-common/src/main/java/com/mgmtp/jfunk/common/config/BaseScope.java
BaseScope.performDisposal
protected void performDisposal(final Map<Key<?>, Object> scopeMap) { """ Iterates over the entries of the specified map calling potentially registered {@link Disposable}s. @param scopeMap the scope map """ for (Entry<Key<?>, Object> entry : scopeMap.entrySet()) { Key<?> key = entry.getKey(); // w...
java
protected void performDisposal(final Map<Key<?>, Object> scopeMap) { for (Entry<Key<?>, Object> entry : scopeMap.entrySet()) { Key<?> key = entry.getKey(); // warning can be safely suppressed, we always get a Disposable and // the type parameter <Object> does not hurt here at runtime @SuppressWarnings("u...
[ "protected", "void", "performDisposal", "(", "final", "Map", "<", "Key", "<", "?", ">", ",", "Object", ">", "scopeMap", ")", "{", "for", "(", "Entry", "<", "Key", "<", "?", ">", ",", "Object", ">", "entry", ":", "scopeMap", ".", "entrySet", "(", ")...
Iterates over the entries of the specified map calling potentially registered {@link Disposable}s. @param scopeMap the scope map
[ "Iterates", "over", "the", "entries", "of", "the", "specified", "map", "calling", "potentially", "registered", "{", "@link", "Disposable", "}", "s", "." ]
train
https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/config/BaseScope.java#L89-L101
lagom/lagom
dev/service-registry/client-javadsl/src/main/java/com/lightbend/lagom/internal/javadsl/registry/RegisteredService.java
RegisteredService.of
public static RegisteredService of(String name, URI url, Optional<String> portName) { """ Construct a new immutable {@code RegisteredService} instance. @param name The value for the {@code name} attribute @param url The value for the {@code url} attribute @return An immutable RegisteredService instance "...
java
public static RegisteredService of(String name, URI url, Optional<String> portName) { return new RegisteredService(name, url, portName); }
[ "public", "static", "RegisteredService", "of", "(", "String", "name", ",", "URI", "url", ",", "Optional", "<", "String", ">", "portName", ")", "{", "return", "new", "RegisteredService", "(", "name", ",", "url", ",", "portName", ")", ";", "}" ]
Construct a new immutable {@code RegisteredService} instance. @param name The value for the {@code name} attribute @param url The value for the {@code url} attribute @return An immutable RegisteredService instance
[ "Construct", "a", "new", "immutable", "{", "@code", "RegisteredService", "}", "instance", "." ]
train
https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/dev/service-registry/client-javadsl/src/main/java/com/lightbend/lagom/internal/javadsl/registry/RegisteredService.java#L72-L74
gitblit/fathom
fathom-xmlrpc/src/main/java/fathom/xmlrpc/XmlRpcMethodRegistrar.java
XmlRpcMethodRegistrar.addDefaultMethodGroup
public void addDefaultMethodGroup(Class<?> methodGroupClass) { """ Add @XmlRpc methods from this class to the default method handler. @param methodGroupClass """ Object methodsObject = injector.getInstance(methodGroupClass); methodGroups.put(defaultMethods, new XmlRpcMethodInvoker("", method...
java
public void addDefaultMethodGroup(Class<?> methodGroupClass) { Object methodsObject = injector.getInstance(methodGroupClass); methodGroups.put(defaultMethods, new XmlRpcMethodInvoker("", methodGroupClass, methodsObject)); }
[ "public", "void", "addDefaultMethodGroup", "(", "Class", "<", "?", ">", "methodGroupClass", ")", "{", "Object", "methodsObject", "=", "injector", ".", "getInstance", "(", "methodGroupClass", ")", ";", "methodGroups", ".", "put", "(", "defaultMethods", ",", "new"...
Add @XmlRpc methods from this class to the default method handler. @param methodGroupClass
[ "Add", "@XmlRpc", "methods", "from", "this", "class", "to", "the", "default", "method", "handler", "." ]
train
https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-xmlrpc/src/main/java/fathom/xmlrpc/XmlRpcMethodRegistrar.java#L50-L53
classgraph/classgraph
src/main/java/io/github/classgraph/ClassInfo.java
ClassInfo.addScannedClass
static ClassInfo addScannedClass(final String className, final int classModifiers, final boolean isExternalClass, final Map<String, ClassInfo> classNameToClassInfo, final ClasspathElement classpathElement, final Resource classfileResource) { """ Add a class that has just been scanned (as op...
java
static ClassInfo addScannedClass(final String className, final int classModifiers, final boolean isExternalClass, final Map<String, ClassInfo> classNameToClassInfo, final ClasspathElement classpathElement, final Resource classfileResource) { ClassInfo classInfo = classNameToClassInfo.get...
[ "static", "ClassInfo", "addScannedClass", "(", "final", "String", "className", ",", "final", "int", "classModifiers", ",", "final", "boolean", "isExternalClass", ",", "final", "Map", "<", "String", ",", "ClassInfo", ">", "classNameToClassInfo", ",", "final", "Clas...
Add a class that has just been scanned (as opposed to just referenced by a scanned class). Not threadsafe, should be run in single threaded context. @param className the class name @param classModifiers the class modifiers @param isExternalClass true if this is an external class @param classNameToClassInfo the map fro...
[ "Add", "a", "class", "that", "has", "just", "been", "scanned", "(", "as", "opposed", "to", "just", "referenced", "by", "a", "scanned", "class", ")", ".", "Not", "threadsafe", "should", "be", "run", "in", "single", "threaded", "context", "." ]
train
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassInfo.java#L579-L612
b3dgs/lionengine
lionengine-core-awt/src/main/java/com/b3dgs/lionengine/awt/graphic/ToolsAwt.java
ToolsAwt.createHiddenCursor
public static Cursor createHiddenCursor() { """ Create a hidden cursor. @return Hidden cursor, or default cursor if not able to create it. """ final Toolkit toolkit = Toolkit.getDefaultToolkit(); final Dimension dim = toolkit.getBestCursorSize(1, 1); final BufferedImage c = create...
java
public static Cursor createHiddenCursor() { final Toolkit toolkit = Toolkit.getDefaultToolkit(); final Dimension dim = toolkit.getBestCursorSize(1, 1); final BufferedImage c = createImage(Math.max(1, dim.width), Math.max(1, dim.height), ...
[ "public", "static", "Cursor", "createHiddenCursor", "(", ")", "{", "final", "Toolkit", "toolkit", "=", "Toolkit", ".", "getDefaultToolkit", "(", ")", ";", "final", "Dimension", "dim", "=", "toolkit", ".", "getBestCursorSize", "(", "1", ",", "1", ")", ";", ...
Create a hidden cursor. @return Hidden cursor, or default cursor if not able to create it.
[ "Create", "a", "hidden", "cursor", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core-awt/src/main/java/com/b3dgs/lionengine/awt/graphic/ToolsAwt.java#L364-L373
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/lang/ClassHelper.java
ClassHelper.areConvertibleClasses
public static boolean areConvertibleClasses (@Nonnull final Class <?> aSrcClass, @Nonnull final Class <?> aDstClass) { """ Check if the passed classes are convertible. Includes conversion checks between primitive types and primitive wrapper types. @param aSrcClass First class. May not be <code>null</code>. @...
java
public static boolean areConvertibleClasses (@Nonnull final Class <?> aSrcClass, @Nonnull final Class <?> aDstClass) { ValueEnforcer.notNull (aSrcClass, "SrcClass"); ValueEnforcer.notNull (aDstClass, "DstClass"); // Same class? if (aDstClass.equals (aSrcClass)) return true; // Default assi...
[ "public", "static", "boolean", "areConvertibleClasses", "(", "@", "Nonnull", "final", "Class", "<", "?", ">", "aSrcClass", ",", "@", "Nonnull", "final", "Class", "<", "?", ">", "aDstClass", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aSrcClass", ",", ...
Check if the passed classes are convertible. Includes conversion checks between primitive types and primitive wrapper types. @param aSrcClass First class. May not be <code>null</code>. @param aDstClass Second class. May not be <code>null</code>. @return <code>true</code> if the classes are directly convertible.
[ "Check", "if", "the", "passed", "classes", "are", "convertible", ".", "Includes", "conversion", "checks", "between", "primitive", "types", "and", "primitive", "wrapper", "types", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/ClassHelper.java#L284-L305
cdk/cdk
legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java
GeometryTools.getClosestAtom
public static IAtom getClosestAtom(double xPosition, double yPosition, IAtomContainer atomCon, IAtom toignore) { """ Returns the atom of the given molecule that is closest to the given coordinates and is not the atom. See comment for center(IAtomContainer atomCon, Dimension areaDim, HashMap renderingCoordinates)...
java
public static IAtom getClosestAtom(double xPosition, double yPosition, IAtomContainer atomCon, IAtom toignore) { IAtom closestAtom = null; IAtom currentAtom; // we compare squared distances, allowing us to do one sqrt() // calculation less double smallestSquaredMouseDistance = -1...
[ "public", "static", "IAtom", "getClosestAtom", "(", "double", "xPosition", ",", "double", "yPosition", ",", "IAtomContainer", "atomCon", ",", "IAtom", "toignore", ")", "{", "IAtom", "closestAtom", "=", "null", ";", "IAtom", "currentAtom", ";", "// we compare squar...
Returns the atom of the given molecule that is closest to the given coordinates and is not the atom. See comment for center(IAtomContainer atomCon, Dimension areaDim, HashMap renderingCoordinates) for details on coordinate sets @param xPosition The x coordinate @param yPosition The y coordinate @param atomCon ...
[ "Returns", "the", "atom", "of", "the", "given", "molecule", "that", "is", "closest", "to", "the", "given", "coordinates", "and", "is", "not", "the", "atom", ".", "See", "comment", "for", "center", "(", "IAtomContainer", "atomCon", "Dimension", "areaDim", "Ha...
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java#L735-L757
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/os390/OS390CCompiler.java
OS390CCompiler.buildDefineArguments
@Override protected void buildDefineArguments(final CompilerDef[] defs, final Vector<String> args) { """ The buildDefineArguments implementation CommandLineCCompiler is not good for us because os390 defines are give by -D definex instead of /Ddefinex, 2 args not 1! since we implement this ourslefs, we do not ...
java
@Override protected void buildDefineArguments(final CompilerDef[] defs, final Vector<String> args) { // // assume that we aren't inheriting defines from containing <cc> // UndefineArgument[] merged = defs[0].getActiveDefines(); for (int i = 1; i < defs.length; i++) { // // if we are in...
[ "@", "Override", "protected", "void", "buildDefineArguments", "(", "final", "CompilerDef", "[", "]", "defs", ",", "final", "Vector", "<", "String", ">", "args", ")", "{", "//", "// assume that we aren't inheriting defines from containing <cc>", "//", "UndefineArgument",...
The buildDefineArguments implementation CommandLineCCompiler is not good for us because os390 defines are give by -D definex instead of /Ddefinex, 2 args not 1! since we implement this ourslefs, we do not have to implement the getDefineSwitch() and the getUndefineSwitch().
[ "The", "buildDefineArguments", "implementation", "CommandLineCCompiler", "is", "not", "good", "for", "us", "because", "os390", "defines", "are", "give", "by", "-", "D", "definex", "instead", "of", "/", "Ddefinex", "2", "args", "not", "1!", "since", "we", "impl...
train
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/os390/OS390CCompiler.java#L99-L127
timols/java-gitlab-api
src/main/java/org/gitlab/api/GitlabAPI.java
GitlabAPI.updateRepositoryFile
public GitlabSimpleRepositoryFile updateRepositoryFile(GitlabProject project, String path, String branchName, String commitMsg, String content) throws IOException { """ Updates the content of an existing file in the repository @param project The Project @param path The file path inside the repository ...
java
public GitlabSimpleRepositoryFile updateRepositoryFile(GitlabProject project, String path, String branchName, String commitMsg, String content) throws IOException { String tailUrl = GitlabProject.URL + "/" + project.getId() + "/repository/files/" + sanitizePath(path); GitlabHTTPRequestor requestor = ret...
[ "public", "GitlabSimpleRepositoryFile", "updateRepositoryFile", "(", "GitlabProject", "project", ",", "String", "path", ",", "String", "branchName", ",", "String", "commitMsg", ",", "String", "content", ")", "throws", "IOException", "{", "String", "tailUrl", "=", "G...
Updates the content of an existing file in the repository @param project The Project @param path The file path inside the repository @param branchName The name of a repository branch @param commitMsg The commit message @param content The base64 encoded content of the file @throws IOException on gitlab api...
[ "Updates", "the", "content", "of", "an", "existing", "file", "in", "the", "repository" ]
train
https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L2229-L2239
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/string/StringParser.java
StringParser.parseLong
public static long parseLong (@Nullable final Object aObject, @Nonnegative final int nRadix, final long nDefault) { """ Parse the given {@link Object} as long with the specified radix. @param aObject The object to parse. May be <code>null</code>. @param nRadix The radix to use. Must be &ge; {@link Character#...
java
public static long parseLong (@Nullable final Object aObject, @Nonnegative final int nRadix, final long nDefault) { if (aObject == null) return nDefault; if (aObject instanceof Number) return ((Number) aObject).longValue (); return parseLong (aObject.toString (), nRadix, nDefault); }
[ "public", "static", "long", "parseLong", "(", "@", "Nullable", "final", "Object", "aObject", ",", "@", "Nonnegative", "final", "int", "nRadix", ",", "final", "long", "nDefault", ")", "{", "if", "(", "aObject", "==", "null", ")", "return", "nDefault", ";", ...
Parse the given {@link Object} as long with the specified radix. @param aObject The object to parse. May be <code>null</code>. @param nRadix The radix to use. Must be &ge; {@link Character#MIN_RADIX} and &le; {@link Character#MAX_RADIX}. @param nDefault The default value to be returned if the passed object could not b...
[ "Parse", "the", "given", "{", "@link", "Object", "}", "as", "long", "with", "the", "specified", "radix", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L998-L1005
googleapis/google-cloud-java
google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionAddressId.java
RegionAddressId.of
public static RegionAddressId of(String project, String region, String address) { """ Returns a region address identity given project, region and address names. The address name must be 1-63 characters long and comply with RFC1035. Specifically, the name must match the regular expression {@code [a-z]([-a-z0-9]*[...
java
public static RegionAddressId of(String project, String region, String address) { return new RegionAddressId(project, region, address); }
[ "public", "static", "RegionAddressId", "of", "(", "String", "project", ",", "String", "region", ",", "String", "address", ")", "{", "return", "new", "RegionAddressId", "(", "project", ",", "region", ",", "address", ")", ";", "}" ]
Returns a region address identity given project, region and address names. The address name must be 1-63 characters long and comply with RFC1035. Specifically, the name must match the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, and all following char...
[ "Returns", "a", "region", "address", "identity", "given", "project", "region", "and", "address", "names", ".", "The", "address", "name", "must", "be", "1", "-", "63", "characters", "long", "and", "comply", "with", "RFC1035", ".", "Specifically", "the", "name...
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionAddressId.java#L125-L127
googleapis/google-cloud-java
google-cloud-clients/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/CloudTasksClient.java
CloudTasksClient.acknowledgeTask
public final void acknowledgeTask(String name, Timestamp scheduleTime) { """ Acknowledges a pull task. <p>The worker, that is, the entity that [leased][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] this task must call this method to indicate that the work associated with the task has finished. <p>The w...
java
public final void acknowledgeTask(String name, Timestamp scheduleTime) { AcknowledgeTaskRequest request = AcknowledgeTaskRequest.newBuilder().setName(name).setScheduleTime(scheduleTime).build(); acknowledgeTask(request); }
[ "public", "final", "void", "acknowledgeTask", "(", "String", "name", ",", "Timestamp", "scheduleTime", ")", "{", "AcknowledgeTaskRequest", "request", "=", "AcknowledgeTaskRequest", ".", "newBuilder", "(", ")", ".", "setName", "(", "name", ")", ".", "setScheduleTim...
Acknowledges a pull task. <p>The worker, that is, the entity that [leased][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] this task must call this method to indicate that the work associated with the task has finished. <p>The worker must acknowledge a task within the [lease_duration][google.cloud.tasks.v2beta2.Lea...
[ "Acknowledges", "a", "pull", "task", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/CloudTasksClient.java#L2243-L2248
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.ifObjectsEqual
public static InsnList ifObjectsEqual(InsnList lhs, InsnList rhs, InsnList action) { """ Compares two objects and performs some action if the objects are the same (uses == to check if same, not the equals method). @param lhs left hand side instruction list -- must leave an object on the stack @param rhs right ha...
java
public static InsnList ifObjectsEqual(InsnList lhs, InsnList rhs, InsnList action) { Validate.notNull(lhs); Validate.notNull(rhs); Validate.notNull(action); InsnList ret = new InsnList(); LabelNode notEqualLabelNode = new LabelNode(); r...
[ "public", "static", "InsnList", "ifObjectsEqual", "(", "InsnList", "lhs", ",", "InsnList", "rhs", ",", "InsnList", "action", ")", "{", "Validate", ".", "notNull", "(", "lhs", ")", ";", "Validate", ".", "notNull", "(", "rhs", ")", ";", "Validate", ".", "n...
Compares two objects and performs some action if the objects are the same (uses == to check if same, not the equals method). @param lhs left hand side instruction list -- must leave an object on the stack @param rhs right hand side instruction list -- must leave an object on the stack @param action action to perform if...
[ "Compares", "two", "objects", "and", "performs", "some", "action", "if", "the", "objects", "are", "the", "same", "(", "uses", "==", "to", "check", "if", "same", "not", "the", "equals", "method", ")", "." ]
train
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L648-L665
google/closure-compiler
src/com/google/javascript/jscomp/BranchCoverageInstrumentationCallback.java
BranchCoverageInstrumentationCallback.newBranchInstrumentationNode
private Node newBranchInstrumentationNode(NodeTraversal traversal, Node node, int idx) { """ Create an assignment to the branch coverage data for the given index into the array. @return the newly constructed assignment node. """ String arrayName = createArrayName(traversal); // Create instrumentati...
java
private Node newBranchInstrumentationNode(NodeTraversal traversal, Node node, int idx) { String arrayName = createArrayName(traversal); // Create instrumentation Node Node getElemNode = IR.getelem(IR.name(arrayName), IR.number(idx)); // Make line number 0-based Node exprNode = IR.exprResult(IR.assign(g...
[ "private", "Node", "newBranchInstrumentationNode", "(", "NodeTraversal", "traversal", ",", "Node", "node", ",", "int", "idx", ")", "{", "String", "arrayName", "=", "createArrayName", "(", "traversal", ")", ";", "// Create instrumentation Node", "Node", "getElemNode", ...
Create an assignment to the branch coverage data for the given index into the array. @return the newly constructed assignment node.
[ "Create", "an", "assignment", "to", "the", "branch", "coverage", "data", "for", "the", "given", "index", "into", "the", "array", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/BranchCoverageInstrumentationCallback.java#L145-L158
BioPAX/Paxtools
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/ModificationChangeConstraint.java
ModificationChangeConstraint.satisfies
@Override public boolean satisfies(Match match, int... ind) { """ Checks the any of the changed modifications match to any of the desired modifications. @param match current pattern match @param ind mapped indices @return true if a modification change is among desired modifications """ PhysicalEntity pe1...
java
@Override public boolean satisfies(Match match, int... ind) { PhysicalEntity pe1 = (PhysicalEntity) match.get(ind[0]); PhysicalEntity pe2 = (PhysicalEntity) match.get(ind[1]); Set<ModificationFeature>[] mods = DifferentialModificationUtil.getChangedModifications(pe1, pe2); Set<String> terms; if (type ...
[ "@", "Override", "public", "boolean", "satisfies", "(", "Match", "match", ",", "int", "...", "ind", ")", "{", "PhysicalEntity", "pe1", "=", "(", "PhysicalEntity", ")", "match", ".", "get", "(", "ind", "[", "0", "]", ")", ";", "PhysicalEntity", "pe2", "...
Checks the any of the changed modifications match to any of the desired modifications. @param match current pattern match @param ind mapped indices @return true if a modification change is among desired modifications
[ "Checks", "the", "any", "of", "the", "changed", "modifications", "match", "to", "any", "of", "the", "desired", "modifications", "." ]
train
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/ModificationChangeConstraint.java#L59-L75
deeplearning4j/deeplearning4j
datavec/datavec-spark/src/main/java/org/datavec/spark/storage/SparkStorageUtils.java
SparkStorageUtils.saveSequenceFile
public static void saveSequenceFile(String path, JavaRDD<List<Writable>> rdd, Integer maxOutputFiles) { """ Save a {@code JavaRDD<List<Writable>>} to a Hadoop {@link org.apache.hadoop.io.SequenceFile}. Each record is given a unique (but noncontiguous) {@link LongWritable} key, and values are stored as {@link Rec...
java
public static void saveSequenceFile(String path, JavaRDD<List<Writable>> rdd, Integer maxOutputFiles) { path = FilenameUtils.normalize(path, true); if (maxOutputFiles != null) { rdd = rdd.coalesce(maxOutputFiles); } JavaPairRDD<List<Writable>, Long> dataIndexPairs = rdd.zipW...
[ "public", "static", "void", "saveSequenceFile", "(", "String", "path", ",", "JavaRDD", "<", "List", "<", "Writable", ">", ">", "rdd", ",", "Integer", "maxOutputFiles", ")", "{", "path", "=", "FilenameUtils", ".", "normalize", "(", "path", ",", "true", ")",...
Save a {@code JavaRDD<List<Writable>>} to a Hadoop {@link org.apache.hadoop.io.SequenceFile}. Each record is given a unique (but noncontiguous) {@link LongWritable} key, and values are stored as {@link RecordWritable} instances. <p> Use {@link #restoreSequenceFile(String, JavaSparkContext)} to restore values saved with...
[ "Save", "a", "{", "@code", "JavaRDD<List<Writable", ">>", "}", "to", "a", "Hadoop", "{", "@link", "org", ".", "apache", ".", "hadoop", ".", "io", ".", "SequenceFile", "}", ".", "Each", "record", "is", "given", "a", "unique", "(", "but", "noncontiguous", ...
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/storage/SparkStorageUtils.java#L92-L103
elki-project/elki
elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/strings/LevenshteinDistanceFunction.java
LevenshteinDistanceFunction.levenshteinDistance
public static int levenshteinDistance(String o1, String o2, int prefix, int postfix) { """ Compute the Levenshtein distance, except for prefix and postfix. @param o1 First object @param o2 Second object @param prefix Prefix length @param postfix Postfix length @return Levenshtein distance """ final ...
java
public static int levenshteinDistance(String o1, String o2, int prefix, int postfix) { final int l1 = o1.length(), l2 = o2.length(); // Buffer, interleaved. Even and odd values are our rows. int[] buf = new int[(l2 + 1 - (prefix + postfix)) << 1]; // Initial "row", on even positions for(int j = 0; j...
[ "public", "static", "int", "levenshteinDistance", "(", "String", "o1", ",", "String", "o2", ",", "int", "prefix", ",", "int", "postfix", ")", "{", "final", "int", "l1", "=", "o1", ".", "length", "(", ")", ",", "l2", "=", "o2", ".", "length", "(", "...
Compute the Levenshtein distance, except for prefix and postfix. @param o1 First object @param o2 Second object @param prefix Prefix length @param postfix Postfix length @return Levenshtein distance
[ "Compute", "the", "Levenshtein", "distance", "except", "for", "prefix", "and", "postfix", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/strings/LevenshteinDistanceFunction.java#L150-L167
GoogleCloudPlatform/appengine-pipelines
java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java
PipelineManager.cancelJob
public static void cancelJob(String jobHandle) throws NoSuchObjectException { """ Sends cancellation request to the root job. @param jobHandle The handle of a job @throws NoSuchObjectException If a JobRecord with the given handle cannot be found in the data store. """ checkNonEmpty(jobHandle, "jobHand...
java
public static void cancelJob(String jobHandle) throws NoSuchObjectException { checkNonEmpty(jobHandle, "jobHandle"); Key key = KeyFactory.createKey(JobRecord.DATA_STORE_KIND, jobHandle); JobRecord jobRecord = backEnd.queryJob(key, InflationType.NONE); CancelJobTask cancelJobTask = new CancelJobTask(key,...
[ "public", "static", "void", "cancelJob", "(", "String", "jobHandle", ")", "throws", "NoSuchObjectException", "{", "checkNonEmpty", "(", "jobHandle", ",", "\"jobHandle\"", ")", ";", "Key", "key", "=", "KeyFactory", ".", "createKey", "(", "JobRecord", ".", "DATA_S...
Sends cancellation request to the root job. @param jobHandle The handle of a job @throws NoSuchObjectException If a JobRecord with the given handle cannot be found in the data store.
[ "Sends", "cancellation", "request", "to", "the", "root", "job", "." ]
train
https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java#L382-L392
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java
AbstractExtraLanguageGenerator.getExpectedType
protected LightweightTypeReference getExpectedType(XtendExecutable executable, JvmTypeReference declaredReturnType) { """ Replies the expected type of the given executable. @param executable the executable. @param declaredReturnType the declared return type, if one. @return the expected type or {@code null} i...
java
protected LightweightTypeReference getExpectedType(XtendExecutable executable, JvmTypeReference declaredReturnType) { if (declaredReturnType == null) { // Try to get any inferred return type. if (executable instanceof XtendFunction) { final XtendFunction function = (XtendFunction) executable; final JvmO...
[ "protected", "LightweightTypeReference", "getExpectedType", "(", "XtendExecutable", "executable", ",", "JvmTypeReference", "declaredReturnType", ")", "{", "if", "(", "declaredReturnType", "==", "null", ")", "{", "// Try to get any inferred return type.", "if", "(", "executa...
Replies the expected type of the given executable. @param executable the executable. @param declaredReturnType the declared return type, if one. @return the expected type or {@code null} if none ({@code void}).
[ "Replies", "the", "expected", "type", "of", "the", "given", "executable", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java#L789-L808
teatrove/teatrove
build-tools/package-info-maven-plugin/src/main/java/org/teatrove/maven/plugins/packageinfo/PackageInfoMojo.java
PackageInfoMojo.writePackageInfos
private void writePackageInfos( File rootDir, File outputDir ) throws MojoExecutionException { """ recurse into rootDir writing PackageInfos on the way in. @param rootDir The root directory for the source @param outputDir The root directory to output to @throws org.apache.maven.plugin.MojoExecutionExcep...
java
private void writePackageInfos( File rootDir, File outputDir ) throws MojoExecutionException { getLog().debug( "in writePackageInfos(" + rootDir + ", " + outputDir + ")" ); try { if ( shouldWritePackageInfo( rootDir ) ) { if( !outputDir.exists...
[ "private", "void", "writePackageInfos", "(", "File", "rootDir", ",", "File", "outputDir", ")", "throws", "MojoExecutionException", "{", "getLog", "(", ")", ".", "debug", "(", "\"in writePackageInfos(\"", "+", "rootDir", "+", "\", \"", "+", "outputDir", "+", "\")...
recurse into rootDir writing PackageInfos on the way in. @param rootDir The root directory for the source @param outputDir The root directory to output to @throws org.apache.maven.plugin.MojoExecutionException
[ "recurse", "into", "rootDir", "writing", "PackageInfos", "on", "the", "way", "in", "." ]
train
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/build-tools/package-info-maven-plugin/src/main/java/org/teatrove/maven/plugins/packageinfo/PackageInfoMojo.java#L197-L238
liferay/com-liferay-commerce
commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceRegionPersistenceImpl.java
CommerceRegionPersistenceImpl.removeByC_C
@Override public CommerceRegion removeByC_C(long commerceCountryId, String code) throws NoSuchRegionException { """ Removes the commerce region where commerceCountryId = &#63; and code = &#63; from the database. @param commerceCountryId the commerce country ID @param code the code @return the commerce regi...
java
@Override public CommerceRegion removeByC_C(long commerceCountryId, String code) throws NoSuchRegionException { CommerceRegion commerceRegion = findByC_C(commerceCountryId, code); return remove(commerceRegion); }
[ "@", "Override", "public", "CommerceRegion", "removeByC_C", "(", "long", "commerceCountryId", ",", "String", "code", ")", "throws", "NoSuchRegionException", "{", "CommerceRegion", "commerceRegion", "=", "findByC_C", "(", "commerceCountryId", ",", "code", ")", ";", "...
Removes the commerce region where commerceCountryId = &#63; and code = &#63; from the database. @param commerceCountryId the commerce country ID @param code the code @return the commerce region that was removed
[ "Removes", "the", "commerce", "region", "where", "commerceCountryId", "=", "&#63", ";", "and", "code", "=", "&#63", ";", "from", "the", "database", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceRegionPersistenceImpl.java#L2169-L2175
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.iiop/src/com/ibm/ws/transport/iiop/internal/IIOPEndpointImpl.java
IIOPEndpointImpl.activate
@Activate protected void activate(Map<String, Object> properties) throws Exception { """ Start the ORB associated with this bean instance. @exception Exception """ this.host = (String) properties.get("host"); Integer iiopPort = (Integer) properties.get("iiopPort"); this.iiopPort ...
java
@Activate protected void activate(Map<String, Object> properties) throws Exception { this.host = (String) properties.get("host"); Integer iiopPort = (Integer) properties.get("iiopPort"); this.iiopPort = iiopPort == null ? -1 : iiopPort; iiopsOptions = Nester.nest("iiopsOptions", pro...
[ "@", "Activate", "protected", "void", "activate", "(", "Map", "<", "String", ",", "Object", ">", "properties", ")", "throws", "Exception", "{", "this", ".", "host", "=", "(", "String", ")", "properties", ".", "get", "(", "\"host\"", ")", ";", "Integer", ...
Start the ORB associated with this bean instance. @exception Exception
[ "Start", "the", "ORB", "associated", "with", "this", "bean", "instance", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.iiop/src/com/ibm/ws/transport/iiop/internal/IIOPEndpointImpl.java#L71-L78
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/OsgiPropertyUtils.java
OsgiPropertyUtils.getProperty
public static String getProperty(String propertyName, String defaultValue) { """ Retrieve the value of the specified property from framework/system properties. @param propertyName Name of property @param defaultValue Default value to return if property is not set @return Property or default value as a String ...
java
public static String getProperty(String propertyName, String defaultValue) { String value = get(propertyName); return value == null ? defaultValue : value; }
[ "public", "static", "String", "getProperty", "(", "String", "propertyName", ",", "String", "defaultValue", ")", "{", "String", "value", "=", "get", "(", "propertyName", ")", ";", "return", "value", "==", "null", "?", "defaultValue", ":", "value", ";", "}" ]
Retrieve the value of the specified property from framework/system properties. @param propertyName Name of property @param defaultValue Default value to return if property is not set @return Property or default value as a String
[ "Retrieve", "the", "value", "of", "the", "specified", "property", "from", "framework", "/", "system", "properties", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/OsgiPropertyUtils.java#L84-L87
Azure/azure-sdk-for-java
datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java
ServicesInner.checkStatus
public DataMigrationServiceStatusResponseInner checkStatus(String groupName, String serviceName) { """ Check service health status. The services resource is the top-level resource that represents the Data Migration Service. This action performs a health check and returns the status of the service and virtual mach...
java
public DataMigrationServiceStatusResponseInner checkStatus(String groupName, String serviceName) { return checkStatusWithServiceResponseAsync(groupName, serviceName).toBlocking().single().body(); }
[ "public", "DataMigrationServiceStatusResponseInner", "checkStatus", "(", "String", "groupName", ",", "String", "serviceName", ")", "{", "return", "checkStatusWithServiceResponseAsync", "(", "groupName", ",", "serviceName", ")", ".", "toBlocking", "(", ")", ".", "single"...
Check service health status. The services resource is the top-level resource that represents the Data Migration Service. This action performs a health check and returns the status of the service and virtual machine size. @param groupName Name of the resource group @param serviceName Name of the service @throws Illegal...
[ "Check", "service", "health", "status", ".", "The", "services", "resource", "is", "the", "top", "-", "level", "resource", "that", "represents", "the", "Data", "Migration", "Service", ".", "This", "action", "performs", "a", "health", "check", "and", "returns", ...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java#L940-L942
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/DataIO.java
DataIO.getProperties
public static AbstractTableModel getProperties(final CSProperties p) { """ Get the KVP as table. @param p @return an AbstractTableModel for properties (KVP) """ return new AbstractTableModel() { @Override public int getRowCount() { return p.keySet().size(); ...
java
public static AbstractTableModel getProperties(final CSProperties p) { return new AbstractTableModel() { @Override public int getRowCount() { return p.keySet().size(); } @Override public int getColumnCount() { return ...
[ "public", "static", "AbstractTableModel", "getProperties", "(", "final", "CSProperties", "p", ")", "{", "return", "new", "AbstractTableModel", "(", ")", "{", "@", "Override", "public", "int", "getRowCount", "(", ")", "{", "return", "p", ".", "keySet", "(", "...
Get the KVP as table. @param p @return an AbstractTableModel for properties (KVP)
[ "Get", "the", "KVP", "as", "table", "." ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L555-L601
Azure/azure-sdk-for-java
sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobTargetGroupsInner.java
JobTargetGroupsInner.createOrUpdate
public JobTargetGroupInner createOrUpdate(String resourceGroupName, String serverName, String jobAgentName, String targetGroupName, List<JobTarget> members) { """ Creates or updates a target group. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from...
java
public JobTargetGroupInner createOrUpdate(String resourceGroupName, String serverName, String jobAgentName, String targetGroupName, List<JobTarget> members) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName, targetGroupName, members).toBlocking().single().body(); }
[ "public", "JobTargetGroupInner", "createOrUpdate", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "jobAgentName", ",", "String", "targetGroupName", ",", "List", "<", "JobTarget", ">", "members", ")", "{", "return", "createOrUpdateWithS...
Creates or updates a target group. @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 jobAgentName The name of the job agent. @param targetGroupName The name of...
[ "Creates", "or", "updates", "a", "target", "group", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobTargetGroupsInner.java#L331-L333
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/javaee/util/DDUtil.java
DDUtil.methodParamsMatch
public static boolean methodParamsMatch(List<String> typeNames, Class<?>[] types) { """ Checks if the specified method parameters object matches the specified method parameter types. @param parms the method parameters object @param types the method parameter types @return true if the object matches the types...
java
public static boolean methodParamsMatch(List<String> typeNames, Class<?>[] types) { if (typeNames.size() != types.length) { return false; } for (int i = 0; i < types.length; i++) { String typeName = typeNames.get(i); int typeNameEnd = type...
[ "public", "static", "boolean", "methodParamsMatch", "(", "List", "<", "String", ">", "typeNames", ",", "Class", "<", "?", ">", "[", "]", "types", ")", "{", "if", "(", "typeNames", ".", "size", "(", ")", "!=", "types", ".", "length", ")", "{", "return...
Checks if the specified method parameters object matches the specified method parameter types. @param parms the method parameters object @param types the method parameter types @return true if the object matches the types
[ "Checks", "if", "the", "specified", "method", "parameters", "object", "matches", "the", "specified", "method", "parameter", "types", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/javaee/util/DDUtil.java#L36-L66
OpenLiberty/open-liberty
dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java
ThreadPoolController.adjustPoolSize
int adjustPoolSize(int poolSize, int poolAdjustment) { """ Adjust the size of the thread pool. @param poolSize the current pool size @param poolAdjustment the change to make to the pool @return the new pool size """ if (threadPool == null) return poolSize; // arguably should return 0...
java
int adjustPoolSize(int poolSize, int poolAdjustment) { if (threadPool == null) return poolSize; // arguably should return 0, but "least change" is safer... This happens during shutdown. int newPoolSize = poolSize + poolAdjustment; lastAction = LastAction.NONE; if (poolAdjus...
[ "int", "adjustPoolSize", "(", "int", "poolSize", ",", "int", "poolAdjustment", ")", "{", "if", "(", "threadPool", "==", "null", ")", "return", "poolSize", ";", "// arguably should return 0, but \"least change\" is safer... This happens during shutdown.", "int", "newPoolSize...
Adjust the size of the thread pool. @param poolSize the current pool size @param poolAdjustment the change to make to the pool @return the new pool size
[ "Adjust", "the", "size", "of", "the", "thread", "pool", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java#L1209-L1230
cdapio/tigon
tigon-api/src/main/java/co/cask/tigon/internal/io/Schema.java
Schema.enumWith
public static Schema enumWith(Iterable<String> values) { """ Creates a {@link Schema} of {@link Type#ENUM ENUM} type, with the given enum values. The set of values given should be unique and must contains at least one value. The ordering of values in the enum type schema would be the same as the {@link Iterable#...
java
public static Schema enumWith(Iterable<String> values) { Set<String> uniqueValues = ImmutableSet.copyOf(values); Preconditions.checkArgument(uniqueValues.size() > 0, "No enum value provided."); Preconditions.checkArgument(Iterables.size(values) == uniqueValues.size(), "Duplicate enum value is not allowed.")...
[ "public", "static", "Schema", "enumWith", "(", "Iterable", "<", "String", ">", "values", ")", "{", "Set", "<", "String", ">", "uniqueValues", "=", "ImmutableSet", ".", "copyOf", "(", "values", ")", ";", "Preconditions", ".", "checkArgument", "(", "uniqueValu...
Creates a {@link Schema} of {@link Type#ENUM ENUM} type, with the given enum values. The set of values given should be unique and must contains at least one value. The ordering of values in the enum type schema would be the same as the {@link Iterable#iterator()} order. @param values Enum values. @return A {@link Sche...
[ "Creates", "a", "{", "@link", "Schema", "}", "of", "{", "@link", "Type#ENUM", "ENUM", "}", "type", "with", "the", "given", "enum", "values", ".", "The", "set", "of", "values", "given", "should", "be", "unique", "and", "must", "contains", "at", "least", ...
train
https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-api/src/main/java/co/cask/tigon/internal/io/Schema.java#L147-L152
wisdom-framework/wisdom
core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java
ConfigurationImpl.getOrDie
@Override public <T> T getOrDie(String key, Class<T> clazz) { """ Get a custom type property. The object is created using the {@link org.wisdom.api.content.ParameterFactories} strategy. This "die" method forces this key to be set. Otherwise a runtime exception will be thrown. @param key the key the key ...
java
@Override public <T> T getOrDie(String key, Class<T> clazz) { T val = get(key, clazz); if (val == null) { throw new IllegalArgumentException(String.format(ERROR_KEYNOTFOUND, key)); } return val; }
[ "@", "Override", "public", "<", "T", ">", "T", "getOrDie", "(", "String", "key", ",", "Class", "<", "T", ">", "clazz", ")", "{", "T", "val", "=", "get", "(", "key", ",", "clazz", ")", ";", "if", "(", "val", "==", "null", ")", "{", "throw", "n...
Get a custom type property. The object is created using the {@link org.wisdom.api.content.ParameterFactories} strategy. This "die" method forces this key to be set. Otherwise a runtime exception will be thrown. @param key the key the key used in the configuration file. @param clazz the class of the object to create ...
[ "Get", "a", "custom", "type", "property", ".", "The", "object", "is", "created", "using", "the", "{", "@link", "org", ".", "wisdom", ".", "api", ".", "content", ".", "ParameterFactories", "}", "strategy", ".", "This", "die", "method", "forces", "this", "...
train
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java#L485-L492
vakinge/jeesuite-libs
jeesuite-common/src/main/java/com/jeesuite/common/util/ReflectUtils.java
ReflectUtils.isCompatible
public static boolean isCompatible(Class<?>[] cs, Object[] os) { """ is compatible. @param cs class array. @param os object array. @return compatible or not. """ int len = cs.length; if (len != os.length) return false; if (len == 0) return true; for (int i = 0; i < len; i++) if (!isCompat...
java
public static boolean isCompatible(Class<?>[] cs, Object[] os) { int len = cs.length; if (len != os.length) return false; if (len == 0) return true; for (int i = 0; i < len; i++) if (!isCompatible(cs[i], os[i])) return false; return true; }
[ "public", "static", "boolean", "isCompatible", "(", "Class", "<", "?", ">", "[", "]", "cs", ",", "Object", "[", "]", "os", ")", "{", "int", "len", "=", "cs", ".", "length", ";", "if", "(", "len", "!=", "os", ".", "length", ")", "return", "false",...
is compatible. @param cs class array. @param os object array. @return compatible or not.
[ "is", "compatible", "." ]
train
https://github.com/vakinge/jeesuite-libs/blob/c48fe2c7fbd294892cf4030dbec96e744dd3e386/jeesuite-common/src/main/java/com/jeesuite/common/util/ReflectUtils.java#L199-L209
softindex/datakernel
boot/src/main/java/io/datakernel/service/ServiceGraphModule.java
ServiceGraphModule.addDependency
public ServiceGraphModule addDependency(Key<?> key, Key<?> keyDependency) { """ Adds the dependency for key @param key key for adding dependency @param keyDependency key of dependency @return ServiceGraphModule with change """ addedDependencies.computeIfAbsent(key, key1 -> new HashSet<>()).add...
java
public ServiceGraphModule addDependency(Key<?> key, Key<?> keyDependency) { addedDependencies.computeIfAbsent(key, key1 -> new HashSet<>()).add(keyDependency); return this; }
[ "public", "ServiceGraphModule", "addDependency", "(", "Key", "<", "?", ">", "key", ",", "Key", "<", "?", ">", "keyDependency", ")", "{", "addedDependencies", ".", "computeIfAbsent", "(", "key", ",", "key1", "->", "new", "HashSet", "<>", "(", ")", ")", "....
Adds the dependency for key @param key key for adding dependency @param keyDependency key of dependency @return ServiceGraphModule with change
[ "Adds", "the", "dependency", "for", "key" ]
train
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/boot/src/main/java/io/datakernel/service/ServiceGraphModule.java#L173-L176
pravega/pravega
controller/src/main/java/io/pravega/controller/metrics/TransactionMetrics.java
TransactionMetrics.commitTransactionFailed
public void commitTransactionFailed(String scope, String streamName, String txnId) { """ This method increments the global, Stream-related and Transaction-related counters of failed commit operations. @param scope Scope. @param streamName Name of the Stream. @param txnId Transaction id. """ ...
java
public void commitTransactionFailed(String scope, String streamName, String txnId) { DYNAMIC_LOGGER.incCounterValue(globalMetricName(COMMIT_TRANSACTION_FAILED), 1); DYNAMIC_LOGGER.incCounterValue(COMMIT_TRANSACTION_FAILED, 1, streamTags(scope, streamName)); DYNAMIC_LOGGER.incCounterValue(COMMIT_...
[ "public", "void", "commitTransactionFailed", "(", "String", "scope", ",", "String", "streamName", ",", "String", "txnId", ")", "{", "DYNAMIC_LOGGER", ".", "incCounterValue", "(", "globalMetricName", "(", "COMMIT_TRANSACTION_FAILED", ")", ",", "1", ")", ";", "DYNAM...
This method increments the global, Stream-related and Transaction-related counters of failed commit operations. @param scope Scope. @param streamName Name of the Stream. @param txnId Transaction id.
[ "This", "method", "increments", "the", "global", "Stream", "-", "related", "and", "Transaction", "-", "related", "counters", "of", "failed", "commit", "operations", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/TransactionMetrics.java#L84-L88
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java
SARLQuickfixProvider.removeToPreviousSeparator
public boolean removeToPreviousSeparator(int offset, int length, IXtextDocument document, String separator) throws BadLocationException { """ Remove the portion of text, and the whitespaces before the text until the given separator. @param offset the offset where to start to remove. @param length the length...
java
public boolean removeToPreviousSeparator(int offset, int length, IXtextDocument document, String separator) throws BadLocationException { // Skip spaces before the identifier until the separator int index = offset - 1; char c = document.getChar(index); while (Character.isWhitespace(c)) { index--; c = d...
[ "public", "boolean", "removeToPreviousSeparator", "(", "int", "offset", ",", "int", "length", ",", "IXtextDocument", "document", ",", "String", "separator", ")", "throws", "BadLocationException", "{", "// Skip spaces before the identifier until the separator", "int", "index...
Remove the portion of text, and the whitespaces before the text until the given separator. @param offset the offset where to start to remove. @param length the length of the text to remove. @param document the document. @param separator the separator to consider. @return <code>true</code> if the separator was found, <...
[ "Remove", "the", "portion", "of", "text", "and", "the", "whitespaces", "before", "the", "text", "until", "the", "given", "separator", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L329-L355
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/UnitQuaternions.java
UnitQuaternions.relativeOrientation
public static Quat4d relativeOrientation(Point3d[] fixed, Point3d[] moved) { """ Calculate the relative quaternion orientation of two arrays of points. @param fixed point array, coordinates will not be modified @param moved point array, coordinates will not be modified @return a unit quaternion representing...
java
public static Quat4d relativeOrientation(Point3d[] fixed, Point3d[] moved) { Matrix m = CalcPoint.formMatrix(moved, fixed); // inverse EigenvalueDecomposition eig = m.eig(); double[][] v = eig.getV().getArray(); Quat4d q = new Quat4d(v[1][3], v[2][3], v[3][3], v[0][3]); q.normalize(); q.conjugate(); retur...
[ "public", "static", "Quat4d", "relativeOrientation", "(", "Point3d", "[", "]", "fixed", ",", "Point3d", "[", "]", "moved", ")", "{", "Matrix", "m", "=", "CalcPoint", ".", "formMatrix", "(", "moved", ",", "fixed", ")", ";", "// inverse", "EigenvalueDecomposit...
Calculate the relative quaternion orientation of two arrays of points. @param fixed point array, coordinates will not be modified @param moved point array, coordinates will not be modified @return a unit quaternion representing the relative orientation, to rotate moved to bring it to the same orientation as fixed.
[ "Calculate", "the", "relative", "quaternion", "orientation", "of", "two", "arrays", "of", "points", "." ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/UnitQuaternions.java#L199-L207
alkacon/opencms-core
src-gwt/org/opencms/ade/publish/client/CmsPublishSelectPanel.java
CmsPublishSelectPanel.setShowResources
public void setShowResources(boolean showResources, String tooManyResourcesMessage) { """ Sets the mode to either show resources, or only show a "too many resources" message.<p> In the latter case, the check boxes for the siblings/related resources will be deactivated.<p> @param showResources true if the resou...
java
public void setShowResources(boolean showResources, String tooManyResourcesMessage) { m_showResources = showResources; m_checkboxRelated.setEnabled(showResources); m_checkboxRelated.setChecked(showResources && m_publishDialog.getPublishOptions().isIncludeRelated()); m_checkboxSiblings.s...
[ "public", "void", "setShowResources", "(", "boolean", "showResources", ",", "String", "tooManyResourcesMessage", ")", "{", "m_showResources", "=", "showResources", ";", "m_checkboxRelated", ".", "setEnabled", "(", "showResources", ")", ";", "m_checkboxRelated", ".", "...
Sets the mode to either show resources, or only show a "too many resources" message.<p> In the latter case, the check boxes for the siblings/related resources will be deactivated.<p> @param showResources true if the resource list should be shown, false if only the given message should be shown @param tooManyResourcesM...
[ "Sets", "the", "mode", "to", "either", "show", "resources", "or", "only", "show", "a", "too", "many", "resources", "message", ".", "<p", ">", "In", "the", "latter", "case", "the", "check", "boxes", "for", "the", "siblings", "/", "related", "resources", "...
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/publish/client/CmsPublishSelectPanel.java#L674-L695
fcrepo3/fcrepo
fcrepo-server/src/main/java/org/fcrepo/server/resourceIndex/ResourceIndexRebuilder.java
ResourceIndexRebuilder.addObject
public void addObject(DigitalObject obj) throws ResourceIndexException { """ Add the data of interest for the given object. @throws ResourceIndexException """ m_ri.addObject(new SimpleDOReader(null, null, null, null, null, obj)); }
java
public void addObject(DigitalObject obj) throws ResourceIndexException { m_ri.addObject(new SimpleDOReader(null, null, null, null, null, obj)); }
[ "public", "void", "addObject", "(", "DigitalObject", "obj", ")", "throws", "ResourceIndexException", "{", "m_ri", ".", "addObject", "(", "new", "SimpleDOReader", "(", "null", ",", "null", ",", "null", ",", "null", ",", "null", ",", "obj", ")", ")", ";", ...
Add the data of interest for the given object. @throws ResourceIndexException
[ "Add", "the", "data", "of", "interest", "for", "the", "given", "object", "." ]
train
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/resourceIndex/ResourceIndexRebuilder.java#L203-L205
HubSpot/jinjava
src/main/java/com/hubspot/jinjava/el/ExpressionResolver.java
ExpressionResolver.resolveProperty
public Object resolveProperty(Object object, List<String> propertyNames) { """ Resolve property of bean. @param object Bean. @param propertyNames Names of properties to resolve recursively. @return Value of property. """ // Always wrap base object. Object value = resolver.wrap(object); for ...
java
public Object resolveProperty(Object object, List<String> propertyNames) { // Always wrap base object. Object value = resolver.wrap(object); for (String propertyName : propertyNames) { if (value == null) { return null; } value = resolver.getValue(elContext, value, propertyName); ...
[ "public", "Object", "resolveProperty", "(", "Object", "object", ",", "List", "<", "String", ">", "propertyNames", ")", "{", "// Always wrap base object.", "Object", "value", "=", "resolver", ".", "wrap", "(", "object", ")", ";", "for", "(", "String", "property...
Resolve property of bean. @param object Bean. @param propertyNames Names of properties to resolve recursively. @return Value of property.
[ "Resolve", "property", "of", "bean", "." ]
train
https://github.com/HubSpot/jinjava/blob/ce570935630f49c666170d2330b0b9ba4eddb955/src/main/java/com/hubspot/jinjava/el/ExpressionResolver.java#L142-L155
h2oai/h2o-2
src/main/java/hex/deeplearning/Neurons.java
Softmax.bprop
protected void bprop(int target) { """ Backpropagation for classification Update every weight as follows: w += -rate * dE/dw Compute dE/dw via chain rule: dE/dw = dE/dy * dy/dnet * dnet/dw, where net = sum(xi*wi)+b and y = activation function @param target actual class label """ assert (target != miss...
java
protected void bprop(int target) { assert (target != missing_int_value); // no correction of weights/biases for missing label float m = momentum(); float r = _minfo.adaDelta() ? 0 : rate(_minfo.get_processed_total()) * (1f - m); float g; //partial derivative dE/dy * dy/dnet final float row...
[ "protected", "void", "bprop", "(", "int", "target", ")", "{", "assert", "(", "target", "!=", "missing_int_value", ")", ";", "// no correction of weights/biases for missing label", "float", "m", "=", "momentum", "(", ")", ";", "float", "r", "=", "_minfo", ".", ...
Backpropagation for classification Update every weight as follows: w += -rate * dE/dw Compute dE/dw via chain rule: dE/dw = dE/dy * dy/dnet * dnet/dw, where net = sum(xi*wi)+b and y = activation function @param target actual class label
[ "Backpropagation", "for", "classification", "Update", "every", "weight", "as", "follows", ":", "w", "+", "=", "-", "rate", "*", "dE", "/", "dw", "Compute", "dE", "/", "dw", "via", "chain", "rule", ":", "dE", "/", "dw", "=", "dE", "/", "dy", "*", "d...
train
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/deeplearning/Neurons.java#L1003-L1025
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java
ComputeNodesImpl.enableSchedulingAsync
public Observable<Void> enableSchedulingAsync(String poolId, String nodeId) { """ Enables task scheduling on the specified compute node. You can enable task scheduling on a node only if its current scheduling state is disabled. @param poolId The ID of the pool that contains the compute node. @param nodeId The...
java
public Observable<Void> enableSchedulingAsync(String poolId, String nodeId) { return enableSchedulingWithServiceResponseAsync(poolId, nodeId).map(new Func1<ServiceResponseWithHeaders<Void, ComputeNodeEnableSchedulingHeaders>, Void>() { @Override public Void call(ServiceResponseWithHeader...
[ "public", "Observable", "<", "Void", ">", "enableSchedulingAsync", "(", "String", "poolId", ",", "String", "nodeId", ")", "{", "return", "enableSchedulingWithServiceResponseAsync", "(", "poolId", ",", "nodeId", ")", ".", "map", "(", "new", "Func1", "<", "Service...
Enables task scheduling on the specified compute node. You can enable task scheduling on a node only if its current scheduling state is disabled. @param poolId The ID of the pool that contains the compute node. @param nodeId The ID of the compute node on which you want to enable task scheduling. @throws IllegalArgumen...
[ "Enables", "task", "scheduling", "on", "the", "specified", "compute", "node", ".", "You", "can", "enable", "task", "scheduling", "on", "a", "node", "only", "if", "its", "current", "scheduling", "state", "is", "disabled", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java#L1748-L1755
googleapis/google-http-java-client
google-http-client/src/main/java/com/google/api/client/http/HttpBackOffUnsuccessfulResponseHandler.java
HttpBackOffUnsuccessfulResponseHandler.handleResponse
@Override public boolean handleResponse(HttpRequest request, HttpResponse response, boolean supportsRetry) throws IOException { """ {@inheritDoc} <p>Handles the request with {@link BackOff}. That means that if back-off is required a call to {@link Sleeper#sleep(long)} will be made. """ if (!sup...
java
@Override public boolean handleResponse(HttpRequest request, HttpResponse response, boolean supportsRetry) throws IOException { if (!supportsRetry) { return false; } // check if back-off is required for this response if (backOffRequired.isRequired(response)) { try { return Ba...
[ "@", "Override", "public", "boolean", "handleResponse", "(", "HttpRequest", "request", ",", "HttpResponse", "response", ",", "boolean", "supportsRetry", ")", "throws", "IOException", "{", "if", "(", "!", "supportsRetry", ")", "{", "return", "false", ";", "}", ...
{@inheritDoc} <p>Handles the request with {@link BackOff}. That means that if back-off is required a call to {@link Sleeper#sleep(long)} will be made.
[ "{", "@inheritDoc", "}" ]
train
https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpBackOffUnsuccessfulResponseHandler.java#L120-L135
resilience4j/resilience4j
resilience4j-spring/src/main/java/io/github/resilience4j/ratelimiter/configure/RateLimiterAspect.java
RateLimiterAspect.handleJoinPointCompletableFuture
private Object handleJoinPointCompletableFuture(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.ratelimiter.RateLimiter rateLimiter) { """ handle the asynchronous completable future flow @param proceedingJoinPoint AOPJoinPoint @param rateLimiter configured rate limiter @return Completi...
java
private Object handleJoinPointCompletableFuture(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.ratelimiter.RateLimiter rateLimiter) { return rateLimiter.executeCompletionStage(() -> { try { return (CompletionStage<?>) proceedingJoinPoint.proceed(); } catch (Throwable throwable) { throw ...
[ "private", "Object", "handleJoinPointCompletableFuture", "(", "ProceedingJoinPoint", "proceedingJoinPoint", ",", "io", ".", "github", ".", "resilience4j", ".", "ratelimiter", ".", "RateLimiter", "rateLimiter", ")", "{", "return", "rateLimiter", ".", "executeCompletionStag...
handle the asynchronous completable future flow @param proceedingJoinPoint AOPJoinPoint @param rateLimiter configured rate limiter @return CompletionStage
[ "handle", "the", "asynchronous", "completable", "future", "flow" ]
train
https://github.com/resilience4j/resilience4j/blob/fa843d30f531c00f0c3dc218b65a7f2bb51af336/resilience4j-spring/src/main/java/io/github/resilience4j/ratelimiter/configure/RateLimiterAspect.java#L125-L133
PureSolTechnologies/parsers
parsers/src/main/java/com/puresoltechnologies/parsers/parser/packrat/PackratMemo.java
PackratMemo.getMemo
MemoEntry getMemo(String production, int position) { """ This method returns the current memoization element from the buffer. This element is unprocessed. If the element is not set (null) a NONE element is put into the buffer and returned. @param production @param position @return """ Map<String, MemoE...
java
MemoEntry getMemo(String production, int position) { Map<String, MemoEntry> map = memo.get(position); if (map == null) return null; MemoEntry memo = map.get(production); if (memo == null) return null; return memo; }
[ "MemoEntry", "getMemo", "(", "String", "production", ",", "int", "position", ")", "{", "Map", "<", "String", ",", "MemoEntry", ">", "map", "=", "memo", ".", "get", "(", "position", ")", ";", "if", "(", "map", "==", "null", ")", "return", "null", ";",...
This method returns the current memoization element from the buffer. This element is unprocessed. If the element is not set (null) a NONE element is put into the buffer and returned. @param production @param position @return
[ "This", "method", "returns", "the", "current", "memoization", "element", "from", "the", "buffer", ".", "This", "element", "is", "unprocessed", ".", "If", "the", "element", "is", "not", "set", "(", "null", ")", "a", "NONE", "element", "is", "put", "into", ...
train
https://github.com/PureSolTechnologies/parsers/blob/61077223b90d3768ff9445ae13036343c98b63cd/parsers/src/main/java/com/puresoltechnologies/parsers/parser/packrat/PackratMemo.java#L39-L47
czyzby/gdx-lml
mvc/src/main/java/com/github/czyzby/autumn/mvc/component/ui/InterfaceService.java
InterfaceService.registerController
public void registerController(final Class<?> mappedControllerClass, final ViewController controller) { """ Allows to manually register a managed controller. For internal use mostly. @param mappedControllerClass class with which the controller is accessible. This does not have to be controller's actual class. ...
java
public void registerController(final Class<?> mappedControllerClass, final ViewController controller) { controllers.put(mappedControllerClass, controller); if (Strings.isNotEmpty(controller.getViewId())) { parser.getData().addActorConsumer(SCREEN_TRANSITION_ACTION_PREFIX + controller.getView...
[ "public", "void", "registerController", "(", "final", "Class", "<", "?", ">", "mappedControllerClass", ",", "final", "ViewController", "controller", ")", "{", "controllers", ".", "put", "(", "mappedControllerClass", ",", "controller", ")", ";", "if", "(", "Strin...
Allows to manually register a managed controller. For internal use mostly. @param mappedControllerClass class with which the controller is accessible. This does not have to be controller's actual class. @param controller controller implementation, managing a single view.
[ "Allows", "to", "manually", "register", "a", "managed", "controller", ".", "For", "internal", "use", "mostly", "." ]
train
https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/mvc/src/main/java/com/github/czyzby/autumn/mvc/component/ui/InterfaceService.java#L174-L180
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java
SDMath.jaccardDistance
public SDVariable jaccardDistance(SDVariable x, SDVariable y, int... dimensions) { """ Jaccard similarity reduction operation. The output contains the Jaccard distance for each tensor along the specified dimensions. @param x Input variable x @param y Input variable y @param dimensions Dimen...
java
public SDVariable jaccardDistance(SDVariable x, SDVariable y, int... dimensions) { return jaccardDistance(null, x, y, dimensions); }
[ "public", "SDVariable", "jaccardDistance", "(", "SDVariable", "x", ",", "SDVariable", "y", ",", "int", "...", "dimensions", ")", "{", "return", "jaccardDistance", "(", "null", ",", "x", ",", "y", ",", "dimensions", ")", ";", "}" ]
Jaccard similarity reduction operation. The output contains the Jaccard distance for each tensor along the specified dimensions. @param x Input variable x @param y Input variable y @param dimensions Dimensions to calculate Jaccard similarity over @return Output variable
[ "Jaccard", "similarity", "reduction", "operation", ".", "The", "output", "contains", "the", "Jaccard", "distance", "for", "each", "tensor", "along", "the", "specified", "dimensions", "." ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java#L1446-L1448
maxirosson/jdroid-android
jdroid-android-core/src/main/java/com/jdroid/android/usecase/AbstractUseCase.java
AbstractUseCase.notifyFailedUseCase
@RestrictTo(LIBRARY) public void notifyFailedUseCase(AbstractException exception, UseCaseListener listener) { """ Notifies the listener that the use case has failed to execute. <br/> You can override this method for a custom notification when your listeners may be listening to multiple use cases at a time. @...
java
@RestrictTo(LIBRARY) public void notifyFailedUseCase(AbstractException exception, UseCaseListener listener) { try { LOGGER.debug("Notifying " + getClass().getSimpleName() + " finish failed to listener " + listener.getClass().getSimpleName()); listener.onFinishFailedUseCase(exception); } catch (Exception e) {...
[ "@", "RestrictTo", "(", "LIBRARY", ")", "public", "void", "notifyFailedUseCase", "(", "AbstractException", "exception", ",", "UseCaseListener", "listener", ")", "{", "try", "{", "LOGGER", ".", "debug", "(", "\"Notifying \"", "+", "getClass", "(", ")", ".", "ge...
Notifies the listener that the use case has failed to execute. <br/> You can override this method for a custom notification when your listeners may be listening to multiple use cases at a time. @param listener The listener to notify.
[ "Notifies", "the", "listener", "that", "the", "use", "case", "has", "failed", "to", "execute", ".", "<br", "/", ">", "You", "can", "override", "this", "method", "for", "a", "custom", "notification", "when", "your", "listeners", "may", "be", "listening", "t...
train
https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/usecase/AbstractUseCase.java#L226-L235
antlrjavaparser/antlr-java-parser
src/main/java/com/github/antlrjavaparser/ASTHelper.java
ASTHelper.addStmt
public static void addStmt(BlockStmt block, Statement stmt) { """ Adds the given statement to the specified block. The list of statements will be initialized if it is <code>null</code>. @param block @param stmt """ List<Statement> stmts = block.getStmts(); if (stmts == null) { ...
java
public static void addStmt(BlockStmt block, Statement stmt) { List<Statement> stmts = block.getStmts(); if (stmts == null) { stmts = new ArrayList<Statement>(); block.setStmts(stmts); } stmts.add(stmt); }
[ "public", "static", "void", "addStmt", "(", "BlockStmt", "block", ",", "Statement", "stmt", ")", "{", "List", "<", "Statement", ">", "stmts", "=", "block", ".", "getStmts", "(", ")", ";", "if", "(", "stmts", "==", "null", ")", "{", "stmts", "=", "new...
Adds the given statement to the specified block. The list of statements will be initialized if it is <code>null</code>. @param block @param stmt
[ "Adds", "the", "given", "statement", "to", "the", "specified", "block", ".", "The", "list", "of", "statements", "will", "be", "initialized", "if", "it", "is", "<code", ">", "null<", "/", "code", ">", "." ]
train
https://github.com/antlrjavaparser/antlr-java-parser/blob/077160deb44d952c40c442800abd91af7e6fe006/src/main/java/com/github/antlrjavaparser/ASTHelper.java#L245-L252
ManfredTremmel/gwt-bean-validators
mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/util/PhoneNumberUtil.java
PhoneNumberUtil.formatCommonNational
public final String formatCommonNational(final String pphoneNumber, final String pcountryCode) { """ format phone number in common national format. @param pphoneNumber phone number to format @param pcountryCode iso code of country @return formated phone number as String """ return this.formatCommonNat...
java
public final String formatCommonNational(final String pphoneNumber, final String pcountryCode) { return this.formatCommonNational(this.parsePhoneNumber(pphoneNumber, pcountryCode)); }
[ "public", "final", "String", "formatCommonNational", "(", "final", "String", "pphoneNumber", ",", "final", "String", "pcountryCode", ")", "{", "return", "this", ".", "formatCommonNational", "(", "this", ".", "parsePhoneNumber", "(", "pphoneNumber", ",", "pcountryCod...
format phone number in common national format. @param pphoneNumber phone number to format @param pcountryCode iso code of country @return formated phone number as String
[ "format", "phone", "number", "in", "common", "national", "format", "." ]
train
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/util/PhoneNumberUtil.java#L1641-L1643
Erudika/para
para-client/src/main/java/com/erudika/para/client/ParaClient.java
ParaClient.deleteChildren
public void deleteChildren(ParaObject obj, String type2) { """ Deletes all child objects permanently. @param obj the object to execute this method on @param type2 the children's type. """ if (obj == null || obj.getId() == null || type2 == null) { return; } MultivaluedMap<String, String> params = new...
java
public void deleteChildren(ParaObject obj, String type2) { if (obj == null || obj.getId() == null || type2 == null) { return; } MultivaluedMap<String, String> params = new MultivaluedHashMap<>(); params.putSingle("childrenonly", "true"); String url = Utils.formatMessage("{0}/links/{1}", obj.getObjectURI(),...
[ "public", "void", "deleteChildren", "(", "ParaObject", "obj", ",", "String", "type2", ")", "{", "if", "(", "obj", "==", "null", "||", "obj", ".", "getId", "(", ")", "==", "null", "||", "type2", "==", "null", ")", "{", "return", ";", "}", "Multivalued...
Deletes all child objects permanently. @param obj the object to execute this method on @param type2 the children's type.
[ "Deletes", "all", "child", "objects", "permanently", "." ]
train
https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-client/src/main/java/com/erudika/para/client/ParaClient.java#L1158-L1166
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
Gen.makeRef
int makeRef(DiagnosticPosition pos, Type type) { """ Insert a reference to given type in the constant pool, checking for an array with too many dimensions; return the reference's index. @param type The type for which a reference is inserted. """ checkDimension(pos, type); if (type.isAnnota...
java
int makeRef(DiagnosticPosition pos, Type type) { checkDimension(pos, type); if (type.isAnnotated()) { return pool.put((Object)type); } else { return pool.put(type.hasTag(CLASS) ? (Object)type.tsym : (Object)type); } }
[ "int", "makeRef", "(", "DiagnosticPosition", "pos", ",", "Type", "type", ")", "{", "checkDimension", "(", "pos", ",", "type", ")", ";", "if", "(", "type", ".", "isAnnotated", "(", ")", ")", "{", "return", "pool", ".", "put", "(", "(", "Object", ")", ...
Insert a reference to given type in the constant pool, checking for an array with too many dimensions; return the reference's index. @param type The type for which a reference is inserted.
[ "Insert", "a", "reference", "to", "given", "type", "in", "the", "constant", "pool", "checking", "for", "an", "array", "with", "too", "many", "dimensions", ";", "return", "the", "reference", "s", "index", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java#L252-L259
alkacon/opencms-core
src/org/opencms/webdav/CmsWebdavServlet.java
CmsWebdavServlet.copyRange
protected IOException copyRange(Reader reader, PrintWriter writer, long start, long end) { """ Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).<p> @param reader the reader to read from ...
java
protected IOException copyRange(Reader reader, PrintWriter writer, long start, long end) { try { reader.skip(start); } catch (IOException e) { return e; } IOException exception = null; long bytesToRead = (end - start) + 1; char[] buffer = new ch...
[ "protected", "IOException", "copyRange", "(", "Reader", "reader", ",", "PrintWriter", "writer", ",", "long", "start", ",", "long", "end", ")", "{", "try", "{", "reader", ".", "skip", "(", "start", ")", ";", "}", "catch", "(", "IOException", "e", ")", "...
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).<p> @param reader the reader to read from @param writer the writer to write to @param start the start of the range which will be copied @param end ...
[ "Copy", "the", "contents", "of", "the", "specified", "input", "stream", "to", "the", "specified", "output", "stream", "and", "ensure", "that", "both", "streams", "are", "closed", "before", "returning", "(", "even", "in", "the", "face", "of", "an", "exception...
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/webdav/CmsWebdavServlet.java#L926-L960
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/libs/modules/HMModelIM.java
HMModelIM.getGridCoverage
protected GridCoverage2D getGridCoverage( int readerNum, double north, double south, double east, double west ) throws Exception { """ Get the {@link GridCoverage2D} in a certain region. <p>It might be usefull for faster access to the underlying data to extract the raster before creatin the iterato...
java
protected GridCoverage2D getGridCoverage( int readerNum, double north, double south, double east, double west ) throws Exception { GeneralParameterValue[] readGeneralParameterValues = CoverageUtilities.createGridGeometryGeneralParameter(xRes, yRes, north, south, east, west, crs); ...
[ "protected", "GridCoverage2D", "getGridCoverage", "(", "int", "readerNum", ",", "double", "north", ",", "double", "south", ",", "double", "east", ",", "double", "west", ")", "throws", "Exception", "{", "GeneralParameterValue", "[", "]", "readGeneralParameterValues",...
Get the {@link GridCoverage2D} in a certain region. <p>It might be usefull for faster access to the underlying data to extract the raster before creatin the iterator, instead of iterating directly. <p>This can be done on the returned gridcoverage through: <code> Raster readRaster = readGC.getRenderedImage().getData();...
[ "Get", "the", "{", "@link", "GridCoverage2D", "}", "in", "a", "certain", "region", "." ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/libs/modules/HMModelIM.java#L162-L170