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 |
|---|---|---|---|---|---|---|---|---|---|---|
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/comp/Resolve.java | Resolve.resolveOperator | Symbol resolveOperator(DiagnosticPosition pos, JCTree.Tag optag,
Env<AttrContext> env, List<Type> argtypes) {
"""
Resolve operator.
@param pos The position to use for error reporting.
@param optag The tag of the operation tree.
@param env The environment current at the... | java | Symbol resolveOperator(DiagnosticPosition pos, JCTree.Tag optag,
Env<AttrContext> env, List<Type> argtypes) {
MethodResolutionContext prevResolutionContext = currentResolutionContext;
try {
currentResolutionContext = new MethodResolutionContext();
Name ... | [
"Symbol",
"resolveOperator",
"(",
"DiagnosticPosition",
"pos",
",",
"JCTree",
".",
"Tag",
"optag",
",",
"Env",
"<",
"AttrContext",
">",
"env",
",",
"List",
"<",
"Type",
">",
"argtypes",
")",
"{",
"MethodResolutionContext",
"prevResolutionContext",
"=",
"currentR... | Resolve operator.
@param pos The position to use for error reporting.
@param optag The tag of the operation tree.
@param env The environment current at the operation.
@param argtypes The types of the operands. | [
"Resolve",
"operator",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/comp/Resolve.java#L2679-L2702 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/postprocess/BundleProcessingStatus.java | BundleProcessingStatus.addPostProcessVariant | public void addPostProcessVariant(String variantType, VariantSet variantSet) {
"""
Add a post process variant
@param variantType
the variant type
@param variantSet
the variant set
"""
Map<String, VariantSet> variantMap = new HashMap<>();
variantMap.put(variantType, variantSet);
addPostProcessVaria... | java | public void addPostProcessVariant(String variantType, VariantSet variantSet) {
Map<String, VariantSet> variantMap = new HashMap<>();
variantMap.put(variantType, variantSet);
addPostProcessVariant(variantMap);
} | [
"public",
"void",
"addPostProcessVariant",
"(",
"String",
"variantType",
",",
"VariantSet",
"variantSet",
")",
"{",
"Map",
"<",
"String",
",",
"VariantSet",
">",
"variantMap",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"variantMap",
".",
"put",
"(",
"varian... | Add a post process variant
@param variantType
the variant type
@param variantSet
the variant set | [
"Add",
"a",
"post",
"process",
"variant"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/postprocess/BundleProcessingStatus.java#L245-L250 |
jayantk/jklol | src/com/jayantkrish/jklol/tensor/SparseTensor.java | SparseTensor.resizeIntoTable | private static SparseTensor resizeIntoTable(int[] dimensions, int[] dimensionSizes,
long[] keyNums, double[] values, int size) {
"""
Takes the data structures for a {@code SparseTensor}, but
possibly with the wrong number of filled-in entries, resizes them
and constructs a {@code SparseTensor} with them.
... | java | private static SparseTensor resizeIntoTable(int[] dimensions, int[] dimensionSizes,
long[] keyNums, double[] values, int size) {
if (values.length == size) {
return new SparseTensor(dimensions, dimensionSizes, keyNums, values);
} else {
// Resize the result array to fit the actual number of re... | [
"private",
"static",
"SparseTensor",
"resizeIntoTable",
"(",
"int",
"[",
"]",
"dimensions",
",",
"int",
"[",
"]",
"dimensionSizes",
",",
"long",
"[",
"]",
"keyNums",
",",
"double",
"[",
"]",
"values",
",",
"int",
"size",
")",
"{",
"if",
"(",
"values",
... | Takes the data structures for a {@code SparseTensor}, but
possibly with the wrong number of filled-in entries, resizes them
and constructs a {@code SparseTensor} with them.
@param keyNums
@param values
@param size
@return | [
"Takes",
"the",
"data",
"structures",
"for",
"a",
"{",
"@code",
"SparseTensor",
"}",
"but",
"possibly",
"with",
"the",
"wrong",
"number",
"of",
"filled",
"-",
"in",
"entries",
"resizes",
"them",
"and",
"constructs",
"a",
"{",
"@code",
"SparseTensor",
"}",
... | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/tensor/SparseTensor.java#L1354-L1365 |
dvasilen/Hive-XML-SerDe | src/main/java/com/ibm/spss/hive/serde2/xml/objectinspector/XmlObjectInspectorFactory.java | XmlObjectInspectorFactory.getStandardJavaObjectInspectorFromTypeInfo | public static ObjectInspector getStandardJavaObjectInspectorFromTypeInfo(TypeInfo typeInfo, XmlProcessor xmlProcessor) {
"""
Returns the standard java object inspector
@param typeInfo
the type info
@param xmlProcessor
the XML processor
@return the standard java object inspector
"""
switch (typeI... | java | public static ObjectInspector getStandardJavaObjectInspectorFromTypeInfo(TypeInfo typeInfo, XmlProcessor xmlProcessor) {
switch (typeInfo.getCategory()) {
case PRIMITIVE: {
return PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector(((PrimitiveTypeInfo) typeInfo).getPrimit... | [
"public",
"static",
"ObjectInspector",
"getStandardJavaObjectInspectorFromTypeInfo",
"(",
"TypeInfo",
"typeInfo",
",",
"XmlProcessor",
"xmlProcessor",
")",
"{",
"switch",
"(",
"typeInfo",
".",
"getCategory",
"(",
")",
")",
"{",
"case",
"PRIMITIVE",
":",
"{",
"return... | Returns the standard java object inspector
@param typeInfo
the type info
@param xmlProcessor
the XML processor
@return the standard java object inspector | [
"Returns",
"the",
"standard",
"java",
"object",
"inspector"
] | train | https://github.com/dvasilen/Hive-XML-SerDe/blob/2a7a184b2cfaeb63008529a9851cd72edb8025d9/src/main/java/com/ibm/spss/hive/serde2/xml/objectinspector/XmlObjectInspectorFactory.java#L53-L85 |
jenkinsci/jenkins | core/src/main/java/hudson/model/View.java | View.doConfigSubmit | @RequirePOST
public final synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException {
"""
Accepts submission from the configuration page.
Subtypes should override the {@link #submit(StaplerRequest)} method.
"""
checkPermission... | java | @RequirePOST
public final synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException {
checkPermission(CONFIGURE);
submit(req);
description = Util.nullify(req.getParameter("description"));
filterExecutors = req.ge... | [
"@",
"RequirePOST",
"public",
"final",
"synchronized",
"void",
"doConfigSubmit",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
")",
"throws",
"IOException",
",",
"ServletException",
",",
"FormException",
"{",
"checkPermission",
"(",
"CONFIGURE",
")",
... | Accepts submission from the configuration page.
Subtypes should override the {@link #submit(StaplerRequest)} method. | [
"Accepts",
"submission",
"from",
"the",
"configuration",
"page",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/View.java#L983-L1000 |
tvesalainen/util | util/src/main/java/org/vesalainen/util/CmdArgs.java | CmdArgs.addOption | public final <T> void addOption(Class<T> cls, String name, String description, String exclusiveGroup) {
"""
Add a mandatory option
@param <T> Type of option
@param cls Option type class
@param name Option name Option name without
@param description Option description
@param exclusiveGroup A group of options. ... | java | public final <T> void addOption(Class<T> cls, String name, String description, String exclusiveGroup)
{
addOption(cls, name, description, exclusiveGroup, true);
} | [
"public",
"final",
"<",
"T",
">",
"void",
"addOption",
"(",
"Class",
"<",
"T",
">",
"cls",
",",
"String",
"name",
",",
"String",
"description",
",",
"String",
"exclusiveGroup",
")",
"{",
"addOption",
"(",
"cls",
",",
"name",
",",
"description",
",",
"e... | Add a mandatory option
@param <T> Type of option
@param cls Option type class
@param name Option name Option name without
@param description Option description
@param exclusiveGroup A group of options. Only options of a single group
are accepted. | [
"Add",
"a",
"mandatory",
"option"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/CmdArgs.java#L344-L347 |
fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/util/AuthConfigFactory.java | AuthConfigFactory.parseOpenShiftConfig | private AuthConfig parseOpenShiftConfig() {
"""
Parse OpenShift config to get credentials, but return null if not found
"""
Map kubeConfig = DockerFileUtil.readKubeConfig();
if (kubeConfig == null) {
return null;
}
String currentContextName = (String) kubeConfig.get... | java | private AuthConfig parseOpenShiftConfig() {
Map kubeConfig = DockerFileUtil.readKubeConfig();
if (kubeConfig == null) {
return null;
}
String currentContextName = (String) kubeConfig.get("current-context");
if (currentContextName == null) {
return null;
... | [
"private",
"AuthConfig",
"parseOpenShiftConfig",
"(",
")",
"{",
"Map",
"kubeConfig",
"=",
"DockerFileUtil",
".",
"readKubeConfig",
"(",
")",
";",
"if",
"(",
"kubeConfig",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"currentContextName",
"=",
... | Parse OpenShift config to get credentials, but return null if not found | [
"Parse",
"OpenShift",
"config",
"to",
"get",
"credentials",
"but",
"return",
"null",
"if",
"not",
"found"
] | train | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/util/AuthConfigFactory.java#L458-L476 |
google/j2objc | jre_emul/android/platform/external/mockwebserver/src/main/java/com/google/mockwebserver/MockResponse.java | MockResponse.addHeader | public MockResponse addHeader(String name, Object value) {
"""
Adds a new header with the name and value. This may be used to add
multiple headers with the same name.
"""
return addHeader(name + ": " + String.valueOf(value));
} | java | public MockResponse addHeader(String name, Object value) {
return addHeader(name + ": " + String.valueOf(value));
} | [
"public",
"MockResponse",
"addHeader",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"return",
"addHeader",
"(",
"name",
"+",
"\": \"",
"+",
"String",
".",
"valueOf",
"(",
"value",
")",
")",
";",
"}"
] | Adds a new header with the name and value. This may be used to add
multiple headers with the same name. | [
"Adds",
"a",
"new",
"header",
"with",
"the",
"name",
"and",
"value",
".",
"This",
"may",
"be",
"used",
"to",
"add",
"multiple",
"headers",
"with",
"the",
"same",
"name",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/mockwebserver/src/main/java/com/google/mockwebserver/MockResponse.java#L116-L118 |
jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java | ShExGenerator.genAltEntry | private String genAltEntry(String id, ElementDefinition.TypeRefComponent typ) {
"""
Generate an alternative shape for a reference
@param id reference name
@param typ shape type
@return ShEx equivalent
"""
if(!typ.getCode().equals("Reference"))
throw new AssertionError("We do not handle " + typ.g... | java | private String genAltEntry(String id, ElementDefinition.TypeRefComponent typ) {
if(!typ.getCode().equals("Reference"))
throw new AssertionError("We do not handle " + typ.getCode() + " alternatives");
return genReference(id, typ);
} | [
"private",
"String",
"genAltEntry",
"(",
"String",
"id",
",",
"ElementDefinition",
".",
"TypeRefComponent",
"typ",
")",
"{",
"if",
"(",
"!",
"typ",
".",
"getCode",
"(",
")",
".",
"equals",
"(",
"\"Reference\"",
")",
")",
"throw",
"new",
"AssertionError",
"... | Generate an alternative shape for a reference
@param id reference name
@param typ shape type
@return ShEx equivalent | [
"Generate",
"an",
"alternative",
"shape",
"for",
"a",
"reference"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java#L638-L643 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRecordBrowser.java | LogRecordBrowser.getRecord | public RepositoryLogRecord getRecord(RepositoryPointer location) {
"""
Returns repository record corresponding to the <code>location</code> pointer.
@param location the location of a record.
@return log record instance if <code>location</code> points to a record in the repository;
<code>null</code> otherwise.... | java | public RepositoryLogRecord getRecord(RepositoryPointer location) {
if (!(location instanceof RepositoryPointerImpl)) {
return null;
}
RepositoryPointerImpl real = (RepositoryPointerImpl)location;
long pos = real.getRecordOffset();
File file = fileBrowser.findFile(real);
if (pos < 0 || file == null) {
... | [
"public",
"RepositoryLogRecord",
"getRecord",
"(",
"RepositoryPointer",
"location",
")",
"{",
"if",
"(",
"!",
"(",
"location",
"instanceof",
"RepositoryPointerImpl",
")",
")",
"{",
"return",
"null",
";",
"}",
"RepositoryPointerImpl",
"real",
"=",
"(",
"RepositoryP... | Returns repository record corresponding to the <code>location</code> pointer.
@param location the location of a record.
@return log record instance if <code>location</code> points to a record in the repository;
<code>null</code> otherwise. | [
"Returns",
"repository",
"record",
"corresponding",
"to",
"the",
"<code",
">",
"location<",
"/",
"code",
">",
"pointer",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRecordBrowser.java#L136-L158 |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/LengthOperation.java | LengthOperation.getLengthOfObject | private Object getLengthOfObject(Object object, String functionName) throws TransformationOperationException {
"""
Returns the length of the given object got through the method of the given function name
"""
try {
Method method = object.getClass().getMethod(functionName);
return... | java | private Object getLengthOfObject(Object object, String functionName) throws TransformationOperationException {
try {
Method method = object.getClass().getMethod(functionName);
return method.invoke(object);
} catch (NoSuchMethodException e) {
StringBuilder builder = ne... | [
"private",
"Object",
"getLengthOfObject",
"(",
"Object",
"object",
",",
"String",
"functionName",
")",
"throws",
"TransformationOperationException",
"{",
"try",
"{",
"Method",
"method",
"=",
"object",
".",
"getClass",
"(",
")",
".",
"getMethod",
"(",
"functionName... | Returns the length of the given object got through the method of the given function name | [
"Returns",
"the",
"length",
"of",
"the",
"given",
"object",
"got",
"through",
"the",
"method",
"of",
"the",
"given",
"function",
"name"
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/LengthOperation.java#L69-L85 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ElasticPoolsInner.java | ElasticPoolsInner.getAsync | public Observable<ElasticPoolInner> getAsync(String resourceGroupName, String serverName, String elasticPoolName) {
"""
Gets an elastic pool.
@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 s... | java | public Observable<ElasticPoolInner> getAsync(String resourceGroupName, String serverName, String elasticPoolName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName).map(new Func1<ServiceResponse<ElasticPoolInner>, ElasticPoolInner>() {
@Override
public E... | [
"public",
"Observable",
"<",
"ElasticPoolInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"elasticPoolName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
"e... | Gets an elastic pool.
@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 elasticPoolName The name of the elastic pool to be retrieved.
@throws IllegalArgumentEx... | [
"Gets",
"an",
"elastic",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ElasticPoolsInner.java#L603-L610 |
codelibs/jcifs | src/main/java/jcifs/smb1/smb1/SmbTransport.java | SmbTransport.dfsPathSplit | void dfsPathSplit(String path, String[] result) {
"""
/* Split DFS path like \fs1.example.com\root5\link2\foo\bar.txt into at
most 3 components (not including the first index which is always empty):
result[0] = ""
result[1] = "fs1.example.com"
result[2] = "root5"
result[3] = "link2\foo\bar.txt"
"""
... | java | void dfsPathSplit(String path, String[] result)
{
int ri = 0, rlast = result.length - 1;
int i = 0, b = 0, len = path.length();
do {
if (ri == rlast) {
result[rlast] = path.substring(b);
return;
}
if (i == len || path.charA... | [
"void",
"dfsPathSplit",
"(",
"String",
"path",
",",
"String",
"[",
"]",
"result",
")",
"{",
"int",
"ri",
"=",
"0",
",",
"rlast",
"=",
"result",
".",
"length",
"-",
"1",
";",
"int",
"i",
"=",
"0",
",",
"b",
"=",
"0",
",",
"len",
"=",
"path",
"... | /* Split DFS path like \fs1.example.com\root5\link2\foo\bar.txt into at
most 3 components (not including the first index which is always empty):
result[0] = ""
result[1] = "fs1.example.com"
result[2] = "root5"
result[3] = "link2\foo\bar.txt" | [
"/",
"*",
"Split",
"DFS",
"path",
"like",
"\\",
"fs1",
".",
"example",
".",
"com",
"\\",
"root5",
"\\",
"link2",
"\\",
"foo",
"\\",
"bar",
".",
"txt",
"into",
"at",
"most",
"3",
"components",
"(",
"not",
"including",
"the",
"first",
"index",
"which",... | train | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/smb1/SmbTransport.java#L684-L703 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/nearcache/impl/preloader/NearCachePreloader.java | NearCachePreloader.storeKeys | public void storeKeys(Iterator<K> iterator) {
"""
Stores the Near Cache keys from the supplied iterator.
@param iterator {@link Iterator} over the key set of a {@link com.hazelcast.internal.nearcache.NearCacheRecordStore}
"""
long startedNanos = System.nanoTime();
FileOutputStream fos = null... | java | public void storeKeys(Iterator<K> iterator) {
long startedNanos = System.nanoTime();
FileOutputStream fos = null;
try {
buf = allocate(BUFFER_SIZE);
lastWrittenBytes = 0;
lastKeyCount = 0;
fos = new FileOutputStream(tmpStoreFile, false);
... | [
"public",
"void",
"storeKeys",
"(",
"Iterator",
"<",
"K",
">",
"iterator",
")",
"{",
"long",
"startedNanos",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"FileOutputStream",
"fos",
"=",
"null",
";",
"try",
"{",
"buf",
"=",
"allocate",
"(",
"BUFFER_SIZE... | Stores the Near Cache keys from the supplied iterator.
@param iterator {@link Iterator} over the key set of a {@link com.hazelcast.internal.nearcache.NearCacheRecordStore} | [
"Stores",
"the",
"Near",
"Cache",
"keys",
"from",
"the",
"supplied",
"iterator",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/nearcache/impl/preloader/NearCachePreloader.java#L169-L204 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/ClassUtils.java | ClassUtils.getCanonicalName | public static String getCanonicalName(final Class<?> cls, final String valueIfNull) {
"""
<p>Gets the canonical name for a {@code Class}.</p>
@param cls the class for which to get the canonical class name; may be null
@param valueIfNull the return value if null
@return the canonical name of the class, or {@c... | java | public static String getCanonicalName(final Class<?> cls, final String valueIfNull) {
if (cls == null) {
return valueIfNull;
}
final String canonicalName = cls.getCanonicalName();
return canonicalName == null ? valueIfNull : canonicalName;
} | [
"public",
"static",
"String",
"getCanonicalName",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"String",
"valueIfNull",
")",
"{",
"if",
"(",
"cls",
"==",
"null",
")",
"{",
"return",
"valueIfNull",
";",
"}",
"final",
"String",
"canonicalName",... | <p>Gets the canonical name for a {@code Class}.</p>
@param cls the class for which to get the canonical class name; may be null
@param valueIfNull the return value if null
@return the canonical name of the class, or {@code valueIfNull}
@since 3.7
@see Class#getCanonicalName() | [
"<p",
">",
"Gets",
"the",
"canonical",
"name",
"for",
"a",
"{",
"@code",
"Class",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ClassUtils.java#L1220-L1226 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancersInner.java | LoadBalancersInner.beginCreateOrUpdate | public LoadBalancerInner beginCreateOrUpdate(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) {
"""
Creates or updates a load balancer.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@param parameters Parameters s... | java | public LoadBalancerInner beginCreateOrUpdate(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).toBlocking().single().body();
} | [
"public",
"LoadBalancerInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"loadBalancerName",
",",
"LoadBalancerInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"loadBalancerNa... | Creates or updates a load balancer.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@param parameters Parameters supplied to the create or update load balancer operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws Cl... | [
"Creates",
"or",
"updates",
"a",
"load",
"balancer",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancersInner.java#L519-L521 |
Azure/azure-sdk-for-java | kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java | ClustersInner.createOrUpdate | public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) {
"""
Create or update a Kusto cluster.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@param parameters The Kusto ... | java | public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body();
} | [
"public",
"ClusterInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"ClusterInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
",",
"parameters",
... | Create or update a Kusto cluster.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation.
@throws IllegalArgumentException thrown if parameters fail t... | [
"Create",
"or",
"update",
"a",
"Kusto",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java#L231-L233 |
ebean-orm/ebean-querybean | src/main/java/io/ebean/typequery/PJson.java | PJson.jsonEqualTo | public R jsonEqualTo(String path, Object value) {
"""
Value at the given JSON path is equal to the given value.
<pre>{@code
new QSimpleDoc()
.content.jsonEqualTo("title", "Rob JSON in the DB")
.findList();
}</pre>
<pre>{@code
new QSimpleDoc()
.content.jsonEqualTo("path.other", 34)
.findList();... | java | public R jsonEqualTo(String path, Object value) {
expr().jsonEqualTo(_name, path, value);
return _root;
} | [
"public",
"R",
"jsonEqualTo",
"(",
"String",
"path",
",",
"Object",
"value",
")",
"{",
"expr",
"(",
")",
".",
"jsonEqualTo",
"(",
"_name",
",",
"path",
",",
"value",
")",
";",
"return",
"_root",
";",
"}"
] | Value at the given JSON path is equal to the given value.
<pre>{@code
new QSimpleDoc()
.content.jsonEqualTo("title", "Rob JSON in the DB")
.findList();
}</pre>
<pre>{@code
new QSimpleDoc()
.content.jsonEqualTo("path.other", 34)
.findList();
}</pre>
@param path the dot notation path in the JSON document
@param v... | [
"Value",
"at",
"the",
"given",
"JSON",
"path",
"is",
"equal",
"to",
"the",
"given",
"value",
"."
] | train | https://github.com/ebean-orm/ebean-querybean/blob/821650cb817c9c0fdcc97f93408dc79170b12423/src/main/java/io/ebean/typequery/PJson.java#L98-L101 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DecimalFormat.java | DecimalFormat.matchesDigit | private int matchesDigit(String str, int start, int[] decVal) {
"""
Check if the substring at the specified position matches a decimal digit.
If matched, this method sets the decimal value to <code>decVal</code> and
returns matched length.
@param str The input string
@param start The start index
@... | java | private int matchesDigit(String str, int start, int[] decVal) {
String[] localeDigits = symbols.getDigitStringsLocal();
// Check if the sequence at the current position matches locale digits.
for (int i = 0; i < 10; i++) {
int digitStrLen = localeDigits[i].length();
if (... | [
"private",
"int",
"matchesDigit",
"(",
"String",
"str",
",",
"int",
"start",
",",
"int",
"[",
"]",
"decVal",
")",
"{",
"String",
"[",
"]",
"localeDigits",
"=",
"symbols",
".",
"getDigitStringsLocal",
"(",
")",
";",
"// Check if the sequence at the current positi... | Check if the substring at the specified position matches a decimal digit.
If matched, this method sets the decimal value to <code>decVal</code> and
returns matched length.
@param str The input string
@param start The start index
@param decVal Receives decimal value
@return Length of match, or 0 i... | [
"Check",
"if",
"the",
"substring",
"at",
"the",
"specified",
"position",
"matches",
"a",
"decimal",
"digit",
".",
"If",
"matched",
"this",
"method",
"sets",
"the",
"decimal",
"value",
"to",
"<code",
">",
"decVal<",
"/",
"code",
">",
"and",
"returns",
"matc... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DecimalFormat.java#L2798-L2818 |
teknux-org/jetty-bootstrap | jetty-bootstrap/src/main/java/org/teknux/jettybootstrap/JettyBootstrap.java | JettyBootstrap.addExplodedWarApp | public WebAppContext addExplodedWarApp(String explodedWar, String descriptor) throws JettyBootstrapException {
"""
Add an exploded (not packaged) War application on the default context path {@value #CONTEXT_PATH_ROOT}
@param explodedWar
the exploded war path
@param descriptor
the web.xml descriptor path
@re... | java | public WebAppContext addExplodedWarApp(String explodedWar, String descriptor) throws JettyBootstrapException {
return addExplodedWarApp(explodedWar, descriptor, CONTEXT_PATH_ROOT);
} | [
"public",
"WebAppContext",
"addExplodedWarApp",
"(",
"String",
"explodedWar",
",",
"String",
"descriptor",
")",
"throws",
"JettyBootstrapException",
"{",
"return",
"addExplodedWarApp",
"(",
"explodedWar",
",",
"descriptor",
",",
"CONTEXT_PATH_ROOT",
")",
";",
"}"
] | Add an exploded (not packaged) War application on the default context path {@value #CONTEXT_PATH_ROOT}
@param explodedWar
the exploded war path
@param descriptor
the web.xml descriptor path
@return WebAppContext
@throws JettyBootstrapException
on failed | [
"Add",
"an",
"exploded",
"(",
"not",
"packaged",
")",
"War",
"application",
"on",
"the",
"default",
"context",
"path",
"{",
"@value",
"#CONTEXT_PATH_ROOT",
"}"
] | train | https://github.com/teknux-org/jetty-bootstrap/blob/c16e710b833084c650fce35aa8c1ccaf83cd93ef/jetty-bootstrap/src/main/java/org/teknux/jettybootstrap/JettyBootstrap.java#L305-L307 |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java | CommerceDiscountPersistenceImpl.findAll | @Override
public List<CommerceDiscount> findAll(int start, int end) {
"""
Returns a range of all the commerce discounts.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set... | java | @Override
public List<CommerceDiscount> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceDiscount",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce discounts.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>st... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"discounts",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java#L5171-L5174 |
lukas-krecan/completion-stage | src/main/java/net/javacrumbs/completionstage/CompletionStageFactory.java | CompletionStageFactory.supplyAsync | public final <U> CompletionStage<U> supplyAsync(Supplier<U> supplier) {
"""
Returns a new CompletionStage that is asynchronously completed
by a task running in the defaultAsyncExecutor with
the value obtained by calling the given Supplier.
@param supplier a function returning the value to be used
to complete... | java | public final <U> CompletionStage<U> supplyAsync(Supplier<U> supplier) {
return supplyAsync(supplier, defaultAsyncExecutor);
} | [
"public",
"final",
"<",
"U",
">",
"CompletionStage",
"<",
"U",
">",
"supplyAsync",
"(",
"Supplier",
"<",
"U",
">",
"supplier",
")",
"{",
"return",
"supplyAsync",
"(",
"supplier",
",",
"defaultAsyncExecutor",
")",
";",
"}"
] | Returns a new CompletionStage that is asynchronously completed
by a task running in the defaultAsyncExecutor with
the value obtained by calling the given Supplier.
@param supplier a function returning the value to be used
to complete the returned CompletionStage
@param <U> the function's return type
@return the new Co... | [
"Returns",
"a",
"new",
"CompletionStage",
"that",
"is",
"asynchronously",
"completed",
"by",
"a",
"task",
"running",
"in",
"the",
"defaultAsyncExecutor",
"with",
"the",
"value",
"obtained",
"by",
"calling",
"the",
"given",
"Supplier",
"."
] | train | https://github.com/lukas-krecan/completion-stage/blob/9c270d779b5fc98dc958a5fb335f6e2ad9d06962/src/main/java/net/javacrumbs/completionstage/CompletionStageFactory.java#L72-L74 |
Netflix/servo | servo-core/src/main/java/com/netflix/servo/monitor/MaxGauge.java | MaxGauge.updateMax | private void updateMax(int idx, long v) {
"""
Update the max for the given index if the provided value is larger than the current max.
"""
AtomicLong current = max.getCurrent(idx);
long m = current.get();
while (v > m) {
if (current.compareAndSet(m, v)) {
break;
}
m = curr... | java | private void updateMax(int idx, long v) {
AtomicLong current = max.getCurrent(idx);
long m = current.get();
while (v > m) {
if (current.compareAndSet(m, v)) {
break;
}
m = current.get();
}
} | [
"private",
"void",
"updateMax",
"(",
"int",
"idx",
",",
"long",
"v",
")",
"{",
"AtomicLong",
"current",
"=",
"max",
".",
"getCurrent",
"(",
"idx",
")",
";",
"long",
"m",
"=",
"current",
".",
"get",
"(",
")",
";",
"while",
"(",
"v",
">",
"m",
")",... | Update the max for the given index if the provided value is larger than the current max. | [
"Update",
"the",
"max",
"for",
"the",
"given",
"index",
"if",
"the",
"provided",
"value",
"is",
"larger",
"than",
"the",
"current",
"max",
"."
] | train | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/monitor/MaxGauge.java#L57-L66 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java | GlobalUsersInner.beginResetPassword | public void beginResetPassword(String userName, ResetPasswordPayload resetPasswordPayload) {
"""
Resets the user password on an environment This operation can take a while to complete.
@param userName The name of the user.
@param resetPasswordPayload Represents the payload for resetting passwords.
@throws Ill... | java | public void beginResetPassword(String userName, ResetPasswordPayload resetPasswordPayload) {
beginResetPasswordWithServiceResponseAsync(userName, resetPasswordPayload).toBlocking().single().body();
} | [
"public",
"void",
"beginResetPassword",
"(",
"String",
"userName",
",",
"ResetPasswordPayload",
"resetPasswordPayload",
")",
"{",
"beginResetPasswordWithServiceResponseAsync",
"(",
"userName",
",",
"resetPasswordPayload",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
... | Resets the user password on an environment This operation can take a while to complete.
@param userName The name of the user.
@param resetPasswordPayload Represents the payload for resetting passwords.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the reques... | [
"Resets",
"the",
"user",
"password",
"on",
"an",
"environment",
"This",
"operation",
"can",
"take",
"a",
"while",
"to",
"complete",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java#L998-L1000 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java | DataLabelingServiceClient.listInstructions | public final ListInstructionsPagedResponse listInstructions(String parent, String filter) {
"""
Lists instructions for a project. Pagination is supported.
<p>Sample code:
<pre><code>
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = Da... | java | public final ListInstructionsPagedResponse listInstructions(String parent, String filter) {
PROJECT_PATH_TEMPLATE.validate(parent, "listInstructions");
ListInstructionsRequest request =
ListInstructionsRequest.newBuilder().setParent(parent).setFilter(filter).build();
return listInstructions(request)... | [
"public",
"final",
"ListInstructionsPagedResponse",
"listInstructions",
"(",
"String",
"parent",
",",
"String",
"filter",
")",
"{",
"PROJECT_PATH_TEMPLATE",
".",
"validate",
"(",
"parent",
",",
"\"listInstructions\"",
")",
";",
"ListInstructionsRequest",
"request",
"=",... | Lists instructions for a project. Pagination is supported.
<p>Sample code:
<pre><code>
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
String filter = "";
for (Instruction element : data... | [
"Lists",
"instructions",
"for",
"a",
"project",
".",
"Pagination",
"is",
"supported",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java#L2604-L2609 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/loader/impl/OgmLoader.java | OgmLoader.loadEntitiesFromTuples | @Override
public List<Object> loadEntitiesFromTuples(SharedSessionContractImplementor session, LockOptions lockOptions, OgmLoadingContext ogmContext) {
"""
Load a list of entities using the information in the context
@param session The session
@param lockOptions The locking details
@param ogmContext The cont... | java | @Override
public List<Object> loadEntitiesFromTuples(SharedSessionContractImplementor session, LockOptions lockOptions, OgmLoadingContext ogmContext) {
return loadEntity( null, null, session, lockOptions, ogmContext );
} | [
"@",
"Override",
"public",
"List",
"<",
"Object",
">",
"loadEntitiesFromTuples",
"(",
"SharedSessionContractImplementor",
"session",
",",
"LockOptions",
"lockOptions",
",",
"OgmLoadingContext",
"ogmContext",
")",
"{",
"return",
"loadEntity",
"(",
"null",
",",
"null",
... | Load a list of entities using the information in the context
@param session The session
@param lockOptions The locking details
@param ogmContext The context with the information to load the entities
@return the list of entities corresponding to the given context | [
"Load",
"a",
"list",
"of",
"entities",
"using",
"the",
"information",
"in",
"the",
"context"
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/loader/impl/OgmLoader.java#L219-L222 |
alipay/sofa-rpc | core-impl/client/src/main/java/com/alipay/sofa/rpc/client/AllConnectConnectionHolder.java | AllConnectConnectionHolder.aliveToRetry | protected void aliveToRetry(ProviderInfo providerInfo, ClientTransport transport) {
"""
从存活丢到重试列表
@param providerInfo Provider
@param transport 连接
"""
providerLock.lock();
try {
if (aliveConnections.remove(providerInfo) != null) {
retryConnections.put(provider... | java | protected void aliveToRetry(ProviderInfo providerInfo, ClientTransport transport) {
providerLock.lock();
try {
if (aliveConnections.remove(providerInfo) != null) {
retryConnections.put(providerInfo, transport);
}
} finally {
providerLock.unlock... | [
"protected",
"void",
"aliveToRetry",
"(",
"ProviderInfo",
"providerInfo",
",",
"ClientTransport",
"transport",
")",
"{",
"providerLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"aliveConnections",
".",
"remove",
"(",
"providerInfo",
")",
"!=",
"null... | 从存活丢到重试列表
@param providerInfo Provider
@param transport 连接 | [
"从存活丢到重试列表"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core-impl/client/src/main/java/com/alipay/sofa/rpc/client/AllConnectConnectionHolder.java#L145-L154 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/container/impl/metadata/BpmPlatformXmlParse.java | BpmPlatformXmlParse.parseJobAcquisition | protected void parseJobAcquisition(Element element, List<JobAcquisitionXml> jobAcquisitions) {
"""
parse a <code><job-acquisition .../></code> element and add it to the
list of parsed elements
"""
JobAcquisitionXmlImpl jobAcquisition = new JobAcquisitionXmlImpl();
// set name
jobAcquisitio... | java | protected void parseJobAcquisition(Element element, List<JobAcquisitionXml> jobAcquisitions) {
JobAcquisitionXmlImpl jobAcquisition = new JobAcquisitionXmlImpl();
// set name
jobAcquisition.setName(element.attribute(NAME));
Map<String, String> properties = new HashMap<String, String>();
for (Ele... | [
"protected",
"void",
"parseJobAcquisition",
"(",
"Element",
"element",
",",
"List",
"<",
"JobAcquisitionXml",
">",
"jobAcquisitions",
")",
"{",
"JobAcquisitionXmlImpl",
"jobAcquisition",
"=",
"new",
"JobAcquisitionXmlImpl",
"(",
")",
";",
"// set name",
"jobAcquisition"... | parse a <code><job-acquisition .../></code> element and add it to the
list of parsed elements | [
"parse",
"a",
"<code",
">",
"<",
";",
"job",
"-",
"acquisition",
"...",
"/",
">",
";",
"<",
"/",
"code",
">",
"element",
"and",
"add",
"it",
"to",
"the",
"list",
"of",
"parsed",
"elements"
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/container/impl/metadata/BpmPlatformXmlParse.java#L107-L131 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSPlot.java | OPTICSPlot.plotForClusterOrder | public static OPTICSPlot plotForClusterOrder(ClusterOrder co, VisualizerContext context) {
"""
Static method to find an optics plot for a result, or to create a new one
using the given context.
@param co Cluster order
@param context Context (for colors and reference clustering)
@return New or existing opti... | java | public static OPTICSPlot plotForClusterOrder(ClusterOrder co, VisualizerContext context) {
// Check for an existing plot
// ArrayList<OPTICSPlot<D>> plots = ResultUtil.filterResults(co,
// OPTICSPlot.class);
// if (plots.size() > 0) {
// return plots.get(0);
// }
final StylingPolicy policy =... | [
"public",
"static",
"OPTICSPlot",
"plotForClusterOrder",
"(",
"ClusterOrder",
"co",
",",
"VisualizerContext",
"context",
")",
"{",
"// Check for an existing plot",
"// ArrayList<OPTICSPlot<D>> plots = ResultUtil.filterResults(co,",
"// OPTICSPlot.class);",
"// if (plots.size() > 0) {",... | Static method to find an optics plot for a result, or to create a new one
using the given context.
@param co Cluster order
@param context Context (for colors and reference clustering)
@return New or existing optics plot | [
"Static",
"method",
"to",
"find",
"an",
"optics",
"plot",
"for",
"a",
"result",
"or",
"to",
"create",
"a",
"new",
"one",
"using",
"the",
"given",
"context",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSPlot.java#L278-L289 |
elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java | FastMultidimensionalScalingTransform.multiply | protected double multiply(double[][] mat, double[] in, double[] out) {
"""
Compute out = A * in, and return the (signed!) length of the output vector.
@param mat Matrix.
@param in Input vector.
@param out Output vector storage.
@return Length of this vector.
"""
double l = 0.;
// Matrix multiplic... | java | protected double multiply(double[][] mat, double[] in, double[] out) {
double l = 0.;
// Matrix multiplication:
for(int d1 = 0; d1 < in.length; d1++) {
final double[] row = mat[d1];
double t = 0.;
for(int d2 = 0; d2 < in.length; d2++) {
t += row[d2] * in[d2];
}
out[d1] ... | [
"protected",
"double",
"multiply",
"(",
"double",
"[",
"]",
"[",
"]",
"mat",
",",
"double",
"[",
"]",
"in",
",",
"double",
"[",
"]",
"out",
")",
"{",
"double",
"l",
"=",
"0.",
";",
"// Matrix multiplication:",
"for",
"(",
"int",
"d1",
"=",
"0",
";"... | Compute out = A * in, and return the (signed!) length of the output vector.
@param mat Matrix.
@param in Input vector.
@param out Output vector storage.
@return Length of this vector. | [
"Compute",
"out",
"=",
"A",
"*",
"in",
"and",
"return",
"the",
"(",
"signed!",
")",
"length",
"of",
"the",
"output",
"vector",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java#L236-L249 |
dottydingo/hyperion | core/src/main/java/com/dottydingo/hyperion/core/endpoint/pipeline/phase/UpdatePhase.java | UpdatePhase.processLegacyRequest | protected void processLegacyRequest(HyperionContext hyperionContext) {
"""
Process a legacy V1 request (single item)
@param hyperionContext The context
"""
EndpointRequest request = hyperionContext.getEndpointRequest();
EndpointResponse response = hyperionContext.getEndpointResponse();
... | java | protected void processLegacyRequest(HyperionContext hyperionContext)
{
EndpointRequest request = hyperionContext.getEndpointRequest();
EndpointResponse response = hyperionContext.getEndpointResponse();
ApiVersionPlugin<ApiObject<Serializable>,PersistentObject<Serializable>,Serializable> api... | [
"protected",
"void",
"processLegacyRequest",
"(",
"HyperionContext",
"hyperionContext",
")",
"{",
"EndpointRequest",
"request",
"=",
"hyperionContext",
".",
"getEndpointRequest",
"(",
")",
";",
"EndpointResponse",
"response",
"=",
"hyperionContext",
".",
"getEndpointRespo... | Process a legacy V1 request (single item)
@param hyperionContext The context | [
"Process",
"a",
"legacy",
"V1",
"request",
"(",
"single",
"item",
")"
] | train | https://github.com/dottydingo/hyperion/blob/c4d119c90024a88c0335d7d318e9ccdb70149764/core/src/main/java/com/dottydingo/hyperion/core/endpoint/pipeline/phase/UpdatePhase.java#L48-L88 |
gwtbootstrap3/gwtbootstrap3-extras | src/main/java/org/gwtbootstrap3/extras/typeahead/client/ui/Typeahead.java | Typeahead.onCursorChanged | private void onCursorChanged(final Event event, final Suggestion<T> suggestion) {
"""
Triggered when the dropdown menu cursor is moved to a different suggestion.
@param event the event
@param suggestion the suggestion object
"""
TypeaheadCursorChangedEvent.fire(this, suggestion, event);
} | java | private void onCursorChanged(final Event event, final Suggestion<T> suggestion) {
TypeaheadCursorChangedEvent.fire(this, suggestion, event);
} | [
"private",
"void",
"onCursorChanged",
"(",
"final",
"Event",
"event",
",",
"final",
"Suggestion",
"<",
"T",
">",
"suggestion",
")",
"{",
"TypeaheadCursorChangedEvent",
".",
"fire",
"(",
"this",
",",
"suggestion",
",",
"event",
")",
";",
"}"
] | Triggered when the dropdown menu cursor is moved to a different suggestion.
@param event the event
@param suggestion the suggestion object | [
"Triggered",
"when",
"the",
"dropdown",
"menu",
"cursor",
"is",
"moved",
"to",
"a",
"different",
"suggestion",
"."
] | train | https://github.com/gwtbootstrap3/gwtbootstrap3-extras/blob/8e42aaffd2a082e9cb23a14c37a3c87b7cbdfa94/src/main/java/org/gwtbootstrap3/extras/typeahead/client/ui/Typeahead.java#L180-L182 |
j256/ormlite-core | src/main/java/com/j256/ormlite/table/TableUtils.java | TableUtils.clearTable | public static <T> int clearTable(ConnectionSource connectionSource, Class<T> dataClass) throws SQLException {
"""
Clear all data out of the table. For certain database types and with large sized tables, which may take a long
time. In some configurations, it may be faster to drop and re-create the table.
<p>
<... | java | public static <T> int clearTable(ConnectionSource connectionSource, Class<T> dataClass) throws SQLException {
DatabaseType databaseType = connectionSource.getDatabaseType();
String tableName = DatabaseTableConfig.extractTableName(databaseType, dataClass);
if (databaseType.isEntityNamesMustBeUpCase()) {
tableNa... | [
"public",
"static",
"<",
"T",
">",
"int",
"clearTable",
"(",
"ConnectionSource",
"connectionSource",
",",
"Class",
"<",
"T",
">",
"dataClass",
")",
"throws",
"SQLException",
"{",
"DatabaseType",
"databaseType",
"=",
"connectionSource",
".",
"getDatabaseType",
"(",... | Clear all data out of the table. For certain database types and with large sized tables, which may take a long
time. In some configurations, it may be faster to drop and re-create the table.
<p>
<b>WARNING:</b> This is [obviously] very destructive and is unrecoverable.
</p> | [
"Clear",
"all",
"data",
"out",
"of",
"the",
"table",
".",
"For",
"certain",
"database",
"types",
"and",
"with",
"large",
"sized",
"tables",
"which",
"may",
"take",
"a",
"long",
"time",
".",
"In",
"some",
"configurations",
"it",
"may",
"be",
"faster",
"to... | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/TableUtils.java#L232-L239 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java | ApiOvhDbaaslogs.serviceName_input_inputId_allowedNetwork_POST | public OvhOperation serviceName_input_inputId_allowedNetwork_POST(String serviceName, String inputId, String network) throws IOException {
"""
Allow an ip to join input
REST: POST /dbaas/logs/{serviceName}/input/{inputId}/allowedNetwork
@param serviceName [required] Service name
@param inputId [required] Inpu... | java | public OvhOperation serviceName_input_inputId_allowedNetwork_POST(String serviceName, String inputId, String network) throws IOException {
String qPath = "/dbaas/logs/{serviceName}/input/{inputId}/allowedNetwork";
StringBuilder sb = path(qPath, serviceName, inputId);
HashMap<String, Object>o = new HashMap<String,... | [
"public",
"OvhOperation",
"serviceName_input_inputId_allowedNetwork_POST",
"(",
"String",
"serviceName",
",",
"String",
"inputId",
",",
"String",
"network",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dbaas/logs/{serviceName}/input/{inputId}/allowedNetwork\""... | Allow an ip to join input
REST: POST /dbaas/logs/{serviceName}/input/{inputId}/allowedNetwork
@param serviceName [required] Service name
@param inputId [required] Input ID
@param network [required] IP block | [
"Allow",
"an",
"ip",
"to",
"join",
"input"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java#L497-L504 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java | ProfileSummaryBuilder.buildExceptionSummary | public void buildExceptionSummary(XMLNode node, Content packageSummaryContentTree) {
"""
Build the summary for the exceptions in the package.
@param node the XML element that specifies which components to document
@param packageSummaryContentTree the tree to which the exception summary will
be added
"""
... | java | public void buildExceptionSummary(XMLNode node, Content packageSummaryContentTree) {
String exceptionTableSummary =
configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Exception_Summary"),
configuration.getText("doclet.exceptions"));... | [
"public",
"void",
"buildExceptionSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"packageSummaryContentTree",
")",
"{",
"String",
"exceptionTableSummary",
"=",
"configuration",
".",
"getText",
"(",
"\"doclet.Member_Table_Summary\"",
",",
"configuration",
".",
"getText",... | Build the summary for the exceptions in the package.
@param node the XML element that specifies which components to document
@param packageSummaryContentTree the tree to which the exception summary will
be added | [
"Build",
"the",
"summary",
"for",
"the",
"exceptions",
"in",
"the",
"package",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java#L260-L276 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ElasticPoolsInner.java | ElasticPoolsInner.beginCreateOrUpdateAsync | public Observable<ElasticPoolInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters) {
"""
Creates a new elastic pool or updates an existing elastic pool.
@param resourceGroupName The name of the resource group that contains the resource.... | java | public Observable<ElasticPoolInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).map(new Func1<ServiceResponse<ElasticPoo... | [
"public",
"Observable",
"<",
"ElasticPoolInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"elasticPoolName",
",",
"ElasticPoolInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceRes... | Creates a new elastic pool or updates an existing elastic pool.
@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 elasticPoolName The name of the elastic pool ... | [
"Creates",
"a",
"new",
"elastic",
"pool",
"or",
"updates",
"an",
"existing",
"elastic",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ElasticPoolsInner.java#L224-L231 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java | OperationsApi.getUsersAsyncAsync | public com.squareup.okhttp.Call getUsersAsyncAsync(String aioId, Integer limit, Integer offset, String order, String sortBy, String filterName, String filterParameters, String roles, String skills, Boolean userEnabled, String userValid, final ApiCallback<ApiAsyncSuccessResponse> callback) throws ApiException {
"""
... | java | public com.squareup.okhttp.Call getUsersAsyncAsync(String aioId, Integer limit, Integer offset, String order, String sortBy, String filterName, String filterParameters, String roles, String skills, Boolean userEnabled, String userValid, final ApiCallback<ApiAsyncSuccessResponse> callback) throws ApiException {
... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"getUsersAsyncAsync",
"(",
"String",
"aioId",
",",
"Integer",
"limit",
",",
"Integer",
"offset",
",",
"String",
"order",
",",
"String",
"sortBy",
",",
"String",
"filterName",
",",
"String",
"filte... | Get users. (asynchronously)
Get [CfgPerson](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgPerson) objects based on the specified filters.
@param aioId A unique ID generated on the client (browser) when sending an API request that returns an asynchronous response. (required)
@param limit Limit the... | [
"Get",
"users",
".",
"(",
"asynchronously",
")",
"Get",
"[",
"CfgPerson",
"]",
"(",
"https",
":",
"//",
"docs",
".",
"genesys",
".",
"com",
"/",
"Documentation",
"/",
"PSDK",
"/",
"latest",
"/",
"ConfigLayerRef",
"/",
"CfgPerson",
")",
"objects",
"based"... | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java#L697-L722 |
CloudSlang/cs-actions | cs-vmware/src/main/java/io/cloudslang/content/vmware/services/GuestService.java | GuestService.customizeVM | public Map<String, String> customizeVM(HttpInputs httpInputs, VmInputs vmInputs, GuestInputs guestInputs, boolean isWin)
throws Exception {
"""
Method used to connect to specified data center and customize the windows OS based virtual machine identified
by the inputs provided.
@param httpInputs Ob... | java | public Map<String, String> customizeVM(HttpInputs httpInputs, VmInputs vmInputs, GuestInputs guestInputs, boolean isWin)
throws Exception {
ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs);
try {
ManagedObjectReference vmMor = new MorObjectH... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"customizeVM",
"(",
"HttpInputs",
"httpInputs",
",",
"VmInputs",
"vmInputs",
",",
"GuestInputs",
"guestInputs",
",",
"boolean",
"isWin",
")",
"throws",
"Exception",
"{",
"ConnectionResources",
"connectionResources"... | Method used to connect to specified data center and customize the windows OS based virtual machine identified
by the inputs provided.
@param httpInputs Object that has all the inputs necessary to made a connection to data center
@param vmInputs Object that has all the specific inputs necessary to identify the targ... | [
"Method",
"used",
"to",
"connect",
"to",
"specified",
"data",
"center",
"and",
"customize",
"the",
"windows",
"OS",
"based",
"virtual",
"machine",
"identified",
"by",
"the",
"inputs",
"provided",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-vmware/src/main/java/io/cloudslang/content/vmware/services/GuestService.java#L41-L69 |
mediathekview/MLib | src/main/java/de/mediathekview/mlib/tool/FilenameUtils.java | FilenameUtils.removeIllegalCharacters | public static String removeIllegalCharacters(final String input, boolean isPath) {
"""
Remove illegal characters from String based on current OS.
@param input The input string
@param isPath
@return Cleaned-up string.
"""
String ret = input;
switch (Functions.getOs()) {
case MA... | java | public static String removeIllegalCharacters(final String input, boolean isPath) {
String ret = input;
switch (Functions.getOs()) {
case MAC:
case LINUX:
//On OSX the VFS take care of writing correct filenames to FAT filesystems...
//Just remove t... | [
"public",
"static",
"String",
"removeIllegalCharacters",
"(",
"final",
"String",
"input",
",",
"boolean",
"isPath",
")",
"{",
"String",
"ret",
"=",
"input",
";",
"switch",
"(",
"Functions",
".",
"getOs",
"(",
")",
")",
"{",
"case",
"MAC",
":",
"case",
"L... | Remove illegal characters from String based on current OS.
@param input The input string
@param isPath
@return Cleaned-up string. | [
"Remove",
"illegal",
"characters",
"from",
"String",
"based",
"on",
"current",
"OS",
"."
] | train | https://github.com/mediathekview/MLib/blob/01fd5791d87390fea7536275b8a2d4407fc00908/src/main/java/de/mediathekview/mlib/tool/FilenameUtils.java#L283-L312 |
apache/incubator-druid | extensions-core/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcStructConverter.java | OrcStructConverter.convertRootField | @Nullable
Object convertRootField(OrcStruct struct, String fieldName) {
"""
Convert a orc struct field of the "root" {@link OrcStruct} that represents the "row". This method has a cache of
field names to field index that is ONLY valid for this {@link OrcStruct}, and should not be used for
nested {@link OrcStru... | java | @Nullable
Object convertRootField(OrcStruct struct, String fieldName)
{
// this cache is only valid for the root level, to skip the indexOf on fieldNames to get the fieldIndex.
TypeDescription schema = struct.getSchema();
final List<String> fields = schema.getFieldNames();
if (fieldIndexCache == nul... | [
"@",
"Nullable",
"Object",
"convertRootField",
"(",
"OrcStruct",
"struct",
",",
"String",
"fieldName",
")",
"{",
"// this cache is only valid for the root level, to skip the indexOf on fieldNames to get the fieldIndex.",
"TypeDescription",
"schema",
"=",
"struct",
".",
"getSchema... | Convert a orc struct field of the "root" {@link OrcStruct} that represents the "row". This method has a cache of
field names to field index that is ONLY valid for this {@link OrcStruct}, and should not be used for
nested {@link OrcStruct} fields of the row. Looks up field index by field name, and delegates to
{@link Or... | [
"Convert",
"a",
"orc",
"struct",
"field",
"of",
"the",
"root",
"{"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/extensions-core/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcStructConverter.java#L157-L174 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeCRI.java | TreeCRI.preRequest | public void preRequest(RequestInterceptorContext ctxt, InterceptorChain chain) throws InterceptorException {
"""
Implementation of the {@link RequestInterceptor#preRequest(org.apache.beehive.netui.pageflow.interceptor.request.RequestInterceptorContext, org.apache.beehive.netui.pageflow.interceptor.InterceptorChain... | java | public void preRequest(RequestInterceptorContext ctxt, InterceptorChain chain) throws InterceptorException
{
HttpServletRequest request = ctxt.getRequest();
String cmd = parseCommand(request.getRequestURI());
render(request, ctxt.getResponse(), ctxt.getServletContext(), cmd);
chain... | [
"public",
"void",
"preRequest",
"(",
"RequestInterceptorContext",
"ctxt",
",",
"InterceptorChain",
"chain",
")",
"throws",
"InterceptorException",
"{",
"HttpServletRequest",
"request",
"=",
"ctxt",
".",
"getRequest",
"(",
")",
";",
"String",
"cmd",
"=",
"parseComman... | Implementation of the {@link RequestInterceptor#preRequest(org.apache.beehive.netui.pageflow.interceptor.request.RequestInterceptorContext, org.apache.beehive.netui.pageflow.interceptor.InterceptorChain)}
method for using this class as part of a request interceptor chain.
@param ctxt the interceptor's context object
@... | [
"Implementation",
"of",
"the",
"{",
"@link",
"RequestInterceptor#preRequest",
"(",
"org",
".",
"apache",
".",
"beehive",
".",
"netui",
".",
"pageflow",
".",
"interceptor",
".",
"request",
".",
"RequestInterceptorContext",
"org",
".",
"apache",
".",
"beehive",
".... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeCRI.java#L89-L97 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRJassimpAdapter.java | GVRJassimpAdapter.fixKeys | private void fixKeys(GVRAnimationChannel channel, Vector3f scaleFactor) {
"""
/*
Some FBX files are exported as centimeters. Assimp does not correctly compute the scale keys.
They should include the scaling from the bind pose since the animations are NOT relative
to the bind pose.
"""
float[] temp =... | java | private void fixKeys(GVRAnimationChannel channel, Vector3f scaleFactor)
{
float[] temp = new float[3];
for (int i = 0; i < channel.getNumPosKeys(); ++i)
{
float time = (float) channel.getPosKeyTime(i);
channel.getPosKeyVector(i, temp);
temp[0] *= scaleFact... | [
"private",
"void",
"fixKeys",
"(",
"GVRAnimationChannel",
"channel",
",",
"Vector3f",
"scaleFactor",
")",
"{",
"float",
"[",
"]",
"temp",
"=",
"new",
"float",
"[",
"3",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"channel",
".",
"getNu... | /*
Some FBX files are exported as centimeters. Assimp does not correctly compute the scale keys.
They should include the scaling from the bind pose since the animations are NOT relative
to the bind pose. | [
"/",
"*",
"Some",
"FBX",
"files",
"are",
"exported",
"as",
"centimeters",
".",
"Assimp",
"does",
"not",
"correctly",
"compute",
"the",
"scale",
"keys",
".",
"They",
"should",
"include",
"the",
"scaling",
"from",
"the",
"bind",
"pose",
"since",
"the",
"anim... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRJassimpAdapter.java#L647-L668 |
MindscapeHQ/raygun4android | provider/src/main/java/com.mindscapehq.android.raygun4android/RaygunClient.java | RaygunClient.AttachExceptionHandler | @Deprecated public static void AttachExceptionHandler(List tags, Map userCustomData) {
"""
Attaches a pre-built Raygun exception handler to the thread's DefaultUncaughtExceptionHandler.
This automatically sends any exceptions that reaches it to the Raygun API.
@param tags A list of tags that relate to the callin... | java | @Deprecated public static void AttachExceptionHandler(List tags, Map userCustomData) {
UncaughtExceptionHandler oldHandler = Thread.getDefaultUncaughtExceptionHandler();
if (!(oldHandler instanceof RaygunUncaughtExceptionHandler)) {
RaygunClient.handler = new RaygunUncaughtExceptionHandler(oldHandler, tag... | [
"@",
"Deprecated",
"public",
"static",
"void",
"AttachExceptionHandler",
"(",
"List",
"tags",
",",
"Map",
"userCustomData",
")",
"{",
"UncaughtExceptionHandler",
"oldHandler",
"=",
"Thread",
".",
"getDefaultUncaughtExceptionHandler",
"(",
")",
";",
"if",
"(",
"!",
... | Attaches a pre-built Raygun exception handler to the thread's DefaultUncaughtExceptionHandler.
This automatically sends any exceptions that reaches it to the Raygun API.
@param tags A list of tags that relate to the calling application's currently build or state.
These will be appended to all exception messages sent to... | [
"Attaches",
"a",
"pre",
"-",
"built",
"Raygun",
"exception",
"handler",
"to",
"the",
"thread",
"s",
"DefaultUncaughtExceptionHandler",
".",
"This",
"automatically",
"sends",
"any",
"exceptions",
"that",
"reaches",
"it",
"to",
"the",
"Raygun",
"API",
"."
] | train | https://github.com/MindscapeHQ/raygun4android/blob/227231f9b8aca1cafa5b6518a388d128e37d35fe/provider/src/main/java/com.mindscapehq.android.raygun4android/RaygunClient.java#L310-L316 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SARLJvmGenerator.java | SARLJvmGenerator.generateStaticConstructor | protected ITreeAppendable generateStaticConstructor(JvmOperation it, ITreeAppendable appendable, GeneratorConfig config) {
"""
Generate a static constructor from the given Jvm constructor.
@param it the container of the code.
@param appendable the output.
@param config the generation configuration.
@return t... | java | protected ITreeAppendable generateStaticConstructor(JvmOperation it, ITreeAppendable appendable, GeneratorConfig config) {
appendable.newLine();
appendable.openScope();
generateJavaDoc(it, appendable, config);
final ITreeAppendable tracedAppendable = appendable.trace(it);
tracedAppendable.append("static "); /... | [
"protected",
"ITreeAppendable",
"generateStaticConstructor",
"(",
"JvmOperation",
"it",
",",
"ITreeAppendable",
"appendable",
",",
"GeneratorConfig",
"config",
")",
"{",
"appendable",
".",
"newLine",
"(",
")",
";",
"appendable",
".",
"openScope",
"(",
")",
";",
"g... | Generate a static constructor from the given Jvm constructor.
@param it the container of the code.
@param appendable the output.
@param config the generation configuration.
@return the appendable. | [
"Generate",
"a",
"static",
"constructor",
"from",
"the",
"given",
"Jvm",
"constructor",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SARLJvmGenerator.java#L129-L137 |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/UIViewRoot.java | UIViewRoot._process | private boolean _process(FacesContext context, PhaseId phaseId, PhaseProcessor processor) {
"""
Process the specified phase by calling PhaseListener.beforePhase for every phase listeners defined on this
view root, then calling the process method of the processor, broadcasting relevant events and finally
notifyin... | java | private boolean _process(FacesContext context, PhaseId phaseId, PhaseProcessor processor)
{
RuntimeException processingException = null;
try
{
if (!notifyListeners(context, phaseId, getBeforePhaseListener(), true))
{
try
{
... | [
"private",
"boolean",
"_process",
"(",
"FacesContext",
"context",
",",
"PhaseId",
"phaseId",
",",
"PhaseProcessor",
"processor",
")",
"{",
"RuntimeException",
"processingException",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"!",
"notifyListeners",
"(",
"context",
... | Process the specified phase by calling PhaseListener.beforePhase for every phase listeners defined on this
view root, then calling the process method of the processor, broadcasting relevant events and finally
notifying the afterPhase method of every phase listeners registered on this view root.
@param context
@param p... | [
"Process",
"the",
"specified",
"phase",
"by",
"calling",
"PhaseListener",
".",
"beforePhase",
"for",
"every",
"phase",
"listeners",
"defined",
"on",
"this",
"view",
"root",
"then",
"calling",
"the",
"process",
"method",
"of",
"the",
"processor",
"broadcasting",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/UIViewRoot.java#L1644-L1685 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Chunk.java | Chunk.setUnderline | public Chunk setUnderline(Color color, float thickness, float thicknessMul,
float yPosition, float yPositionMul, int cap) {
"""
Sets an horizontal line that can be an underline or a strikethrough.
Actually, the line can be anywhere vertically and has always the <CODE>
Chunk</CODE> width. Multiple call to this... | java | public Chunk setUnderline(Color color, float thickness, float thicknessMul,
float yPosition, float yPositionMul, int cap) {
if (attributes == null)
attributes = new HashMap();
Object obj[] = {
color,
new float[] { thickness, thicknessMul, yPosition, yPositionMul, cap } };
Object unders[][] = Utiliti... | [
"public",
"Chunk",
"setUnderline",
"(",
"Color",
"color",
",",
"float",
"thickness",
",",
"float",
"thicknessMul",
",",
"float",
"yPosition",
",",
"float",
"yPositionMul",
",",
"int",
"cap",
")",
"{",
"if",
"(",
"attributes",
"==",
"null",
")",
"attributes",... | Sets an horizontal line that can be an underline or a strikethrough.
Actually, the line can be anywhere vertically and has always the <CODE>
Chunk</CODE> width. Multiple call to this method will produce multiple
lines.
@param color
the color of the line or <CODE>null</CODE> to follow the
text color
@param thickness
th... | [
"Sets",
"an",
"horizontal",
"line",
"that",
"can",
"be",
"an",
"underline",
"or",
"a",
"strikethrough",
".",
"Actually",
"the",
"line",
"can",
"be",
"anywhere",
"vertically",
"and",
"has",
"always",
"the",
"<CODE",
">",
"Chunk<",
"/",
"CODE",
">",
"width",... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Chunk.java#L525-L535 |
spring-cloud/spring-cloud-contract | spring-cloud-contract-verifier/src/main/java/org/springframework/cloud/contract/verifier/assertion/CollectionAssert.java | CollectionAssert.hasSizeBetween | public CollectionAssert hasSizeBetween(int lowerBound, int higherBound) {
"""
Checks whether size is between the provided value.
@param lowerBound - the collection should have size greater than or equal to this
value
@param higherBound - the collection should have size less than or equal to this
value
@return... | java | public CollectionAssert hasSizeBetween(int lowerBound, int higherBound) {
isNotNull();
int size = size(this.actual);
if (!(size >= lowerBound && size <= higherBound)) {
failWithMessage("The size <%s> is not between <%s> and <%s>", size,
lowerBound, higherBound);
}
return this;
} | [
"public",
"CollectionAssert",
"hasSizeBetween",
"(",
"int",
"lowerBound",
",",
"int",
"higherBound",
")",
"{",
"isNotNull",
"(",
")",
";",
"int",
"size",
"=",
"size",
"(",
"this",
".",
"actual",
")",
";",
"if",
"(",
"!",
"(",
"size",
">=",
"lowerBound",
... | Checks whether size is between the provided value.
@param lowerBound - the collection should have size greater than or equal to this
value
@param higherBound - the collection should have size less than or equal to this
value
@return this | [
"Checks",
"whether",
"size",
"is",
"between",
"the",
"provided",
"value",
"."
] | train | https://github.com/spring-cloud/spring-cloud-contract/blob/857da51950a87b393286e3bb1b2208c420c01087/spring-cloud-contract-verifier/src/main/java/org/springframework/cloud/contract/verifier/assertion/CollectionAssert.java#L163-L171 |
jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/configuration/ConfigurationProperties.java | ConfigurationProperties.logLevel | public static void logLevel(String level) {
"""
Override the default logging level of INFO
@param level the log level, which can be TRACE, DEBUG, INFO, WARN, ERROR, OFF
"""
if (!Arrays.asList("TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF").contains(level)) {
throw new IllegalArgumentEx... | java | public static void logLevel(String level) {
if (!Arrays.asList("TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF").contains(level)) {
throw new IllegalArgumentException("log level \"" + level + "\" is not legal it must be one of \"TRACE\", \"DEBUG\", \"INFO\", \"WARN\", \"ERROR\", \"OFF\"");
}... | [
"public",
"static",
"void",
"logLevel",
"(",
"String",
"level",
")",
"{",
"if",
"(",
"!",
"Arrays",
".",
"asList",
"(",
"\"TRACE\"",
",",
"\"DEBUG\"",
",",
"\"INFO\"",
",",
"\"WARN\"",
",",
"\"ERROR\"",
",",
"\"OFF\"",
")",
".",
"contains",
"(",
"level",... | Override the default logging level of INFO
@param level the log level, which can be TRACE, DEBUG, INFO, WARN, ERROR, OFF | [
"Override",
"the",
"default",
"logging",
"level",
"of",
"INFO"
] | train | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/configuration/ConfigurationProperties.java#L286-L292 |
tango-controls/JTango | client/src/main/java/fr/soleil/tango/clientapi/TangoCommand.java | TangoCommand.executeExtractList | public <T> List<T> executeExtractList(final Class<T> clazz, final Object value) throws DevFailed {
"""
Execute a command with argin which is a single value
@param <T>
@param clazz
@param value
@return
@throws DevFailed
"""
final Object r = command.executeExtract(value);
return extractLis... | java | public <T> List<T> executeExtractList(final Class<T> clazz, final Object value) throws DevFailed {
final Object r = command.executeExtract(value);
return extractList(TypeConversionUtil.castToType(clazz, r));
} | [
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"executeExtractList",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
",",
"final",
"Object",
"value",
")",
"throws",
"DevFailed",
"{",
"final",
"Object",
"r",
"=",
"command",
".",
"executeExtract",
"(",
"... | Execute a command with argin which is a single value
@param <T>
@param clazz
@param value
@return
@throws DevFailed | [
"Execute",
"a",
"command",
"with",
"argin",
"which",
"is",
"a",
"single",
"value"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/client/src/main/java/fr/soleil/tango/clientapi/TangoCommand.java#L190-L193 |
threerings/narya | core/src/main/java/com/threerings/presents/server/ClientManager.java | ClientManager.applyToClient | public void applyToClient (Name username, final ClientOp clop) {
"""
Resolves the specified client, applies the supplied client operation to them and releases
the client.
"""
resolveClientObject(username, new ClientResolutionListener() {
public void clientResolved (Name username, ClientObj... | java | public void applyToClient (Name username, final ClientOp clop)
{
resolveClientObject(username, new ClientResolutionListener() {
public void clientResolved (Name username, ClientObject clobj) {
try {
clop.apply(clobj);
} catch (Exception e) {
... | [
"public",
"void",
"applyToClient",
"(",
"Name",
"username",
",",
"final",
"ClientOp",
"clop",
")",
"{",
"resolveClientObject",
"(",
"username",
",",
"new",
"ClientResolutionListener",
"(",
")",
"{",
"public",
"void",
"clientResolved",
"(",
"Name",
"username",
",... | Resolves the specified client, applies the supplied client operation to them and releases
the client. | [
"Resolves",
"the",
"specified",
"client",
"applies",
"the",
"supplied",
"client",
"operation",
"to",
"them",
"and",
"releases",
"the",
"client",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ClientManager.java#L262-L281 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/Assert.java | Assert.isFalse | public static void isFalse(Boolean condition, Supplier<String> message) {
"""
Asserts that the condition is {@literal false}.
The assertion holds if and only if the value is equal to {@literal false}.
@param condition {@link Boolean} value being evaluated.
@param message {@link Supplier} containing the mess... | java | public static void isFalse(Boolean condition, Supplier<String> message) {
if (isNotFalse(condition)) {
throw new IllegalArgumentException(message.get());
}
} | [
"public",
"static",
"void",
"isFalse",
"(",
"Boolean",
"condition",
",",
"Supplier",
"<",
"String",
">",
"message",
")",
"{",
"if",
"(",
"isNotFalse",
"(",
"condition",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"message",
".",
"get",
... | Asserts that the condition is {@literal false}.
The assertion holds if and only if the value is equal to {@literal false}.
@param condition {@link Boolean} value being evaluated.
@param message {@link Supplier} containing the message used in the {@link IllegalArgumentException} thrown
if the assertion fails.
@throws ... | [
"Asserts",
"that",
"the",
"condition",
"is",
"{",
"@literal",
"false",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L649-L653 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java | QueryExecutorImpl.startCopy | public synchronized CopyOperation startCopy(String sql, boolean suppressBegin)
throws SQLException {
"""
Sends given query to BE to start, initialize and lock connection for a CopyOperation.
@param sql COPY FROM STDIN / COPY TO STDOUT statement
@return CopyIn or CopyOut operation object
@throws SQLExcep... | java | public synchronized CopyOperation startCopy(String sql, boolean suppressBegin)
throws SQLException {
waitOnLock();
if (!suppressBegin) {
doSubprotocolBegin();
}
byte[] buf = Utils.encodeUTF8(sql);
try {
LOGGER.log(Level.FINEST, " FE=> Query(CopyStart)");
pgStream.sendChar('... | [
"public",
"synchronized",
"CopyOperation",
"startCopy",
"(",
"String",
"sql",
",",
"boolean",
"suppressBegin",
")",
"throws",
"SQLException",
"{",
"waitOnLock",
"(",
")",
";",
"if",
"(",
"!",
"suppressBegin",
")",
"{",
"doSubprotocolBegin",
"(",
")",
";",
"}",... | Sends given query to BE to start, initialize and lock connection for a CopyOperation.
@param sql COPY FROM STDIN / COPY TO STDOUT statement
@return CopyIn or CopyOut operation object
@throws SQLException on failure | [
"Sends",
"given",
"query",
"to",
"BE",
"to",
"start",
"initialize",
"and",
"lock",
"connection",
"for",
"a",
"CopyOperation",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java#L853-L876 |
abel533/ECharts | src/main/java/com/github/abel533/echarts/Polar.java | Polar.radius | public Polar radius(Object width, Object height) {
"""
半径,支持绝对值(px)和百分比,百分比计算比,min(width, height) / 2 * 75%,
传数组实现环形图,[内半径,外半径]
@param width
@param height
@return
"""
radius = new Object[]{width, height};
return this;
} | java | public Polar radius(Object width, Object height) {
radius = new Object[]{width, height};
return this;
} | [
"public",
"Polar",
"radius",
"(",
"Object",
"width",
",",
"Object",
"height",
")",
"{",
"radius",
"=",
"new",
"Object",
"[",
"]",
"{",
"width",
",",
"height",
"}",
";",
"return",
"this",
";",
"}"
] | 半径,支持绝对值(px)和百分比,百分比计算比,min(width, height) / 2 * 75%,
传数组实现环形图,[内半径,外半径]
@param width
@param height
@return | [
"半径,支持绝对值(px)和百分比,百分比计算比,min",
"(",
"width",
"height",
")",
"/",
"2",
"*",
"75%,",
"传数组实现环形图,",
"[",
"内半径,外半径",
"]"
] | train | https://github.com/abel533/ECharts/blob/73e031e51b75e67480701404ccf16e76fd5aa278/src/main/java/com/github/abel533/echarts/Polar.java#L305-L308 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.parseTokenNonExtract | protected int parseTokenNonExtract(WsByteBuffer buff, byte bDelimiter, boolean bApproveCRLF) throws MalformedMessageException {
"""
Standard parsing of a token; however, instead of saving the data into
the global parsedToken variable, this merely returns the length of the
token. Used for occasions where we just ... | java | protected int parseTokenNonExtract(WsByteBuffer buff, byte bDelimiter, boolean bApproveCRLF) throws MalformedMessageException {
TokenCodes rc = findTokenLength(buff, bDelimiter, bApproveCRLF);
return (TokenCodes.TOKEN_RC_MOREDATA.equals(rc)) ? -1 : this.parsedTokenLength;
} | [
"protected",
"int",
"parseTokenNonExtract",
"(",
"WsByteBuffer",
"buff",
",",
"byte",
"bDelimiter",
",",
"boolean",
"bApproveCRLF",
")",
"throws",
"MalformedMessageException",
"{",
"TokenCodes",
"rc",
"=",
"findTokenLength",
"(",
"buff",
",",
"bDelimiter",
",",
"bAp... | Standard parsing of a token; however, instead of saving the data into
the global parsedToken variable, this merely returns the length of the
token. Used for occasions where we just need to find the length of
the token.
@param buff
@param bDelimiter
@param bApproveCRLF
@return int (-1 means we need more data)
@throws M... | [
"Standard",
"parsing",
"of",
"a",
"token",
";",
"however",
"instead",
"of",
"saving",
"the",
"data",
"into",
"the",
"global",
"parsedToken",
"variable",
"this",
"merely",
"returns",
"the",
"length",
"of",
"the",
"token",
".",
"Used",
"for",
"occasions",
"whe... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L3917-L3921 |
liferay/com-liferay-commerce | commerce-payment-service/src/main/java/com/liferay/commerce/payment/service/persistence/impl/CommercePaymentMethodGroupRelPersistenceImpl.java | CommercePaymentMethodGroupRelPersistenceImpl.findAll | @Override
public List<CommercePaymentMethodGroupRel> findAll(int start, int end) {
"""
Returns a range of all the commerce payment method group rels.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they ... | java | @Override
public List<CommercePaymentMethodGroupRel> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommercePaymentMethodGroupRel",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce payment method group rels.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setti... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"payment",
"method",
"group",
"rels",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-payment-service/src/main/java/com/liferay/commerce/payment/service/persistence/impl/CommercePaymentMethodGroupRelPersistenceImpl.java#L2057-L2060 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java | QrCodeDecoderBits.decodeAlphanumeric | private int decodeAlphanumeric( QrCode qr , PackedBits8 data, int bitLocation ) {
"""
Decodes alphanumeric messages
@param qr QR code
@param data encoded data
@return Location it has read up to in bits
"""
int lengthBits = QrCodeEncoder.getLengthBitsAlphanumeric(qr.version);
int length = data.read(bi... | java | private int decodeAlphanumeric( QrCode qr , PackedBits8 data, int bitLocation ) {
int lengthBits = QrCodeEncoder.getLengthBitsAlphanumeric(qr.version);
int length = data.read(bitLocation,lengthBits,true);
bitLocation += lengthBits;
while( length >= 2 ) {
if( data.size < bitLocation+11 ) {
qr.failureCau... | [
"private",
"int",
"decodeAlphanumeric",
"(",
"QrCode",
"qr",
",",
"PackedBits8",
"data",
",",
"int",
"bitLocation",
")",
"{",
"int",
"lengthBits",
"=",
"QrCodeEncoder",
".",
"getLengthBitsAlphanumeric",
"(",
"qr",
".",
"version",
")",
";",
"int",
"length",
"="... | Decodes alphanumeric messages
@param qr QR code
@param data encoded data
@return Location it has read up to in bits | [
"Decodes",
"alphanumeric",
"messages"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java#L296-L328 |
biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/LocIterator.java | LocIterator.hasNext | public boolean hasNext( int windowSize, int increment ) {
"""
Check if next window of specified size is available.
@param windowSize Size of window. May be smaller or larger than default window size.
@param increment The increment by which to move the window at each iteration. Note that this
method does not a... | java | public boolean hasNext( int windowSize, int increment )
{
if( windowSize <= 0 )
{
throw new IllegalArgumentException( "Window size must be positive." );
}
try
{
if( increment > 0 )
{
return windowSize == mBounds.suffix( mPosition ).prefix( windowSize ).length();
}
else
{
if( mPosit... | [
"public",
"boolean",
"hasNext",
"(",
"int",
"windowSize",
",",
"int",
"increment",
")",
"{",
"if",
"(",
"windowSize",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Window size must be positive.\"",
")",
";",
"}",
"try",
"{",
"if",
... | Check if next window of specified size is available.
@param windowSize Size of window. May be smaller or larger than default window size.
@param increment The increment by which to move the window at each iteration. Note that this
method does not actually change the position. However, it checks the sign of the increme... | [
"Check",
"if",
"next",
"window",
"of",
"specified",
"size",
"is",
"available",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/LocIterator.java#L91-L120 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/util/walk/TypesWalker.java | TypesWalker.isLowerBoundCompatible | private static boolean isLowerBoundCompatible(final WildcardType type, final Class... with) {
"""
Check that wildcard's lower bound type is not less then any of provided types.
@param type wildcard with possible lower bound
@param with types to compare with lower bound
@return true if compatible or no lower b... | java | private static boolean isLowerBoundCompatible(final WildcardType type, final Class... with) {
boolean res = true;
if (type.getLowerBounds().length > 0) {
// only one super could be used
// couldn't be an object here as ? super Object is always replaced to simply Object before com... | [
"private",
"static",
"boolean",
"isLowerBoundCompatible",
"(",
"final",
"WildcardType",
"type",
",",
"final",
"Class",
"...",
"with",
")",
"{",
"boolean",
"res",
"=",
"true",
";",
"if",
"(",
"type",
".",
"getLowerBounds",
"(",
")",
".",
"length",
">",
"0",... | Check that wildcard's lower bound type is not less then any of provided types.
@param type wildcard with possible lower bound
@param with types to compare with lower bound
@return true if compatible or no lower bound set, false otherwise | [
"Check",
"that",
"wildcard",
"s",
"lower",
"bound",
"type",
"is",
"not",
"less",
"then",
"any",
"of",
"provided",
"types",
"."
] | train | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/walk/TypesWalker.java#L241-L257 |
cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/ParameterMetaData.java | ParameterMetaData.Real | public static ParameterDef Real(final float f) {
"""
Float constructor (as REAL).
@param f the float value for the parameter
@return Parameter definition for given float value
"""
final BigDecimal bd = new BigDecimal(Float.toString(f));
return Scaled(Types.REAL, bd.scale());
} | java | public static ParameterDef Real(final float f) {
final BigDecimal bd = new BigDecimal(Float.toString(f));
return Scaled(Types.REAL, bd.scale());
} | [
"public",
"static",
"ParameterDef",
"Real",
"(",
"final",
"float",
"f",
")",
"{",
"final",
"BigDecimal",
"bd",
"=",
"new",
"BigDecimal",
"(",
"Float",
".",
"toString",
"(",
"f",
")",
")",
";",
"return",
"Scaled",
"(",
"Types",
".",
"REAL",
",",
"bd",
... | Float constructor (as REAL).
@param f the float value for the parameter
@return Parameter definition for given float value | [
"Float",
"constructor",
"(",
"as",
"REAL",
")",
"."
] | train | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/ParameterMetaData.java#L278-L282 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_statistics_GET | public OvhUnitAndValues<OvhTimestampAndValue> serviceName_statistics_GET(String serviceName, OvhStatisticsPeriodEnum period, OvhAccessStatisticsTypeEnum type) throws IOException {
"""
Get various statistics about this access
REST: GET /xdsl/{serviceName}/statistics
@param period [required]
@param type [requir... | java | public OvhUnitAndValues<OvhTimestampAndValue> serviceName_statistics_GET(String serviceName, OvhStatisticsPeriodEnum period, OvhAccessStatisticsTypeEnum type) throws IOException {
String qPath = "/xdsl/{serviceName}/statistics";
StringBuilder sb = path(qPath, serviceName);
query(sb, "period", period);
query(sb,... | [
"public",
"OvhUnitAndValues",
"<",
"OvhTimestampAndValue",
">",
"serviceName_statistics_GET",
"(",
"String",
"serviceName",
",",
"OvhStatisticsPeriodEnum",
"period",
",",
"OvhAccessStatisticsTypeEnum",
"type",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"... | Get various statistics about this access
REST: GET /xdsl/{serviceName}/statistics
@param period [required]
@param type [required]
@param serviceName [required] The internal name of your XDSL offer | [
"Get",
"various",
"statistics",
"about",
"this",
"access"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L593-L600 |
brettwooldridge/SansOrm | src/main/java/com/zaxxer/sansorm/OrmElf.java | OrmElf.resultSetToObject | public static <T> T resultSetToObject(ResultSet resultSet, T target, Set<String> ignoredColumns) throws SQLException {
"""
Get an object from the specified ResultSet. ResultSet.next() is <i>NOT</i> called,
this should be done by the caller. <b>The ResultSet is not closed as a result of this
method.</b>
@par... | java | public static <T> T resultSetToObject(ResultSet resultSet, T target, Set<String> ignoredColumns) throws SQLException
{
return OrmReader.resultSetToObject(resultSet, target, ignoredColumns);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"resultSetToObject",
"(",
"ResultSet",
"resultSet",
",",
"T",
"target",
",",
"Set",
"<",
"String",
">",
"ignoredColumns",
")",
"throws",
"SQLException",
"{",
"return",
"OrmReader",
".",
"resultSetToObject",
"(",
"resultS... | Get an object from the specified ResultSet. ResultSet.next() is <i>NOT</i> called,
this should be done by the caller. <b>The ResultSet is not closed as a result of this
method.</b>
@param resultSet a {@link ResultSet}
@param target the target object to set values on
@param ignoredColumns the columns in the result se... | [
"Get",
"an",
"object",
"from",
"the",
"specified",
"ResultSet",
".",
"ResultSet",
".",
"next",
"()",
"is",
"<i",
">",
"NOT<",
"/",
"i",
">",
"called",
"this",
"should",
"be",
"done",
"by",
"the",
"caller",
".",
"<b",
">",
"The",
"ResultSet",
"is",
"n... | train | https://github.com/brettwooldridge/SansOrm/blob/ab22721db79c5f20c0e8483f09eda2844d596557/src/main/java/com/zaxxer/sansorm/OrmElf.java#L185-L188 |
alkacon/opencms-core | src-setup/org/opencms/setup/CmsSetupBean.java | CmsSetupBean.setStartView | public void setStartView(String userName, String view) throws CmsException {
"""
Sets the start view for the given user.<p>
@param userName the name of the user
@param view the start view path
@throws CmsException if something goes wrong
"""
try {
CmsUser user = m_cms.readUser(user... | java | public void setStartView(String userName, String view) throws CmsException {
try {
CmsUser user = m_cms.readUser(userName);
user.getAdditionalInfo().put(
CmsUserSettings.PREFERENCES
+ CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS
... | [
"public",
"void",
"setStartView",
"(",
"String",
"userName",
",",
"String",
"view",
")",
"throws",
"CmsException",
"{",
"try",
"{",
"CmsUser",
"user",
"=",
"m_cms",
".",
"readUser",
"(",
"userName",
")",
";",
"user",
".",
"getAdditionalInfo",
"(",
")",
"."... | Sets the start view for the given user.<p>
@param userName the name of the user
@param view the start view path
@throws CmsException if something goes wrong | [
"Sets",
"the",
"start",
"view",
"for",
"the",
"given",
"user",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/CmsSetupBean.java#L2235-L2250 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/selectMultiMenu/SelectMultiMenuRenderer.java | SelectMultiMenuRenderer.renderOption | protected void renderOption(ResponseWriter rw, SelectItem selectItem, String[] selectedOption, int index)
throws IOException {
"""
Renders a single <option> tag. For some reason,
<code>SelectItem</code> and <code>UISelectItem</code> don't share a
common interface, so this method is repeated twice.
@p... | java | protected void renderOption(ResponseWriter rw, SelectItem selectItem, String[] selectedOption, int index)
throws IOException {
String itemLabel = selectItem.getLabel();
final String description = selectItem.getDescription();
final Object itemValue = selectItem.getValue();
renderOption(rw, selectedOption, i... | [
"protected",
"void",
"renderOption",
"(",
"ResponseWriter",
"rw",
",",
"SelectItem",
"selectItem",
",",
"String",
"[",
"]",
"selectedOption",
",",
"int",
"index",
")",
"throws",
"IOException",
"{",
"String",
"itemLabel",
"=",
"selectItem",
".",
"getLabel",
"(",
... | Renders a single <option> tag. For some reason,
<code>SelectItem</code> and <code>UISelectItem</code> don't share a
common interface, so this method is repeated twice.
@param rw
The response writer
@param selectItem
The current SelectItem
@param selectedOption
the currently selected option
@throws IOException
th... | [
"Renders",
"a",
"single",
"<",
";",
"option>",
";",
"tag",
".",
"For",
"some",
"reason",
"<code",
">",
"SelectItem<",
"/",
"code",
">",
"and",
"<code",
">",
"UISelectItem<",
"/",
"code",
">",
"don",
"t",
"share",
"a",
"common",
"interface",
"so",
"... | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/selectMultiMenu/SelectMultiMenuRenderer.java#L590-L598 |
JCTools/JCTools | jctools-core/src/main/java/org/jctools/queues/atomic/BaseSpscLinkedAtomicArrayQueue.java | BaseSpscLinkedAtomicArrayQueue.peek | @SuppressWarnings("unchecked")
@Override
public E peek() {
"""
{@inheritDoc}
<p>
This implementation is correct for single consumer thread use only.
"""
final AtomicReferenceArray<E> buffer = consumerBuffer;
final long index = lpConsumerIndex();
final long mask = consumerMask;... | java | @SuppressWarnings("unchecked")
@Override
public E peek() {
final AtomicReferenceArray<E> buffer = consumerBuffer;
final long index = lpConsumerIndex();
final long mask = consumerMask;
final int offset = calcElementOffset(index, mask);
// LoadLoad
final Object e = ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"E",
"peek",
"(",
")",
"{",
"final",
"AtomicReferenceArray",
"<",
"E",
">",
"buffer",
"=",
"consumerBuffer",
";",
"final",
"long",
"index",
"=",
"lpConsumerIndex",
"(",
")",
";",
... | {@inheritDoc}
<p>
This implementation is correct for single consumer thread use only. | [
"{"
] | train | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-core/src/main/java/org/jctools/queues/atomic/BaseSpscLinkedAtomicArrayQueue.java#L316-L329 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/query/KunderaQuery.java | KunderaQuery.addUpdateClause | public void addUpdateClause(final String property, final String value) {
"""
Adds the update clause.
@param property
the property
@param value
the value
"""
UpdateClause updateClause = new UpdateClause(property.trim(), value.trim());
updateClauseQueue.add(updateClause);
addTypedPa... | java | public void addUpdateClause(final String property, final String value) {
UpdateClause updateClause = new UpdateClause(property.trim(), value.trim());
updateClauseQueue.add(updateClause);
addTypedParameter(
value.trim().startsWith("?") ? Type.INDEXED : value.trim().startsWith(":") ? T... | [
"public",
"void",
"addUpdateClause",
"(",
"final",
"String",
"property",
",",
"final",
"String",
"value",
")",
"{",
"UpdateClause",
"updateClause",
"=",
"new",
"UpdateClause",
"(",
"property",
".",
"trim",
"(",
")",
",",
"value",
".",
"trim",
"(",
")",
")"... | Adds the update clause.
@param property
the property
@param value
the value | [
"Adds",
"the",
"update",
"clause",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/query/KunderaQuery.java#L1304-L1310 |
apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticInvocationWriter.java | StaticInvocationWriter.tryBridgeMethod | @Deprecated
protected boolean tryBridgeMethod(MethodNode target, Expression receiver, boolean implicitThis, TupleExpression args) {
"""
Attempts to make a direct method call on a bridge method, if it exists.
"""
return tryBridgeMethod(target, receiver, implicitThis, args, null);
} | java | @Deprecated
protected boolean tryBridgeMethod(MethodNode target, Expression receiver, boolean implicitThis, TupleExpression args) {
return tryBridgeMethod(target, receiver, implicitThis, args, null);
} | [
"@",
"Deprecated",
"protected",
"boolean",
"tryBridgeMethod",
"(",
"MethodNode",
"target",
",",
"Expression",
"receiver",
",",
"boolean",
"implicitThis",
",",
"TupleExpression",
"args",
")",
"{",
"return",
"tryBridgeMethod",
"(",
"target",
",",
"receiver",
",",
"i... | Attempts to make a direct method call on a bridge method, if it exists. | [
"Attempts",
"to",
"make",
"a",
"direct",
"method",
"call",
"on",
"a",
"bridge",
"method",
"if",
"it",
"exists",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticInvocationWriter.java#L218-L221 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraphGenerator.java | StreamGraphGenerator.determineSlotSharingGroup | private String determineSlotSharingGroup(String specifiedGroup, Collection<Integer> inputIds) {
"""
Determines the slot sharing group for an operation based on the slot sharing group set by
the user and the slot sharing groups of the inputs.
<p>If the user specifies a group name, this is taken as is. If nothin... | java | private String determineSlotSharingGroup(String specifiedGroup, Collection<Integer> inputIds) {
if (specifiedGroup != null) {
return specifiedGroup;
} else {
String inputGroup = null;
for (int id: inputIds) {
String inputGroupCandidate = streamGraph.getSlotSharingGroup(id);
if (inputGroup == null) ... | [
"private",
"String",
"determineSlotSharingGroup",
"(",
"String",
"specifiedGroup",
",",
"Collection",
"<",
"Integer",
">",
"inputIds",
")",
"{",
"if",
"(",
"specifiedGroup",
"!=",
"null",
")",
"{",
"return",
"specifiedGroup",
";",
"}",
"else",
"{",
"String",
"... | Determines the slot sharing group for an operation based on the slot sharing group set by
the user and the slot sharing groups of the inputs.
<p>If the user specifies a group name, this is taken as is. If nothing is specified and
the input operations all have the same group name then this name is taken. Otherwise the
... | [
"Determines",
"the",
"slot",
"sharing",
"group",
"for",
"an",
"operation",
"based",
"on",
"the",
"slot",
"sharing",
"group",
"set",
"by",
"the",
"user",
"and",
"the",
"slot",
"sharing",
"groups",
"of",
"the",
"inputs",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraphGenerator.java#L639-L654 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java | ClassDescriptorConstraints.checkRowReader | private void checkRowReader(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException {
"""
Checks the given class descriptor for correct row-reader setting.
@param classDef The class descriptor
@param checkLevel The current check level (this constraint is only checked in strict)
@exception... | java | private void checkRowReader(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
{
if (!CHECKLEVEL_STRICT.equals(checkLevel))
{
return;
}
String rowReaderName = classDef.getProperty(PropertyHelper.OJB_PROPERTY_ROW_READER);
... | [
"private",
"void",
"checkRowReader",
"(",
"ClassDescriptorDef",
"classDef",
",",
"String",
"checkLevel",
")",
"throws",
"ConstraintException",
"{",
"if",
"(",
"!",
"CHECKLEVEL_STRICT",
".",
"equals",
"(",
"checkLevel",
")",
")",
"{",
"return",
";",
"}",
"String"... | Checks the given class descriptor for correct row-reader setting.
@param classDef The class descriptor
@param checkLevel The current check level (this constraint is only checked in strict)
@exception ConstraintException If the constraint has been violated | [
"Checks",
"the",
"given",
"class",
"descriptor",
"for",
"correct",
"row",
"-",
"reader",
"setting",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java#L414-L441 |
PawelAdamski/HttpClientMock | src/main/java/com/github/paweladamski/httpclientmock/HttpClientResponseBuilder.java | HttpClientResponseBuilder.withHeader | public HttpClientResponseBuilder withHeader(String name, String value) {
"""
Sets response header.
@param name header name
@param value header value
@return response builder
"""
Action lastAction = newRule.getLastAction();
HeaderAction headerAction = new HeaderAction(lastAction, name, val... | java | public HttpClientResponseBuilder withHeader(String name, String value) {
Action lastAction = newRule.getLastAction();
HeaderAction headerAction = new HeaderAction(lastAction, name, value);
newRule.overrideLastAction(headerAction);
return this;
} | [
"public",
"HttpClientResponseBuilder",
"withHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"Action",
"lastAction",
"=",
"newRule",
".",
"getLastAction",
"(",
")",
";",
"HeaderAction",
"headerAction",
"=",
"new",
"HeaderAction",
"(",
"lastAction"... | Sets response header.
@param name header name
@param value header value
@return response builder | [
"Sets",
"response",
"header",
"."
] | train | https://github.com/PawelAdamski/HttpClientMock/blob/0205498434bbc0c78c187a51181cac9b266a28fb/src/main/java/com/github/paweladamski/httpclientmock/HttpClientResponseBuilder.java#L26-L31 |
osglworks/java-tool | src/main/java/org/osgl/Lang.java | F3.andThen | public Func3<P1, P2, P3, R> andThen(
final Func3<? super P1, ? super P2, ? super P3, ? extends R>... fs
) {
"""
Returns a composed function that applied, in sequence, this function and
all functions specified one by one. If applying anyone of the functions
throws an exception, it is relay... | java | public Func3<P1, P2, P3, R> andThen(
final Func3<? super P1, ? super P2, ? super P3, ? extends R>... fs
) {
if (0 == fs.length) {
return this;
}
final Func3<P1, P2, P3, R> me = this;
return new F3<P1, P2, P3, R>() {
... | [
"public",
"Func3",
"<",
"P1",
",",
"P2",
",",
"P3",
",",
"R",
">",
"andThen",
"(",
"final",
"Func3",
"<",
"?",
"super",
"P1",
",",
"?",
"super",
"P2",
",",
"?",
"super",
"P3",
",",
"?",
"extends",
"R",
">",
"...",
"fs",
")",
"{",
"if",
"(",
... | Returns a composed function that applied, in sequence, this function and
all functions specified one by one. If applying anyone of the functions
throws an exception, it is relayed to the caller of the composed function.
If an exception is thrown out, the following functions will not be applied.
<p>When apply the compos... | [
"Returns",
"a",
"composed",
"function",
"that",
"applied",
"in",
"sequence",
"this",
"function",
"and",
"all",
"functions",
"specified",
"one",
"by",
"one",
".",
"If",
"applying",
"anyone",
"of",
"the",
"functions",
"throws",
"an",
"exception",
"it",
"is",
"... | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/Lang.java#L1279-L1297 |
apache/flink | flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/SqlClient.java | SqlClient.openCli | private void openCli(SessionContext context, Executor executor) {
"""
Opens the CLI client for executing SQL statements.
@param context session context
@param executor executor
"""
CliClient cli = null;
try {
cli = new CliClient(context, executor);
// interactive CLI mode
if (options.getUpdate... | java | private void openCli(SessionContext context, Executor executor) {
CliClient cli = null;
try {
cli = new CliClient(context, executor);
// interactive CLI mode
if (options.getUpdateStatement() == null) {
cli.open();
}
// execute single update statement
else {
final boolean success = cli.subm... | [
"private",
"void",
"openCli",
"(",
"SessionContext",
"context",
",",
"Executor",
"executor",
")",
"{",
"CliClient",
"cli",
"=",
"null",
";",
"try",
"{",
"cli",
"=",
"new",
"CliClient",
"(",
"context",
",",
"executor",
")",
";",
"// interactive CLI mode",
"if... | Opens the CLI client for executing SQL statements.
@param context session context
@param executor executor | [
"Opens",
"the",
"CLI",
"client",
"for",
"executing",
"SQL",
"statements",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/SqlClient.java#L117-L137 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/JandexUtils.java | JandexUtils.indexClasspath | public static void indexClasspath(final URLClassLoader classLoader, final Indexer indexer, final List<File> knownFiles) {
"""
Indexes all classes in the classpath (*.jar or *.class).
@param classLoader
Class loader to use.
@param indexer
Indexer to use.
@param knownFiles
List of files already analyzed. New... | java | public static void indexClasspath(final URLClassLoader classLoader, final Indexer indexer, final List<File> knownFiles) {
// Variant that works with Maven "exec:java"
final List<File> classPathFiles = Utils4J.localFilesFromUrlClassLoader(classLoader);
for (final File file : classPathFiles) {
... | [
"public",
"static",
"void",
"indexClasspath",
"(",
"final",
"URLClassLoader",
"classLoader",
",",
"final",
"Indexer",
"indexer",
",",
"final",
"List",
"<",
"File",
">",
"knownFiles",
")",
"{",
"// Variant that works with Maven \"exec:java\"",
"final",
"List",
"<",
"... | Indexes all classes in the classpath (*.jar or *.class).
@param classLoader
Class loader to use.
@param indexer
Indexer to use.
@param knownFiles
List of files already analyzed. New files will be added within this method. | [
"Indexes",
"all",
"classes",
"in",
"the",
"classpath",
"(",
"*",
".",
"jar",
"or",
"*",
".",
"class",
")",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/JandexUtils.java#L137-L157 |
EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/model/IfdTags.java | IfdTags.addTag | public void addTag(String tagName, int[] tagValue) {
"""
Adds the tag.
@param tagName the tag name
@param tagValue the tag value
"""
int id = TiffTags.getTagId(tagName);
TagValue tag = new TagValue(id, 3);
for (int i = 0; i < tagValue.length; i++) {
com.easyinnova.tiff.model.types.Short v... | java | public void addTag(String tagName, int[] tagValue) {
int id = TiffTags.getTagId(tagName);
TagValue tag = new TagValue(id, 3);
for (int i = 0; i < tagValue.length; i++) {
com.easyinnova.tiff.model.types.Short val = new com.easyinnova.tiff.model.types.Short(tagValue[i]);
tag.add(val);
}
ad... | [
"public",
"void",
"addTag",
"(",
"String",
"tagName",
",",
"int",
"[",
"]",
"tagValue",
")",
"{",
"int",
"id",
"=",
"TiffTags",
".",
"getTagId",
"(",
"tagName",
")",
";",
"TagValue",
"tag",
"=",
"new",
"TagValue",
"(",
"id",
",",
"3",
")",
";",
"fo... | Adds the tag.
@param tagName the tag name
@param tagValue the tag value | [
"Adds",
"the",
"tag",
"."
] | train | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/model/IfdTags.java#L92-L100 |
PureSolTechnologies/commons | types/src/main/java/com/puresoltechnologies/commons/types/StringUtils.java | StringUtils.wrapLinesByWords | public static String wrapLinesByWords(String text, int maxLen) {
"""
This methods auto breaks a long line of text into several lines by adding
line breaks.
@param text
is the {@link String} to be broken down into several line.
@param maxLen
is the maximum number of characters per line.
@return Returned is ... | java | public static String wrapLinesByWords(String text, int maxLen) {
StringBuffer buffer = new StringBuffer();
int lineLength = 0;
for (String token : text.split(" ")) {
if (lineLength + token.length() + 1 > maxLen) {
buffer.append("\n");
lineLength = 0;
} else if (lineLength > 0) {
buffer.append(" ");
... | [
"public",
"static",
"String",
"wrapLinesByWords",
"(",
"String",
"text",
",",
"int",
"maxLen",
")",
"{",
"StringBuffer",
"buffer",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"int",
"lineLength",
"=",
"0",
";",
"for",
"(",
"String",
"token",
":",
"text",
... | This methods auto breaks a long line of text into several lines by adding
line breaks.
@param text
is the {@link String} to be broken down into several line.
@param maxLen
is the maximum number of characters per line.
@return Returned is the original text with additional line breaks. | [
"This",
"methods",
"auto",
"breaks",
"a",
"long",
"line",
"of",
"text",
"into",
"several",
"lines",
"by",
"adding",
"line",
"breaks",
"."
] | train | https://github.com/PureSolTechnologies/commons/blob/f98c23d8841a1ff61632ff17fe7d24f99dbc1d44/types/src/main/java/com/puresoltechnologies/commons/types/StringUtils.java#L21-L37 |
i-net-software/jlessc | src/com/inet/lib/less/ColorUtils.java | ColorUtils.hsva | static double hsva( double hue, double saturation, double value, double alpha ) {
"""
Create a color value.
@param hue
hue value
@param saturation
saturation
@param value
the value
@param alpha
alpha
@return a color value as long
"""
hue = ((hue % 360) / 360) * 360;
int i = (int)Mat... | java | static double hsva( double hue, double saturation, double value, double alpha ) {
hue = ((hue % 360) / 360) * 360;
int i = (int)Math.floor( (hue / 60) % 6 );
double f = (hue / 60) - i;
double[] vs = { value, value * (1 - saturation), value * (1 - f * saturation), value * (1 - (1 - f) *... | [
"static",
"double",
"hsva",
"(",
"double",
"hue",
",",
"double",
"saturation",
",",
"double",
"value",
",",
"double",
"alpha",
")",
"{",
"hue",
"=",
"(",
"(",
"hue",
"%",
"360",
")",
"/",
"360",
")",
"*",
"360",
";",
"int",
"i",
"=",
"(",
"int",
... | Create a color value.
@param hue
hue value
@param saturation
saturation
@param value
the value
@param alpha
alpha
@return a color value as long | [
"Create",
"a",
"color",
"value",
"."
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/ColorUtils.java#L366-L375 |
RuedigerMoeller/kontraktor | src/main/java/org/nustaq/kontraktor/Actors.java | Actors.SubmitDelayed | public static void SubmitDelayed( long millis, Runnable task ) {
"""
utility function. Executed in foreign thread. Use Actor::delayed() to have the runnable executed inside actor thread
"""
Actors.delayedCalls.schedule( new TimerTask() {
@Override
public void run() {
... | java | public static void SubmitDelayed( long millis, Runnable task ) {
Actors.delayedCalls.schedule( new TimerTask() {
@Override
public void run() {
task.run();
}
},millis);
} | [
"public",
"static",
"void",
"SubmitDelayed",
"(",
"long",
"millis",
",",
"Runnable",
"task",
")",
"{",
"Actors",
".",
"delayedCalls",
".",
"schedule",
"(",
"new",
"TimerTask",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"task"... | utility function. Executed in foreign thread. Use Actor::delayed() to have the runnable executed inside actor thread | [
"utility",
"function",
".",
"Executed",
"in",
"foreign",
"thread",
".",
"Use",
"Actor",
"::",
"delayed",
"()",
"to",
"have",
"the",
"runnable",
"executed",
"inside",
"actor",
"thread"
] | train | https://github.com/RuedigerMoeller/kontraktor/blob/d5f3817f9476f3786187b8ef00400b7a4f25a404/src/main/java/org/nustaq/kontraktor/Actors.java#L136-L143 |
cdk/cdk | app/depict/src/main/java/org/openscience/cdk/depict/DepictionGenerator.java | DepictionGenerator.generateTitle | private Bounds generateTitle(IChemObject chemObj, double scale) {
"""
Generate a bound element that is the title of the provided molecule. If title
is not specified an empty bounds is returned.
@param chemObj molecule or reaction
@return bound element
"""
String title = chemObj.getProperty(CDKCons... | java | private Bounds generateTitle(IChemObject chemObj, double scale) {
String title = chemObj.getProperty(CDKConstants.TITLE);
if (title == null || title.isEmpty())
return new Bounds();
scale = 1 / scale * getParameterValue(RendererModel.TitleFontScale.class);
return new Bounds(Ma... | [
"private",
"Bounds",
"generateTitle",
"(",
"IChemObject",
"chemObj",
",",
"double",
"scale",
")",
"{",
"String",
"title",
"=",
"chemObj",
".",
"getProperty",
"(",
"CDKConstants",
".",
"TITLE",
")",
";",
"if",
"(",
"title",
"==",
"null",
"||",
"title",
".",... | Generate a bound element that is the title of the provided molecule. If title
is not specified an empty bounds is returned.
@param chemObj molecule or reaction
@return bound element | [
"Generate",
"a",
"bound",
"element",
"that",
"is",
"the",
"title",
"of",
"the",
"provided",
"molecule",
".",
"If",
"title",
"is",
"not",
"specified",
"an",
"empty",
"bounds",
"is",
"returned",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/DepictionGenerator.java#L643-L650 |
JOML-CI/JOML | src/org/joml/Intersectionf.java | Intersectionf.intersectRayLineSegment | public static float intersectRayLineSegment(float originX, float originY, float dirX, float dirY, float aX, float aY, float bX, float bY) {
"""
Determine whether the ray with given origin <code>(originX, originY)</code> and direction <code>(dirX, dirY)</code> intersects the undirected line segment
given by the tw... | java | public static float intersectRayLineSegment(float originX, float originY, float dirX, float dirY, float aX, float aY, float bX, float bY) {
float v1X = originX - aX;
float v1Y = originY - aY;
float v2X = bX - aX;
float v2Y = bY - aY;
float invV23 = 1.0f / (v2Y * dirX - v2X * dirY... | [
"public",
"static",
"float",
"intersectRayLineSegment",
"(",
"float",
"originX",
",",
"float",
"originY",
",",
"float",
"dirX",
",",
"float",
"dirY",
",",
"float",
"aX",
",",
"float",
"aY",
",",
"float",
"bX",
",",
"float",
"bY",
")",
"{",
"float",
"v1X"... | Determine whether the ray with given origin <code>(originX, originY)</code> and direction <code>(dirX, dirY)</code> intersects the undirected line segment
given by the two end points <code>(aX, bY)</code> and <code>(bX, bY)</code>, and return the value of the parameter <i>t</i> in the ray equation
<i>p(t) = origin + t ... | [
"Determine",
"whether",
"the",
"ray",
"with",
"given",
"origin",
"<code",
">",
"(",
"originX",
"originY",
")",
"<",
"/",
"code",
">",
"and",
"direction",
"<code",
">",
"(",
"dirX",
"dirY",
")",
"<",
"/",
"code",
">",
"intersects",
"the",
"undirected",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L3982-L3993 |
apache/flink | flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBSerializedCompositeKeyBuilder.java | RocksDBSerializedCompositeKeyBuilder.setKeyAndKeyGroup | public void setKeyAndKeyGroup(@Nonnull K key, @Nonnegative int keyGroupId) {
"""
Sets the key and key-group as prefix. This will serialize them into the buffer and the will be used to create
composite keys with provided namespaces.
@param key the key.
@param keyGroupId the key-group id for the key.
... | java | public void setKeyAndKeyGroup(@Nonnull K key, @Nonnegative int keyGroupId) {
try {
serializeKeyGroupAndKey(key, keyGroupId);
} catch (IOException shouldNeverHappen) {
throw new FlinkRuntimeException(shouldNeverHappen);
}
} | [
"public",
"void",
"setKeyAndKeyGroup",
"(",
"@",
"Nonnull",
"K",
"key",
",",
"@",
"Nonnegative",
"int",
"keyGroupId",
")",
"{",
"try",
"{",
"serializeKeyGroupAndKey",
"(",
"key",
",",
"keyGroupId",
")",
";",
"}",
"catch",
"(",
"IOException",
"shouldNeverHappen... | Sets the key and key-group as prefix. This will serialize them into the buffer and the will be used to create
composite keys with provided namespaces.
@param key the key.
@param keyGroupId the key-group id for the key. | [
"Sets",
"the",
"key",
"and",
"key",
"-",
"group",
"as",
"prefix",
".",
"This",
"will",
"serialize",
"them",
"into",
"the",
"buffer",
"and",
"the",
"will",
"be",
"used",
"to",
"create",
"composite",
"keys",
"with",
"provided",
"namespaces",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBSerializedCompositeKeyBuilder.java#L94-L100 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.findLastIndexOf | public static int findLastIndexOf(Object self, int startIndex, Closure closure) {
"""
Iterates over the elements of an iterable collection of items, starting
from a specified startIndex, and returns the index of the last item that
matches the condition specified in the closure.
@param self the iteration... | java | public static int findLastIndexOf(Object self, int startIndex, Closure closure) {
int result = -1;
int i = 0;
BooleanClosureWrapper bcw = new BooleanClosureWrapper(closure);
for (Iterator iter = InvokerHelper.asIterator(self); iter.hasNext(); i++) {
Object value = iter.next()... | [
"public",
"static",
"int",
"findLastIndexOf",
"(",
"Object",
"self",
",",
"int",
"startIndex",
",",
"Closure",
"closure",
")",
"{",
"int",
"result",
"=",
"-",
"1",
";",
"int",
"i",
"=",
"0",
";",
"BooleanClosureWrapper",
"bcw",
"=",
"new",
"BooleanClosureW... | Iterates over the elements of an iterable collection of items, starting
from a specified startIndex, and returns the index of the last item that
matches the condition specified in the closure.
@param self the iteration object over which to iterate
@param startIndex start matching from this index
@param closure ... | [
"Iterates",
"over",
"the",
"elements",
"of",
"an",
"iterable",
"collection",
"of",
"items",
"starting",
"from",
"a",
"specified",
"startIndex",
"and",
"returns",
"the",
"index",
"of",
"the",
"last",
"item",
"that",
"matches",
"the",
"condition",
"specified",
"... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L15414-L15428 |
google/error-prone | check_api/src/main/java/com/google/errorprone/JavacErrorDescriptionListener.java | JavacErrorDescriptionListener.shouldSkipImportTreeFix | private static boolean shouldSkipImportTreeFix(DiagnosticPosition position, Fix f) {
"""
be fixed if they were specified via SuggestedFix.replace, for example.
"""
if (position.getTree() != null && position.getTree().getKind() != Kind.IMPORT) {
return false;
}
return !f.getImportsToAdd().isE... | java | private static boolean shouldSkipImportTreeFix(DiagnosticPosition position, Fix f) {
if (position.getTree() != null && position.getTree().getKind() != Kind.IMPORT) {
return false;
}
return !f.getImportsToAdd().isEmpty() || !f.getImportsToRemove().isEmpty();
} | [
"private",
"static",
"boolean",
"shouldSkipImportTreeFix",
"(",
"DiagnosticPosition",
"position",
",",
"Fix",
"f",
")",
"{",
"if",
"(",
"position",
".",
"getTree",
"(",
")",
"!=",
"null",
"&&",
"position",
".",
"getTree",
"(",
")",
".",
"getKind",
"(",
")"... | be fixed if they were specified via SuggestedFix.replace, for example. | [
"be",
"fixed",
"if",
"they",
"were",
"specified",
"via",
"SuggestedFix",
".",
"replace",
"for",
"example",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/JavacErrorDescriptionListener.java#L119-L125 |
esigate/esigate | esigate-core/src/main/java/org/esigate/http/HttpResponseUtils.java | HttpResponseUtils.writeTo | public static void writeTo(final HttpEntity httpEntity, final OutputStream outstream) throws IOException {
"""
Copied from org.apache.http.entity.InputStreamEntity.writeTo(OutputStream) method but flushes the buffer after
each read in order to allow streaming and web sockets.
@param httpEntity
The entity to c... | java | public static void writeTo(final HttpEntity httpEntity, final OutputStream outstream) throws IOException {
Args.notNull(outstream, "Output stream");
try (InputStream instream = httpEntity.getContent()) {
final byte[] buffer = new byte[OUTPUT_BUFFER_SIZE];
int l;
if (h... | [
"public",
"static",
"void",
"writeTo",
"(",
"final",
"HttpEntity",
"httpEntity",
",",
"final",
"OutputStream",
"outstream",
")",
"throws",
"IOException",
"{",
"Args",
".",
"notNull",
"(",
"outstream",
",",
"\"Output stream\"",
")",
";",
"try",
"(",
"InputStream"... | Copied from org.apache.http.entity.InputStreamEntity.writeTo(OutputStream) method but flushes the buffer after
each read in order to allow streaming and web sockets.
@param httpEntity
The entity to copy to the OutputStream
@param outstream
The OutputStream
@throws IOException
If a problem occurs | [
"Copied",
"from",
"org",
".",
"apache",
".",
"http",
".",
"entity",
".",
"InputStreamEntity",
".",
"writeTo",
"(",
"OutputStream",
")",
"method",
"but",
"flushes",
"the",
"buffer",
"after",
"each",
"read",
"in",
"order",
"to",
"allow",
"streaming",
"and",
... | train | https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/http/HttpResponseUtils.java#L237-L264 |
Comcast/jrugged | jrugged-core/src/main/java/org/fishwife/jrugged/interval/DiscreteInterval.java | DiscreteInterval.plus | public DiscreteInterval plus(DiscreteInterval other) {
"""
Returns an interval representing the addition of the
given interval with this one.
@param other interval to add to this one
@return interval sum
"""
return new DiscreteInterval(this.min + other.min, this.max + other.max);
} | java | public DiscreteInterval plus(DiscreteInterval other) {
return new DiscreteInterval(this.min + other.min, this.max + other.max);
} | [
"public",
"DiscreteInterval",
"plus",
"(",
"DiscreteInterval",
"other",
")",
"{",
"return",
"new",
"DiscreteInterval",
"(",
"this",
".",
"min",
"+",
"other",
".",
"min",
",",
"this",
".",
"max",
"+",
"other",
".",
"max",
")",
";",
"}"
] | Returns an interval representing the addition of the
given interval with this one.
@param other interval to add to this one
@return interval sum | [
"Returns",
"an",
"interval",
"representing",
"the",
"addition",
"of",
"the",
"given",
"interval",
"with",
"this",
"one",
"."
] | train | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-core/src/main/java/org/fishwife/jrugged/interval/DiscreteInterval.java#L74-L76 |
haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.containsIgnoreCase | public static boolean containsIgnoreCase(String pString, int pChar) {
"""
Tests if a string contains a specific character, ignoring case.
@param pString The string to check.
@param pChar The character to search for.
@return true if the string contains the specific character.
"""
return ((pSt... | java | public static boolean containsIgnoreCase(String pString, int pChar) {
return ((pString != null)
&& ((pString.indexOf(Character.toLowerCase((char) pChar)) >= 0)
|| (pString.indexOf(Character.toUpperCase((char) pChar)) >= 0)));
// NOTE: I don't convert the string to ... | [
"public",
"static",
"boolean",
"containsIgnoreCase",
"(",
"String",
"pString",
",",
"int",
"pChar",
")",
"{",
"return",
"(",
"(",
"pString",
"!=",
"null",
")",
"&&",
"(",
"(",
"pString",
".",
"indexOf",
"(",
"Character",
".",
"toLowerCase",
"(",
"(",
"ch... | Tests if a string contains a specific character, ignoring case.
@param pString The string to check.
@param pChar The character to search for.
@return true if the string contains the specific character. | [
"Tests",
"if",
"a",
"string",
"contains",
"a",
"specific",
"character",
"ignoring",
"case",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L227-L235 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpClient.java | SftpClient.lcd | public void lcd(String path) throws SftpStatusException {
"""
<p>
Changes the local working directory.
</p>
@param path
the path to the new working directory
@throws SftpStatusException
"""
File actual;
if (!isLocalAbsolutePath(path)) {
actual = new File(lcwd, path);
} else {
actual = new... | java | public void lcd(String path) throws SftpStatusException {
File actual;
if (!isLocalAbsolutePath(path)) {
actual = new File(lcwd, path);
} else {
actual = new File(path);
}
if (!actual.isDirectory()) {
throw new SftpStatusException(SftpStatusException.SSH_FX_FAILURE,
path + " is not a directory... | [
"public",
"void",
"lcd",
"(",
"String",
"path",
")",
"throws",
"SftpStatusException",
"{",
"File",
"actual",
";",
"if",
"(",
"!",
"isLocalAbsolutePath",
"(",
"path",
")",
")",
"{",
"actual",
"=",
"new",
"File",
"(",
"lcwd",
",",
"path",
")",
";",
"}",
... | <p>
Changes the local working directory.
</p>
@param path
the path to the new working directory
@throws SftpStatusException | [
"<p",
">",
"Changes",
"the",
"local",
"working",
"directory",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpClient.java#L747-L767 |
apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/sql/dal/show/ShowParserFactory.java | ShowParserFactory.newInstance | public static AbstractShowParser newInstance(final DatabaseType dbType, final ShardingRule shardingRule, final LexerEngine lexerEngine) {
"""
Create show parser instance.
@param dbType database type
@param shardingRule databases and tables sharding rule
@param lexerEngine lexical analysis engine.
@return sho... | java | public static AbstractShowParser newInstance(final DatabaseType dbType, final ShardingRule shardingRule, final LexerEngine lexerEngine) {
switch (dbType) {
case H2:
case MySQL:
return new MySQLShowParser(shardingRule, lexerEngine);
default:
thr... | [
"public",
"static",
"AbstractShowParser",
"newInstance",
"(",
"final",
"DatabaseType",
"dbType",
",",
"final",
"ShardingRule",
"shardingRule",
",",
"final",
"LexerEngine",
"lexerEngine",
")",
"{",
"switch",
"(",
"dbType",
")",
"{",
"case",
"H2",
":",
"case",
"My... | Create show parser instance.
@param dbType database type
@param shardingRule databases and tables sharding rule
@param lexerEngine lexical analysis engine.
@return show parser instance | [
"Create",
"show",
"parser",
"instance",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/sql/dal/show/ShowParserFactory.java#L43-L51 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/UpdateSketch.java | UpdateSketch.heapify | public static UpdateSketch heapify(final Memory srcMem, final long seed) {
"""
Instantiates an on-heap UpdateSketch from Memory.
@param srcMem <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
@param seed <a href="{@docRoot}/resources/dictionary.html#seed">See Update Hash Seed</a>.
@return an Up... | java | public static UpdateSketch heapify(final Memory srcMem, final long seed) {
final Family family = Family.idToFamily(srcMem.getByte(FAMILY_BYTE));
if (family.equals(Family.ALPHA)) {
return HeapAlphaSketch.heapifyInstance(srcMem, seed);
}
return HeapQuickSelectSketch.heapifyInstance(srcMem, seed);
... | [
"public",
"static",
"UpdateSketch",
"heapify",
"(",
"final",
"Memory",
"srcMem",
",",
"final",
"long",
"seed",
")",
"{",
"final",
"Family",
"family",
"=",
"Family",
".",
"idToFamily",
"(",
"srcMem",
".",
"getByte",
"(",
"FAMILY_BYTE",
")",
")",
";",
"if",
... | Instantiates an on-heap UpdateSketch from Memory.
@param srcMem <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
@param seed <a href="{@docRoot}/resources/dictionary.html#seed">See Update Hash Seed</a>.
@return an UpdateSketch | [
"Instantiates",
"an",
"on",
"-",
"heap",
"UpdateSketch",
"from",
"Memory",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/UpdateSketch.java#L107-L113 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareCrossClustersIntoGrids.java | SquareCrossClustersIntoGrids.isOpenEdge | static boolean isOpenEdge( SquareNode node , int index ) {
"""
Is the edge open and can be traversed to? Can't be null and can't have
the marker set to a none RESET_GRAPH value.
"""
if( node.edges[index] == null )
return false;
int marker = node.edges[index].destination(node).graph;
return marker ==... | java | static boolean isOpenEdge( SquareNode node , int index ) {
if( node.edges[index] == null )
return false;
int marker = node.edges[index].destination(node).graph;
return marker == SquareNode.RESET_GRAPH;
} | [
"static",
"boolean",
"isOpenEdge",
"(",
"SquareNode",
"node",
",",
"int",
"index",
")",
"{",
"if",
"(",
"node",
".",
"edges",
"[",
"index",
"]",
"==",
"null",
")",
"return",
"false",
";",
"int",
"marker",
"=",
"node",
".",
"edges",
"[",
"index",
"]",... | Is the edge open and can be traversed to? Can't be null and can't have
the marker set to a none RESET_GRAPH value. | [
"Is",
"the",
"edge",
"open",
"and",
"can",
"be",
"traversed",
"to?",
"Can",
"t",
"be",
"null",
"and",
"can",
"t",
"have",
"the",
"marker",
"set",
"to",
"a",
"none",
"RESET_GRAPH",
"value",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareCrossClustersIntoGrids.java#L373-L378 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java | INodeDirectory.getExistingPathINodes | int getExistingPathINodes(byte[][] components, INode[] existing) {
"""
Retrieve existing INodes from a path. If existing is big enough to store
all path components (existing and non-existing), then existing INodes
will be stored starting from the root INode into existing[0]; if
existing is not big enough to sto... | java | int getExistingPathINodes(byte[][] components, INode[] existing) {
assert compareTo(components[0]) == 0 :
"Incorrect name " + getLocalName() + " expected " + components[0];
INode curNode = this;
int count = 0;
int index = existing.length - components.length;
if (index > 0)
index = 0;
... | [
"int",
"getExistingPathINodes",
"(",
"byte",
"[",
"]",
"[",
"]",
"components",
",",
"INode",
"[",
"]",
"existing",
")",
"{",
"assert",
"compareTo",
"(",
"components",
"[",
"0",
"]",
")",
"==",
"0",
":",
"\"Incorrect name \"",
"+",
"getLocalName",
"(",
")... | Retrieve existing INodes from a path. If existing is big enough to store
all path components (existing and non-existing), then existing INodes
will be stored starting from the root INode into existing[0]; if
existing is not big enough to store all path components, then only the
last existing and non existing INodes wil... | [
"Retrieve",
"existing",
"INodes",
"from",
"a",
"path",
".",
"If",
"existing",
"is",
"big",
"enough",
"to",
"store",
"all",
"path",
"components",
"(",
"existing",
"and",
"non",
"-",
"existing",
")",
"then",
"existing",
"INodes",
"will",
"be",
"stored",
"sta... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java#L195-L215 |
XiaoMi/chronos | chronos-server/src/main/java/com/xiaomi/infra/chronos/zookeeper/ZooKeeperUtil.java | ZooKeeperUtil.createAcl | public static ArrayList<ACL> createAcl(FailoverWatcher failoverWatcher, String znode) {
"""
Create acl for znodes, anyone could read, but only admin can operate if set scure.
@param failoverWatcher the watcher which has the configuration
@return the acls
"""
if (znode.equals("/chronos")) {
return... | java | public static ArrayList<ACL> createAcl(FailoverWatcher failoverWatcher, String znode) {
if (znode.equals("/chronos")) {
return Ids.OPEN_ACL_UNSAFE;
}
if (failoverWatcher.isZkSecure()) {
ArrayList<ACL> acls = new ArrayList<ACL>();
acls.add(new ACL(ZooDefs.Perms.READ, ZooDefs.Ids.ANYONE... | [
"public",
"static",
"ArrayList",
"<",
"ACL",
">",
"createAcl",
"(",
"FailoverWatcher",
"failoverWatcher",
",",
"String",
"znode",
")",
"{",
"if",
"(",
"znode",
".",
"equals",
"(",
"\"/chronos\"",
")",
")",
"{",
"return",
"Ids",
".",
"OPEN_ACL_UNSAFE",
";",
... | Create acl for znodes, anyone could read, but only admin can operate if set scure.
@param failoverWatcher the watcher which has the configuration
@return the acls | [
"Create",
"acl",
"for",
"znodes",
"anyone",
"could",
"read",
"but",
"only",
"admin",
"can",
"operate",
"if",
"set",
"scure",
"."
] | train | https://github.com/XiaoMi/chronos/blob/92e4a30c98947e87aba47ea88c944a56505a4ec0/chronos-server/src/main/java/com/xiaomi/infra/chronos/zookeeper/ZooKeeperUtil.java#L230-L243 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/util/AbstractLog.java | AbstractLog.note | public void note(DiagnosticPosition pos, String key, Object ... args) {
"""
Provide a non-fatal notification, unless suppressed by the -nowarn option.
@param key The key for the localized notification message.
@param args Fields of the notification message.
"""
note(pos, diags.noteKey(key, args)... | java | public void note(DiagnosticPosition pos, String key, Object ... args) {
note(pos, diags.noteKey(key, args));
} | [
"public",
"void",
"note",
"(",
"DiagnosticPosition",
"pos",
",",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"note",
"(",
"pos",
",",
"diags",
".",
"noteKey",
"(",
"key",
",",
"args",
")",
")",
";",
"}"
] | Provide a non-fatal notification, unless suppressed by the -nowarn option.
@param key The key for the localized notification message.
@param args Fields of the notification message. | [
"Provide",
"a",
"non",
"-",
"fatal",
"notification",
"unless",
"suppressed",
"by",
"the",
"-",
"nowarn",
"option",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/util/AbstractLog.java#L340-L342 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java | ElementPlugin.tryRegisterListener | public boolean tryRegisterListener(Object object, boolean register) {
"""
Attempts to register or unregister an object as an event listener.
@param object Object to register/unregister.
@param register If true, we are attempting to register. If false, unregister.
@return True if operation was successful. Fals... | java | public boolean tryRegisterListener(Object object, boolean register) {
boolean success = false;
if (object instanceof IPluginEvent) {
if (register) {
registerListener((IPluginEvent) object);
} else {
unregisterListener((IPluginEvent) object);
... | [
"public",
"boolean",
"tryRegisterListener",
"(",
"Object",
"object",
",",
"boolean",
"register",
")",
"{",
"boolean",
"success",
"=",
"false",
";",
"if",
"(",
"object",
"instanceof",
"IPluginEvent",
")",
"{",
"if",
"(",
"register",
")",
"{",
"registerListener"... | Attempts to register or unregister an object as an event listener.
@param object Object to register/unregister.
@param register If true, we are attempting to register. If false, unregister.
@return True if operation was successful. False if the object supports none of the recognized
event listeners. | [
"Attempts",
"to",
"register",
"or",
"unregister",
"an",
"object",
"as",
"an",
"event",
"listener",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L705-L727 |
apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java | State.appendToListProp | public synchronized void appendToListProp(String key, String value) {
"""
Appends the input value to a list property that can be retrieved with {@link #getPropAsList}.
<p>
List properties are internally stored as comma separated strings. Adding a value that contains commas (for
example "a,b,c") will essential... | java | public synchronized void appendToListProp(String key, String value) {
if (contains(key)) {
setProp(key, LIST_JOINER.join(getProp(key), value));
} else {
setProp(key, value);
}
} | [
"public",
"synchronized",
"void",
"appendToListProp",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"contains",
"(",
"key",
")",
")",
"{",
"setProp",
"(",
"key",
",",
"LIST_JOINER",
".",
"join",
"(",
"getProp",
"(",
"key",
")",
","... | Appends the input value to a list property that can be retrieved with {@link #getPropAsList}.
<p>
List properties are internally stored as comma separated strings. Adding a value that contains commas (for
example "a,b,c") will essentially add multiple values to the property ("a", "b", and "c"). This is
similar to the ... | [
"Appends",
"the",
"input",
"value",
"to",
"a",
"list",
"property",
"that",
"can",
"be",
"retrieved",
"with",
"{",
"@link",
"#getPropAsList",
"}",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java#L228-L234 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxAPIRequest.java | BoxAPIRequest.addHeader | public void addHeader(String key, String value) {
"""
Adds an HTTP header to this request.
@param key the header key.
@param value the header value.
"""
if (key.equals("As-User")) {
for (int i = 0; i < this.headers.size(); i++) {
if (this.headers.get(i).getKey().equals("... | java | public void addHeader(String key, String value) {
if (key.equals("As-User")) {
for (int i = 0; i < this.headers.size(); i++) {
if (this.headers.get(i).getKey().equals("As-User")) {
this.headers.remove(i);
}
}
}
if (key.e... | [
"public",
"void",
"addHeader",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"key",
".",
"equals",
"(",
"\"As-User\"",
")",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"headers",
".",
"size",
"(",
... | Adds an HTTP header to this request.
@param key the header key.
@param value the header value. | [
"Adds",
"an",
"HTTP",
"header",
"to",
"this",
"request",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIRequest.java#L178-L190 |
grpc/grpc-java | core/src/main/java/io/grpc/internal/TransportFrameUtil.java | TransportFrameUtil.endsWith | private static boolean endsWith(byte[] subject, byte[] suffix) {
"""
Returns {@code true} if {@code subject} ends with {@code suffix}.
"""
int start = subject.length - suffix.length;
if (start < 0) {
return false;
}
for (int i = start; i < subject.length; i++) {
if (subject[i] != su... | java | private static boolean endsWith(byte[] subject, byte[] suffix) {
int start = subject.length - suffix.length;
if (start < 0) {
return false;
}
for (int i = start; i < subject.length; i++) {
if (subject[i] != suffix[i - start]) {
return false;
}
}
return true;
} | [
"private",
"static",
"boolean",
"endsWith",
"(",
"byte",
"[",
"]",
"subject",
",",
"byte",
"[",
"]",
"suffix",
")",
"{",
"int",
"start",
"=",
"subject",
".",
"length",
"-",
"suffix",
".",
"length",
";",
"if",
"(",
"start",
"<",
"0",
")",
"{",
"retu... | Returns {@code true} if {@code subject} ends with {@code suffix}. | [
"Returns",
"{"
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/core/src/main/java/io/grpc/internal/TransportFrameUtil.java#L153-L164 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java | Extern.readPackageListFromURL | private void readPackageListFromURL(String urlpath, URL pkglisturlpath) throws Fault {
"""
Fetch the URL and read the "package-list" file.
@param urlpath Path to the packages.
@param pkglisturlpath URL or the path to the "package-list" file.
"""
try {
URL link = pkglisturlpath.to... | java | private void readPackageListFromURL(String urlpath, URL pkglisturlpath) throws Fault {
try {
URL link = pkglisturlpath.toURI().resolve(DocPaths.PACKAGE_LIST.getPath()).toURL();
readPackageList(link.openStream(), urlpath, false);
} catch (URISyntaxException | MalformedURLException... | [
"private",
"void",
"readPackageListFromURL",
"(",
"String",
"urlpath",
",",
"URL",
"pkglisturlpath",
")",
"throws",
"Fault",
"{",
"try",
"{",
"URL",
"link",
"=",
"pkglisturlpath",
".",
"toURI",
"(",
")",
".",
"resolve",
"(",
"DocPaths",
".",
"PACKAGE_LIST",
... | Fetch the URL and read the "package-list" file.
@param urlpath Path to the packages.
@param pkglisturlpath URL or the path to the "package-list" file. | [
"Fetch",
"the",
"URL",
"and",
"read",
"the",
"package",
"-",
"list",
"file",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java#L242-L252 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java | TSVDriverFunction.exportTable | @Override
public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException {
"""
Export a table or a query to as TSV file
@param connection Active connection, do not close this connection.
@param tableReference ... | java | @Override
public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException {
String regex = ".*(?i)\\b(select|from)\\b.*";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.match... | [
"@",
"Override",
"public",
"void",
"exportTable",
"(",
"Connection",
"connection",
",",
"String",
"tableReference",
",",
"File",
"fileName",
",",
"ProgressVisitor",
"progress",
",",
"String",
"encoding",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"Str... | Export a table or a query to as TSV file
@param connection Active connection, do not close this connection.
@param tableReference [[catalog.]schema.]table reference
@param fileName File path to read
@param progress
@param encoding
@throws SQLException
@throws IOException | [
"Export",
"a",
"table",
"or",
"a",
"query",
"to",
"as",
"TSV",
"file"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java#L109-L140 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataDecoder.java | DataDecoder.decodeBooleanObj | public static Boolean decodeBooleanObj(byte[] src, int srcOffset)
throws CorruptEncodingException {
"""
Decodes a Boolean object from exactly 1 byte.
@param src source of encoded bytes
@param srcOffset offset into source array
@return Boolean object or null
"""
try {
switch ... | java | public static Boolean decodeBooleanObj(byte[] src, int srcOffset)
throws CorruptEncodingException
{
try {
switch (src[srcOffset]) {
case NULL_BYTE_LOW: case NULL_BYTE_HIGH:
return null;
case (byte)128:
return Boolean.TRUE;
... | [
"public",
"static",
"Boolean",
"decodeBooleanObj",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"srcOffset",
")",
"throws",
"CorruptEncodingException",
"{",
"try",
"{",
"switch",
"(",
"src",
"[",
"srcOffset",
"]",
")",
"{",
"case",
"NULL_BYTE_LOW",
":",
"case",... | Decodes a Boolean object from exactly 1 byte.
@param src source of encoded bytes
@param srcOffset offset into source array
@return Boolean object or null | [
"Decodes",
"a",
"Boolean",
"object",
"from",
"exactly",
"1",
"byte",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataDecoder.java#L269-L284 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/RepositoryReaderImpl.java | RepositoryReaderImpl.getLogLists | public Iterable<ServerInstanceLogRecordList> getLogLists(Date beginTime, Date endTime, final LogRecordHeaderFilter filter) {
"""
returns log records from the binary repository that are within the date range and which satisfy condition of the filter as specified by the parameters.
@param beginTime the minimum {@... | java | public Iterable<ServerInstanceLogRecordList> getLogLists(Date beginTime, Date endTime, final LogRecordHeaderFilter filter) {
final long min = beginTime == null ? -1 : beginTime.getTime();
final long max = endTime == null ? -1 : endTime.getTime();
LogRepositoryBrowser logs;
if (beginTime... | [
"public",
"Iterable",
"<",
"ServerInstanceLogRecordList",
">",
"getLogLists",
"(",
"Date",
"beginTime",
",",
"Date",
"endTime",
",",
"final",
"LogRecordHeaderFilter",
"filter",
")",
"{",
"final",
"long",
"min",
"=",
"beginTime",
"==",
"null",
"?",
"-",
"1",
":... | returns log records from the binary repository that are within the date range and which satisfy condition of the filter as specified by the parameters.
@param beginTime the minimum {@link Date} value that the returned records can have
@param endTime the maximum {@link Date} value that the returned records can have
@pa... | [
"returns",
"log",
"records",
"from",
"the",
"binary",
"repository",
"that",
"are",
"within",
"the",
"date",
"range",
"and",
"which",
"satisfy",
"condition",
"of",
"the",
"filter",
"as",
"specified",
"by",
"the",
"parameters",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/RepositoryReaderImpl.java#L384-L428 |
deeplearning4j/deeplearning4j | datavec/datavec-spark/src/main/java/org/datavec/spark/transform/utils/SparkUtils.java | SparkUtils.writeObjectToFile | public static void writeObjectToFile(String path, Object toWrite, SparkContext sc) throws IOException {
"""
Write an object to HDFS (or local) using default Java object serialization
@param path Path to write the object to
@param toWrite Object to write
@param sc Spark context
"""
... | java | public static void writeObjectToFile(String path, Object toWrite, SparkContext sc) throws IOException {
writeObjectToFile(path, toWrite, sc.hadoopConfiguration());
} | [
"public",
"static",
"void",
"writeObjectToFile",
"(",
"String",
"path",
",",
"Object",
"toWrite",
",",
"SparkContext",
"sc",
")",
"throws",
"IOException",
"{",
"writeObjectToFile",
"(",
"path",
",",
"toWrite",
",",
"sc",
".",
"hadoopConfiguration",
"(",
")",
"... | Write an object to HDFS (or local) using default Java object serialization
@param path Path to write the object to
@param toWrite Object to write
@param sc Spark context | [
"Write",
"an",
"object",
"to",
"HDFS",
"(",
"or",
"local",
")",
"using",
"default",
"Java",
"object",
"serialization"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/utils/SparkUtils.java#L155-L157 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.