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 |
|---|---|---|---|---|---|---|---|---|---|---|
alkacon/opencms-core | src/org/opencms/search/fields/CmsSearchField.java | CmsSearchField.addUninvertingMappings | public static void addUninvertingMappings(Map<String, Type> uninvertingMap) {
"""
To allow sorting on a field the field must be added to the map given to {@link org.apache.solr.uninverting.UninvertingReader#wrap(org.apache.lucene.index.DirectoryReader, Map)}.
The method adds all default fields.
@param uninvertin... | java | public static void addUninvertingMappings(Map<String, Type> uninvertingMap) {
uninvertingMap.put(FIELD_CATEGORY, Type.SORTED);
uninvertingMap.put(FIELD_CONTENT, Type.SORTED);
uninvertingMap.put(FIELD_CONTENT_BLOB, Type.SORTED);
uninvertingMap.put(FIELD_CONTENT_LOCALES, Type.SORTED);
... | [
"public",
"static",
"void",
"addUninvertingMappings",
"(",
"Map",
"<",
"String",
",",
"Type",
">",
"uninvertingMap",
")",
"{",
"uninvertingMap",
".",
"put",
"(",
"FIELD_CATEGORY",
",",
"Type",
".",
"SORTED",
")",
";",
"uninvertingMap",
".",
"put",
"(",
"FIEL... | To allow sorting on a field the field must be added to the map given to {@link org.apache.solr.uninverting.UninvertingReader#wrap(org.apache.lucene.index.DirectoryReader, Map)}.
The method adds all default fields.
@param uninvertingMap the map to which the fields are added. | [
"To",
"allow",
"sorting",
"on",
"a",
"field",
"the",
"field",
"must",
"be",
"added",
"to",
"the",
"map",
"given",
"to",
"{"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/fields/CmsSearchField.java#L311-L356 |
structr/structr | structr-core/src/main/java/org/structr/core/entity/SchemaNode.java | SchemaNode.throwExceptionIfTypeAlreadyExists | private void throwExceptionIfTypeAlreadyExists() throws FrameworkException {
"""
If the system is fully initialized (and no schema replacement is currently active), we disallow overriding (known) existing types so we can prevent unwanted behavior.
If a user were to create a type 'Html', he could cripple Structrs ... | java | private void throwExceptionIfTypeAlreadyExists() throws FrameworkException {
if (Services.getInstance().isInitialized() && ! Services.getInstance().isOverridingSchemaTypesAllowed()) {
final String typeName = getProperty(name);
// add type names to list of forbidden entity names
if (EntityNameBlacklist.con... | [
"private",
"void",
"throwExceptionIfTypeAlreadyExists",
"(",
")",
"throws",
"FrameworkException",
"{",
"if",
"(",
"Services",
".",
"getInstance",
"(",
")",
".",
"isInitialized",
"(",
")",
"&&",
"!",
"Services",
".",
"getInstance",
"(",
")",
".",
"isOverridingSch... | If the system is fully initialized (and no schema replacement is currently active), we disallow overriding (known) existing types so we can prevent unwanted behavior.
If a user were to create a type 'Html', he could cripple Structrs Page rendering completely.
This is a fix for all types in the Structr context - this do... | [
"If",
"the",
"system",
"is",
"fully",
"initialized",
"(",
"and",
"no",
"schema",
"replacement",
"is",
"currently",
"active",
")",
"we",
"disallow",
"overriding",
"(",
"known",
")",
"existing",
"types",
"so",
"we",
"can",
"prevent",
"unwanted",
"behavior",
".... | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/entity/SchemaNode.java#L730-L753 |
betfair/cougar | cougar-framework/socket-transport/src/main/java/com/betfair/cougar/transport/nio/ApplicationHealthMonitor.java | ApplicationHealthMonitor.startActiveMonitoring | private void startActiveMonitoring(final StatusAggregator aggregator) {
"""
Start a new thread and periodically poll all status aggregators for their current status
</p>
Calculate a new status where newStatus = healthy if all aggregator's status = healthy
"""
log.info("Starting application health monit... | java | private void startActiveMonitoring(final StatusAggregator aggregator) {
log.info("Starting application health monitoring in ACTIVE mode");
ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
Thread t ... | [
"private",
"void",
"startActiveMonitoring",
"(",
"final",
"StatusAggregator",
"aggregator",
")",
"{",
"log",
".",
"info",
"(",
"\"Starting application health monitoring in ACTIVE mode\"",
")",
";",
"ScheduledExecutorService",
"executor",
"=",
"Executors",
".",
"newSingleThr... | Start a new thread and periodically poll all status aggregators for their current status
</p>
Calculate a new status where newStatus = healthy if all aggregator's status = healthy | [
"Start",
"a",
"new",
"thread",
"and",
"periodically",
"poll",
"all",
"status",
"aggregators",
"for",
"their",
"current",
"status",
"<",
"/",
"p",
">",
"Calculate",
"a",
"new",
"status",
"where",
"newStatus",
"=",
"healthy",
"if",
"all",
"aggregator",
"s",
... | train | https://github.com/betfair/cougar/blob/08d1fe338fbd0e8572a9c2305bb5796402d5b1f5/cougar-framework/socket-transport/src/main/java/com/betfair/cougar/transport/nio/ApplicationHealthMonitor.java#L132-L160 |
wanglinsong/thx-webservice | src/main/java/com/tascape/qa/th/ws/comm/WebServiceCommunication.java | WebServiceCommunication.putJson | public String putJson(String endpoint, String params, JSONObject json) throws IOException {
"""
Issues HTTP PUT request, returns response body as string.
@param endpoint endpoint of request url
@param params request line parameters
@param json request body
@return response body
@throws IOException... | java | public String putJson(String endpoint, String params, JSONObject json) throws IOException {
return this.putJson(endpoint, params, json, "");
} | [
"public",
"String",
"putJson",
"(",
"String",
"endpoint",
",",
"String",
"params",
",",
"JSONObject",
"json",
")",
"throws",
"IOException",
"{",
"return",
"this",
".",
"putJson",
"(",
"endpoint",
",",
"params",
",",
"json",
",",
"\"\"",
")",
";",
"}"
] | Issues HTTP PUT request, returns response body as string.
@param endpoint endpoint of request url
@param params request line parameters
@param json request body
@return response body
@throws IOException in case of any IO related issue | [
"Issues",
"HTTP",
"PUT",
"request",
"returns",
"response",
"body",
"as",
"string",
"."
] | train | https://github.com/wanglinsong/thx-webservice/blob/29bc084b09ad35b012eb7c6b5c9ee55337ddee28/src/main/java/com/tascape/qa/th/ws/comm/WebServiceCommunication.java#L1058-L1060 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLSymmetricObjectPropertyAxiomImpl_CustomFieldSerializer.java | OWLSymmetricObjectPropertyAxiomImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLSymmetricObjectPropertyAxiomImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@lin... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLSymmetricObjectPropertyAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLSymmetricObjectPropertyAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
... | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLSymmetricObjectPropertyAxiomImpl_CustomFieldSerializer.java#L94-L97 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java | WhiteboxImpl.findFieldInHierarchy | private static Field findFieldInHierarchy(Object object, FieldMatcherStrategy strategy) {
"""
Find field in hierarchy.
@param object the object
@param strategy the strategy
@return the field
"""
assertObjectInGetInternalStateIsNotNull(object);
return findSingleFieldUsingStrategy(strategy... | java | private static Field findFieldInHierarchy(Object object, FieldMatcherStrategy strategy) {
assertObjectInGetInternalStateIsNotNull(object);
return findSingleFieldUsingStrategy(strategy, object, true, getType(object));
} | [
"private",
"static",
"Field",
"findFieldInHierarchy",
"(",
"Object",
"object",
",",
"FieldMatcherStrategy",
"strategy",
")",
"{",
"assertObjectInGetInternalStateIsNotNull",
"(",
"object",
")",
";",
"return",
"findSingleFieldUsingStrategy",
"(",
"strategy",
",",
"object",
... | Find field in hierarchy.
@param object the object
@param strategy the strategy
@return the field | [
"Find",
"field",
"in",
"hierarchy",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L452-L455 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/utilities/ServerUtility.java | ServerUtility.getArgBoolean | private static boolean getArgBoolean(String[] args, int position, boolean defaultValue) {
"""
Get boolean argument from list of arguments at position; use defaultValue if not present
@param args
@param position
@param defaultValue
@return
"""
if (args.length > position) {
String lowerAr... | java | private static boolean getArgBoolean(String[] args, int position, boolean defaultValue) {
if (args.length > position) {
String lowerArg = args[position].toLowerCase();
if (lowerArg.equals("true") || lowerArg.equals("yes")) {
return true;
} else if (lowerArg.eq... | [
"private",
"static",
"boolean",
"getArgBoolean",
"(",
"String",
"[",
"]",
"args",
",",
"int",
"position",
",",
"boolean",
"defaultValue",
")",
"{",
"if",
"(",
"args",
".",
"length",
">",
"position",
")",
"{",
"String",
"lowerArg",
"=",
"args",
"[",
"posi... | Get boolean argument from list of arguments at position; use defaultValue if not present
@param args
@param position
@param defaultValue
@return | [
"Get",
"boolean",
"argument",
"from",
"list",
"of",
"arguments",
"at",
"position",
";",
"use",
"defaultValue",
"if",
"not",
"present"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/utilities/ServerUtility.java#L355-L368 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java | HintRule.addAddVendor | public void addAddVendor(String source, String name, String value, Confidence confidence) {
"""
Adds a given vendor to the list of evidence to add when matched.
@param source the source of the evidence
@param name the name of the evidence
@param value the value of the evidence
@param confidence the confidenc... | java | public void addAddVendor(String source, String name, String value, Confidence confidence) {
addVendor.add(new Evidence(source, name, value, confidence));
} | [
"public",
"void",
"addAddVendor",
"(",
"String",
"source",
",",
"String",
"name",
",",
"String",
"value",
",",
"Confidence",
"confidence",
")",
"{",
"addVendor",
".",
"add",
"(",
"new",
"Evidence",
"(",
"source",
",",
"name",
",",
"value",
",",
"confidence... | Adds a given vendor to the list of evidence to add when matched.
@param source the source of the evidence
@param name the name of the evidence
@param value the value of the evidence
@param confidence the confidence of the evidence | [
"Adds",
"a",
"given",
"vendor",
"to",
"the",
"list",
"of",
"evidence",
"to",
"add",
"when",
"matched",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java#L191-L193 |
google/closure-templates | java/src/com/google/template/soy/base/internal/BaseUtils.java | BaseUtils.appendHexEscape | public static void appendHexEscape(StringBuilder out, int codePoint) {
"""
Appends the Unicode hex escape sequence for the given code point (backslash + 'u' + 4 hex
digits) to the given StringBuilder.
<p>Note: May append 2 escape sequences (surrogate pair) in the case of a supplementary
character (outside the... | java | public static void appendHexEscape(StringBuilder out, int codePoint) {
if (Character.isSupplementaryCodePoint(codePoint)) {
// Handle supplementary unicode values which are not representable in
// javascript. We deal with these by escaping them as two 4B sequences
// so that they will round-trip... | [
"public",
"static",
"void",
"appendHexEscape",
"(",
"StringBuilder",
"out",
",",
"int",
"codePoint",
")",
"{",
"if",
"(",
"Character",
".",
"isSupplementaryCodePoint",
"(",
"codePoint",
")",
")",
"{",
"// Handle supplementary unicode values which are not representable in"... | Appends the Unicode hex escape sequence for the given code point (backslash + 'u' + 4 hex
digits) to the given StringBuilder.
<p>Note: May append 2 escape sequences (surrogate pair) in the case of a supplementary
character (outside the Unicode BMP).
<p>Adapted from StringUtil.appendHexJavaScriptRepresentation().
@pa... | [
"Appends",
"the",
"Unicode",
"hex",
"escape",
"sequence",
"for",
"the",
"given",
"code",
"point",
"(",
"backslash",
"+",
"u",
"+",
"4",
"hex",
"digits",
")",
"to",
"the",
"given",
"StringBuilder",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/base/internal/BaseUtils.java#L254-L272 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/maven2/ArtifactsDeployer.java | ArtifactsDeployer.getArtifactFile | private File getArtifactFile(MavenBuild build, MavenArtifact mavenArtifact) throws IOException {
"""
Obtains the {@link java.io.File} representing the archived artifact.
"""
String fileName = mavenArtifact.fileName;
if (isArchiveJenkinsVersion) {
fileName = mavenArtifact.canonicalNa... | java | private File getArtifactFile(MavenBuild build, MavenArtifact mavenArtifact) throws IOException {
String fileName = mavenArtifact.fileName;
if (isArchiveJenkinsVersion) {
fileName = mavenArtifact.canonicalName;
}
File file = new File(new File(new File(new File(build.getArtifac... | [
"private",
"File",
"getArtifactFile",
"(",
"MavenBuild",
"build",
",",
"MavenArtifact",
"mavenArtifact",
")",
"throws",
"IOException",
"{",
"String",
"fileName",
"=",
"mavenArtifact",
".",
"fileName",
";",
"if",
"(",
"isArchiveJenkinsVersion",
")",
"{",
"fileName",
... | Obtains the {@link java.io.File} representing the archived artifact. | [
"Obtains",
"the",
"{"
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/maven2/ArtifactsDeployer.java#L232-L243 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/TemplatesApi.java | TemplatesApi.listBulkRecipients | public BulkRecipientsResponse listBulkRecipients(String accountId, String templateId, String recipientId) throws ApiException {
"""
Gets the bulk recipient file from a template.
Retrieves the bulk recipient file information from a template that has a bulk recipient.
@param accountId The external account number (... | java | public BulkRecipientsResponse listBulkRecipients(String accountId, String templateId, String recipientId) throws ApiException {
return listBulkRecipients(accountId, templateId, recipientId, null);
} | [
"public",
"BulkRecipientsResponse",
"listBulkRecipients",
"(",
"String",
"accountId",
",",
"String",
"templateId",
",",
"String",
"recipientId",
")",
"throws",
"ApiException",
"{",
"return",
"listBulkRecipients",
"(",
"accountId",
",",
"templateId",
",",
"recipientId",
... | Gets the bulk recipient file from a template.
Retrieves the bulk recipient file information from a template that has a bulk recipient.
@param accountId The external account number (int) or account ID Guid. (required)
@param templateId The ID of the template being accessed. (required)
@param recipientId The ID of the re... | [
"Gets",
"the",
"bulk",
"recipient",
"file",
"from",
"a",
"template",
".",
"Retrieves",
"the",
"bulk",
"recipient",
"file",
"information",
"from",
"a",
"template",
"that",
"has",
"a",
"bulk",
"recipient",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/TemplatesApi.java#L2000-L2002 |
wildfly/wildfly-core | cli/src/main/java/org/jboss/as/cli/Util.java | Util.replaceFilePathsWithBytes | public static void replaceFilePathsWithBytes(ModelNode request, ModelNode opDescOutcome) throws CommandFormatException {
"""
For any request params that are of type BYTES, replace the file path with the bytes from the file
"""
ModelNode requestProps = opDescOutcome.get("result", "request-properties");
... | java | public static void replaceFilePathsWithBytes(ModelNode request, ModelNode opDescOutcome) throws CommandFormatException {
ModelNode requestProps = opDescOutcome.get("result", "request-properties");
for (Property prop : requestProps.asPropertyList()) {
ModelNode typeDesc = prop.getValue().get(... | [
"public",
"static",
"void",
"replaceFilePathsWithBytes",
"(",
"ModelNode",
"request",
",",
"ModelNode",
"opDescOutcome",
")",
"throws",
"CommandFormatException",
"{",
"ModelNode",
"requestProps",
"=",
"opDescOutcome",
".",
"get",
"(",
"\"result\"",
",",
"\"request-prope... | For any request params that are of type BYTES, replace the file path with the bytes from the file | [
"For",
"any",
"request",
"params",
"that",
"are",
"of",
"type",
"BYTES",
"replace",
"the",
"file",
"path",
"with",
"the",
"bytes",
"from",
"the",
"file"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/cli/src/main/java/org/jboss/as/cli/Util.java#L1693-L1710 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java | CFG.getSuccessorWithEdgeType | public BasicBlock getSuccessorWithEdgeType(BasicBlock source, @Type int edgeType) {
"""
Get the first successor reachable from given edge type.
@param source
the source block
@param edgeType
the edge type leading to the successor
@return the successor, or null if there is no outgoing edge with the
specifie... | java | public BasicBlock getSuccessorWithEdgeType(BasicBlock source, @Type int edgeType) {
Edge edge = getOutgoingEdgeWithType(source, edgeType);
return edge != null ? edge.getTarget() : null;
} | [
"public",
"BasicBlock",
"getSuccessorWithEdgeType",
"(",
"BasicBlock",
"source",
",",
"@",
"Type",
"int",
"edgeType",
")",
"{",
"Edge",
"edge",
"=",
"getOutgoingEdgeWithType",
"(",
"source",
",",
"edgeType",
")",
";",
"return",
"edge",
"!=",
"null",
"?",
"edge... | Get the first successor reachable from given edge type.
@param source
the source block
@param edgeType
the edge type leading to the successor
@return the successor, or null if there is no outgoing edge with the
specified edge type | [
"Get",
"the",
"first",
"successor",
"reachable",
"from",
"given",
"edge",
"type",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java#L427-L430 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/raytrace/RaytraceWorld.java | RaytraceWorld.rayTraceBlock | public RayTraceResult rayTraceBlock(BlockPos pos, Point exit) {
"""
Raytraces inside an actual block area. Calls
{@link Block#collisionRayTrace(IBlockState, World, BlockPos, net.minecraft.util.math.Vec3d, net.minecraft.util.math.Vec3d)}
@param pos the pos
@param exit the exit
@return the {@link RayTraceResul... | java | public RayTraceResult rayTraceBlock(BlockPos pos, Point exit)
{
IBlockState state = world.getBlockState(pos);
Block block = state.getBlock();
//TODO: fix getBoundingBox for IBoundingBox ?
if (hasOption(Options.CHECK_COLLISION) && state.getBoundingBox(world, pos) == null)
return null;
if (!block.canCollide... | [
"public",
"RayTraceResult",
"rayTraceBlock",
"(",
"BlockPos",
"pos",
",",
"Point",
"exit",
")",
"{",
"IBlockState",
"state",
"=",
"world",
".",
"getBlockState",
"(",
"pos",
")",
";",
"Block",
"block",
"=",
"state",
".",
"getBlock",
"(",
")",
";",
"//TODO: ... | Raytraces inside an actual block area. Calls
{@link Block#collisionRayTrace(IBlockState, World, BlockPos, net.minecraft.util.math.Vec3d, net.minecraft.util.math.Vec3d)}
@param pos the pos
@param exit the exit
@return the {@link RayTraceResult} return by block raytrace | [
"Raytraces",
"inside",
"an",
"actual",
"block",
"area",
".",
"Calls",
"{",
"@link",
"Block#collisionRayTrace",
"(",
"IBlockState",
"World",
"BlockPos",
"net",
".",
"minecraft",
".",
"util",
".",
"math",
".",
"Vec3d",
"net",
".",
"minecraft",
".",
"util",
"."... | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/raytrace/RaytraceWorld.java#L281-L291 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuFuncSetAttribute | public static int cuFuncSetAttribute(CUfunction hfunc, int attrib, int value) {
"""
Sets information about a function.<br>
<br>
This call sets the value of a specified attribute attrib on the kernel given
by hfunc to an integer value specified by val
This function returns CUDA_SUCCESS if the new value of the a... | java | public static int cuFuncSetAttribute(CUfunction hfunc, int attrib, int value)
{
return checkResult(cuFuncSetAttributeNative(hfunc, attrib, value));
} | [
"public",
"static",
"int",
"cuFuncSetAttribute",
"(",
"CUfunction",
"hfunc",
",",
"int",
"attrib",
",",
"int",
"value",
")",
"{",
"return",
"checkResult",
"(",
"cuFuncSetAttributeNative",
"(",
"hfunc",
",",
"attrib",
",",
"value",
")",
")",
";",
"}"
] | Sets information about a function.<br>
<br>
This call sets the value of a specified attribute attrib on the kernel given
by hfunc to an integer value specified by val
This function returns CUDA_SUCCESS if the new value of the attribute could be
successfully set. If the set fails, this call will return an error.
Not all... | [
"Sets",
"information",
"about",
"a",
"function",
".",
"<br",
">",
"<br",
">",
"This",
"call",
"sets",
"the",
"value",
"of",
"a",
"specified",
"attribute",
"attrib",
"on",
"the",
"kernel",
"given",
"by",
"hfunc",
"to",
"an",
"integer",
"value",
"specified",... | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L8162-L8165 |
jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/output/Settings.java | Settings.getStringSetting | public static String getStringSetting(Map<String, Object> settings, String key, String defaultVal) {
"""
Gets a String value for the setting, returning the default value if not
specified.
@param settings
@param key the key to get the String setting for
@param defaultVal the default value to return i... | java | public static String getStringSetting(Map<String, Object> settings, String key, String defaultVal) {
final Object value = settings.get(key);
return value != null ? value.toString() : defaultVal;
} | [
"public",
"static",
"String",
"getStringSetting",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"settings",
",",
"String",
"key",
",",
"String",
"defaultVal",
")",
"{",
"final",
"Object",
"value",
"=",
"settings",
".",
"get",
"(",
"key",
")",
";",
"retu... | Gets a String value for the setting, returning the default value if not
specified.
@param settings
@param key the key to get the String setting for
@param defaultVal the default value to return if the setting was not specified
@return the String value for the setting | [
"Gets",
"a",
"String",
"value",
"for",
"the",
"setting",
"returning",
"the",
"default",
"value",
"if",
"not",
"specified",
"."
] | train | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/output/Settings.java#L117-L120 |
aws/aws-sdk-java | aws-java-sdk-cloudfront/src/main/java/com/amazonaws/services/cloudfront/util/SignerUtils.java | SignerUtils.buildCannedPolicy | public static String buildCannedPolicy(String resourceUrlOrPath,
Date dateLessThan) {
"""
Returns a "canned" policy for the given parameters.
For more information, see <a href=
"http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-urls-overview.html"
>Overview of ... | java | public static String buildCannedPolicy(String resourceUrlOrPath,
Date dateLessThan) {
return "{\"Statement\":[{\"Resource\":\""
+ resourceUrlOrPath
+ "\",\"Condition\":{\"DateLessThan\":{\"AWS:EpochTime\":"
+ MILLISECONDS.toSeconds(dateLessThan.getTime... | [
"public",
"static",
"String",
"buildCannedPolicy",
"(",
"String",
"resourceUrlOrPath",
",",
"Date",
"dateLessThan",
")",
"{",
"return",
"\"{\\\"Statement\\\":[{\\\"Resource\\\":\\\"\"",
"+",
"resourceUrlOrPath",
"+",
"\"\\\",\\\"Condition\\\":{\\\"DateLessThan\\\":{\\\"AWS:EpochTim... | Returns a "canned" policy for the given parameters.
For more information, see <a href=
"http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-urls-overview.html"
>Overview of Signed URLs</a>. | [
"Returns",
"a",
"canned",
"policy",
"for",
"the",
"given",
"parameters",
".",
"For",
"more",
"information",
"see",
"<a",
"href",
"=",
"http",
":",
"//",
"docs",
".",
"aws",
".",
"amazon",
".",
"com",
"/",
"AmazonCloudFront",
"/",
"latest",
"/",
"Develope... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudfront/src/main/java/com/amazonaws/services/cloudfront/util/SignerUtils.java#L59-L66 |
Erudika/para | para-core/src/main/java/com/erudika/para/utils/Utils.java | Utils.noSpaces | public static String noSpaces(String str, String replaceWith) {
"""
Converts spaces to dashes.
@param str a string with spaces
@param replaceWith a string to replace spaces with
@return a string with dashes
"""
return StringUtils.isBlank(str) ? "" : str.trim().replaceAll("[\\p{C}\\p{Z}]+",
StringUtils... | java | public static String noSpaces(String str, String replaceWith) {
return StringUtils.isBlank(str) ? "" : str.trim().replaceAll("[\\p{C}\\p{Z}]+",
StringUtils.trimToEmpty(replaceWith)).toLowerCase();
} | [
"public",
"static",
"String",
"noSpaces",
"(",
"String",
"str",
",",
"String",
"replaceWith",
")",
"{",
"return",
"StringUtils",
".",
"isBlank",
"(",
"str",
")",
"?",
"\"\"",
":",
"str",
".",
"trim",
"(",
")",
".",
"replaceAll",
"(",
"\"[\\\\p{C}\\\\p{Z}]+... | Converts spaces to dashes.
@param str a string with spaces
@param replaceWith a string to replace spaces with
@return a string with dashes | [
"Converts",
"spaces",
"to",
"dashes",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/utils/Utils.java#L364-L367 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java | SDNN.leakyRelu | public SDVariable leakyRelu(String name, SDVariable x, double alpha) {
"""
Element-wise leaky ReLU function:<br>
out = x if x >= 0.0<br>
out = alpha * x if x < cutoff<br>
Alpha value is most commonly set to 0.01
@param x Input variable
@param alpha Cutoff - usually 0.0
@return Output variable
"""
... | java | public SDVariable leakyRelu(String name, SDVariable x, double alpha) {
validateFloatingPoint("leaky ReLU", x);
SDVariable result = f().leakyRelu(x, alpha);
return updateVariableNameAndReference(result, name);
} | [
"public",
"SDVariable",
"leakyRelu",
"(",
"String",
"name",
",",
"SDVariable",
"x",
",",
"double",
"alpha",
")",
"{",
"validateFloatingPoint",
"(",
"\"leaky ReLU\"",
",",
"x",
")",
";",
"SDVariable",
"result",
"=",
"f",
"(",
")",
".",
"leakyRelu",
"(",
"x"... | Element-wise leaky ReLU function:<br>
out = x if x >= 0.0<br>
out = alpha * x if x < cutoff<br>
Alpha value is most commonly set to 0.01
@param x Input variable
@param alpha Cutoff - usually 0.0
@return Output variable | [
"Element",
"-",
"wise",
"leaky",
"ReLU",
"function",
":",
"<br",
">",
"out",
"=",
"x",
"if",
"x",
">",
"=",
"0",
".",
"0<br",
">",
"out",
"=",
"alpha",
"*",
"x",
"if",
"x",
"<",
"cutoff<br",
">",
"Alpha",
"value",
"is",
"most",
"commonly",
"set",... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java#L307-L311 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/TilesExtractor.java | TilesExtractor.isExtracted | private static boolean isExtracted(SpriteTiled level, int x, int y, Collection<ImageBuffer> tiles) {
"""
Check if tile has already been extracted regarding the current tile on level rip.
@param level The level rip reference.
@param x The current level rip horizontal location.
@param y The current level rip ve... | java | private static boolean isExtracted(SpriteTiled level, int x, int y, Collection<ImageBuffer> tiles)
{
final int tw = level.getTileWidth();
final int th = level.getTileHeight();
final ImageBuffer surface = level.getSurface();
for (final ImageBuffer tile : tiles)
{
... | [
"private",
"static",
"boolean",
"isExtracted",
"(",
"SpriteTiled",
"level",
",",
"int",
"x",
",",
"int",
"y",
",",
"Collection",
"<",
"ImageBuffer",
">",
"tiles",
")",
"{",
"final",
"int",
"tw",
"=",
"level",
".",
"getTileWidth",
"(",
")",
";",
"final",
... | Check if tile has already been extracted regarding the current tile on level rip.
@param level The level rip reference.
@param x The current level rip horizontal location.
@param y The current level rip vertical location.
@param tiles The current extracted tiles.
@return <code>true</code> if already extracted, <code>f... | [
"Check",
"if",
"tile",
"has",
"already",
"been",
"extracted",
"regarding",
"the",
"current",
"tile",
"on",
"level",
"rip",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/TilesExtractor.java#L87-L101 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getAddCommentRequest | public BoxRequestsFile.AddCommentToFile getAddCommentRequest(String fileId, String message) {
"""
Gets a request that adds a comment to a file
@param fileId id of the file to add the comment to
@param message message for the comment that will be added
@return request to add a comment to a file
"""
... | java | public BoxRequestsFile.AddCommentToFile getAddCommentRequest(String fileId, String message) {
BoxRequestsFile.AddCommentToFile request = new BoxRequestsFile.AddCommentToFile(fileId, message, getCommentUrl(), mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"AddCommentToFile",
"getAddCommentRequest",
"(",
"String",
"fileId",
",",
"String",
"message",
")",
"{",
"BoxRequestsFile",
".",
"AddCommentToFile",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"AddCommentToFile",
"(",
"fileId",
","... | Gets a request that adds a comment to a file
@param fileId id of the file to add the comment to
@param message message for the comment that will be added
@return request to add a comment to a file | [
"Gets",
"a",
"request",
"that",
"adds",
"a",
"comment",
"to",
"a",
"file"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L282-L285 |
Backendless/Android-SDK | src/com/backendless/Media.java | Media.configureForPublish | public void configureForPublish( Context context, SurfaceView mSurfaceView, DisplayOrientation orientation ) {
"""
<p>
default video quality to 176x144 20fps 500Kbps<br/>
default audio quality to 16 000 sampleRate 272000 bitRate
</p>
"""
session = getSession( context, mSurfaceView, orientation.getValue(... | java | public void configureForPublish( Context context, SurfaceView mSurfaceView, DisplayOrientation orientation )
{
session = getSession( context, mSurfaceView, orientation.getValue() );
rtspClient = getRtspClient( context, session );
} | [
"public",
"void",
"configureForPublish",
"(",
"Context",
"context",
",",
"SurfaceView",
"mSurfaceView",
",",
"DisplayOrientation",
"orientation",
")",
"{",
"session",
"=",
"getSession",
"(",
"context",
",",
"mSurfaceView",
",",
"orientation",
".",
"getValue",
"(",
... | <p>
default video quality to 176x144 20fps 500Kbps<br/>
default audio quality to 16 000 sampleRate 272000 bitRate
</p> | [
"<p",
">",
"default",
"video",
"quality",
"to",
"176x144",
"20fps",
"500Kbps<br",
"/",
">",
"default",
"audio",
"quality",
"to",
"16",
"000",
"sampleRate",
"272000",
"bitRate",
"<",
"/",
"p",
">"
] | train | https://github.com/Backendless/Android-SDK/blob/3af1e9a378f19d890db28a833f7fc8595b924cc3/src/com/backendless/Media.java#L198-L202 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java | JsonRpcBasicServer.findBestMethodUsingParamIndexes | private AMethodWithItsArgs findBestMethodUsingParamIndexes(Set<Method> methods, int paramCount, ArrayNode paramNodes) {
"""
Finds the {@link Method} from the supplied {@link Set} that
best matches the rest of the arguments supplied and returns
it as a {@link AMethodWithItsArgs} class.
@param methods the {@... | java | private AMethodWithItsArgs findBestMethodUsingParamIndexes(Set<Method> methods, int paramCount, ArrayNode paramNodes) {
int numParams = isNullNodeOrValue(paramNodes) ? 0 : paramNodes.size();
int bestParamNumDiff = Integer.MAX_VALUE;
Set<Method> matchedMethods = collectMethodsMatchingParamCount(methods, paramCount... | [
"private",
"AMethodWithItsArgs",
"findBestMethodUsingParamIndexes",
"(",
"Set",
"<",
"Method",
">",
"methods",
",",
"int",
"paramCount",
",",
"ArrayNode",
"paramNodes",
")",
"{",
"int",
"numParams",
"=",
"isNullNodeOrValue",
"(",
"paramNodes",
")",
"?",
"0",
":",
... | Finds the {@link Method} from the supplied {@link Set} that
best matches the rest of the arguments supplied and returns
it as a {@link AMethodWithItsArgs} class.
@param methods the {@link Method}s
@param paramCount the number of expect parameters
@param paramNodes the parameters for matching types
@return the {@lin... | [
"Finds",
"the",
"{",
"@link",
"Method",
"}",
"from",
"the",
"supplied",
"{",
"@link",
"Set",
"}",
"that",
"best",
"matches",
"the",
"rest",
"of",
"the",
"arguments",
"supplied",
"and",
"returns",
"it",
"as",
"a",
"{",
"@link",
"AMethodWithItsArgs",
"}",
... | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java#L659-L668 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/Messages.java | Messages.formatMessage | private String formatMessage(String message, String language, Object... args) {
"""
Optionally formats a message for the requested language with
{@link java.text.MessageFormat}.
@param message
@param language
@param args
@return the message
"""
if (args != null && args.length > 0) {
... | java | private String formatMessage(String message, String language, Object... args) {
if (args != null && args.length > 0) {
// only format a message if we have arguments
Locale locale = languages.getLocaleOrDefault(language);
MessageFormat messageFormat = new MessageFormat(message... | [
"private",
"String",
"formatMessage",
"(",
"String",
"message",
",",
"String",
"language",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"args",
"!=",
"null",
"&&",
"args",
".",
"length",
">",
"0",
")",
"{",
"// only format a message if we have arguments"... | Optionally formats a message for the requested language with
{@link java.text.MessageFormat}.
@param message
@param language
@param args
@return the message | [
"Optionally",
"formats",
"a",
"message",
"for",
"the",
"requested",
"language",
"with",
"{",
"@link",
"java",
".",
"text",
".",
"MessageFormat",
"}",
"."
] | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/Messages.java#L403-L412 |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRelPersistenceImpl.java | CommerceDiscountRelPersistenceImpl.findByCD_CN | @Override
public List<CommerceDiscountRel> findByCD_CN(long commerceDiscountId,
long classNameId, int start, int end) {
"""
Returns a range of all the commerce discount rels where commerceDiscountId = ? and classNameId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</... | java | @Override
public List<CommerceDiscountRel> findByCD_CN(long commerceDiscountId,
long classNameId, int start, int end) {
return findByCD_CN(commerceDiscountId, classNameId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceDiscountRel",
">",
"findByCD_CN",
"(",
"long",
"commerceDiscountId",
",",
"long",
"classNameId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCD_CN",
"(",
"commerceDiscountId",
",",
"classNam... | Returns a range of all the commerce discount rels where commerceDiscountId = ? and classNameId = ?.
<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>... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"discount",
"rels",
"where",
"commerceDiscountId",
"=",
"?",
";",
"and",
"classNameId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRelPersistenceImpl.java#L670-L674 |
galan/commons | src/main/java/de/galan/commons/net/flux/Flux.java | Flux.addDefaultHeader | public static void addDefaultHeader(String key, String value) {
"""
Added default headers will always be send, can still be overriden using the builder.
"""
if (isNotBlank(key) && isNotBlank(value)) {
if (defaultHeader == null) {
defaultHeader = new HashMap<String, String>();
}
defaultHeader.put... | java | public static void addDefaultHeader(String key, String value) {
if (isNotBlank(key) && isNotBlank(value)) {
if (defaultHeader == null) {
defaultHeader = new HashMap<String, String>();
}
defaultHeader.put(key, value);
}
} | [
"public",
"static",
"void",
"addDefaultHeader",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"isNotBlank",
"(",
"key",
")",
"&&",
"isNotBlank",
"(",
"value",
")",
")",
"{",
"if",
"(",
"defaultHeader",
"==",
"null",
")",
"{",
"defa... | Added default headers will always be send, can still be overriden using the builder. | [
"Added",
"default",
"headers",
"will",
"always",
"be",
"send",
"can",
"still",
"be",
"overriden",
"using",
"the",
"builder",
"."
] | train | https://github.com/galan/commons/blob/45d2f36c69958d3f847e5fed66603ea629471822/src/main/java/de/galan/commons/net/flux/Flux.java#L103-L110 |
m-m-m/util | datatype/src/main/java/net/sf/mmm/util/datatype/api/color/GenericColor.java | GenericColor.calculateSaturationHsl | private static double calculateSaturationHsl(double chroma, double lightness) {
"""
Calculate the {@link Saturation} for {@link ColorModel#HSL}.
@param chroma is the {@link Chroma} value.
@param lightness is the {@link Lightness} value.
@return the {@link Saturation}.
"""
double d = 1 - Math.abs(2 * ... | java | private static double calculateSaturationHsl(double chroma, double lightness) {
double d = 1 - Math.abs(2 * lightness - 1);
if (d == 0) {
return 0;
}
return chroma / d;
} | [
"private",
"static",
"double",
"calculateSaturationHsl",
"(",
"double",
"chroma",
",",
"double",
"lightness",
")",
"{",
"double",
"d",
"=",
"1",
"-",
"Math",
".",
"abs",
"(",
"2",
"*",
"lightness",
"-",
"1",
")",
";",
"if",
"(",
"d",
"==",
"0",
")",
... | Calculate the {@link Saturation} for {@link ColorModel#HSL}.
@param chroma is the {@link Chroma} value.
@param lightness is the {@link Lightness} value.
@return the {@link Saturation}. | [
"Calculate",
"the",
"{",
"@link",
"Saturation",
"}",
"for",
"{",
"@link",
"ColorModel#HSL",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/datatype/src/main/java/net/sf/mmm/util/datatype/api/color/GenericColor.java#L215-L222 |
acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/config/StormConfigUtil.java | StormConfigUtil.getIntValue | public static int getIntValue(Config stormConf, String key, int defaultValue) {
"""
Storm設定オブジェクトから文字列型の設定値を取得する。<br>
存在しない場合はデフォルト値を返す。
@param stormConf Storm設定オブジェクト
@param key 設定値のキー
@param defaultValue デフォルト値
@return 個別設定値(int型)
"""
Object config = stormConf.get(key);
if (config ... | java | public static int getIntValue(Config stormConf, String key, int defaultValue)
{
Object config = stormConf.get(key);
if (config == null)
{
return defaultValue;
}
return Integer.parseInt(config.toString());
} | [
"public",
"static",
"int",
"getIntValue",
"(",
"Config",
"stormConf",
",",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"Object",
"config",
"=",
"stormConf",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"config",
"==",
"null",
")",
"{",
"retu... | Storm設定オブジェクトから文字列型の設定値を取得する。<br>
存在しない場合はデフォルト値を返す。
@param stormConf Storm設定オブジェクト
@param key 設定値のキー
@param defaultValue デフォルト値
@return 個別設定値(int型) | [
"Storm設定オブジェクトから文字列型の設定値を取得する。<br",
">",
"存在しない場合はデフォルト値を返す。"
] | train | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/config/StormConfigUtil.java#L64-L74 |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/MonomerStore.java | MonomerStore.getMonomer | public Monomer getMonomer(String polymerType, String alternateId) {
"""
Returns the monomer specified by polymerType and alternatId
@param polymerType polymer type of monomer
@param alternateId alternateId of monomer
@return the matching monomer
"""
Map<String, Monomer> map1 = monomerDB.get(polymerType)... | java | public Monomer getMonomer(String polymerType, String alternateId) {
Map<String, Monomer> map1 = monomerDB.get(polymerType);
//alternateId = alternateId.toUpperCase();
return monomerDB.get(polymerType).get(alternateId);
} | [
"public",
"Monomer",
"getMonomer",
"(",
"String",
"polymerType",
",",
"String",
"alternateId",
")",
"{",
"Map",
"<",
"String",
",",
"Monomer",
">",
"map1",
"=",
"monomerDB",
".",
"get",
"(",
"polymerType",
")",
";",
"//alternateId = alternateId.toUpperCase();\r",
... | Returns the monomer specified by polymerType and alternatId
@param polymerType polymer type of monomer
@param alternateId alternateId of monomer
@return the matching monomer | [
"Returns",
"the",
"monomer",
"specified",
"by",
"polymerType",
"and",
"alternatId"
] | train | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/MonomerStore.java#L151-L155 |
SimiaCryptus/utilities | java-util/src/main/java/com/simiacryptus/util/Util.java | Util.toInlineImage | public static String toInlineImage(final BufferedImage img, final String alt) {
"""
To inline image string.
@param img the img
@param alt the alt
@return the string
"""
return com.simiacryptus.util.Util.toInlineImage(new LabeledObject<>(img, alt));
} | java | public static String toInlineImage(final BufferedImage img, final String alt) {
return com.simiacryptus.util.Util.toInlineImage(new LabeledObject<>(img, alt));
} | [
"public",
"static",
"String",
"toInlineImage",
"(",
"final",
"BufferedImage",
"img",
",",
"final",
"String",
"alt",
")",
"{",
"return",
"com",
".",
"simiacryptus",
".",
"util",
".",
"Util",
".",
"toInlineImage",
"(",
"new",
"LabeledObject",
"<>",
"(",
"img",... | To inline image string.
@param img the img
@param alt the alt
@return the string | [
"To",
"inline",
"image",
"string",
"."
] | train | https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/util/Util.java#L459-L461 |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java | HttpBuilder.postAsync | public CompletableFuture<Object> postAsync(final Consumer<HttpConfig> configuration) {
"""
Executes an asynchronous POST request on the configured URI (asynchronous alias to `post(Consumer)`), with additional configuration provided by the
configuration function.
This method is generally used for Java-specific ... | java | public CompletableFuture<Object> postAsync(final Consumer<HttpConfig> configuration) {
return CompletableFuture.supplyAsync(() -> post(configuration), getExecutor());
} | [
"public",
"CompletableFuture",
"<",
"Object",
">",
"postAsync",
"(",
"final",
"Consumer",
"<",
"HttpConfig",
">",
"configuration",
")",
"{",
"return",
"CompletableFuture",
".",
"supplyAsync",
"(",
"(",
")",
"->",
"post",
"(",
"configuration",
")",
",",
"getExe... | Executes an asynchronous POST request on the configured URI (asynchronous alias to `post(Consumer)`), with additional configuration provided by the
configuration function.
This method is generally used for Java-specific configuration.
[source,java]
----
HttpBuilder http = HttpBuilder.configure(config -> {
config.getR... | [
"Executes",
"an",
"asynchronous",
"POST",
"request",
"on",
"the",
"configured",
"URI",
"(",
"asynchronous",
"alias",
"to",
"post",
"(",
"Consumer",
")",
")",
"with",
"additional",
"configuration",
"provided",
"by",
"the",
"configuration",
"function",
"."
] | train | https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L827-L829 |
cloudfoundry/uaa | server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/NonSnarlMetadataManager.java | NonSnarlMetadataManager.addDescriptor | private void addDescriptor(List<String> result, EntityDescriptor descriptor) throws MetadataProviderException {
"""
Parses entityID from the descriptor and adds it to the result set. Signatures on all found entities
are verified using the given policy and trust engine.
@param result result set
@param des... | java | private void addDescriptor(List<String> result, EntityDescriptor descriptor) throws MetadataProviderException {
String entityID = descriptor.getEntityID();
log.debug("Found metadata EntityDescriptor with ID", entityID);
result.add(entityID);
} | [
"private",
"void",
"addDescriptor",
"(",
"List",
"<",
"String",
">",
"result",
",",
"EntityDescriptor",
"descriptor",
")",
"throws",
"MetadataProviderException",
"{",
"String",
"entityID",
"=",
"descriptor",
".",
"getEntityID",
"(",
")",
";",
"log",
".",
"debug"... | Parses entityID from the descriptor and adds it to the result set. Signatures on all found entities
are verified using the given policy and trust engine.
@param result result set
@param descriptor descriptor to parse
@throws MetadataProviderException in case signature validation fails | [
"Parses",
"entityID",
"from",
"the",
"descriptor",
"and",
"adds",
"it",
"to",
"the",
"result",
"set",
".",
"Signatures",
"on",
"all",
"found",
"entities",
"are",
"verified",
"using",
"the",
"given",
"policy",
"and",
"trust",
"engine",
"."
] | train | https://github.com/cloudfoundry/uaa/blob/e8df3d7060580c92d33461106399f9e4f36e3cd2/server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/NonSnarlMetadataManager.java#L384-L390 |
imsweb/naaccr-xml | src/main/java/com/imsweb/naaccrxml/sas/SasUtils.java | SasUtils.getFields | public static List<SasFieldInfo> getFields(String version, String recordType, File dictionary) {
"""
Returns the fields information for the given parameters.
@param version NAACCR version
@param recordType record type
@param dictionary user-defined dictionary in CSV format (see standard ones in docs folder)
@r... | java | public static List<SasFieldInfo> getFields(String version, String recordType, File dictionary) {
return getFields(recordType, Thread.currentThread().getContextClassLoader().getResourceAsStream("naaccr-xml-items-" + version + ".csv"), dictionary);
} | [
"public",
"static",
"List",
"<",
"SasFieldInfo",
">",
"getFields",
"(",
"String",
"version",
",",
"String",
"recordType",
",",
"File",
"dictionary",
")",
"{",
"return",
"getFields",
"(",
"recordType",
",",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getC... | Returns the fields information for the given parameters.
@param version NAACCR version
@param recordType record type
@param dictionary user-defined dictionary in CSV format (see standard ones in docs folder)
@return fields information | [
"Returns",
"the",
"fields",
"information",
"for",
"the",
"given",
"parameters",
"."
] | train | https://github.com/imsweb/naaccr-xml/blob/a3a501faa2a0c3411dd5248b2c1379f279131696/src/main/java/com/imsweb/naaccrxml/sas/SasUtils.java#L64-L66 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/WorkQueueManager.java | WorkQueueManager.createNewThread | protected void createNewThread(ChannelSelector sr, int threadType, int number) {
"""
Create a new reader thread. Provided so we can support pulling these from a
thread pool
in the SyncWorkQueueManager. This will allow these threads to have
WSTHreadLocal.
@param sr
@param threadType
@param number
"""
... | java | protected void createNewThread(ChannelSelector sr, int threadType, int number) {
StartPrivilegedThread privThread = new StartPrivilegedThread(sr, threadType, number, this.tGroup);
AccessController.doPrivileged(privThread);
} | [
"protected",
"void",
"createNewThread",
"(",
"ChannelSelector",
"sr",
",",
"int",
"threadType",
",",
"int",
"number",
")",
"{",
"StartPrivilegedThread",
"privThread",
"=",
"new",
"StartPrivilegedThread",
"(",
"sr",
",",
"threadType",
",",
"number",
",",
"this",
... | Create a new reader thread. Provided so we can support pulling these from a
thread pool
in the SyncWorkQueueManager. This will allow these threads to have
WSTHreadLocal.
@param sr
@param threadType
@param number | [
"Create",
"a",
"new",
"reader",
"thread",
".",
"Provided",
"so",
"we",
"can",
"support",
"pulling",
"these",
"from",
"a",
"thread",
"pool",
"in",
"the",
"SyncWorkQueueManager",
".",
"This",
"will",
"allow",
"these",
"threads",
"to",
"have",
"WSTHreadLocal",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/WorkQueueManager.java#L808-L811 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/Img.java | Img.draw | private static BufferedImage draw(BufferedImage backgroundImg, Image img, Rectangle rectangle, float alpha) {
"""
将图片绘制在背景上
@param backgroundImg 背景图片
@param img 要绘制的图片
@param rectangle 矩形对象,表示矩形区域的x,y,width,height,x,y从背景图片中心计算
@return 绘制后的背景
"""
final Graphics2D g = backgroundImg.createGraphics();
... | java | private static BufferedImage draw(BufferedImage backgroundImg, Image img, Rectangle rectangle, float alpha) {
final Graphics2D g = backgroundImg.createGraphics();
g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, alpha));
g.drawImage(img, rectangle.x, rectangle.y, rectangle.width, rectangle.he... | [
"private",
"static",
"BufferedImage",
"draw",
"(",
"BufferedImage",
"backgroundImg",
",",
"Image",
"img",
",",
"Rectangle",
"rectangle",
",",
"float",
"alpha",
")",
"{",
"final",
"Graphics2D",
"g",
"=",
"backgroundImg",
".",
"createGraphics",
"(",
")",
";",
"g... | 将图片绘制在背景上
@param backgroundImg 背景图片
@param img 要绘制的图片
@param rectangle 矩形对象,表示矩形区域的x,y,width,height,x,y从背景图片中心计算
@return 绘制后的背景 | [
"将图片绘制在背景上"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/Img.java#L574-L580 |
titorenko/quick-csv-streamer | src/main/java/uk/elementarysoftware/quickcsv/api/CSVParserBuilder.java | CSVParserBuilder.usingSeparatorWithQuote | public CSVParserBuilder<T, K> usingSeparatorWithQuote(char separator, char quote) {
"""
Use specified characters as field separator and quote character.
Quote character can be escaped by preceding it with another quote character.
@param separator - field separator character
@param quote - quote character
@retu... | java | public CSVParserBuilder<T, K> usingSeparatorWithQuote(char separator, char quote) {
this.metadata = new CSVFileMetadata(separator, Optional.of(quote));
return this;
} | [
"public",
"CSVParserBuilder",
"<",
"T",
",",
"K",
">",
"usingSeparatorWithQuote",
"(",
"char",
"separator",
",",
"char",
"quote",
")",
"{",
"this",
".",
"metadata",
"=",
"new",
"CSVFileMetadata",
"(",
"separator",
",",
"Optional",
".",
"of",
"(",
"quote",
... | Use specified characters as field separator and quote character.
Quote character can be escaped by preceding it with another quote character.
@param separator - field separator character
@param quote - quote character
@return this parser builder | [
"Use",
"specified",
"characters",
"as",
"field",
"separator",
"and",
"quote",
"character",
".",
"Quote",
"character",
"can",
"be",
"escaped",
"by",
"preceding",
"it",
"with",
"another",
"quote",
"character",
"."
] | train | https://github.com/titorenko/quick-csv-streamer/blob/cc11f6e9db6df4f3aac57ca72c4176501667f41d/src/main/java/uk/elementarysoftware/quickcsv/api/CSVParserBuilder.java#L120-L123 |
AKSW/RDFUnit | rdfunit-commons/src/main/java/org/aksw/rdfunit/services/PrefixNSService.java | PrefixNSService.getLocalName | public static String getLocalName(final String uri, final String prefix) {
"""
Returns the local name of a URI by removing the prefix namespace
@param uri the uri
@param prefix the prefix we want to remove
@return the local name (uri without prefix namespace)
"""
String ns = getNSFromPrefix(pre... | java | public static String getLocalName(final String uri, final String prefix) {
String ns = getNSFromPrefix(prefix);
if (ns != null) {
return uri.replace(ns, "");
}
throw new IllegalArgumentException("Undefined prefix (" + prefix + ") in URI: " + uri);
} | [
"public",
"static",
"String",
"getLocalName",
"(",
"final",
"String",
"uri",
",",
"final",
"String",
"prefix",
")",
"{",
"String",
"ns",
"=",
"getNSFromPrefix",
"(",
"prefix",
")",
";",
"if",
"(",
"ns",
"!=",
"null",
")",
"{",
"return",
"uri",
".",
"re... | Returns the local name of a URI by removing the prefix namespace
@param uri the uri
@param prefix the prefix we want to remove
@return the local name (uri without prefix namespace) | [
"Returns",
"the",
"local",
"name",
"of",
"a",
"URI",
"by",
"removing",
"the",
"prefix",
"namespace"
] | train | https://github.com/AKSW/RDFUnit/blob/083f18ebda4ad790b1fbb4cfe1c9dd1762d51384/rdfunit-commons/src/main/java/org/aksw/rdfunit/services/PrefixNSService.java#L117-L123 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.openapi/src/com/ibm/ws/microprofile/openapi/impl/parser/util/InlineModelResolver.java | InlineModelResolver.makeRefProperty | public Schema makeRefProperty(String ref, Schema property) {
"""
Make a RefProperty
@param ref new property name
@param property Property
@return
"""
Schema newProperty = new SchemaImpl().ref(ref);
this.copyVendorExtensions(property, newProperty);
return newProperty;
} | java | public Schema makeRefProperty(String ref, Schema property) {
Schema newProperty = new SchemaImpl().ref(ref);
this.copyVendorExtensions(property, newProperty);
return newProperty;
} | [
"public",
"Schema",
"makeRefProperty",
"(",
"String",
"ref",
",",
"Schema",
"property",
")",
"{",
"Schema",
"newProperty",
"=",
"new",
"SchemaImpl",
"(",
")",
".",
"ref",
"(",
"ref",
")",
";",
"this",
".",
"copyVendorExtensions",
"(",
"property",
",",
"new... | Make a RefProperty
@param ref new property name
@param property Property
@return | [
"Make",
"a",
"RefProperty"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.openapi/src/com/ibm/ws/microprofile/openapi/impl/parser/util/InlineModelResolver.java#L486-L491 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/FullTextLinkList.java | FullTextLinkList.setFullTextLinks | public void setFullTextLinks(int i, FullTextLink v) {
"""
indexed setter for fullTextLinks - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (FullTextLinkList_Type.featOkTst && ((FullTextLinkList_Type)jcasType).casFeat_fullTextLinks == n... | java | public void setFullTextLinks(int i, FullTextLink v) {
if (FullTextLinkList_Type.featOkTst && ((FullTextLinkList_Type)jcasType).casFeat_fullTextLinks == null)
jcasType.jcas.throwFeatMissing("fullTextLinks", "de.julielab.jules.types.FullTextLinkList");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getR... | [
"public",
"void",
"setFullTextLinks",
"(",
"int",
"i",
",",
"FullTextLink",
"v",
")",
"{",
"if",
"(",
"FullTextLinkList_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"FullTextLinkList_Type",
")",
"jcasType",
")",
".",
"casFeat_fullTextLinks",
"==",
"null",
")",
"jc... | indexed setter for fullTextLinks - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"fullTextLinks",
"-",
"sets",
"an",
"indexed",
"value",
"-"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/FullTextLinkList.java#L116-L120 |
Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/DeepRecordReader.java | DeepRecordReader.getPartitionKey | private ByteBuffer getPartitionKey(List<Pair<String, Serializable>> equalsList, Serializable inValue) {
"""
Builds the partition key in {@link ByteBuffer} format for the given values.
@param equalsList List of equals field and value pairs.
@param inValue Value for the operator in.
@return with the partitio... | java | private ByteBuffer getPartitionKey(List<Pair<String, Serializable>> equalsList, Serializable inValue) {
assert (equalsList.size() + 1) == ((CompositeType) keyValidator).componentsCount();
ByteBuffer[] serialized = new ByteBuffer[equalsList.size() + 1];
for (int i = 0; i < equalsList.size(); i+... | [
"private",
"ByteBuffer",
"getPartitionKey",
"(",
"List",
"<",
"Pair",
"<",
"String",
",",
"Serializable",
">",
">",
"equalsList",
",",
"Serializable",
"inValue",
")",
"{",
"assert",
"(",
"equalsList",
".",
"size",
"(",
")",
"+",
"1",
")",
"==",
"(",
"(",... | Builds the partition key in {@link ByteBuffer} format for the given values.
@param equalsList List of equals field and value pairs.
@param inValue Value for the operator in.
@return with the partition key. | [
"Builds",
"the",
"partition",
"key",
"in",
"{",
"@link",
"ByteBuffer",
"}",
"format",
"for",
"the",
"given",
"values",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/DeepRecordReader.java#L741-L754 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java | QueryParameters.updatePosition | public QueryParameters updatePosition(String key, Integer position) {
"""
Updates position of specified key
@param key Key
@param position Position
@return this instance of QueryParameters
"""
while (this.order.size() < position + 1) {
this.order.add(null);
}
... | java | public QueryParameters updatePosition(String key, Integer position) {
while (this.order.size() < position + 1) {
this.order.add(null);
}
this.order.set(position, processKey(key));
return this;
} | [
"public",
"QueryParameters",
"updatePosition",
"(",
"String",
"key",
",",
"Integer",
"position",
")",
"{",
"while",
"(",
"this",
".",
"order",
".",
"size",
"(",
")",
"<",
"position",
"+",
"1",
")",
"{",
"this",
".",
"order",
".",
"add",
"(",
"null",
... | Updates position of specified key
@param key Key
@param position Position
@return this instance of QueryParameters | [
"Updates",
"position",
"of",
"specified",
"key"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java#L314-L322 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/clustering/LinkClustering.java | LinkClustering.getEdgeSimilarity | protected double getEdgeSimilarity(SparseMatrix sm, Edge e1, Edge e2) {
"""
Computes the similarity of the two edges as the Jaccard index of the
neighbors of two impost nodes. The impost nodes are the two nodes the
edges do not have in common. Subclasses may override this method to
define a new method for com... | java | protected double getEdgeSimilarity(SparseMatrix sm, Edge e1, Edge e2) {
// Determing the keystone (shared) node by the edges and the other two
// impost (unshared) nodes.
int keystone = -1;
int impost1 = -1;
int impost2 = -1;
if (e1.from == e2.from) {
keystone... | [
"protected",
"double",
"getEdgeSimilarity",
"(",
"SparseMatrix",
"sm",
",",
"Edge",
"e1",
",",
"Edge",
"e2",
")",
"{",
"// Determing the keystone (shared) node by the edges and the other two",
"// impost (unshared) nodes.",
"int",
"keystone",
"=",
"-",
"1",
";",
"int",
... | Computes the similarity of the two edges as the Jaccard index of the
neighbors of two impost nodes. The impost nodes are the two nodes the
edges do not have in common. Subclasses may override this method to
define a new method for computing edge similarity.
<p><i>Implementation Note</i>: Subclasses that wish to over... | [
"Computes",
"the",
"similarity",
"of",
"the",
"two",
"edges",
"as",
"the",
"Jaccard",
"index",
"of",
"the",
"neighbors",
"of",
"two",
"impost",
"nodes",
".",
"The",
"impost",
"nodes",
"are",
"the",
"two",
"nodes",
"the",
"edges",
"do",
"not",
"have",
"in... | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/clustering/LinkClustering.java#L451-L485 |
pippo-java/pippo | pippo-controller-parent/pippo-spring/src/main/java/ro/pippo/spring/SpringControllerFactory.java | SpringControllerFactory.createBeanDefinition | protected BeanDefinition createBeanDefinition(Class<? extends Controller> controllerClass) {
"""
Created a bean definition for a class.
Optionally configure all bean properties, like scope, prototype/singleton, etc using:
<p/>
<pre>
BeanDefinition definition = super.createBeanDefinition(beanClass);
definitio... | java | protected BeanDefinition createBeanDefinition(Class<? extends Controller> controllerClass) {
// optionally configure all bean properties, like scope, prototype/singleton, etc
// return new RootBeanDefinition(beanClass);
return new RootBeanDefinition(controllerClass, Autowire.BY_TYPE.value(), tru... | [
"protected",
"BeanDefinition",
"createBeanDefinition",
"(",
"Class",
"<",
"?",
"extends",
"Controller",
">",
"controllerClass",
")",
"{",
"// optionally configure all bean properties, like scope, prototype/singleton, etc",
"// return new RootBeanDefinition(beanClass);",
"return"... | Created a bean definition for a class.
Optionally configure all bean properties, like scope, prototype/singleton, etc using:
<p/>
<pre>
BeanDefinition definition = super.createBeanDefinition(beanClass);
definition.setScope(BeanDefinition.SCOPE_SINGLETON);
return definition;
</pre>
@param controllerClass
@return | [
"Created",
"a",
"bean",
"definition",
"for",
"a",
"class",
".",
"Optionally",
"configure",
"all",
"bean",
"properties",
"like",
"scope",
"prototype",
"/",
"singleton",
"etc",
"using",
":",
"<p",
"/",
">",
"<pre",
">",
"BeanDefinition",
"definition",
"=",
"su... | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-controller-parent/pippo-spring/src/main/java/ro/pippo/spring/SpringControllerFactory.java#L81-L85 |
overturetool/overture | core/pog/src/main/java/org/overture/pog/visitors/PatternToExpVisitor.java | PatternToExpVisitor.pattern2DummyDef | private ALocalDefinition pattern2DummyDef(PPattern pat) {
"""
/*
VarExps in the CGP need a corresponding vardef or it crashes. So we add dummy definitions to avoid the crash. The
definition is never needed for anything.
"""
ALocalDefinition r = AstFactory.newALocalDefinition(null, new LexNameToken("", "", ... | java | private ALocalDefinition pattern2DummyDef(PPattern pat)
{
ALocalDefinition r = AstFactory.newALocalDefinition(null, new LexNameToken("", "", pat.getLocation().clone()), NameScope.LOCAL, new AUnknownType());
return r;
} | [
"private",
"ALocalDefinition",
"pattern2DummyDef",
"(",
"PPattern",
"pat",
")",
"{",
"ALocalDefinition",
"r",
"=",
"AstFactory",
".",
"newALocalDefinition",
"(",
"null",
",",
"new",
"LexNameToken",
"(",
"\"\"",
",",
"\"\"",
",",
"pat",
".",
"getLocation",
"(",
... | /*
VarExps in the CGP need a corresponding vardef or it crashes. So we add dummy definitions to avoid the crash. The
definition is never needed for anything. | [
"/",
"*",
"VarExps",
"in",
"the",
"CGP",
"need",
"a",
"corresponding",
"vardef",
"or",
"it",
"crashes",
".",
"So",
"we",
"add",
"dummy",
"definitions",
"to",
"avoid",
"the",
"crash",
".",
"The",
"definition",
"is",
"never",
"needed",
"for",
"anything",
"... | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/pog/src/main/java/org/overture/pog/visitors/PatternToExpVisitor.java#L315-L319 |
shekhargulati/strman-java | src/main/java/strman/Strman.java | Strman.ensureRight | public static String ensureRight(final String value, final String suffix) {
"""
Ensures that the value ends with suffix. If it doesn't, it's appended. This operation is case sensitive.
@param value The input String
@param suffix The substr to be ensured to be right
@return The string which is guarenteed to s... | java | public static String ensureRight(final String value, final String suffix) {
return ensureRight(value, suffix, true);
} | [
"public",
"static",
"String",
"ensureRight",
"(",
"final",
"String",
"value",
",",
"final",
"String",
"suffix",
")",
"{",
"return",
"ensureRight",
"(",
"value",
",",
"suffix",
",",
"true",
")",
";",
"}"
] | Ensures that the value ends with suffix. If it doesn't, it's appended. This operation is case sensitive.
@param value The input String
@param suffix The substr to be ensured to be right
@return The string which is guarenteed to start with substr | [
"Ensures",
"that",
"the",
"value",
"ends",
"with",
"suffix",
".",
"If",
"it",
"doesn",
"t",
"it",
"s",
"appended",
".",
"This",
"operation",
"is",
"case",
"sensitive",
"."
] | train | https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L391-L393 |
eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/PropositionCopier.java | PropositionCopier.visit | @Override
public void visit(PrimitiveParameter primitiveParameter) {
"""
Creates a derived primitive parameter with the id specified in the
constructor and the same characteristics (e.g., data source type,
interval, value, etc.).
@param primitiveParameter a {@link PrimitiveParameter}. Cannot be
<code>nul... | java | @Override
public void visit(PrimitiveParameter primitiveParameter) {
assert this.kh != null : "kh wasn't set";
PrimitiveParameter param = new PrimitiveParameter(propId, this.uniqueIdProvider.getInstance());
param.setPosition(primitiveParameter.getPosition());
param.setGranularity(pri... | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"PrimitiveParameter",
"primitiveParameter",
")",
"{",
"assert",
"this",
".",
"kh",
"!=",
"null",
":",
"\"kh wasn't set\"",
";",
"PrimitiveParameter",
"param",
"=",
"new",
"PrimitiveParameter",
"(",
"propId",
",",
... | Creates a derived primitive parameter with the id specified in the
constructor and the same characteristics (e.g., data source type,
interval, value, etc.).
@param primitiveParameter a {@link PrimitiveParameter}. Cannot be
<code>null</code>. | [
"Creates",
"a",
"derived",
"primitive",
"parameter",
"with",
"the",
"id",
"specified",
"in",
"the",
"constructor",
"and",
"the",
"same",
"characteristics",
"(",
"e",
".",
"g",
".",
"data",
"source",
"type",
"interval",
"value",
"etc",
".",
")",
"."
] | train | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/PropositionCopier.java#L156-L168 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/AnalysisCache.java | AnalysisCache.reuseClassAnalysis | public <E> void reuseClassAnalysis(Class<E> analysisClass, Map<ClassDescriptor, Object> map) {
"""
Adds the data for given analysis type from given map to the cache
@param analysisClass non null analysis type
@param map non null, pre-filled map with analysis data for given type
"""
Map<ClassDescripto... | java | public <E> void reuseClassAnalysis(Class<E> analysisClass, Map<ClassDescriptor, Object> map) {
Map<ClassDescriptor, Object> myMap = classAnalysisMap.get(analysisClass);
if (myMap != null) {
myMap.putAll(map);
} else {
myMap = createMap(classAnalysisEngineMap, analysisClas... | [
"public",
"<",
"E",
">",
"void",
"reuseClassAnalysis",
"(",
"Class",
"<",
"E",
">",
"analysisClass",
",",
"Map",
"<",
"ClassDescriptor",
",",
"Object",
">",
"map",
")",
"{",
"Map",
"<",
"ClassDescriptor",
",",
"Object",
">",
"myMap",
"=",
"classAnalysisMap... | Adds the data for given analysis type from given map to the cache
@param analysisClass non null analysis type
@param map non null, pre-filled map with analysis data for given type | [
"Adds",
"the",
"data",
"for",
"given",
"analysis",
"type",
"from",
"given",
"map",
"to",
"the",
"cache"
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/AnalysisCache.java#L227-L236 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | FSNamesystem.saveNamespace | void saveNamespace(boolean force, boolean uncompressed) throws AccessControlException, IOException {
"""
Save namespace image.
This will save current namespace into fsimage file and empty edits file.
Requires superuser privilege and safe mode.
@param force if true, then the namenode need not already be in saf... | java | void saveNamespace(boolean force, boolean uncompressed) throws AccessControlException, IOException {
LOG.info("Saving namespace");
writeLock();
try {
checkSuperuserPrivilege();
if(!force && !isInSafeMode()) {
throw new IOException("Safe mode should be turned ON " +
"in order to... | [
"void",
"saveNamespace",
"(",
"boolean",
"force",
",",
"boolean",
"uncompressed",
")",
"throws",
"AccessControlException",
",",
"IOException",
"{",
"LOG",
".",
"info",
"(",
"\"Saving namespace\"",
")",
";",
"writeLock",
"(",
")",
";",
"try",
"{",
"checkSuperuser... | Save namespace image.
This will save current namespace into fsimage file and empty edits file.
Requires superuser privilege and safe mode.
@param force if true, then the namenode need not already be in safemode.
@throws AccessControlException if superuser privilege is violated.
@throws IOException if | [
"Save",
"namespace",
"image",
".",
"This",
"will",
"save",
"current",
"namespace",
"into",
"fsimage",
"file",
"and",
"empty",
"edits",
"file",
".",
"Requires",
"superuser",
"privilege",
"and",
"safe",
"mode",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L7862-L7876 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java | ApiOvhDbaaslogs.serviceName_input_inputId_action_GET | public ArrayList<OvhInputAction> serviceName_input_inputId_action_GET(String serviceName, String inputId) throws IOException {
"""
Returns actions of specified input
REST: GET /dbaas/logs/{serviceName}/input/{inputId}/action
@param serviceName [required] Service name
@param inputId [required] Input ID
"""... | java | public ArrayList<OvhInputAction> serviceName_input_inputId_action_GET(String serviceName, String inputId) throws IOException {
String qPath = "/dbaas/logs/{serviceName}/input/{inputId}/action";
StringBuilder sb = path(qPath, serviceName, inputId);
String resp = exec(qPath, "GET", sb.toString(), null);
return co... | [
"public",
"ArrayList",
"<",
"OvhInputAction",
">",
"serviceName_input_inputId_action_GET",
"(",
"String",
"serviceName",
",",
"String",
"inputId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dbaas/logs/{serviceName}/input/{inputId}/action\"",
";",
"String... | Returns actions of specified input
REST: GET /dbaas/logs/{serviceName}/input/{inputId}/action
@param serviceName [required] Service name
@param inputId [required] Input ID | [
"Returns",
"actions",
"of",
"specified",
"input"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java#L543-L548 |
dickschoeller/gedbrowser | gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/BirthDateFromParentsEstimator.java | BirthDateFromParentsEstimator.parentDateIncrement | private LocalDate parentDateIncrement(final LocalDate date) {
"""
Adjust the given date by age of parent at first child.
@param date the input date
@return the adjusted date
"""
final int years = typicals.ageAtMarriage()
+ typicals.gapBetweenChildren();
return plusYearsAdjus... | java | private LocalDate parentDateIncrement(final LocalDate date) {
final int years = typicals.ageAtMarriage()
+ typicals.gapBetweenChildren();
return plusYearsAdjustToBegin(date, years);
} | [
"private",
"LocalDate",
"parentDateIncrement",
"(",
"final",
"LocalDate",
"date",
")",
"{",
"final",
"int",
"years",
"=",
"typicals",
".",
"ageAtMarriage",
"(",
")",
"+",
"typicals",
".",
"gapBetweenChildren",
"(",
")",
";",
"return",
"plusYearsAdjustToBegin",
"... | Adjust the given date by age of parent at first child.
@param date the input date
@return the adjusted date | [
"Adjust",
"the",
"given",
"date",
"by",
"age",
"of",
"parent",
"at",
"first",
"child",
"."
] | train | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/BirthDateFromParentsEstimator.java#L71-L75 |
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-core/src/main/java/com/ibm/cloud/objectstorage/internal/http/JsonErrorCodeParser.java | JsonErrorCodeParser.parseErrorCodeFromHeader | private String parseErrorCodeFromHeader(Map<String, String> httpHeaders) {
"""
Attempt to parse the error code from the response headers. Returns null if information is not
present in the header.
"""
String headerValue = httpHeaders.get(X_AMZN_ERROR_TYPE);
if (headerValue != null) {
... | java | private String parseErrorCodeFromHeader(Map<String, String> httpHeaders) {
String headerValue = httpHeaders.get(X_AMZN_ERROR_TYPE);
if (headerValue != null) {
int separator = headerValue.indexOf(':');
if (separator != -1) {
headerValue = headerValue.substring(0, s... | [
"private",
"String",
"parseErrorCodeFromHeader",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"httpHeaders",
")",
"{",
"String",
"headerValue",
"=",
"httpHeaders",
".",
"get",
"(",
"X_AMZN_ERROR_TYPE",
")",
";",
"if",
"(",
"headerValue",
"!=",
"null",
")",
... | Attempt to parse the error code from the response headers. Returns null if information is not
present in the header. | [
"Attempt",
"to",
"parse",
"the",
"error",
"code",
"from",
"the",
"response",
"headers",
".",
"Returns",
"null",
"if",
"information",
"is",
"not",
"present",
"in",
"the",
"header",
"."
] | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-core/src/main/java/com/ibm/cloud/objectstorage/internal/http/JsonErrorCodeParser.java#L63-L72 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/RolesInner.java | RolesInner.createOrUpdate | public RoleInner createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role) {
"""
Create or update a role.
@param deviceName The device name.
@param name The role name.
@param resourceGroupName The resource group name.
@param role The role properties.
@throws IllegalArgumentExc... | java | public RoleInner createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role) {
return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, role).toBlocking().last().body();
} | [
"public",
"RoleInner",
"createOrUpdate",
"(",
"String",
"deviceName",
",",
"String",
"name",
",",
"String",
"resourceGroupName",
",",
"RoleInner",
"role",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"deviceName",
",",
"name",
",",
"resourceGroup... | Create or update a role.
@param deviceName The device name.
@param name The role name.
@param resourceGroupName The resource group name.
@param role The role properties.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws ... | [
"Create",
"or",
"update",
"a",
"role",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/RolesInner.java#L322-L324 |
Impetus/Kundera | src/kundera-couchbase/src/main/java/com/impetus/client/couchbase/CouchbaseBucketUtils.java | CouchbaseBucketUtils.openBucket | public static Bucket openBucket(CouchbaseCluster cluster, String name, String password) {
"""
Open bucket.
@param cluster
the cluster
@param name
the name
@param password
the password
@return the bucket
"""
if (cluster == null)
{
throw new KunderaException("CouchbaseCluster... | java | public static Bucket openBucket(CouchbaseCluster cluster, String name, String password)
{
if (cluster == null)
{
throw new KunderaException("CouchbaseCluster object can't be null");
}
try
{
Bucket bucket;
if (password != null && !password.t... | [
"public",
"static",
"Bucket",
"openBucket",
"(",
"CouchbaseCluster",
"cluster",
",",
"String",
"name",
",",
"String",
"password",
")",
"{",
"if",
"(",
"cluster",
"==",
"null",
")",
"{",
"throw",
"new",
"KunderaException",
"(",
"\"CouchbaseCluster object can't be n... | Open bucket.
@param cluster
the cluster
@param name
the name
@param password
the password
@return the bucket | [
"Open",
"bucket",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchbase/src/main/java/com/impetus/client/couchbase/CouchbaseBucketUtils.java#L41-L67 |
palatable/lambda | src/main/java/com/jnape/palatable/lambda/adt/Either.java | Either.trying | public static <T extends Throwable, R> Either<T, R> trying(CheckedSupplier<T, R> supplier) {
"""
Attempt to execute the {@link CheckedSupplier}, returning its result in a right value. If the supplier throws an
exception, wrap it in a left value and return it.
@param supplier the supplier of the right value
@p... | java | public static <T extends Throwable, R> Either<T, R> trying(CheckedSupplier<T, R> supplier) {
return trying(supplier, id());
} | [
"public",
"static",
"<",
"T",
"extends",
"Throwable",
",",
"R",
">",
"Either",
"<",
"T",
",",
"R",
">",
"trying",
"(",
"CheckedSupplier",
"<",
"T",
",",
"R",
">",
"supplier",
")",
"{",
"return",
"trying",
"(",
"supplier",
",",
"id",
"(",
")",
")",
... | Attempt to execute the {@link CheckedSupplier}, returning its result in a right value. If the supplier throws an
exception, wrap it in a left value and return it.
@param supplier the supplier of the right value
@param <T> the left parameter type (the most contravariant exception that supplier might throw)
@param ... | [
"Attempt",
"to",
"execute",
"the",
"{",
"@link",
"CheckedSupplier",
"}",
"returning",
"its",
"result",
"in",
"a",
"right",
"value",
".",
"If",
"the",
"supplier",
"throws",
"an",
"exception",
"wrap",
"it",
"in",
"a",
"left",
"value",
"and",
"return",
"it",
... | train | https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/adt/Either.java#L346-L348 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPFriendlyURLEntryPersistenceImpl.java | CPFriendlyURLEntryPersistenceImpl.removeByUuid_C | @Override
public void removeByUuid_C(String uuid, long companyId) {
"""
Removes all the cp friendly url entries where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID
"""
for (CPFriendlyURLEntry cpFriendlyURLEntry : findByUuid_C(uuid,
company... | java | @Override
public void removeByUuid_C(String uuid, long companyId) {
for (CPFriendlyURLEntry cpFriendlyURLEntry : findByUuid_C(uuid,
companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpFriendlyURLEntry);
}
} | [
"@",
"Override",
"public",
"void",
"removeByUuid_C",
"(",
"String",
"uuid",
",",
"long",
"companyId",
")",
"{",
"for",
"(",
"CPFriendlyURLEntry",
"cpFriendlyURLEntry",
":",
"findByUuid_C",
"(",
"uuid",
",",
"companyId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"... | Removes all the cp friendly url entries where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID | [
"Removes",
"all",
"the",
"cp",
"friendly",
"url",
"entries",
"where",
"uuid",
"=",
"?",
";",
"and",
"companyId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPFriendlyURLEntryPersistenceImpl.java#L1411-L1417 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PathNormalizer.java | PathNormalizer.getRelativePath | public static final String getRelativePath(String basedir, String filename) {
"""
Determines the relative path of a filename from a base directory. This
method is useful in building relative links within pages of a web site.
It provides similar functionality to Anakia's <code>$relativePath</code>
context variab... | java | public static final String getRelativePath(String basedir, String filename) {
String basedirPath = uppercaseDrive(basedir);
String filenamePath = uppercaseDrive(filename);
/*
* Verify the arguments and make sure the filename is relative to the
* base directory.
*/
if (basedirPath == null || basedirPat... | [
"public",
"static",
"final",
"String",
"getRelativePath",
"(",
"String",
"basedir",
",",
"String",
"filename",
")",
"{",
"String",
"basedirPath",
"=",
"uppercaseDrive",
"(",
"basedir",
")",
";",
"String",
"filenamePath",
"=",
"uppercaseDrive",
"(",
"filename",
"... | Determines the relative path of a filename from a base directory. This
method is useful in building relative links within pages of a web site.
It provides similar functionality to Anakia's <code>$relativePath</code>
context variable. The arguments to this method may contain either forward
or backward slashes as file se... | [
"Determines",
"the",
"relative",
"path",
"of",
"a",
"filename",
"from",
"a",
"base",
"directory",
".",
"This",
"method",
"is",
"useful",
"in",
"building",
"relative",
"links",
"within",
"pages",
"of",
"a",
"web",
"site",
".",
"It",
"provides",
"similar",
"... | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PathNormalizer.java#L560-L590 |
jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java | ShExGenerator.genChoiceTypes | private String genChoiceTypes(StructureDefinition sd, ElementDefinition ed, String id) {
"""
Generate a list of type choices for a "name[x]" style id
@param sd Structure containing ed
@param ed element definition
@param id choice identifier
@return ShEx fragment for the set of choices
"""
List<String>... | java | private String genChoiceTypes(StructureDefinition sd, ElementDefinition ed, String id) {
List<String> choiceEntries = new ArrayList<String>();
String base = id.replace("[x]", "");
for(ElementDefinition.TypeRefComponent typ : ed.getType())
choiceEntries.add(genChoiceEntry(sd, ed, id, base, typ));... | [
"private",
"String",
"genChoiceTypes",
"(",
"StructureDefinition",
"sd",
",",
"ElementDefinition",
"ed",
",",
"String",
"id",
")",
"{",
"List",
"<",
"String",
">",
"choiceEntries",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"String",
"base",... | Generate a list of type choices for a "name[x]" style id
@param sd Structure containing ed
@param ed element definition
@param id choice identifier
@return ShEx fragment for the set of choices | [
"Generate",
"a",
"list",
"of",
"type",
"choices",
"for",
"a",
"name",
"[",
"x",
"]",
"style",
"id"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java#L652-L660 |
google/gson | codegen/src/main/java/com/google/gson/codegen/JavaWriter.java | JavaWriter.beginMethod | public void beginMethod(String returnType, String name, int modifiers, String... parameters)
throws IOException {
"""
Emit a method declaration.
@param returnType the method's return type, or null for constructors.
@param parameters alternating parameter types and names.
@param name the method name, or ... | java | public void beginMethod(String returnType, String name, int modifiers, String... parameters)
throws IOException {
indent();
modifiers(modifiers);
if (returnType != null) {
type(returnType);
out.write(" ");
out.write(name);
} else {
type(name);
}
out.write("(");
... | [
"public",
"void",
"beginMethod",
"(",
"String",
"returnType",
",",
"String",
"name",
",",
"int",
"modifiers",
",",
"String",
"...",
"parameters",
")",
"throws",
"IOException",
"{",
"indent",
"(",
")",
";",
"modifiers",
"(",
"modifiers",
")",
";",
"if",
"("... | Emit a method declaration.
@param returnType the method's return type, or null for constructors.
@param parameters alternating parameter types and names.
@param name the method name, or the fully qualified class name for
constructors. | [
"Emit",
"a",
"method",
"declaration",
"."
] | train | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/codegen/src/main/java/com/google/gson/codegen/JavaWriter.java#L213-L241 |
OpenTSDB/opentsdb | src/tree/Tree.java | Tree.getRule | public TreeRule getRule(final int level, final int order) {
"""
Retrieves a single rule from the rule set given a level and order
@param level The level where the rule resides
@param order The order in the level where the rule resides
@return The rule if found, null if not found
"""
if (rules == null ||... | java | public TreeRule getRule(final int level, final int order) {
if (rules == null || rules.isEmpty()) {
return null;
}
TreeMap<Integer, TreeRule> rule_level = rules.get(level);
if (rule_level == null || rule_level.isEmpty()) {
return null;
}
return rule_level.get(order);
} | [
"public",
"TreeRule",
"getRule",
"(",
"final",
"int",
"level",
",",
"final",
"int",
"order",
")",
"{",
"if",
"(",
"rules",
"==",
"null",
"||",
"rules",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"TreeMap",
"<",
"Integer",
",",
... | Retrieves a single rule from the rule set given a level and order
@param level The level where the rule resides
@param order The order in the level where the rule resides
@return The rule if found, null if not found | [
"Retrieves",
"a",
"single",
"rule",
"from",
"the",
"rule",
"set",
"given",
"a",
"level",
"and",
"order"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tree/Tree.java#L383-L394 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java | AccountsInner.createAsync | public Observable<DataLakeAnalyticsAccountInner> createAsync(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters) {
"""
Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads.
@param resourceGroupName The ... | java | public Observable<DataLakeAnalyticsAccountInner> createAsync(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters) {
return createWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1<ServiceResponse<DataLakeAnalyticsAccountInner>, DataLakeAnalyticsAccountInner>(... | [
"public",
"Observable",
"<",
"DataLakeAnalyticsAccountInner",
">",
"createAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"DataLakeAnalyticsAccountInner",
"parameters",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"resourceGroupName",
"... | Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.the account will be associated with.
@param name The name of the Data Lake A... | [
"Creates",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
".",
"This",
"supplies",
"the",
"user",
"with",
"computation",
"services",
"for",
"Data",
"Lake",
"Analytics",
"workloads",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java#L2625-L2632 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java | StreamSegmentReadIndex.triggerFutureReads | private void triggerFutureReads(Collection<FutureReadResultEntry> futureReads) {
"""
Triggers all the Future Reads in the given collection.
@param futureReads The Future Reads to trigger.
"""
for (FutureReadResultEntry r : futureReads) {
ReadResultEntry entry = getSingleReadResultEntry(r... | java | private void triggerFutureReads(Collection<FutureReadResultEntry> futureReads) {
for (FutureReadResultEntry r : futureReads) {
ReadResultEntry entry = getSingleReadResultEntry(r.getStreamSegmentOffset(), r.getRequestedReadLength());
assert entry != null : "Serving a StorageReadResultEntr... | [
"private",
"void",
"triggerFutureReads",
"(",
"Collection",
"<",
"FutureReadResultEntry",
">",
"futureReads",
")",
"{",
"for",
"(",
"FutureReadResultEntry",
"r",
":",
"futureReads",
")",
"{",
"ReadResultEntry",
"entry",
"=",
"getSingleReadResultEntry",
"(",
"r",
"."... | Triggers all the Future Reads in the given collection.
@param futureReads The Future Reads to trigger. | [
"Triggers",
"all",
"the",
"Future",
"Reads",
"in",
"the",
"given",
"collection",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L578-L604 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/GrahamScanConvexHull2D.java | GrahamScanConvexHull2D.getHull | public Polygon getHull() {
"""
Compute the convex hull, and return the resulting polygon.
@return Polygon of the hull
"""
if(!ok) {
computeConvexHull();
}
return new Polygon(points, minmaxX.getMin(), minmaxX.getMax(), minmaxY.getMin(), minmaxY.getMax());
} | java | public Polygon getHull() {
if(!ok) {
computeConvexHull();
}
return new Polygon(points, minmaxX.getMin(), minmaxX.getMax(), minmaxY.getMin(), minmaxY.getMax());
} | [
"public",
"Polygon",
"getHull",
"(",
")",
"{",
"if",
"(",
"!",
"ok",
")",
"{",
"computeConvexHull",
"(",
")",
";",
"}",
"return",
"new",
"Polygon",
"(",
"points",
",",
"minmaxX",
".",
"getMin",
"(",
")",
",",
"minmaxX",
".",
"getMax",
"(",
")",
","... | Compute the convex hull, and return the resulting polygon.
@return Polygon of the hull | [
"Compute",
"the",
"convex",
"hull",
"and",
"return",
"the",
"resulting",
"polygon",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/GrahamScanConvexHull2D.java#L267-L272 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/LazyList.java | LazyList.getList | public static List getList(Object list, boolean nullForEmpty) {
"""
Get the real List from a LazyList.
@param list A LazyList returned from LazyList.add(Object) or null
@param nullForEmpty If true, null is returned instead of an
empty list.
@return The List of added items, which may be null, an EMPTY_LIST
o... | java | public static List getList(Object list, boolean nullForEmpty)
{
if (list==null)
return nullForEmpty?null:Collections.EMPTY_LIST;
if (list instanceof List)
return (List)list;
List l = new ArrayList(1);
l.add(list);
return l;
} | [
"public",
"static",
"List",
"getList",
"(",
"Object",
"list",
",",
"boolean",
"nullForEmpty",
")",
"{",
"if",
"(",
"list",
"==",
"null",
")",
"return",
"nullForEmpty",
"?",
"null",
":",
"Collections",
".",
"EMPTY_LIST",
";",
"if",
"(",
"list",
"instanceof"... | Get the real List from a LazyList.
@param list A LazyList returned from LazyList.add(Object) or null
@param nullForEmpty If true, null is returned instead of an
empty list.
@return The List of added items, which may be null, an EMPTY_LIST
or a SingletonList. | [
"Get",
"the",
"real",
"List",
"from",
"a",
"LazyList",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/LazyList.java#L225-L235 |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/model/DateTime.java | DateTime.setTimeZone | public final void setTimeZone(final TimeZone timezone) {
"""
Sets the timezone associated with this date-time instance. If the
specified timezone is null, it will reset to the default timezone. If the
date-time instance is utc, it will turn into either a floating (no
timezone) date-time, or a date-time with a t... | java | public final void setTimeZone(final TimeZone timezone) {
this.timezone = timezone;
if (timezone != null) {
getFormat().setTimeZone(timezone);
} else {
resetTimeZone();
}
time = new Time(time, getFormat().getTimeZone(), false);
} | [
"public",
"final",
"void",
"setTimeZone",
"(",
"final",
"TimeZone",
"timezone",
")",
"{",
"this",
".",
"timezone",
"=",
"timezone",
";",
"if",
"(",
"timezone",
"!=",
"null",
")",
"{",
"getFormat",
"(",
")",
".",
"setTimeZone",
"(",
"timezone",
")",
";",
... | Sets the timezone associated with this date-time instance. If the
specified timezone is null, it will reset to the default timezone. If the
date-time instance is utc, it will turn into either a floating (no
timezone) date-time, or a date-time with a timezone.
@param timezone
a timezone to apply to the instance | [
"Sets",
"the",
"timezone",
"associated",
"with",
"this",
"date",
"-",
"time",
"instance",
".",
"If",
"the",
"specified",
"timezone",
"is",
"null",
"it",
"will",
"reset",
"to",
"the",
"default",
"timezone",
".",
"If",
"the",
"date",
"-",
"time",
"instance",... | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/model/DateTime.java#L465-L473 |
Cleveroad/AdaptiveTableLayout | library/src/main/java/com/cleveroad/adaptivetablelayout/BaseDataAdaptiveTableLayoutAdapter.java | BaseDataAdaptiveTableLayoutAdapter.switchTwoRows | void switchTwoRows(int rowIndex, int rowToIndex) {
"""
Switch 2 rows with data
@param rowIndex row from
@param rowToIndex row to
"""
for (int i = 0; i < getItems().length; i++) {
Object cellData = getItems()[rowToIndex][i];
getItems()[rowToIndex][i] = getItems()[rowIndex][... | java | void switchTwoRows(int rowIndex, int rowToIndex) {
for (int i = 0; i < getItems().length; i++) {
Object cellData = getItems()[rowToIndex][i];
getItems()[rowToIndex][i] = getItems()[rowIndex][i];
getItems()[rowIndex][i] = cellData;
}
} | [
"void",
"switchTwoRows",
"(",
"int",
"rowIndex",
",",
"int",
"rowToIndex",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"getItems",
"(",
")",
".",
"length",
";",
"i",
"++",
")",
"{",
"Object",
"cellData",
"=",
"getItems",
"(",
")",
... | Switch 2 rows with data
@param rowIndex row from
@param rowToIndex row to | [
"Switch",
"2",
"rows",
"with",
"data"
] | train | https://github.com/Cleveroad/AdaptiveTableLayout/blob/188213b35e05e635497b03fe741799782dde7208/library/src/main/java/com/cleveroad/adaptivetablelayout/BaseDataAdaptiveTableLayoutAdapter.java#L71-L77 |
hansenji/pocketknife | pocketknife/src/main/java/pocketknife/PocketKnife.java | PocketKnife.bindArguments | public static <T> void bindArguments(T target, Bundle bundle) {
"""
Bind annotated fields in the specified {@code target} from the {@link android.os.Bundle}.
@param target Target object for bind arguments
@param bundle Bundle containing arguments;
"""
@SuppressWarnings("unchecked")
BundleBi... | java | public static <T> void bindArguments(T target, Bundle bundle) {
@SuppressWarnings("unchecked")
BundleBinding<T> binding = (BundleBinding<T>) getBundleBinding(target.getClass().getClassLoader(), target.getClass());
if (binding != null) {
binding.bindArguments(target, bundle);
... | [
"public",
"static",
"<",
"T",
">",
"void",
"bindArguments",
"(",
"T",
"target",
",",
"Bundle",
"bundle",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"BundleBinding",
"<",
"T",
">",
"binding",
"=",
"(",
"BundleBinding",
"<",
"T",
">",
")... | Bind annotated fields in the specified {@code target} from the {@link android.os.Bundle}.
@param target Target object for bind arguments
@param bundle Bundle containing arguments; | [
"Bind",
"annotated",
"fields",
"in",
"the",
"specified",
"{",
"@code",
"target",
"}",
"from",
"the",
"{",
"@link",
"android",
".",
"os",
".",
"Bundle",
"}",
"."
] | train | https://github.com/hansenji/pocketknife/blob/f225dd66bcafdd702f472a5c99be1fb48202e6ca/pocketknife/src/main/java/pocketknife/PocketKnife.java#L91-L97 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/resource/Delay.java | Delay.decorrelatedJitter | public static Supplier<Delay> decorrelatedJitter(Duration lower, Duration upper, long base, TimeUnit targetTimeUnit) {
"""
Creates a {@link Supplier} that constructs new {@link DecorrelatedJitterDelay} instances.
@param lower the lower boundary, must be non-negative
@param upper the upper boundary, must be gre... | java | public static Supplier<Delay> decorrelatedJitter(Duration lower, Duration upper, long base, TimeUnit targetTimeUnit) {
LettuceAssert.notNull(lower, "Lower boundary must not be null");
LettuceAssert.isTrue(lower.toNanos() >= 0, "Lower boundary must be greater or equal to 0");
LettuceAssert.notNu... | [
"public",
"static",
"Supplier",
"<",
"Delay",
">",
"decorrelatedJitter",
"(",
"Duration",
"lower",
",",
"Duration",
"upper",
",",
"long",
"base",
",",
"TimeUnit",
"targetTimeUnit",
")",
"{",
"LettuceAssert",
".",
"notNull",
"(",
"lower",
",",
"\"Lower boundary m... | Creates a {@link Supplier} that constructs new {@link DecorrelatedJitterDelay} instances.
@param lower the lower boundary, must be non-negative
@param upper the upper boundary, must be greater than the lower boundary
@param base the base, must be greater or equal to 0
@param targetTimeUnit the unit of the delay.
@retu... | [
"Creates",
"a",
"{",
"@link",
"Supplier",
"}",
"that",
"constructs",
"new",
"{",
"@link",
"DecorrelatedJitterDelay",
"}",
"instances",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/resource/Delay.java#L282-L293 |
IBM-Cloud/gp-java-client | src/main/java/com/ibm/g11n/pipeline/client/rb/CloudResourceBundleControl.java | CloudResourceBundleControl.getInstance | public static CloudResourceBundleControl getInstance(ServiceAccount serviceAccount,
long cacheExpiration) {
"""
Create an instance of <code>CloudResourceBundleControl</code> with the specified
service account and the cache expiration.
<p>
This method is equivalent to
<code>getInstance(serviceAccoun... | java | public static CloudResourceBundleControl getInstance(ServiceAccount serviceAccount,
long cacheExpiration) {
return getInstance(serviceAccount, cacheExpiration, null, null);
} | [
"public",
"static",
"CloudResourceBundleControl",
"getInstance",
"(",
"ServiceAccount",
"serviceAccount",
",",
"long",
"cacheExpiration",
")",
"{",
"return",
"getInstance",
"(",
"serviceAccount",
",",
"cacheExpiration",
",",
"null",
",",
"null",
")",
";",
"}"
] | Create an instance of <code>CloudResourceBundleControl</code> with the specified
service account and the cache expiration.
<p>
This method is equivalent to
<code>getInstance(serviceAccount, cacheExpiration, null, null, null)</code>.
@param serviceAccount The service account.
@param cacheExpiration The cache expir... | [
"Create",
"an",
"instance",
"of",
"<code",
">",
"CloudResourceBundleControl<",
"/",
"code",
">",
"with",
"the",
"specified",
"service",
"account",
"and",
"the",
"cache",
"expiration",
".",
"<p",
">",
"This",
"method",
"is",
"equivalent",
"to",
"<code",
">",
... | train | https://github.com/IBM-Cloud/gp-java-client/blob/b015a081d7a7313bc48c448087fbc07bce860427/src/main/java/com/ibm/g11n/pipeline/client/rb/CloudResourceBundleControl.java#L223-L226 |
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/transport/netty/DcpLoggingHandler.java | DcpLoggingHandler.formatByteBuf | protected String formatByteBuf(String eventName, ByteBuf msg) {
"""
Returns a String which contains all details to log the {@link ByteBuf}
"""
int length = msg.readableBytes();
if (length == 0) {
StringBuilder buf = new StringBuilder(eventName.length() + 4);
buf.append(eventName).append(": ... | java | protected String formatByteBuf(String eventName, ByteBuf msg) {
int length = msg.readableBytes();
if (length == 0) {
StringBuilder buf = new StringBuilder(eventName.length() + 4);
buf.append(eventName).append(": 0B");
return buf.toString();
} else {
return "\n" + MessageUtil.humanize... | [
"protected",
"String",
"formatByteBuf",
"(",
"String",
"eventName",
",",
"ByteBuf",
"msg",
")",
"{",
"int",
"length",
"=",
"msg",
".",
"readableBytes",
"(",
")",
";",
"if",
"(",
"length",
"==",
"0",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBu... | Returns a String which contains all details to log the {@link ByteBuf} | [
"Returns",
"a",
"String",
"which",
"contains",
"all",
"details",
"to",
"log",
"the",
"{"
] | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/transport/netty/DcpLoggingHandler.java#L97-L106 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/Flag.java | Flag.setValue | public void setValue(boolean val) {
"""
Convenience function using a native boolean, that doesn't require error
handling.
@param val boolean value
"""
try {
super.setValue(Boolean.valueOf(val));
}
catch(ParameterException e) {
// We're pretty sure that any Boolean is okay, so this s... | java | public void setValue(boolean val) {
try {
super.setValue(Boolean.valueOf(val));
}
catch(ParameterException e) {
// We're pretty sure that any Boolean is okay, so this should never be
// reached.
throw new AbortException("Flag did not accept boolean value!", e);
}
} | [
"public",
"void",
"setValue",
"(",
"boolean",
"val",
")",
"{",
"try",
"{",
"super",
".",
"setValue",
"(",
"Boolean",
".",
"valueOf",
"(",
"val",
")",
")",
";",
"}",
"catch",
"(",
"ParameterException",
"e",
")",
"{",
"// We're pretty sure that any Boolean is ... | Convenience function using a native boolean, that doesn't require error
handling.
@param val boolean value | [
"Convenience",
"function",
"using",
"a",
"native",
"boolean",
"that",
"doesn",
"t",
"require",
"error",
"handling",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/Flag.java#L109-L118 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/cellprocessor/ParseChar.java | ParseChar.execute | public Object execute(final Object value, final CsvContext context) {
"""
{@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null, isn't a Character or String, or is a String of multiple characters
"""
validateInputNotNull(value, context);
final Character result;
if( value instanceof... | java | public Object execute(final Object value, final CsvContext context) {
validateInputNotNull(value, context);
final Character result;
if( value instanceof Character ) {
result = (Character) value;
} else if( value instanceof String ) {
final String stringValue = (String) value;
if( stringValue.length(... | [
"public",
"Object",
"execute",
"(",
"final",
"Object",
"value",
",",
"final",
"CsvContext",
"context",
")",
"{",
"validateInputNotNull",
"(",
"value",
",",
"context",
")",
";",
"final",
"Character",
"result",
";",
"if",
"(",
"value",
"instanceof",
"Character",... | {@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null, isn't a Character or String, or is a String of multiple characters | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/cellprocessor/ParseChar.java#L57-L80 |
Erudika/para | para-server/src/main/java/com/erudika/para/security/SimpleAxFetchListFactory.java | SimpleAxFetchListFactory.createAttributeList | public List<OpenIDAttribute> createAttributeList(String identifier) {
"""
A list of OpenID attributes to send in a request.
@param identifier a user identifier
@return a list of attributes
"""
List<OpenIDAttribute> list = new LinkedList<>();
if (identifier != null && identifier.matches("https://www.googl... | java | public List<OpenIDAttribute> createAttributeList(String identifier) {
List<OpenIDAttribute> list = new LinkedList<>();
if (identifier != null && identifier.matches("https://www.google.com/.*")) {
OpenIDAttribute email = new OpenIDAttribute("email", "http://axschema.org/contact/email");
OpenIDAttribute first =... | [
"public",
"List",
"<",
"OpenIDAttribute",
">",
"createAttributeList",
"(",
"String",
"identifier",
")",
"{",
"List",
"<",
"OpenIDAttribute",
">",
"list",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"if",
"(",
"identifier",
"!=",
"null",
"&&",
"identifier"... | A list of OpenID attributes to send in a request.
@param identifier a user identifier
@return a list of attributes | [
"A",
"list",
"of",
"OpenID",
"attributes",
"to",
"send",
"in",
"a",
"request",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/security/SimpleAxFetchListFactory.java#L37-L52 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsUserDriver.java | CmsUserDriver.internalWriteOrgUnitProperty | protected void internalWriteOrgUnitProperty(CmsDbContext dbc, CmsResource resource, CmsProperty property)
throws CmsException {
"""
Writes a property for an organizational unit resource, online AND offline.<p>
@param dbc the current database context
@param resource the resource representing the organizatio... | java | protected void internalWriteOrgUnitProperty(CmsDbContext dbc, CmsResource resource, CmsProperty property)
throws CmsException {
CmsUUID projectId = ((dbc.getProjectId() == null) || dbc.getProjectId().isNullUUID())
? dbc.currentProject().getUuid()
: dbc.getProjectId();
// write the p... | [
"protected",
"void",
"internalWriteOrgUnitProperty",
"(",
"CmsDbContext",
"dbc",
",",
"CmsResource",
"resource",
",",
"CmsProperty",
"property",
")",
"throws",
"CmsException",
"{",
"CmsUUID",
"projectId",
"=",
"(",
"(",
"dbc",
".",
"getProjectId",
"(",
")",
"==",
... | Writes a property for an organizational unit resource, online AND offline.<p>
@param dbc the current database context
@param resource the resource representing the organizational unit
@param property the property to write
@throws CmsException if something goes wrong | [
"Writes",
"a",
"property",
"for",
"an",
"organizational",
"unit",
"resource",
"online",
"AND",
"offline",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsUserDriver.java#L2924-L2946 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java | BaseBigtableTableAdminClient.checkConsistency | public final CheckConsistencyResponse checkConsistency(String name, String consistencyToken) {
"""
Checks replication consistency based on a consistency token, that is, if replication has caught
up based on the conditions specified in the token and the check request.
<p>Sample code:
<pre><code>
try (BaseBi... | java | public final CheckConsistencyResponse checkConsistency(String name, String consistencyToken) {
CheckConsistencyRequest request =
CheckConsistencyRequest.newBuilder()
.setName(name)
.setConsistencyToken(consistencyToken)
.build();
return checkConsistency(request);
} | [
"public",
"final",
"CheckConsistencyResponse",
"checkConsistency",
"(",
"String",
"name",
",",
"String",
"consistencyToken",
")",
"{",
"CheckConsistencyRequest",
"request",
"=",
"CheckConsistencyRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
")",
... | Checks replication consistency based on a consistency token, that is, if replication has caught
up based on the conditions specified in the token and the check request.
<p>Sample code:
<pre><code>
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
TableName name ... | [
"Checks",
"replication",
"consistency",
"based",
"on",
"a",
"consistency",
"token",
"that",
"is",
"if",
"replication",
"has",
"caught",
"up",
"based",
"on",
"the",
"conditions",
"specified",
"in",
"the",
"token",
"and",
"the",
"check",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java#L1088-L1096 |
pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/StoreException.java | StoreException.create | public static StoreException create(final Type type, final Throwable cause, final String errorMessage) {
"""
Factory method to construct Store exceptions.
@param type Type of Exception.
@param cause Exception cause.
@param errorMessage The detailed error message.
@return Instance of type of... | java | public static StoreException create(final Type type, final Throwable cause, final String errorMessage) {
Preconditions.checkArgument(cause != null || (errorMessage != null && !errorMessage.isEmpty()),
"Either cause or errorMessage should be non-empty");
StoreException exception;
... | [
"public",
"static",
"StoreException",
"create",
"(",
"final",
"Type",
"type",
",",
"final",
"Throwable",
"cause",
",",
"final",
"String",
"errorMessage",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"cause",
"!=",
"null",
"||",
"(",
"errorMessage",
"!... | Factory method to construct Store exceptions.
@param type Type of Exception.
@param cause Exception cause.
@param errorMessage The detailed error message.
@return Instance of type of StoreException. | [
"Factory",
"method",
"to",
"construct",
"Store",
"exceptions",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/StoreException.java#L81-L114 |
podio/podio-java | src/main/java/com/podio/calendar/CalendarAPI.java | CalendarAPI.getApp | public List<Event> getApp(int appId, LocalDate dateFrom, LocalDate dateTo,
ReferenceType... types) {
"""
Returns the items and tasks that are related to the given app.
@param appId
The id of the app
@param dateFrom
The from date
@param dateTo
The to date
@param types
The types of events that should be... | java | public List<Event> getApp(int appId, LocalDate dateFrom, LocalDate dateTo,
ReferenceType... types) {
return getCalendar("app/" + appId, dateFrom, dateTo, null, types);
} | [
"public",
"List",
"<",
"Event",
">",
"getApp",
"(",
"int",
"appId",
",",
"LocalDate",
"dateFrom",
",",
"LocalDate",
"dateTo",
",",
"ReferenceType",
"...",
"types",
")",
"{",
"return",
"getCalendar",
"(",
"\"app/\"",
"+",
"appId",
",",
"dateFrom",
",",
"dat... | Returns the items and tasks that are related to the given app.
@param appId
The id of the app
@param dateFrom
The from date
@param dateTo
The to date
@param types
The types of events that should be returned. Leave out to get
all types of events.
@return The events in the calendar | [
"Returns",
"the",
"items",
"and",
"tasks",
"that",
"are",
"related",
"to",
"the",
"given",
"app",
"."
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/calendar/CalendarAPI.java#L63-L66 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/i18n/list/LinkListPanel.java | LinkListPanel.newAbstractLink | protected AbstractLink newAbstractLink(final String id, final LinkItem model) {
"""
Factory method for creating the new item {@link AbstractLink} in the list. This method is
invoked in the constructor from the derived classes and can be overridden so users can
provide their own version of a new item {@link Abstr... | java | protected AbstractLink newAbstractLink(final String id, final LinkItem model)
{
AttributeModifier target = null;
AbstractLink link = null;
if ((model.getTarget() != null) && !model.getTarget().isEmpty())
{
target = new AttributeModifier("target", Model.of(model.getTarget()));
}
if (model.getUrl() != nul... | [
"protected",
"AbstractLink",
"newAbstractLink",
"(",
"final",
"String",
"id",
",",
"final",
"LinkItem",
"model",
")",
"{",
"AttributeModifier",
"target",
"=",
"null",
";",
"AbstractLink",
"link",
"=",
"null",
";",
"if",
"(",
"(",
"model",
".",
"getTarget",
"... | Factory method for creating the new item {@link AbstractLink} in the list. This method is
invoked in the constructor from the derived classes and can be overridden so users can
provide their own version of a new item {@link AbstractLink} in the list.
@param id
the id
@param model
the model
@return the new item {@link ... | [
"Factory",
"method",
"for",
"creating",
"the",
"new",
"item",
"{",
"@link",
"AbstractLink",
"}",
"in",
"the",
"list",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/i18n/list/LinkListPanel.java#L96-L119 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.fatalv | public void fatalv(String format, Object param1) {
"""
Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting.
@param format the message format string
@param param1 the sole parameter
"""
if (isEnabled(Level.FATAL)) {
doLog(Level.FATAL, FQCN, fo... | java | public void fatalv(String format, Object param1) {
if (isEnabled(Level.FATAL)) {
doLog(Level.FATAL, FQCN, format, new Object[] { param1 }, null);
}
} | [
"public",
"void",
"fatalv",
"(",
"String",
"format",
",",
"Object",
"param1",
")",
"{",
"if",
"(",
"isEnabled",
"(",
"Level",
".",
"FATAL",
")",
")",
"{",
"doLog",
"(",
"Level",
".",
"FATAL",
",",
"FQCN",
",",
"format",
",",
"new",
"Object",
"[",
"... | Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting.
@param format the message format string
@param param1 the sole parameter | [
"Issue",
"a",
"log",
"message",
"with",
"a",
"level",
"of",
"FATAL",
"using",
"{",
"@link",
"java",
".",
"text",
".",
"MessageFormat",
"}",
"-",
"style",
"formatting",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L1845-L1849 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.leftShift | public static StringBuilder leftShift(StringBuilder self, Object value) {
"""
Overloads the left shift operator to provide syntactic sugar for appending to a StringBuilder.
@param self a StringBuilder
@param value an Object
@return the original StringBuilder
@since 1.8.2
"""
self.append(value);
... | java | public static StringBuilder leftShift(StringBuilder self, Object value) {
self.append(value);
return self;
} | [
"public",
"static",
"StringBuilder",
"leftShift",
"(",
"StringBuilder",
"self",
",",
"Object",
"value",
")",
"{",
"self",
".",
"append",
"(",
"value",
")",
";",
"return",
"self",
";",
"}"
] | Overloads the left shift operator to provide syntactic sugar for appending to a StringBuilder.
@param self a StringBuilder
@param value an Object
@return the original StringBuilder
@since 1.8.2 | [
"Overloads",
"the",
"left",
"shift",
"operator",
"to",
"provide",
"syntactic",
"sugar",
"for",
"appending",
"to",
"a",
"StringBuilder",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L1952-L1955 |
jcustenborder/connect-utils | connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ConfigUtils.java | ConfigUtils.getEnum | public static <T extends Enum<T>> T getEnum(Class<T> enumClass, AbstractConfig config, String key) {
"""
Method is used to return an enum value from a given string.
@param enumClass Class for the resulting enum value
@param config config to read the value from
@param key key for the value
@param <T>... | java | public static <T extends Enum<T>> T getEnum(Class<T> enumClass, AbstractConfig config, String key) {
Preconditions.checkNotNull(enumClass, "enumClass cannot be null");
Preconditions.checkState(enumClass.isEnum(), "enumClass must be an enum.");
String textValue = config.getString(key);
return Enum.valueO... | [
"public",
"static",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"getEnum",
"(",
"Class",
"<",
"T",
">",
"enumClass",
",",
"AbstractConfig",
"config",
",",
"String",
"key",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"enumClass",
",",
... | Method is used to return an enum value from a given string.
@param enumClass Class for the resulting enum value
@param config config to read the value from
@param key key for the value
@param <T> Enum class to return type for.
@return enum value for the given key.
@see ValidEnum | [
"Method",
"is",
"used",
"to",
"return",
"an",
"enum",
"value",
"from",
"a",
"given",
"string",
"."
] | train | https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ConfigUtils.java#L60-L65 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.deleteCertificateAsync | public Observable<DeletedCertificateBundle> deleteCertificateAsync(String vaultBaseUrl, String certificateName) {
"""
Deletes a certificate from a specified key vault.
Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of ... | java | public Observable<DeletedCertificateBundle> deleteCertificateAsync(String vaultBaseUrl, String certificateName) {
return deleteCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1<ServiceResponse<DeletedCertificateBundle>, DeletedCertificateBundle>() {
@Override
... | [
"public",
"Observable",
"<",
"DeletedCertificateBundle",
">",
"deleteCertificateAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
")",
"{",
"return",
"deleteCertificateWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"certificateName",
")",
".",
... | Deletes a certificate from a specified key vault.
Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission.
@param vaultBaseUrl The vault name, for e... | [
"Deletes",
"a",
"certificate",
"from",
"a",
"specified",
"key",
"vault",
".",
"Deletes",
"all",
"versions",
"of",
"a",
"certificate",
"object",
"along",
"with",
"its",
"associated",
"policy",
".",
"Delete",
"certificate",
"cannot",
"be",
"used",
"to",
"remove"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L5352-L5359 |
Pi4J/pi4j | pi4j-core/src/main/java/com/pi4j/jni/Serial.java | Serial.write | public synchronized static void write(int fd, byte[] data, int offset, int length) throws IOException {
"""
<p>Sends an array of bytes to the serial port/device identified by the given file descriptor.</p>
@param fd
The file descriptor of the serial port/device.
@param data
A ByteBuffer of data to be transmi... | java | public synchronized static void write(int fd, byte[] data, int offset, int length) throws IOException {
// we make a copy of the data argument because we don't want to modify the original source data
byte[] buffer = new byte[length];
System.arraycopy(data, offset, buffer, 0, length);
/... | [
"public",
"synchronized",
"static",
"void",
"write",
"(",
"int",
"fd",
",",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"// we make a copy of the data argument because we don't want to modify the original sour... | <p>Sends an array of bytes to the serial port/device identified by the given file descriptor.</p>
@param fd
The file descriptor of the serial port/device.
@param data
A ByteBuffer of data to be transmitted.
@param offset
The starting index (inclusive) in the array to send from.
@param length
The number of bytes from t... | [
"<p",
">",
"Sends",
"an",
"array",
"of",
"bytes",
"to",
"the",
"serial",
"port",
"/",
"device",
"identified",
"by",
"the",
"given",
"file",
"descriptor",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-core/src/main/java/com/pi4j/jni/Serial.java#L676-L684 |
SonarSource/sonarqube | server/sonar-process/src/main/java/org/sonar/process/FileUtils2.java | FileUtils2.deleteDirectory | public static void deleteDirectory(File directory) throws IOException {
"""
Deletes a directory recursively. Does not support symbolic link to directories.
@param directory directory to delete
@throws IOException in case deletion is unsuccessful
"""
requireNonNull(directory, DIRECTORY_CAN_NOT_BE_NULL)... | java | public static void deleteDirectory(File directory) throws IOException {
requireNonNull(directory, DIRECTORY_CAN_NOT_BE_NULL);
if (!directory.exists()) {
return;
}
Path path = directory.toPath();
if (Files.isSymbolicLink(path)) {
throw new IOException(format("Directory '%s' is a symboli... | [
"public",
"static",
"void",
"deleteDirectory",
"(",
"File",
"directory",
")",
"throws",
"IOException",
"{",
"requireNonNull",
"(",
"directory",
",",
"DIRECTORY_CAN_NOT_BE_NULL",
")",
";",
"if",
"(",
"!",
"directory",
".",
"exists",
"(",
")",
")",
"{",
"return"... | Deletes a directory recursively. Does not support symbolic link to directories.
@param directory directory to delete
@throws IOException in case deletion is unsuccessful | [
"Deletes",
"a",
"directory",
"recursively",
".",
"Does",
"not",
"support",
"symbolic",
"link",
"to",
"directories",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-process/src/main/java/org/sonar/process/FileUtils2.java#L98-L117 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java | SyncMembersInner.listMemberSchemasAsync | public Observable<Page<SyncFullSchemaPropertiesInner>> listMemberSchemasAsync(final String resourceGroupName, final String serverName, final String databaseName, final String syncGroupName, final String syncMemberName) {
"""
Gets a sync member database schema.
@param resourceGroupName The name of the resource g... | java | public Observable<Page<SyncFullSchemaPropertiesInner>> listMemberSchemasAsync(final String resourceGroupName, final String serverName, final String databaseName, final String syncGroupName, final String syncMemberName) {
return listMemberSchemasWithServiceResponseAsync(resourceGroupName, serverName, databaseNam... | [
"public",
"Observable",
"<",
"Page",
"<",
"SyncFullSchemaPropertiesInner",
">",
">",
"listMemberSchemasAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"serverName",
",",
"final",
"String",
"databaseName",
",",
"final",
"String",
"syncGroup... | Gets a sync member database schema.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database on which the sync group is hosted.
... | [
"Gets",
"a",
"sync",
"member",
"database",
"schema",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java#L1050-L1058 |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/utils/FileUtils.java | FileUtils.byteBufferToInputStream | public static InputStream byteBufferToInputStream(final ByteBuffer byteBuffer) {
"""
Produce an {@link InputStream} that is able to read from a {@link ByteBuffer}.
@param byteBuffer
The {@link ByteBuffer}.
@return An {@link InputStream} that reads from the {@link ByteBuffer}.
"""
// https://stacko... | java | public static InputStream byteBufferToInputStream(final ByteBuffer byteBuffer) {
// https://stackoverflow.com/questions/4332264/wrapping-a-bytebuffer-with-an-inputstream/6603018#6603018
return new InputStream() {
/** The intermediate buffer. */
final ByteBuffer buf = byteBuffer;
... | [
"public",
"static",
"InputStream",
"byteBufferToInputStream",
"(",
"final",
"ByteBuffer",
"byteBuffer",
")",
"{",
"// https://stackoverflow.com/questions/4332264/wrapping-a-bytebuffer-with-an-inputstream/6603018#6603018",
"return",
"new",
"InputStream",
"(",
")",
"{",
"/** The inte... | Produce an {@link InputStream} that is able to read from a {@link ByteBuffer}.
@param byteBuffer
The {@link ByteBuffer}.
@return An {@link InputStream} that reads from the {@link ByteBuffer}. | [
"Produce",
"an",
"{",
"@link",
"InputStream",
"}",
"that",
"is",
"able",
"to",
"read",
"from",
"a",
"{",
"@link",
"ByteBuffer",
"}",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/utils/FileUtils.java#L258-L283 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/util/CompilerUtil.java | CompilerUtil.findField | private static Field findField(String name, MutableObject<Object> valueHolder) {
"""
Returns the field matching the specified name if the type of the value specified in
<code>valueHolder</code> can be assigned to the field (with conversion if necessary), or
null.
@param name
the field name
@param valueHolde... | java | private static Field findField(String name, MutableObject<Object> valueHolder) {
final String sourceMethod = "findField"; //$NON-NLS-1$
final boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod, new Object[]{name, valueHolder});
}
Field f... | [
"private",
"static",
"Field",
"findField",
"(",
"String",
"name",
",",
"MutableObject",
"<",
"Object",
">",
"valueHolder",
")",
"{",
"final",
"String",
"sourceMethod",
"=",
"\"findField\"",
";",
"//$NON-NLS-1$\r",
"final",
"boolean",
"isTraceLogging",
"=",
"log",
... | Returns the field matching the specified name if the type of the value specified in
<code>valueHolder</code> can be assigned to the field (with conversion if necessary), or
null.
@param name
the field name
@param valueHolder
(input/output) On input, the value being assigned. On output, possibly converted
value that wi... | [
"Returns",
"the",
"field",
"matching",
"the",
"specified",
"name",
"if",
"the",
"type",
"of",
"the",
"value",
"specified",
"in",
"<code",
">",
"valueHolder<",
"/",
"code",
">",
"can",
"be",
"assigned",
"to",
"the",
"field",
"(",
"with",
"conversion",
"if",... | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/CompilerUtil.java#L328-L347 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/PhotosGeoApi.java | PhotosGeoApi.photosForLocation | public Photos photosForLocation(Float lat, Float lon, Integer accuracy, EnumSet<JinxConstants.PhotoExtras> extras, int perPage, int page) throws JinxException {
"""
Return a list of photos for the calling user at a specific latitude, longitude and accuracy
<br>
This method requires authentication with 'read' per... | java | public Photos photosForLocation(Float lat, Float lon, Integer accuracy, EnumSet<JinxConstants.PhotoExtras> extras, int perPage, int page) throws JinxException {
JinxUtils.validateParams(lat, lon);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.photos.geo.photosForLocation");
... | [
"public",
"Photos",
"photosForLocation",
"(",
"Float",
"lat",
",",
"Float",
"lon",
",",
"Integer",
"accuracy",
",",
"EnumSet",
"<",
"JinxConstants",
".",
"PhotoExtras",
">",
"extras",
",",
"int",
"perPage",
",",
"int",
"page",
")",
"throws",
"JinxException",
... | Return a list of photos for the calling user at a specific latitude, longitude and accuracy
<br>
This method requires authentication with 'read' permission.
@param lat (Required) The latitude whose valid range is -90 to 90. Anything more than 6 decimal places will be truncated.
@param lon (Required) The long... | [
"Return",
"a",
"list",
"of",
"photos",
"for",
"the",
"calling",
"user",
"at",
"a",
"specific",
"latitude",
"longitude",
"and",
"accuracy",
"<br",
">",
"This",
"method",
"requires",
"authentication",
"with",
"read",
"permission",
"."
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosGeoApi.java#L168-L187 |
mgledi/DRUMS | src/main/java/com/unister/semweb/drums/storable/GeneralStorable.java | GeneralStorable.setKey | public void setKey(String field, byte[] key) throws IOException {
"""
Sets the key belonging to the given field.
@param field
the name of the field
@param key
the key to set
@throws IOException
"""
int hash = Arrays.hashCode(field.getBytes());
setKey(structure.keyHash2Index.get(hash), ke... | java | public void setKey(String field, byte[] key) throws IOException {
int hash = Arrays.hashCode(field.getBytes());
setKey(structure.keyHash2Index.get(hash), key);
} | [
"public",
"void",
"setKey",
"(",
"String",
"field",
",",
"byte",
"[",
"]",
"key",
")",
"throws",
"IOException",
"{",
"int",
"hash",
"=",
"Arrays",
".",
"hashCode",
"(",
"field",
".",
"getBytes",
"(",
")",
")",
";",
"setKey",
"(",
"structure",
".",
"k... | Sets the key belonging to the given field.
@param field
the name of the field
@param key
the key to set
@throws IOException | [
"Sets",
"the",
"key",
"belonging",
"to",
"the",
"given",
"field",
"."
] | train | https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/storable/GeneralStorable.java#L523-L526 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/Marshaller.java | Marshaller.marshalKey | public static Key marshalKey(DefaultEntityManager entityManager, Object entity) {
"""
Extracts the key from the given object, entity, and returns it. The entity must have its ID
set.
@param entityManager
the entity manager.
@param entity
the entity from which key is to be extracted
@return extracted key.
... | java | public static Key marshalKey(DefaultEntityManager entityManager, Object entity) {
Marshaller marshaller = new Marshaller(entityManager, entity, Intent.DELETE);
marshaller.marshalKey();
return (Key) marshaller.key;
} | [
"public",
"static",
"Key",
"marshalKey",
"(",
"DefaultEntityManager",
"entityManager",
",",
"Object",
"entity",
")",
"{",
"Marshaller",
"marshaller",
"=",
"new",
"Marshaller",
"(",
"entityManager",
",",
"entity",
",",
"Intent",
".",
"DELETE",
")",
";",
"marshall... | Extracts the key from the given object, entity, and returns it. The entity must have its ID
set.
@param entityManager
the entity manager.
@param entity
the entity from which key is to be extracted
@return extracted key. | [
"Extracts",
"the",
"key",
"from",
"the",
"given",
"object",
"entity",
"and",
"returns",
"it",
".",
"The",
"entity",
"must",
"have",
"its",
"ID",
"set",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/Marshaller.java#L245-L249 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/util/Util.java | Util.getPackageMetaDataSingleQuotedString | public static String getPackageMetaDataSingleQuotedString(Context appContext, String key) {
"""
<p>This method will allow you to pass in literal strings. You must wrap the string in single quotes in order to ensure it is not modified
by Android. Android will try to coerce the string to a float, Integer, etc., if ... | java | public static String getPackageMetaDataSingleQuotedString(Context appContext, String key) {
Object object = getPackageMetaData(appContext, key);
if (object == null) {
return null;
}
String ret = object.toString();
if (ret.endsWith("'")) {
ret = ret.substring(0, ret.length() - 1);
}
if (ret.startsWit... | [
"public",
"static",
"String",
"getPackageMetaDataSingleQuotedString",
"(",
"Context",
"appContext",
",",
"String",
"key",
")",
"{",
"Object",
"object",
"=",
"getPackageMetaData",
"(",
"appContext",
",",
"key",
")",
";",
"if",
"(",
"object",
"==",
"null",
")",
... | <p>This method will allow you to pass in literal strings. You must wrap the string in single quotes in order to ensure it is not modified
by Android. Android will try to coerce the string to a float, Integer, etc., if it looks like one.</p>
<p>Example: <code><meta-data android:name="sdk_distribution" android:value="... | [
"<p",
">",
"This",
"method",
"will",
"allow",
"you",
"to",
"pass",
"in",
"literal",
"strings",
".",
"You",
"must",
"wrap",
"the",
"string",
"in",
"single",
"quotes",
"in",
"order",
"to",
"ensure",
"it",
"is",
"not",
"modified",
"by",
"Android",
".",
"A... | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/util/Util.java#L246-L259 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/arrays/DoubleIntegerArrayQuickSort.java | DoubleIntegerArrayQuickSort.sortReverse | public static void sortReverse(double[] keys, int[] values, int start, int end) {
"""
Sort the array using the given comparator.
@param keys Keys for sorting
@param values Values for sorting
@param start First index
@param end Last index (exclusive)
"""
quickSortReverse(keys, values, start, end);
} | java | public static void sortReverse(double[] keys, int[] values, int start, int end) {
quickSortReverse(keys, values, start, end);
} | [
"public",
"static",
"void",
"sortReverse",
"(",
"double",
"[",
"]",
"keys",
",",
"int",
"[",
"]",
"values",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"quickSortReverse",
"(",
"keys",
",",
"values",
",",
"start",
",",
"end",
")",
";",
"}"
] | Sort the array using the given comparator.
@param keys Keys for sorting
@param values Values for sorting
@param start First index
@param end Last index (exclusive) | [
"Sort",
"the",
"array",
"using",
"the",
"given",
"comparator",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/arrays/DoubleIntegerArrayQuickSort.java#L226-L228 |
akquinet/needle | src/main/java/de/akquinet/jbosscc/needle/reflection/ReflectionUtil.java | ReflectionUtil.invokeMethod | public static Object invokeMethod(final Object object, final String methodName, final Object... arguments)
throws Exception {
"""
Invoke a given method with given arguments on a given object via
reflection.
@param object
-- target object of invocation
@param methodName
-- name of method to be in... | java | public static Object invokeMethod(final Object object, final String methodName, final Object... arguments)
throws Exception {
return invokeMethod(object, object.getClass(), methodName, arguments);
} | [
"public",
"static",
"Object",
"invokeMethod",
"(",
"final",
"Object",
"object",
",",
"final",
"String",
"methodName",
",",
"final",
"Object",
"...",
"arguments",
")",
"throws",
"Exception",
"{",
"return",
"invokeMethod",
"(",
"object",
",",
"object",
".",
"get... | Invoke a given method with given arguments on a given object via
reflection.
@param object
-- target object of invocation
@param methodName
-- name of method to be invoked
@param arguments
-- arguments for method invocation
@return -- method object to which invocation is actually dispatched
@throws Exception | [
"Invoke",
"a",
"given",
"method",
"with",
"given",
"arguments",
"on",
"a",
"given",
"object",
"via",
"reflection",
"."
] | train | https://github.com/akquinet/needle/blob/8b411c521246b8212882485edc01644f9aac7e24/src/main/java/de/akquinet/jbosscc/needle/reflection/ReflectionUtil.java#L401-L404 |
tempodb/tempodb-java | src/main/java/com/tempodb/Client.java | Client.readDataPoints | public Cursor<DataPoint> readDataPoints(Filter filter, Interval interval, Aggregation aggregation) {
"""
Returns a cursor of datapoints specified by a series filter.
<p>This endpoint allows one to request multiple series and apply an aggregation function.
The system default timezone is used for the returned Da... | java | public Cursor<DataPoint> readDataPoints(Filter filter, Interval interval, Aggregation aggregation) {
return readDataPoints(filter, interval, DateTimeZone.getDefault(), aggregation, null, null);
} | [
"public",
"Cursor",
"<",
"DataPoint",
">",
"readDataPoints",
"(",
"Filter",
"filter",
",",
"Interval",
"interval",
",",
"Aggregation",
"aggregation",
")",
"{",
"return",
"readDataPoints",
"(",
"filter",
",",
"interval",
",",
"DateTimeZone",
".",
"getDefault",
"(... | Returns a cursor of datapoints specified by a series filter.
<p>This endpoint allows one to request multiple series and apply an aggregation function.
The system default timezone is used for the returned DateTimes.
@param filter The series filter
@param interval An interval of time for the query (start/end datetimes)... | [
"Returns",
"a",
"cursor",
"of",
"datapoints",
"specified",
"by",
"a",
"series",
"filter",
"."
] | train | https://github.com/tempodb/tempodb-java/blob/5733f204fe4c8dda48916ba1f67cf44f5a3f9c69/src/main/java/com/tempodb/Client.java#L764-L766 |
prestodb/presto | presto-parser/src/main/java/com/facebook/presto/sql/tree/Expression.java | Expression.accept | @Override
protected <R, C> R accept(AstVisitor<R, C> visitor, C context) {
"""
Accessible for {@link AstVisitor}, use {@link AstVisitor#process(Node, Object)} instead.
"""
return visitor.visitExpression(this, context);
} | java | @Override
protected <R, C> R accept(AstVisitor<R, C> visitor, C context)
{
return visitor.visitExpression(this, context);
} | [
"@",
"Override",
"protected",
"<",
"R",
",",
"C",
">",
"R",
"accept",
"(",
"AstVisitor",
"<",
"R",
",",
"C",
">",
"visitor",
",",
"C",
"context",
")",
"{",
"return",
"visitor",
".",
"visitExpression",
"(",
"this",
",",
"context",
")",
";",
"}"
] | Accessible for {@link AstVisitor}, use {@link AstVisitor#process(Node, Object)} instead. | [
"Accessible",
"for",
"{"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-parser/src/main/java/com/facebook/presto/sql/tree/Expression.java#L31-L35 |
ysc/word | src/main/java/org/apdplat/word/WordFrequencyStatistics.java | WordFrequencyStatistics.statistics | private void statistics(String word, int times, Map<String, AtomicInteger> container) {
"""
统计词频
@param word 词
@param times 词频
@param container 内存中保存词频的数据结构
"""
container.putIfAbsent(word, new AtomicInteger());
container.get(word).addAndGet(times);
} | java | private void statistics(String word, int times, Map<String, AtomicInteger> container){
container.putIfAbsent(word, new AtomicInteger());
container.get(word).addAndGet(times);
} | [
"private",
"void",
"statistics",
"(",
"String",
"word",
",",
"int",
"times",
",",
"Map",
"<",
"String",
",",
"AtomicInteger",
">",
"container",
")",
"{",
"container",
".",
"putIfAbsent",
"(",
"word",
",",
"new",
"AtomicInteger",
"(",
")",
")",
";",
"cont... | 统计词频
@param word 词
@param times 词频
@param container 内存中保存词频的数据结构 | [
"统计词频"
] | train | https://github.com/ysc/word/blob/5e45607f4e97207f55d1e3bc561abda6b34f7c54/src/main/java/org/apdplat/word/WordFrequencyStatistics.java#L164-L167 |
mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/internal/CoreRemoteMongoCollectionImpl.java | CoreRemoteMongoCollectionImpl.updateMany | public RemoteUpdateResult updateMany(
final Bson filter,
final Bson update,
final RemoteUpdateOptions updateOptions
) {
"""
Update all documents in the collection according to the specified arguments.
@param filter a document describing the query filter, which may not be null.
@param... | java | public RemoteUpdateResult updateMany(
final Bson filter,
final Bson update,
final RemoteUpdateOptions updateOptions
) {
return executeUpdate(filter, update, updateOptions, true);
} | [
"public",
"RemoteUpdateResult",
"updateMany",
"(",
"final",
"Bson",
"filter",
",",
"final",
"Bson",
"update",
",",
"final",
"RemoteUpdateOptions",
"updateOptions",
")",
"{",
"return",
"executeUpdate",
"(",
"filter",
",",
"update",
",",
"updateOptions",
",",
"true"... | Update all documents in the collection according to the specified arguments.
@param filter a document describing the query filter, which may not be null.
@param update a document describing the update, which may not be null. The update to
apply must include only update operators.
@param updateOptions the... | [
"Update",
"all",
"documents",
"in",
"the",
"collection",
"according",
"to",
"the",
"specified",
"arguments",
"."
] | train | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/internal/CoreRemoteMongoCollectionImpl.java#L438-L444 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/auth/profile/ProfilesConfigFileWriter.java | ProfilesConfigFileWriter.modifyOneProfile | public static void modifyOneProfile(File destination, String profileName, Profile newProfile) {
"""
Modify one profile in the existing credentials file by in-place
modification. This method will rename the existing profile if the
specified Profile has a different name.
@param destination
The destination file... | java | public static void modifyOneProfile(File destination, String profileName, Profile newProfile) {
final Map<String, Profile> modifications = Collections.singletonMap(profileName, newProfile);
modifyProfiles(destination, modifications);
} | [
"public",
"static",
"void",
"modifyOneProfile",
"(",
"File",
"destination",
",",
"String",
"profileName",
",",
"Profile",
"newProfile",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Profile",
">",
"modifications",
"=",
"Collections",
".",
"singletonMap",
"(",
... | Modify one profile in the existing credentials file by in-place
modification. This method will rename the existing profile if the
specified Profile has a different name.
@param destination
The destination file to modify
@param profileName
The name of the existing profile to be modified
@param newProfile
The new Profil... | [
"Modify",
"one",
"profile",
"in",
"the",
"existing",
"credentials",
"file",
"by",
"in",
"-",
"place",
"modification",
".",
"This",
"method",
"will",
"rename",
"the",
"existing",
"profile",
"if",
"the",
"specified",
"Profile",
"has",
"a",
"different",
"name",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/profile/ProfilesConfigFileWriter.java#L126-L130 |
knowm/Yank | src/main/java/org/knowm/yank/Yank.java | Yank.executeBatch | public static int[] executeBatch(String sql, Object[][] params) throws YankSQLException {
"""
Batch executes the given INSERT, UPDATE, DELETE, REPLACE or UPSERT SQL statement using the
default connection pool.
@param sql The SQL statement
@param params An array of query replacement parameters. Each row in thi... | java | public static int[] executeBatch(String sql, Object[][] params) throws YankSQLException {
return executeBatch(YankPoolManager.DEFAULT_POOL_NAME, sql, params);
} | [
"public",
"static",
"int",
"[",
"]",
"executeBatch",
"(",
"String",
"sql",
",",
"Object",
"[",
"]",
"[",
"]",
"params",
")",
"throws",
"YankSQLException",
"{",
"return",
"executeBatch",
"(",
"YankPoolManager",
".",
"DEFAULT_POOL_NAME",
",",
"sql",
",",
"para... | Batch executes the given INSERT, UPDATE, DELETE, REPLACE or UPSERT SQL statement using the
default connection pool.
@param sql The SQL statement
@param params An array of query replacement parameters. Each row in this array is one set of
batch replacement values
@return The number of rows affected or each individual e... | [
"Batch",
"executes",
"the",
"given",
"INSERT",
"UPDATE",
"DELETE",
"REPLACE",
"or",
"UPSERT",
"SQL",
"statement",
"using",
"the",
"default",
"connection",
"pool",
"."
] | train | https://github.com/knowm/Yank/blob/b2071dcd94da99db6904355f9557456b8b292a6b/src/main/java/org/knowm/yank/Yank.java#L753-L756 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/gremlin/optimizer/ExpandAndsOptimization.java | ExpandAndsOptimization.apply | @Override
public GroovyExpression apply(GroovyExpression expr, OptimizationContext context) {
"""
Expands the given and expression. There is no need to recursively
expand the children here. This method is called recursively by
GremlinQueryOptimier on the children.
"""
FunctionCallExpression ex... | java | @Override
public GroovyExpression apply(GroovyExpression expr, OptimizationContext context) {
FunctionCallExpression exprAsFunction = (FunctionCallExpression)expr;
GroovyExpression result = exprAsFunction.getCaller();
List<GroovyExpression> nonExtractableArguments = new ArrayList<>();
... | [
"@",
"Override",
"public",
"GroovyExpression",
"apply",
"(",
"GroovyExpression",
"expr",
",",
"OptimizationContext",
"context",
")",
"{",
"FunctionCallExpression",
"exprAsFunction",
"=",
"(",
"FunctionCallExpression",
")",
"expr",
";",
"GroovyExpression",
"result",
"=",... | Expands the given and expression. There is no need to recursively
expand the children here. This method is called recursively by
GremlinQueryOptimier on the children. | [
"Expands",
"the",
"given",
"and",
"expression",
".",
"There",
"is",
"no",
"need",
"to",
"recursively",
"expand",
"the",
"children",
"here",
".",
"This",
"method",
"is",
"called",
"recursively",
"by",
"GremlinQueryOptimier",
"on",
"the",
"children",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/gremlin/optimizer/ExpandAndsOptimization.java#L82-L124 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/edge/GradientToEdgeFeatures.java | GradientToEdgeFeatures.discretizeDirection4 | static public GrayS8 discretizeDirection4(GrayF32 angle , GrayS8 discrete ) {
"""
<p>
Converts an image containing edge angles (-pi/2 to pi/2) into a discrete set of angles.
The conversion is done by rounding the angle to the nearest orientation in the set.
</p>
<p>
Discrete value to angle (degrees): 0=0,1=45... | java | static public GrayS8 discretizeDirection4(GrayF32 angle , GrayS8 discrete )
{
discrete = InputSanityCheck.checkDeclare(angle,discrete,GrayS8.class);
final float A = (float)(Math.PI/8.0);
final float B = (float)(Math.PI/4.0);
final int w = angle.width;
final int h = angle.height;
for( int y = 0; y < h; y+... | [
"static",
"public",
"GrayS8",
"discretizeDirection4",
"(",
"GrayF32",
"angle",
",",
"GrayS8",
"discrete",
")",
"{",
"discrete",
"=",
"InputSanityCheck",
".",
"checkDeclare",
"(",
"angle",
",",
"discrete",
",",
"GrayS8",
".",
"class",
")",
";",
"final",
"float"... | <p>
Converts an image containing edge angles (-pi/2 to pi/2) into a discrete set of angles.
The conversion is done by rounding the angle to the nearest orientation in the set.
</p>
<p>
Discrete value to angle (degrees): 0=0,1=45,2=90,-1=-45
</p>
@param angle Input image containing edge orientations. Orientations are ... | [
"<p",
">",
"Converts",
"an",
"image",
"containing",
"edge",
"angles",
"(",
"-",
"pi",
"/",
"2",
"to",
"pi",
"/",
"2",
")",
"into",
"a",
"discrete",
"set",
"of",
"angles",
".",
"The",
"conversion",
"is",
"done",
"by",
"rounding",
"the",
"angle",
"to",... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/edge/GradientToEdgeFeatures.java#L384-L411 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.