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 |
|---|---|---|---|---|---|---|---|---|---|---|
carewebframework/carewebframework-core | org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/service/InfoPanelService.java | InfoPanelService.findInfoPanel | public static IInfoPanel findInfoPanel(PluginContainer container, boolean activeOnly) {
"""
Finds the "nearest" info panel.
@param container The container from which to begin the search.
@param activeOnly If true, only active info panels are considered.
@return The nearest active info panel, or null if none f... | java | public static IInfoPanel findInfoPanel(PluginContainer container, boolean activeOnly) {
return findInfoPanel(ElementUI.getAssociatedElement(container), activeOnly);
} | [
"public",
"static",
"IInfoPanel",
"findInfoPanel",
"(",
"PluginContainer",
"container",
",",
"boolean",
"activeOnly",
")",
"{",
"return",
"findInfoPanel",
"(",
"ElementUI",
".",
"getAssociatedElement",
"(",
"container",
")",
",",
"activeOnly",
")",
";",
"}"
] | Finds the "nearest" info panel.
@param container The container from which to begin the search.
@param activeOnly If true, only active info panels are considered.
@return The nearest active info panel, or null if none found. | [
"Finds",
"the",
"nearest",
"info",
"panel",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/service/InfoPanelService.java#L55-L57 |
googleads/googleads-java-lib | examples/adwords_axis/src/main/java/adwords/axis/v201809/targeting/AddCustomerNegativeCriteria.java | AddCustomerNegativeCriteria.runExample | public static void runExample(AdWordsServicesInterface adWordsServices, AdWordsSession session)
throws RemoteException {
"""
Runs the example.
@param adWordsServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws... | java | public static void runExample(AdWordsServicesInterface adWordsServices, AdWordsSession session)
throws RemoteException {
// Get the CustomerNegativeCriterionService.
CustomerNegativeCriterionServiceInterface customerNegativeCriterionService =
adWordsServices.get(session, CustomerNegativeCriterionS... | [
"public",
"static",
"void",
"runExample",
"(",
"AdWordsServicesInterface",
"adWordsServices",
",",
"AdWordsSession",
"session",
")",
"throws",
"RemoteException",
"{",
"// Get the CustomerNegativeCriterionService.",
"CustomerNegativeCriterionServiceInterface",
"customerNegativeCriteri... | Runs the example.
@param adWordsServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors. | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/adwords_axis/src/main/java/adwords/axis/v201809/targeting/AddCustomerNegativeCriteria.java#L117-L162 |
Erudika/para | para-core/src/main/java/com/erudika/para/utils/RegistryUtils.java | RegistryUtils.removeValue | public static void removeValue(String registryName, String key) {
"""
Remove a specific value from a registry.
@param registryName the name of the registry.
@param key the unique key corresponding to the value to remove (typically an appid).
"""
Sysprop registryObject = readRegistryObject(registryName);
... | java | public static void removeValue(String registryName, String key) {
Sysprop registryObject = readRegistryObject(registryName);
if (registryObject == null || StringUtils.isBlank(key)) {
return;
}
if (registryObject.hasProperty(key)) {
registryObject.removeProperty(key);
CoreUtils.getInstance().getDao().up... | [
"public",
"static",
"void",
"removeValue",
"(",
"String",
"registryName",
",",
"String",
"key",
")",
"{",
"Sysprop",
"registryObject",
"=",
"readRegistryObject",
"(",
"registryName",
")",
";",
"if",
"(",
"registryObject",
"==",
"null",
"||",
"StringUtils",
".",
... | Remove a specific value from a registry.
@param registryName the name of the registry.
@param key the unique key corresponding to the value to remove (typically an appid). | [
"Remove",
"a",
"specific",
"value",
"from",
"a",
"registry",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/utils/RegistryUtils.java#L78-L87 |
percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/ActivityUtils.java | ActivityUtils.getExtraString | public static String getExtraString(Activity context, String key) {
"""
Used to get the parameter values passed into Activity via a Bundle.
@return param Parameter value
"""
String param = "";
Bundle bundle = context.getIntent().getExtras();
if (bundle != null) {
param = ... | java | public static String getExtraString(Activity context, String key) {
String param = "";
Bundle bundle = context.getIntent().getExtras();
if (bundle != null) {
param = bundle.getString(key);
}
return param;
} | [
"public",
"static",
"String",
"getExtraString",
"(",
"Activity",
"context",
",",
"String",
"key",
")",
"{",
"String",
"param",
"=",
"\"\"",
";",
"Bundle",
"bundle",
"=",
"context",
".",
"getIntent",
"(",
")",
".",
"getExtras",
"(",
")",
";",
"if",
"(",
... | Used to get the parameter values passed into Activity via a Bundle.
@return param Parameter value | [
"Used",
"to",
"get",
"the",
"parameter",
"values",
"passed",
"into",
"Activity",
"via",
"a",
"Bundle",
"."
] | train | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/ActivityUtils.java#L59-L66 |
i-net-software/jlessc | src/com/inet/lib/less/ReaderFactory.java | ReaderFactory.openStream | public InputStream openStream( URL baseURL, String urlStr, String relativeUrlStr ) throws IOException {
"""
Open an InputStream for the given URL. This is used for inlining images via data-uri.
@param baseURL
the URL of the top less file
@param urlStr
the absolute or relative URL that should be open
@param ... | java | public InputStream openStream( URL baseURL, String urlStr, String relativeUrlStr ) throws IOException {
URL url = new URL( baseURL, urlStr );
try {
return openStream( url );
} catch( Exception e ) {
// try rewrite location independent of option "rewrite-urls" for backward... | [
"public",
"InputStream",
"openStream",
"(",
"URL",
"baseURL",
",",
"String",
"urlStr",
",",
"String",
"relativeUrlStr",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"baseURL",
",",
"urlStr",
")",
";",
"try",
"{",
"return",
"open... | Open an InputStream for the given URL. This is used for inlining images via data-uri.
@param baseURL
the URL of the top less file
@param urlStr
the absolute or relative URL that should be open
@param relativeUrlStr
relative URL of the less script
@return the stream, never null
@throws IOException
If any I/O error occu... | [
"Open",
"an",
"InputStream",
"for",
"the",
"given",
"URL",
".",
"This",
"is",
"used",
"for",
"inlining",
"images",
"via",
"data",
"-",
"uri",
"."
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/ReaderFactory.java#L68-L77 |
kmi/iserve | iserve-sal-core/src/main/java/uk/ac/open/kmi/iserve/sal/util/caching/impl/RedisCache.java | RedisCache.putIfAbsent | @Override
public V putIfAbsent(K key, V value) {
"""
If the specified key is not already associated
with a value, associate it with the given value.
This is equivalent to
<pre>
if (!map.containsKey(key))
return map.put(key, value);
else
return map.get(key);</pre>
except that the action is performed ato... | java | @Override
public V putIfAbsent(K key, V value) {
return rMap.putIfAbsent(key, value);
} | [
"@",
"Override",
"public",
"V",
"putIfAbsent",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"return",
"rMap",
".",
"putIfAbsent",
"(",
"key",
",",
"value",
")",
";",
"}"
] | If the specified key is not already associated
with a value, associate it with the given value.
This is equivalent to
<pre>
if (!map.containsKey(key))
return map.put(key, value);
else
return map.get(key);</pre>
except that the action is performed atomically.
@param key key with which the specified value is to be assoc... | [
"If",
"the",
"specified",
"key",
"is",
"not",
"already",
"associated",
"with",
"a",
"value",
"associate",
"it",
"with",
"the",
"given",
"value",
".",
"This",
"is",
"equivalent",
"to",
"<pre",
">",
"if",
"(",
"!map",
".",
"containsKey",
"(",
"key",
"))",
... | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-sal-core/src/main/java/uk/ac/open/kmi/iserve/sal/util/caching/impl/RedisCache.java#L374-L377 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cloud_project_serviceName_ip_POST | public OvhOrder cloud_project_serviceName_ip_POST(String serviceName, OvhGeolocationEnum country, String instanceId, Long quantity) throws IOException {
"""
Create order
REST: POST /order/cloud/project/{serviceName}/ip
@param instanceId [required] Instance id where ip will be routed to
@param country [require... | java | public OvhOrder cloud_project_serviceName_ip_POST(String serviceName, OvhGeolocationEnum country, String instanceId, Long quantity) throws IOException {
String qPath = "/order/cloud/project/{serviceName}/ip";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
... | [
"public",
"OvhOrder",
"cloud_project_serviceName_ip_POST",
"(",
"String",
"serviceName",
",",
"OvhGeolocationEnum",
"country",
",",
"String",
"instanceId",
",",
"Long",
"quantity",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cloud/project/{service... | Create order
REST: POST /order/cloud/project/{serviceName}/ip
@param instanceId [required] Instance id where ip will be routed to
@param country [required] IP geolocation
@param quantity [required] Number of failover ip
@param serviceName [required] The project id | [
"Create",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L2945-L2954 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_http_farm_farmId_server_serverId_GET | public OvhBackendHTTPServer serviceName_http_farm_farmId_server_serverId_GET(String serviceName, Long farmId, Long serverId) throws IOException {
"""
Get this object properties
REST: GET /ipLoadbalancing/{serviceName}/http/farm/{farmId}/server/{serverId}
@param serviceName [required] The internal name of your ... | java | public OvhBackendHTTPServer serviceName_http_farm_farmId_server_serverId_GET(String serviceName, Long farmId, Long serverId) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/http/farm/{farmId}/server/{serverId}";
StringBuilder sb = path(qPath, serviceName, farmId, serverId);
String resp = exec(... | [
"public",
"OvhBackendHTTPServer",
"serviceName_http_farm_farmId_server_serverId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"farmId",
",",
"Long",
"serverId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/http/farm/{farmId}/se... | Get this object properties
REST: GET /ipLoadbalancing/{serviceName}/http/farm/{farmId}/server/{serverId}
@param serviceName [required] The internal name of your IP load balancing
@param farmId [required] Id of your farm
@param serverId [required] Id of your server | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L406-L411 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileTree.java | FileTree.followSymbolicLink | @Nullable
private DirectoryEntry followSymbolicLink(File dir, SymbolicLink link, int linkDepth)
throws IOException {
"""
Returns the directory entry located by the target path of the given symbolic link, resolved
relative to the given directory.
"""
if (linkDepth >= MAX_SYMBOLIC_LINK_DEPTH) {
... | java | @Nullable
private DirectoryEntry followSymbolicLink(File dir, SymbolicLink link, int linkDepth)
throws IOException {
if (linkDepth >= MAX_SYMBOLIC_LINK_DEPTH) {
throw new IOException("too many levels of symbolic links");
}
return lookUp(dir, link.target(), Options.FOLLOW_LINKS, linkDepth + 1)... | [
"@",
"Nullable",
"private",
"DirectoryEntry",
"followSymbolicLink",
"(",
"File",
"dir",
",",
"SymbolicLink",
"link",
",",
"int",
"linkDepth",
")",
"throws",
"IOException",
"{",
"if",
"(",
"linkDepth",
">=",
"MAX_SYMBOLIC_LINK_DEPTH",
")",
"{",
"throw",
"new",
"I... | Returns the directory entry located by the target path of the given symbolic link, resolved
relative to the given directory. | [
"Returns",
"the",
"directory",
"entry",
"located",
"by",
"the",
"target",
"path",
"of",
"the",
"given",
"symbolic",
"link",
"resolved",
"relative",
"to",
"the",
"given",
"directory",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileTree.java#L180-L188 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/DockerImage.java | DockerImage.findAndSetManifestFromArtifactory | private boolean findAndSetManifestFromArtifactory(ArtifactoryServer server, ArtifactoryDependenciesClient dependenciesClient, TaskListener listener) throws IOException {
"""
Find and validate manifest.json file in Artifactory for the current image.
Since provided imageTag differs between reverse-proxy and proxy-l... | java | private boolean findAndSetManifestFromArtifactory(ArtifactoryServer server, ArtifactoryDependenciesClient dependenciesClient, TaskListener listener) throws IOException {
String candidateImagePath = DockerUtils.getImagePath(imageTag);
String manifestPath;
// Try to get manifest, assuming reverse... | [
"private",
"boolean",
"findAndSetManifestFromArtifactory",
"(",
"ArtifactoryServer",
"server",
",",
"ArtifactoryDependenciesClient",
"dependenciesClient",
",",
"TaskListener",
"listener",
")",
"throws",
"IOException",
"{",
"String",
"candidateImagePath",
"=",
"DockerUtils",
"... | Find and validate manifest.json file in Artifactory for the current image.
Since provided imageTag differs between reverse-proxy and proxy-less configuration, try to build the correct manifest path.
@param server
@param dependenciesClient
@param listener
@return
@throws IOException | [
"Find",
"and",
"validate",
"manifest",
".",
"json",
"file",
"in",
"Artifactory",
"for",
"the",
"current",
"image",
".",
"Since",
"provided",
"imageTag",
"differs",
"between",
"reverse",
"-",
"proxy",
"and",
"proxy",
"-",
"less",
"configuration",
"try",
"to",
... | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/DockerImage.java#L180-L200 |
OpenHFT/Chronicle-Map | src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java | ReplicatedChronicleMap.readExternalEntry | @Override
public void readExternalEntry(@NotNull Bytes source, byte remoteNodeIdentifier) {
"""
This method does not set a segment lock, A segment lock should be obtained before calling
this method, especially when being used in a multi threaded context.
"""
byte hunk = source.readByte();
... | java | @Override
public void readExternalEntry(@NotNull Bytes source, byte remoteNodeIdentifier) {
byte hunk = source.readByte();
if (hunk == BOOTSTRAP_TIME_HUNK) {
setRemoteNodeCouldBootstrapFrom(remoteNodeIdentifier, source.readLong());
} else {
assert hunk == ENTRY_HUNK;
... | [
"@",
"Override",
"public",
"void",
"readExternalEntry",
"(",
"@",
"NotNull",
"Bytes",
"source",
",",
"byte",
"remoteNodeIdentifier",
")",
"{",
"byte",
"hunk",
"=",
"source",
".",
"readByte",
"(",
")",
";",
"if",
"(",
"hunk",
"==",
"BOOTSTRAP_TIME_HUNK",
")",... | This method does not set a segment lock, A segment lock should be obtained before calling
this method, especially when being used in a multi threaded context. | [
"This",
"method",
"does",
"not",
"set",
"a",
"segment",
"lock",
"A",
"segment",
"lock",
"should",
"be",
"obtained",
"before",
"calling",
"this",
"method",
"especially",
"when",
"being",
"used",
"in",
"a",
"multi",
"threaded",
"context",
"."
] | train | https://github.com/OpenHFT/Chronicle-Map/blob/0b09733cc96302f96be4394a261699eeb021fe37/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java#L551-L562 |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/Msvc.java | Msvc.registryGet32StringValue | private static String registryGet32StringValue(com.sun.jna.platform.win32.WinReg.HKEY root, String key, String value)
throws com.sun.jna.platform.win32.Win32Exception {
"""
Get a registry REG_SZ value.
@param root Root key.
@param key Registry path.
@param value Name of the value to retrieve.
@retur... | java | private static String registryGet32StringValue(com.sun.jna.platform.win32.WinReg.HKEY root, String key, String value)
throws com.sun.jna.platform.win32.Win32Exception {
com.sun.jna.platform.win32.WinReg.HKEYByReference phkKey = new com.sun.jna.platform.win32.WinReg.HKEYByReference();
int rc = com.sun.jna.... | [
"private",
"static",
"String",
"registryGet32StringValue",
"(",
"com",
".",
"sun",
".",
"jna",
".",
"platform",
".",
"win32",
".",
"WinReg",
".",
"HKEY",
"root",
",",
"String",
"key",
",",
"String",
"value",
")",
"throws",
"com",
".",
"sun",
".",
"jna",
... | Get a registry REG_SZ value.
@param root Root key.
@param key Registry path.
@param value Name of the value to retrieve.
@return String value. | [
"Get",
"a",
"registry",
"REG_SZ",
"value",
"."
] | train | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/Msvc.java#L505-L521 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/TableBuilder.java | TableBuilder.getRow | public TableRow getRow(final Table table, final TableAppender appender, final int rowIndex)
throws FastOdsException, IOException {
"""
get a row from a table
@param table the table
@param appender the appender
@param rowIndex the row index
@return the table row
@throws FastOdsException if th... | java | public TableRow getRow(final Table table, final TableAppender appender, final int rowIndex)
throws FastOdsException, IOException {
TableBuilder.checkRow(rowIndex);
return this.getRowSecure(table, appender, rowIndex, true);
} | [
"public",
"TableRow",
"getRow",
"(",
"final",
"Table",
"table",
",",
"final",
"TableAppender",
"appender",
",",
"final",
"int",
"rowIndex",
")",
"throws",
"FastOdsException",
",",
"IOException",
"{",
"TableBuilder",
".",
"checkRow",
"(",
"rowIndex",
")",
";",
... | get a row from a table
@param table the table
@param appender the appender
@param rowIndex the row index
@return the table row
@throws FastOdsException if the index is invalid
@throws IOException if an I/O error occurs | [
"get",
"a",
"row",
"from",
"a",
"table"
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/TableBuilder.java#L236-L240 |
fnklabs/draenei | src/main/java/com/fnklabs/draenei/orm/DataProvider.java | DataProvider.createBoundStatement | @NotNull
private BoundStatement createBoundStatement(@NotNull PreparedStatement prepare, @NotNull V entity, @NotNull List<ColumnMetadata> columns) {
"""
Create BoundStatement from PreparedStatement and bind parameter values from entity
@param prepare PreparedStatement
@param entity Entity from which will ... | java | @NotNull
private BoundStatement createBoundStatement(@NotNull PreparedStatement prepare, @NotNull V entity, @NotNull List<ColumnMetadata> columns) {
BoundStatement boundStatement = new BoundStatement(prepare);
boundStatement.setConsistencyLevel(getEntityMetadata().getWriteConsistencyLevel());
... | [
"@",
"NotNull",
"private",
"BoundStatement",
"createBoundStatement",
"(",
"@",
"NotNull",
"PreparedStatement",
"prepare",
",",
"@",
"NotNull",
"V",
"entity",
",",
"@",
"NotNull",
"List",
"<",
"ColumnMetadata",
">",
"columns",
")",
"{",
"BoundStatement",
"boundStat... | Create BoundStatement from PreparedStatement and bind parameter values from entity
@param prepare PreparedStatement
@param entity Entity from which will be read data
@param columns Bind columns
@return BoundStatement | [
"Create",
"BoundStatement",
"from",
"PreparedStatement",
"and",
"bind",
"parameter",
"values",
"from",
"entity"
] | train | https://github.com/fnklabs/draenei/blob/0a8cac54f1f635be3e2950375a23291d38453ae8/src/main/java/com/fnklabs/draenei/orm/DataProvider.java#L569-L583 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java | TopicsInner.beginDelete | public void beginDelete(String resourceGroupName, String topicName) {
"""
Delete a topic.
Delete existing topic.
@param resourceGroupName The name of the resource group within the user's subscription.
@param topicName Name of the topic
@throws IllegalArgumentException thrown if parameters fail the validation... | java | public void beginDelete(String resourceGroupName, String topicName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, topicName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"topicName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"topicName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
... | Delete a topic.
Delete existing topic.
@param resourceGroupName The name of the resource group within the user's subscription.
@param topicName Name of the topic
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeE... | [
"Delete",
"a",
"topic",
".",
"Delete",
"existing",
"topic",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java#L470-L472 |
cdk/cdk | tool/sdg/src/main/java/org/openscience/cdk/layout/StructureDiagramGenerator.java | StructureDiagramGenerator.newCrossingBracket | private SgroupBracket newCrossingBracket(IBond bond, Multimap<IBond,Sgroup> bonds, Map<IBond,Integer> counter, boolean vert) {
"""
Generate a new bracket across the provided bond.
@param bond bond
@param bonds bond map to Sgroups
@param counter count how many brackets this group has already
@param vert verti... | java | private SgroupBracket newCrossingBracket(IBond bond, Multimap<IBond,Sgroup> bonds, Map<IBond,Integer> counter, boolean vert) {
final IAtom beg = bond.getBegin();
final IAtom end = bond.getEnd();
final Point2d begXy = beg.getPoint2d();
final Point2d endXy = end.getPoint2d();
final... | [
"private",
"SgroupBracket",
"newCrossingBracket",
"(",
"IBond",
"bond",
",",
"Multimap",
"<",
"IBond",
",",
"Sgroup",
">",
"bonds",
",",
"Map",
"<",
"IBond",
",",
"Integer",
">",
"counter",
",",
"boolean",
"vert",
")",
"{",
"final",
"IAtom",
"beg",
"=",
... | Generate a new bracket across the provided bond.
@param bond bond
@param bonds bond map to Sgroups
@param counter count how many brackets this group has already
@param vert vertical align bonds
@return the new bracket | [
"Generate",
"a",
"new",
"bracket",
"across",
"the",
"provided",
"bond",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/StructureDiagramGenerator.java#L2676-L2718 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/EmulatedFields.java | EmulatedFields.get | public byte get(String name, byte defaultValue) throws IllegalArgumentException {
"""
Finds and returns the byte value of a given field named {@code name}
in the receiver. If the field has not been assigned any value yet, the
default value {@code defaultValue} is returned instead.
@param name
the name of the... | java | public byte get(String name, byte defaultValue) throws IllegalArgumentException {
ObjectSlot slot = findMandatorySlot(name, byte.class);
return slot.defaulted ? defaultValue : ((Byte) slot.fieldValue).byteValue();
} | [
"public",
"byte",
"get",
"(",
"String",
"name",
",",
"byte",
"defaultValue",
")",
"throws",
"IllegalArgumentException",
"{",
"ObjectSlot",
"slot",
"=",
"findMandatorySlot",
"(",
"name",
",",
"byte",
".",
"class",
")",
";",
"return",
"slot",
".",
"defaulted",
... | Finds and returns the byte value of a given field named {@code name}
in the receiver. If the field has not been assigned any value yet, the
default value {@code defaultValue} is returned instead.
@param name
the name of the field to find.
@param defaultValue
return value in case the field has not been assigned to yet.... | [
"Finds",
"and",
"returns",
"the",
"byte",
"value",
"of",
"a",
"given",
"field",
"named",
"{",
"@code",
"name",
"}",
"in",
"the",
"receiver",
".",
"If",
"the",
"field",
"has",
"not",
"been",
"assigned",
"any",
"value",
"yet",
"the",
"default",
"value",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/EmulatedFields.java#L208-L211 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getCertificateVersionsAsync | public Observable<Page<CertificateItem>> getCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName, final Integer maxresults) {
"""
List the versions of a certificate.
The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation re... | java | public Observable<Page<CertificateItem>> getCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName, final Integer maxresults) {
return getCertificateVersionsWithServiceResponseAsync(vaultBaseUrl, certificateName, maxresults)
.map(new Func1<ServiceResponse<Page<CertificateIt... | [
"public",
"Observable",
"<",
"Page",
"<",
"CertificateItem",
">",
">",
"getCertificateVersionsAsync",
"(",
"final",
"String",
"vaultBaseUrl",
",",
"final",
"String",
"certificateName",
",",
"final",
"Integer",
"maxresults",
")",
"{",
"return",
"getCertificateVersionsW... | List the versions of a certificate.
The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param certificateName The name of the ce... | [
"List",
"the",
"versions",
"of",
"a",
"certificate",
".",
"The",
"GetCertificateVersions",
"operation",
"returns",
"the",
"versions",
"of",
"a",
"certificate",
"in",
"the",
"specified",
"key",
"vault",
".",
"This",
"operation",
"requires",
"the",
"certificates",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L7065-L7073 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java | CmsSitemapController.isChangedPosition | private boolean isChangedPosition(CmsClientSitemapEntry entry, String toPath, int position) {
"""
Checks if the given path and position indicate a changed position for the entry.<p>
@param entry the sitemap entry to move
@param toPath the destination path
@param position the new position between its siblings
... | java | private boolean isChangedPosition(CmsClientSitemapEntry entry, String toPath, int position) {
return (!entry.getSitePath().equals(toPath) || (entry.getPosition() != position));
} | [
"private",
"boolean",
"isChangedPosition",
"(",
"CmsClientSitemapEntry",
"entry",
",",
"String",
"toPath",
",",
"int",
"position",
")",
"{",
"return",
"(",
"!",
"entry",
".",
"getSitePath",
"(",
")",
".",
"equals",
"(",
"toPath",
")",
"||",
"(",
"entry",
"... | Checks if the given path and position indicate a changed position for the entry.<p>
@param entry the sitemap entry to move
@param toPath the destination path
@param position the new position between its siblings
@return <code>true</code> if this is a position change | [
"Checks",
"if",
"the",
"given",
"path",
"and",
"position",
"indicate",
"a",
"changed",
"position",
"for",
"the",
"entry",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java#L2361-L2364 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImageListsImpl.java | ListManagementImageListsImpl.createAsync | public Observable<ImageList> createAsync(String contentType, BodyModel bodyParameter) {
"""
Creates an image list.
@param contentType The content type.
@param bodyParameter Schema of the body.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ImageList ob... | java | public Observable<ImageList> createAsync(String contentType, BodyModel bodyParameter) {
return createWithServiceResponseAsync(contentType, bodyParameter).map(new Func1<ServiceResponse<ImageList>, ImageList>() {
@Override
public ImageList call(ServiceResponse<ImageList> response) {
... | [
"public",
"Observable",
"<",
"ImageList",
">",
"createAsync",
"(",
"String",
"contentType",
",",
"BodyModel",
"bodyParameter",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"contentType",
",",
"bodyParameter",
")",
".",
"map",
"(",
"new",
"Func1",
"<"... | Creates an image list.
@param contentType The content type.
@param bodyParameter Schema of the body.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ImageList object | [
"Creates",
"an",
"image",
"list",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImageListsImpl.java#L371-L378 |
thorstenwagner/TraJ | src/main/java/de/biomedical_imaging/traJ/features/BoundednessFeature.java | BoundednessFeature.calculateBoundedness | public static double calculateBoundedness(double D, int N, double timelag, double confRadius) {
"""
Calculates the Boundedness value to given confinement radius, diffusion coefficient, timlag and number of steps.
@param D diffusion coefficient
@param N Number of steps
@param timelag Timelag
@param confRadius C... | java | public static double calculateBoundedness(double D, int N, double timelag, double confRadius){
double r = confRadius;
double cov_area = a(N)*D*timelag;
double res = cov_area/(4*r*r);
return res;
} | [
"public",
"static",
"double",
"calculateBoundedness",
"(",
"double",
"D",
",",
"int",
"N",
",",
"double",
"timelag",
",",
"double",
"confRadius",
")",
"{",
"double",
"r",
"=",
"confRadius",
";",
"double",
"cov_area",
"=",
"a",
"(",
"N",
")",
"*",
"D",
... | Calculates the Boundedness value to given confinement radius, diffusion coefficient, timlag and number of steps.
@param D diffusion coefficient
@param N Number of steps
@param timelag Timelag
@param confRadius Confinement radius
@return Boundedness value | [
"Calculates",
"the",
"Boundedness",
"value",
"to",
"given",
"confinement",
"radius",
"diffusion",
"coefficient",
"timlag",
"and",
"number",
"of",
"steps",
"."
] | train | https://github.com/thorstenwagner/TraJ/blob/505fafb1f2f77a2d67bb2a089a2fdebe2c9bc7cb/src/main/java/de/biomedical_imaging/traJ/features/BoundednessFeature.java#L36-L41 |
haraldk/TwelveMonkeys | imageio/imageio-metadata/src/main/java/com/twelvemonkeys/imageio/metadata/jpeg/JPEGQuality.java | JPEGQuality.getJPEGQuality | public static float getJPEGQuality(final ImageInputStream input) throws IOException {
"""
Determines an approximate JPEG compression quality value from the quantization tables.
The value will be in the range {@code [0...1]}, where {@code 1} is the best possible value.
@param input an image input stream contain... | java | public static float getJPEGQuality(final ImageInputStream input) throws IOException {
return getJPEGQuality(JPEGSegmentUtil.readSegments(input, JPEG.DQT, null));
} | [
"public",
"static",
"float",
"getJPEGQuality",
"(",
"final",
"ImageInputStream",
"input",
")",
"throws",
"IOException",
"{",
"return",
"getJPEGQuality",
"(",
"JPEGSegmentUtil",
".",
"readSegments",
"(",
"input",
",",
"JPEG",
".",
"DQT",
",",
"null",
")",
")",
... | Determines an approximate JPEG compression quality value from the quantization tables.
The value will be in the range {@code [0...1]}, where {@code 1} is the best possible value.
@param input an image input stream containing JPEG data.
@return a float in the range {@code [0...1]}, representing the JPEG quality,
or {@c... | [
"Determines",
"an",
"approximate",
"JPEG",
"compression",
"quality",
"value",
"from",
"the",
"quantization",
"tables",
".",
"The",
"value",
"will",
"be",
"in",
"the",
"range",
"{",
"@code",
"[",
"0",
"...",
"1",
"]",
"}",
"where",
"{",
"@code",
"1",
"}",... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-metadata/src/main/java/com/twelvemonkeys/imageio/metadata/jpeg/JPEGQuality.java#L87-L89 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainsInner.java | DomainsInner.beginDelete | public void beginDelete(String resourceGroupName, String domainName) {
"""
Delete a domain.
Delete existing domain.
@param resourceGroupName The name of the resource group within the user's subscription.
@param domainName Name of the domain
@throws IllegalArgumentException thrown if parameters fail the valid... | java | public void beginDelete(String resourceGroupName, String domainName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"domainName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"domainName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
... | Delete a domain.
Delete existing domain.
@param resourceGroupName The name of the resource group within the user's subscription.
@param domainName Name of the domain
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws Runt... | [
"Delete",
"a",
"domain",
".",
"Delete",
"existing",
"domain",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainsInner.java#L466-L468 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.multAddTransAB | public static void multAddTransAB(DMatrix1Row a , DMatrix1Row b , DMatrix1Row c ) {
"""
<p>
Performs the following operation:<br>
<br>
c = c + a<sup>T</sup> * b<sup>T</sup><br>
c<sub>ij</sub> = c<sub>ij</sub> + ∑<sub>k=1:n</sub> { a<sub>ki</sub> * b<sub>jk</sub>}
</p>
@param a The left matrix in the mu... | java | public static void multAddTransAB(DMatrix1Row a , DMatrix1Row b , DMatrix1Row c )
{
if( b.numRows == 1 ) {
// there are significantly faster algorithms when dealing with vectors
if( a.numCols >= EjmlParameters.MULT_COLUMN_SWITCH ) {
MatrixVectorMult_DDRM.multAddTransA... | [
"public",
"static",
"void",
"multAddTransAB",
"(",
"DMatrix1Row",
"a",
",",
"DMatrix1Row",
"b",
",",
"DMatrix1Row",
"c",
")",
"{",
"if",
"(",
"b",
".",
"numRows",
"==",
"1",
")",
"{",
"// there are significantly faster algorithms when dealing with vectors",
"if",
... | <p>
Performs the following operation:<br>
<br>
c = c + a<sup>T</sup> * b<sup>T</sup><br>
c<sub>ij</sub> = c<sub>ij</sub> + ∑<sub>k=1:n</sub> { a<sub>ki</sub> * b<sub>jk</sub>}
</p>
@param a The left matrix in the multiplication operation. Not Modified.
@param b The right matrix in the multiplication operation. Not... | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"c",
"=",
"c",
"+",
"a<sup",
">",
"T<",
"/",
"sup",
">",
"*",
"b<sup",
">",
"T<",
"/",
"sup",
">",
"<br",
">",
"c<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"c<... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L471-L485 |
jbundle/jbundle | thin/base/screen/util/src/main/java/org/jbundle/thin/base/screen/db/converter/CacheConverter.java | CacheConverter.cacheValue | public void cacheValue(Object objKey, Object objValue) {
"""
Add this key and value to the cache.
@param objKey The raw key value.
@param objValue The data value to associate with this key.
"""
//x if ((objKey == null) || (objValue == null))
if (objKey == null)
return;
Clas... | java | public void cacheValue(Object objKey, Object objValue)
{
//x if ((objKey == null) || (objValue == null))
if (objKey == null)
return;
Class<?> classKey = this.getField().getDataClass();
objKey = this.convertKey(objKey, classKey);
if (m_hmCache == null)
m... | [
"public",
"void",
"cacheValue",
"(",
"Object",
"objKey",
",",
"Object",
"objValue",
")",
"{",
"//x if ((objKey == null) || (objValue == null))",
"if",
"(",
"objKey",
"==",
"null",
")",
"return",
";",
"Class",
"<",
"?",
">",
"classKey",
"=",
"this",
".",
... | Add this key and value to the cache.
@param objKey The raw key value.
@param objValue The data value to associate with this key. | [
"Add",
"this",
"key",
"and",
"value",
"to",
"the",
"cache",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/util/src/main/java/org/jbundle/thin/base/screen/db/converter/CacheConverter.java#L111-L121 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/autoupdate/AddOnWrapper.java | AddOnWrapper.setRunningIssues | public void setRunningIssues(String runningIssues, boolean addOnIssues) {
"""
Sets the issues that the wrapped add-on or its extensions might have that prevent them from being run.
<p>
The contents should be in HTML.
@param runningIssues the running issues of the add-on or its extensions, empty if there's no ... | java | public void setRunningIssues(String runningIssues, boolean addOnIssues) {
Validate.notNull(runningIssues, "Parameter runningIssues must not be null.");
this.runningIssues = runningIssues;
this.addOnRunningIssues = addOnIssues;
} | [
"public",
"void",
"setRunningIssues",
"(",
"String",
"runningIssues",
",",
"boolean",
"addOnIssues",
")",
"{",
"Validate",
".",
"notNull",
"(",
"runningIssues",
",",
"\"Parameter runningIssues must not be null.\"",
")",
";",
"this",
".",
"runningIssues",
"=",
"running... | Sets the issues that the wrapped add-on or its extensions might have that prevent them from being run.
<p>
The contents should be in HTML.
@param runningIssues the running issues of the add-on or its extensions, empty if there's no issues.
@param addOnIssues {@code true} if the issues are caused by the add-on, {@code ... | [
"Sets",
"the",
"issues",
"that",
"the",
"wrapped",
"add",
"-",
"on",
"or",
"its",
"extensions",
"might",
"have",
"that",
"prevent",
"them",
"from",
"being",
"run",
".",
"<p",
">",
"The",
"contents",
"should",
"be",
"in",
"HTML",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/autoupdate/AddOnWrapper.java#L216-L221 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.toUnique | @SuppressWarnings("unchecked")
public static <T> T[] toUnique(T[] self, @ClosureParams(value=FromString.class, options= {
"""
Returns a new Array containing the items from the original Array but with duplicates removed with the supplied
comparator determining which items are unique.
<p>
<pre class="groovyTe... | java | @SuppressWarnings("unchecked")
public static <T> T[] toUnique(T[] self, @ClosureParams(value=FromString.class, options={"T","T,T"}) Closure condition) {
Comparator<T> comparator = condition.getMaximumNumberOfParameters() == 1
? new OrderBy<T>(condition, true)
: new ClosureCom... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"toUnique",
"(",
"T",
"[",
"]",
"self",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"FromString",
".",
"class",
",",
"options",
"=",
"{",
"\"T\"",
... | Returns a new Array containing the items from the original Array but with duplicates removed with the supplied
comparator determining which items are unique.
<p>
<pre class="groovyTestCase">
String[] letters = ['c', 'a', 't', 's', 'A', 't', 'h', 'a', 'T']
String[] expected = ['c', 'a', 't', 's', 'h']
assert letters.toU... | [
"Returns",
"a",
"new",
"Array",
"containing",
"the",
"items",
"from",
"the",
"original",
"Array",
"but",
"with",
"duplicates",
"removed",
"with",
"the",
"supplied",
"comparator",
"determining",
"which",
"items",
"are",
"unique",
".",
"<p",
">",
"<pre",
"class"... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L2091-L2097 |
apereo/cas | core/cas-server-core-services-api/src/main/java/org/apereo/cas/services/support/RegisteredServiceRegexAttributeFilter.java | RegisteredServiceRegexAttributeFilter.logReleasedAttributeEntry | private void logReleasedAttributeEntry(final String attributeName, final Object attributeValue) {
"""
Logs the released attribute entry.
@param attributeName the attribute name
@param attributeValue the attribute value
"""
LOGGER.debug("The attribute value [{}] for attribute name [{}] matches the ... | java | private void logReleasedAttributeEntry(final String attributeName, final Object attributeValue) {
LOGGER.debug("The attribute value [{}] for attribute name [{}] matches the pattern [{}]. Releasing attribute...",
attributeValue, attributeName, this.compiledPattern.pattern());
} | [
"private",
"void",
"logReleasedAttributeEntry",
"(",
"final",
"String",
"attributeName",
",",
"final",
"Object",
"attributeValue",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"The attribute value [{}] for attribute name [{}] matches the pattern [{}]. Releasing attribute...\"",
",",
... | Logs the released attribute entry.
@param attributeName the attribute name
@param attributeValue the attribute value | [
"Logs",
"the",
"released",
"attribute",
"entry",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-services-api/src/main/java/org/apereo/cas/services/support/RegisteredServiceRegexAttributeFilter.java#L133-L136 |
jakenjarvis/Android-OrmLiteContentProvider | ormlite-content-provider-library/src/com/tojc/ormlite/android/OrmLiteDefaultContentProvider.java | OrmLiteDefaultContentProvider.onDeleteCompleted | protected void onDeleteCompleted(int result, Uri uri, MatcherPattern target, DeleteParameters parameter) {
"""
This method is called after the onDelete processing has been handled. If you're a need,
you can override this method.
@param result
This is the return value of onDelete method.
@param uri
This is the... | java | protected void onDeleteCompleted(int result, Uri uri, MatcherPattern target, DeleteParameters parameter) {
this.getContext().getContentResolver().notifyChange(uri, null);
} | [
"protected",
"void",
"onDeleteCompleted",
"(",
"int",
"result",
",",
"Uri",
"uri",
",",
"MatcherPattern",
"target",
",",
"DeleteParameters",
"parameter",
")",
"{",
"this",
".",
"getContext",
"(",
")",
".",
"getContentResolver",
"(",
")",
".",
"notifyChange",
"... | This method is called after the onDelete processing has been handled. If you're a need,
you can override this method.
@param result
This is the return value of onDelete method.
@param uri
This is the Uri of target.
@param target
This is identical to the argument of onDelete method.
It is MatcherPattern objects that mat... | [
"This",
"method",
"is",
"called",
"after",
"the",
"onDelete",
"processing",
"has",
"been",
"handled",
".",
"If",
"you",
"re",
"a",
"need",
"you",
"can",
"override",
"this",
"method",
"."
] | train | https://github.com/jakenjarvis/Android-OrmLiteContentProvider/blob/8f102f0743b308c9f58d43639e98f832fd951985/ormlite-content-provider-library/src/com/tojc/ormlite/android/OrmLiteDefaultContentProvider.java#L286-L288 |
lets-blade/blade | src/main/java/com/blade/Environment.java | Environment.of | private static Environment of(@NonNull InputStream is) {
"""
Load InputStream to Environment
@param is InputStream instance
@return return Environment instance
"""
try {
var environment = new Environment();
environment.props.load(new InputStreamReader(is, "UTF-8"));
... | java | private static Environment of(@NonNull InputStream is) {
try {
var environment = new Environment();
environment.props.load(new InputStreamReader(is, "UTF-8"));
return environment;
} catch (IOException e) {
throw new IllegalStateException(e);
} fina... | [
"private",
"static",
"Environment",
"of",
"(",
"@",
"NonNull",
"InputStream",
"is",
")",
"{",
"try",
"{",
"var",
"environment",
"=",
"new",
"Environment",
"(",
")",
";",
"environment",
".",
"props",
".",
"load",
"(",
"new",
"InputStreamReader",
"(",
"is",
... | Load InputStream to Environment
@param is InputStream instance
@return return Environment instance | [
"Load",
"InputStream",
"to",
"Environment"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/Environment.java#L172-L182 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsSecure.java | CmsSecure.actionChangeSecureExport | public void actionChangeSecureExport() throws JspException {
"""
Performs the Security and Export Change.<p>
@throws JspException if including a JSP sub element is not successful
"""
// save initialized instance of this class in request attribute for included sub-elements
getJsp().getReques... | java | public void actionChangeSecureExport() throws JspException {
// save initialized instance of this class in request attribute for included sub-elements
getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);
String filename = getParamResource();
try {
// lock res... | [
"public",
"void",
"actionChangeSecureExport",
"(",
")",
"throws",
"JspException",
"{",
"// save initialized instance of this class in request attribute for included sub-elements",
"getJsp",
"(",
")",
".",
"getRequest",
"(",
")",
".",
"setAttribute",
"(",
"SESSION_WORKPLACE_CLAS... | Performs the Security and Export Change.<p>
@throws JspException if including a JSP sub element is not successful | [
"Performs",
"the",
"Security",
"and",
"Export",
"Change",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsSecure.java#L112-L142 |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlBehaviorUnitBuilderImpl.java | SarlBehaviorUnitBuilderImpl.eInit | public void eInit(XtendTypeDeclaration container, String name, IJvmTypeProvider context) {
"""
Initialize the Ecore element.
@param container the container of the SarlBehaviorUnit.
@param name the type of the SarlBehaviorUnit.
"""
setTypeResolutionContext(context);
if (this.sarlBehaviorUnit == null) {
... | java | public void eInit(XtendTypeDeclaration container, String name, IJvmTypeProvider context) {
setTypeResolutionContext(context);
if (this.sarlBehaviorUnit == null) {
this.container = container;
this.sarlBehaviorUnit = SarlFactory.eINSTANCE.createSarlBehaviorUnit();
this.sarlBehaviorUnit.setAnnotationInfo(Xten... | [
"public",
"void",
"eInit",
"(",
"XtendTypeDeclaration",
"container",
",",
"String",
"name",
",",
"IJvmTypeProvider",
"context",
")",
"{",
"setTypeResolutionContext",
"(",
"context",
")",
";",
"if",
"(",
"this",
".",
"sarlBehaviorUnit",
"==",
"null",
")",
"{",
... | Initialize the Ecore element.
@param container the container of the SarlBehaviorUnit.
@param name the type of the SarlBehaviorUnit. | [
"Initialize",
"the",
"Ecore",
"element",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlBehaviorUnitBuilderImpl.java#L65-L74 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.examplesMethodAsync | public Observable<List<LabelTextObject>> examplesMethodAsync(UUID appId, String versionId, String modelId, ExamplesMethodOptionalParameter examplesMethodOptionalParameter) {
"""
Gets the utterances for the given model in the given app version.
@param appId The application ID.
@param versionId The version ID.
... | java | public Observable<List<LabelTextObject>> examplesMethodAsync(UUID appId, String versionId, String modelId, ExamplesMethodOptionalParameter examplesMethodOptionalParameter) {
return examplesMethodWithServiceResponseAsync(appId, versionId, modelId, examplesMethodOptionalParameter).map(new Func1<ServiceResponse<Li... | [
"public",
"Observable",
"<",
"List",
"<",
"LabelTextObject",
">",
">",
"examplesMethodAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"String",
"modelId",
",",
"ExamplesMethodOptionalParameter",
"examplesMethodOptionalParameter",
")",
"{",
"return",
"ex... | Gets the utterances for the given model in the given app version.
@param appId The application ID.
@param versionId The version ID.
@param modelId The ID (GUID) of the model.
@param examplesMethodOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgument... | [
"Gets",
"the",
"utterances",
"for",
"the",
"given",
"model",
"in",
"the",
"given",
"app",
"version",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L2653-L2660 |
structlogging/structlogger | structlogger/src/main/java/com/github/structlogging/processor/LogInvocationScanner.java | LogInvocationScanner.addToUsedVariables | private void addToUsedVariables(final java.util.List<VariableAndValue> usedVariables, final MethodAndParameter top, final Variable variable) {
"""
with incremented name, e.g. if used variables are A,B and we want to add A, it is added as A1
"""
VariableAndValue variableAndValue = new VariableAndValue(v... | java | private void addToUsedVariables(final java.util.List<VariableAndValue> usedVariables, final MethodAndParameter top, final Variable variable) {
VariableAndValue variableAndValue = new VariableAndValue(variable, top.getParameter());
if (!usedVariables.contains(variableAndValue)) {
usedVariable... | [
"private",
"void",
"addToUsedVariables",
"(",
"final",
"java",
".",
"util",
".",
"List",
"<",
"VariableAndValue",
">",
"usedVariables",
",",
"final",
"MethodAndParameter",
"top",
",",
"final",
"Variable",
"variable",
")",
"{",
"VariableAndValue",
"variableAndValue",... | with incremented name, e.g. if used variables are A,B and we want to add A, it is added as A1 | [
"with",
"incremented",
"name",
"e",
".",
"g",
".",
"if",
"used",
"variables",
"are",
"A",
"B",
"and",
"we",
"want",
"to",
"add",
"A",
"it",
"is",
"added",
"as",
"A1"
] | train | https://github.com/structlogging/structlogger/blob/1fcca4e962ef53cbdb94bd72cb556de7f5f9469f/structlogger/src/main/java/com/github/structlogging/processor/LogInvocationScanner.java#L363-L381 |
foundation-runtime/service-directory | 2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/utils/HttpUtils.java | HttpUtils.postJson | public static HttpResponse postJson(String urlStr, String body)
throws IOException {
"""
Invoke REST Service using POST method.
@param urlStr
the REST service URL String
@param body
the Http Body String.
@return
the HttpResponse.
@throws IOException
"""
URL url = new URL(urlStr);
... | java | public static HttpResponse postJson(String urlStr, String body)
throws IOException {
URL url = new URL(urlStr);
HttpURLConnection urlConnection = (HttpURLConnection) url
.openConnection();
urlConnection.addRequestProperty("Accept", "application/json");
urlCo... | [
"public",
"static",
"HttpResponse",
"postJson",
"(",
"String",
"urlStr",
",",
"String",
"body",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"urlStr",
")",
";",
"HttpURLConnection",
"urlConnection",
"=",
"(",
"HttpURLConnection",
")... | Invoke REST Service using POST method.
@param urlStr
the REST service URL String
@param body
the Http Body String.
@return
the HttpResponse.
@throws IOException | [
"Invoke",
"REST",
"Service",
"using",
"POST",
"method",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/utils/HttpUtils.java#L54-L98 |
b3dgs/lionengine | lionengine-audio-wav/src/main/java/com/b3dgs/lionengine/audio/wav/WavImpl.java | WavImpl.createPlayback | private static Playback createPlayback(Media media, Align alignment, int volume) throws IOException {
"""
Play a sound.
@param media The audio media.
@param alignment The alignment type.
@param volume The audio volume value.
@return The created and opened playback ready to be played.
@throws IOException If ... | java | private static Playback createPlayback(Media media, Align alignment, int volume) throws IOException
{
final AudioInputStream input = openStream(media);
final SourceDataLine dataLine = getDataLine(input);
dataLine.start();
updateAlignment(dataLine, alignment);
updateVolume(dat... | [
"private",
"static",
"Playback",
"createPlayback",
"(",
"Media",
"media",
",",
"Align",
"alignment",
",",
"int",
"volume",
")",
"throws",
"IOException",
"{",
"final",
"AudioInputStream",
"input",
"=",
"openStream",
"(",
"media",
")",
";",
"final",
"SourceDataLin... | Play a sound.
@param media The audio media.
@param alignment The alignment type.
@param volume The audio volume value.
@return The created and opened playback ready to be played.
@throws IOException If playback error. | [
"Play",
"a",
"sound",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-audio-wav/src/main/java/com/b3dgs/lionengine/audio/wav/WavImpl.java#L62-L71 |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/AddressConfiguration.java | AddressConfiguration.withContext | public AddressConfiguration withContext(java.util.Map<String, String> context) {
"""
A map of custom attributes to attributes to be attached to the message for this address. This payload is added to
the push notification's 'data.pinpoint' object or added to the email/sms delivery receipt event attributes.
@par... | java | public AddressConfiguration withContext(java.util.Map<String, String> context) {
setContext(context);
return this;
} | [
"public",
"AddressConfiguration",
"withContext",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"context",
")",
"{",
"setContext",
"(",
"context",
")",
";",
"return",
"this",
";",
"}"
] | A map of custom attributes to attributes to be attached to the message for this address. This payload is added to
the push notification's 'data.pinpoint' object or added to the email/sms delivery receipt event attributes.
@param context
A map of custom attributes to attributes to be attached to the message for this ad... | [
"A",
"map",
"of",
"custom",
"attributes",
"to",
"attributes",
"to",
"be",
"attached",
"to",
"the",
"message",
"for",
"this",
"address",
".",
"This",
"payload",
"is",
"added",
"to",
"the",
"push",
"notification",
"s",
"data",
".",
"pinpoint",
"object",
"or"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/AddressConfiguration.java#L207-L210 |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java | EsClient.deleteAll | public void deleteAll(String name, String type) throws IOException {
"""
Deletes all documents.
@param name index name
@param type index type.
@throws IOException
"""
CloseableHttpClient client = HttpClients.createDefault();
HttpPost method = new HttpPost(String.format("http://%s:%d/%s/%s"... | java | public void deleteAll(String name, String type) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpPost method = new HttpPost(String.format("http://%s:%d/%s/%s", host, port, name, type));
try {
EsRequest query = new EsRequest();
query.put("... | [
"public",
"void",
"deleteAll",
"(",
"String",
"name",
",",
"String",
"type",
")",
"throws",
"IOException",
"{",
"CloseableHttpClient",
"client",
"=",
"HttpClients",
".",
"createDefault",
"(",
")",
";",
"HttpPost",
"method",
"=",
"new",
"HttpPost",
"(",
"String... | Deletes all documents.
@param name index name
@param type index type.
@throws IOException | [
"Deletes",
"all",
"documents",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java#L196-L213 |
tingley/snax-xml | src/main/java/net/sundell/snax/ElementSelector.java | ElementSelector.addTransition | public void addTransition(QName name, ElementSelector<T> target) {
"""
Create a transition to another node state represented by its
{@link ElementSelector}.
@param name QName of the element on which to transition
@param target target node state to which the transition leads
"""
buildState().addTr... | java | public void addTransition(QName name, ElementSelector<T> target) {
buildState().addTransition(new ElementEqualsConstraint(name),
target.buildState());
} | [
"public",
"void",
"addTransition",
"(",
"QName",
"name",
",",
"ElementSelector",
"<",
"T",
">",
"target",
")",
"{",
"buildState",
"(",
")",
".",
"addTransition",
"(",
"new",
"ElementEqualsConstraint",
"(",
"name",
")",
",",
"target",
".",
"buildState",
"(",
... | Create a transition to another node state represented by its
{@link ElementSelector}.
@param name QName of the element on which to transition
@param target target node state to which the transition leads | [
"Create",
"a",
"transition",
"to",
"another",
"node",
"state",
"represented",
"by",
"its",
"{",
"@link",
"ElementSelector",
"}",
"."
] | train | https://github.com/tingley/snax-xml/blob/73858b9a53136694bc49d5c521d21fa33931e8df/src/main/java/net/sundell/snax/ElementSelector.java#L94-L97 |
apptik/jus | benchmark/src/perf/java/com/android/volley/Request.java | Request.encodeParameters | private byte[] encodeParameters(Map<String, String> params, String paramsEncoding) {
"""
Converts <code>params</code> into an application/x-www-form-urlencoded encoded string.
"""
StringBuilder encodedParams = new StringBuilder();
try {
for (Map.Entry<String, String> entry : params.... | java | private byte[] encodeParameters(Map<String, String> params, String paramsEncoding) {
StringBuilder encodedParams = new StringBuilder();
try {
for (Map.Entry<String, String> entry : params.entrySet()) {
encodedParams.append(URLEncoder.encode(entry.getKey(), paramsEncoding));
... | [
"private",
"byte",
"[",
"]",
"encodeParameters",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"params",
",",
"String",
"paramsEncoding",
")",
"{",
"StringBuilder",
"encodedParams",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"try",
"{",
"for",
"(",
"Map"... | Converts <code>params</code> into an application/x-www-form-urlencoded encoded string. | [
"Converts",
"<code",
">",
"params<",
"/",
"code",
">",
"into",
"an",
"application",
"/",
"x",
"-",
"www",
"-",
"form",
"-",
"urlencoded",
"encoded",
"string",
"."
] | train | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/benchmark/src/perf/java/com/android/volley/Request.java#L418-L431 |
lucee/Lucee | core/src/main/java/lucee/runtime/type/util/ComponentUtil.java | ComponentUtil.registerTypeMapping | private static Class registerTypeMapping(WSServer server, Class clazz) {
"""
search in methods of a class for complex types
@param server
@param clazz
@return
"""
java.lang.reflect.Method[] methods = clazz.getMethods();
java.lang.reflect.Method method;
Class[] params;
for (int i = 0; i < methods.lengt... | java | private static Class registerTypeMapping(WSServer server, Class clazz) {
java.lang.reflect.Method[] methods = clazz.getMethods();
java.lang.reflect.Method method;
Class[] params;
for (int i = 0; i < methods.length; i++) {
method = methods[i];
if (method.getDeclaringClass() == clazz) {
_registerTypeMappi... | [
"private",
"static",
"Class",
"registerTypeMapping",
"(",
"WSServer",
"server",
",",
"Class",
"clazz",
")",
"{",
"java",
".",
"lang",
".",
"reflect",
".",
"Method",
"[",
"]",
"methods",
"=",
"clazz",
".",
"getMethods",
"(",
")",
";",
"java",
".",
"lang",... | search in methods of a class for complex types
@param server
@param clazz
@return | [
"search",
"in",
"methods",
"of",
"a",
"class",
"for",
"complex",
"types"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ComponentUtil.java#L291-L306 |
Lucas3oo/jicunit | src/jicunit-framework/src/main/java/org/jicunit/framework/internal/BasicProxyRunner.java | BasicProxyRunner.runChild | @Override
protected void runChild(FrameworkMethod method, RunNotifier notifier) {
"""
This method will be called for the set of methods annotated with
Before/Test/After.
"""
Description description = describeChild(method);
if (method.getAnnotation(Ignore.class) != null) {
notifier.fireTestIgn... | java | @Override
protected void runChild(FrameworkMethod method, RunNotifier notifier) {
Description description = describeChild(method);
if (method.getAnnotation(Ignore.class) != null) {
notifier.fireTestIgnored(description);
return;
}
notifier.fireTestStarted(description);
String testClas... | [
"@",
"Override",
"protected",
"void",
"runChild",
"(",
"FrameworkMethod",
"method",
",",
"RunNotifier",
"notifier",
")",
"{",
"Description",
"description",
"=",
"describeChild",
"(",
"method",
")",
";",
"if",
"(",
"method",
".",
"getAnnotation",
"(",
"Ignore",
... | This method will be called for the set of methods annotated with
Before/Test/After. | [
"This",
"method",
"will",
"be",
"called",
"for",
"the",
"set",
"of",
"methods",
"annotated",
"with",
"Before",
"/",
"Test",
"/",
"After",
"."
] | train | https://github.com/Lucas3oo/jicunit/blob/1ed41891ccf8e5c6068c6b544d214280bb93945b/src/jicunit-framework/src/main/java/org/jicunit/framework/internal/BasicProxyRunner.java#L60-L81 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java | WebhooksInner.beginCreateAsync | public Observable<WebhookInner> beginCreateAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) {
"""
Creates a webhook for a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which th... | java | public Observable<WebhookInner> beginCreateAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).map(new Func1<ServiceResponse<W... | [
"public",
"Observable",
"<",
"WebhookInner",
">",
"beginCreateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"webhookName",
",",
"WebhookCreateParameters",
"webhookCreateParameters",
")",
"{",
"return",
"beginCreateWithServiceRespo... | Creates a webhook 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 webhookName The name of the webhook.
@param webhookCreateParameters The parameters fo... | [
"Creates",
"a",
"webhook",
"for",
"a",
"container",
"registry",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java#L336-L343 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java | ParagraphVectors.inferVector | public INDArray inferVector(@NonNull List<VocabWord> document) {
"""
This method calculates inferred vector for given list of words, with default parameters for learning rate and iterations
@param document
@return
"""
return inferVector(document, this.learningRate.get(), this.minLearningRate,
... | java | public INDArray inferVector(@NonNull List<VocabWord> document) {
return inferVector(document, this.learningRate.get(), this.minLearningRate,
this.numEpochs * this.numIterations);
} | [
"public",
"INDArray",
"inferVector",
"(",
"@",
"NonNull",
"List",
"<",
"VocabWord",
">",
"document",
")",
"{",
"return",
"inferVector",
"(",
"document",
",",
"this",
".",
"learningRate",
".",
"get",
"(",
")",
",",
"this",
".",
"minLearningRate",
",",
"this... | This method calculates inferred vector for given list of words, with default parameters for learning rate and iterations
@param document
@return | [
"This",
"method",
"calculates",
"inferred",
"vector",
"for",
"given",
"list",
"of",
"words",
"with",
"default",
"parameters",
"for",
"learning",
"rate",
"and",
"iterations"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java#L313-L316 |
windup/windup | config/api/src/main/java/org/jboss/windup/config/RuleSubset.java | RuleSubset.logTimeTakenByPhase | private void logTimeTakenByPhase(GraphContext graphContext, Class<? extends RulePhase> phase, int timeTaken) {
"""
Logs the time taken by this rule and adds this to the total time taken for this phase
"""
if (!timeTakenByPhase.containsKey(phase))
{
RulePhaseExecutionStatisticsModel ... | java | private void logTimeTakenByPhase(GraphContext graphContext, Class<? extends RulePhase> phase, int timeTaken)
{
if (!timeTakenByPhase.containsKey(phase))
{
RulePhaseExecutionStatisticsModel model = new GraphService<>(graphContext,
RulePhaseExecutionStatisticsModel.... | [
"private",
"void",
"logTimeTakenByPhase",
"(",
"GraphContext",
"graphContext",
",",
"Class",
"<",
"?",
"extends",
"RulePhase",
">",
"phase",
",",
"int",
"timeTaken",
")",
"{",
"if",
"(",
"!",
"timeTakenByPhase",
".",
"containsKey",
"(",
"phase",
")",
")",
"{... | Logs the time taken by this rule and adds this to the total time taken for this phase | [
"Logs",
"the",
"time",
"taken",
"by",
"this",
"rule",
"and",
"adds",
"this",
"to",
"the",
"total",
"time",
"taken",
"for",
"this",
"phase"
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/api/src/main/java/org/jboss/windup/config/RuleSubset.java#L167-L186 |
DigitalPebble/TextClassification | src/main/java/com/digitalpebble/classification/util/scorers/logLikelihoodAttributeScorer.java | logLikelihoodAttributeScorer.getValueForRank | public static double getValueForRank(int rank,double[] scores) {
"""
Returns the value of the nth score once sorted
Used to determine whether or not to keep an attribute
*
"""
double[] copy = new double[scores.length];
System.arraycopy(scores,0,copy,0,scores.length);
java.util.Arrays.sort(copy... | java | public static double getValueForRank(int rank,double[] scores){
double[] copy = new double[scores.length];
System.arraycopy(scores,0,copy,0,scores.length);
java.util.Arrays.sort(copy);
rank = scores.length-rank;
return copy[rank];
} | [
"public",
"static",
"double",
"getValueForRank",
"(",
"int",
"rank",
",",
"double",
"[",
"]",
"scores",
")",
"{",
"double",
"[",
"]",
"copy",
"=",
"new",
"double",
"[",
"scores",
".",
"length",
"]",
";",
"System",
".",
"arraycopy",
"(",
"scores",
",",
... | Returns the value of the nth score once sorted
Used to determine whether or not to keep an attribute
* | [
"Returns",
"the",
"value",
"of",
"the",
"nth",
"score",
"once",
"sorted",
"Used",
"to",
"determine",
"whether",
"or",
"not",
"to",
"keep",
"an",
"attribute",
"*"
] | train | https://github.com/DigitalPebble/TextClassification/blob/c510719c31633841af2bf393a20707d4624f865d/src/main/java/com/digitalpebble/classification/util/scorers/logLikelihoodAttributeScorer.java#L129-L135 |
rjeschke/txtmark | src/main/java/com/github/rjeschke/txtmark/Utils.java | Utils.appendHexEntity | public final static void appendHexEntity(final StringBuilder out, final char value) {
"""
Append the given char as a hexadecimal HTML entity.
@param out
The StringBuilder to write to.
@param value
The character.
"""
out.append("&#x");
out.append(Integer.toHexString(value));
out.ap... | java | public final static void appendHexEntity(final StringBuilder out, final char value)
{
out.append("&#x");
out.append(Integer.toHexString(value));
out.append(';');
} | [
"public",
"final",
"static",
"void",
"appendHexEntity",
"(",
"final",
"StringBuilder",
"out",
",",
"final",
"char",
"value",
")",
"{",
"out",
".",
"append",
"(",
"\"&#x\"",
")",
";",
"out",
".",
"append",
"(",
"Integer",
".",
"toHexString",
"(",
"value",
... | Append the given char as a hexadecimal HTML entity.
@param out
The StringBuilder to write to.
@param value
The character. | [
"Append",
"the",
"given",
"char",
"as",
"a",
"hexadecimal",
"HTML",
"entity",
"."
] | train | https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/Utils.java#L537-L542 |
sniggle/simple-pgp | simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/internal/BasePGPCommon.java | BasePGPCommon.findSecretKey | protected PGPSecretKey findSecretKey(InputStream secretKey, final long keyId) throws IOException, PGPException {
"""
helper method to read a specific secret key
@param secretKey
the secret key stream
@param keyId
the key id
@return the applicable secret key or null if none is part of the stream for the key ... | java | protected PGPSecretKey findSecretKey(InputStream secretKey, final long keyId) throws IOException, PGPException {
LOGGER.trace("findSecretKey(InputStream, long)");
LOGGER.trace("Secret Key: {}, Key ID: {}", secretKey == null ? "not set" : "set", keyId);
return findSecretKey(secretKey, new KeyFilter<PGPSecret... | [
"protected",
"PGPSecretKey",
"findSecretKey",
"(",
"InputStream",
"secretKey",
",",
"final",
"long",
"keyId",
")",
"throws",
"IOException",
",",
"PGPException",
"{",
"LOGGER",
".",
"trace",
"(",
"\"findSecretKey(InputStream, long)\"",
")",
";",
"LOGGER",
".",
"trace... | helper method to read a specific secret key
@param secretKey
the secret key stream
@param keyId
the key id
@return the applicable secret key or null if none is part of the stream for the key id
@throws IOException
@throws PGPException | [
"helper",
"method",
"to",
"read",
"a",
"specific",
"secret",
"key"
] | train | https://github.com/sniggle/simple-pgp/blob/2ab83e4d370b8189f767d8e4e4c7e6020e60fbe3/simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/internal/BasePGPCommon.java#L143-L152 |
virgo47/javasimon | core/src/main/java/org/javasimon/callback/lastsplits/LastSplitsCallback.java | LastSplitsCallback.onStopwatchStop | @Override
public void onStopwatchStop(Split split, StopwatchSample sample) {
"""
When a Splits is stopped, it is added to the stopwatch a Last Splits attribute.
"""
LastSplits lastSplits = getLastSplits(split.getStopwatch());
lastSplits.add(split);
lastSplits.log(split);
} | java | @Override
public void onStopwatchStop(Split split, StopwatchSample sample) {
LastSplits lastSplits = getLastSplits(split.getStopwatch());
lastSplits.add(split);
lastSplits.log(split);
} | [
"@",
"Override",
"public",
"void",
"onStopwatchStop",
"(",
"Split",
"split",
",",
"StopwatchSample",
"sample",
")",
"{",
"LastSplits",
"lastSplits",
"=",
"getLastSplits",
"(",
"split",
".",
"getStopwatch",
"(",
")",
")",
";",
"lastSplits",
".",
"add",
"(",
"... | When a Splits is stopped, it is added to the stopwatch a Last Splits attribute. | [
"When",
"a",
"Splits",
"is",
"stopped",
"it",
"is",
"added",
"to",
"the",
"stopwatch",
"a",
"Last",
"Splits",
"attribute",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/callback/lastsplits/LastSplitsCallback.java#L87-L92 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.searchInFacetValues | public JSONObject searchInFacetValues(String facetName, String facetQuery, Query params, RequestOptions requestOptions) throws AlgoliaException {
"""
Search into a facet value
@param requestOptions Options to pass to this request
"""
params = params == null ? new Query() : params;
String paramsStrin... | java | public JSONObject searchInFacetValues(String facetName, String facetQuery, Query params, RequestOptions requestOptions) throws AlgoliaException {
params = params == null ? new Query() : params;
String paramsString = params.setFacetQuery(facetQuery).getQueryString();
JSONObject body = new JSONObject();
S... | [
"public",
"JSONObject",
"searchInFacetValues",
"(",
"String",
"facetName",
",",
"String",
"facetQuery",
",",
"Query",
"params",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"params",
"=",
"params",
"==",
"null",
"?",
"new",
"Que... | Search into a facet value
@param requestOptions Options to pass to this request | [
"Search",
"into",
"a",
"facet",
"value"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L715-L729 |
lucee/Lucee | core/src/main/java/lucee/runtime/net/http/HttpServletRequestDummy.java | HttpServletRequestDummy.addHeader | public void addHeader(String name, String value) {
"""
add a new header value
@param name name of the new value
@param value header value
"""
headers = ReqRspUtil.add(headers, name, value);
} | java | public void addHeader(String name, String value) {
headers = ReqRspUtil.add(headers, name, value);
} | [
"public",
"void",
"addHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"headers",
"=",
"ReqRspUtil",
".",
"add",
"(",
"headers",
",",
"name",
",",
"value",
")",
";",
"}"
] | add a new header value
@param name name of the new value
@param value header value | [
"add",
"a",
"new",
"header",
"value"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/http/HttpServletRequestDummy.java#L247-L249 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ServerDnsAliasesInner.java | ServerDnsAliasesInner.beginCreateOrUpdate | public ServerDnsAliasInner beginCreateOrUpdate(String resourceGroupName, String serverName, String dnsAliasName) {
"""
Creates a server dns alias.
@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.
@pa... | java | public ServerDnsAliasInner beginCreateOrUpdate(String resourceGroupName, String serverName, String dnsAliasName) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, dnsAliasName).toBlocking().single().body();
} | [
"public",
"ServerDnsAliasInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"dnsAliasName",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
"dnsA... | Creates a server dns alias.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server that the alias is pointing to.
@param dnsAliasName The name of the server DNS alias.
@thr... | [
"Creates",
"a",
"server",
"dns",
"alias",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ServerDnsAliasesInner.java#L283-L285 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.toAsync | public static <T1, T2, T3, T4> Func4<T1, T2, T3, T4, Observable<Void>> toAsync(Action4<? super T1, ? super T2, ? super T3, ? super T4> action) {
"""
Convert a synchronous action call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/i... | java | public static <T1, T2, T3, T4> Func4<T1, T2, T3, T4, Observable<Void>> toAsync(Action4<? super T1, ? super T2, ? super T3, ? super T4> action) {
return toAsync(action, Schedulers.computation());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
">",
"Func4",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"Observable",
"<",
"Void",
">",
">",
"toAsync",
"(",
"Action4",
"<",
"?",
"super",
"T1",
",",
"?",
"super",
"T2",
"... | Convert a synchronous action call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.an.png" alt="">
@param <T1> the first parameter type
@param <T2> the second parameter type
@param <T3> the third parameter type
... | [
"Convert",
"a",
"synchronous",
"action",
"call",
"into",
"an",
"asynchronous",
"function",
"call",
"through",
"an",
"Observable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki",
... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L344-L346 |
Metatavu/edelphi | edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/resources/GoogleImageDAO.java | GoogleImageDAO.updateName | public GoogleImage updateName(GoogleImage googleImage, String name, String urlName) {
"""
Updates GoogleImage name. This method does not update lastModifier and lastModified fields and thus should
be called only by system operations (e.g. scheduler)
@param googleImage GoogleImage entity
@param name new resour... | java | public GoogleImage updateName(GoogleImage googleImage, String name, String urlName) {
googleImage.setName(name);
googleImage.setUrlName(urlName);
getEntityManager().persist(googleImage);
return googleImage;
} | [
"public",
"GoogleImage",
"updateName",
"(",
"GoogleImage",
"googleImage",
",",
"String",
"name",
",",
"String",
"urlName",
")",
"{",
"googleImage",
".",
"setName",
"(",
"name",
")",
";",
"googleImage",
".",
"setUrlName",
"(",
"urlName",
")",
";",
"getEntityMan... | Updates GoogleImage name. This method does not update lastModifier and lastModified fields and thus should
be called only by system operations (e.g. scheduler)
@param googleImage GoogleImage entity
@param name new resource name
@param urlName new resource urlName
@return Updated GoogleImage | [
"Updates",
"GoogleImage",
"name",
".",
"This",
"method",
"does",
"not",
"update",
"lastModifier",
"and",
"lastModified",
"fields",
"and",
"thus",
"should",
"be",
"called",
"only",
"by",
"system",
"operations",
"(",
"e",
".",
"g",
".",
"scheduler",
")"
] | train | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/resources/GoogleImageDAO.java#L73-L78 |
alkacon/opencms-core | src/org/opencms/cmis/CmsCmisResourceHelper.java | CmsCmisResourceHelper.getAcl | public synchronized Acl getAcl(CmsCmisCallContext context, String objectId, boolean onlyBasicPermissions) {
"""
Gets the ACL for an object.<p>
@param context the call context
@param objectId the object id
@param onlyBasicPermissions flag to only get basic permissions
@return the ACL for the object
"""
... | java | public synchronized Acl getAcl(CmsCmisCallContext context, String objectId, boolean onlyBasicPermissions) {
try {
CmsObject cms = m_repository.getCmsObject(context);
CmsUUID structureId = new CmsUUID(objectId);
CmsResource resource = cms.readResource(structureId);
... | [
"public",
"synchronized",
"Acl",
"getAcl",
"(",
"CmsCmisCallContext",
"context",
",",
"String",
"objectId",
",",
"boolean",
"onlyBasicPermissions",
")",
"{",
"try",
"{",
"CmsObject",
"cms",
"=",
"m_repository",
".",
"getCmsObject",
"(",
"context",
")",
";",
"Cms... | Gets the ACL for an object.<p>
@param context the call context
@param objectId the object id
@param onlyBasicPermissions flag to only get basic permissions
@return the ACL for the object | [
"Gets",
"the",
"ACL",
"for",
"an",
"object",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cmis/CmsCmisResourceHelper.java#L147-L160 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/Transaction.java | Transaction.hashForWitnessSignature | public synchronized Sha256Hash hashForWitnessSignature(
int inputIndex,
Script scriptCode,
Coin prevValue,
SigHash type,
boolean anyoneCanPay) {
"""
<p>Calculates a signature hash, that is, a hash of a simplified form of the transaction. How exactly the t... | java | public synchronized Sha256Hash hashForWitnessSignature(
int inputIndex,
Script scriptCode,
Coin prevValue,
SigHash type,
boolean anyoneCanPay) {
return hashForWitnessSignature(inputIndex, scriptCode.getProgram(), prevValue, type, anyoneCanPay);
} | [
"public",
"synchronized",
"Sha256Hash",
"hashForWitnessSignature",
"(",
"int",
"inputIndex",
",",
"Script",
"scriptCode",
",",
"Coin",
"prevValue",
",",
"SigHash",
"type",
",",
"boolean",
"anyoneCanPay",
")",
"{",
"return",
"hashForWitnessSignature",
"(",
"inputIndex"... | <p>Calculates a signature hash, that is, a hash of a simplified form of the transaction. How exactly the transaction
is simplified is specified by the type and anyoneCanPay parameters.</p>
<p>This is a low level API and when using the regular {@link Wallet} class you don't have to call this yourself.
When working with... | [
"<p",
">",
"Calculates",
"a",
"signature",
"hash",
"that",
"is",
"a",
"hash",
"of",
"a",
"simplified",
"form",
"of",
"the",
"transaction",
".",
"How",
"exactly",
"the",
"transaction",
"is",
"simplified",
"is",
"specified",
"by",
"the",
"type",
"and",
"anyo... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Transaction.java#L1345-L1352 |
chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/util/jaxb/JaxbUtils.java | JaxbUtils.unmarshalCollection | public static <T> List<T> unmarshalCollection(Class<T> cl, Reader r) throws JAXBException {
"""
Converts the contents of the Reader to a List with objects of the given class.
@param cl Type to be used
@param r Input
@return List with objects of the given type
"""
return unmarshalCollection(cl, new St... | java | public static <T> List<T> unmarshalCollection(Class<T> cl, Reader r) throws JAXBException {
return unmarshalCollection(cl, new StreamSource(r));
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"unmarshalCollection",
"(",
"Class",
"<",
"T",
">",
"cl",
",",
"Reader",
"r",
")",
"throws",
"JAXBException",
"{",
"return",
"unmarshalCollection",
"(",
"cl",
",",
"new",
"StreamSource",
"(",
"r",... | Converts the contents of the Reader to a List with objects of the given class.
@param cl Type to be used
@param r Input
@return List with objects of the given type | [
"Converts",
"the",
"contents",
"of",
"the",
"Reader",
"to",
"a",
"List",
"with",
"objects",
"of",
"the",
"given",
"class",
"."
] | train | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/jaxb/JaxbUtils.java#L310-L312 |
jamesagnew/hapi-fhir | hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TranslationRequest.java | TranslationRequest.addCode | public TranslationRequest addCode(String theSystem, String theCode) {
"""
This is just a convenience method that creates a codeableconcept if one
doesn't already exist, and adds a coding to it
"""
Validate.notBlank(theSystem, "theSystem must not be null");
Validate.notBlank(theCode, "theCode must not be n... | java | public TranslationRequest addCode(String theSystem, String theCode) {
Validate.notBlank(theSystem, "theSystem must not be null");
Validate.notBlank(theCode, "theCode must not be null");
if (getCodeableConcept() == null) {
setCodeableConcept(new CodeableConcept());
}
getCodeableConcept().addCoding(new Codin... | [
"public",
"TranslationRequest",
"addCode",
"(",
"String",
"theSystem",
",",
"String",
"theCode",
")",
"{",
"Validate",
".",
"notBlank",
"(",
"theSystem",
",",
"\"theSystem must not be null\"",
")",
";",
"Validate",
".",
"notBlank",
"(",
"theCode",
",",
"\"theCode ... | This is just a convenience method that creates a codeableconcept if one
doesn't already exist, and adds a coding to it | [
"This",
"is",
"just",
"a",
"convenience",
"method",
"that",
"creates",
"a",
"codeableconcept",
"if",
"one",
"doesn",
"t",
"already",
"exist",
"and",
"adds",
"a",
"coding",
"to",
"it"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TranslationRequest.java#L50-L58 |
aws/aws-sdk-java | aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/CreateIdentityPoolRequest.java | CreateIdentityPoolRequest.withIdentityPoolTags | public CreateIdentityPoolRequest withIdentityPoolTags(java.util.Map<String, String> identityPoolTags) {
"""
<p>
Tags to assign to the identity pool. A tag is a label that you can apply to identity pools to categorize and
manage them in different ways, such as by purpose, owner, environment, or other criteria.
<... | java | public CreateIdentityPoolRequest withIdentityPoolTags(java.util.Map<String, String> identityPoolTags) {
setIdentityPoolTags(identityPoolTags);
return this;
} | [
"public",
"CreateIdentityPoolRequest",
"withIdentityPoolTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"identityPoolTags",
")",
"{",
"setIdentityPoolTags",
"(",
"identityPoolTags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Tags to assign to the identity pool. A tag is a label that you can apply to identity pools to categorize and
manage them in different ways, such as by purpose, owner, environment, or other criteria.
</p>
@param identityPoolTags
Tags to assign to the identity pool. A tag is a label that you can apply to identity po... | [
"<p",
">",
"Tags",
"to",
"assign",
"to",
"the",
"identity",
"pool",
".",
"A",
"tag",
"is",
"a",
"label",
"that",
"you",
"can",
"apply",
"to",
"identity",
"pools",
"to",
"categorize",
"and",
"manage",
"them",
"in",
"different",
"ways",
"such",
"as",
"by... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/CreateIdentityPoolRequest.java#L563-L566 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_screen_serviceName_PUT | public void billingAccount_screen_serviceName_PUT(String billingAccount, String serviceName, OvhScreen body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/screen/{serviceName}
@param body [required] New object properties
@param billingAccount [required] The name o... | java | public void billingAccount_screen_serviceName_PUT(String billingAccount, String serviceName, OvhScreen body) throws IOException {
String qPath = "/telephony/{billingAccount}/screen/{serviceName}";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"billingAccount_screen_serviceName_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhScreen",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/screen/{serviceName}\"",
";",
"Strin... | Alter this object properties
REST: PUT /telephony/{billingAccount}/screen/{serviceName}
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L5372-L5376 |
resilience4j/resilience4j | resilience4j-prometheus/src/main/java/io/github/resilience4j/prometheus/CircuitBreakerExports.java | CircuitBreakerExports.ofCircuitBreaker | public static CircuitBreakerExports ofCircuitBreaker(String prefix, CircuitBreaker circuitBreaker) {
"""
Creates a new instance of {@link CircuitBreakerExports} with default metrics names prefix and
a circuit breaker as a source.
@param prefix the prefix of metrics names
@param circuitBreaker the circuit brea... | java | public static CircuitBreakerExports ofCircuitBreaker(String prefix, CircuitBreaker circuitBreaker) {
requireNonNull(prefix);
requireNonNull(circuitBreaker);
return new CircuitBreakerExports(prefix, Array.of(circuitBreaker));
} | [
"public",
"static",
"CircuitBreakerExports",
"ofCircuitBreaker",
"(",
"String",
"prefix",
",",
"CircuitBreaker",
"circuitBreaker",
")",
"{",
"requireNonNull",
"(",
"prefix",
")",
";",
"requireNonNull",
"(",
"circuitBreaker",
")",
";",
"return",
"new",
"CircuitBreakerE... | Creates a new instance of {@link CircuitBreakerExports} with default metrics names prefix and
a circuit breaker as a source.
@param prefix the prefix of metrics names
@param circuitBreaker the circuit breaker | [
"Creates",
"a",
"new",
"instance",
"of",
"{",
"@link",
"CircuitBreakerExports",
"}",
"with",
"default",
"metrics",
"names",
"prefix",
"and",
"a",
"circuit",
"breaker",
"as",
"a",
"source",
"."
] | train | https://github.com/resilience4j/resilience4j/blob/fa843d30f531c00f0c3dc218b65a7f2bb51af336/resilience4j-prometheus/src/main/java/io/github/resilience4j/prometheus/CircuitBreakerExports.java#L140-L144 |
bwkimmel/java-util | src/main/java/ca/eandb/util/StringUtil.java | StringUtil.hexToByte | public static byte hexToByte(char hex) {
"""
Converts a hexadecimal digit to a byte.
@param hex The hexadecimal digit.
@return The byte value corresponding to <code>hex</code>.
"""
if ('0' <= hex && hex <= '9') {
return (byte) (hex - '0');
} else if ('A' <= hex && hex <= 'F') {
return (by... | java | public static byte hexToByte(char hex) {
if ('0' <= hex && hex <= '9') {
return (byte) (hex - '0');
} else if ('A' <= hex && hex <= 'F') {
return (byte) (10 + hex - 'A');
} else if ('a' <= hex && hex <= 'f') {
return (byte) (10 + hex - 'a');
} else {
throw new IllegalArgumentExce... | [
"public",
"static",
"byte",
"hexToByte",
"(",
"char",
"hex",
")",
"{",
"if",
"(",
"'",
"'",
"<=",
"hex",
"&&",
"hex",
"<=",
"'",
"'",
")",
"{",
"return",
"(",
"byte",
")",
"(",
"hex",
"-",
"'",
"'",
")",
";",
"}",
"else",
"if",
"(",
"'",
"'... | Converts a hexadecimal digit to a byte.
@param hex The hexadecimal digit.
@return The byte value corresponding to <code>hex</code>. | [
"Converts",
"a",
"hexadecimal",
"digit",
"to",
"a",
"byte",
"."
] | train | https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/StringUtil.java#L86-L96 |
apache/fluo | modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java | TransactionImpl.readUnread | private void readUnread(CommitData cd, Consumer<Entry<Key, Value>> locksSeen) {
"""
This function helps handle the following case
<OL>
<LI>TX1 locls r1 col1
<LI>TX1 fails before unlocking
<LI>TX2 attempts to write r1:col1 w/o reading it
</OL>
<p>
In this case TX2 would not roll back TX1, because it neve... | java | private void readUnread(CommitData cd, Consumer<Entry<Key, Value>> locksSeen) {
// TODO make async
// TODO need to keep track of ranges read (not ranges passed in, but actual data read... user
// may not iterate over entire range
Map<Bytes, Set<Column>> columnsToRead = new HashMap<>();
for (Entry<B... | [
"private",
"void",
"readUnread",
"(",
"CommitData",
"cd",
",",
"Consumer",
"<",
"Entry",
"<",
"Key",
",",
"Value",
">",
">",
"locksSeen",
")",
"{",
"// TODO make async",
"// TODO need to keep track of ranges read (not ranges passed in, but actual data read... user",
"// may... | This function helps handle the following case
<OL>
<LI>TX1 locls r1 col1
<LI>TX1 fails before unlocking
<LI>TX2 attempts to write r1:col1 w/o reading it
</OL>
<p>
In this case TX2 would not roll back TX1, because it never read the column. This function
attempts to handle this case if TX2 fails. Only doing this in cas... | [
"This",
"function",
"helps",
"handle",
"the",
"following",
"case"
] | train | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java#L557-L579 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/execution/ExecArgList.java | ExecArgList.buildCommandForNode | @Deprecated
public ArrayList<String> buildCommandForNode(Map<String, Map<String, String>> dataContext, String osFamily) {
"""
Generate the quoted and expanded argument list, by expanding property values given the data context, and quoting
for the given OS
@param dataContext property value data context
@pa... | java | @Deprecated
public ArrayList<String> buildCommandForNode(Map<String, Map<String, String>> dataContext, String osFamily) {
return buildCommandForNode(this, dataContext, osFamily);
} | [
"@",
"Deprecated",
"public",
"ArrayList",
"<",
"String",
">",
"buildCommandForNode",
"(",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"String",
">",
">",
"dataContext",
",",
"String",
"osFamily",
")",
"{",
"return",
"buildCommandForNode",
"(",
"thi... | Generate the quoted and expanded argument list, by expanding property values given the data context, and quoting
for the given OS
@param dataContext property value data context
@param osFamily OS family to determine quoting
@return list of strings | [
"Generate",
"the",
"quoted",
"and",
"expanded",
"argument",
"list",
"by",
"expanding",
"property",
"values",
"given",
"the",
"data",
"context",
"and",
"quoting",
"for",
"the",
"given",
"OS"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/execution/ExecArgList.java#L140-L143 |
sniggle/simple-pgp | simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/internal/BasePGPCommon.java | BasePGPCommon.findSecretKey | protected PGPSecretKey findSecretKey(InputStream secretKey, KeyFilter<PGPSecretKey> keyFilter) throws IOException, PGPException {
"""
reads the given secret key and applies the provided key filter
@param secretKey
the secret key stream
@param keyFilter
the filter to apply on the stream
@return the secret ke... | java | protected PGPSecretKey findSecretKey(InputStream secretKey, KeyFilter<PGPSecretKey> keyFilter) throws IOException, PGPException {
LOGGER.trace("findSecretKey(InputStream, KeyFilter<PGPSecretKey>)");
PGPSecretKey result = null;
LOGGER.debug("Wrapping secret key stream in ArmoredInputStream");
try( InputS... | [
"protected",
"PGPSecretKey",
"findSecretKey",
"(",
"InputStream",
"secretKey",
",",
"KeyFilter",
"<",
"PGPSecretKey",
">",
"keyFilter",
")",
"throws",
"IOException",
",",
"PGPException",
"{",
"LOGGER",
".",
"trace",
"(",
"\"findSecretKey(InputStream, KeyFilter<PGPSecretKe... | reads the given secret key and applies the provided key filter
@param secretKey
the secret key stream
@param keyFilter
the filter to apply on the stream
@return the secret key or null if none matches the filter acceptance criteria
@throws IOException
@throws PGPException | [
"reads",
"the",
"given",
"secret",
"key",
"and",
"applies",
"the",
"provided",
"key",
"filter"
] | train | https://github.com/sniggle/simple-pgp/blob/2ab83e4d370b8189f767d8e4e4c7e6020e60fbe3/simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/internal/BasePGPCommon.java#L165-L175 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/scripting/ScriptingUtils.java | ScriptingUtils.executeGroovyShellScript | public static <T> T executeGroovyShellScript(final String script,
final Map<String, Object> variables,
final Class<T> clazz) {
"""
Execute groovy shell script t.
@param <T> the type parameter
@param script ... | java | public static <T> T executeGroovyShellScript(final String script,
final Map<String, Object> variables,
final Class<T> clazz) {
try {
val binding = new Binding();
val shell = new GroovyShell(... | [
"public",
"static",
"<",
"T",
">",
"T",
"executeGroovyShellScript",
"(",
"final",
"String",
"script",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"variables",
",",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"try",
"{",
"val",
"bind... | Execute groovy shell script t.
@param <T> the type parameter
@param script the script
@param variables the variables
@param clazz the clazz
@return the t | [
"Execute",
"groovy",
"shell",
"script",
"t",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/scripting/ScriptingUtils.java#L103-L123 |
google/closure-compiler | src/com/google/javascript/jscomp/FunctionTypeBuilder.java | FunctionTypeBuilder.inferThisType | FunctionTypeBuilder inferThisType(JSDocInfo info, JSType type) {
"""
Infers the type of {@code this}.
@param type The type of this if the info is missing.
"""
// Look at the @this annotation first.
inferThisType(info);
if (thisType == null) {
ObjectType objType = ObjectType.cast(type);
... | java | FunctionTypeBuilder inferThisType(JSDocInfo info, JSType type) {
// Look at the @this annotation first.
inferThisType(info);
if (thisType == null) {
ObjectType objType = ObjectType.cast(type);
if (objType != null && (info == null || !info.hasType())) {
thisType = objType;
}
}
... | [
"FunctionTypeBuilder",
"inferThisType",
"(",
"JSDocInfo",
"info",
",",
"JSType",
"type",
")",
"{",
"// Look at the @this annotation first.",
"inferThisType",
"(",
"info",
")",
";",
"if",
"(",
"thisType",
"==",
"null",
")",
"{",
"ObjectType",
"objType",
"=",
"Objec... | Infers the type of {@code this}.
@param type The type of this if the info is missing. | [
"Infers",
"the",
"type",
"of",
"{"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/FunctionTypeBuilder.java#L524-L536 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/script/ExtensionScript.java | ExtensionScript.invokeSenderScript | public void invokeSenderScript(ScriptWrapper script, HttpMessage msg, int initiator, HttpSender sender, boolean request) {
"""
Invokes the given {@code script}, synchronously, as a {@link HttpSenderScript}, handling any {@code Exception} thrown
during the invocation.
<p>
The context class loader of caller threa... | java | public void invokeSenderScript(ScriptWrapper script, HttpMessage msg, int initiator, HttpSender sender, boolean request) {
validateScriptType(script, TYPE_HTTP_SENDER);
Writer writer = getWriters(script);
try {
HttpSenderScript senderScript = this.getInterface(script, HttpSende... | [
"public",
"void",
"invokeSenderScript",
"(",
"ScriptWrapper",
"script",
",",
"HttpMessage",
"msg",
",",
"int",
"initiator",
",",
"HttpSender",
"sender",
",",
"boolean",
"request",
")",
"{",
"validateScriptType",
"(",
"script",
",",
"TYPE_HTTP_SENDER",
")",
";",
... | Invokes the given {@code script}, synchronously, as a {@link HttpSenderScript}, handling any {@code Exception} thrown
during the invocation.
<p>
The context class loader of caller thread is replaced with the class loader {@code AddOnLoader} to allow the script to
access classes of add-ons.
@param script the script to ... | [
"Invokes",
"the",
"given",
"{",
"@code",
"script",
"}",
"synchronously",
"as",
"a",
"{",
"@link",
"HttpSenderScript",
"}",
"handling",
"any",
"{",
"@code",
"Exception",
"}",
"thrown",
"during",
"the",
"invocation",
".",
"<p",
">",
"The",
"context",
"class",
... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/script/ExtensionScript.java#L1523-L1542 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentsInner.java | ComponentsInner.purgeAsync | public Observable<ComponentPurgeResponseInner> purgeAsync(String resourceGroupName, String resourceName, ComponentPurgeBody body) {
"""
Purges data in an Application Insights component by a set of user-defined filters.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the... | java | public Observable<ComponentPurgeResponseInner> purgeAsync(String resourceGroupName, String resourceName, ComponentPurgeBody body) {
return purgeWithServiceResponseAsync(resourceGroupName, resourceName, body).map(new Func1<ServiceResponse<ComponentPurgeResponseInner>, ComponentPurgeResponseInner>() {
... | [
"public",
"Observable",
"<",
"ComponentPurgeResponseInner",
">",
"purgeAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ComponentPurgeBody",
"body",
")",
"{",
"return",
"purgeWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resour... | Purges data in an Application Insights component by a set of user-defined filters.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@param body Describes the body of a request to purge data in a single table of an Application Insights... | [
"Purges",
"data",
"in",
"an",
"Application",
"Insights",
"component",
"by",
"a",
"set",
"of",
"user",
"-",
"defined",
"filters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentsInner.java#L815-L822 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapConnection.java | LdapConnection.updateAttributesCache | private void updateAttributesCache(String uniqueNameKey, String dn, Attributes newAttrs, String[] attrIds) {
"""
Update the attributes cache by adding a mapping of the unique name to distinguished name
and mapping the distinguished name to the updated attributes.
@param uniqueNameKey The unique name to map the... | java | private void updateAttributesCache(String uniqueNameKey, String dn, Attributes newAttrs, String[] attrIds) {
final String METHODNAME = "updateAttributesCache(key,dn,newAttrs)";
/*
* Add uniqueName to DN mapping to cache
*/
getAttributesCache().put(uniqueNameKey, dn, 1, iAttrsC... | [
"private",
"void",
"updateAttributesCache",
"(",
"String",
"uniqueNameKey",
",",
"String",
"dn",
",",
"Attributes",
"newAttrs",
",",
"String",
"[",
"]",
"attrIds",
")",
"{",
"final",
"String",
"METHODNAME",
"=",
"\"updateAttributesCache(key,dn,newAttrs)\"",
";",
"/*... | Update the attributes cache by adding a mapping of the unique name to distinguished name
and mapping the distinguished name to the updated attributes.
@param uniqueNameKey The unique name to map the distinguished name to.
@param dn The distinguished name to map to the unique name. This will also be used to map
the att... | [
"Update",
"the",
"attributes",
"cache",
"by",
"adding",
"a",
"mapping",
"of",
"the",
"unique",
"name",
"to",
"distinguished",
"name",
"and",
"mapping",
"the",
"distinguished",
"name",
"to",
"the",
"updated",
"attributes",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapConnection.java#L1073-L1095 |
kiegroup/drools | drools-core/src/main/java/org/drools/core/phreak/SegmentUtilities.java | SegmentUtilities.isRootNode | public static boolean isRootNode(LeftTupleNode node, TerminalNode removingTN) {
"""
Returns whether the node is the root of a segment.
Lians are always the root of a segment.
node cannot be null.
The result should discount any removingRule. That means it gives you the result as
if the rule had already been... | java | public static boolean isRootNode(LeftTupleNode node, TerminalNode removingTN) {
return node.getType() == NodeTypeEnums.LeftInputAdapterNode || isNonTerminalTipNode( node.getLeftTupleSource(), removingTN );
} | [
"public",
"static",
"boolean",
"isRootNode",
"(",
"LeftTupleNode",
"node",
",",
"TerminalNode",
"removingTN",
")",
"{",
"return",
"node",
".",
"getType",
"(",
")",
"==",
"NodeTypeEnums",
".",
"LeftInputAdapterNode",
"||",
"isNonTerminalTipNode",
"(",
"node",
".",
... | Returns whether the node is the root of a segment.
Lians are always the root of a segment.
node cannot be null.
The result should discount any removingRule. That means it gives you the result as
if the rule had already been removed from the network. | [
"Returns",
"whether",
"the",
"node",
"is",
"the",
"root",
"of",
"a",
"segment",
".",
"Lians",
"are",
"always",
"the",
"root",
"of",
"a",
"segment",
"."
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/phreak/SegmentUtilities.java#L471-L473 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/SuperPositions.java | SuperPositions.getRmsd | public static double getRmsd(Point3d[] fixed, Point3d[] moved) {
"""
Use the {@link SuperPosition#getRmsd(Point3d[], Point3d[])} method of the
default static SuperPosition algorithm contained in this Class.
"""
superposer.setCentered(false);
return superposer.getRmsd(fixed, moved);
} | java | public static double getRmsd(Point3d[] fixed, Point3d[] moved) {
superposer.setCentered(false);
return superposer.getRmsd(fixed, moved);
} | [
"public",
"static",
"double",
"getRmsd",
"(",
"Point3d",
"[",
"]",
"fixed",
",",
"Point3d",
"[",
"]",
"moved",
")",
"{",
"superposer",
".",
"setCentered",
"(",
"false",
")",
";",
"return",
"superposer",
".",
"getRmsd",
"(",
"fixed",
",",
"moved",
")",
... | Use the {@link SuperPosition#getRmsd(Point3d[], Point3d[])} method of the
default static SuperPosition algorithm contained in this Class. | [
"Use",
"the",
"{"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/SuperPositions.java#L89-L92 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/dynamic/DefaultRedisCommandsMetadata.java | DefaultRedisCommandsMetadata.getMostSpecificMethod | public static Method getMostSpecificMethod(Method method, Class<?> targetClass) {
"""
Given a method, which may come from an interface, and a target class used in the current reflective invocation, find the
corresponding target method if there is one. E.g. the method may be {@code IFoo.bar()} and the target class... | java | public static Method getMostSpecificMethod(Method method, Class<?> targetClass) {
if (method != null && isOverridable(method, targetClass) && targetClass != null
&& targetClass != method.getDeclaringClass()) {
try {
try {
return targetClass.getMet... | [
"public",
"static",
"Method",
"getMostSpecificMethod",
"(",
"Method",
"method",
",",
"Class",
"<",
"?",
">",
"targetClass",
")",
"{",
"if",
"(",
"method",
"!=",
"null",
"&&",
"isOverridable",
"(",
"method",
",",
"targetClass",
")",
"&&",
"targetClass",
"!=",... | Given a method, which may come from an interface, and a target class used in the current reflective invocation, find the
corresponding target method if there is one. E.g. the method may be {@code IFoo.bar()} and the target class may be
{@code DefaultFoo}. In this case, the method may be {@code DefaultFoo.bar()}. This e... | [
"Given",
"a",
"method",
"which",
"may",
"come",
"from",
"an",
"interface",
"and",
"a",
"target",
"class",
"used",
"in",
"the",
"current",
"reflective",
"invocation",
"find",
"the",
"corresponding",
"target",
"method",
"if",
"there",
"is",
"one",
".",
"E",
... | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/dynamic/DefaultRedisCommandsMetadata.java#L101-L115 |
apache/groovy | src/main/java/org/codehaus/groovy/reflection/ReflectionUtils.java | ReflectionUtils.getCallingClass | public static Class getCallingClass(int matchLevel, Collection<String> extraIgnoredPackages) {
"""
Get the called that is matchLevel stack frames before the call,
ignoring MOP frames and desired exclude packages.
@param matchLevel how may call stacks down to look.
If it is less than 1 it is treated ... | java | public static Class getCallingClass(int matchLevel, Collection<String> extraIgnoredPackages) {
Class[] classContext = HELPER.getClassContext();
int depth = 0;
try {
Class c;
// this super class stuff is for Java 1.4 support only
// it isn't needed on a 5.0 VM... | [
"public",
"static",
"Class",
"getCallingClass",
"(",
"int",
"matchLevel",
",",
"Collection",
"<",
"String",
">",
"extraIgnoredPackages",
")",
"{",
"Class",
"[",
"]",
"classContext",
"=",
"HELPER",
".",
"getClassContext",
"(",
")",
";",
"int",
"depth",
"=",
"... | Get the called that is matchLevel stack frames before the call,
ignoring MOP frames and desired exclude packages.
@param matchLevel how may call stacks down to look.
If it is less than 1 it is treated as though it was 1.
@param extraIgnoredPackages A collection of string names of packages to exclude
in addit... | [
"Get",
"the",
"called",
"that",
"is",
"matchLevel",
"stack",
"frames",
"before",
"the",
"call",
"ignoring",
"MOP",
"frames",
"and",
"desired",
"exclude",
"packages",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/reflection/ReflectionUtils.java#L97-L121 |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/dory/DoradusClient.java | DoradusClient.lookupStorageServiceByApp | private static String lookupStorageServiceByApp(RESTClient restClient, String applicationName) {
"""
Convenient method to lookup storageService of the application
@param restClient
@param applicationName
@return storage service name
"""
Utils.require(applicationName != null, "Missing application nam... | java | private static String lookupStorageServiceByApp(RESTClient restClient, String applicationName) {
Utils.require(applicationName != null, "Missing application name");
if (applicationName != null) {
ApplicationDefinition appDef = Command.getAppDef(restClient, applicationName);
Util... | [
"private",
"static",
"String",
"lookupStorageServiceByApp",
"(",
"RESTClient",
"restClient",
",",
"String",
"applicationName",
")",
"{",
"Utils",
".",
"require",
"(",
"applicationName",
"!=",
"null",
",",
"\"Missing application name\"",
")",
";",
"if",
"(",
"applica... | Convenient method to lookup storageService of the application
@param restClient
@param applicationName
@return storage service name | [
"Convenient",
"method",
"to",
"lookup",
"storageService",
"of",
"the",
"application"
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/dory/DoradusClient.java#L208-L216 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.filemonitor/src/com/ibm/ws/kernel/filemonitor/internal/MonitorHolder.java | MonitorHolder.scanForUpdates | private void scanForUpdates(Collection<File> created, Collection<File> deleted, Collection<File> modified) {
"""
Find changes to monitored resources.
Not thread safe: please ensure you're calling this only from
one thread (i.e. within the scanLock)
@param created the list to which created files will be added
... | java | private void scanForUpdates(Collection<File> created, Collection<File> deleted, Collection<File> modified) {
for (UpdateMonitor m : updateMonitors.keySet()) {
try {
m.scanForUpdates(created, modified, deleted);
} catch (RuntimeException e) {
// Don't let o... | [
"private",
"void",
"scanForUpdates",
"(",
"Collection",
"<",
"File",
">",
"created",
",",
"Collection",
"<",
"File",
">",
"deleted",
",",
"Collection",
"<",
"File",
">",
"modified",
")",
"{",
"for",
"(",
"UpdateMonitor",
"m",
":",
"updateMonitors",
".",
"k... | Find changes to monitored resources.
Not thread safe: please ensure you're calling this only from
one thread (i.e. within the scanLock)
@param created the list to which created files will be added
@param deleted the list to which deleted files will be added
@param modified the list to which modified files will be adde... | [
"Find",
"changes",
"to",
"monitored",
"resources",
".",
"Not",
"thread",
"safe",
":",
"please",
"ensure",
"you",
"re",
"calling",
"this",
"only",
"from",
"one",
"thread",
"(",
"i",
".",
"e",
".",
"within",
"the",
"scanLock",
")"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.filemonitor/src/com/ibm/ws/kernel/filemonitor/internal/MonitorHolder.java#L1091-L1100 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.openidconnect.clients.common/src/com/ibm/ws/security/openidconnect/clients/common/UserInfoHelper.java | UserInfoHelper.isUserInfoValid | protected boolean isUserInfoValid(String userInfoStr, String subClaim) {
"""
per oidc-connect-core-1.0 sec 5.3.2, sub claim of userinfo response must match sub claim in id token.
"""
String userInfoSubClaim = getUserInfoSubClaim(userInfoStr);
if (userInfoSubClaim == null || subClaim == null || ... | java | protected boolean isUserInfoValid(String userInfoStr, String subClaim) {
String userInfoSubClaim = getUserInfoSubClaim(userInfoStr);
if (userInfoSubClaim == null || subClaim == null || userInfoSubClaim.compareTo(subClaim) != 0) {
Tr.error(tc, "USERINFO_INVALID", new Object[] { userInfoStr, s... | [
"protected",
"boolean",
"isUserInfoValid",
"(",
"String",
"userInfoStr",
",",
"String",
"subClaim",
")",
"{",
"String",
"userInfoSubClaim",
"=",
"getUserInfoSubClaim",
"(",
"userInfoStr",
")",
";",
"if",
"(",
"userInfoSubClaim",
"==",
"null",
"||",
"subClaim",
"==... | per oidc-connect-core-1.0 sec 5.3.2, sub claim of userinfo response must match sub claim in id token. | [
"per",
"oidc",
"-",
"connect",
"-",
"core",
"-",
"1",
".",
"0",
"sec",
"5",
".",
"3",
".",
"2",
"sub",
"claim",
"of",
"userinfo",
"response",
"must",
"match",
"sub",
"claim",
"in",
"id",
"token",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.openidconnect.clients.common/src/com/ibm/ws/security/openidconnect/clients/common/UserInfoHelper.java#L73-L80 |
eserating/siren4j | src/main/java/com/google/code/siren4j/component/builder/EntityBuilder.java | EntityBuilder.validateSubEntities | private void validateSubEntities(Entity obj) {
"""
Validate sub entities ensuring the existence of a relationship and if an embedded link then ensure the
existence of an href.
@param obj assumed not <code>null</code>.
"""
// Validate that all sub entities have a "rel" set.
String relRequire... | java | private void validateSubEntities(Entity obj) {
// Validate that all sub entities have a "rel" set.
String relRequired = "Sub entities are required to have a <rel> property set.";
String hrefReqForEmbed = "Sub entities that are embedded links are required to have a <href> property set.";
... | [
"private",
"void",
"validateSubEntities",
"(",
"Entity",
"obj",
")",
"{",
"// Validate that all sub entities have a \"rel\" set.\r",
"String",
"relRequired",
"=",
"\"Sub entities are required to have a <rel> property set.\"",
";",
"String",
"hrefReqForEmbed",
"=",
"\"Sub entities t... | Validate sub entities ensuring the existence of a relationship and if an embedded link then ensure the
existence of an href.
@param obj assumed not <code>null</code>. | [
"Validate",
"sub",
"entities",
"ensuring",
"the",
"existence",
"of",
"a",
"relationship",
"and",
"if",
"an",
"embedded",
"link",
"then",
"ensure",
"the",
"existence",
"of",
"an",
"href",
"."
] | train | https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/component/builder/EntityBuilder.java#L324-L338 |
sahan/ZombieLink | zombielink/src/main/java/com/lonepulse/zombielink/request/RequestProcessorChain.java | RequestProcessorChain.onTraverse | @Override
protected HttpRequestBase onTraverse(HttpRequestBase result, ProcessorChainLink<HttpRequestBase, RequestProcessorException> successor, Object... args) {
"""
<p>Executed for each <i>link-traversal<i> from the root {@link UriProcessor} onwards. Takes the
<b>successor</b> and invokes it with the argument ... | java | @Override
protected HttpRequestBase onTraverse(HttpRequestBase result, ProcessorChainLink<HttpRequestBase, RequestProcessorException> successor, Object... args) {
return successor.getProcessor().run(args[0], result); //allow any exceptions to elevate to a chain-wide failure
} | [
"@",
"Override",
"protected",
"HttpRequestBase",
"onTraverse",
"(",
"HttpRequestBase",
"result",
",",
"ProcessorChainLink",
"<",
"HttpRequestBase",
",",
"RequestProcessorException",
">",
"successor",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"successor",
".",
... | <p>Executed for each <i>link-traversal<i> from the root {@link UriProcessor} onwards. Takes the
<b>successor</b> and invokes it with the argument array which was provided in {@link #run(Object...)}
and returns the resulting {@link HttpRequestBase}.</p>
<p>See {@link AbstractRequestProcessor}.</p>
{@inheritDoc} | [
"<p",
">",
"Executed",
"for",
"each",
"<i",
">",
"link",
"-",
"traversal<i",
">",
"from",
"the",
"root",
"{",
"@link",
"UriProcessor",
"}",
"onwards",
".",
"Takes",
"the",
"<b",
">",
"successor<",
"/",
"b",
">",
"and",
"invokes",
"it",
"with",
"the",
... | train | https://github.com/sahan/ZombieLink/blob/a9971add56d4f6919a4a5e84c78e9220011d8982/zombielink/src/main/java/com/lonepulse/zombielink/request/RequestProcessorChain.java#L126-L130 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.deleteRegexEntityRoleAsync | public Observable<OperationStatus> deleteRegexEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId) {
"""
Delete an entity role.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role Id.
@throws IllegalArgumentExcep... | java | public Observable<OperationStatus> deleteRegexEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId) {
return deleteRegexEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() {
@Override
... | [
"public",
"Observable",
"<",
"OperationStatus",
">",
"deleteRegexEntityRoleAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
")",
"{",
"return",
"deleteRegexEntityRoleWithServiceResponseAsync",
"(",
"appId",
",",... | Delete an entity role.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role Id.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationStatus object | [
"Delete",
"an",
"entity",
"role",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L12285-L12292 |
alipay/sofa-rpc | extension-impl/remoting-http/src/main/java/com/alipay/sofa/rpc/transport/http/Http2ServerChannelInitializer.java | Http2ServerChannelInitializer.configureClearText | private void configureClearText(final SocketChannel ch) {
"""
Configure the pipeline for a cleartext upgrade from HTTP to HTTP/2.0
"""
final ChannelPipeline p = ch.pipeline();
final HttpServerCodec sourceCodec = new HttpServerCodec();
final HttpServerUpgradeHandler upgradeHandler = new ... | java | private void configureClearText(final SocketChannel ch) {
final ChannelPipeline p = ch.pipeline();
final HttpServerCodec sourceCodec = new HttpServerCodec();
final HttpServerUpgradeHandler upgradeHandler = new HttpServerUpgradeHandler(sourceCodec,
new UpgradeCodecFactory() {
... | [
"private",
"void",
"configureClearText",
"(",
"final",
"SocketChannel",
"ch",
")",
"{",
"final",
"ChannelPipeline",
"p",
"=",
"ch",
".",
"pipeline",
"(",
")",
";",
"final",
"HttpServerCodec",
"sourceCodec",
"=",
"new",
"HttpServerCodec",
"(",
")",
";",
"final"... | Configure the pipeline for a cleartext upgrade from HTTP to HTTP/2.0 | [
"Configure",
"the",
"pipeline",
"for",
"a",
"cleartext",
"upgrade",
"from",
"HTTP",
"to",
"HTTP",
"/",
"2",
".",
"0"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/remoting-http/src/main/java/com/alipay/sofa/rpc/transport/http/Http2ServerChannelInitializer.java#L116-L156 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/TapClient.java | TapClient.tapCustom | public TapStream tapCustom(final String id, final RequestMessage message)
throws ConfigurationException, IOException {
"""
Allows the user to specify a custom tap message.
@param id the named tap id that can be used to resume a disconnected tap
stream
@param message the custom tap message that will be use... | java | public TapStream tapCustom(final String id, final RequestMessage message)
throws ConfigurationException, IOException {
final TapConnectionProvider conn = new TapConnectionProvider(addrs);
final TapStream ts = new TapStream();
conn.broadcastOp(new BroadcastOpFactory() {
public Operation newOp(final... | [
"public",
"TapStream",
"tapCustom",
"(",
"final",
"String",
"id",
",",
"final",
"RequestMessage",
"message",
")",
"throws",
"ConfigurationException",
",",
"IOException",
"{",
"final",
"TapConnectionProvider",
"conn",
"=",
"new",
"TapConnectionProvider",
"(",
"addrs",
... | Allows the user to specify a custom tap message.
@param id the named tap id that can be used to resume a disconnected tap
stream
@param message the custom tap message that will be used to initiate the tap
stream.
@return the operation that controls the tap stream.
@throws ConfigurationException a bad configuration was... | [
"Allows",
"the",
"user",
"to",
"specify",
"a",
"custom",
"tap",
"message",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/TapClient.java#L166-L197 |
jayantk/jklol | src/com/jayantkrish/jklol/preprocessing/FeatureStandardizer.java | FeatureStandardizer.getVariances | public static DiscreteFactor getVariances(DiscreteFactor featureFactor, int featureVariableNum) {
"""
Gets the variance of the values of each assignment to
{@code featureVariableNum} in {@code featureFactor}.
@param featureFactor
@param featureVariableNum
@return
"""
return getVariances(Arrays.asList... | java | public static DiscreteFactor getVariances(DiscreteFactor featureFactor, int featureVariableNum) {
return getVariances(Arrays.asList(featureFactor), featureVariableNum);
} | [
"public",
"static",
"DiscreteFactor",
"getVariances",
"(",
"DiscreteFactor",
"featureFactor",
",",
"int",
"featureVariableNum",
")",
"{",
"return",
"getVariances",
"(",
"Arrays",
".",
"asList",
"(",
"featureFactor",
")",
",",
"featureVariableNum",
")",
";",
"}"
] | Gets the variance of the values of each assignment to
{@code featureVariableNum} in {@code featureFactor}.
@param featureFactor
@param featureVariableNum
@return | [
"Gets",
"the",
"variance",
"of",
"the",
"values",
"of",
"each",
"assignment",
"to",
"{",
"@code",
"featureVariableNum",
"}",
"in",
"{",
"@code",
"featureFactor",
"}",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/preprocessing/FeatureStandardizer.java#L171-L173 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/admin/AbstractAdminObject.java | AbstractAdminObject.readFromDB4Properties | protected void readFromDB4Properties()
throws CacheReloadException {
"""
The instance method reads the properties for this administration object.
Each found property is set with instance method {@link #setProperty}.
@throws CacheReloadException on error
@see #setProperty
"""
Connection c... | java | protected void readFromDB4Properties()
throws CacheReloadException
{
Connection con = null;
try {
con = Context.getConnection();
final PreparedStatement stmt = con.prepareStatement(AbstractAdminObject.SELECT);
stmt.setObject(1, getId());
final ... | [
"protected",
"void",
"readFromDB4Properties",
"(",
")",
"throws",
"CacheReloadException",
"{",
"Connection",
"con",
"=",
"null",
";",
"try",
"{",
"con",
"=",
"Context",
".",
"getConnection",
"(",
")",
";",
"final",
"PreparedStatement",
"stmt",
"=",
"con",
".",... | The instance method reads the properties for this administration object.
Each found property is set with instance method {@link #setProperty}.
@throws CacheReloadException on error
@see #setProperty | [
"The",
"instance",
"method",
"reads",
"the",
"properties",
"for",
"this",
"administration",
"object",
".",
"Each",
"found",
"property",
"is",
"set",
"with",
"instance",
"method",
"{",
"@link",
"#setProperty",
"}",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/admin/AbstractAdminObject.java#L385-L418 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/RemoteQPConsumerKey.java | RemoteQPConsumerKey.completedReceived | protected final void completedReceived(AIStreamKey key, boolean reissueGet) {
"""
completed tick received from the RME corresponding to a get request issued by this consumer.
Note that this method is called only when the RemoteConsumerDispatcher does not hide the completed
by reissuing the get.
This method will... | java | protected final void completedReceived(AIStreamKey key, boolean reissueGet)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "completedReceived", new Object[] {key, Boolean.valueOf(reissueGet)});
completedReceivedNoPrefetch(key, reissueGet);
try
{
i... | [
"protected",
"final",
"void",
"completedReceived",
"(",
"AIStreamKey",
"key",
",",
"boolean",
"reissueGet",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
... | completed tick received from the RME corresponding to a get request issued by this consumer.
Note that this method is called only when the RemoteConsumerDispatcher does not hide the completed
by reissuing the get.
This method will never be called for messages received due to gets issued by the
RemoteQPConsumerKeyGroup
... | [
"completed",
"tick",
"received",
"from",
"the",
"RME",
"corresponding",
"to",
"a",
"get",
"request",
"issued",
"by",
"this",
"consumer",
".",
"Note",
"that",
"this",
"method",
"is",
"called",
"only",
"when",
"the",
"RemoteConsumerDispatcher",
"does",
"not",
"h... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/RemoteQPConsumerKey.java#L515-L537 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/CheckedExceptionsFactory.java | CheckedExceptionsFactory.newCloneNotSupportedException | public static CloneNotSupportedException newCloneNotSupportedException(Throwable cause,
String message, Object... args) {
"""
Constructs and initializes a new {@link CloneNotSupportedException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] argumen... | java | public static CloneNotSupportedException newCloneNotSupportedException(Throwable cause,
String message, Object... args) {
return (CloneNotSupportedException) new CloneNotSupportedException(format(message, args)).initCause(cause);
} | [
"public",
"static",
"CloneNotSupportedException",
"newCloneNotSupportedException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"(",
"CloneNotSupportedException",
")",
"new",
"CloneNotSupportedException",
"(",
"f... | Constructs and initializes a new {@link CloneNotSupportedException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} identified as the reason this {@link CloneNotSupportedException} was thrown.
@param message {@link St... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"CloneNotSupportedException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/CheckedExceptionsFactory.java#L59-L63 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLLiteralImplString_CustomFieldSerializer.java | OWLLiteralImplString_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLLiteralImplString instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLLiteralImplString instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLLiteralImplString",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.client.rp... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{"
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLLiteralImplString_CustomFieldSerializer.java#L63-L66 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/report/MessageListeners.java | MessageListeners.onInboundMessage | public void onInboundMessage(Message message, TestContext context) {
"""
Delegate to all known message listener instances.
@param message
@param context
"""
if (message != null) {
for (MessageListener listener : messageListener) {
listener.onInboundMessage(message, conte... | java | public void onInboundMessage(Message message, TestContext context) {
if (message != null) {
for (MessageListener listener : messageListener) {
listener.onInboundMessage(message, context);
}
}
} | [
"public",
"void",
"onInboundMessage",
"(",
"Message",
"message",
",",
"TestContext",
"context",
")",
"{",
"if",
"(",
"message",
"!=",
"null",
")",
"{",
"for",
"(",
"MessageListener",
"listener",
":",
"messageListener",
")",
"{",
"listener",
".",
"onInboundMess... | Delegate to all known message listener instances.
@param message
@param context | [
"Delegate",
"to",
"all",
"known",
"message",
"listener",
"instances",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/report/MessageListeners.java#L44-L50 |
thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/util/MetricInstrumentedIterator.java | MetricInstrumentedIterator.of | public static MetricInstrumentedIterator of(KeyIterator keyIterator, String... prefix) {
"""
If the iterator argument is non-null, then return a new
{@code MetricInstrumentedIterator} wrapping it. Metrics for method calls
on the wrapped instance will be prefixed with the string {@code prefix}
which must be non-... | java | public static MetricInstrumentedIterator of(KeyIterator keyIterator, String... prefix) {
if (keyIterator == null) {
return null;
}
Preconditions.checkNotNull(prefix);
return new MetricInstrumentedIterator(keyIterator, StringUtils.join(prefix,"."));
} | [
"public",
"static",
"MetricInstrumentedIterator",
"of",
"(",
"KeyIterator",
"keyIterator",
",",
"String",
"...",
"prefix",
")",
"{",
"if",
"(",
"keyIterator",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Preconditions",
".",
"checkNotNull",
"(",
"prefi... | If the iterator argument is non-null, then return a new
{@code MetricInstrumentedIterator} wrapping it. Metrics for method calls
on the wrapped instance will be prefixed with the string {@code prefix}
which must be non-null. If the iterator argument is null, then return
null.
@param keyIterator
the iterator to wrap wi... | [
"If",
"the",
"iterator",
"argument",
"is",
"non",
"-",
"null",
"then",
"return",
"a",
"new",
"{",
"@code",
"MetricInstrumentedIterator",
"}",
"wrapping",
"it",
".",
"Metrics",
"for",
"method",
"calls",
"on",
"the",
"wrapped",
"instance",
"will",
"be",
"prefi... | train | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/util/MetricInstrumentedIterator.java#L43-L50 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/internal/HierarchicalUriComponents.java | HierarchicalUriComponents.encodeUriComponent | public static String encodeUriComponent(String source, String encoding, Type type)
throws UnsupportedEncodingException {
"""
Encode the given source into an encoded String using the rules specified
by the given component and with the given options.
@param source the source string
@param encoding the... | java | public static String encodeUriComponent(String source, String encoding, Type type)
throws UnsupportedEncodingException {
if (source == null) {
return null;
}
assertNotEmpty(encoding, "Encoding");
byte[] bytes = encodeBytes(source.getBytes(encoding), type);
... | [
"public",
"static",
"String",
"encodeUriComponent",
"(",
"String",
"source",
",",
"String",
"encoding",
",",
"Type",
"type",
")",
"throws",
"UnsupportedEncodingException",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"assertNot... | Encode the given source into an encoded String using the rules specified
by the given component and with the given options.
@param source the source string
@param encoding the encoding of the source string
@param type the URI component for the source
@return the encoded URI
@throws IllegalArgumentException when the giv... | [
"Encode",
"the",
"given",
"source",
"into",
"an",
"encoded",
"String",
"using",
"the",
"rules",
"specified",
"by",
"the",
"given",
"component",
"and",
"with",
"the",
"given",
"options",
"."
] | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/internal/HierarchicalUriComponents.java#L42-L51 |
lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java | CommonOps_DSCC.multTransAB | public static void multTransAB(DMatrixSparseCSC A , DMatrixRMaj B , DMatrixRMaj C ) {
"""
Performs matrix multiplication. C = A<sup>T</sup>*B<sup>T</sup>
@param A Matrix
@param B Dense Matrix
@param C Dense Matrix
"""
if( A.numRows != B.numCols )
throw new MatrixDimensionException("In... | java | public static void multTransAB(DMatrixSparseCSC A , DMatrixRMaj B , DMatrixRMaj C )
{
if( A.numRows != B.numCols )
throw new MatrixDimensionException("Inconsistent matrix shapes. "+stringShapes(A,B));
C.reshape(A.numCols,B.numRows);
ImplSparseSparseMult_DSCC.multTransAB(A,B,C);
... | [
"public",
"static",
"void",
"multTransAB",
"(",
"DMatrixSparseCSC",
"A",
",",
"DMatrixRMaj",
"B",
",",
"DMatrixRMaj",
"C",
")",
"{",
"if",
"(",
"A",
".",
"numRows",
"!=",
"B",
".",
"numCols",
")",
"throw",
"new",
"MatrixDimensionException",
"(",
"\"Inconsist... | Performs matrix multiplication. C = A<sup>T</sup>*B<sup>T</sup>
@param A Matrix
@param B Dense Matrix
@param C Dense Matrix | [
"Performs",
"matrix",
"multiplication",
".",
"C",
"=",
"A<sup",
">",
"T<",
"/",
"sup",
">",
"*",
"B<sup",
">",
"T<",
"/",
"sup",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java#L276-L283 |
dbracewell/mango | src/main/java/com/davidbracewell/io/Resources.java | Resources.temporaryFile | public static Resource temporaryFile(String name, String extension) throws IOException {
"""
Creates a resource wrapping a temporary file
@param name The file name
@param extension The file extension
@return The resource representing the temporary file
@throws IOException the io exception
"""
... | java | public static Resource temporaryFile(String name, String extension) throws IOException {
return new FileResource(File.createTempFile(name, extension));
} | [
"public",
"static",
"Resource",
"temporaryFile",
"(",
"String",
"name",
",",
"String",
"extension",
")",
"throws",
"IOException",
"{",
"return",
"new",
"FileResource",
"(",
"File",
".",
"createTempFile",
"(",
"name",
",",
"extension",
")",
")",
";",
"}"
] | Creates a resource wrapping a temporary file
@param name The file name
@param extension The file extension
@return The resource representing the temporary file
@throws IOException the io exception | [
"Creates",
"a",
"resource",
"wrapping",
"a",
"temporary",
"file"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/io/Resources.java#L270-L272 |
Metatavu/edelphi | rest/src/main/java/fi/metatavu/edelphi/permissions/PermissionController.java | PermissionController.hasDelfoiAccess | private boolean hasDelfoiAccess(DelfoiAction action, UserRole userRole) {
"""
Returns whether user role required action access
@param action action
@param userRole role
@return whether user role required action access
"""
Delfoi delfoi = getDelfoi();
return delfoiUserRoleActionDAO.hasDelfoiActionA... | java | private boolean hasDelfoiAccess(DelfoiAction action, UserRole userRole) {
Delfoi delfoi = getDelfoi();
return delfoiUserRoleActionDAO.hasDelfoiActionAccess(delfoi, userRole, action);
} | [
"private",
"boolean",
"hasDelfoiAccess",
"(",
"DelfoiAction",
"action",
",",
"UserRole",
"userRole",
")",
"{",
"Delfoi",
"delfoi",
"=",
"getDelfoi",
"(",
")",
";",
"return",
"delfoiUserRoleActionDAO",
".",
"hasDelfoiActionAccess",
"(",
"delfoi",
",",
"userRole",
"... | Returns whether user role required action access
@param action action
@param userRole role
@return whether user role required action access | [
"Returns",
"whether",
"user",
"role",
"required",
"action",
"access"
] | train | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/permissions/PermissionController.java#L175-L178 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/AABBUtils.java | AABBUtils.readFromNBT | public static AxisAlignedBB readFromNBT(NBTTagCompound tag, String prefix) {
"""
Reads a {@link AxisAlignedBB} from {@link NBTTagCompound} with the specified prefix.
@param tag the tag
@param prefix the prefix
@return the axis aligned bb
"""
prefix = prefix == null ? "" : prefix + ".";
return tag != n... | java | public static AxisAlignedBB readFromNBT(NBTTagCompound tag, String prefix)
{
prefix = prefix == null ? "" : prefix + ".";
return tag != null ? new AxisAlignedBB(tag.getDouble(prefix + "minX"),
tag.getDouble(prefix + "minY"),
tag.getDouble(prefix + "minZ"),
tag.getDouble(prefix +... | [
"public",
"static",
"AxisAlignedBB",
"readFromNBT",
"(",
"NBTTagCompound",
"tag",
",",
"String",
"prefix",
")",
"{",
"prefix",
"=",
"prefix",
"==",
"null",
"?",
"\"\"",
":",
"prefix",
"+",
"\".\"",
";",
"return",
"tag",
"!=",
"null",
"?",
"new",
"AxisAlign... | Reads a {@link AxisAlignedBB} from {@link NBTTagCompound} with the specified prefix.
@param tag the tag
@param prefix the prefix
@return the axis aligned bb | [
"Reads",
"a",
"{",
"@link",
"AxisAlignedBB",
"}",
"from",
"{",
"@link",
"NBTTagCompound",
"}",
"with",
"the",
"specified",
"prefix",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/AABBUtils.java#L236-L246 |
aws/aws-sdk-java | aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/RelatedResource.java | RelatedResource.withAdditionalInfo | public RelatedResource withAdditionalInfo(java.util.Map<String, String> additionalInfo) {
"""
<p>
Additional information about the resource.
</p>
@param additionalInfo
Additional information about the resource.
@return Returns a reference to this object so that method calls can be chained together.
"""
... | java | public RelatedResource withAdditionalInfo(java.util.Map<String, String> additionalInfo) {
setAdditionalInfo(additionalInfo);
return this;
} | [
"public",
"RelatedResource",
"withAdditionalInfo",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"additionalInfo",
")",
"{",
"setAdditionalInfo",
"(",
"additionalInfo",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Additional information about the resource.
</p>
@param additionalInfo
Additional information about the resource.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Additional",
"information",
"about",
"the",
"resource",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/RelatedResource.java#L181-L184 |
btrplace/scheduler | btrpsl/src/main/java/org/btrplace/btrpsl/constraint/SplitBuilder.java | SplitBuilder.buildConstraint | @Override
public List<? extends SatConstraint> buildConstraint(BtrPlaceTree t, List<BtrpOperand> args) {
"""
Build a constraint.
@param args the parameters of the constraint. Must be 2 non-empty set of virtual machines.
@return the constraint
"""
if (checkConformance(t, args)) {
@Su... | java | @Override
public List<? extends SatConstraint> buildConstraint(BtrPlaceTree t, List<BtrpOperand> args) {
if (checkConformance(t, args)) {
@SuppressWarnings("unchecked") Collection<Collection<VM>> s = (Collection<Collection<VM>>) params[0].transform(this, t, args.get(0));
return s != ... | [
"@",
"Override",
"public",
"List",
"<",
"?",
"extends",
"SatConstraint",
">",
"buildConstraint",
"(",
"BtrPlaceTree",
"t",
",",
"List",
"<",
"BtrpOperand",
">",
"args",
")",
"{",
"if",
"(",
"checkConformance",
"(",
"t",
",",
"args",
")",
")",
"{",
"@",
... | Build a constraint.
@param args the parameters of the constraint. Must be 2 non-empty set of virtual machines.
@return the constraint | [
"Build",
"a",
"constraint",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/constraint/SplitBuilder.java#L51-L58 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/rewrite/rewritepolicy_rewritepolicylabel_binding.java | rewritepolicy_rewritepolicylabel_binding.count_filtered | public static long count_filtered(nitro_service service, String name, String filter) throws Exception {
"""
Use this API to count the filtered set of rewritepolicy_rewritepolicylabel_binding resources.
filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
"""
rewritepolicy_rewritepolicylabe... | java | public static long count_filtered(nitro_service service, String name, String filter) throws Exception{
rewritepolicy_rewritepolicylabel_binding obj = new rewritepolicy_rewritepolicylabel_binding();
obj.set_name(name);
options option = new options();
option.set_count(true);
option.set_filter(filter);
rewrite... | [
"public",
"static",
"long",
"count_filtered",
"(",
"nitro_service",
"service",
",",
"String",
"name",
",",
"String",
"filter",
")",
"throws",
"Exception",
"{",
"rewritepolicy_rewritepolicylabel_binding",
"obj",
"=",
"new",
"rewritepolicy_rewritepolicylabel_binding",
"(",
... | Use this API to count the filtered set of rewritepolicy_rewritepolicylabel_binding resources.
filter string should be in JSON format.eg: "port:80,servicetype:HTTP". | [
"Use",
"this",
"API",
"to",
"count",
"the",
"filtered",
"set",
"of",
"rewritepolicy_rewritepolicylabel_binding",
"resources",
".",
"filter",
"string",
"should",
"be",
"in",
"JSON",
"format",
".",
"eg",
":",
"port",
":",
"80",
"servicetype",
":",
"HTTP",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/rewrite/rewritepolicy_rewritepolicylabel_binding.java#L214-L225 |
apache/flink | flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcher.java | KinesisDataFetcher.registerNewSubscribedShardState | public int registerNewSubscribedShardState(KinesisStreamShardState newSubscribedShardState) {
"""
Register a new subscribed shard state.
@param newSubscribedShardState the new shard state that this fetcher is to be subscribed to
"""
synchronized (checkpointLock) {
subscribedShardsState.add(newSubscribe... | java | public int registerNewSubscribedShardState(KinesisStreamShardState newSubscribedShardState) {
synchronized (checkpointLock) {
subscribedShardsState.add(newSubscribedShardState);
// If a registered shard has initial state that is not SENTINEL_SHARD_ENDING_SEQUENCE_NUM (will be the case
// if the consumer had... | [
"public",
"int",
"registerNewSubscribedShardState",
"(",
"KinesisStreamShardState",
"newSubscribedShardState",
")",
"{",
"synchronized",
"(",
"checkpointLock",
")",
"{",
"subscribedShardsState",
".",
"add",
"(",
"newSubscribedShardState",
")",
";",
"// If a registered shard h... | Register a new subscribed shard state.
@param newSubscribedShardState the new shard state that this fetcher is to be subscribed to | [
"Register",
"a",
"new",
"subscribed",
"shard",
"state",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcher.java#L670-L699 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/JsonUtil.java | JsonUtil.getArray | public static JsonArray getArray(JsonObject object, String field, JsonArray defaultValue) {
"""
Returns a field in a Json object as an array.
@param object the Json Object
@param field the field in the Json object to return
@param defaultValue a default value for the field if the field value is null
@return ... | java | public static JsonArray getArray(JsonObject object, String field, JsonArray defaultValue) {
final JsonValue value = object.get(field);
if (value == null || value.isNull()) {
return defaultValue;
} else {
return value.asArray();
}
} | [
"public",
"static",
"JsonArray",
"getArray",
"(",
"JsonObject",
"object",
",",
"String",
"field",
",",
"JsonArray",
"defaultValue",
")",
"{",
"final",
"JsonValue",
"value",
"=",
"object",
".",
"get",
"(",
"field",
")",
";",
"if",
"(",
"value",
"==",
"null"... | Returns a field in a Json object as an array.
@param object the Json Object
@param field the field in the Json object to return
@param defaultValue a default value for the field if the field value is null
@return the Json field value as a Json array | [
"Returns",
"a",
"field",
"in",
"a",
"Json",
"object",
"as",
"an",
"array",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/JsonUtil.java#L244-L251 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java | Settings.getInt | public int getInt(@NotNull final String key, int defaultValue) {
"""
Returns an int value from the properties file. If the value was specified
as a system property or passed in via the -Dprop=value argument - this
method will return the value from the system properties before the values
in the contained configu... | java | public int getInt(@NotNull final String key, int defaultValue) {
int value;
try {
value = Integer.parseInt(getString(key));
} catch (NumberFormatException ex) {
if (!getString(key, "").isEmpty()) {
LOGGER.debug("Could not convert property '{}={}' to an int... | [
"public",
"int",
"getInt",
"(",
"@",
"NotNull",
"final",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"int",
"value",
";",
"try",
"{",
"value",
"=",
"Integer",
".",
"parseInt",
"(",
"getString",
"(",
"key",
")",
")",
";",
"}",
"catch",
"(",... | Returns an int value from the properties file. If the value was specified
as a system property or passed in via the -Dprop=value argument - this
method will return the value from the system properties before the values
in the contained configuration file.
@param key the key to lookup within the properties file
@param ... | [
"Returns",
"an",
"int",
"value",
"from",
"the",
"properties",
"file",
".",
"If",
"the",
"value",
"was",
"specified",
"as",
"a",
"system",
"property",
"or",
"passed",
"in",
"via",
"the",
"-",
"Dprop",
"=",
"value",
"argument",
"-",
"this",
"method",
"will... | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java#L994-L1005 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.