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 |
|---|---|---|---|---|---|---|---|---|---|---|
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/factory/ComponentFactory.java | ComponentFactory.newLabel | public static <T> Label newLabel(final String id, final String forId, final IModel<T> model) {
"""
Factory method for create a new {@link Label} with the for attribute.
@param <T>
the generic type of the model
@param id
the id
@param forId
the for id
@param model
the model
@return the new {@link Label}
... | java | public static <T> Label newLabel(final String id, final String forId, final IModel<T> model)
{
final Label label = new Label(id, model);
label.add(new AttributeAppender("for", Model.of(forId), " "));
label.setOutputMarkupId(true);
return label;
} | [
"public",
"static",
"<",
"T",
">",
"Label",
"newLabel",
"(",
"final",
"String",
"id",
",",
"final",
"String",
"forId",
",",
"final",
"IModel",
"<",
"T",
">",
"model",
")",
"{",
"final",
"Label",
"label",
"=",
"new",
"Label",
"(",
"id",
",",
"model",
... | Factory method for create a new {@link Label} with the for attribute.
@param <T>
the generic type of the model
@param id
the id
@param forId
the for id
@param model
the model
@return the new {@link Label} | [
"Factory",
"method",
"for",
"create",
"a",
"new",
"{",
"@link",
"Label",
"}",
"with",
"the",
"for",
"attribute",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/factory/ComponentFactory.java#L461-L467 |
elki-project/elki | addons/joglvis/src/main/java/de/lmu/ifi/dbs/elki/joglvis/ShaderUtil.java | ShaderUtil.compileShader | public static int compileShader(Class<?> context, GL2 gl, int type, String name) throws ShaderCompilationException {
"""
Compile a shader from a file.
@param context Class context for loading the resource file.
@param gl GL context
@param type
@param name
@return Shader program number.
@throws ShaderCompil... | java | public static int compileShader(Class<?> context, GL2 gl, int type, String name) throws ShaderCompilationException {
int prog = -1;
try (InputStream in = context.getResourceAsStream(name)) {
int[] error = new int[1];
String shaderdata = FileUtil.slurp(in);
prog = gl.glCreateShader(type);
... | [
"public",
"static",
"int",
"compileShader",
"(",
"Class",
"<",
"?",
">",
"context",
",",
"GL2",
"gl",
",",
"int",
"type",
",",
"String",
"name",
")",
"throws",
"ShaderCompilationException",
"{",
"int",
"prog",
"=",
"-",
"1",
";",
"try",
"(",
"InputStream... | Compile a shader from a file.
@param context Class context for loading the resource file.
@param gl GL context
@param type
@param name
@return Shader program number.
@throws ShaderCompilationException When compilation failed. | [
"Compile",
"a",
"shader",
"from",
"a",
"file",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/joglvis/src/main/java/de/lmu/ifi/dbs/elki/joglvis/ShaderUtil.java#L54-L81 |
facebookarchive/hadoop-20 | src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacityTaskScheduler.java | CapacityTaskScheduler.assignTasks | @Override
public synchronized List<Task> assignTasks(TaskTracker taskTracker)
throws IOException {
"""
/*
The grand plan for assigning a task.
If multiple task assignment is enabled, it tries to get one map and
one reduce slot depending on free slots on the TT.
Otherwise, we decide whether a Map or Red... | java | @Override
public synchronized List<Task> assignTasks(TaskTracker taskTracker)
throws IOException {
TaskTrackerStatus taskTrackerStatus = taskTracker.getStatus();
ClusterStatus c = taskTrackerManager.getClusterStatus();
int mapClusterCapacity = c.getMaxMapTasks();
int reduceClusterCapacity = c.ge... | [
"@",
"Override",
"public",
"synchronized",
"List",
"<",
"Task",
">",
"assignTasks",
"(",
"TaskTracker",
"taskTracker",
")",
"throws",
"IOException",
"{",
"TaskTrackerStatus",
"taskTrackerStatus",
"=",
"taskTracker",
".",
"getStatus",
"(",
")",
";",
"ClusterStatus",
... | /*
The grand plan for assigning a task.
If multiple task assignment is enabled, it tries to get one map and
one reduce slot depending on free slots on the TT.
Otherwise, we decide whether a Map or Reduce task should be given to a TT
(if the TT can accept either).
Either way, we first pick a queue. We only look at que... | [
"/",
"*",
"The",
"grand",
"plan",
"for",
"assigning",
"a",
"task",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacityTaskScheduler.java#L1321-L1374 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/dispatcher/DataContextUtils.java | DataContextUtils.addEnvVars | public static void addEnvVars( final EnvironmentConfigurable sshexecTask, final Map<String, Map<String, String>> dataContext) {
"""
add Env elements to pass environment variables to the ExtSSHExec
@param sshexecTask task
@param dataContext data
"""
final Map<String, String> environment = generateEn... | java | public static void addEnvVars( final EnvironmentConfigurable sshexecTask, final Map<String, Map<String, String>> dataContext) {
final Map<String, String> environment = generateEnvVarsFromContext(dataContext);
if (null != environment) {
for (final Map.Entry<String, String> entry : environment... | [
"public",
"static",
"void",
"addEnvVars",
"(",
"final",
"EnvironmentConfigurable",
"sshexecTask",
",",
"final",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"String",
">",
">",
"dataContext",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
... | add Env elements to pass environment variables to the ExtSSHExec
@param sshexecTask task
@param dataContext data | [
"add",
"Env",
"elements",
"to",
"pass",
"environment",
"variables",
"to",
"the",
"ExtSSHExec"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/dispatcher/DataContextUtils.java#L537-L550 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/StringField.java | StringField.getSQLType | public String getSQLType(boolean bIncludeLength, Map<String, Object> properties) {
"""
Get the SQL type of this field.
Typically STRING, VARCHAR, or LONGSTRING if over 127 chars.
@param bIncludeLength Include the field length in this description.
@param properties Database properties to determine the SQL type.
... | java | public String getSQLType(boolean bIncludeLength, Map<String, Object> properties)
{
String strType = (String)properties.get(DBSQLTypes.STRING);
if (strType == null)
strType = "VARCHAR"; // The default SQL Type
if (this.getMaxLength() < 127)
{
String str... | [
"public",
"String",
"getSQLType",
"(",
"boolean",
"bIncludeLength",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"String",
"strType",
"=",
"(",
"String",
")",
"properties",
".",
"get",
"(",
"DBSQLTypes",
".",
"STRING",
")",
";",
... | Get the SQL type of this field.
Typically STRING, VARCHAR, or LONGSTRING if over 127 chars.
@param bIncludeLength Include the field length in this description.
@param properties Database properties to determine the SQL type. | [
"Get",
"the",
"SQL",
"type",
"of",
"this",
"field",
".",
"Typically",
"STRING",
"VARCHAR",
"or",
"LONGSTRING",
"if",
"over",
"127",
"chars",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/StringField.java#L101-L119 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_resiliate_POST | public OvhResiliationFollowUpDetail serviceName_resiliate_POST(String serviceName, Date resiliationDate, OvhResiliationSurvey resiliationSurvey) throws IOException {
"""
Resiliate the access
REST: POST /xdsl/{serviceName}/resiliate
@param resiliationSurvey [required] Comment about resiliation reasons
@param r... | java | public OvhResiliationFollowUpDetail serviceName_resiliate_POST(String serviceName, Date resiliationDate, OvhResiliationSurvey resiliationSurvey) throws IOException {
String qPath = "/xdsl/{serviceName}/resiliate";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>(... | [
"public",
"OvhResiliationFollowUpDetail",
"serviceName_resiliate_POST",
"(",
"String",
"serviceName",
",",
"Date",
"resiliationDate",
",",
"OvhResiliationSurvey",
"resiliationSurvey",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/{serviceName}/resiliate\""... | Resiliate the access
REST: POST /xdsl/{serviceName}/resiliate
@param resiliationSurvey [required] Comment about resiliation reasons
@param resiliationDate [required] The desired resiliation date
@param serviceName [required] The internal name of your XDSL offer | [
"Resiliate",
"the",
"access"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L626-L634 |
fuinorg/units4j | src/main/java/org/fuin/units4j/assertionrules/Utils.java | Utils.hasAnnotation | public static boolean hasAnnotation(final List<AnnotationInstance> annotations, final String annotationClaszName) {
"""
Verifies if a list of annotations contains a given one.
@param annotations
List with annotations to check.
@param annotationClaszName
Full qualified name of annotation class to find.
@re... | java | public static boolean hasAnnotation(final List<AnnotationInstance> annotations, final String annotationClaszName) {
final DotName annotationName = DotName.createSimple(annotationClaszName);
for (final AnnotationInstance annotation : annotations) {
if (annotation.name().equals(annotationNa... | [
"public",
"static",
"boolean",
"hasAnnotation",
"(",
"final",
"List",
"<",
"AnnotationInstance",
">",
"annotations",
",",
"final",
"String",
"annotationClaszName",
")",
"{",
"final",
"DotName",
"annotationName",
"=",
"DotName",
".",
"createSimple",
"(",
"annotationC... | Verifies if a list of annotations contains a given one.
@param annotations
List with annotations to check.
@param annotationClaszName
Full qualified name of annotation class to find.
@return TRUE if the list contains the annotation, else FALSE. | [
"Verifies",
"if",
"a",
"list",
"of",
"annotations",
"contains",
"a",
"given",
"one",
"."
] | train | https://github.com/fuinorg/units4j/blob/29383e30b0f9c246b309e734df9cc63dc5d5499e/src/main/java/org/fuin/units4j/assertionrules/Utils.java#L56-L64 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java | SimpleDateFormat.lowerLevel | private boolean lowerLevel(Object[] items, int i, int level)
throws IllegalArgumentException {
"""
check whether the i-th item's level is lower than the input 'level'
It is supposed to be used only by CLDR survey tool.
It is used by intervalFormatByAlgorithm().
@param items the pattern ... | java | private boolean lowerLevel(Object[] items, int i, int level)
throws IllegalArgumentException {
if (items[i] instanceof String) {
return false;
}
PatternItem item = (PatternItem)items[i];
char ch = item.type;
int patternCharIndex = getLevelFromChar(... | [
"private",
"boolean",
"lowerLevel",
"(",
"Object",
"[",
"]",
"items",
",",
"int",
"i",
",",
"int",
"level",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"items",
"[",
"i",
"]",
"instanceof",
"String",
")",
"{",
"return",
"false",
";",
"}",
... | check whether the i-th item's level is lower than the input 'level'
It is supposed to be used only by CLDR survey tool.
It is used by intervalFormatByAlgorithm().
@param items the pattern items
@param i the i-th item in pattern items
@param level the level with which the i-th pattern item compared to
@exceptio... | [
"check",
"whether",
"the",
"i",
"-",
"th",
"item",
"s",
"level",
"is",
"lower",
"than",
"the",
"input",
"level"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java#L4341-L4359 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java | AlignmentTools.getAlignedStructure | public static final Structure getAlignedStructure(Atom[] ca1, Atom[] ca2) throws StructureException {
"""
Get an artifical Structure containing both chains.
Does NOT rotate anything
@param ca1
@param ca2
@return a structure object containing two models, one for each set of Atoms.
@throws StructureException
... | java | public static final Structure getAlignedStructure(Atom[] ca1, Atom[] ca2) throws StructureException{
/* Previous implementation commented
Structure s = new StructureImpl();
List<Chain>model1 = getAlignedModel(ca1);
List<Chain>model2 = getAlignedModel(ca2);
s.addModel(model1);
s.addModel(model2);
retu... | [
"public",
"static",
"final",
"Structure",
"getAlignedStructure",
"(",
"Atom",
"[",
"]",
"ca1",
",",
"Atom",
"[",
"]",
"ca2",
")",
"throws",
"StructureException",
"{",
"/* Previous implementation commented\n\n\t\tStructure s = new StructureImpl();\n\n\n\t\tList<Chain>model1 = ge... | Get an artifical Structure containing both chains.
Does NOT rotate anything
@param ca1
@param ca2
@return a structure object containing two models, one for each set of Atoms.
@throws StructureException | [
"Get",
"an",
"artifical",
"Structure",
"containing",
"both",
"chains",
".",
"Does",
"NOT",
"rotate",
"anything"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java#L1241-L1263 |
kirgor/enklib | ejb/src/main/java/com/kirgor/enklib/ejb/Bean.java | Bean.handleException | protected Object handleException(Exception ex, Method method, Object[] params) throws Exception {
"""
Called by interceptor in case of invocation exception.
<p/>
Default implementation just rethrows the exception.
@param ex Caught exception instance.
@param method Invoked method.
@param params Invoked m... | java | protected Object handleException(Exception ex, Method method, Object[] params) throws Exception {
throw ex;
} | [
"protected",
"Object",
"handleException",
"(",
"Exception",
"ex",
",",
"Method",
"method",
",",
"Object",
"[",
"]",
"params",
")",
"throws",
"Exception",
"{",
"throw",
"ex",
";",
"}"
] | Called by interceptor in case of invocation exception.
<p/>
Default implementation just rethrows the exception.
@param ex Caught exception instance.
@param method Invoked method.
@param params Invoked method params.
@return Method can return something on behalf of invoked method.
@throws Exception | [
"Called",
"by",
"interceptor",
"in",
"case",
"of",
"invocation",
"exception",
".",
"<p",
"/",
">",
"Default",
"implementation",
"just",
"rethrows",
"the",
"exception",
"."
] | train | https://github.com/kirgor/enklib/blob/8a24db296dc43db5d8fe509cf64ace0a0c7be8f2/ejb/src/main/java/com/kirgor/enklib/ejb/Bean.java#L161-L163 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/BundlePathMappingBuilder.java | BundlePathMappingBuilder.addFilePathMapping | protected void addFilePathMapping(BundlePathMapping bundlePathMapping, String pathMapping) {
"""
Adds the path mapping to the file path mapping
@param bundlePathMapping
the bundle path mapping
@param pathMapping
the path mapping to add
"""
long timestamp = 0;
String filePath = resourceReaderHandler.g... | java | protected void addFilePathMapping(BundlePathMapping bundlePathMapping, String pathMapping) {
long timestamp = 0;
String filePath = resourceReaderHandler.getFilePath(pathMapping);
if (filePath != null) {
timestamp = resourceReaderHandler.getLastModified(filePath);
List<FilePathMapping> filePathMappings = bun... | [
"protected",
"void",
"addFilePathMapping",
"(",
"BundlePathMapping",
"bundlePathMapping",
",",
"String",
"pathMapping",
")",
"{",
"long",
"timestamp",
"=",
"0",
";",
"String",
"filePath",
"=",
"resourceReaderHandler",
".",
"getFilePath",
"(",
"pathMapping",
")",
";"... | Adds the path mapping to the file path mapping
@param bundlePathMapping
the bundle path mapping
@param pathMapping
the path mapping to add | [
"Adds",
"the",
"path",
"mapping",
"to",
"the",
"file",
"path",
"mapping"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/BundlePathMappingBuilder.java#L195-L213 |
NordicSemiconductor/Android-DFU-Library | dfu/src/main/java/no/nordicsemi/android/dfu/LegacyDfuImpl.java | LegacyDfuImpl.resetAndRestart | private void resetAndRestart(@NonNull final BluetoothGatt gatt, @NonNull final Intent intent)
throws DfuException, DeviceDisconnectedException, UploadAbortedException {
"""
Sends Reset command to the target device to reset its state and restarts the DFU Service that will start again.
@param gatt the GATT dev... | java | private void resetAndRestart(@NonNull final BluetoothGatt gatt, @NonNull final Intent intent)
throws DfuException, DeviceDisconnectedException, UploadAbortedException {
mService.sendLogBroadcast(DfuBaseService.LOG_LEVEL_WARNING, "Last upload interrupted. Restarting device...");
// Send 'jump to bootloader comman... | [
"private",
"void",
"resetAndRestart",
"(",
"@",
"NonNull",
"final",
"BluetoothGatt",
"gatt",
",",
"@",
"NonNull",
"final",
"Intent",
"intent",
")",
"throws",
"DfuException",
",",
"DeviceDisconnectedException",
",",
"UploadAbortedException",
"{",
"mService",
".",
"se... | Sends Reset command to the target device to reset its state and restarts the DFU Service that will start again.
@param gatt the GATT device.
@param intent intent used to start the service.
@throws DeviceDisconnectedException Thrown when the device will disconnect in the middle of
the transmission.
@throws DfuException... | [
"Sends",
"Reset",
"command",
"to",
"the",
"target",
"device",
"to",
"reset",
"its",
"state",
"and",
"restarts",
"the",
"DFU",
"Service",
"that",
"will",
"start",
"again",
"."
] | train | https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/LegacyDfuImpl.java#L720-L744 |
StanKocken/EfficientAdapter | efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java | ViewHelper.setTag | public static void setTag(EfficientCacheView cacheView, int viewId, Object tag) {
"""
Equivalent to calling View.setTag
@param cacheView The cache of views to get the view from
@param viewId The id of the view whose tag should change
@param tag An Object to tag the view with
"""
View view... | java | public static void setTag(EfficientCacheView cacheView, int viewId, Object tag) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view != null) {
view.setTag(tag);
}
} | [
"public",
"static",
"void",
"setTag",
"(",
"EfficientCacheView",
"cacheView",
",",
"int",
"viewId",
",",
"Object",
"tag",
")",
"{",
"View",
"view",
"=",
"cacheView",
".",
"findViewByIdEfficient",
"(",
"viewId",
")",
";",
"if",
"(",
"view",
"!=",
"null",
")... | Equivalent to calling View.setTag
@param cacheView The cache of views to get the view from
@param viewId The id of the view whose tag should change
@param tag An Object to tag the view with | [
"Equivalent",
"to",
"calling",
"View",
".",
"setTag"
] | train | https://github.com/StanKocken/EfficientAdapter/blob/0bcc3a20182cbce9d7901e1e2a9104251637167d/efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java#L86-L91 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/FormLogoutExtensionProcessor.java | FormLogoutExtensionProcessor.isRedirectHostTheSameAsLocalHost | private boolean isRedirectHostTheSameAsLocalHost(String exitPage, String logoutURLhost, String hostFullName, String shortName, String ipAddress) {
"""
Check the logout URL host name with various combination of shortName, full name and ipAddress.
@param logoutURLhost
@param hostFullName
@param shortName
@para... | java | private boolean isRedirectHostTheSameAsLocalHost(String exitPage, String logoutURLhost, String hostFullName, String shortName, String ipAddress) {
String localHostIpAddress = "127.0.0.1";
boolean acceptURL = false;
if (logoutURLhost.equalsIgnoreCase("localhost") || logoutURLhost.equals(localHost... | [
"private",
"boolean",
"isRedirectHostTheSameAsLocalHost",
"(",
"String",
"exitPage",
",",
"String",
"logoutURLhost",
",",
"String",
"hostFullName",
",",
"String",
"shortName",
",",
"String",
"ipAddress",
")",
"{",
"String",
"localHostIpAddress",
"=",
"\"127.0.0.1\"",
... | Check the logout URL host name with various combination of shortName, full name and ipAddress.
@param logoutURLhost
@param hostFullName
@param shortName
@param ipAddress | [
"Check",
"the",
"logout",
"URL",
"host",
"name",
"with",
"various",
"combination",
"of",
"shortName",
"full",
"name",
"and",
"ipAddress",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/FormLogoutExtensionProcessor.java#L336-L349 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jbatch.misc_fat/util/src/fat/util/JobWaiter.java | JobWaiter.waitForFinish | public JobExecution waitForFinish(long executionId) {
"""
Wait for {@code JobWaiter#timeout} seconds for BOTH of:
1) BatchStatus to be one of: STOPPED ,FAILED , COMPLETED, ABANDONED
AND
2) exitStatus to be non-null
@return JobExecution
"""
logger.fine("Entering waitForFinish for executionId = "... | java | public JobExecution waitForFinish(long executionId) {
logger.fine("Entering waitForFinish for executionId = " + executionId);
JobExecution jobExecution = null;
long startTime = System.currentTimeMillis();
while (true) {
try {
logger.finer("Sleeping for " + P... | [
"public",
"JobExecution",
"waitForFinish",
"(",
"long",
"executionId",
")",
"{",
"logger",
".",
"fine",
"(",
"\"Entering waitForFinish for executionId = \"",
"+",
"executionId",
")",
";",
"JobExecution",
"jobExecution",
"=",
"null",
";",
"long",
"startTime",
"=",
"S... | Wait for {@code JobWaiter#timeout} seconds for BOTH of:
1) BatchStatus to be one of: STOPPED ,FAILED , COMPLETED, ABANDONED
AND
2) exitStatus to be non-null
@return JobExecution | [
"Wait",
"for",
"{",
"@code",
"JobWaiter#timeout",
"}",
"seconds",
"for",
"BOTH",
"of",
":"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jbatch.misc_fat/util/src/fat/util/JobWaiter.java#L169-L191 |
deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/loader/ImageLoader.java | ImageLoader.asMatrix | public INDArray asMatrix(InputStream inputStream) throws IOException {
"""
Convert an input stream to a matrix
@param inputStream the input stream to convert
@return the input stream to convert
"""
if (channels == 3)
return toBgr(inputStream);
try {
BufferedImage ima... | java | public INDArray asMatrix(InputStream inputStream) throws IOException {
if (channels == 3)
return toBgr(inputStream);
try {
BufferedImage image = ImageIO.read(inputStream);
return asMatrix(image);
} catch (IOException e) {
throw new IOException("Una... | [
"public",
"INDArray",
"asMatrix",
"(",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"if",
"(",
"channels",
"==",
"3",
")",
"return",
"toBgr",
"(",
"inputStream",
")",
";",
"try",
"{",
"BufferedImage",
"image",
"=",
"ImageIO",
".",
"read",... | Convert an input stream to a matrix
@param inputStream the input stream to convert
@return the input stream to convert | [
"Convert",
"an",
"input",
"stream",
"to",
"a",
"matrix"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/loader/ImageLoader.java#L261-L270 |
aggregateknowledge/java-hll | src/main/java/net/agkn/hll/serialization/SerializationUtil.java | SerializationUtil.packParametersByte | public static byte packParametersByte(final int registerWidth, final int registerCountLog2) {
"""
Generates a byte that encodes the parameters of a
{@link HLLType#FULL} or {@link HLLType#SPARSE}
HLL.<p/>
The top 3 bits are used to encode <code>registerWidth - 1</code>
(range of <code>registerWidth</code> is ... | java | public static byte packParametersByte(final int registerWidth, final int registerCountLog2) {
final int widthBits = ((registerWidth - 1) & REGISTER_WIDTH_MASK);
final int countBits = (registerCountLog2 & LOG2_REGISTER_COUNT_MASK);
return (byte)((widthBits << LOG2_REGISTER_COUNT_BITS) | countBits... | [
"public",
"static",
"byte",
"packParametersByte",
"(",
"final",
"int",
"registerWidth",
",",
"final",
"int",
"registerCountLog2",
")",
"{",
"final",
"int",
"widthBits",
"=",
"(",
"(",
"registerWidth",
"-",
"1",
")",
"&",
"REGISTER_WIDTH_MASK",
")",
";",
"final... | Generates a byte that encodes the parameters of a
{@link HLLType#FULL} or {@link HLLType#SPARSE}
HLL.<p/>
The top 3 bits are used to encode <code>registerWidth - 1</code>
(range of <code>registerWidth</code> is thus 1-9) and the bottom 5
bits are used to encode <code>registerCountLog2</code>
(range of <code>registerCo... | [
"Generates",
"a",
"byte",
"that",
"encodes",
"the",
"parameters",
"of",
"a",
"{",
"@link",
"HLLType#FULL",
"}",
"or",
"{",
"@link",
"HLLType#SPARSE",
"}",
"HLL",
".",
"<p",
"/",
">"
] | train | https://github.com/aggregateknowledge/java-hll/blob/1f4126e79a85b79581460c75bf1c1634b8a7402d/src/main/java/net/agkn/hll/serialization/SerializationUtil.java#L206-L210 |
berkesa/datatree-promise | src/main/java/io/datatree/Promise.java | Promise.catchError | public Promise catchError(CheckedFunction<Throwable> action) {
"""
The catchError() method returns a Promise and deals with rejected cases
only. Sample:
<pre>
Promise.resolve().then(() -> {
return 123;
<b>}).catchError(error -> {</b>
// ...do something, with a return value...
return 456;
});
</pre... | java | public Promise catchError(CheckedFunction<Throwable> action) {
return new Promise(future.handle((data, error) -> {
if (error != null) {
try {
return action.apply(error);
} catch (Throwable cause) {
return cause;
}
}
return data;
}), root);
} | [
"public",
"Promise",
"catchError",
"(",
"CheckedFunction",
"<",
"Throwable",
">",
"action",
")",
"{",
"return",
"new",
"Promise",
"(",
"future",
".",
"handle",
"(",
"(",
"data",
",",
"error",
")",
"->",
"{",
"if",
"(",
"error",
"!=",
"null",
")",
"{",
... | The catchError() method returns a Promise and deals with rejected cases
only. Sample:
<pre>
Promise.resolve().then(() -> {
return 123;
<b>}).catchError(error -> {</b>
// ...do something, with a return value...
return 456;
});
</pre>
@param action
error handler of the previous "next" handlers
@return output Pro... | [
"The",
"catchError",
"()",
"method",
"returns",
"a",
"Promise",
"and",
"deals",
"with",
"rejected",
"cases",
"only",
".",
"Sample",
":"
] | train | https://github.com/berkesa/datatree-promise/blob/d9093bdb549f69b83b3eff5e29cd511f2014f177/src/main/java/io/datatree/Promise.java#L462-L473 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/collection/ArrayHelper.java | ArrayHelper.getAllExceptLast | @Nullable
@ReturnsMutableCopy
@SafeVarargs
public static <ELEMENTTYPE> ELEMENTTYPE [] getAllExceptLast (@Nullable final ELEMENTTYPE... aArray) {
"""
Get an array that contains all elements, except for the last element.
@param <ELEMENTTYPE>
Array element type
@param aArray
The source array. May be <code... | java | @Nullable
@ReturnsMutableCopy
@SafeVarargs
public static <ELEMENTTYPE> ELEMENTTYPE [] getAllExceptLast (@Nullable final ELEMENTTYPE... aArray)
{
return getAllExceptLast (aArray, 1);
} | [
"@",
"Nullable",
"@",
"ReturnsMutableCopy",
"@",
"SafeVarargs",
"public",
"static",
"<",
"ELEMENTTYPE",
">",
"ELEMENTTYPE",
"[",
"]",
"getAllExceptLast",
"(",
"@",
"Nullable",
"final",
"ELEMENTTYPE",
"...",
"aArray",
")",
"{",
"return",
"getAllExceptLast",
"(",
... | Get an array that contains all elements, except for the last element.
@param <ELEMENTTYPE>
Array element type
@param aArray
The source array. May be <code>null</code>.
@return <code>null</code> if the passed array is <code>null</code> or has
less than one element. A non-<code>null</code> copy of the array
without the ... | [
"Get",
"an",
"array",
"that",
"contains",
"all",
"elements",
"except",
"for",
"the",
"last",
"element",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/collection/ArrayHelper.java#L3360-L3366 |
census-instrumentation/opencensus-java | contrib/resource_util/src/main/java/io/opencensus/contrib/resource/util/CloudResource.java | CloudResource.create | public static Resource create(String provider, String accountId, String region, String zone) {
"""
Returns a {@link Resource} that describes a cloud environment.
@param provider the name of the cloud provider.
@param accountId the cloud account id used to identify different entities.
@param region the region ... | java | public static Resource create(String provider, String accountId, String region, String zone) {
Map<String, String> labels = new LinkedHashMap<String, String>();
labels.put(PROVIDER_KEY, checkNotNull(provider, "provider"));
labels.put(ACCOUNT_ID_KEY, checkNotNull(accountId, "accountId"));
labels.put(REGI... | [
"public",
"static",
"Resource",
"create",
"(",
"String",
"provider",
",",
"String",
"accountId",
",",
"String",
"region",
",",
"String",
"zone",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"labels",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
... | Returns a {@link Resource} that describes a cloud environment.
@param provider the name of the cloud provider.
@param accountId the cloud account id used to identify different entities.
@param region the region in which entities are running.
@param zone the zone in which entities are running.
@return a {@link Resource... | [
"Returns",
"a",
"{",
"@link",
"Resource",
"}",
"that",
"describes",
"a",
"cloud",
"environment",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/contrib/resource_util/src/main/java/io/opencensus/contrib/resource/util/CloudResource.java#L98-L105 |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.translatePath | public static TreePath translatePath(
TreeModel newTreeModel, TreePath oldPath) {
"""
Translates one TreePath to a new TreeModel. This methods assumes
DefaultMutableTreeNodes.
@param newTreeModel The new tree model
@param oldPath The old tree path
@return The new tree path, or <code>null</code> if t... | java | public static TreePath translatePath(
TreeModel newTreeModel, TreePath oldPath)
{
return translatePath(newTreeModel, oldPath, Objects::equals);
} | [
"public",
"static",
"TreePath",
"translatePath",
"(",
"TreeModel",
"newTreeModel",
",",
"TreePath",
"oldPath",
")",
"{",
"return",
"translatePath",
"(",
"newTreeModel",
",",
"oldPath",
",",
"Objects",
"::",
"equals",
")",
";",
"}"
] | Translates one TreePath to a new TreeModel. This methods assumes
DefaultMutableTreeNodes.
@param newTreeModel The new tree model
@param oldPath The old tree path
@return The new tree path, or <code>null</code> if there is no
corresponding path in the new tree model | [
"Translates",
"one",
"TreePath",
"to",
"a",
"new",
"TreeModel",
".",
"This",
"methods",
"assumes",
"DefaultMutableTreeNodes",
"."
] | train | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L489-L493 |
Backendless/Android-SDK | src/com/backendless/persistence/BackendlessSerializer.java | BackendlessSerializer.getOrMakeSerializedObject | private Object getOrMakeSerializedObject( Object entityEntryValue,
Map<Object, Map<String, Object>> serializedCache ) {
"""
Returns serialized object from cache or serializes object if it's not present in cache.
@param entityEntryValue object to be serialized
... | java | private Object getOrMakeSerializedObject( Object entityEntryValue,
Map<Object, Map<String, Object>> serializedCache )
{
if( serializedCache.containsKey( entityEntryValue ) ) //cyclic relation
{
//take from cache and substitute
return serializedCac... | [
"private",
"Object",
"getOrMakeSerializedObject",
"(",
"Object",
"entityEntryValue",
",",
"Map",
"<",
"Object",
",",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"serializedCache",
")",
"{",
"if",
"(",
"serializedCache",
".",
"containsKey",
"(",
"entityEntryVa... | Returns serialized object from cache or serializes object if it's not present in cache.
@param entityEntryValue object to be serialized
@return Map formed from given object | [
"Returns",
"serialized",
"object",
"from",
"cache",
"or",
"serializes",
"object",
"if",
"it",
"s",
"not",
"present",
"in",
"cache",
"."
] | train | https://github.com/Backendless/Android-SDK/blob/3af1e9a378f19d890db28a833f7fc8595b924cc3/src/com/backendless/persistence/BackendlessSerializer.java#L214-L227 |
census-instrumentation/opencensus-java | api/src/main/java/io/opencensus/trace/SpanId.java | SpanId.fromBytes | public static SpanId fromBytes(byte[] src) {
"""
Returns a {@code SpanId} built from a byte representation.
@param src the representation of the {@code SpanId}.
@return a {@code SpanId} whose representation is given by the {@code src} parameter.
@throws NullPointerException if {@code src} is null.
@throws Il... | java | public static SpanId fromBytes(byte[] src) {
Utils.checkNotNull(src, "src");
// TODO: Remove this extra condition.
Utils.checkArgument(src.length == SIZE, "Invalid size: expected %s, got %s", SIZE, src.length);
return fromBytes(src, 0);
} | [
"public",
"static",
"SpanId",
"fromBytes",
"(",
"byte",
"[",
"]",
"src",
")",
"{",
"Utils",
".",
"checkNotNull",
"(",
"src",
",",
"\"src\"",
")",
";",
"// TODO: Remove this extra condition.",
"Utils",
".",
"checkArgument",
"(",
"src",
".",
"length",
"==",
"S... | Returns a {@code SpanId} built from a byte representation.
@param src the representation of the {@code SpanId}.
@return a {@code SpanId} whose representation is given by the {@code src} parameter.
@throws NullPointerException if {@code src} is null.
@throws IllegalArgumentException if {@code src.length} is not {@link ... | [
"Returns",
"a",
"{",
"@code",
"SpanId",
"}",
"built",
"from",
"a",
"byte",
"representation",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/trace/SpanId.java#L65-L70 |
overturetool/overture | ide/debug/src/main/java/org/overture/ide/debug/ui/propertypages/VdmBreakpointPropertyPage.java | VdmBreakpointPropertyPage.createRadioButton | protected Button createRadioButton(Composite parent, String text) {
"""
Creates a fully configured radio button with the given text.
@param parent
the parent composite
@param text
the label of the returned radio button
@return a fully configured radio button
"""
return SWTFactory.createRadioButton(par... | java | protected Button createRadioButton(Composite parent, String text)
{
return SWTFactory.createRadioButton(parent, text);
} | [
"protected",
"Button",
"createRadioButton",
"(",
"Composite",
"parent",
",",
"String",
"text",
")",
"{",
"return",
"SWTFactory",
".",
"createRadioButton",
"(",
"parent",
",",
"text",
")",
";",
"}"
] | Creates a fully configured radio button with the given text.
@param parent
the parent composite
@param text
the label of the returned radio button
@return a fully configured radio button | [
"Creates",
"a",
"fully",
"configured",
"radio",
"button",
"with",
"the",
"given",
"text",
"."
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/debug/src/main/java/org/overture/ide/debug/ui/propertypages/VdmBreakpointPropertyPage.java#L533-L536 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java | ApiOvhDbaaslogs.serviceName_GET | public net.minidev.ovh.api.dbaas.logs.OvhService serviceName_GET(String serviceName) throws IOException {
"""
Returns the service object of connected identity.
REST: GET /dbaas/logs/{serviceName}
@param serviceName [required] Service name
"""
String qPath = "/dbaas/logs/{serviceName}";
StringBuilder sb... | java | public net.minidev.ovh.api.dbaas.logs.OvhService serviceName_GET(String serviceName) throws IOException {
String qPath = "/dbaas/logs/{serviceName}";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, net.minidev.ovh.api.dbaas.logs.OvhServi... | [
"public",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"dbaas",
".",
"logs",
".",
"OvhService",
"serviceName_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dbaas/logs/{serviceName}\"",
";",
"StringBuilde... | Returns the service object of connected identity.
REST: GET /dbaas/logs/{serviceName}
@param serviceName [required] Service name | [
"Returns",
"the",
"service",
"object",
"of",
"connected",
"identity",
"."
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java#L996-L1001 |
arnaudroger/SimpleFlatMapper | sfm-jdbc/src/main/java/org/simpleflatmapper/jdbc/ConnectedCrud.java | ConnectedCrud.create | public <RH extends CheckedConsumer<? super K>> RH create(final T value, final RH keyConsumer) throws SQLException {
"""
insert value into the db through the specified connection.
Callback keyConsumer with the generated key if one was.
@param value the value
@param keyConsumer the key consumer
@param <R... | java | public <RH extends CheckedConsumer<? super K>> RH create(final T value, final RH keyConsumer) throws SQLException {
transactionTemplate
.doInTransaction(new SQLFunction<Connection, Object>() {
@Override
public Object apply(Connection connection) throws SQLException {
... | [
"public",
"<",
"RH",
"extends",
"CheckedConsumer",
"<",
"?",
"super",
"K",
">",
">",
"RH",
"create",
"(",
"final",
"T",
"value",
",",
"final",
"RH",
"keyConsumer",
")",
"throws",
"SQLException",
"{",
"transactionTemplate",
".",
"doInTransaction",
"(",
"new",... | insert value into the db through the specified connection.
Callback keyConsumer with the generated key if one was.
@param value the value
@param keyConsumer the key consumer
@param <RH> the type of keyConsumer
@return the keyConsumer
@throws SQLException | [
"insert",
"value",
"into",
"the",
"db",
"through",
"the",
"specified",
"connection",
".",
"Callback",
"keyConsumer",
"with",
"the",
"generated",
"key",
"if",
"one",
"was",
"."
] | train | https://github.com/arnaudroger/SimpleFlatMapper/blob/93435438c18f26c87963d5e0f3ebf0f264dcd8c2/sfm-jdbc/src/main/java/org/simpleflatmapper/jdbc/ConnectedCrud.java#L70-L80 |
sdaschner/jaxrs-analyzer | src/main/java/com/sebastian_daschner/jaxrs_analyzer/analysis/results/ResultInterpreter.java | ResultInterpreter.addResponseComments | private void addResponseComments(MethodResult methodResult, ResourceMethod resourceMethod) {
"""
Adds the comments for the individual status code to the corresponding Responses.
The information is based on the {@code @response} javadoc tags.
"""
MethodComment methodDoc = methodResult.getMethodDoc();
... | java | private void addResponseComments(MethodResult methodResult, ResourceMethod resourceMethod) {
MethodComment methodDoc = methodResult.getMethodDoc();
if (methodDoc == null)
return;
methodDoc.getResponseComments()
.forEach((k, v) -> addResponseComment(k, v, resourceMeth... | [
"private",
"void",
"addResponseComments",
"(",
"MethodResult",
"methodResult",
",",
"ResourceMethod",
"resourceMethod",
")",
"{",
"MethodComment",
"methodDoc",
"=",
"methodResult",
".",
"getMethodDoc",
"(",
")",
";",
"if",
"(",
"methodDoc",
"==",
"null",
")",
"ret... | Adds the comments for the individual status code to the corresponding Responses.
The information is based on the {@code @response} javadoc tags. | [
"Adds",
"the",
"comments",
"for",
"the",
"individual",
"status",
"code",
"to",
"the",
"corresponding",
"Responses",
".",
"The",
"information",
"is",
"based",
"on",
"the",
"{"
] | train | https://github.com/sdaschner/jaxrs-analyzer/blob/4ac62942202d05632977d6c14d3cd7e2d27e2b9b/src/main/java/com/sebastian_daschner/jaxrs_analyzer/analysis/results/ResultInterpreter.java#L139-L153 |
alrocar/POIProxy | es.alrocar.poiproxy/src/main/java/es/alrocar/poiproxy/proxy/POIProxy.java | POIProxy.getFeatures | public ArrayList<JTSFeature> getFeatures(String id, double minX, double minY, double maxX, double maxY,
List<Param> optionalParams) throws Exception {
"""
This method is used to get the pois from a service and return a list of
{@link JTSFeature} document with the data retrieved given a bounding box
corners
... | java | public ArrayList<JTSFeature> getFeatures(String id, double minX, double minY, double maxX, double maxY,
List<Param> optionalParams) throws Exception {
DescribeService describeService = getDescribeServiceByID(id);
return getFeatures(id, optionalParams, describeService, minX, minY, maxX, maxY, 0, 0);
} | [
"public",
"ArrayList",
"<",
"JTSFeature",
">",
"getFeatures",
"(",
"String",
"id",
",",
"double",
"minX",
",",
"double",
"minY",
",",
"double",
"maxX",
",",
"double",
"maxY",
",",
"List",
"<",
"Param",
">",
"optionalParams",
")",
"throws",
"Exception",
"{"... | This method is used to get the pois from a service and return a list of
{@link JTSFeature} document with the data retrieved given a bounding box
corners
@param id
The id of the service
@param minX
@param minY
@param maxX
@param maxY
@return A list of {@link JTSFeature} | [
"This",
"method",
"is",
"used",
"to",
"get",
"the",
"pois",
"from",
"a",
"service",
"and",
"return",
"a",
"list",
"of",
"{",
"@link",
"JTSFeature",
"}",
"document",
"with",
"the",
"data",
"retrieved",
"given",
"a",
"bounding",
"box",
"corners"
] | train | https://github.com/alrocar/POIProxy/blob/e1dabe738a862478b2580e90d5fc4209a2997868/es.alrocar.poiproxy/src/main/java/es/alrocar/poiproxy/proxy/POIProxy.java#L476-L481 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/triangulate/ResidualsTriangulateMetricSimple.java | ResidualsTriangulateMetricSimple.setObservations | public void setObservations( List<Point2D_F64> observations , List<Se3_F64> motionGtoC ) {
"""
Configures inputs.
@param observations Observations of the feature at different locations. Normalized image coordinates.
@param motionGtoC Camera motion from global to camera frame..
"""
if( observations.size()... | java | public void setObservations( List<Point2D_F64> observations , List<Se3_F64> motionGtoC ) {
if( observations.size() != motionGtoC.size() )
throw new IllegalArgumentException("Different size lists");
this.observations = observations;
this.motionGtoC = motionGtoC;
} | [
"public",
"void",
"setObservations",
"(",
"List",
"<",
"Point2D_F64",
">",
"observations",
",",
"List",
"<",
"Se3_F64",
">",
"motionGtoC",
")",
"{",
"if",
"(",
"observations",
".",
"size",
"(",
")",
"!=",
"motionGtoC",
".",
"size",
"(",
")",
")",
"throw"... | Configures inputs.
@param observations Observations of the feature at different locations. Normalized image coordinates.
@param motionGtoC Camera motion from global to camera frame.. | [
"Configures",
"inputs",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/triangulate/ResidualsTriangulateMetricSimple.java#L51-L57 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualFileAssembly.java | VirtualFileAssembly.getFile | public VirtualFile getFile(VirtualFile mountPoint, VirtualFile target) {
"""
Get the VirtualFile from the assembly. This will traverse VirtualFiles in assembly
to find children if needed.
@param mountPoint
@param target
@return
@throws IOException
"""
final String path = target.getPathNameRelat... | java | public VirtualFile getFile(VirtualFile mountPoint, VirtualFile target) {
final String path = target.getPathNameRelativeTo(mountPoint);
return rootNode.getFile(new Path(path), mountPoint);
} | [
"public",
"VirtualFile",
"getFile",
"(",
"VirtualFile",
"mountPoint",
",",
"VirtualFile",
"target",
")",
"{",
"final",
"String",
"path",
"=",
"target",
".",
"getPathNameRelativeTo",
"(",
"mountPoint",
")",
";",
"return",
"rootNode",
".",
"getFile",
"(",
"new",
... | Get the VirtualFile from the assembly. This will traverse VirtualFiles in assembly
to find children if needed.
@param mountPoint
@param target
@return
@throws IOException | [
"Get",
"the",
"VirtualFile",
"from",
"the",
"assembly",
".",
"This",
"will",
"traverse",
"VirtualFiles",
"in",
"assembly",
"to",
"find",
"children",
"if",
"needed",
"."
] | train | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualFileAssembly.java#L95-L98 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.createImageRegions | public ImageRegionCreateSummary createImageRegions(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter) {
"""
Create a set of image regions.
This API accepts a batch of image regions, and optionally tags, to update existing images with region information.
There is a limit of 6... | java | public ImageRegionCreateSummary createImageRegions(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter) {
return createImageRegionsWithServiceResponseAsync(projectId, createImageRegionsOptionalParameter).toBlocking().single().body();
} | [
"public",
"ImageRegionCreateSummary",
"createImageRegions",
"(",
"UUID",
"projectId",
",",
"CreateImageRegionsOptionalParameter",
"createImageRegionsOptionalParameter",
")",
"{",
"return",
"createImageRegionsWithServiceResponseAsync",
"(",
"projectId",
",",
"createImageRegionsOptiona... | Create a set of image regions.
This API accepts a batch of image regions, and optionally tags, to update existing images with region information.
There is a limit of 64 entries in the batch.
@param projectId The project id
@param createImageRegionsOptionalParameter the object representing the optional parameters to be... | [
"Create",
"a",
"set",
"of",
"image",
"regions",
".",
"This",
"API",
"accepts",
"a",
"batch",
"of",
"image",
"regions",
"and",
"optionally",
"tags",
"to",
"update",
"existing",
"images",
"with",
"region",
"information",
".",
"There",
"is",
"a",
"limit",
"of... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L3345-L3347 |
ChannelFinder/javaCFClient | src/main/java/gov/bnl/channelfinder/api/CFProperties.java | CFProperties.getPreferenceValue | public String getPreferenceValue(String key, String defaultValue) {
"""
check java preferences for the requested key - then checks the various
default properties files.
@param key
@param defaultValue
@return
"""
if (userCFProperties.containsKey(key))
return userCFProperties.getProperty(key);
else ... | java | public String getPreferenceValue(String key, String defaultValue) {
if (userCFProperties.containsKey(key))
return userCFProperties.getProperty(key);
else if (userHomeCFProperties.containsKey(key))
return userHomeCFProperties.getProperty(key);
else if (systemCFProperties.containsKey(key))
return systemCFP... | [
"public",
"String",
"getPreferenceValue",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"userCFProperties",
".",
"containsKey",
"(",
"key",
")",
")",
"return",
"userCFProperties",
".",
"getProperty",
"(",
"key",
")",
";",
"else",
... | check java preferences for the requested key - then checks the various
default properties files.
@param key
@param defaultValue
@return | [
"check",
"java",
"preferences",
"for",
"the",
"requested",
"key",
"-",
"then",
"checks",
"the",
"various",
"default",
"properties",
"files",
"."
] | train | https://github.com/ChannelFinder/javaCFClient/blob/000fce53ad2b8f8c38ef24fec5b5ec65e383ac9d/src/main/java/gov/bnl/channelfinder/api/CFProperties.java#L100-L111 |
grpc/grpc-java | services/src/main/java/io/grpc/services/HealthCheckingLoadBalancerUtil.java | HealthCheckingLoadBalancerUtil.newHealthCheckingLoadBalancer | public static LoadBalancer newHealthCheckingLoadBalancer(Factory factory, Helper helper) {
"""
Creates a health-checking-capable LoadBalancer. This method is used to implement
health-checking-capable {@link Factory}s, which will typically written this way:
<pre>
public class HealthCheckingFooLbFactory extend... | java | public static LoadBalancer newHealthCheckingLoadBalancer(Factory factory, Helper helper) {
HealthCheckingLoadBalancerFactory hcFactory =
new HealthCheckingLoadBalancerFactory(
factory, new ExponentialBackoffPolicy.Provider(),
GrpcUtil.STOPWATCH_SUPPLIER);
return hcFactory.newLoad... | [
"public",
"static",
"LoadBalancer",
"newHealthCheckingLoadBalancer",
"(",
"Factory",
"factory",
",",
"Helper",
"helper",
")",
"{",
"HealthCheckingLoadBalancerFactory",
"hcFactory",
"=",
"new",
"HealthCheckingLoadBalancerFactory",
"(",
"factory",
",",
"new",
"ExponentialBack... | Creates a health-checking-capable LoadBalancer. This method is used to implement
health-checking-capable {@link Factory}s, which will typically written this way:
<pre>
public class HealthCheckingFooLbFactory extends LoadBalancer.Factory {
// This is the original balancer implementation that doesn't have health checki... | [
"Creates",
"a",
"health",
"-",
"checking",
"-",
"capable",
"LoadBalancer",
".",
"This",
"method",
"is",
"used",
"to",
"implement",
"health",
"-",
"checking",
"-",
"capable",
"{",
"@link",
"Factory",
"}",
"s",
"which",
"will",
"typically",
"written",
"this",
... | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/services/src/main/java/io/grpc/services/HealthCheckingLoadBalancerUtil.java#L63-L69 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java | ST_AsGeoJSON.toGeojsonMultiLineString | public static void toGeojsonMultiLineString(MultiLineString multiLineString, StringBuilder sb) {
"""
Coordinates of a MultiLineString are an array of LineString coordinate
arrays.
Syntax:
{ "type": "MultiLineString", "coordinates": [ [ [100.0, 0.0], [101.0,
1.0] ], [ [102.0, 2.0], [103.0, 3.0] ] ] }
@pa... | java | public static void toGeojsonMultiLineString(MultiLineString multiLineString, StringBuilder sb) {
sb.append("{\"type\":\"MultiLineString\",\"coordinates\":[");
for (int i = 0; i < multiLineString.getNumGeometries(); i++) {
toGeojsonCoordinates(multiLineString.getGeometryN(i).getCoordinates(),... | [
"public",
"static",
"void",
"toGeojsonMultiLineString",
"(",
"MultiLineString",
"multiLineString",
",",
"StringBuilder",
"sb",
")",
"{",
"sb",
".",
"append",
"(",
"\"{\\\"type\\\":\\\"MultiLineString\\\",\\\"coordinates\\\":[\"",
")",
";",
"for",
"(",
"int",
"i",
"=",
... | Coordinates of a MultiLineString are an array of LineString coordinate
arrays.
Syntax:
{ "type": "MultiLineString", "coordinates": [ [ [100.0, 0.0], [101.0,
1.0] ], [ [102.0, 2.0], [103.0, 3.0] ] ] }
@param multiLineString
@param sb | [
"Coordinates",
"of",
"a",
"MultiLineString",
"are",
"an",
"array",
"of",
"LineString",
"coordinate",
"arrays",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java#L160-L169 |
apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/source/workunit/Extract.java | Extract.addPrimaryKey | @Deprecated
public void addPrimaryKey(String... primaryKeyFieldName) {
"""
Add more primary keys to the existing set of primary keys.
@param primaryKeyFieldName primary key names
@deprecated @deprecated It is recommended to add primary keys in {@code WorkUnit} instead of {@code Extract}.
"""
StringBu... | java | @Deprecated
public void addPrimaryKey(String... primaryKeyFieldName) {
StringBuilder sb = new StringBuilder(getProp(ConfigurationKeys.EXTRACT_PRIMARY_KEY_FIELDS_KEY, ""));
Joiner.on(",").appendTo(sb, primaryKeyFieldName);
setProp(ConfigurationKeys.EXTRACT_PRIMARY_KEY_FIELDS_KEY, sb.toString());
} | [
"@",
"Deprecated",
"public",
"void",
"addPrimaryKey",
"(",
"String",
"...",
"primaryKeyFieldName",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"getProp",
"(",
"ConfigurationKeys",
".",
"EXTRACT_PRIMARY_KEY_FIELDS_KEY",
",",
"\"\"",
")",
")",
... | Add more primary keys to the existing set of primary keys.
@param primaryKeyFieldName primary key names
@deprecated @deprecated It is recommended to add primary keys in {@code WorkUnit} instead of {@code Extract}. | [
"Add",
"more",
"primary",
"keys",
"to",
"the",
"existing",
"set",
"of",
"primary",
"keys",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/source/workunit/Extract.java#L247-L252 |
VoltDB/voltdb | third_party/java/src/org/apache/commons_voltpatches/cli/Parser.java | Parser.processArgs | public void processArgs(Option opt, ListIterator<String> iter) throws ParseException {
"""
Process the argument values for the specified Option
<code>opt</code> using the values retrieved from the
specified iterator <code>iter</code>.
@param opt The current Option
@param iter The iterator over the flattened ... | java | public void processArgs(Option opt, ListIterator<String> iter) throws ParseException
{
// loop until an option is found
while (iter.hasNext())
{
String str = iter.next();
// found an Option, not an argument
if (getOptions().hasOption(str) && s... | [
"public",
"void",
"processArgs",
"(",
"Option",
"opt",
",",
"ListIterator",
"<",
"String",
">",
"iter",
")",
"throws",
"ParseException",
"{",
"// loop until an option is found",
"while",
"(",
"iter",
".",
"hasNext",
"(",
")",
")",
"{",
"String",
"str",
"=",
... | Process the argument values for the specified Option
<code>opt</code> using the values retrieved from the
specified iterator <code>iter</code>.
@param opt The current Option
@param iter The iterator over the flattened command line Options.
@throws ParseException if an argument value is required
and it is has not been... | [
"Process",
"the",
"argument",
"values",
"for",
"the",
"specified",
"Option",
"<code",
">",
"opt<",
"/",
"code",
">",
"using",
"the",
"values",
"retrieved",
"from",
"the",
"specified",
"iterator",
"<code",
">",
"iter<",
"/",
"code",
">",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/Parser.java#L335-L365 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/MapPrinter.java | MapPrinter.parseSpec | public static PJsonObject parseSpec(final String spec) {
"""
Parse the JSON string and return the object. The string is expected to be the JSON print data from the
client.
@param spec the JSON formatted string.
@return The encapsulated JSON object
"""
final JSONObject jsonSpec;
try {
... | java | public static PJsonObject parseSpec(final String spec) {
final JSONObject jsonSpec;
try {
jsonSpec = new JSONObject(spec);
} catch (JSONException e) {
throw new RuntimeException("Cannot parse the spec file: " + spec, e);
}
return new PJsonObject(jsonSpec, ... | [
"public",
"static",
"PJsonObject",
"parseSpec",
"(",
"final",
"String",
"spec",
")",
"{",
"final",
"JSONObject",
"jsonSpec",
";",
"try",
"{",
"jsonSpec",
"=",
"new",
"JSONObject",
"(",
"spec",
")",
";",
"}",
"catch",
"(",
"JSONException",
"e",
")",
"{",
... | Parse the JSON string and return the object. The string is expected to be the JSON print data from the
client.
@param spec the JSON formatted string.
@return The encapsulated JSON object | [
"Parse",
"the",
"JSON",
"string",
"and",
"return",
"the",
"object",
".",
"The",
"string",
"is",
"expected",
"to",
"be",
"the",
"JSON",
"print",
"data",
"from",
"the",
"client",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/MapPrinter.java#L54-L62 |
js-lib-com/template.xhtml | src/main/java/js/template/xhtml/OperatorsList.java | OperatorsList.insanityCheck | private void insanityCheck(Element element, Meta meta, Opcode.Type type) {
"""
Throws template exception if operator of given type is already declared.
@param element context element,
@param meta operator meta-data,
@param type operator type.
@throws TemplateException if operator of given type is already dec... | java | private void insanityCheck(Element element, Meta meta, Opcode.Type type) {
if (meta != null) {
throw new TemplateException("Invalid operators list on element |%s|. Only one %s operator is allowed.", element, type);
}
} | [
"private",
"void",
"insanityCheck",
"(",
"Element",
"element",
",",
"Meta",
"meta",
",",
"Opcode",
".",
"Type",
"type",
")",
"{",
"if",
"(",
"meta",
"!=",
"null",
")",
"{",
"throw",
"new",
"TemplateException",
"(",
"\"Invalid operators list on element |%s|. Only... | Throws template exception if operator of given type is already declared.
@param element context element,
@param meta operator meta-data,
@param type operator type.
@throws TemplateException if operator of given type is already declared. | [
"Throws",
"template",
"exception",
"if",
"operator",
"of",
"given",
"type",
"is",
"already",
"declared",
"."
] | train | https://github.com/js-lib-com/template.xhtml/blob/d50cec08aca9ab9680baebe2a26a341c096564fb/src/main/java/js/template/xhtml/OperatorsList.java#L107-L111 |
mfornos/humanize | humanize-slim/src/main/java/humanize/Humanize.java | Humanize.duration | public static String duration(final Number seconds, final TimeStyle style) {
"""
<p>
Formats a number of seconds as hours, minutes and seconds.
</p>
@param seconds
Number of seconds
@param style
Time style
@return a String with the formatted time according to the given style
"""
int s = second... | java | public static String duration(final Number seconds, final TimeStyle style)
{
int s = seconds.intValue();
boolean neg = s < 0;
s = Math.abs(s);
return style.format(context.get(), neg, s / 3600, (s / 60) % 60, s % 60);
} | [
"public",
"static",
"String",
"duration",
"(",
"final",
"Number",
"seconds",
",",
"final",
"TimeStyle",
"style",
")",
"{",
"int",
"s",
"=",
"seconds",
".",
"intValue",
"(",
")",
";",
"boolean",
"neg",
"=",
"s",
"<",
"0",
";",
"s",
"=",
"Math",
".",
... | <p>
Formats a number of seconds as hours, minutes and seconds.
</p>
@param seconds
Number of seconds
@param style
Time style
@return a String with the formatted time according to the given style | [
"<p",
">",
"Formats",
"a",
"number",
"of",
"seconds",
"as",
"hours",
"minutes",
"and",
"seconds",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/mfornos/humanize/blob/59fc103045de9d217c9e77dbcb7621f992f46c63/humanize-slim/src/main/java/humanize/Humanize.java#L756-L762 |
roboconf/roboconf-platform | miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/TextUtils.java | TextUtils.fixSelectionLength | static int fixSelectionLength( String fullText, int selectionOffset, int selectionLength ) {
"""
Fixes the selection length to get the whole line.
@param fullText the full text (not null)
@param selectionOffset a <b>valid</b> selection offset
@param selectionLength the selection length
@return a valid selectio... | java | static int fixSelectionLength( String fullText, int selectionOffset, int selectionLength ) {
if( selectionLength < 0 )
selectionLength = 0;
else if( selectionOffset + selectionLength > fullText.length())
selectionLength = fullText.length() - selectionOffset;
for( ; selectionOffset + selectionLength < full... | [
"static",
"int",
"fixSelectionLength",
"(",
"String",
"fullText",
",",
"int",
"selectionOffset",
",",
"int",
"selectionLength",
")",
"{",
"if",
"(",
"selectionLength",
"<",
"0",
")",
"selectionLength",
"=",
"0",
";",
"else",
"if",
"(",
"selectionOffset",
"+",
... | Fixes the selection length to get the whole line.
@param fullText the full text (not null)
@param selectionOffset a <b>valid</b> selection offset
@param selectionLength the selection length
@return a valid selection length (can be zero) | [
"Fixes",
"the",
"selection",
"length",
"to",
"get",
"the",
"whole",
"line",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/TextUtils.java#L123-L137 |
keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/GraphicalModel.java | GraphicalModel.addBinaryFactor | public Factor addBinaryFactor(int a, int b, BiFunction<Integer, Integer, ConcatVector> featurizer) {
"""
A simple helper function for defining a binary factor. That is, a factor between two variables in the graphical model.
@param a The index of the first variable.
@param b The index of the second variable
@p... | java | public Factor addBinaryFactor(int a, int b, BiFunction<Integer, Integer, ConcatVector> featurizer) {
int[] variableDims = getVariableSizes();
assert a < variableDims.length;
assert b < variableDims.length;
return addFactor(new int[]{a, b}, new int[]{variableDims[a], variableDims[b]}, assignment -> featu... | [
"public",
"Factor",
"addBinaryFactor",
"(",
"int",
"a",
",",
"int",
"b",
",",
"BiFunction",
"<",
"Integer",
",",
"Integer",
",",
"ConcatVector",
">",
"featurizer",
")",
"{",
"int",
"[",
"]",
"variableDims",
"=",
"getVariableSizes",
"(",
")",
";",
"assert",... | A simple helper function for defining a binary factor. That is, a factor between two variables in the graphical model.
@param a The index of the first variable.
@param b The index of the second variable
@param featurizer The featurizer. This takes as input two assignments for the two variables, and returns the feature... | [
"A",
"simple",
"helper",
"function",
"for",
"defining",
"a",
"binary",
"factor",
".",
"That",
"is",
"a",
"factor",
"between",
"two",
"variables",
"in",
"the",
"graphical",
"model",
"."
] | train | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/GraphicalModel.java#L437-L442 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/frequencies/LongsSketch.java | LongsSketch.getInstance | public static LongsSketch getInstance(final String string) {
"""
Returns a sketch instance of this class from the given String,
which must be a String representation of this sketch class.
@param string a String representation of a sketch of this class.
@return a sketch instance of this class.
"""
fina... | java | public static LongsSketch getInstance(final String string) {
final String[] tokens = string.split(",");
if (tokens.length < (STR_PREAMBLE_TOKENS + 2)) {
throw new SketchesArgumentException(
"String not long enough: " + tokens.length);
}
final int serVer = Integer.parseInt(tokens[0]);
... | [
"public",
"static",
"LongsSketch",
"getInstance",
"(",
"final",
"String",
"string",
")",
"{",
"final",
"String",
"[",
"]",
"tokens",
"=",
"string",
".",
"split",
"(",
"\",\"",
")",
";",
"if",
"(",
"tokens",
".",
"length",
"<",
"(",
"STR_PREAMBLE_TOKENS",
... | Returns a sketch instance of this class from the given String,
which must be a String representation of this sketch class.
@param string a String representation of a sketch of this class.
@return a sketch instance of this class. | [
"Returns",
"a",
"sketch",
"instance",
"of",
"this",
"class",
"from",
"the",
"given",
"String",
"which",
"must",
"be",
"a",
"String",
"representation",
"of",
"this",
"sketch",
"class",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/frequencies/LongsSketch.java#L275-L313 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/zone/ZoneRulesBuilder.java | ZoneRulesBuilder.addRuleToWindow | public ZoneRulesBuilder addRuleToWindow(
int year,
Month month,
int dayOfMonthIndicator,
LocalTime time,
boolean timeEndOfDay,
TimeDefinition timeDefinition,
int savingAmountSecs) {
"""
Adds a single transition rule to the current ... | java | public ZoneRulesBuilder addRuleToWindow(
int year,
Month month,
int dayOfMonthIndicator,
LocalTime time,
boolean timeEndOfDay,
TimeDefinition timeDefinition,
int savingAmountSecs) {
return addRuleToWindow(year, year, month, dayO... | [
"public",
"ZoneRulesBuilder",
"addRuleToWindow",
"(",
"int",
"year",
",",
"Month",
"month",
",",
"int",
"dayOfMonthIndicator",
",",
"LocalTime",
"time",
",",
"boolean",
"timeEndOfDay",
",",
"TimeDefinition",
"timeDefinition",
",",
"int",
"savingAmountSecs",
")",
"{"... | Adds a single transition rule to the current window.
<p>
This adds a rule such that the offset, expressed as a daylight savings amount,
changes at the specified date-time.
@param year the year of the transition, from MIN_VALUE to MAX_VALUE
@param month the month of the transition, not null
@param dayOfMonthIndicator... | [
"Adds",
"a",
"single",
"transition",
"rule",
"to",
"the",
"current",
"window",
".",
"<p",
">",
"This",
"adds",
"a",
"rule",
"such",
"that",
"the",
"offset",
"expressed",
"as",
"a",
"daylight",
"savings",
"amount",
"changes",
"at",
"the",
"specified",
"date... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/ZoneRulesBuilder.java#L222-L231 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/ReflectionUtil.java | ReflectionUtil.getProperty | public static Object getProperty(final Object object, final String property) {
"""
This method gets a property from an object via reflection.
@param object The object from which the property is to be retrieved.
@param property The name of the property to be retrieved.
@return The value of the specified <em>... | java | public static Object getProperty(final Object object, final String property) {
Class[] paramTypes = new Class[]{};
Object[] params = new Object[]{};
String methodName = "get" + property.substring(0, 1).toUpperCase() + property.substring(1);
return ReflectionUtil.invokeMethod(object, methodName, params, paramTy... | [
"public",
"static",
"Object",
"getProperty",
"(",
"final",
"Object",
"object",
",",
"final",
"String",
"property",
")",
"{",
"Class",
"[",
"]",
"paramTypes",
"=",
"new",
"Class",
"[",
"]",
"{",
"}",
";",
"Object",
"[",
"]",
"params",
"=",
"new",
"Objec... | This method gets a property from an object via reflection.
@param object The object from which the property is to be retrieved.
@param property The name of the property to be retrieved.
@return The value of the specified <em>property</em>. | [
"This",
"method",
"gets",
"a",
"property",
"from",
"an",
"object",
"via",
"reflection",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/ReflectionUtil.java#L139-L145 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/AlgorithmId.java | AlgorithmId.get | public static AlgorithmId get(AlgorithmParameters algparams)
throws NoSuchAlgorithmException {
"""
Returns one of the algorithm IDs most commonly associated
with this algorithm parameters.
@param algparams the associated algorithm parameters.
@exception NoSuchAlgorithmException on error.
"""
... | java | public static AlgorithmId get(AlgorithmParameters algparams)
throws NoSuchAlgorithmException {
ObjectIdentifier oid;
String algname = algparams.getAlgorithm();
try {
oid = algOID(algname);
} catch (IOException ioe) {
throw new NoSuchAlgorithmException
... | [
"public",
"static",
"AlgorithmId",
"get",
"(",
"AlgorithmParameters",
"algparams",
")",
"throws",
"NoSuchAlgorithmException",
"{",
"ObjectIdentifier",
"oid",
";",
"String",
"algname",
"=",
"algparams",
".",
"getAlgorithm",
"(",
")",
";",
"try",
"{",
"oid",
"=",
... | Returns one of the algorithm IDs most commonly associated
with this algorithm parameters.
@param algparams the associated algorithm parameters.
@exception NoSuchAlgorithmException on error. | [
"Returns",
"one",
"of",
"the",
"algorithm",
"IDs",
"most",
"commonly",
"associated",
"with",
"this",
"algorithm",
"parameters",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/AlgorithmId.java#L438-L453 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java | MapMessage.with | @SuppressWarnings("unchecked")
public M with(final String key, final short value) {
"""
Adds an item to the data Map.
@param key The name of the data item.
@param value The value of the data item.
@return this object
@since 2.9
"""
validate(key, value);
data.putValue(key, value);
... | java | @SuppressWarnings("unchecked")
public M with(final String key, final short value) {
validate(key, value);
data.putValue(key, value);
return (M) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"M",
"with",
"(",
"final",
"String",
"key",
",",
"final",
"short",
"value",
")",
"{",
"validate",
"(",
"key",
",",
"value",
")",
";",
"data",
".",
"putValue",
"(",
"key",
",",
"value",
")",
... | Adds an item to the data Map.
@param key The name of the data item.
@param value The value of the data item.
@return this object
@since 2.9 | [
"Adds",
"an",
"item",
"to",
"the",
"data",
"Map",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java#L652-L657 |
Danny02/JOpenCTM | src/main/java/darwin/jopenctm/compression/MG2Encoder.java | MG2Encoder.pointToGridIdx | private int pointToGridIdx(Grid grid, float x, float y, float z) {
"""
Convert a point to a grid index.
@param grid grid definition
@return grid index of point
"""
Vec3f size = grid.getSize();
int idx = calcIndex(x, size.getX(), grid.getMin().getX(), grid.getDivision().getX());
int... | java | private int pointToGridIdx(Grid grid, float x, float y, float z) {
Vec3f size = grid.getSize();
int idx = calcIndex(x, size.getX(), grid.getMin().getX(), grid.getDivision().getX());
int idy = calcIndex(y, size.getY(), grid.getMin().getY(), grid.getDivision().getY());
int idz = calcIndex... | [
"private",
"int",
"pointToGridIdx",
"(",
"Grid",
"grid",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"Vec3f",
"size",
"=",
"grid",
".",
"getSize",
"(",
")",
";",
"int",
"idx",
"=",
"calcIndex",
"(",
"x",
",",
"size",
".",
"... | Convert a point to a grid index.
@param grid grid definition
@return grid index of point | [
"Convert",
"a",
"point",
"to",
"a",
"grid",
"index",
"."
] | train | https://github.com/Danny02/JOpenCTM/blob/c55a2a2d166a55979190f1bb08214fc84c93008f/src/main/java/darwin/jopenctm/compression/MG2Encoder.java#L197-L205 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingConfigurationImpl.java | IndexingConfigurationImpl.getPropertyBoost | public float getPropertyBoost(NodeData state, InternalQName propertyName) {
"""
Returns the boost value for the given property name. If there is no
configuration entry for the property name the {@link #DEFAULT_BOOST} is
returned.
@param state
the node state.
@param propertyName
the name of a property.
@re... | java | public float getPropertyBoost(NodeData state, InternalQName propertyName)
{
IndexingRule rule = getApplicableIndexingRule(state);
if (rule != null)
{
return rule.getBoost(propertyName);
}
return DEFAULT_BOOST;
} | [
"public",
"float",
"getPropertyBoost",
"(",
"NodeData",
"state",
",",
"InternalQName",
"propertyName",
")",
"{",
"IndexingRule",
"rule",
"=",
"getApplicableIndexingRule",
"(",
"state",
")",
";",
"if",
"(",
"rule",
"!=",
"null",
")",
"{",
"return",
"rule",
".",... | Returns the boost value for the given property name. If there is no
configuration entry for the property name the {@link #DEFAULT_BOOST} is
returned.
@param state
the node state.
@param propertyName
the name of a property.
@return the boost value for the property. | [
"Returns",
"the",
"boost",
"value",
"for",
"the",
"given",
"property",
"name",
".",
"If",
"there",
"is",
"no",
"configuration",
"entry",
"for",
"the",
"property",
"name",
"the",
"{",
"@link",
"#DEFAULT_BOOST",
"}",
"is",
"returned",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingConfigurationImpl.java#L271-L279 |
iig-uni-freiburg/SEWOL | ext/org/deckfour/spex/SXDocument.java | SXDocument.addNode | public SXTag addNode(String tagName) throws IOException {
"""
Adds a regular, named node to this document (usually one single root node)
<b>WARNING:</b> This will close the last added tag, if applicable!
@param tagName The name of the tag to add (contents between brackets)
@return A Node abstraction.
"""
... | java | public SXTag addNode(String tagName) throws IOException {
prepareToAddChildNode();
SXTag node = new SXTag(tagName, writer, 0, tabString);
lastChildNode = node;
return node;
} | [
"public",
"SXTag",
"addNode",
"(",
"String",
"tagName",
")",
"throws",
"IOException",
"{",
"prepareToAddChildNode",
"(",
")",
";",
"SXTag",
"node",
"=",
"new",
"SXTag",
"(",
"tagName",
",",
"writer",
",",
"0",
",",
"tabString",
")",
";",
"lastChildNode",
"... | Adds a regular, named node to this document (usually one single root node)
<b>WARNING:</b> This will close the last added tag, if applicable!
@param tagName The name of the tag to add (contents between brackets)
@return A Node abstraction. | [
"Adds",
"a",
"regular",
"named",
"node",
"to",
"this",
"document",
"(",
"usually",
"one",
"single",
"root",
"node",
")",
"<b",
">",
"WARNING",
":",
"<",
"/",
"b",
">",
"This",
"will",
"close",
"the",
"last",
"added",
"tag",
"if",
"applicable!"
] | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/spex/SXDocument.java#L158-L163 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java | NodeSequence.batchOfKeys | public static Batch batchOfKeys( final Collection<NodeKey> keys,
final float score,
final String workspaceName,
final RepositoryCache repository ) {
"""
Create a batch of nodes around the supplied iterabl... | java | public static Batch batchOfKeys( final Collection<NodeKey> keys,
final float score,
final String workspaceName,
final RepositoryCache repository ) {
if (keys == null) return emptyBatch(workspaceName, 1... | [
"public",
"static",
"Batch",
"batchOfKeys",
"(",
"final",
"Collection",
"<",
"NodeKey",
">",
"keys",
",",
"final",
"float",
"score",
",",
"final",
"String",
"workspaceName",
",",
"final",
"RepositoryCache",
"repository",
")",
"{",
"if",
"(",
"keys",
"==",
"n... | Create a batch of nodes around the supplied iterable container. Note that the supplied iterator is accessed lazily only
when the batch is {@link Batch#nextRow() used}.
@param keys the iterator over the keys of the nodes to be returned; if null, an {@link #emptySequence empty instance} is
returned
@param score the scor... | [
"Create",
"a",
"batch",
"of",
"nodes",
"around",
"the",
"supplied",
"iterable",
"container",
".",
"Note",
"that",
"the",
"supplied",
"iterator",
"is",
"accessed",
"lazily",
"only",
"when",
"the",
"batch",
"is",
"{",
"@link",
"Batch#nextRow",
"()",
"used",
"}... | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L1410-L1416 |
RestComm/sip-servlets | sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/dispatchers/SubsequentRequestDispatcher.java | SubsequentRequestDispatcher.handleOrphanRequest | private static void handleOrphanRequest(final SipProvider sipProvider,
final SipServletRequestImpl sipServletRequest,
String applicationId, final SipContext sipContext)
throws DispatcherException {
"""
/*
http://code.google.com/p/mobicents/issues/detail?id=2547
Allows to route subsequent requests statel... | java | private static void handleOrphanRequest(final SipProvider sipProvider,
final SipServletRequestImpl sipServletRequest,
String applicationId, final SipContext sipContext)
throws DispatcherException {
final String applicationName = sipContext.getApplicationName();
final Request request = (Request) sipServletR... | [
"private",
"static",
"void",
"handleOrphanRequest",
"(",
"final",
"SipProvider",
"sipProvider",
",",
"final",
"SipServletRequestImpl",
"sipServletRequest",
",",
"String",
"applicationId",
",",
"final",
"SipContext",
"sipContext",
")",
"throws",
"DispatcherException",
"{",... | /*
http://code.google.com/p/mobicents/issues/detail?id=2547
Allows to route subsequent requests statelessly to proxy applications to
improve perf and mem usage. | [
"/",
"*",
"http",
":",
"//",
"code",
".",
"google",
".",
"com",
"/",
"p",
"/",
"mobicents",
"/",
"issues",
"/",
"detail?id",
"=",
"2547",
"Allows",
"to",
"route",
"subsequent",
"requests",
"statelessly",
"to",
"proxy",
"applications",
"to",
"improve",
"p... | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/dispatchers/SubsequentRequestDispatcher.java#L558-L607 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/functions/FunctionOneArg.java | FunctionOneArg.setArg | public void setArg(Expression arg, int argNum)
throws WrongNumberArgsException {
"""
Set an argument expression for a function. This method is called by the
XPath compiler.
@param arg non-null expression that represents the argument.
@param argNum The argument number index.
@throws WrongNumberAr... | java | public void setArg(Expression arg, int argNum)
throws WrongNumberArgsException
{
if (0 == argNum)
{
m_arg0 = arg;
arg.exprSetParent(this);
}
else
reportWrongNumberArgs();
} | [
"public",
"void",
"setArg",
"(",
"Expression",
"arg",
",",
"int",
"argNum",
")",
"throws",
"WrongNumberArgsException",
"{",
"if",
"(",
"0",
"==",
"argNum",
")",
"{",
"m_arg0",
"=",
"arg",
";",
"arg",
".",
"exprSetParent",
"(",
"this",
")",
";",
"}",
"e... | Set an argument expression for a function. This method is called by the
XPath compiler.
@param arg non-null expression that represents the argument.
@param argNum The argument number index.
@throws WrongNumberArgsException If the argNum parameter is greater than 0. | [
"Set",
"an",
"argument",
"expression",
"for",
"a",
"function",
".",
"This",
"method",
"is",
"called",
"by",
"the",
"XPath",
"compiler",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/functions/FunctionOneArg.java#L60-L71 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/FirstNonNullHelper.java | FirstNonNullHelper.firstNonNull | public static <T, R> R firstNonNull(Function<T, R> function, T[] values) {
"""
Gets first result of function which is not null.
@param <T> type of values.
@param <R> element to return.
@param function function to apply to each value.
@param values all possible values to apply function to.
@retur... | java | public static <T, R> R firstNonNull(Function<T, R> function, T[] values) {
return values == null ? null : firstNonNull(function, Stream.of(values));
} | [
"public",
"static",
"<",
"T",
",",
"R",
">",
"R",
"firstNonNull",
"(",
"Function",
"<",
"T",
",",
"R",
">",
"function",
",",
"T",
"[",
"]",
"values",
")",
"{",
"return",
"values",
"==",
"null",
"?",
"null",
":",
"firstNonNull",
"(",
"function",
","... | Gets first result of function which is not null.
@param <T> type of values.
@param <R> element to return.
@param function function to apply to each value.
@param values all possible values to apply function to.
@return first result which was not null,
OR <code>null</code> if either result for all values wa... | [
"Gets",
"first",
"result",
"of",
"function",
"which",
"is",
"not",
"null",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/FirstNonNullHelper.java#L36-L38 |
OpenTSDB/opentsdb | src/tools/CliUtils.java | CliUtils.fromBytes | static String fromBytes(final byte[] b) {
"""
Invokces the reflected {@code UnqieuiId.fromBytes()} method with the given
byte array using the UniqueId character set.
@param b The byte array to convert to a string
@return The string
@throws RuntimeException if reflection failed
"""
try {
return (S... | java | static String fromBytes(final byte[] b) {
try {
return (String) fromBytes.invoke(null, b);
} catch (Exception e) {
throw new RuntimeException("fromBytes=" + fromBytes, e);
}
} | [
"static",
"String",
"fromBytes",
"(",
"final",
"byte",
"[",
"]",
"b",
")",
"{",
"try",
"{",
"return",
"(",
"String",
")",
"fromBytes",
".",
"invoke",
"(",
"null",
",",
"b",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
... | Invokces the reflected {@code UnqieuiId.fromBytes()} method with the given
byte array using the UniqueId character set.
@param b The byte array to convert to a string
@return The string
@throws RuntimeException if reflection failed | [
"Invokces",
"the",
"reflected",
"{"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/CliUtils.java#L260-L266 |
spring-projects/spring-social | spring-social-core/src/main/java/org/springframework/social/support/URIBuilder.java | URIBuilder.queryParam | public URIBuilder queryParam(String name, String value) {
"""
Adds a query parameter to the URI
@param name the parameter name
@param value the parameter value
@return the URIBuilder
"""
parameters.add(name, value);
return this;
} | java | public URIBuilder queryParam(String name, String value) {
parameters.add(name, value);
return this;
} | [
"public",
"URIBuilder",
"queryParam",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"parameters",
".",
"add",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds a query parameter to the URI
@param name the parameter name
@param value the parameter value
@return the URIBuilder | [
"Adds",
"a",
"query",
"parameter",
"to",
"the",
"URI"
] | train | https://github.com/spring-projects/spring-social/blob/e41cfecb288022b83c79413b58f52511c3c9d4fc/spring-social-core/src/main/java/org/springframework/social/support/URIBuilder.java#L69-L72 |
killbill/killbill | payment/src/main/java/org/killbill/billing/payment/core/PaymentRefresher.java | PaymentRefresher.toPayment | private Payment toPayment(final PaymentModelDao paymentModelDao, final boolean withPluginInfo, final boolean withAttempts, final Iterable<PluginProperty> properties, final TenantContext context, final InternalTenantContext tenantContext) throws PaymentApiException {
"""
Used in single get APIs (getPayment / getPay... | java | private Payment toPayment(final PaymentModelDao paymentModelDao, final boolean withPluginInfo, final boolean withAttempts, final Iterable<PluginProperty> properties, final TenantContext context, final InternalTenantContext tenantContext) throws PaymentApiException {
final PaymentPluginApi plugin = getPaymentPro... | [
"private",
"Payment",
"toPayment",
"(",
"final",
"PaymentModelDao",
"paymentModelDao",
",",
"final",
"boolean",
"withPluginInfo",
",",
"final",
"boolean",
"withAttempts",
",",
"final",
"Iterable",
"<",
"PluginProperty",
">",
"properties",
",",
"final",
"TenantContext"... | Used in single get APIs (getPayment / getPaymentByExternalKey) | [
"Used",
"in",
"single",
"get",
"APIs",
"(",
"getPayment",
"/",
"getPaymentByExternalKey",
")"
] | train | https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/payment/src/main/java/org/killbill/billing/payment/core/PaymentRefresher.java#L388-L393 |
Stratio/stratio-connector-commons | connector-commons/src/main/java/com/stratio/connector/commons/metadata/IndexMetadataBuilder.java | IndexMetadataBuilder.withOptions | @TimerJ
public IndexMetadataBuilder withOptions(Map<Selector, Selector> opts) {
"""
Set the options. Any options previously created are removed.
@param opts the opts
@return the index metadata builder
"""
options = new HashMap<Selector, Selector>(opts);
return this;
} | java | @TimerJ
public IndexMetadataBuilder withOptions(Map<Selector, Selector> opts) {
options = new HashMap<Selector, Selector>(opts);
return this;
} | [
"@",
"TimerJ",
"public",
"IndexMetadataBuilder",
"withOptions",
"(",
"Map",
"<",
"Selector",
",",
"Selector",
">",
"opts",
")",
"{",
"options",
"=",
"new",
"HashMap",
"<",
"Selector",
",",
"Selector",
">",
"(",
"opts",
")",
";",
"return",
"this",
";",
"}... | Set the options. Any options previously created are removed.
@param opts the opts
@return the index metadata builder | [
"Set",
"the",
"options",
".",
"Any",
"options",
"previously",
"created",
"are",
"removed",
"."
] | train | https://github.com/Stratio/stratio-connector-commons/blob/d7cc66cb9591344a13055962e87a91f01c3707d1/connector-commons/src/main/java/com/stratio/connector/commons/metadata/IndexMetadataBuilder.java#L92-L96 |
threerings/nenya | core/src/main/java/com/threerings/chat/ChatLogic.java | ChatLogic.getSubtitleShape | public Shape getSubtitleShape (int type, Rectangle r, Rectangle b) {
"""
Get the appropriate shape for the specified type of chat.
@param r the rectangle bounding the chat label.
@param b the rectangle bounding the chat label and icon.
"""
int placeType = placeOf(type);
switch (placeType) {... | java | public Shape getSubtitleShape (int type, Rectangle r, Rectangle b)
{
int placeType = placeOf(type);
switch (placeType) {
case SPECIALIZED:
case PLACE:
return getPlaceSubtitleShape(type, r);
case TELL: {
// lightning box!
int halfy = r.y + ... | [
"public",
"Shape",
"getSubtitleShape",
"(",
"int",
"type",
",",
"Rectangle",
"r",
",",
"Rectangle",
"b",
")",
"{",
"int",
"placeType",
"=",
"placeOf",
"(",
"type",
")",
";",
"switch",
"(",
"placeType",
")",
"{",
"case",
"SPECIALIZED",
":",
"case",
"PLACE... | Get the appropriate shape for the specified type of chat.
@param r the rectangle bounding the chat label.
@param b the rectangle bounding the chat label and icon. | [
"Get",
"the",
"appropriate",
"shape",
"for",
"the",
"specified",
"type",
"of",
"chat",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/ChatLogic.java#L195-L253 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/AssetRendition.java | AssetRendition.getDimensionFromImageBinary | private static @Nullable Dimension getDimensionFromImageBinary(@NotNull Rendition rendition,
boolean suppressLogWarningNoRenditionsMetadata) {
"""
Fallback: Read dimension by loading image binary into memory.
@param rendition Rendition
@param suppressLogWarningNoRenditionsMetadata If set to true, no log wa... | java | private static @Nullable Dimension getDimensionFromImageBinary(@NotNull Rendition rendition,
boolean suppressLogWarningNoRenditionsMetadata) {
try (InputStream is = rendition.getStream()) {
if (is != null) {
if (!suppressLogWarningNoRenditionsMetadata) {
log.warn("Unable to detect rend... | [
"private",
"static",
"@",
"Nullable",
"Dimension",
"getDimensionFromImageBinary",
"(",
"@",
"NotNull",
"Rendition",
"rendition",
",",
"boolean",
"suppressLogWarningNoRenditionsMetadata",
")",
"{",
"try",
"(",
"InputStream",
"is",
"=",
"rendition",
".",
"getStream",
"(... | Fallback: Read dimension by loading image binary into memory.
@param rendition Rendition
@param suppressLogWarningNoRenditionsMetadata If set to true, no log warnings is generated when
renditions metadata containing the with/height of the rendition does not exist (yet).
@return Dimension or null | [
"Fallback",
":",
"Read",
"dimension",
"by",
"loading",
"image",
"binary",
"into",
"memory",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/AssetRendition.java#L178-L201 |
kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/gateway/GatewayManagementBeanImpl.java | GatewayManagementBeanImpl.doFilterWriteListeners | @Override
public void doFilterWriteListeners(final long sessionId, final long sessionWrittenBytes, final WriteRequest writeRequest) {
"""
Notify the management listeners on a filterWrite.
<p/>
NOTE: this starts on the IO thread, but runs a task OFF the thread.
"""
runManagementTask(new Runnable()... | java | @Override
public void doFilterWriteListeners(final long sessionId, final long sessionWrittenBytes, final WriteRequest writeRequest) {
runManagementTask(new Runnable() {
@Override
public void run() {
try {
// The particular management listeners chan... | [
"@",
"Override",
"public",
"void",
"doFilterWriteListeners",
"(",
"final",
"long",
"sessionId",
",",
"final",
"long",
"sessionWrittenBytes",
",",
"final",
"WriteRequest",
"writeRequest",
")",
"{",
"runManagementTask",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
... | Notify the management listeners on a filterWrite.
<p/>
NOTE: this starts on the IO thread, but runs a task OFF the thread. | [
"Notify",
"the",
"management",
"listeners",
"on",
"a",
"filterWrite",
".",
"<p",
"/",
">",
"NOTE",
":",
"this",
"starts",
"on",
"the",
"IO",
"thread",
"but",
"runs",
"a",
"task",
"OFF",
"the",
"thread",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/gateway/GatewayManagementBeanImpl.java#L529-L546 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.dedicatedCloud_serviceName_upgradeRessource_duration_POST | public OvhOrder dedicatedCloud_serviceName_upgradeRessource_duration_POST(String serviceName, String duration, OvhUpgradeTypeEnum upgradeType, Long upgradedRessourceId, OvhUpgradeRessourceTypeEnum upgradedRessourceType) throws IOException {
"""
Create order
REST: POST /order/dedicatedCloud/{serviceName}/upgrade... | java | public OvhOrder dedicatedCloud_serviceName_upgradeRessource_duration_POST(String serviceName, String duration, OvhUpgradeTypeEnum upgradeType, Long upgradedRessourceId, OvhUpgradeRessourceTypeEnum upgradedRessourceType) throws IOException {
String qPath = "/order/dedicatedCloud/{serviceName}/upgradeRessource/{duratio... | [
"public",
"OvhOrder",
"dedicatedCloud_serviceName_upgradeRessource_duration_POST",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"OvhUpgradeTypeEnum",
"upgradeType",
",",
"Long",
"upgradedRessourceId",
",",
"OvhUpgradeRessourceTypeEnum",
"upgradedRessourceType",
"... | Create order
REST: POST /order/dedicatedCloud/{serviceName}/upgradeRessource/{duration}
@param upgradedRessourceType [required] The type of ressource you want to upgrade.
@param upgradedRessourceId [required] The id of a particular ressource you want to upgrade in your Private Cloud (useless for "all" UpgradeRessource... | [
"Create",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L5775-L5784 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/CcgParserUtils.java | CcgParserUtils.isPossibleExample | public static boolean isPossibleExample(CcgParser parser, CcgExample example) {
"""
Returns {@code true} if {@code parser} can reproduce the
syntactic tree in {@code example}.
@param parser
@param example
@return
"""
CcgBeamSearchChart chart = new CcgBeamSearchChart(example.getSentence(), Integer.MAX... | java | public static boolean isPossibleExample(CcgParser parser, CcgExample example) {
CcgBeamSearchChart chart = new CcgBeamSearchChart(example.getSentence(), Integer.MAX_VALUE, 100);
SyntacticChartCost filter = SyntacticChartCost.createAgreementCost(example.getSyntacticParse());
parser.parseCommon(chart, example... | [
"public",
"static",
"boolean",
"isPossibleExample",
"(",
"CcgParser",
"parser",
",",
"CcgExample",
"example",
")",
"{",
"CcgBeamSearchChart",
"chart",
"=",
"new",
"CcgBeamSearchChart",
"(",
"example",
".",
"getSentence",
"(",
")",
",",
"Integer",
".",
"MAX_VALUE",... | Returns {@code true} if {@code parser} can reproduce the
syntactic tree in {@code example}.
@param parser
@param example
@return | [
"Returns",
"{",
"@code",
"true",
"}",
"if",
"{",
"@code",
"parser",
"}",
"can",
"reproduce",
"the",
"syntactic",
"tree",
"in",
"{",
"@code",
"example",
"}",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/CcgParserUtils.java#L59-L74 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/TaskTracker.java | TaskTracker.shuffleError | public synchronized void shuffleError(TaskAttemptID taskId, String message)
throws IOException {
"""
A reduce-task failed to shuffle the map-outputs. Kill the task.
"""
LOG.fatal("Task: " + taskId + " - Killed due to Shuffle Failure: " + message);
TaskInProgress tip = runningTasks.get(taskId);
if... | java | public synchronized void shuffleError(TaskAttemptID taskId, String message)
throws IOException {
LOG.fatal("Task: " + taskId + " - Killed due to Shuffle Failure: " + message);
TaskInProgress tip = runningTasks.get(taskId);
if (tip != null) {
tip.reportDiagnosticInfo("Shuffle Error: " + message);
... | [
"public",
"synchronized",
"void",
"shuffleError",
"(",
"TaskAttemptID",
"taskId",
",",
"String",
"message",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"fatal",
"(",
"\"Task: \"",
"+",
"taskId",
"+",
"\" - Killed due to Shuffle Failure: \"",
"+",
"message",
")",
... | A reduce-task failed to shuffle the map-outputs. Kill the task. | [
"A",
"reduce",
"-",
"task",
"failed",
"to",
"shuffle",
"the",
"map",
"-",
"outputs",
".",
"Kill",
"the",
"task",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L3698-L3706 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/commands/PackageProcessor.java | PackageProcessor.buildManifestForIncludeHasRunnable | protected File buildManifestForIncludeHasRunnable(File installationManifest) throws IOException {
"""
Create a proper manifest file for the --include=execute option. The manifest is a copy
of the given installation manifest, with the following edits:
Change
from:
Main-Class: wlp.lib.extract.SelfExtract
to:
... | java | protected File buildManifestForIncludeHasRunnable(File installationManifest) throws IOException {
Manifest mf = new Manifest();
mf.read(new FileInputStream(installationManifest));
mf.getMainAttributes().remove(new Attributes.Name("License-Agreement"));
mf.getMainAttributes().remove(new ... | [
"protected",
"File",
"buildManifestForIncludeHasRunnable",
"(",
"File",
"installationManifest",
")",
"throws",
"IOException",
"{",
"Manifest",
"mf",
"=",
"new",
"Manifest",
"(",
")",
";",
"mf",
".",
"read",
"(",
"new",
"FileInputStream",
"(",
"installationManifest",... | Create a proper manifest file for the --include=execute option. The manifest is a copy
of the given installation manifest, with the following edits:
Change
from:
Main-Class: wlp.lib.extract.SelfExtract
to:
Main-Class: wlp.lib.extract.SelfExtractRun
add:
Server-Name: <processName>
@return the manifest file | [
"Create",
"a",
"proper",
"manifest",
"file",
"for",
"the",
"--",
"include",
"=",
"execute",
"option",
".",
"The",
"manifest",
"is",
"a",
"copy",
"of",
"the",
"given",
"installation",
"manifest",
"with",
"the",
"following",
"edits",
":"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/commands/PackageProcessor.java#L162-L175 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java | HadoopUtils.sanitizePath | public static Path sanitizePath(Path path, String substitute) {
"""
Remove illegal HDFS path characters from the given path. Illegal characters will be replaced
with the given substitute.
"""
return new Path(sanitizePath(path.toString(), substitute));
} | java | public static Path sanitizePath(Path path, String substitute) {
return new Path(sanitizePath(path.toString(), substitute));
} | [
"public",
"static",
"Path",
"sanitizePath",
"(",
"Path",
"path",
",",
"String",
"substitute",
")",
"{",
"return",
"new",
"Path",
"(",
"sanitizePath",
"(",
"path",
".",
"toString",
"(",
")",
",",
"substitute",
")",
")",
";",
"}"
] | Remove illegal HDFS path characters from the given path. Illegal characters will be replaced
with the given substitute. | [
"Remove",
"illegal",
"HDFS",
"path",
"characters",
"from",
"the",
"given",
"path",
".",
"Illegal",
"characters",
"will",
"be",
"replaced",
"with",
"the",
"given",
"substitute",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L930-L932 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.createPartialMock | public static synchronized <T> T createPartialMock(Class<T> type, String methodNameToMock,
Class<?> firstArgumentType, Class<?>... additionalArgumentTypes) {
"""
Mock a single specific method. Use this to handle overloaded methods.
@param <T> ... | java | public static synchronized <T> T createPartialMock(Class<T> type, String methodNameToMock,
Class<?> firstArgumentType, Class<?>... additionalArgumentTypes) {
return doMockSpecific(type, new DefaultMockStrategy(), new String[]{methodNameToMock}, null,
... | [
"public",
"static",
"synchronized",
"<",
"T",
">",
"T",
"createPartialMock",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"methodNameToMock",
",",
"Class",
"<",
"?",
">",
"firstArgumentType",
",",
"Class",
"<",
"?",
">",
"...",
"additionalArgumentType... | Mock a single specific method. Use this to handle overloaded methods.
@param <T> The type of the mock.
@param type The type that'll be used to create a mock instance.
@param methodNameToMock The name of the method to mock
@param firstArgumentType The type of the firs... | [
"Mock",
"a",
"single",
"specific",
"method",
".",
"Use",
"this",
"to",
"handle",
"overloaded",
"methods",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L467-L471 |
esigate/esigate | esigate-core/src/main/java/org/esigate/http/ProxyingHttpClientBuilder.java | ProxyingHttpClientBuilder.addFetchEvent | private ClientExecChain addFetchEvent(final ClientExecChain wrapped) {
"""
Decorate with fetch event managements
@param wrapped
@return the decorated ClientExecChain
"""
return new ClientExecChain() {
@Override
public CloseableHttpResponse execute(HttpRoute route, HttpReque... | java | private ClientExecChain addFetchEvent(final ClientExecChain wrapped) {
return new ClientExecChain() {
@Override
public CloseableHttpResponse execute(HttpRoute route, HttpRequestWrapper request,
HttpClientContext httpClientContext, HttpExecutionAware execAware) throws... | [
"private",
"ClientExecChain",
"addFetchEvent",
"(",
"final",
"ClientExecChain",
"wrapped",
")",
"{",
"return",
"new",
"ClientExecChain",
"(",
")",
"{",
"@",
"Override",
"public",
"CloseableHttpResponse",
"execute",
"(",
"HttpRoute",
"route",
",",
"HttpRequestWrapper",... | Decorate with fetch event managements
@param wrapped
@return the decorated ClientExecChain | [
"Decorate",
"with",
"fetch",
"event",
"managements"
] | train | https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/http/ProxyingHttpClientBuilder.java#L84-L122 |
alibaba/jstorm | jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/spout/FileLock.java | FileLock.acquireOldestExpiredLock | public static FileLock acquireOldestExpiredLock(FileSystem fs, Path lockFilesDir, int locktimeoutSec, String spoutId)
throws IOException {
"""
Finds a oldest expired lock file (using modification timestamp), then takes
ownership of the lock file
Impt: Assumes access to lockFilesDir has been externally ... | java | public static FileLock acquireOldestExpiredLock(FileSystem fs, Path lockFilesDir, int locktimeoutSec, String spoutId)
throws IOException {
// list files
long now = System.currentTimeMillis();
long olderThan = now - (locktimeoutSec*1000);
Collection<Path> listing = HdfsUtils.listFilesByModifica... | [
"public",
"static",
"FileLock",
"acquireOldestExpiredLock",
"(",
"FileSystem",
"fs",
",",
"Path",
"lockFilesDir",
",",
"int",
"locktimeoutSec",
",",
"String",
"spoutId",
")",
"throws",
"IOException",
"{",
"// list files",
"long",
"now",
"=",
"System",
".",
"curren... | Finds a oldest expired lock file (using modification timestamp), then takes
ownership of the lock file
Impt: Assumes access to lockFilesDir has been externally synchronized such that
only one thread accessing the same thread
@param fs
@param lockFilesDir
@param locktimeoutSec
@return | [
"Finds",
"a",
"oldest",
"expired",
"lock",
"file",
"(",
"using",
"modification",
"timestamp",
")",
"then",
"takes",
"ownership",
"of",
"the",
"lock",
"file",
"Impt",
":",
"Assumes",
"access",
"to",
"lockFilesDir",
"has",
"been",
"externally",
"synchronized",
"... | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/spout/FileLock.java#L225-L249 |
gliga/ekstazi | org.ekstazi.core/src/main/java/org/ekstazi/util/FileUtil.java | FileUtil.readFile | public static byte[] readFile(File file) throws IOException {
"""
Loads bytes of the given file.
@return Bytes of the given file.
"""
// Open file
RandomAccessFile f = new RandomAccessFile(file, "r");
try {
// Get and check length
long longlength = f.length();... | java | public static byte[] readFile(File file) throws IOException {
// Open file
RandomAccessFile f = new RandomAccessFile(file, "r");
try {
// Get and check length
long longlength = f.length();
int length = (int) longlength;
if (length != longlength) {
... | [
"public",
"static",
"byte",
"[",
"]",
"readFile",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"// Open file",
"RandomAccessFile",
"f",
"=",
"new",
"RandomAccessFile",
"(",
"file",
",",
"\"r\"",
")",
";",
"try",
"{",
"// Get and check length",
"long... | Loads bytes of the given file.
@return Bytes of the given file. | [
"Loads",
"bytes",
"of",
"the",
"given",
"file",
"."
] | train | https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/util/FileUtil.java#L54-L72 |
m-m-m/util | nls/src/main/java/net/sf/mmm/util/nls/impl/AbstractResourceBundleNlsTemplateResolver.java | AbstractResourceBundleNlsTemplateResolver.resolveTemplate | @Deprecated
public NlsTemplate resolveTemplate(String internationalizedMessage, NlsReversedResourceBundle... bundles) {
"""
This method {@link #resolveTemplate(String) resolves} the {@link NlsTemplate} from the given array of
{@link NlsReversedResourceBundle bundles}.
@param internationalizedMessage is the m... | java | @Deprecated
public NlsTemplate resolveTemplate(String internationalizedMessage, NlsReversedResourceBundle... bundles) {
NlsTemplate result = null;
for (NlsReversedResourceBundle bundle : bundles) {
result = resolveTemplate(bundle, internationalizedMessage);
if (result != null) {
break;
... | [
"@",
"Deprecated",
"public",
"NlsTemplate",
"resolveTemplate",
"(",
"String",
"internationalizedMessage",
",",
"NlsReversedResourceBundle",
"...",
"bundles",
")",
"{",
"NlsTemplate",
"result",
"=",
"null",
";",
"for",
"(",
"NlsReversedResourceBundle",
"bundle",
":",
"... | This method {@link #resolveTemplate(String) resolves} the {@link NlsTemplate} from the given array of
{@link NlsReversedResourceBundle bundles}.
@param internationalizedMessage is the message for which the {@link NlsTemplate} is required.
@param bundles are the {@link NlsReversedResourceBundle reversed bundles} that p... | [
"This",
"method",
"{",
"@link",
"#resolveTemplate",
"(",
"String",
")",
"resolves",
"}",
"the",
"{",
"@link",
"NlsTemplate",
"}",
"from",
"the",
"given",
"array",
"of",
"{",
"@link",
"NlsReversedResourceBundle",
"bundles",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/nls/src/main/java/net/sf/mmm/util/nls/impl/AbstractResourceBundleNlsTemplateResolver.java#L69-L80 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/filters/DateSearcher.java | DateSearcher.addTerm | @Override
public void addTerm(FilterTerm.Operator op, DB.DateTime date) throws IllegalStateException {
"""
Adds comparison term. Only specified {@link com.versionone.apiclient.FilterTerm.Operator} supported:
<ul>
<li>GreaterThan
<li>GreaterThanOrEqual
<li>LessThan
<li>LessThanOrEqual
<li>equal
</ul>
... | java | @Override
public void addTerm(FilterTerm.Operator op, DB.DateTime date) throws IllegalStateException {
final GregorianCalendar cal = new GregorianCalendar();
cal.setTime(date.getValue());
cal.set(MILLISECOND, 0);
switch (op) {
case GreaterThan:
cal.add(Cal... | [
"@",
"Override",
"public",
"void",
"addTerm",
"(",
"FilterTerm",
".",
"Operator",
"op",
",",
"DB",
".",
"DateTime",
"date",
")",
"throws",
"IllegalStateException",
"{",
"final",
"GregorianCalendar",
"cal",
"=",
"new",
"GregorianCalendar",
"(",
")",
";",
"cal",... | Adds comparison term. Only specified {@link com.versionone.apiclient.FilterTerm.Operator} supported:
<ul>
<li>GreaterThan
<li>GreaterThanOrEqual
<li>LessThan
<li>LessThanOrEqual
<li>equal
</ul>
@param op comparison operator.
@param date value to compare with.
@throws IllegalStateException if wrong operator or wrong ... | [
"Adds",
"comparison",
"term",
".",
"Only",
"specified",
"{",
"@link",
"com",
".",
"versionone",
".",
"apiclient",
".",
"FilterTerm",
".",
"Operator",
"}",
"supported",
":",
"<ul",
">",
"<li",
">",
"GreaterThan",
"<li",
">",
"GreaterThanOrEqual",
"<li",
">",
... | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/filters/DateSearcher.java#L39-L67 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerLoadBalancingRulesInner.java | LoadBalancerLoadBalancingRulesInner.getAsync | public Observable<LoadBalancingRuleInner> getAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) {
"""
Gets the specified load balancer load balancing rule.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@param... | java | public Observable<LoadBalancingRuleInner> getAsync(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) {
return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName).map(new Func1<ServiceResponse<LoadBalancingRuleInner>, LoadBalancingRuleInner>() {
... | [
"public",
"Observable",
"<",
"LoadBalancingRuleInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"loadBalancerName",
",",
"String",
"loadBalancingRuleName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"loadBa... | Gets the specified load balancer load balancing rule.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@param loadBalancingRuleName The name of the load balancing rule.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the o... | [
"Gets",
"the",
"specified",
"load",
"balancer",
"load",
"balancing",
"rule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/LoadBalancerLoadBalancingRulesInner.java#L233-L240 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.updateStorageAccountAsync | public Observable<StorageBundle> updateStorageAccountAsync(String vaultBaseUrl, String storageAccountName) {
"""
Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission.
@param vaultBaseUrl The vault name, for example https://myvault.... | java | public Observable<StorageBundle> updateStorageAccountAsync(String vaultBaseUrl, String storageAccountName) {
return updateStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).map(new Func1<ServiceResponse<StorageBundle>, StorageBundle>() {
@Override
public StorageBund... | [
"public",
"Observable",
"<",
"StorageBundle",
">",
"updateStorageAccountAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
")",
"{",
"return",
"updateStorageAccountWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"storageAccountName",
")",
".",
... | Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName The name of the storage account.
@throws IllegalArgumentException thrown if p... | [
"Updates",
"the",
"specified",
"attributes",
"associated",
"with",
"the",
"given",
"storage",
"account",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"set",
"/",
"update",
"permission",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L10118-L10125 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageDrawing.java | ImageDrawing.drawRoundedCorners | public static void drawRoundedCorners(Bitmap src, Bitmap dest, int radius) {
"""
Drawing src bitmap to dest bitmap with rounded corners
@param src source bitmap
@param dest destination bitmap
@param radius radius in destination bitmap scale
"""
drawRoundedCorners(src, dest, radius, CLEAR_COLO... | java | public static void drawRoundedCorners(Bitmap src, Bitmap dest, int radius) {
drawRoundedCorners(src, dest, radius, CLEAR_COLOR);
} | [
"public",
"static",
"void",
"drawRoundedCorners",
"(",
"Bitmap",
"src",
",",
"Bitmap",
"dest",
",",
"int",
"radius",
")",
"{",
"drawRoundedCorners",
"(",
"src",
",",
"dest",
",",
"radius",
",",
"CLEAR_COLOR",
")",
";",
"}"
] | Drawing src bitmap to dest bitmap with rounded corners
@param src source bitmap
@param dest destination bitmap
@param radius radius in destination bitmap scale | [
"Drawing",
"src",
"bitmap",
"to",
"dest",
"bitmap",
"with",
"rounded",
"corners"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageDrawing.java#L109-L111 |
casbin/jcasbin | src/main/java/org/casbin/jcasbin/main/ManagementEnforcer.java | ManagementEnforcer.addNamedGroupingPolicy | public boolean addNamedGroupingPolicy(String ptype, List<String> params) {
"""
addNamedGroupingPolicy adds a named role inheritance rule to the current policy.
If the rule already exists, the function returns false and the rule will not be added.
Otherwise the function returns true by adding the new rule.
@pa... | java | public boolean addNamedGroupingPolicy(String ptype, List<String> params) {
boolean ruleAdded = addPolicy("g", ptype, params);
if (autoBuildRoleLinks) {
buildRoleLinks();
}
return ruleAdded;
} | [
"public",
"boolean",
"addNamedGroupingPolicy",
"(",
"String",
"ptype",
",",
"List",
"<",
"String",
">",
"params",
")",
"{",
"boolean",
"ruleAdded",
"=",
"addPolicy",
"(",
"\"g\"",
",",
"ptype",
",",
"params",
")",
";",
"if",
"(",
"autoBuildRoleLinks",
")",
... | addNamedGroupingPolicy adds a named role inheritance rule to the current policy.
If the rule already exists, the function returns false and the rule will not be added.
Otherwise the function returns true by adding the new rule.
@param ptype the policy type, can be "g", "g2", "g3", ..
@param params the "g" policy rule.... | [
"addNamedGroupingPolicy",
"adds",
"a",
"named",
"role",
"inheritance",
"rule",
"to",
"the",
"current",
"policy",
".",
"If",
"the",
"rule",
"already",
"exists",
"the",
"function",
"returns",
"false",
"and",
"the",
"rule",
"will",
"not",
"be",
"added",
".",
"O... | train | https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/main/ManagementEnforcer.java#L448-L455 |
alkacon/opencms-core | src/org/opencms/util/CmsStringUtil.java | CmsStringUtil.isPrefixPath | public static boolean isPrefixPath(String firstPath, String secondPath) {
"""
Checks if the first path is a prefix of the second path.<p>
This method is different compared to {@link String#startsWith},
because it considers <code>/foo/bar</code> to
be a prefix path of <code>/foo/bar/baz</code>,
but not of <co... | java | public static boolean isPrefixPath(String firstPath, String secondPath) {
firstPath = CmsStringUtil.joinPaths(firstPath, "/");
secondPath = CmsStringUtil.joinPaths(secondPath, "/");
return secondPath.startsWith(firstPath);
} | [
"public",
"static",
"boolean",
"isPrefixPath",
"(",
"String",
"firstPath",
",",
"String",
"secondPath",
")",
"{",
"firstPath",
"=",
"CmsStringUtil",
".",
"joinPaths",
"(",
"firstPath",
",",
"\"/\"",
")",
";",
"secondPath",
"=",
"CmsStringUtil",
".",
"joinPaths",... | Checks if the first path is a prefix of the second path.<p>
This method is different compared to {@link String#startsWith},
because it considers <code>/foo/bar</code> to
be a prefix path of <code>/foo/bar/baz</code>,
but not of <code>/foo/bar42</code>.
<b>Directly exposed for JSP EL</b>, not through {@link org.opencm... | [
"Checks",
"if",
"the",
"first",
"path",
"is",
"a",
"prefix",
"of",
"the",
"second",
"path",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsStringUtil.java#L1099-L1104 |
xcesco/kripton | kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/SQLiteUpdateTaskHelper.java | SQLiteUpdateTaskHelper.executeSQL | public static void executeSQL(final SQLiteDatabase database, InputStream fileInputStream) {
"""
Execute SQL.
@param database
the database
@param fileInputStream
the file input stream
"""
List<String> commands = readSQLFromFile(fileInputStream);
executeSQL(database, commands);
} | java | public static void executeSQL(final SQLiteDatabase database, InputStream fileInputStream) {
List<String> commands = readSQLFromFile(fileInputStream);
executeSQL(database, commands);
} | [
"public",
"static",
"void",
"executeSQL",
"(",
"final",
"SQLiteDatabase",
"database",
",",
"InputStream",
"fileInputStream",
")",
"{",
"List",
"<",
"String",
">",
"commands",
"=",
"readSQLFromFile",
"(",
"fileInputStream",
")",
";",
"executeSQL",
"(",
"database",
... | Execute SQL.
@param database
the database
@param fileInputStream
the file input stream | [
"Execute",
"SQL",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/SQLiteUpdateTaskHelper.java#L289-L292 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/atomic/AtomicReferenceArray.java | AtomicReferenceArray.getAndUpdate | public final E getAndUpdate(int i, UnaryOperator<E> updateFunction) {
"""
Atomically updates the element at index {@code i} with the results
of applying the given function, returning the previous value. The
function should be side-effect-free, since it may be re-applied
when attempted updates fail due to conten... | java | public final E getAndUpdate(int i, UnaryOperator<E> updateFunction) {
// long offset = checkedByteOffset(i);
E prev, next;
do {
prev = get(i);
next = updateFunction.apply(prev);
} while (!compareAndSet(i, prev, next));
return prev;
} | [
"public",
"final",
"E",
"getAndUpdate",
"(",
"int",
"i",
",",
"UnaryOperator",
"<",
"E",
">",
"updateFunction",
")",
"{",
"// long offset = checkedByteOffset(i);",
"E",
"prev",
",",
"next",
";",
"do",
"{",
"prev",
"=",
"get",
"(",
"i",
")",
";",
"next",
... | Atomically updates the element at index {@code i} with the results
of applying the given function, returning the previous value. The
function should be side-effect-free, since it may be re-applied
when attempted updates fail due to contention among threads.
@param i the index
@param updateFunction a side-effect-free f... | [
"Atomically",
"updates",
"the",
"element",
"at",
"index",
"{",
"@code",
"i",
"}",
"with",
"the",
"results",
"of",
"applying",
"the",
"given",
"function",
"returning",
"the",
"previous",
"value",
".",
"The",
"function",
"should",
"be",
"side",
"-",
"effect",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/atomic/AtomicReferenceArray.java#L243-L251 |
WileyLabs/teasy | src/main/java/com/wiley/driver/factory/RemoteDriverFactory.java | RemoteDriverFactory.tuneDriver | private RemoteWebDriver tuneDriver(RemoteWebDriver driver, String name) {
"""
Final tuning for a driver
<p>
Setting a file detector for a driver
and setting a driver name to SeleniumHolder
@param driver - instance of a RemoteWebDriver
@param name - driver name
@return driver with LocalFileDetector as a f... | java | private RemoteWebDriver tuneDriver(RemoteWebDriver driver, String name) {
DriverHolder.setDriverName(name);
driver.setFileDetector(new LocalFileDetector());
return driver;
} | [
"private",
"RemoteWebDriver",
"tuneDriver",
"(",
"RemoteWebDriver",
"driver",
",",
"String",
"name",
")",
"{",
"DriverHolder",
".",
"setDriverName",
"(",
"name",
")",
";",
"driver",
".",
"setFileDetector",
"(",
"new",
"LocalFileDetector",
"(",
")",
")",
";",
"... | Final tuning for a driver
<p>
Setting a file detector for a driver
and setting a driver name to SeleniumHolder
@param driver - instance of a RemoteWebDriver
@param name - driver name
@return driver with LocalFileDetector as a fileDetector | [
"Final",
"tuning",
"for",
"a",
"driver",
"<p",
">",
"Setting",
"a",
"file",
"detector",
"for",
"a",
"driver",
"and",
"setting",
"a",
"driver",
"name",
"to",
"SeleniumHolder"
] | train | https://github.com/WileyLabs/teasy/blob/94489ac8e6a6680b52dfa6cdbc9d8535333bef42/src/main/java/com/wiley/driver/factory/RemoteDriverFactory.java#L184-L188 |
elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/distance/ReferenceBasedOutlierDetection.java | ReferenceBasedOutlierDetection.computeDistanceVector | protected DoubleDBIDList computeDistanceVector(NumberVector refPoint, Relation<? extends NumberVector> database, PrimitiveDistanceQuery<? super NumberVector> distFunc) {
"""
Computes for each object the distance to one reference point. (one
dimensional representation of the data set)
@param refPoint Reference ... | java | protected DoubleDBIDList computeDistanceVector(NumberVector refPoint, Relation<? extends NumberVector> database, PrimitiveDistanceQuery<? super NumberVector> distFunc) {
ModifiableDoubleDBIDList referenceDists = DBIDUtil.newDistanceDBIDList(database.size());
for(DBIDIter iditer = database.iterDBIDs(); iditer.va... | [
"protected",
"DoubleDBIDList",
"computeDistanceVector",
"(",
"NumberVector",
"refPoint",
",",
"Relation",
"<",
"?",
"extends",
"NumberVector",
">",
"database",
",",
"PrimitiveDistanceQuery",
"<",
"?",
"super",
"NumberVector",
">",
"distFunc",
")",
"{",
"ModifiableDoub... | Computes for each object the distance to one reference point. (one
dimensional representation of the data set)
@param refPoint Reference Point Feature Vector
@param database database to work on
@param distFunc Distance function to use
@return array containing the distance to one reference point for each
database objec... | [
"Computes",
"for",
"each",
"object",
"the",
"distance",
"to",
"one",
"reference",
"point",
".",
"(",
"one",
"dimensional",
"representation",
"of",
"the",
"data",
"set",
")"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/distance/ReferenceBasedOutlierDetection.java#L182-L189 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/main/StaticTraceInstrumentation.java | StaticTraceInstrumentation.processClassConfiguration | protected ClassConfigData processClassConfiguration(final InputStream inputStream) throws IOException {
"""
Introspect configuration information from the class in the provided
InputStream.
"""
if (introspectAnnotations == false) {
return new ClassConfigData(inputStream);
}
... | java | protected ClassConfigData processClassConfiguration(final InputStream inputStream) throws IOException {
if (introspectAnnotations == false) {
return new ClassConfigData(inputStream);
}
ClassReader cr = new ClassReader(inputStream);
ClassWriter cw = new ClassWriter(cr, 0); //... | [
"protected",
"ClassConfigData",
"processClassConfiguration",
"(",
"final",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"if",
"(",
"introspectAnnotations",
"==",
"false",
")",
"{",
"return",
"new",
"ClassConfigData",
"(",
"inputStream",
")",
";",
... | Introspect configuration information from the class in the provided
InputStream. | [
"Introspect",
"configuration",
"information",
"from",
"the",
"class",
"in",
"the",
"provided",
"InputStream",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/main/StaticTraceInstrumentation.java#L206-L219 |
VoltDB/voltdb | src/frontend/org/voltdb/PlannerStatsCollector.java | PlannerStatsCollector.updateStatsRow | @Override
protected void updateStatsRow(Object rowKey, Object rowValues[]) {
"""
Update the rowValues array with the latest statistical information.
This method is overrides the super class version
which must also be called so that it can update its columns.
@param values Values of each column of the row of... | java | @Override
protected void updateStatsRow(Object rowKey, Object rowValues[]) {
super.updateStatsRow(rowKey, rowValues);
rowValues[columnNameToIndex.get("PARTITION_ID")] = m_partitionId;
long totalTimedExecutionTime = m_totalPlanningTime;
long minExecutionTime = m_minPlanningTime;
... | [
"@",
"Override",
"protected",
"void",
"updateStatsRow",
"(",
"Object",
"rowKey",
",",
"Object",
"rowValues",
"[",
"]",
")",
"{",
"super",
".",
"updateStatsRow",
"(",
"rowKey",
",",
"rowValues",
")",
";",
"rowValues",
"[",
"columnNameToIndex",
".",
"get",
"("... | Update the rowValues array with the latest statistical information.
This method is overrides the super class version
which must also be called so that it can update its columns.
@param values Values of each column of the row of stats. Used as output. | [
"Update",
"the",
"rowValues",
"array",
"with",
"the",
"latest",
"statistical",
"information",
".",
"This",
"method",
"is",
"overrides",
"the",
"super",
"class",
"version",
"which",
"must",
"also",
"be",
"called",
"so",
"that",
"it",
"can",
"update",
"its",
"... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/PlannerStatsCollector.java#L244-L305 |
Wikidata/Wikidata-Toolkit | wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/StatementUpdate.java | StatementUpdate.getDatamodelObjectFromResponse | protected <T> T getDatamodelObjectFromResponse(JsonNode response, List<String> path, Class<T> targetClass) throws JsonProcessingException {
"""
Extracts a particular data model instance from a JSON response
returned by MediaWiki. The location is described by a list of successive
fields to use, from the root to t... | java | protected <T> T getDatamodelObjectFromResponse(JsonNode response, List<String> path, Class<T> targetClass) throws JsonProcessingException {
if(response == null) {
throw new JsonMappingException("The API response is null");
}
JsonNode currentNode = response;
for(String field : path) {
if (!currentNode.has(... | [
"protected",
"<",
"T",
">",
"T",
"getDatamodelObjectFromResponse",
"(",
"JsonNode",
"response",
",",
"List",
"<",
"String",
">",
"path",
",",
"Class",
"<",
"T",
">",
"targetClass",
")",
"throws",
"JsonProcessingException",
"{",
"if",
"(",
"response",
"==",
"... | Extracts a particular data model instance from a JSON response
returned by MediaWiki. The location is described by a list of successive
fields to use, from the root to the target object.
@param response
the API response as returned by MediaWiki
@param path
a list of fields from the root to the target object
@return
th... | [
"Extracts",
"a",
"particular",
"data",
"model",
"instance",
"from",
"a",
"JSON",
"response",
"returned",
"by",
"MediaWiki",
".",
"The",
"location",
"is",
"described",
"by",
"a",
"list",
"of",
"successive",
"fields",
"to",
"use",
"from",
"the",
"root",
"to",
... | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/StatementUpdate.java#L623-L635 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/mime/MimeTypeDeterminator.java | MimeTypeDeterminator.getMimeTypeFromBytes | @Nullable
public IMimeType getMimeTypeFromBytes (@Nullable final byte [] aBytes, @Nullable final IMimeType aDefault) {
"""
Try to determine the MIME type from the given byte array.
@param aBytes
The byte array to parse. May be <code>null</code> or empty.
@param aDefault
The default MIME type to be returned... | java | @Nullable
public IMimeType getMimeTypeFromBytes (@Nullable final byte [] aBytes, @Nullable final IMimeType aDefault)
{
if (aBytes == null || aBytes.length == 0)
return aDefault;
return m_aRWLock.readLocked ( () -> {
for (final MimeTypeContent aMTC : m_aMimeTypeContents)
if (aMTC.matches... | [
"@",
"Nullable",
"public",
"IMimeType",
"getMimeTypeFromBytes",
"(",
"@",
"Nullable",
"final",
"byte",
"[",
"]",
"aBytes",
",",
"@",
"Nullable",
"final",
"IMimeType",
"aDefault",
")",
"{",
"if",
"(",
"aBytes",
"==",
"null",
"||",
"aBytes",
".",
"length",
"... | Try to determine the MIME type from the given byte array.
@param aBytes
The byte array to parse. May be <code>null</code> or empty.
@param aDefault
The default MIME type to be returned, if no matching MIME type was
found. May be <code>null</code>.
@return The supplied default value, if no matching MIME type was found.... | [
"Try",
"to",
"determine",
"the",
"MIME",
"type",
"from",
"the",
"given",
"byte",
"array",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/mime/MimeTypeDeterminator.java#L233-L247 |
tango-controls/JTango | server/src/main/java/org/tango/server/events/EventTriggerFactory.java | EventTriggerFactory.createEventTrigger | public static IEventTrigger createEventTrigger(final EventType eventType, final AttributeImpl attribute)
throws DevFailed {
"""
Create an {@link IEventTrigger}
@param eventType The event type
@param attribute The attribute that will send events
@return the created EventTrigger object
@throws Dev... | java | public static IEventTrigger createEventTrigger(final EventType eventType, final AttributeImpl attribute)
throws DevFailed {
LOGGER.debug("create event trigger for attribute {} of type {}", attribute.getName(), eventType);
final EventProperties props = attribute.getProperties().getEventPro... | [
"public",
"static",
"IEventTrigger",
"createEventTrigger",
"(",
"final",
"EventType",
"eventType",
",",
"final",
"AttributeImpl",
"attribute",
")",
"throws",
"DevFailed",
"{",
"LOGGER",
".",
"debug",
"(",
"\"create event trigger for attribute {} of type {}\"",
",",
"attri... | Create an {@link IEventTrigger}
@param eventType The event type
@param attribute The attribute that will send events
@return the created EventTrigger object
@throws DevFailed | [
"Create",
"an",
"{",
"@link",
"IEventTrigger",
"}"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/events/EventTriggerFactory.java#L51-L86 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java | InstanceClient.setTagsInstance | @BetaApi
public final Operation setTagsInstance(ProjectZoneInstanceName instance, Tags tagsResource) {
"""
Sets network tags for the specified instance to the data included in the request.
<p>Sample code:
<pre><code>
try (InstanceClient instanceClient = InstanceClient.create()) {
ProjectZoneInstanceName ... | java | @BetaApi
public final Operation setTagsInstance(ProjectZoneInstanceName instance, Tags tagsResource) {
SetTagsInstanceHttpRequest request =
SetTagsInstanceHttpRequest.newBuilder()
.setInstance(instance == null ? null : instance.toString())
.setTagsResource(tagsResource)
... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"setTagsInstance",
"(",
"ProjectZoneInstanceName",
"instance",
",",
"Tags",
"tagsResource",
")",
"{",
"SetTagsInstanceHttpRequest",
"request",
"=",
"SetTagsInstanceHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setInstan... | Sets network tags for the specified instance to the data included in the request.
<p>Sample code:
<pre><code>
try (InstanceClient instanceClient = InstanceClient.create()) {
ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
Tags tagsResource = Tags.newBuilder().build(... | [
"Sets",
"network",
"tags",
"for",
"the",
"specified",
"instance",
"to",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java#L3132-L3141 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java | PropertiesUtil.extractSubset | public static Properties extractSubset(final Properties properties, final String prefix) {
"""
Extracts properties that start with or are equals to the specific prefix and returns them in a new Properties
object with the prefix removed.
@param properties The Properties to evaluate.
@param prefix The prefix to... | java | public static Properties extractSubset(final Properties properties, final String prefix) {
final Properties subset = new Properties();
if (prefix == null || prefix.length() == 0) {
return subset;
}
final String prefixToMatch = prefix.charAt(prefix.length() - 1) != '.' ? pre... | [
"public",
"static",
"Properties",
"extractSubset",
"(",
"final",
"Properties",
"properties",
",",
"final",
"String",
"prefix",
")",
"{",
"final",
"Properties",
"subset",
"=",
"new",
"Properties",
"(",
")",
";",
"if",
"(",
"prefix",
"==",
"null",
"||",
"prefi... | Extracts properties that start with or are equals to the specific prefix and returns them in a new Properties
object with the prefix removed.
@param properties The Properties to evaluate.
@param prefix The prefix to extract.
@return The subset of properties. | [
"Extracts",
"properties",
"that",
"start",
"with",
"or",
"are",
"equals",
"to",
"the",
"specific",
"prefix",
"and",
"returns",
"them",
"in",
"a",
"new",
"Properties",
"object",
"with",
"the",
"prefix",
"removed",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java#L288-L310 |
recommenders/rival | rival-recommend/src/main/java/net/recommenders/rival/recommend/frameworks/MultipleRecommendationRunner.java | MultipleRecommendationRunner.runRanksysRecommenders | public static void runRanksysRecommenders(final Set<String> paths, final Properties properties) {
"""
Runs Ranksys-based recommenders.
@param paths the input and output paths.
@param properties the properties.
"""
for (AbstractRunner<Long, Long> rec : instantiateRanksysRecommenders(paths, propertie... | java | public static void runRanksysRecommenders(final Set<String> paths, final Properties properties) {
for (AbstractRunner<Long, Long> rec : instantiateRanksysRecommenders(paths, properties)) {
RecommendationRunner.run(rec);
}
} | [
"public",
"static",
"void",
"runRanksysRecommenders",
"(",
"final",
"Set",
"<",
"String",
">",
"paths",
",",
"final",
"Properties",
"properties",
")",
"{",
"for",
"(",
"AbstractRunner",
"<",
"Long",
",",
"Long",
">",
"rec",
":",
"instantiateRanksysRecommenders",... | Runs Ranksys-based recommenders.
@param paths the input and output paths.
@param properties the properties. | [
"Runs",
"Ranksys",
"-",
"based",
"recommenders",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-recommend/src/main/java/net/recommenders/rival/recommend/frameworks/MultipleRecommendationRunner.java#L320-L324 |
offbynull/coroutines | instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/VariableTable.java | VariableTable.acquireExtra | public Variable acquireExtra(Type type) {
"""
Acquire a new variable for use when instrumenting some code within the method this {@link VariableTable} is for.
@param type type which variable is for
@return new variable
@throws NullPointerException if any argument is {@code null}
@throws IllegalArgumentExceptio... | java | public Variable acquireExtra(Type type) {
Validate.notNull(type);
Validate.isTrue(type.getSort() != Type.VOID);
Validate.isTrue(type.getSort() != Type.METHOD);
for (Variable var : extraVars) {
if (!var.used && var.type.equals(type)) {
// We don't want... | [
"public",
"Variable",
"acquireExtra",
"(",
"Type",
"type",
")",
"{",
"Validate",
".",
"notNull",
"(",
"type",
")",
";",
"Validate",
".",
"isTrue",
"(",
"type",
".",
"getSort",
"(",
")",
"!=",
"Type",
".",
"VOID",
")",
";",
"Validate",
".",
"isTrue",
... | Acquire a new variable for use when instrumenting some code within the method this {@link VariableTable} is for.
@param type type which variable is for
@return new variable
@throws NullPointerException if any argument is {@code null}
@throws IllegalArgumentException if {@code type} is of sort of {@link Type#VOID} or {@... | [
"Acquire",
"a",
"new",
"variable",
"for",
"use",
"when",
"instrumenting",
"some",
"code",
"within",
"the",
"method",
"this",
"{"
] | train | https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/VariableTable.java#L106-L129 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/concurrent/TimeUnit.java | TimeUnit.timedJoin | public void timedJoin(Thread thread, long timeout)
throws InterruptedException {
"""
Perform a timed <tt>Thread.join</tt> using this time unit.
This is a convenience method that converts time arguments into the
form required by the <tt>Thread.join</tt> method.
@param thread the thread to wait for
@par... | java | public void timedJoin(Thread thread, long timeout)
throws InterruptedException {
if (timeout > 0) {
long ms = toMillis(timeout);
int ns = excessNanos(timeout, ms);
thread.join(ms, ns);
}
} | [
"public",
"void",
"timedJoin",
"(",
"Thread",
"thread",
",",
"long",
"timeout",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"timeout",
">",
"0",
")",
"{",
"long",
"ms",
"=",
"toMillis",
"(",
"timeout",
")",
";",
"int",
"ns",
"=",
"excessNanos"... | Perform a timed <tt>Thread.join</tt> using this time unit.
This is a convenience method that converts time arguments into the
form required by the <tt>Thread.join</tt> method.
@param thread the thread to wait for
@param timeout the maximum time to wait
@throws InterruptedException if interrupted while waiting.
@see jav... | [
"Perform",
"a",
"timed",
"<tt",
">",
"Thread",
".",
"join<",
"/",
"tt",
">",
"using",
"this",
"time",
"unit",
".",
"This",
"is",
"a",
"convenience",
"method",
"that",
"converts",
"time",
"arguments",
"into",
"the",
"form",
"required",
"by",
"the",
"<tt",... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/concurrent/TimeUnit.java#L300-L307 |
zafarkhaja/jsemver | src/main/java/com/github/zafarkhaja/semver/Version.java | Version.forIntegers | public static Version forIntegers(int major, int minor, int patch) {
"""
Creates a new instance of {@code Version}
for the specified version numbers.
@param major the major version number
@param minor the minor version number
@param patch the patch version number
@return a new instance of the {@code Version... | java | public static Version forIntegers(int major, int minor, int patch) {
return new Version(new NormalVersion(major, minor, patch));
} | [
"public",
"static",
"Version",
"forIntegers",
"(",
"int",
"major",
",",
"int",
"minor",
",",
"int",
"patch",
")",
"{",
"return",
"new",
"Version",
"(",
"new",
"NormalVersion",
"(",
"major",
",",
"minor",
",",
"patch",
")",
")",
";",
"}"
] | Creates a new instance of {@code Version}
for the specified version numbers.
@param major the major version number
@param minor the minor version number
@param patch the patch version number
@return a new instance of the {@code Version} class
@throws IllegalArgumentException if a negative integer is passed
@since 0.7.... | [
"Creates",
"a",
"new",
"instance",
"of",
"{",
"@code",
"Version",
"}",
"for",
"the",
"specified",
"version",
"numbers",
"."
] | train | https://github.com/zafarkhaja/jsemver/blob/1f4996ea3dab06193c378fd66fd4f8fdc8334cc6/src/main/java/com/github/zafarkhaja/semver/Version.java#L306-L308 |
Wadpam/guja | guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java | GeneratedDContactDaoImpl.queryByWorkPhone | public Iterable<DContact> queryByWorkPhone(Object parent, java.lang.String workPhone) {
"""
query-by method for field workPhone
@param workPhone the specified attribute
@return an Iterable of DContacts for the specified workPhone
"""
return queryByField(parent, DContactMapper.Field.WORKPHONE.getFieldName... | java | public Iterable<DContact> queryByWorkPhone(Object parent, java.lang.String workPhone) {
return queryByField(parent, DContactMapper.Field.WORKPHONE.getFieldName(), workPhone);
} | [
"public",
"Iterable",
"<",
"DContact",
">",
"queryByWorkPhone",
"(",
"Object",
"parent",
",",
"java",
".",
"lang",
".",
"String",
"workPhone",
")",
"{",
"return",
"queryByField",
"(",
"parent",
",",
"DContactMapper",
".",
"Field",
".",
"WORKPHONE",
".",
"get... | query-by method for field workPhone
@param workPhone the specified attribute
@return an Iterable of DContacts for the specified workPhone | [
"query",
"-",
"by",
"method",
"for",
"field",
"workPhone"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java#L322-L324 |
jfinal/jfinal | src/main/java/com/jfinal/config/JFinalConfig.java | JFinalConfig.loadPropertyFile | public Properties loadPropertyFile(String fileName, String encoding) {
"""
Load property file.
Example:<br>
loadPropertyFile("db_username_pass.txt", "UTF-8");
@param fileName the file in CLASSPATH or the sub directory of the CLASSPATH
@param encoding the encoding
"""
prop = new Prop(fileName, encoding... | java | public Properties loadPropertyFile(String fileName, String encoding) {
prop = new Prop(fileName, encoding);
return prop.getProperties();
} | [
"public",
"Properties",
"loadPropertyFile",
"(",
"String",
"fileName",
",",
"String",
"encoding",
")",
"{",
"prop",
"=",
"new",
"Prop",
"(",
"fileName",
",",
"encoding",
")",
";",
"return",
"prop",
".",
"getProperties",
"(",
")",
";",
"}"
] | Load property file.
Example:<br>
loadPropertyFile("db_username_pass.txt", "UTF-8");
@param fileName the file in CLASSPATH or the sub directory of the CLASSPATH
@param encoding the encoding | [
"Load",
"property",
"file",
".",
"Example",
":",
"<br",
">",
"loadPropertyFile",
"(",
"db_username_pass",
".",
"txt",
"UTF",
"-",
"8",
")",
";"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/config/JFinalConfig.java#L104-L107 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/model/trigram/CharacterBasedGenerativeModel.java | CharacterBasedGenerativeModel.log_prob | double log_prob(char s1, int i1, char s2, int i2, char s3, int i3) {
"""
求概率
@param s1 前2个字
@param s1 前2个状态的下标
@param s2 前1个字
@param s2 前1个状态的下标
@param s3 当前字
@param s3 当前状态的下标
@return 序列的概率
"""
if (transMatrix[i1][i2][i3] == 0)
return inf;
char t1 = id2tag[i1];
char ... | java | double log_prob(char s1, int i1, char s2, int i2, char s3, int i3)
{
if (transMatrix[i1][i2][i3] == 0)
return inf;
char t1 = id2tag[i1];
char t2 = id2tag[i2];
char t3 = id2tag[i3];
double uni = l1 * tf.freq(s3,t3);
double bi = div(l2 * tf.get(s2,t2, s3,t3)... | [
"double",
"log_prob",
"(",
"char",
"s1",
",",
"int",
"i1",
",",
"char",
"s2",
",",
"int",
"i2",
",",
"char",
"s3",
",",
"int",
"i3",
")",
"{",
"if",
"(",
"transMatrix",
"[",
"i1",
"]",
"[",
"i2",
"]",
"[",
"i3",
"]",
"==",
"0",
")",
"return",... | 求概率
@param s1 前2个字
@param s1 前2个状态的下标
@param s2 前1个字
@param s2 前1个状态的下标
@param s3 当前字
@param s3 当前状态的下标
@return 序列的概率 | [
"求概率"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/trigram/CharacterBasedGenerativeModel.java#L157-L170 |
apache/groovy | subprojects/groovy-json/src/main/java/groovy/json/StringEscapeUtils.java | StringEscapeUtils.escapeJavaScript | public static void escapeJavaScript(Writer out, String str) throws IOException {
"""
Escapes the characters in a <code>String</code> using JavaScript String rules
to a <code>Writer</code>.
<p>
A <code>null</code> string input has no effect.
@see #escapeJavaScript(java.lang.String)
@param out Writer to writ... | java | public static void escapeJavaScript(Writer out, String str) throws IOException {
escapeJavaStyleString(out, str, true, true);
} | [
"public",
"static",
"void",
"escapeJavaScript",
"(",
"Writer",
"out",
",",
"String",
"str",
")",
"throws",
"IOException",
"{",
"escapeJavaStyleString",
"(",
"out",
",",
"str",
",",
"true",
",",
"true",
")",
";",
"}"
] | Escapes the characters in a <code>String</code> using JavaScript String rules
to a <code>Writer</code>.
<p>
A <code>null</code> string input has no effect.
@see #escapeJavaScript(java.lang.String)
@param out Writer to write escaped string into
@param str String to escape values in, may be null
@throws IllegalArgumen... | [
"Escapes",
"the",
"characters",
"in",
"a",
"<code",
">",
"String<",
"/",
"code",
">",
"using",
"JavaScript",
"String",
"rules",
"to",
"a",
"<code",
">",
"Writer<",
"/",
"code",
">",
".",
"<p",
">",
"A",
"<code",
">",
"null<",
"/",
"code",
">",
"strin... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-json/src/main/java/groovy/json/StringEscapeUtils.java#L140-L142 |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/TaskGroup.java | TaskGroup.invokeAfterPostRunAsync | private Observable<Indexable> invokeAfterPostRunAsync(final TaskGroupEntry<TaskItem> entry,
final InvocationContext context) {
"""
Invokes the {@link TaskItem#invokeAfterPostRunAsync(boolean)} method of an actual TaskItem
if the given entry holds a ProxyTa... | java | private Observable<Indexable> invokeAfterPostRunAsync(final TaskGroupEntry<TaskItem> entry,
final InvocationContext context) {
return Observable.defer(new Func0<Observable<Indexable>>() {
@Override
public Observable<Indexable> cal... | [
"private",
"Observable",
"<",
"Indexable",
">",
"invokeAfterPostRunAsync",
"(",
"final",
"TaskGroupEntry",
"<",
"TaskItem",
">",
"entry",
",",
"final",
"InvocationContext",
"context",
")",
"{",
"return",
"Observable",
".",
"defer",
"(",
"new",
"Func0",
"<",
"Obs... | Invokes the {@link TaskItem#invokeAfterPostRunAsync(boolean)} method of an actual TaskItem
if the given entry holds a ProxyTaskItem.
@param entry the entry holding a ProxyTaskItem
@param context a group level shared context
@return An Observable that represents asynchronous work started by
{@link TaskItem#invokeAfter... | [
"Invokes",
"the",
"{",
"@link",
"TaskItem#invokeAfterPostRunAsync",
"(",
"boolean",
")",
"}",
"method",
"of",
"an",
"actual",
"TaskItem",
"if",
"the",
"given",
"entry",
"holds",
"a",
"ProxyTaskItem",
"."
] | train | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/TaskGroup.java#L433-L471 |
phax/as2-peppol-client | src/main/java/com/helger/peppol/as2client/AS2ClientBuilder.java | AS2ClientBuilder.setPKCS12KeyStore | @Nonnull
@Deprecated
public AS2ClientBuilder setPKCS12KeyStore (@Nullable final File aKeyStoreFile,
@Nullable final String sKeyStorePassword) {
"""
Set the key store file and password for the AS2 client. The key store must
be an existing file of type PKCS12 contain... | java | @Nonnull
@Deprecated
public AS2ClientBuilder setPKCS12KeyStore (@Nullable final File aKeyStoreFile,
@Nullable final String sKeyStorePassword)
{
return setKeyStore (EKeyStoreType.PKCS12, aKeyStoreFile, sKeyStorePassword);
} | [
"@",
"Nonnull",
"@",
"Deprecated",
"public",
"AS2ClientBuilder",
"setPKCS12KeyStore",
"(",
"@",
"Nullable",
"final",
"File",
"aKeyStoreFile",
",",
"@",
"Nullable",
"final",
"String",
"sKeyStorePassword",
")",
"{",
"return",
"setKeyStore",
"(",
"EKeyStoreType",
".",
... | Set the key store file and password for the AS2 client. The key store must
be an existing file of type PKCS12 containing at least the key alias of the
sender (see {@link #setSenderAS2ID(String)}). The key store file must be
writable as dynamically certificates of partners are added.
@param aKeyStoreFile
The existing k... | [
"Set",
"the",
"key",
"store",
"file",
"and",
"password",
"for",
"the",
"AS2",
"client",
".",
"The",
"key",
"store",
"must",
"be",
"an",
"existing",
"file",
"of",
"type",
"PKCS12",
"containing",
"at",
"least",
"the",
"key",
"alias",
"of",
"the",
"sender",... | train | https://github.com/phax/as2-peppol-client/blob/499fea5938df1a3c69aade5bf8be26b6e261988f/src/main/java/com/helger/peppol/as2client/AS2ClientBuilder.java#L190-L196 |
haraldk/TwelveMonkeys | imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/QuickDrawContext.java | QuickDrawContext.fillArc | public void fillArc(final Rectangle2D pRectangle, int pStartAngle, int pArcAngle, Pattern pPattern) {
"""
FillArc(r,int,int, pat) // fills an arc's interior with any pattern you
specify. The procedure transfers the pattern with the patCopy pattern
mode, which directly copies your requested pattern into the shape... | java | public void fillArc(final Rectangle2D pRectangle, int pStartAngle, int pArcAngle, Pattern pPattern) {
fillShape(toArc(pRectangle, pStartAngle, pArcAngle, true), pPattern);
} | [
"public",
"void",
"fillArc",
"(",
"final",
"Rectangle2D",
"pRectangle",
",",
"int",
"pStartAngle",
",",
"int",
"pArcAngle",
",",
"Pattern",
"pPattern",
")",
"{",
"fillShape",
"(",
"toArc",
"(",
"pRectangle",
",",
"pStartAngle",
",",
"pArcAngle",
",",
"true",
... | FillArc(r,int,int, pat) // fills an arc's interior with any pattern you
specify. The procedure transfers the pattern with the patCopy pattern
mode, which directly copies your requested pattern into the shape.
@param pRectangle the rectangle to fill
@param pStartAngle start angle in degrees (starting from 12'o clock, ... | [
"FillArc",
"(",
"r",
"int",
"int",
"pat",
")",
"//",
"fills",
"an",
"arc",
"s",
"interior",
"with",
"any",
"pattern",
"you",
"specify",
".",
"The",
"procedure",
"transfers",
"the",
"pattern",
"with",
"the",
"patCopy",
"pattern",
"mode",
"which",
"directly"... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/QuickDrawContext.java#L754-L756 |
leancloud/java-sdk-all | android-sdk/mixpush-android/src/main/java/cn/leancloud/AVMixPushManager.java | AVMixPushManager.registerXiaomiPush | public static void registerXiaomiPush(Context context, String miAppId, String miAppKey) {
"""
注册小米推送
只有 appId、appKey 有效 且 MIUI 且 manifest 正确填写 才能注册
@param context
@param miAppId
@param miAppKey
"""
registerXiaomiPush(context, miAppId, miAppKey, "");
} | java | public static void registerXiaomiPush(Context context, String miAppId, String miAppKey) {
registerXiaomiPush(context, miAppId, miAppKey, "");
} | [
"public",
"static",
"void",
"registerXiaomiPush",
"(",
"Context",
"context",
",",
"String",
"miAppId",
",",
"String",
"miAppKey",
")",
"{",
"registerXiaomiPush",
"(",
"context",
",",
"miAppId",
",",
"miAppKey",
",",
"\"\"",
")",
";",
"}"
] | 注册小米推送
只有 appId、appKey 有效 且 MIUI 且 manifest 正确填写 才能注册
@param context
@param miAppId
@param miAppKey | [
"注册小米推送",
"只有",
"appId、appKey",
"有效",
"且",
"MIUI",
"且",
"manifest",
"正确填写",
"才能注册"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/mixpush-android/src/main/java/cn/leancloud/AVMixPushManager.java#L51-L53 |
google/gson | gson/src/main/java/com/google/gson/Gson.java | Gson.toJson | public String toJson(Object src) {
"""
This method serializes the specified object into its equivalent Json representation.
This method should be used when the specified object is not a generic type. This method uses
{@link Class#getClass()} to get the type for the specified object, but the
{@code getClass()} l... | java | public String toJson(Object src) {
if (src == null) {
return toJson(JsonNull.INSTANCE);
}
return toJson(src, src.getClass());
} | [
"public",
"String",
"toJson",
"(",
"Object",
"src",
")",
"{",
"if",
"(",
"src",
"==",
"null",
")",
"{",
"return",
"toJson",
"(",
"JsonNull",
".",
"INSTANCE",
")",
";",
"}",
"return",
"toJson",
"(",
"src",
",",
"src",
".",
"getClass",
"(",
")",
")",... | This method serializes the specified object into its equivalent Json representation.
This method should be used when the specified object is not a generic type. This method uses
{@link Class#getClass()} to get the type for the specified object, but the
{@code getClass()} loses the generic type information because of th... | [
"This",
"method",
"serializes",
"the",
"specified",
"object",
"into",
"its",
"equivalent",
"Json",
"representation",
".",
"This",
"method",
"should",
"be",
"used",
"when",
"the",
"specified",
"object",
"is",
"not",
"a",
"generic",
"type",
".",
"This",
"method"... | train | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/Gson.java#L614-L619 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.