repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
gilberto-torrezan/viacep | src/main/java/com/github/gilbertotorrezan/viacep/gwt/ViaCEPGWTClient.java | ViaCEPGWTClient.getEndereco | public void getEndereco(String cep, MethodCallback<ViaCEPEndereco> callback) {
"""
Executa a consulta de endereço a partir de um CEP.
@param cep CEP da localidade onde se quer consultar o endereço. Precisa ter 8 dígitos - a formatação é feita pelo cliente.
CEPs válidos (que contém 8 dígitos): "20930-040", "abc... | java | public void getEndereco(String cep, MethodCallback<ViaCEPEndereco> callback){
char[] chars = cep.toCharArray();
StringBuilder builder = new StringBuilder();
for (int i = 0; i< chars.length; i++){
if (Character.isDigit(chars[i])){
builder.append(chars[i]);
}
}
cep = builder.toString();
if (ce... | [
"public",
"void",
"getEndereco",
"(",
"String",
"cep",
",",
"MethodCallback",
"<",
"ViaCEPEndereco",
">",
"callback",
")",
"{",
"char",
"[",
"]",
"chars",
"=",
"cep",
".",
"toCharArray",
"(",
")",
";",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",... | Executa a consulta de endereço a partir de um CEP.
@param cep CEP da localidade onde se quer consultar o endereço. Precisa ter 8 dígitos - a formatação é feita pelo cliente.
CEPs válidos (que contém 8 dígitos): "20930-040", "abc0 1311000xy z", "20930 040". CEPs inválidos (que não contém 8 dígitos): "00000", "abc", "12... | [
"Executa",
"a",
"consulta",
"de",
"endereço",
"a",
"partir",
"de",
"um",
"CEP",
"."
] | train | https://github.com/gilberto-torrezan/viacep/blob/96f203f72accb970e20a14792f0ea0b1b6553e3f/src/main/java/com/github/gilbertotorrezan/viacep/gwt/ViaCEPGWTClient.java#L87-L105 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java | CacheProviderWrapper.batchUpdate | @Override
public void batchUpdate(HashMap invalidateIdEvents, HashMap invalidateTemplateEvents, ArrayList pushEntryEvents) {
"""
This method is used only by default cache provider (cache.java). Do nothing.
"""
final String methodName = "batchUpdate()";
if (tc.isDebugEnabled()) {
... | java | @Override
public void batchUpdate(HashMap invalidateIdEvents, HashMap invalidateTemplateEvents, ArrayList pushEntryEvents) {
final String methodName = "batchUpdate()";
if (tc.isDebugEnabled()) {
Tr.debug(tc, methodName + " cacheName=" + cacheName + " ERROR because it should not be called... | [
"@",
"Override",
"public",
"void",
"batchUpdate",
"(",
"HashMap",
"invalidateIdEvents",
",",
"HashMap",
"invalidateTemplateEvents",
",",
"ArrayList",
"pushEntryEvents",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"batchUpdate()\"",
";",
"if",
"(",
"tc",
".",
... | This method is used only by default cache provider (cache.java). Do nothing. | [
"This",
"method",
"is",
"used",
"only",
"by",
"default",
"cache",
"provider",
"(",
"cache",
".",
"java",
")",
".",
"Do",
"nothing",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java#L1539-L1545 |
derari/cthul | log/src/main/java/org/cthul/log/CLogConfigurationBase.java | CLogConfigurationBase.detectClass | protected static String detectClass(int i) {
"""
{@code i == 0} identifies the caller of this method, for {@code i > 0},
the stack is walked upwards.
@param i
@return class name
"""
if (i < 1) {
throw new IllegalArgumentException("Expected value > 0, got " + i);
}
StackTr... | java | protected static String detectClass(int i) {
if (i < 1) {
throw new IllegalArgumentException("Expected value > 0, got " + i);
}
StackTraceElement[] stack = Thread.currentThread().getStackTrace();
// 0 getStackTrace
// 1 detectClass
// 2 getLogger
// 3 ... | [
"protected",
"static",
"String",
"detectClass",
"(",
"int",
"i",
")",
"{",
"if",
"(",
"i",
"<",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Expected value > 0, got \"",
"+",
"i",
")",
";",
"}",
"StackTraceElement",
"[",
"]",
"stack",
... | {@code i == 0} identifies the caller of this method, for {@code i > 0},
the stack is walked upwards.
@param i
@return class name | [
"{"
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/log/src/main/java/org/cthul/log/CLogConfigurationBase.java#L56-L67 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/remote/TransactionalProtocolOperationHandler.java | TransactionalProtocolOperationHandler.internalExecute | protected OperationResponse internalExecute(final Operation operation, final ManagementRequestContext<?> context, final OperationMessageHandler messageHandler, final ModelController.OperationTransactionControl control) {
"""
Subclasses can override this method to determine how to execute the method, e.g. attach to... | java | protected OperationResponse internalExecute(final Operation operation, final ManagementRequestContext<?> context, final OperationMessageHandler messageHandler, final ModelController.OperationTransactionControl control) {
// Execute the operation
return controller.execute(
operation,
... | [
"protected",
"OperationResponse",
"internalExecute",
"(",
"final",
"Operation",
"operation",
",",
"final",
"ManagementRequestContext",
"<",
"?",
">",
"context",
",",
"final",
"OperationMessageHandler",
"messageHandler",
",",
"final",
"ModelController",
".",
"OperationTran... | Subclasses can override this method to determine how to execute the method, e.g. attach to an existing operation or not
@param operation the operation being executed
@param messageHandler the operation message handler proxy
@param control the operation transaction control
@return the result of the executed operation | [
"Subclasses",
"can",
"override",
"this",
"method",
"to",
"determine",
"how",
"to",
"execute",
"the",
"method",
"e",
".",
"g",
".",
"attach",
"to",
"an",
"existing",
"operation",
"or",
"not"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/remote/TransactionalProtocolOperationHandler.java#L267-L273 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java | ShapeGenerator.createEllipseInternal | private Shape createEllipseInternal(int x, int y, int w, int h) {
"""
Return a path for an ellipse.
@param x the X coordinate of the upper-left corner of the ellipse
@param y the Y coordinate of the upper-left corner of the ellipse
@param w the width of the ellipse
@param h the height of the ellipse
@... | java | private Shape createEllipseInternal(int x, int y, int w, int h) {
ellipse.setFrame(x, y, w, h);
return ellipse;
} | [
"private",
"Shape",
"createEllipseInternal",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"w",
",",
"int",
"h",
")",
"{",
"ellipse",
".",
"setFrame",
"(",
"x",
",",
"y",
",",
"w",
",",
"h",
")",
";",
"return",
"ellipse",
";",
"}"
] | Return a path for an ellipse.
@param x the X coordinate of the upper-left corner of the ellipse
@param y the Y coordinate of the upper-left corner of the ellipse
@param w the width of the ellipse
@param h the height of the ellipse
@return a path representing the shape. | [
"Return",
"a",
"path",
"for",
"an",
"ellipse",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java#L749-L753 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Clicker.java | Clicker.clickOn | public <T extends View> void clickOn(Class<T> viewClass, int index) {
"""
Clicks on a {@code View} of a specific class, with a certain index.
@param viewClass what kind of {@code View} to click, e.g. {@code Button.class} or {@code ImageView.class}
@param index the index of the {@code View} to be clicked, withi... | java | public <T extends View> void clickOn(Class<T> viewClass, int index) {
clickOnScreen(waiter.waitForAndGetView(index, viewClass));
} | [
"public",
"<",
"T",
"extends",
"View",
">",
"void",
"clickOn",
"(",
"Class",
"<",
"T",
">",
"viewClass",
",",
"int",
"index",
")",
"{",
"clickOnScreen",
"(",
"waiter",
".",
"waitForAndGetView",
"(",
"index",
",",
"viewClass",
")",
")",
";",
"}"
] | Clicks on a {@code View} of a specific class, with a certain index.
@param viewClass what kind of {@code View} to click, e.g. {@code Button.class} or {@code ImageView.class}
@param index the index of the {@code View} to be clicked, within {@code View}s of the specified class | [
"Clicks",
"on",
"a",
"{",
"@code",
"View",
"}",
"of",
"a",
"specific",
"class",
"with",
"a",
"certain",
"index",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Clicker.java#L494-L496 |
maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/activity/ActivityLauncher.java | ActivityLauncher.startActivity | public static void startActivity(@Nullable Activity activity, Class<? extends Activity> targetActivityClass) {
"""
Launches a new {@link Activity}
@param targetActivityClass The target {@link Activity} class to launch
"""
if (activity != null) {
if (activity.getClass() != targetActivityClass) {
Int... | java | public static void startActivity(@Nullable Activity activity, Class<? extends Activity> targetActivityClass) {
if (activity != null) {
if (activity.getClass() != targetActivityClass) {
Intent intent = new Intent(activity, targetActivityClass);
activity.startActivity(intent);
}
} else {
LOGGER.warn(... | [
"public",
"static",
"void",
"startActivity",
"(",
"@",
"Nullable",
"Activity",
"activity",
",",
"Class",
"<",
"?",
"extends",
"Activity",
">",
"targetActivityClass",
")",
"{",
"if",
"(",
"activity",
"!=",
"null",
")",
"{",
"if",
"(",
"activity",
".",
"getC... | Launches a new {@link Activity}
@param targetActivityClass The target {@link Activity} class to launch | [
"Launches",
"a",
"new",
"{",
"@link",
"Activity",
"}"
] | train | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/activity/ActivityLauncher.java#L84-L93 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java | CmsSitemapController.clearDeletedList | public void clearDeletedList() {
"""
Clears the deleted clip-board list and commits the change.<p>
"""
CmsSitemapClipboardData clipboardData = getData().getClipboardData().copy();
clipboardData.getDeletions().clear();
CmsSitemapChange change = new CmsSitemapChange(null, null, ChangeTyp... | java | public void clearDeletedList() {
CmsSitemapClipboardData clipboardData = getData().getClipboardData().copy();
clipboardData.getDeletions().clear();
CmsSitemapChange change = new CmsSitemapChange(null, null, ChangeType.clipboardOnly);
change.setClipBoardData(clipboardData);
commi... | [
"public",
"void",
"clearDeletedList",
"(",
")",
"{",
"CmsSitemapClipboardData",
"clipboardData",
"=",
"getData",
"(",
")",
".",
"getClipboardData",
"(",
")",
".",
"copy",
"(",
")",
";",
"clipboardData",
".",
"getDeletions",
"(",
")",
".",
"clear",
"(",
")",
... | Clears the deleted clip-board list and commits the change.<p> | [
"Clears",
"the",
"deleted",
"clip",
"-",
"board",
"list",
"and",
"commits",
"the",
"change",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java#L402-L409 |
EvidentSolutions/dalesbred | dalesbred/src/main/java/org/dalesbred/Database.java | Database.withTransaction | public <T> T withTransaction(@NotNull TransactionCallback<T> callback) {
"""
Executes a block of code within a context of a transaction, using {@link Propagation#REQUIRED} propagation.
"""
return withTransaction(Propagation.REQUIRED, Isolation.DEFAULT, callback);
} | java | public <T> T withTransaction(@NotNull TransactionCallback<T> callback) {
return withTransaction(Propagation.REQUIRED, Isolation.DEFAULT, callback);
} | [
"public",
"<",
"T",
">",
"T",
"withTransaction",
"(",
"@",
"NotNull",
"TransactionCallback",
"<",
"T",
">",
"callback",
")",
"{",
"return",
"withTransaction",
"(",
"Propagation",
".",
"REQUIRED",
",",
"Isolation",
".",
"DEFAULT",
",",
"callback",
")",
";",
... | Executes a block of code within a context of a transaction, using {@link Propagation#REQUIRED} propagation. | [
"Executes",
"a",
"block",
"of",
"code",
"within",
"a",
"context",
"of",
"a",
"transaction",
"using",
"{"
] | train | https://github.com/EvidentSolutions/dalesbred/blob/713f5b6e152d97e1672ca68b9ff9c7c6c288ceb1/dalesbred/src/main/java/org/dalesbred/Database.java#L155-L157 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/component/UIViewRoot.java | UIViewRoot.resetValues | public void resetValues(FacesContext context, Collection<String> clientIds) {
"""
<p class="changed_added_2_2">Visit the clientIds and, if the component is
an instance of {@link EditableValueHolder},
call its {@link EditableValueHolder#resetValue} method.
Use {@link #visitTree} to do the visiting.</p>
@since... | java | public void resetValues(FacesContext context, Collection<String> clientIds) {
this.visitTree(VisitContext.createVisitContext(context, clientIds, null),
new DoResetValues());
} | [
"public",
"void",
"resetValues",
"(",
"FacesContext",
"context",
",",
"Collection",
"<",
"String",
">",
"clientIds",
")",
"{",
"this",
".",
"visitTree",
"(",
"VisitContext",
".",
"createVisitContext",
"(",
"context",
",",
"clientIds",
",",
"null",
")",
",",
... | <p class="changed_added_2_2">Visit the clientIds and, if the component is
an instance of {@link EditableValueHolder},
call its {@link EditableValueHolder#resetValue} method.
Use {@link #visitTree} to do the visiting.</p>
@since 2.2
@param context the {@link FacesContext} for the request we are processing.
@param clie... | [
"<p",
"class",
"=",
"changed_added_2_2",
">",
"Visit",
"the",
"clientIds",
"and",
"if",
"the",
"component",
"is",
"an",
"instance",
"of",
"{",
"@link",
"EditableValueHolder",
"}",
"call",
"its",
"{",
"@link",
"EditableValueHolder#resetValue",
"}",
"method",
".",... | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/component/UIViewRoot.java#L951-L954 |
Azure/azure-sdk-for-java | compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/SnapshotsInner.java | SnapshotsInner.updateAsync | public Observable<SnapshotInner> updateAsync(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) {
"""
Updates (patches) a snapshot.
@param resourceGroupName The name of the resource group.
@param snapshotName The name of the snapshot that is being created. The name can't be changed after t... | java | public Observable<SnapshotInner> updateAsync(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) {
return updateWithServiceResponseAsync(resourceGroupName, snapshotName, snapshot).map(new Func1<ServiceResponse<SnapshotInner>, SnapshotInner>() {
@Override
public Snapsh... | [
"public",
"Observable",
"<",
"SnapshotInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"snapshotName",
",",
"SnapshotUpdate",
"snapshot",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"snapshotName",
"... | Updates (patches) a snapshot.
@param resourceGroupName The name of the resource group.
@param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
@param sna... | [
"Updates",
"(",
"patches",
")",
"a",
"snapshot",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/SnapshotsInner.java#L343-L350 |
ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/substitution/impl/ImmutableUnificationTools.java | ImmutableUnificationTools.computeMGUS | public Optional<ImmutableSubstitution<ImmutableTerm>> computeMGUS(ImmutableSubstitution<? extends ImmutableTerm> substitution1,
ImmutableSubstitution<? extends ImmutableTerm> substitution2) {
"""
Computes one Most General Unifier (MGU) of... | java | public Optional<ImmutableSubstitution<ImmutableTerm>> computeMGUS(ImmutableSubstitution<? extends ImmutableTerm> substitution1,
ImmutableSubstitution<? extends ImmutableTerm> substitution2) {
ImmutableList.Builder<ImmutableTerm> first... | [
"public",
"Optional",
"<",
"ImmutableSubstitution",
"<",
"ImmutableTerm",
">",
">",
"computeMGUS",
"(",
"ImmutableSubstitution",
"<",
"?",
"extends",
"ImmutableTerm",
">",
"substitution1",
",",
"ImmutableSubstitution",
"<",
"?",
"extends",
"ImmutableTerm",
">",
"subst... | Computes one Most General Unifier (MGU) of (two) substitutions. | [
"Computes",
"one",
"Most",
"General",
"Unifier",
"(",
"MGU",
")",
"of",
"(",
"two",
")",
"substitutions",
"."
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/substitution/impl/ImmutableUnificationTools.java#L208-L228 |
overturetool/overture | ide/debug/src/main/java/org/overture/ide/debug/ui/VdmEvaluationContextManager.java | VdmEvaluationContextManager.getEvaluationContext | public static IVdmStackFrame getEvaluationContext(IWorkbenchWindow window) {
"""
Returns the evaluation context for the given window, or <code>null</code> if none. The evaluation context
corresponds to the selected stack frame in the following priority order:
<ol>
<li>stack frame in active page of the window</l... | java | public static IVdmStackFrame getEvaluationContext(IWorkbenchWindow window)
{
List<IWorkbenchWindow> alreadyVisited = new ArrayList<IWorkbenchWindow>();
if (window == null)
{
window = fgManager.fActiveWindow;
}
return getEvaluationContext(window, alreadyVisited);
} | [
"public",
"static",
"IVdmStackFrame",
"getEvaluationContext",
"(",
"IWorkbenchWindow",
"window",
")",
"{",
"List",
"<",
"IWorkbenchWindow",
">",
"alreadyVisited",
"=",
"new",
"ArrayList",
"<",
"IWorkbenchWindow",
">",
"(",
")",
";",
"if",
"(",
"window",
"==",
"n... | Returns the evaluation context for the given window, or <code>null</code> if none. The evaluation context
corresponds to the selected stack frame in the following priority order:
<ol>
<li>stack frame in active page of the window</li>
<li>stack frame in another page of the window</li>
<li>stack frame in active page of a... | [
"Returns",
"the",
"evaluation",
"context",
"for",
"the",
"given",
"window",
"or",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"none",
".",
"The",
"evaluation",
"context",
"corresponds",
"to",
"the",
"selected",
"stack",
"frame",
"in",
"the",
"following",
... | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/debug/src/main/java/org/overture/ide/debug/ui/VdmEvaluationContextManager.java#L264-L272 |
dadoonet/elasticsearch-beyonder | src/main/java/fr/pilato/elasticsearch/tools/template/TemplateElasticsearchUpdater.java | TemplateElasticsearchUpdater.createTemplateWithJson | public static void createTemplateWithJson(RestClient client, String template, String json, boolean force) throws Exception {
"""
Create a new template in Elasticsearch
@param client Elasticsearch client
@param template Template name
@param json JSon content for the template
@param force set it to true if you w... | java | public static void createTemplateWithJson(RestClient client, String template, String json, boolean force) throws Exception {
if (isTemplateExist(client, template)) {
if (force) {
logger.debug("Template [{}] already exists. Force is set. Removing it.", template);
removeTemplate(client, template);
} else ... | [
"public",
"static",
"void",
"createTemplateWithJson",
"(",
"RestClient",
"client",
",",
"String",
"template",
",",
"String",
"json",
",",
"boolean",
"force",
")",
"throws",
"Exception",
"{",
"if",
"(",
"isTemplateExist",
"(",
"client",
",",
"template",
")",
")... | Create a new template in Elasticsearch
@param client Elasticsearch client
@param template Template name
@param json JSon content for the template
@param force set it to true if you want to force cleaning template before adding it
@throws Exception if something goes wrong | [
"Create",
"a",
"new",
"template",
"in",
"Elasticsearch"
] | train | https://github.com/dadoonet/elasticsearch-beyonder/blob/275bf63432b97169a90a266e983143cca9ad7629/src/main/java/fr/pilato/elasticsearch/tools/template/TemplateElasticsearchUpdater.java#L182-L196 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/hadoop/ConfigHelper.java | ConfigHelper.setInputRange | public static void setInputRange(Configuration conf, String startToken, String endToken, List<IndexExpression> filter) {
"""
Set the KeyRange to limit the rows.
@param conf Job configuration you are about to run
"""
KeyRange range = new KeyRange().setStart_token(startToken).setEnd_token(endToken).setR... | java | public static void setInputRange(Configuration conf, String startToken, String endToken, List<IndexExpression> filter)
{
KeyRange range = new KeyRange().setStart_token(startToken).setEnd_token(endToken).setRow_filter(filter);
conf.set(INPUT_KEYRANGE_CONFIG, thriftToString(range));
} | [
"public",
"static",
"void",
"setInputRange",
"(",
"Configuration",
"conf",
",",
"String",
"startToken",
",",
"String",
"endToken",
",",
"List",
"<",
"IndexExpression",
">",
"filter",
")",
"{",
"KeyRange",
"range",
"=",
"new",
"KeyRange",
"(",
")",
".",
"setS... | Set the KeyRange to limit the rows.
@param conf Job configuration you are about to run | [
"Set",
"the",
"KeyRange",
"to",
"limit",
"the",
"rows",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/ConfigHelper.java#L254-L258 |
hellosign/hellosign-java-sdk | src/main/java/com/hellosign/sdk/HelloSignClient.java | HelloSignClient.setAccessToken | public void setAccessToken(String accessToken, String tokenType) throws HelloSignException {
"""
Sets the access token for the OAuth user that this client will use to
perform requests.
@param accessToken String access token
@param tokenType String token type
@throws HelloSignException thrown if there's a pro... | java | public void setAccessToken(String accessToken, String tokenType) throws HelloSignException {
auth.setAccessToken(accessToken, tokenType);
} | [
"public",
"void",
"setAccessToken",
"(",
"String",
"accessToken",
",",
"String",
"tokenType",
")",
"throws",
"HelloSignException",
"{",
"auth",
".",
"setAccessToken",
"(",
"accessToken",
",",
"tokenType",
")",
";",
"}"
] | Sets the access token for the OAuth user that this client will use to
perform requests.
@param accessToken String access token
@param tokenType String token type
@throws HelloSignException thrown if there's a problem setting the access
token. | [
"Sets",
"the",
"access",
"token",
"for",
"the",
"OAuth",
"user",
"that",
"this",
"client",
"will",
"use",
"to",
"perform",
"requests",
"."
] | train | https://github.com/hellosign/hellosign-java-sdk/blob/08fa7aeb3b0c68ddb6c7ea797d114d55d36d36b1/src/main/java/com/hellosign/sdk/HelloSignClient.java#L1063-L1065 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/ObjectStreamClass.java | ObjectStreamClass.findMethod | static Method findMethod(Class<?> cl, String methodName) {
"""
Return the java.lang.reflect.Method if class <code>cl</code> implements
<code>methodName</code> . Return null otherwise.
@param cl
a java.lang.Class which to test
@return <code>java.lang.reflect.Method</code> if the class implements
writeReplace... | java | static Method findMethod(Class<?> cl, String methodName) {
Class<?> search = cl;
Method method = null;
while (search != null) {
try {
method = search.getDeclaredMethod(methodName, (Class[]) null);
if (search == cl
|| (method.get... | [
"static",
"Method",
"findMethod",
"(",
"Class",
"<",
"?",
">",
"cl",
",",
"String",
"methodName",
")",
"{",
"Class",
"<",
"?",
">",
"search",
"=",
"cl",
";",
"Method",
"method",
"=",
"null",
";",
"while",
"(",
"search",
"!=",
"null",
")",
"{",
"try... | Return the java.lang.reflect.Method if class <code>cl</code> implements
<code>methodName</code> . Return null otherwise.
@param cl
a java.lang.Class which to test
@return <code>java.lang.reflect.Method</code> if the class implements
writeReplace <code>null</code> if the class does not implement
writeReplace | [
"Return",
"the",
"java",
".",
"lang",
".",
"reflect",
".",
"Method",
"if",
"class",
"<code",
">",
"cl<",
"/",
"code",
">",
"implements",
"<code",
">",
"methodName<",
"/",
"code",
">",
".",
"Return",
"null",
"otherwise",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/ObjectStreamClass.java#L1145-L1161 |
ecclesia/kipeto | kipeto-core/src/main/java/de/ecclesia/kipeto/repository/ReadingRepositoryStrategy.java | ReadingRepositoryStrategy.retrieveStream | public InputStream retrieveStream(final String id, ByteTransferListener listener) throws IOException {
"""
Läd das Objekt mit der angegebenen Id aus dem Speicher.
@param id
Id, unter der das gewünschte Objekt abgelegt wurde
@return InputStream des gespeichernten Objektes
@throws IdNotFoundException
falls un... | java | public InputStream retrieveStream(final String id, ByteTransferListener listener) throws IOException {
Assert.isNotNull(id, "Es muss die Id des Items übergeben werden");
InputStream inputStream = retrieve(id);
CountingInputStream countingInputStream = new CountingInputStream(inputStream);
countingInputStream.a... | [
"public",
"InputStream",
"retrieveStream",
"(",
"final",
"String",
"id",
",",
"ByteTransferListener",
"listener",
")",
"throws",
"IOException",
"{",
"Assert",
".",
"isNotNull",
"(",
"id",
",",
"\"Es muss die Id des Items übergeben werden\")",
";",
"",
"InputStream",
"... | Läd das Objekt mit der angegebenen Id aus dem Speicher.
@param id
Id, unter der das gewünschte Objekt abgelegt wurde
@return InputStream des gespeichernten Objektes
@throws IdNotFoundException
falls unter <code>id</code> kein Objekt abgelegt ist
@throws IOException | [
"Läd",
"das",
"Objekt",
"mit",
"der",
"angegebenen",
"Id",
"aus",
"dem",
"Speicher",
"."
] | train | https://github.com/ecclesia/kipeto/blob/ea39a10ae4eaa550f71a856ab2f2845270a64913/kipeto-core/src/main/java/de/ecclesia/kipeto/repository/ReadingRepositoryStrategy.java#L69-L90 |
foundation-runtime/service-directory | 1.1/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java | DirectoryServiceClient._deserialize | <T> T _deserialize(String body, TypeReference<T> typeRef) {
"""
Deserialize a JSON String to a generic object.
This method is used when the target object is generic.
@param body
the JSON String.
@param typeRef
the generic type.
@return
the deserialized object instance.
@throws IOException
@throws Json... | java | <T> T _deserialize(String body, TypeReference<T> typeRef) {
if (body == null || body.isEmpty()) {
throw new ServiceException(ErrorCode.REMOTE_DIRECTORY_SERVER_ERROR,
ErrorCode.REMOTE_DIRECTORY_SERVER_ERROR
.getMessageTemplate(), "the message body is em... | [
"<",
"T",
">",
"T",
"_deserialize",
"(",
"String",
"body",
",",
"TypeReference",
"<",
"T",
">",
"typeRef",
")",
"{",
"if",
"(",
"body",
"==",
"null",
"||",
"body",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"ServiceException",
"(",
"ErrorCod... | Deserialize a JSON String to a generic object.
This method is used when the target object is generic.
@param body
the JSON String.
@param typeRef
the generic type.
@return
the deserialized object instance.
@throws IOException
@throws JsonMappingException
@throws JsonParseException | [
"Deserialize",
"a",
"JSON",
"String",
"to",
"a",
"generic",
"object",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/1.1/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java#L411-L426 |
craftercms/profile | security-provider/src/main/java/org/craftercms/security/processors/impl/UrlAccessRestrictionCheckingProcessor.java | UrlAccessRestrictionCheckingProcessor.setUrlRestrictions | @Required
public void setUrlRestrictions(Map<String, String> restrictions) {
"""
Sets the map of restrictions. Each key of the map is ANT-style path pattern, used to match the URLs of incoming
requests, and each value is a Spring EL expression.
"""
urlRestrictions = new LinkedHashMap<>();
... | java | @Required
public void setUrlRestrictions(Map<String, String> restrictions) {
urlRestrictions = new LinkedHashMap<>();
ExpressionParser parser = new SpelExpressionParser();
for (Map.Entry<String, String> entry : restrictions.entrySet()) {
urlRestrictions.put(entry.getKey(), pars... | [
"@",
"Required",
"public",
"void",
"setUrlRestrictions",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"restrictions",
")",
"{",
"urlRestrictions",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
")",
";",
"ExpressionParser",
"parser",
"=",
"new",
"SpelExpressionParser... | Sets the map of restrictions. Each key of the map is ANT-style path pattern, used to match the URLs of incoming
requests, and each value is a Spring EL expression. | [
"Sets",
"the",
"map",
"of",
"restrictions",
".",
"Each",
"key",
"of",
"the",
"map",
"is",
"ANT",
"-",
"style",
"path",
"pattern",
"used",
"to",
"match",
"the",
"URLs",
"of",
"incoming",
"requests",
"and",
"each",
"value",
"is",
"a",
"Spring",
"EL",
"ex... | train | https://github.com/craftercms/profile/blob/d829c1136b0fd21d87dc925cb7046cbd38a300a4/security-provider/src/main/java/org/craftercms/security/processors/impl/UrlAccessRestrictionCheckingProcessor.java#L95-L104 |
mgormley/prim | src/main/java_generated/edu/jhu/prim/vector/IntFloatVectorSlice.java | IntFloatVectorSlice.lookupIndex | public int lookupIndex(float value, float delta) {
"""
Gets the index of the first element in this vector with the specified
value, or -1 if it is not present.
@param value The value to search for.
@param delta The delta with which to evaluate equality.
@return The index or -1 if not present.
"""
... | java | public int lookupIndex(float value, float delta) {
for (int i=0; i<size; i++) {
if (Primitives.equals(elements[i + start], value, delta)) {
return i;
}
}
return -1;
} | [
"public",
"int",
"lookupIndex",
"(",
"float",
"value",
",",
"float",
"delta",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
"if",
"(",
"Primitives",
".",
"equals",
"(",
"elements",
"[",
"i",
"+",
"... | Gets the index of the first element in this vector with the specified
value, or -1 if it is not present.
@param value The value to search for.
@param delta The delta with which to evaluate equality.
@return The index or -1 if not present. | [
"Gets",
"the",
"index",
"of",
"the",
"first",
"element",
"in",
"this",
"vector",
"with",
"the",
"specified",
"value",
"or",
"-",
"1",
"if",
"it",
"is",
"not",
"present",
"."
] | train | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/vector/IntFloatVectorSlice.java#L170-L177 |
VoltDB/voltdb | third_party/java/src/org/apache/commons_voltpatches/cli/Option.java | Option.processValue | private void processValue(String value) {
"""
Processes the value. If this Option has a value separator
the value will have to be parsed into individual tokens. When
n-1 tokens have been processed and there are more value separators
in the value, parsing is ceased and the remaining characters are
added as a ... | java | private void processValue(String value)
{
// this Option has a separator character
if (hasValueSeparator())
{
// get the separator character
char sep = getValueSeparator();
// store the index for the value separator
int index = value.indexOf(s... | [
"private",
"void",
"processValue",
"(",
"String",
"value",
")",
"{",
"// this Option has a separator character",
"if",
"(",
"hasValueSeparator",
"(",
")",
")",
"{",
"// get the separator character",
"char",
"sep",
"=",
"getValueSeparator",
"(",
")",
";",
"// store the... | Processes the value. If this Option has a value separator
the value will have to be parsed into individual tokens. When
n-1 tokens have been processed and there are more value separators
in the value, parsing is ceased and the remaining characters are
added as a single token.
@param value The String to be processed.... | [
"Processes",
"the",
"value",
".",
"If",
"this",
"Option",
"has",
"a",
"value",
"separator",
"the",
"value",
"will",
"have",
"to",
"be",
"parsed",
"into",
"individual",
"tokens",
".",
"When",
"n",
"-",
"1",
"tokens",
"have",
"been",
"processed",
"and",
"t... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/Option.java#L451-L484 |
UrielCh/ovh-java-sdk | ovh-java-sdk-licenseoffice/src/main/java/net/minidev/ovh/api/ApiOvhLicenseoffice.java | ApiOvhLicenseoffice.serviceName_user_POST | public OvhOfficeTask serviceName_user_POST(String serviceName, String domain, String firstName, String lastName, OvhLicenceEnum licence, String login) throws IOException {
"""
Create new office user
REST: POST /license/office/{serviceName}/user
@param lastName [required] Account last name
@param firstName [re... | java | public OvhOfficeTask serviceName_user_POST(String serviceName, String domain, String firstName, String lastName, OvhLicenceEnum licence, String login) throws IOException {
String qPath = "/license/office/{serviceName}/user";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<Strin... | [
"public",
"OvhOfficeTask",
"serviceName_user_POST",
"(",
"String",
"serviceName",
",",
"String",
"domain",
",",
"String",
"firstName",
",",
"String",
"lastName",
",",
"OvhLicenceEnum",
"licence",
",",
"String",
"login",
")",
"throws",
"IOException",
"{",
"String",
... | Create new office user
REST: POST /license/office/{serviceName}/user
@param lastName [required] Account last name
@param firstName [required] Account first name
@param login [required] Account login
@param licence [required] Office licence
@param domain [required] Office domain
@param serviceName [required] The unique... | [
"Create",
"new",
"office",
"user"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-licenseoffice/src/main/java/net/minidev/ovh/api/ApiOvhLicenseoffice.java#L217-L228 |
venmo/cursor-utils | cursor-utils/src/main/java/com/venmo/cursor/CursorUtils.java | CursorUtils.consumeToLinkedHashSet | public static <T> LinkedHashSet<T> consumeToLinkedHashSet(IterableCursor<T> cursor) {
"""
Returns an {@link java.util.LinkedHashSet} of the {@link android.database.Cursor} and closes
it.
"""
return consumeToCollection(cursor, new LinkedHashSet<T>(cursor.getCount()));
} | java | public static <T> LinkedHashSet<T> consumeToLinkedHashSet(IterableCursor<T> cursor) {
return consumeToCollection(cursor, new LinkedHashSet<T>(cursor.getCount()));
} | [
"public",
"static",
"<",
"T",
">",
"LinkedHashSet",
"<",
"T",
">",
"consumeToLinkedHashSet",
"(",
"IterableCursor",
"<",
"T",
">",
"cursor",
")",
"{",
"return",
"consumeToCollection",
"(",
"cursor",
",",
"new",
"LinkedHashSet",
"<",
"T",
">",
"(",
"cursor",
... | Returns an {@link java.util.LinkedHashSet} of the {@link android.database.Cursor} and closes
it. | [
"Returns",
"an",
"{"
] | train | https://github.com/venmo/cursor-utils/blob/52cf91c4253346632fe70b8d7b7eab8bbcc9b248/cursor-utils/src/main/java/com/venmo/cursor/CursorUtils.java#L58-L60 |
adyliu/jafka | src/main/java/io/jafka/server/ServerRegister.java | ServerRegister.registerBrokerInZk | public void registerBrokerInZk() {
"""
register broker in the zookeeper
<p>
path: /brokers/ids/<id> <br>
data: creator:host:port
"""
logger.info("Registering broker " + brokerIdPath);
String hostname = config.getHostName();
if (hostname == null) {
try {
... | java | public void registerBrokerInZk() {
logger.info("Registering broker " + brokerIdPath);
String hostname = config.getHostName();
if (hostname == null) {
try {
hostname = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
... | [
"public",
"void",
"registerBrokerInZk",
"(",
")",
"{",
"logger",
".",
"info",
"(",
"\"Registering broker \"",
"+",
"brokerIdPath",
")",
";",
"String",
"hostname",
"=",
"config",
".",
"getHostName",
"(",
")",
";",
"if",
"(",
"hostname",
"==",
"null",
")",
"... | register broker in the zookeeper
<p>
path: /brokers/ids/<id> <br>
data: creator:host:port | [
"register",
"broker",
"in",
"the",
"zookeeper",
"<p",
">",
"path",
":",
"/",
"brokers",
"/",
"ids",
"/",
"<",
";",
"id>",
";",
"<br",
">",
"data",
":",
"creator",
":",
"host",
":",
"port"
] | train | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/server/ServerRegister.java#L119-L145 |
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/Client.java | Client.recoverState | public Completable recoverState(final StateFormat format, final byte[] persistedState) {
"""
Initializes the {@link SessionState} from a previous snapshot with specific state information.
<p>
If a system needs to be built that withstands outages and needs to resume where left off, this method,
combined with the... | java | public Completable recoverState(final StateFormat format, final byte[] persistedState) {
return Completable.create(new Completable.OnSubscribe() {
@Override
public void call(CompletableSubscriber subscriber) {
LOGGER.info("Recovering state from format {}", format);
LOGGER.debug("Persiste... | [
"public",
"Completable",
"recoverState",
"(",
"final",
"StateFormat",
"format",
",",
"final",
"byte",
"[",
"]",
"persistedState",
")",
"{",
"return",
"Completable",
".",
"create",
"(",
"new",
"Completable",
".",
"OnSubscribe",
"(",
")",
"{",
"@",
"Override",
... | Initializes the {@link SessionState} from a previous snapshot with specific state information.
<p>
If a system needs to be built that withstands outages and needs to resume where left off, this method,
combined with the periodic persistence of the {@link SessionState} provides resume capabilities. If you
need to start ... | [
"Initializes",
"the",
"{",
"@link",
"SessionState",
"}",
"from",
"a",
"previous",
"snapshot",
"with",
"specific",
"state",
"information",
".",
"<p",
">",
"If",
"a",
"system",
"needs",
"to",
"be",
"built",
"that",
"withstands",
"outages",
"and",
"needs",
"to"... | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/Client.java#L601-L620 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/mathematics/regularization/L2Regularizer.java | L2Regularizer.updateWeights | public static <K> void updateWeights(double l2, double learningRate, Map<K, Double> weights, Map<K, Double> newWeights) {
"""
Updates the weights by applying the L2 regularization.
@param l2
@param learningRate
@param weights
@param newWeights
@param <K>
"""
if(l2 > 0.0) {
for(Map.En... | java | public static <K> void updateWeights(double l2, double learningRate, Map<K, Double> weights, Map<K, Double> newWeights) {
if(l2 > 0.0) {
for(Map.Entry<K, Double> e : weights.entrySet()) {
K column = e.getKey();
newWeights.put(column, newWeights.get(column) + l2*e.getV... | [
"public",
"static",
"<",
"K",
">",
"void",
"updateWeights",
"(",
"double",
"l2",
",",
"double",
"learningRate",
",",
"Map",
"<",
"K",
",",
"Double",
">",
"weights",
",",
"Map",
"<",
"K",
",",
"Double",
">",
"newWeights",
")",
"{",
"if",
"(",
"l2",
... | Updates the weights by applying the L2 regularization.
@param l2
@param learningRate
@param weights
@param newWeights
@param <K> | [
"Updates",
"the",
"weights",
"by",
"applying",
"the",
"L2",
"regularization",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/mathematics/regularization/L2Regularizer.java#L36-L43 |
lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/misc/TriangularSolver_DSCC.java | TriangularSolver_DSCC.searchNzRowsElim | public static int searchNzRowsElim( DMatrixSparseCSC A , int k , int parent[], int s[], int w[] ) {
"""
<p>Given an elimination tree compute the non-zero elements in the specified row of L given the
symmetric A matrix. This is in general much faster than general purpose algorithms</p>
<p>Functionally equivale... | java | public static int searchNzRowsElim( DMatrixSparseCSC A , int k , int parent[], int s[], int w[] ) {
int top = A.numCols;
// Traversing through the column in A is the same as the row in A since it's symmetric
int idx0 = A.col_idx[k], idx1 = A.col_idx[k+1];
w[k] = -w[k]-2; // makr node ... | [
"public",
"static",
"int",
"searchNzRowsElim",
"(",
"DMatrixSparseCSC",
"A",
",",
"int",
"k",
",",
"int",
"parent",
"[",
"]",
",",
"int",
"s",
"[",
"]",
",",
"int",
"w",
"[",
"]",
")",
"{",
"int",
"top",
"=",
"A",
".",
"numCols",
";",
"// Traversin... | <p>Given an elimination tree compute the non-zero elements in the specified row of L given the
symmetric A matrix. This is in general much faster than general purpose algorithms</p>
<p>Functionally equivalent to cs_ereach() in csparse</p>
@param A Symmetric matrix.
@param k Row in A being processed.
@param parent el... | [
"<p",
">",
"Given",
"an",
"elimination",
"tree",
"compute",
"the",
"non",
"-",
"zero",
"elements",
"in",
"the",
"specified",
"row",
"of",
"L",
"given",
"the",
"symmetric",
"A",
"matrix",
".",
"This",
"is",
"in",
"general",
"much",
"faster",
"than",
"gene... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/misc/TriangularSolver_DSCC.java#L574-L604 |
Impetus/Kundera | src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBSchemaManager.java | CouchDBSchemaManager.createDatabaseIfNotExist | private void createDatabaseIfNotExist(boolean drop) throws URISyntaxException, IOException, ClientProtocolException {
"""
Creates the database if not exist.
@param drop
the drop
@throws URISyntaxException
the URI syntax exception
@throws IOException
Signals that an I/O exception has occurred.
@throws Clie... | java | private void createDatabaseIfNotExist(boolean drop) throws URISyntaxException, IOException, ClientProtocolException
{
boolean exist = checkForDBExistence();
if (exist && drop)
{
dropDatabase();
exist = false;
}
if (!exist)
{
URI ur... | [
"private",
"void",
"createDatabaseIfNotExist",
"(",
"boolean",
"drop",
")",
"throws",
"URISyntaxException",
",",
"IOException",
",",
"ClientProtocolException",
"{",
"boolean",
"exist",
"=",
"checkForDBExistence",
"(",
")",
";",
"if",
"(",
"exist",
"&&",
"drop",
")... | Creates the database if not exist.
@param drop
the drop
@throws URISyntaxException
the URI syntax exception
@throws IOException
Signals that an I/O exception has occurred.
@throws ClientProtocolException
the client protocol exception | [
"Creates",
"the",
"database",
"if",
"not",
"exist",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBSchemaManager.java#L677-L703 |
beders/Resty | src/main/java/us/monoid/web/Resty.java | Resty.authenticateForRealm | public void authenticateForRealm(String realm, String aLogin, char[] charArray) {
"""
Register a login password for the realm returned by the authorization challenge.
Use this method instead of authenticate in case the URL is not made available to the java.net.Authenticator class
@param realm the realm (see rf... | java | public void authenticateForRealm(String realm, String aLogin, char[] charArray) {
rath.addRealm(realm, aLogin, charArray);
} | [
"public",
"void",
"authenticateForRealm",
"(",
"String",
"realm",
",",
"String",
"aLogin",
",",
"char",
"[",
"]",
"charArray",
")",
"{",
"rath",
".",
"addRealm",
"(",
"realm",
",",
"aLogin",
",",
"charArray",
")",
";",
"}"
] | Register a login password for the realm returned by the authorization challenge.
Use this method instead of authenticate in case the URL is not made available to the java.net.Authenticator class
@param realm the realm (see rfc2617, section 1.2)
@param aLogin
@param charArray | [
"Register",
"a",
"login",
"password",
"for",
"the",
"realm",
"returned",
"by",
"the",
"authorization",
"challenge",
".",
"Use",
"this",
"method",
"instead",
"of",
"authenticate",
"in",
"case",
"the",
"URL",
"is",
"not",
"made",
"available",
"to",
"the",
"jav... | train | https://github.com/beders/Resty/blob/4493603e9689c942cc3e53b9c5018010e414a364/src/main/java/us/monoid/web/Resty.java#L160-L162 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/layer/CacheEntry.java | CacheEntry.tryGetInputStream | public InputStream tryGetInputStream(HttpServletRequest request, MutableObject<byte[]> sourceMapResult) throws IOException {
"""
Can fail by returning null, but won't throw an exception.
@param request
the request object
@param sourceMapResult
(Output) mutable object reference to the source map. May be null... | java | public InputStream tryGetInputStream(HttpServletRequest request, MutableObject<byte[]> sourceMapResult) throws IOException {
InputStream result = null;
// Check bytes before filename when reading and reverse order when setting
if (bytes != null || filename != null) {
try {
result = getInputStream(requ... | [
"public",
"InputStream",
"tryGetInputStream",
"(",
"HttpServletRequest",
"request",
",",
"MutableObject",
"<",
"byte",
"[",
"]",
">",
"sourceMapResult",
")",
"throws",
"IOException",
"{",
"InputStream",
"result",
"=",
"null",
";",
"// Check bytes before filename when re... | Can fail by returning null, but won't throw an exception.
@param request
the request object
@param sourceMapResult
(Output) mutable object reference to the source map. May be null
if source maps are not being requested.
@return The LayerInputStream, or null if data is not available
@throws IOException | [
"Can",
"fail",
"by",
"returning",
"null",
"but",
"won",
"t",
"throw",
"an",
"exception",
"."
] | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/layer/CacheEntry.java#L150-L164 |
Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESClient.java | ESClient.addRelations | private void addRelations(List<RelationHolder> rlHolders, Map<String, Object> values) {
"""
Adds the relations.
@param rlHolders
the rl holders
@param values
the values
"""
if (rlHolders != null)
{
for (RelationHolder relation : rlHolders)
{
values.... | java | private void addRelations(List<RelationHolder> rlHolders, Map<String, Object> values)
{
if (rlHolders != null)
{
for (RelationHolder relation : rlHolders)
{
values.put(relation.getRelationName(), relation.getRelationValue());
}
}
} | [
"private",
"void",
"addRelations",
"(",
"List",
"<",
"RelationHolder",
">",
"rlHolders",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"values",
")",
"{",
"if",
"(",
"rlHolders",
"!=",
"null",
")",
"{",
"for",
"(",
"RelationHolder",
"relation",
":",
"rl... | Adds the relations.
@param rlHolders
the rl holders
@param values
the values | [
"Adds",
"the",
"relations",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESClient.java#L214-L223 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java | Expressions.comparableTemplate | @Deprecated
public static <T extends Comparable<?>> ComparableTemplate<T> comparableTemplate(Class<? extends T> cl,
String template, ImmutableList<?> args) {
"""
Create a new Template expression
@deprecated Use {@link #comp... | java | @Deprecated
public static <T extends Comparable<?>> ComparableTemplate<T> comparableTemplate(Class<? extends T> cl,
String template, ImmutableList<?> args) {
return comparableTemplate(cl, createTemplate(template), args);
... | [
"@",
"Deprecated",
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"?",
">",
">",
"ComparableTemplate",
"<",
"T",
">",
"comparableTemplate",
"(",
"Class",
"<",
"?",
"extends",
"T",
">",
"cl",
",",
"String",
"template",
",",
"ImmutableList",
"<"... | Create a new Template expression
@deprecated Use {@link #comparableTemplate(Class, String, List)} instead.
@param cl type of expression
@param template template
@param args template parameters
@return template expression | [
"Create",
"a",
"new",
"Template",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L413-L417 |
pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLogFactory.java | BookKeeperLogFactory.createDebugLogWrapper | public DebugLogWrapper createDebugLogWrapper(int logId) {
"""
Creates a new DebugLogWrapper that can be used for debugging purposes. This should not be used for regular operations.
@param logId Id of the Log to create a wrapper for.
@return A new instance of the DebugLogWrapper class.
"""
Precondit... | java | public DebugLogWrapper createDebugLogWrapper(int logId) {
Preconditions.checkState(this.bookKeeper.get() != null, "BookKeeperLogFactory is not initialized.");
return new DebugLogWrapper(logId, this.zkClient, this.bookKeeper.get(), this.config, this.executor);
} | [
"public",
"DebugLogWrapper",
"createDebugLogWrapper",
"(",
"int",
"logId",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"this",
".",
"bookKeeper",
".",
"get",
"(",
")",
"!=",
"null",
",",
"\"BookKeeperLogFactory is not initialized.\"",
")",
";",
"return",
"n... | Creates a new DebugLogWrapper that can be used for debugging purposes. This should not be used for regular operations.
@param logId Id of the Log to create a wrapper for.
@return A new instance of the DebugLogWrapper class. | [
"Creates",
"a",
"new",
"DebugLogWrapper",
"that",
"can",
"be",
"used",
"for",
"debugging",
"purposes",
".",
"This",
"should",
"not",
"be",
"used",
"for",
"regular",
"operations",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLogFactory.java#L112-L115 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.listHierarchicalEntities | public List<HierarchicalEntityExtractor> listHierarchicalEntities(UUID appId, String versionId, ListHierarchicalEntitiesOptionalParameter listHierarchicalEntitiesOptionalParameter) {
"""
Gets information about the hierarchical entity models.
@param appId The application ID.
@param versionId The version ID.
@p... | java | public List<HierarchicalEntityExtractor> listHierarchicalEntities(UUID appId, String versionId, ListHierarchicalEntitiesOptionalParameter listHierarchicalEntitiesOptionalParameter) {
return listHierarchicalEntitiesWithServiceResponseAsync(appId, versionId, listHierarchicalEntitiesOptionalParameter).toBlocking()... | [
"public",
"List",
"<",
"HierarchicalEntityExtractor",
">",
"listHierarchicalEntities",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"ListHierarchicalEntitiesOptionalParameter",
"listHierarchicalEntitiesOptionalParameter",
")",
"{",
"return",
"listHierarchicalEntitiesWit... | Gets information about the hierarchical entity models.
@param appId The application ID.
@param versionId The version ID.
@param listHierarchicalEntitiesOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the vali... | [
"Gets",
"information",
"about",
"the",
"hierarchical",
"entity",
"models",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L1373-L1375 |
biouno/figshare-java-api | src/main/java/org/biouno/figshare/FigShareClient.java | FigShareClient.getURL | private String getURL(String endpoint, int version, String method) {
"""
Create the FigShare API URL using the endpoint, version and API method.
@param endpoint endpoint URL
@param version API version
@param method API operation
@return the URL with the version and method
"""
StringBuilder sb = n... | java | private String getURL(String endpoint, int version, String method) {
StringBuilder sb = new StringBuilder();
sb.append(endpoint);
if (!endpoint.endsWith(FORWARD_SLASH)) {
sb.append(FORWARD_SLASH);
}
sb.append(VERSION_PREFIX + version + FORWARD_SLASH + method);
... | [
"private",
"String",
"getURL",
"(",
"String",
"endpoint",
",",
"int",
"version",
",",
"String",
"method",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"endpoint",
")",
";",
"if",
"(",
"!",
"endp... | Create the FigShare API URL using the endpoint, version and API method.
@param endpoint endpoint URL
@param version API version
@param method API operation
@return the URL with the version and method | [
"Create",
"the",
"FigShare",
"API",
"URL",
"using",
"the",
"endpoint",
"version",
"and",
"API",
"method",
"."
] | train | https://github.com/biouno/figshare-java-api/blob/6d447764efe8fa4329d15e339a8601351aade93c/src/main/java/org/biouno/figshare/FigShareClient.java#L132-L140 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java | CirculantTracker.updateTrackLocation | protected void updateTrackLocation(T image) {
"""
Find the target inside the current image by searching around its last known location
"""
get_subwindow(image, templateNew);
// calculate response of the classifier at all locations
// matlab: k = dense_gauss_kernel(sigma, x, z);
dense_gauss_kernel(sigm... | java | protected void updateTrackLocation(T image) {
get_subwindow(image, templateNew);
// calculate response of the classifier at all locations
// matlab: k = dense_gauss_kernel(sigma, x, z);
dense_gauss_kernel(sigma, templateNew, template,k);
fft.forward(k,kf);
// response = real(ifft2(alphaf .* fft2(k))); ... | [
"protected",
"void",
"updateTrackLocation",
"(",
"T",
"image",
")",
"{",
"get_subwindow",
"(",
"image",
",",
"templateNew",
")",
";",
"// calculate response of the classifier at all locations",
"// matlab: k = dense_gauss_kernel(sigma, x, z);",
"dense_gauss_kernel",
"(",
"sigma... | Find the target inside the current image by searching around its last known location | [
"Find",
"the",
"target",
"inside",
"the",
"current",
"image",
"by",
"searching",
"around",
"its",
"last",
"known",
"location"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java#L332-L372 |
xiaosunzhu/resource-utils | src/main/java/net/sunyijun/resource/config/Configs.java | Configs.getSystemConfig | public static String getSystemConfig(String keyPrefix, IConfigKey key) {
"""
<p>Get system config string. Config key include prefix.</p>
Example:<br>
If key.getKeyString() is "test", <br>
getSystemConfig("1.", key); will return "1.test" config value in system config file.
@param keyPrefix config key prefix
... | java | public static String getSystemConfig(String keyPrefix, IConfigKey key) {
return systemConfigs.getConfig(keyPrefix, key);
} | [
"public",
"static",
"String",
"getSystemConfig",
"(",
"String",
"keyPrefix",
",",
"IConfigKey",
"key",
")",
"{",
"return",
"systemConfigs",
".",
"getConfig",
"(",
"keyPrefix",
",",
"key",
")",
";",
"}"
] | <p>Get system config string. Config key include prefix.</p>
Example:<br>
If key.getKeyString() is "test", <br>
getSystemConfig("1.", key); will return "1.test" config value in system config file.
@param keyPrefix config key prefix
@param key config key
@return config value string. Return null if not config in
sy... | [
"<p",
">",
"Get",
"system",
"config",
"string",
".",
"Config",
"key",
"include",
"prefix",
".",
"<",
"/",
"p",
">",
"Example",
":",
"<br",
">",
"If",
"key",
".",
"getKeyString",
"()",
"is",
"test",
"<br",
">",
"getSystemConfig",
"(",
"1",
".",
"key",... | train | https://github.com/xiaosunzhu/resource-utils/blob/4f2bf3f36df10195a978f122ed682ba1eb0462b5/src/main/java/net/sunyijun/resource/config/Configs.java#L98-L100 |
jenkinsci/jenkins | core/src/main/java/hudson/util/FormApply.java | FormApply.applyResponse | public static HttpResponseException applyResponse(final String script) {
"""
Generates the response for the asynchronous background form submission (AKA the Apply button.)
<p>
When the response HTML includes a JavaScript function in a pre-determined name, that function gets executed.
This method generates such ... | java | public static HttpResponseException applyResponse(final String script) {
return new HttpResponseException() {
public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException {
rsp.setContentType("text/html;charset=UTF-8");
... | [
"public",
"static",
"HttpResponseException",
"applyResponse",
"(",
"final",
"String",
"script",
")",
"{",
"return",
"new",
"HttpResponseException",
"(",
")",
"{",
"public",
"void",
"generateResponse",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
",",... | Generates the response for the asynchronous background form submission (AKA the Apply button.)
<p>
When the response HTML includes a JavaScript function in a pre-determined name, that function gets executed.
This method generates such a response from JavaScript text. | [
"Generates",
"the",
"response",
"for",
"the",
"asynchronous",
"background",
"form",
"submission",
"(",
"AKA",
"the",
"Apply",
"button",
".",
")",
"<p",
">",
"When",
"the",
"response",
"HTML",
"includes",
"a",
"JavaScript",
"function",
"in",
"a",
"pre",
"-",
... | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/FormApply.java#L74-L87 |
vladmihalcea/db-util | src/main/java/com/vladmihalcea/sql/SQLStatementCountValidator.java | SQLStatementCountValidator.assertInsertCount | public static void assertInsertCount(long expectedInsertCount) {
"""
Assert insert statement count
@param expectedInsertCount expected insert statement count
"""
QueryCount queryCount = QueryCountHolder.getGrandTotal();
long recordedInsertCount = queryCount.getInsert();
if (expectedI... | java | public static void assertInsertCount(long expectedInsertCount) {
QueryCount queryCount = QueryCountHolder.getGrandTotal();
long recordedInsertCount = queryCount.getInsert();
if (expectedInsertCount != recordedInsertCount) {
throw new SQLInsertCountMismatchException(expectedInsertCoun... | [
"public",
"static",
"void",
"assertInsertCount",
"(",
"long",
"expectedInsertCount",
")",
"{",
"QueryCount",
"queryCount",
"=",
"QueryCountHolder",
".",
"getGrandTotal",
"(",
")",
";",
"long",
"recordedInsertCount",
"=",
"queryCount",
".",
"getInsert",
"(",
")",
"... | Assert insert statement count
@param expectedInsertCount expected insert statement count | [
"Assert",
"insert",
"statement",
"count"
] | train | https://github.com/vladmihalcea/db-util/blob/81c8c8421253c9869db1d4e221668d7afbd69fd0/src/main/java/com/vladmihalcea/sql/SQLStatementCountValidator.java#L78-L84 |
bwkimmel/jdcp | jdcp-server/src/main/java/ca/eandb/jdcp/server/classmanager/FileClassManager.java | FileClassManager.getClassDefinition | private ByteBuffer getClassDefinition(File directory, String name) {
"""
Gets the definition of a class.
@param directory The root of the directory tree containing the class
definition.
@param name The fully qualified name of the class.
@return A <code>ByteBuffer</code> containing the class definition.
"""... | java | private ByteBuffer getClassDefinition(File directory, String name) {
String baseName = getBaseFileName(name);
File digestFile = new File(directory, baseName + CLASS_EXTENSION);
return ByteBuffer.wrap(getFileContents(digestFile));
} | [
"private",
"ByteBuffer",
"getClassDefinition",
"(",
"File",
"directory",
",",
"String",
"name",
")",
"{",
"String",
"baseName",
"=",
"getBaseFileName",
"(",
"name",
")",
";",
"File",
"digestFile",
"=",
"new",
"File",
"(",
"directory",
",",
"baseName",
"+",
"... | Gets the definition of a class.
@param directory The root of the directory tree containing the class
definition.
@param name The fully qualified name of the class.
@return A <code>ByteBuffer</code> containing the class definition. | [
"Gets",
"the",
"definition",
"of",
"a",
"class",
"."
] | train | https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-server/src/main/java/ca/eandb/jdcp/server/classmanager/FileClassManager.java#L267-L271 |
mailin-api/sendinblue-java-mvn | src/main/java/com/sendinblue/Sendinblue.java | Sendinblue.delete_user | public String delete_user(Map<String, String> data) {
"""
/*
Unlink existing user from all lists.
@param {Object} data contains json objects as a key value pair from HashMap.
@options data {String} email: Email address of the already existing user in the SendinBlue contacts to be unlinked from all lists [Mandat... | java | public String delete_user(Map<String, String> data) {
String id = data.get("email");
return delete("user/" + id, EMPTY_STRING);
} | [
"public",
"String",
"delete_user",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"data",
")",
"{",
"String",
"id",
"=",
"data",
".",
"get",
"(",
"\"email\"",
")",
";",
"return",
"delete",
"(",
"\"user/\"",
"+",
"id",
",",
"EMPTY_STRING",
")",
";",
"... | /*
Unlink existing user from all lists.
@param {Object} data contains json objects as a key value pair from HashMap.
@options data {String} email: Email address of the already existing user in the SendinBlue contacts to be unlinked from all lists [Mandatory] | [
"/",
"*",
"Unlink",
"existing",
"user",
"from",
"all",
"lists",
"."
] | train | https://github.com/mailin-api/sendinblue-java-mvn/blob/3a186b004003450f18d619aa084adc8d75086183/src/main/java/com/sendinblue/Sendinblue.java#L806-L809 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/TypedCollections.java | TypedCollections.dynamicallyCastList | @SuppressWarnings("unchecked")
static <E> List<E> dynamicallyCastList(List<?> list, Class<E> type) {
"""
Dynamically check that the members of the list are all instances of
the given type (or null).
@param <E>
the list's element type
@param list
the list to cast
@param type
the class of the list's el... | java | @SuppressWarnings("unchecked")
static <E> List<E> dynamicallyCastList(List<?> list, Class<E> type) {
return dynamicallyCastCollection(list, type, List.class);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"static",
"<",
"E",
">",
"List",
"<",
"E",
">",
"dynamicallyCastList",
"(",
"List",
"<",
"?",
">",
"list",
",",
"Class",
"<",
"E",
">",
"type",
")",
"{",
"return",
"dynamicallyCastCollection",
"(",
"lis... | Dynamically check that the members of the list are all instances of
the given type (or null).
@param <E>
the list's element type
@param list
the list to cast
@param type
the class of the list's element type.
@return the dynamically-type checked list.
@throws java.lang.ClassCastException | [
"Dynamically",
"check",
"that",
"the",
"members",
"of",
"the",
"list",
"are",
"all",
"instances",
"of",
"the",
"given",
"type",
"(",
"or",
"null",
")",
"."
] | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/TypedCollections.java#L104-L107 |
Jasig/uPortal | uPortal-security/uPortal-security-xslt/src/main/java/org/apereo/portal/security/xslt/XalanLayoutElementTitleHelper.java | XalanLayoutElementTitleHelper.getTitle | public static String getTitle(String id, String language, String name) {
"""
This method checks whether id indicates that it is a layout owner's structure element (or at
least derived from it). If it is the case, then it asks {@link MessageSource} to resolve the
message using layout element's name. Otherwise it ... | java | public static String getTitle(String id, String language, String name) {
if (id != null && id.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {
final Locale locale = localeManagerFactory.parseLocale(language);
return messageSource.getMessage(name, new Object[] {}, name, locale);
}... | [
"public",
"static",
"String",
"getTitle",
"(",
"String",
"id",
",",
"String",
"language",
",",
"String",
"name",
")",
"{",
"if",
"(",
"id",
"!=",
"null",
"&&",
"id",
".",
"startsWith",
"(",
"Constants",
".",
"FRAGMENT_ID_USER_PREFIX",
")",
")",
"{",
"fin... | This method checks whether id indicates that it is a layout owner's structure element (or at
least derived from it). If it is the case, then it asks {@link MessageSource} to resolve the
message using layout element's name. Otherwise it returns the name. Note that layout owner's
element identifier format is 'uXlYnZ' whe... | [
"This",
"method",
"checks",
"whether",
"id",
"indicates",
"that",
"it",
"is",
"a",
"layout",
"owner",
"s",
"structure",
"element",
"(",
"or",
"at",
"least",
"derived",
"from",
"it",
")",
".",
"If",
"it",
"is",
"the",
"case",
"then",
"it",
"asks",
"{",
... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-xslt/src/main/java/org/apereo/portal/security/xslt/XalanLayoutElementTitleHelper.java#L57-L63 |
azkaban/azkaban | az-core/src/main/java/azkaban/utils/PropsUtils.java | PropsUtils.fromHierarchicalMap | public static Props fromHierarchicalMap(final Map<String, Object> propsMap) {
"""
Convert a hierarchical Map to Prop Object
@param propsMap a hierarchical Map
@return a new constructed Props Object
"""
if (propsMap == null) {
return null;
}
final String source = (String) propsMap.get("so... | java | public static Props fromHierarchicalMap(final Map<String, Object> propsMap) {
if (propsMap == null) {
return null;
}
final String source = (String) propsMap.get("source");
final Map<String, String> propsParams =
(Map<String, String>) propsMap.get("props");
final Map<String, Object> p... | [
"public",
"static",
"Props",
"fromHierarchicalMap",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"propsMap",
")",
"{",
"if",
"(",
"propsMap",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"String",
"source",
"=",
"(",
"String",
... | Convert a hierarchical Map to Prop Object
@param propsMap a hierarchical Map
@return a new constructed Props Object | [
"Convert",
"a",
"hierarchical",
"Map",
"to",
"Prop",
"Object"
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/PropsUtils.java#L399-L414 |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/context/ContextRuntime.java | ContextRuntime.startTask | @SuppressWarnings("checkstyle:illegalcatch")
void startTask(final Configuration taskConfig) throws TaskClientCodeException {
"""
Launches a Task on this context.
@param taskConfig the configuration to be used for the task.
@throws org.apache.reef.runtime.common.evaluator.task.TaskClientCodeException If the T... | java | @SuppressWarnings("checkstyle:illegalcatch")
void startTask(final Configuration taskConfig) throws TaskClientCodeException {
synchronized (this.contextLifeCycle) {
if (this.task.isPresent() && this.task.get().hasEnded()) {
// clean up state
this.task = Optional.empty();
}
if (... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:illegalcatch\"",
")",
"void",
"startTask",
"(",
"final",
"Configuration",
"taskConfig",
")",
"throws",
"TaskClientCodeException",
"{",
"synchronized",
"(",
"this",
".",
"contextLifeCycle",
")",
"{",
"if",
"(",
"this",
".",... | Launches a Task on this context.
@param taskConfig the configuration to be used for the task.
@throws org.apache.reef.runtime.common.evaluator.task.TaskClientCodeException If the Task cannot be instantiated
due to user code / configuration issues.
@throws IllegalStateException ... | [
"Launches",
"a",
"Task",
"on",
"this",
"context",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/context/ContextRuntime.java#L234-L272 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GoogleMapLink.java | ST_GoogleMapLink.generateGMLink | public static String generateGMLink(Geometry geom, String layerType, int zoom) {
"""
Generate a Google Map link URL based on the center of the bounding box of the input geometry.
Set the layer type and the zoom level.
@param geom
@param layerType
@param zoom
@return
"""
if (geom == null) {
... | java | public static String generateGMLink(Geometry geom, String layerType, int zoom) {
if (geom == null) {
return null;
}
try {
LayerType layer = LayerType.valueOf(layerType.toLowerCase());
Coordinate centre = geom.getEnvelopeInternal().centre();
StringB... | [
"public",
"static",
"String",
"generateGMLink",
"(",
"Geometry",
"geom",
",",
"String",
"layerType",
",",
"int",
"zoom",
")",
"{",
"if",
"(",
"geom",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"LayerType",
"layer",
"=",
"LayerType",
... | Generate a Google Map link URL based on the center of the bounding box of the input geometry.
Set the layer type and the zoom level.
@param geom
@param layerType
@param zoom
@return | [
"Generate",
"a",
"Google",
"Map",
"link",
"URL",
"based",
"on",
"the",
"center",
"of",
"the",
"bounding",
"box",
"of",
"the",
"input",
"geometry",
".",
"Set",
"the",
"layer",
"type",
"and",
"the",
"zoom",
"level",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GoogleMapLink.java#L78-L97 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/MapUtils.java | MapUtils.isPointOnPolyline | public static boolean isPointOnPolyline(LatLng point, PolylineOptions polyline, boolean geodesic, double tolerance) {
"""
Is the point on the polyline
@param point point
@param polyline polyline
@param geodesic geodesic check flag
@param tolerance distance tolerance
@return true if on the line
"""... | java | public static boolean isPointOnPolyline(LatLng point, PolylineOptions polyline, boolean geodesic, double tolerance) {
return PolyUtil.isLocationOnPath(point, polyline.getPoints(), geodesic, tolerance);
} | [
"public",
"static",
"boolean",
"isPointOnPolyline",
"(",
"LatLng",
"point",
",",
"PolylineOptions",
"polyline",
",",
"boolean",
"geodesic",
",",
"double",
"tolerance",
")",
"{",
"return",
"PolyUtil",
".",
"isLocationOnPath",
"(",
"point",
",",
"polyline",
".",
"... | Is the point on the polyline
@param point point
@param polyline polyline
@param geodesic geodesic check flag
@param tolerance distance tolerance
@return true if on the line | [
"Is",
"the",
"point",
"on",
"the",
"polyline"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/MapUtils.java#L325-L327 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/AVT.java | AVT.fixupVariables | public void fixupVariables(java.util.Vector vars, int globalsSize) {
"""
This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corre... | java | public void fixupVariables(java.util.Vector vars, int globalsSize)
{
if (null != m_parts)
{
int n = m_parts.size();
for (int i = 0; i < n; i++)
{
AVTPart part = (AVTPart) m_parts.elementAt(i);
part.fixupVariables(vars, globalsSize);
}
}
} | [
"public",
"void",
"fixupVariables",
"(",
"java",
".",
"util",
".",
"Vector",
"vars",
",",
"int",
"globalsSize",
")",
"{",
"if",
"(",
"null",
"!=",
"m_parts",
")",
"{",
"int",
"n",
"=",
"m_parts",
".",
"size",
"(",
")",
";",
"for",
"(",
"int",
"i",
... | This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corresponds to the variable reference qname. The position of the
QName in the vector f... | [
"This",
"function",
"is",
"used",
"to",
"fixup",
"variables",
"from",
"QNames",
"to",
"stack",
"frame",
"indexes",
"at",
"stylesheet",
"build",
"time",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/AVT.java#L566-L579 |
huahin/huahin-core | src/main/java/org/huahinframework/core/SimpleJob.java | SimpleJob.setJoin | public SimpleJob setJoin(String[] masterLabels, String masterColumn, String dataColumn,
String masterPath, String separator, boolean regex, int threshold) throws IOException, URISyntaxException {
"""
This method is to determine automatically join the Simple and Big.
@param masterLabel... | java | public SimpleJob setJoin(String[] masterLabels, String masterColumn, String dataColumn,
String masterPath, String separator, boolean regex, int threshold) throws IOException, URISyntaxException {
if (regex) {
return setSimpleJoin(masterLabels, masterColumn, dataColumn,
... | [
"public",
"SimpleJob",
"setJoin",
"(",
"String",
"[",
"]",
"masterLabels",
",",
"String",
"masterColumn",
",",
"String",
"dataColumn",
",",
"String",
"masterPath",
",",
"String",
"separator",
",",
"boolean",
"regex",
",",
"int",
"threshold",
")",
"throws",
"IO... | This method is to determine automatically join the Simple and Big.
@param masterLabels label of master data
@param masterColumn master column
@param dataColumn data column
@param masterPath master data HDFS path
@param separator separator
@param regex master join is regex
@param threshold auto join threshold size(MB). ... | [
"This",
"method",
"is",
"to",
"determine",
"automatically",
"join",
"the",
"Simple",
"and",
"Big",
"."
] | train | https://github.com/huahin/huahin-core/blob/a87921b5a12be92a822f753c075ab2431036e6f5/src/main/java/org/huahinframework/core/SimpleJob.java#L484-L503 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java | GrailsDomainBinder.calculateForeignKeyColumnCount | private int calculateForeignKeyColumnCount(PersistentEntity refDomainClass, String[] propertyNames) {
"""
number of columns required for a column key we have to perform the calculation here
"""
int expectedForeignKeyColumnLength = 0;
for (String propertyName : propertyNames) {
Persi... | java | private int calculateForeignKeyColumnCount(PersistentEntity refDomainClass, String[] propertyNames) {
int expectedForeignKeyColumnLength = 0;
for (String propertyName : propertyNames) {
PersistentProperty referencedProperty = refDomainClass.getPropertyByName(propertyName);
if(ref... | [
"private",
"int",
"calculateForeignKeyColumnCount",
"(",
"PersistentEntity",
"refDomainClass",
",",
"String",
"[",
"]",
"propertyNames",
")",
"{",
"int",
"expectedForeignKeyColumnLength",
"=",
"0",
";",
"for",
"(",
"String",
"propertyName",
":",
"propertyNames",
")",
... | number of columns required for a column key we have to perform the calculation here | [
"number",
"of",
"columns",
"required",
"for",
"a",
"column",
"key",
"we",
"have",
"to",
"perform",
"the",
"calculation",
"here"
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java#L2422-L2441 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.order_orderId_availableRegisteredPaymentMean_GET | public ArrayList<OvhRegisteredPaymentMean> order_orderId_availableRegisteredPaymentMean_GET(Long orderId) throws IOException {
"""
List of registered payment mean you can use to pay this order
REST: GET /me/order/{orderId}/availableRegisteredPaymentMean
@param orderId [required]
"""
String qPath = "/me/o... | java | public ArrayList<OvhRegisteredPaymentMean> order_orderId_availableRegisteredPaymentMean_GET(Long orderId) throws IOException {
String qPath = "/me/order/{orderId}/availableRegisteredPaymentMean";
StringBuilder sb = path(qPath, orderId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(res... | [
"public",
"ArrayList",
"<",
"OvhRegisteredPaymentMean",
">",
"order_orderId_availableRegisteredPaymentMean_GET",
"(",
"Long",
"orderId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/order/{orderId}/availableRegisteredPaymentMean\"",
";",
"StringBuilder",
"s... | List of registered payment mean you can use to pay this order
REST: GET /me/order/{orderId}/availableRegisteredPaymentMean
@param orderId [required] | [
"List",
"of",
"registered",
"payment",
"mean",
"you",
"can",
"use",
"to",
"pay",
"this",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2054-L2059 |
aws/aws-sdk-java | aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/UpdateIdentityProviderRequest.java | UpdateIdentityProviderRequest.withAttributeMapping | public UpdateIdentityProviderRequest withAttributeMapping(java.util.Map<String, String> attributeMapping) {
"""
<p>
The identity provider attribute mapping to be changed.
</p>
@param attributeMapping
The identity provider attribute mapping to be changed.
@return Returns a reference to this object so that me... | java | public UpdateIdentityProviderRequest withAttributeMapping(java.util.Map<String, String> attributeMapping) {
setAttributeMapping(attributeMapping);
return this;
} | [
"public",
"UpdateIdentityProviderRequest",
"withAttributeMapping",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributeMapping",
")",
"{",
"setAttributeMapping",
"(",
"attributeMapping",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The identity provider attribute mapping to be changed.
</p>
@param attributeMapping
The identity provider attribute mapping to be changed.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"identity",
"provider",
"attribute",
"mapping",
"to",
"be",
"changed",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/UpdateIdentityProviderRequest.java#L238-L241 |
jbossas/jboss-invocation | src/main/java/org/jboss/invocation/proxy/ProxyFactory.java | ProxyFactory.setInvocationHandlerStatic | public static void setInvocationHandlerStatic(Object proxy, InvocationHandler handler) {
"""
Sets the invocation handler for a proxy. This method is less efficient than
{@link #setInvocationHandler(Object, InvocationHandler)}, however it will work on any proxy, not just proxies from a
specific factory.
@param... | java | public static void setInvocationHandlerStatic(Object proxy, InvocationHandler handler) {
try {
final Field field = proxy.getClass().getDeclaredField(INVOCATION_HANDLER_FIELD);
AccessController.doPrivileged(new SetAccessiblePrivilege(field));
field.set(proxy, handler);
... | [
"public",
"static",
"void",
"setInvocationHandlerStatic",
"(",
"Object",
"proxy",
",",
"InvocationHandler",
"handler",
")",
"{",
"try",
"{",
"final",
"Field",
"field",
"=",
"proxy",
".",
"getClass",
"(",
")",
".",
"getDeclaredField",
"(",
"INVOCATION_HANDLER_FIELD... | Sets the invocation handler for a proxy. This method is less efficient than
{@link #setInvocationHandler(Object, InvocationHandler)}, however it will work on any proxy, not just proxies from a
specific factory.
@param proxy the proxy to modify
@param handler the handler to use | [
"Sets",
"the",
"invocation",
"handler",
"for",
"a",
"proxy",
".",
"This",
"method",
"is",
"less",
"efficient",
"than",
"{",
"@link",
"#setInvocationHandler",
"(",
"Object",
"InvocationHandler",
")",
"}",
"however",
"it",
"will",
"work",
"on",
"any",
"proxy",
... | train | https://github.com/jbossas/jboss-invocation/blob/f72586a554264cbc78fcdad9fdd3e84b833249c9/src/main/java/org/jboss/invocation/proxy/ProxyFactory.java#L394-L406 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/util/CompareUtil.java | CompareUtil.elementIsNotContainedInArray | public static <T> boolean elementIsNotContainedInArray(T element, T... values) {
"""
Checks if the element is contained within the list of values. If the element, or the list are null then true is returned.
@param element to check
@param values to check in
@param <T> the type of the element
@return {@code tr... | java | public static <T> boolean elementIsNotContainedInArray(T element, T... values) {
if (element != null && values != null) {
return elementIsNotContainedInList(element, Arrays.asList(values));
}
else {
return false;
}
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"elementIsNotContainedInArray",
"(",
"T",
"element",
",",
"T",
"...",
"values",
")",
"{",
"if",
"(",
"element",
"!=",
"null",
"&&",
"values",
"!=",
"null",
")",
"{",
"return",
"elementIsNotContainedInList",
"(",
... | Checks if the element is contained within the list of values. If the element, or the list are null then true is returned.
@param element to check
@param values to check in
@param <T> the type of the element
@return {@code true} if the element and values are not {@code null} and the values does not contain the element,... | [
"Checks",
"if",
"the",
"element",
"is",
"contained",
"within",
"the",
"list",
"of",
"values",
".",
"If",
"the",
"element",
"or",
"the",
"list",
"are",
"null",
"then",
"true",
"is",
"returned",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/util/CompareUtil.java#L103-L110 |
spring-projects/spring-shell | spring-shell-standard-commands/src/main/java/org/springframework/shell/standard/commands/Help.java | Help.documentCommand | private CharSequence documentCommand(String command) {
"""
Return a description of a specific command. Uses a layout inspired by *nix man pages.
"""
MethodTarget methodTarget = commandRegistry.listCommands().get(command);
if (methodTarget == null) {
throw new IllegalArgumentException("Unknown command '"... | java | private CharSequence documentCommand(String command) {
MethodTarget methodTarget = commandRegistry.listCommands().get(command);
if (methodTarget == null) {
throw new IllegalArgumentException("Unknown command '" + command + "'");
}
AttributedStringBuilder result = new AttributedStringBuilder().append("\n\n")... | [
"private",
"CharSequence",
"documentCommand",
"(",
"String",
"command",
")",
"{",
"MethodTarget",
"methodTarget",
"=",
"commandRegistry",
".",
"listCommands",
"(",
")",
".",
"get",
"(",
"command",
")",
";",
"if",
"(",
"methodTarget",
"==",
"null",
")",
"{",
... | Return a description of a specific command. Uses a layout inspired by *nix man pages. | [
"Return",
"a",
"description",
"of",
"a",
"specific",
"command",
".",
"Uses",
"a",
"layout",
"inspired",
"by",
"*",
"nix",
"man",
"pages",
"."
] | train | https://github.com/spring-projects/spring-shell/blob/23d99f45eb8f487e31a1f080c837061313bbfafa/spring-shell-standard-commands/src/main/java/org/springframework/shell/standard/commands/Help.java#L119-L145 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/related/RelatedTablesCoreExtension.java | RelatedTablesCoreExtension.addMediaRelationship | public ExtendedRelation addMediaRelationship(String baseTableName,
MediaTable mediaTable, String mappingTableName) {
"""
Adds a media relationship between the base table and user media related
table. Creates a default user mapping table and the media table if
needed.
@param baseTableName
base table name
... | java | public ExtendedRelation addMediaRelationship(String baseTableName,
MediaTable mediaTable, String mappingTableName) {
return addRelationship(baseTableName, mediaTable, mappingTableName);
} | [
"public",
"ExtendedRelation",
"addMediaRelationship",
"(",
"String",
"baseTableName",
",",
"MediaTable",
"mediaTable",
",",
"String",
"mappingTableName",
")",
"{",
"return",
"addRelationship",
"(",
"baseTableName",
",",
"mediaTable",
",",
"mappingTableName",
")",
";",
... | Adds a media relationship between the base table and user media related
table. Creates a default user mapping table and the media table if
needed.
@param baseTableName
base table name
@param mediaTable
user media table
@param mappingTableName
user mapping table name
@return The relationship that was added | [
"Adds",
"a",
"media",
"relationship",
"between",
"the",
"base",
"table",
"and",
"user",
"media",
"related",
"table",
".",
"Creates",
"a",
"default",
"user",
"mapping",
"table",
"and",
"the",
"media",
"table",
"if",
"needed",
"."
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/related/RelatedTablesCoreExtension.java#L527-L530 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/CollectionUtils.java | CollectionUtils.containsObject | public static <T> boolean containsObject(Collection<T> c, T o) {
"""
Checks whether a Collection contains a specified Object. Object equality
(==), rather than .equals(), is used.
"""
for (Object o1 : c) {
if (o == o1) {
return true;
}
}
return false;
} | java | public static <T> boolean containsObject(Collection<T> c, T o) {
for (Object o1 : c) {
if (o == o1) {
return true;
}
}
return false;
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"containsObject",
"(",
"Collection",
"<",
"T",
">",
"c",
",",
"T",
"o",
")",
"{",
"for",
"(",
"Object",
"o1",
":",
"c",
")",
"{",
"if",
"(",
"o",
"==",
"o1",
")",
"{",
"return",
"true",
";",
"}",
... | Checks whether a Collection contains a specified Object. Object equality
(==), rather than .equals(), is used. | [
"Checks",
"whether",
"a",
"Collection",
"contains",
"a",
"specified",
"Object",
".",
"Object",
"equality",
"(",
"==",
")",
"rather",
"than",
".",
"equals",
"()",
"is",
"used",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/CollectionUtils.java#L241-L248 |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/utils/oms/CLI.java | CLI.createSim | public static Object createSim( String script, boolean groovy, String ll ) throws Exception {
"""
Create a simulation object.
@param script the script
@param groovy
@param ll
@return the simulation object.
"""
setOMSProperties();
Level.parse(ll); // may throw IAE
String prefix = g... | java | public static Object createSim( String script, boolean groovy, String ll ) throws Exception {
setOMSProperties();
Level.parse(ll); // may throw IAE
String prefix = groovy ? "" : "import static oms3.SimConst.*\n" + "def __sb__ = new oms3.SimBuilder(logging:'" + ll
+ "')\n" + "__sb... | [
"public",
"static",
"Object",
"createSim",
"(",
"String",
"script",
",",
"boolean",
"groovy",
",",
"String",
"ll",
")",
"throws",
"Exception",
"{",
"setOMSProperties",
"(",
")",
";",
"Level",
".",
"parse",
"(",
"ll",
")",
";",
"// may throw IAE",
"String",
... | Create a simulation object.
@param script the script
@param groovy
@param ll
@return the simulation object. | [
"Create",
"a",
"simulation",
"object",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/utils/oms/CLI.java#L108-L121 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java | CommerceOrderPersistenceImpl.fetchByUUID_G | @Override
public CommerceOrder fetchByUUID_G(String uuid, long groupId) {
"""
Returns the commerce order where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce order, o... | java | @Override
public CommerceOrder fetchByUUID_G(String uuid, long groupId) {
return fetchByUUID_G(uuid, groupId, true);
} | [
"@",
"Override",
"public",
"CommerceOrder",
"fetchByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"{",
"return",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
",",
"true",
")",
";",
"}"
] | Returns the commerce order where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce order, or <code>null</code> if a matching commerce order could not be found | [
"Returns",
"the",
"commerce",
"order",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"finder",
"cache",
... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java#L700-L703 |
juebanlin/util4j | util4j/src/main/java/net/jueb/util4j/util/WxQRUtil.java | WxQRUtil.getPerpetualQR_senceId | public static String getPerpetualQR_senceId(String access_token, int senceId) {
"""
生成永久二维码
http请求方式: POST URL:
https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=TOKEN
POST数据格式:json POST数据例子:{"action_name": "QR_LIMIT_SCENE", "action_info":
{"scene": {"scene_id": 123}}}
@param senceId
@return
"... | java | public static String getPerpetualQR_senceId(String access_token, int senceId) {
// 获取数据的地址(微信提供)
String url = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=" + access_token;
JsonObject content = new JsonObject();
content.addProperty("action_name", "QR_LIMIT_SCENE");
JsonObject scene = new... | [
"public",
"static",
"String",
"getPerpetualQR_senceId",
"(",
"String",
"access_token",
",",
"int",
"senceId",
")",
"{",
"// 获取数据的地址(微信提供)\r",
"String",
"url",
"=",
"\"https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=\"",
"+",
"access_token",
";",
"JsonObject",
"... | 生成永久二维码
http请求方式: POST URL:
https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=TOKEN
POST数据格式:json POST数据例子:{"action_name": "QR_LIMIT_SCENE", "action_info":
{"scene": {"scene_id": 123}}}
@param senceId
@return | [
"生成永久二维码",
"http请求方式",
":",
"POST",
"URL",
":",
"https",
":",
"//",
"api",
".",
"weixin",
".",
"qq",
".",
"com",
"/",
"cgi",
"-",
"bin",
"/",
"qrcode",
"/",
"create?access_token",
"=",
"TOKEN",
"POST数据格式:json",
"POST数据例子:",
"{",
"action_name",
":",
"QR_L... | train | https://github.com/juebanlin/util4j/blob/c404b2dbdedf7a8890533b351257fa8af4f1439f/util4j/src/main/java/net/jueb/util4j/util/WxQRUtil.java#L67-L89 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java | AttributeDefinition.resolveValue | public ModelNode resolveValue(final OperationContext context, final ModelNode value) throws OperationFailedException {
"""
Takes the given {@code value}, resolves it using the given {@code context}
and validates it using this attribute's {@link #getValidator() validator}. If the value is
undefined and a {@link #... | java | public ModelNode resolveValue(final OperationContext context, final ModelNode value) throws OperationFailedException {
return resolveValue(new ExpressionResolver() {
@Override
public ModelNode resolveExpressions(ModelNode node) throws OperationFailedException {
return con... | [
"public",
"ModelNode",
"resolveValue",
"(",
"final",
"OperationContext",
"context",
",",
"final",
"ModelNode",
"value",
")",
"throws",
"OperationFailedException",
"{",
"return",
"resolveValue",
"(",
"new",
"ExpressionResolver",
"(",
")",
"{",
"@",
"Override",
"publi... | Takes the given {@code value}, resolves it using the given {@code context}
and validates it using this attribute's {@link #getValidator() validator}. If the value is
undefined and a {@link #getDefaultValue() default value} is available, the default value is used.
@param context the context to use to {@link OperationCo... | [
"Takes",
"the",
"given",
"{",
"@code",
"value",
"}",
"resolves",
"it",
"using",
"the",
"given",
"{",
"@code",
"context",
"}",
"and",
"validates",
"it",
"using",
"this",
"attribute",
"s",
"{",
"@link",
"#getValidator",
"()",
"validator",
"}",
".",
"If",
"... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java#L641-L648 |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/BandwidthClient.java | BandwidthClient.generatePostRequest | protected HttpPost generatePostRequest(final String path, final Map<String, Object> paramMap) {
"""
Helper method to build the POST request for the server.
@param path the path.
@param paramMap the parameters map.
@return the post object.
"""
final HttpPost post = new HttpPost(buildUri(path));
... | java | protected HttpPost generatePostRequest(final String path, final Map<String, Object> paramMap) {
final HttpPost post = new HttpPost(buildUri(path));
post.setEntity(new StringEntity(JSONObject.toJSONString(paramMap), ContentType.APPLICATION_JSON));
return post;
} | [
"protected",
"HttpPost",
"generatePostRequest",
"(",
"final",
"String",
"path",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"paramMap",
")",
"{",
"final",
"HttpPost",
"post",
"=",
"new",
"HttpPost",
"(",
"buildUri",
"(",
"path",
")",
")",
";",
... | Helper method to build the POST request for the server.
@param path the path.
@param paramMap the parameters map.
@return the post object. | [
"Helper",
"method",
"to",
"build",
"the",
"POST",
"request",
"for",
"the",
"server",
"."
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/BandwidthClient.java#L626-L630 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/GeneralizedCounter.java | GeneralizedCounter.getCount | public double getCount(K o1, K o2, K o3) {
"""
A convenience method equivalent to <code>{@link
#getCounts}({o1,o2,o3})</code>; works only for depth 3
GeneralizedCounters
"""
if (depth != 3) {
wrongDepth();
}
GeneralizedCounter<K> gc1 = ErasureUtils.<GeneralizedCounter<K>>uncheckedCast(m... | java | public double getCount(K o1, K o2, K o3) {
if (depth != 3) {
wrongDepth();
}
GeneralizedCounter<K> gc1 = ErasureUtils.<GeneralizedCounter<K>>uncheckedCast(map.get(o1));
if (gc1 == null) {
return 0.0;
} else {
return gc1.getCount(o2, o3);
}
} | [
"public",
"double",
"getCount",
"(",
"K",
"o1",
",",
"K",
"o2",
",",
"K",
"o3",
")",
"{",
"if",
"(",
"depth",
"!=",
"3",
")",
"{",
"wrongDepth",
"(",
")",
";",
"}",
"GeneralizedCounter",
"<",
"K",
">",
"gc1",
"=",
"ErasureUtils",
".",
"<",
"Gener... | A convenience method equivalent to <code>{@link
#getCounts}({o1,o2,o3})</code>; works only for depth 3
GeneralizedCounters | [
"A",
"convenience",
"method",
"equivalent",
"to",
"<code",
">",
"{"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/GeneralizedCounter.java#L343-L353 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/Instructions.java | Instructions.mergeAndOverrideExisting | public static Properties mergeAndOverrideExisting(Properties props1, Properties props2) {
"""
Utility method to merge instructions from {@code props2} into the {@code props1}. The instructions
from {@code props2} override the instructions from {@code props1} (when both contain the same instruction)
@param pro... | java | public static Properties mergeAndOverrideExisting(Properties props1, Properties props2) {
Properties properties = new Properties();
properties.putAll(props1);
properties.putAll(props2);
return properties;
} | [
"public",
"static",
"Properties",
"mergeAndOverrideExisting",
"(",
"Properties",
"props1",
",",
"Properties",
"props2",
")",
"{",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",
")",
";",
"properties",
".",
"putAll",
"(",
"props1",
")",
";",
"properti... | Utility method to merge instructions from {@code props2} into the {@code props1}. The instructions
from {@code props2} override the instructions from {@code props1} (when both contain the same instruction)
@param props1 the first set of instructions
@param props2 the second set of instructions
@return the new set of ... | [
"Utility",
"method",
"to",
"merge",
"instructions",
"from",
"{",
"@code",
"props2",
"}",
"into",
"the",
"{",
"@code",
"props1",
"}",
".",
"The",
"instructions",
"from",
"{",
"@code",
"props2",
"}",
"override",
"the",
"instructions",
"from",
"{",
"@code",
"... | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/Instructions.java#L64-L69 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.containsURL | public static boolean containsURL(final URL[] urls, final URL url) {
"""
Checks if the array or URLs contains the given URL.
@param urls
Array of URLs - Cannot be <code>null</code>.
@param url
URL to find - Cannot be <code>null</code>.
@return If the URL is in the array TRUE else FALSE.
"""
c... | java | public static boolean containsURL(final URL[] urls, final URL url) {
checkNotNull("urls", urls);
checkNotNull("url", url);
for (int i = 0; i < urls.length; i++) {
final URL element = urls[i];
final String elementStr = element.toExternalForm();
final Stri... | [
"public",
"static",
"boolean",
"containsURL",
"(",
"final",
"URL",
"[",
"]",
"urls",
",",
"final",
"URL",
"url",
")",
"{",
"checkNotNull",
"(",
"\"urls\"",
",",
"urls",
")",
";",
"checkNotNull",
"(",
"\"url\"",
",",
"url",
")",
";",
"for",
"(",
"int",
... | Checks if the array or URLs contains the given URL.
@param urls
Array of URLs - Cannot be <code>null</code>.
@param url
URL to find - Cannot be <code>null</code>.
@return If the URL is in the array TRUE else FALSE. | [
"Checks",
"if",
"the",
"array",
"or",
"URLs",
"contains",
"the",
"given",
"URL",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L273-L285 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java | PhotosInterface.getImage | public BufferedImage getImage(Photo photo, int size) throws FlickrException {
"""
Request an image from the Flickr-servers.
<p>
At {@link Size} you can find constants for the available sizes.
@param photo
A photo-object
@param size
The size
@return An Image
@throws FlickrException
"""
try ... | java | public BufferedImage getImage(Photo photo, int size) throws FlickrException {
try {
return ImageIO.read(getImageAsStream(photo, size));
} catch (IOException e) {
throw new FlickrException(e.getMessage(), e.getCause());
}
} | [
"public",
"BufferedImage",
"getImage",
"(",
"Photo",
"photo",
",",
"int",
"size",
")",
"throws",
"FlickrException",
"{",
"try",
"{",
"return",
"ImageIO",
".",
"read",
"(",
"getImageAsStream",
"(",
"photo",
",",
"size",
")",
")",
";",
"}",
"catch",
"(",
"... | Request an image from the Flickr-servers.
<p>
At {@link Size} you can find constants for the available sizes.
@param photo
A photo-object
@param size
The size
@return An Image
@throws FlickrException | [
"Request",
"an",
"image",
"from",
"the",
"Flickr",
"-",
"servers",
".",
"<p",
">"
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java#L1409-L1415 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListPersistenceImpl.java | CommercePriceListPersistenceImpl.findAll | @Override
public List<CommercePriceList> findAll() {
"""
Returns all the commerce price lists.
@return the commerce price lists
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommercePriceList> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommercePriceList",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce price lists.
@return the commerce price lists | [
"Returns",
"all",
"the",
"commerce",
"price",
"lists",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListPersistenceImpl.java#L5942-L5945 |
opendatatrentino/s-match | src/main/java/it/unitn/disi/smatch/filters/SPSMMappingFilter.java | SPSMMappingFilter.filterMappingsOfChildren | private void filterMappingsOfChildren(INode sourceParent, INode targetParent, char semanticRelation) {
"""
Sorts the children of the given nodes.
@param sourceParent Source node.
@param targetParent Target node.
@param semanticRelation the relation to use for comparison.
"""
List<INode> s... | java | private void filterMappingsOfChildren(INode sourceParent, INode targetParent, char semanticRelation) {
List<INode> source = new ArrayList<INode>(sourceParent.getChildrenList());
List<INode> target = new ArrayList<INode>(targetParent.getChildrenList());
sourceIndex.add(sourceParent.getLevel(... | [
"private",
"void",
"filterMappingsOfChildren",
"(",
"INode",
"sourceParent",
",",
"INode",
"targetParent",
",",
"char",
"semanticRelation",
")",
"{",
"List",
"<",
"INode",
">",
"source",
"=",
"new",
"ArrayList",
"<",
"INode",
">",
"(",
"sourceParent",
".",
"ge... | Sorts the children of the given nodes.
@param sourceParent Source node.
@param targetParent Target node.
@param semanticRelation the relation to use for comparison. | [
"Sorts",
"the",
"children",
"of",
"the",
"given",
"nodes",
"."
] | train | https://github.com/opendatatrentino/s-match/blob/ba5982ef406b7010c2f92592e43887a485935aa1/src/main/java/it/unitn/disi/smatch/filters/SPSMMappingFilter.java#L122-L136 |
hdecarne/java-default | src/main/java/de/carne/io/IOUtil.java | IOUtil.copyFile | public static long copyFile(File dst, File src) throws IOException {
"""
Copies all bytes from a {@linkplain File} to a {@linkplain File}.
@param dst the {@linkplain File} to copy to.
@param src the {@linkplain File} to copy from.
@return the number of copied bytes.
@throws IOException if an I/O error occurs... | java | public static long copyFile(File dst, File src) throws IOException {
long copied;
try (FileInputStream srcStream = new FileInputStream(src)) {
copied = copyStream(dst, srcStream);
}
return copied;
} | [
"public",
"static",
"long",
"copyFile",
"(",
"File",
"dst",
",",
"File",
"src",
")",
"throws",
"IOException",
"{",
"long",
"copied",
";",
"try",
"(",
"FileInputStream",
"srcStream",
"=",
"new",
"FileInputStream",
"(",
"src",
")",
")",
"{",
"copied",
"=",
... | Copies all bytes from a {@linkplain File} to a {@linkplain File}.
@param dst the {@linkplain File} to copy to.
@param src the {@linkplain File} to copy from.
@return the number of copied bytes.
@throws IOException if an I/O error occurs. | [
"Copies",
"all",
"bytes",
"from",
"a",
"{",
"@linkplain",
"File",
"}",
"to",
"a",
"{",
"@linkplain",
"File",
"}",
"."
] | train | https://github.com/hdecarne/java-default/blob/ca16f6fdb0436e90e9e2df3106055e320bb3c9e3/src/main/java/de/carne/io/IOUtil.java#L135-L142 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseLongObj | @Nullable
public static Long parseLongObj (@Nullable final String sStr) {
"""
Parse the given {@link String} as {@link Long} with radix
{@value #DEFAULT_RADIX}.
@param sStr
The string to parse. May be <code>null</code>.
@return <code>null</code> if the string does not represent a valid value.
"""
r... | java | @Nullable
public static Long parseLongObj (@Nullable final String sStr)
{
return parseLongObj (sStr, DEFAULT_RADIX, null);
} | [
"@",
"Nullable",
"public",
"static",
"Long",
"parseLongObj",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
")",
"{",
"return",
"parseLongObj",
"(",
"sStr",
",",
"DEFAULT_RADIX",
",",
"null",
")",
";",
"}"
] | Parse the given {@link String} as {@link Long} with radix
{@value #DEFAULT_RADIX}.
@param sStr
The string to parse. May be <code>null</code>.
@return <code>null</code> if the string does not represent a valid value. | [
"Parse",
"the",
"given",
"{",
"@link",
"String",
"}",
"as",
"{",
"@link",
"Long",
"}",
"with",
"radix",
"{",
"@value",
"#DEFAULT_RADIX",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L1115-L1119 |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/table/WatchTable.java | WatchTable.onPut | @Override
public void onPut(byte[] key, TypePut type) {
"""
Notification on a table put.
@param key the key of the updated row
@param type the notification type (local/remote)
"""
//_watchKey.init(key);
WatchKey watchKey = new WatchKey(key);
switch (type) {
case LOCAL:
ArrayList... | java | @Override
public void onPut(byte[] key, TypePut type)
{
//_watchKey.init(key);
WatchKey watchKey = new WatchKey(key);
switch (type) {
case LOCAL:
ArrayList<WatchEntry> listLocal = _entryMapLocal.get(watchKey);
onPut(listLocal, key);
break;
case REMOTE:
{
in... | [
"@",
"Override",
"public",
"void",
"onPut",
"(",
"byte",
"[",
"]",
"key",
",",
"TypePut",
"type",
")",
"{",
"//_watchKey.init(key);",
"WatchKey",
"watchKey",
"=",
"new",
"WatchKey",
"(",
"key",
")",
";",
"switch",
"(",
"type",
")",
"{",
"case",
"LOCAL",
... | Notification on a table put.
@param key the key of the updated row
@param type the notification type (local/remote) | [
"Notification",
"on",
"a",
"table",
"put",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/table/WatchTable.java#L151-L188 |
udoprog/ffwd-client-java | src/main/java/com/google/protobuf250/CodedOutputStream.java | CodedOutputStream.writeMessage | public void writeMessage(final int fieldNumber, final MessageLite value)
throws IOException {
"""
Write an embedded message field, including tag, to the stream.
"""
writeTag(fieldNumber, WireFormat.WIRETYPE_LENGTH_DELIMITED);
writeMessageNoTag(value);
} | java | public void writeMessage(final int fieldNumber, final MessageLite value)
throws IOException {
writeTag(fieldNumber, WireFormat.WIRETYPE_LENGTH_DELIMITED);
writeMessageNoTag(value);
} | [
"public",
"void",
"writeMessage",
"(",
"final",
"int",
"fieldNumber",
",",
"final",
"MessageLite",
"value",
")",
"throws",
"IOException",
"{",
"writeTag",
"(",
"fieldNumber",
",",
"WireFormat",
".",
"WIRETYPE_LENGTH_DELIMITED",
")",
";",
"writeMessageNoTag",
"(",
... | Write an embedded message field, including tag, to the stream. | [
"Write",
"an",
"embedded",
"message",
"field",
"including",
"tag",
"to",
"the",
"stream",
"."
] | train | https://github.com/udoprog/ffwd-client-java/blob/b4161d2b138e3edb8fa9420cc3cc653d5764cf5b/src/main/java/com/google/protobuf250/CodedOutputStream.java#L219-L223 |
Terradue/jcatalogue-client | apis/src/main/java/com/terradue/jcatalogue/repository/Proxy.java | Proxy.setAuthentication | public Proxy setAuthentication( Authentication auth ) {
"""
Sets the authentication to use for the proxy connection.
@param auth The authentication to use, may be {@code null}.
@return The new proxy, never {@code null}.
"""
if ( eq( this.auth, auth ) )
{
return this;
}
... | java | public Proxy setAuthentication( Authentication auth )
{
if ( eq( this.auth, auth ) )
{
return this;
}
return new Proxy( type, host, port, auth );
} | [
"public",
"Proxy",
"setAuthentication",
"(",
"Authentication",
"auth",
")",
"{",
"if",
"(",
"eq",
"(",
"this",
".",
"auth",
",",
"auth",
")",
")",
"{",
"return",
"this",
";",
"}",
"return",
"new",
"Proxy",
"(",
"type",
",",
"host",
",",
"port",
",",
... | Sets the authentication to use for the proxy connection.
@param auth The authentication to use, may be {@code null}.
@return The new proxy, never {@code null}. | [
"Sets",
"the",
"authentication",
"to",
"use",
"for",
"the",
"proxy",
"connection",
"."
] | train | https://github.com/Terradue/jcatalogue-client/blob/1f24c4da952d8ad2373c4fa97eed48b0b8a88d21/apis/src/main/java/com/terradue/jcatalogue/repository/Proxy.java#L154-L161 |
mcdiae/kludje | kludje-core/src/main/java/uk/kludje/MetaConfig.java | MetaConfig.withObjectEqualsChecks | public MetaConfig withObjectEqualsChecks(ObjectEqualsPolicy equalsPolicy, ObjectHashCodePolicy hashCodePolicy) {
"""
Allows consumers to set special handling for {@link Getter#get(Object)} responses for
{@link Meta#equals(Object, Object)}, {@link Meta#hashCode(Object)}.
@param equalsPolicy a non-null equals po... | java | public MetaConfig withObjectEqualsChecks(ObjectEqualsPolicy equalsPolicy, ObjectHashCodePolicy hashCodePolicy) {
Ensure.that(equalsPolicy != null, "equalsPolicy != null");
Ensure.that(hashCodePolicy != null, "hashCodePolicy != null");
return new MetaConfigBuilder(this)
.setObjectEqualsPolicy(equalsPo... | [
"public",
"MetaConfig",
"withObjectEqualsChecks",
"(",
"ObjectEqualsPolicy",
"equalsPolicy",
",",
"ObjectHashCodePolicy",
"hashCodePolicy",
")",
"{",
"Ensure",
".",
"that",
"(",
"equalsPolicy",
"!=",
"null",
",",
"\"equalsPolicy != null\"",
")",
";",
"Ensure",
".",
"t... | Allows consumers to set special handling for {@link Getter#get(Object)} responses for
{@link Meta#equals(Object, Object)}, {@link Meta#hashCode(Object)}.
@param equalsPolicy a non-null equals policy
@param hashCodePolicy a non-null hash policy
@return the new config
@see #withShallowArraySupport() | [
"Allows",
"consumers",
"to",
"set",
"special",
"handling",
"for",
"{",
"@link",
"Getter#get",
"(",
"Object",
")",
"}",
"responses",
"for",
"{",
"@link",
"Meta#equals",
"(",
"Object",
"Object",
")",
"}",
"{",
"@link",
"Meta#hashCode",
"(",
"Object",
")",
"}... | train | https://github.com/mcdiae/kludje/blob/9ed80cd183ebf162708d5922d784f79ac3841dfc/kludje-core/src/main/java/uk/kludje/MetaConfig.java#L168-L176 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java | ImageMiscOps.insertBand | public static void insertBand( GrayI16 input, int band , InterleavedI16 output) {
"""
Inserts a single band into a multi-band image overwriting the original band
@param input Single band image
@param band Which band the image is to be inserted into
@param output The multi-band image which the input image is t... | java | public static void insertBand( GrayI16 input, int band , InterleavedI16 output) {
final int numBands = output.numBands;
for (int y = 0; y < input.height; y++) {
int indexIn = input.getStartIndex() + y * input.getStride();
int indexOut = output.getStartIndex() + y * output.getStride() + band;
int end = ind... | [
"public",
"static",
"void",
"insertBand",
"(",
"GrayI16",
"input",
",",
"int",
"band",
",",
"InterleavedI16",
"output",
")",
"{",
"final",
"int",
"numBands",
"=",
"output",
".",
"numBands",
";",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"input",... | Inserts a single band into a multi-band image overwriting the original band
@param input Single band image
@param band Which band the image is to be inserted into
@param output The multi-band image which the input image is to be inserted into | [
"Inserts",
"a",
"single",
"band",
"into",
"a",
"multi",
"-",
"band",
"image",
"overwriting",
"the",
"original",
"band"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java#L714-L725 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalDateTime.java | LocalDateTime.plusWeeks | public LocalDateTime plusWeeks(long weeks) {
"""
Returns a copy of this {@code LocalDateTime} with the specified number of weeks added.
<p>
This method adds the specified amount in weeks to the days field incrementing
the month and year fields as necessary to ensure the result remains valid.
The result is only... | java | public LocalDateTime plusWeeks(long weeks) {
LocalDate newDate = date.plusWeeks(weeks);
return with(newDate, time);
} | [
"public",
"LocalDateTime",
"plusWeeks",
"(",
"long",
"weeks",
")",
"{",
"LocalDate",
"newDate",
"=",
"date",
".",
"plusWeeks",
"(",
"weeks",
")",
";",
"return",
"with",
"(",
"newDate",
",",
"time",
")",
";",
"}"
] | Returns a copy of this {@code LocalDateTime} with the specified number of weeks added.
<p>
This method adds the specified amount in weeks to the days field incrementing
the month and year fields as necessary to ensure the result remains valid.
The result is only invalid if the maximum/minimum year is exceeded.
<p>
For ... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"LocalDateTime",
"}",
"with",
"the",
"specified",
"number",
"of",
"weeks",
"added",
".",
"<p",
">",
"This",
"method",
"adds",
"the",
"specified",
"amount",
"in",
"weeks",
"to",
"the",
"days",
"field",
"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalDateTime.java#L1259-L1262 |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/JanusConfig.java | JanusConfig.getSystemPropertyAsEnum | public static <S extends Enum<S>> S getSystemPropertyAsEnum(Class<S> type, String name, S defaultValue) {
"""
Replies the value of the integer system property.
@param <S>
- type of the enumeration to read.
@param type
- type of the enumeration.
@param name
- name of the property.
@param defaultValue
- va... | java | public static <S extends Enum<S>> S getSystemPropertyAsEnum(Class<S> type, String name, S defaultValue) {
final String value = getSystemProperty(name, null);
if (value != null) {
try {
final S enumeration = Enum.valueOf(type, value);
if (enumeration != null) {... | [
"public",
"static",
"<",
"S",
"extends",
"Enum",
"<",
"S",
">",
">",
"S",
"getSystemPropertyAsEnum",
"(",
"Class",
"<",
"S",
">",
"type",
",",
"String",
"name",
",",
"S",
"defaultValue",
")",
"{",
"final",
"String",
"value",
"=",
"getSystemProperty",
"("... | Replies the value of the integer system property.
@param <S>
- type of the enumeration to read.
@param type
- type of the enumeration.
@param name
- name of the property.
@param defaultValue
- value to reply if the these is no property found
@return the value, or defaultValue. | [
"Replies",
"the",
"value",
"of",
"the",
"integer",
"system",
"property",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/JanusConfig.java#L457-L479 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/IntStream.java | IntStream.iterate | @NotNull
public static IntStream iterate(final int seed,
@NotNull final IntUnaryOperator f) {
"""
Returns an infinite sequential ordered {@code IntStream} produced by iterative
application of a function {@code f} to an initial element {@code seed},
producing a {@code Strea... | java | @NotNull
public static IntStream iterate(final int seed,
@NotNull final IntUnaryOperator f) {
Objects.requireNonNull(f);
return new IntStream(new IntIterate(seed, f));
} | [
"@",
"NotNull",
"public",
"static",
"IntStream",
"iterate",
"(",
"final",
"int",
"seed",
",",
"@",
"NotNull",
"final",
"IntUnaryOperator",
"f",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"f",
")",
";",
"return",
"new",
"IntStream",
"(",
"new",
"IntIt... | Returns an infinite sequential ordered {@code IntStream} produced by iterative
application of a function {@code f} to an initial element {@code seed},
producing a {@code Stream} consisting of {@code seed}, {@code f(seed)},
{@code f(f(seed))}, etc.
<p> The first element (position {@code 0}) in the {@code IntStream} wil... | [
"Returns",
"an",
"infinite",
"sequential",
"ordered",
"{",
"@code",
"IntStream",
"}",
"produced",
"by",
"iterative",
"application",
"of",
"a",
"function",
"{",
"@code",
"f",
"}",
"to",
"an",
"initial",
"element",
"{",
"@code",
"seed",
"}",
"producing",
"a",
... | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/IntStream.java#L182-L187 |
micronaut-projects/micronaut-core | multitenancy/src/main/java/io/micronaut/multitenancy/writer/HttpHeaderTenantWriter.java | HttpHeaderTenantWriter.writeTenant | @Override
public void writeTenant(MutableHttpRequest<?> request, Serializable tenant) {
"""
Writes the token to the request.
@param request The {@link MutableHttpRequest} instance
@param tenant Tenant Id
"""
if (tenant instanceof CharSequence) {
request.header(getHeaderName(), (CharSe... | java | @Override
public void writeTenant(MutableHttpRequest<?> request, Serializable tenant) {
if (tenant instanceof CharSequence) {
request.header(getHeaderName(), (CharSequence) tenant);
}
} | [
"@",
"Override",
"public",
"void",
"writeTenant",
"(",
"MutableHttpRequest",
"<",
"?",
">",
"request",
",",
"Serializable",
"tenant",
")",
"{",
"if",
"(",
"tenant",
"instanceof",
"CharSequence",
")",
"{",
"request",
".",
"header",
"(",
"getHeaderName",
"(",
... | Writes the token to the request.
@param request The {@link MutableHttpRequest} instance
@param tenant Tenant Id | [
"Writes",
"the",
"token",
"to",
"the",
"request",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/multitenancy/src/main/java/io/micronaut/multitenancy/writer/HttpHeaderTenantWriter.java#L57-L62 |
voldemort/voldemort | src/java/voldemort/utils/MetadataVersionStoreUtils.java | MetadataVersionStoreUtils.getProperties | public static Properties getProperties(SystemStoreClient<String, String> versionStore) {
"""
Retrieves a properties (hashmap) consisting of all the metadata versions
@param versionStore The system store client used to retrieve the metadata
versions
@return Properties object containing all the
'property_name=... | java | public static Properties getProperties(SystemStoreClient<String, String> versionStore) {
Properties props = null;
Versioned<String> versioned = versionStore.getSysStore(SystemStoreConstants.VERSIONS_METADATA_KEY);
if(versioned != null && versioned.getValue() != null) {
try {
... | [
"public",
"static",
"Properties",
"getProperties",
"(",
"SystemStoreClient",
"<",
"String",
",",
"String",
">",
"versionStore",
")",
"{",
"Properties",
"props",
"=",
"null",
";",
"Versioned",
"<",
"String",
">",
"versioned",
"=",
"versionStore",
".",
"getSysStor... | Retrieves a properties (hashmap) consisting of all the metadata versions
@param versionStore The system store client used to retrieve the metadata
versions
@return Properties object containing all the
'property_name=property_value' values | [
"Retrieves",
"a",
"properties",
"(",
"hashmap",
")",
"consisting",
"of",
"all",
"the",
"metadata",
"versions"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/MetadataVersionStoreUtils.java#L51-L65 |
google/truth | extensions/proto/src/main/java/com/google/common/truth/extensions/proto/IterableOfProtosSubject.java | IterableOfProtosSubject.ignoringFieldScope | public IterableOfProtosFluentAssertion<M> ignoringFieldScope(FieldScope fieldScope) {
"""
Excludes all specific field paths under the argument {@link FieldScope} from the comparison.
<p>This method is additive and has well-defined ordering semantics. If the invoking {@link
ProtoFluentAssertion} is already scop... | java | public IterableOfProtosFluentAssertion<M> ignoringFieldScope(FieldScope fieldScope) {
return usingConfig(config.ignoringFieldScope(checkNotNull(fieldScope, "fieldScope")));
} | [
"public",
"IterableOfProtosFluentAssertion",
"<",
"M",
">",
"ignoringFieldScope",
"(",
"FieldScope",
"fieldScope",
")",
"{",
"return",
"usingConfig",
"(",
"config",
".",
"ignoringFieldScope",
"(",
"checkNotNull",
"(",
"fieldScope",
",",
"\"fieldScope\"",
")",
")",
"... | Excludes all specific field paths under the argument {@link FieldScope} from the comparison.
<p>This method is additive and has well-defined ordering semantics. If the invoking {@link
ProtoFluentAssertion} is already scoped to a {@link FieldScope} {@code X}, and this method is
invoked with {@link FieldScope} {@code Y}... | [
"Excludes",
"all",
"specific",
"field",
"paths",
"under",
"the",
"argument",
"{",
"@link",
"FieldScope",
"}",
"from",
"the",
"comparison",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/IterableOfProtosSubject.java#L953-L955 |
ag-gipp/MathMLTools | mathml-core/src/main/java/com/formulasearchengine/mathmltools/helper/XMLHelper.java | XMLHelper.getElementB | public static Node getElementB(Node node, XPathExpression xPath) throws XPathExpressionException {
"""
Helper program: Extracts the specified XPATH expression
from an XML-String.
@param node the node
@param xPath the x path
@return NodeList
@throws XPathExpressionException the x path expression exception
... | java | public static Node getElementB(Node node, XPathExpression xPath) throws XPathExpressionException {
return getElementsB(node, xPath).item(0);
} | [
"public",
"static",
"Node",
"getElementB",
"(",
"Node",
"node",
",",
"XPathExpression",
"xPath",
")",
"throws",
"XPathExpressionException",
"{",
"return",
"getElementsB",
"(",
"node",
",",
"xPath",
")",
".",
"item",
"(",
"0",
")",
";",
"}"
] | Helper program: Extracts the specified XPATH expression
from an XML-String.
@param node the node
@param xPath the x path
@return NodeList
@throws XPathExpressionException the x path expression exception | [
"Helper",
"program",
":",
"Extracts",
"the",
"specified",
"XPATH",
"expression",
"from",
"an",
"XML",
"-",
"String",
"."
] | train | https://github.com/ag-gipp/MathMLTools/blob/77c69b6366a5b8720796d1cd9d155ba26c2f1b20/mathml-core/src/main/java/com/formulasearchengine/mathmltools/helper/XMLHelper.java#L154-L156 |
jhy/jsoup | src/main/java/org/jsoup/nodes/Element.java | Element.getElementsByAttributeValue | public Elements getElementsByAttributeValue(String key, String value) {
"""
Find elements that have an attribute with the specific value. Case insensitive.
@param key name of the attribute
@param value value of the attribute
@return elements that have this attribute with this value, empty if none
"""
... | java | public Elements getElementsByAttributeValue(String key, String value) {
return Collector.collect(new Evaluator.AttributeWithValue(key, value), this);
} | [
"public",
"Elements",
"getElementsByAttributeValue",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"return",
"Collector",
".",
"collect",
"(",
"new",
"Evaluator",
".",
"AttributeWithValue",
"(",
"key",
",",
"value",
")",
",",
"this",
")",
";",
"}"
... | Find elements that have an attribute with the specific value. Case insensitive.
@param key name of the attribute
@param value value of the attribute
@return elements that have this attribute with this value, empty if none | [
"Find",
"elements",
"that",
"have",
"an",
"attribute",
"with",
"the",
"specific",
"value",
".",
"Case",
"insensitive",
"."
] | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/nodes/Element.java#L863-L865 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/DisksInner.java | DisksInner.beginDeleteAsync | public Observable<OperationStatusResponseInner> beginDeleteAsync(String resourceGroupName, String diskName) {
"""
Deletes a disk.
@param resourceGroupName The name of the resource group.
@param diskName The name of the managed disk that is being created. The name can't be changed after the disk is created. Sup... | java | public Observable<OperationStatusResponseInner> beginDeleteAsync(String resourceGroupName, String diskName) {
return beginDeleteWithServiceResponseAsync(resourceGroupName, diskName).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {
@Override
p... | [
"public",
"Observable",
"<",
"OperationStatusResponseInner",
">",
"beginDeleteAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"diskName",
")",
"{",
"return",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"diskName",
")",
".",
"map",
"(... | Deletes a disk.
@param resourceGroupName The name of the resource group.
@param diskName The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
@throws IllegalArgumentE... | [
"Deletes",
"a",
"disk",
"."
] | train | 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/DisksInner.java#L667-L674 |
google/error-prone-javac | src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java | ElementFilter.packagesIn | public static Set<PackageElement>
packagesIn(Set<? extends Element> elements) {
"""
Returns a set of packages in {@code elements}.
@return a set of packages in {@code elements}
@param elements the elements to filter
"""
return setFilter(elements, PACKAGE_KIND, PackageElement.class);
} | java | public static Set<PackageElement>
packagesIn(Set<? extends Element> elements) {
return setFilter(elements, PACKAGE_KIND, PackageElement.class);
} | [
"public",
"static",
"Set",
"<",
"PackageElement",
">",
"packagesIn",
"(",
"Set",
"<",
"?",
"extends",
"Element",
">",
"elements",
")",
"{",
"return",
"setFilter",
"(",
"elements",
",",
"PACKAGE_KIND",
",",
"PackageElement",
".",
"class",
")",
";",
"}"
] | Returns a set of packages in {@code elements}.
@return a set of packages in {@code elements}
@param elements the elements to filter | [
"Returns",
"a",
"set",
"of",
"packages",
"in",
"{"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java#L182-L185 |
janus-project/guava.janusproject.io | guava/src/com/google/common/base/Joiner.java | Joiner.appendTo | public final <A extends Appendable> A appendTo(A appendable, Object[] parts) throws IOException {
"""
Appends the string representation of each of {@code parts}, using the previously configured
separator between each, to {@code appendable}.
"""
return appendTo(appendable, Arrays.asList(parts));
} | java | public final <A extends Appendable> A appendTo(A appendable, Object[] parts) throws IOException {
return appendTo(appendable, Arrays.asList(parts));
} | [
"public",
"final",
"<",
"A",
"extends",
"Appendable",
">",
"A",
"appendTo",
"(",
"A",
"appendable",
",",
"Object",
"[",
"]",
"parts",
")",
"throws",
"IOException",
"{",
"return",
"appendTo",
"(",
"appendable",
",",
"Arrays",
".",
"asList",
"(",
"parts",
... | Appends the string representation of each of {@code parts}, using the previously configured
separator between each, to {@code appendable}. | [
"Appends",
"the",
"string",
"representation",
"of",
"each",
"of",
"{"
] | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/base/Joiner.java#L121-L123 |
twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java | AbstractMavenScroogeMojo.isDepOfIdlArtifact | private boolean isDepOfIdlArtifact(Artifact artifact, Map<String, Artifact> depsMap) {
"""
Checks if the artifact is dependency of an dependent idl artifact
@returns true if the artifact was a dependency of idl artifact
"""
List<String> depTrail = artifact.getDependencyTrail();
// depTrail can be null... | java | private boolean isDepOfIdlArtifact(Artifact artifact, Map<String, Artifact> depsMap) {
List<String> depTrail = artifact.getDependencyTrail();
// depTrail can be null sometimes, which seems like a maven bug
if (depTrail != null) {
for (String name : depTrail) {
Artifact dep = depsMap.get(name);... | [
"private",
"boolean",
"isDepOfIdlArtifact",
"(",
"Artifact",
"artifact",
",",
"Map",
"<",
"String",
",",
"Artifact",
">",
"depsMap",
")",
"{",
"List",
"<",
"String",
">",
"depTrail",
"=",
"artifact",
".",
"getDependencyTrail",
"(",
")",
";",
"// depTrail can b... | Checks if the artifact is dependency of an dependent idl artifact
@returns true if the artifact was a dependency of idl artifact | [
"Checks",
"if",
"the",
"artifact",
"is",
"dependency",
"of",
"an",
"dependent",
"idl",
"artifact"
] | train | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java#L539-L551 |
osglworks/java-tool | src/main/java/org/osgl/Lang.java | F5.applyOrElse | public R applyOrElse(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5,
F5<? super P1, ? super P2, ? super P3, ? super P4, ? super P5, ? extends R> fallback
) {
"""
Applies this partial function to the given argument when it is contained in the function domain.
Applies fallback function where... | java | public R applyOrElse(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5,
F5<? super P1, ? super P2, ? super P3, ? super P4, ? super P5, ? extends R> fallback
) {
try {
return apply(p1, p2, p3, p4, p5);
} catch (RuntimeException e) {
return fall... | [
"public",
"R",
"applyOrElse",
"(",
"P1",
"p1",
",",
"P2",
"p2",
",",
"P3",
"p3",
",",
"P4",
"p4",
",",
"P5",
"p5",
",",
"F5",
"<",
"?",
"super",
"P1",
",",
"?",
"super",
"P2",
",",
"?",
"super",
"P3",
",",
"?",
"super",
"P4",
",",
"?",
"sup... | Applies this partial function to the given argument when it is contained in the function domain.
Applies fallback function where this partial function is not defined.
@param p1
the first argument
@param p2
the second argument
@param p3
the third argument
@param p4
the fourth argument
@param p5
the fifth argument
@para... | [
"Applies",
"this",
"partial",
"function",
"to",
"the",
"given",
"argument",
"when",
"it",
"is",
"contained",
"in",
"the",
"function",
"domain",
".",
"Applies",
"fallback",
"function",
"where",
"this",
"partial",
"function",
"is",
"not",
"defined",
"."
] | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/Lang.java#L1791-L1799 |
TimeAndSpaceIO/SmoothieMap | src/main/java/net/openhft/smoothie/SmoothieMap.java | SmoothieMap.put | @Override
public final V put(K key, V value) {
"""
Associates the specified value with the specified key in this map. If the map previously
contained a mapping for the key, the old value is replaced by the specified value. (A map
{@code m} is said to contain a mapping for a key {@code k} if and only if {@lin... | java | @Override
public final V put(K key, V value) {
long hash;
return segment(segmentIndex(hash = keyHashCode(key))).put(this, hash, key, value, false);
} | [
"@",
"Override",
"public",
"final",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"long",
"hash",
";",
"return",
"segment",
"(",
"segmentIndex",
"(",
"hash",
"=",
"keyHashCode",
"(",
"key",
")",
")",
")",
".",
"put",
"(",
"this",
",",
... | Associates the specified value with the specified key in this map. If the map previously
contained a mapping for the key, the old value is replaced by the specified value. (A map
{@code m} is said to contain a mapping for a key {@code k} if and only if {@link
#containsKey(Object) m.containsKey(k)} would return {@code t... | [
"Associates",
"the",
"specified",
"value",
"with",
"the",
"specified",
"key",
"in",
"this",
"map",
".",
"If",
"the",
"map",
"previously",
"contained",
"a",
"mapping",
"for",
"the",
"key",
"the",
"old",
"value",
"is",
"replaced",
"by",
"the",
"specified",
"... | train | https://github.com/TimeAndSpaceIO/SmoothieMap/blob/c798f6cae1d377f6913e8821a1fcf5bf45ee0412/src/main/java/net/openhft/smoothie/SmoothieMap.java#L802-L806 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.updateHierarchicalEntityRole | public OperationStatus updateHierarchicalEntityRole(UUID appId, String versionId, UUID hEntityId, UUID roleId, UpdateHierarchicalEntityRoleOptionalParameter updateHierarchicalEntityRoleOptionalParameter) {
"""
Update an entity role for a given entity.
@param appId The application ID.
@param versionId The versi... | java | public OperationStatus updateHierarchicalEntityRole(UUID appId, String versionId, UUID hEntityId, UUID roleId, UpdateHierarchicalEntityRoleOptionalParameter updateHierarchicalEntityRoleOptionalParameter) {
return updateHierarchicalEntityRoleWithServiceResponseAsync(appId, versionId, hEntityId, roleId, updateHie... | [
"public",
"OperationStatus",
"updateHierarchicalEntityRole",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"hEntityId",
",",
"UUID",
"roleId",
",",
"UpdateHierarchicalEntityRoleOptionalParameter",
"updateHierarchicalEntityRoleOptionalParameter",
")",
"{",
"re... | Update an entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param hEntityId The hierarchical entity extractor ID.
@param roleId The entity role ID.
@param updateHierarchicalEntityRoleOptionalParameter the object representing the optional parameters to be set before call... | [
"Update",
"an",
"entity",
"role",
"for",
"a",
"given",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L13260-L13262 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/nio/NIOTool.java | NIOTool.getLastModifiedTime | public FileTime getLastModifiedTime(Path path, LinkOption... options) {
"""
See {@link Files#getLastModifiedTime(Path, LinkOption...)}.
@param path See {@link Files#getLastModifiedTime(Path, LinkOption...)}
@param options See {@link Files#getLastModifiedTime(Path, LinkOption...)}
@return See {@link Files#getL... | java | public FileTime getLastModifiedTime(Path path, LinkOption... options)
{
try {
return Files.getLastModifiedTime(path, options);
} catch (IOException e) {
return null;
}
} | [
"public",
"FileTime",
"getLastModifiedTime",
"(",
"Path",
"path",
",",
"LinkOption",
"...",
"options",
")",
"{",
"try",
"{",
"return",
"Files",
".",
"getLastModifiedTime",
"(",
"path",
",",
"options",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"... | See {@link Files#getLastModifiedTime(Path, LinkOption...)}.
@param path See {@link Files#getLastModifiedTime(Path, LinkOption...)}
@param options See {@link Files#getLastModifiedTime(Path, LinkOption...)}
@return See {@link Files#getLastModifiedTime(Path, LinkOption...)} | [
"See",
"{",
"@link",
"Files#getLastModifiedTime",
"(",
"Path",
"LinkOption",
"...",
")",
"}",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/nio/NIOTool.java#L262-L269 |
graknlabs/grakn | server/src/server/kb/concept/ElementFactory.java | ElementFactory.buildRelation | RelationImpl buildRelation(EdgeElement edge) {
"""
Used by RelationEdge to build a RelationImpl object out of a provided Edge
"""
return getOrBuildConcept(edge, (e) -> RelationImpl.create(RelationEdge.get(edge)));
} | java | RelationImpl buildRelation(EdgeElement edge) {
return getOrBuildConcept(edge, (e) -> RelationImpl.create(RelationEdge.get(edge)));
} | [
"RelationImpl",
"buildRelation",
"(",
"EdgeElement",
"edge",
")",
"{",
"return",
"getOrBuildConcept",
"(",
"edge",
",",
"(",
"e",
")",
"-",
">",
"RelationImpl",
".",
"create",
"(",
"RelationEdge",
".",
"get",
"(",
"edge",
")",
")",
")",
";",
"}"
] | Used by RelationEdge to build a RelationImpl object out of a provided Edge | [
"Used",
"by",
"RelationEdge",
"to",
"build",
"a",
"RelationImpl",
"object",
"out",
"of",
"a",
"provided",
"Edge"
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/kb/concept/ElementFactory.java#L113-L115 |
Netflix/netflix-graph | src/main/java/com/netflix/nfgraph/NFGraph.java | NFGraph.getConnection | public int getConnection(String connectionModel, String nodeType, int ordinal, String propertyName) {
"""
Retrieve a single connected ordinal in a given connection model, given the type and ordinal of the originating node, and the property by which this node is connected.
@return the connected ordinal, or -1 if... | java | public int getConnection(String connectionModel, String nodeType, int ordinal, String propertyName) {
int connectionModelIndex = modelHolder.getModelIndex(connectionModel);
return getConnection(connectionModelIndex, nodeType, ordinal, propertyName);
} | [
"public",
"int",
"getConnection",
"(",
"String",
"connectionModel",
",",
"String",
"nodeType",
",",
"int",
"ordinal",
",",
"String",
"propertyName",
")",
"{",
"int",
"connectionModelIndex",
"=",
"modelHolder",
".",
"getModelIndex",
"(",
"connectionModel",
")",
";"... | Retrieve a single connected ordinal in a given connection model, given the type and ordinal of the originating node, and the property by which this node is connected.
@return the connected ordinal, or -1 if there is no such ordinal | [
"Retrieve",
"a",
"single",
"connected",
"ordinal",
"in",
"a",
"given",
"connection",
"model",
"given",
"the",
"type",
"and",
"ordinal",
"of",
"the",
"originating",
"node",
"and",
"the",
"property",
"by",
"which",
"this",
"node",
"is",
"connected",
"."
] | train | https://github.com/Netflix/netflix-graph/blob/ee129252a08a9f51dd296d6fca2f0b28b7be284e/src/main/java/com/netflix/nfgraph/NFGraph.java#L115-L118 |
googleads/googleads-java-lib | modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/utils/v201811/Pql.java | Pql.resultSetToStringArrayList | public static List<String[]> resultSetToStringArrayList(ResultSet resultSet) {
"""
Gets the result set as list of string arrays, which can be transformed to a CSV using {@code
CsvFiles} such as
<pre>
<code>
ResultSet combinedResultSet = Pql.combineResultSet(resultSet1, resultSet2);
//...
combinedResultSet ... | java | public static List<String[]> resultSetToStringArrayList(ResultSet resultSet) {
List<String[]> stringArrayList = Lists.newArrayList();
stringArrayList.add(getColumnLabels(resultSet).toArray(new String[] {}));
if (resultSet.getRows() != null) {
for (Row row : resultSet.getRows()) {
try {
... | [
"public",
"static",
"List",
"<",
"String",
"[",
"]",
">",
"resultSetToStringArrayList",
"(",
"ResultSet",
"resultSet",
")",
"{",
"List",
"<",
"String",
"[",
"]",
">",
"stringArrayList",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"stringArrayList",
"."... | Gets the result set as list of string arrays, which can be transformed to a CSV using {@code
CsvFiles} such as
<pre>
<code>
ResultSet combinedResultSet = Pql.combineResultSet(resultSet1, resultSet2);
//...
combinedResultSet = Pql.combineResultSet(combinedResultSet, resultSet3);
CsvFiles.writeCsv(Pql.resultSetToStringA... | [
"Gets",
"the",
"result",
"set",
"as",
"list",
"of",
"string",
"arrays",
"which",
"can",
"be",
"transformed",
"to",
"a",
"CSV",
"using",
"{",
"@code",
"CsvFiles",
"}",
"such",
"as"
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/utils/v201811/Pql.java#L313-L326 |
google/closure-templates | java/src/com/google/template/soy/basetree/MixinParentNode.java | MixinParentNode.addChildren | public void addChildren(int index, List<? extends N> children) {
"""
Adds the given children at the given index (shifting existing children if necessary).
@param index The index to add the children at.
@param children The children to add.
"""
List<N> origChildren = Lists.newArrayList(this.children);
... | java | public void addChildren(int index, List<? extends N> children) {
List<N> origChildren = Lists.newArrayList(this.children);
int origNumChildren = this.children.size();
// Temporarily remove the original children from index onward (in reverse order).
for (int i = origNumChildren - 1; i >= index; i--) {
... | [
"public",
"void",
"addChildren",
"(",
"int",
"index",
",",
"List",
"<",
"?",
"extends",
"N",
">",
"children",
")",
"{",
"List",
"<",
"N",
">",
"origChildren",
"=",
"Lists",
".",
"newArrayList",
"(",
"this",
".",
"children",
")",
";",
"int",
"origNumChi... | Adds the given children at the given index (shifting existing children if necessary).
@param index The index to add the children at.
@param children The children to add. | [
"Adds",
"the",
"given",
"children",
"at",
"the",
"given",
"index",
"(",
"shifting",
"existing",
"children",
"if",
"necessary",
")",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/basetree/MixinParentNode.java#L211-L222 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsview_binding.java | dnsview_binding.get | public static dnsview_binding get(nitro_service service, String viewname) throws Exception {
"""
Use this API to fetch dnsview_binding resource of given name .
"""
dnsview_binding obj = new dnsview_binding();
obj.set_viewname(viewname);
dnsview_binding response = (dnsview_binding) obj.get_resource(servic... | java | public static dnsview_binding get(nitro_service service, String viewname) throws Exception{
dnsview_binding obj = new dnsview_binding();
obj.set_viewname(viewname);
dnsview_binding response = (dnsview_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"dnsview_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"viewname",
")",
"throws",
"Exception",
"{",
"dnsview_binding",
"obj",
"=",
"new",
"dnsview_binding",
"(",
")",
";",
"obj",
".",
"set_viewname",
"(",
"viewname",
")",
... | Use this API to fetch dnsview_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"dnsview_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnsview_binding.java#L114-L119 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/CurrencyLocalizationUrl.java | CurrencyLocalizationUrl.getCurrencyExchangeRateUrl | public static MozuUrl getCurrencyExchangeRateUrl(String currencyCode, String responseFields, String toCurrencyCode) {
"""
Get Resource Url for GetCurrencyExchangeRate
@param currencyCode The three character ISOÂ currency code, such as USDÂ for US Dollars.
@param responseFields Filtering syntax appended to an API... | java | public static MozuUrl getCurrencyExchangeRateUrl(String currencyCode, String responseFields, String toCurrencyCode)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/currency/{currencyCode}/exchangerates/{toCurrencyCode}?responseFields={responseFields}");
formatter.formatUrl("currencyCode", ... | [
"public",
"static",
"MozuUrl",
"getCurrencyExchangeRateUrl",
"(",
"String",
"currencyCode",
",",
"String",
"responseFields",
",",
"String",
"toCurrencyCode",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/currency/{cur... | Get Resource Url for GetCurrencyExchangeRate
@param currencyCode The three character ISOÂ currency code, such as USDÂ for US Dollars.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve da... | [
"Get",
"Resource",
"Url",
"for",
"GetCurrencyExchangeRate"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/CurrencyLocalizationUrl.java#L35-L42 |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/http/HttpRequest.java | HttpRequest.withHeader | public HttpRequest withHeader(String name, String value) {
"""
Set a request header, replacing any existing value.
A null for {@code value} will remove the header if one with matching name exists.
@param name the header name
@param value the header value
@return this HttpRequest
"""
headers.set(n... | java | public HttpRequest withHeader(String name, String value) {
headers.set(name, value);
return this;
} | [
"public",
"HttpRequest",
"withHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"headers",
".",
"set",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Set a request header, replacing any existing value.
A null for {@code value} will remove the header if one with matching name exists.
@param name the header name
@param value the header value
@return this HttpRequest | [
"Set",
"a",
"request",
"header",
"replacing",
"any",
"existing",
"value",
".",
"A",
"null",
"for",
"{",
"@code",
"value",
"}",
"will",
"remove",
"the",
"header",
"if",
"one",
"with",
"matching",
"name",
"exists",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/http/HttpRequest.java#L117-L120 |
jbundle/jbundle | app/program/manual/util/src/main/java/org/jbundle/app/program/manual/util/Includes.java | Includes.addInclude | public void addInclude(String strClassName, ClassProject.CodeType codeType) {
"""
Include the source file for this class if it isn't in this source
"""
try {
m_recClassInfo.getField(ClassInfo.CLASS_NAME).setString(strClassName);
m_recClassInfo.setKeyArea(ClassInfo.CLASS_NAME_K... | java | public void addInclude(String strClassName, ClassProject.CodeType codeType)
{
try {
m_recClassInfo.getField(ClassInfo.CLASS_NAME).setString(strClassName);
m_recClassInfo.setKeyArea(ClassInfo.CLASS_NAME_KEY);
if ((m_recClassInfo.seek("=")) && (strClassName != null) && (s... | [
"public",
"void",
"addInclude",
"(",
"String",
"strClassName",
",",
"ClassProject",
".",
"CodeType",
"codeType",
")",
"{",
"try",
"{",
"m_recClassInfo",
".",
"getField",
"(",
"ClassInfo",
".",
"CLASS_NAME",
")",
".",
"setString",
"(",
"strClassName",
")",
";",... | Include the source file for this class if it isn't in this source | [
"Include",
"the",
"source",
"file",
"for",
"this",
"class",
"if",
"it",
"isn",
"t",
"in",
"this",
"source"
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/manual/util/src/main/java/org/jbundle/app/program/manual/util/Includes.java#L41-L58 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.