repo stringlengths 7 59 | path stringlengths 3 222 | func_name stringlengths 3 127 | original_string stringlengths 0 466k | language stringclasses 1
value | code stringlengths 0 466k | code_tokens listlengths 0 68.3k | docstring stringlengths 0 21.3k | docstring_tokens listlengths 0 1.93k | sha stringlengths 0 40 | url stringlengths 0 339 | partition stringclasses 3
values | summary stringlengths 0 250 | instruction stringlengths 38 3.13k | input stringclasses 1
value | output stringlengths 146 466k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/utility/ImageUtils.java | ImageUtils.generateBitmap | public static Bitmap generateBitmap(final int[] argbIntBuffer,
final int width, final int height) {
return Bitmap.createBitmap(argbIntBuffer,
width, height, Bitmap.Config.ARGB_8888);
} | java | public static Bitmap generateBitmap(final int[] argbIntBuffer,
final int width, final int height) {
return Bitmap.createBitmap(argbIntBuffer,
width, height, Bitmap.Config.ARGB_8888);
} | [
"public",
"static",
"Bitmap",
"generateBitmap",
"(",
"final",
"int",
"[",
"]",
"argbIntBuffer",
",",
"final",
"int",
"width",
",",
"final",
"int",
"height",
")",
"{",
"return",
"Bitmap",
".",
"createBitmap",
"(",
"argbIntBuffer",
",",
"width",
",",
"height",... | Generates a {@code Bitmap} from a int array containing {@code width} *
{@code height} pixels. The pixel format is in ARGB_8888 format for
Android.
@param argbIntBuffer The int array containing pixels values.
@param width The width of the image.
@param height The height of the image.
@return The generated {@code Bitmap... | [
"Generates",
"a",
"{",
"@code",
"Bitmap",
"}",
"from",
"a",
"int",
"array",
"containing",
"{",
"@code",
"width",
"}",
"*",
"{",
"@code",
"height",
"}",
"pixels",
".",
"The",
"pixel",
"format",
"is",
"in",
"ARGB_8888",
"format",
"for",
"Android",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/ImageUtils.java#L59-L63 | train | Generate a bitmap from the array of ints. | Create a Java method that does the following: "Generate a bitmap from the array of ints.". | Of course, here is the Java code you requested:
```java
public static Bitmap generateBitmap(final int[] argbIntBuffer,
final int width, final int height) {
return Bitmap.createBitmap(argbIntBuffer,
width, height, Bitmap.Config.ARGB_8888);
}
```
Hope this help... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/CacheingSearchResults.java | CacheingSearchResults.addObjects | public void addObjects(List[] objects)
{
if (tc.isEntryEnabled())
tc.entry(this,cclass, "addObjects", "objects: " + objects);
if (delegate != null)
delegate.addObjects(objects);
if (tc.isEntryEnabled())
tc.exit(this,cclass, "addObjects");
} | java | public void addObjects(List[] objects)
{
if (tc.isEntryEnabled())
tc.entry(this,cclass, "addObjects", "objects: " + objects);
if (delegate != null)
delegate.addObjects(objects);
if (tc.isEntryEnabled())
tc.exit(this,cclass, "addObjects");
} | [
"public",
"void",
"addObjects",
"(",
"List",
"[",
"]",
"objects",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"tc",
".",
"entry",
"(",
"this",
",",
"cclass",
",",
"\"addObjects\"",
",",
"\"objects: \"",
"+",
"objects",
")",
";",
... | /*
Adds a reference to an object list to the result set's list
of object lists.
@param objects an array of FastVectors of objects, indexed by type | [
"/",
"*",
"Adds",
"a",
"reference",
"to",
"an",
"object",
"list",
"to",
"the",
"result",
"set",
"s",
"list",
"of",
"object",
"lists",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/CacheingSearchResults.java#L54-L64 | train | Add the objects to the list of objects. | Create a Java method that does the following: "Add the objects to the list of objects.". | Of course, here is the Java code you requested:
```java
public void addObjects(List[] objects)
{
if (tc.isEntryEnabled())
tc.entry(this,cclass, "addObjects", "objects: " + objects);
if (delegate != null)
delegate.addObjects(objects);
if (tc.isEntryEnabled())
tc.exit(this,cclass, "addO... | |
drapostolos/rdp4j | src/main/java/com/github/drapostolos/rdp4j/AbstractRdp4jListener.java | AbstractRdp4jListener.ioErrorRaised | @Override
public void ioErrorRaised(IoErrorRaisedEvent event) throws InterruptedException {
String message = "I/O error raised when polling directory '%s'!";
PolledDirectory dir = event.getPolledDirectory();
IOException e = event.getIoException();
LOG.error(String.format(message, dir... | java | @Override
public void ioErrorRaised(IoErrorRaisedEvent event) throws InterruptedException {
String message = "I/O error raised when polling directory '%s'!";
PolledDirectory dir = event.getPolledDirectory();
IOException e = event.getIoException();
LOG.error(String.format(message, dir... | [
"@",
"Override",
"public",
"void",
"ioErrorRaised",
"(",
"IoErrorRaisedEvent",
"event",
")",
"throws",
"InterruptedException",
"{",
"String",
"message",
"=",
"\"I/O error raised when polling directory '%s'!\"",
";",
"PolledDirectory",
"dir",
"=",
"event",
".",
"getPolledD... | Logs any occurred I/O errors
@throws InterruptedException when interrupted. | [
"Logs",
"any",
"occurred",
"I",
"/",
"O",
"errors"
] | ec1db2444d245b7ccd6607182bb56a027fa66d6b | https://github.com/drapostolos/rdp4j/blob/ec1db2444d245b7ccd6607182bb56a027fa66d6b/src/main/java/com/github/drapostolos/rdp4j/AbstractRdp4jListener.java#L64-L70 | train | Called when an IO error occurs. | Create a Java method that does the following: "Called when an IO error occurs.". | Of course, here is the Java code you requested:
```java
@Override
public void ioErrorRaised(IoErrorRaisedEvent event) throws InterruptedException {
String message = "I/O error raised when polling directory '%s'!";
PolledDirectory dir = event.getPolledDirectory();
IOException e = event.getIo... | |
ReactiveX/RxJava | src/main/java/io/reactivex/parallel/ParallelFlowable.java | ParallelFlowable.doOnError | @CheckReturnValue
@NonNull
public final ParallelFlowable<T> doOnError(@NonNull Consumer<Throwable> onError) {
ObjectHelper.requireNonNull(onError, "onError is null");
return RxJavaPlugins.onAssembly(new ParallelPeek<T>(this,
Functions.emptyConsumer(),
Functions.em... | java | @CheckReturnValue
@NonNull
public final ParallelFlowable<T> doOnError(@NonNull Consumer<Throwable> onError) {
ObjectHelper.requireNonNull(onError, "onError is null");
return RxJavaPlugins.onAssembly(new ParallelPeek<T>(this,
Functions.emptyConsumer(),
Functions.em... | [
"@",
"CheckReturnValue",
"@",
"NonNull",
"public",
"final",
"ParallelFlowable",
"<",
"T",
">",
"doOnError",
"(",
"@",
"NonNull",
"Consumer",
"<",
"Throwable",
">",
"onError",
")",
"{",
"ObjectHelper",
".",
"requireNonNull",
"(",
"onError",
",",
"\"onError is nul... | Call the specified consumer with the exception passing through any 'rail'.
@param onError the callback
@return the new ParallelFlowable instance | [
"Call",
"the",
"specified",
"consumer",
"with",
"the",
"exception",
"passing",
"through",
"any",
"rail",
"."
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/parallel/ParallelFlowable.java#L604-L618 | test | Creates a parallel flowable that will throw an exception when the source is not available. | Create a Java method that does the following: "Creates a parallel flowable that will throw an exception when the source is not available.". | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@NonNull
public final ParallelFlowable<T> doOnError(@NonNull Consumer<Throwable> onError) {
ObjectHelper.requireNonNull(onError, "onError is null");
return RxJavaPlugins.onAssembly(new ParallelPeek<T>(this,
... | |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java | ByteBufferOutputStream.write | public void write(byte[] b,int offset, int length)
throws IOException
{
ensureSpareCapacity(length);
System.arraycopy(b,offset,_buf,_pos,length);
_pos+=length;
} | java | public void write(byte[] b,int offset, int length)
throws IOException
{
ensureSpareCapacity(length);
System.arraycopy(b,offset,_buf,_pos,length);
_pos+=length;
} | [
"public",
"void",
"write",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"ensureSpareCapacity",
"(",
"length",
")",
";",
"System",
".",
"arraycopy",
"(",
"b",
",",
"offset",
",",
"_buf",
",",... | /* ------------------------------------------------------------ | [
"/",
"*",
"------------------------------------------------------------"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java#L195-L201 | train | Write a byte array to the underlying stream. | Create a Java method that does the following: "Write a byte array to the underlying stream.". | Of course, here is the Java code you requested:
```java
public void write(byte[] b,int offset, int length)
throws IOException
{
ensureSpareCapacity(length);
System.arraycopy(b,offset,_buf,_pos,length);
_pos+=length;
}
```
Hope this helps! | |
VoltDB/voltdb | src/frontend/org/voltdb/DRConsumerDrIdTracker.java | DRConsumerDrIdTracker.mergeTracker | public void mergeTracker(DRConsumerDrIdTracker tracker) {
final long newSafePoint = Math.max(tracker.getSafePointDrId(), getSafePointDrId());
m_map.addAll(tracker.m_map);
truncate(newSafePoint);
m_lastSpUniqueId = Math.max(m_lastSpUniqueId, tracker.m_lastSpUniqueId);
m_lastMpUniq... | java | public void mergeTracker(DRConsumerDrIdTracker tracker) {
final long newSafePoint = Math.max(tracker.getSafePointDrId(), getSafePointDrId());
m_map.addAll(tracker.m_map);
truncate(newSafePoint);
m_lastSpUniqueId = Math.max(m_lastSpUniqueId, tracker.m_lastSpUniqueId);
m_lastMpUniq... | [
"public",
"void",
"mergeTracker",
"(",
"DRConsumerDrIdTracker",
"tracker",
")",
"{",
"final",
"long",
"newSafePoint",
"=",
"Math",
".",
"max",
"(",
"tracker",
".",
"getSafePointDrId",
"(",
")",
",",
"getSafePointDrId",
"(",
")",
")",
";",
"m_map",
".",
"addA... | Merge the given tracker with the current tracker. Ranges can
overlap. After the merge, the current tracker will be truncated to the
larger safe point.
@param tracker | [
"Merge",
"the",
"given",
"tracker",
"with",
"the",
"current",
"tracker",
".",
"Ranges",
"can",
"overlap",
".",
"After",
"the",
"merge",
"the",
"current",
"tracker",
"will",
"be",
"truncated",
"to",
"the",
"larger",
"safe",
"point",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/DRConsumerDrIdTracker.java#L366-L372 | train | Merge the given tracker with this one. | Create a Java method that does the following: "Merge the given tracker with this one.". | Of course, here is the Java code you requested:
```java
public void mergeTracker(DRConsumerDrIdTracker tracker) {
final long newSafePoint = Math.max(tracker.getSafePointDrId(), getSafePointDrId());
m_map.addAll(tracker.m_map);
truncate(newSafePoint);
m_lastSpUniqueId = Math.max(m_lastSp... | |
liferay/com-liferay-commerce | commerce-api/src/main/java/com/liferay/commerce/service/CommerceAvailabilityEstimateLocalServiceUtil.java | CommerceAvailabilityEstimateLocalServiceUtil.updateCommerceAvailabilityEstimate | public static com.liferay.commerce.model.CommerceAvailabilityEstimate updateCommerceAvailabilityEstimate(
com.liferay.commerce.model.CommerceAvailabilityEstimate commerceAvailabilityEstimate) {
return getService()
.updateCommerceAvailabilityEstimate(commerceAvailabilityEstimate);
} | java | public static com.liferay.commerce.model.CommerceAvailabilityEstimate updateCommerceAvailabilityEstimate(
com.liferay.commerce.model.CommerceAvailabilityEstimate commerceAvailabilityEstimate) {
return getService()
.updateCommerceAvailabilityEstimate(commerceAvailabilityEstimate);
} | [
"public",
"static",
"com",
".",
"liferay",
".",
"commerce",
".",
"model",
".",
"CommerceAvailabilityEstimate",
"updateCommerceAvailabilityEstimate",
"(",
"com",
".",
"liferay",
".",
"commerce",
".",
"model",
".",
"CommerceAvailabilityEstimate",
"commerceAvailabilityEstima... | Updates the commerce availability estimate in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
@param commerceAvailabilityEstimate the commerce availability estimate
@return the commerce availability estimate that was updated | [
"Updates",
"the",
"commerce",
"availability",
"estimate",
"in",
"the",
"database",
"or",
"adds",
"it",
"if",
"it",
"does",
"not",
"yet",
"exist",
".",
"Also",
"notifies",
"the",
"appropriate",
"model",
"listeners",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-api/src/main/java/com/liferay/commerce/service/CommerceAvailabilityEstimateLocalServiceUtil.java#L352-L356 | train | Updates the commerce availability estimate in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. | Create a Java method that does the following: "Updates the commerce availability estimate in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.". | Of course, here is the Java code you requested:
```java
public static com.liferay.commerce.model.CommerceAvailabilityEstimate updateCommerceAvailabilityEstimate(
com.liferay.commerce.model.CommerceAvailabilityEstimate commerceAvailabilityEstimate) {
return getService()
.updateCommerceAvailabilityEstimate(co... | |
pressgang-ccms/PressGangCCMSBuilder | src/main/java/org/jboss/pressgang/ccms/contentspec/builder/PublicanPODocBookBuilder.java | PublicanPODocBookBuilder.processPOInitialContentBugLink | protected void processPOInitialContentBugLink(final POBuildData buildData, final InitialContent initialContent,
final Map<String, TranslationDetails> translations) throws BuildProcessingException {
try {
final DocBookXMLPreProcessor preProcessor = buildData.getXMLPreProcessor();
... | java | protected void processPOInitialContentBugLink(final POBuildData buildData, final InitialContent initialContent,
final Map<String, TranslationDetails> translations) throws BuildProcessingException {
try {
final DocBookXMLPreProcessor preProcessor = buildData.getXMLPreProcessor();
... | [
"protected",
"void",
"processPOInitialContentBugLink",
"(",
"final",
"POBuildData",
"buildData",
",",
"final",
"InitialContent",
"initialContent",
",",
"final",
"Map",
"<",
"String",
",",
"TranslationDetails",
">",
"translations",
")",
"throws",
"BuildProcessingException"... | Add any bug link strings for a specific initial content container.
@param buildData Information and data structures for the build.
@param initialContent The initial content to create any bug link translation strings for.
@param translations The mapping of original strings to tra... | [
"Add",
"any",
"bug",
"link",
"strings",
"for",
"a",
"specific",
"initial",
"content",
"container",
"."
] | 5436d36ba1b3c5baa246b270e5fc350e6778bce8 | https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/PublicanPODocBookBuilder.java#L1272-L1284 | train | Process the Bug Links of the initial content. | Create a Java method that does the following: "Process the Bug Links of the initial content.". | Of course, here is the Java code you requested:
```java
protected void processPOInitialContentBugLink(final POBuildData buildData, final InitialContent initialContent,
final Map<String, TranslationDetails> translations) throws BuildProcessingException {
try {
final DocBookXMLPreProcesso... | |
aws/aws-sdk-java | aws-java-sdk-discovery/src/main/java/com/amazonaws/services/applicationdiscovery/model/transform/DescribeExportConfigurationsRequestMarshaller.java | DescribeExportConfigurationsRequestMarshaller.marshall | public void marshall(DescribeExportConfigurationsRequest describeExportConfigurationsRequest, ProtocolMarshaller protocolMarshaller) {
if (describeExportConfigurationsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
pr... | java | public void marshall(DescribeExportConfigurationsRequest describeExportConfigurationsRequest, ProtocolMarshaller protocolMarshaller) {
if (describeExportConfigurationsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
pr... | [
"public",
"void",
"marshall",
"(",
"DescribeExportConfigurationsRequest",
"describeExportConfigurationsRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"describeExportConfigurationsRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientExce... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-discovery/src/main/java/com/amazonaws/services/applicationdiscovery/model/transform/DescribeExportConfigurationsRequestMarshaller.java#L47-L60 | train | marshalls the given DescribeExportConfigurationsRequest to the given protocolMarshaller. | Create a Java method that does the following: "marshalls the given DescribeExportConfigurationsRequest to the given protocolMarshaller.". | Of course, here is the Java code you requested:
```java
public void marshall(DescribeExportConfigurationsRequest describeExportConfigurationsRequest, ProtocolMarshaller protocolMarshaller) {
if (describeExportConfigurationsRequest == null) {
throw new SdkClientException("Invalid argument passed to... | |
Impetus/Kundera | src/kundera-hbase/kundera-hbase/src/main/java/com/impetus/client/hbase/service/HBaseWriter.java | HBaseWriter.persistRows | @Override
public void persistRows(Map<HTableInterface, List<HBaseDataWrapper>> rows) throws IOException
{
List<Put> dataSet = new ArrayList<Put>(rows.size());
for (HTableInterface hTable : rows.keySet())
{
List<HBaseDataWrapper> row = rows.get(hTable);
for (HBaseD... | java | @Override
public void persistRows(Map<HTableInterface, List<HBaseDataWrapper>> rows) throws IOException
{
List<Put> dataSet = new ArrayList<Put>(rows.size());
for (HTableInterface hTable : rows.keySet())
{
List<HBaseDataWrapper> row = rows.get(hTable);
for (HBaseD... | [
"@",
"Override",
"public",
"void",
"persistRows",
"(",
"Map",
"<",
"HTableInterface",
",",
"List",
"<",
"HBaseDataWrapper",
">",
">",
"rows",
")",
"throws",
"IOException",
"{",
"List",
"<",
"Put",
">",
"dataSet",
"=",
"new",
"ArrayList",
"<",
"Put",
">",
... | /*
(non-Javadoc)
@see com.impetus.client.hbase.Writer#persistRows(java.util.Map) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-hbase/kundera-hbase/src/main/java/com/impetus/client/hbase/service/HBaseWriter.java#L295-L309 | train | Persist rows. | Create a Java method that does the following: "Persist rows.". | Of course, here is the Java code you requested:
```java
@Override
public void persistRows(Map<HTableInterface, List<HBaseDataWrapper>> rows) throws IOException
{
List<Put> dataSet = new ArrayList<Put>(rows.size());
for (HTableInterface hTable : rows.keySet())
{
List<HBaseDat... | |
pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/DocBookUtilities.java | DocBookUtilities.findTitle | public static String findTitle(final Document doc) {
if (doc == null) return null;
// loop through the child nodes until the title element is found
final NodeList childNodes = doc.getDocumentElement().getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node n... | java | public static String findTitle(final Document doc) {
if (doc == null) return null;
// loop through the child nodes until the title element is found
final NodeList childNodes = doc.getDocumentElement().getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node n... | [
"public",
"static",
"String",
"findTitle",
"(",
"final",
"Document",
"doc",
")",
"{",
"if",
"(",
"doc",
"==",
"null",
")",
"return",
"null",
";",
"// loop through the child nodes until the title element is found",
"final",
"NodeList",
"childNodes",
"=",
"doc",
".",
... | Finds the first title element in a DocBook XML file.
@param doc The docbook xml transformed into a DOM Document to find the title from.
@return The first title found in the xml. | [
"Finds",
"the",
"first",
"title",
"element",
"in",
"a",
"DocBook",
"XML",
"file",
"."
] | 5ebf5ed30a94c34c33f4708caa04a8da99cbb15c | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/DocBookUtilities.java#L2162-L2177 | train | Find the title of the document. | Create a Java method that does the following: "Find the title of the document.". | Of course, here is the Java code you requested:
```java
public static String findTitle(final Document doc) {
if (doc == null) return null;
// loop through the child nodes until the title element is found
final NodeList childNodes = doc.getDocumentElement().getChildNodes();
for (int i =... | |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java | SparseCpuLevel1.sroti | @Override
protected void sroti(long N, INDArray X, DataBuffer indexes, INDArray Y, double c, double s) {
cblas_sroti((int) N, (FloatPointer) X.data().addressPointer(), (IntPointer) indexes.addressPointer().capacity(X.columns()),
(FloatPointer) Y.data().addressPointer(), (float) c, (float) s)... | java | @Override
protected void sroti(long N, INDArray X, DataBuffer indexes, INDArray Y, double c, double s) {
cblas_sroti((int) N, (FloatPointer) X.data().addressPointer(), (IntPointer) indexes.addressPointer().capacity(X.columns()),
(FloatPointer) Y.data().addressPointer(), (float) c, (float) s)... | [
"@",
"Override",
"protected",
"void",
"sroti",
"(",
"long",
"N",
",",
"INDArray",
"X",
",",
"DataBuffer",
"indexes",
",",
"INDArray",
"Y",
",",
"double",
"c",
",",
"double",
"s",
")",
"{",
"cblas_sroti",
"(",
"(",
"int",
")",
"N",
",",
"(",
"FloatPoi... | Applies Givens rotation to sparse vectors one of which is in compressed form.
@param N The number of elements in vectors X and Y
@param X a float sparse vector
@param indexes The indexes of the sparse vector
@param Y a float full-storage vector
@param c a scalar
@param s a scalar | [
"Applies",
"Givens",
"rotation",
"to",
"sparse",
"vectors",
"one",
"of",
"which",
"is",
"in",
"compressed",
"form",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java#L248-L252 | train | Sroti implementation of the CBA | Create a Java method that does the following: "Sroti implementation of the CBA". | Of course, here is the Java code you requested:
```java
@Override
protected void sroti(long N, INDArray X, DataBuffer indexes, INDArray Y, double c, double s) {
cblas_sroti((int) N, (FloatPointer) X.data().addressPointer(), (IntPointer) indexes.addressPointer().capacity(X.columns()),
(Float... | |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/JobExecutionEventSubmitter.java | JobExecutionEventSubmitter.submitTaskStateEvents | private void submitTaskStateEvents(JobState jobState) {
// Build Job Metadata applicable for TaskStates
ImmutableMap.Builder<String, String> jobMetadataBuilder = new ImmutableMap.Builder<>();
jobMetadataBuilder.put(METADATA_JOB_ID, jobState.getJobId());
jobMetadataBuilder.put(METADATA_JOB_NAME, jobState... | java | private void submitTaskStateEvents(JobState jobState) {
// Build Job Metadata applicable for TaskStates
ImmutableMap.Builder<String, String> jobMetadataBuilder = new ImmutableMap.Builder<>();
jobMetadataBuilder.put(METADATA_JOB_ID, jobState.getJobId());
jobMetadataBuilder.put(METADATA_JOB_NAME, jobState... | [
"private",
"void",
"submitTaskStateEvents",
"(",
"JobState",
"jobState",
")",
"{",
"// Build Job Metadata applicable for TaskStates",
"ImmutableMap",
".",
"Builder",
"<",
"String",
",",
"String",
">",
"jobMetadataBuilder",
"=",
"new",
"ImmutableMap",
".",
"Builder",
"<>... | Submits an event for each {@link TaskState} in the given {@link JobState}. | [
"Submits",
"an",
"event",
"for",
"each",
"{"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/JobExecutionEventSubmitter.java#L88-L100 | train | Submit TaskState events for each TaskState | Create a Java method that does the following: "Submit TaskState events for each TaskState". | Of course, here is the Java code you requested:
```java
private void submitTaskStateEvents(JobState jobState) {
// Build Job Metadata applicable for TaskStates
ImmutableMap.Builder<String, String> jobMetadataBuilder = new ImmutableMap.Builder<>();
jobMetadataBuilder.put(METADATA_JOB_ID, jobState.getJobId()... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.security/src/com/ibm/ws/security/internal/SecurityServiceImpl.java | SecurityServiceImpl.getUserRegistryService | @Override
public UserRegistryService getUserRegistryService() {
UserRegistryService service = userRegistryService.get();
if (service == null) {
if (isConfigurationDefinedInFile()) {
String id = getEffectiveSecurityConfiguration().getUserRegistryServiceId();
... | java | @Override
public UserRegistryService getUserRegistryService() {
UserRegistryService service = userRegistryService.get();
if (service == null) {
if (isConfigurationDefinedInFile()) {
String id = getEffectiveSecurityConfiguration().getUserRegistryServiceId();
... | [
"@",
"Override",
"public",
"UserRegistryService",
"getUserRegistryService",
"(",
")",
"{",
"UserRegistryService",
"service",
"=",
"userRegistryService",
".",
"get",
"(",
")",
";",
"if",
"(",
"service",
"==",
"null",
")",
"{",
"if",
"(",
"isConfigurationDefinedInFi... | {@inheritDoc} | [
"{"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security/src/com/ibm/ws/security/internal/SecurityServiceImpl.java#L536-L550 | train | Gets the UserRegistryService. | Create a Java method that does the following: "Gets the UserRegistryService.". | Of course, here is the Java code you requested:
```java
@Override
public UserRegistryService getUserRegistryService() {
UserRegistryService service = userRegistryService.get();
if (service == null) {
if (isConfigurationDefinedInFile()) {
String id = getEffectiveSecurityC... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/BindingsHelper.java | BindingsHelper.addAmbiguousShortDefaultBindingName | private void addAmbiguousShortDefaultBindingName(String shortBindingName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "adding AmbiguousEJBReference for short default binding name '" +
shortBindingName + "', for EJB " + ivHomeRecord.get... | java | private void addAmbiguousShortDefaultBindingName(String shortBindingName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "adding AmbiguousEJBReference for short default binding name '" +
shortBindingName + "', for EJB " + ivHomeRecord.get... | [
"private",
"void",
"addAmbiguousShortDefaultBindingName",
"(",
"String",
"shortBindingName",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"a... | Creates a Reference for an AmbiguousEJBReferenceException with detail
information about the short form default binding confilicts, and adds
it to the list of AmbiguousEJBReferences to be bound into naming. <p>
@param shortBindingName the short form default binding name that is ambiguous. | [
"Creates",
"a",
"Reference",
"for",
"an",
"AmbiguousEJBReferenceException",
"with",
"detail",
"information",
"about",
"the",
"short",
"form",
"default",
"binding",
"confilicts",
"and",
"adds",
"it",
"to",
"the",
"list",
"of",
"AmbiguousEJBReferences",
"to",
"be",
... | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/BindingsHelper.java#L524-L542 | train | Add an AmbiguousEJBReference for a short default binding name. | Create a Java method that does the following: "Add an AmbiguousEJBReference for a short default binding name.". | Of course, here is the Java code you requested:
```java
private void addAmbiguousShortDefaultBindingName(String shortBindingName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "adding AmbiguousEJBReference for short default binding name '" +
... | |
aws/aws-sdk-java | aws-java-sdk-appmesh/src/main/java/com/amazonaws/services/appmesh/model/transform/TcpRouteMarshaller.java | TcpRouteMarshaller.marshall | public void marshall(TcpRoute tcpRoute, ProtocolMarshaller protocolMarshaller) {
if (tcpRoute == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(tcpRoute.getAction(), ACTION_BINDING);
} catch ... | java | public void marshall(TcpRoute tcpRoute, ProtocolMarshaller protocolMarshaller) {
if (tcpRoute == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(tcpRoute.getAction(), ACTION_BINDING);
} catch ... | [
"public",
"void",
"marshall",
"(",
"TcpRoute",
"tcpRoute",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"tcpRoute",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argument passed to marshall(...)\"",
")",
";",
... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-appmesh/src/main/java/com/amazonaws/services/appmesh/model/transform/TcpRouteMarshaller.java#L42-L53 | train | marshalls the given TCPRoute to the given protocolMarshaller. | Create a Java method that does the following: "marshalls the given TCPRoute to the given protocolMarshaller.". | Of course, here is the Java code you requested:
```java
public void marshall(TcpRoute tcpRoute, ProtocolMarshaller protocolMarshaller) {
if (tcpRoute == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshal... | |
alkacon/opencms-core | src/org/opencms/ui/CmsVaadinUtils.java | CmsVaadinUtils.getBootstrapScript | public static String getBootstrapScript(CmsObject cms, String elementId, String servicePath) throws Exception {
String script = BOOTSTRAP_SCRIPT;
CmsMacroResolver resolver = new CmsMacroResolver();
String context = OpenCms.getSystemInfo().getContextPath();
String vaadinDir = CmsStringUt... | java | public static String getBootstrapScript(CmsObject cms, String elementId, String servicePath) throws Exception {
String script = BOOTSTRAP_SCRIPT;
CmsMacroResolver resolver = new CmsMacroResolver();
String context = OpenCms.getSystemInfo().getContextPath();
String vaadinDir = CmsStringUt... | [
"public",
"static",
"String",
"getBootstrapScript",
"(",
"CmsObject",
"cms",
",",
"String",
"elementId",
",",
"String",
"servicePath",
")",
"throws",
"Exception",
"{",
"String",
"script",
"=",
"BOOTSTRAP_SCRIPT",
";",
"CmsMacroResolver",
"resolver",
"=",
"new",
"C... | Returns the Javascript code to use for initializing a Vaadin UI.<p>
@param cms the CMS context
@param elementId the id of the DOM element in which to initialize the UI
@param servicePath the UI servlet path
@return the Javascript code to initialize Vaadin
@throws Exception if something goes wrong | [
"Returns",
"the",
"Javascript",
"code",
"to",
"use",
"for",
"initializing",
"a",
"Vaadin",
"UI",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsVaadinUtils.java#L498-L515 | train | Returns the bootstrap script for the current user. | Create a Java method that does the following: "Returns the bootstrap script for the current user.". | Of course, here is the Java code you requested:
```java
public static String getBootstrapScript(CmsObject cms, String elementId, String servicePath) throws Exception {
String script = BOOTSTRAP_SCRIPT;
CmsMacroResolver resolver = new CmsMacroResolver();
String context = OpenCms.getSystemInfo()... | |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.minusEquals | public static double[] minusEquals(final double[] v1, final double s1) {
for(int i = 0; i < v1.length; i++) {
v1[i] -= s1;
}
return v1;
} | java | public static double[] minusEquals(final double[] v1, final double s1) {
for(int i = 0; i < v1.length; i++) {
v1[i] -= s1;
}
return v1;
} | [
"public",
"static",
"double",
"[",
"]",
"minusEquals",
"(",
"final",
"double",
"[",
"]",
"v1",
",",
"final",
"double",
"s1",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"v1",
".",
"length",
";",
"i",
"++",
")",
"{",
"v1",
"[",
... | Subtract component-wise in-place v1 = v1 - s1,
overwriting the vector v1.
@param v1 original vector
@param s1 Value to subtract
@return v1 = v1 - s1 | [
"Subtract",
"component",
"-",
"wise",
"in",
"-",
"place",
"v1",
"=",
"v1",
"-",
"s1",
"overwriting",
"the",
"vector",
"v1",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L456-L461 | train | Subtracts two vectors. | Create a Java method that does the following: "Subtracts two vectors.". | Of course, here is the Java code you requested:
```java
public static double[] minusEquals(final double[] v1, final double s1) {
for(int i = 0; i < v1.length; i++) {
v1[i] -= s1;
}
return v1;
}
```
Hope this helps! | |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java | BoxApiBookmark.getCopyRequest | public BoxRequestsBookmark.CopyBookmark getCopyRequest(String id, String parentId) {
BoxRequestsBookmark.CopyBookmark request = new BoxRequestsBookmark.CopyBookmark(id, parentId, getBookmarkCopyUrl(id), mSession);
return request;
} | java | public BoxRequestsBookmark.CopyBookmark getCopyRequest(String id, String parentId) {
BoxRequestsBookmark.CopyBookmark request = new BoxRequestsBookmark.CopyBookmark(id, parentId, getBookmarkCopyUrl(id), mSession);
return request;
} | [
"public",
"BoxRequestsBookmark",
".",
"CopyBookmark",
"getCopyRequest",
"(",
"String",
"id",
",",
"String",
"parentId",
")",
"{",
"BoxRequestsBookmark",
".",
"CopyBookmark",
"request",
"=",
"new",
"BoxRequestsBookmark",
".",
"CopyBookmark",
"(",
"id",
",",
"parentId... | Gets a request that copies a bookmark
@param id id of the bookmark to copy
@param parentId id of the parent folder to copy the bookmark into
@return request to copy a bookmark | [
"Gets",
"a",
"request",
"that",
"copies",
"a",
"bookmark"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L108-L111 | train | Gets a request that copies a bookmark | Create a Java method that does the following: "Gets a request that copies a bookmark". | Of course, here is the Java code you requested:
```java
public BoxRequestsBookmark.CopyBookmark getCopyRequest(String id, String parentId) {
BoxRequestsBookmark.CopyBookmark request = new BoxRequestsBookmark.CopyBookmark(id, parentId, getBookmarkCopyUrl(id), mSession);
return request;
}
```
Hope t... | |
Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.checkSendMessageEnabled | protected boolean checkSendMessageEnabled(RTMPMessage message) {
IRTMPEvent body = message.getBody();
if (!receiveAudio && body instanceof AudioData) {
// The user doesn't want to get audio packets
((IStreamData<?>) body).getData().free();
if (sendBlankAudio) {
... | java | protected boolean checkSendMessageEnabled(RTMPMessage message) {
IRTMPEvent body = message.getBody();
if (!receiveAudio && body instanceof AudioData) {
// The user doesn't want to get audio packets
((IStreamData<?>) body).getData().free();
if (sendBlankAudio) {
... | [
"protected",
"boolean",
"checkSendMessageEnabled",
"(",
"RTMPMessage",
"message",
")",
"{",
"IRTMPEvent",
"body",
"=",
"message",
".",
"getBody",
"(",
")",
";",
"if",
"(",
"!",
"receiveAudio",
"&&",
"body",
"instanceof",
"AudioData",
")",
"{",
"// The user doesn... | Check if sending the given message was enabled by the client.
@param message
the message to check
@return true if the message should be sent, false otherwise (and the message is discarded) | [
"Check",
"if",
"sending",
"the",
"given",
"message",
"was",
"enabled",
"by",
"the",
"client",
"."
] | 39ae73710c25bda86d70b13ef37ae707962217b9 | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1691-L1716 | train | Check if sending a message is enabled. | Create a Java method that does the following: "Check if sending a message is enabled.". | Of course, here is the Java code you requested:
```java
protected boolean checkSendMessageEnabled(RTMPMessage message) {
IRTMPEvent body = message.getBody();
if (!receiveAudio && body instanceof AudioData) {
// The user doesn't want to get audio packets
((IStreamData<?>) body).g... | |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/AmazonDynamoDBAsyncClient.java | AmazonDynamoDBAsyncClient.deleteTableAsync | public Future<DeleteTableResult> deleteTableAsync(
final DeleteTableRequest deleteTableRequest,
final AsyncHandler<DeleteTableRequest, DeleteTableResult> asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable<De... | java | public Future<DeleteTableResult> deleteTableAsync(
final DeleteTableRequest deleteTableRequest,
final AsyncHandler<DeleteTableRequest, DeleteTableResult> asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable<De... | [
"public",
"Future",
"<",
"DeleteTableResult",
">",
"deleteTableAsync",
"(",
"final",
"DeleteTableRequest",
"deleteTableRequest",
",",
"final",
"AsyncHandler",
"<",
"DeleteTableRequest",
",",
"DeleteTableResult",
">",
"asyncHandler",
")",
"throws",
"AmazonServiceException",
... | <p>
Deletes a table and all of its items.
</p>
<p>
If the table is in the <code>ACTIVE</code> state, you can delete it.
If a table is in <code>CREATING</code> or <code>UPDATING</code> states
then Amazon DynamoDB returns a <code>ResourceInUseException</code> .
If the specified table does not exist, Amazon DynamoDB retur... | [
"<p",
">",
"Deletes",
"a",
"table",
"and",
"all",
"of",
"its",
"items",
".",
"<",
"/",
"p",
">",
"<p",
">",
"If",
"the",
"table",
"is",
"in",
"the",
"<code",
">",
"ACTIVE<",
"/",
"code",
">",
"state",
"you",
"can",
"delete",
"it",
".",
"If",
"a... | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/AmazonDynamoDBAsyncClient.java#L1085-L1102 | train | Asynchronously deletes a table in the Amazon DynamoDB table system using the specified AsyncHandler. | Create a Java method that does the following: "Asynchronously deletes a table in the Amazon DynamoDB table system using the specified AsyncHandler.". | Of course, here is the Java code you requested:
```java
public Future<DeleteTableResult> deleteTableAsync(
final DeleteTableRequest deleteTableRequest,
final AsyncHandler<DeleteTableRequest, DeleteTableResult> asyncHandler)
throws AmazonServiceException, AmazonClientExceptio... | |
eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/AbstractSource.java | AbstractSource.addSourceListener | @Override
public final void addSourceListener(SourceListener<S> listener) {
if (listener != null) {
this.listenerList.add(listener);
}
} | java | @Override
public final void addSourceListener(SourceListener<S> listener) {
if (listener != null) {
this.listenerList.add(listener);
}
} | [
"@",
"Override",
"public",
"final",
"void",
"addSourceListener",
"(",
"SourceListener",
"<",
"S",
">",
"listener",
")",
"{",
"if",
"(",
"listener",
"!=",
"null",
")",
"{",
"this",
".",
"listenerList",
".",
"add",
"(",
"listener",
")",
";",
"}",
"}"
] | Adds a listener that gets called whenever something changes.
@param listener a {@link DataSourceListener}. | [
"Adds",
"a",
"listener",
"that",
"gets",
"called",
"whenever",
"something",
"changes",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/AbstractSource.java#L78-L83 | train | Add a source listener. | Create a Java method that does the following: "Add a source listener.". | Of course, here is the Java code you requested:
```java
@Override
public final void addSourceListener(SourceListener<S> listener) {
if (listener != null) {
this.listenerList.add(listener);
}
}
```
Hope this helps! | |
javers/javers | javers-core/src/main/java/org/javers/repository/jql/QueryBuilder.java | QueryBuilder.byValueObjectId | public static QueryBuilder byValueObjectId(Object ownerLocalId, Class ownerEntityClass, String path){
Validate.argumentsAreNotNull(ownerEntityClass, ownerLocalId, path);
return new QueryBuilder(new IdFilterDefinition(ValueObjectIdDTO.valueObjectId(ownerLocalId, ownerEntityClass, path)));
} | java | public static QueryBuilder byValueObjectId(Object ownerLocalId, Class ownerEntityClass, String path){
Validate.argumentsAreNotNull(ownerEntityClass, ownerLocalId, path);
return new QueryBuilder(new IdFilterDefinition(ValueObjectIdDTO.valueObjectId(ownerLocalId, ownerEntityClass, path)));
} | [
"public",
"static",
"QueryBuilder",
"byValueObjectId",
"(",
"Object",
"ownerLocalId",
",",
"Class",
"ownerEntityClass",
",",
"String",
"path",
")",
"{",
"Validate",
".",
"argumentsAreNotNull",
"(",
"ownerEntityClass",
",",
"ownerLocalId",
",",
"path",
")",
";",
"r... | Query for selecting changes (or snapshots) made on a concrete ValueObject
(so a ValueObject owned by a concrete Entity instance).
<br/><br/>
<b>Path parameter</b> is a relative path from owning Entity instance to ValueObject that you are looking for.
<br/><br/>
When ValueObject is just <b>a property</b>, use property... | [
"Query",
"for",
"selecting",
"changes",
"(",
"or",
"snapshots",
")",
"made",
"on",
"a",
"concrete",
"ValueObject",
"(",
"so",
"a",
"ValueObject",
"owned",
"by",
"a",
"concrete",
"Entity",
"instance",
")",
".",
"<br",
"/",
">",
"<br",
"/",
">"
] | a51511be7d8bcee3e1812db8b7e69a45330b4e14 | https://github.com/javers/javers/blob/a51511be7d8bcee3e1812db8b7e69a45330b4e14/javers-core/src/main/java/org/javers/repository/jql/QueryBuilder.java#L174-L177 | train | Create a query builder that filters objects by valueObjectId. | Create a Java method that does the following: "Create a query builder that filters objects by valueObjectId.". | Of course, here is the Java code you requested:
```java
public static QueryBuilder byValueObjectId(Object ownerLocalId, Class ownerEntityClass, String path){
Validate.argumentsAreNotNull(ownerEntityClass, ownerLocalId, path);
return new QueryBuilder(new IdFilterDefinition(ValueObjectIdDTO.valueObjectId... | |
isisaddons-legacy/isis-module-publishmq | dom/jdo/src/main/java/org/isisaddons/module/publishmq/dom/jdo/status/StatusMessageRepository.java | StatusMessageRepository.findByTransactionId | @Programmatic
public List<StatusMessage> findByTransactionId(final UUID transactionId) {
return repositoryService.allMatches(
new QueryDefault<>(StatusMessage.class,
"findByTransactionId",
"transactionId", transactionId));
} | java | @Programmatic
public List<StatusMessage> findByTransactionId(final UUID transactionId) {
return repositoryService.allMatches(
new QueryDefault<>(StatusMessage.class,
"findByTransactionId",
"transactionId", transactionId));
} | [
"@",
"Programmatic",
"public",
"List",
"<",
"StatusMessage",
">",
"findByTransactionId",
"(",
"final",
"UUID",
"transactionId",
")",
"{",
"return",
"repositoryService",
".",
"allMatches",
"(",
"new",
"QueryDefault",
"<>",
"(",
"StatusMessage",
".",
"class",
",",
... | region > findByTransactionId | [
"region",
">",
"findByTransactionId"
] | b1a424f95b26a2a0369aac706c2e30074b7f6e43 | https://github.com/isisaddons-legacy/isis-module-publishmq/blob/b1a424f95b26a2a0369aac706c2e30074b7f6e43/dom/jdo/src/main/java/org/isisaddons/module/publishmq/dom/jdo/status/StatusMessageRepository.java#L46-L52 | train | Find all status messages for a given transaction id. | Create a Java method that does the following: "Find all status messages for a given transaction id.". | Of course, here is the Java code you requested:
```java
@Programmatic
public List<StatusMessage> findByTransactionId(final UUID transactionId) {
return repositoryService.allMatches(
new QueryDefault<>(StatusMessage.class,
"findByTransactionId",
... | |
eFaps/eFaps-Kernel | src/main/java/org/efaps/db/print/LinkToSelectPart.java | LinkToSelectPart.getType | @Override
public Type getType()
throws EFapsException
{
final Attribute attr = this.type.getAttribute(this.attrName);
if (attr == null) {
LinkToSelectPart.LOG.error("Could not find an Attribute with name '{}' for type:{}", this.attrName,
this.type)... | java | @Override
public Type getType()
throws EFapsException
{
final Attribute attr = this.type.getAttribute(this.attrName);
if (attr == null) {
LinkToSelectPart.LOG.error("Could not find an Attribute with name '{}' for type:{}", this.attrName,
this.type)... | [
"@",
"Override",
"public",
"Type",
"getType",
"(",
")",
"throws",
"EFapsException",
"{",
"final",
"Attribute",
"attr",
"=",
"this",
".",
"type",
".",
"getAttribute",
"(",
"this",
".",
"attrName",
")",
";",
"if",
"(",
"attr",
"==",
"null",
")",
"{",
"Li... | {@inheritDoc} | [
"{"
] | 04b96548f518c2386a93f5ec2b9349f9b9063859 | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/print/LinkToSelectPart.java#L154-L174 | train | Get the type of the entity. | Create a Java method that does the following: "Get the type of the entity.". | Of course, here is the Java code you requested:
```java
@Override
public Type getType()
throws EFapsException
{
final Attribute attr = this.type.getAttribute(this.attrName);
if (attr == null) {
LinkToSelectPart.LOG.error("Could not find an Attribute with name '{}' for type:{... | |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/RxComapi.java | RxComapi.initialise | public static Observable<RxComapiClient> initialise(@NonNull Application app, @NonNull ComapiConfig config) {
String error = checkIfCanInitialise(app, config, false);
if (!TextUtils.isEmpty(error)) {
return Observable.error(new Exception(error));
}
RxComapiClient client = n... | java | public static Observable<RxComapiClient> initialise(@NonNull Application app, @NonNull ComapiConfig config) {
String error = checkIfCanInitialise(app, config, false);
if (!TextUtils.isEmpty(error)) {
return Observable.error(new Exception(error));
}
RxComapiClient client = n... | [
"public",
"static",
"Observable",
"<",
"RxComapiClient",
">",
"initialise",
"(",
"@",
"NonNull",
"Application",
"app",
",",
"@",
"NonNull",
"ComapiConfig",
"config",
")",
"{",
"String",
"error",
"=",
"checkIfCanInitialise",
"(",
"app",
",",
"config",
",",
"fal... | Build SDK client. Can be called only once in onCreate callback on Application class. | [
"Build",
"SDK",
"client",
".",
"Can",
"be",
"called",
"only",
"once",
"in",
"onCreate",
"callback",
"on",
"Application",
"class",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/RxComapi.java#L47-L56 | train | Initialise the application with the given configuration. | Create a Java method that does the following: "Initialise the application with the given configuration.". | Of course, here is the Java code you requested:
```java
public static Observable<RxComapiClient> initialise(@NonNull Application app, @NonNull ComapiConfig config) {
String error = checkIfCanInitialise(app, config, false);
if (!TextUtils.isEmpty(error)) {
return Observable.error(new Except... | |
aws/aws-sdk-java | aws-java-sdk-simpleworkflow/src/main/java/com/amazonaws/services/simpleworkflow/model/transform/ListActivityTypesRequestMarshaller.java | ListActivityTypesRequestMarshaller.marshall | public void marshall(ListActivityTypesRequest listActivityTypesRequest, ProtocolMarshaller protocolMarshaller) {
if (listActivityTypesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listAct... | java | public void marshall(ListActivityTypesRequest listActivityTypesRequest, ProtocolMarshaller protocolMarshaller) {
if (listActivityTypesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listAct... | [
"public",
"void",
"marshall",
"(",
"ListActivityTypesRequest",
"listActivityTypesRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"listActivityTypesRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argum... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-simpleworkflow/src/main/java/com/amazonaws/services/simpleworkflow/model/transform/ListActivityTypesRequestMarshaller.java#L52-L68 | train | marshalls the given list activity types request to the given protocolMarshaller. | Create a Java method that does the following: "marshalls the given list activity types request to the given protocolMarshaller.". | Of course, here is the Java code you requested:
```java
public void marshall(ListActivityTypesRequest listActivityTypesRequest, ProtocolMarshaller protocolMarshaller) {
if (listActivityTypesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
... | |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/complex/BaseComplexNDArray.java | BaseComplexNDArray.putRow | @Override
public IComplexNDArray putRow(long row, INDArray toPut) {
return (IComplexNDArray) super.putRow(row, toPut);
} | java | @Override
public IComplexNDArray putRow(long row, INDArray toPut) {
return (IComplexNDArray) super.putRow(row, toPut);
} | [
"@",
"Override",
"public",
"IComplexNDArray",
"putRow",
"(",
"long",
"row",
",",
"INDArray",
"toPut",
")",
"{",
"return",
"(",
"IComplexNDArray",
")",
"super",
".",
"putRow",
"(",
"row",
",",
"toPut",
")",
";",
"}"
] | Insert a row in to this array
Will throw an exception if this
ndarray is not a matrix
@param row the row insert into
@param toPut the row to insert
@return this | [
"Insert",
"a",
"row",
"in",
"to",
"this",
"array",
"Will",
"throw",
"an",
"exception",
"if",
"this",
"ndarray",
"is",
"not",
"a",
"matrix"
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/complex/BaseComplexNDArray.java#L2130-L2133 | test | Put a row into the matrix | Create a Java method that does the following: "Put a row into the matrix". | Of course, here is the Java code you requested:
```java
@Override
public IComplexNDArray putRow(long row, INDArray toPut) {
return (IComplexNDArray) super.putRow(row, toPut);
}
```
Hope this helps! | |
alkacon/opencms-core | src-gwt/org/opencms/ade/contenteditor/client/CmsContentEditor.java | CmsContentEditor.renderFormContent | void renderFormContent() {
initLocaleSelect();
setNativeResourceInfo(m_sitePath, m_locale);
m_contentInfoHeader = new CmsInfoHeader(m_title, null, m_sitePath, m_locale, m_iconClasses);
m_basePanel.add(m_contentInfoHeader);
SimplePanel content = new SimplePanel();
... | java | void renderFormContent() {
initLocaleSelect();
setNativeResourceInfo(m_sitePath, m_locale);
m_contentInfoHeader = new CmsInfoHeader(m_title, null, m_sitePath, m_locale, m_iconClasses);
m_basePanel.add(m_contentInfoHeader);
SimplePanel content = new SimplePanel();
... | [
"void",
"renderFormContent",
"(",
")",
"{",
"initLocaleSelect",
"(",
")",
";",
"setNativeResourceInfo",
"(",
"m_sitePath",
",",
"m_locale",
")",
";",
"m_contentInfoHeader",
"=",
"new",
"CmsInfoHeader",
"(",
"m_title",
",",
"null",
",",
"m_sitePath",
",",
"m_loca... | Renders the form content.<p> | [
"Renders",
"the",
"form",
"content",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/contenteditor/client/CmsContentEditor.java#L1759-L1791 | train | Render the form content. | Create a Java method that does the following: "Render the form content.". | Of course, here is the Java code you requested:
```java
void renderFormContent() {
initLocaleSelect();
setNativeResourceInfo(m_sitePath, m_locale);
m_contentInfoHeader = new CmsInfoHeader(m_title, null, m_sitePath, m_locale, m_iconClasses);
m_basePanel.add(m_contentInfoHeader);
... | |
glyptodon/guacamole-client | extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUser.java | ModeledUser.parseDate | private Date parseDate(String dateString)
throws ParseException {
// Return null if no date provided
java.util.Date parsedDate = DateField.parse(dateString);
if (parsedDate == null)
return null;
// Convert to SQL Date
return new Date(parsedDate.getTime());
... | java | private Date parseDate(String dateString)
throws ParseException {
// Return null if no date provided
java.util.Date parsedDate = DateField.parse(dateString);
if (parsedDate == null)
return null;
// Convert to SQL Date
return new Date(parsedDate.getTime());
... | [
"private",
"Date",
"parseDate",
"(",
"String",
"dateString",
")",
"throws",
"ParseException",
"{",
"// Return null if no date provided",
"java",
".",
"util",
".",
"Date",
"parsedDate",
"=",
"DateField",
".",
"parse",
"(",
"dateString",
")",
";",
"if",
"(",
"pars... | Parses the given string into a corresponding date. The string must
follow the standard format used by date attributes, as defined by
DateField.FORMAT and as would be produced by DateField.format().
@param dateString
The date string to parse, which may be null.
@return
The date corresponding to the given date string, ... | [
"Parses",
"the",
"given",
"string",
"into",
"a",
"corresponding",
"date",
".",
"The",
"string",
"must",
"follow",
"the",
"standard",
"format",
"used",
"by",
"date",
"attributes",
"as",
"defined",
"by",
"DateField",
".",
"FORMAT",
"and",
"as",
"would",
"be",
... | ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9 | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUser.java#L370-L381 | train | Parse a date string into a Date object. | Create a Java method that does the following: "Parse a date string into a Date object.". | Of course, here is the Java code you requested:
```java
private Date parseDate(String dateString)
throws ParseException {
// Return null if no date provided
java.util.Date parsedDate = DateField.parse(dateString);
if (parsedDate == null)
return null;
// Convert to SQL ... | |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/experimental/ListenersNotifier.java | ListenersNotifier.logError | private void logError(LifecycleListener listener, Exception e) {
LOGGER.error("Error for listener " + listener.getClass(), e);
} | java | private void logError(LifecycleListener listener, Exception e) {
LOGGER.error("Error for listener " + listener.getClass(), e);
} | [
"private",
"void",
"logError",
"(",
"LifecycleListener",
"listener",
",",
"Exception",
"e",
")",
"{",
"LOGGER",
".",
"error",
"(",
"\"Error for listener \"",
"+",
"listener",
".",
"getClass",
"(",
")",
",",
"e",
")",
";",
"}"
] | This method log given exception in specified listener | [
"This",
"method",
"log",
"given",
"exception",
"in",
"specified",
"listener"
] | 9a816fa05d8b894a917b7ebb7fd1a4056dee4693 | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/experimental/ListenersNotifier.java#L246-L248 | train | Log an error for a lifecycle listener. | Create a Java method that does the following: "Log an error for a lifecycle listener.". | Of course, here is the Java code you requested:
```java
private void logError(LifecycleListener listener, Exception e) {
LOGGER.error("Error for listener " + listener.getClass(), e);
}
```
Hope this helps! | |
biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/webstart/JNLPProxy.java | JNLPProxy.getBasicServiceObject | @SuppressWarnings({ "unchecked" })
private static Object getBasicServiceObject ( )
//////////////////////////////////////////////////////////////////////
{
try
{
Class serviceManagerClass
= Class.forName ( "javax.jnlp.ServiceManager" );
Method lookupMethod = serviceManagerClass.getMethod ( "lookup",
new... | java | @SuppressWarnings({ "unchecked" })
private static Object getBasicServiceObject ( )
//////////////////////////////////////////////////////////////////////
{
try
{
Class serviceManagerClass
= Class.forName ( "javax.jnlp.ServiceManager" );
Method lookupMethod = serviceManagerClass.getMethod ( "lookup",
new... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
"}",
")",
"private",
"static",
"Object",
"getBasicServiceObject",
"(",
")",
"//////////////////////////////////////////////////////////////////////",
"{",
"try",
"{",
"Class",
"serviceManagerClass",
"=",
"Class",
".",
"f... | //////////////////////////////////////////////////////////////////// | [
"////////////////////////////////////////////////////////////////////"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/webstart/JNLPProxy.java#L102-L121 | train | Gets the basic service object. | Create a Java method that does the following: "Gets the basic service object.". | Of course, here is the Java code you requested:
```java
@SuppressWarnings({ "unchecked" })
private static Object getBasicServiceObject ( )
//////////////////////////////////////////////////////////////////////
{
try
{
Class serviceManagerClass
= Class.forName ( "javax.jnlp.ServiceManager" );
Method lookup... | |
cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java | PreparedStatement.executeBatch | public int[] executeBatch() throws SQLException {
final int[] cs = new int[batch.size()];
java.util.Arrays.fill(cs, EXECUTE_FAILED);
final boolean cont =
"true".equals(connection.getProperties().
get("acolyte.batch.continueOnError"));
SQLException... | java | public int[] executeBatch() throws SQLException {
final int[] cs = new int[batch.size()];
java.util.Arrays.fill(cs, EXECUTE_FAILED);
final boolean cont =
"true".equals(connection.getProperties().
get("acolyte.batch.continueOnError"));
SQLException... | [
"public",
"int",
"[",
"]",
"executeBatch",
"(",
")",
"throws",
"SQLException",
"{",
"final",
"int",
"[",
"]",
"cs",
"=",
"new",
"int",
"[",
"batch",
".",
"size",
"(",
")",
"]",
";",
"java",
".",
"util",
".",
"Arrays",
".",
"fill",
"(",
"cs",
",",... | {@inheritDoc} | [
"{"
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java#L576-L604 | train | Execute the batch of SQL statements. | Create a Java method that does the following: "Execute the batch of SQL statements.". | Of course, here is the Java code you requested:
```java
public int[] executeBatch() throws SQLException {
final int[] cs = new int[batch.size()];
java.util.Arrays.fill(cs, EXECUTE_FAILED);
final boolean cont =
"true".equals(connection.getProperties().
get... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java | MessageProcessorMatching.deregisterConsumerSetMonitor | public void deregisterConsumerSetMonitor(ConnectionImpl connection,
ConsumerSetChangeCallback callback)
throws SINotPossibleInCurrentConfigurationException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "deregisterConsumerSetMo... | java | public void deregisterConsumerSetMonitor(ConnectionImpl connection,
ConsumerSetChangeCallback callback)
throws SINotPossibleInCurrentConfigurationException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "deregisterConsumerSetMo... | [
"public",
"void",
"deregisterConsumerSetMonitor",
"(",
"ConnectionImpl",
"connection",
",",
"ConsumerSetChangeCallback",
"callback",
")",
"throws",
"SINotPossibleInCurrentConfigurationException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
... | Method deregisterConsumerSetMonitor
Deregisters a previously registered callback.
@param connection
@param callback
@throws SINotPossibleInCurrentConfigurationException | [
"Method",
"deregisterConsumerSetMonitor"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java#L2464-L2480 | train | Deregisters a consumer set monitor for a connection | Create a Java method that does the following: "Deregisters a consumer set monitor for a connection". | Of course, here is the Java code you requested:
```java
public void deregisterConsumerSetMonitor(ConnectionImpl connection,
ConsumerSetChangeCallback callback)
throws SINotPossibleInCurrentConfigurationException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntry... | |
aws/aws-sdk-java | aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/transform/ParameterInlinePolicyMarshaller.java | ParameterInlinePolicyMarshaller.marshall | public void marshall(ParameterInlinePolicy parameterInlinePolicy, ProtocolMarshaller protocolMarshaller) {
if (parameterInlinePolicy == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(parameterInlineP... | java | public void marshall(ParameterInlinePolicy parameterInlinePolicy, ProtocolMarshaller protocolMarshaller) {
if (parameterInlinePolicy == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(parameterInlineP... | [
"public",
"void",
"marshall",
"(",
"ParameterInlinePolicy",
"parameterInlinePolicy",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"parameterInlinePolicy",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argument passe... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/transform/ParameterInlinePolicyMarshaller.java#L46-L59 | train | marshalls the given parameter inline policy to the JSON object. | Create a Java method that does the following: "marshalls the given parameter inline policy to the JSON object.". | Of course, here is the Java code you requested:
```java
public void marshall(ParameterInlinePolicy parameterInlinePolicy, ProtocolMarshaller protocolMarshaller) {
if (parameterInlinePolicy == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {... | |
Evol-Instruct | N/A | N/A | java | [] | [] | train | Create a Java class named "MyClass" with three methods - getName(), setName(), and displayName(). Additionally, implement a static variable called "counter" to keep track of the number of instances of "MyClass" that have been created. Increment the counter variable every time a new instance of "MyClass" is created and ... | Here is the implementation of the MyClass class with the requested methods and counter variable:
```java
public class MyClass {
private static int counter = 0;
private String name;
public MyClass() {
counter++;
}
public String getName() {
return name;
}
public... | |||||||
chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/util/Interval1D.java | Interval1D.main | public static void main(String[] args) {
Interval1D<Integer> a = new Interval1D<>(15, 20);
Interval1D<Integer> b = new Interval1D<>(25, 30);
Interval1D<Integer> c = new Interval1D<>(10, 40);
Interval1D<Integer> d = new Interval1D<>(40, 50);
System.out.println("a = " + a);
System.out.println("b ... | java | public static void main(String[] args) {
Interval1D<Integer> a = new Interval1D<>(15, 20);
Interval1D<Integer> b = new Interval1D<>(25, 30);
Interval1D<Integer> c = new Interval1D<>(10, 40);
Interval1D<Integer> d = new Interval1D<>(40, 50);
System.out.println("a = " + a);
System.out.println("b ... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"Interval1D",
"<",
"Integer",
">",
"a",
"=",
"new",
"Interval1D",
"<>",
"(",
"15",
",",
"20",
")",
";",
"Interval1D",
"<",
"Integer",
">",
"b",
"=",
"new",
"Interval1D",
... | test client | [
"test",
"client"
] | e53ae6be982e2de3123292be7d5297715bec70bb | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/Interval1D.java#L48-L67 | train | Main method to print the intersection between two 2D intervals. | Create a Java method that does the following: "Main method to print the intersection between two 2D intervals.". | Of course, here is the Java code you requested:
```java
public static void main(String[] args) {
Interval1D<Integer> a = new Interval1D<>(15, 20);
Interval1D<Integer> b = new Interval1D<>(25, 30);
Interval1D<Integer> c = new Interval1D<>(10, 40);
Interval1D<Integer> d = new Interval1D<>(40, 50);
S... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSCompatibleBoxList.java | JSCompatibleBoxList.get | public Object get(int index) {
try {
return getValue(index);
} catch (JMFException e) {
FFDCFilter.processException(e, "get", "125", this);
return null;
}
} | java | public Object get(int index) {
try {
return getValue(index);
} catch (JMFException e) {
FFDCFilter.processException(e, "get", "125", this);
return null;
}
} | [
"public",
"Object",
"get",
"(",
"int",
"index",
")",
"{",
"try",
"{",
"return",
"getValue",
"(",
"index",
")",
";",
"}",
"catch",
"(",
"JMFException",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"get\"",
",",
"\"125\"",
",",
... | Implement get via getValue | [
"Implement",
"get",
"via",
"getValue"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSCompatibleBoxList.java#L106-L113 | train | Get the value of the specified index. | Create a Java method that does the following: "Get the value of the specified index.". | Of course, here is the Java code you requested:
```java
public Object get(int index) {
try {
return getValue(index);
} catch (JMFException e) {
FFDCFilter.processException(e, "get", "125", this);
return null;
}
}
```
Hope this helps! | |
SimiaCryptus/utilities | java-util/src/main/java/com/simiacryptus/util/Util.java | Util.cvt | @javax.annotation.Nonnull
public static TemporalUnit cvt(@javax.annotation.Nonnull final TimeUnit units) {
switch (units) {
case DAYS:
return ChronoUnit.DAYS;
case HOURS:
return ChronoUnit.HOURS;
case MINUTES:
return ChronoUnit.MINUTES;
case SECONDS:
return ... | java | @javax.annotation.Nonnull
public static TemporalUnit cvt(@javax.annotation.Nonnull final TimeUnit units) {
switch (units) {
case DAYS:
return ChronoUnit.DAYS;
case HOURS:
return ChronoUnit.HOURS;
case MINUTES:
return ChronoUnit.MINUTES;
case SECONDS:
return ... | [
"@",
"javax",
".",
"annotation",
".",
"Nonnull",
"public",
"static",
"TemporalUnit",
"cvt",
"(",
"@",
"javax",
".",
"annotation",
".",
"Nonnull",
"final",
"TimeUnit",
"units",
")",
"{",
"switch",
"(",
"units",
")",
"{",
"case",
"DAYS",
":",
"return",
"Ch... | Cvt temporal unit.
@param units the units
@return the temporal unit | [
"Cvt",
"temporal",
"unit",
"."
] | b5a5e73449aae57de7dbfca2ed7a074432c5b17e | https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/util/Util.java#L291-L311 | train | Cvt method for the javax. annotation. Nonnull TimeUnit | Create a Java method that does the following: "Cvt method for the javax. annotation. Nonnull TimeUnit". | Of course, here is the Java code you requested:
```java
@javax.annotation.Nonnull
public static TemporalUnit cvt(@javax.annotation.Nonnull final TimeUnit units) {
switch (units) {
case DAYS:
return ChronoUnit.DAYS;
case HOURS:
return ChronoUnit.HOURS;
case MINUTES:
retur... | |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/schema/mapping/GeoPointMapper.java | GeoPointMapper.indexableFields | @Override
public List<IndexableField> indexableFields(Columns columns) {
Double lon = readLongitude(columns);
Double lat = readLatitude(columns);
if (lon == null && lat == null) {
return Collections.emptyList();
} else if (lat == null) {
throw new IndexExcep... | java | @Override
public List<IndexableField> indexableFields(Columns columns) {
Double lon = readLongitude(columns);
Double lat = readLatitude(columns);
if (lon == null && lat == null) {
return Collections.emptyList();
} else if (lat == null) {
throw new IndexExcep... | [
"@",
"Override",
"public",
"List",
"<",
"IndexableField",
">",
"indexableFields",
"(",
"Columns",
"columns",
")",
"{",
"Double",
"lon",
"=",
"readLongitude",
"(",
"columns",
")",
";",
"Double",
"lat",
"=",
"readLatitude",
"(",
"columns",
")",
";",
"if",
"(... | {@inheritDoc} | [
"{"
] | a94a4d9af6c25d40e1108729974c35c27c54441c | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/schema/mapping/GeoPointMapper.java#L93-L110 | train | Returns a list of indexable fields from the given columns. | Create a Java method that does the following: "Returns a list of indexable fields from the given columns.". | Of course, here is the Java code you requested:
```java
@Override
public List<IndexableField> indexableFields(Columns columns) {
Double lon = readLongitude(columns);
Double lat = readLatitude(columns);
if (lon == null && lat == null) {
return Collections.emptyList();
}... | |
citygml4j/citygml4j | src-gen/main/java/net/opengis/gml/ObjectFactory.java | ObjectFactory.create_Association | @XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "_association")
public JAXBElement<AssociationType> create_Association(AssociationType value) {
return new JAXBElement<AssociationType>(__Association_QNAME, AssociationType.class, null, value);
} | java | @XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "_association")
public JAXBElement<AssociationType> create_Association(AssociationType value) {
return new JAXBElement<AssociationType>(__Association_QNAME, AssociationType.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://www.opengis.net/gml\"",
",",
"name",
"=",
"\"_association\"",
")",
"public",
"JAXBElement",
"<",
"AssociationType",
">",
"create_Association",
"(",
"AssociationType",
"value",
")",
"{",
"return",
"new",
"JAXBElem... | Create an instance of {@link JAXBElement }{@code <}{@link AssociationType }{@code >}
@param value
Java instance representing xml element's value.
@return
the new instance of {@link JAXBElement }{@code <}{@link AssociationType }{@code >} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"AssociationType",
"}",
"{",
"@code",
">",
"}"
] | 9155997d5ecf7e8f19411a02ba047f13375b97b9 | https://github.com/citygml4j/citygml4j/blob/9155997d5ecf7e8f19411a02ba047f13375b97b9/src-gen/main/java/net/opengis/gml/ObjectFactory.java#L3379-L3382 | train | Create an instance of the associated JAXBElement. | Create a Java method that does the following: "Create an instance of the associated JAXBElement.". | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "_association")
public JAXBElement<AssociationType> create_Association(AssociationType value) {
return new JAXBElement<AssociationType>(__Association_QNAME, AssociationType.class, null, ... | |
Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelCreateHandler.java | ChannelCreateHandler.handleChannelCategory | private void handleChannelCategory(JsonNode channel) {
long serverId = channel.get("guild_id").asLong();
api.getPossiblyUnreadyServerById(serverId).ifPresent(server -> {
ChannelCategory channelCategory = ((ServerImpl) server).getOrCreateChannelCategory(channel);
ServerChannelCrea... | java | private void handleChannelCategory(JsonNode channel) {
long serverId = channel.get("guild_id").asLong();
api.getPossiblyUnreadyServerById(serverId).ifPresent(server -> {
ChannelCategory channelCategory = ((ServerImpl) server).getOrCreateChannelCategory(channel);
ServerChannelCrea... | [
"private",
"void",
"handleChannelCategory",
"(",
"JsonNode",
"channel",
")",
"{",
"long",
"serverId",
"=",
"channel",
".",
"get",
"(",
"\"guild_id\"",
")",
".",
"asLong",
"(",
")",
";",
"api",
".",
"getPossiblyUnreadyServerById",
"(",
"serverId",
")",
".",
"... | Handles channel category creation.
@param channel The channel data. | [
"Handles",
"channel",
"category",
"creation",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelCreateHandler.java#L80-L87 | train | Handle channel category. | Create a Java method that does the following: "Handle channel category.". | Of course, here is the Java code you requested:
```java
private void handleChannelCategory(JsonNode channel) {
long serverId = channel.get("guild_id").asLong();
api.getPossiblyUnreadyServerById(serverId).ifPresent(server -> {
ChannelCategory channelCategory = ((ServerImpl) server).getOrCrea... | |
alkacon/opencms-core | src/org/opencms/search/solr/spellchecking/CmsSolrSpellchecker.java | CmsSolrSpellchecker.performSpellcheckQuery | private SpellCheckResponse performSpellcheckQuery(CmsSpellcheckingRequest request) {
if ((null == request) || !request.isInitialized()) {
return null;
}
final String[] wordsToCheck = request.m_wordsToCheck;
final ModifiableSolrParams params = new ModifiableSolrParams();
... | java | private SpellCheckResponse performSpellcheckQuery(CmsSpellcheckingRequest request) {
if ((null == request) || !request.isInitialized()) {
return null;
}
final String[] wordsToCheck = request.m_wordsToCheck;
final ModifiableSolrParams params = new ModifiableSolrParams();
... | [
"private",
"SpellCheckResponse",
"performSpellcheckQuery",
"(",
"CmsSpellcheckingRequest",
"request",
")",
"{",
"if",
"(",
"(",
"null",
"==",
"request",
")",
"||",
"!",
"request",
".",
"isInitialized",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"final",
... | Performs the actual spell check query using Solr.
@param request the spell check request
@return Results of the Solr spell check of type SpellCheckResponse or null if something goes wrong. | [
"Performs",
"the",
"actual",
"spell",
"check",
"query",
"using",
"Solr",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/solr/spellchecking/CmsSolrSpellchecker.java#L451-L484 | train | Perform a spellcheck query. | Create a Java method that does the following: "Perform a spellcheck query.". | Of course, here is the Java code you requested:
```java
private SpellCheckResponse performSpellcheckQuery(CmsSpellcheckingRequest request) {
if ((null == request) || !request.isInitialized()) {
return null;
}
final String[] wordsToCheck = request.m_wordsToCheck;
final Mod... | |
stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/CacheManager.java | CacheManager.getDateOfDataInCache | @Override
public Date getDateOfDataInCache(Class<?> clazz, Object cacheKey) throws CacheLoadingException, CacheCreationException {
return new Date(getObjectPersister(clazz).getCreationDateInCache(cacheKey));
} | java | @Override
public Date getDateOfDataInCache(Class<?> clazz, Object cacheKey) throws CacheLoadingException, CacheCreationException {
return new Date(getObjectPersister(clazz).getCreationDateInCache(cacheKey));
} | [
"@",
"Override",
"public",
"Date",
"getDateOfDataInCache",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Object",
"cacheKey",
")",
"throws",
"CacheLoadingException",
",",
"CacheCreationException",
"{",
"return",
"new",
"Date",
"(",
"getObjectPersister",
"(",
"clazz"... | {@inheritDoc}
@throws CacheLoadingException
@throws CacheCreationException | [
"{"
] | 8bffde88b3534a961a13cab72a8f07a755f0a0fe | https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/CacheManager.java#L94-L97 | train | Get the date of the data in cache. | Create a Java method that does the following: "Get the date of the data in cache.". | Of course, here is the Java code you requested:
```java
@Override
public Date getDateOfDataInCache(Class<?> clazz, Object cacheKey) throws CacheLoadingException, CacheCreationException {
return new Date(getObjectPersister(clazz).getCreationDateInCache(cacheKey));
}
```
Hope this helps! | |
Unidata/thredds | cdm/src/main/java/thredds/client/catalog/builder/CatalogBuilder.java | CatalogBuilder.readMetadata | protected ThreddsMetadata.MetadataOther readMetadata(Map<String,Object> flds, DatasetBuilder dataset, Element mdataElement) {
// there are 6 cases to deal with: threddsNamespace vs not & inline vs Xlink & (if thredds) inherited or not
Namespace namespace;
List inlineElements = mdataElement.getChildren();
... | java | protected ThreddsMetadata.MetadataOther readMetadata(Map<String,Object> flds, DatasetBuilder dataset, Element mdataElement) {
// there are 6 cases to deal with: threddsNamespace vs not & inline vs Xlink & (if thredds) inherited or not
Namespace namespace;
List inlineElements = mdataElement.getChildren();
... | [
"protected",
"ThreddsMetadata",
".",
"MetadataOther",
"readMetadata",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"flds",
",",
"DatasetBuilder",
"dataset",
",",
"Element",
"mdataElement",
")",
"{",
"// there are 6 cases to deal with: threddsNamespace vs not & inline vs X... | /*
<xsd:element name="metadata">
<xsd:complexType>
<xsd:choice>
<xsd:group ref="threddsMetadataGroup" minOccurs="0" maxOccurs="unbounded"/>
<xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
</xsd:choice>
<xsd:attribute name="inherited" type="xsd:boolean" default="false"/>
<xsd:at... | [
"/",
"*",
"<xsd",
":",
"element",
"name",
"=",
"metadata",
">",
"<xsd",
":",
"complexType",
">",
"<xsd",
":",
"choice",
">",
"<xsd",
":",
"group",
"ref",
"=",
"threddsMetadataGroup",
"minOccurs",
"=",
"0",
"maxOccurs",
"=",
"unbounded",
"/",
">",
"<xsd",... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/thredds/client/catalog/builder/CatalogBuilder.java#L969-L1035 | test | Read the ThreddsMetadata XML element | Create a Java method that does the following: "Read the ThreddsMetadata XML element". | Of course, here is the Java code you requested:
```java
protected ThreddsMetadata.MetadataOther readMetadata(Map<String,Object> flds, DatasetBuilder dataset, Element mdataElement) {
// there are 6 cases to deal with: threddsNamespace vs not & inline vs Xlink & (if thredds) inherited or not
Namespace namespace;... | |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/concurrent/AbstractJrbRunnable.java | AbstractJrbRunnable.run | @Override
public final void run() {
LOGGER.trace(RUN_IT, runnableName());
try {
runInto();
} catch (final JRebirthThreadException jte) {
LOGGER.error(THREAD_ERROR, jte, jte.getMessage());
}
} | java | @Override
public final void run() {
LOGGER.trace(RUN_IT, runnableName());
try {
runInto();
} catch (final JRebirthThreadException jte) {
LOGGER.error(THREAD_ERROR, jte, jte.getMessage());
}
} | [
"@",
"Override",
"public",
"final",
"void",
"run",
"(",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"RUN_IT",
",",
"runnableName",
"(",
")",
")",
";",
"try",
"{",
"runInto",
"(",
")",
";",
"}",
"catch",
"(",
"final",
"JRebirthThreadException",
"jte",
")",
... | {@inheritDoc} | [
"{"
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/concurrent/AbstractJrbRunnable.java#L74-L85 | train | Run the application. | Create a Java method that does the following: "Run the application.". | Of course, here is the Java code you requested:
```java
@Override
public final void run() {
LOGGER.trace(RUN_IT, runnableName());
try {
runInto();
} catch (final JRebirthThreadException jte) {
LOGGER.error(THREAD_ERROR, jte, jte.getMessage());
}
}
```
... | |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/factory/DecompositionFactory_DDRM.java | DecompositionFactory_DDRM.quality | public static double quality(DMatrixRMaj orig , SingularValueDecomposition<DMatrixRMaj> svd )
{
return quality(orig,svd.getU(null,false),svd.getW(null),svd.getV(null,true));
} | java | public static double quality(DMatrixRMaj orig , SingularValueDecomposition<DMatrixRMaj> svd )
{
return quality(orig,svd.getU(null,false),svd.getW(null),svd.getV(null,true));
} | [
"public",
"static",
"double",
"quality",
"(",
"DMatrixRMaj",
"orig",
",",
"SingularValueDecomposition",
"<",
"DMatrixRMaj",
">",
"svd",
")",
"{",
"return",
"quality",
"(",
"orig",
",",
"svd",
".",
"getU",
"(",
"null",
",",
"false",
")",
",",
"svd",
".",
... | <p>
Computes a metric which measures the the quality of a singular value decomposition. If a
value is returned that is close to or smaller than 1e-15 then it is within machine precision.
</p>
<p>
SVD quality is defined as:<br>
<br>
Quality = || A - U W V<sup>T</sup>|| / || A || <br>
where A is the original matrix , U... | [
"<p",
">",
"Computes",
"a",
"metric",
"which",
"measures",
"the",
"the",
"quality",
"of",
"a",
"singular",
"value",
"decomposition",
".",
"If",
"a",
"value",
"is",
"returned",
"that",
"is",
"close",
"to",
"or",
"smaller",
"than",
"1e",
"-",
"15",
"then",... | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/factory/DecompositionFactory_DDRM.java#L251-L254 | train | Get the quality of a single SEVCTYPE matrix. | Create a Java method that does the following: "Get the quality of a single SEVCTYPE matrix.". | Of course, here is the Java code you requested:
```java
public static double quality(DMatrixRMaj orig , SingularValueDecomposition<DMatrixRMaj> svd )
{
return quality(orig,svd.getU(null,false),svd.getW(null),svd.getV(null,true));
}
```
Hope this helps! | |
googleads/googleads-java-lib | modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201808/LineItemSummary.java | LineItemSummary.getValueCostPerUnit | public com.google.api.ads.admanager.axis.v201808.Money getValueCostPerUnit() {
return valueCostPerUnit;
} | java | public com.google.api.ads.admanager.axis.v201808.Money getValueCostPerUnit() {
return valueCostPerUnit;
} | [
"public",
"com",
".",
"google",
".",
"api",
".",
"ads",
".",
"admanager",
".",
"axis",
".",
"v201808",
".",
"Money",
"getValueCostPerUnit",
"(",
")",
"{",
"return",
"valueCostPerUnit",
";",
"}"
] | Gets the valueCostPerUnit value for this LineItemSummary.
@return valueCostPerUnit * An amount to help the adserver rank inventory. {@link
LineItem#valueCostPerUnit} artificially raises the
value of
inventory over the {@link LineItem#costPerUnit} but
avoids raising
the actual {@link LineItem#costPerUnit}. This attri... | [
"Gets",
"the",
"valueCostPerUnit",
"value",
"for",
"this",
"LineItemSummary",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201808/LineItemSummary.java#L1315-L1317 | train | Gets the valueCostPerUnit value for this CIDCTYPE. | Create a Java method that does the following: "Gets the valueCostPerUnit value for this CIDCTYPE.". | Of course, here is the Java code you requested:
```java
public com.google.api.ads.admanager.axis.v201808.Money getValueCostPerUnit() {
return valueCostPerUnit;
}
```
Hope this helps! | |
mnlipp/jgrapes | org.jgrapes.core/src/org/jgrapes/core/Event.java | Event.forChannels | @SuppressWarnings({ "unchecked", "PMD.ShortVariable" })
public <E extends EventBase<?>, C extends Channel> void forChannels(
Class<C> type, BiConsumer<E, C> handler) {
Arrays.stream(channels)
.filter(c -> type.isAssignableFrom(c.getClass()))
.forEach(c -> handler.accept((... | java | @SuppressWarnings({ "unchecked", "PMD.ShortVariable" })
public <E extends EventBase<?>, C extends Channel> void forChannels(
Class<C> type, BiConsumer<E, C> handler) {
Arrays.stream(channels)
.filter(c -> type.isAssignableFrom(c.getClass()))
.forEach(c -> handler.accept((... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"PMD.ShortVariable\"",
"}",
")",
"public",
"<",
"E",
"extends",
"EventBase",
"<",
"?",
">",
",",
"C",
"extends",
"Channel",
">",
"void",
"forChannels",
"(",
"Class",
"<",
"C",
">",
"type",
",",
"... | Execute the given handler for all channels of the given type.
@param <E> the type of the event
@param <C> the type of the channel
@param type the channel type
@param handler the handler | [
"Execute",
"the",
"given",
"handler",
"for",
"all",
"channels",
"of",
"the",
"given",
"type",
"."
] | 8b5d874935d84c34a52d3e3d3745e869b5203fa0 | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.core/src/org/jgrapes/core/Event.java#L187-L193 | train | Handles all the event channels of the given type. | Create a Java method that does the following: "Handles all the event channels of the given type.". | Of course, here is the Java code you requested:
```java
@SuppressWarnings({ "unchecked", "PMD.ShortVariable" })
public <E extends EventBase<?>, C extends Channel> void forChannels(
Class<C> type, BiConsumer<E, C> handler) {
Arrays.stream(channels)
.filter(c -> type.isAssignableFrom(... | |
JavaMoney/jsr354-ri | moneta-core/src/main/java/org/javamoney/moneta/spi/CompoundRateProvider.java | CompoundRateProvider.addProvider | private void addProvider(ExchangeRateProvider prov) {
providers.add(Optional.ofNullable(prov)
.orElseThrow(() -> new NullPointerException("ConversionProvider required.")));
} | java | private void addProvider(ExchangeRateProvider prov) {
providers.add(Optional.ofNullable(prov)
.orElseThrow(() -> new NullPointerException("ConversionProvider required.")));
} | [
"private",
"void",
"addProvider",
"(",
"ExchangeRateProvider",
"prov",
")",
"{",
"providers",
".",
"add",
"(",
"Optional",
".",
"ofNullable",
"(",
"prov",
")",
".",
"orElseThrow",
"(",
"(",
")",
"->",
"new",
"NullPointerException",
"(",
"\"ConversionProvider req... | Add an additional {@link ExchangeRateProvider} to the instance's delegate
list.
@param prov The {@link ExchangeRateProvider} to be added, not {@code null}
.
@throws java.lang.NullPointerException if the provider is null.
. | [
"Add",
"an",
"additional",
"{",
"@link",
"ExchangeRateProvider",
"}",
"to",
"the",
"instance",
"s",
"delegate",
"list",
"."
] | cf8ff2bbaf9b115acc05eb9b0c76c8397c308284 | https://github.com/JavaMoney/jsr354-ri/blob/cf8ff2bbaf9b115acc05eb9b0c76c8397c308284/moneta-core/src/main/java/org/javamoney/moneta/spi/CompoundRateProvider.java#L90-L93 | train | Add a ConversionProvider to the list of providers. | Create a Java method that does the following: "Add a ConversionProvider to the list of providers.". | Of course, here is the Java code you requested:
```java
private void addProvider(ExchangeRateProvider prov) {
providers.add(Optional.ofNullable(prov)
.orElseThrow(() -> new NullPointerException("ConversionProvider required.")));
}
```
Hope this helps! | |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java | MultiLayerNetwork.setLayerMaskArrays | public void setLayerMaskArrays(INDArray featuresMaskArray, INDArray labelsMaskArray) {
if (featuresMaskArray != null) {
// FIXME: int cast
//New approach: use feedForwardMaskArray method
feedForwardMaskArray(featuresMaskArray, MaskState.Active, (int) featuresMaskArray.size(0... | java | public void setLayerMaskArrays(INDArray featuresMaskArray, INDArray labelsMaskArray) {
if (featuresMaskArray != null) {
// FIXME: int cast
//New approach: use feedForwardMaskArray method
feedForwardMaskArray(featuresMaskArray, MaskState.Active, (int) featuresMaskArray.size(0... | [
"public",
"void",
"setLayerMaskArrays",
"(",
"INDArray",
"featuresMaskArray",
",",
"INDArray",
"labelsMaskArray",
")",
"{",
"if",
"(",
"featuresMaskArray",
"!=",
"null",
")",
"{",
"// FIXME: int cast",
"//New approach: use feedForwardMaskArray method",
"feedForwardMaskArray",... | Set the mask arrays for features and labels. Mask arrays are typically used in situations such as one-to-many
and many-to-one learning with recurrent neural networks, as well as for supporting time series of varying lengths
within the same minibatch.<br>
For example, with RNN data sets with input of shape [miniBatchSiz... | [
"Set",
"the",
"mask",
"arrays",
"for",
"features",
"and",
"labels",
".",
"Mask",
"arrays",
"are",
"typically",
"used",
"in",
"situations",
"such",
"as",
"one",
"-",
"to",
"-",
"many",
"and",
"many",
"-",
"to",
"-",
"one",
"learning",
"with",
"recurrent",... | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java#L3184-L3217 | train | Sets the mask arrays for the layers | Create a Java method that does the following: "Sets the mask arrays for the layers". | Of course, here is the Java code you requested:
```java
public void setLayerMaskArrays(INDArray featuresMaskArray, INDArray labelsMaskArray) {
if (featuresMaskArray != null) {
// FIXME: int cast
//New approach: use feedForwardMaskArray method
feedForwardMaskArray(featuresMa... | |
CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java | CleverTapAPI.getCachedGUIDs | private JSONObject getCachedGUIDs() {
JSONObject cache = null;
String json = getStringFromPrefs(Constants.CACHED_GUIDS_KEY, null);
if (json != null) {
try {
cache = new JSONObject(json);
} catch (Throwable t) {
// no-op
getC... | java | private JSONObject getCachedGUIDs() {
JSONObject cache = null;
String json = getStringFromPrefs(Constants.CACHED_GUIDS_KEY, null);
if (json != null) {
try {
cache = new JSONObject(json);
} catch (Throwable t) {
// no-op
getC... | [
"private",
"JSONObject",
"getCachedGUIDs",
"(",
")",
"{",
"JSONObject",
"cache",
"=",
"null",
";",
"String",
"json",
"=",
"getStringFromPrefs",
"(",
"Constants",
".",
"CACHED_GUIDS_KEY",
",",
"null",
")",
";",
"if",
"(",
"json",
"!=",
"null",
")",
"{",
"tr... | Profile | [
"Profile"
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java#L2985-L2998 | train | Get the cached GUIDs | Create a Java method that does the following: "Get the cached GUIDs". | Of course, here is the Java code you requested:
```java
private JSONObject getCachedGUIDs() {
JSONObject cache = null;
String json = getStringFromPrefs(Constants.CACHED_GUIDS_KEY, null);
if (json != null) {
try {
cache = new JSONObject(json);
} catch (Thr... | |
apache/incubator-shardingsphere | sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/ShardingRule.java | ShardingRule.getShardingLogicTableNames | public Collection<String> getShardingLogicTableNames(final Collection<String> logicTableNames) {
Collection<String> result = new LinkedList<>();
for (String each : logicTableNames) {
Optional<TableRule> tableRule = findTableRule(each);
if (tableRule.isPresent()) {
... | java | public Collection<String> getShardingLogicTableNames(final Collection<String> logicTableNames) {
Collection<String> result = new LinkedList<>();
for (String each : logicTableNames) {
Optional<TableRule> tableRule = findTableRule(each);
if (tableRule.isPresent()) {
... | [
"public",
"Collection",
"<",
"String",
">",
"getShardingLogicTableNames",
"(",
"final",
"Collection",
"<",
"String",
">",
"logicTableNames",
")",
"{",
"Collection",
"<",
"String",
">",
"result",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"for",
"(",
"Str... | Get sharding logic table names.
@param logicTableNames logic table names
@return sharding logic table names | [
"Get",
"sharding",
"logic",
"table",
"names",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/ShardingRule.java#L498-L507 | train | Get the sharding logic table names. | Create a Java method that does the following: "Get the sharding logic table names.". | Of course, here is the Java code you requested:
```java
public Collection<String> getShardingLogicTableNames(final Collection<String> logicTableNames) {
Collection<String> result = new LinkedList<>();
for (String each : logicTableNames) {
Optional<TableRule> tableRule = findTableRule(each);... | |
Azure/azure-storage-android | microsoft-azure-storage/src/com/microsoft/azure/storage/StorageUri.java | StorageUri.getUri | public URI getUri(StorageLocation location) {
switch (location) {
case PRIMARY:
return this.primaryUri;
case SECONDARY:
return this.secondaryUri;
default:
throw new IllegalArgumentException(String.format(Utility.LOCALE_US, SR.... | java | public URI getUri(StorageLocation location) {
switch (location) {
case PRIMARY:
return this.primaryUri;
case SECONDARY:
return this.secondaryUri;
default:
throw new IllegalArgumentException(String.format(Utility.LOCALE_US, SR.... | [
"public",
"URI",
"getUri",
"(",
"StorageLocation",
"location",
")",
"{",
"switch",
"(",
"location",
")",
"{",
"case",
"PRIMARY",
":",
"return",
"this",
".",
"primaryUri",
";",
"case",
"SECONDARY",
":",
"return",
"this",
".",
"secondaryUri",
";",
"default",
... | Gets the URI for a specified {@link StorageLocation}.
@param location
The <code>StorageLocation</code> object for which to retrieve a URI.
@return
A <code>java.net.URI</code> object for the specified <code>StorageLocation</code>. | [
"Gets",
"the",
"URI",
"for",
"a",
"specified",
"{",
"@link",
"StorageLocation",
"}",
"."
] | 2c643c37c6b8c9081058add284c601a2393afc93 | https://github.com/Azure/azure-storage-android/blob/2c643c37c6b8c9081058add284c601a2393afc93/microsoft-azure-storage/src/com/microsoft/azure/storage/StorageUri.java#L155-L167 | valid | Gets the URI of the resource in the specified location. | Create a Java method that does the following: "Gets the URI of the resource in the specified location.". | Of course, here is the Java code you requested:
```java
public URI getUri(StorageLocation location) {
switch (location) {
case PRIMARY:
return this.primaryUri;
case SECONDARY:
return this.secondaryUri;
default:
throw new Ille... | |
jbundle/osgi | core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java | BaseBundleActivator.getProperty | public String getProperty(String key)
{
String servicePid = this.getServicePid();
String value = null;
if (!key.contains("."))
{
value = context.getProperty(servicePid + '.' + key);
if ((value == null) && (properties != null))
value = properties.get(servicePid + '.' + key);
}
... | java | public String getProperty(String key)
{
String servicePid = this.getServicePid();
String value = null;
if (!key.contains("."))
{
value = context.getProperty(servicePid + '.' + key);
if ((value == null) && (properties != null))
value = properties.get(servicePid + '.' + key);
}
... | [
"public",
"String",
"getProperty",
"(",
"String",
"key",
")",
"{",
"String",
"servicePid",
"=",
"this",
".",
"getServicePid",
"(",
")",
";",
"String",
"value",
"=",
"null",
";",
"if",
"(",
"!",
"key",
".",
"contains",
"(",
"\".\"",
")",
")",
"{",
"va... | Get the properties.
@return the properties. | [
"Get",
"the",
"properties",
"."
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java#L387-L402 | train | Get the value of the property. | Create a Java method that does the following: "Get the value of the property.". | Of course, here is the Java code you requested:
```java
public String getProperty(String key)
{
String servicePid = this.getServicePid();
String value = null;
if (!key.contains("."))
{
value = context.getProperty(servicePid + '.' + key);
if ((value == null) && (properties != null))
va... | |
FINRAOS/JTAF-ExtWebDriver | src/main/java/org/finra/jtaf/ewd/widget/element/Element.java | Element.waitForAttribute | public void waitForAttribute(String attributeName, String pattern, long timeout) throws WidgetException {
waitForAttributePatternMatcher(attributeName, pattern, timeout, true);
} | java | public void waitForAttribute(String attributeName, String pattern, long timeout) throws WidgetException {
waitForAttributePatternMatcher(attributeName, pattern, timeout, true);
} | [
"public",
"void",
"waitForAttribute",
"(",
"String",
"attributeName",
",",
"String",
"pattern",
",",
"long",
"timeout",
")",
"throws",
"WidgetException",
"{",
"waitForAttributePatternMatcher",
"(",
"attributeName",
",",
"pattern",
",",
"timeout",
",",
"true",
")",
... | /*
(non-Javadoc)
@see
qc.automation.framework.widget.IElement#waitForAttribute(java.lang.String
, java.lang.String, java.lang.Long) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 78d646def1bf0904f79b19a81df0241e07f2c73a | https://github.com/FINRAOS/JTAF-ExtWebDriver/blob/78d646def1bf0904f79b19a81df0241e07f2c73a/src/main/java/org/finra/jtaf/ewd/widget/element/Element.java#L1003-L1005 | train | Waits until an attribute with the specified name matches the given pattern. | Create a Java method that does the following: "Waits until an attribute with the specified name matches the given pattern.". | Of course, here is the Java code you requested:
```java
public void waitForAttribute(String attributeName, String pattern, long timeout) throws WidgetException {
waitForAttributePatternMatcher(attributeName, pattern, timeout, true);
}
```
Hope this helps! | |
lessthanoptimal/GeoRegression | main/src/georegression/geometry/UtilPolygons2D_F64.java | UtilPolygons2D_F64.isCCW | public static boolean isCCW( List<Point2D_F64> polygon ) {
final int N = polygon.size();
int sign = 0;
for (int i = 0; i < N; i++) {
int j = (i+1)%N;
int k = (i+2)%N;
Point2D_F64 a = polygon.get(i);
Point2D_F64 b = polygon.get(j);
Point2D_F64 c = polygon.get(k);
double dx0 = a.x-b.x;
double... | java | public static boolean isCCW( List<Point2D_F64> polygon ) {
final int N = polygon.size();
int sign = 0;
for (int i = 0; i < N; i++) {
int j = (i+1)%N;
int k = (i+2)%N;
Point2D_F64 a = polygon.get(i);
Point2D_F64 b = polygon.get(j);
Point2D_F64 c = polygon.get(k);
double dx0 = a.x-b.x;
double... | [
"public",
"static",
"boolean",
"isCCW",
"(",
"List",
"<",
"Point2D_F64",
">",
"polygon",
")",
"{",
"final",
"int",
"N",
"=",
"polygon",
".",
"size",
"(",
")",
";",
"int",
"sign",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"... | Returns true if the polygon is ordered in a counter-clockwise order. This is done by summing up the interior
angles.
@param polygon List of ordered points which define a polygon
@return true if CCW and false if CW | [
"Returns",
"true",
"if",
"the",
"polygon",
"is",
"ordered",
"in",
"a",
"counter",
"-",
"clockwise",
"order",
".",
"This",
"is",
"done",
"by",
"summing",
"up",
"the",
"interior",
"angles",
"."
] | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/UtilPolygons2D_F64.java#L242-L267 | test | Checks if the polygon is a CCW polygon. | Create a Java method that does the following: "Checks if the polygon is a CCW polygon.". | Of course, here is the Java code you requested:
```java
public static boolean isCCW( List<Point2D_F64> polygon ) {
final int N = polygon.size();
int sign = 0;
for (int i = 0; i < N; i++) {
int j = (i+1)%N;
int k = (i+2)%N;
Point2D_F64 a = polygon.get(i);
Point2D_F64 b = polygon.get(j);
Point2D_F6... | |
aws/aws-sdk-java | aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/model/GetContextKeysForCustomPolicyResult.java | GetContextKeysForCustomPolicyResult.getContextKeyNames | public java.util.List<String> getContextKeyNames() {
if (contextKeyNames == null) {
contextKeyNames = new com.amazonaws.internal.SdkInternalList<String>();
}
return contextKeyNames;
} | java | public java.util.List<String> getContextKeyNames() {
if (contextKeyNames == null) {
contextKeyNames = new com.amazonaws.internal.SdkInternalList<String>();
}
return contextKeyNames;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
"getContextKeyNames",
"(",
")",
"{",
"if",
"(",
"contextKeyNames",
"==",
"null",
")",
"{",
"contextKeyNames",
"=",
"new",
"com",
".",
"amazonaws",
".",
"internal",
".",
"SdkInternalList",
"<",... | <p>
The list of context keys that are referenced in the input policies.
</p>
@return The list of context keys that are referenced in the input policies. | [
"<p",
">",
"The",
"list",
"of",
"context",
"keys",
"that",
"are",
"referenced",
"in",
"the",
"input",
"policies",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/model/GetContextKeysForCustomPolicyResult.java#L46-L51 | train | Gets the value of the contextKeyNames property. | Create a Java method that does the following: "Gets the value of the contextKeyNames property.". | Of course, here is the Java code you requested:
```java
public java.util.List<String> getContextKeyNames() {
if (contextKeyNames == null) {
contextKeyNames = new com.amazonaws.internal.SdkInternalList<String>();
}
return contextKeyNames;
}
```
Hope this helps! | |
chocoteam/choco-graph | src/main/java/org/chocosolver/graphsolver/cstrs/channeling/edges/PropNeighIntsChannel1.java | PropNeighIntsChannel1.propagate | @Override
public void propagate(int evtmask) throws ContradictionException {
for (int i = 0; i < n; i++) {
ISet tmp = g.getMandNeighOf(i);
for (int j : tmp) {
if (!succs[i].contains(j)) {
succs[j].instantiateTo(i, this);
} else if (!succs[j].contains(i)) {
succs[i].instantiateTo(j, this);
... | java | @Override
public void propagate(int evtmask) throws ContradictionException {
for (int i = 0; i < n; i++) {
ISet tmp = g.getMandNeighOf(i);
for (int j : tmp) {
if (!succs[i].contains(j)) {
succs[j].instantiateTo(i, this);
} else if (!succs[j].contains(i)) {
succs[i].instantiateTo(j, this);
... | [
"@",
"Override",
"public",
"void",
"propagate",
"(",
"int",
"evtmask",
")",
"throws",
"ContradictionException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"n",
";",
"i",
"++",
")",
"{",
"ISet",
"tmp",
"=",
"g",
".",
"getMandNeighOf",
"(",
... | *********************************************************************************** | [
"***********************************************************************************"
] | 0a03b0aafc86601977728c7e3fcb5ed376f1fae9 | https://github.com/chocoteam/choco-graph/blob/0a03b0aafc86601977728c7e3fcb5ed376f1fae9/src/main/java/org/chocosolver/graphsolver/cstrs/channeling/edges/PropNeighIntsChannel1.java#L70-L87 | train | Propagate the event to all other nodes. | Create a Java method that does the following: "Propagate the event to all other nodes.". | Of course, here is the Java code you requested:
```java
@Override
public void propagate(int evtmask) throws ContradictionException {
for (int i = 0; i < n; i++) {
ISet tmp = g.getMandNeighOf(i);
for (int j : tmp) {
if (!succs[i].contains(j)) {
succs[j].instantiateTo(i, this);
} else if (!succs[j]... | |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/features/ExampleFeatureSurf.java | ExampleFeatureSurf.harder | public static <II extends ImageGray<II>> void harder(GrayF32 image ) {
// SURF works off of integral images
Class<II> integralType = GIntegralImageOps.getIntegralType(GrayF32.class);
// define the feature detection algorithm
NonMaxSuppression extractor =
FactoryFeatureExtractor.nonmax(new ConfigExtract(2... | java | public static <II extends ImageGray<II>> void harder(GrayF32 image ) {
// SURF works off of integral images
Class<II> integralType = GIntegralImageOps.getIntegralType(GrayF32.class);
// define the feature detection algorithm
NonMaxSuppression extractor =
FactoryFeatureExtractor.nonmax(new ConfigExtract(2... | [
"public",
"static",
"<",
"II",
"extends",
"ImageGray",
"<",
"II",
">",
">",
"void",
"harder",
"(",
"GrayF32",
"image",
")",
"{",
"// SURF works off of integral images",
"Class",
"<",
"II",
">",
"integralType",
"=",
"GIntegralImageOps",
".",
"getIntegralType",
"(... | Configured exactly the same as the easy example above, but require a lot more code and a more in depth
understanding of how SURF works and is configured. Instead of TupleDesc_F64, SurfFeature are computed in
this case. They are almost the same as TupleDesc_F64, but contain the Laplacian's sign which can be used
to sp... | [
"Configured",
"exactly",
"the",
"same",
"as",
"the",
"easy",
"example",
"above",
"but",
"require",
"a",
"lot",
"more",
"code",
"and",
"a",
"more",
"in",
"depth",
"understanding",
"of",
"how",
"SURF",
"works",
"and",
"is",
"configured",
".",
"Instead",
"of"... | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleFeatureSurf.java#L79-L124 | train | Harder the image | Create a Java method that does the following: "Harder the image". | Of course, here is the Java code you requested:
```java
public static <II extends ImageGray<II>> void harder(GrayF32 image ) {
// SURF works off of integral images
Class<II> integralType = GIntegralImageOps.getIntegralType(GrayF32.class);
// define the feature detection algorithm
NonMaxSuppression extractor... | |
duracloud/duracloud | s3storageprovider/src/main/java/org/duracloud/s3storage/S3StorageProvider.java | S3StorageProvider.addContent | public String addContent(String spaceId,
String contentId,
String contentMimeType,
Map<String, String> userProperties,
long contentSize,
String contentChecksum,
... | java | public String addContent(String spaceId,
String contentId,
String contentMimeType,
Map<String, String> userProperties,
long contentSize,
String contentChecksum,
... | [
"public",
"String",
"addContent",
"(",
"String",
"spaceId",
",",
"String",
"contentId",
",",
"String",
"contentMimeType",
",",
"Map",
"<",
"String",
",",
"String",
">",
"userProperties",
",",
"long",
"contentSize",
",",
"String",
"contentChecksum",
",",
"InputSt... | {@inheritDoc} | [
"{"
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/s3storageprovider/src/main/java/org/duracloud/s3storage/S3StorageProvider.java#L561-L688 | train | Add a content to the object. | Create a Java method that does the following: "Add a content to the object.". | Of course, here is the Java code you requested:
```java
public String addContent(String spaceId,
String contentId,
String contentMimeType,
Map<String, String> userProperties,
long contentSize,
... | |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/SubstructureIdentifier.java | SubstructureIdentifier.copyLigandsByProximity | protected static void copyLigandsByProximity(Structure full, Structure reduced, double cutoff, int fromModel, int toModel) {
// Geometric hashing of the reduced structure
Grid grid = new Grid(cutoff);
Atom[] nonwaters = StructureTools.getAllNonHAtomArray(reduced,true,toModel);
if( nonwaters.length < 1 )
retu... | java | protected static void copyLigandsByProximity(Structure full, Structure reduced, double cutoff, int fromModel, int toModel) {
// Geometric hashing of the reduced structure
Grid grid = new Grid(cutoff);
Atom[] nonwaters = StructureTools.getAllNonHAtomArray(reduced,true,toModel);
if( nonwaters.length < 1 )
retu... | [
"protected",
"static",
"void",
"copyLigandsByProximity",
"(",
"Structure",
"full",
",",
"Structure",
"reduced",
",",
"double",
"cutoff",
",",
"int",
"fromModel",
",",
"int",
"toModel",
")",
"{",
"// Geometric hashing of the reduced structure",
"Grid",
"grid",
"=",
"... | Supplements the reduced structure with ligands from the full structure based on
a distance cutoff. Ligand groups are moved (destructively) from full to reduced
if they fall within the cutoff of any atom in the reduced structure.
@param full Structure containing all ligands
@param reduced Structure with a subset of the ... | [
"Supplements",
"the",
"reduced",
"structure",
"with",
"ligands",
"from",
"the",
"full",
"structure",
"based",
"on",
"a",
"distance",
"cutoff",
".",
"Ligand",
"groups",
"are",
"moved",
"(",
"destructively",
")",
"from",
"full",
"to",
"reduced",
"if",
"they",
... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/SubstructureIdentifier.java#L327-L362 | train | Copy all ligand groups from the full structure to the reduced structure by proximity | Create a Java method that does the following: "Copy all ligand groups from the full structure to the reduced structure by proximity". | Of course, here is the Java code you requested:
```java
protected static void copyLigandsByProximity(Structure full, Structure reduced, double cutoff, int fromModel, int toModel) {
// Geometric hashing of the reduced structure
Grid grid = new Grid(cutoff);
Atom[] nonwaters = StructureTools.getAllNonHAtomArray(re... | |
nominanuda/zen-project | zen-core/src/main/java/com/nominanuda/zen/common/DateTimeUtils.java | DateTimeUtils.toISO8601Date | public String toISO8601Date(long utcEpochMillis, @Nullable DateTimeZone dtz) {
return toISO8601Date(new DateTime(utcEpochMillis, dtz), dtz);
} | java | public String toISO8601Date(long utcEpochMillis, @Nullable DateTimeZone dtz) {
return toISO8601Date(new DateTime(utcEpochMillis, dtz), dtz);
} | [
"public",
"String",
"toISO8601Date",
"(",
"long",
"utcEpochMillis",
",",
"@",
"Nullable",
"DateTimeZone",
"dtz",
")",
"{",
"return",
"toISO8601Date",
"(",
"new",
"DateTime",
"(",
"utcEpochMillis",
",",
"dtz",
")",
",",
"dtz",
")",
";",
"}"
] | /* long -> ISO8601 | [
"/",
"*",
"long",
"-",
">",
"ISO8601"
] | fe48ae8da198eb7066c2b56bf2ffafe4cdfc451d | https://github.com/nominanuda/zen-project/blob/fe48ae8da198eb7066c2b56bf2ffafe4cdfc451d/zen-core/src/main/java/com/nominanuda/zen/common/DateTimeUtils.java#L155-L157 | train | Converts a long to an ISO 8601 date. | Create a Java method that does the following: "Converts a long to an ISO 8601 date.". | Of course, here is the Java code you requested:
```java
public String toISO8601Date(long utcEpochMillis, @Nullable DateTimeZone dtz) {
return toISO8601Date(new DateTime(utcEpochMillis, dtz), dtz);
}
```
Hope this helps! | |
citiususc/hipster | hipster-core/src/main/java/es/usc/citius/hipster/util/examples/maze/Maze2D.java | Maze2D.isFree | public boolean isFree(Point p) {
return FREE_TILES.contains(this.maze[p.y][p.x]);
} | java | public boolean isFree(Point p) {
return FREE_TILES.contains(this.maze[p.y][p.x]);
} | [
"public",
"boolean",
"isFree",
"(",
"Point",
"p",
")",
"{",
"return",
"FREE_TILES",
".",
"contains",
"(",
"this",
".",
"maze",
"[",
"p",
".",
"y",
"]",
"[",
"p",
".",
"x",
"]",
")",
";",
"}"
] | Check if the point {@code p} in the maze is empty or occupied.
@param p Point to check
@return True if is free, false if is not empty. | [
"Check",
"if",
"the",
"point",
"{",
"@code",
"p",
"}",
"in",
"the",
"maze",
"is",
"empty",
"or",
"occupied",
"."
] | 9ab1236abb833a27641ae73ba9ca890d5c17598e | https://github.com/citiususc/hipster/blob/9ab1236abb833a27641ae73ba9ca890d5c17598e/hipster-core/src/main/java/es/usc/citius/hipster/util/examples/maze/Maze2D.java#L226-L228 | train | Checks if the given point is free. | Create a Java method that does the following: "Checks if the given point is free.". | Of course, here is the Java code you requested:
```java
public boolean isFree(Point p) {
return FREE_TILES.contains(this.maze[p.y][p.x]);
}
```
Hope this helps! | |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/AfplibFactoryImpl.java | AfplibFactoryImpl.createCRCResourceManagementFmtQualFromString | public CRCResourceManagementFmtQual createCRCResourceManagementFmtQualFromString(EDataType eDataType, String initialValue) {
CRCResourceManagementFmtQual result = CRCResourceManagementFmtQual.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid e... | java | public CRCResourceManagementFmtQual createCRCResourceManagementFmtQualFromString(EDataType eDataType, String initialValue) {
CRCResourceManagementFmtQual result = CRCResourceManagementFmtQual.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid e... | [
"public",
"CRCResourceManagementFmtQual",
"createCRCResourceManagementFmtQualFromString",
"(",
"EDataType",
"eDataType",
",",
"String",
"initialValue",
")",
"{",
"CRCResourceManagementFmtQual",
"result",
"=",
"CRCResourceManagementFmtQual",
".",
"get",
"(",
"initialValue",
")",... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/AfplibFactoryImpl.java#L6128-L6132 | train | Create a CRCResourceManagementFmtQual value from a String. | Create a Java method that does the following: "Create a CRCResourceManagementFmtQual value from a String.". | Of course, here is the Java code you requested:
```java
public CRCResourceManagementFmtQual createCRCResourceManagementFmtQualFromString(EDataType eDataType, String initialValue) {
CRCResourceManagementFmtQual result = CRCResourceManagementFmtQual.get(initialValue);
if (result == null) throw new IllegalArgumentExc... | |
allure-framework/allure-java | allure-java-commons/src/main/java/io/qameta/allure/Allure.java | Allure.step | public static void step(final ThrowableContextRunnableVoid<StepContext> runnable) {
step(step -> {
runnable.run(step);
return null;
});
} | java | public static void step(final ThrowableContextRunnableVoid<StepContext> runnable) {
step(step -> {
runnable.run(step);
return null;
});
} | [
"public",
"static",
"void",
"step",
"(",
"final",
"ThrowableContextRunnableVoid",
"<",
"StepContext",
">",
"runnable",
")",
"{",
"step",
"(",
"step",
"->",
"{",
"runnable",
".",
"run",
"(",
"step",
")",
";",
"return",
"null",
";",
"}",
")",
";",
"}"
] | Syntax sugar for {@link #step(ThrowableContextRunnable)}.
@param runnable the step's body. | [
"Syntax",
"sugar",
"for",
"{",
"@link",
"#step",
"(",
"ThrowableContextRunnable",
")",
"}",
"."
] | 64015ca2b789aa6f7b19c793f1512e2f11d0174e | https://github.com/allure-framework/allure-java/blob/64015ca2b789aa6f7b19c793f1512e2f11d0174e/allure-java-commons/src/main/java/io/qameta/allure/Allure.java#L136-L141 | train | Step a RunnableVoid. | Create a Java method that does the following: "Step a RunnableVoid.". | Of course, here is the Java code you requested:
```java
public static void step(final ThrowableContextRunnableVoid<StepContext> runnable) {
step(step -> {
runnable.run(step);
return null;
});
}
```
Hope this helps! | |
JOML-CI/JOML | src/org/joml/Vector4i.java | Vector4i.sub | public Vector4i sub(int x, int y, int z, int w, Vector4i dest) {
dest.x = this.x - x;
dest.y = this.y - y;
dest.z = this.z - z;
dest.w = this.w - w;
return dest;
} | java | public Vector4i sub(int x, int y, int z, int w, Vector4i dest) {
dest.x = this.x - x;
dest.y = this.y - y;
dest.z = this.z - z;
dest.w = this.w - w;
return dest;
} | [
"public",
"Vector4i",
"sub",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"z",
",",
"int",
"w",
",",
"Vector4i",
"dest",
")",
"{",
"dest",
".",
"x",
"=",
"this",
".",
"x",
"-",
"x",
";",
"dest",
".",
"y",
"=",
"this",
".",
"y",
"-",
"y",
... | /* (non-Javadoc)
@see org.joml.Vector4ic#sub(int, int, int, int, org.joml.Vector4i) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | ce2652fc236b42bda3875c591f8e6645048a678f | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector4i.java#L604-L610 | train | Subtracts the specified vector from this vector. | Create a Java method that does the following: "Subtracts the specified vector from this vector.". | Of course, here is the Java code you requested:
```java
public Vector4i sub(int x, int y, int z, int w, Vector4i dest) {
dest.x = this.x - x;
dest.y = this.y - y;
dest.z = this.z - z;
dest.w = this.w - w;
return dest;
}
```
Hope this helps! | |
geomajas/geomajas-project-client-gwt2 | common-gwt/command/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java | GwtCommandDispatcher.setToken | private void setToken(String userToken, UserDetail userDetail, boolean loginPending) {
boolean changed = !isEqual(this.userToken, userToken);
this.userToken = userToken;
if (null == userDetail) {
userDetail = new UserDetail();
}
this.userDetail = userDetail;
if (changed) {
TokenChangedEvent event = ne... | java | private void setToken(String userToken, UserDetail userDetail, boolean loginPending) {
boolean changed = !isEqual(this.userToken, userToken);
this.userToken = userToken;
if (null == userDetail) {
userDetail = new UserDetail();
}
this.userDetail = userDetail;
if (changed) {
TokenChangedEvent event = ne... | [
"private",
"void",
"setToken",
"(",
"String",
"userToken",
",",
"UserDetail",
"userDetail",
",",
"boolean",
"loginPending",
")",
"{",
"boolean",
"changed",
"=",
"!",
"isEqual",
"(",
"this",
".",
"userToken",
",",
"userToken",
")",
";",
"this",
".",
"userToke... | Set the user token, so it can be sent in every command. This is the internal version, used by the token changed
handler.
@param userToken
user token
@param userDetail
user details
@param loginPending
true if this will be followed by a fresh token change | [
"Set",
"the",
"user",
"token",
"so",
"it",
"can",
"be",
"sent",
"in",
"every",
"command",
".",
"This",
"is",
"the",
"internal",
"version",
"used",
"by",
"the",
"token",
"changed",
"handler",
"."
] | bd8d7904e861fa80522eed7b83c4ea99844180c7 | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java#L455-L466 | train | Sets the token of the user. | Create a Java method that does the following: "Sets the token of the user.". | Of course, here is the Java code you requested:
```java
private void setToken(String userToken, UserDetail userDetail, boolean loginPending) {
boolean changed = !isEqual(this.userToken, userToken);
this.userToken = userToken;
if (null == userDetail) {
userDetail = new UserDetail();
}
this.userDetail = use... | |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateUniqueByScoreAlg.java | AssociateUniqueByScoreAlg.processSource | private void processSource(FastQueue<AssociatedIndex> matches, int numSource,
FastQueue<AssociatedIndex> output ) {
//set up data structures
scores.resize(numSource);
solutions.resize(numSource);
for( int i =0; i < numSource; i++ ) {
solutions.data[i] = -1;
}
// select best matches
for( int ... | java | private void processSource(FastQueue<AssociatedIndex> matches, int numSource,
FastQueue<AssociatedIndex> output ) {
//set up data structures
scores.resize(numSource);
solutions.resize(numSource);
for( int i =0; i < numSource; i++ ) {
solutions.data[i] = -1;
}
// select best matches
for( int ... | [
"private",
"void",
"processSource",
"(",
"FastQueue",
"<",
"AssociatedIndex",
">",
"matches",
",",
"int",
"numSource",
",",
"FastQueue",
"<",
"AssociatedIndex",
">",
"output",
")",
"{",
"//set up data structures",
"scores",
".",
"resize",
"(",
"numSource",
")",
... | Selects a subset of matches that have at most one association for each source feature. | [
"Selects",
"a",
"subset",
"of",
"matches",
"that",
"have",
"at",
"most",
"one",
"association",
"for",
"each",
"source",
"feature",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/associate/AssociateUniqueByScoreAlg.java#L94-L144 | train | Process the source of the match set. | Create a Java method that does the following: "Process the source of the match set.". | Of course, here is the Java code you requested:
```java
private void processSource(FastQueue<AssociatedIndex> matches, int numSource,
FastQueue<AssociatedIndex> output ) {
//set up data structures
scores.resize(numSource);
solutions.resize(numSource);
for( int i =0; i < numSource; i++ ) {
solution... | |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/compaction/CompactionManager.java | CompactionManager.doValidationCompaction | private void doValidationCompaction(ColumnFamilyStore cfs, Validator validator) throws IOException
{
// this isn't meant to be race-proof, because it's not -- it won't cause bugs for a CFS to be dropped
// mid-validation, or to attempt to validate a droped CFS. this is just a best effort to avoid u... | java | private void doValidationCompaction(ColumnFamilyStore cfs, Validator validator) throws IOException
{
// this isn't meant to be race-proof, because it's not -- it won't cause bugs for a CFS to be dropped
// mid-validation, or to attempt to validate a droped CFS. this is just a best effort to avoid u... | [
"private",
"void",
"doValidationCompaction",
"(",
"ColumnFamilyStore",
"cfs",
",",
"Validator",
"validator",
")",
"throws",
"IOException",
"{",
"// this isn't meant to be race-proof, because it's not -- it won't cause bugs for a CFS to be dropped",
"// mid-validation, or to attempt to va... | Performs a readonly "compaction" of all sstables in order to validate complete rows,
but without writing the merge result | [
"Performs",
"a",
"readonly",
"compaction",
"of",
"all",
"sstables",
"in",
"order",
"to",
"validate",
"complete",
"rows",
"but",
"without",
"writing",
"the",
"merge",
"result"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/compaction/CompactionManager.java#L922-L1037 | train | This method is called by the validationCompaction method to perform the actual validation of the CFS. | Create a Java method that does the following: "This method is called by the validationCompaction method to perform the actual validation of the CFS.". | Of course, here is the Java code you requested:
```java
private void doValidationCompaction(ColumnFamilyStore cfs, Validator validator) throws IOException
{
// this isn't meant to be race-proof, because it's not -- it won't cause bugs for a CFS to be dropped
// mid-validation, or to attempt to vali... | |
flipkart-incubator/zjsonpatch | src/main/java/com/flipkart/zjsonpatch/JsonDiff.java | JsonDiff.isAllowed | private static boolean isAllowed(JsonPointer source, JsonPointer destination) {
boolean isSame = source.equals(destination);
int i = 0;
int j = 0;
// Hack to fix broken COPY operation, need better handling here
while (i < source.size() && j < destination.size()) {
Jso... | java | private static boolean isAllowed(JsonPointer source, JsonPointer destination) {
boolean isSame = source.equals(destination);
int i = 0;
int j = 0;
// Hack to fix broken COPY operation, need better handling here
while (i < source.size() && j < destination.size()) {
Jso... | [
"private",
"static",
"boolean",
"isAllowed",
"(",
"JsonPointer",
"source",
",",
"JsonPointer",
"destination",
")",
"{",
"boolean",
"isSame",
"=",
"source",
".",
"equals",
"(",
"destination",
")",
";",
"int",
"i",
"=",
"0",
";",
"int",
"j",
"=",
"0",
";",... | TODO this is quite unclear and needs some serious documentation | [
"TODO",
"this",
"is",
"quite",
"unclear",
"and",
"needs",
"some",
"serious",
"documentation"
] | 797278e24d8a3fb0481f0aa581f08b66c010020f | https://github.com/flipkart-incubator/zjsonpatch/blob/797278e24d8a3fb0481f0aa581f08b66c010020f/src/main/java/com/flipkart/zjsonpatch/JsonDiff.java#L99-L120 | train | Check if two JsonPointer are allowed. | Create a Java method that does the following: "Check if two JsonPointer are allowed.". | Of course, here is the Java code you requested:
```java
private static boolean isAllowed(JsonPointer source, JsonPointer destination) {
boolean isSame = source.equals(destination);
int i = 0;
int j = 0;
// Hack to fix broken COPY operation, need better handling here
while (i < s... | |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/dbinfo/DatabaseInformationFull.java | DatabaseInformationFull.TABLE_CONSTRAINTS | Table TABLE_CONSTRAINTS() {
Table t = sysTables[TABLE_CONSTRAINTS];
if (t == null) {
t = createBlankTable(sysTableHsqlNames[TABLE_CONSTRAINTS]);
addColumn(t, "CONSTRAINT_CATALOG", SQL_IDENTIFIER);
addColumn(t, "CONSTRAINT_SCHEMA", SQL_IDENTIFIER);
addCo... | java | Table TABLE_CONSTRAINTS() {
Table t = sysTables[TABLE_CONSTRAINTS];
if (t == null) {
t = createBlankTable(sysTableHsqlNames[TABLE_CONSTRAINTS]);
addColumn(t, "CONSTRAINT_CATALOG", SQL_IDENTIFIER);
addColumn(t, "CONSTRAINT_SCHEMA", SQL_IDENTIFIER);
addCo... | [
"Table",
"TABLE_CONSTRAINTS",
"(",
")",
"{",
"Table",
"t",
"=",
"sysTables",
"[",
"TABLE_CONSTRAINTS",
"]",
";",
"if",
"(",
"t",
"==",
"null",
")",
"{",
"t",
"=",
"createBlankTable",
"(",
"sysTableHsqlNames",
"[",
"TABLE_CONSTRAINTS",
"]",
")",
";",
"addCo... | The TABLE_CONSTRAINTS table has one row for each table constraint
associated with a table. <p>
It effectively contains a representation of the table constraint
descriptors. <p>
<b>Definition:</b> <p>
<pre class="SqlCodeExample">
CREATE TABLE SYSTEM_TABLE_CONSTRAINTS (
CONSTRAINT_CATALOG VARCHAR NULL,
CONSTRAIN... | [
"The",
"TABLE_CONSTRAINTS",
"table",
"has",
"one",
"row",
"for",
"each",
"table",
"constraint",
"associated",
"with",
"a",
"table",
".",
"<p",
">"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/dbinfo/DatabaseInformationFull.java#L5113-L5232 | train | Table CONSTRAINTS | Create a Java method that does the following: "Table CONSTRAINTS". | Of course, here is the Java code you requested:
```java
Table TABLE_CONSTRAINTS() {
Table t = sysTables[TABLE_CONSTRAINTS];
if (t == null) {
t = createBlankTable(sysTableHsqlNames[TABLE_CONSTRAINTS]);
addColumn(t, "CONSTRAINT_CATALOG", SQL_IDENTIFIER);
addColumn(t... | |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java | InterconnectClient.deleteInterconnect | @BetaApi
public final Operation deleteInterconnect(String interconnect) {
DeleteInterconnectHttpRequest request =
DeleteInterconnectHttpRequest.newBuilder().setInterconnect(interconnect).build();
return deleteInterconnect(request);
} | java | @BetaApi
public final Operation deleteInterconnect(String interconnect) {
DeleteInterconnectHttpRequest request =
DeleteInterconnectHttpRequest.newBuilder().setInterconnect(interconnect).build();
return deleteInterconnect(request);
} | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"deleteInterconnect",
"(",
"String",
"interconnect",
")",
"{",
"DeleteInterconnectHttpRequest",
"request",
"=",
"DeleteInterconnectHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setInterconnect",
"(",
"interconnect",
")"... | Deletes the specified interconnect.
<p>Sample code:
<pre><code>
try (InterconnectClient interconnectClient = InterconnectClient.create()) {
ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
Operation response = interconnectClient.deleteInterconnect(interconn... | [
"Deletes",
"the",
"specified",
"interconnect",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java#L197-L203 | train | Deletes an interconnect. | Create a Java method that does the following: "Deletes an interconnect.". | Of course, here is the Java code you requested:
```java
@BetaApi
public final Operation deleteInterconnect(String interconnect) {
DeleteInterconnectHttpRequest request =
DeleteInterconnectHttpRequest.newBuilder().setInterconnect(interconnect).build();
return deleteInterconnect(request);
}
```
Hop... | |
opensourceBIM/BIMserver | PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/IfcPropertyEnumeratedValueImpl.java | IfcPropertyEnumeratedValueImpl.getEnumerationValues | @SuppressWarnings("unchecked")
public EList<IfcValue> getEnumerationValues() {
return (EList<IfcValue>) eGet(Ifc2x3tc1Package.Literals.IFC_PROPERTY_ENUMERATED_VALUE__ENUMERATION_VALUES,
true);
} | java | @SuppressWarnings("unchecked")
public EList<IfcValue> getEnumerationValues() {
return (EList<IfcValue>) eGet(Ifc2x3tc1Package.Literals.IFC_PROPERTY_ENUMERATED_VALUE__ENUMERATION_VALUES,
true);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"EList",
"<",
"IfcValue",
">",
"getEnumerationValues",
"(",
")",
"{",
"return",
"(",
"EList",
"<",
"IfcValue",
">",
")",
"eGet",
"(",
"Ifc2x3tc1Package",
".",
"Literals",
".",
"IFC_PROPERTY_ENUMERATED... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 116803c3047d1b32217366757cee1bb3880fda63 | https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/IfcPropertyEnumeratedValueImpl.java#L82-L86 | train | Gets the value of the enumeration values property. | Create a Java method that does the following: "Gets the value of the enumeration values property.". | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public EList<IfcValue> getEnumerationValues() {
return (EList<IfcValue>) eGet(Ifc2x3tc1Package.Literals.IFC_PROPERTY_ENUMERATED_VALUE__ENUMERATION_VALUES,
true);
}
```
Hope this helps! | |
aoindustries/aocode-public | src/main/java/com/aoindustries/net/UrlUtils.java | UrlUtils.encodeUrlPath | public static String encodeUrlPath(String href, String encoding) throws UnsupportedEncodingException {
if(href.startsWith("tel:")) return href.replace(' ', '-');
int len = href.length();
int pos = 0;
int stopAt;
{
int anchorAt = href.lastIndexOf('#');
int paramsAt = href.lastIndexOf('?', (anchorAt==-1 ?... | java | public static String encodeUrlPath(String href, String encoding) throws UnsupportedEncodingException {
if(href.startsWith("tel:")) return href.replace(' ', '-');
int len = href.length();
int pos = 0;
int stopAt;
{
int anchorAt = href.lastIndexOf('#');
int paramsAt = href.lastIndexOf('?', (anchorAt==-1 ?... | [
"public",
"static",
"String",
"encodeUrlPath",
"(",
"String",
"href",
",",
"String",
"encoding",
")",
"throws",
"UnsupportedEncodingException",
"{",
"if",
"(",
"href",
".",
"startsWith",
"(",
"\"tel:\"",
")",
")",
"return",
"href",
".",
"replace",
"(",
"'",
... | Encodes the URL up to trailing '?' or '#' (the first found of the two).
To avoid ambiguity, parameters and anchors must have been correctly encoded by the caller.
Does not encode any characters in the set { '?', ':', '/', ';', '#', '+' }.
Encodes tel: (case-sensitive) urls by relacing spaces with hyphens.
@see #deco... | [
"Encodes",
"the",
"URL",
"up",
"to",
"trailing",
"?",
"or",
"#",
"(",
"the",
"first",
"found",
"of",
"the",
"two",
")",
".",
"To",
"avoid",
"ambiguity",
"parameters",
"and",
"anchors",
"must",
"have",
"been",
"correctly",
"encoded",
"by",
"the",
"caller"... | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/net/UrlUtils.java#L63-L95 | train | Encode a URL path. | Create a Java method that does the following: "Encode a URL path.". | Of course, here is the Java code you requested:
```java
public static String encodeUrlPath(String href, String encoding) throws UnsupportedEncodingException {
if(href.startsWith("tel:")) return href.replace(' ', '-');
int len = href.length();
int pos = 0;
int stopAt;
{
int anchorAt = href.lastIndexOf('#')... | |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/ProductReservationUrl.java | ProductReservationUrl.deleteProductReservationUrl | public static MozuUrl deleteProductReservationUrl(Integer productReservationId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/productreservations/{productReservationId}");
formatter.formatUrl("productReservationId", productReservationId);
return new MozuUrl(formatter.getResourceUrl... | java | public static MozuUrl deleteProductReservationUrl(Integer productReservationId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/productreservations/{productReservationId}");
formatter.formatUrl("productReservationId", productReservationId);
return new MozuUrl(formatter.getResourceUrl... | [
"public",
"static",
"MozuUrl",
"deleteProductReservationUrl",
"(",
"Integer",
"productReservationId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/productreservations/{productReservationId}\"",
")",
";",
"formatter",
"."... | Get Resource Url for DeleteProductReservation
@param productReservationId Unique identifier of the product reservation.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"DeleteProductReservation"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/ProductReservationUrl.java#L89-L94 | train | Get Resource Url for DeleteProductReservation | Create a Java method that does the following: "Get Resource Url for DeleteProductReservation". | Of course, here is the Java code you requested:
```java
public static MozuUrl deleteProductReservationUrl(Integer productReservationId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/productreservations/{productReservationId}");
formatter.formatUrl("productReservationId", productReser... | |
alkacon/opencms-core | src/org/opencms/widgets/CmsCategoryWidget.java | CmsCategoryWidget.getResource | protected CmsResource getResource(CmsObject cms, I_CmsWidgetParameter param) {
I_CmsXmlContentValue value = (I_CmsXmlContentValue)param;
CmsFile file = value.getDocument().getFile();
String resourceName = cms.getSitePath(file);
if (CmsWorkplace.isTemporaryFile(file)) {
Strin... | java | protected CmsResource getResource(CmsObject cms, I_CmsWidgetParameter param) {
I_CmsXmlContentValue value = (I_CmsXmlContentValue)param;
CmsFile file = value.getDocument().getFile();
String resourceName = cms.getSitePath(file);
if (CmsWorkplace.isTemporaryFile(file)) {
Strin... | [
"protected",
"CmsResource",
"getResource",
"(",
"CmsObject",
"cms",
",",
"I_CmsWidgetParameter",
"param",
")",
"{",
"I_CmsXmlContentValue",
"value",
"=",
"(",
"I_CmsXmlContentValue",
")",
"param",
";",
"CmsFile",
"file",
"=",
"value",
".",
"getDocument",
"(",
")",... | Returns the right resource, depending on the locale.<p>
@param cms the cms context
@param param the widget parameter
@return the resource to get/set the categories for | [
"Returns",
"the",
"right",
"resource",
"depending",
"on",
"the",
"locale",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/CmsCategoryWidget.java#L603-L636 | train | Gets the resource. | Create a Java method that does the following: "Gets the resource.". | Of course, here is the Java code you requested:
```java
protected CmsResource getResource(CmsObject cms, I_CmsWidgetParameter param) {
I_CmsXmlContentValue value = (I_CmsXmlContentValue)param;
CmsFile file = value.getDocument().getFile();
String resourceName = cms.getSitePath(file);
if... | |
jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/streaming/IcyInputStream.java | IcyInputStream.readMetadata | protected void readMetadata() throws IOException
{
int blockCount = super.read();
// System.out.println ("blocks to read: " + blockCount);
int byteCount = (blockCount * 16); // 16 bytes per block
if (byteCount <= 0) return; // WTF?!
byte[] metadataBlock = new byte[byteCount];
int index = 0;
// build an a... | java | protected void readMetadata() throws IOException
{
int blockCount = super.read();
// System.out.println ("blocks to read: " + blockCount);
int byteCount = (blockCount * 16); // 16 bytes per block
if (byteCount <= 0) return; // WTF?!
byte[] metadataBlock = new byte[byteCount];
int index = 0;
// build an a... | [
"protected",
"void",
"readMetadata",
"(",
")",
"throws",
"IOException",
"{",
"int",
"blockCount",
"=",
"super",
".",
"read",
"(",
")",
";",
"// System.out.println (\"blocks to read: \" + blockCount);",
"int",
"byteCount",
"=",
"(",
"blockCount",
"*",
"16",
")",
";... | Read the next segment of metadata. The stream <b>must</b>
be right on the segment, ie, the next byte to read is
the metadata block count. The metadata is parsed and
new tags are added with addTag(), which fires events | [
"Read",
"the",
"next",
"segment",
"of",
"metadata",
".",
"The",
"stream",
"<b",
">",
"must<",
"/",
"b",
">",
"be",
"right",
"on",
"the",
"segment",
"ie",
"the",
"next",
"byte",
"to",
"read",
"is",
"the",
"metadata",
"block",
"count",
".",
"The",
"met... | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/streaming/IcyInputStream.java#L289-L306 | train | Read the metadata. | Create a Java method that does the following: "Read the metadata.". | Of course, here is the Java code you requested:
```java
protected void readMetadata() throws IOException
{
int blockCount = super.read();
// System.out.println ("blocks to read: " + blockCount);
int byteCount = (blockCount * 16); // 16 bytes per block
if (byteCount <= 0) return; // WTF?!
byte[] metadataBloc... | |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/gff3/writer/GFF3EntryWriter.java | GFF3EntryWriter.write | public void write(Writer writer) throws IOException {
GFF3Writer.writeVersionPragma(writer);
GFF3Writer.writeRegionPragma(writer, entry.getPrimaryAccession(),
windowBeginPosition, windowEndPosition);
int ID = 0;
if (show.contains(SHOW_GENE)) {
locusTagGeneMap = new HashMap<String, GFF3Gene>();
... | java | public void write(Writer writer) throws IOException {
GFF3Writer.writeVersionPragma(writer);
GFF3Writer.writeRegionPragma(writer, entry.getPrimaryAccession(),
windowBeginPosition, windowEndPosition);
int ID = 0;
if (show.contains(SHOW_GENE)) {
locusTagGeneMap = new HashMap<String, GFF3Gene>();
... | [
"public",
"void",
"write",
"(",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"GFF3Writer",
".",
"writeVersionPragma",
"(",
"writer",
")",
";",
"GFF3Writer",
".",
"writeRegionPragma",
"(",
"writer",
",",
"entry",
".",
"getPrimaryAccession",
"(",
")",
... | Writes the GFF3 file.
@param writer the output stream.
@throws IOException is there was an error in writing
to the output stream. | [
"Writes",
"the",
"GFF3",
"file",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/gff3/writer/GFF3EntryWriter.java#L71-L123 | train | Write the contents of this entry to the specified writer. | Create a Java method that does the following: "Write the contents of this entry to the specified writer.". | Of course, here is the Java code you requested:
```java
public void write(Writer writer) throws IOException {
GFF3Writer.writeVersionPragma(writer);
GFF3Writer.writeRegionPragma(writer, entry.getPrimaryAccession(),
windowBeginPosition, windowEndPosition);
int ID = 0;
if (show.contains(SHOW_GENE)) {... | |
joniles/mpxj | src/main/java/net/sf/mpxj/Duration.java | Duration.getInstance | public static Duration getInstance(double duration, TimeUnit type)
{
Duration result;
if (duration == 0)
{
result = ZERO_DURATIONS[type.getValue()];
}
else
{
result = new Duration(duration, type);
}
return (result);
} | java | public static Duration getInstance(double duration, TimeUnit type)
{
Duration result;
if (duration == 0)
{
result = ZERO_DURATIONS[type.getValue()];
}
else
{
result = new Duration(duration, type);
}
return (result);
} | [
"public",
"static",
"Duration",
"getInstance",
"(",
"double",
"duration",
",",
"TimeUnit",
"type",
")",
"{",
"Duration",
"result",
";",
"if",
"(",
"duration",
"==",
"0",
")",
"{",
"result",
"=",
"ZERO_DURATIONS",
"[",
"type",
".",
"getValue",
"(",
")",
"... | Retrieve an Duration instance. Use shared objects to
represent common values for memory efficiency.
@param duration duration value
@param type duration type
@return Duration instance | [
"Retrieve",
"an",
"Duration",
"instance",
".",
"Use",
"shared",
"objects",
"to",
"represent",
"common",
"values",
"for",
"memory",
"efficiency",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Duration.java#L298-L310 | train | Get a Duration object from a double value and TimeUnit. | Create a Java method that does the following: "Get a Duration object from a double value and TimeUnit.". | Of course, here is the Java code you requested:
```java
public static Duration getInstance(double duration, TimeUnit type)
{
Duration result;
if (duration == 0)
{
result = ZERO_DURATIONS[type.getValue()];
}
else
{
result = new Duration(duration, type);
}
... | |
hugegraph/hugegraph-common | src/main/java/com/baidu/hugegraph/util/NumericUtil.java | NumericUtil.compareNumber | @SuppressWarnings("unchecked")
public static int compareNumber(Object first, Number second) {
if (first instanceof Number && first instanceof Comparable &&
first.getClass().equals(second.getClass())) {
return ((Comparable<Number>) first).compareTo(second);
}
Function... | java | @SuppressWarnings("unchecked")
public static int compareNumber(Object first, Number second) {
if (first instanceof Number && first instanceof Comparable &&
first.getClass().equals(second.getClass())) {
return ((Comparable<Number>) first).compareTo(second);
}
Function... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"int",
"compareNumber",
"(",
"Object",
"first",
",",
"Number",
"second",
")",
"{",
"if",
"(",
"first",
"instanceof",
"Number",
"&&",
"first",
"instanceof",
"Comparable",
"&&",
"first",
"."... | Compare object with a number, the object should be a number,
or it can be converted to a BigDecimal
@param first might be number or string
@param second must be number
@return 0 if first is numerically equal to second;
a negative int if first is numerically less than second;
a positive int if first is numerically g... | [
"Compare",
"object",
"with",
"a",
"number",
"the",
"object",
"should",
"be",
"a",
"number",
"or",
"it",
"can",
"be",
"converted",
"to",
"a",
"BigDecimal"
] | 1eb2414134b639a13f68ca352c1b3eb2d956e7b2 | https://github.com/hugegraph/hugegraph-common/blob/1eb2414134b639a13f68ca352c1b3eb2d956e7b2/src/main/java/com/baidu/hugegraph/util/NumericUtil.java#L255-L265 | train | Compare two Number objects. | Create a Java method that does the following: "Compare two Number objects.". | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public static int compareNumber(Object first, Number second) {
if (first instanceof Number && first instanceof Comparable &&
first.getClass().equals(second.getClass())) {
return ((Comparable<Numbe... | |
aws/aws-sdk-java | aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/transform/CreatePresignedNotebookInstanceUrlRequestMarshaller.java | CreatePresignedNotebookInstanceUrlRequestMarshaller.marshall | public void marshall(CreatePresignedNotebookInstanceUrlRequest createPresignedNotebookInstanceUrlRequest, ProtocolMarshaller protocolMarshaller) {
if (createPresignedNotebookInstanceUrlRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
tr... | java | public void marshall(CreatePresignedNotebookInstanceUrlRequest createPresignedNotebookInstanceUrlRequest, ProtocolMarshaller protocolMarshaller) {
if (createPresignedNotebookInstanceUrlRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
tr... | [
"public",
"void",
"marshall",
"(",
"CreatePresignedNotebookInstanceUrlRequest",
"createPresignedNotebookInstanceUrlRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"createPresignedNotebookInstanceUrlRequest",
"==",
"null",
")",
"{",
"throw",
"new"... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/transform/CreatePresignedNotebookInstanceUrlRequestMarshaller.java#L44-L57 | train | marshalls the given CreatePresignedNotebookInstanceUrlRequest to the given protocolMarshaller. | Create a Java method that does the following: "marshalls the given CreatePresignedNotebookInstanceUrlRequest to the given protocolMarshaller.". | Of course, here is the Java code you requested:
```java
public void marshall(CreatePresignedNotebookInstanceUrlRequest createPresignedNotebookInstanceUrlRequest, ProtocolMarshaller protocolMarshaller) {
if (createPresignedNotebookInstanceUrlRequest == null) {
throw new SdkClientException("Invalid ... | |
tstirrat/ucm-twine | src/main/java/org/ucmtwine/parameter/ParameterMarshaller.java | ParameterMarshaller.getValueArray | public Object[] getValueArray(Workspace ws, DataBinder binder, ExecutionContext ctx) {
Object[] paramArray = new Object[this.parameters.size()];
for (int i = 0; i < this.parameters.size(); i++) {
// inject params if needed
IParameter p = this.parameters.get(i);
try {
if (p.getType(... | java | public Object[] getValueArray(Workspace ws, DataBinder binder, ExecutionContext ctx) {
Object[] paramArray = new Object[this.parameters.size()];
for (int i = 0; i < this.parameters.size(); i++) {
// inject params if needed
IParameter p = this.parameters.get(i);
try {
if (p.getType(... | [
"public",
"Object",
"[",
"]",
"getValueArray",
"(",
"Workspace",
"ws",
",",
"DataBinder",
"binder",
",",
"ExecutionContext",
"ctx",
")",
"{",
"Object",
"[",
"]",
"paramArray",
"=",
"new",
"Object",
"[",
"this",
".",
"parameters",
".",
"size",
"(",
")",
"... | Returns an array of values given a filter execution context
@param ws
The system workspace
@param binder
The current binder
@param ctx
The current execution context
@return | [
"Returns",
"an",
"array",
"of",
"values",
"given",
"a",
"filter",
"execution",
"context"
] | df53650f26c404c8de74ae06efa70c963933d4e9 | https://github.com/tstirrat/ucm-twine/blob/df53650f26c404c8de74ae06efa70c963933d4e9/src/main/java/org/ucmtwine/parameter/ParameterMarshaller.java#L218-L248 | valid | Get the value array for this parameter. | Create a Java method that does the following: "Get the value array for this parameter.". | Of course, here is the Java code you requested:
```java
public Object[] getValueArray(Workspace ws, DataBinder binder, ExecutionContext ctx) {
Object[] paramArray = new Object[this.parameters.size()];
for (int i = 0; i < this.parameters.size(); i++) {
// inject params if needed
IParameter p = thi... | |
fabric8io/fabric8-forge | addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelXmlHelper.java | CamelXmlHelper.collapseNode | private static String collapseNode(String xml, String name) {
String answer = xml;
Pattern pattern = Pattern.compile("<" + name + "(.*)></" + name + ">");
Matcher matcher = pattern.matcher(answer);
if (matcher.find()) {
answer = matcher.replaceAll("<" + name + "$1/>");
... | java | private static String collapseNode(String xml, String name) {
String answer = xml;
Pattern pattern = Pattern.compile("<" + name + "(.*)></" + name + ">");
Matcher matcher = pattern.matcher(answer);
if (matcher.find()) {
answer = matcher.replaceAll("<" + name + "$1/>");
... | [
"private",
"static",
"String",
"collapseNode",
"(",
"String",
"xml",
",",
"String",
"name",
")",
"{",
"String",
"answer",
"=",
"xml",
";",
"Pattern",
"pattern",
"=",
"Pattern",
".",
"compile",
"(",
"\"<\"",
"+",
"name",
"+",
"\"(.*)></\"",
"+",
"name",
"... | Collapses all the named node in the XML
@param xml the XML
@param name the name of the node
@return the XML with collapsed nodes | [
"Collapses",
"all",
"the",
"named",
"node",
"in",
"the",
"XML"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelXmlHelper.java#L484-L493 | train | Collapse a single XML node with a single name. | Create a Java method that does the following: "Collapse a single XML node with a single name.". | Of course, here is the Java code you requested:
```java
private static String collapseNode(String xml, String name) {
String answer = xml;
Pattern pattern = Pattern.compile("<" + name + "(.*)></" + name + ">");
Matcher matcher = pattern.matcher(answer);
if (matcher.find()) {
... | |
reactor/reactor-netty | src/main/java/reactor/netty/tcp/TcpClient.java | TcpClient.resolver | public final TcpClient resolver(AddressResolverGroup<?> resolver) {
Objects.requireNonNull(resolver, "resolver");
return bootstrap(b -> b.resolver(resolver));
} | java | public final TcpClient resolver(AddressResolverGroup<?> resolver) {
Objects.requireNonNull(resolver, "resolver");
return bootstrap(b -> b.resolver(resolver));
} | [
"public",
"final",
"TcpClient",
"resolver",
"(",
"AddressResolverGroup",
"<",
"?",
">",
"resolver",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"resolver",
",",
"\"resolver\"",
")",
";",
"return",
"bootstrap",
"(",
"b",
"->",
"b",
".",
"resolver",
"(",
... | Assign an {@link AddressResolverGroup}.
@param resolver the new {@link AddressResolverGroup}
@return a new {@link TcpClient} | [
"Assign",
"an",
"{",
"@link",
"AddressResolverGroup",
"}",
"."
] | 4ed14316e1d7fca3cecd18d6caa5f2251e159e49 | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/tcp/TcpClient.java#L425-L428 | train | Sets the address resolver group. | Create a Java method that does the following: "Sets the address resolver group.". | Of course, here is the Java code you requested:
```java
public final TcpClient resolver(AddressResolverGroup<?> resolver) {
Objects.requireNonNull(resolver, "resolver");
return bootstrap(b -> b.resolver(resolver));
}
```
Hope this helps! | |
b3log/latke | latke-core/src/main/java/org/b3log/latke/plugin/AbstractPlugin.java | AbstractPlugin.plug | public void plug(final Map<String, Object> dataModel, final RequestContext context) {
String content = (String) dataModel.get(Plugin.PLUGINS);
if (null == content) {
dataModel.put(Plugin.PLUGINS, "");
}
handleLangs(dataModel);
fillDefault(dataModel);
postPl... | java | public void plug(final Map<String, Object> dataModel, final RequestContext context) {
String content = (String) dataModel.get(Plugin.PLUGINS);
if (null == content) {
dataModel.put(Plugin.PLUGINS, "");
}
handleLangs(dataModel);
fillDefault(dataModel);
postPl... | [
"public",
"void",
"plug",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"dataModel",
",",
"final",
"RequestContext",
"context",
")",
"{",
"String",
"content",
"=",
"(",
"String",
")",
"dataModel",
".",
"get",
"(",
"Plugin",
".",
"PLUGINS",
")",... | Plugs with the specified data model and the args from request.
@param dataModel dataModel
@param context context | [
"Plugs",
"with",
"the",
"specified",
"data",
"model",
"and",
"the",
"args",
"from",
"request",
"."
] | f7e08a47eeecea5f7c94006382c24f353585de33 | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/plugin/AbstractPlugin.java#L271-L294 | train | PlPlug the data model with the context. | Create a Java method that does the following: "PlPlug the data model with the context.". | Of course, here is the Java code you requested:
```java
public void plug(final Map<String, Object> dataModel, final RequestContext context) {
String content = (String) dataModel.get(Plugin.PLUGINS);
if (null == content) {
dataModel.put(Plugin.PLUGINS, "");
}
handleLangs(da... | |
dropwizard/dropwizard-elasticsearch | src/main/java/io/dropwizard/elasticsearch/health/EsIndexExistsHealthCheck.java | EsIndexExistsHealthCheck.check | @Override
protected Result check() throws Exception {
final IndicesExistsResponse indicesExistsResponse = client.admin().indices().prepareExists(indices).get();
if (indicesExistsResponse.isExists()) {
return Result.healthy();
} else {
return Result.unhealthy("One or ... | java | @Override
protected Result check() throws Exception {
final IndicesExistsResponse indicesExistsResponse = client.admin().indices().prepareExists(indices).get();
if (indicesExistsResponse.isExists()) {
return Result.healthy();
} else {
return Result.unhealthy("One or ... | [
"@",
"Override",
"protected",
"Result",
"check",
"(",
")",
"throws",
"Exception",
"{",
"final",
"IndicesExistsResponse",
"indicesExistsResponse",
"=",
"client",
".",
"admin",
"(",
")",
".",
"indices",
"(",
")",
".",
"prepareExists",
"(",
"indices",
")",
".",
... | Perform a check of the number of documents in the Elasticsearch indices.
@return if the Elasticsearch indices exist, a healthy {@link com.codahale.metrics.health.HealthCheck.Result};
otherwise, an unhealthy {@link com.codahale.metrics.health.HealthCheck.Result} with a descriptive error
message or exception
@throws Exc... | [
"Perform",
"a",
"check",
"of",
"the",
"number",
"of",
"documents",
"in",
"the",
"Elasticsearch",
"indices",
"."
] | 9f08953ab53ebda0b81306dadabb7b71b7f87970 | https://github.com/dropwizard/dropwizard-elasticsearch/blob/9f08953ab53ebda0b81306dadabb7b71b7f87970/src/main/java/io/dropwizard/elasticsearch/health/EsIndexExistsHealthCheck.java#L55-L64 | train | Check if the system is healthy. | Create a Java method that does the following: "Check if the system is healthy.". | Of course, here is the Java code you requested:
```java
@Override
protected Result check() throws Exception {
final IndicesExistsResponse indicesExistsResponse = client.admin().indices().prepareExists(indices).get();
if (indicesExistsResponse.isExists()) {
return Result.healthy();
... | |
VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java | TemplateParserContext.addImport | public void addImport(String fullyQualifiedName) {
String[] importSplit = fullyQualifiedName.split("\\.");
String className = importSplit[importSplit.length - 1];
classNameToFullyQualifiedName.put(className, fullyQualifiedName);
} | java | public void addImport(String fullyQualifiedName) {
String[] importSplit = fullyQualifiedName.split("\\.");
String className = importSplit[importSplit.length - 1];
classNameToFullyQualifiedName.put(className, fullyQualifiedName);
} | [
"public",
"void",
"addImport",
"(",
"String",
"fullyQualifiedName",
")",
"{",
"String",
"[",
"]",
"importSplit",
"=",
"fullyQualifiedName",
".",
"split",
"(",
"\"\\\\.\"",
")",
";",
"String",
"className",
"=",
"importSplit",
"[",
"importSplit",
".",
"length",
... | Add a Java Import to the context.
@param fullyQualifiedName The fully qualified name of the class to import | [
"Add",
"a",
"Java",
"Import",
"to",
"the",
"context",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java#L193-L198 | train | Add an import to the class to be imported. | Create a Java method that does the following: "Add an import to the class to be imported.". | Of course, here is the Java code you requested:
```java
public void addImport(String fullyQualifiedName) {
String[] importSplit = fullyQualifiedName.split("\\.");
String className = importSplit[importSplit.length - 1];
classNameToFullyQualifiedName.put(className, fullyQualifiedName);
}
```
Hope this he... | |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/registry/ProducerRegistryAPIImpl.java | ProducerRegistryAPIImpl.rebuildProducerCache | private void rebuildProducerCache(Collection<IStatsProducer> producers){
log.debug("Rebuilding producer cache with "+producers.size()+" producers.");
log.debug("Following producers known: "+producers);
synchronized(cacheLock){
//lets create lists with more place to store as actually need, we will probab... | java | private void rebuildProducerCache(Collection<IStatsProducer> producers){
log.debug("Rebuilding producer cache with "+producers.size()+" producers.");
log.debug("Following producers known: "+producers);
synchronized(cacheLock){
//lets create lists with more place to store as actually need, we will probab... | [
"private",
"void",
"rebuildProducerCache",
"(",
"Collection",
"<",
"IStatsProducer",
">",
"producers",
")",
"{",
"log",
".",
"debug",
"(",
"\"Rebuilding producer cache with \"",
"+",
"producers",
".",
"size",
"(",
")",
"+",
"\" producers.\"",
")",
";",
"log",
".... | Rebuilds the caches with given producers.. | [
"Rebuilds",
"the",
"caches",
"with",
"given",
"producers",
".."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/registry/ProducerRegistryAPIImpl.java#L129-L154 | train | Rebuild the cache with the given collection of producers. | Create a Java method that does the following: "Rebuild the cache with the given collection of producers.". | Of course, here is the Java code you requested:
```java
private void rebuildProducerCache(Collection<IStatsProducer> producers){
log.debug("Rebuilding producer cache with "+producers.size()+" producers.");
log.debug("Following producers known: "+producers);
synchronized(cacheLock){
//lets create lists ... | |
oblac/jodd | jodd-madvoc/src/main/java/jodd/madvoc/component/ScopeDataInspector.java | ScopeDataInspector.inspectMethodParameterScopes | public ScopeData inspectMethodParameterScopes(final String name, final Class type, final Annotation[] annotations) {
In in = null;
Out out = null;
for (final Annotation annotation : annotations) {
if (annotation instanceof In) {
in = (In) annotation;
} else if (annotation instanceof Out) {
out = (O... | java | public ScopeData inspectMethodParameterScopes(final String name, final Class type, final Annotation[] annotations) {
In in = null;
Out out = null;
for (final Annotation annotation : annotations) {
if (annotation instanceof In) {
in = (In) annotation;
} else if (annotation instanceof Out) {
out = (O... | [
"public",
"ScopeData",
"inspectMethodParameterScopes",
"(",
"final",
"String",
"name",
",",
"final",
"Class",
"type",
",",
"final",
"Annotation",
"[",
"]",
"annotations",
")",
"{",
"In",
"in",
"=",
"null",
";",
"Out",
"out",
"=",
"null",
";",
"for",
"(",
... | Inspects {@link ScopeData} parameters for given method parameter information. | [
"Inspects",
"{"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/component/ScopeDataInspector.java#L84-L124 | test | Inspect method parameter scopes. | Create a Java method that does the following: "Inspect method parameter scopes.". | Of course, here is the Java code you requested:
```java
public ScopeData inspectMethodParameterScopes(final String name, final Class type, final Annotation[] annotations) {
In in = null;
Out out = null;
for (final Annotation annotation : annotations) {
if (annotation instanceof In) {
in = (In) annotation... | |
hawkular/hawkular-apm | client/collector/src/main/java/org/hawkular/apm/client/collector/internal/FragmentBuilder.java | FragmentBuilder.addUncompletedCorrelationId | public void addUncompletedCorrelationId(String id, Node node, int position) {
NodePlaceholder placeholder = new NodePlaceholder();
placeholder.setNode(node);
placeholder.setPosition(position);
uncompletedCorrelationIdsNodeMap.put(id, placeholder);
} | java | public void addUncompletedCorrelationId(String id, Node node, int position) {
NodePlaceholder placeholder = new NodePlaceholder();
placeholder.setNode(node);
placeholder.setPosition(position);
uncompletedCorrelationIdsNodeMap.put(id, placeholder);
} | [
"public",
"void",
"addUncompletedCorrelationId",
"(",
"String",
"id",
",",
"Node",
"node",
",",
"int",
"position",
")",
"{",
"NodePlaceholder",
"placeholder",
"=",
"new",
"NodePlaceholder",
"(",
")",
";",
"placeholder",
".",
"setNode",
"(",
"node",
")",
";",
... | This method associates a parent node and child position with a
correlation id.
@param id The correlation id
@param node The parent node
@param position The child node position within the parent node | [
"This",
"method",
"associates",
"a",
"parent",
"node",
"and",
"child",
"position",
"with",
"a",
"correlation",
"id",
"."
] | 57a4df0611b359597626563ea5f9ac64d4bb2533 | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/client/collector/src/main/java/org/hawkular/apm/client/collector/internal/FragmentBuilder.java#L406-L411 | train | Add an unconditional correlation id to the unconditional correlation ids map. | Create a Java method that does the following: "Add an unconditional correlation id to the unconditional correlation ids map.". | Of course, here is the Java code you requested:
```java
public void addUncompletedCorrelationId(String id, Node node, int position) {
NodePlaceholder placeholder = new NodePlaceholder();
placeholder.setNode(node);
placeholder.setPosition(position);
uncompletedCorrelationIdsNodeMap.put(i... | |
streamsets/datacollector | bootstrap/src/main/java/com/streamsets/pipeline/ApplicationPackage.java | ApplicationPackage.findApplicationPackageNames | private static SortedSet<String> findApplicationPackageNames(ClassLoader cl) {
SortedSet<String> packages = new TreeSet<>();
while (cl != null) {
if (cl instanceof URLClassLoader) {
for (URL url : ((URLClassLoader)cl).getURLs()) {
String path = url.getPath();
if (!path.startsWi... | java | private static SortedSet<String> findApplicationPackageNames(ClassLoader cl) {
SortedSet<String> packages = new TreeSet<>();
while (cl != null) {
if (cl instanceof URLClassLoader) {
for (URL url : ((URLClassLoader)cl).getURLs()) {
String path = url.getPath();
if (!path.startsWi... | [
"private",
"static",
"SortedSet",
"<",
"String",
">",
"findApplicationPackageNames",
"(",
"ClassLoader",
"cl",
")",
"{",
"SortedSet",
"<",
"String",
">",
"packages",
"=",
"new",
"TreeSet",
"<>",
"(",
")",
";",
"while",
"(",
"cl",
"!=",
"null",
")",
"{",
... | Finds package names associated with a class loader which which are not JVM level
packages. Anything inside java home are specifically excluded as well as some
OS specific install locations (MacOS). | [
"Finds",
"package",
"names",
"associated",
"with",
"a",
"class",
"loader",
"which",
"which",
"are",
"not",
"JVM",
"level",
"packages",
".",
"Anything",
"inside",
"java",
"home",
"are",
"specifically",
"excluded",
"as",
"well",
"as",
"some",
"OS",
"specific",
... | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/bootstrap/src/main/java/com/streamsets/pipeline/ApplicationPackage.java#L134-L180 | test | Find the application package names from the given class loader. | Create a Java method that does the following: "Find the application package names from the given class loader.". | Of course, here is the Java code you requested:
```java
private static SortedSet<String> findApplicationPackageNames(ClassLoader cl) {
SortedSet<String> packages = new TreeSet<>();
while (cl != null) {
if (cl instanceof URLClassLoader) {
for (URL url : ((URLClassLoader)cl).getURLs()) {
... | |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/filter/filteraction.java | filteraction.update | public static base_responses update(nitro_service client, filteraction resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
filteraction updateresources[] = new filteraction[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i... | java | public static base_responses update(nitro_service client, filteraction resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
filteraction updateresources[] = new filteraction[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i... | [
"public",
"static",
"base_responses",
"update",
"(",
"nitro_service",
"client",
",",
"filteraction",
"resources",
"[",
"]",
")",
"throws",
"Exception",
"{",
"base_responses",
"result",
"=",
"null",
";",
"if",
"(",
"resources",
"!=",
"null",
"&&",
"resources",
... | Use this API to update filteraction resources. | [
"Use",
"this",
"API",
"to",
"update",
"filteraction",
"resources",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/filter/filteraction.java#L334-L349 | train | Use this API to update filteraction resources. | Create a Java method that does the following: "Use this API to update filteraction resources.". | Of course, here is the Java code you requested:
```java
public static base_responses update(nitro_service client, filteraction resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
filteraction updateresources[] = new filteraction[resources.length];
fo... | |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/component/html/HtmlMessages.java | HtmlMessages.getFatalClass | public java.lang.String getFatalClass() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.fatalClass);
} | java | public java.lang.String getFatalClass() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.fatalClass);
} | [
"public",
"java",
".",
"lang",
".",
"String",
"getFatalClass",
"(",
")",
"{",
"return",
"(",
"java",
".",
"lang",
".",
"String",
")",
"getStateHelper",
"(",
")",
".",
"eval",
"(",
"PropertyKeys",
".",
"fatalClass",
")",
";",
"}"
] | <p>Return the value of the <code>fatalClass</code> property.</p>
<p>Contents: CSS style class to apply to any message
with a severity class of "FATAL". | [
"<p",
">",
"Return",
"the",
"value",
"of",
"the",
"<code",
">",
"fatalClass<",
"/",
"code",
">",
"property",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Contents",
":",
"CSS",
"style",
"class",
"to",
"apply",
"to",
"any",
"message",
"with",
"a",
"severity",... | cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3 | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/component/html/HtmlMessages.java#L168-L171 | train | Gets the value of the fatalClass property. | Create a Java method that does the following: "Gets the value of the fatalClass property.". | Of course, here is the Java code you requested:
```java
public java.lang.String getFatalClass() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.fatalClass);
}
```
Hope this helps! | |
NextFaze/power-adapters | power-adapters-data/src/main/java/com/nextfaze/poweradapters/data/CursorData.java | CursorData.changeCursor | private void changeCursor(@Nullable Cursor newCursor) {
Cursor oldCursor = mCursor;
if (mCursor != newCursor) {
int oldSize = 0;
int deltaSize = 0;
if (oldCursor != null) {
int oldCount = oldCursor.getCount();
oldSize = oldCount;
... | java | private void changeCursor(@Nullable Cursor newCursor) {
Cursor oldCursor = mCursor;
if (mCursor != newCursor) {
int oldSize = 0;
int deltaSize = 0;
if (oldCursor != null) {
int oldCount = oldCursor.getCount();
oldSize = oldCount;
... | [
"private",
"void",
"changeCursor",
"(",
"@",
"Nullable",
"Cursor",
"newCursor",
")",
"{",
"Cursor",
"oldCursor",
"=",
"mCursor",
";",
"if",
"(",
"mCursor",
"!=",
"newCursor",
")",
"{",
"int",
"oldSize",
"=",
"0",
";",
"int",
"deltaSize",
"=",
"0",
";",
... | Switches to the specified cursor, notifying observers of changes as necessary. | [
"Switches",
"to",
"the",
"specified",
"cursor",
"notifying",
"observers",
"of",
"changes",
"as",
"necessary",
"."
] | cdf00b1b723ed9d6bcd549ae9741a19dd59651e1 | https://github.com/NextFaze/power-adapters/blob/cdf00b1b723ed9d6bcd549ae9741a19dd59651e1/power-adapters-data/src/main/java/com/nextfaze/poweradapters/data/CursorData.java#L161-L190 | train | Changes the cursor. | Create a Java method that does the following: "Changes the cursor.". | Of course, here is the Java code you requested:
```java
private void changeCursor(@Nullable Cursor newCursor) {
Cursor oldCursor = mCursor;
if (mCursor != newCursor) {
int oldSize = 0;
int deltaSize = 0;
if (oldCursor != null) {
int oldCount = oldCurs... | |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/model/Conference.java | Conference.getMembers | public List<ConferenceMember> getMembers() throws Exception {
final String membersPath = StringUtils.join(new String[]{
getUri(),
"members"
}, '/');
final JSONArray array = toJSONArray(client.get(membersPath, null));
final List<ConferenceMember> members =... | java | public List<ConferenceMember> getMembers() throws Exception {
final String membersPath = StringUtils.join(new String[]{
getUri(),
"members"
}, '/');
final JSONArray array = toJSONArray(client.get(membersPath, null));
final List<ConferenceMember> members =... | [
"public",
"List",
"<",
"ConferenceMember",
">",
"getMembers",
"(",
")",
"throws",
"Exception",
"{",
"final",
"String",
"membersPath",
"=",
"StringUtils",
".",
"join",
"(",
"new",
"String",
"[",
"]",
"{",
"getUri",
"(",
")",
",",
"\"members\"",
"}",
",",
... | Gets list all members from a conference. If a member had already hung up or removed from conference it will be displayed as completed.
@return list of members
@throws IOException unexpected error. | [
"Gets",
"list",
"all",
"members",
"from",
"a",
"conference",
".",
"If",
"a",
"member",
"had",
"already",
"hung",
"up",
"or",
"removed",
"from",
"conference",
"it",
"will",
"be",
"displayed",
"as",
"completed",
"."
] | 2124c85148ad6a54d2f2949cb952eb3985830e2a | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/Conference.java#L165-L177 | train | Gets the members of the user. | Create a Java method that does the following: "Gets the members of the user.". | Of course, here is the Java code you requested:
```java
public List<ConferenceMember> getMembers() throws Exception {
final String membersPath = StringUtils.join(new String[]{
getUri(),
"members"
}, '/');
final JSONArray array = toJSONArray(client.get(membersPath... | |
google/closure-templates | java/src/com/google/template/soy/exprtree/FunctionNode.java | FunctionNode.isPure | public boolean isPure() {
if (soyFunction instanceof BuiltinFunction) {
return ((BuiltinFunction) soyFunction).isPure();
}
return soyFunction.getClass().isAnnotationPresent(SoyPureFunction.class);
} | java | public boolean isPure() {
if (soyFunction instanceof BuiltinFunction) {
return ((BuiltinFunction) soyFunction).isPure();
}
return soyFunction.getClass().isAnnotationPresent(SoyPureFunction.class);
} | [
"public",
"boolean",
"isPure",
"(",
")",
"{",
"if",
"(",
"soyFunction",
"instanceof",
"BuiltinFunction",
")",
"{",
"return",
"(",
"(",
"BuiltinFunction",
")",
"soyFunction",
")",
".",
"isPure",
"(",
")",
";",
"}",
"return",
"soyFunction",
".",
"getClass",
... | Whether or not this function is pure.
<p>See {@link SoyPureFunction} for the definition of a pure function. | [
"Whether",
"or",
"not",
"this",
"function",
"is",
"pure",
"."
] | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/exprtree/FunctionNode.java#L156-L161 | train | Returns true if the function is pure. | Create a Java method that does the following: "Returns true if the function is pure.". | Of course, here is the Java code you requested:
```java
public boolean isPure() {
if (soyFunction instanceof BuiltinFunction) {
return ((BuiltinFunction) soyFunction).isPure();
}
return soyFunction.getClass().isAnnotationPresent(SoyPureFunction.class);
}
```
Hope this helps! | |
haraldk/TwelveMonkeys | imageio/imageio-hdr/src/main/java/com/twelvemonkeys/imageio/plugins/hdr/RGBE.java | RGBE.copysign | private static double copysign(double x, double y) {
return fromhilo((hi(x) & 0x7fffffff) | (hi(y) & 0x80000000), lo(x));
} | java | private static double copysign(double x, double y) {
return fromhilo((hi(x) & 0x7fffffff) | (hi(y) & 0x80000000), lo(x));
} | [
"private",
"static",
"double",
"copysign",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"return",
"fromhilo",
"(",
"(",
"hi",
"(",
"x",
")",
"&",
"0x7fffffff",
")",
"|",
"(",
"hi",
"(",
"y",
")",
"&",
"0x80000000",
")",
",",
"lo",
"(",
"x",
... | copysign(double x, double y) <BR>
copysign(x,y) returns a value with the magnitude of x and
with the sign bit of y. | [
"copysign",
"(",
"double",
"x",
"double",
"y",
")",
"<BR",
">",
"copysign",
"(",
"x",
"y",
")",
"returns",
"a",
"value",
"with",
"the",
"magnitude",
"of",
"x",
"and",
"with",
"the",
"sign",
"bit",
"of",
"y",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-hdr/src/main/java/com/twelvemonkeys/imageio/plugins/hdr/RGBE.java#L424-L426 | train | Copy sign of x and y. | Create a Java method that does the following: "Copy sign of x and y.". | Of course, here is the Java code you requested:
```java
private static double copysign(double x, double y) {
return fromhilo((hi(x) & 0x7fffffff) | (hi(y) & 0x80000000), lo(x));
}
```
Hope this helps! | |
OpenBEL/openbel-framework | org.openbel.framework.api/src/main/java/org/openbel/framework/api/KAMStoreImpl.java | KAMStoreImpl.teardown | @Override
public void teardown() {
if (_dao != null) _dao.terminate();
Set<Entry<KamInfo, KAMStoreDao>> entries = entries(daomap);
Iterator<Entry<KamInfo, KAMStoreDao>> iter = entries.iterator();
while (iter.hasNext()) {
Entry<KamInfo, KAMStoreDao> next = iter.next();
... | java | @Override
public void teardown() {
if (_dao != null) _dao.terminate();
Set<Entry<KamInfo, KAMStoreDao>> entries = entries(daomap);
Iterator<Entry<KamInfo, KAMStoreDao>> iter = entries.iterator();
while (iter.hasNext()) {
Entry<KamInfo, KAMStoreDao> next = iter.next();
... | [
"@",
"Override",
"public",
"void",
"teardown",
"(",
")",
"{",
"if",
"(",
"_dao",
"!=",
"null",
")",
"_dao",
".",
"terminate",
"(",
")",
";",
"Set",
"<",
"Entry",
"<",
"KamInfo",
",",
"KAMStoreDao",
">",
">",
"entries",
"=",
"entries",
"(",
"daomap",
... | {@inheritDoc} | [
"{"
] | 149f80b1d6eabb15ab15815b6f745b0afa9fd2d3 | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.api/src/main/java/org/openbel/framework/api/KAMStoreImpl.java#L170-L197 | train | Tear down the application of the CRUD. | Create a Java method that does the following: "Tear down the application of the CRUD.". | Of course, here is the Java code you requested:
```java
@Override
public void teardown() {
if (_dao != null) _dao.terminate();
Set<Entry<KamInfo, KAMStoreDao>> entries = entries(daomap);
Iterator<Entry<KamInfo, KAMStoreDao>> iter = entries.iterator();
while (iter.hasNext()) {
... | |
KyoriPowered/text | api/src/main/java/net/kyori/text/TranslatableComponent.java | TranslatableComponent.of | public static TranslatableComponent of(final @NonNull String key, final @Nullable TextColor color, final @NonNull List<Component> args) {
return of(key, color, Collections.emptySet(), args);
} | java | public static TranslatableComponent of(final @NonNull String key, final @Nullable TextColor color, final @NonNull List<Component> args) {
return of(key, color, Collections.emptySet(), args);
} | [
"public",
"static",
"TranslatableComponent",
"of",
"(",
"final",
"@",
"NonNull",
"String",
"key",
",",
"final",
"@",
"Nullable",
"TextColor",
"color",
",",
"final",
"@",
"NonNull",
"List",
"<",
"Component",
">",
"args",
")",
"{",
"return",
"of",
"(",
"key"... | Creates a translatable component with a translation key and arguments.
@param key the translation key
@param color the color
@param args the translation arguments
@return the translatable component | [
"Creates",
"a",
"translatable",
"component",
"with",
"a",
"translation",
"key",
"and",
"arguments",
"."
] | 4496c593bf89e8fb036dd6efe26f8ac60f7655c9 | https://github.com/KyoriPowered/text/blob/4496c593bf89e8fb036dd6efe26f8ac60f7655c9/api/src/main/java/net/kyori/text/TranslatableComponent.java#L169-L171 | train | Create a translatable component with a key color and list of components. | Create a Java method that does the following: "Create a translatable component with a key color and list of components.". | Of course, here is the Java code you requested:
```java
public static TranslatableComponent of(final @NonNull String key, final @Nullable TextColor color, final @NonNull List<Component> args) {
return of(key, color, Collections.emptySet(), args);
}
```
Hope this helps! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.