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 |
|---|---|---|---|---|---|---|---|---|---|---|
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.convertFrom | public static GrayF32 convertFrom(BufferedImage src, GrayF32 dst) {
"""
Converts the buffered image into an {@link GrayF32}. If the buffered image
has multiple channels the intensities of each channel are averaged together.
@param src Input image.
@param dst Where the converted image is written to. If null ... | java | public static GrayF32 convertFrom(BufferedImage src, GrayF32 dst) {
if (dst != null) {
dst.reshape(src.getWidth(), src.getHeight());
} else {
dst = new GrayF32( src.getWidth(), src.getHeight());
}
try {
DataBuffer buff = src.getRaster().getDataBuffer();
if ( buff.getDataType() == DataBuffer.TYPE_B... | [
"public",
"static",
"GrayF32",
"convertFrom",
"(",
"BufferedImage",
"src",
",",
"GrayF32",
"dst",
")",
"{",
"if",
"(",
"dst",
"!=",
"null",
")",
"{",
"dst",
".",
"reshape",
"(",
"src",
".",
"getWidth",
"(",
")",
",",
"src",
".",
"getHeight",
"(",
")"... | Converts the buffered image into an {@link GrayF32}. If the buffered image
has multiple channels the intensities of each channel are averaged together.
@param src Input image.
@param dst Where the converted image is written to. If null a new unsigned image is created.
@return Converted image. | [
"Converts",
"the",
"buffered",
"image",
"into",
"an",
"{",
"@link",
"GrayF32",
"}",
".",
"If",
"the",
"buffered",
"image",
"has",
"multiple",
"channels",
"the",
"intensities",
"of",
"each",
"channel",
"are",
"averaged",
"together",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L425-L452 |
jdereg/java-util | src/main/java/com/cedarsoftware/util/StringUtilities.java | StringUtilities.levenshteinDistance | public static int levenshteinDistance(CharSequence s, CharSequence t) {
"""
The Levenshtein distance is a string metric for measuring the difference between two sequences.
Informally, the Levenshtein distance between two words is the minimum number of single-character edits
(i.e. insertions, deletions or substit... | java | public static int levenshteinDistance(CharSequence s, CharSequence t)
{
// degenerate cases s
if (s == null || "".equals(s))
{
return t == null || "".equals(t) ? 0 : t.length();
}
else if (t == null || "".equals(t))
{
return s.length()... | [
"public",
"static",
"int",
"levenshteinDistance",
"(",
"CharSequence",
"s",
",",
"CharSequence",
"t",
")",
"{",
"// degenerate cases s",
"if",
"(",
"s",
"==",
"null",
"||",
"\"\"",
".",
"equals",
"(",
"s",
")",
")",
"{",
"return",
"t",
"==",
"null... | The Levenshtein distance is a string metric for measuring the difference between two sequences.
Informally, the Levenshtein distance between two words is the minimum number of single-character edits
(i.e. insertions, deletions or substitutions) required to change one word into the other. The phrase
'edit distance' is o... | [
"The",
"Levenshtein",
"distance",
"is",
"a",
"string",
"metric",
"for",
"measuring",
"the",
"difference",
"between",
"two",
"sequences",
".",
"Informally",
"the",
"Levenshtein",
"distance",
"between",
"two",
"words",
"is",
"the",
"minimum",
"number",
"of",
"sing... | train | https://github.com/jdereg/java-util/blob/a2dce61aed16d6454ee575174dda1ba6bff0015c/src/main/java/com/cedarsoftware/util/StringUtilities.java#L245-L291 |
impossibl/stencil | engine/src/main/java/com/impossibl/stencil/api/impl/AnnotatedExtensions.java | AnnotatedExtensions.findMethod | public static Method findMethod(String name, Class<?> cls) {
"""
Finds a named declared method on the given class.
@param name Name of declared method to retrieve
@param cls Class to retrieve method from
@return Named method on class
"""
for(Method method : cls.getDeclaredMethods()) {
if(me... | java | public static Method findMethod(String name, Class<?> cls) {
for(Method method : cls.getDeclaredMethods()) {
if(method.getName().equals(name)) {
return method;
}
}
throw new ExecutionException("invalid auto-function: no '" + name + "' method declared", null);
} | [
"public",
"static",
"Method",
"findMethod",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"cls",
")",
"{",
"for",
"(",
"Method",
"method",
":",
"cls",
".",
"getDeclaredMethods",
"(",
")",
")",
"{",
"if",
"(",
"method",
".",
"getName",
"(",
")",... | Finds a named declared method on the given class.
@param name Name of declared method to retrieve
@param cls Class to retrieve method from
@return Named method on class | [
"Finds",
"a",
"named",
"declared",
"method",
"on",
"the",
"given",
"class",
"."
] | train | https://github.com/impossibl/stencil/blob/4aac1be605542b4248be95bf8916be4e2f755d1c/engine/src/main/java/com/impossibl/stencil/api/impl/AnnotatedExtensions.java#L57-L66 |
JOML-CI/JOML | src/org/joml/Intersectionf.java | Intersectionf.intersectLineCircle | public static boolean intersectLineCircle(float x0, float y0, float x1, float y1, float centerX, float centerY, float radius, Vector3f intersectionCenterAndHL) {
"""
Test whether the line defined by the two points <code>(x0, y0)</code> and <code>(x1, y1)</code> intersects the circle with center
<code>(centerX, ce... | java | public static boolean intersectLineCircle(float x0, float y0, float x1, float y1, float centerX, float centerY, float radius, Vector3f intersectionCenterAndHL) {
// Build general line equation from two points and use the other method
return intersectLineCircle(y0 - y1, x1 - x0, (x0 - x1) * y0 + (y1 - y0... | [
"public",
"static",
"boolean",
"intersectLineCircle",
"(",
"float",
"x0",
",",
"float",
"y0",
",",
"float",
"x1",
",",
"float",
"y1",
",",
"float",
"centerX",
",",
"float",
"centerY",
",",
"float",
"radius",
",",
"Vector3f",
"intersectionCenterAndHL",
")",
"... | Test whether the line defined by the two points <code>(x0, y0)</code> and <code>(x1, y1)</code> intersects the circle with center
<code>(centerX, centerY)</code> and <code>radius</code>, and store the center of the line segment of
intersection in the <code>(x, y)</code> components of the supplied vector and the half-le... | [
"Test",
"whether",
"the",
"line",
"defined",
"by",
"the",
"two",
"points",
"<code",
">",
"(",
"x0",
"y0",
")",
"<",
"/",
"code",
">",
"and",
"<code",
">",
"(",
"x1",
"y1",
")",
"<",
"/",
"code",
">",
"intersects",
"the",
"circle",
"with",
"center",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L3470-L3473 |
Alexey1Gavrilov/ExpectIt | expectit-core/src/main/java/net/sf/expectit/filter/Filters.java | Filters.replaceInBuffer | public static Filter replaceInBuffer(final Pattern regexp, final String replacement) {
"""
Creates a filter which replaces every substring in the input buffer that matches the given
regular expression
and replaces it with given replacement.
<p/>
The method just calls {@link String#replaceAll(String, String)} f... | java | public static Filter replaceInBuffer(final Pattern regexp, final String replacement) {
return new FilterAdapter() {
@Override
protected boolean doAfterAppend(StringBuilder buffer) {
Matcher matcher = regexp.matcher(buffer);
String str = matcher.replaceAll(... | [
"public",
"static",
"Filter",
"replaceInBuffer",
"(",
"final",
"Pattern",
"regexp",
",",
"final",
"String",
"replacement",
")",
"{",
"return",
"new",
"FilterAdapter",
"(",
")",
"{",
"@",
"Override",
"protected",
"boolean",
"doAfterAppend",
"(",
"StringBuilder",
... | Creates a filter which replaces every substring in the input buffer that matches the given
regular expression
and replaces it with given replacement.
<p/>
The method just calls {@link String#replaceAll(String, String)} for the entire buffer
contents every time new
data arrives,
@param regexp the regular expressio... | [
"Creates",
"a",
"filter",
"which",
"replaces",
"every",
"substring",
"in",
"the",
"input",
"buffer",
"that",
"matches",
"the",
"given",
"regular",
"expression",
"and",
"replaces",
"it",
"with",
"given",
"replacement",
".",
"<p",
"/",
">",
"The",
"method",
"j... | train | https://github.com/Alexey1Gavrilov/ExpectIt/blob/5acbe1f8f895fe1dbd63e29bf3ab8e5bbf0873c3/expectit-core/src/main/java/net/sf/expectit/filter/Filters.java#L168-L178 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationsInner.java | ReplicationsInner.beginUpdateAsync | public Observable<ReplicationInner> beginUpdateAsync(String resourceGroupName, String registryName, String replicationName) {
"""
Updates a replication for a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param... | java | public Observable<ReplicationInner> beginUpdateAsync(String resourceGroupName, String registryName, String replicationName) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1<ServiceResponse<ReplicationInner>, ReplicationInner>() {
@Override
... | [
"public",
"Observable",
"<",
"ReplicationInner",
">",
"beginUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"replicationName",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"regist... | Updates a replication for a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param replicationName The name of the replication.
@throws IllegalArgumentException thr... | [
"Updates",
"a",
"replication",
"for",
"a",
"container",
"registry",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationsInner.java#L752-L759 |
tomgibara/bits | src/main/java/com/tomgibara/bits/Bits.java | Bits.asStore | public static BitStore asStore(byte[] bytes) {
"""
Exposes the bits of a byte array as a {@link BitStore}. The returned bit
store is a live view over the byte array; changes made to the array are
reflected in bit store and vice versa. The bit store contains every bit
in the array with the zeroth indexed bit of ... | java | public static BitStore asStore(byte[] bytes) {
if (bytes == null) throw new IllegalArgumentException("null bytes");
if (bytes.length * 8L > Integer.MAX_VALUE) throw new IllegalArgumentException("index overflow");
return new BytesBitStore(bytes, 0, bytes.length << 3, true);
} | [
"public",
"static",
"BitStore",
"asStore",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"if",
"(",
"bytes",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"null bytes\"",
")",
";",
"if",
"(",
"bytes",
".",
"length",
"*",
"8L",
">",
... | Exposes the bits of a byte array as a {@link BitStore}. The returned bit
store is a live view over the byte array; changes made to the array are
reflected in bit store and vice versa. The bit store contains every bit
in the array with the zeroth indexed bit of the store taking its value
from the least significant bit o... | [
"Exposes",
"the",
"bits",
"of",
"a",
"byte",
"array",
"as",
"a",
"{",
"@link",
"BitStore",
"}",
".",
"The",
"returned",
"bit",
"store",
"is",
"a",
"live",
"view",
"over",
"the",
"byte",
"array",
";",
"changes",
"made",
"to",
"the",
"array",
"are",
"r... | train | https://github.com/tomgibara/bits/blob/56c32c0a30efd3d7c4e7c6600a0ca39e51eecc97/src/main/java/com/tomgibara/bits/Bits.java#L512-L516 |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/run/SseBuilder.java | SseBuilder.setProxyCredentials | private void setProxyCredentials(Run<?, ?> run) {
"""
Get credentials by the credentials id. Then set the user name and password into the SsePoxySetting.
"""
if (proxySettings != null && proxySettings.getFsProxyCredentialsId() != null) {
UsernamePasswordCredentials up = CredentialsProvider.findCrede... | java | private void setProxyCredentials(Run<?, ?> run) {
if (proxySettings != null && proxySettings.getFsProxyCredentialsId() != null) {
UsernamePasswordCredentials up = CredentialsProvider.findCredentialById(
proxySettings.getFsProxyCredentialsId(),
StandardUsernamePasswordCredentials.class,
... | [
"private",
"void",
"setProxyCredentials",
"(",
"Run",
"<",
"?",
",",
"?",
">",
"run",
")",
"{",
"if",
"(",
"proxySettings",
"!=",
"null",
"&&",
"proxySettings",
".",
"getFsProxyCredentialsId",
"(",
")",
"!=",
"null",
")",
"{",
"UsernamePasswordCredentials",
... | Get credentials by the credentials id. Then set the user name and password into the SsePoxySetting. | [
"Get",
"credentials",
"by",
"the",
"credentials",
"id",
".",
"Then",
"set",
"the",
"user",
"name",
"and",
"password",
"into",
"the",
"SsePoxySetting",
"."
] | train | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/run/SseBuilder.java#L177-L190 |
WolfgangFahl/Mediawiki-Japi | src/main/java/com/bitplan/mediawiki/japi/Mediawiki.java | Mediawiki.sortByTitleAndFilterDoubles | public List<Rc> sortByTitleAndFilterDoubles(List<Rc> rcList) {
"""
sort the given List by title and filter double titles
@param rcList
@return
"""
List<Rc> result = new ArrayList<Rc>();
List<Rc> sorted = new ArrayList<Rc>();
sorted.addAll(rcList);
Collections.sort(sorted, new Comparator<Rc>... | java | public List<Rc> sortByTitleAndFilterDoubles(List<Rc> rcList) {
List<Rc> result = new ArrayList<Rc>();
List<Rc> sorted = new ArrayList<Rc>();
sorted.addAll(rcList);
Collections.sort(sorted, new Comparator<Rc>() {
@Override
public int compare(Rc lRc, Rc rRc) {
int result = lRc.getTitle... | [
"public",
"List",
"<",
"Rc",
">",
"sortByTitleAndFilterDoubles",
"(",
"List",
"<",
"Rc",
">",
"rcList",
")",
"{",
"List",
"<",
"Rc",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Rc",
">",
"(",
")",
";",
"List",
"<",
"Rc",
">",
"sorted",
"=",
"new"... | sort the given List by title and filter double titles
@param rcList
@return | [
"sort",
"the",
"given",
"List",
"by",
"title",
"and",
"filter",
"double",
"titles"
] | train | https://github.com/WolfgangFahl/Mediawiki-Japi/blob/78d0177ebfe02eb05da5550839727861f1e888a5/src/main/java/com/bitplan/mediawiki/japi/Mediawiki.java#L1445-L1474 |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClientV2.java | AtlasClientV2.createAtlasTypeDefs | public AtlasTypesDef createAtlasTypeDefs(final AtlasTypesDef typesDef) throws AtlasServiceException {
"""
Bulk create APIs for all atlas type definitions, only new definitions will be created.
Any changes to the existing definitions will be discarded
@param typesDef A composite wrapper object with correspondin... | java | public AtlasTypesDef createAtlasTypeDefs(final AtlasTypesDef typesDef) throws AtlasServiceException {
return callAPI(CREATE_ALL_TYPE_DEFS, AtlasTypesDef.class, AtlasType.toJson(typesDef));
} | [
"public",
"AtlasTypesDef",
"createAtlasTypeDefs",
"(",
"final",
"AtlasTypesDef",
"typesDef",
")",
"throws",
"AtlasServiceException",
"{",
"return",
"callAPI",
"(",
"CREATE_ALL_TYPE_DEFS",
",",
"AtlasTypesDef",
".",
"class",
",",
"AtlasType",
".",
"toJson",
"(",
"types... | Bulk create APIs for all atlas type definitions, only new definitions will be created.
Any changes to the existing definitions will be discarded
@param typesDef A composite wrapper object with corresponding lists of the type definition
@return A composite wrapper object with lists of type definitions that were success... | [
"Bulk",
"create",
"APIs",
"for",
"all",
"atlas",
"type",
"definitions",
"only",
"new",
"definitions",
"will",
"be",
"created",
".",
"Any",
"changes",
"to",
"the",
"existing",
"definitions",
"will",
"be",
"discarded"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClientV2.java#L261-L263 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.setPeerOptions | PeerOptions setPeerOptions(Peer peer, PeerOptions peerOptions) throws InvalidArgumentException {
"""
Set peerOptions in the channel that has not be initialized yet.
@param peer the peer to set options on.
@param peerOptions see {@link PeerOptions}
@return old options.
"""
if (initialized) {... | java | PeerOptions setPeerOptions(Peer peer, PeerOptions peerOptions) throws InvalidArgumentException {
if (initialized) {
throw new InvalidArgumentException(format("Channel %s already initialized.", name));
}
checkPeer(peer);
PeerOptions ret = getPeersOptions(peer);
remove... | [
"PeerOptions",
"setPeerOptions",
"(",
"Peer",
"peer",
",",
"PeerOptions",
"peerOptions",
")",
"throws",
"InvalidArgumentException",
"{",
"if",
"(",
"initialized",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"format",
"(",
"\"Channel %s already initialized... | Set peerOptions in the channel that has not be initialized yet.
@param peer the peer to set options on.
@param peerOptions see {@link PeerOptions}
@return old options. | [
"Set",
"peerOptions",
"in",
"the",
"channel",
"that",
"has",
"not",
"be",
"initialized",
"yet",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L1001-L1013 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/dicom/ApplicationActivityEvent.java | ApplicationActivityEvent.addApplicationParticipant | public void addApplicationParticipant(String userId, String altUserId, String userName, String networkId) {
"""
Add an Application Active Participant to this message
@param userId The Active Participant's User ID
@param altUserId The Active Participant's Alternate UserID
@param userName The Active Participant... | java | public void addApplicationParticipant(String userId, String altUserId, String userName, String networkId)
{
addActiveParticipant(
userId,
altUserId,
userName,
false,
Collections.singletonList(new DICOMActiveParticipantRoleIdCodes.Application()),
networkId);
} | [
"public",
"void",
"addApplicationParticipant",
"(",
"String",
"userId",
",",
"String",
"altUserId",
",",
"String",
"userName",
",",
"String",
"networkId",
")",
"{",
"addActiveParticipant",
"(",
"userId",
",",
"altUserId",
",",
"userName",
",",
"false",
",",
"Col... | Add an Application Active Participant to this message
@param userId The Active Participant's User ID
@param altUserId The Active Participant's Alternate UserID
@param userName The Active Participant's UserName
@param networkId The Active Participant's Network Access Point ID | [
"Add",
"an",
"Application",
"Active",
"Participant",
"to",
"this",
"message"
] | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/dicom/ApplicationActivityEvent.java#L54-L63 |
liferay/com-liferay-commerce | commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPFriendlyURLEntryUtil.java | CPFriendlyURLEntryUtil.removeByUUID_G | public static CPFriendlyURLEntry removeByUUID_G(String uuid, long groupId)
throws com.liferay.commerce.product.exception.NoSuchCPFriendlyURLEntryException {
"""
Removes the cp friendly url entry where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@retur... | java | public static CPFriendlyURLEntry removeByUUID_G(String uuid, long groupId)
throws com.liferay.commerce.product.exception.NoSuchCPFriendlyURLEntryException {
return getPersistence().removeByUUID_G(uuid, groupId);
} | [
"public",
"static",
"CPFriendlyURLEntry",
"removeByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"com",
".",
"liferay",
".",
"commerce",
".",
"product",
".",
"exception",
".",
"NoSuchCPFriendlyURLEntryException",
"{",
"return",
"getPersisten... | Removes the cp friendly url entry where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the cp friendly url entry that was removed | [
"Removes",
"the",
"cp",
"friendly",
"url",
"entry",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPFriendlyURLEntryUtil.java#L316-L319 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java | JQLChecker.analyzeVariableStatementInternal | protected <L extends JqlBaseListener> void analyzeVariableStatementInternal(JQLContext jqlContext, final String jql, L listener) {
"""
Analyze variable statement internal.
@param <L>
the generic type
@param jqlContext
the jql context
@param jql
the jql
@param listener
the listener
"""
walker.walk(l... | java | protected <L extends JqlBaseListener> void analyzeVariableStatementInternal(JQLContext jqlContext, final String jql, L listener) {
walker.walk(listener, prepareVariableStatement(jqlContext, jql).value0);
} | [
"protected",
"<",
"L",
"extends",
"JqlBaseListener",
">",
"void",
"analyzeVariableStatementInternal",
"(",
"JQLContext",
"jqlContext",
",",
"final",
"String",
"jql",
",",
"L",
"listener",
")",
"{",
"walker",
".",
"walk",
"(",
"listener",
",",
"prepareVariableState... | Analyze variable statement internal.
@param <L>
the generic type
@param jqlContext
the jql context
@param jql
the jql
@param listener
the listener | [
"Analyze",
"variable",
"statement",
"internal",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java#L131-L133 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/ant/RepositoryVerifierHandler.java | RepositoryVerifierHandler.getLiteralId | private int getLiteralId(String literal) throws PersistenceBrokerException {
"""
returns the XmlCapable id associated with the literal.
OJB maintains a RepositoryTags table that provides
a mapping from xml-tags to XmlCapable ids.
@param literal the literal to lookup
@return the int value representing the Xml... | java | private int getLiteralId(String literal) throws PersistenceBrokerException
{
////logger.debug("lookup: " + literal);
try
{
return tags.getIdByTag(literal);
}
catch (NullPointerException t)
{
throw new MetadataException("unknown literal... | [
"private",
"int",
"getLiteralId",
"(",
"String",
"literal",
")",
"throws",
"PersistenceBrokerException",
"{",
"////logger.debug(\"lookup: \" + literal);\r",
"try",
"{",
"return",
"tags",
".",
"getIdByTag",
"(",
"literal",
")",
";",
"}",
"catch",
"(",
"NullPointerExcep... | returns the XmlCapable id associated with the literal.
OJB maintains a RepositoryTags table that provides
a mapping from xml-tags to XmlCapable ids.
@param literal the literal to lookup
@return the int value representing the XmlCapable
@throws MetadataException if no literal was found in tags mapping | [
"returns",
"the",
"XmlCapable",
"id",
"associated",
"with",
"the",
"literal",
".",
"OJB",
"maintains",
"a",
"RepositoryTags",
"table",
"that",
"provides",
"a",
"mapping",
"from",
"xml",
"-",
"tags",
"to",
"XmlCapable",
"ids",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/ant/RepositoryVerifierHandler.java#L108-L120 |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java | MediaDescriptorField.createApplicationFormat | private RTPFormat createApplicationFormat(int payload, Text description) {
"""
Creates or updates application format using payload number and text format description.
@param payload the payload number of the format.
@param description text description of the format
@return format object
"""
Iterat... | java | private RTPFormat createApplicationFormat(int payload, Text description) {
Iterator<Text> it = description.split('/').iterator();
//encoding name
Text token = it.next();
token.trim();
EncodingName name = new EncodingName(token);
//clock rate
token = it.next();
... | [
"private",
"RTPFormat",
"createApplicationFormat",
"(",
"int",
"payload",
",",
"Text",
"description",
")",
"{",
"Iterator",
"<",
"Text",
">",
"it",
"=",
"description",
".",
"split",
"(",
"'",
"'",
")",
".",
"iterator",
"(",
")",
";",
"//encoding name",
"Te... | Creates or updates application format using payload number and text format description.
@param payload the payload number of the format.
@param description text description of the format
@return format object | [
"Creates",
"or",
"updates",
"application",
"format",
"using",
"payload",
"number",
"and",
"text",
"format",
"description",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/MediaDescriptorField.java#L496-L515 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AbstractModelUpdateHandler.java | AbstractModelUpdateHandler.updateModel | protected void updateModel(final ModelNode operation, final Resource resource) throws OperationFailedException {
"""
Update the given resource in the persistent configuration model based on the values in the given operation.
@param operation the operation
@param resource the resource that corresponds to the a... | java | protected void updateModel(final ModelNode operation, final Resource resource) throws OperationFailedException {
updateModel(operation, resource.getModel());
} | [
"protected",
"void",
"updateModel",
"(",
"final",
"ModelNode",
"operation",
",",
"final",
"Resource",
"resource",
")",
"throws",
"OperationFailedException",
"{",
"updateModel",
"(",
"operation",
",",
"resource",
".",
"getModel",
"(",
")",
")",
";",
"}"
] | Update the given resource in the persistent configuration model based on the values in the given operation.
@param operation the operation
@param resource the resource that corresponds to the address of {@code operation}
@throws OperationFailedException if {@code operation} is invalid or populating the model otherwis... | [
"Update",
"the",
"given",
"resource",
"in",
"the",
"persistent",
"configuration",
"model",
"based",
"on",
"the",
"values",
"in",
"the",
"given",
"operation",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AbstractModelUpdateHandler.java#L64-L66 |
biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java | Alignments.getPairwiseAligner | public static <S extends Sequence<C>, C extends Compound> PairwiseSequenceAligner<S, C> getPairwiseAligner(
S query, S target, PairwiseSequenceAlignerType type, GapPenalty gapPenalty,
SubstitutionMatrix<C> subMatrix) {
"""
Factory method which constructs a pairwise sequence aligner.
@param <S> each {@link... | java | public static <S extends Sequence<C>, C extends Compound> PairwiseSequenceAligner<S, C> getPairwiseAligner(
S query, S target, PairwiseSequenceAlignerType type, GapPenalty gapPenalty,
SubstitutionMatrix<C> subMatrix) {
if (!query.getCompoundSet().equals(target.getCompoundSet())) {
throw new IllegalArgumentEx... | [
"public",
"static",
"<",
"S",
"extends",
"Sequence",
"<",
"C",
">",
",",
"C",
"extends",
"Compound",
">",
"PairwiseSequenceAligner",
"<",
"S",
",",
"C",
">",
"getPairwiseAligner",
"(",
"S",
"query",
",",
"S",
"target",
",",
"PairwiseSequenceAlignerType",
"ty... | Factory method which constructs a pairwise sequence aligner.
@param <S> each {@link Sequence} of an alignment pair is of type S
@param <C> each element of an {@link AlignedSequence} is a {@link Compound} of type C
@param query the first {@link Sequence} to align
@param target the second {@link Sequence} to align
@para... | [
"Factory",
"method",
"which",
"constructs",
"a",
"pairwise",
"sequence",
"aligner",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java#L320-L338 |
deeplearning4j/deeplearning4j | datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java | AnalyzeSpark.getUnique | public static Map<String,List<Writable>> getUnique(List<String> columnNames, Schema schema, JavaRDD<List<Writable>> data) {
"""
Get a list of unique values from the specified columns.
For sequence data, use {@link #getUniqueSequence(String, Schema, JavaRDD)}
@param columnNames Names of the column to get uniq... | java | public static Map<String,List<Writable>> getUnique(List<String> columnNames, Schema schema, JavaRDD<List<Writable>> data){
Map<String,Set<Writable>> m = data.aggregate(null, new UniqueAddFunction(columnNames, schema), new UniqueMergeFunction());
Map<String,List<Writable>> out = new HashMap<>();
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"List",
"<",
"Writable",
">",
">",
"getUnique",
"(",
"List",
"<",
"String",
">",
"columnNames",
",",
"Schema",
"schema",
",",
"JavaRDD",
"<",
"List",
"<",
"Writable",
">",
">",
"data",
")",
"{",
"Map",
"... | Get a list of unique values from the specified columns.
For sequence data, use {@link #getUniqueSequence(String, Schema, JavaRDD)}
@param columnNames Names of the column to get unique values from
@param schema Data schema
@param data Data to get unique values from
@return List of unique ... | [
"Get",
"a",
"list",
"of",
"unique",
"values",
"from",
"the",
"specified",
"columns",
".",
"For",
"sequence",
"data",
"use",
"{",
"@link",
"#getUniqueSequence",
"(",
"String",
"Schema",
"JavaRDD",
")",
"}"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java#L212-L219 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDRNN.java | SDRNN.sruCell | public SDVariable sruCell(String baseName, SRUCellConfiguration configuration) {
"""
An sru cell
@param baseName the base name to use for the output variables
@param configuration the configuration for the sru cell
@return
"""
return new SRUCell(sd, configuration).outputVariables(baseName)[0... | java | public SDVariable sruCell(String baseName, SRUCellConfiguration configuration) {
return new SRUCell(sd, configuration).outputVariables(baseName)[0];
} | [
"public",
"SDVariable",
"sruCell",
"(",
"String",
"baseName",
",",
"SRUCellConfiguration",
"configuration",
")",
"{",
"return",
"new",
"SRUCell",
"(",
"sd",
",",
"configuration",
")",
".",
"outputVariables",
"(",
"baseName",
")",
"[",
"0",
"]",
";",
"}"
] | An sru cell
@param baseName the base name to use for the output variables
@param configuration the configuration for the sru cell
@return | [
"An",
"sru",
"cell"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDRNN.java#L108-L110 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseConnectionPoliciesInner.java | DatabaseConnectionPoliciesInner.createOrUpdateAsync | public Observable<DatabaseConnectionPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseConnectionPolicyInner parameters) {
"""
Creates or updates a database's connection policy, which is used with table auditing. Table auditing is deprecated, use blob auditin... | java | public Observable<DatabaseConnectionPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseConnectionPolicyInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1<ServiceResponse<... | [
"public",
"Observable",
"<",
"DatabaseConnectionPolicyInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"DatabaseConnectionPolicyInner",
"parameters",
")",
"{",
"return",
"createOrUpdateW... | Creates or updates a database's connection policy, which is used with table auditing. Table auditing is deprecated, use blob auditing instead.
@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 serverNa... | [
"Creates",
"or",
"updates",
"a",
"database",
"s",
"connection",
"policy",
"which",
"is",
"used",
"with",
"table",
"auditing",
".",
"Table",
"auditing",
"is",
"deprecated",
"use",
"blob",
"auditing",
"instead",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseConnectionPoliciesInner.java#L202-L209 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Equals.java | ST_Equals.geomEquals | public static Boolean geomEquals(Geometry a, Geometry b) {
"""
Return true if Geometry A is equal to Geometry B
@param a Geometry Geometry.
@param b Geometry instance
@return true if Geometry A is equal to Geometry B
"""
if(a==null || b==null) {
return null;
}
return a.... | java | public static Boolean geomEquals(Geometry a, Geometry b) {
if(a==null || b==null) {
return null;
}
return a.equals(b);
} | [
"public",
"static",
"Boolean",
"geomEquals",
"(",
"Geometry",
"a",
",",
"Geometry",
"b",
")",
"{",
"if",
"(",
"a",
"==",
"null",
"||",
"b",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"a",
".",
"equals",
"(",
"b",
")",
";",
"}"
... | Return true if Geometry A is equal to Geometry B
@param a Geometry Geometry.
@param b Geometry instance
@return true if Geometry A is equal to Geometry B | [
"Return",
"true",
"if",
"Geometry",
"A",
"is",
"equal",
"to",
"Geometry",
"B"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Equals.java#L51-L56 |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/api/common/io/FormatUtil.java | FormatUtil.normalizePath | private static Path normalizePath(Path path) {
"""
Fixes the path if it denotes a local (relative) file without the proper protocol prefix.
"""
URI uri = path.toUri();
if (uri.getScheme() == null) {
try {
uri = new URI("file", uri.getHost(), uri.getPath(), uri.getFragment());
path = new Path(uri... | java | private static Path normalizePath(Path path) {
URI uri = path.toUri();
if (uri.getScheme() == null) {
try {
uri = new URI("file", uri.getHost(), uri.getPath(), uri.getFragment());
path = new Path(uri.toString());
} catch (URISyntaxException e) {
throw new IllegalArgumentException("path is invalid"... | [
"private",
"static",
"Path",
"normalizePath",
"(",
"Path",
"path",
")",
"{",
"URI",
"uri",
"=",
"path",
".",
"toUri",
"(",
")",
";",
"if",
"(",
"uri",
".",
"getScheme",
"(",
")",
"==",
"null",
")",
"{",
"try",
"{",
"uri",
"=",
"new",
"URI",
"(",
... | Fixes the path if it denotes a local (relative) file without the proper protocol prefix. | [
"Fixes",
"the",
"path",
"if",
"it",
"denotes",
"a",
"local",
"(",
"relative",
")",
"file",
"without",
"the",
"proper",
"protocol",
"prefix",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/api/common/io/FormatUtil.java#L169-L180 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/network/NettyUtils.java | NettyUtils.createEventLoop | public static EventLoopGroup createEventLoop(ChannelType type, int numThreads,
String threadPrefix, boolean isDaemon) {
"""
Creates a Netty {@link EventLoopGroup} based on {@link ChannelType}.
@param type Selector for which form of low-level IO we should use
@param numThreads target number of threads
@p... | java | public static EventLoopGroup createEventLoop(ChannelType type, int numThreads,
String threadPrefix, boolean isDaemon) {
ThreadFactory threadFactory = ThreadFactoryUtils.build(threadPrefix, isDaemon);
switch (type) {
case NIO:
return new NioEventLoopGroup(numThreads, threadFactory);
ca... | [
"public",
"static",
"EventLoopGroup",
"createEventLoop",
"(",
"ChannelType",
"type",
",",
"int",
"numThreads",
",",
"String",
"threadPrefix",
",",
"boolean",
"isDaemon",
")",
"{",
"ThreadFactory",
"threadFactory",
"=",
"ThreadFactoryUtils",
".",
"build",
"(",
"threa... | Creates a Netty {@link EventLoopGroup} based on {@link ChannelType}.
@param type Selector for which form of low-level IO we should use
@param numThreads target number of threads
@param threadPrefix name pattern for each thread. should contain '%d' to distinguish between
threads.
@param isDaemon if true, the {@link jav... | [
"Creates",
"a",
"Netty",
"{",
"@link",
"EventLoopGroup",
"}",
"based",
"on",
"{",
"@link",
"ChannelType",
"}",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/network/NettyUtils.java#L64-L76 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/utils/FastDateFormat.java | FastDateFormat.getDateInstance | public static synchronized FastDateFormat getDateInstance(int style, TimeZone timeZone, Locale locale) {
"""
<p>Gets a date formatter instance using the specified style, time
zone and locale.</p>
@param style date style: FULL, LONG, MEDIUM, or SHORT
@param timeZone optional time zone, overrides time zone of... | java | public static synchronized FastDateFormat getDateInstance(int style, TimeZone timeZone, Locale locale) {
Object key = new Integer(style);
if (timeZone != null) {
key = new Pair(key, timeZone);
}
if (locale == null) {
locale = Locale.getDefault();
... | [
"public",
"static",
"synchronized",
"FastDateFormat",
"getDateInstance",
"(",
"int",
"style",
",",
"TimeZone",
"timeZone",
",",
"Locale",
"locale",
")",
"{",
"Object",
"key",
"=",
"new",
"Integer",
"(",
"style",
")",
";",
"if",
"(",
"timeZone",
"!=",
"null",... | <p>Gets a date formatter instance using the specified style, time
zone and locale.</p>
@param style date style: FULL, LONG, MEDIUM, or SHORT
@param timeZone optional time zone, overrides time zone of
formatted date
@param locale optional locale, overrides system locale
@return a localized standard date formatter
@t... | [
"<p",
">",
"Gets",
"a",
"date",
"formatter",
"instance",
"using",
"the",
"specified",
"style",
"time",
"zone",
"and",
"locale",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/FastDateFormat.java#L281-L306 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/DTDEntitiesAttr.java | DTDEntitiesAttr.validateDefault | @Override
public void validateDefault(InputProblemReporter rep, boolean normalize)
throws XMLStreamException {
"""
Method called by the validator object
to ask attribute to verify that the default it has (if any) is
valid for such type.
"""
String normStr = validateDefaultNames(rep, true)... | java | @Override
public void validateDefault(InputProblemReporter rep, boolean normalize)
throws XMLStreamException
{
String normStr = validateDefaultNames(rep, true);
if (normalize) {
mDefValue.setValue(normStr);
}
// Ok, but were they declared?
/* Perform... | [
"@",
"Override",
"public",
"void",
"validateDefault",
"(",
"InputProblemReporter",
"rep",
",",
"boolean",
"normalize",
")",
"throws",
"XMLStreamException",
"{",
"String",
"normStr",
"=",
"validateDefaultNames",
"(",
"rep",
",",
"true",
")",
";",
"if",
"(",
"norm... | Method called by the validator object
to ask attribute to verify that the default it has (if any) is
valid for such type. | [
"Method",
"called",
"by",
"the",
"validator",
"object",
"to",
"ask",
"attribute",
"to",
"verify",
"that",
"the",
"default",
"it",
"has",
"(",
"if",
"any",
")",
"is",
"valid",
"for",
"such",
"type",
"."
] | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/DTDEntitiesAttr.java#L150-L177 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java | AmazonS3Client.populateRequestWithCopyPartParameters | private static void populateRequestWithCopyPartParameters(Request<?> request, CopyPartRequest copyPartRequest) {
"""
<p>
Populates the specified request with the numerous options available in
<code>CopyObjectRequest</code>.
</p>
@param request
The request to populate with headers to represent all the
optio... | java | private static void populateRequestWithCopyPartParameters(Request<?> request, CopyPartRequest copyPartRequest) {
String copySourceHeader =
"/" + SdkHttpUtils.urlEncode(copyPartRequest.getSourceBucketName(), true)
+ "/" + SdkHttpUtils.urlEncode(copyPartRequest.getSourceKey(), true);
... | [
"private",
"static",
"void",
"populateRequestWithCopyPartParameters",
"(",
"Request",
"<",
"?",
">",
"request",
",",
"CopyPartRequest",
"copyPartRequest",
")",
"{",
"String",
"copySourceHeader",
"=",
"\"/\"",
"+",
"SdkHttpUtils",
".",
"urlEncode",
"(",
"copyPartReques... | <p>
Populates the specified request with the numerous options available in
<code>CopyObjectRequest</code>.
</p>
@param request
The request to populate with headers to represent all the
options expressed in the <code>CopyPartRequest</code> object.
@param copyPartRequest
The object containing all the options for copying... | [
"<p",
">",
"Populates",
"the",
"specified",
"request",
"with",
"the",
"numerous",
"options",
"available",
"in",
"<code",
">",
"CopyObjectRequest<",
"/",
"code",
">",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L4315-L4342 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/DerInputStream.java | DerInputStream.getBigInteger | public BigInteger getBigInteger() throws IOException {
"""
Get a integer from the input stream as a BigInteger object.
@return the integer held in this DER input stream.
"""
if (buffer.read() != DerValue.tag_Integer) {
throw new IOException("DER input, Integer tag error");
}
... | java | public BigInteger getBigInteger() throws IOException {
if (buffer.read() != DerValue.tag_Integer) {
throw new IOException("DER input, Integer tag error");
}
return buffer.getBigInteger(getLength(buffer), false);
} | [
"public",
"BigInteger",
"getBigInteger",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"buffer",
".",
"read",
"(",
")",
"!=",
"DerValue",
".",
"tag_Integer",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"DER input, Integer tag error\"",
")",
";",
"}",
... | Get a integer from the input stream as a BigInteger object.
@return the integer held in this DER input stream. | [
"Get",
"a",
"integer",
"from",
"the",
"input",
"stream",
"as",
"a",
"BigInteger",
"object",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/DerInputStream.java#L178-L183 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/PersistenceDelegator.java | PersistenceDelegator.loadClient | void loadClient(String persistenceUnit, Client client) {
"""
Pre load client specific to persistence unit.
@param persistenceUnit
persistence unit.
@param client
"""
if (!clientMap.containsKey(persistenceUnit) && client != null)
{
clientMap.put(persistenceUnit, client);
... | java | void loadClient(String persistenceUnit, Client client)
{
if (!clientMap.containsKey(persistenceUnit) && client != null)
{
clientMap.put(persistenceUnit, client);
}
} | [
"void",
"loadClient",
"(",
"String",
"persistenceUnit",
",",
"Client",
"client",
")",
"{",
"if",
"(",
"!",
"clientMap",
".",
"containsKey",
"(",
"persistenceUnit",
")",
"&&",
"client",
"!=",
"null",
")",
"{",
"clientMap",
".",
"put",
"(",
"persistenceUnit",
... | Pre load client specific to persistence unit.
@param persistenceUnit
persistence unit.
@param client | [
"Pre",
"load",
"client",
"specific",
"to",
"persistence",
"unit",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/PersistenceDelegator.java#L802-L808 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/ProductRequirementInformation.java | ProductRequirementInformation.createFromAppliesTo | @SuppressWarnings("unchecked") // SelfExtractor has no generics
public static List<ProductRequirementInformation> createFromAppliesTo(String appliesTo) {
"""
Parse an appliesTo string to produce a list of product requirements
@param appliesTo the appliesTo string
@return the product requirements informatio... | java | @SuppressWarnings("unchecked") // SelfExtractor has no generics
public static List<ProductRequirementInformation> createFromAppliesTo(String appliesTo) {
if (appliesTo == null || appliesTo.isEmpty()) {
throw new InvalidParameterException("Applies to must be set to a valid value but is " + applie... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"// SelfExtractor has no generics",
"public",
"static",
"List",
"<",
"ProductRequirementInformation",
">",
"createFromAppliesTo",
"(",
"String",
"appliesTo",
")",
"{",
"if",
"(",
"appliesTo",
"==",
"null",
"||",
"app... | Parse an appliesTo string to produce a list of product requirements
@param appliesTo the appliesTo string
@return the product requirements information | [
"Parse",
"an",
"appliesTo",
"string",
"to",
"produce",
"a",
"list",
"of",
"product",
"requirements"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/ProductRequirementInformation.java#L118-L149 |
Netflix/dyno | dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/HostStatusTracker.java | HostStatusTracker.inactiveSetChanged | public boolean inactiveSetChanged(Collection<Host> hostsUp, Collection<Host> hostsDown) {
"""
This check is more involved than the active set check. Here we 2 conditions to check for
1. We could have new hosts that were in the active set and have shown up in the inactive set.
2. We can also have the case where... | java | public boolean inactiveSetChanged(Collection<Host> hostsUp, Collection<Host> hostsDown) {
boolean newInactiveHostsFound = false;
// Check for condition 1.
for (Host hostDown : hostsDown) {
if (activeHosts.contains(hostDown)) {
newInactiveHostsFound = true;
break;
}
}
// Check for condi... | [
"public",
"boolean",
"inactiveSetChanged",
"(",
"Collection",
"<",
"Host",
">",
"hostsUp",
",",
"Collection",
"<",
"Host",
">",
"hostsDown",
")",
"{",
"boolean",
"newInactiveHostsFound",
"=",
"false",
";",
"// Check for condition 1. ",
"for",
"(",
"Host",
"hostDow... | This check is more involved than the active set check. Here we 2 conditions to check for
1. We could have new hosts that were in the active set and have shown up in the inactive set.
2. We can also have the case where hosts from the active set have disappeared and also not in the provided inactive set.
This is where w... | [
"This",
"check",
"is",
"more",
"involved",
"than",
"the",
"active",
"set",
"check",
".",
"Here",
"we",
"2",
"conditions",
"to",
"check",
"for"
] | train | https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/HostStatusTracker.java#L103-L122 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistriesInner.java | RegistriesInner.updatePolicies | public RegistryPoliciesInner updatePolicies(String resourceGroupName, String registryName, RegistryPoliciesInner registryPoliciesUpdateParameters) {
"""
Updates the policies for the specified container registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@p... | java | public RegistryPoliciesInner updatePolicies(String resourceGroupName, String registryName, RegistryPoliciesInner registryPoliciesUpdateParameters) {
return updatePoliciesWithServiceResponseAsync(resourceGroupName, registryName, registryPoliciesUpdateParameters).toBlocking().last().body();
} | [
"public",
"RegistryPoliciesInner",
"updatePolicies",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"RegistryPoliciesInner",
"registryPoliciesUpdateParameters",
")",
"{",
"return",
"updatePoliciesWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Updates the policies for the specified container registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param registryPoliciesUpdateParameters The parameters for updating policies of a container registry.
@thro... | [
"Updates",
"the",
"policies",
"for",
"the",
"specified",
"container",
"registry",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistriesInner.java#L1578-L1580 |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/iter/Generators.java | Generators.serialDayGenerator | static Generator serialDayGenerator(
final int interval, final DateValue dtStart) {
"""
constructs a generator that generates every day in the current month that
is an integer multiple of interval days from dtStart.
"""
return new Generator() {
int year, month, date;
... | java | static Generator serialDayGenerator(
final int interval, final DateValue dtStart) {
return new Generator() {
int year, month, date;
/** ndays in the last month encountered */
int nDays;
{
// step back one interval
DTBui... | [
"static",
"Generator",
"serialDayGenerator",
"(",
"final",
"int",
"interval",
",",
"final",
"DateValue",
"dtStart",
")",
"{",
"return",
"new",
"Generator",
"(",
")",
"{",
"int",
"year",
",",
"month",
",",
"date",
";",
"/** ndays in the last month encountered */",
... | constructs a generator that generates every day in the current month that
is an integer multiple of interval days from dtStart. | [
"constructs",
"a",
"generator",
"that",
"generates",
"every",
"day",
"in",
"the",
"current",
"month",
"that",
"is",
"an",
"integer",
"multiple",
"of",
"interval",
"days",
"from",
"dtStart",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/iter/Generators.java#L147-L204 |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java | SpringApplication.bindToSpringApplication | protected void bindToSpringApplication(ConfigurableEnvironment environment) {
"""
Bind the environment to the {@link SpringApplication}.
@param environment the environment to bind
"""
try {
Binder.get(environment).bind("spring.main", Bindable.ofInstance(this));
}
catch (Exception ex) {
throw new I... | java | protected void bindToSpringApplication(ConfigurableEnvironment environment) {
try {
Binder.get(environment).bind("spring.main", Bindable.ofInstance(this));
}
catch (Exception ex) {
throw new IllegalStateException("Cannot bind to SpringApplication", ex);
}
} | [
"protected",
"void",
"bindToSpringApplication",
"(",
"ConfigurableEnvironment",
"environment",
")",
"{",
"try",
"{",
"Binder",
".",
"get",
"(",
"environment",
")",
".",
"bind",
"(",
"\"spring.main\"",
",",
"Bindable",
".",
"ofInstance",
"(",
"this",
")",
")",
... | Bind the environment to the {@link SpringApplication}.
@param environment the environment to bind | [
"Bind",
"the",
"environment",
"to",
"the",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java#L562-L569 |
NICTA/nicta-ner | conll2003-evaluation/src/main/java/org/t3as/ner/conll2003/Util.java | Util.positionClassificationMap | public static Map<Integer, NerClassification> positionClassificationMap(final NerResultSet nerResultSet) {
"""
Return a Map of Token startIndex to classification of the Phrase that Token is a part of.
"""
final Map<Integer, NerClassification> m = new HashMap<>();
for (final List<Phrase> senten... | java | public static Map<Integer, NerClassification> positionClassificationMap(final NerResultSet nerResultSet) {
final Map<Integer, NerClassification> m = new HashMap<>();
for (final List<Phrase> sentence : nerResultSet.phrases) {
for (final Phrase p : sentence) {
final int phrase... | [
"public",
"static",
"Map",
"<",
"Integer",
",",
"NerClassification",
">",
"positionClassificationMap",
"(",
"final",
"NerResultSet",
"nerResultSet",
")",
"{",
"final",
"Map",
"<",
"Integer",
",",
"NerClassification",
">",
"m",
"=",
"new",
"HashMap",
"<>",
"(",
... | Return a Map of Token startIndex to classification of the Phrase that Token is a part of. | [
"Return",
"a",
"Map",
"of",
"Token",
"startIndex",
"to",
"classification",
"of",
"the",
"Phrase",
"that",
"Token",
"is",
"a",
"part",
"of",
"."
] | train | https://github.com/NICTA/nicta-ner/blob/c2156a0e299004e586926777a995b7795f35ff1c/conll2003-evaluation/src/main/java/org/t3as/ner/conll2003/Util.java#L39-L61 |
playn/playn | scene/src/playn/scene/LayerUtil.java | LayerUtil.getHitLayer | public static Layer getHitLayer (Layer root, Point p) {
"""
Returns the layer hit by (screen) position {@code p} (or null) in the scene graph rooted at
{@code root}, using {@link Layer#hitTest}. Note that {@code p} is mutated by this call.
"""
root.transform().inverseTransform(p, p);
p.x += root.origi... | java | public static Layer getHitLayer (Layer root, Point p) {
root.transform().inverseTransform(p, p);
p.x += root.originX();
p.y += root.originY();
return root.hitTest(p);
} | [
"public",
"static",
"Layer",
"getHitLayer",
"(",
"Layer",
"root",
",",
"Point",
"p",
")",
"{",
"root",
".",
"transform",
"(",
")",
".",
"inverseTransform",
"(",
"p",
",",
"p",
")",
";",
"p",
".",
"x",
"+=",
"root",
".",
"originX",
"(",
")",
";",
... | Returns the layer hit by (screen) position {@code p} (or null) in the scene graph rooted at
{@code root}, using {@link Layer#hitTest}. Note that {@code p} is mutated by this call. | [
"Returns",
"the",
"layer",
"hit",
"by",
"(",
"screen",
")",
"position",
"{"
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/scene/src/playn/scene/LayerUtil.java#L128-L133 |
openbaton/openbaton-client | sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceDescriptorAgent.java | NetworkServiceDescriptorAgent.deleteVirtualNetworkFunctionDescriptors | @Help(
help =
"Delete the VirtualNetworkFunctionDescriptor of a NetworkServiceDescriptor with specific id"
)
@Deprecated
public void deleteVirtualNetworkFunctionDescriptors(final String idNSD, final String idVnf)
throws SDKException {
"""
Delete a specific VirtualNetworkFunctionDescriptor t... | java | @Help(
help =
"Delete the VirtualNetworkFunctionDescriptor of a NetworkServiceDescriptor with specific id"
)
@Deprecated
public void deleteVirtualNetworkFunctionDescriptors(final String idNSD, final String idVnf)
throws SDKException {
String url = idNSD + "/vnfdescriptors" + "/" + idVnf;
... | [
"@",
"Help",
"(",
"help",
"=",
"\"Delete the VirtualNetworkFunctionDescriptor of a NetworkServiceDescriptor with specific id\"",
")",
"@",
"Deprecated",
"public",
"void",
"deleteVirtualNetworkFunctionDescriptors",
"(",
"final",
"String",
"idNSD",
",",
"final",
"String",
"idVnf"... | Delete a specific VirtualNetworkFunctionDescriptor that is contained in a particular
NetworkServiceDescriptor.
@param idNSD the ID of the NetworkServiceDescriptor
@param idVnf the id of the VirtualNetworkFunctionDescriptor
@throws SDKException if the request fails | [
"Delete",
"a",
"specific",
"VirtualNetworkFunctionDescriptor",
"that",
"is",
"contained",
"in",
"a",
"particular",
"NetworkServiceDescriptor",
"."
] | train | https://github.com/openbaton/openbaton-client/blob/6ca6dd6b62a23940d312213d6fa489d5b636061a/sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceDescriptorAgent.java#L146-L155 |
awslabs/jsii | packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiEngine.java | JsiiEngine.createNewObject | public JsiiObjectRef createNewObject(final Object uninitializedNativeObject, final Object... args) {
"""
Given an uninitialized native object instance, reads the @Jsii annotations to determine
the jsii module and FQN, and creates a JS object.
Any methods implemented on the native object are passed in as "overr... | java | public JsiiObjectRef createNewObject(final Object uninitializedNativeObject, final Object... args) {
Class<? extends Object> klass = uninitializedNativeObject.getClass();
Jsii jsii = tryGetJsiiAnnotation(klass, true);
String fqn = "Object"; // if we can't determine FQN, we just create an empty J... | [
"public",
"JsiiObjectRef",
"createNewObject",
"(",
"final",
"Object",
"uninitializedNativeObject",
",",
"final",
"Object",
"...",
"args",
")",
"{",
"Class",
"<",
"?",
"extends",
"Object",
">",
"klass",
"=",
"uninitializedNativeObject",
".",
"getClass",
"(",
")",
... | Given an uninitialized native object instance, reads the @Jsii annotations to determine
the jsii module and FQN, and creates a JS object.
Any methods implemented on the native object are passed in as "overrides", which are overridden
in the javascript side to call-back to the native method.
@param uninitializedNative... | [
"Given",
"an",
"uninitialized",
"native",
"object",
"instance",
"reads",
"the",
"@Jsii",
"annotations",
"to",
"determine",
"the",
"jsii",
"module",
"and",
"FQN",
"and",
"creates",
"a",
"JS",
"object",
"."
] | train | https://github.com/awslabs/jsii/blob/6bbf743f5f65e98e5199ad31c93961533ffc40e5/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiEngine.java#L446-L462 |
signit-wesign/java-sdk | src/main/java/cn/signit/sdk/util/FastjsonEncoder.java | FastjsonEncoder.encodeAsString | public static String encodeAsString(Object obj,NamingStyle namingStyle) {
"""
将指定java对象序列化成相应字符串<br>
(默认:使用unicode编码(当有中文字段时))
@param obj java对象
@param namingStyle 命名风格
@return 序列化后的json字符串
@author Zhanghongdong
"""
return encodeAsString(obj, namingStyle, true);
} | java | public static String encodeAsString(Object obj,NamingStyle namingStyle){
return encodeAsString(obj, namingStyle, true);
} | [
"public",
"static",
"String",
"encodeAsString",
"(",
"Object",
"obj",
",",
"NamingStyle",
"namingStyle",
")",
"{",
"return",
"encodeAsString",
"(",
"obj",
",",
"namingStyle",
",",
"true",
")",
";",
"}"
] | 将指定java对象序列化成相应字符串<br>
(默认:使用unicode编码(当有中文字段时))
@param obj java对象
@param namingStyle 命名风格
@return 序列化后的json字符串
@author Zhanghongdong | [
"将指定java对象序列化成相应字符串<br",
">",
"(",
"默认:使用unicode编码(当有中文字段时)",
")"
] | train | https://github.com/signit-wesign/java-sdk/blob/6f3196c9d444818a953396fdaa8ffed9794d9530/src/main/java/cn/signit/sdk/util/FastjsonEncoder.java#L41-L43 |
SonarSource/sonarqube | server/sonar-main/src/main/java/org/sonar/application/config/AppSettingsLoaderImpl.java | AppSettingsLoaderImpl.loadPropertiesFile | private static Properties loadPropertiesFile(File homeDir) {
"""
Loads the configuration file ${homeDir}/conf/sonar.properties.
An empty {@link Properties} is returned if the file does not exist.
"""
Properties p = new Properties();
File propsFile = new File(homeDir, "conf/sonar.properties");
if (... | java | private static Properties loadPropertiesFile(File homeDir) {
Properties p = new Properties();
File propsFile = new File(homeDir, "conf/sonar.properties");
if (propsFile.exists()) {
try (Reader reader = new InputStreamReader(new FileInputStream(propsFile), UTF_8)) {
p.load(reader);
} catc... | [
"private",
"static",
"Properties",
"loadPropertiesFile",
"(",
"File",
"homeDir",
")",
"{",
"Properties",
"p",
"=",
"new",
"Properties",
"(",
")",
";",
"File",
"propsFile",
"=",
"new",
"File",
"(",
"homeDir",
",",
"\"conf/sonar.properties\"",
")",
";",
"if",
... | Loads the configuration file ${homeDir}/conf/sonar.properties.
An empty {@link Properties} is returned if the file does not exist. | [
"Loads",
"the",
"configuration",
"file",
"$",
"{",
"homeDir",
"}",
"/",
"conf",
"/",
"sonar",
".",
"properties",
".",
"An",
"empty",
"{"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-main/src/main/java/org/sonar/application/config/AppSettingsLoaderImpl.java#L91-L104 |
tzaeschke/zoodb | src/org/zoodb/internal/ZooClassDef.java | ZooClassDef.newVersion | private ZooClassDef newVersion(ClientSessionCache cache, ZooClassDef newSuper) {
"""
Schema versioning: We only create new schema instance when we add or remove fields.
Renaming a field should not result in a new version!
A new version is only required when the modified schema does not match the stored data. Suc... | java | private ZooClassDef newVersion(ClientSessionCache cache, ZooClassDef newSuper) {
if (nextVersion != null) {
throw new IllegalStateException();
}
if (newSuper == null) {
//no new version of super available
newSuper = superDef;
}
long oid = jdoZooGetContext().getNode().getOidBuffer().allocateOid()... | [
"private",
"ZooClassDef",
"newVersion",
"(",
"ClientSessionCache",
"cache",
",",
"ZooClassDef",
"newSuper",
")",
"{",
"if",
"(",
"nextVersion",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
")",
";",
"}",
"if",
"(",
"newSuper",
"==",
... | Schema versioning: We only create new schema instance when we add or remove fields.
Renaming a field should not result in a new version!
A new version is only required when the modified schema does not match the stored data. Such
changes require also new versions of all sub-classes.
WHY? If every class stored only thei... | [
"Schema",
"versioning",
":",
"We",
"only",
"create",
"new",
"schema",
"instance",
"when",
"we",
"add",
"or",
"remove",
"fields",
".",
"Renaming",
"a",
"field",
"should",
"not",
"result",
"in",
"a",
"new",
"version!",
"A",
"new",
"version",
"is",
"only",
... | train | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/ZooClassDef.java#L182-L226 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.getUntaggedImageCount | public int getUntaggedImageCount(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter) {
"""
Gets the number of untagged images.
This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the
current worksp... | java | public int getUntaggedImageCount(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter) {
return getUntaggedImageCountWithServiceResponseAsync(projectId, getUntaggedImageCountOptionalParameter).toBlocking().single().body();
} | [
"public",
"int",
"getUntaggedImageCount",
"(",
"UUID",
"projectId",
",",
"GetUntaggedImageCountOptionalParameter",
"getUntaggedImageCountOptionalParameter",
")",
"{",
"return",
"getUntaggedImageCountWithServiceResponseAsync",
"(",
"projectId",
",",
"getUntaggedImageCountOptionalParam... | Gets the number of untagged images.
This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the
current workspace is used.
@param projectId The project id
@param getUntaggedImageCountOptionalParameter the object representing the optional parameters t... | [
"Gets",
"the",
"number",
"of",
"untagged",
"images",
".",
"This",
"API",
"returns",
"the",
"images",
"which",
"have",
"no",
"tags",
"for",
"a",
"given",
"project",
"and",
"optionally",
"an",
"iteration",
".",
"If",
"no",
"iteration",
"is",
"specified",
"th... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L4454-L4456 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.copyOfRange | public static <T> List<T> copyOfRange(final List<T> c, int from, final int to, final int step) {
"""
Copy all the elements in <code>original</code>, through <code>to</code>-<code>from</code>, by <code>step</code>.
@param c
@param from
@param to
@param step
@return
"""
N.checkFromToIndex(from < ... | java | public static <T> List<T> copyOfRange(final List<T> c, int from, final int to, final int step) {
N.checkFromToIndex(from < to ? from : (to == -1 ? 0 : to), from < to ? to : from, c.size());
if (step == 0) {
throw new IllegalArgumentException("The input parameter 'by' can not be zero");
... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"copyOfRange",
"(",
"final",
"List",
"<",
"T",
">",
"c",
",",
"int",
"from",
",",
"final",
"int",
"to",
",",
"final",
"int",
"step",
")",
"{",
"N",
".",
"checkFromToIndex",
"(",
"from",
"<... | Copy all the elements in <code>original</code>, through <code>to</code>-<code>from</code>, by <code>step</code>.
@param c
@param from
@param to
@param step
@return | [
"Copy",
"all",
"the",
"elements",
"in",
"<code",
">",
"original<",
"/",
"code",
">",
"through",
"<code",
">",
"to<",
"/",
"code",
">",
"-",
"<code",
">",
"from<",
"/",
"code",
">",
"by",
"<code",
">",
"step<",
"/",
"code",
">",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L11021-L11052 |
deeplearning4j/deeplearning4j | datavec/datavec-local/src/main/java/org/datavec/local/transforms/LocalTransformExecutor.java | LocalTransformExecutor.executeToSequence | public static List<List<List<Writable>>> executeToSequence(List<List<Writable>> inputWritables,
TransformProcess transformProcess) {
"""
Execute the specified TransformProcess with the given input data<br>
Note: this method can only be used if the Tra... | java | public static List<List<List<Writable>>> executeToSequence(List<List<Writable>> inputWritables,
TransformProcess transformProcess) {
if (!(transformProcess.getFinalSchema() instanceof SequenceSchema)) {
throw new IllegalStateException("C... | [
"public",
"static",
"List",
"<",
"List",
"<",
"List",
"<",
"Writable",
">",
">",
">",
"executeToSequence",
"(",
"List",
"<",
"List",
"<",
"Writable",
">",
">",
"inputWritables",
",",
"TransformProcess",
"transformProcess",
")",
"{",
"if",
"(",
"!",
"(",
... | Execute the specified TransformProcess with the given input data<br>
Note: this method can only be used if the TransformProcess
starts with non-sequential data,
but returns <it>sequence</it>
data (after grouping or converting to a sequence as one of the steps)
@param inputWritables Input data to process
@param trans... | [
"Execute",
"the",
"specified",
"TransformProcess",
"with",
"the",
"given",
"input",
"data<br",
">",
"Note",
":",
"this",
"method",
"can",
"only",
"be",
"used",
"if",
"the",
"TransformProcess",
"starts",
"with",
"non",
"-",
"sequential",
"data",
"but",
"returns... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-local/src/main/java/org/datavec/local/transforms/LocalTransformExecutor.java#L107-L114 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java | VirtualNetworkTapsInner.beginUpdateTags | public VirtualNetworkTapInner beginUpdateTags(String resourceGroupName, String tapName) {
"""
Updates an VirtualNetworkTap tags.
@param resourceGroupName The name of the resource group.
@param tapName The name of the tap.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws Cloud... | java | public VirtualNetworkTapInner beginUpdateTags(String resourceGroupName, String tapName) {
return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, tapName).toBlocking().single().body();
} | [
"public",
"VirtualNetworkTapInner",
"beginUpdateTags",
"(",
"String",
"resourceGroupName",
",",
"String",
"tapName",
")",
"{",
"return",
"beginUpdateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"tapName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",... | Updates an VirtualNetworkTap tags.
@param resourceGroupName The name of the resource group.
@param tapName The name of the tap.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked... | [
"Updates",
"an",
"VirtualNetworkTap",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java#L672-L674 |
mapcode-foundation/mapcode-java | src/main/java/com/mapcode/Mapcode.java | Mapcode.getCodeWithTerritory | @Nonnull
public String getCodeWithTerritory(final int precision, @Nullable final Alphabet alphabet) throws IllegalArgumentException {
"""
Return the international mapcode as a shorter version using the ISO territory codes where possible.
International codes use a territory code "AAA".
The format of the code ... | java | @Nonnull
public String getCodeWithTerritory(final int precision, @Nullable final Alphabet alphabet) throws IllegalArgumentException {
return territory.toString() + ' ' + getCode(precision, alphabet);
} | [
"@",
"Nonnull",
"public",
"String",
"getCodeWithTerritory",
"(",
"final",
"int",
"precision",
",",
"@",
"Nullable",
"final",
"Alphabet",
"alphabet",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"territory",
".",
"toString",
"(",
")",
"+",
"'",
"'",
... | Return the international mapcode as a shorter version using the ISO territory codes where possible.
International codes use a territory code "AAA".
The format of the code is:
short-territory-name mapcode
Example:
NLD 49.4V (regular code)
NLD 49.4V-K2 (high-precision code)
@param preci... | [
"Return",
"the",
"international",
"mapcode",
"as",
"a",
"shorter",
"version",
"using",
"the",
"ISO",
"territory",
"codes",
"where",
"possible",
".",
"International",
"codes",
"use",
"a",
"territory",
"code",
"AAA",
".",
"The",
"format",
"of",
"the",
"code",
... | train | https://github.com/mapcode-foundation/mapcode-java/blob/f12d4d9fbd460472ac0fff1f702f2ac716bc0ab8/src/main/java/com/mapcode/Mapcode.java#L218-L221 |
crawljax/crawljax | core/src/main/java/com/crawljax/forms/FormHandler.java | FormHandler.setInputElementValue | protected void setInputElementValue(Node element, FormInput input) {
"""
Fills in the element with the InputValues for input
@param element the node element
@param input the input data
"""
LOGGER.debug("INPUTFIELD: {} ({})", input.getIdentification(), input.getType());
if (element == null || input.g... | java | protected void setInputElementValue(Node element, FormInput input) {
LOGGER.debug("INPUTFIELD: {} ({})", input.getIdentification(), input.getType());
if (element == null || input.getInputValues().isEmpty()) {
return;
}
try {
switch (input.getType()) {
case TEXT:
case TEXTAREA:
case PASSWORD:... | [
"protected",
"void",
"setInputElementValue",
"(",
"Node",
"element",
",",
"FormInput",
"input",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"INPUTFIELD: {} ({})\"",
",",
"input",
".",
"getIdentification",
"(",
")",
",",
"input",
".",
"getType",
"(",
")",
")",
"... | Fills in the element with the InputValues for input
@param element the node element
@param input the input data | [
"Fills",
"in",
"the",
"element",
"with",
"the",
"InputValues",
"for",
"input"
] | train | https://github.com/crawljax/crawljax/blob/d339f4f622ca902ccd35322065821e52a62ec543/core/src/main/java/com/crawljax/forms/FormHandler.java#L54-L88 |
deeplearning4j/deeplearning4j | datavec/datavec-spark/src/main/java/org/datavec/spark/transform/utils/SparkUtils.java | SparkUtils.readStringFromFile | public static String readStringFromFile(String path, SparkContext sc) throws IOException {
"""
Read a UTF-8 format String from HDFS (or local)
@param path Path to write the string
@param sc Spark context
"""
return readStringFromFile(path, sc.hadoopConfiguration());
} | java | public static String readStringFromFile(String path, SparkContext sc) throws IOException {
return readStringFromFile(path, sc.hadoopConfiguration());
} | [
"public",
"static",
"String",
"readStringFromFile",
"(",
"String",
"path",
",",
"SparkContext",
"sc",
")",
"throws",
"IOException",
"{",
"return",
"readStringFromFile",
"(",
"path",
",",
"sc",
".",
"hadoopConfiguration",
"(",
")",
")",
";",
"}"
] | Read a UTF-8 format String from HDFS (or local)
@param path Path to write the string
@param sc Spark context | [
"Read",
"a",
"UTF",
"-",
"8",
"format",
"String",
"from",
"HDFS",
"(",
"or",
"local",
")"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/utils/SparkUtils.java#L119-L121 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java | CmsSitemapController.createSubEntry | public void createSubEntry(final CmsClientSitemapEntry newEntry, CmsUUID parentId, CmsUUID structureId) {
"""
Registers a new sitemap entry.<p>
@param newEntry the new entry
@param parentId the parent entry id
@param structureId the structure id of the model page (if null, uses default model page)
"""
... | java | public void createSubEntry(final CmsClientSitemapEntry newEntry, CmsUUID parentId, CmsUUID structureId) {
if (structureId == null) {
structureId = m_data.getDefaultNewElementInfo().getCopyResourceId();
}
create(newEntry, parentId, m_data.getDefaultNewElementInfo().getId(), structure... | [
"public",
"void",
"createSubEntry",
"(",
"final",
"CmsClientSitemapEntry",
"newEntry",
",",
"CmsUUID",
"parentId",
",",
"CmsUUID",
"structureId",
")",
"{",
"if",
"(",
"structureId",
"==",
"null",
")",
"{",
"structureId",
"=",
"m_data",
".",
"getDefaultNewElementIn... | Registers a new sitemap entry.<p>
@param newEntry the new entry
@param parentId the parent entry id
@param structureId the structure id of the model page (if null, uses default model page) | [
"Registers",
"a",
"new",
"sitemap",
"entry",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java#L691-L697 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureWriter.java | MmtfStructureWriter.storeBioassemblyInformation | private void storeBioassemblyInformation(Map<String, Integer> chainIdToIndexMap, Map<Integer, BioAssemblyInfo> inputBioAss) {
"""
Generate the bioassembly information on in the desired form.
@param bioJavaStruct the Biojava structure
@param header the header
"""
int bioAssemblyIndex = 0;
for (Entry<Integ... | java | private void storeBioassemblyInformation(Map<String, Integer> chainIdToIndexMap, Map<Integer, BioAssemblyInfo> inputBioAss) {
int bioAssemblyIndex = 0;
for (Entry<Integer, BioAssemblyInfo> entry : inputBioAss.entrySet()) {
Map<double[], int[]> transformMap = MmtfUtils.getTransformMap(entry.getValue(), chainIdToI... | [
"private",
"void",
"storeBioassemblyInformation",
"(",
"Map",
"<",
"String",
",",
"Integer",
">",
"chainIdToIndexMap",
",",
"Map",
"<",
"Integer",
",",
"BioAssemblyInfo",
">",
"inputBioAss",
")",
"{",
"int",
"bioAssemblyIndex",
"=",
"0",
";",
"for",
"(",
"Entr... | Generate the bioassembly information on in the desired form.
@param bioJavaStruct the Biojava structure
@param header the header | [
"Generate",
"the",
"bioassembly",
"information",
"on",
"in",
"the",
"desired",
"form",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureWriter.java#L210-L219 |
restfb/restfb | src/main/java/com/restfb/DefaultFacebookClient.java | DefaultFacebookClient.toParameterString | protected String toParameterString(boolean withJsonParameter, Parameter... parameters) {
"""
Generate the parameter string to be included in the Facebook API request.
@param withJsonParameter
add additional parameter format with type json
@param parameters
Arbitrary number of extra parameters to include in t... | java | protected String toParameterString(boolean withJsonParameter, Parameter... parameters) {
if (!isBlank(accessToken)) {
parameters = parametersWithAdditionalParameter(Parameter.with(ACCESS_TOKEN_PARAM_NAME, accessToken), parameters);
}
if (!isBlank(accessToken) && !isBlank(appSecret)) {
parameter... | [
"protected",
"String",
"toParameterString",
"(",
"boolean",
"withJsonParameter",
",",
"Parameter",
"...",
"parameters",
")",
"{",
"if",
"(",
"!",
"isBlank",
"(",
"accessToken",
")",
")",
"{",
"parameters",
"=",
"parametersWithAdditionalParameter",
"(",
"Parameter",
... | Generate the parameter string to be included in the Facebook API request.
@param withJsonParameter
add additional parameter format with type json
@param parameters
Arbitrary number of extra parameters to include in the request.
@return The parameter string to include in the Facebook API request.
@throws FacebookJsonMa... | [
"Generate",
"the",
"parameter",
"string",
"to",
"be",
"included",
"in",
"the",
"Facebook",
"API",
"request",
"."
] | train | https://github.com/restfb/restfb/blob/fb77ba5486d1339e7deb81b9830670fa209b1047/src/main/java/com/restfb/DefaultFacebookClient.java#L875-L905 |
woxblom/DragListView | library/src/main/java/com/woxthebox/draglistview/DragItemRecyclerView.java | DragItemRecyclerView.findChildView | public View findChildView(float x, float y) {
"""
Returns the child view under the specific x,y coordinate.
This method will take margins of the child into account when finding it.
"""
final int count = getChildCount();
if (y <= 0 && count > 0) {
return getChildAt(0);
}
... | java | public View findChildView(float x, float y) {
final int count = getChildCount();
if (y <= 0 && count > 0) {
return getChildAt(0);
}
for (int i = count - 1; i >= 0; i--) {
final View child = getChildAt(i);
MarginLayoutParams params = (MarginLayoutParam... | [
"public",
"View",
"findChildView",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"final",
"int",
"count",
"=",
"getChildCount",
"(",
")",
";",
"if",
"(",
"y",
"<=",
"0",
"&&",
"count",
">",
"0",
")",
"{",
"return",
"getChildAt",
"(",
"0",
")",
... | Returns the child view under the specific x,y coordinate.
This method will take margins of the child into account when finding it. | [
"Returns",
"the",
"child",
"view",
"under",
"the",
"specific",
"x",
"y",
"coordinate",
".",
"This",
"method",
"will",
"take",
"margins",
"of",
"the",
"child",
"into",
"account",
"when",
"finding",
"it",
"."
] | train | https://github.com/woxblom/DragListView/blob/9823406f21d96035e88d8fd173f64419d0bb89f3/library/src/main/java/com/woxthebox/draglistview/DragItemRecyclerView.java#L251-L267 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataDecoder.java | DataDecoder.decodeInt | public static int decodeInt(byte[] src, int srcOffset)
throws CorruptEncodingException {
"""
Decodes a signed integer from exactly 4 bytes.
@param src source of encoded bytes
@param srcOffset offset into source array
@return signed integer value
"""
try {
int value = (src[sr... | java | public static int decodeInt(byte[] src, int srcOffset)
throws CorruptEncodingException
{
try {
int value = (src[srcOffset] << 24) | ((src[srcOffset + 1] & 0xff) << 16) |
((src[srcOffset + 2] & 0xff) << 8) | (src[srcOffset + 3] & 0xff);
return value ^ 0x8... | [
"public",
"static",
"int",
"decodeInt",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"srcOffset",
")",
"throws",
"CorruptEncodingException",
"{",
"try",
"{",
"int",
"value",
"=",
"(",
"src",
"[",
"srcOffset",
"]",
"<<",
"24",
")",
"|",
"(",
"(",
"src",
... | Decodes a signed integer from exactly 4 bytes.
@param src source of encoded bytes
@param srcOffset offset into source array
@return signed integer value | [
"Decodes",
"a",
"signed",
"integer",
"from",
"exactly",
"4",
"bytes",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataDecoder.java#L47-L57 |
alkacon/opencms-core | src/org/opencms/gwt/shared/property/CmsClientProperty.java | CmsClientProperty.getPathValue | public CmsPathValue getPathValue() {
"""
Returns the effective path value of the property.<p>
@return the effective path value of the property
"""
if (!CmsStringUtil.isEmpty(m_structureValue)) {
return new CmsPathValue(m_structureValue, PATH_STRUCTURE_VALUE);
} else if (!CmsStri... | java | public CmsPathValue getPathValue() {
if (!CmsStringUtil.isEmpty(m_structureValue)) {
return new CmsPathValue(m_structureValue, PATH_STRUCTURE_VALUE);
} else if (!CmsStringUtil.isEmpty(m_resourceValue)) {
return new CmsPathValue(m_resourceValue, PATH_RESOURCE_VALUE);
} el... | [
"public",
"CmsPathValue",
"getPathValue",
"(",
")",
"{",
"if",
"(",
"!",
"CmsStringUtil",
".",
"isEmpty",
"(",
"m_structureValue",
")",
")",
"{",
"return",
"new",
"CmsPathValue",
"(",
"m_structureValue",
",",
"PATH_STRUCTURE_VALUE",
")",
";",
"}",
"else",
"if"... | Returns the effective path value of the property.<p>
@return the effective path value of the property | [
"Returns",
"the",
"effective",
"path",
"value",
"of",
"the",
"property",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/shared/property/CmsClientProperty.java#L287-L296 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java | FlowControllerFactory.getPageFlowForURI | public static PageFlowController getPageFlowForURI( HttpServletRequest request,
HttpServletResponse response,
String uri,
ServletContext servletContext ... | java | public static PageFlowController getPageFlowForURI( HttpServletRequest request,
HttpServletResponse response,
String uri,
ServletContext servletContext ... | [
"public",
"static",
"PageFlowController",
"getPageFlowForURI",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"String",
"uri",
",",
"ServletContext",
"servletContext",
")",
"{",
"return",
"getPageFlowForRelativeURI",
"(",
"request",
","... | Get the page flow instance that should be associated with the given URI. If it doesn't exist, create it.
If one is created, the page flow stack (for nesting) will be cleared or pushed, and the new instance will be
stored as the current page flow.
@deprecated Use {@link #getPageFlowForPath(RequestContext, String)} inst... | [
"Get",
"the",
"page",
"flow",
"instance",
"that",
"should",
"be",
"associated",
"with",
"the",
"given",
"URI",
".",
"If",
"it",
"doesn",
"t",
"exist",
"create",
"it",
".",
"If",
"one",
"is",
"created",
"the",
"page",
"flow",
"stack",
"(",
"for",
"nesti... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java#L587-L594 |
cubedtear/aritzh | aritzh-core/src/main/java/io/github/aritzhack/aritzh/util/IOUtil.java | IOUtil.chooseFile | public static File chooseFile(String title, File currentDir) {
"""
Open a {@link javax.swing.JFileChooser}, and return the selected file, or null if closed or cancelled.
@param title The title of the file-chooser window.
@param currentDir The root directory. If null, {@code new File(".")} will be used.
@... | java | public static File chooseFile(String title, File currentDir) {
if (currentDir == null) currentDir = new File(".");
JFileChooser fileChooser = new JFileChooser();
fileChooser.setCurrentDirectory(currentDir);
fileChooser.setDialogTitle(title);
fileChooser.setMultiSelectionEnabled(false);
int result = fileChoo... | [
"public",
"static",
"File",
"chooseFile",
"(",
"String",
"title",
",",
"File",
"currentDir",
")",
"{",
"if",
"(",
"currentDir",
"==",
"null",
")",
"currentDir",
"=",
"new",
"File",
"(",
"\".\"",
")",
";",
"JFileChooser",
"fileChooser",
"=",
"new",
"JFileCh... | Open a {@link javax.swing.JFileChooser}, and return the selected file, or null if closed or cancelled.
@param title The title of the file-chooser window.
@param currentDir The root directory. If null, {@code new File(".")} will be used.
@return The chosen file, or null if none was chosen. | [
"Open",
"a",
"{",
"@link",
"javax",
".",
"swing",
".",
"JFileChooser",
"}",
"and",
"return",
"the",
"selected",
"file",
"or",
"null",
"if",
"closed",
"or",
"cancelled",
"."
] | train | https://github.com/cubedtear/aritzh/blob/bc7493447a1a6088c4a7306ca4d0f0c20278364f/aritzh-core/src/main/java/io/github/aritzhack/aritzh/util/IOUtil.java#L73-L84 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlImplementation.java | AptControlImplementation.initSuperClass | private AptControlImplementation initSuperClass() {
"""
Initializes the super interface that this ControlImpl extends (or null if a
base class)
"""
if ( _implDecl == null || _implDecl.getSuperclass() == null )
return null;
ClassDeclaration superDecl = _implDecl.getSupercla... | java | private AptControlImplementation initSuperClass()
{
if ( _implDecl == null || _implDecl.getSuperclass() == null )
return null;
ClassDeclaration superDecl = _implDecl.getSuperclass().getDeclaration();
if (superDecl != null &&
superDecl.getAnnotation(org.apach... | [
"private",
"AptControlImplementation",
"initSuperClass",
"(",
")",
"{",
"if",
"(",
"_implDecl",
"==",
"null",
"||",
"_implDecl",
".",
"getSuperclass",
"(",
")",
"==",
"null",
")",
"return",
"null",
";",
"ClassDeclaration",
"superDecl",
"=",
"_implDecl",
".",
"... | Initializes the super interface that this ControlImpl extends (or null if a
base class) | [
"Initializes",
"the",
"super",
"interface",
"that",
"this",
"ControlImpl",
"extends",
"(",
"or",
"null",
"if",
"a",
"base",
"class",
")"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlImplementation.java#L112-L125 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/thrift/CassandraSchemaMgr.java | CassandraSchemaMgr.keyspaceExists | public boolean keyspaceExists(DBConn dbConn, String keyspace) {
"""
Return true if a keyspace with the given name exists. This method can be used with
any DB connection.
@param dbConn Database connection to use.
@param keyspace Keyspace name.
@return True if it exists.
"""
try {
... | java | public boolean keyspaceExists(DBConn dbConn, String keyspace) {
try {
dbConn.getClientSession().describe_keyspace(keyspace);
return true;
} catch (Exception e) {
return false; // Notfound
}
} | [
"public",
"boolean",
"keyspaceExists",
"(",
"DBConn",
"dbConn",
",",
"String",
"keyspace",
")",
"{",
"try",
"{",
"dbConn",
".",
"getClientSession",
"(",
")",
".",
"describe_keyspace",
"(",
"keyspace",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"Ex... | Return true if a keyspace with the given name exists. This method can be used with
any DB connection.
@param dbConn Database connection to use.
@param keyspace Keyspace name.
@return True if it exists. | [
"Return",
"true",
"if",
"a",
"keyspace",
"with",
"the",
"given",
"name",
"exists",
".",
"This",
"method",
"can",
"be",
"used",
"with",
"any",
"DB",
"connection",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/CassandraSchemaMgr.java#L103-L110 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepsInner.java | BuildStepsInner.listBuildArgumentsAsync | public Observable<Page<BuildArgumentInner>> listBuildArgumentsAsync(final String resourceGroupName, final String registryName, final String buildTaskName, final String stepName) {
"""
List the build arguments for a step including the secret arguments.
@param resourceGroupName The name of the resource group to w... | java | public Observable<Page<BuildArgumentInner>> listBuildArgumentsAsync(final String resourceGroupName, final String registryName, final String buildTaskName, final String stepName) {
return listBuildArgumentsWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName)
.map(new Fun... | [
"public",
"Observable",
"<",
"Page",
"<",
"BuildArgumentInner",
">",
">",
"listBuildArgumentsAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"registryName",
",",
"final",
"String",
"buildTaskName",
",",
"final",
"String",
"stepName",
")"... | List the build arguments for a step including the secret arguments.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param buildTaskName The name of the container registry build task.
@param stepName The name of a ... | [
"List",
"the",
"build",
"arguments",
"for",
"a",
"step",
"including",
"the",
"secret",
"arguments",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepsInner.java#L1141-L1149 |
lingochamp/okdownload | okdownload/src/main/java/com/liulishuo/okdownload/DownloadTask.java | DownloadTask.addTag | public synchronized DownloadTask addTag(int key, Object value) {
"""
Add the {@code tag} identify with the {@code key} you can use it through {@link #getTag(int)}
@param key the identify of the tag.
@param value the value of the tag.
"""
if (keyTagMap == null) {
synchronized (this) {
... | java | public synchronized DownloadTask addTag(int key, Object value) {
if (keyTagMap == null) {
synchronized (this) {
if (keyTagMap == null) keyTagMap = new SparseArray<>();
}
}
keyTagMap.put(key, value);
return this;
} | [
"public",
"synchronized",
"DownloadTask",
"addTag",
"(",
"int",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"keyTagMap",
"==",
"null",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"keyTagMap",
"==",
"null",
")",
"keyTagMap",
"=",
... | Add the {@code tag} identify with the {@code key} you can use it through {@link #getTag(int)}
@param key the identify of the tag.
@param value the value of the tag. | [
"Add",
"the",
"{",
"@code",
"tag",
"}",
"identify",
"with",
"the",
"{",
"@code",
"key",
"}",
"you",
"can",
"use",
"it",
"through",
"{",
"@link",
"#getTag",
"(",
"int",
")",
"}"
] | train | https://github.com/lingochamp/okdownload/blob/403e2c814556ef7f2fade1f5bee83a02a5eaecb2/okdownload/src/main/java/com/liulishuo/okdownload/DownloadTask.java#L452-L461 |
mediathekview/MLib | src/main/java/de/mediathekview/mlib/filmlisten/WriteFilmlistJson.java | WriteFilmlistJson.filmlisteSchreibenJsonCompressed | public void filmlisteSchreibenJsonCompressed(String datei, ListeFilme listeFilme) {
"""
Write film data and compress with LZMA2.
@param datei file path
@param listeFilme film data
"""
final String tempFile = datei + "_temp";
filmlisteSchreibenJson(tempFile, listeFilme);
try {
... | java | public void filmlisteSchreibenJsonCompressed(String datei, ListeFilme listeFilme) {
final String tempFile = datei + "_temp";
filmlisteSchreibenJson(tempFile, listeFilme);
try {
Log.sysLog("Komprimiere Datei: " + datei);
if (datei.endsWith(Const.FORMAT_XZ)) {
... | [
"public",
"void",
"filmlisteSchreibenJsonCompressed",
"(",
"String",
"datei",
",",
"ListeFilme",
"listeFilme",
")",
"{",
"final",
"String",
"tempFile",
"=",
"datei",
"+",
"\"_temp\"",
";",
"filmlisteSchreibenJson",
"(",
"tempFile",
",",
"listeFilme",
")",
";",
"tr... | Write film data and compress with LZMA2.
@param datei file path
@param listeFilme film data | [
"Write",
"film",
"data",
"and",
"compress",
"with",
"LZMA2",
"."
] | train | https://github.com/mediathekview/MLib/blob/01fd5791d87390fea7536275b8a2d4407fc00908/src/main/java/de/mediathekview/mlib/filmlisten/WriteFilmlistJson.java#L74-L96 |
mapbox/mapbox-navigation-android | libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/RouteProcessorThreadListener.java | RouteProcessorThreadListener.onNewRouteProgress | @Override
public void onNewRouteProgress(Location location, RouteProgress routeProgress) {
"""
Corresponds to ProgressChangeListener object, updating the notification and passing information
to the navigation event dispatcher.
"""
notificationProvider.updateNavigationNotification(routeProgress);
eve... | java | @Override
public void onNewRouteProgress(Location location, RouteProgress routeProgress) {
notificationProvider.updateNavigationNotification(routeProgress);
eventDispatcher.onProgressChange(location, routeProgress);
} | [
"@",
"Override",
"public",
"void",
"onNewRouteProgress",
"(",
"Location",
"location",
",",
"RouteProgress",
"routeProgress",
")",
"{",
"notificationProvider",
".",
"updateNavigationNotification",
"(",
"routeProgress",
")",
";",
"eventDispatcher",
".",
"onProgressChange",
... | Corresponds to ProgressChangeListener object, updating the notification and passing information
to the navigation event dispatcher. | [
"Corresponds",
"to",
"ProgressChangeListener",
"object",
"updating",
"the",
"notification",
"and",
"passing",
"information",
"to",
"the",
"navigation",
"event",
"dispatcher",
"."
] | train | https://github.com/mapbox/mapbox-navigation-android/blob/375a89c017d360b9defc2c90d0c03468165162ec/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/RouteProcessorThreadListener.java#L31-L35 |
urbanairship/datacube | src/main/java/com/urbanairship/datacube/backfill/HBaseBackfillMerger.java | HBaseBackfillMerger.truncateScan | private static final Scan truncateScan(Scan scan, byte[] rangeStart, byte[] rangeEnd) {
"""
Given a scan and a key range, return a new Scan whose range is truncated to only include keys in
that range. Returns null if the Scan does not overlap the given range.
"""
byte[] scanStart = scan.getStartRow();... | java | private static final Scan truncateScan(Scan scan, byte[] rangeStart, byte[] rangeEnd) {
byte[] scanStart = scan.getStartRow();
byte[] scanEnd = scan.getStopRow();
if (scanEnd.length > 0 && bytesCompare(scanEnd, rangeStart) <= 0) {
// The entire scan range is before the entire cube k... | [
"private",
"static",
"final",
"Scan",
"truncateScan",
"(",
"Scan",
"scan",
",",
"byte",
"[",
"]",
"rangeStart",
",",
"byte",
"[",
"]",
"rangeEnd",
")",
"{",
"byte",
"[",
"]",
"scanStart",
"=",
"scan",
".",
"getStartRow",
"(",
")",
";",
"byte",
"[",
"... | Given a scan and a key range, return a new Scan whose range is truncated to only include keys in
that range. Returns null if the Scan does not overlap the given range. | [
"Given",
"a",
"scan",
"and",
"a",
"key",
"range",
"return",
"a",
"new",
"Scan",
"whose",
"range",
"is",
"truncated",
"to",
"only",
"include",
"keys",
"in",
"that",
"range",
".",
"Returns",
"null",
"if",
"the",
"Scan",
"does",
"not",
"overlap",
"the",
"... | train | https://github.com/urbanairship/datacube/blob/89c6b68744cc384c8b49f921cdb0a0f9f414ada6/src/main/java/com/urbanairship/datacube/backfill/HBaseBackfillMerger.java#L199-L230 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/utilities/PHPMethods.java | PHPMethods.preg_match | public static int preg_match(String regex, String subject) {
"""
Matches a string with a regex.
@param regex
@param subject
@return
"""
Pattern p = Pattern.compile(regex);
return preg_match(p, subject);
} | java | public static int preg_match(String regex, String subject) {
Pattern p = Pattern.compile(regex);
return preg_match(p, subject);
} | [
"public",
"static",
"int",
"preg_match",
"(",
"String",
"regex",
",",
"String",
"subject",
")",
"{",
"Pattern",
"p",
"=",
"Pattern",
".",
"compile",
"(",
"regex",
")",
";",
"return",
"preg_match",
"(",
"p",
",",
"subject",
")",
";",
"}"
] | Matches a string with a regex.
@param regex
@param subject
@return | [
"Matches",
"a",
"string",
"with",
"a",
"regex",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/utilities/PHPMethods.java#L137-L140 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.typeTextInWebElement | public void typeTextInWebElement(By by, String text) {
"""
Types text in a WebElement matching the specified By object.
@param by the By object. Examples are: {@code By.id("id")} and {@code By.name("name")}
@param text the text to enter in the {@link WebElement} field
"""
if(config.commandLogging){
Lo... | java | public void typeTextInWebElement(By by, String text){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "typeTextInWebElement("+by+", \""+text+"\")");
}
typeTextInWebElement(by, text, 0);
} | [
"public",
"void",
"typeTextInWebElement",
"(",
"By",
"by",
",",
"String",
"text",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"typeTextInWebElement(\"",
"+",
"by",
"+",
"\... | Types text in a WebElement matching the specified By object.
@param by the By object. Examples are: {@code By.id("id")} and {@code By.name("name")}
@param text the text to enter in the {@link WebElement} field | [
"Types",
"text",
"in",
"a",
"WebElement",
"matching",
"the",
"specified",
"By",
"object",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L2744-L2750 |
apache/flink | flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/AbstractServerBase.java | AbstractServerBase.attemptToBind | private boolean attemptToBind(final int port) throws Throwable {
"""
Tries to start the server at the provided port.
<p>This, in conjunction with {@link #start()}, try to start the
server on a free port among the port range provided at the constructor.
@param port the port to try to bind the server to.
@th... | java | private boolean attemptToBind(final int port) throws Throwable {
log.debug("Attempting to start {} on port {}.", serverName, port);
this.queryExecutor = createQueryExecutor();
this.handler = initializeHandler();
final NettyBufferPool bufferPool = new NettyBufferPool(numEventLoopThreads);
final ThreadFactor... | [
"private",
"boolean",
"attemptToBind",
"(",
"final",
"int",
"port",
")",
"throws",
"Throwable",
"{",
"log",
".",
"debug",
"(",
"\"Attempting to start {} on port {}.\"",
",",
"serverName",
",",
"port",
")",
";",
"this",
".",
"queryExecutor",
"=",
"createQueryExecut... | Tries to start the server at the provided port.
<p>This, in conjunction with {@link #start()}, try to start the
server on a free port among the port range provided at the constructor.
@param port the port to try to bind the server to.
@throws Exception If something goes wrong during the bind operation. | [
"Tries",
"to",
"start",
"the",
"server",
"at",
"the",
"provided",
"port",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/AbstractServerBase.java#L211-L279 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/taglib/jsf/AbstractHtmlImageTag.java | AbstractHtmlImageTag.prepareAttribute | protected void prepareAttribute(StringBuffer handlers, String name, boolean value) {
"""
Prepares an attribute if the value is not null, appending it to the the
given StringBuffer.
@param handlers
The StringBuffer that output will be appended to.
@param name
the property name
@param value
the property val... | java | protected void prepareAttribute(StringBuffer handlers, String name, boolean value) {
handlers.append(" ");
handlers.append(name);
handlers.append("=\"");
handlers.append(value);
handlers.append("\"");
} | [
"protected",
"void",
"prepareAttribute",
"(",
"StringBuffer",
"handlers",
",",
"String",
"name",
",",
"boolean",
"value",
")",
"{",
"handlers",
".",
"append",
"(",
"\" \"",
")",
";",
"handlers",
".",
"append",
"(",
"name",
")",
";",
"handlers",
".",
"appen... | Prepares an attribute if the value is not null, appending it to the the
given StringBuffer.
@param handlers
The StringBuffer that output will be appended to.
@param name
the property name
@param value
the property value | [
"Prepares",
"an",
"attribute",
"if",
"the",
"value",
"is",
"not",
"null",
"appending",
"it",
"to",
"the",
"the",
"given",
"StringBuffer",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/taglib/jsf/AbstractHtmlImageTag.java#L159-L167 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/BoundsOnRatiosInThetaSketchedSets.java | BoundsOnRatiosInThetaSketchedSets.getLowerBoundForBoverA | public static double getLowerBoundForBoverA(final Sketch sketchA, final Sketch sketchB) {
"""
Gets the approximate lower bound for B over A based on a 95% confidence interval
@param sketchA the sketch A
@param sketchB the sketch B
@return the approximate lower bound for B over A
"""
final double thetaA ... | java | public static double getLowerBoundForBoverA(final Sketch sketchA, final Sketch sketchB) {
final double thetaA = sketchA.getTheta();
final double thetaB = sketchB.getTheta();
checkThetas(thetaA, thetaB);
final int countB = sketchB.getRetainedEntries(true);
final int countA = (thetaB == thetaA) ? ske... | [
"public",
"static",
"double",
"getLowerBoundForBoverA",
"(",
"final",
"Sketch",
"sketchA",
",",
"final",
"Sketch",
"sketchB",
")",
"{",
"final",
"double",
"thetaA",
"=",
"sketchA",
".",
"getTheta",
"(",
")",
";",
"final",
"double",
"thetaB",
"=",
"sketchB",
... | Gets the approximate lower bound for B over A based on a 95% confidence interval
@param sketchA the sketch A
@param sketchB the sketch B
@return the approximate lower bound for B over A | [
"Gets",
"the",
"approximate",
"lower",
"bound",
"for",
"B",
"over",
"A",
"based",
"on",
"a",
"95%",
"confidence",
"interval"
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/BoundsOnRatiosInThetaSketchedSets.java#L41-L53 |
alkacon/opencms-core | src-setup/org/opencms/setup/ui/A_CmsSetupStep.java | A_CmsSetupStep.readSnippet | public String readSnippet(String name) {
"""
Reads an HTML snippet with the given name.
@return the HTML data
"""
String path = CmsStringUtil.joinPaths(
m_context.getSetupBean().getWebAppRfsPath(),
CmsSetupBean.FOLDER_SETUP,
"html",
name);
try... | java | public String readSnippet(String name) {
String path = CmsStringUtil.joinPaths(
m_context.getSetupBean().getWebAppRfsPath(),
CmsSetupBean.FOLDER_SETUP,
"html",
name);
try (InputStream stream = new FileInputStream(path)) {
byte[] data = CmsFile... | [
"public",
"String",
"readSnippet",
"(",
"String",
"name",
")",
"{",
"String",
"path",
"=",
"CmsStringUtil",
".",
"joinPaths",
"(",
"m_context",
".",
"getSetupBean",
"(",
")",
".",
"getWebAppRfsPath",
"(",
")",
",",
"CmsSetupBean",
".",
"FOLDER_SETUP",
",",
"... | Reads an HTML snippet with the given name.
@return the HTML data | [
"Reads",
"an",
"HTML",
"snippet",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/ui/A_CmsSetupStep.java#L94-L108 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/RoutingTrie.java | RoutingTrie.findNode | @Nullable
@VisibleForTesting
Node<V> findNode(String path, boolean exact) {
"""
Returns a {@link Node} which is mapped to the given {@code path}.
If {@code exact} is {@code true}, internally-added node may be returned.
"""
requireNonNull(path, "path");
return findNode(root, path, 0, ex... | java | @Nullable
@VisibleForTesting
Node<V> findNode(String path, boolean exact) {
requireNonNull(path, "path");
return findNode(root, path, 0, exact);
} | [
"@",
"Nullable",
"@",
"VisibleForTesting",
"Node",
"<",
"V",
">",
"findNode",
"(",
"String",
"path",
",",
"boolean",
"exact",
")",
"{",
"requireNonNull",
"(",
"path",
",",
"\"path\"",
")",
";",
"return",
"findNode",
"(",
"root",
",",
"path",
",",
"0",
... | Returns a {@link Node} which is mapped to the given {@code path}.
If {@code exact} is {@code true}, internally-added node may be returned. | [
"Returns",
"a",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/RoutingTrie.java#L96-L101 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/ModulesInner.java | ModulesInner.listByAutomationAccountWithServiceResponseAsync | public Observable<ServiceResponse<Page<ModuleInner>>> listByAutomationAccountWithServiceResponseAsync(final String resourceGroupName, final String automationAccountName) {
"""
Retrieve a list of modules.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the auto... | java | public Observable<ServiceResponse<Page<ModuleInner>>> listByAutomationAccountWithServiceResponseAsync(final String resourceGroupName, final String automationAccountName) {
return listByAutomationAccountSinglePageAsync(resourceGroupName, automationAccountName)
.concatMap(new Func1<ServiceResponse<Pag... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"ModuleInner",
">",
">",
">",
"listByAutomationAccountWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"automationAccountName",
")",
"{",
"return",
"listByAu... | Retrieve a list of modules.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<ModuleInner> object | [
"Retrieve",
"a",
"list",
"of",
"modules",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/ModulesInner.java#L540-L552 |
JetBrains/xodus | entity-store/src/main/java/jetbrains/exodus/entitystore/tables/TwoColumnTable.java | TwoColumnTable.get2 | @Nullable
public ByteIterable get2(@NotNull final Transaction txn, @NotNull final ByteIterable second) {
"""
Search for the second entry in the second database. Use this method for databases configured with no duplicates.
@param second second key (value for first).
@return null if no entry found, otherwise... | java | @Nullable
public ByteIterable get2(@NotNull final Transaction txn, @NotNull final ByteIterable second) {
return this.second.get(txn, second);
} | [
"@",
"Nullable",
"public",
"ByteIterable",
"get2",
"(",
"@",
"NotNull",
"final",
"Transaction",
"txn",
",",
"@",
"NotNull",
"final",
"ByteIterable",
"second",
")",
"{",
"return",
"this",
".",
"second",
".",
"get",
"(",
"txn",
",",
"second",
")",
";",
"}"... | Search for the second entry in the second database. Use this method for databases configured with no duplicates.
@param second second key (value for first).
@return null if no entry found, otherwise the value. | [
"Search",
"for",
"the",
"second",
"entry",
"in",
"the",
"second",
"database",
".",
"Use",
"this",
"method",
"for",
"databases",
"configured",
"with",
"no",
"duplicates",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/entity-store/src/main/java/jetbrains/exodus/entitystore/tables/TwoColumnTable.java#L65-L68 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/CollectionNamingConfusion.java | CollectionNamingConfusion.visitField | @Override
public void visitField(Field obj) {
"""
overrides the visitor to look for fields where the name has 'Map', 'Set', 'List' in it but the type of that field isn't that.
@param obj
the currently parsed field
"""
if (checkConfusedName(obj.getName(), obj.getSignature())) {
bugRe... | java | @Override
public void visitField(Field obj) {
if (checkConfusedName(obj.getName(), obj.getSignature())) {
bugReporter.reportBug(new BugInstance(this, BugType.CNC_COLLECTION_NAMING_CONFUSION.name(), NORMAL_PRIORITY).addClass(this).addField(this)
.addString(obj.getName()));
... | [
"@",
"Override",
"public",
"void",
"visitField",
"(",
"Field",
"obj",
")",
"{",
"if",
"(",
"checkConfusedName",
"(",
"obj",
".",
"getName",
"(",
")",
",",
"obj",
".",
"getSignature",
"(",
")",
")",
")",
"{",
"bugReporter",
".",
"reportBug",
"(",
"new",... | overrides the visitor to look for fields where the name has 'Map', 'Set', 'List' in it but the type of that field isn't that.
@param obj
the currently parsed field | [
"overrides",
"the",
"visitor",
"to",
"look",
"for",
"fields",
"where",
"the",
"name",
"has",
"Map",
"Set",
"List",
"in",
"it",
"but",
"the",
"type",
"of",
"that",
"field",
"isn",
"t",
"that",
"."
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/CollectionNamingConfusion.java#L97-L103 |
infinispan/infinispan | query/src/main/java/org/infinispan/query/dsl/embedded/impl/HibernateSearchPropertyHelper.java | HibernateSearchPropertyHelper.hasEmbeddedProperty | @Override
public boolean hasEmbeddedProperty(Class<?> entityType, String[] propertyPath) {
"""
Determines whether the given property path denotes an embedded entity (not a property of such entity).
@param entityType the indexed type
@param propertyPath the path of interest
@return {@code true} if the giv... | java | @Override
public boolean hasEmbeddedProperty(Class<?> entityType, String[] propertyPath) {
EntityIndexBinding indexBinding = searchFactory.getIndexBindings().get(entityType);
if (indexBinding != null) {
ResolvedProperty resolvedProperty = resolveProperty(indexBinding, propertyPath);
if ... | [
"@",
"Override",
"public",
"boolean",
"hasEmbeddedProperty",
"(",
"Class",
"<",
"?",
">",
"entityType",
",",
"String",
"[",
"]",
"propertyPath",
")",
"{",
"EntityIndexBinding",
"indexBinding",
"=",
"searchFactory",
".",
"getIndexBindings",
"(",
")",
".",
"get",
... | Determines whether the given property path denotes an embedded entity (not a property of such entity).
@param entityType the indexed type
@param propertyPath the path of interest
@return {@code true} if the given path denotes an embedded entity of the given indexed type, {@code false}
otherwise. | [
"Determines",
"whether",
"the",
"given",
"property",
"path",
"denotes",
"an",
"embedded",
"entity",
"(",
"not",
"a",
"property",
"of",
"such",
"entity",
")",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/query/src/main/java/org/infinispan/query/dsl/embedded/impl/HibernateSearchPropertyHelper.java#L276-L286 |
code4everything/util | src/main/java/com/zhazhapan/util/DateUtils.java | DateUtils.addYear | public static Date addYear(String date, int amount) throws ParseException {
"""
添加年份
@param date 日期
@param amount 数量
@return 添加后的日期
@throws ParseException 异常
"""
return add(date, Calendar.YEAR, amount);
} | java | public static Date addYear(String date, int amount) throws ParseException {
return add(date, Calendar.YEAR, amount);
} | [
"public",
"static",
"Date",
"addYear",
"(",
"String",
"date",
",",
"int",
"amount",
")",
"throws",
"ParseException",
"{",
"return",
"add",
"(",
"date",
",",
"Calendar",
".",
"YEAR",
",",
"amount",
")",
";",
"}"
] | 添加年份
@param date 日期
@param amount 数量
@return 添加后的日期
@throws ParseException 异常 | [
"添加年份"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/DateUtils.java#L397-L399 |
strator-dev/greenpepper | greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/Project.java | Project.removeRepository | public void removeRepository(Repository repo) throws GreenPepperServerException {
"""
<p>removeRepository.</p>
@param repo a {@link com.greenpepper.server.domain.Repository} object.
@throws com.greenpepper.server.GreenPepperServerException if any.
"""
if(!repositories.contains(repo))
{
... | java | public void removeRepository(Repository repo) throws GreenPepperServerException
{
if(!repositories.contains(repo))
{
throw new GreenPepperServerException( GreenPepperServerErrorKey.REPOSITORY_NOT_FOUND, "Repository not found");
}
repositories.remove(repo);
repo.s... | [
"public",
"void",
"removeRepository",
"(",
"Repository",
"repo",
")",
"throws",
"GreenPepperServerException",
"{",
"if",
"(",
"!",
"repositories",
".",
"contains",
"(",
"repo",
")",
")",
"{",
"throw",
"new",
"GreenPepperServerException",
"(",
"GreenPepperServerError... | <p>removeRepository.</p>
@param repo a {@link com.greenpepper.server.domain.Repository} object.
@throws com.greenpepper.server.GreenPepperServerException if any. | [
"<p",
">",
"removeRepository",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/Project.java#L138-L147 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/analyzer/PythonDistributionAnalyzer.java | PythonDistributionAnalyzer.getMatchingFile | private static File getMatchingFile(File folder, FilenameFilter filter) {
"""
Returns a list of files that match the given filter, this does not
recursively scan the directory.
@param folder the folder to filter
@param filter the filter to apply to the files in the directory
@return the list of Files in the ... | java | private static File getMatchingFile(File folder, FilenameFilter filter) {
File result = null;
final File[] matches = folder.listFiles(filter);
if (null != matches && 1 == matches.length) {
result = matches[0];
}
return result;
} | [
"private",
"static",
"File",
"getMatchingFile",
"(",
"File",
"folder",
",",
"FilenameFilter",
"filter",
")",
"{",
"File",
"result",
"=",
"null",
";",
"final",
"File",
"[",
"]",
"matches",
"=",
"folder",
".",
"listFiles",
"(",
"filter",
")",
";",
"if",
"(... | Returns a list of files that match the given filter, this does not
recursively scan the directory.
@param folder the folder to filter
@param filter the filter to apply to the files in the directory
@return the list of Files in the directory that match the provided filter | [
"Returns",
"a",
"list",
"of",
"files",
"that",
"match",
"the",
"given",
"filter",
"this",
"does",
"not",
"recursively",
"scan",
"the",
"directory",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/PythonDistributionAnalyzer.java#L354-L361 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.ortho2D | public Matrix4d ortho2D(double left, double right, double bottom, double top, Matrix4d dest) {
"""
Apply an orthographic projection transformation for a right-handed coordinate system
to this matrix and store the result in <code>dest</code>.
<p>
This method is equivalent to calling {@link #ortho(double, double,... | java | public Matrix4d ortho2D(double left, double right, double bottom, double top, Matrix4d dest) {
if ((properties & PROPERTY_IDENTITY) != 0)
return dest.setOrtho2D(left, right, bottom, top);
return ortho2DGeneric(left, right, bottom, top, dest);
} | [
"public",
"Matrix4d",
"ortho2D",
"(",
"double",
"left",
",",
"double",
"right",
",",
"double",
"bottom",
",",
"double",
"top",
",",
"Matrix4d",
"dest",
")",
"{",
"if",
"(",
"(",
"properties",
"&",
"PROPERTY_IDENTITY",
")",
"!=",
"0",
")",
"return",
"dest... | Apply an orthographic projection transformation for a right-handed coordinate system
to this matrix and store the result in <code>dest</code>.
<p>
This method is equivalent to calling {@link #ortho(double, double, double, double, double, double, Matrix4d) ortho()} with
<code>zNear=-1</code> and <code>zFar=+1</code>.
<p... | [
"Apply",
"an",
"orthographic",
"projection",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"to",
"this",
"matrix",
"and",
"store",
"the",
"result",
"in",
"<code",
">",
"dest<",
"/",
"code",
">",
".",
"<p",
">",
"This",
"meth... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L10561-L10565 |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java | StringUtils.checkSize | public static String checkSize(byte[] value, int limitSize) {
"""
Check size.
@param value the value
@param limitSize the limit size
@return the string
"""
if (value != null) {
if (value.length > limitSize) {
return bytesToHex(value, limitSize-3) + "...";
} else
return bytesToHex(value, va... | java | public static String checkSize(byte[] value, int limitSize) {
if (value != null) {
if (value.length > limitSize) {
return bytesToHex(value, limitSize-3) + "...";
} else
return bytesToHex(value, value.length);
} else
return null;
} | [
"public",
"static",
"String",
"checkSize",
"(",
"byte",
"[",
"]",
"value",
",",
"int",
"limitSize",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"if",
"(",
"value",
".",
"length",
">",
"limitSize",
")",
"{",
"return",
"bytesToHex",
"(",
"val... | Check size.
@param value the value
@param limitSize the limit size
@return the string | [
"Check",
"size",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java#L120-L129 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.setProgressBar | public void setProgressBar(int index, int progress) {
"""
Sets the progress of a ProgressBar matching the specified index. Examples of ProgressBars are: {@link android.widget.SeekBar} and {@link android.widget.RatingBar}.
@param index the index of the {@link ProgressBar}
@param progress the progress to set the... | java | public void setProgressBar(int index, int progress){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "setProgressBar("+index+", "+progress+")");
}
setProgressBar(waiter.waitForAndGetView(index, ProgressBar.class), progress);
} | [
"public",
"void",
"setProgressBar",
"(",
"int",
"index",
",",
"int",
"progress",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"setProgressBar(\"",
"+",
"index",
"+",
"\", \... | Sets the progress of a ProgressBar matching the specified index. Examples of ProgressBars are: {@link android.widget.SeekBar} and {@link android.widget.RatingBar}.
@param index the index of the {@link ProgressBar}
@param progress the progress to set the {@link ProgressBar} | [
"Sets",
"the",
"progress",
"of",
"a",
"ProgressBar",
"matching",
"the",
"specified",
"index",
".",
"Examples",
"of",
"ProgressBars",
"are",
":",
"{",
"@link",
"android",
".",
"widget",
".",
"SeekBar",
"}",
"and",
"{",
"@link",
"android",
".",
"widget",
"."... | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L2587-L2593 |
threerings/playn | core/src/playn/core/AbstractPlatform.java | AbstractPlatform.notifySuccess | public <T> void notifySuccess(final Callback<T> callback, final T result) {
"""
Delivers {@code result} to {@code callback} on the next game tick (on the PlayN thread).
"""
invokeLater(new Runnable() {
public void run() {
callback.onSuccess(result);
}
});
} | java | public <T> void notifySuccess(final Callback<T> callback, final T result) {
invokeLater(new Runnable() {
public void run() {
callback.onSuccess(result);
}
});
} | [
"public",
"<",
"T",
">",
"void",
"notifySuccess",
"(",
"final",
"Callback",
"<",
"T",
">",
"callback",
",",
"final",
"T",
"result",
")",
"{",
"invokeLater",
"(",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"(",
")",
"{",
"callback",
".... | Delivers {@code result} to {@code callback} on the next game tick (on the PlayN thread). | [
"Delivers",
"{"
] | train | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/AbstractPlatform.java#L66-L72 |
apache/flink | flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/util/SetCache.java | SetCache.getSortedGrouping | @SuppressWarnings("unchecked")
public <T> SortedGrouping<T> getSortedGrouping(int id) {
"""
Returns the cached {@link SortedGrouping} for the given ID.
@param id Set ID
@param <T> SortedGrouping type
@return Cached SortedGrouping
@throws IllegalStateException if the cached set is not a SortedGrouping
"... | java | @SuppressWarnings("unchecked")
public <T> SortedGrouping<T> getSortedGrouping(int id) {
return verifyType(id, sortedGroupings.get(id), SetType.SORTED_GROUPING);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"SortedGrouping",
"<",
"T",
">",
"getSortedGrouping",
"(",
"int",
"id",
")",
"{",
"return",
"verifyType",
"(",
"id",
",",
"sortedGroupings",
".",
"get",
"(",
"id",
")",
",",
"Se... | Returns the cached {@link SortedGrouping} for the given ID.
@param id Set ID
@param <T> SortedGrouping type
@return Cached SortedGrouping
@throws IllegalStateException if the cached set is not a SortedGrouping | [
"Returns",
"the",
"cached",
"{",
"@link",
"SortedGrouping",
"}",
"for",
"the",
"given",
"ID",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/util/SetCache.java#L182-L185 |
j256/simplejmx | src/main/java/com/j256/simplejmx/client/JmxClient.java | JmxClient.getOperationsInfo | public MBeanOperationInfo[] getOperationsInfo(String domainName, String beanName) throws JMException {
"""
Return an array of the operations associated with the bean name.
"""
return getOperationsInfo(ObjectNameUtil.makeObjectName(domainName, beanName));
} | java | public MBeanOperationInfo[] getOperationsInfo(String domainName, String beanName) throws JMException {
return getOperationsInfo(ObjectNameUtil.makeObjectName(domainName, beanName));
} | [
"public",
"MBeanOperationInfo",
"[",
"]",
"getOperationsInfo",
"(",
"String",
"domainName",
",",
"String",
"beanName",
")",
"throws",
"JMException",
"{",
"return",
"getOperationsInfo",
"(",
"ObjectNameUtil",
".",
"makeObjectName",
"(",
"domainName",
",",
"beanName",
... | Return an array of the operations associated with the bean name. | [
"Return",
"an",
"array",
"of",
"the",
"operations",
"associated",
"with",
"the",
"bean",
"name",
"."
] | train | https://github.com/j256/simplejmx/blob/1a04f52512dfa0a711ba0cc7023c604dbc82a352/src/main/java/com/j256/simplejmx/client/JmxClient.java#L267-L269 |
twitter/hraven | hraven-core/src/main/java/com/twitter/hraven/datasource/AppVersionService.java | AppVersionService.getDistinctVersions | public List<VersionInfo> getDistinctVersions(String cluster, String user,
String appId) throws IOException {
"""
Returns the list of distinct versions for the given application sorted in
reverse chronological order
@param cluster
@param user
@param appId
@return the list of versions sorted in reverse ... | java | public List<VersionInfo> getDistinctVersions(String cluster, String user,
String appId) throws IOException {
Get get = new Get(getRowKey(cluster, user, appId));
List<VersionInfo> versions = Lists.newArrayList();
Long ts = 0L;
Table versionsTable = null;
try {
versionsTable = hbaseConnect... | [
"public",
"List",
"<",
"VersionInfo",
">",
"getDistinctVersions",
"(",
"String",
"cluster",
",",
"String",
"user",
",",
"String",
"appId",
")",
"throws",
"IOException",
"{",
"Get",
"get",
"=",
"new",
"Get",
"(",
"getRowKey",
"(",
"cluster",
",",
"user",
",... | Returns the list of distinct versions for the given application sorted in
reverse chronological order
@param cluster
@param user
@param appId
@return the list of versions sorted in reverse chronological order (the
list will be empty if no versions are found)
@throws IOException | [
"Returns",
"the",
"list",
"of",
"distinct",
"versions",
"for",
"the",
"given",
"application",
"sorted",
"in",
"reverse",
"chronological",
"order"
] | train | https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/AppVersionService.java#L110-L149 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/Collections.java | Collections.everyWithin | public static SatisfiesBuilder everyWithin(String variable, Expression expression) {
"""
Create an EVERY comprehension with a first WITHIN range.
EVERY is a range predicate that allows you to test a Boolean condition over the elements or attributes of a
collection, object, or objects. It uses the IN and WITHIN... | java | public static SatisfiesBuilder everyWithin(String variable, Expression expression) {
return new SatisfiesBuilder(x("EVERY"), variable, expression, false);
} | [
"public",
"static",
"SatisfiesBuilder",
"everyWithin",
"(",
"String",
"variable",
",",
"Expression",
"expression",
")",
"{",
"return",
"new",
"SatisfiesBuilder",
"(",
"x",
"(",
"\"EVERY\"",
")",
",",
"variable",
",",
"expression",
",",
"false",
")",
";",
"}"
] | Create an EVERY comprehension with a first WITHIN range.
EVERY is a range predicate that allows you to test a Boolean condition over the elements or attributes of a
collection, object, or objects. It uses the IN and WITHIN operators to range through the collection.
IN ranges in the direct elements of its array expres... | [
"Create",
"an",
"EVERY",
"comprehension",
"with",
"a",
"first",
"WITHIN",
"range",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/Collections.java#L214-L216 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLAnnotationImpl_CustomFieldSerializer.java | OWLAnnotationImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLAnnotationImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.use... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLAnnotationImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLAnnotationImpl",
"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.clie... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{"
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLAnnotationImpl_CustomFieldSerializer.java#L93-L96 |
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.listByResourceGroupAsync | public Observable<Page<DataLakeAnalyticsAccountInner>> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) {
"""
Gets the f... | java | public Observable<Page<DataLakeAnalyticsAccountInner>> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) {
return list... | [
"public",
"Observable",
"<",
"Page",
"<",
"DataLakeAnalyticsAccountInner",
">",
">",
"listByResourceGroupAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"filter",
",",
"final",
"Integer",
"top",
",",
"final",
"Integer",
"skip",
",",
"f... | Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.
@param filter OData filter. Optional.
@param top The number of items... | [
"Gets",
"the",
"first",
"page",
"of",
"Data",
"Lake",
"Analytics",
"accounts",
"if",
"any",
"within",
"a",
"specific",
"resource",
"group",
".",
"This",
"includes",
"a",
"link",
"to",
"the",
"next",
"page",
"if",
"any",
"."
] | 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#L1997-L2005 |
looly/hutool | hutool-json/src/main/java/cn/hutool/json/JSONUtil.java | JSONUtil.toBean | public static <T> T toBean(JSONObject json, Class<T> beanClass) {
"""
转为实体类对象,转换异常将被抛出
@param <T> Bean类型
@param json JSONObject
@param beanClass 实体类对象
@return 实体类对象
"""
return null == json ? null : json.toBean(beanClass);
} | java | public static <T> T toBean(JSONObject json, Class<T> beanClass) {
return null == json ? null : json.toBean(beanClass);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"toBean",
"(",
"JSONObject",
"json",
",",
"Class",
"<",
"T",
">",
"beanClass",
")",
"{",
"return",
"null",
"==",
"json",
"?",
"null",
":",
"json",
".",
"toBean",
"(",
"beanClass",
")",
";",
"}"
] | 转为实体类对象,转换异常将被抛出
@param <T> Bean类型
@param json JSONObject
@param beanClass 实体类对象
@return 实体类对象 | [
"转为实体类对象,转换异常将被抛出"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONUtil.java#L342-L344 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.withReader | public static <T> T withReader(Reader reader, @ClosureParams(value=SimpleType.class, options="java.io.Reader") Closure<T> closure) throws IOException {
"""
Allows this reader to be used within the closure, ensuring that it
is closed before this method returns.
@param reader the reader which is used and then c... | java | public static <T> T withReader(Reader reader, @ClosureParams(value=SimpleType.class, options="java.io.Reader") Closure<T> closure) throws IOException {
try {
T result = closure.call(reader);
Reader temp = reader;
reader = null;
temp.close();
return r... | [
"public",
"static",
"<",
"T",
">",
"T",
"withReader",
"(",
"Reader",
"reader",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.Reader\"",
")",
"Closure",
"<",
"T",
">",
"closure",
")",
"throws",
"... | Allows this reader to be used within the closure, ensuring that it
is closed before this method returns.
@param reader the reader which is used and then closed
@param closure the closure that the writer is passed into
@return the value returned by the closure
@throws IOException if an IOException occurs.
@since 1.5.2 | [
"Allows",
"this",
"reader",
"to",
"be",
"used",
"within",
"the",
"closure",
"ensuring",
"that",
"it",
"is",
"closed",
"before",
"this",
"method",
"returns",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java#L1181-L1193 |
alkacon/opencms-core | src/org/opencms/jsp/util/CmsDynamicFunctionBeanWrapper.java | CmsDynamicFunctionBeanWrapper.getFormatFor | public Object getFormatFor() {
"""
Gets the lazy map for accessing the various function formats.<p>
@return a map which allows access to the various function formats
"""
Transformer mapFunction = new Transformer() {
public Object transform(Object param) {
if (m_f... | java | public Object getFormatFor() {
Transformer mapFunction = new Transformer() {
public Object transform(Object param) {
if (m_functionBean == null) {
return new CmsDynamicFunctionFormatWrapper(m_cms, null);
}
int width = -1... | [
"public",
"Object",
"getFormatFor",
"(",
")",
"{",
"Transformer",
"mapFunction",
"=",
"new",
"Transformer",
"(",
")",
"{",
"public",
"Object",
"transform",
"(",
"Object",
"param",
")",
"{",
"if",
"(",
"m_functionBean",
"==",
"null",
")",
"{",
"return",
"ne... | Gets the lazy map for accessing the various function formats.<p>
@return a map which allows access to the various function formats | [
"Gets",
"the",
"lazy",
"map",
"for",
"accessing",
"the",
"various",
"function",
"formats",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsDynamicFunctionBeanWrapper.java#L68-L100 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/MalisisCore.java | MalisisCore.isClientClass | private boolean isClientClass(String className, Set<ASMData> clientClasses) {
"""
Checks if is the specified class has a @SideOnly(Side.CLIENT) annotation.
@param className the class name
@param clientClasses the client classes
@return true, if is client class
"""
for (ASMData data : clientClasses)
{
... | java | private boolean isClientClass(String className, Set<ASMData> clientClasses)
{
for (ASMData data : clientClasses)
{
if (data.getClassName().equals(className) && data.getObjectName().equals(data.getClassName())
&& ((ModAnnotation.EnumHolder) data.getAnnotationInfo().get("value")).getValue().equals("CLIENT"))... | [
"private",
"boolean",
"isClientClass",
"(",
"String",
"className",
",",
"Set",
"<",
"ASMData",
">",
"clientClasses",
")",
"{",
"for",
"(",
"ASMData",
"data",
":",
"clientClasses",
")",
"{",
"if",
"(",
"data",
".",
"getClassName",
"(",
")",
".",
"equals",
... | Checks if is the specified class has a @SideOnly(Side.CLIENT) annotation.
@param className the class name
@param clientClasses the client classes
@return true, if is client class | [
"Checks",
"if",
"is",
"the",
"specified",
"class",
"has",
"a",
"@SideOnly",
"(",
"Side",
".",
"CLIENT",
")",
"annotation",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/MalisisCore.java#L218-L227 |
spotify/helios | helios-services/src/main/java/com/spotify/helios/agent/TaskConfig.java | TaskConfig.containerEnv | public Map<String, String> containerEnv() {
"""
Get environment variables for the container.
@return The environment variables.
"""
final Map<String, String> env = Maps.newHashMap(envVars);
// Put in variables that tell the container where it's exposed
for (final Entry<String, Integer> entry : ... | java | public Map<String, String> containerEnv() {
final Map<String, String> env = Maps.newHashMap(envVars);
// Put in variables that tell the container where it's exposed
for (final Entry<String, Integer> entry : ports.entrySet()) {
env.put("HELIOS_PORT_" + entry.getKey(), host + ":" + entry.getValue());
... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"containerEnv",
"(",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"env",
"=",
"Maps",
".",
"newHashMap",
"(",
"envVars",
")",
";",
"// Put in variables that tell the container where it's exposed... | Get environment variables for the container.
@return The environment variables. | [
"Get",
"environment",
"variables",
"for",
"the",
"container",
"."
] | train | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-services/src/main/java/com/spotify/helios/agent/TaskConfig.java#L146-L156 |
wwadge/bonecp | bonecp/src/main/java/com/jolbox/bonecp/ConnectionHandle.java | ConnectionHandle.recreateConnectionHandle | public ConnectionHandle recreateConnectionHandle() throws SQLException {
"""
Creates the connection handle again. We use this method to create a brand new connection
handle. That way if the application (wrongly) tries to do something else with the connection
that has already been "closed", it will fail.
@return... | java | public ConnectionHandle recreateConnectionHandle() throws SQLException{
ConnectionHandle handle = new ConnectionHandle(this.connection, this.originatingPartition, this.pool, true);
handle.originatingPartition = this.originatingPartition;
handle.connectionCreationTimeInMs = this.connectionCreationTimeInMs;
h... | [
"public",
"ConnectionHandle",
"recreateConnectionHandle",
"(",
")",
"throws",
"SQLException",
"{",
"ConnectionHandle",
"handle",
"=",
"new",
"ConnectionHandle",
"(",
"this",
".",
"connection",
",",
"this",
".",
"originatingPartition",
",",
"this",
".",
"pool",
",",
... | Creates the connection handle again. We use this method to create a brand new connection
handle. That way if the application (wrongly) tries to do something else with the connection
that has already been "closed", it will fail.
@return ConnectionHandle
@throws SQLException | [
"Creates",
"the",
"connection",
"handle",
"again",
".",
"We",
"use",
"this",
"method",
"to",
"create",
"a",
"brand",
"new",
"connection",
"handle",
".",
"That",
"way",
"if",
"the",
"application",
"(",
"wrongly",
")",
"tries",
"to",
"do",
"something",
"else... | train | https://github.com/wwadge/bonecp/blob/74bc3287025fc137ca28909f0f7693edae37a15d/bonecp/src/main/java/com/jolbox/bonecp/ConnectionHandle.java#L279-L294 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WFieldLayoutExample.java | WFieldLayoutExample.recursiveFieldLayout | private WFieldLayout recursiveFieldLayout(final int curr, final int startAt) {
"""
Create a recursive field layout.
@param curr recursion index
@param startAt the ordered offset
@return the recursive field layout.
"""
WFieldLayout innerLayout = new WFieldLayout();
innerLayout.setLabelWidth(20);
if ... | java | private WFieldLayout recursiveFieldLayout(final int curr, final int startAt) {
WFieldLayout innerLayout = new WFieldLayout();
innerLayout.setLabelWidth(20);
if (curr == 0 && startAt == 0) {
innerLayout.setMargin(new Margin(Size.LARGE, null, null, null));
}
innerLayout.setOrdered(true);
if (startAt > 1)... | [
"private",
"WFieldLayout",
"recursiveFieldLayout",
"(",
"final",
"int",
"curr",
",",
"final",
"int",
"startAt",
")",
"{",
"WFieldLayout",
"innerLayout",
"=",
"new",
"WFieldLayout",
"(",
")",
";",
"innerLayout",
".",
"setLabelWidth",
"(",
"20",
")",
";",
"if",
... | Create a recursive field layout.
@param curr recursion index
@param startAt the ordered offset
@return the recursive field layout. | [
"Create",
"a",
"recursive",
"field",
"layout",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WFieldLayoutExample.java#L194-L217 |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/spawn/StandardSpawnService.java | StandardSpawnService.fireAgentSpawnedOutsideAgent | protected void fireAgentSpawnedOutsideAgent(UUID spawningAgent, AgentContext context, Class<? extends Agent> agentClazz, List<Agent> agents,
Object... initializationParameters) {
"""
Notify the listeners about the agents' spawning.
@param spawningAgent the spawning agent.
@param context the context in which... | java | protected void fireAgentSpawnedOutsideAgent(UUID spawningAgent, AgentContext context, Class<? extends Agent> agentClazz, List<Agent> agents,
Object... initializationParameters) {
// Notify the listeners on the spawn events (not restricted to a single agent)
for (final SpawnServiceListener l : this.globalListener... | [
"protected",
"void",
"fireAgentSpawnedOutsideAgent",
"(",
"UUID",
"spawningAgent",
",",
"AgentContext",
"context",
",",
"Class",
"<",
"?",
"extends",
"Agent",
">",
"agentClazz",
",",
"List",
"<",
"Agent",
">",
"agents",
",",
"Object",
"...",
"initializationParamet... | Notify the listeners about the agents' spawning.
@param spawningAgent the spawning agent.
@param context the context in which the agents were spawned.
@param agentClazz the type of the spwnaed agents.
@param agents the spawned agents.
@param initializationParameters the initialization parameters. | [
"Notify",
"the",
"listeners",
"about",
"the",
"agents",
"spawning",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/spawn/StandardSpawnService.java#L213-L239 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/model/ResultDataModel.java | ResultDataModel.getRowData | public SortedMap<String,Object> getRowData() {
"""
<p>If row data is available, return the <code>SortedMap</code> array
element at the index specified by <code>rowIndex</code> of the
array returned by calling <code>getRows()</code> on the underlying
<code>Result</code>. If no wrapped data is available,
return... | java | public SortedMap<String,Object> getRowData() {
if (result == null) {
return (null);
} else if (!isRowAvailable()) {
throw new NoRowAvailableException();
} else {
//noinspection unchecked
return ((SortedMap<String,Object>)rows[index]);
}
} | [
"public",
"SortedMap",
"<",
"String",
",",
"Object",
">",
"getRowData",
"(",
")",
"{",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"return",
"(",
"null",
")",
";",
"}",
"else",
"if",
"(",
"!",
"isRowAvailable",
"(",
")",
")",
"{",
"throw",
"new",
... | <p>If row data is available, return the <code>SortedMap</code> array
element at the index specified by <code>rowIndex</code> of the
array returned by calling <code>getRows()</code> on the underlying
<code>Result</code>. If no wrapped data is available,
return <code>null</code>.</p>
<p>Note that, if a non-<code>null</... | [
"<p",
">",
"If",
"row",
"data",
"is",
"available",
"return",
"the",
"<code",
">",
"SortedMap<",
"/",
"code",
">",
"array",
"element",
"at",
"the",
"index",
"specified",
"by",
"<code",
">",
"rowIndex<",
"/",
"code",
">",
"of",
"the",
"array",
"returned",
... | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/model/ResultDataModel.java#L160-L171 |
geomajas/geomajas-project-client-gwt2 | common-gwt/command/src/main/java/org/geomajas/gwt/client/util/Log.java | Log.logDebug | public static void logDebug(String message, Throwable t) {
"""
Debug logging with cause.
@param message message
@param t cause
"""
logDebug(message + SEP + getMessage(t));
} | java | public static void logDebug(String message, Throwable t) {
logDebug(message + SEP + getMessage(t));
} | [
"public",
"static",
"void",
"logDebug",
"(",
"String",
"message",
",",
"Throwable",
"t",
")",
"{",
"logDebug",
"(",
"message",
"+",
"SEP",
"+",
"getMessage",
"(",
"t",
")",
")",
";",
"}"
] | Debug logging with cause.
@param message message
@param t cause | [
"Debug",
"logging",
"with",
"cause",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/Log.java#L99-L101 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaModule.java | JavaModule.addReads | public void addReads(Instrumentation instrumentation, JavaModule module) {
"""
Adds a read-edge to this module to the supplied module using the instrumentation API.
@param instrumentation The instrumentation instance to use for adding the edge.
@param module The module to add as a read dependency to t... | java | public void addReads(Instrumentation instrumentation, JavaModule module) {
DISPATCHER.addReads(instrumentation, this.module, module.unwrap());
} | [
"public",
"void",
"addReads",
"(",
"Instrumentation",
"instrumentation",
",",
"JavaModule",
"module",
")",
"{",
"DISPATCHER",
".",
"addReads",
"(",
"instrumentation",
",",
"this",
".",
"module",
",",
"module",
".",
"unwrap",
"(",
")",
")",
";",
"}"
] | Adds a read-edge to this module to the supplied module using the instrumentation API.
@param instrumentation The instrumentation instance to use for adding the edge.
@param module The module to add as a read dependency to this module. | [
"Adds",
"a",
"read",
"-",
"edge",
"to",
"this",
"module",
"to",
"the",
"supplied",
"module",
"using",
"the",
"instrumentation",
"API",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaModule.java#L152-L154 |
algolia/instantsearch-android | ui/src/main/java/com/algolia/instantsearch/ui/databinding/BindingHelper.java | BindingHelper.getFullAttribute | @NonNull
public static String getFullAttribute(@NonNull View view, @Nullable String rawAttributeValue) {
"""
Gets the full version of an attribute, with its eventual prefix and suffix.
@param view the view mapped to this attribute.
@param rawAttributeValue the raw value of the attribute.
@ret... | java | @NonNull
public static String getFullAttribute(@NonNull View view, @Nullable String rawAttributeValue) {
String attribute = "";
final String prefix = getPrefix(view);
final String suffix = getSuffix(view);
if (prefix != null) {
attribute = prefix;
}
attrib... | [
"@",
"NonNull",
"public",
"static",
"String",
"getFullAttribute",
"(",
"@",
"NonNull",
"View",
"view",
",",
"@",
"Nullable",
"String",
"rawAttributeValue",
")",
"{",
"String",
"attribute",
"=",
"\"\"",
";",
"final",
"String",
"prefix",
"=",
"getPrefix",
"(",
... | Gets the full version of an attribute, with its eventual prefix and suffix.
@param view the view mapped to this attribute.
@param rawAttributeValue the raw value of the attribute.
@return the attribute value, prefixed and suffixed if any was specified on the view. | [
"Gets",
"the",
"full",
"version",
"of",
"an",
"attribute",
"with",
"its",
"eventual",
"prefix",
"and",
"suffix",
"."
] | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/databinding/BindingHelper.java#L210-L223 |
aoindustries/ao-taglib | src/main/java/com/aoindustries/taglib/AttributeUtils.java | AttributeUtils.findAttributeParent | public static <T> T findAttributeParent(String fromTagName, JspTag from, String attribute, Class<? extends T> clazz) throws NeedAttributeParentException {
"""
Finds the attribute parent tag of the provided class (or subclass).
@return the parent tag
@exception NeedAttributeParentException if parent not foun... | java | public static <T> T findAttributeParent(String fromTagName, JspTag from, String attribute, Class<? extends T> clazz) throws NeedAttributeParentException {
T parent = clazz.cast(SimpleTagSupport.findAncestorWithClass(from, clazz));
if(parent==null) throw new NeedAttributeParentException(fromTagName, attribute);
re... | [
"public",
"static",
"<",
"T",
">",
"T",
"findAttributeParent",
"(",
"String",
"fromTagName",
",",
"JspTag",
"from",
",",
"String",
"attribute",
",",
"Class",
"<",
"?",
"extends",
"T",
">",
"clazz",
")",
"throws",
"NeedAttributeParentException",
"{",
"T",
"pa... | Finds the attribute parent tag of the provided class (or subclass).
@return the parent tag
@exception NeedAttributeParentException if parent not found | [
"Finds",
"the",
"attribute",
"parent",
"tag",
"of",
"the",
"provided",
"class",
"(",
"or",
"subclass",
")",
"."
] | train | https://github.com/aoindustries/ao-taglib/blob/5670eba8485196bd42d31d3ff09a42deacb025f8/src/main/java/com/aoindustries/taglib/AttributeUtils.java#L41-L45 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.