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 |
|---|---|---|---|---|---|---|---|---|---|---|
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.checkRadioList | protected boolean checkRadioList(PageElement pageElement, String value) throws FailureException {
"""
Checks that given value is matching the selected radio list button.
@param pageElement
The page element
@param value
The value to check the selection from
@return true if the given value is selected, false ... | java | protected boolean checkRadioList(PageElement pageElement, String value) throws FailureException {
try {
final List<WebElement> radioButtons = Context.waitUntil(ExpectedConditions.presenceOfAllElementsLocatedBy(Utilities.getLocator(pageElement)));
for (final WebElement button : radioBu... | [
"protected",
"boolean",
"checkRadioList",
"(",
"PageElement",
"pageElement",
",",
"String",
"value",
")",
"throws",
"FailureException",
"{",
"try",
"{",
"final",
"List",
"<",
"WebElement",
">",
"radioButtons",
"=",
"Context",
".",
"waitUntil",
"(",
"ExpectedCondit... | Checks that given value is matching the selected radio list button.
@param pageElement
The page element
@param value
The value to check the selection from
@return true if the given value is selected, false otherwise.
@throws FailureException
if the scenario encounters a functional error | [
"Checks",
"that",
"given",
"value",
"is",
"matching",
"the",
"selected",
"radio",
"list",
"button",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L631-L643 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/FreezableMutableURI.java | FreezableMutableURI.addParameter | public void addParameter( String name, String value, boolean encoded ) {
"""
Add a parameter for the query string.
<p> If the encoded flag is true then this method assumes that
the name and value do not need encoding or are already encoded
correctly. Otherwise, it translates the name and value with the
charact... | java | public void addParameter( String name, String value, boolean encoded )
{
testFrozen();
super.addParameter( name, value, encoded );
} | [
"public",
"void",
"addParameter",
"(",
"String",
"name",
",",
"String",
"value",
",",
"boolean",
"encoded",
")",
"{",
"testFrozen",
"(",
")",
";",
"super",
".",
"addParameter",
"(",
"name",
",",
"value",
",",
"encoded",
")",
";",
"}"
] | Add a parameter for the query string.
<p> If the encoded flag is true then this method assumes that
the name and value do not need encoding or are already encoded
correctly. Otherwise, it translates the name and value with the
character encoding of this URI and adds them to the set of
parameters for the query. If the e... | [
"Add",
"a",
"parameter",
"for",
"the",
"query",
"string",
".",
"<p",
">",
"If",
"the",
"encoded",
"flag",
"is",
"true",
"then",
"this",
"method",
"assumes",
"that",
"the",
"name",
"and",
"value",
"do",
"not",
"need",
"encoding",
"or",
"are",
"already",
... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/FreezableMutableURI.java#L245-L249 |
xiancloud/xian | xian-dao/xian-daocore/src/main/java/info/xiancloud/dao/core/action/SafetyChecker.java | SafetyChecker.doCheck | public static UnitResponse doCheck(WhereAction action, Map map) {
"""
Check whether where claus is ignored.
@param action the where action
@param map parameter map
@return succeeded response for checking pass, and failure response for checking not passed.
"""
String[] whereArray = action.search... | java | public static UnitResponse doCheck(WhereAction action, Map map) {
String[] whereArray = action.searchConditions();
if (whereArray != null) {
for (String whereFragment : whereArray) {
if (!action.ignoreWhereFragment(whereFragment, map)) {
return UnitRespons... | [
"public",
"static",
"UnitResponse",
"doCheck",
"(",
"WhereAction",
"action",
",",
"Map",
"map",
")",
"{",
"String",
"[",
"]",
"whereArray",
"=",
"action",
".",
"searchConditions",
"(",
")",
";",
"if",
"(",
"whereArray",
"!=",
"null",
")",
"{",
"for",
"("... | Check whether where claus is ignored.
@param action the where action
@param map parameter map
@return succeeded response for checking pass, and failure response for checking not passed. | [
"Check",
"whether",
"where",
"claus",
"is",
"ignored",
"."
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-dao/xian-daocore/src/main/java/info/xiancloud/dao/core/action/SafetyChecker.java#L41-L53 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/android/support/v7/widget/ChatLinearLayoutManager.java | ChatLinearLayoutManager.findFirstVisibleChildClosestToEnd | private View findFirstVisibleChildClosestToEnd(boolean completelyVisible,
boolean acceptPartiallyVisible) {
"""
Convenience method to find the visible child closes to end. Caller should check if it has
enough children.
@param completelyVisible Whether child sh... | java | private View findFirstVisibleChildClosestToEnd(boolean completelyVisible,
boolean acceptPartiallyVisible) {
if (mShouldReverseLayout) {
return findOneVisibleChild(0, getChildCount(), completelyVisible,
acceptPartiallyVisible);
... | [
"private",
"View",
"findFirstVisibleChildClosestToEnd",
"(",
"boolean",
"completelyVisible",
",",
"boolean",
"acceptPartiallyVisible",
")",
"{",
"if",
"(",
"mShouldReverseLayout",
")",
"{",
"return",
"findOneVisibleChild",
"(",
"0",
",",
"getChildCount",
"(",
")",
","... | Convenience method to find the visible child closes to end. Caller should check if it has
enough children.
@param completelyVisible Whether child should be completely visible or not
@return The first visible child closest to end of the layout from user's perspective. | [
"Convenience",
"method",
"to",
"find",
"the",
"visible",
"child",
"closes",
"to",
"end",
".",
"Caller",
"should",
"check",
"if",
"it",
"has",
"enough",
"children",
"."
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/android/support/v7/widget/ChatLinearLayoutManager.java#L1507-L1516 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.copyEntries | private static void copyEntries(File zip, final ZipOutputStream out, final Set<String> ignoredEntries) {
"""
Copies all entries from one ZIP file to another, ignoring entries with path in ignoredEntries
@param zip
source ZIP file.
@param out
target ZIP stream.
@param ignoredEntries
paths of entries not to ... | java | private static void copyEntries(File zip, final ZipOutputStream out, final Set<String> ignoredEntries) {
final Set<String> names = new HashSet<String>();
final Set<String> dirNames = filterDirEntries(zip, ignoredEntries);
iterate(zip, new ZipEntryCallback() {
public void process(InputStream in, ZipEnt... | [
"private",
"static",
"void",
"copyEntries",
"(",
"File",
"zip",
",",
"final",
"ZipOutputStream",
"out",
",",
"final",
"Set",
"<",
"String",
">",
"ignoredEntries",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"names",
"=",
"new",
"HashSet",
"<",
"String",
... | Copies all entries from one ZIP file to another, ignoring entries with path in ignoredEntries
@param zip
source ZIP file.
@param out
target ZIP stream.
@param ignoredEntries
paths of entries not to copy | [
"Copies",
"all",
"entries",
"from",
"one",
"ZIP",
"file",
"to",
"another",
"ignoring",
"entries",
"with",
"path",
"in",
"ignoredEntries"
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L2423-L2447 |
phax/ph-ebinterface | src/main/java/com/helger/ebinterface/visualization/VisualizationManager.java | VisualizationManager.visualizeToFile | @Nullable
public static ESuccess visualizeToFile (@Nonnull final EEbInterfaceVersion eVersion,
@Nonnull final Source aSource,
@Nonnull final File aDestinationFile) {
"""
Visualize a source to a file for a certain ebInterface vers... | java | @Nullable
public static ESuccess visualizeToFile (@Nonnull final EEbInterfaceVersion eVersion,
@Nonnull final Source aSource,
@Nonnull final File aDestinationFile)
{
return visualize (eVersion, aSource, TransformResultFactory.cr... | [
"@",
"Nullable",
"public",
"static",
"ESuccess",
"visualizeToFile",
"(",
"@",
"Nonnull",
"final",
"EEbInterfaceVersion",
"eVersion",
",",
"@",
"Nonnull",
"final",
"Source",
"aSource",
",",
"@",
"Nonnull",
"final",
"File",
"aDestinationFile",
")",
"{",
"return",
... | Visualize a source to a file for a certain ebInterface version.
@param eVersion
ebInterface version to use. May not be <code>null</code>.
@param aSource
Source. May not be <code>null</code>.
@param aDestinationFile
The file to write the result to. May not be <code>null</code>.
@return {@link ESuccess} | [
"Visualize",
"a",
"source",
"to",
"a",
"file",
"for",
"a",
"certain",
"ebInterface",
"version",
"."
] | train | https://github.com/phax/ph-ebinterface/blob/e3d2381f25c2fdfcc98acff2509bf5f33752d087/src/main/java/com/helger/ebinterface/visualization/VisualizationManager.java#L184-L190 |
jnidzwetzki/bitfinex-v2-wss-api-java | src/main/java/com/github/jnidzwetzki/bitfinex/v2/BitfinexApiCallbackListeners.java | BitfinexApiCallbackListeners.onMyOrderNotification | public Closeable onMyOrderNotification(final BiConsumer<BitfinexAccountSymbol, BitfinexSubmittedOrder> listener) {
"""
registers listener for my order notifications
@param listener of event
@return hook of this listener
"""
newOrderConsumers.offer(listener);
return () -> newOrderConsumers.rem... | java | public Closeable onMyOrderNotification(final BiConsumer<BitfinexAccountSymbol, BitfinexSubmittedOrder> listener) {
newOrderConsumers.offer(listener);
return () -> newOrderConsumers.remove(listener);
} | [
"public",
"Closeable",
"onMyOrderNotification",
"(",
"final",
"BiConsumer",
"<",
"BitfinexAccountSymbol",
",",
"BitfinexSubmittedOrder",
">",
"listener",
")",
"{",
"newOrderConsumers",
".",
"offer",
"(",
"listener",
")",
";",
"return",
"(",
")",
"->",
"newOrderConsu... | registers listener for my order notifications
@param listener of event
@return hook of this listener | [
"registers",
"listener",
"for",
"my",
"order",
"notifications"
] | train | https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/BitfinexApiCallbackListeners.java#L98-L101 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/f/FundamentalExtractEpipoles.java | FundamentalExtractEpipoles.process | public void process(DMatrixRMaj F , @Nullable Point3D_F64 e1 , @Nullable Point3D_F64 e2 ) {
"""
Extracts the left and right epipoles.
@param F (Input) Fundamental matrix
@param e1 (Output) right null space. Can be null.
@param e2 (Output) left null space. Can be null.
"""
if( !svd.decompose(F) )
thr... | java | public void process(DMatrixRMaj F , @Nullable Point3D_F64 e1 , @Nullable Point3D_F64 e2 ) {
if( !svd.decompose(F) )
throw new RuntimeException("SVD Failed?!");
svd.getU(U,false);
svd.getV(V,false);
double singular[] = svd.getSingularValues();
SingularOps_DDRM.descendingOrder(U,false,singular,3,V,false);
... | [
"public",
"void",
"process",
"(",
"DMatrixRMaj",
"F",
",",
"@",
"Nullable",
"Point3D_F64",
"e1",
",",
"@",
"Nullable",
"Point3D_F64",
"e2",
")",
"{",
"if",
"(",
"!",
"svd",
".",
"decompose",
"(",
"F",
")",
")",
"throw",
"new",
"RuntimeException",
"(",
... | Extracts the left and right epipoles.
@param F (Input) Fundamental matrix
@param e1 (Output) right null space. Can be null.
@param e2 (Output) left null space. Can be null. | [
"Extracts",
"the",
"left",
"and",
"right",
"epipoles",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/f/FundamentalExtractEpipoles.java#L57-L71 |
Azure/azure-sdk-for-java | mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ServersInner.java | ServersInner.beginCreateAsync | public Observable<ServerInner> beginCreateAsync(String resourceGroupName, String serverName, ServerForCreate parameters) {
"""
Creates a new server or updates an existing server. The update action will overwrite the existing server.
@param resourceGroupName The name of the resource group that contains the resou... | java | public Observable<ServerInner> beginCreateAsync(String resourceGroupName, String serverName, ServerForCreate parameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerInner>, ServerInner>() {
@Override
public S... | [
"public",
"Observable",
"<",
"ServerInner",
">",
"beginCreateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"ServerForCreate",
"parameters",
")",
"{",
"return",
"beginCreateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverNam... | Creates a new server or updates an existing server. The update action will overwrite the existing server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param par... | [
"Creates",
"a",
"new",
"server",
"or",
"updates",
"an",
"existing",
"server",
".",
"The",
"update",
"action",
"will",
"overwrite",
"the",
"existing",
"server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ServersInner.java#L220-L227 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/implementation/bytecode/constant/SerializedConstant.java | SerializedConstant.of | public static StackManipulation of(Serializable value) {
"""
Creates a new stack manipulation to load the supplied value onto the stack.
@param value The value to serialize.
@return A stack manipulation to serialize the supplied value.
"""
if (value == null) {
return NullConstant.INSTAN... | java | public static StackManipulation of(Serializable value) {
if (value == null) {
return NullConstant.INSTANCE;
}
try {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteAr... | [
"public",
"static",
"StackManipulation",
"of",
"(",
"Serializable",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"NullConstant",
".",
"INSTANCE",
";",
"}",
"try",
"{",
"ByteArrayOutputStream",
"byteArrayOutputStream",
"=",
"new",
"B... | Creates a new stack manipulation to load the supplied value onto the stack.
@param value The value to serialize.
@return A stack manipulation to serialize the supplied value. | [
"Creates",
"a",
"new",
"stack",
"manipulation",
"to",
"load",
"the",
"supplied",
"value",
"onto",
"the",
"stack",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/bytecode/constant/SerializedConstant.java#L61-L77 |
Pi4J/pi4j | pi4j-device/src/main/java/com/pi4j/component/servo/impl/RPIServoBlasterProvider.java | RPIServoBlasterProvider.getServoDriver | @Override
public synchronized ServoDriver getServoDriver(Pin servoPin) throws IOException {
"""
Returns new instance of {@link RPIServoBlasterServoDriver}.
@param servoPin servo pin.
@return instance of {@link RPIServoBlasterServoDriver}.
"""
List<Pin> servoPins = getDefinedServoPins();
... | java | @Override
public synchronized ServoDriver getServoDriver(Pin servoPin) throws IOException {
List<Pin> servoPins = getDefinedServoPins();
int index = servoPins.indexOf(servoPin);
if (index < 0) {
throw new IllegalArgumentException("Servo driver cannot drive pin " + servoPin);
... | [
"@",
"Override",
"public",
"synchronized",
"ServoDriver",
"getServoDriver",
"(",
"Pin",
"servoPin",
")",
"throws",
"IOException",
"{",
"List",
"<",
"Pin",
">",
"servoPins",
"=",
"getDefinedServoPins",
"(",
")",
";",
"int",
"index",
"=",
"servoPins",
".",
"inde... | Returns new instance of {@link RPIServoBlasterServoDriver}.
@param servoPin servo pin.
@return instance of {@link RPIServoBlasterServoDriver}. | [
"Returns",
"new",
"instance",
"of",
"{",
"@link",
"RPIServoBlasterServoDriver",
"}",
"."
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-device/src/main/java/com/pi4j/component/servo/impl/RPIServoBlasterProvider.java#L249-L264 |
trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/messages/Requests.java | Requests.createPublishNotify | public static PublishNotify createPublishNotify(Identifier i1,
Collection<Document> mdlist) {
"""
Create a new {@link PublishNotify} instance that is used to publish
a list of metadata instances.
@param i1 the {@link Identifier} to which the given metadata is published to
@param mdlist a list of metadata o... | java | public static PublishNotify createPublishNotify(Identifier i1,
Collection<Document> mdlist) {
return createPublishNotify(i1, null, mdlist);
} | [
"public",
"static",
"PublishNotify",
"createPublishNotify",
"(",
"Identifier",
"i1",
",",
"Collection",
"<",
"Document",
">",
"mdlist",
")",
"{",
"return",
"createPublishNotify",
"(",
"i1",
",",
"null",
",",
"mdlist",
")",
";",
"}"
] | Create a new {@link PublishNotify} instance that is used to publish
a list of metadata instances.
@param i1 the {@link Identifier} to which the given metadata is published to
@param mdlist a list of metadata objects
@return the new {@link PublishNotify} instance | [
"Create",
"a",
"new",
"{",
"@link",
"PublishNotify",
"}",
"instance",
"that",
"is",
"used",
"to",
"publish",
"a",
"list",
"of",
"metadata",
"instances",
"."
] | train | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/messages/Requests.java#L482-L485 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_bill_GET | public ArrayList<OvhBill> project_serviceName_bill_GET(String serviceName, Date from, Date to) throws IOException {
"""
Get your project bills
REST: GET /cloud/project/{serviceName}/bill
@param to [required] Get bills to
@param from [required] Get bills from
@param serviceName [required] The project id
"... | java | public ArrayList<OvhBill> project_serviceName_bill_GET(String serviceName, Date from, Date to) throws IOException {
String qPath = "/cloud/project/{serviceName}/bill";
StringBuilder sb = path(qPath, serviceName);
query(sb, "from", from);
query(sb, "to", to);
String resp = exec(qPath, "GET", sb.toString(), nul... | [
"public",
"ArrayList",
"<",
"OvhBill",
">",
"project_serviceName_bill_GET",
"(",
"String",
"serviceName",
",",
"Date",
"from",
",",
"Date",
"to",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/bill\"",
";",
"StringBuilder",
... | Get your project bills
REST: GET /cloud/project/{serviceName}/bill
@param to [required] Get bills to
@param from [required] Get bills from
@param serviceName [required] The project id | [
"Get",
"your",
"project",
"bills"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1691-L1698 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/JodaBeanSer.java | JodaBeanSer.withIteratorFactory | public JodaBeanSer withIteratorFactory(SerIteratorFactory iteratorFactory) {
"""
Returns a copy of this serializer with the specified iterator factory.
@param iteratorFactory the iterator factory, not null
@return a copy of this object with the iterator factory changed, not null
"""
JodaBeanUtils.... | java | public JodaBeanSer withIteratorFactory(SerIteratorFactory iteratorFactory) {
JodaBeanUtils.notNull(iteratorFactory, "iteratorFactory");
return new JodaBeanSer(indent, newLine, converter, iteratorFactory, shortTypes, deserializers, includeDerived);
} | [
"public",
"JodaBeanSer",
"withIteratorFactory",
"(",
"SerIteratorFactory",
"iteratorFactory",
")",
"{",
"JodaBeanUtils",
".",
"notNull",
"(",
"iteratorFactory",
",",
"\"iteratorFactory\"",
")",
";",
"return",
"new",
"JodaBeanSer",
"(",
"indent",
",",
"newLine",
",",
... | Returns a copy of this serializer with the specified iterator factory.
@param iteratorFactory the iterator factory, not null
@return a copy of this object with the iterator factory changed, not null | [
"Returns",
"a",
"copy",
"of",
"this",
"serializer",
"with",
"the",
"specified",
"iterator",
"factory",
"."
] | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/JodaBeanSer.java#L181-L184 |
jronrun/benayn | benayn-berkeley/src/main/java/com/benayn/berkeley/Berkeley.java | Berkeley.from | public static BerkeleyDB from(String envHomePath, String databaseName) {
"""
Returns a new {@link BerkeleyDB} instance, {@link Environment} with {@link Berkeley#defaultEnvironmentConfig()
and {@link Database} with {@link Berkeley#defaultDatabaseConfig()}
"""
return env(envHomePath).connection(database... | java | public static BerkeleyDB from(String envHomePath, String databaseName) {
return env(envHomePath).connection(databaseName, null, null);
} | [
"public",
"static",
"BerkeleyDB",
"from",
"(",
"String",
"envHomePath",
",",
"String",
"databaseName",
")",
"{",
"return",
"env",
"(",
"envHomePath",
")",
".",
"connection",
"(",
"databaseName",
",",
"null",
",",
"null",
")",
";",
"}"
] | Returns a new {@link BerkeleyDB} instance, {@link Environment} with {@link Berkeley#defaultEnvironmentConfig()
and {@link Database} with {@link Berkeley#defaultDatabaseConfig()} | [
"Returns",
"a",
"new",
"{"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-berkeley/src/main/java/com/benayn/berkeley/Berkeley.java#L115-L117 |
hageldave/ImagingKit | ImagingKit_Core/src/main/java/hageldave/imagingkit/core/Img.java | Img.interpolateARGB | public int interpolateARGB(final double xNormalized, final double yNormalized) {
"""
Returns a bilinearly interpolated ARGB value of the image for the
specified normalized position (x and y within [0,1]). Position {0,0}
denotes the image's origin (top left corner), position {1,1} denotes the
opposite corner (pi... | java | public int interpolateARGB(final double xNormalized, final double yNormalized){
double xF = xNormalized * (getWidth()-1);
double yF = yNormalized * (getHeight()-1);
int x = (int)xF;
int y = (int)yF;
int c00 = getValue(x, y);
int c01 = getValue(x, (y+1 < getHeight() ? y+1:y));
int c10 = get... | [
"public",
"int",
"interpolateARGB",
"(",
"final",
"double",
"xNormalized",
",",
"final",
"double",
"yNormalized",
")",
"{",
"double",
"xF",
"=",
"xNormalized",
"*",
"(",
"getWidth",
"(",
")",
"-",
"1",
")",
";",
"double",
"yF",
"=",
"yNormalized",
"*",
"... | Returns a bilinearly interpolated ARGB value of the image for the
specified normalized position (x and y within [0,1]). Position {0,0}
denotes the image's origin (top left corner), position {1,1} denotes the
opposite corner (pixel at {width-1, height-1}).
<p>
An ArrayIndexOutOfBoundsException may be thrown for x and y ... | [
"Returns",
"a",
"bilinearly",
"interpolated",
"ARGB",
"value",
"of",
"the",
"image",
"for",
"the",
"specified",
"normalized",
"position",
"(",
"x",
"and",
"y",
"within",
"[",
"0",
"1",
"]",
")",
".",
"Position",
"{",
"0",
"0",
"}",
"denotes",
"the",
"i... | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Core/src/main/java/hageldave/imagingkit/core/Img.java#L330-L340 |
aws/aws-sdk-java | aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/IdentityProviderType.java | IdentityProviderType.withAttributeMapping | public IdentityProviderType withAttributeMapping(java.util.Map<String, String> attributeMapping) {
"""
<p>
A mapping of identity provider attributes to standard and custom user pool attributes.
</p>
@param attributeMapping
A mapping of identity provider attributes to standard and custom user pool attributes.... | java | public IdentityProviderType withAttributeMapping(java.util.Map<String, String> attributeMapping) {
setAttributeMapping(attributeMapping);
return this;
} | [
"public",
"IdentityProviderType",
"withAttributeMapping",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributeMapping",
")",
"{",
"setAttributeMapping",
"(",
"attributeMapping",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A mapping of identity provider attributes to standard and custom user pool attributes.
</p>
@param attributeMapping
A mapping of identity provider attributes to standard and custom user pool attributes.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"A",
"mapping",
"of",
"identity",
"provider",
"attributes",
"to",
"standard",
"and",
"custom",
"user",
"pool",
"attributes",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/IdentityProviderType.java#L329-L332 |
btrplace/scheduler | json/src/main/java/org/btrplace/json/model/view/network/NetworkConverter.java | NetworkConverter.switchFromJSON | public Switch switchFromJSON(JSONObject o) throws JSONConverterException {
"""
Convert a JSON switch object to a Switch.
@param o the json object
@return the Switch
"""
return new Switch(requiredInt(o, "id"), readCapacity(o));
} | java | public Switch switchFromJSON(JSONObject o) throws JSONConverterException {
return new Switch(requiredInt(o, "id"), readCapacity(o));
} | [
"public",
"Switch",
"switchFromJSON",
"(",
"JSONObject",
"o",
")",
"throws",
"JSONConverterException",
"{",
"return",
"new",
"Switch",
"(",
"requiredInt",
"(",
"o",
",",
"\"id\"",
")",
",",
"readCapacity",
"(",
"o",
")",
")",
";",
"}"
] | Convert a JSON switch object to a Switch.
@param o the json object
@return the Switch | [
"Convert",
"a",
"JSON",
"switch",
"object",
"to",
"a",
"Switch",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/json/src/main/java/org/btrplace/json/model/view/network/NetworkConverter.java#L233-L235 |
stephenc/simple-java-mail | src/main/java/org/codemonkey/simplejavamail/Mailer.java | Mailer.sendMail | public final void sendMail(final Email email)
throws MailException {
"""
Processes an {@link Email} instance into a completely configured {@link Message}.
<p>
Sends the Sun JavaMail {@link Message} object using {@link Session#getTransport()}. It will call {@link Transport#connect()} assuming
all connection ... | java | public final void sendMail(final Email email)
throws MailException {
if (validate(email)) {
try {
// create new wrapper for each mail being sent (enable sending multiple emails with one mailer)
final MimeEmailMessageWrapper messageRoot = new MimeEmailMessageWrapper();
// fill and send wrapped ... | [
"public",
"final",
"void",
"sendMail",
"(",
"final",
"Email",
"email",
")",
"throws",
"MailException",
"{",
"if",
"(",
"validate",
"(",
"email",
")",
")",
"{",
"try",
"{",
"// create new wrapper for each mail being sent (enable sending multiple emails with one mailer)\r",... | Processes an {@link Email} instance into a completely configured {@link Message}.
<p>
Sends the Sun JavaMail {@link Message} object using {@link Session#getTransport()}. It will call {@link Transport#connect()} assuming
all connection details have been configured in the provided {@link Session} instance.
<p>
Performs a... | [
"Processes",
"an",
"{",
"@link",
"Email",
"}",
"instance",
"into",
"a",
"completely",
"configured",
"{",
"@link",
"Message",
"}",
".",
"<p",
">",
"Sends",
"the",
"Sun",
"JavaMail",
"{",
"@link",
"Message",
"}",
"object",
"using",
"{",
"@link",
"Session#get... | train | https://github.com/stephenc/simple-java-mail/blob/8c5897e6bbc23c11e7c7eb5064f407625c653923/src/main/java/org/codemonkey/simplejavamail/Mailer.java#L209-L235 |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/MergeTopicParser.java | MergeTopicParser.handleLocalDita | private URI handleLocalDita(final URI href, final AttributesImpl atts) {
"""
Rewrite local DITA href value.
@param href href attribute value
@return rewritten href value
"""
final URI attValue = href;
final int sharpIndex = attValue.toString().indexOf(SHARP);
URI pathFromMap;
... | java | private URI handleLocalDita(final URI href, final AttributesImpl atts) {
final URI attValue = href;
final int sharpIndex = attValue.toString().indexOf(SHARP);
URI pathFromMap;
URI retAttValue;
if (sharpIndex != -1) { // href value refer to an id in a topic
if (sharpIn... | [
"private",
"URI",
"handleLocalDita",
"(",
"final",
"URI",
"href",
",",
"final",
"AttributesImpl",
"atts",
")",
"{",
"final",
"URI",
"attValue",
"=",
"href",
";",
"final",
"int",
"sharpIndex",
"=",
"attValue",
".",
"toString",
"(",
")",
".",
"indexOf",
"(",... | Rewrite local DITA href value.
@param href href attribute value
@return rewritten href value | [
"Rewrite",
"local",
"DITA",
"href",
"value",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/MergeTopicParser.java#L124-L165 |
mediathekview/MServer | src/main/java/mServer/tool/MserverDatumZeit.java | MserverDatumZeit.formatTime | public static String formatTime(String dateValue, FastDateFormat sdf) {
"""
formats a datetime string to the time format used in DatenFilm
@param dateValue the datetime value
@param sdf the format of dateValue
@return the formatted time string
"""
try {
return FDF_OUT_TIME.format(sdf.pa... | java | public static String formatTime(String dateValue, FastDateFormat sdf) {
try {
return FDF_OUT_TIME.format(sdf.parse(dateValue));
} catch (ParseException ex) {
LOG.debug(String.format("Fehler beim Parsen des Datums %s: %s", dateValue, ex.getMessage()));
}
... | [
"public",
"static",
"String",
"formatTime",
"(",
"String",
"dateValue",
",",
"FastDateFormat",
"sdf",
")",
"{",
"try",
"{",
"return",
"FDF_OUT_TIME",
".",
"format",
"(",
"sdf",
".",
"parse",
"(",
"dateValue",
")",
")",
";",
"}",
"catch",
"(",
"ParseExcepti... | formats a datetime string to the time format used in DatenFilm
@param dateValue the datetime value
@param sdf the format of dateValue
@return the formatted time string | [
"formats",
"a",
"datetime",
"string",
"to",
"the",
"time",
"format",
"used",
"in",
"DatenFilm"
] | train | https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/tool/MserverDatumZeit.java#L98-L106 |
yanzhenjie/Album | album/src/main/java/com/yanzhenjie/album/api/VideoMultipleWrapper.java | VideoMultipleWrapper.selectCount | public VideoMultipleWrapper selectCount(@IntRange(from = 1, to = Integer.MAX_VALUE) int count) {
"""
Set the maximum number to be selected.
@param count the maximum number.
"""
this.mLimitCount = count;
return this;
} | java | public VideoMultipleWrapper selectCount(@IntRange(from = 1, to = Integer.MAX_VALUE) int count) {
this.mLimitCount = count;
return this;
} | [
"public",
"VideoMultipleWrapper",
"selectCount",
"(",
"@",
"IntRange",
"(",
"from",
"=",
"1",
",",
"to",
"=",
"Integer",
".",
"MAX_VALUE",
")",
"int",
"count",
")",
"{",
"this",
".",
"mLimitCount",
"=",
"count",
";",
"return",
"this",
";",
"}"
] | Set the maximum number to be selected.
@param count the maximum number. | [
"Set",
"the",
"maximum",
"number",
"to",
"be",
"selected",
"."
] | train | https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/api/VideoMultipleWrapper.java#L56-L59 |
querydsl/querydsl | querydsl-sql/src/main/java/com/querydsl/sql/mysql/MySQLQueryFactory.java | MySQLQueryFactory.insertOnDuplicateKeyUpdate | public SQLInsertClause insertOnDuplicateKeyUpdate(RelationalPath<?> entity, Expression<?>... clauses) {
"""
Create a INSERT ... ON DUPLICATE KEY UPDATE clause
@param entity table to insert to
@param clauses clauses
@return insert clause
"""
SQLInsertClause insert = insert(entity);
StringBu... | java | public SQLInsertClause insertOnDuplicateKeyUpdate(RelationalPath<?> entity, Expression<?>... clauses) {
SQLInsertClause insert = insert(entity);
StringBuilder flag = new StringBuilder(" on duplicate key update ");
for (int i = 0; i < clauses.length; i++) {
flag.append(i > 0 ? ", " : ... | [
"public",
"SQLInsertClause",
"insertOnDuplicateKeyUpdate",
"(",
"RelationalPath",
"<",
"?",
">",
"entity",
",",
"Expression",
"<",
"?",
">",
"...",
"clauses",
")",
"{",
"SQLInsertClause",
"insert",
"=",
"insert",
"(",
"entity",
")",
";",
"StringBuilder",
"flag",... | Create a INSERT ... ON DUPLICATE KEY UPDATE clause
@param entity table to insert to
@param clauses clauses
@return insert clause | [
"Create",
"a",
"INSERT",
"...",
"ON",
"DUPLICATE",
"KEY",
"UPDATE",
"clause"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/mysql/MySQLQueryFactory.java#L93-L101 |
RKumsher/utils | src/main/java/com/github/rkumsher/date/RandomDateUtils.java | RandomDateUtils.randomBefore | public static long randomBefore(TemporalField field, long before) {
"""
Returns a random valid value for the given {@link TemporalField} between <code>
TemporalField.range().min()</code> and <code>before</code>. For example, <code>
randomBefore({@link ChronoField#HOUR_OF_DAY}, 13)</code> will return a random val... | java | public static long randomBefore(TemporalField field, long before) {
long min = field.range().getMinimum();
long max = field.range().getMaximum();
checkArgument(before > min, "Before must be after %s", min);
checkArgument(before <= max, "Before must be on or before %s", max);
return randomLong(min, b... | [
"public",
"static",
"long",
"randomBefore",
"(",
"TemporalField",
"field",
",",
"long",
"before",
")",
"{",
"long",
"min",
"=",
"field",
".",
"range",
"(",
")",
".",
"getMinimum",
"(",
")",
";",
"long",
"max",
"=",
"field",
".",
"range",
"(",
")",
".... | Returns a random valid value for the given {@link TemporalField} between <code>
TemporalField.range().min()</code> and <code>before</code>. For example, <code>
randomBefore({@link ChronoField#HOUR_OF_DAY}, 13)</code> will return a random value between
0-12.
@param field the {@link TemporalField} to return a valid valu... | [
"Returns",
"a",
"random",
"valid",
"value",
"for",
"the",
"given",
"{",
"@link",
"TemporalField",
"}",
"between",
"<code",
">",
"TemporalField",
".",
"range",
"()",
".",
"min",
"()",
"<",
"/",
"code",
">",
"and",
"<code",
">",
"before<",
"/",
"code",
"... | train | https://github.com/RKumsher/utils/blob/fcdb190569cd0288249bf4b46fd418f8c01d1caf/src/main/java/com/github/rkumsher/date/RandomDateUtils.java#L646-L652 |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/Scoreboard.java | Scoreboard.isComparable | private static boolean isComparable(CompleteTransactionTask c1, CompleteTransactionTask c2) {
"""
4) restart completion and repair completion can't overwrite each other
"""
return c1.getMsgTxnId() == c2.getMsgTxnId() &&
MpRestartSequenceGenerator.isForRestart(c1.getTimestamp()) ==
... | java | private static boolean isComparable(CompleteTransactionTask c1, CompleteTransactionTask c2) {
return c1.getMsgTxnId() == c2.getMsgTxnId() &&
MpRestartSequenceGenerator.isForRestart(c1.getTimestamp()) ==
MpRestartSequenceGenerator.isForRestart(c2.getTimestamp());
} | [
"private",
"static",
"boolean",
"isComparable",
"(",
"CompleteTransactionTask",
"c1",
",",
"CompleteTransactionTask",
"c2",
")",
"{",
"return",
"c1",
".",
"getMsgTxnId",
"(",
")",
"==",
"c2",
".",
"getMsgTxnId",
"(",
")",
"&&",
"MpRestartSequenceGenerator",
".",
... | 4) restart completion and repair completion can't overwrite each other | [
"4",
")",
"restart",
"completion",
"and",
"repair",
"completion",
"can",
"t",
"overwrite",
"each",
"other"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/Scoreboard.java#L123-L127 |
alkacon/opencms-core | src/org/opencms/ade/sitemap/shared/CmsClientSitemapEntry.java | CmsClientSitemapEntry.setSubEntries | public void setSubEntries(List<CmsClientSitemapEntry> children, I_CmsSitemapController controller) {
"""
Sets the children.<p>
@param children the children to set
@param controller a sitemap controller instance
"""
m_childrenLoadedInitially = true;
m_subEntries.clear();
if (childr... | java | public void setSubEntries(List<CmsClientSitemapEntry> children, I_CmsSitemapController controller) {
m_childrenLoadedInitially = true;
m_subEntries.clear();
if (children != null) {
m_subEntries.addAll(children);
for (CmsClientSitemapEntry child : children) {
... | [
"public",
"void",
"setSubEntries",
"(",
"List",
"<",
"CmsClientSitemapEntry",
">",
"children",
",",
"I_CmsSitemapController",
"controller",
")",
"{",
"m_childrenLoadedInitially",
"=",
"true",
";",
"m_subEntries",
".",
"clear",
"(",
")",
";",
"if",
"(",
"children",... | Sets the children.<p>
@param children the children to set
@param controller a sitemap controller instance | [
"Sets",
"the",
"children",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/sitemap/shared/CmsClientSitemapEntry.java#L1034-L1045 |
Azure/azure-sdk-for-java | iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsInner.java | AppsInner.updateAsync | public Observable<AppInner> updateAsync(String resourceGroupName, String resourceName, AppPatch appPatch) {
"""
Update the metadata of an IoT Central application.
@param resourceGroupName The name of the resource group that contains the IoT Central application.
@param resourceName The ARM resource name of the ... | java | public Observable<AppInner> updateAsync(String resourceGroupName, String resourceName, AppPatch appPatch) {
return updateWithServiceResponseAsync(resourceGroupName, resourceName, appPatch).map(new Func1<ServiceResponse<AppInner>, AppInner>() {
@Override
public AppInner call(ServiceRespon... | [
"public",
"Observable",
"<",
"AppInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"AppPatch",
"appPatch",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
",",
"appP... | Update the metadata of an IoT Central application.
@param resourceGroupName The name of the resource group that contains the IoT Central application.
@param resourceName The ARM resource name of the IoT Central application.
@param appPatch The IoT Central application metadata and security metadata.
@throws IllegalArgu... | [
"Update",
"the",
"metadata",
"of",
"an",
"IoT",
"Central",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsInner.java#L418-L425 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java | QrCodeUtil.generate | public static BufferedImage generate(String content, int width, int height) {
"""
生成二维码图片
@param content 文本内容
@param width 宽度
@param height 高度
@return 二维码图片(黑白)
"""
return generate(content, new QrConfig(width, height));
} | java | public static BufferedImage generate(String content, int width, int height) {
return generate(content, new QrConfig(width, height));
} | [
"public",
"static",
"BufferedImage",
"generate",
"(",
"String",
"content",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"return",
"generate",
"(",
"content",
",",
"new",
"QrConfig",
"(",
"width",
",",
"height",
")",
")",
";",
"}"
] | 生成二维码图片
@param content 文本内容
@param width 宽度
@param height 高度
@return 二维码图片(黑白) | [
"生成二维码图片"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java#L133-L135 |
maddingo/sojo | src/main/java/net/sf/sojo/util/Util.java | Util.registerDateFormat | public static DateFormat registerDateFormat(String format) {
"""
Add the format string as {@link SimpleDateFormat} using English as locale.
The format can be removed by the format string.
If you need a different locale use {@link #registerDateFormat(String, DateFormat)}.
@param format {@link SimpleDateFormat#Si... | java | public static DateFormat registerDateFormat(String format) {
return registerDateFormat(format, new SimpleDateFormat(format, Locale.ENGLISH));
} | [
"public",
"static",
"DateFormat",
"registerDateFormat",
"(",
"String",
"format",
")",
"{",
"return",
"registerDateFormat",
"(",
"format",
",",
"new",
"SimpleDateFormat",
"(",
"format",
",",
"Locale",
".",
"ENGLISH",
")",
")",
";",
"}"
] | Add the format string as {@link SimpleDateFormat} using English as locale.
The format can be removed by the format string.
If you need a different locale use {@link #registerDateFormat(String, DateFormat)}.
@param format {@link SimpleDateFormat#SimpleDateFormat(String)} | [
"Add",
"the",
"format",
"string",
"as",
"{"
] | train | https://github.com/maddingo/sojo/blob/99e9e0a146b502deb7f507fe0623227402ed675b/src/main/java/net/sf/sojo/util/Util.java#L66-L68 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/ui/CmsSmallElementsHandler.java | CmsSmallElementsHandler.setEditSmallElements | public void setEditSmallElements(final boolean editable, boolean save) {
"""
Enables or disables editing for small elements and optionally saves the setting.<p>
@param editable if true, enables editing for small elements
@param save true if the setting should be saved
"""
if (save) {
... | java | public void setEditSmallElements(final boolean editable, boolean save) {
if (save) {
CmsRpcAction<Void> action = new CmsRpcAction<Void>() {
@Override
public void execute() {
start(200, false);
internalSetEditSmallEle... | [
"public",
"void",
"setEditSmallElements",
"(",
"final",
"boolean",
"editable",
",",
"boolean",
"save",
")",
"{",
"if",
"(",
"save",
")",
"{",
"CmsRpcAction",
"<",
"Void",
">",
"action",
"=",
"new",
"CmsRpcAction",
"<",
"Void",
">",
"(",
")",
"{",
"@",
... | Enables or disables editing for small elements and optionally saves the setting.<p>
@param editable if true, enables editing for small elements
@param save true if the setting should be saved | [
"Enables",
"or",
"disables",
"editing",
"for",
"small",
"elements",
"and",
"optionally",
"saves",
"the",
"setting",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/ui/CmsSmallElementsHandler.java#L127-L153 |
BigBadaboom/androidsvg | androidsvg/src/main/java/com/caverock/androidsvg/SVG.java | SVG.renderToCanvas | @SuppressWarnings( {
"""
Renders this SVG document to a Canvas object.
@param canvas the canvas to which the document should be rendered.
@param viewPort the bounds of the area on the canvas you want the SVG rendered, or null for the whole canvas.
""""WeakerAccess", "unused"})
public void renderToCanv... | java | @SuppressWarnings({"WeakerAccess", "unused"})
public void renderToCanvas(Canvas canvas, RectF viewPort)
{
RenderOptions renderOptions = new RenderOptions();
if (viewPort != null) {
renderOptions.viewPort(viewPort.left, viewPort.top, viewPort.width(), viewPort.height());
} else... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"public",
"void",
"renderToCanvas",
"(",
"Canvas",
"canvas",
",",
"RectF",
"viewPort",
")",
"{",
"RenderOptions",
"renderOptions",
"=",
"new",
"RenderOptions",
"(",
")",
";",
"... | Renders this SVG document to a Canvas object.
@param canvas the canvas to which the document should be rendered.
@param viewPort the bounds of the area on the canvas you want the SVG rendered, or null for the whole canvas. | [
"Renders",
"this",
"SVG",
"document",
"to",
"a",
"Canvas",
"object",
"."
] | train | https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVG.java#L504-L518 |
weld/core | impl/src/main/java/org/jboss/weld/bootstrap/events/ContainerLifecycleEventPreloader.java | ContainerLifecycleEventPreloader.preloadContainerLifecycleEvent | @SuppressFBWarnings(value = "RV_RETURN_VALUE_IGNORED_BAD_PRACTICE", justification = "We never need to synchronize with the preloader.")
void preloadContainerLifecycleEvent(Class<?> eventRawType, Type... typeParameters) {
"""
In multi-threaded environment we often cannot leverage multiple core fully in bootstra... | java | @SuppressFBWarnings(value = "RV_RETURN_VALUE_IGNORED_BAD_PRACTICE", justification = "We never need to synchronize with the preloader.")
void preloadContainerLifecycleEvent(Class<?> eventRawType, Type... typeParameters) {
executor.submit(new PreloadingTask(new ParameterizedTypeImpl(eventRawType, typeParamete... | [
"@",
"SuppressFBWarnings",
"(",
"value",
"=",
"\"RV_RETURN_VALUE_IGNORED_BAD_PRACTICE\"",
",",
"justification",
"=",
"\"We never need to synchronize with the preloader.\"",
")",
"void",
"preloadContainerLifecycleEvent",
"(",
"Class",
"<",
"?",
">",
"eventRawType",
",",
"Type"... | In multi-threaded environment we often cannot leverage multiple core fully in bootstrap because the deployer
threads are often blocked by the reflection API or waiting to get a classloader lock. While waiting for classes to be loaded or
reflection metadata to be obtained, we can make use of the idle CPU cores and start... | [
"In",
"multi",
"-",
"threaded",
"environment",
"we",
"often",
"cannot",
"leverage",
"multiple",
"core",
"fully",
"in",
"bootstrap",
"because",
"the",
"deployer",
"threads",
"are",
"often",
"blocked",
"by",
"the",
"reflection",
"API",
"or",
"waiting",
"to",
"ge... | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/events/ContainerLifecycleEventPreloader.java#L70-L73 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/RecordList.java | RecordList.addRecord | public void addRecord(Rec record, boolean bMainQuery) {
"""
Add this record to this list.
@param record The record to add.
@param bMainQuery If this is the main record.
"""
if (record == null)
return;
if (this.contains(record))
{ // Don't add this twice.
if... | java | public void addRecord(Rec record, boolean bMainQuery)
{
if (record == null)
return;
if (this.contains(record))
{ // Don't add this twice.
if (!bMainQuery)
return;
this.removeRecord(record); // Change order
}
if (bMainQu... | [
"public",
"void",
"addRecord",
"(",
"Rec",
"record",
",",
"boolean",
"bMainQuery",
")",
"{",
"if",
"(",
"record",
"==",
"null",
")",
"return",
";",
"if",
"(",
"this",
".",
"contains",
"(",
"record",
")",
")",
"{",
"// Don't add this twice.",
"if",
"(",
... | Add this record to this list.
@param record The record to add.
@param bMainQuery If this is the main record. | [
"Add",
"this",
"record",
"to",
"this",
"list",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/RecordList.java#L102-L116 |
undertow-io/undertow | core/src/main/java/io/undertow/websockets/core/WebSockets.java | WebSockets.sendClose | public static void sendClose(final ByteBuffer data, final WebSocketChannel wsChannel, final WebSocketCallback<Void> callback) {
"""
Sends a complete close message, invoking the callback when complete
@param data The data to send
@param wsChannel The web socket channel
@param callback The callback to invoke on... | java | public static void sendClose(final ByteBuffer data, final WebSocketChannel wsChannel, final WebSocketCallback<Void> callback) {
CloseMessage sm = new CloseMessage(data);
sendClose(sm, wsChannel, callback);
} | [
"public",
"static",
"void",
"sendClose",
"(",
"final",
"ByteBuffer",
"data",
",",
"final",
"WebSocketChannel",
"wsChannel",
",",
"final",
"WebSocketCallback",
"<",
"Void",
">",
"callback",
")",
"{",
"CloseMessage",
"sm",
"=",
"new",
"CloseMessage",
"(",
"data",
... | Sends a complete close message, invoking the callback when complete
@param data The data to send
@param wsChannel The web socket channel
@param callback The callback to invoke on completion | [
"Sends",
"a",
"complete",
"close",
"message",
"invoking",
"the",
"callback",
"when",
"complete"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L768-L771 |
sksamuel/scrimage | scrimage-filters/src/main/java/thirdparty/jhlabs/image/ShearFilter.java | ShearFilter.transformInverse | protected void transformInverse(int x, int y, float[] out) {
"""
/*
public void imageComplete(int status) {
try {
if (status == IMAGEERROR || status == IMAGEABORTED) {
consumer.imageComplete(status);
return;
}
int width = originalSpace.width;
int height = originalSpace.height;
float tangent = Math.tan... | java | protected void transformInverse(int x, int y, float[] out) {
out[0] = x + xoffset + (y * shx);
out[1] = y + yoffset + (x * shy);
} | [
"protected",
"void",
"transformInverse",
"(",
"int",
"x",
",",
"int",
"y",
",",
"float",
"[",
"]",
"out",
")",
"{",
"out",
"[",
"0",
"]",
"=",
"x",
"+",
"xoffset",
"+",
"(",
"y",
"*",
"shx",
")",
";",
"out",
"[",
"1",
"]",
"=",
"y",
"+",
"y... | /*
public void imageComplete(int status) {
try {
if (status == IMAGEERROR || status == IMAGEABORTED) {
consumer.imageComplete(status);
return;
}
int width = originalSpace.width;
int height = originalSpace.height;
float tangent = Math.tan(angle);
if (tangent < 0.0)
tangent = -tangent;
int newWidth = (int)(height * tan... | [
"/",
"*",
"public",
"void",
"imageComplete",
"(",
"int",
"status",
")",
"{",
"try",
"{",
"if",
"(",
"status",
"==",
"IMAGEERROR",
"||",
"status",
"==",
"IMAGEABORTED",
")",
"{",
"consumer",
".",
"imageComplete",
"(",
"status",
")",
";",
"return",
";",
... | train | https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-filters/src/main/java/thirdparty/jhlabs/image/ShearFilter.java#L128-L131 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/history/HistoryStore.java | HistoryStore.initHistoryUpdaters | private void initHistoryUpdaters() {
"""
A set of updaters which are dispatched to for certain request types
"""
historyUpdaters.put(RequestType.EXEC,
new HistoryUpdater<JmxExecRequest>() {
/** {@inheritDoc} */
... | java | private void initHistoryUpdaters() {
historyUpdaters.put(RequestType.EXEC,
new HistoryUpdater<JmxExecRequest>() {
/** {@inheritDoc} */
public void updateHistory(JSONObject pJson,JmxExecRequest request, long pTimestamp) {... | [
"private",
"void",
"initHistoryUpdaters",
"(",
")",
"{",
"historyUpdaters",
".",
"put",
"(",
"RequestType",
".",
"EXEC",
",",
"new",
"HistoryUpdater",
"<",
"JmxExecRequest",
">",
"(",
")",
"{",
"/** {@inheritDoc} */",
"public",
"void",
"updateHistory",
"(",
"JSO... | A set of updaters which are dispatched to for certain request types | [
"A",
"set",
"of",
"updaters",
"which",
"are",
"dispatched",
"to",
"for",
"certain",
"request",
"types"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/history/HistoryStore.java#L188-L223 |
scireum/server-sass | src/main/java/org/serversass/Functions.java | Functions.adjusthue | public static Expression adjusthue(Generator generator, FunctionCall input) {
"""
Adjusts the hue of the given color by the given number of degrees.
@param generator the surrounding generator
@param input the function call to evaluate
@return the result of the evaluation
"""
Color color = inpu... | java | public static Expression adjusthue(Generator generator, FunctionCall input) {
Color color = input.getExpectedColorParam(0);
int changeInDegrees = input.getExpectedIntParam(1);
Color.HSL hsl = color.getHSL();
hsl.setH(hsl.getH() + changeInDegrees);
return hsl.getColor();
} | [
"public",
"static",
"Expression",
"adjusthue",
"(",
"Generator",
"generator",
",",
"FunctionCall",
"input",
")",
"{",
"Color",
"color",
"=",
"input",
".",
"getExpectedColorParam",
"(",
"0",
")",
";",
"int",
"changeInDegrees",
"=",
"input",
".",
"getExpectedIntPa... | Adjusts the hue of the given color by the given number of degrees.
@param generator the surrounding generator
@param input the function call to evaluate
@return the result of the evaluation | [
"Adjusts",
"the",
"hue",
"of",
"the",
"given",
"color",
"by",
"the",
"given",
"number",
"of",
"degrees",
"."
] | train | https://github.com/scireum/server-sass/blob/e74af983567f10c43420d70cd31165dd080ba8fc/src/main/java/org/serversass/Functions.java#L78-L84 |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/UserUtil.java | UserUtil.createUsers | public static void createUsers(GreenMailOperations greenMail, InternetAddress... addresses) {
"""
Create users for the given array of addresses. The passwords will be set to the email addresses.
@param greenMail Greenmail instance to create users for
@param addresses Addresses
"""
for (InternetAddr... | java | public static void createUsers(GreenMailOperations greenMail, InternetAddress... addresses) {
for (InternetAddress address : addresses) {
greenMail.setUser(address.getAddress(), address.getAddress());
}
} | [
"public",
"static",
"void",
"createUsers",
"(",
"GreenMailOperations",
"greenMail",
",",
"InternetAddress",
"...",
"addresses",
")",
"{",
"for",
"(",
"InternetAddress",
"address",
":",
"addresses",
")",
"{",
"greenMail",
".",
"setUser",
"(",
"address",
".",
"get... | Create users for the given array of addresses. The passwords will be set to the email addresses.
@param greenMail Greenmail instance to create users for
@param addresses Addresses | [
"Create",
"users",
"for",
"the",
"given",
"array",
"of",
"addresses",
".",
"The",
"passwords",
"will",
"be",
"set",
"to",
"the",
"email",
"addresses",
"."
] | train | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/UserUtil.java#L23-L27 |
jbossws/jbossws-common | src/main/java/org/jboss/ws/common/invocation/InvocationHandlerJAXWS.java | InvocationHandlerJAXWS.onEndpointInstantiated | @Override
public void onEndpointInstantiated(final Endpoint endpoint, final Invocation invocation) {
"""
Injects resources on target bean and calls post construct method.
Finally it registers target bean for predestroy phase.
@param endpoint used for predestroy phase registration process
@param invocation ... | java | @Override
public void onEndpointInstantiated(final Endpoint endpoint, final Invocation invocation)
{
final Object _targetBean = this.getTargetBean(invocation);
// TODO: refactor injection to AS IL
final Reference reference = endpoint.getInstanceProvider().getInstance(_targetBean.getClass().getNa... | [
"@",
"Override",
"public",
"void",
"onEndpointInstantiated",
"(",
"final",
"Endpoint",
"endpoint",
",",
"final",
"Invocation",
"invocation",
")",
"{",
"final",
"Object",
"_targetBean",
"=",
"this",
".",
"getTargetBean",
"(",
"invocation",
")",
";",
"// TODO: refac... | Injects resources on target bean and calls post construct method.
Finally it registers target bean for predestroy phase.
@param endpoint used for predestroy phase registration process
@param invocation current invocation | [
"Injects",
"resources",
"on",
"target",
"bean",
"and",
"calls",
"post",
"construct",
"method",
".",
"Finally",
"it",
"registers",
"target",
"bean",
"for",
"predestroy",
"phase",
"."
] | train | https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/invocation/InvocationHandlerJAXWS.java#L50-L67 |
pietermartin/sqlg | sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/VertexLabel.java | VertexLabel.ensureEdgeLabelExist | public EdgeLabel ensureEdgeLabelExist(final String edgeLabelName, final VertexLabel inVertexLabel, Map<String, PropertyType> properties) {
"""
Ensures that the {@link EdgeLabel} exists. It will be created if it does not exists.
"this" is the out {@link VertexLabel} and inVertexLabel is the inVertexLabel
This met... | java | public EdgeLabel ensureEdgeLabelExist(final String edgeLabelName, final VertexLabel inVertexLabel, Map<String, PropertyType> properties) {
return this.getSchema().ensureEdgeLabelExist(edgeLabelName, this, inVertexLabel, properties);
} | [
"public",
"EdgeLabel",
"ensureEdgeLabelExist",
"(",
"final",
"String",
"edgeLabelName",
",",
"final",
"VertexLabel",
"inVertexLabel",
",",
"Map",
"<",
"String",
",",
"PropertyType",
">",
"properties",
")",
"{",
"return",
"this",
".",
"getSchema",
"(",
")",
".",
... | Ensures that the {@link EdgeLabel} exists. It will be created if it does not exists.
"this" is the out {@link VertexLabel} and inVertexLabel is the inVertexLabel
This method is equivalent to {@link Schema#ensureEdgeLabelExist(String, VertexLabel, VertexLabel, Map)}
@param edgeLabelName The EdgeLabel's label's name.
@p... | [
"Ensures",
"that",
"the",
"{",
"@link",
"EdgeLabel",
"}",
"exists",
".",
"It",
"will",
"be",
"created",
"if",
"it",
"does",
"not",
"exists",
".",
"this",
"is",
"the",
"out",
"{",
"@link",
"VertexLabel",
"}",
"and",
"inVertexLabel",
"is",
"the",
"inVertex... | train | https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/VertexLabel.java#L299-L301 |
JetBrains/xodus | compress/src/main/java/jetbrains/exodus/util/CompressBackupUtil.java | CompressBackupUtil.tar | public static void tar(@NotNull File source, @NotNull File dest) throws IOException {
"""
Compresses the content of source and stores newly created archive in dest.
In case source is a directory, it will be compressed recursively.
@param source file or folder to be archived. Should exist on method call.
@para... | java | public static void tar(@NotNull File source, @NotNull File dest) throws IOException {
if (!source.exists()) {
throw new IllegalArgumentException("No source file or folder exists: " + source.getAbsolutePath());
}
if (dest.exists()) {
throw new IllegalArgumentException("Des... | [
"public",
"static",
"void",
"tar",
"(",
"@",
"NotNull",
"File",
"source",
",",
"@",
"NotNull",
"File",
"dest",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"source",
".",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"("... | Compresses the content of source and stores newly created archive in dest.
In case source is a directory, it will be compressed recursively.
@param source file or folder to be archived. Should exist on method call.
@param dest path to the archive to be created. Should not exist on method call.
@throws IOException ... | [
"Compresses",
"the",
"content",
"of",
"source",
"and",
"stores",
"newly",
"created",
"archive",
"in",
"dest",
".",
"In",
"case",
"source",
"is",
"a",
"directory",
"it",
"will",
"be",
"compressed",
"recursively",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/compress/src/main/java/jetbrains/exodus/util/CompressBackupUtil.java#L188-L203 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/sequences/SequenceGibbsSampler.java | SequenceGibbsSampler.collectSamples | public List<int[]> collectSamples(SequenceModel model, int numSamples, int sampleInterval, int[] initialSequence) {
"""
Collects numSamples samples of sequences, from the distribution over sequences defined
by the sequence model passed on construction.
All samples collected are sampleInterval samples apart, in a... | java | public List<int[]> collectSamples(SequenceModel model, int numSamples, int sampleInterval, int[] initialSequence) {
if (verbose>0) System.err.print("Collecting samples");
listener.setInitialSequence(initialSequence);
List<int[]> result = new ArrayList<int[]>();
int[] sequence = initialSequence;
... | [
"public",
"List",
"<",
"int",
"[",
"]",
">",
"collectSamples",
"(",
"SequenceModel",
"model",
",",
"int",
"numSamples",
",",
"int",
"sampleInterval",
",",
"int",
"[",
"]",
"initialSequence",
")",
"{",
"if",
"(",
"verbose",
">",
"0",
")",
"System",
".",
... | Collects numSamples samples of sequences, from the distribution over sequences defined
by the sequence model passed on construction.
All samples collected are sampleInterval samples apart, in an attempt to reduce
autocorrelation.
@return a Counter containing the sequence samples, as arrays of type int, and their scores | [
"Collects",
"numSamples",
"samples",
"of",
"sequences",
"from",
"the",
"distribution",
"over",
"sequences",
"defined",
"by",
"the",
"sequence",
"model",
"passed",
"on",
"construction",
".",
"All",
"samples",
"collected",
"are",
"sampleInterval",
"samples",
"apart",
... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/sequences/SequenceGibbsSampler.java#L144-L162 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.adjustLinks | public void adjustLinks(Map<String, String> sourceTargetMap, String targetParentFolder) throws CmsException {
"""
This method works just like {@link CmsObject#adjustLinks(String, String)}, but instead of specifying
a single source and target folder, you can specify multiple sources and the corresponding targets i... | java | public void adjustLinks(Map<String, String> sourceTargetMap, String targetParentFolder) throws CmsException {
CmsObject cms = OpenCms.initCmsObject(this);
cms.getRequestContext().setSiteRoot("");
List<CmsPair<String, String>> sourcesAndTargets = new ArrayList<CmsPair<String, String>>();
... | [
"public",
"void",
"adjustLinks",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"sourceTargetMap",
",",
"String",
"targetParentFolder",
")",
"throws",
"CmsException",
"{",
"CmsObject",
"cms",
"=",
"OpenCms",
".",
"initCmsObject",
"(",
"this",
")",
";",
"cms",
... | This method works just like {@link CmsObject#adjustLinks(String, String)}, but instead of specifying
a single source and target folder, you can specify multiple sources and the corresponding targets in
a map of strings.
@param sourceTargetMap a map with the source files as keys and the corresponding targets as values
... | [
"This",
"method",
"works",
"just",
"like",
"{",
"@link",
"CmsObject#adjustLinks",
"(",
"String",
"String",
")",
"}",
"but",
"instead",
"of",
"specifying",
"a",
"single",
"source",
"and",
"target",
"folder",
"you",
"can",
"specify",
"multiple",
"sources",
"and"... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L212-L225 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_boostHistory_date_GET | public OvhBoostHistory serviceName_boostHistory_date_GET(String serviceName, java.util.Date date) throws IOException {
"""
Get this object properties
REST: GET /hosting/web/{serviceName}/boostHistory/{date}
@param serviceName [required] The internal name of your hosting
@param date [required] The date when th... | java | public OvhBoostHistory serviceName_boostHistory_date_GET(String serviceName, java.util.Date date) throws IOException {
String qPath = "/hosting/web/{serviceName}/boostHistory/{date}";
StringBuilder sb = path(qPath, serviceName, date);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp,... | [
"public",
"OvhBoostHistory",
"serviceName_boostHistory_date_GET",
"(",
"String",
"serviceName",
",",
"java",
".",
"util",
".",
"Date",
"date",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/web/{serviceName}/boostHistory/{date}\"",
";",
"StringBuil... | Get this object properties
REST: GET /hosting/web/{serviceName}/boostHistory/{date}
@param serviceName [required] The internal name of your hosting
@param date [required] The date when the change has been requested | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L246-L251 |
jsonld-java/jsonld-java | core/src/main/java/com/github/jsonldjava/core/RDFDataset.java | RDFDataset.addQuad | public void addQuad(final String subject, final String predicate, final String object,
String graph) {
"""
Adds a triple to the specified graph of this dataset
@param subject
the subject for the triple
@param predicate
the predicate for the triple
@param object
the object for the triple
@param... | java | public void addQuad(final String subject, final String predicate, final String object,
String graph) {
if (graph == null) {
graph = "@default";
}
if (!containsKey(graph)) {
put(graph, new ArrayList<Quad>());
}
((ArrayList<Quad>) get(graph)).add... | [
"public",
"void",
"addQuad",
"(",
"final",
"String",
"subject",
",",
"final",
"String",
"predicate",
",",
"final",
"String",
"object",
",",
"String",
"graph",
")",
"{",
"if",
"(",
"graph",
"==",
"null",
")",
"{",
"graph",
"=",
"\"@default\"",
";",
"}",
... | Adds a triple to the specified graph of this dataset
@param subject
the subject for the triple
@param predicate
the predicate for the triple
@param object
the object for the triple
@param graph
the graph to add this triple to | [
"Adds",
"a",
"triple",
"to",
"the",
"specified",
"graph",
"of",
"this",
"dataset"
] | train | https://github.com/jsonld-java/jsonld-java/blob/efeef6ee96029a0011649633457035fa6be42da1/core/src/main/java/com/github/jsonldjava/core/RDFDataset.java#L532-L541 |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/ngmf/util/cosu/luca/ParameterData.java | ParameterData.setLowerAndUpperBounds | public void setLowerAndUpperBounds(double lower, double upper) {
"""
Set the lower and upper bounds, and the actual bounds are determined.
"""
if (data == null) {
return;
}
this.originalLowerBound = lower;
this.originalUpperBound = upper;
if (originalLowerBo... | java | public void setLowerAndUpperBounds(double lower, double upper) {
if (data == null) {
return;
}
this.originalLowerBound = lower;
this.originalUpperBound = upper;
if (originalLowerBound < min) {
offset = Math.abs(originalLowerBound) + 10;
} else {
... | [
"public",
"void",
"setLowerAndUpperBounds",
"(",
"double",
"lower",
",",
"double",
"upper",
")",
"{",
"if",
"(",
"data",
"==",
"null",
")",
"{",
"return",
";",
"}",
"this",
".",
"originalLowerBound",
"=",
"lower",
";",
"this",
".",
"originalUpperBound",
"=... | Set the lower and upper bounds, and the actual bounds are determined. | [
"Set",
"the",
"lower",
"and",
"upper",
"bounds",
"and",
"the",
"actual",
"bounds",
"are",
"determined",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/ngmf/util/cosu/luca/ParameterData.java#L229-L251 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/buffer/factory/CudaDataBufferFactory.java | CudaDataBufferFactory.createDouble | @Override
public DataBuffer createDouble(double[] data, boolean copy, MemoryWorkspace workspace) {
"""
Creates a double data buffer
@param data the data to create the buffer from
@param copy
@param workspace @return the new buffer
"""
return new CudaDoubleDataBuffer(data, copy, workspace)... | java | @Override
public DataBuffer createDouble(double[] data, boolean copy, MemoryWorkspace workspace) {
return new CudaDoubleDataBuffer(data, copy, workspace);
} | [
"@",
"Override",
"public",
"DataBuffer",
"createDouble",
"(",
"double",
"[",
"]",
"data",
",",
"boolean",
"copy",
",",
"MemoryWorkspace",
"workspace",
")",
"{",
"return",
"new",
"CudaDoubleDataBuffer",
"(",
"data",
",",
"copy",
",",
"workspace",
")",
";",
"}... | Creates a double data buffer
@param data the data to create the buffer from
@param copy
@param workspace @return the new buffer | [
"Creates",
"a",
"double",
"data",
"buffer"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/buffer/factory/CudaDataBufferFactory.java#L840-L843 |
alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/command/HealthCheck.java | HealthCheck.isHealthyUnderPath | private static boolean isHealthyUnderPath(String path, long timeout) {
"""
return false if the health check failed when running the scripts under the path
"""
if (path == null) {
return true;
}
List<String> commands = generateCommands(path);
if (commands != null && c... | java | private static boolean isHealthyUnderPath(String path, long timeout) {
if (path == null) {
return true;
}
List<String> commands = generateCommands(path);
if (commands != null && commands.size() > 0) {
for (String command : commands) {
ScriptProcess... | [
"private",
"static",
"boolean",
"isHealthyUnderPath",
"(",
"String",
"path",
",",
"long",
"timeout",
")",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"List",
"<",
"String",
">",
"commands",
"=",
"generateCommands",
"(",
"p... | return false if the health check failed when running the scripts under the path | [
"return",
"false",
"if",
"the",
"health",
"check",
"failed",
"when",
"running",
"the",
"scripts",
"under",
"the",
"path"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/command/HealthCheck.java#L65-L82 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/OperationContextImpl.java | OperationContextImpl.getServiceRegistry | ServiceRegistry getServiceRegistry(final boolean modify, final Step registryActiveStep) {
"""
Gets a service registry that will ensure
{@link org.jboss.msc.service.ServiceController#setMode(org.jboss.msc.service.ServiceController.Mode) changes to the mode}
of registered services will result in subsequent verific... | java | ServiceRegistry getServiceRegistry(final boolean modify, final Step registryActiveStep) {
if (modify) {
readOnly = false;
}
assert isControllingThread();
Stage currentStage = this.currentStage;
if (modify) {
if (!isRuntimeChangeAllowed()) {
... | [
"ServiceRegistry",
"getServiceRegistry",
"(",
"final",
"boolean",
"modify",
",",
"final",
"Step",
"registryActiveStep",
")",
"{",
"if",
"(",
"modify",
")",
"{",
"readOnly",
"=",
"false",
";",
"}",
"assert",
"isControllingThread",
"(",
")",
";",
"Stage",
"curre... | Gets a service registry that will ensure
{@link org.jboss.msc.service.ServiceController#setMode(org.jboss.msc.service.ServiceController.Mode) changes to the mode}
of registered services will result in subsequent verification of service stability.
@param modify {@code true} if the caller intends to modify state
@param ... | [
"Gets",
"a",
"service",
"registry",
"that",
"will",
"ensure",
"{",
"@link",
"org",
".",
"jboss",
".",
"msc",
".",
"service",
".",
"ServiceController#setMode",
"(",
"org",
".",
"jboss",
".",
"msc",
".",
"service",
".",
"ServiceController",
".",
"Mode",
")",... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/OperationContextImpl.java#L604-L626 |
dihedron/dihedron-commons | src/main/java/org/dihedron/core/zip/ZipArchive.java | ZipArchive.addFile | public void addFile(String zipEntry, File file) throws IOException {
"""
Adds a file to a ZIP archive.
@param zipEntry
the name of entry in the archive; if null, the name of the original
file is used.
@param file
File object representing the file to be added to the archive.
"""
String zipEntryName = S... | java | public void addFile(String zipEntry, File file) throws IOException {
String zipEntryName = Strings.isValid(zipEntry) ? zipEntry : file.getName();
logger.debug("adding '{}' as '{}'", file.getName(), zipEntryName);
try(InputStream input = new FileInputStream(file)) {
addFile(zipEntryName, input);
}
} | [
"public",
"void",
"addFile",
"(",
"String",
"zipEntry",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"String",
"zipEntryName",
"=",
"Strings",
".",
"isValid",
"(",
"zipEntry",
")",
"?",
"zipEntry",
":",
"file",
".",
"getName",
"(",
")",
";",
"... | Adds a file to a ZIP archive.
@param zipEntry
the name of entry in the archive; if null, the name of the original
file is used.
@param file
File object representing the file to be added to the archive. | [
"Adds",
"a",
"file",
"to",
"a",
"ZIP",
"archive",
"."
] | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/core/zip/ZipArchive.java#L145-L151 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.addWeeks | public static Date addWeeks(Date d, int weeks) {
"""
Add weeks to a date
@param d date
@param weeks weeks
@return new date
"""
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.WEEK_OF_YEAR, weeks);
return cal.getTime();
} | java | public static Date addWeeks(Date d, int weeks) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.WEEK_OF_YEAR, weeks);
return cal.getTime();
} | [
"public",
"static",
"Date",
"addWeeks",
"(",
"Date",
"d",
",",
"int",
"weeks",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"add",
"(",
"Calendar",
".",
"WEE... | Add weeks to a date
@param d date
@param weeks weeks
@return new date | [
"Add",
"weeks",
"to",
"a",
"date"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L496-L501 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDisjointDataPropertiesAxiomImpl_CustomFieldSerializer.java | OWLDisjointDataPropertiesAxiomImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLDisjointDataPropertiesAxiomImpl instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLDisjointDataPropertiesAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLDisjointDataPropertiesAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
... | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDisjointDataPropertiesAxiomImpl_CustomFieldSerializer.java#L74-L77 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/link/ComponentEnhancer.java | ComponentEnhancer.injectComponent | @SuppressWarnings("unchecked")
private static void injectComponent(final FacadeReady<?> component, final Field field, final Object... keyParts) {
"""
Inject a component into the property of an other.
@param component the component
@param field the field
@param keyParts the key parts
"""
try {... | java | @SuppressWarnings("unchecked")
private static void injectComponent(final FacadeReady<?> component, final Field field, final Object... keyParts) {
try {
if (Command.class.isAssignableFrom(field.getType())) {
ClassUtility.setFieldValue(field, component, component.localFacade().glo... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"void",
"injectComponent",
"(",
"final",
"FacadeReady",
"<",
"?",
">",
"component",
",",
"final",
"Field",
"field",
",",
"final",
"Object",
"...",
"keyParts",
")",
"{",
"try",
"{",
"if"... | Inject a component into the property of an other.
@param component the component
@param field the field
@param keyParts the key parts | [
"Inject",
"a",
"component",
"into",
"the",
"property",
"of",
"an",
"other",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/link/ComponentEnhancer.java#L137-L152 |
Azure/azure-sdk-for-java | redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java | RedisInner.beginExportData | public void beginExportData(String resourceGroupName, String name, ExportRDBParameters parameters) {
"""
Export data from the redis cache to blobs in a container.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@param parameters Parameters for Redis export ope... | java | public void beginExportData(String resourceGroupName, String name, ExportRDBParameters parameters) {
beginExportDataWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().body();
} | [
"public",
"void",
"beginExportData",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"ExportRDBParameters",
"parameters",
")",
"{",
"beginExportDataWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
",",
"parameters",
")",
".",
"toBlocking... | Export data from the redis cache to blobs in a container.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@param parameters Parameters for Redis export operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if... | [
"Export",
"data",
"from",
"the",
"redis",
"cache",
"to",
"blobs",
"in",
"a",
"container",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java#L1584-L1586 |
apereo/cas | support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/AbstractSaml20ObjectBuilder.java | AbstractSaml20ObjectBuilder.newAssertion | public Assertion newAssertion(final AuthnStatement authnStatement, final String issuer,
final ZonedDateTime issuedAt, final String id) {
"""
Create a new SAML1 response object.
@param authnStatement the authn statement
@param issuer the issuer
@param issuedAt th... | java | public Assertion newAssertion(final AuthnStatement authnStatement, final String issuer,
final ZonedDateTime issuedAt, final String id) {
val list = new ArrayList<Statement>();
list.add(authnStatement);
return newAssertion(list, issuer, issuedAt, id);
} | [
"public",
"Assertion",
"newAssertion",
"(",
"final",
"AuthnStatement",
"authnStatement",
",",
"final",
"String",
"issuer",
",",
"final",
"ZonedDateTime",
"issuedAt",
",",
"final",
"String",
"id",
")",
"{",
"val",
"list",
"=",
"new",
"ArrayList",
"<",
"Statement"... | Create a new SAML1 response object.
@param authnStatement the authn statement
@param issuer the issuer
@param issuedAt the issued at
@param id the id
@return the assertion | [
"Create",
"a",
"new",
"SAML1",
"response",
"object",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/AbstractSaml20ObjectBuilder.java#L170-L175 |
apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java | DescriptorProperties.putIndexedFixedProperties | public void putIndexedFixedProperties(String key, List<String> subKeys, List<List<String>> subKeyValues) {
"""
Adds an indexed sequence of properties (with sub-properties) under a common key.
<p>For example:
<pre>
schema.fields.0.type = INT, schema.fields.0.name = test
schema.fields.1.type = LONG, schema.f... | java | public void putIndexedFixedProperties(String key, List<String> subKeys, List<List<String>> subKeyValues) {
checkNotNull(key);
checkNotNull(subKeys);
checkNotNull(subKeyValues);
for (int idx = 0; idx < subKeyValues.size(); idx++) {
final List<String> values = subKeyValues.get(idx);
if (values == null || va... | [
"public",
"void",
"putIndexedFixedProperties",
"(",
"String",
"key",
",",
"List",
"<",
"String",
">",
"subKeys",
",",
"List",
"<",
"List",
"<",
"String",
">",
">",
"subKeyValues",
")",
"{",
"checkNotNull",
"(",
"key",
")",
";",
"checkNotNull",
"(",
"subKey... | Adds an indexed sequence of properties (with sub-properties) under a common key.
<p>For example:
<pre>
schema.fields.0.type = INT, schema.fields.0.name = test
schema.fields.1.type = LONG, schema.fields.1.name = test2
</pre>
<p>The arity of each subKeyValues must match the arity of propertyKeys. | [
"Adds",
"an",
"indexed",
"sequence",
"of",
"properties",
"(",
"with",
"sub",
"-",
"properties",
")",
"under",
"a",
"common",
"key",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java#L202-L215 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.listCustomPrebuiltIntents | public List<IntentClassifier> listCustomPrebuiltIntents(UUID appId, String versionId) {
"""
Gets custom prebuilt intents information of this application.
@param appId The application ID.
@param versionId The version ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorRe... | java | public List<IntentClassifier> listCustomPrebuiltIntents(UUID appId, String versionId) {
return listCustomPrebuiltIntentsWithServiceResponseAsync(appId, versionId).toBlocking().single().body();
} | [
"public",
"List",
"<",
"IntentClassifier",
">",
"listCustomPrebuiltIntents",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
")",
"{",
"return",
"listCustomPrebuiltIntentsWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
")",
".",
"toBlocking",
"(",
")",
... | Gets custom prebuilt intents information of this application.
@param appId The application ID.
@param versionId The version ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@throws RuntimeException all other wrapped... | [
"Gets",
"custom",
"prebuilt",
"intents",
"information",
"of",
"this",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L5804-L5806 |
palatable/lambda | src/main/java/com/jnape/palatable/lambda/adt/hmap/HMap.java | HMap.put | public <V> HMap put(TypeSafeKey<?, V> key, V value) {
"""
Store a value for the given key.
@param key the key
@param value the value
@param <V> the value type
@return the updated HMap
"""
return alter(t -> t.put(key, view(key.mirror(), value)));
} | java | public <V> HMap put(TypeSafeKey<?, V> key, V value) {
return alter(t -> t.put(key, view(key.mirror(), value)));
} | [
"public",
"<",
"V",
">",
"HMap",
"put",
"(",
"TypeSafeKey",
"<",
"?",
",",
"V",
">",
"key",
",",
"V",
"value",
")",
"{",
"return",
"alter",
"(",
"t",
"->",
"t",
".",
"put",
"(",
"key",
",",
"view",
"(",
"key",
".",
"mirror",
"(",
")",
",",
... | Store a value for the given key.
@param key the key
@param value the value
@param <V> the value type
@return the updated HMap | [
"Store",
"a",
"value",
"for",
"the",
"given",
"key",
"."
] | train | https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/adt/hmap/HMap.java#L73-L75 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.rotateLocalX | public Matrix4f rotateLocalX(float ang, Matrix4f dest) {
"""
Pre-multiply a rotation around the X axis to this matrix by rotating the given amount of radians
about the X axis and store the result in <code>dest</code>.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vecto... | java | public Matrix4f rotateLocalX(float ang, Matrix4f dest) {
float sin = (float) Math.sin(ang);
float cos = (float) Math.cosFromSin(sin, ang);
float nm01 = cos * m01 - sin * m02;
float nm02 = sin * m01 + cos * m02;
float nm11 = cos * m11 - sin * m12;
float nm12 = sin * m11 + ... | [
"public",
"Matrix4f",
"rotateLocalX",
"(",
"float",
"ang",
",",
"Matrix4f",
"dest",
")",
"{",
"float",
"sin",
"=",
"(",
"float",
")",
"Math",
".",
"sin",
"(",
"ang",
")",
";",
"float",
"cos",
"=",
"(",
"float",
")",
"Math",
".",
"cosFromSin",
"(",
... | Pre-multiply a rotation around the X axis to this matrix by rotating the given amount of radians
about the X axis and store the result in <code>dest</code>.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clockwise around the rotation axis, when viewing along the ... | [
"Pre",
"-",
"multiply",
"a",
"rotation",
"around",
"the",
"X",
"axis",
"to",
"this",
"matrix",
"by",
"rotating",
"the",
"given",
"amount",
"of",
"radians",
"about",
"the",
"X",
"axis",
"and",
"store",
"the",
"result",
"in",
"<code",
">",
"dest<",
"/",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L6284-L6313 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.deletePrebuiltEntityRoleAsync | public Observable<OperationStatus> deletePrebuiltEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId) {
"""
Delete an entity role.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role Id.
@throws IllegalArgumentEx... | java | public Observable<OperationStatus> deletePrebuiltEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId) {
return deletePrebuiltEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() {
@Override
... | [
"public",
"Observable",
"<",
"OperationStatus",
">",
"deletePrebuiltEntityRoleAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
")",
"{",
"return",
"deletePrebuiltEntityRoleWithServiceResponseAsync",
"(",
"appId",
... | Delete an entity role.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role Id.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationStatus object | [
"Delete",
"an",
"entity",
"role",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L11479-L11486 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.listMultiRoleMetricDefinitionsWithServiceResponseAsync | public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> listMultiRoleMetricDefinitionsWithServiceResponseAsync(final String resourceGroupName, final String name) {
"""
Get metric definitions for a multi-role pool of an App Service Environment.
Get metric definitions for a multi-role pool of an App... | java | public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> listMultiRoleMetricDefinitionsWithServiceResponseAsync(final String resourceGroupName, final String name) {
return listMultiRoleMetricDefinitionsSinglePageAsync(resourceGroupName, name)
.concatMap(new Func1<ServiceResponse<Page<... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"ResourceMetricDefinitionInner",
">",
">",
">",
"listMultiRoleMetricDefinitionsWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
")",
"{",
"return",
"... | Get metric definitions for a multi-role pool of an App Service Environment.
Get metric definitions for a multi-role pool of an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@throws IllegalArgumentException th... | [
"Get",
"metric",
"definitions",
"for",
"a",
"multi",
"-",
"role",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
".",
"Get",
"metric",
"definitions",
"for",
"a",
"multi",
"-",
"role",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L3024-L3036 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java | Expressions.dateTimeTemplate | public static <T extends Comparable<?>> DateTimeTemplate<T> dateTimeTemplate(Class<? extends T> cl, String template, List<?> args) {
"""
Create a new Template expression
@param cl type of expression
@param template template
@param args template parameters
@return template expression
"""
return da... | java | public static <T extends Comparable<?>> DateTimeTemplate<T> dateTimeTemplate(Class<? extends T> cl, String template, List<?> args) {
return dateTimeTemplate(cl, createTemplate(template), args);
} | [
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"?",
">",
">",
"DateTimeTemplate",
"<",
"T",
">",
"dateTimeTemplate",
"(",
"Class",
"<",
"?",
"extends",
"T",
">",
"cl",
",",
"String",
"template",
",",
"List",
"<",
"?",
">",
"args",
")",
"... | Create a new Template expression
@param cl type of expression
@param template template
@param args template parameters
@return template expression | [
"Create",
"a",
"new",
"Template",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L591-L593 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/session/impl/HttpSessionContextImpl.java | HttpSessionContextImpl.getIHttpSession | public HttpSession getIHttpSession(HttpServletRequest _request, HttpServletResponse _response, boolean create) {
"""
/*
This method called by webcontainer when app requests session. We always
pass false as cacheOnly parm; we need to search for existing session in
cache and persistent stores when the app request... | java | public HttpSession getIHttpSession(HttpServletRequest _request, HttpServletResponse _response, boolean create)
{
return getIHttpSession(_request, _response, create, false);
} | [
"public",
"HttpSession",
"getIHttpSession",
"(",
"HttpServletRequest",
"_request",
",",
"HttpServletResponse",
"_response",
",",
"boolean",
"create",
")",
"{",
"return",
"getIHttpSession",
"(",
"_request",
",",
"_response",
",",
"create",
",",
"false",
")",
";",
"... | /*
This method called by webcontainer when app requests session. We always
pass false as cacheOnly parm; we need to search for existing session in
cache and persistent stores when the app requests session | [
"/",
"*",
"This",
"method",
"called",
"by",
"webcontainer",
"when",
"app",
"requests",
"session",
".",
"We",
"always",
"pass",
"false",
"as",
"cacheOnly",
"parm",
";",
"we",
"need",
"to",
"search",
"for",
"existing",
"session",
"in",
"cache",
"and",
"persi... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/session/impl/HttpSessionContextImpl.java#L659-L662 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditorFactory.java | AuditorFactory.getAuditor | public static IHEAuditor getAuditor(Class<? extends IHEAuditor> clazz, boolean useGlobalConfig, boolean useGlobalContext) {
"""
Get an auditor instance for the specified auditor class. Auditor
will use a standalone configuration or context if a non-global
configuration / context is requested. If a standalone c... | java | public static IHEAuditor getAuditor(Class<? extends IHEAuditor> clazz, boolean useGlobalConfig, boolean useGlobalContext)
{
AuditorModuleConfig config = AuditorModuleContext.getContext().getConfig();
if (!useGlobalConfig) {
config = config.clone();
}
return getAuditor(clazz, config, useGlobalContext);
} | [
"public",
"static",
"IHEAuditor",
"getAuditor",
"(",
"Class",
"<",
"?",
"extends",
"IHEAuditor",
">",
"clazz",
",",
"boolean",
"useGlobalConfig",
",",
"boolean",
"useGlobalContext",
")",
"{",
"AuditorModuleConfig",
"config",
"=",
"AuditorModuleContext",
".",
"getCon... | Get an auditor instance for the specified auditor class. Auditor
will use a standalone configuration or context if a non-global
configuration / context is requested. If a standalone configuration
is requested, the existing global configuration is cloned and used as the
base configuration.
@param clazz Class to insta... | [
"Get",
"an",
"auditor",
"instance",
"for",
"the",
"specified",
"auditor",
"class",
".",
"Auditor",
"will",
"use",
"a",
"standalone",
"configuration",
"or",
"context",
"if",
"a",
"non",
"-",
"global",
"configuration",
"/",
"context",
"is",
"requested",
".",
"... | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditorFactory.java#L87-L95 |
Stratio/stratio-cassandra | src/java/com/stratio/cassandra/contrib/ComparatorChain.java | ComparatorChain.setComparator | public void setComparator(int index, Comparator<T> comparator, boolean reverse) {
"""
Replace the Comparator at the given index in the ComparatorChain, using the given sortFields order
@param index index of the Comparator to replace
@param comparator Comparator to set
@param reverse false = forward so... | java | public void setComparator(int index, Comparator<T> comparator, boolean reverse) {
checkLocked();
comparatorChain.set(index, comparator);
if (reverse == true) {
orderingBits.set(index);
} else {
orderingBits.clear(index);
}
} | [
"public",
"void",
"setComparator",
"(",
"int",
"index",
",",
"Comparator",
"<",
"T",
">",
"comparator",
",",
"boolean",
"reverse",
")",
"{",
"checkLocked",
"(",
")",
";",
"comparatorChain",
".",
"set",
"(",
"index",
",",
"comparator",
")",
";",
"if",
"("... | Replace the Comparator at the given index in the ComparatorChain, using the given sortFields order
@param index index of the Comparator to replace
@param comparator Comparator to set
@param reverse false = forward sortFields order; true = reverse sortFields order | [
"Replace",
"the",
"Comparator",
"at",
"the",
"given",
"index",
"in",
"the",
"ComparatorChain",
"using",
"the",
"given",
"sortFields",
"order"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/contrib/ComparatorChain.java#L162-L171 |
logic-ng/LogicNG | src/main/java/org/logicng/formulas/FormulaFactory.java | FormulaFactory.addFormulaOr | private void addFormulaOr(final LinkedHashSet<Formula> ops, final Formula f) {
"""
Adds a given formula to a list of operands. If the formula is the neutral element for the respective n-ary
operation it will be skipped. If a complementary formula is already present in the list of operands or the
formula is the... | java | private void addFormulaOr(final LinkedHashSet<Formula> ops, final Formula f) {
if (f.type == FALSE) {
this.formulaAdditionResult[0] = true;
this.formulaAdditionResult[1] = true;
} else if (f.type == TRUE || containsComplement(ops, f)) {
this.formulaAdditionResult[0] = false;
this.formula... | [
"private",
"void",
"addFormulaOr",
"(",
"final",
"LinkedHashSet",
"<",
"Formula",
">",
"ops",
",",
"final",
"Formula",
"f",
")",
"{",
"if",
"(",
"f",
".",
"type",
"==",
"FALSE",
")",
"{",
"this",
".",
"formulaAdditionResult",
"[",
"0",
"]",
"=",
"true"... | Adds a given formula to a list of operands. If the formula is the neutral element for the respective n-ary
operation it will be skipped. If a complementary formula is already present in the list of operands or the
formula is the dual element, {@code false} is stored as first element of the result array,
otherwise {@c... | [
"Adds",
"a",
"given",
"formula",
"to",
"a",
"list",
"of",
"operands",
".",
"If",
"the",
"formula",
"is",
"the",
"neutral",
"element",
"for",
"the",
"respective",
"n",
"-",
"ary",
"operation",
"it",
"will",
"be",
"skipped",
".",
"If",
"a",
"complementary"... | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/FormulaFactory.java#L954-L966 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagContainer.java | CmsJspTagContainer.getNestedContainerName | public static String getNestedContainerName(String name, String parentIstanceId, String namePrefix) {
"""
Returns the prefixed nested container name.<p>
This will be either {parentInstanceId}-{name} or {namePrefix}-{name} or in case namePrefix equals 'none' {name} only.<p>
@param name the container name
@para... | java | public static String getNestedContainerName(String name, String parentIstanceId, String namePrefix) {
String prefix;
if (CmsStringUtil.isEmptyOrWhitespaceOnly(namePrefix)) {
prefix = parentIstanceId + "-";
} else if ("none".equals(namePrefix)) {
prefix = "";
} el... | [
"public",
"static",
"String",
"getNestedContainerName",
"(",
"String",
"name",
",",
"String",
"parentIstanceId",
",",
"String",
"namePrefix",
")",
"{",
"String",
"prefix",
";",
"if",
"(",
"CmsStringUtil",
".",
"isEmptyOrWhitespaceOnly",
"(",
"namePrefix",
")",
")"... | Returns the prefixed nested container name.<p>
This will be either {parentInstanceId}-{name} or {namePrefix}-{name} or in case namePrefix equals 'none' {name} only.<p>
@param name the container name
@param parentIstanceId the parent instance id
@param namePrefix the name prefix attribute
@return the nested container ... | [
"Returns",
"the",
"prefixed",
"nested",
"container",
"name",
".",
"<p",
">",
"This",
"will",
"be",
"either",
"{",
"parentInstanceId",
"}",
"-",
"{",
"name",
"}",
"or",
"{",
"namePrefix",
"}",
"-",
"{",
"name",
"}",
"or",
"in",
"case",
"namePrefix",
"eq... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagContainer.java#L351-L362 |
hawkular/hawkular-apm | api/src/main/java/org/hawkular/apm/api/services/internal/CommunicationSummaryTreeBuilder.java | CommunicationSummaryTreeBuilder.initCommunicationSummaryTreeNode | protected static void initCommunicationSummaryTreeNode(CommunicationSummaryStatistics node,
Map<String, CommunicationSummaryStatistics> nodeMap, Set<String> usedIds) {
"""
This method recursively builds the communication summary tree, using the supplied node map,
taking copies of each node to ensure t... | java | protected static void initCommunicationSummaryTreeNode(CommunicationSummaryStatistics node,
Map<String, CommunicationSummaryStatistics> nodeMap, Set<String> usedIds) {
for (String id : node.getOutbound().keySet()) {
if (!usedIds.contains(id)) {
CommunicationSummaryStatist... | [
"protected",
"static",
"void",
"initCommunicationSummaryTreeNode",
"(",
"CommunicationSummaryStatistics",
"node",
",",
"Map",
"<",
"String",
",",
"CommunicationSummaryStatistics",
">",
"nodeMap",
",",
"Set",
"<",
"String",
">",
"usedIds",
")",
"{",
"for",
"(",
"Stri... | This method recursively builds the communication summary tree, using the supplied node map,
taking copies of each node to ensure the original list is not modified as some of the nodes
may be shared between multiple trees. If a node is add to the tree, its id will be added to the
'used' list, to ensure that repetitions ... | [
"This",
"method",
"recursively",
"builds",
"the",
"communication",
"summary",
"tree",
"using",
"the",
"supplied",
"node",
"map",
"taking",
"copies",
"of",
"each",
"node",
"to",
"ensure",
"the",
"original",
"list",
"is",
"not",
"modified",
"as",
"some",
"of",
... | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/api/src/main/java/org/hawkular/apm/api/services/internal/CommunicationSummaryTreeBuilder.java#L89-L111 |
jenkinsci/email-ext-plugin | src/main/java/hudson/plugins/emailext/plugins/CssInliner.java | CssInliner.extractStyles | private void extractStyles(Document doc) {
"""
Extracts styles from the stylesheet and applies them to a
<code>cssstyle</code> attribute. This is because the styles need to be
applied sequentially, but before the <code>style</code> defined for the
element inline.
@param doc the html document
"""
... | java | private void extractStyles(Document doc) {
String stylesheet = fetchStyles(doc);
String trimmedStylesheet = stylesheet.replaceAll("\n", "").replaceAll("/\\*.*?\\*/", "").replaceAll(" +", " ");
String styleRules = trimmedStylesheet.trim(), delims = "{}";
StringTokenizer st = new StringTo... | [
"private",
"void",
"extractStyles",
"(",
"Document",
"doc",
")",
"{",
"String",
"stylesheet",
"=",
"fetchStyles",
"(",
"doc",
")",
";",
"String",
"trimmedStylesheet",
"=",
"stylesheet",
".",
"replaceAll",
"(",
"\"\\n\"",
",",
"\"\"",
")",
".",
"replaceAll",
... | Extracts styles from the stylesheet and applies them to a
<code>cssstyle</code> attribute. This is because the styles need to be
applied sequentially, but before the <code>style</code> defined for the
element inline.
@param doc the html document | [
"Extracts",
"styles",
"from",
"the",
"stylesheet",
"and",
"applies",
"them",
"to",
"a",
"<code",
">",
"cssstyle<",
"/",
"code",
">",
"attribute",
".",
"This",
"is",
"because",
"the",
"styles",
"need",
"to",
"be",
"applied",
"sequentially",
"but",
"before",
... | train | https://github.com/jenkinsci/email-ext-plugin/blob/21fbd402665848a18205b26751424149e51e86e4/src/main/java/hudson/plugins/emailext/plugins/CssInliner.java#L156-L172 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceInfoMap.java | SourceInfoMap.getFieldLine | public @CheckForNull
SourceLineRange getFieldLine(String className, String fieldName) {
"""
Look up the line number range for a field.
@param className
name of class containing the field
@param fieldName
name of field
@return the line number range, or null if no line number is known for the
field
"... | java | public @CheckForNull
SourceLineRange getFieldLine(String className, String fieldName) {
return fieldLineMap.get(new FieldDescriptor(className, fieldName));
} | [
"public",
"@",
"CheckForNull",
"SourceLineRange",
"getFieldLine",
"(",
"String",
"className",
",",
"String",
"fieldName",
")",
"{",
"return",
"fieldLineMap",
".",
"get",
"(",
"new",
"FieldDescriptor",
"(",
"className",
",",
"fieldName",
")",
")",
";",
"}"
] | Look up the line number range for a field.
@param className
name of class containing the field
@param fieldName
name of field
@return the line number range, or null if no line number is known for the
field | [
"Look",
"up",
"the",
"line",
"number",
"range",
"for",
"a",
"field",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceInfoMap.java#L293-L296 |
alkacon/opencms-core | src/org/opencms/ui/components/CmsBasicDialog.java | CmsBasicDialog.displayResourceInfo | public void displayResourceInfo(List<CmsResource> resources, String messageKey) {
"""
Display the resource indos panel with panel message.<p>
@param resources to show info for
@param messageKey of the panel
"""
m_infoResources = Lists.newArrayList(resources);
if (m_infoComponent != null) {... | java | public void displayResourceInfo(List<CmsResource> resources, String messageKey) {
m_infoResources = Lists.newArrayList(resources);
if (m_infoComponent != null) {
m_mainPanel.removeComponent(m_infoComponent);
m_infoComponent = null;
}
if ((resources != null) && !r... | [
"public",
"void",
"displayResourceInfo",
"(",
"List",
"<",
"CmsResource",
">",
"resources",
",",
"String",
"messageKey",
")",
"{",
"m_infoResources",
"=",
"Lists",
".",
"newArrayList",
"(",
"resources",
")",
";",
"if",
"(",
"m_infoComponent",
"!=",
"null",
")"... | Display the resource indos panel with panel message.<p>
@param resources to show info for
@param messageKey of the panel | [
"Display",
"the",
"resource",
"indos",
"panel",
"with",
"panel",
"message",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsBasicDialog.java#L289-L314 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/data/conversion/DefaultableConverter.java | DefaultableConverter.canConvert | @Override
public boolean canConvert(Class<?> fromType, Class<?> toType) {
"""
Determines whether this {@link Converter} can convert {@link Object Objects}
{@link Class from type} {@link Class to type}.
@param fromType {@link Class type} to convert from.
@param toType {@link Class type} to convert to.
@retu... | java | @Override
public boolean canConvert(Class<?> fromType, Class<?> toType) {
return (fromType == null && getDefaultValue() != null);
} | [
"@",
"Override",
"public",
"boolean",
"canConvert",
"(",
"Class",
"<",
"?",
">",
"fromType",
",",
"Class",
"<",
"?",
">",
"toType",
")",
"{",
"return",
"(",
"fromType",
"==",
"null",
"&&",
"getDefaultValue",
"(",
")",
"!=",
"null",
")",
";",
"}"
] | Determines whether this {@link Converter} can convert {@link Object Objects}
{@link Class from type} {@link Class to type}.
@param fromType {@link Class type} to convert from.
@param toType {@link Class type} to convert to.
@return a boolean indicating whether this {@link Converter} can convert {@link Object Objects}
... | [
"Determines",
"whether",
"this",
"{",
"@link",
"Converter",
"}",
"can",
"convert",
"{",
"@link",
"Object",
"Objects",
"}",
"{",
"@link",
"Class",
"from",
"type",
"}",
"{",
"@link",
"Class",
"to",
"type",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/data/conversion/DefaultableConverter.java#L65-L68 |
fnklabs/draenei | src/main/java/com/fnklabs/draenei/analytics/TextUtils.java | TextUtils.isNormalWord | public boolean isNormalWord(@NotNull String word, @NotNull Language language) {
"""
Check if word is normal word
@param word Checked word
@return True if it normal form of word
"""
Timer timer = MetricsFactory.getMetrics().getTimer(MetricsType.TEXT_UTILS_IS_NORMAL_WORD.name());
if (Strin... | java | public boolean isNormalWord(@NotNull String word, @NotNull Language language) {
Timer timer = MetricsFactory.getMetrics().getTimer(MetricsType.TEXT_UTILS_IS_NORMAL_WORD.name());
if (StringUtils.isEmpty(word)) {
return false;
}
try {
Timer morphTimer = MetricsFac... | [
"public",
"boolean",
"isNormalWord",
"(",
"@",
"NotNull",
"String",
"word",
",",
"@",
"NotNull",
"Language",
"language",
")",
"{",
"Timer",
"timer",
"=",
"MetricsFactory",
".",
"getMetrics",
"(",
")",
".",
"getTimer",
"(",
"MetricsType",
".",
"TEXT_UTILS_IS_NO... | Check if word is normal word
@param word Checked word
@return True if it normal form of word | [
"Check",
"if",
"word",
"is",
"normal",
"word"
] | train | https://github.com/fnklabs/draenei/blob/0a8cac54f1f635be3e2950375a23291d38453ae8/src/main/java/com/fnklabs/draenei/analytics/TextUtils.java#L90-L112 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/ApplicationOperations.java | ApplicationOperations.getApplication | public ApplicationSummary getApplication(String applicationId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
"""
Gets information about the specified application.
@param applicationId The ID of the application to get.
@param additionalBehaviors A collection of {@l... | java | public ApplicationSummary getApplication(String applicationId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
ApplicationGetOptions options = new ApplicationGetOptions();
BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors... | [
"public",
"ApplicationSummary",
"getApplication",
"(",
"String",
"applicationId",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"ApplicationGetOptions",
"options",
"=",
"new",
"Appli... | Gets information about the specified application.
@param applicationId The ID of the application to get.
@param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied to the Batch service request.
@return An {@link ApplicationSummary} containing information about the specified appli... | [
"Gets",
"information",
"about",
"the",
"specified",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/ApplicationOperations.java#L101-L107 |
Azure/azure-sdk-for-java | policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyDefinitionsInner.java | PolicyDefinitionsInner.createOrUpdate | public PolicyDefinitionInner createOrUpdate(String policyDefinitionName, PolicyDefinitionInner parameters) {
"""
Creates or updates a policy definition.
@param policyDefinitionName The name of the policy definition to create.
@param parameters The policy definition properties.
@throws IllegalArgumentException... | java | public PolicyDefinitionInner createOrUpdate(String policyDefinitionName, PolicyDefinitionInner parameters) {
return createOrUpdateWithServiceResponseAsync(policyDefinitionName, parameters).toBlocking().single().body();
} | [
"public",
"PolicyDefinitionInner",
"createOrUpdate",
"(",
"String",
"policyDefinitionName",
",",
"PolicyDefinitionInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"policyDefinitionName",
",",
"parameters",
")",
".",
"toBlocking",
"(",
... | Creates or updates a policy definition.
@param policyDefinitionName The name of the policy definition to create.
@param parameters The policy definition properties.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws Runti... | [
"Creates",
"or",
"updates",
"a",
"policy",
"definition",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyDefinitionsInner.java#L128-L130 |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/StringBindings.java | StringBindings.transforming | public static StringBinding transforming(ObservableValue<String> text, Function<String, String> transformer) {
"""
Creates a string binding that contains the value of the given observable string transformed using the supplied
function.
If the given observable string has a value of `null` the created binding wi... | java | public static StringBinding transforming(ObservableValue<String> text, Function<String, String> transformer) {
return Bindings.createStringBinding(()
-> {
Function<String, String> func = transformer == null ? Function.identity() : transformer;
return text.getValue() == null ? "" : func.apply(text.getValue())... | [
"public",
"static",
"StringBinding",
"transforming",
"(",
"ObservableValue",
"<",
"String",
">",
"text",
",",
"Function",
"<",
"String",
",",
"String",
">",
"transformer",
")",
"{",
"return",
"Bindings",
".",
"createStringBinding",
"(",
"(",
")",
"->",
"{",
... | Creates a string binding that contains the value of the given observable string transformed using the supplied
function.
If the given observable string has a value of `null` the created binding will contain an empty string.
If the given function has a value of `null` {@link Function#identity()} will be used instead.
... | [
"Creates",
"a",
"string",
"binding",
"that",
"contains",
"the",
"value",
"of",
"the",
"given",
"observable",
"string",
"transformed",
"using",
"the",
"supplied",
"function",
"."
] | train | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/StringBindings.java#L220-L226 |
sonyxperiadev/gerrit-events | src/main/java/com/sonymobile/tools/gerrit/gerritevents/workers/AbstractJsonObjectWork.java | AbstractJsonObjectWork.perform | protected void perform(JSONObject json, Coordinator coordinator, Provider provider) {
"""
Parses the JSONObject into a Java bean and sends the parsed {@link GerritEvent} down the inheritance chain.
@param json the JSONObject to work on.
@param coordinator the coordinator.
@param provider the Gerrit server info
... | java | protected void perform(JSONObject json, Coordinator coordinator, Provider provider) {
logger.trace("Extracting event from JSON.");
GerritEvent event = GerritJsonEventFactory.getEvent(json);
if (event != null) {
if (event instanceof GerritTriggeredEvent) {
GerritTrigge... | [
"protected",
"void",
"perform",
"(",
"JSONObject",
"json",
",",
"Coordinator",
"coordinator",
",",
"Provider",
"provider",
")",
"{",
"logger",
".",
"trace",
"(",
"\"Extracting event from JSON.\"",
")",
";",
"GerritEvent",
"event",
"=",
"GerritJsonEventFactory",
".",... | Parses the JSONObject into a Java bean and sends the parsed {@link GerritEvent} down the inheritance chain.
@param json the JSONObject to work on.
@param coordinator the coordinator.
@param provider the Gerrit server info | [
"Parses",
"the",
"JSONObject",
"into",
"a",
"Java",
"bean",
"and",
"sends",
"the",
"parsed",
"{"
] | train | https://github.com/sonyxperiadev/gerrit-events/blob/9a443d13dded85cc4709136ac33989f2bbb34fe2/src/main/java/com/sonymobile/tools/gerrit/gerritevents/workers/AbstractJsonObjectWork.java#L67-L81 |
infinispan/infinispan | core/src/main/java/org/infinispan/configuration/parsing/ParseUtils.java | ParseUtils.requireAttributes | public static String[] requireAttributes(final XMLStreamReader reader, boolean replace, final String... attributeNames)
throws XMLStreamException {
"""
Require all the named attributes, returning their values in order.
@param reader the reader
@param attributeNames the attribute names
@return the at... | java | public static String[] requireAttributes(final XMLStreamReader reader, boolean replace, final String... attributeNames)
throws XMLStreamException {
final int length = attributeNames.length;
final String[] result = new String[length];
for (int i = 0; i < length; i++) {
fin... | [
"public",
"static",
"String",
"[",
"]",
"requireAttributes",
"(",
"final",
"XMLStreamReader",
"reader",
",",
"boolean",
"replace",
",",
"final",
"String",
"...",
"attributeNames",
")",
"throws",
"XMLStreamException",
"{",
"final",
"int",
"length",
"=",
"attributeN... | Require all the named attributes, returning their values in order.
@param reader the reader
@param attributeNames the attribute names
@return the attribute values in order
@throws javax.xml.stream.XMLStreamException if an error occurs | [
"Require",
"all",
"the",
"named",
"attributes",
"returning",
"their",
"values",
"in",
"order",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/configuration/parsing/ParseUtils.java#L238-L251 |
looly/hutool | hutool-cron/src/main/java/cn/hutool/cron/pattern/CronPattern.java | CronPattern.isMatch | private static boolean isMatch(List<ValueMatcher> matchers, int index, int value) {
"""
是否匹配指定的日期时间位置
@param matchers 匹配器列表
@param index 位置
@param value 被匹配的值
@return 是否匹配
@since 4.0.2
"""
return (matchers.size() > index) ? matchers.get(index).match(value) : true;
} | java | private static boolean isMatch(List<ValueMatcher> matchers, int index, int value) {
return (matchers.size() > index) ? matchers.get(index).match(value) : true;
} | [
"private",
"static",
"boolean",
"isMatch",
"(",
"List",
"<",
"ValueMatcher",
">",
"matchers",
",",
"int",
"index",
",",
"int",
"value",
")",
"{",
"return",
"(",
"matchers",
".",
"size",
"(",
")",
">",
"index",
")",
"?",
"matchers",
".",
"get",
"(",
"... | 是否匹配指定的日期时间位置
@param matchers 匹配器列表
@param index 位置
@param value 被匹配的值
@return 是否匹配
@since 4.0.2 | [
"是否匹配指定的日期时间位置"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cron/src/main/java/cn/hutool/cron/pattern/CronPattern.java#L213-L215 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java | BeanUtil.getPropertyDescriptor | public static PropertyDescriptor getPropertyDescriptor(Class<?> clazz, final String fieldName) throws BeanException {
"""
获得Bean类属性描述,大小写敏感
@param clazz Bean类
@param fieldName 字段名
@return PropertyDescriptor
@throws BeanException 获取属性异常
"""
return getPropertyDescriptor(clazz, fieldName, false);
} | java | public static PropertyDescriptor getPropertyDescriptor(Class<?> clazz, final String fieldName) throws BeanException {
return getPropertyDescriptor(clazz, fieldName, false);
} | [
"public",
"static",
"PropertyDescriptor",
"getPropertyDescriptor",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"String",
"fieldName",
")",
"throws",
"BeanException",
"{",
"return",
"getPropertyDescriptor",
"(",
"clazz",
",",
"fieldName",
",",
"false",
")",... | 获得Bean类属性描述,大小写敏感
@param clazz Bean类
@param fieldName 字段名
@return PropertyDescriptor
@throws BeanException 获取属性异常 | [
"获得Bean类属性描述,大小写敏感"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java#L228-L230 |
jenkinsci/sectioned-view-plugin | src/main/java/hudson/plugins/sectioned_view/SectionedView.java | SectionedView.submit | @Override
protected void submit(StaplerRequest req) throws ServletException, FormException {
"""
Handles the configuration submission.
Load view-specific properties here.
"""
initSections();
try {
sections.rebuildHetero(req, req.getSubmittedForm(), Hudson
.getInstance().<Secti... | java | @Override
protected void submit(StaplerRequest req) throws ServletException, FormException {
initSections();
try {
sections.rebuildHetero(req, req.getSubmittedForm(), Hudson
.getInstance().<SectionedViewSection, Descriptor<SectionedViewSection>>getDescriptorList(SectionedViewSection.class... | [
"@",
"Override",
"protected",
"void",
"submit",
"(",
"StaplerRequest",
"req",
")",
"throws",
"ServletException",
",",
"FormException",
"{",
"initSections",
"(",
")",
";",
"try",
"{",
"sections",
".",
"rebuildHetero",
"(",
"req",
",",
"req",
".",
"getSubmittedF... | Handles the configuration submission.
Load view-specific properties here. | [
"Handles",
"the",
"configuration",
"submission",
"."
] | train | https://github.com/jenkinsci/sectioned-view-plugin/blob/dc8a23c018c4c329b8e75e91cea2b7f466ce0320/src/main/java/hudson/plugins/sectioned_view/SectionedView.java#L149-L159 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/storage/tx/recovery/RecoveryMgr.java | RecoveryMgr.logLogicalAbort | public LogSeqNum logLogicalAbort(long txNum, LogSeqNum undoNextLSN) {
"""
Writes a logical abort record into the log.
@param txNum
the number of aborted transaction
@param undoNextLSN
the LSN which the redo the Abort record should jump to
@return the LSN of the log record, or null if recovery manager turn... | java | public LogSeqNum logLogicalAbort(long txNum, LogSeqNum undoNextLSN) {
if (enableLogging) {
return new LogicalAbortRecord(txNum, undoNextLSN).writeToLog();
} else
return null;
} | [
"public",
"LogSeqNum",
"logLogicalAbort",
"(",
"long",
"txNum",
",",
"LogSeqNum",
"undoNextLSN",
")",
"{",
"if",
"(",
"enableLogging",
")",
"{",
"return",
"new",
"LogicalAbortRecord",
"(",
"txNum",
",",
"undoNextLSN",
")",
".",
"writeToLog",
"(",
")",
";",
"... | Writes a logical abort record into the log.
@param txNum
the number of aborted transaction
@param undoNextLSN
the LSN which the redo the Abort record should jump to
@return the LSN of the log record, or null if recovery manager turns off
the logging | [
"Writes",
"a",
"logical",
"abort",
"record",
"into",
"the",
"log",
"."
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/tx/recovery/RecoveryMgr.java#L172-L177 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/PropertyUtils.java | PropertyUtils.loadGradleProperties | private static Properties loadGradleProperties(FilePath gradlePropertiesFilePath)
throws IOException, InterruptedException {
"""
Load a properties file from a file path
@param gradlePropertiesFilePath The file path where the gradle.properties is located.
@return The loaded properties.
@throws IOEx... | java | private static Properties loadGradleProperties(FilePath gradlePropertiesFilePath)
throws IOException, InterruptedException {
return gradlePropertiesFilePath.act(new MasterToSlaveFileCallable<Properties>() {
public Properties invoke(File gradlePropertiesFile, VirtualChannel channel) throw... | [
"private",
"static",
"Properties",
"loadGradleProperties",
"(",
"FilePath",
"gradlePropertiesFilePath",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"return",
"gradlePropertiesFilePath",
".",
"act",
"(",
"new",
"MasterToSlaveFileCallable",
"<",
"Propertie... | Load a properties file from a file path
@param gradlePropertiesFilePath The file path where the gradle.properties is located.
@return The loaded properties.
@throws IOException In case an error occurs while reading the properties file, this exception is thrown. | [
"Load",
"a",
"properties",
"file",
"from",
"a",
"file",
"path"
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/PropertyUtils.java#L81-L104 |
linkedin/linkedin-zookeeper | org.linkedin.zookeeper-impl/src/main/java/org/linkedin/zookeeper/tracker/ZKStringDataReader.java | ZKStringDataReader.isEqual | @Override
public boolean isEqual(String data1, String data2) {
"""
Compare 2 data equality
@return <code>true</code> if equal (in the {@link Object#equals(Object)} definition)
"""
return LangUtils.isEqual(data1, data2);
} | java | @Override
public boolean isEqual(String data1, String data2)
{
return LangUtils.isEqual(data1, data2);
} | [
"@",
"Override",
"public",
"boolean",
"isEqual",
"(",
"String",
"data1",
",",
"String",
"data2",
")",
"{",
"return",
"LangUtils",
".",
"isEqual",
"(",
"data1",
",",
"data2",
")",
";",
"}"
] | Compare 2 data equality
@return <code>true</code> if equal (in the {@link Object#equals(Object)} definition) | [
"Compare",
"2",
"data",
"equality"
] | train | https://github.com/linkedin/linkedin-zookeeper/blob/600b1d01318594ed425ede566bbbdc94b026a53e/org.linkedin.zookeeper-impl/src/main/java/org/linkedin/zookeeper/tracker/ZKStringDataReader.java#L51-L55 |
google/closure-templates | java/src/com/google/template/soy/SoyFileSet.java | SoyFileSet.compileToPySrcFiles | void compileToPySrcFiles(String outputPathFormat, SoyPySrcOptions pySrcOptions)
throws IOException {
"""
Compiles this Soy file set into Python source code files and writes these Python files to disk.
@param outputPathFormat The format string defining how to build the output file path
corresponding to an... | java | void compileToPySrcFiles(String outputPathFormat, SoyPySrcOptions pySrcOptions)
throws IOException {
resetErrorReporter();
ParseResult result = parse();
throwIfErrorsPresent();
new PySrcMain(scopedData.enterable())
.genPyFiles(result.fileSet(), pySrcOptions, outputPathFormat, errorReporter... | [
"void",
"compileToPySrcFiles",
"(",
"String",
"outputPathFormat",
",",
"SoyPySrcOptions",
"pySrcOptions",
")",
"throws",
"IOException",
"{",
"resetErrorReporter",
"(",
")",
";",
"ParseResult",
"result",
"=",
"parse",
"(",
")",
";",
"throwIfErrorsPresent",
"(",
")",
... | Compiles this Soy file set into Python source code files and writes these Python files to disk.
@param outputPathFormat The format string defining how to build the output file path
corresponding to an input file path.
@param pySrcOptions The compilation options for the Python Src output target.
@throws SoyCompilationE... | [
"Compiles",
"this",
"Soy",
"file",
"set",
"into",
"Python",
"source",
"code",
"files",
"and",
"writes",
"these",
"Python",
"files",
"to",
"disk",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/SoyFileSet.java#L950-L960 |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/Tuple.java | Tuple.isBindingCompatible | private static boolean isBindingCompatible( Tuple tuple, VarBindingDef binding) {
"""
Returns true if the given binding can be added to the give tuple.
"""
VarValueDef currentValue = tuple.getBinding( binding.getVarDef());
return (currentValue == null || currentValue.equals( binding.getValueDef()));
... | java | private static boolean isBindingCompatible( Tuple tuple, VarBindingDef binding)
{
VarValueDef currentValue = tuple.getBinding( binding.getVarDef());
return (currentValue == null || currentValue.equals( binding.getValueDef()));
} | [
"private",
"static",
"boolean",
"isBindingCompatible",
"(",
"Tuple",
"tuple",
",",
"VarBindingDef",
"binding",
")",
"{",
"VarValueDef",
"currentValue",
"=",
"tuple",
".",
"getBinding",
"(",
"binding",
".",
"getVarDef",
"(",
")",
")",
";",
"return",
"(",
"curre... | Returns true if the given binding can be added to the give tuple. | [
"Returns",
"true",
"if",
"the",
"given",
"binding",
"can",
"be",
"added",
"to",
"the",
"give",
"tuple",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/Tuple.java#L93-L97 |
Azure/azure-sdk-for-java | streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/StreamingJobsInner.java | StreamingJobsInner.getByResourceGroupAsync | public Observable<StreamingJobInner> getByResourceGroupAsync(String resourceGroupName, String jobName) {
"""
Gets details about the specified streaming job.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the po... | java | public Observable<StreamingJobInner> getByResourceGroupAsync(String resourceGroupName, String jobName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, jobName).map(new Func1<ServiceResponseWithHeaders<StreamingJobInner, StreamingJobsGetHeaders>, StreamingJobInner>() {
@Overrid... | [
"public",
"Observable",
"<",
"StreamingJobInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"jobName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"jobName",
")",
".",
"map",
"... | Gets details about the specified streaming job.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param jobName The name of the streaming job.
@throws IllegalArgumentException thrown if parameters fail the v... | [
"Gets",
"details",
"about",
"the",
"specified",
"streaming",
"job",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/StreamingJobsInner.java#L863-L870 |
rpau/javalang-compiler | src/main/java/org/walkmod/javalang/compiler/symbols/SymbolType.java | SymbolType.withName | public SymbolType withName(String name) {
"""
Clones replacing the symbol type name.
@param name the symbol type name
@return Returns a copy of this symbol type replacing the name
"""
return clone(marker, name, arrayCount, typeVariable, null, null);
} | java | public SymbolType withName(String name) {
return clone(marker, name, arrayCount, typeVariable, null, null);
} | [
"public",
"SymbolType",
"withName",
"(",
"String",
"name",
")",
"{",
"return",
"clone",
"(",
"marker",
",",
"name",
",",
"arrayCount",
",",
"typeVariable",
",",
"null",
",",
"null",
")",
";",
"}"
] | Clones replacing the symbol type name.
@param name the symbol type name
@return Returns a copy of this symbol type replacing the name | [
"Clones",
"replacing",
"the",
"symbol",
"type",
"name",
"."
] | train | https://github.com/rpau/javalang-compiler/blob/d7da81359161feef2bc7ff186c4e1b73c6a5a8ef/src/main/java/org/walkmod/javalang/compiler/symbols/SymbolType.java#L592-L594 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ReflectiveVisitorHelper.java | ReflectiveVisitorHelper.invokeVisit | public Object invokeVisit(Object visitor, Object argument) {
"""
Use reflection to call the appropriate <code>visit</code> method on the
provided visitor, passing in the specified argument.
@param visitor
the visitor encapsulating the logic to process the argument
@param argument
the argument to dispatch
@... | java | public Object invokeVisit(Object visitor, Object argument) {
Assert.notNull(visitor, "The visitor to visit is required");
// Perform call back on the visitor through reflection.
Method method = getMethod(visitor.getClass(), argument);
if (method == null) {
if (logger.isWarnEnabled()) {
logger.warn("No me... | [
"public",
"Object",
"invokeVisit",
"(",
"Object",
"visitor",
",",
"Object",
"argument",
")",
"{",
"Assert",
".",
"notNull",
"(",
"visitor",
",",
"\"The visitor to visit is required\"",
")",
";",
"// Perform call back on the visitor through reflection.",
"Method",
"method"... | Use reflection to call the appropriate <code>visit</code> method on the
provided visitor, passing in the specified argument.
@param visitor
the visitor encapsulating the logic to process the argument
@param argument
the argument to dispatch
@throws IllegalArgumentException
if the visitor parameter is null | [
"Use",
"reflection",
"to",
"call",
"the",
"appropriate",
"<code",
">",
"visit<",
"/",
"code",
">",
"method",
"on",
"the",
"provided",
"visitor",
"passing",
"in",
"the",
"specified",
"argument",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ReflectiveVisitorHelper.java#L79-L108 |
clanie/clanie-core | src/main/java/dk/clanie/collections/NumberMap.java | NumberMap.newByteMap | public static <K> NumberMap<K, Byte> newByteMap() {
"""
Creates a NumberMap for Bytes.
@param <K>
@return NumberMap<K, Byte>
"""
return new NumberMap<K, Byte>() {
@Override
public void add(K key, Byte addend) {
put(key, (byte)(containsKey(key) ? get(key) + addend : addend));
}
@Over... | java | public static <K> NumberMap<K, Byte> newByteMap() {
return new NumberMap<K, Byte>() {
@Override
public void add(K key, Byte addend) {
put(key, (byte)(containsKey(key) ? get(key) + addend : addend));
}
@Override
public void sub(K key, Byte subtrahend) {
put(key, (byte)((containsKey(key) ? get(ke... | [
"public",
"static",
"<",
"K",
">",
"NumberMap",
"<",
"K",
",",
"Byte",
">",
"newByteMap",
"(",
")",
"{",
"return",
"new",
"NumberMap",
"<",
"K",
",",
"Byte",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"add",
"(",
"K",
"key",
",",
"Byt... | Creates a NumberMap for Bytes.
@param <K>
@return NumberMap<K, Byte> | [
"Creates",
"a",
"NumberMap",
"for",
"Bytes",
"."
] | train | https://github.com/clanie/clanie-core/blob/ac8a655b93127f0e281b741c4d53f429be2816ad/src/main/java/dk/clanie/collections/NumberMap.java#L112-L123 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java | InstanceFailoverGroupsInner.beginForceFailoverAllowDataLossAsync | public Observable<InstanceFailoverGroupInner> beginForceFailoverAllowDataLossAsync(String resourceGroupName, String locationName, String failoverGroupName) {
"""
Fails over from the current primary managed instance to this managed instance. This operation might result in data loss.
@param resourceGroupName The ... | java | public Observable<InstanceFailoverGroupInner> beginForceFailoverAllowDataLossAsync(String resourceGroupName, String locationName, String failoverGroupName) {
return beginForceFailoverAllowDataLossWithServiceResponseAsync(resourceGroupName, locationName, failoverGroupName).map(new Func1<ServiceResponse<InstanceF... | [
"public",
"Observable",
"<",
"InstanceFailoverGroupInner",
">",
"beginForceFailoverAllowDataLossAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"locationName",
",",
"String",
"failoverGroupName",
")",
"{",
"return",
"beginForceFailoverAllowDataLossWithServiceResponseAs... | Fails over from the current primary managed instance to this managed instance. This operation might result in data loss.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param locationName The name of the r... | [
"Fails",
"over",
"from",
"the",
"current",
"primary",
"managed",
"instance",
"to",
"this",
"managed",
"instance",
".",
"This",
"operation",
"might",
"result",
"in",
"data",
"loss",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java#L967-L974 |
Red5/red5-server-common | src/main/java/org/red5/server/messaging/AbstractPipe.java | AbstractPipe.sendOOBControlMessage | public void sendOOBControlMessage(IProvider provider, OOBControlMessage oobCtrlMsg) {
"""
Send out-of-band ("special") control message to all consumers
@param provider
Provider, may be used in concrete implementations
@param oobCtrlMsg
Out-of-band control message
"""
for (IConsumer consumer : con... | java | public void sendOOBControlMessage(IProvider provider, OOBControlMessage oobCtrlMsg) {
for (IConsumer consumer : consumers) {
try {
consumer.onOOBControlMessage(provider, this, oobCtrlMsg);
} catch (Throwable t) {
log.error("exception when passing OOBCM fro... | [
"public",
"void",
"sendOOBControlMessage",
"(",
"IProvider",
"provider",
",",
"OOBControlMessage",
"oobCtrlMsg",
")",
"{",
"for",
"(",
"IConsumer",
"consumer",
":",
"consumers",
")",
"{",
"try",
"{",
"consumer",
".",
"onOOBControlMessage",
"(",
"provider",
",",
... | Send out-of-band ("special") control message to all consumers
@param provider
Provider, may be used in concrete implementations
@param oobCtrlMsg
Out-of-band control message | [
"Send",
"out",
"-",
"of",
"-",
"band",
"(",
"special",
")",
"control",
"message",
"to",
"all",
"consumers"
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/messaging/AbstractPipe.java#L163-L171 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java | Aggregations.bigDecimalSum | public static <Key, Value> Aggregation<Key, BigDecimal, BigDecimal> bigDecimalSum() {
"""
Returns an aggregation to calculate the {@link java.math.BigDecimal} sum
of all supplied values.<br/>
This aggregation is similar to: <pre>SELECT SUM(value) FROM x</pre>
@param <Key> the input key type
@param <Value> ... | java | public static <Key, Value> Aggregation<Key, BigDecimal, BigDecimal> bigDecimalSum() {
return new AggregationAdapter(new BigDecimalSumAggregation<Key, Value>());
} | [
"public",
"static",
"<",
"Key",
",",
"Value",
">",
"Aggregation",
"<",
"Key",
",",
"BigDecimal",
",",
"BigDecimal",
">",
"bigDecimalSum",
"(",
")",
"{",
"return",
"new",
"AggregationAdapter",
"(",
"new",
"BigDecimalSumAggregation",
"<",
"Key",
",",
"Value",
... | Returns an aggregation to calculate the {@link java.math.BigDecimal} sum
of all supplied values.<br/>
This aggregation is similar to: <pre>SELECT SUM(value) FROM x</pre>
@param <Key> the input key type
@param <Value> the supplied value type
@return the sum over all supplied values | [
"Returns",
"an",
"aggregation",
"to",
"calculate",
"the",
"{",
"@link",
"java",
".",
"math",
".",
"BigDecimal",
"}",
"sum",
"of",
"all",
"supplied",
"values",
".",
"<br",
"/",
">",
"This",
"aggregation",
"is",
"similar",
"to",
":",
"<pre",
">",
"SELECT",... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java#L260-L262 |
jsonld-java/jsonld-java | core/src/main/java/com/github/jsonldjava/core/DocumentLoader.java | DocumentLoader.addInjectedDoc | public DocumentLoader addInjectedDoc(String url, String doc) throws JsonLdError {
"""
Avoid resolving a document by instead using the given serialised
representation.
@param url
The URL this document represents.
@param doc
The serialised document as a String
@return This object for fluent addition of other... | java | public DocumentLoader addInjectedDoc(String url, String doc) throws JsonLdError {
try {
m_injectedDocs.put(url, JsonUtils.fromString(doc));
return this;
} catch (final Exception e) {
throw new JsonLdError(JsonLdError.Error.LOADING_INJECTED_CONTEXT_FAILED, url, e);
... | [
"public",
"DocumentLoader",
"addInjectedDoc",
"(",
"String",
"url",
",",
"String",
"doc",
")",
"throws",
"JsonLdError",
"{",
"try",
"{",
"m_injectedDocs",
".",
"put",
"(",
"url",
",",
"JsonUtils",
".",
"fromString",
"(",
"doc",
")",
")",
";",
"return",
"th... | Avoid resolving a document by instead using the given serialised
representation.
@param url
The URL this document represents.
@param doc
The serialised document as a String
@return This object for fluent addition of other injected documents.
@throws JsonLdError
If loading of the document failed for any reason. | [
"Avoid",
"resolving",
"a",
"document",
"by",
"instead",
"using",
"the",
"given",
"serialised",
"representation",
"."
] | train | https://github.com/jsonld-java/jsonld-java/blob/efeef6ee96029a0011649633457035fa6be42da1/core/src/main/java/com/github/jsonldjava/core/DocumentLoader.java#L37-L44 |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java | VisualizeImageData.renderLabeled | public static void renderLabeled(GrayS32 labelImage, int numRegions, Bitmap output , byte[] storage) {
"""
Renders a labeled where each region is assigned a random color.
@param labelImage Labeled image with labels from 0 to numRegions-1
@param numRegions Number of labeled in the image
@param output Where the... | java | public static void renderLabeled(GrayS32 labelImage, int numRegions, Bitmap output , byte[] storage) {
if( storage == null )
storage = declareStorage(output,null);
int colors[] = new int[numRegions];
Random rand = new Random(123);
for( int i = 0; i < colors.length; i++ ) {
colors[i] = rand.nextInt();
... | [
"public",
"static",
"void",
"renderLabeled",
"(",
"GrayS32",
"labelImage",
",",
"int",
"numRegions",
",",
"Bitmap",
"output",
",",
"byte",
"[",
"]",
"storage",
")",
"{",
"if",
"(",
"storage",
"==",
"null",
")",
"storage",
"=",
"declareStorage",
"(",
"outpu... | Renders a labeled where each region is assigned a random color.
@param labelImage Labeled image with labels from 0 to numRegions-1
@param numRegions Number of labeled in the image
@param output Where the output is written to
@param storage Optional working buffer for Bitmap image. Can be null. | [
"Renders",
"a",
"labeled",
"where",
"each",
"region",
"is",
"assigned",
"a",
"random",
"color",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java#L545-L574 |
etnetera/seb | src/main/java/cz/etnetera/seb/listener/SebListener.java | SebListener.saveFile | protected void saveFile(SebEvent event, File file, String name, String extension) {
"""
Save file into output file with given name and extension.
@param event
@param file
@param name
@param extension
"""
event.saveFile(file, getListenerFileName(name), extension);
} | java | protected void saveFile(SebEvent event, File file, String name, String extension) {
event.saveFile(file, getListenerFileName(name), extension);
} | [
"protected",
"void",
"saveFile",
"(",
"SebEvent",
"event",
",",
"File",
"file",
",",
"String",
"name",
",",
"String",
"extension",
")",
"{",
"event",
".",
"saveFile",
"(",
"file",
",",
"getListenerFileName",
"(",
"name",
")",
",",
"extension",
")",
";",
... | Save file into output file with given name and extension.
@param event
@param file
@param name
@param extension | [
"Save",
"file",
"into",
"output",
"file",
"with",
"given",
"name",
"and",
"extension",
"."
] | train | https://github.com/etnetera/seb/blob/6aed29c7726db12f440c60cfd253de229064ed04/src/main/java/cz/etnetera/seb/listener/SebListener.java#L461-L463 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/FlinkZooKeeperQuorumPeer.java | FlinkZooKeeperQuorumPeer.writeMyIdToDataDir | private static void writeMyIdToDataDir(Properties zkProps, int id) throws IOException {
"""
Write 'myid' file to the 'dataDir' in the given ZooKeeper configuration.
<blockquote>
Every machine that is part of the ZooKeeper ensemble should know about every other machine in
the ensemble. You accomplish this with... | java | private static void writeMyIdToDataDir(Properties zkProps, int id) throws IOException {
// Check dataDir and create if necessary
if (zkProps.getProperty("dataDir") == null) {
throw new IllegalConfigurationException("No dataDir configured.");
}
File dataDir = new File(zkProps.getProperty("dataDir"));
if ... | [
"private",
"static",
"void",
"writeMyIdToDataDir",
"(",
"Properties",
"zkProps",
",",
"int",
"id",
")",
"throws",
"IOException",
"{",
"// Check dataDir and create if necessary",
"if",
"(",
"zkProps",
".",
"getProperty",
"(",
"\"dataDir\"",
")",
"==",
"null",
")",
... | Write 'myid' file to the 'dataDir' in the given ZooKeeper configuration.
<blockquote>
Every machine that is part of the ZooKeeper ensemble should know about every other machine in
the ensemble. You accomplish this with the series of lines of the form
server.id=host:port:port. The parameters host and port are straightf... | [
"Write",
"myid",
"file",
"to",
"the",
"dataDir",
"in",
"the",
"given",
"ZooKeeper",
"configuration",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/FlinkZooKeeperQuorumPeer.java#L220-L242 |
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/buffer/StreamEventBuffer.java | StreamEventBuffer.rollback | private void rollback(final short vbucket, final long toSeqno) {
"""
Discard any buffered events in the given vBucket with sequence numbers
higher than the given sequence number.
"""
final Queue<BufferedEvent> queue = partitionQueues.get(vbucket);
synchronized (queue) {
for (Iterator<BufferedEv... | java | private void rollback(final short vbucket, final long toSeqno) {
final Queue<BufferedEvent> queue = partitionQueues.get(vbucket);
synchronized (queue) {
for (Iterator<BufferedEvent> i = queue.iterator(); i.hasNext(); ) {
final BufferedEvent event = i.next();
final boolean eventSeqnoIsGrea... | [
"private",
"void",
"rollback",
"(",
"final",
"short",
"vbucket",
",",
"final",
"long",
"toSeqno",
")",
"{",
"final",
"Queue",
"<",
"BufferedEvent",
">",
"queue",
"=",
"partitionQueues",
".",
"get",
"(",
"vbucket",
")",
";",
"synchronized",
"(",
"queue",
")... | Discard any buffered events in the given vBucket with sequence numbers
higher than the given sequence number. | [
"Discard",
"any",
"buffered",
"events",
"in",
"the",
"given",
"vBucket",
"with",
"sequence",
"numbers",
"higher",
"than",
"the",
"given",
"sequence",
"number",
"."
] | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/buffer/StreamEventBuffer.java#L190-L204 |
apereo/cas | support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/views/OAuth20DefaultUserProfileViewRenderer.java | OAuth20DefaultUserProfileViewRenderer.getRenderedUserProfile | protected String getRenderedUserProfile(final Map<String, Object> model) {
"""
Gets rendered user profile.
@param model the model
@return the rendered user profile
"""
if (oauthProperties.getUserProfileViewType() == OAuthProperties.UserProfileViewTypes.FLAT) {
val flattened = new Linked... | java | protected String getRenderedUserProfile(final Map<String, Object> model) {
if (oauthProperties.getUserProfileViewType() == OAuthProperties.UserProfileViewTypes.FLAT) {
val flattened = new LinkedHashMap<String, Object>();
if (model.containsKey(MODEL_ATTRIBUTE_ATTRIBUTES)) {
... | [
"protected",
"String",
"getRenderedUserProfile",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"model",
")",
"{",
"if",
"(",
"oauthProperties",
".",
"getUserProfileViewType",
"(",
")",
"==",
"OAuthProperties",
".",
"UserProfileViewTypes",
".",
"FLAT",
... | Gets rendered user profile.
@param model the model
@return the rendered user profile | [
"Gets",
"rendered",
"user",
"profile",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/views/OAuth20DefaultUserProfileViewRenderer.java#L42-L58 |
Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java | ESFilterBuilder.getQueryBuilder | private QueryBuilder getQueryBuilder(FilterClause clause, final EntityMetadata metadata) {
"""
Gets the query.
@param clause
the clause
@param metadata
the metadata
@return the query
"""
String condition = clause.getCondition();
String value = clause.getValue().get(0).toString();
... | java | private QueryBuilder getQueryBuilder(FilterClause clause, final EntityMetadata metadata)
{
String condition = clause.getCondition();
String value = clause.getValue().get(0).toString();
String name = ((AbstractAttribute) ((MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
... | [
"private",
"QueryBuilder",
"getQueryBuilder",
"(",
"FilterClause",
"clause",
",",
"final",
"EntityMetadata",
"metadata",
")",
"{",
"String",
"condition",
"=",
"clause",
".",
"getCondition",
"(",
")",
";",
"String",
"value",
"=",
"clause",
".",
"getValue",
"(",
... | Gets the query.
@param clause
the clause
@param metadata
the metadata
@return the query | [
"Gets",
"the",
"query",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java#L468-L486 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.