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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/aws-sdk-java | aws-java-sdk-route53/src/main/java/com/amazonaws/services/route53domains/model/ViewBillingResult.java | ViewBillingResult.setBillingRecords | public void setBillingRecords(java.util.Collection<BillingRecord> billingRecords) {
if (billingRecords == null) {
this.billingRecords = null;
return;
}
this.billingRecords = new com.amazonaws.internal.SdkInternalList<BillingRecord>(billingRecords);
} | java | public void setBillingRecords(java.util.Collection<BillingRecord> billingRecords) {
if (billingRecords == null) {
this.billingRecords = null;
return;
}
this.billingRecords = new com.amazonaws.internal.SdkInternalList<BillingRecord>(billingRecords);
} | [
"public",
"void",
"setBillingRecords",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"BillingRecord",
">",
"billingRecords",
")",
"{",
"if",
"(",
"billingRecords",
"==",
"null",
")",
"{",
"this",
".",
"billingRecords",
"=",
"null",
";",
"return",
";",
... | <p>
A summary of billing records.
</p>
@param billingRecords
A summary of billing records. | [
"<p",
">",
"A",
"summary",
"of",
"billing",
"records",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-route53/src/main/java/com/amazonaws/services/route53domains/model/ViewBillingResult.java#L113-L120 | train | Sets the value of the billingRecords property. | Create a Java method that does the following: "Sets the value of the billingRecords property.". | Of course, here is the Java code you requested:
```java
public void setBillingRecords(java.util.Collection<BillingRecord> billingRecords) {
if (billingRecords == null) {
this.billingRecords = null;
return;
}
this.billingRecords = new com.amazonaws.internal.SdkInternalLi... | |
graylog-labs/jersey-netty | src/main/java/org/graylog2/jersey/container/netty/NettyContainer.java | NettyContainer.extractBasicAuthCredentials | private String[] extractBasicAuthCredentials(String authorizationHeader) {
if (authorizationHeader == null) {
return null;
}
String[] schemeUserPass = new String[3];
String credentials;
final String[] headerParts = authorizationHeader.split(" ");
if (headerPar... | java | private String[] extractBasicAuthCredentials(String authorizationHeader) {
if (authorizationHeader == null) {
return null;
}
String[] schemeUserPass = new String[3];
String credentials;
final String[] headerParts = authorizationHeader.split(" ");
if (headerPar... | [
"private",
"String",
"[",
"]",
"extractBasicAuthCredentials",
"(",
"String",
"authorizationHeader",
")",
"{",
"if",
"(",
"authorizationHeader",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"[",
"]",
"schemeUserPass",
"=",
"new",
"String",
"[",... | /* horrible, looks like rubby | [
"/",
"*",
"horrible",
"looks",
"like",
"rubby"
] | 48232b672de983545b00ab2425a4857d56f487cd | https://github.com/graylog-labs/jersey-netty/blob/48232b672de983545b00ab2425a4857d56f487cd/src/main/java/org/graylog2/jersey/container/netty/NettyContainer.java#L367-L385 | train | Extract basic auth credentials from the Authorization header. | Create a Java method that does the following: "Extract basic auth credentials from the Authorization header.". | Of course, here is the Java code you requested:
```java
private String[] extractBasicAuthCredentials(String authorizationHeader) {
if (authorizationHeader == null) {
return null;
}
String[] schemeUserPass = new String[3];
String credentials;
final String[] headerPart... | |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPAttachmentFileEntryPersistenceImpl.java | CPAttachmentFileEntryPersistenceImpl.findByC_C_Last | @Override
public CPAttachmentFileEntry findByC_C_Last(long classNameId, long classPK,
OrderByComparator<CPAttachmentFileEntry> orderByComparator)
throws NoSuchCPAttachmentFileEntryException {
CPAttachmentFileEntry cpAttachmentFileEntry = fetchByC_C_Last(classNameId,
classPK, orderByComparator);
if (cpAtta... | java | @Override
public CPAttachmentFileEntry findByC_C_Last(long classNameId, long classPK,
OrderByComparator<CPAttachmentFileEntry> orderByComparator)
throws NoSuchCPAttachmentFileEntryException {
CPAttachmentFileEntry cpAttachmentFileEntry = fetchByC_C_Last(classNameId,
classPK, orderByComparator);
if (cpAtta... | [
"@",
"Override",
"public",
"CPAttachmentFileEntry",
"findByC_C_Last",
"(",
"long",
"classNameId",
",",
"long",
"classPK",
",",
"OrderByComparator",
"<",
"CPAttachmentFileEntry",
">",
"orderByComparator",
")",
"throws",
"NoSuchCPAttachmentFileEntryException",
"{",
"CPAttachm... | Returns the last cp attachment file entry in the ordered set where classNameId = ? and classPK = ?.
@param classNameId the class name ID
@param classPK the class pk
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return the last matching cp attachment file entry
@thr... | [
"Returns",
"the",
"last",
"cp",
"attachment",
"file",
"entry",
"in",
"the",
"ordered",
"set",
"where",
"classNameId",
"=",
"?",
";",
"and",
"classPK",
"=",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPAttachmentFileEntryPersistenceImpl.java#L1768-L1792 | train | Returns the last cp attachment file entry in the ordered set. | Create a Java method that does the following: "Returns the last cp attachment file entry in the ordered set.". | Of course, here is the Java code you requested:
```java
@Override
public CPAttachmentFileEntry findByC_C_Last(long classNameId, long classPK,
OrderByComparator<CPAttachmentFileEntry> orderByComparator)
throws NoSuchCPAttachmentFileEntryException {
CPAttachmentFileEntry cpAttachmentFileEntry = fetchByC_C_Last(cl... | |
icode/ameba | src/main/java/ameba/mvc/template/internal/TemplateModelProcessor.java | TemplateModelProcessor.processModel | private ResourceModel processModel(final ResourceModel resourceModel, final boolean subResourceModel) {
ResourceModel.Builder newModelBuilder = processTemplateAnnotatedInvocables(resourceModel, subResourceModel);
for (RuntimeResource resource : resourceModel.getRuntimeResourceModel().getRuntimeResource... | java | private ResourceModel processModel(final ResourceModel resourceModel, final boolean subResourceModel) {
ResourceModel.Builder newModelBuilder = processTemplateAnnotatedInvocables(resourceModel, subResourceModel);
for (RuntimeResource resource : resourceModel.getRuntimeResourceModel().getRuntimeResource... | [
"private",
"ResourceModel",
"processModel",
"(",
"final",
"ResourceModel",
"resourceModel",
",",
"final",
"boolean",
"subResourceModel",
")",
"{",
"ResourceModel",
".",
"Builder",
"newModelBuilder",
"=",
"processTemplateAnnotatedInvocables",
"(",
"resourceModel",
",",
"su... | Enhance {@link org.glassfish.jersey.server.model.RuntimeResource runtime resources} of given
{@link org.glassfish.jersey.server.model.ResourceModel resource model} with methods obtained with
{@link #getEnhancingMethods(org.glassfish.jersey.server.model.RuntimeResource)}.
@param resourceModel resource model to enhan... | [
"Enhance",
"{",
"@link",
"org",
".",
"glassfish",
".",
"jersey",
".",
"server",
".",
"model",
".",
"RuntimeResource",
"runtime",
"resources",
"}",
"of",
"given",
"{",
"@link",
"org",
".",
"glassfish",
".",
"jersey",
".",
"server",
".",
"model",
".",
"Res... | 9d4956e935898e41331b2745e400ef869cd265e0 | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/mvc/template/internal/TemplateModelProcessor.java#L96-L104 | train | Process a resource model. | Create a Java method that does the following: "Process a resource model.". | Of course, here is the Java code you requested:
```java
private ResourceModel processModel(final ResourceModel resourceModel, final boolean subResourceModel) {
ResourceModel.Builder newModelBuilder = processTemplateAnnotatedInvocables(resourceModel, subResourceModel);
for (RuntimeResource resource : r... | |
sharneng/gm4java | src/main/java/org/gm4java/im4java/GMOperation.java | GMOperation.resize | public GMOperation resize(final int width, final int height, final Collection<GeometryAnnotation> annotations) {
final List<String> args = getCmdArgs();
args.add("-resize");
args.add(resample(width, height, annotations));
return this;
} | java | public GMOperation resize(final int width, final int height, final Collection<GeometryAnnotation> annotations) {
final List<String> args = getCmdArgs();
args.add("-resize");
args.add(resample(width, height, annotations));
return this;
} | [
"public",
"GMOperation",
"resize",
"(",
"final",
"int",
"width",
",",
"final",
"int",
"height",
",",
"final",
"Collection",
"<",
"GeometryAnnotation",
">",
"annotations",
")",
"{",
"final",
"List",
"<",
"String",
">",
"args",
"=",
"getCmdArgs",
"(",
")",
"... | Resize source to desired target dimensions, using default resizing filter algorithm.
@param width
Length in pixels of the target image's width.
@param height
Length in pixels of the target image's height.
@param annotations
Geometry annotations to define how the {@code width} and {@code height} options are to be inter... | [
"Resize",
"source",
"to",
"desired",
"target",
"dimensions",
"using",
"default",
"resizing",
"filter",
"algorithm",
"."
] | 92f3f3b64a45f312ef6978f2367263ec64ff0c04 | https://github.com/sharneng/gm4java/blob/92f3f3b64a45f312ef6978f2367263ec64ff0c04/src/main/java/org/gm4java/im4java/GMOperation.java#L190-L195 | test | Resize the image. | Create a Java method that does the following: "Resize the image.". | Of course, here is the Java code you requested:
```java
public GMOperation resize(final int width, final int height, final Collection<GeometryAnnotation> annotations) {
final List<String> args = getCmdArgs();
args.add("-resize");
args.add(resample(width, height, annotations));
return th... | |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/v1beta1/ErrorGroupServiceClient.java | ErrorGroupServiceClient.getGroup | public final ErrorGroup getGroup(GroupName groupName) {
GetGroupRequest request =
GetGroupRequest.newBuilder()
.setGroupName(groupName == null ? null : groupName.toString())
.build();
return getGroup(request);
} | java | public final ErrorGroup getGroup(GroupName groupName) {
GetGroupRequest request =
GetGroupRequest.newBuilder()
.setGroupName(groupName == null ? null : groupName.toString())
.build();
return getGroup(request);
} | [
"public",
"final",
"ErrorGroup",
"getGroup",
"(",
"GroupName",
"groupName",
")",
"{",
"GetGroupRequest",
"request",
"=",
"GetGroupRequest",
".",
"newBuilder",
"(",
")",
".",
"setGroupName",
"(",
"groupName",
"==",
"null",
"?",
"null",
":",
"groupName",
".",
"t... | Get the specified group.
<p>Sample code:
<pre><code>
try (ErrorGroupServiceClient errorGroupServiceClient = ErrorGroupServiceClient.create()) {
GroupName groupName = GroupName.of("[PROJECT]", "[GROUP]");
ErrorGroup response = errorGroupServiceClient.getGroup(groupName);
}
</code></pre>
@param groupName [Required] Th... | [
"Get",
"the",
"specified",
"group",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/v1beta1/ErrorGroupServiceClient.java#L173-L180 | train | Gets an ErrorGroup object. | Create a Java method that does the following: "Gets an ErrorGroup object.". | Of course, here is the Java code you requested:
```java
public final ErrorGroup getGroup(GroupName groupName) {
GetGroupRequest request =
GetGroupRequest.newBuilder()
.setGroupName(groupName == null ? null : groupName.toString())
.build();
return getGroup(request);
}
```
Hop... | |
liferay/com-liferay-commerce | commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CProductUtil.java | CProductUtil.findByGroupId_PrevAndNext | public static CProduct[] findByGroupId_PrevAndNext(long CProductId,
long groupId, OrderByComparator<CProduct> orderByComparator)
throws com.liferay.commerce.product.exception.NoSuchCProductException {
return getPersistence()
.findByGroupId_PrevAndNext(CProductId, groupId,
orderByComparator);
} | java | public static CProduct[] findByGroupId_PrevAndNext(long CProductId,
long groupId, OrderByComparator<CProduct> orderByComparator)
throws com.liferay.commerce.product.exception.NoSuchCProductException {
return getPersistence()
.findByGroupId_PrevAndNext(CProductId, groupId,
orderByComparator);
} | [
"public",
"static",
"CProduct",
"[",
"]",
"findByGroupId_PrevAndNext",
"(",
"long",
"CProductId",
",",
"long",
"groupId",
",",
"OrderByComparator",
"<",
"CProduct",
">",
"orderByComparator",
")",
"throws",
"com",
".",
"liferay",
".",
"commerce",
".",
"product",
... | Returns the c products before and after the current c product in the ordered set where groupId = ?.
@param CProductId the primary key of the current c product
@param groupId the group ID
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return the previous, current, and ne... | [
"Returns",
"the",
"c",
"products",
"before",
"and",
"after",
"the",
"current",
"c",
"product",
"in",
"the",
"ordered",
"set",
"where",
"groupId",
"=",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CProductUtil.java#L626-L632 | train | Returns the c products before and after the current C Product in the ordered set where CProductId = ? ; and groupId = ? ;. | Create a Java method that does the following: "Returns the c products before and after the current C Product in the ordered set where CProductId = ? ; and groupId = ? ;.". | Of course, here is the Java code you requested:
```java
public static CProduct[] findByGroupId_PrevAndNext(long CProductId,
long groupId, OrderByComparator<CProduct> orderByComparator)
throws com.liferay.commerce.product.exception.NoSuchCProductException {
return getPersistence()
.findByGroupId_PrevAndNex... | |
biezhi/anima | src/main/java/io/github/biezhi/anima/core/AnimaQuery.java | AnimaQuery.maps | public List<Map<String, Object>> maps() {
this.beforeCheck();
String sql = this.buildSelectSQL(true);
return this.queryListMap(sql, paramValues);
} | java | public List<Map<String, Object>> maps() {
this.beforeCheck();
String sql = this.buildSelectSQL(true);
return this.queryListMap(sql, paramValues);
} | [
"public",
"List",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"maps",
"(",
")",
"{",
"this",
".",
"beforeCheck",
"(",
")",
";",
"String",
"sql",
"=",
"this",
".",
"buildSelectSQL",
"(",
"true",
")",
";",
"return",
"this",
".",
"queryListMap",... | query List<Map>
@return List<Map> | [
"query",
"List<Map",
">"
] | d6655e47ac4c08d9d7f961ac0569062bead8b1ed | https://github.com/biezhi/anima/blob/d6655e47ac4c08d9d7f961ac0569062bead8b1ed/src/main/java/io/github/biezhi/anima/core/AnimaQuery.java#L845-L849 | train | Get a list of map objects from the database. | Create a Java method that does the following: "Get a list of map objects from the database.". | Of course, here is the Java code you requested:
```java
public List<Map<String, Object>> maps() {
this.beforeCheck();
String sql = this.buildSelectSQL(true);
return this.queryListMap(sql, paramValues);
}
```
Hope this helps! | |
jcuda/jcufft | JCufftJava/src/main/java/jcuda/jcufft/JCufft.java | JCufft.cufftPlanMany | public static int cufftPlanMany(cufftHandle plan, int rank, int n[],
int inembed[], int istride, int idist,
int onembed[], int ostride, int odist,
int type, int batch)
{
return checkResult(cufftPlanManyNative(plan, rank, n, inembed, istride, idist, onembed, ostride, odist, type,... | java | public static int cufftPlanMany(cufftHandle plan, int rank, int n[],
int inembed[], int istride, int idist,
int onembed[], int ostride, int odist,
int type, int batch)
{
return checkResult(cufftPlanManyNative(plan, rank, n, inembed, istride, idist, onembed, ostride, odist, type,... | [
"public",
"static",
"int",
"cufftPlanMany",
"(",
"cufftHandle",
"plan",
",",
"int",
"rank",
",",
"int",
"n",
"[",
"]",
",",
"int",
"inembed",
"[",
"]",
",",
"int",
"istride",
",",
"int",
"idist",
",",
"int",
"onembed",
"[",
"]",
",",
"int",
"ostride"... | <pre>
Creates a FFT plan configuration of dimension rank, with sizes
specified in the array n.
cufftResult cufftPlanMany(cufftHandle *plan, int rank, int *n,
int *inembed, int istride, int idist,
int *onembed, int ostride, int odist,
cufftType type, int batch );
The batch input parameter tells CUFFT how many transfor... | [
"<pre",
">",
"Creates",
"a",
"FFT",
"plan",
"configuration",
"of",
"dimension",
"rank",
"with",
"sizes",
"specified",
"in",
"the",
"array",
"n",
"."
] | 833c87ffb0864f7ee7270fddef8af57f48939b3a | https://github.com/jcuda/jcufft/blob/833c87ffb0864f7ee7270fddef8af57f48939b3a/JCufftJava/src/main/java/jcuda/jcufft/JCufft.java#L349-L355 | train | Create a Cufft - Plans structure from a single CufftHandle. | Create a Java method that does the following: "Create a Cufft - Plans structure from a single CufftHandle.". | Of course, here is the Java code you requested:
```java
public static int cufftPlanMany(cufftHandle plan, int rank, int n[],
int inembed[], int istride, int idist,
int onembed[], int ostride, int odist,
int type, int batch)
{
return checkResult(cufftPlanManyNative(plan, rank, n... | |
BioPAX/Paxtools | paxtools-console/src/main/java/org/biopax/paxtools/examples/GOUnificationXREFtoRelationshipXREFConverter.java | GOUnificationXREFtoRelationshipXREFConverter.processXrefs | private static void processXrefs(String arg) throws
FileNotFoundException,
IllegalAccessException,
InvocationTargetException
{
//Read in the model
FileInputStream in =
new FileInputStream(new File(arg));
Model level2 =
reader.convertFromOWL(in);
//Get all unification xrefs.
Set... | java | private static void processXrefs(String arg) throws
FileNotFoundException,
IllegalAccessException,
InvocationTargetException
{
//Read in the model
FileInputStream in =
new FileInputStream(new File(arg));
Model level2 =
reader.convertFromOWL(in);
//Get all unification xrefs.
Set... | [
"private",
"static",
"void",
"processXrefs",
"(",
"String",
"arg",
")",
"throws",
"FileNotFoundException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"//Read in the model",
"FileInputStream",
"in",
"=",
"new",
"FileInputStream",
"(",
"new",
"F... | Main conversion method. Demonstrates how to read and write a BioPAX
model and accessing its objects.
@param arg file name to be processed | [
"Main",
"conversion",
"method",
".",
"Demonstrates",
"how",
"to",
"read",
"and",
"write",
"a",
"BioPAX",
"model",
"and",
"accessing",
"its",
"objects",
"."
] | 2f93afa94426bf8b5afc2e0e61cd4b269a83288d | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-console/src/main/java/org/biopax/paxtools/examples/GOUnificationXREFtoRelationshipXREFConverter.java#L62-L101 | train | Process the xrefs in the file arg. | Create a Java method that does the following: "Process the xrefs in the file arg.". | Of course, here is the Java code you requested:
```java
private static void processXrefs(String arg) throws
FileNotFoundException,
IllegalAccessException,
InvocationTargetException
{
//Read in the model
FileInputStream in =
new FileInputStream(new File(arg));
Model level2 =
reader.convertFromO... | |
inferred/FreeBuilder | src/main/java/org/inferred/freebuilder/processor/source/FunctionalType.java | FunctionalType.functionalTypeAcceptedByMethod | public static FunctionalType functionalTypeAcceptedByMethod(
DeclaredType type,
String methodName,
FunctionalType prototype,
Elements elements,
Types types) {
return functionalTypesAcceptedByMethod(type, methodName, elements, types)
.stream()
.filter(functionalType -> i... | java | public static FunctionalType functionalTypeAcceptedByMethod(
DeclaredType type,
String methodName,
FunctionalType prototype,
Elements elements,
Types types) {
return functionalTypesAcceptedByMethod(type, methodName, elements, types)
.stream()
.filter(functionalType -> i... | [
"public",
"static",
"FunctionalType",
"functionalTypeAcceptedByMethod",
"(",
"DeclaredType",
"type",
",",
"String",
"methodName",
",",
"FunctionalType",
"prototype",
",",
"Elements",
"elements",
",",
"Types",
"types",
")",
"{",
"return",
"functionalTypesAcceptedByMethod",... | Returns the functional type accepted by {@code methodName} on {@code type}, assignable to
{@code prototype}, or {@code prototype} itself if no such method has been declared.
<p>Used to allow the user to override the functional interface used on builder methods,
e.g. to force boxing, or to use Guava types. | [
"Returns",
"the",
"functional",
"type",
"accepted",
"by",
"{",
"@code",
"methodName",
"}",
"on",
"{",
"@code",
"type",
"}",
"assignable",
"to",
"{",
"@code",
"prototype",
"}",
"or",
"{",
"@code",
"prototype",
"}",
"itself",
"if",
"no",
"such",
"method",
... | d5a222f90648aece135da4b971c55a60afe8649c | https://github.com/inferred/FreeBuilder/blob/d5a222f90648aece135da4b971c55a60afe8649c/src/main/java/org/inferred/freebuilder/processor/source/FunctionalType.java#L135-L146 | train | Returns the functional type accepted by the given parameters. | Create a Java method that does the following: "Returns the functional type accepted by the given parameters.". | Of course, here is the Java code you requested:
```java
public static FunctionalType functionalTypeAcceptedByMethod(
DeclaredType type,
String methodName,
FunctionalType prototype,
Elements elements,
Types types) {
return functionalTypesAcceptedByMethod(type, methodName, elements, typ... | |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/dbinfo/DatabaseInformationMain.java | DatabaseInformationMain.createBlankTable | protected final Table createBlankTable(HsqlName name) {
Table table = new Table(database, name, TableBase.SYSTEM_TABLE);
return table;
} | java | protected final Table createBlankTable(HsqlName name) {
Table table = new Table(database, name, TableBase.SYSTEM_TABLE);
return table;
} | [
"protected",
"final",
"Table",
"createBlankTable",
"(",
"HsqlName",
"name",
")",
"{",
"Table",
"table",
"=",
"new",
"Table",
"(",
"database",
",",
"name",
",",
"TableBase",
".",
"SYSTEM_TABLE",
")",
";",
"return",
"table",
";",
"}"
] | Creates a new primoidal system table with the specified name. <p>
@return a new system table
@param name of the table | [
"Creates",
"a",
"new",
"primoidal",
"system",
"table",
"with",
"the",
"specified",
"name",
".",
"<p",
">"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/dbinfo/DatabaseInformationMain.java#L464-L469 | train | Create a blank table. | Create a Java method that does the following: "Create a blank table.". | Of course, here is the Java code you requested:
```java
protected final Table createBlankTable(HsqlName name) {
Table table = new Table(database, name, TableBase.SYSTEM_TABLE);
return table;
}
```
Hope this helps! | |
googleads/googleads-java-lib | modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201805/ReportQuery.java | ReportQuery.getAdUnitView | public com.google.api.ads.admanager.axis.v201805.ReportQueryAdUnitView getAdUnitView() {
return adUnitView;
} | java | public com.google.api.ads.admanager.axis.v201805.ReportQueryAdUnitView getAdUnitView() {
return adUnitView;
} | [
"public",
"com",
".",
"google",
".",
"api",
".",
"ads",
".",
"admanager",
".",
"axis",
".",
"v201805",
".",
"ReportQueryAdUnitView",
"getAdUnitView",
"(",
")",
"{",
"return",
"adUnitView",
";",
"}"
] | Gets the adUnitView value for this ReportQuery.
@return adUnitView * The ad unit view for the report. Defaults to {@link AdUnitView#TOP_LEVEL}. | [
"Gets",
"the",
"adUnitView",
"value",
"for",
"this",
"ReportQuery",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201805/ReportQuery.java#L311-L313 | train | Gets the adUnitView value for this ReportQuery. | Create a Java method that does the following: "Gets the adUnitView value for this ReportQuery.". | Of course, here is the Java code you requested:
```java
public com.google.api.ads.admanager.axis.v201805.ReportQueryAdUnitView getAdUnitView() {
return adUnitView;
}
```
Hope this helps! | |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/tools/HttpTools.java | HttpTools.validateResponse | private String validateResponse(final DigestedResponse response, final URL url) throws MovieDbException {
if (response.getStatusCode() == 0) {
throw new MovieDbException(ApiExceptionType.CONNECTION_ERROR, response.getContent(), response.getStatusCode(), url, null);
} else if (response.getSta... | java | private String validateResponse(final DigestedResponse response, final URL url) throws MovieDbException {
if (response.getStatusCode() == 0) {
throw new MovieDbException(ApiExceptionType.CONNECTION_ERROR, response.getContent(), response.getStatusCode(), url, null);
} else if (response.getSta... | [
"private",
"String",
"validateResponse",
"(",
"final",
"DigestedResponse",
"response",
",",
"final",
"URL",
"url",
")",
"throws",
"MovieDbException",
"{",
"if",
"(",
"response",
".",
"getStatusCode",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"MovieDbExcep... | Check the status codes of the response and throw exceptions if needed
@param response DigestedResponse to process
@param url URL for notification purposes
@return String content
@throws MovieDbException exception | [
"Check",
"the",
"status",
"codes",
"of",
"the",
"response",
"and",
"throw",
"exceptions",
"if",
"needed"
] | bf132d7c7271734e13b58ba3bc92bba46f220118 | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/tools/HttpTools.java#L149-L159 | train | Validate the response. | Create a Java method that does the following: "Validate the response.". | Of course, here is the Java code you requested:
```java
private String validateResponse(final DigestedResponse response, final URL url) throws MovieDbException {
if (response.getStatusCode() == 0) {
throw new MovieDbException(ApiExceptionType.CONNECTION_ERROR, response.getContent(), response.getSta... | |
dyu/protostuff-1.0.x | protostuff-parser/src/main/java/com/dyuproject/protostuff/parser/ProtoLexer.java | ProtoLexer.mRIGHTPAREN | public final void mRIGHTPAREN() throws RecognitionException {
try {
int _type = RIGHTPAREN;
int _channel = DEFAULT_TOKEN_CHANNEL;
// com/dyuproject/protostuff/parser/ProtoLexer.g:55:5: ( ')' )
// com/dyuproject/protostuff/parser/ProtoLexer.g:55:9: ')'
... | java | public final void mRIGHTPAREN() throws RecognitionException {
try {
int _type = RIGHTPAREN;
int _channel = DEFAULT_TOKEN_CHANNEL;
// com/dyuproject/protostuff/parser/ProtoLexer.g:55:5: ( ')' )
// com/dyuproject/protostuff/parser/ProtoLexer.g:55:9: ')'
... | [
"public",
"final",
"void",
"mRIGHTPAREN",
"(",
")",
"throws",
"RecognitionException",
"{",
"try",
"{",
"int",
"_type",
"=",
"RIGHTPAREN",
";",
"int",
"_channel",
"=",
"DEFAULT_TOKEN_CHANNEL",
";",
"// com/dyuproject/protostuff/parser/ProtoLexer.g:55:5: ( ')' )",
"// com/d... | $ANTLR start "RIGHTPAREN" | [
"$ANTLR",
"start",
"RIGHTPAREN"
] | d7c964ec20da3fe44699d86ee95c2677ddffde96 | https://github.com/dyu/protostuff-1.0.x/blob/d7c964ec20da3fe44699d86ee95c2677ddffde96/protostuff-parser/src/main/java/com/dyuproject/protostuff/parser/ProtoLexer.java#L191-L207 | train | start of RIGHTPAREN | Create a Java method that does the following: "start of RIGHTPAREN". | Of course, here is the Java code you requested:
```java
public final void mRIGHTPAREN() throws RecognitionException {
try {
int _type = RIGHTPAREN;
int _channel = DEFAULT_TOKEN_CHANNEL;
// com/dyuproject/protostuff/parser/ProtoLexer.g:55:5: ( ')' )
// com/dyuproj... | |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtp/RtpChannel.java | RtpChannel.setFormatMap | public void setFormatMap(RTPFormats rtpFormats) {
flush();
this.rtpHandler.setFormatMap(rtpFormats);
this.transmitter.setFormatMap(rtpFormats);
} | java | public void setFormatMap(RTPFormats rtpFormats) {
flush();
this.rtpHandler.setFormatMap(rtpFormats);
this.transmitter.setFormatMap(rtpFormats);
} | [
"public",
"void",
"setFormatMap",
"(",
"RTPFormats",
"rtpFormats",
")",
"{",
"flush",
"(",
")",
";",
"this",
".",
"rtpHandler",
".",
"setFormatMap",
"(",
"rtpFormats",
")",
";",
"this",
".",
"transmitter",
".",
"setFormatMap",
"(",
"rtpFormats",
")",
";",
... | Modifies the map between format and RTP payload number
@param rtpFormats the format map | [
"Modifies",
"the",
"map",
"between",
"format",
"and",
"RTP",
"payload",
"number"
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/RtpChannel.java#L213-L217 | train | Sets the format map for this class. | Create a Java method that does the following: "Sets the format map for this class.". | Of course, here is the Java code you requested:
```java
public void setFormatMap(RTPFormats rtpFormats) {
flush();
this.rtpHandler.setFormatMap(rtpFormats);
this.transmitter.setFormatMap(rtpFormats);
}
```
Hope this helps! | |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/util/Log.java | Log.isLoggingEnabled | static boolean isLoggingEnabled(String tag, int logLevel) {
// this hashmap lookup might be a little expensive, and so it might make
// sense to convert this over to a CopyOnWriteArrayList
Integer logLevelForTag = enabledTags.get(tag);
return logLevel >= (logLevelForTag == null ? INFO :... | java | static boolean isLoggingEnabled(String tag, int logLevel) {
// this hashmap lookup might be a little expensive, and so it might make
// sense to convert this over to a CopyOnWriteArrayList
Integer logLevelForTag = enabledTags.get(tag);
return logLevel >= (logLevelForTag == null ? INFO :... | [
"static",
"boolean",
"isLoggingEnabled",
"(",
"String",
"tag",
",",
"int",
"logLevel",
")",
"{",
"// this hashmap lookup might be a little expensive, and so it might make",
"// sense to convert this over to a CopyOnWriteArrayList",
"Integer",
"logLevelForTag",
"=",
"enabledTags",
"... | /* package | [
"/",
"*",
"package"
] | 3b275642e2d2f231fd155ad9def9c5e9eff3118e | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/util/Log.java#L99-L105 | train | Returns true if logging is enabled for the specified tag. | Create a Java method that does the following: "Returns true if logging is enabled for the specified tag.". | Of course, here is the Java code you requested:
```java
static boolean isLoggingEnabled(String tag, int logLevel) {
// this hashmap lookup might be a little expensive, and so it might make
// sense to convert this over to a CopyOnWriteArrayList
Integer logLevelForTag = enabledTags.get(tag);
... | |
Ellzord/JALSE | src/main/java/jalse/entities/Entities.java | Entities.walkEntityTree | public static void walkEntityTree(final EntityContainer container, final EntityVisitor visitor) {
walkEntityTree(container, Integer.MAX_VALUE, visitor);
} | java | public static void walkEntityTree(final EntityContainer container, final EntityVisitor visitor) {
walkEntityTree(container, Integer.MAX_VALUE, visitor);
} | [
"public",
"static",
"void",
"walkEntityTree",
"(",
"final",
"EntityContainer",
"container",
",",
"final",
"EntityVisitor",
"visitor",
")",
"{",
"walkEntityTree",
"(",
"container",
",",
"Integer",
".",
"MAX_VALUE",
",",
"visitor",
")",
";",
"}"
] | Walks through all entities (recursive and breadth-first). Walking can be stopped or filtered
based on the visit result returned.
This is equivalent to {@code walkEntityTree(container, Integer.MAX_VALUE, visitor)}
@param container
Entity container.
@param visitor
Entity visitor.
@see EntityVisitor | [
"Walks",
"through",
"all",
"entities",
"(",
"recursive",
"and",
"breadth",
"-",
"first",
")",
".",
"Walking",
"can",
"be",
"stopped",
"or",
"filtered",
"based",
"on",
"the",
"visit",
"result",
"returned",
"."
] | 43fc6572de9b16eb8474aa21a88b6b2d11291615 | https://github.com/Ellzord/JALSE/blob/43fc6572de9b16eb8474aa21a88b6b2d11291615/src/main/java/jalse/entities/Entities.java#L502-L504 | train | Walk entity tree. | Create a Java method that does the following: "Walk entity tree.". | Of course, here is the Java code you requested:
```java
public static void walkEntityTree(final EntityContainer container, final EntityVisitor visitor) {
walkEntityTree(container, Integer.MAX_VALUE, visitor);
}
```
Hope this helps! | |
outbrain/ob1k | ob1k-concurrent/src/main/java/com/outbrain/ob1k/concurrent/ComposableFutures.java | ComposableFutures.buildEager | public static <T> ComposableFuture<T> buildEager(final Producer<T> producer) {
return EagerComposableFuture.build(producer);
} | java | public static <T> ComposableFuture<T> buildEager(final Producer<T> producer) {
return EagerComposableFuture.build(producer);
} | [
"public",
"static",
"<",
"T",
">",
"ComposableFuture",
"<",
"T",
">",
"buildEager",
"(",
"final",
"Producer",
"<",
"T",
">",
"producer",
")",
"{",
"return",
"EagerComposableFuture",
".",
"build",
"(",
"producer",
")",
";",
"}"
] | builds a new eager future from a producer. the producer is consumed only once
abd the result(or error) is cached for future consumption.
@param producer the result producer
@param <T> the future type
@return the future ;) | [
"builds",
"a",
"new",
"eager",
"future",
"from",
"a",
"producer",
".",
"the",
"producer",
"is",
"consumed",
"only",
"once",
"abd",
"the",
"result",
"(",
"or",
"error",
")",
"is",
"cached",
"for",
"future",
"consumption",
"."
] | 9e43ab39230c5787065053da0f766d822d0fe4e7 | https://github.com/outbrain/ob1k/blob/9e43ab39230c5787065053da0f766d822d0fe4e7/ob1k-concurrent/src/main/java/com/outbrain/ob1k/concurrent/ComposableFutures.java#L504-L506 | train | Build eager. | Create a Java method that does the following: "Build eager.". | Of course, here is the Java code you requested:
```java
public static <T> ComposableFuture<T> buildEager(final Producer<T> producer) {
return EagerComposableFuture.build(producer);
}
```
Hope this helps! | |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/Optional.java | Optional.ofNullable | @NotNull
public static <T> Optional<T> ofNullable(@Nullable T value) {
return value == null ? Optional.<T>empty() : of(value);
} | java | @NotNull
public static <T> Optional<T> ofNullable(@Nullable T value) {
return value == null ? Optional.<T>empty() : of(value);
} | [
"@",
"NotNull",
"public",
"static",
"<",
"T",
">",
"Optional",
"<",
"T",
">",
"ofNullable",
"(",
"@",
"Nullable",
"T",
"value",
")",
"{",
"return",
"value",
"==",
"null",
"?",
"Optional",
".",
"<",
"T",
">",
"empty",
"(",
")",
":",
"of",
"(",
"va... | Returns an {@code Optional} with the specified value, or empty {@code Optional} if value is null.
@param <T> the type of value
@param value the value which can be null
@return an {@code Optional}
@see #of(java.lang.Object) | [
"Returns",
"an",
"{",
"@code",
"Optional",
"}",
"with",
"the",
"specified",
"value",
"or",
"empty",
"{",
"@code",
"Optional",
"}",
"if",
"value",
"is",
"null",
"."
] | f29fd57208c20252a4549b084d55ed082c3e58f0 | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Optional.java#L50-L53 | train | Returns an Optional of the given value. | Create a Java method that does the following: "Returns an Optional of the given value.". | Of course, here is the Java code you requested:
```java
@NotNull
public static <T> Optional<T> ofNullable(@Nullable T value) {
return value == null ? Optional.<T>empty() : of(value);
}
```
Hope this helps! | |
naver/nbase-arc | confmaster/src/main/java/com/navercorp/nbasearc/confmaster/io/EventSelector.java | EventSelector.ioProcess | public void ioProcess()
{
int numberOfKeys;
try {
numberOfKeys = selector.select(selectTimeout);
} catch (IOException e) {
Logger.error("Selector.select error.", e);
return;
}
if (0 == numberOfKeys) {
return;
}
... | java | public void ioProcess()
{
int numberOfKeys;
try {
numberOfKeys = selector.select(selectTimeout);
} catch (IOException e) {
Logger.error("Selector.select error.", e);
return;
}
if (0 == numberOfKeys) {
return;
}
... | [
"public",
"void",
"ioProcess",
"(",
")",
"{",
"int",
"numberOfKeys",
";",
"try",
"{",
"numberOfKeys",
"=",
"selector",
".",
"select",
"(",
"selectTimeout",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"Logger",
".",
"error",
"(",
"\"Selecto... | Demultiplex IO events | [
"Demultiplex",
"IO",
"events"
] | d4ce8a258527160c09b55e34acc1542651a8bbb3 | https://github.com/naver/nbase-arc/blob/d4ce8a258527160c09b55e34acc1542651a8bbb3/confmaster/src/main/java/com/navercorp/nbasearc/confmaster/io/EventSelector.java#L119-L174 | valid | Io Process method. | Create a Java method that does the following: "Io Process method.". | Of course, here is the Java code you requested:
```java
public void ioProcess()
{
int numberOfKeys;
try {
numberOfKeys = selector.select(selectTimeout);
} catch (IOException e) {
Logger.error("Selector.select error.", e);
return;
}
if (0 =... | |
alkacon/opencms-core | src/org/opencms/ui/components/fileselect/CmsNavigationFilter.java | CmsNavigationFilter.getAncestorPaths | List<String> getAncestorPaths(String path) {
List<String> result = Lists.newArrayList();
while (path != null) {
result.add(path);
path = CmsResource.getParentFolder(path);
}
return result;
} | java | List<String> getAncestorPaths(String path) {
List<String> result = Lists.newArrayList();
while (path != null) {
result.add(path);
path = CmsResource.getParentFolder(path);
}
return result;
} | [
"List",
"<",
"String",
">",
"getAncestorPaths",
"(",
"String",
"path",
")",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"while",
"(",
"path",
"!=",
"null",
")",
"{",
"result",
".",
"add",
"(",
"path",
... | Calculates all ancestor paths for a given path.<p>
@param path the path
@return the list of ancestor paths | [
"Calculates",
"all",
"ancestor",
"paths",
"for",
"a",
"given",
"path",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/fileselect/CmsNavigationFilter.java#L105-L113 | train | Returns an array of all ancestor paths of the given path. | Create a Java method that does the following: "Returns an array of all ancestor paths of the given path.". | Of course, here is the Java code you requested:
```java
List<String> getAncestorPaths(String path) {
List<String> result = Lists.newArrayList();
while (path != null) {
result.add(path);
path = CmsResource.getParentFolder(path);
}
return result;
}
```
Hope t... | |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/DefaultCommandRegistry.java | DefaultCommandRegistry.getType | public Class getType(String commandId) {
Assert.notNull(commandId, "commandId");
Object command = getCommand(commandId);
if (command == null) {
return null;
}
else {
return command.getClass();
}
} | java | public Class getType(String commandId) {
Assert.notNull(commandId, "commandId");
Object command = getCommand(commandId);
if (command == null) {
return null;
}
else {
return command.getClass();
}
} | [
"public",
"Class",
"getType",
"(",
"String",
"commandId",
")",
"{",
"Assert",
".",
"notNull",
"(",
"commandId",
",",
"\"commandId\"",
")",
";",
"Object",
"command",
"=",
"getCommand",
"(",
"commandId",
")",
";",
"if",
"(",
"command",
"==",
"null",
")",
"... | {@inheritDoc} | [
"{"
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/DefaultCommandRegistry.java#L336-L349 | train | Get the type of the command. | Create a Java method that does the following: "Get the type of the command.". | Of course, here is the Java code you requested:
```java
public Class getType(String commandId) {
Assert.notNull(commandId, "commandId");
Object command = getCommand(commandId);
if (command == null) {
return null;
}
else {
return... | |
blademainer/common_utils | common_helper/src/main/java/com/xiongyingqi/util/DateHelper.java | DateHelper.getSeqWeek | public static String getSeqWeek() {
Calendar c = Calendar.getInstance(Locale.CHINA);
String week = Integer.toString(c.get(Calendar.WEEK_OF_YEAR));
if (week.length() == 1)
week = "0" + week;
String year = Integer.toString(c.get(Calendar.YEAR));
return year + week;
... | java | public static String getSeqWeek() {
Calendar c = Calendar.getInstance(Locale.CHINA);
String week = Integer.toString(c.get(Calendar.WEEK_OF_YEAR));
if (week.length() == 1)
week = "0" + week;
String year = Integer.toString(c.get(Calendar.YEAR));
return year + week;
... | [
"public",
"static",
"String",
"getSeqWeek",
"(",
")",
"{",
"Calendar",
"c",
"=",
"Calendar",
".",
"getInstance",
"(",
"Locale",
".",
"CHINA",
")",
";",
"String",
"week",
"=",
"Integer",
".",
"toString",
"(",
"c",
".",
"get",
"(",
"Calendar",
".",
"WEEK... | 产生周序列,即得到当前时间所在的年度是第几周
@return | [
"产生周序列",
"即得到当前时间所在的年度是第几周"
] | ef6baf0367c16de95a28caab67a7d5842a6d13db | https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/DateHelper.java#L434-L441 | test | getseqweek - returns the sequence week of the sequence | Create a Java method that does the following: "getseqweek - returns the sequence week of the sequence". | Of course, here is the Java code you requested:
```java
public static String getSeqWeek() {
Calendar c = Calendar.getInstance(Locale.CHINA);
String week = Integer.toString(c.get(Calendar.WEEK_OF_YEAR));
if (week.length() == 1)
week = "0" + week;
String year = Integer.toStrin... | |
rythmengine/rythmengine | src/main/java/org/rythmengine/toString/ToStringStyle.java | ToStringStyle.appendStart | public void appendStart(StringBuilder buffer, Object object) {
if (object != null) {
appendClassName(buffer, object);
appendIdentityHashCode(buffer, object);
appendContentStart(buffer);
if (fieldSeparatorAtStart) {
appendFieldSeparator(buffer);
... | java | public void appendStart(StringBuilder buffer, Object object) {
if (object != null) {
appendClassName(buffer, object);
appendIdentityHashCode(buffer, object);
appendContentStart(buffer);
if (fieldSeparatorAtStart) {
appendFieldSeparator(buffer);
... | [
"public",
"void",
"appendStart",
"(",
"StringBuilder",
"buffer",
",",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"!=",
"null",
")",
"{",
"appendClassName",
"(",
"buffer",
",",
"object",
")",
";",
"appendIdentityHashCode",
"(",
"buffer",
",",
"object"... | <p>Append to the <code>toString</code> the start of data indicator.</p>
@param buffer the <code>StringBuilder</code> to populate
@param object the <code>Object</code> to build a <code>toString</code> for | [
"<p",
">",
"Append",
"to",
"the",
"<code",
">",
"toString<",
"/",
"code",
">",
"the",
"start",
"of",
"data",
"indicator",
".",
"<",
"/",
"p",
">"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/toString/ToStringStyle.java#L369-L378 | train | Append the start of the content of the class. | Create a Java method that does the following: "Append the start of the content of the class.". | Of course, here is the Java code you requested:
```java
public void appendStart(StringBuilder buffer, Object object) {
if (object != null) {
appendClassName(buffer, object);
appendIdentityHashCode(buffer, object);
appendContentStart(buffer);
if (fieldSeparatorAtS... | |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java | JDBCVendorReliance.isJDBCClass | private static boolean isJDBCClass(@SlashedClassName String name) {
String clsName = SignatureUtils.stripSignature(name);
return (clsName.startsWith("java.sql.") || clsName.startsWith("javax.sql.")) && !clsName.endsWith("Exception");
} | java | private static boolean isJDBCClass(@SlashedClassName String name) {
String clsName = SignatureUtils.stripSignature(name);
return (clsName.startsWith("java.sql.") || clsName.startsWith("javax.sql.")) && !clsName.endsWith("Exception");
} | [
"private",
"static",
"boolean",
"isJDBCClass",
"(",
"@",
"SlashedClassName",
"String",
"name",
")",
"{",
"String",
"clsName",
"=",
"SignatureUtils",
".",
"stripSignature",
"(",
"name",
")",
";",
"return",
"(",
"clsName",
".",
"startsWith",
"(",
"\"java.sql.\"",
... | returns whether the class is a jdbc class
@param name
class name or signature of a class
@return if the class name is a jdbc one | [
"returns",
"whether",
"the",
"class",
"is",
"a",
"jdbc",
"class"
] | 3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8 | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java#L175-L179 | train | isJDBCClass returns true if class name is a JDBC class name | Create a Java method that does the following: "isJDBCClass returns true if class name is a JDBC class name". | Of course, here is the Java code you requested:
```java
private static boolean isJDBCClass(@SlashedClassName String name) {
String clsName = SignatureUtils.stripSignature(name);
return (clsName.startsWith("java.sql.") || clsName.startsWith("javax.sql.")) && !clsName.endsWith("Exception");
}
```
H... | |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/v/smoothing/OmsLineSmootherMcMaster.java | OmsLineSmootherMcMaster.isAlone | private boolean isAlone( Geometry geometryN ) {
Coordinate[] coordinates = geometryN.getCoordinates();
if (coordinates.length > 1) {
Coordinate first = coordinates[0];
Coordinate last = coordinates[coordinates.length - 1];
for( SimpleFeature line : linesList ) {
... | java | private boolean isAlone( Geometry geometryN ) {
Coordinate[] coordinates = geometryN.getCoordinates();
if (coordinates.length > 1) {
Coordinate first = coordinates[0];
Coordinate last = coordinates[coordinates.length - 1];
for( SimpleFeature line : linesList ) {
... | [
"private",
"boolean",
"isAlone",
"(",
"Geometry",
"geometryN",
")",
"{",
"Coordinate",
"[",
"]",
"coordinates",
"=",
"geometryN",
".",
"getCoordinates",
"(",
")",
";",
"if",
"(",
"coordinates",
".",
"length",
">",
"1",
")",
"{",
"Coordinate",
"first",
"=",... | Checks if the given geometry is connected to any other line.
@param geometryN the geometry to test.
@return true if the geometry is alone in the space, i.e. not connected at
one of the ends to any other geometry. | [
"Checks",
"if",
"the",
"given",
"geometry",
"is",
"connected",
"to",
"any",
"other",
"line",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/v/smoothing/OmsLineSmootherMcMaster.java#L205-L231 | train | isAlone returns true if geometryN is a single point geometry. | Create a Java method that does the following: "isAlone returns true if geometryN is a single point geometry.". | Of course, here is the Java code you requested:
```java
private boolean isAlone( Geometry geometryN ) {
Coordinate[] coordinates = geometryN.getCoordinates();
if (coordinates.length > 1) {
Coordinate first = coordinates[0];
Coordinate last = coordinates[coordinates.length - 1];
... | |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/query/expr/CalendarPath.java | CalendarPath.lte | public Expression<Calendar> lte(Calendar value) {
String valueString = "'" + getCalendarAsString(value) + "'";
return new Expression<Calendar>(this, Operation.lte, valueString);
} | java | public Expression<Calendar> lte(Calendar value) {
String valueString = "'" + getCalendarAsString(value) + "'";
return new Expression<Calendar>(this, Operation.lte, valueString);
} | [
"public",
"Expression",
"<",
"Calendar",
">",
"lte",
"(",
"Calendar",
"value",
")",
"{",
"String",
"valueString",
"=",
"\"'\"",
"+",
"getCalendarAsString",
"(",
"value",
")",
"+",
"\"'\"",
";",
"return",
"new",
"Expression",
"<",
"Calendar",
">",
"(",
"thi... | Method to construct the less than or equals expression for calendar
@param value the calendar value
@return Expression | [
"Method",
"to",
"construct",
"the",
"less",
"than",
"or",
"equals",
"expression",
"for",
"calendar"
] | 59f988d0776d46620d0b34711c411b2b5b1da06b | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/query/expr/CalendarPath.java#L187-L190 | train | Method to construct the less than or equals expression for calendar | Create a Java method that does the following: "Method to construct the less than or equals expression for calendar". | Of course, here is the Java code you requested:
```java
public Expression<Calendar> lte(Calendar value) {
String valueString = "'" + getCalendarAsString(value) + "'";
return new Expression<Calendar>(this, Operation.lte, valueString);
}
```
Hope this helps! | |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.deleteInstancesAsync | public ServiceFuture<OperationStatusResponseInner> deleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List<String> instanceIds, final ServiceCallback<OperationStatusResponseInner> serviceCallback) {
return ServiceFuture.fromResponse(deleteInstancesWithServiceResponseAsync(resourceGroupName, v... | java | public ServiceFuture<OperationStatusResponseInner> deleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List<String> instanceIds, final ServiceCallback<OperationStatusResponseInner> serviceCallback) {
return ServiceFuture.fromResponse(deleteInstancesWithServiceResponseAsync(resourceGroupName, v... | [
"public",
"ServiceFuture",
"<",
"OperationStatusResponseInner",
">",
"deleteInstancesAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"List",
"<",
"String",
">",
"instanceIds",
",",
"final",
"ServiceCallback",
"<",
"OperationStatusResponse... | Deletes virtual machines in a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@param instanceIds The virtual machine scale set instance ids.
@param serviceCallback the async ServiceCallback to handle successful and failed responses.
@throws Ill... | [
"Deletes",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L1134-L1136 | train | Deletes the specified virtual machine scale set instances. | Create a Java method that does the following: "Deletes the specified virtual machine scale set instances.". | Of course, here is the Java code you requested:
```java
public ServiceFuture<OperationStatusResponseInner> deleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List<String> instanceIds, final ServiceCallback<OperationStatusResponseInner> serviceCallback) {
return ServiceFuture.fromResponse(del... | |
uber/NullAway | jar-infer/jar-infer-lib/src/main/java/com/uber/nullaway/jarinfer/DefinitelyDerefedParamsDriver.java | DefinitelyDerefedParamsDriver.writeModel | private static void writeModel(DataOutputStream out) throws IOException {
Map<String, String> importedAnnotations =
ImmutableMap.<String, String>builder()
.put("Nonnull", "javax.annotation.Nonnull")
.put("Nullable", "javax.annotation.Nullable")
.build();
Map<String, S... | java | private static void writeModel(DataOutputStream out) throws IOException {
Map<String, String> importedAnnotations =
ImmutableMap.<String, String>builder()
.put("Nonnull", "javax.annotation.Nonnull")
.put("Nullable", "javax.annotation.Nullable")
.build();
Map<String, S... | [
"private",
"static",
"void",
"writeModel",
"(",
"DataOutputStream",
"out",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"importedAnnotations",
"=",
"ImmutableMap",
".",
"<",
"String",
",",
"String",
">",
"builder",
"(",
")",
"... | StubxWriter.VERSION_0_FILE_MAGIC_NUMBER (?) | [
"StubxWriter",
".",
"VERSION_0_FILE_MAGIC_NUMBER",
"(",
"?",
")"
] | c3979b4241f80411dbba6aac3ff653acbb88d00b | https://github.com/uber/NullAway/blob/c3979b4241f80411dbba6aac3ff653acbb88d00b/jar-infer/jar-infer-lib/src/main/java/com/uber/nullaway/jarinfer/DefinitelyDerefedParamsDriver.java#L333-L365 | train | Write the model. | Create a Java method that does the following: "Write the model.". | Of course, here is the Java code you requested:
```java
private static void writeModel(DataOutputStream out) throws IOException {
Map<String, String> importedAnnotations =
ImmutableMap.<String, String>builder()
.put("Nonnull", "javax.annotation.Nonnull")
.put("Nullable", "javax.anno... | |
jeroenvanmaanen/common | src/main/java/org/leialearns/common/Static.java | Static.compare | public static <T extends Comparable<T>> int compare(T left, T right) {
int result;
if (left == null) {
if (right == null) {
result = 0;
} else {
result = -1;
}
} else {
if (right == null) {
result = 1... | java | public static <T extends Comparable<T>> int compare(T left, T right) {
int result;
if (left == null) {
if (right == null) {
result = 0;
} else {
result = -1;
}
} else {
if (right == null) {
result = 1... | [
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"T",
">",
">",
"int",
"compare",
"(",
"T",
"left",
",",
"T",
"right",
")",
"{",
"int",
"result",
";",
"if",
"(",
"left",
"==",
"null",
")",
"{",
"if",
"(",
"right",
"==",
"null",
")",
... | Compares the two given objects, handling <code>null</code> values predictably. A <code>null</code> value is
compared smaller than a non-<code>null</code> value. See {@link Comparable#compareTo(Object)} for
the definition of the return value.
@param left The left object
@param right The right object
@param <T> The type... | [
"Compares",
"the",
"two",
"given",
"objects",
"handling",
"<code",
">",
"null<",
"/",
"code",
">",
"values",
"predictably",
".",
"A",
"<code",
">",
"null<",
"/",
"code",
">",
"value",
"is",
"compared",
"smaller",
"than",
"a",
"non",
"-",
"<code",
">",
... | d646f41f42bab86c88a90e232421c4d2e88fa9ef | https://github.com/jeroenvanmaanen/common/blob/d646f41f42bab86c88a90e232421c4d2e88fa9ef/src/main/java/org/leialearns/common/Static.java#L55-L71 | train | Compare two sets of Comparable objects. | Create a Java method that does the following: "Compare two sets of Comparable objects.". | Of course, here is the Java code you requested:
```java
public static <T extends Comparable<T>> int compare(T left, T right) {
int result;
if (left == null) {
if (right == null) {
result = 0;
} else {
result = -1;
}
} else {
... | |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/QueryByCriteria.java | QueryByCriteria.addOrderBy | public void addOrderBy(String fieldName, boolean sortAscending)
{
if (fieldName != null)
{
m_orderby.add(new FieldHelper(fieldName, sortAscending));
}
} | java | public void addOrderBy(String fieldName, boolean sortAscending)
{
if (fieldName != null)
{
m_orderby.add(new FieldHelper(fieldName, sortAscending));
}
} | [
"public",
"void",
"addOrderBy",
"(",
"String",
"fieldName",
",",
"boolean",
"sortAscending",
")",
"{",
"if",
"(",
"fieldName",
"!=",
"null",
")",
"{",
"m_orderby",
".",
"add",
"(",
"new",
"FieldHelper",
"(",
"fieldName",
",",
"sortAscending",
")",
")",
";"... | Adds a field for orderBy
@param fieldName The field name to be used
@param sortAscending true for ASCENDING, false for DESCENDING | [
"Adds",
"a",
"field",
"for",
"orderBy"
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/QueryByCriteria.java#L403-L409 | train | Add the OrderBy operator to the list of Fields to sort by. | Create a Java method that does the following: "Add the OrderBy operator to the list of Fields to sort by.". | Of course, here is the Java code you requested:
```java
public void addOrderBy(String fieldName, boolean sortAscending)
{
if (fieldName != null)
{
m_orderby.add(new FieldHelper(fieldName, sortAscending));
}
}
```
Hope this helps! | |
tracee/tracee | core/src/main/java/io/tracee/transport/SoapHeaderTransport.java | SoapHeaderTransport.renderSoapHeader | public void renderSoapHeader(final Map<String, String> context, final SOAPHeader soapHeader) {
renderSoapHeader(SOAP_HEADER_MARSHALLER, context, soapHeader);
} | java | public void renderSoapHeader(final Map<String, String> context, final SOAPHeader soapHeader) {
renderSoapHeader(SOAP_HEADER_MARSHALLER, context, soapHeader);
} | [
"public",
"void",
"renderSoapHeader",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"context",
",",
"final",
"SOAPHeader",
"soapHeader",
")",
"{",
"renderSoapHeader",
"(",
"SOAP_HEADER_MARSHALLER",
",",
"context",
",",
"soapHeader",
")",
";",
"}"
] | Renders a given context map into a given soapHeader. | [
"Renders",
"a",
"given",
"context",
"map",
"into",
"a",
"given",
"soapHeader",
"."
] | 15a68e435248f57757beb8ceac6db5b7f6035bb3 | https://github.com/tracee/tracee/blob/15a68e435248f57757beb8ceac6db5b7f6035bb3/core/src/main/java/io/tracee/transport/SoapHeaderTransport.java#L105-L107 | train | Render the SOAP header. | Create a Java method that does the following: "Render the SOAP header.". | Of course, here is the Java code you requested:
```java
public void renderSoapHeader(final Map<String, String> context, final SOAPHeader soapHeader) {
renderSoapHeader(SOAP_HEADER_MARSHALLER, context, soapHeader);
}
```
Hope this helps! | |
jingwei/krati | krati-main/src/examples/java/krati/examples/KratiDataPartition.java | KratiDataPartition.populate | public void populate() throws Exception {
for (int i = 0, cnt = _partition.getIdCount(); i < cnt; i++) {
int memberId = _partition.getIdStart() + i;
_partition.set(memberId, createDataForMember(memberId), System.nanoTime());
}
_partition.sync();
} | java | public void populate() throws Exception {
for (int i = 0, cnt = _partition.getIdCount(); i < cnt; i++) {
int memberId = _partition.getIdStart() + i;
_partition.set(memberId, createDataForMember(memberId), System.nanoTime());
}
_partition.sync();
} | [
"public",
"void",
"populate",
"(",
")",
"throws",
"Exception",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"cnt",
"=",
"_partition",
".",
"getIdCount",
"(",
")",
";",
"i",
"<",
"cnt",
";",
"i",
"++",
")",
"{",
"int",
"memberId",
"=",
"_partition",
... | Populates the underlying data partition.
@throws Exception | [
"Populates",
"the",
"underlying",
"data",
"partition",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/examples/java/krati/examples/KratiDataPartition.java#L74-L80 | train | Populates the data structures. | Create a Java method that does the following: "Populates the data structures.". | Of course, here is the Java code you requested:
```java
public void populate() throws Exception {
for (int i = 0, cnt = _partition.getIdCount(); i < cnt; i++) {
int memberId = _partition.getIdStart() + i;
_partition.set(memberId, createDataForMember(memberId), System.nanoTime());
... | |
santhosh-tekuri/jlibs | xml/src/main/java/jlibs/xml/sax/MyXMLFilter.java | MyXMLFilter.setupParsing | private void setupParsing() throws SAXException{
parent.setEntityResolver(handler);
parent.setDTDHandler(handler);
parent.setContentHandler(handler);
parent.setErrorHandler(handler);
parent.setProperty(SAXProperties.LEXICAL_HANDLER, handler);
parent.setProperty(SAXPropert... | java | private void setupParsing() throws SAXException{
parent.setEntityResolver(handler);
parent.setDTDHandler(handler);
parent.setContentHandler(handler);
parent.setErrorHandler(handler);
parent.setProperty(SAXProperties.LEXICAL_HANDLER, handler);
parent.setProperty(SAXPropert... | [
"private",
"void",
"setupParsing",
"(",
")",
"throws",
"SAXException",
"{",
"parent",
".",
"setEntityResolver",
"(",
"handler",
")",
";",
"parent",
".",
"setDTDHandler",
"(",
"handler",
")",
";",
"parent",
".",
"setContentHandler",
"(",
"handler",
")",
";",
... | /*-------------------------------------------------[ Parsing ]--------------------------------------------------- | [
"/",
"*",
"-------------------------------------------------",
"[",
"Parsing",
"]",
"---------------------------------------------------"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/xml/src/main/java/jlibs/xml/sax/MyXMLFilter.java#L80-L87 | train | Setup the parsing. | Create a Java method that does the following: "Setup the parsing.". | Of course, here is the Java code you requested:
```java
private void setupParsing() throws SAXException{
parent.setEntityResolver(handler);
parent.setDTDHandler(handler);
parent.setContentHandler(handler);
parent.setErrorHandler(handler);
parent.setProperty(SAXProperties.LEXICAL... | |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/GCCHSTImpl.java | GCCHSTImpl.eIsSet | @Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.GCCHST__CP:
return CP_EDEFAULT == null ? cp != null : !CP_EDEFAULT.equals(cp);
}
return super.eIsSet(featureID);
} | java | @Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.GCCHST__CP:
return CP_EDEFAULT == null ? cp != null : !CP_EDEFAULT.equals(cp);
}
return super.eIsSet(featureID);
} | [
"@",
"Override",
"public",
"boolean",
"eIsSet",
"(",
"int",
"featureID",
")",
"{",
"switch",
"(",
"featureID",
")",
"{",
"case",
"AfplibPackage",
".",
"GCCHST__CP",
":",
"return",
"CP_EDEFAULT",
"==",
"null",
"?",
"cp",
"!=",
"null",
":",
"!",
"CP_EDEFAULT... | <!-- 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/GCCHSTImpl.java#L139-L146 | train | Returns true if the feature is set to the value of the CP feature. | Create a Java method that does the following: "Returns true if the feature is set to the value of the CP feature.". | Of course, here is the Java code you requested:
```java
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.GCCHST__CP:
return CP_EDEFAULT == null ? cp != null : !CP_EDEFAULT.equals(cp);
}
return super.eIsSet(featureID);
}
```
Hope this helps! | |
CenturyLinkCloud/mdw | mdw-workflow/src/com/centurylink/mdw/workflow/activity/task/AutoFormManualTaskActivity.java | AutoFormManualTaskActivity.execute | @Override
public void execute() throws ActivityException {
Long instanceId = null; // pre-existing instanceId
String instanceIdSpec = getInstanceIdVariable();
if (instanceIdSpec != null) {
Object value = getValue(instanceIdSpec);
if (value instanceof Long)
... | java | @Override
public void execute() throws ActivityException {
Long instanceId = null; // pre-existing instanceId
String instanceIdSpec = getInstanceIdVariable();
if (instanceIdSpec != null) {
Object value = getValue(instanceIdSpec);
if (value instanceof Long)
... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
")",
"throws",
"ActivityException",
"{",
"Long",
"instanceId",
"=",
"null",
";",
"// pre-existing instanceId",
"String",
"instanceIdSpec",
"=",
"getInstanceIdVariable",
"(",
")",
";",
"if",
"(",
"instanceIdSpec",
... | Creates a task instance unless the INSTANCE_ID_VAR attribute points
to a pre-existing instance. If the attribute is populated but the variable
value is null, the variable will be set to the newly-created instanceId. | [
"Creates",
"a",
"task",
"instance",
"unless",
"the",
"INSTANCE_ID_VAR",
"attribute",
"points",
"to",
"a",
"pre",
"-",
"existing",
"instance",
".",
"If",
"the",
"attribute",
"is",
"populated",
"but",
"the",
"variable",
"value",
"is",
"null",
"the",
"variable",
... | 91167fe65a25a5d7022cdcf8b0fae8506f5b87ce | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-workflow/src/com/centurylink/mdw/workflow/activity/task/AutoFormManualTaskActivity.java#L47-L85 | train | Override to execute the action. | Create a Java method that does the following: "Override to execute the action.". | Of course, here is the Java code you requested:
```java
@Override
public void execute() throws ActivityException {
Long instanceId = null; // pre-existing instanceId
String instanceIdSpec = getInstanceIdVariable();
if (instanceIdSpec != null) {
Object value = getValue(instanceI... | |
aws/aws-sdk-java | aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/RunScheduledInstancesResult.java | RunScheduledInstancesResult.withInstanceIdSet | public RunScheduledInstancesResult withInstanceIdSet(String... instanceIdSet) {
if (this.instanceIdSet == null) {
setInstanceIdSet(new com.amazonaws.internal.SdkInternalList<String>(instanceIdSet.length));
}
for (String ele : instanceIdSet) {
this.instanceIdSet.add(ele);
... | java | public RunScheduledInstancesResult withInstanceIdSet(String... instanceIdSet) {
if (this.instanceIdSet == null) {
setInstanceIdSet(new com.amazonaws.internal.SdkInternalList<String>(instanceIdSet.length));
}
for (String ele : instanceIdSet) {
this.instanceIdSet.add(ele);
... | [
"public",
"RunScheduledInstancesResult",
"withInstanceIdSet",
"(",
"String",
"...",
"instanceIdSet",
")",
"{",
"if",
"(",
"this",
".",
"instanceIdSet",
"==",
"null",
")",
"{",
"setInstanceIdSet",
"(",
"new",
"com",
".",
"amazonaws",
".",
"internal",
".",
"SdkInt... | <p>
The IDs of the newly launched instances.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setInstanceIdSet(java.util.Collection)} or {@link #withInstanceIdSet(java.util.Collection)} if you want
to override the existing values.
</p>
@param instanceIdSet
The IDs of the ... | [
"<p",
">",
"The",
"IDs",
"of",
"the",
"newly",
"launched",
"instances",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
"the",
"values",
"to",
"the",
"existing",
"list",
"(",
"if",
"any... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/RunScheduledInstancesResult.java#L83-L91 | train | Sets the instanceIdSet value for this RunScheduledInstancesResult. | Create a Java method that does the following: "Sets the instanceIdSet value for this RunScheduledInstancesResult.". | Of course, here is the Java code you requested:
```java
public RunScheduledInstancesResult withInstanceIdSet(String... instanceIdSet) {
if (this.instanceIdSet == null) {
setInstanceIdSet(new com.amazonaws.internal.SdkInternalList<String>(instanceIdSet.length));
}
for (String ele : i... | |
RestComm/jdiameter | core/jdiameter/impl/src/main/java/org/jdiameter/common/impl/app/cxdx/CxDxSessionFactoryImpl.java | CxDxSessionFactoryImpl.doRegistrationTerminationAnswer | @Override
public void doRegistrationTerminationAnswer(ServerCxDxSession appSession, JRegistrationTerminationRequest request,
JRegistrationTerminationAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException {
logger.info("Diameter Cx/Dx Session Factory :: d... | java | @Override
public void doRegistrationTerminationAnswer(ServerCxDxSession appSession, JRegistrationTerminationRequest request,
JRegistrationTerminationAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException {
logger.info("Diameter Cx/Dx Session Factory :: d... | [
"@",
"Override",
"public",
"void",
"doRegistrationTerminationAnswer",
"(",
"ServerCxDxSession",
"appSession",
",",
"JRegistrationTerminationRequest",
"request",
",",
"JRegistrationTerminationAnswer",
"answer",
")",
"throws",
"InternalException",
",",
"IllegalDiameterStateExceptio... | /*
(non-Javadoc)
@see org.jdiameter.api.cxdx.ServerCxDxSessionListener#doRegistrationTerminationAnswer(org.jdiameter.api.cxdx.ServerCxDxSession,
org.jdiameter.api.cxdx.events.JRegistrationTerminationRequest, org.jdiameter.api.cxdx.events.JRegistrationTerminationAnswer) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 672134c378ea9704bf06dbe1985872ad4ebf4640 | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/core/jdiameter/impl/src/main/java/org/jdiameter/common/impl/app/cxdx/CxDxSessionFactoryImpl.java#L490-L495 | train | Method called to handle the
banner request. | Create a Java method that does the following: "Method called to handle the
banner request.". | Of course, here is the Java code you requested:
```java
@Override
public void doRegistrationTerminationAnswer(ServerCxDxSession appSession, JRegistrationTerminationRequest request,
JRegistrationTerminationAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadExceptio... | |
aws/aws-sdk-java | aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/BatchGetPartitionRequest.java | BatchGetPartitionRequest.withPartitionsToGet | public BatchGetPartitionRequest withPartitionsToGet(PartitionValueList... partitionsToGet) {
if (this.partitionsToGet == null) {
setPartitionsToGet(new java.util.ArrayList<PartitionValueList>(partitionsToGet.length));
}
for (PartitionValueList ele : partitionsToGet) {
thi... | java | public BatchGetPartitionRequest withPartitionsToGet(PartitionValueList... partitionsToGet) {
if (this.partitionsToGet == null) {
setPartitionsToGet(new java.util.ArrayList<PartitionValueList>(partitionsToGet.length));
}
for (PartitionValueList ele : partitionsToGet) {
thi... | [
"public",
"BatchGetPartitionRequest",
"withPartitionsToGet",
"(",
"PartitionValueList",
"...",
"partitionsToGet",
")",
"{",
"if",
"(",
"this",
".",
"partitionsToGet",
"==",
"null",
")",
"{",
"setPartitionsToGet",
"(",
"new",
"java",
".",
"util",
".",
"ArrayList",
... | <p>
A list of partition values identifying the partitions to retrieve.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setPartitionsToGet(java.util.Collection)} or {@link #withPartitionsToGet(java.util.Collection)} if you
want to override the existing values.
</p>
@param... | [
"<p",
">",
"A",
"list",
"of",
"partition",
"values",
"identifying",
"the",
"partitions",
"to",
"retrieve",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
"the",
"values",
"to",
"the",
"e... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/BatchGetPartitionRequest.java#L225-L233 | train | A list of partitions to get. | Create a Java method that does the following: "A list of partitions to get.". | Of course, here is the Java code you requested:
```java
public BatchGetPartitionRequest withPartitionsToGet(PartitionValueList... partitionsToGet) {
if (this.partitionsToGet == null) {
setPartitionsToGet(new java.util.ArrayList<PartitionValueList>(partitionsToGet.length));
}
for (Pa... | |
jbake-org/jbake | jbake-core/src/main/java/org/jbake/app/Asset.java | Asset.copySingleFile | public void copySingleFile(File asset) {
try {
if ( !asset.isDirectory() ) {
String targetPath = config.getDestinationFolder().getCanonicalPath() + File.separatorChar + assetSubPath(asset);
LOGGER.info("Copying single asset file to [{}]", targetPath);
... | java | public void copySingleFile(File asset) {
try {
if ( !asset.isDirectory() ) {
String targetPath = config.getDestinationFolder().getCanonicalPath() + File.separatorChar + assetSubPath(asset);
LOGGER.info("Copying single asset file to [{}]", targetPath);
... | [
"public",
"void",
"copySingleFile",
"(",
"File",
"asset",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"asset",
".",
"isDirectory",
"(",
")",
")",
"{",
"String",
"targetPath",
"=",
"config",
".",
"getDestinationFolder",
"(",
")",
".",
"getCanonicalPath",
"(",
"... | Copy one asset file at a time.
@param asset The asset file to copy | [
"Copy",
"one",
"asset",
"file",
"at",
"a",
"time",
"."
] | beb9042a54bf0eb168821d524c88b9ea0bee88dc | https://github.com/jbake-org/jbake/blob/beb9042a54bf0eb168821d524c88b9ea0bee88dc/jbake-core/src/main/java/org/jbake/app/Asset.java#L79-L91 | train | Copy single file. | Create a Java method that does the following: "Copy single file.". | Of course, here is the Java code you requested:
```java
public void copySingleFile(File asset) {
try {
if ( !asset.isDirectory() ) {
String targetPath = config.getDestinationFolder().getCanonicalPath() + File.separatorChar + assetSubPath(asset);
LOGGER.info("Copying ... | |
square/jna-gmp | jnagmp/src/main/java/com/squareup/jnagmp/Gmp.java | Gmp.exactDivide | public static BigInteger exactDivide(BigInteger dividend, BigInteger divisor) {
if (divisor.signum() == 0) {
throw new ArithmeticException("BigInteger divide by zero");
}
return INSTANCE.get().exactDivImpl(dividend, divisor);
} | java | public static BigInteger exactDivide(BigInteger dividend, BigInteger divisor) {
if (divisor.signum() == 0) {
throw new ArithmeticException("BigInteger divide by zero");
}
return INSTANCE.get().exactDivImpl(dividend, divisor);
} | [
"public",
"static",
"BigInteger",
"exactDivide",
"(",
"BigInteger",
"dividend",
",",
"BigInteger",
"divisor",
")",
"{",
"if",
"(",
"divisor",
".",
"signum",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"ArithmeticException",
"(",
"\"BigInteger divide by zero\"... | Divide dividend by divisor. This method only returns correct answers when the division produces
no remainder. Correct answers should not be expected when the divison would result in a
remainder.
@return dividend / divisor
@throws ArithmeticException if divisor is zero | [
"Divide",
"dividend",
"by",
"divisor",
".",
"This",
"method",
"only",
"returns",
"correct",
"answers",
"when",
"the",
"division",
"produces",
"no",
"remainder",
".",
"Correct",
"answers",
"should",
"not",
"be",
"expected",
"when",
"the",
"divison",
"would",
"r... | 192d26d97d6773bc3c68ccfa97450f4257d54838 | https://github.com/square/jna-gmp/blob/192d26d97d6773bc3c68ccfa97450f4257d54838/jnagmp/src/main/java/com/squareup/jnagmp/Gmp.java#L165-L170 | train | Exact division of two BigIntegers. | Create a Java method that does the following: "Exact division of two BigIntegers.". | Of course, here is the Java code you requested:
```java
public static BigInteger exactDivide(BigInteger dividend, BigInteger divisor) {
if (divisor.signum() == 0) {
throw new ArithmeticException("BigInteger divide by zero");
}
return INSTANCE.get().exactDivImpl(dividend, divisor);
}
```
Hope this ... | |
lucee/Lucee | core/src/main/java/lucee/transformer/bytecode/util/ExpressionUtil.java | ExpressionUtil.writeOutSilent | public static void writeOutSilent(Expression value, BytecodeContext bc, int mode) throws TransformerException {
Position start = value.getStart();
Position end = value.getEnd();
value.setStart(null);
value.setEnd(null);
value.writeOut(bc, mode);
value.setStart(start);
value.setEnd(end);
} | java | public static void writeOutSilent(Expression value, BytecodeContext bc, int mode) throws TransformerException {
Position start = value.getStart();
Position end = value.getEnd();
value.setStart(null);
value.setEnd(null);
value.writeOut(bc, mode);
value.setStart(start);
value.setEnd(end);
} | [
"public",
"static",
"void",
"writeOutSilent",
"(",
"Expression",
"value",
",",
"BytecodeContext",
"bc",
",",
"int",
"mode",
")",
"throws",
"TransformerException",
"{",
"Position",
"start",
"=",
"value",
".",
"getStart",
"(",
")",
";",
"Position",
"end",
"=",
... | write out expression without LNT
@param value
@param bc
@param mode
@throws TransformerException | [
"write",
"out",
"expression",
"without",
"LNT"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/bytecode/util/ExpressionUtil.java#L105-L113 | train | Write out the expression. | Create a Java method that does the following: "Write out the expression.". | Of course, here is the Java code you requested:
```java
public static void writeOutSilent(Expression value, BytecodeContext bc, int mode) throws TransformerException {
Position start = value.getStart();
Position end = value.getEnd();
value.setStart(null);
value.setEnd(null);
value.writeOut(bc, mode);
value.setSt... | |
apiman/apiman | gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/engine/VertxConfigDrivenEngineFactory.java | VertxConfigDrivenEngineFactory.doInstantiate | @Override
@SuppressWarnings("nls")
protected <T> T doInstantiate(Class<T> type, Map<String, String> mapConfig) {
try {
Constructor<T> constructor = type.getConstructor(Vertx.class, VertxEngineConfig.class, Map.class);
return constructor.newInstance(vertx, vxConfig, mapConfig);
... | java | @Override
@SuppressWarnings("nls")
protected <T> T doInstantiate(Class<T> type, Map<String, String> mapConfig) {
try {
Constructor<T> constructor = type.getConstructor(Vertx.class, VertxEngineConfig.class, Map.class);
return constructor.newInstance(vertx, vxConfig, mapConfig);
... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"nls\"",
")",
"protected",
"<",
"T",
">",
"T",
"doInstantiate",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"Map",
"<",
"String",
",",
"String",
">",
"mapConfig",
")",
"{",
"try",
"{",
"Constructor",
"<",
... | NB: We can't override static parent version of instantiate. | [
"NB",
":",
"We",
"can",
"t",
"override",
"static",
"parent",
"version",
"of",
"instantiate",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/engine/VertxConfigDrivenEngineFactory.java#L58-L87 | train | This method is called to create a new instance of the given class. | Create a Java method that does the following: "This method is called to create a new instance of the given class.". | Of course, here is the Java code you requested:
```java
@Override
@SuppressWarnings("nls")
protected <T> T doInstantiate(Class<T> type, Map<String, String> mapConfig) {
try {
Constructor<T> constructor = type.getConstructor(Vertx.class, VertxEngineConfig.class, Map.class);
retur... | |
liferay/com-liferay-commerce | commerce-api/src/main/java/com/liferay/commerce/service/CommerceOrderPaymentLocalServiceUtil.java | CommerceOrderPaymentLocalServiceUtil.deleteCommerceOrderPayment | public static com.liferay.commerce.model.CommerceOrderPayment deleteCommerceOrderPayment(
com.liferay.commerce.model.CommerceOrderPayment commerceOrderPayment) {
return getService().deleteCommerceOrderPayment(commerceOrderPayment);
} | java | public static com.liferay.commerce.model.CommerceOrderPayment deleteCommerceOrderPayment(
com.liferay.commerce.model.CommerceOrderPayment commerceOrderPayment) {
return getService().deleteCommerceOrderPayment(commerceOrderPayment);
} | [
"public",
"static",
"com",
".",
"liferay",
".",
"commerce",
".",
"model",
".",
"CommerceOrderPayment",
"deleteCommerceOrderPayment",
"(",
"com",
".",
"liferay",
".",
"commerce",
".",
"model",
".",
"CommerceOrderPayment",
"commerceOrderPayment",
")",
"{",
"return",
... | Deletes the commerce order payment from the database. Also notifies the appropriate model listeners.
@param commerceOrderPayment the commerce order payment
@return the commerce order payment that was removed | [
"Deletes",
"the",
"commerce",
"order",
"payment",
"from",
"the",
"database",
".",
"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/CommerceOrderPaymentLocalServiceUtil.java#L90-L93 | train | Deletes the commerce order payment from the database. Also notifies the appropriate model listeners. | Create a Java method that does the following: "Deletes the commerce order payment from the database. Also notifies the appropriate model listeners.". | Of course, here is the Java code you requested:
```java
public static com.liferay.commerce.model.CommerceOrderPayment deleteCommerceOrderPayment(
com.liferay.commerce.model.CommerceOrderPayment commerceOrderPayment) {
return getService().deleteCommerceOrderPayment(commerceOrderPayment);
}
```
Hope this helps! | |
tstirrat/ucm-twine | src/main/java/org/ucmtwine/parameter/ParameterMarshaller.java | ParameterMarshaller.getTypeArray | public Class<?>[] getTypeArray() {
Class<?>[] typeArray = new Class[this.parameters.size()];
for (int i = 0; i < this.parameters.size(); i++) {
typeArray[i] = this.parameters.get(i).getType();
}
return typeArray;
} | java | public Class<?>[] getTypeArray() {
Class<?>[] typeArray = new Class[this.parameters.size()];
for (int i = 0; i < this.parameters.size(); i++) {
typeArray[i] = this.parameters.get(i).getType();
}
return typeArray;
} | [
"public",
"Class",
"<",
"?",
">",
"[",
"]",
"getTypeArray",
"(",
")",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"typeArray",
"=",
"new",
"Class",
"[",
"this",
".",
"parameters",
".",
"size",
"(",
")",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
... | Returns an array of types for use with reflection method.invoke().
@return | [
"Returns",
"an",
"array",
"of",
"types",
"for",
"use",
"with",
"reflection",
"method",
".",
"invoke",
"()",
"."
] | df53650f26c404c8de74ae06efa70c963933d4e9 | https://github.com/tstirrat/ucm-twine/blob/df53650f26c404c8de74ae06efa70c963933d4e9/src/main/java/org/ucmtwine/parameter/ParameterMarshaller.java#L97-L106 | valid | Get the type array. | Create a Java method that does the following: "Get the type array.". | Of course, here is the Java code you requested:
```java
public Class<?>[] getTypeArray() {
Class<?>[] typeArray = new Class[this.parameters.size()];
for (int i = 0; i < this.parameters.size(); i++) {
typeArray[i] = this.parameters.get(i).getType();
}
return typeArray;
}
```
Hope this helps! | |
jcustenborder/connect-utils | connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ConfigUtils.java | ConfigUtils.uris | public static List<URI> uris(AbstractConfig config, String key) {
List<URI> result = new ArrayList<>();
List<String> input = config.getList(key);
for (String s : input) {
result.add(uri(key, s));
}
return ImmutableList.copyOf(result);
} | java | public static List<URI> uris(AbstractConfig config, String key) {
List<URI> result = new ArrayList<>();
List<String> input = config.getList(key);
for (String s : input) {
result.add(uri(key, s));
}
return ImmutableList.copyOf(result);
} | [
"public",
"static",
"List",
"<",
"URI",
">",
"uris",
"(",
"AbstractConfig",
"config",
",",
"String",
"key",
")",
"{",
"List",
"<",
"URI",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"List",
"<",
"String",
">",
"input",
"=",
"config",... | Method is used to retrieve a list of URI(s) from a configuration key.
@param config Config to read
@param key Key to read
@return URI for the value. | [
"Method",
"is",
"used",
"to",
"retrieve",
"a",
"list",
"of",
"URI",
"(",
"s",
")",
"from",
"a",
"configuration",
"key",
"."
] | 19add138921f59ffcc85282d7aad551eeb582370 | https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ConfigUtils.java#L276-L283 | train | Get a list of URIs from a config. | Create a Java method that does the following: "Get a list of URIs from a config.". | Of course, here is the Java code you requested:
```java
public static List<URI> uris(AbstractConfig config, String key) {
List<URI> result = new ArrayList<>();
List<String> input = config.getList(key);
for (String s : input) {
result.add(uri(key, s));
}
return ImmutableList.copyOf(result);
... | |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/UserProfileHandlerImpl.java | UserProfileHandlerImpl.removeUserProfile | public UserProfile removeUserProfile(String userName, boolean broadcast) throws Exception
{
Session session = service.getStorageSession();
try
{
return removeUserProfile(session, userName, broadcast);
}
finally
{
session.logout();
}
} | java | public UserProfile removeUserProfile(String userName, boolean broadcast) throws Exception
{
Session session = service.getStorageSession();
try
{
return removeUserProfile(session, userName, broadcast);
}
finally
{
session.logout();
}
} | [
"public",
"UserProfile",
"removeUserProfile",
"(",
"String",
"userName",
",",
"boolean",
"broadcast",
")",
"throws",
"Exception",
"{",
"Session",
"session",
"=",
"service",
".",
"getStorageSession",
"(",
")",
";",
"try",
"{",
"return",
"removeUserProfile",
"(",
... | {@inheritDoc} | [
"{"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/UserProfileHandlerImpl.java#L178-L189 | train | Remove a UserProfile from the UserProfile store. | Create a Java method that does the following: "Remove a UserProfile from the UserProfile store.". | Of course, here is the Java code you requested:
```java
public UserProfile removeUserProfile(String userName, boolean broadcast) throws Exception
{
Session session = service.getStorageSession();
try
{
return removeUserProfile(session, userName, broadcast);
}
finally
{
... | |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/face/AipFace.java | AipFace.videoFaceliveness | public JSONObject videoFaceliveness(String sessionId, byte[] video, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("session_id", sessionId);
String base64Content = Base64Util.encode(video);
request.addBody("video... | java | public JSONObject videoFaceliveness(String sessionId, byte[] video, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("session_id", sessionId);
String base64Content = Base64Util.encode(video);
request.addBody("video... | [
"public",
"JSONObject",
"videoFaceliveness",
"(",
"String",
"sessionId",
",",
"byte",
"[",
"]",
"video",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",... | 视频活体检测接口接口
@param sessionId - 语音校验码会话id,使用此接口的前提是已经调用了语音校验码接口
@param video - 二进制图像数据
@param options - 可选参数对象,key: value都为string类型
options - options列表:
@return JSONObject | [
"视频活体检测接口接口"
] | 16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90 | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/face/AipFace.java#L441-L455 | train | Perform a video Faceliveness | Create a Java method that does the following: "Perform a video Faceliveness". | Of course, here is the Java code you requested:
```java
public JSONObject videoFaceliveness(String sessionId, byte[] video, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("session_id", sessionId);
String base64Content =... | |
EdwardRaff/JSAT | JSAT/src/jsat/utils/GridDataGenerator.java | GridDataGenerator.addSamples | private void addSamples(int[] curClass, int curDim, int samples, List<DataPoint> dataPoints, int[] dim)
{
if(curDim < dimensions.length-1)
for(int i = 0; i < dimensions[curDim+1]; i++ )
{
int[] nextDim = Arrays.copyOf(dim, dim.length);
nextDim[cu... | java | private void addSamples(int[] curClass, int curDim, int samples, List<DataPoint> dataPoints, int[] dim)
{
if(curDim < dimensions.length-1)
for(int i = 0; i < dimensions[curDim+1]; i++ )
{
int[] nextDim = Arrays.copyOf(dim, dim.length);
nextDim[cu... | [
"private",
"void",
"addSamples",
"(",
"int",
"[",
"]",
"curClass",
",",
"int",
"curDim",
",",
"int",
"samples",
",",
"List",
"<",
"DataPoint",
">",
"dataPoints",
",",
"int",
"[",
"]",
"dim",
")",
"{",
"if",
"(",
"curDim",
"<",
"dimensions",
".",
"len... | Helper function
@param curClass used as a pointer to an integer so that we dont have to add class tracking logic
@param curDim the current dimension to split on. If we are at the last dimension, we add data points instead.
@param samples the number of samples to take for each class
@param dataPoints the location to put... | [
"Helper",
"function"
] | 0ff53b7b39684b2379cc1da522f5b3a954b15cfb | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/utils/GridDataGenerator.java#L90-L110 | train | Add samples to dataPoints list. | Create a Java method that does the following: "Add samples to dataPoints list.". | Of course, here is the Java code you requested:
```java
private void addSamples(int[] curClass, int curDim, int samples, List<DataPoint> dataPoints, int[] dim)
{
if(curDim < dimensions.length-1)
for(int i = 0; i < dimensions[curDim+1]; i++ )
{
int[] nextDim = Ar... | |
apache/incubator-heron | heron/metricsmgr/src/java/org/apache/heron/metricsmgr/sink/AbstractWebSink.java | AbstractWebSink.startHttpServer | protected void startHttpServer(String path, int port) {
try {
httpServer = HttpServer.create(new InetSocketAddress(port), 0);
httpServer.createContext(path, httpExchange -> {
byte[] response = generateResponse();
httpExchange.sendResponseHeaders(HTTP_STATUS_OK, response.length);
... | java | protected void startHttpServer(String path, int port) {
try {
httpServer = HttpServer.create(new InetSocketAddress(port), 0);
httpServer.createContext(path, httpExchange -> {
byte[] response = generateResponse();
httpExchange.sendResponseHeaders(HTTP_STATUS_OK, response.length);
... | [
"protected",
"void",
"startHttpServer",
"(",
"String",
"path",
",",
"int",
"port",
")",
"{",
"try",
"{",
"httpServer",
"=",
"HttpServer",
".",
"create",
"(",
"new",
"InetSocketAddress",
"(",
"port",
")",
",",
"0",
")",
";",
"httpServer",
".",
"createContex... | Start a http server on supplied port that will serve the metrics, as json,
on the specified path.
@param path
@param port | [
"Start",
"a",
"http",
"server",
"on",
"supplied",
"port",
"that",
"will",
"serve",
"the",
"metrics",
"as",
"json",
"on",
"the",
"specified",
"path",
"."
] | 776abe2b5a45b93a0eb957fd65cbc149d901a92a | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/metricsmgr/src/java/org/apache/heron/metricsmgr/sink/AbstractWebSink.java#L129-L145 | train | Start the Http server on the given port. | Create a Java method that does the following: "Start the Http server on the given port.". | Of course, here is the Java code you requested:
```java
protected void startHttpServer(String path, int port) {
try {
httpServer = HttpServer.create(new InetSocketAddress(port), 0);
httpServer.createContext(path, httpExchange -> {
byte[] response = generateResponse();
httpExchange.sendR... | |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/sharedgroups/SharedGroupManager.java | SharedGroupManager.getSharedGroups | public static List<String> getSharedGroups(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
// Discover the shared groups of the logged user
SharedGroupsInfo info = new SharedGroupsInfo();
info.setType(IQ.Type.get);
... | java | public static List<String> getSharedGroups(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
// Discover the shared groups of the logged user
SharedGroupsInfo info = new SharedGroupsInfo();
info.setType(IQ.Type.get);
... | [
"public",
"static",
"List",
"<",
"String",
">",
"getSharedGroups",
"(",
"XMPPConnection",
"connection",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"// Discover the shared groups of the logge... | Returns the collection that will contain the name of the shared groups where the user
logged in with the specified session belongs.
@param connection connection to use to get the user's shared groups.
@return collection with the shared groups' name of the logged user.
@throws XMPPErrorException
@throws NoResponseExcep... | [
"Returns",
"the",
"collection",
"that",
"will",
"contain",
"the",
"name",
"of",
"the",
"shared",
"groups",
"where",
"the",
"user",
"logged",
"in",
"with",
"the",
"specified",
"session",
"belongs",
"."
] | 870756997faec1e1bfabfac0cd6c2395b04da873 | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/sharedgroups/SharedGroupManager.java#L50-L57 | train | Get the list of shared groups of the logged user. | Create a Java method that does the following: "Get the list of shared groups of the logged user.". | Of course, here is the Java code you requested:
```java
public static List<String> getSharedGroups(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
// Discover the shared groups of the logged user
SharedGroupsInfo info = new Shared... | |
navnorth/LRJavaLib | src/com/navnorth/learningregistry/LRActivity.java | LRActivity.addContextToVerb | public boolean addContextToVerb(String objectType, String id, String description)
{
Map<String, Object> container = new HashMap<String, Object>();
if (objectType != null)
{
container.put("objectType", objectType);
}
if (id != null)
{
c... | java | public boolean addContextToVerb(String objectType, String id, String description)
{
Map<String, Object> container = new HashMap<String, Object>();
if (objectType != null)
{
container.put("objectType", objectType);
}
if (id != null)
{
c... | [
"public",
"boolean",
"addContextToVerb",
"(",
"String",
"objectType",
",",
"String",
"id",
",",
"String",
"description",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"container",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
... | Add a context object to the verb within this activity
@param objectType The type of context
@param id The id of the context
@param description Description of the context
@return True if added, false if not (due to lack of "verb") | [
"Add",
"a",
"context",
"object",
"to",
"the",
"verb",
"within",
"this",
"activity"
] | 27af28b9f80d772273592414e7d0dccffaac09e1 | https://github.com/navnorth/LRJavaLib/blob/27af28b9f80d772273592414e7d0dccffaac09e1/src/com/navnorth/learningregistry/LRActivity.java#L238-L257 | train | Add a context to a verb. | Create a Java method that does the following: "Add a context to a verb.". | Of course, here is the Java code you requested:
```java
public boolean addContextToVerb(String objectType, String id, String description)
{
Map<String, Object> container = new HashMap<String, Object>();
if (objectType != null)
{
container.put("objectType", objectType);
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.