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 |
|---|---|---|---|---|---|---|---|---|---|---|
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/meta/PathProperties.java | PathProperties.removeAll | public void removeAll(Supplier<JournalContext> ctx, String path) {
"""
Removes all properties for path.
@param ctx the journal context
@param path the path
"""
try (LockResource r = new LockResource(mLock.writeLock())) {
Map<String, String> properties = mState.getProperties(path);
if (!prop... | java | public void removeAll(Supplier<JournalContext> ctx, String path) {
try (LockResource r = new LockResource(mLock.writeLock())) {
Map<String, String> properties = mState.getProperties(path);
if (!properties.isEmpty()) {
mState.applyAndJournal(ctx, RemovePathPropertiesEntry.newBuilder().setPath(pat... | [
"public",
"void",
"removeAll",
"(",
"Supplier",
"<",
"JournalContext",
">",
"ctx",
",",
"String",
"path",
")",
"{",
"try",
"(",
"LockResource",
"r",
"=",
"new",
"LockResource",
"(",
"mLock",
".",
"writeLock",
"(",
")",
")",
")",
"{",
"Map",
"<",
"Strin... | Removes all properties for path.
@param ctx the journal context
@param path the path | [
"Removes",
"all",
"properties",
"for",
"path",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/meta/PathProperties.java#L117-L124 |
mgm-tp/jfunk | jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/WebDriverTool.java | WebDriverTool.getAttributeValue | public String getAttributeValue(final By by, final String attributeName) {
"""
Delegates to {@link #findElement(By)} and then calls
{@link WebElement#getAttribute(String) getAttribute(String)} on the returned element.
@param by
the {@link By} used to locate the element
@param attributeName
the attribute nam... | java | public String getAttributeValue(final By by, final String attributeName) {
WebElement element = findElement(by);
return element.getAttribute(attributeName);
} | [
"public",
"String",
"getAttributeValue",
"(",
"final",
"By",
"by",
",",
"final",
"String",
"attributeName",
")",
"{",
"WebElement",
"element",
"=",
"findElement",
"(",
"by",
")",
";",
"return",
"element",
".",
"getAttribute",
"(",
"attributeName",
")",
";",
... | Delegates to {@link #findElement(By)} and then calls
{@link WebElement#getAttribute(String) getAttribute(String)} on the returned element.
@param by
the {@link By} used to locate the element
@param attributeName
the attribute name
@return the attribute value | [
"Delegates",
"to",
"{",
"@link",
"#findElement",
"(",
"By",
")",
"}",
"and",
"then",
"calls",
"{",
"@link",
"WebElement#getAttribute",
"(",
"String",
")",
"getAttribute",
"(",
"String",
")",
"}",
"on",
"the",
"returned",
"element",
"."
] | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/WebDriverTool.java#L528-L531 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.getTotalNaturalAbundance | public static double getTotalNaturalAbundance(IAtomContainer atomContainer) {
"""
Get the summed natural abundance of all atoms in an AtomContainer
@param atomContainer The IAtomContainer to manipulate
@return The summed natural abundance of all atoms in this AtomContainer.
"""
try {
I... | java | public static double getTotalNaturalAbundance(IAtomContainer atomContainer) {
try {
Isotopes isotopes = Isotopes.getInstance();
double abundance = 1.0;
double hAbundance = isotopes.getMajorIsotope(1).getNaturalAbundance();
int nImplH = 0;
for (IAtom ... | [
"public",
"static",
"double",
"getTotalNaturalAbundance",
"(",
"IAtomContainer",
"atomContainer",
")",
"{",
"try",
"{",
"Isotopes",
"isotopes",
"=",
"Isotopes",
".",
"getInstance",
"(",
")",
";",
"double",
"abundance",
"=",
"1.0",
";",
"double",
"hAbundance",
"=... | Get the summed natural abundance of all atoms in an AtomContainer
@param atomContainer The IAtomContainer to manipulate
@return The summed natural abundance of all atoms in this AtomContainer. | [
"Get",
"the",
"summed",
"natural",
"abundance",
"of",
"all",
"atoms",
"in",
"an",
"AtomContainer"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L459-L479 |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/ExecutionEnvironment.java | ExecutionEnvironment.createRemoteEnvironment | public static ExecutionEnvironment createRemoteEnvironment(
String host, int port, Configuration clientConfiguration, String... jarFiles) {
"""
Creates a {@link RemoteEnvironment}. The remote environment sends (parts of) the program
to a cluster for execution. Note that all file paths used in the program must ... | java | public static ExecutionEnvironment createRemoteEnvironment(
String host, int port, Configuration clientConfiguration, String... jarFiles) {
return new RemoteEnvironment(host, port, clientConfiguration, jarFiles, null);
} | [
"public",
"static",
"ExecutionEnvironment",
"createRemoteEnvironment",
"(",
"String",
"host",
",",
"int",
"port",
",",
"Configuration",
"clientConfiguration",
",",
"String",
"...",
"jarFiles",
")",
"{",
"return",
"new",
"RemoteEnvironment",
"(",
"host",
",",
"port",... | Creates a {@link RemoteEnvironment}. The remote environment sends (parts of) the program
to a cluster for execution. Note that all file paths used in the program must be accessible from the
cluster. The custom configuration file is used to configure Akka specific configuration parameters
for the Client only; Program pa... | [
"Creates",
"a",
"{",
"@link",
"RemoteEnvironment",
"}",
".",
"The",
"remote",
"environment",
"sends",
"(",
"parts",
"of",
")",
"the",
"program",
"to",
"a",
"cluster",
"for",
"execution",
".",
"Note",
"that",
"all",
"file",
"paths",
"used",
"in",
"the",
"... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/ExecutionEnvironment.java#L1192-L1195 |
landawn/AbacusUtil | src/com/landawn/abacus/util/TriIterator.java | TriIterator.generate | public static <A, B, C> TriIterator<A, B, C> generate(final Consumer<Triple<A, B, C>> output) {
"""
Returns an infinite {@code BiIterator}.
@param output transfer the next values.
@return
"""
return generate(BooleanSupplier.TRUE, output);
} | java | public static <A, B, C> TriIterator<A, B, C> generate(final Consumer<Triple<A, B, C>> output) {
return generate(BooleanSupplier.TRUE, output);
} | [
"public",
"static",
"<",
"A",
",",
"B",
",",
"C",
">",
"TriIterator",
"<",
"A",
",",
"B",
",",
"C",
">",
"generate",
"(",
"final",
"Consumer",
"<",
"Triple",
"<",
"A",
",",
"B",
",",
"C",
">",
">",
"output",
")",
"{",
"return",
"generate",
"(",... | Returns an infinite {@code BiIterator}.
@param output transfer the next values.
@return | [
"Returns",
"an",
"infinite",
"{",
"@code",
"BiIterator",
"}",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/TriIterator.java#L71-L73 |
neoremind/fluent-validator | fluent-validator/src/main/java/com/baidu/unbiz/fluentvalidator/ValidatorContext.java | ValidatorContext.getAttribute | public <T> T getAttribute(String key, Class<T> clazz) {
"""
根据类型<t>T</t>直接获取属性值
@param key 键
@param clazz 值类型
@return 值
"""
return (T) getAttribute(key);
} | java | public <T> T getAttribute(String key, Class<T> clazz) {
return (T) getAttribute(key);
} | [
"public",
"<",
"T",
">",
"T",
"getAttribute",
"(",
"String",
"key",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"(",
"T",
")",
"getAttribute",
"(",
"key",
")",
";",
"}"
] | 根据类型<t>T</t>直接获取属性值
@param key 键
@param clazz 值类型
@return 值 | [
"根据类型<t",
">",
"T<",
"/",
"t",
">",
"直接获取属性值"
] | train | https://github.com/neoremind/fluent-validator/blob/b516970591aa9468b44ba63938b98ec341fd6ead/fluent-validator/src/main/java/com/baidu/unbiz/fluentvalidator/ValidatorContext.java#L79-L81 |
Swagger2Markup/swagger2markup | src/main/java/io/github/swagger2markup/internal/component/PathOperationComponent.java | PathOperationComponent.buildOperationTitle | private void buildOperationTitle(MarkupDocBuilder markupDocBuilder, String title, String anchor) {
"""
Adds a operation title to the document.
@param title the operation title
@param anchor optional anchor (null => auto-generate from title)
"""
if (config.getPathsGroupedBy() == GroupBy.AS_IS) {
... | java | private void buildOperationTitle(MarkupDocBuilder markupDocBuilder, String title, String anchor) {
if (config.getPathsGroupedBy() == GroupBy.AS_IS) {
markupDocBuilder.sectionTitleWithAnchorLevel2(title, anchor);
} else {
markupDocBuilder.sectionTitleWithAnchorLevel3(title, anchor... | [
"private",
"void",
"buildOperationTitle",
"(",
"MarkupDocBuilder",
"markupDocBuilder",
",",
"String",
"title",
",",
"String",
"anchor",
")",
"{",
"if",
"(",
"config",
".",
"getPathsGroupedBy",
"(",
")",
"==",
"GroupBy",
".",
"AS_IS",
")",
"{",
"markupDocBuilder"... | Adds a operation title to the document.
@param title the operation title
@param anchor optional anchor (null => auto-generate from title) | [
"Adds",
"a",
"operation",
"title",
"to",
"the",
"document",
"."
] | train | https://github.com/Swagger2Markup/swagger2markup/blob/da83465f19a2f8a0f1fba873b5762bca8587896b/src/main/java/io/github/swagger2markup/internal/component/PathOperationComponent.java#L148-L154 |
cdk/cdk | tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomTetrahedralLigandPlacer3D.java | AtomTetrahedralLigandPlacer3D.getPlacedHeavyAtomInAtomContainer | public IAtom getPlacedHeavyAtomInAtomContainer(IAtom atomA, IAtom atomB, IAtomContainer ac) {
"""
Returns a placed neighbouring atom of a central atom atomA, which is not
atomB.
@param atomA central atom (Atom)
@param atomB atom connected to atomA (Atom)
@param ac molecule
@return returns a ... | java | public IAtom getPlacedHeavyAtomInAtomContainer(IAtom atomA, IAtom atomB, IAtomContainer ac) {
List atoms = ac.getConnectedAtomsList(atomA);
IAtom atom = null;
for (int i = 0; i < atoms.size(); i++) {
IAtom curAtom = (IAtom) atoms.get(i);
if (curAtom.getFlag(CDKConstants.I... | [
"public",
"IAtom",
"getPlacedHeavyAtomInAtomContainer",
"(",
"IAtom",
"atomA",
",",
"IAtom",
"atomB",
",",
"IAtomContainer",
"ac",
")",
"{",
"List",
"atoms",
"=",
"ac",
".",
"getConnectedAtomsList",
"(",
"atomA",
")",
";",
"IAtom",
"atom",
"=",
"null",
";",
... | Returns a placed neighbouring atom of a central atom atomA, which is not
atomB.
@param atomA central atom (Atom)
@param atomB atom connected to atomA (Atom)
@param ac molecule
@return returns a connected atom (Atom) | [
"Returns",
"a",
"placed",
"neighbouring",
"atom",
"of",
"a",
"central",
"atom",
"atomA",
"which",
"is",
"not",
"atomB",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomTetrahedralLigandPlacer3D.java#L870-L880 |
lucasr/probe | library/src/main/java/org/lucasr/probe/Interceptor.java | Interceptor.invokeOnMeasure | protected final void invokeOnMeasure(View view, int widthMeasureSpec, int heightMeasureSpec) {
"""
Performs a {@link View#onMeasure(int, int)} call on the given {@link View}.
"""
final ViewProxy proxy = (ViewProxy) view;
proxy.invokeOnMeasure(widthMeasureSpec, heightMeasureSpec);
} | java | protected final void invokeOnMeasure(View view, int widthMeasureSpec, int heightMeasureSpec) {
final ViewProxy proxy = (ViewProxy) view;
proxy.invokeOnMeasure(widthMeasureSpec, heightMeasureSpec);
} | [
"protected",
"final",
"void",
"invokeOnMeasure",
"(",
"View",
"view",
",",
"int",
"widthMeasureSpec",
",",
"int",
"heightMeasureSpec",
")",
"{",
"final",
"ViewProxy",
"proxy",
"=",
"(",
"ViewProxy",
")",
"view",
";",
"proxy",
".",
"invokeOnMeasure",
"(",
"widt... | Performs a {@link View#onMeasure(int, int)} call on the given {@link View}. | [
"Performs",
"a",
"{"
] | train | https://github.com/lucasr/probe/blob/cd15cc04383a1bf85de2f4c345d2018415b9ddc9/library/src/main/java/org/lucasr/probe/Interceptor.java#L58-L61 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java | AipImageSearch.sameHqDeleteByUrl | public JSONObject sameHqDeleteByUrl(String url, HashMap<String, String> options) {
"""
相同图检索—删除接口
**删除图库中的图片,支持批量删除,批量删除时请传cont_sign参数,勿传image,最多支持1000个cont_sign**
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key:... | java | public JSONObject sameHqDeleteByUrl(String url, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("url", url);
if (options != null) {
request.addBody(options);
}
request.setUri(ImageSearch... | [
"public",
"JSONObject",
"sameHqDeleteByUrl",
"(",
"String",
"url",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"request",
... | 相同图检索—删除接口
**删除图库中的图片,支持批量删除,批量删除时请传cont_sign参数,勿传image,最多支持1000个cont_sign**
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key: value都为string类型
options - options列表:
@return JSONObject | [
"相同图检索—删除接口",
"**",
"删除图库中的图片,支持批量删除,批量删除时请传cont_sign参数,勿传image,最多支持1000个cont_sign",
"**"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java#L323-L334 |
CloudBees-community/syslog-java-client | src/main/java/com/cloudbees/syslog/sender/UdpSyslogMessageSender.java | UdpSyslogMessageSender.sendMessage | @Override
public void sendMessage(SyslogMessage message) throws IOException {
"""
Send the given {@link com.cloudbees.syslog.SyslogMessage} over UDP.
@param message the message to send
@throws IOException
"""
sendCounter.incrementAndGet();
long nanosBefore = System.nanoTime();
... | java | @Override
public void sendMessage(SyslogMessage message) throws IOException {
sendCounter.incrementAndGet();
long nanosBefore = System.nanoTime();
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Writer out = new OutputStreamWriter(baos, UTF_8);
... | [
"@",
"Override",
"public",
"void",
"sendMessage",
"(",
"SyslogMessage",
"message",
")",
"throws",
"IOException",
"{",
"sendCounter",
".",
"incrementAndGet",
"(",
")",
";",
"long",
"nanosBefore",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"try",
"{",
"Byt... | Send the given {@link com.cloudbees.syslog.SyslogMessage} over UDP.
@param message the message to send
@throws IOException | [
"Send",
"the",
"given",
"{",
"@link",
"com",
".",
"cloudbees",
".",
"syslog",
".",
"SyslogMessage",
"}",
"over",
"UDP",
"."
] | train | https://github.com/CloudBees-community/syslog-java-client/blob/41e01206e4ce17c6d225ffb443bf19792a3f3c3a/src/main/java/com/cloudbees/syslog/sender/UdpSyslogMessageSender.java#L76-L103 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/helper/CheckPointHelper.java | CheckPointHelper.addValidationRule | public CheckPointHelper addValidationRule(String ruleName, StandardValueType standardValueType, BaseValidationCheck validationCheck, AssistType assistType) {
"""
Add the fresh user rule
@param ruleName use rule name - must uniqueue
@param standardValueType rule check standardvalue type
@param validat... | java | public CheckPointHelper addValidationRule(String ruleName, StandardValueType standardValueType, BaseValidationCheck validationCheck, AssistType assistType) {
ValidationRule rule = new ValidationRule(ruleName, standardValueType, validationCheck);
if (assistType == null) {
assistType = AssistT... | [
"public",
"CheckPointHelper",
"addValidationRule",
"(",
"String",
"ruleName",
",",
"StandardValueType",
"standardValueType",
",",
"BaseValidationCheck",
"validationCheck",
",",
"AssistType",
"assistType",
")",
"{",
"ValidationRule",
"rule",
"=",
"new",
"ValidationRule",
"... | Add the fresh user rule
@param ruleName use rule name - must uniqueue
@param standardValueType rule check standardvalue type
@param validationCheck rule check class with extends BaseValidationCheck and overide replace or check method and exception method
@param assistType input field type
@return Che... | [
"Add",
"the",
"fresh",
"user",
"rule"
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/helper/CheckPointHelper.java#L63-L71 |
groupon/monsoon | history/src/main/java/com/groupon/lex/metrics/history/xdr/support/FileUtil.java | FileUtil.createTempFile | public static FileChannel createTempFile(Path dir, String prefix, String suffix) throws IOException {
"""
Create a temporary file that will be removed when it is closed.
"""
return createNewFileImpl(dir, prefix, suffix, new OpenOption[]{READ, WRITE, CREATE_NEW, DELETE_ON_CLOSE}).getFileChannel();
} | java | public static FileChannel createTempFile(Path dir, String prefix, String suffix) throws IOException {
return createNewFileImpl(dir, prefix, suffix, new OpenOption[]{READ, WRITE, CREATE_NEW, DELETE_ON_CLOSE}).getFileChannel();
} | [
"public",
"static",
"FileChannel",
"createTempFile",
"(",
"Path",
"dir",
",",
"String",
"prefix",
",",
"String",
"suffix",
")",
"throws",
"IOException",
"{",
"return",
"createNewFileImpl",
"(",
"dir",
",",
"prefix",
",",
"suffix",
",",
"new",
"OpenOption",
"["... | Create a temporary file that will be removed when it is closed. | [
"Create",
"a",
"temporary",
"file",
"that",
"will",
"be",
"removed",
"when",
"it",
"is",
"closed",
"."
] | train | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/support/FileUtil.java#L58-L60 |
mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteConnectionPool.java | SQLiteConnectionPool.shouldYieldConnection | public boolean shouldYieldConnection(SQLiteConnection connection, int connectionFlags) {
"""
Returns true if the session should yield the connection due to
contention over available database connections.
@param connection The connection owned by the session.
@param connectionFlags The connection request flags... | java | public boolean shouldYieldConnection(SQLiteConnection connection, int connectionFlags) {
synchronized (mLock) {
if (!mAcquiredConnections.containsKey(connection)) {
throw new IllegalStateException("Cannot perform this operation "
+ "because the specified conne... | [
"public",
"boolean",
"shouldYieldConnection",
"(",
"SQLiteConnection",
"connection",
",",
"int",
"connectionFlags",
")",
"{",
"synchronized",
"(",
"mLock",
")",
"{",
"if",
"(",
"!",
"mAcquiredConnections",
".",
"containsKey",
"(",
"connection",
")",
")",
"{",
"t... | Returns true if the session should yield the connection due to
contention over available database connections.
@param connection The connection owned by the session.
@param connectionFlags The connection request flags.
@return True if the session should yield its connection.
@throws IllegalStateException if the conne... | [
"Returns",
"true",
"if",
"the",
"session",
"should",
"yield",
"the",
"connection",
"due",
"to",
"contention",
"over",
"available",
"database",
"connections",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteConnectionPool.java#L424-L439 |
radkovo/SwingBox | src/main/java/org/fit/cssbox/swingbox/view/TextBoxView.java | TextBoxView.processPaint | protected void processPaint(Graphics gg, Shape a) {
"""
Process paint.
@param gg
the graphics context
@param a
the allocation
"""
Graphics2D g = (Graphics2D) gg;
AffineTransform tmpTransform = g.getTransform();
if (!tmpTransform.equals(transform))
{
transform =... | java | protected void processPaint(Graphics gg, Shape a)
{
Graphics2D g = (Graphics2D) gg;
AffineTransform tmpTransform = g.getTransform();
if (!tmpTransform.equals(transform))
{
transform = tmpTransform;
invalidateTextLayout();
}
Component c = conta... | [
"protected",
"void",
"processPaint",
"(",
"Graphics",
"gg",
",",
"Shape",
"a",
")",
"{",
"Graphics2D",
"g",
"=",
"(",
"Graphics2D",
")",
"gg",
";",
"AffineTransform",
"tmpTransform",
"=",
"g",
".",
"getTransform",
"(",
")",
";",
"if",
"(",
"!",
"tmpTrans... | Process paint.
@param gg
the graphics context
@param a
the allocation | [
"Process",
"paint",
"."
] | train | https://github.com/radkovo/SwingBox/blob/ff370f3dc54d248e4c8852c17513618c83c25984/src/main/java/org/fit/cssbox/swingbox/view/TextBoxView.java#L359-L397 |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java | DataSetUtils.countElementsPerPartition | public static <T> DataSet<Tuple2<Integer, Long>> countElementsPerPartition(DataSet<T> input) {
"""
Method that goes over all the elements in each partition in order to retrieve
the total number of elements.
@param input the DataSet received as input
@return a data set containing tuples of subtask index, numbe... | java | public static <T> DataSet<Tuple2<Integer, Long>> countElementsPerPartition(DataSet<T> input) {
return input.mapPartition(new RichMapPartitionFunction<T, Tuple2<Integer, Long>>() {
@Override
public void mapPartition(Iterable<T> values, Collector<Tuple2<Integer, Long>> out) throws Exception {
long counter = 0... | [
"public",
"static",
"<",
"T",
">",
"DataSet",
"<",
"Tuple2",
"<",
"Integer",
",",
"Long",
">",
">",
"countElementsPerPartition",
"(",
"DataSet",
"<",
"T",
">",
"input",
")",
"{",
"return",
"input",
".",
"mapPartition",
"(",
"new",
"RichMapPartitionFunction",... | Method that goes over all the elements in each partition in order to retrieve
the total number of elements.
@param input the DataSet received as input
@return a data set containing tuples of subtask index, number of elements mappings. | [
"Method",
"that",
"goes",
"over",
"all",
"the",
"elements",
"in",
"each",
"partition",
"in",
"order",
"to",
"retrieve",
"the",
"total",
"number",
"of",
"elements",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java#L69-L80 |
fcrepo3/fcrepo | fcrepo-common/src/main/java/org/fcrepo/utilities/xml/XercesXmlSerializers.java | XercesXmlSerializers.writeConsoleNoDocType | public static void writeConsoleNoDocType(Document ele, Writer out)
throws IOException {
"""
method: "XML"
charset: "UTF-8"
indenting: TRUE
indent-width: 2
line-width: 80
preserve-space: FALSE
omit-XML-declaration: FALSE
omit-DOCTYPE: TRUE
@param ele
@param out
@throws IOException
"""
XMLS... | java | public static void writeConsoleNoDocType(Document ele, Writer out)
throws IOException {
XMLSerializer serializer =
new XMLSerializer(out, CONSOLE_NO_DOCTYPE);
serializer.serialize(ele);
} | [
"public",
"static",
"void",
"writeConsoleNoDocType",
"(",
"Document",
"ele",
",",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"XMLSerializer",
"serializer",
"=",
"new",
"XMLSerializer",
"(",
"out",
",",
"CONSOLE_NO_DOCTYPE",
")",
";",
"serializer",
".",
... | method: "XML"
charset: "UTF-8"
indenting: TRUE
indent-width: 2
line-width: 80
preserve-space: FALSE
omit-XML-declaration: FALSE
omit-DOCTYPE: TRUE
@param ele
@param out
@throws IOException | [
"method",
":",
"XML",
"charset",
":",
"UTF",
"-",
"8",
"indenting",
":",
"TRUE",
"indent",
"-",
"width",
":",
"2",
"line",
"-",
"width",
":",
"80",
"preserve",
"-",
"space",
":",
"FALSE",
"omit",
"-",
"XML",
"-",
"declaration",
":",
"FALSE",
"omit",
... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-common/src/main/java/org/fcrepo/utilities/xml/XercesXmlSerializers.java#L52-L57 |
Azure/azure-sdk-for-java | recoveryservices/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/v2016_06_01/implementation/VaultExtendedInfosInner.java | VaultExtendedInfosInner.createOrUpdate | public VaultExtendedInfoResourceInner createOrUpdate(String resourceGroupName, String vaultName, VaultExtendedInfoResourceInner resourceResourceExtendedInfoDetails) {
"""
Create vault extended info.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@param vau... | java | public VaultExtendedInfoResourceInner createOrUpdate(String resourceGroupName, String vaultName, VaultExtendedInfoResourceInner resourceResourceExtendedInfoDetails) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, vaultName, resourceResourceExtendedInfoDetails).toBlocking().single().body();
... | [
"public",
"VaultExtendedInfoResourceInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"vaultName",
",",
"VaultExtendedInfoResourceInner",
"resourceResourceExtendedInfoDetails",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGr... | Create vault extended info.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@param vaultName The name of the recovery services vault.
@param resourceResourceExtendedInfoDetails Details of ResourceExtendedInfo
@throws IllegalArgumentException thrown if parameters fa... | [
"Create",
"vault",
"extended",
"info",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/v2016_06_01/implementation/VaultExtendedInfosInner.java#L169-L171 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/AppUtil.java | AppUtil.startCall | @RequiresPermission(Manifest.permission.CALL_PHONE)
public static void startCall(@NonNull final Context context, final int phoneNumber) {
"""
Starts the dialer in order to call a specific phone number. The call is immediately started,
requiring the invoking app to have the permission <code>android.permission.... | java | @RequiresPermission(Manifest.permission.CALL_PHONE)
public static void startCall(@NonNull final Context context, final int phoneNumber) {
startDialer(context, Integer.toString(phoneNumber));
} | [
"@",
"RequiresPermission",
"(",
"Manifest",
".",
"permission",
".",
"CALL_PHONE",
")",
"public",
"static",
"void",
"startCall",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"final",
"int",
"phoneNumber",
")",
"{",
"startDialer",
"(",
"context",
","... | Starts the dialer in order to call a specific phone number. The call is immediately started,
requiring the invoking app to have the permission <code>android.permission.CALL_PHONE</code>
granted, otherwise a {@link SecurityException} will be thrown. If an error occurs while
starting the dialer, an {@link ActivityNotFoun... | [
"Starts",
"the",
"dialer",
"in",
"order",
"to",
"call",
"a",
"specific",
"phone",
"number",
".",
"The",
"call",
"is",
"immediately",
"started",
"requiring",
"the",
"invoking",
"app",
"to",
"have",
"the",
"permission",
"<code",
">",
"android",
".",
"permissio... | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/AppUtil.java#L379-L382 |
CloudSlang/cs-actions | cs-commons/src/main/java/io/cloudslang/content/utils/NumberUtilities.java | NumberUtilities.isValidLong | public static boolean isValidLong(@Nullable final String longStr, final long lowerBound, final long upperBound) {
"""
Given a long integer string, it checks if it's a valid long (base on apaches NumberUtils.createLong) and if
it's between the lowerBound and upperBound (including the lowerBound and excluding the u... | java | public static boolean isValidLong(@Nullable final String longStr, final long lowerBound, final long upperBound) {
return isValidLong(longStr, lowerBound, upperBound, true, false);
} | [
"public",
"static",
"boolean",
"isValidLong",
"(",
"@",
"Nullable",
"final",
"String",
"longStr",
",",
"final",
"long",
"lowerBound",
",",
"final",
"long",
"upperBound",
")",
"{",
"return",
"isValidLong",
"(",
"longStr",
",",
"lowerBound",
",",
"upperBound",
"... | Given a long integer string, it checks if it's a valid long (base on apaches NumberUtils.createLong) and if
it's between the lowerBound and upperBound (including the lowerBound and excluding the upperBound).
@param longStr the long integer string to check
@param lowerBound the lower bound of the interval
@param upperB... | [
"Given",
"a",
"long",
"integer",
"string",
"it",
"checks",
"if",
"it",
"s",
"a",
"valid",
"long",
"(",
"base",
"on",
"apaches",
"NumberUtils",
".",
"createLong",
")",
"and",
"if",
"it",
"s",
"between",
"the",
"lowerBound",
"and",
"upperBound",
"(",
"incl... | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-commons/src/main/java/io/cloudslang/content/utils/NumberUtilities.java#L144-L146 |
Squarespace/cldr | compiler/src/main/java/com/squarespace/cldr/codegen/CalendarCodeGenerator.java | CalendarCodeGenerator.buildTimeZoneAliases | private void buildTimeZoneAliases(TypeSpec.Builder type, Map<String, String> map) {
"""
Creates a switch table to resolve a retired time zone to a valid one.
"""
MethodSpec.Builder method = MethodSpec.methodBuilder("getTimeZoneAlias")
.addModifiers(PUBLIC, STATIC)
.addParameter(String.class... | java | private void buildTimeZoneAliases(TypeSpec.Builder type, Map<String, String> map) {
MethodSpec.Builder method = MethodSpec.methodBuilder("getTimeZoneAlias")
.addModifiers(PUBLIC, STATIC)
.addParameter(String.class, "zoneId")
.returns(String.class);
method.beginControlFlow("switch (zoneI... | [
"private",
"void",
"buildTimeZoneAliases",
"(",
"TypeSpec",
".",
"Builder",
"type",
",",
"Map",
"<",
"String",
",",
"String",
">",
"map",
")",
"{",
"MethodSpec",
".",
"Builder",
"method",
"=",
"MethodSpec",
".",
"methodBuilder",
"(",
"\"getTimeZoneAlias\"",
")... | Creates a switch table to resolve a retired time zone to a valid one. | [
"Creates",
"a",
"switch",
"table",
"to",
"resolve",
"a",
"retired",
"time",
"zone",
"to",
"a",
"valid",
"one",
"."
] | train | https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/compiler/src/main/java/com/squarespace/cldr/codegen/CalendarCodeGenerator.java#L186-L199 |
kubernetes-client/java | util/src/main/java/io/kubernetes/client/util/Yaml.java | Yaml.loadAs | public static <T> T loadAs(Reader reader, Class<T> clazz) {
"""
Load an API object from a YAML stream. Returns a concrete typed object using the type
specified.
@param reader The YAML stream
@param clazz The class of object to return.
@return An instantiation of the object.
@throws IOException If an error o... | java | public static <T> T loadAs(Reader reader, Class<T> clazz) {
return getSnakeYaml().loadAs(reader, clazz);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"loadAs",
"(",
"Reader",
"reader",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"getSnakeYaml",
"(",
")",
".",
"loadAs",
"(",
"reader",
",",
"clazz",
")",
";",
"}"
] | Load an API object from a YAML stream. Returns a concrete typed object using the type
specified.
@param reader The YAML stream
@param clazz The class of object to return.
@return An instantiation of the object.
@throws IOException If an error occurs while reading the YAML. | [
"Load",
"an",
"API",
"object",
"from",
"a",
"YAML",
"stream",
".",
"Returns",
"a",
"concrete",
"typed",
"object",
"using",
"the",
"type",
"specified",
"."
] | train | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/util/Yaml.java#L221-L223 |
aws/aws-sdk-java | aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/GetIdentityPoolRolesResult.java | GetIdentityPoolRolesResult.withRoleMappings | public GetIdentityPoolRolesResult withRoleMappings(java.util.Map<String, RoleMapping> roleMappings) {
"""
<p>
How users for a specific identity provider are to mapped to roles. This is a String-to-<a>RoleMapping</a> object
map. The string identifies the identity provider, for example, "graph.facebook.com" or
"c... | java | public GetIdentityPoolRolesResult withRoleMappings(java.util.Map<String, RoleMapping> roleMappings) {
setRoleMappings(roleMappings);
return this;
} | [
"public",
"GetIdentityPoolRolesResult",
"withRoleMappings",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"RoleMapping",
">",
"roleMappings",
")",
"{",
"setRoleMappings",
"(",
"roleMappings",
")",
";",
"return",
"this",
";",
"}"
] | <p>
How users for a specific identity provider are to mapped to roles. This is a String-to-<a>RoleMapping</a> object
map. The string identifies the identity provider, for example, "graph.facebook.com" or
"cognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id".
</p>
@param roleMappings
How users for a s... | [
"<p",
">",
"How",
"users",
"for",
"a",
"specific",
"identity",
"provider",
"are",
"to",
"mapped",
"to",
"roles",
".",
"This",
"is",
"a",
"String",
"-",
"to",
"-",
"<a",
">",
"RoleMapping<",
"/",
"a",
">",
"object",
"map",
".",
"The",
"string",
"ident... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/GetIdentityPoolRolesResult.java#L201-L204 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/datastore/map/impl/MapDatastoreProvider.java | MapDatastoreProvider.readLock | public void readLock(EntityKey key, int timeout) {
"""
Acquires a read lock on a specific key.
@param key The key to lock
@param timeout in milliseconds; -1 means wait indefinitely, 0 means no wait.
"""
ReadWriteLock lock = getLock( key );
Lock readLock = lock.readLock();
acquireLock( key, timeout, rea... | java | public void readLock(EntityKey key, int timeout) {
ReadWriteLock lock = getLock( key );
Lock readLock = lock.readLock();
acquireLock( key, timeout, readLock );
} | [
"public",
"void",
"readLock",
"(",
"EntityKey",
"key",
",",
"int",
"timeout",
")",
"{",
"ReadWriteLock",
"lock",
"=",
"getLock",
"(",
"key",
")",
";",
"Lock",
"readLock",
"=",
"lock",
".",
"readLock",
"(",
")",
";",
"acquireLock",
"(",
"key",
",",
"tim... | Acquires a read lock on a specific key.
@param key The key to lock
@param timeout in milliseconds; -1 means wait indefinitely, 0 means no wait. | [
"Acquires",
"a",
"read",
"lock",
"on",
"a",
"specific",
"key",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/datastore/map/impl/MapDatastoreProvider.java#L105-L109 |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/api/common/operators/DualInputSemanticProperties.java | DualInputSemanticProperties.addForwardedField2 | public void addForwardedField2(int sourceField, int destinationField) {
"""
Adds, to the existing information, a field that is forwarded directly
from the source record(s) in the second input to the destination
record(s).
@param sourceField the position in the source record(s) from the first input
@param des... | java | public void addForwardedField2(int sourceField, int destinationField) {
FieldSet fs;
if((fs = this.forwardedFields2.get(sourceField)) != null) {
fs.add(destinationField);
} else {
fs = new FieldSet(destinationField);
this.forwardedFields2.put(sourceField, fs);
}
} | [
"public",
"void",
"addForwardedField2",
"(",
"int",
"sourceField",
",",
"int",
"destinationField",
")",
"{",
"FieldSet",
"fs",
";",
"if",
"(",
"(",
"fs",
"=",
"this",
".",
"forwardedFields2",
".",
"get",
"(",
"sourceField",
")",
")",
"!=",
"null",
")",
"... | Adds, to the existing information, a field that is forwarded directly
from the source record(s) in the second input to the destination
record(s).
@param sourceField the position in the source record(s) from the first input
@param destinationField the position in the destination record(s) | [
"Adds",
"to",
"the",
"existing",
"information",
"a",
"field",
"that",
"is",
"forwarded",
"directly",
"from",
"the",
"source",
"record",
"(",
"s",
")",
"in",
"the",
"second",
"input",
"to",
"the",
"destination",
"record",
"(",
"s",
")",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/api/common/operators/DualInputSemanticProperties.java#L124-L132 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java | SeaGlassLookAndFeel.defineInternalFrameIconifyButtons | private void defineInternalFrameIconifyButtons(UIDefaults d) {
"""
Initialize the internal frame iconify button settings.
@param d the UI defaults map.
"""
String p = "InternalFrame:InternalFrameTitlePane:\"InternalFrameTitlePane.iconifyButton\"";
String c = PAINTER_PREFIX + "TitlePaneIconif... | java | private void defineInternalFrameIconifyButtons(UIDefaults d) {
String p = "InternalFrame:InternalFrameTitlePane:\"InternalFrameTitlePane.iconifyButton\"";
String c = PAINTER_PREFIX + "TitlePaneIconifyButtonPainter";
d.put(p + ".States", "Enabled,MouseOver,Pressed,Disabled,Focused,Selected,Windo... | [
"private",
"void",
"defineInternalFrameIconifyButtons",
"(",
"UIDefaults",
"d",
")",
"{",
"String",
"p",
"=",
"\"InternalFrame:InternalFrameTitlePane:\\\"InternalFrameTitlePane.iconifyButton\\\"\"",
";",
"String",
"c",
"=",
"PAINTER_PREFIX",
"+",
"\"TitlePaneIconifyButtonPainter\... | Initialize the internal frame iconify button settings.
@param d the UI defaults map. | [
"Initialize",
"the",
"internal",
"frame",
"iconify",
"button",
"settings",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java#L1259-L1301 |
seedstack/i18n-addon | core/src/main/java/org/seedstack/i18n/internal/domain/model/key/Key.java | Key.addTranslation | public Translation addTranslation(String locale, String value, boolean isApproximate) {
"""
Saves or updates the translation for the specified locale.
If the key was outdated, checks if the key is still outdated.
@param locale specified the translation locale
@param value translation value
@pa... | java | public Translation addTranslation(String locale, String value, boolean isApproximate) {
LocaleCodeSpecification.assertCode(locale);
if (isBlank(value)) {
throw new IllegalArgumentException("The translation can't be blank");
}
Translation translation = createOrUpdateTranslatio... | [
"public",
"Translation",
"addTranslation",
"(",
"String",
"locale",
",",
"String",
"value",
",",
"boolean",
"isApproximate",
")",
"{",
"LocaleCodeSpecification",
".",
"assertCode",
"(",
"locale",
")",
";",
"if",
"(",
"isBlank",
"(",
"value",
")",
")",
"{",
"... | Saves or updates the translation for the specified locale.
If the key was outdated, checks if the key is still outdated.
@param locale specified the translation locale
@param value translation value
@param isApproximate true if the translation is not exact.
@return the new translation
@throws java.lang.... | [
"Saves",
"or",
"updates",
"the",
"translation",
"for",
"the",
"specified",
"locale",
".",
"If",
"the",
"key",
"was",
"outdated",
"checks",
"if",
"the",
"key",
"is",
"still",
"outdated",
"."
] | train | https://github.com/seedstack/i18n-addon/blob/1e65101d8554623f09bda2497b0151fd10a16615/core/src/main/java/org/seedstack/i18n/internal/domain/model/key/Key.java#L85-L93 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java | NetworkConfig.fromJsonFile | public static NetworkConfig fromJsonFile(File configFile) throws InvalidArgumentException, IOException, NetworkConfigurationException {
"""
Creates a new NetworkConfig instance configured with details supplied in a JSON file.
@param configFile The file containing the network configuration
@return A new Network... | java | public static NetworkConfig fromJsonFile(File configFile) throws InvalidArgumentException, IOException, NetworkConfigurationException {
return fromFile(configFile, true);
} | [
"public",
"static",
"NetworkConfig",
"fromJsonFile",
"(",
"File",
"configFile",
")",
"throws",
"InvalidArgumentException",
",",
"IOException",
",",
"NetworkConfigurationException",
"{",
"return",
"fromFile",
"(",
"configFile",
",",
"true",
")",
";",
"}"
] | Creates a new NetworkConfig instance configured with details supplied in a JSON file.
@param configFile The file containing the network configuration
@return A new NetworkConfig instance
@throws InvalidArgumentException
@throws IOException | [
"Creates",
"a",
"new",
"NetworkConfig",
"instance",
"configured",
"with",
"details",
"supplied",
"in",
"a",
"JSON",
"file",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L254-L256 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/DefaultCommandManager.java | DefaultCommandManager.createCommandGroup | @Override
public CommandGroup createCommandGroup(final String groupId, final Object[] members,
final boolean exclusive, final CommandConfigurer configurer) {
"""
Creates a command group, configuring the group using the ObjectConfigurer
service (pulling visual configu... | java | @Override
public CommandGroup createCommandGroup(final String groupId, final Object[] members,
final boolean exclusive, final CommandConfigurer configurer) {
final CommandGroupFactoryBean groupFactory = new CommandGroupFactoryBean(groupId, null, getCommandConfigurer(), m... | [
"@",
"Override",
"public",
"CommandGroup",
"createCommandGroup",
"(",
"final",
"String",
"groupId",
",",
"final",
"Object",
"[",
"]",
"members",
",",
"final",
"boolean",
"exclusive",
",",
"final",
"CommandConfigurer",
"configurer",
")",
"{",
"final",
"CommandGroup... | Creates a command group, configuring the group using the ObjectConfigurer
service (pulling visual configuration properties from an external
source). This method will also auto-configure contained Command members
that have not yet been configured.
@param groupId id to configure this commandGroup.
@param members members... | [
"Creates",
"a",
"command",
"group",
"configuring",
"the",
"group",
"using",
"the",
"ObjectConfigurer",
"service",
"(",
"pulling",
"visual",
"configuration",
"properties",
"from",
"an",
"external",
"source",
")",
".",
"This",
"method",
"will",
"also",
"auto",
"-"... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/DefaultCommandManager.java#L332-L338 |
javabits/yar | yar-guice/src/main/java/org/javabits/yar/guice/Reflections.java | Reflections.asParameterizedType | @Nullable
private static ParameterizedType asParameterizedType(Type type, Class<?> expectedType) {
"""
Returns the given type casted to {@code ParameterizedType} if and only
if it is a {@code ParameterizedType} and its raw type is assignable from
the given expected type.
@param type the type whose... | java | @Nullable
private static ParameterizedType asParameterizedType(Type type, Class<?> expectedType) {
ParameterizedType result = null;
if (isParameterizedType(type)) {
ParameterizedType parameterizedType = (ParameterizedType) type;
if (expectedType.isAssignableFrom((Class<?>) pa... | [
"@",
"Nullable",
"private",
"static",
"ParameterizedType",
"asParameterizedType",
"(",
"Type",
"type",
",",
"Class",
"<",
"?",
">",
"expectedType",
")",
"{",
"ParameterizedType",
"result",
"=",
"null",
";",
"if",
"(",
"isParameterizedType",
"(",
"type",
")",
"... | Returns the given type casted to {@code ParameterizedType} if and only
if it is a {@code ParameterizedType} and its raw type is assignable from
the given expected type.
@param type the type whose expect parameterized must be tested.
@param expectedType expected parameterized type.
@return the expected paramete... | [
"Returns",
"the",
"given",
"type",
"casted",
"to",
"{",
"@code",
"ParameterizedType",
"}",
"if",
"and",
"only",
"if",
"it",
"is",
"a",
"{",
"@code",
"ParameterizedType",
"}",
"and",
"its",
"raw",
"type",
"is",
"assignable",
"from",
"the",
"given",
"expecte... | train | https://github.com/javabits/yar/blob/e146a86611ca4831e8334c9a98fd7086cee9c03e/yar-guice/src/main/java/org/javabits/yar/guice/Reflections.java#L127-L137 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/corpus/io/IOUtil.java | IOUtil.readBytesFromOtherInputStream | public static int readBytesFromOtherInputStream(InputStream is, byte[] targetArray) throws IOException {
"""
从InputStream读取指定长度的字节出来
@param is 流
@param targetArray output
@return 实际读取了多少字节,返回0表示遇到了文件尾部
@throws IOException
"""
assert targetArray != null;
if (targetArray.length == 0) return 0... | java | public static int readBytesFromOtherInputStream(InputStream is, byte[] targetArray) throws IOException
{
assert targetArray != null;
if (targetArray.length == 0) return 0;
int len;
int off = 0;
while (off < targetArray.length && (len = is.read(targetArray, off, targetArray.le... | [
"public",
"static",
"int",
"readBytesFromOtherInputStream",
"(",
"InputStream",
"is",
",",
"byte",
"[",
"]",
"targetArray",
")",
"throws",
"IOException",
"{",
"assert",
"targetArray",
"!=",
"null",
";",
"if",
"(",
"targetArray",
".",
"length",
"==",
"0",
")",
... | 从InputStream读取指定长度的字节出来
@param is 流
@param targetArray output
@return 实际读取了多少字节,返回0表示遇到了文件尾部
@throws IOException | [
"从InputStream读取指定长度的字节出来"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/io/IOUtil.java#L292-L303 |
matiwinnetou/spring-soy-view | spring-soy-view/src/main/java/pl/matisoft/soy/bundle/DefaultSoyMsgBundleResolver.java | DefaultSoyMsgBundleResolver.createSoyMsgBundle | protected SoyMsgBundle createSoyMsgBundle(final Locale locale) throws IOException {
"""
An implementation that using a ContextClassLoader iterates over all urls it finds
based on a messagePath and locale, e.g. messages_de_DE.xlf and returns a merged
SoyMsgBundle of SoyMsgBundle matching a a pattern it finds in a... | java | protected SoyMsgBundle createSoyMsgBundle(final Locale locale) throws IOException {
Preconditions.checkNotNull(messagesPath, "messagesPath cannot be null!");
final String path = messagesPath + "_" + locale.toString() + ".xlf";
final Enumeration<URL> e = Thread.currentThread().getContextClassLo... | [
"protected",
"SoyMsgBundle",
"createSoyMsgBundle",
"(",
"final",
"Locale",
"locale",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"messagesPath",
",",
"\"messagesPath cannot be null!\"",
")",
";",
"final",
"String",
"path",
"=",
"messa... | An implementation that using a ContextClassLoader iterates over all urls it finds
based on a messagePath and locale, e.g. messages_de_DE.xlf and returns a merged
SoyMsgBundle of SoyMsgBundle matching a a pattern it finds in a class path.
@param locale - locale
@return SoyMsgBundle - bundle
@throws java.io.IOException ... | [
"An",
"implementation",
"that",
"using",
"a",
"ContextClassLoader",
"iterates",
"over",
"all",
"urls",
"it",
"finds",
"based",
"on",
"a",
"messagePath",
"and",
"locale",
"e",
".",
"g",
".",
"messages_de_DE",
".",
"xlf",
"and",
"returns",
"a",
"merged",
"SoyM... | train | https://github.com/matiwinnetou/spring-soy-view/blob/a27c1b2bc76b074a2753ddd7b0c7f685c883d1d1/spring-soy-view/src/main/java/pl/matisoft/soy/bundle/DefaultSoyMsgBundleResolver.java#L104-L121 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/syslog_generic.java | syslog_generic.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
syslog_generic_responses result = (syslog_generic_responses) service.ge... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
syslog_generic_responses result = (syslog_generic_responses) service.get_payload_formatter().string_to_resource(syslog_generic_responses.class, response);
if(result.errorcode != 0)
{
if (result.er... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"syslog_generic_responses",
"result",
"=",
"(",
"syslog_generic_responses",
")",
"service",
".",
"get_payload_... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/syslog_generic.java#L478-L495 |
moleculer-java/moleculer-java | src/main/java/services/moleculer/ServiceBroker.java | ServiceBroker.waitForServices | public Promise waitForServices(long timeoutMillis, Collection<String> services) {
"""
Waits for a collection of services. Sample code:<br>
<br>
Set<String> serviceNames = ...<br>
broker.waitForServices(5000, serviceNames).then(in -> {<br>
broker.getLogger().info("Ok");<br>
}.catchError(error -> {<... | java | public Promise waitForServices(long timeoutMillis, Collection<String> services) {
return serviceRegistry.waitForServices(timeoutMillis, services);
} | [
"public",
"Promise",
"waitForServices",
"(",
"long",
"timeoutMillis",
",",
"Collection",
"<",
"String",
">",
"services",
")",
"{",
"return",
"serviceRegistry",
".",
"waitForServices",
"(",
"timeoutMillis",
",",
"services",
")",
";",
"}"
] | Waits for a collection of services. Sample code:<br>
<br>
Set<String> serviceNames = ...<br>
broker.waitForServices(5000, serviceNames).then(in -> {<br>
broker.getLogger().info("Ok");<br>
}.catchError(error -> {<br>
broker.getLogger().info("Failed / timeout");<br>
}
@param timeoutMillis
timeout in millisec... | [
"Waits",
"for",
"a",
"collection",
"of",
"services",
".",
"Sample",
"code",
":",
"<br",
">",
"<br",
">",
"Set<",
";",
"String>",
";",
"serviceNames",
"=",
"...",
"<br",
">",
"broker",
".",
"waitForServices",
"(",
"5000",
"serviceNames",
")",
".",
"th... | train | https://github.com/moleculer-java/moleculer-java/blob/27575c44b9ecacc17c4456ceacf5d1851abf1cc4/src/main/java/services/moleculer/ServiceBroker.java#L826-L828 |
haraldk/TwelveMonkeys | imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/QuickDrawContext.java | QuickDrawContext.copyBits | public void copyBits(BufferedImage pSrcBitmap, Rectangle pSrcRect, Rectangle pDstRect, int pMode, Shape pMaskRgn) {
"""
CopyBits.
<p/>
Note that the destination is always {@code this}.
@param pSrcBitmap the source bitmap to copy pixels from
@param pSrcRect the source rectangle
@param pDstRect the destin... | java | public void copyBits(BufferedImage pSrcBitmap, Rectangle pSrcRect, Rectangle pDstRect, int pMode, Shape pMaskRgn) {
graphics.setComposite(getCompositeFor(pMode));
if (pMaskRgn != null) {
setClipRegion(pMaskRgn);
}
graphics.drawImage(
pSrcBitmap,
... | [
"public",
"void",
"copyBits",
"(",
"BufferedImage",
"pSrcBitmap",
",",
"Rectangle",
"pSrcRect",
",",
"Rectangle",
"pDstRect",
",",
"int",
"pMode",
",",
"Shape",
"pMaskRgn",
")",
"{",
"graphics",
".",
"setComposite",
"(",
"getCompositeFor",
"(",
"pMode",
")",
"... | CopyBits.
<p/>
Note that the destination is always {@code this}.
@param pSrcBitmap the source bitmap to copy pixels from
@param pSrcRect the source rectangle
@param pDstRect the destination rectangle
@param pMode the blending mode
@param pMaskRgn the mask region | [
"CopyBits",
".",
"<p",
"/",
">",
"Note",
"that",
"the",
"destination",
"is",
"always",
"{",
"@code",
"this",
"}",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/QuickDrawContext.java#L933-L953 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/NamespaceResources.java | NamespaceResources.updateUsersForNamespace | @PUT
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/ {
"""
Update users allowed to use this namespace.
@param req The HTTP request.
@param namespaceId The namespace ID to update.
@param usernames The list of authorized users.
@return The ... | java | @PUT
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/{namespaceId}/users")
@Description("Update users allowed to use this namespace.")
public NamespaceDto updateUsersForNamespace(@Context HttpServletRequest req,
@PathParam("namespaceId") final BigInteger n... | [
"@",
"PUT",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Path",
"(",
"\"/{namespaceId}/users\"",
")",
"@",
"Description",
"(",
"\"Update users allowed to use this namespace.\"",... | Update users allowed to use this namespace.
@param req The HTTP request.
@param namespaceId The namespace ID to update.
@param usernames The list of authorized users.
@return The updated namespace.
@throws WebApplicationException If an error occurs. | [
"Update",
"users",
"allowed",
"to",
"use",
"this",
"namespace",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/NamespaceResources.java#L129-L154 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertNV21.java | ConvertNV21.nv21ToInterleaved | public static InterleavedF32 nv21ToInterleaved( byte[] data , int width , int height ,
InterleavedF32 output ) {
"""
Converts an NV21 image into a {@link InterleavedF32} RGB image.
@param data Input: NV21 image data
@param width Input: NV21 image width
@param height Input: NV21 image height
... | java | public static InterleavedF32 nv21ToInterleaved( byte[] data , int width , int height ,
InterleavedF32 output ) {
if( output == null ) {
output = new InterleavedF32(width,height,3);
} else {
output.reshape(width, height, 3);
}
if(BoofConcurrency.USE_CONCURRENT ) {
ImplConvertNV21_MT.n... | [
"public",
"static",
"InterleavedF32",
"nv21ToInterleaved",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"width",
",",
"int",
"height",
",",
"InterleavedF32",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"{",
"output",
"=",
"new",
"InterleavedF... | Converts an NV21 image into a {@link InterleavedF32} RGB image.
@param data Input: NV21 image data
@param width Input: NV21 image width
@param height Input: NV21 image height
@param output Output: Optional storage for output image. Can be null. | [
"Converts",
"an",
"NV21",
"image",
"into",
"a",
"{",
"@link",
"InterleavedF32",
"}",
"RGB",
"image",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertNV21.java#L305-L320 |
michael-rapp/AndroidMaterialPreferences | example/src/main/java/de/mrapp/android/preference/example/PreferenceFragment.java | PreferenceFragment.createShowDialogHeaderListener | private Preference.OnPreferenceChangeListener createShowDialogHeaderListener() {
"""
Creates and returns a listener, which allows to adapt, whether the headers of the
preference's dialogs should be shown, or not, when the corresponding setting has been
changed.
@return The listener, which has been created, as... | java | private Preference.OnPreferenceChangeListener createShowDialogHeaderListener() {
return new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(final Preference preference, final Object newValue) {
boolean showDialogHeader = (Boolean) ne... | [
"private",
"Preference",
".",
"OnPreferenceChangeListener",
"createShowDialogHeaderListener",
"(",
")",
"{",
"return",
"new",
"Preference",
".",
"OnPreferenceChangeListener",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"onPreferenceChange",
"(",
"final",
"Prefe... | Creates and returns a listener, which allows to adapt, whether the headers of the
preference's dialogs should be shown, or not, when the corresponding setting has been
changed.
@return The listener, which has been created, as an instance of the type {@link
Preference.OnPreferenceChangeListener} | [
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"adapt",
"whether",
"the",
"headers",
"of",
"the",
"preference",
"s",
"dialogs",
"should",
"be",
"shown",
"or",
"not",
"when",
"the",
"corresponding",
"setting",
"has",
"been",
"changed",
... | train | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/example/src/main/java/de/mrapp/android/preference/example/PreferenceFragment.java#L176-L195 |
facebookarchive/hadoop-20 | src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerLogReaderUtil.java | ServerLogReaderUtil.checkTransactionId | static long checkTransactionId(long currentTransactionId, FSEditLogOp op)
throws IOException {
"""
Asserts the read operation is the expected one.
@param op the newly read operation
@param expectedTransactionId
@return next expected transaction id
@throws IOException if the transaction id doesn't match t... | java | static long checkTransactionId(long currentTransactionId, FSEditLogOp op)
throws IOException {
if (currentTransactionId != -1) {
if (op.getTransactionId() != currentTransactionId + 1) {
LOG.error("Read invalid txId=" + op.getTransactionId()
+ " expectedTxId=" + (currentTransactionId ... | [
"static",
"long",
"checkTransactionId",
"(",
"long",
"currentTransactionId",
",",
"FSEditLogOp",
"op",
")",
"throws",
"IOException",
"{",
"if",
"(",
"currentTransactionId",
"!=",
"-",
"1",
")",
"{",
"if",
"(",
"op",
".",
"getTransactionId",
"(",
")",
"!=",
"... | Asserts the read operation is the expected one.
@param op the newly read operation
@param expectedTransactionId
@return next expected transaction id
@throws IOException if the transaction id doesn't match the expected
transaction id. The transaction id's should be consecutive. | [
"Asserts",
"the",
"read",
"operation",
"is",
"the",
"expected",
"one",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerLogReaderUtil.java#L87-L98 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsGlobalConfigurationCacheEventHandler.java | CmsGlobalConfigurationCacheEventHandler.addCache | public void addCache(
I_CmsGlobalConfigurationCache offlineCache,
I_CmsGlobalConfigurationCache onlineCache,
String debugName) {
"""
Adds a new pair of cache instances which should be managed by this event handler.<p>
@param offlineCache the offline cache instance
@param onlineCache ... | java | public void addCache(
I_CmsGlobalConfigurationCache offlineCache,
I_CmsGlobalConfigurationCache onlineCache,
String debugName) {
CachePair cachePair = new CachePair(offlineCache, onlineCache, debugName);
m_caches.add(cachePair);
} | [
"public",
"void",
"addCache",
"(",
"I_CmsGlobalConfigurationCache",
"offlineCache",
",",
"I_CmsGlobalConfigurationCache",
"onlineCache",
",",
"String",
"debugName",
")",
"{",
"CachePair",
"cachePair",
"=",
"new",
"CachePair",
"(",
"offlineCache",
",",
"onlineCache",
","... | Adds a new pair of cache instances which should be managed by this event handler.<p>
@param offlineCache the offline cache instance
@param onlineCache the online cache instance
@param debugName an identifier used for debugging | [
"Adds",
"a",
"new",
"pair",
"of",
"cache",
"instances",
"which",
"should",
"be",
"managed",
"by",
"this",
"event",
"handler",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsGlobalConfigurationCacheEventHandler.java#L143-L150 |
voldemort/voldemort | src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java | ClientConfigUtil.readSingleClientConfigAvro | @SuppressWarnings("unchecked")
public static Properties readSingleClientConfigAvro(String configAvro) {
"""
Parses a string that contains single fat client config string in avro
format
@param configAvro Input string of avro format, that contains config for
multiple stores
@return Properties of single fat... | java | @SuppressWarnings("unchecked")
public static Properties readSingleClientConfigAvro(String configAvro) {
Properties props = new Properties();
try {
JsonDecoder decoder = new JsonDecoder(CLIENT_CONFIG_AVRO_SCHEMA, configAvro);
GenericDatumReader<Object> datumReader = new Generi... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Properties",
"readSingleClientConfigAvro",
"(",
"String",
"configAvro",
")",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"try",
"{",
"JsonDecoder",
"decoder",
"=",
... | Parses a string that contains single fat client config string in avro
format
@param configAvro Input string of avro format, that contains config for
multiple stores
@return Properties of single fat client config | [
"Parses",
"a",
"string",
"that",
"contains",
"single",
"fat",
"client",
"config",
"string",
"in",
"avro",
"format"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java#L34-L48 |
web3j/web3j | core/src/main/java/org/web3j/ens/EnsResolver.java | EnsResolver.reverseResolve | public String reverseResolve(String address) {
"""
Reverse name resolution as documented in the
<a href="https://docs.ens.domains/en/latest/userguide.html#reverse-name-resolution">specification</a>.
@param address an ethereum address, example: "0x314159265dd8dbb310642f98f50c066173c1259b"
@return a EnsName regis... | java | public String reverseResolve(String address) {
if (WalletUtils.isValidAddress(address)) {
String reverseName = Numeric.cleanHexPrefix(address) + REVERSE_NAME_SUFFIX;
PublicResolver resolver = obtainPublicResolver(reverseName);
byte[] nameHash = NameHash.nameHashAsBytes(rever... | [
"public",
"String",
"reverseResolve",
"(",
"String",
"address",
")",
"{",
"if",
"(",
"WalletUtils",
".",
"isValidAddress",
"(",
"address",
")",
")",
"{",
"String",
"reverseName",
"=",
"Numeric",
".",
"cleanHexPrefix",
"(",
"address",
")",
"+",
"REVERSE_NAME_SU... | Reverse name resolution as documented in the
<a href="https://docs.ens.domains/en/latest/userguide.html#reverse-name-resolution">specification</a>.
@param address an ethereum address, example: "0x314159265dd8dbb310642f98f50c066173c1259b"
@return a EnsName registered for provided address | [
"Reverse",
"name",
"resolution",
"as",
"documented",
"in",
"the",
"<a",
"href",
"=",
"https",
":",
"//",
"docs",
".",
"ens",
".",
"domains",
"/",
"en",
"/",
"latest",
"/",
"userguide",
".",
"html#reverse",
"-",
"name",
"-",
"resolution",
">",
"specificat... | train | https://github.com/web3j/web3j/blob/f99ceb19cdd65895c18e0a565034767ca18ea9fc/core/src/main/java/org/web3j/ens/EnsResolver.java#L97-L118 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/expressions/Expressions.java | Expressions.isLessThan | public static BooleanIsLessThan isLessThan(BooleanExpression left, Object constant) {
"""
Creates an BooleanIsLessThan expression from the given expression and constant.
@param left The left expression.
@param constant The constant to compare to (must be a Number).
@throws IllegalArgumentException If the con... | java | public static BooleanIsLessThan isLessThan(BooleanExpression left, Object constant) {
if (!(constant instanceof Boolean))
throw new IllegalArgumentException("constant is not a Boolean");
return new BooleanIsLessThan(left, constant((Boolean)constant));
} | [
"public",
"static",
"BooleanIsLessThan",
"isLessThan",
"(",
"BooleanExpression",
"left",
",",
"Object",
"constant",
")",
"{",
"if",
"(",
"!",
"(",
"constant",
"instanceof",
"Boolean",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"constant is not a Bo... | Creates an BooleanIsLessThan expression from the given expression and constant.
@param left The left expression.
@param constant The constant to compare to (must be a Number).
@throws IllegalArgumentException If the constant is not a Number
@return A new is less than binary expression. | [
"Creates",
"an",
"BooleanIsLessThan",
"expression",
"from",
"the",
"given",
"expression",
"and",
"constant",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/expressions/Expressions.java#L362-L368 |
michael-rapp/AndroidBottomSheet | library/src/main/java/de/mrapp/android/bottomsheet/BottomSheet.java | BottomSheet.addItem | public final void addItem(final int id, @StringRes final int titleId) {
"""
Adds a new item to the bottom sheet.
@param id
The id of the item, which should be added, as an {@link Integer} value. The id must
be at least 0
@param titleId
The resource id of the title of the item, which should be added, as an {... | java | public final void addItem(final int id, @StringRes final int titleId) {
Item item = new Item(getContext(), id, titleId);
adapter.add(item);
adaptGridViewHeight();
} | [
"public",
"final",
"void",
"addItem",
"(",
"final",
"int",
"id",
",",
"@",
"StringRes",
"final",
"int",
"titleId",
")",
"{",
"Item",
"item",
"=",
"new",
"Item",
"(",
"getContext",
"(",
")",
",",
"id",
",",
"titleId",
")",
";",
"adapter",
".",
"add",
... | Adds a new item to the bottom sheet.
@param id
The id of the item, which should be added, as an {@link Integer} value. The id must
be at least 0
@param titleId
The resource id of the title of the item, which should be added, as an {@link
Integer} value. The resource id must correspond to a valid string resource | [
"Adds",
"a",
"new",
"item",
"to",
"the",
"bottom",
"sheet",
"."
] | train | https://github.com/michael-rapp/AndroidBottomSheet/blob/6e4690ee9f63b14a7b143d3a3717b5f8a11ca503/library/src/main/java/de/mrapp/android/bottomsheet/BottomSheet.java#L2019-L2023 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/MetricDistiller.java | MetricDistiller.setCommonAttributes | public static void setCommonAttributes(List<Metric> metrics, Metric result) {
"""
Filters common attributes from list of metrics and writes them to result metric.
@param metrics - The set of metrics that needs to be filtered
@param result - The resultant metric that gets populated with the common tags
... | java | public static void setCommonAttributes(List<Metric> metrics, Metric result) {
MetricDistiller distiller = new MetricDistiller();
distiller.distill(metrics);
result.setDisplayName(distiller.getDisplayName());
result.setUnits(distiller.getUnits());
result.setTags(distiller.getTags... | [
"public",
"static",
"void",
"setCommonAttributes",
"(",
"List",
"<",
"Metric",
">",
"metrics",
",",
"Metric",
"result",
")",
"{",
"MetricDistiller",
"distiller",
"=",
"new",
"MetricDistiller",
"(",
")",
";",
"distiller",
".",
"distill",
"(",
"metrics",
")",
... | Filters common attributes from list of metrics and writes them to result metric.
@param metrics - The set of metrics that needs to be filtered
@param result - The resultant metric that gets populated with the common tags | [
"Filters",
"common",
"attributes",
"from",
"list",
"of",
"metrics",
"and",
"writes",
"them",
"to",
"result",
"metric",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/MetricDistiller.java#L65-L72 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/inventory.java | inventory.get | public static inventory get(nitro_service client, inventory resource) throws Exception {
"""
Use this operation to start inventory of a given device. All devices if device IP Address is not specified..
"""
resource.validate("get");
return ((inventory[]) resource.get_resources(client))[0];
} | java | public static inventory get(nitro_service client, inventory resource) throws Exception
{
resource.validate("get");
return ((inventory[]) resource.get_resources(client))[0];
} | [
"public",
"static",
"inventory",
"get",
"(",
"nitro_service",
"client",
",",
"inventory",
"resource",
")",
"throws",
"Exception",
"{",
"resource",
".",
"validate",
"(",
"\"get\"",
")",
";",
"return",
"(",
"(",
"inventory",
"[",
"]",
")",
"resource",
".",
"... | Use this operation to start inventory of a given device. All devices if device IP Address is not specified.. | [
"Use",
"this",
"operation",
"to",
"start",
"inventory",
"of",
"a",
"given",
"device",
".",
"All",
"devices",
"if",
"device",
"IP",
"Address",
"is",
"not",
"specified",
".."
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/inventory.java#L107-L111 |
nominanuda/zen-project | zen-webservice/src/main/java/com/nominanuda/web/http/HttpCoreHelper.java | HttpCoreHelper.createClient | public HttpClient createClient(int maxConnPerRoute, int connTimeoutMillis, int soTimeoutMillis, @Nullable String proxyHostAnPort) {
"""
if proxyHostAnPort value is jvm the normal jvm settings apply
"""
Registry<ConnectionSocketFactory> defaultRegistry = RegistryBuilder
.<ConnectionSocketFactory> create()
... | java | public HttpClient createClient(int maxConnPerRoute, int connTimeoutMillis, int soTimeoutMillis, @Nullable String proxyHostAnPort) {
Registry<ConnectionSocketFactory> defaultRegistry = RegistryBuilder
.<ConnectionSocketFactory> create()
.register("http", PlainConnectionSocketFactory.getSocketFactory())
.regis... | [
"public",
"HttpClient",
"createClient",
"(",
"int",
"maxConnPerRoute",
",",
"int",
"connTimeoutMillis",
",",
"int",
"soTimeoutMillis",
",",
"@",
"Nullable",
"String",
"proxyHostAnPort",
")",
"{",
"Registry",
"<",
"ConnectionSocketFactory",
">",
"defaultRegistry",
"=",... | if proxyHostAnPort value is jvm the normal jvm settings apply | [
"if",
"proxyHostAnPort",
"value",
"is",
"jvm",
"the",
"normal",
"jvm",
"settings",
"apply"
] | train | https://github.com/nominanuda/zen-project/blob/fe48ae8da198eb7066c2b56bf2ffafe4cdfc451d/zen-webservice/src/main/java/com/nominanuda/web/http/HttpCoreHelper.java#L535-L568 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java | ReUtil.findAllGroup1 | public static List<String> findAllGroup1(String regex, CharSequence content) {
"""
取得内容中匹配的所有结果,获得匹配的所有结果中正则对应分组1的内容
@param regex 正则
@param content 被查找的内容
@return 结果列表
@since 3.1.2
"""
return findAll(regex, content, 1);
} | java | public static List<String> findAllGroup1(String regex, CharSequence content) {
return findAll(regex, content, 1);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"findAllGroup1",
"(",
"String",
"regex",
",",
"CharSequence",
"content",
")",
"{",
"return",
"findAll",
"(",
"regex",
",",
"content",
",",
"1",
")",
";",
"}"
] | 取得内容中匹配的所有结果,获得匹配的所有结果中正则对应分组1的内容
@param regex 正则
@param content 被查找的内容
@return 结果列表
@since 3.1.2 | [
"取得内容中匹配的所有结果,获得匹配的所有结果中正则对应分组1的内容"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java#L375-L377 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.BrayCurtis | public static double BrayCurtis(IntPoint p, IntPoint q) {
"""
Gets the Bray Curtis distance between two points.
@param p IntPoint with X and Y axis coordinates.
@param q IntPoint with X and Y axis coordinates.
@return The Bray Curtis distance between x and y.
"""
return BrayCurtis(p.x, p.y, q.x, q... | java | public static double BrayCurtis(IntPoint p, IntPoint q) {
return BrayCurtis(p.x, p.y, q.x, q.y);
} | [
"public",
"static",
"double",
"BrayCurtis",
"(",
"IntPoint",
"p",
",",
"IntPoint",
"q",
")",
"{",
"return",
"BrayCurtis",
"(",
"p",
".",
"x",
",",
"p",
".",
"y",
",",
"q",
".",
"x",
",",
"q",
".",
"y",
")",
";",
"}"
] | Gets the Bray Curtis distance between two points.
@param p IntPoint with X and Y axis coordinates.
@param q IntPoint with X and Y axis coordinates.
@return The Bray Curtis distance between x and y. | [
"Gets",
"the",
"Bray",
"Curtis",
"distance",
"between",
"two",
"points",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L121-L123 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/DoubleStream.java | DoubleStream.iterate | @NotNull
public static DoubleStream iterate(final double seed,
@NotNull final DoubleUnaryOperator f) {
"""
Creates a {@code DoubleStream} by iterative application {@code DoubleUnaryOperator} function
to an initial element {@code seed}. Produces {@code DoubleStream} consi... | java | @NotNull
public static DoubleStream iterate(final double seed,
@NotNull final DoubleUnaryOperator f) {
Objects.requireNonNull(f);
return new DoubleStream(new DoubleIterate(seed, f));
} | [
"@",
"NotNull",
"public",
"static",
"DoubleStream",
"iterate",
"(",
"final",
"double",
"seed",
",",
"@",
"NotNull",
"final",
"DoubleUnaryOperator",
"f",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"f",
")",
";",
"return",
"new",
"DoubleStream",
"(",
"ne... | Creates a {@code DoubleStream} by iterative application {@code DoubleUnaryOperator} function
to an initial element {@code seed}. Produces {@code DoubleStream} consisting of
{@code seed}, {@code f(seed)}, {@code f(f(seed))}, etc.
<p> The first element (position {@code 0}) in the {@code DoubleStream} will be
the provide... | [
"Creates",
"a",
"{",
"@code",
"DoubleStream",
"}",
"by",
"iterative",
"application",
"{",
"@code",
"DoubleUnaryOperator",
"}",
"function",
"to",
"an",
"initial",
"element",
"{",
"@code",
"seed",
"}",
".",
"Produces",
"{",
"@code",
"DoubleStream",
"}",
"consist... | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/DoubleStream.java#L125-L130 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/TasksImpl.java | TasksImpl.listNext | public PagedList<CloudTask> listNext(final String nextPageLink, final TaskListNextOptions taskListNextOptions) {
"""
Lists all of the tasks that are associated with the specified job.
For multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task. Use the list subta... | java | public PagedList<CloudTask> listNext(final String nextPageLink, final TaskListNextOptions taskListNextOptions) {
ServiceResponseWithHeaders<Page<CloudTask>, TaskListHeaders> response = listNextSinglePageAsync(nextPageLink, taskListNextOptions).toBlocking().single();
return new PagedList<CloudTask>(respo... | [
"public",
"PagedList",
"<",
"CloudTask",
">",
"listNext",
"(",
"final",
"String",
"nextPageLink",
",",
"final",
"TaskListNextOptions",
"taskListNextOptions",
")",
"{",
"ServiceResponseWithHeaders",
"<",
"Page",
"<",
"CloudTask",
">",
",",
"TaskListHeaders",
">",
"re... | Lists all of the tasks that are associated with the specified job.
For multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task. Use the list subtasks API to retrieve information about subtasks.
@param nextPageLink The NextLink from the previous successful call to List... | [
"Lists",
"all",
"of",
"the",
"tasks",
"that",
"are",
"associated",
"with",
"the",
"specified",
"job",
".",
"For",
"multi",
"-",
"instance",
"tasks",
"information",
"such",
"as",
"affinityId",
"executionInfo",
"and",
"nodeInfo",
"refer",
"to",
"the",
"primary",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/TasksImpl.java#L2441-L2449 |
apache/flink | flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/streaming/data/PythonDualInputSender.java | PythonDualInputSender.sendBuffer2 | public int sendBuffer2(SingleElementPushBackIterator<IN2> input) throws IOException {
"""
Extracts records from an iterator and writes them to the memory-mapped file. This method assumes that all values
in the iterator are of the same type. This method does NOT take care of synchronization. The caller must
guara... | java | public int sendBuffer2(SingleElementPushBackIterator<IN2> input) throws IOException {
if (serializer2 == null) {
IN2 value = input.next();
serializer2 = getSerializer(value);
input.pushBack(value);
}
return sendBuffer(input, serializer2);
} | [
"public",
"int",
"sendBuffer2",
"(",
"SingleElementPushBackIterator",
"<",
"IN2",
">",
"input",
")",
"throws",
"IOException",
"{",
"if",
"(",
"serializer2",
"==",
"null",
")",
"{",
"IN2",
"value",
"=",
"input",
".",
"next",
"(",
")",
";",
"serializer2",
"=... | Extracts records from an iterator and writes them to the memory-mapped file. This method assumes that all values
in the iterator are of the same type. This method does NOT take care of synchronization. The caller must
guarantee that the file may be written to before calling this method.
@param input iterator containin... | [
"Extracts",
"records",
"from",
"an",
"iterator",
"and",
"writes",
"them",
"to",
"the",
"memory",
"-",
"mapped",
"file",
".",
"This",
"method",
"assumes",
"that",
"all",
"values",
"in",
"the",
"iterator",
"are",
"of",
"the",
"same",
"type",
".",
"This",
"... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/streaming/data/PythonDualInputSender.java#L69-L76 |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/util/LazyInitializedCacheMap.java | LazyInitializedCacheMap.putIfAbsent | public V putIfAbsent(K key, LazyInitializer<V> value) {
"""
If the specified key is not already associated
with a value, associate it with the given value.
This is equivalent to
<pre>
if (!map.containsKey(key))
return map.put(key, value);
else
return map.get(key);</pre>
except that the action is performed ... | java | public V putIfAbsent(K key, LazyInitializer<V> value) {
LazyInitializer<V> v = cache.get(key);
if (v == null) {
v = cache.putIfAbsent(key, value);
if (v == null) {
return value.get();
}
}
return v.get();
} | [
"public",
"V",
"putIfAbsent",
"(",
"K",
"key",
",",
"LazyInitializer",
"<",
"V",
">",
"value",
")",
"{",
"LazyInitializer",
"<",
"V",
">",
"v",
"=",
"cache",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"v",
"==",
"null",
")",
"{",
"v",
"=",
"c... | If the specified key is not already associated
with a value, associate it with the given value.
This is equivalent to
<pre>
if (!map.containsKey(key))
return map.put(key, value);
else
return map.get(key);</pre>
except that the action is performed atomically.
@param key key with which the specified value is to be assoc... | [
"If",
"the",
"specified",
"key",
"is",
"not",
"already",
"associated",
"with",
"a",
"value",
"associate",
"it",
"with",
"the",
"given",
"value",
".",
"This",
"is",
"equivalent",
"to",
"<pre",
">",
"if",
"(",
"!map",
".",
"containsKey",
"(",
"key",
"))",
... | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/util/LazyInitializedCacheMap.java#L116-L126 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbConnection.java | MariaDbConnection.prepareStatement | public PreparedStatement prepareStatement(final String sql, final int autoGeneratedKeys)
throws SQLException {
"""
<p>Creates a default <code>PreparedStatement</code> object that has the capability to retrieve
auto-generated keys. The given constant tells the driver whether it should make auto-generated
ke... | java | public PreparedStatement prepareStatement(final String sql, final int autoGeneratedKeys)
throws SQLException {
return internalPrepareStatement(sql,
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY,
autoGeneratedKeys);
} | [
"public",
"PreparedStatement",
"prepareStatement",
"(",
"final",
"String",
"sql",
",",
"final",
"int",
"autoGeneratedKeys",
")",
"throws",
"SQLException",
"{",
"return",
"internalPrepareStatement",
"(",
"sql",
",",
"ResultSet",
".",
"TYPE_FORWARD_ONLY",
",",
"ResultSe... | <p>Creates a default <code>PreparedStatement</code> object that has the capability to retrieve
auto-generated keys. The given constant tells the driver whether it should make auto-generated
keys available for retrieval. This parameter is ignored if the SQL statement is not an
<code>INSERT</code> statement, or an SQL s... | [
"<p",
">",
"Creates",
"a",
"default",
"<code",
">",
"PreparedStatement<",
"/",
"code",
">",
"object",
"that",
"has",
"the",
"capability",
"to",
"retrieve",
"auto",
"-",
"generated",
"keys",
".",
"The",
"given",
"constant",
"tells",
"the",
"driver",
"whether"... | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbConnection.java#L415-L421 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Locale.java | Locale.setDefault | public static synchronized void setDefault(Locale.Category category,
Locale newLocale) {
"""
Sets the default locale for the specified Category for this instance
of the Java Virtual Machine. This does not affect the host locale.
<p>
If there is a security manager, its checkPermission method is called
w... | java | public static synchronized void setDefault(Locale.Category category,
Locale newLocale) {
if (category == null)
throw new NullPointerException("Category cannot be NULL");
if (newLocale == null)
throw new NullPointerException("Can't set default locale to NULL");
/*... | [
"public",
"static",
"synchronized",
"void",
"setDefault",
"(",
"Locale",
".",
"Category",
"category",
",",
"Locale",
"newLocale",
")",
"{",
"if",
"(",
"category",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"Category cannot be NULL\"",
")",
... | Sets the default locale for the specified Category for this instance
of the Java Virtual Machine. This does not affect the host locale.
<p>
If there is a security manager, its checkPermission method is called
with a PropertyPermission("user.language", "write") permission before
the default locale is changed.
<p>
The Ja... | [
"Sets",
"the",
"default",
"locale",
"for",
"the",
"specified",
"Category",
"for",
"this",
"instance",
"of",
"the",
"Java",
"Virtual",
"Machine",
".",
"This",
"does",
"not",
"affect",
"the",
"host",
"locale",
".",
"<p",
">",
"If",
"there",
"is",
"a",
"sec... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Locale.java#L968-L989 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslcertkey_service_binding.java | sslcertkey_service_binding.count_filtered | public static long count_filtered(nitro_service service, String certkey, String filter) throws Exception {
"""
Use this API to count the filtered set of sslcertkey_service_binding resources.
filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
"""
sslcertkey_service_binding obj = new sslce... | java | public static long count_filtered(nitro_service service, String certkey, String filter) throws Exception{
sslcertkey_service_binding obj = new sslcertkey_service_binding();
obj.set_certkey(certkey);
options option = new options();
option.set_count(true);
option.set_filter(filter);
sslcertkey_service_binding... | [
"public",
"static",
"long",
"count_filtered",
"(",
"nitro_service",
"service",
",",
"String",
"certkey",
",",
"String",
"filter",
")",
"throws",
"Exception",
"{",
"sslcertkey_service_binding",
"obj",
"=",
"new",
"sslcertkey_service_binding",
"(",
")",
";",
"obj",
... | Use this API to count the filtered set of sslcertkey_service_binding resources.
filter string should be in JSON format.eg: "port:80,servicetype:HTTP". | [
"Use",
"this",
"API",
"to",
"count",
"the",
"filtered",
"set",
"of",
"sslcertkey_service_binding",
"resources",
".",
"filter",
"string",
"should",
"be",
"in",
"JSON",
"format",
".",
"eg",
":",
"port",
":",
"80",
"servicetype",
":",
"HTTP",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslcertkey_service_binding.java#L284-L295 |
real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/golang/GolangOutputManager.java | GolangOutputManager.createOutput | public Writer createOutput(final String name) throws IOException {
"""
Create a new output which will be a golang source file in the given package.
<p>
The {@link java.io.Writer} should be closed once the caller has finished with it. The Writer is
buffer for efficient IO operations.
@param name the name of t... | java | public Writer createOutput(final String name) throws IOException
{
final File targetFile = new File(outputDir, name + ".go");
return Files.newBufferedWriter(targetFile.toPath(), StandardCharsets.UTF_8);
} | [
"public",
"Writer",
"createOutput",
"(",
"final",
"String",
"name",
")",
"throws",
"IOException",
"{",
"final",
"File",
"targetFile",
"=",
"new",
"File",
"(",
"outputDir",
",",
"name",
"+",
"\".go\"",
")",
";",
"return",
"Files",
".",
"newBufferedWriter",
"(... | Create a new output which will be a golang source file in the given package.
<p>
The {@link java.io.Writer} should be closed once the caller has finished with it. The Writer is
buffer for efficient IO operations.
@param name the name of the golang class.
@return a {@link java.io.Writer} to which the source code should... | [
"Create",
"a",
"new",
"output",
"which",
"will",
"be",
"a",
"golang",
"source",
"file",
"in",
"the",
"given",
"package",
".",
"<p",
">",
"The",
"{",
"@link",
"java",
".",
"io",
".",
"Writer",
"}",
"should",
"be",
"closed",
"once",
"the",
"caller",
"h... | train | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/golang/GolangOutputManager.java#L66-L71 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.asType | @SuppressWarnings("unchecked")
public static <T> T asType(Closure cl, Class<T> clazz) {
"""
Coerces the closure to an implementation of the given class. The class
is assumed to be an interface or class with a single method definition.
The closure is used as the implementation of that single method.
@para... | java | @SuppressWarnings("unchecked")
public static <T> T asType(Closure cl, Class<T> clazz) {
if (clazz.isInterface() && !(clazz.isInstance(cl))) {
if (Traits.isTrait(clazz)) {
Method samMethod = CachedSAMClass.getSAMMethod(clazz);
if (samMethod!=null) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"asType",
"(",
"Closure",
"cl",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"clazz",
".",
"isInterface",
"(",
")",
"&&",
"!",
"(",
"clazz",
"... | Coerces the closure to an implementation of the given class. The class
is assumed to be an interface or class with a single method definition.
The closure is used as the implementation of that single method.
@param cl the implementation of the single method
@param clazz the target type
@return a Proxy of the given... | [
"Coerces",
"the",
"closure",
"to",
"an",
"implementation",
"of",
"the",
"given",
"class",
".",
"The",
"class",
"is",
"assumed",
"to",
"be",
"an",
"interface",
"or",
"class",
"with",
"a",
"single",
"method",
"definition",
".",
"The",
"closure",
"is",
"used"... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L11772-L11797 |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/jmx/MBeanRegistry.java | MBeanRegistry.makeObjectName | protected ObjectName makeObjectName(String path, ZKMBeanInfo bean)
throws MalformedObjectNameException {
"""
Builds an MBean path and creates an ObjectName instance using the path.
@param path MBean path
@param bean the MBean instance
@return ObjectName to be registered with the platform MBean server
... | java | protected ObjectName makeObjectName(String path, ZKMBeanInfo bean)
throws MalformedObjectNameException
{
if(path==null)
return null;
StringBuilder beanName = new StringBuilder(CommonNames.DOMAIN + ":");
int counter=0;
counter=tokenize(beanName,path,counter);
... | [
"protected",
"ObjectName",
"makeObjectName",
"(",
"String",
"path",
",",
"ZKMBeanInfo",
"bean",
")",
"throws",
"MalformedObjectNameException",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"return",
"null",
";",
"StringBuilder",
"beanName",
"=",
"new",
"StringBuilder... | Builds an MBean path and creates an ObjectName instance using the path.
@param path MBean path
@param bean the MBean instance
@return ObjectName to be registered with the platform MBean server | [
"Builds",
"an",
"MBean",
"path",
"and",
"creates",
"an",
"ObjectName",
"instance",
"using",
"the",
"path",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/jmx/MBeanRegistry.java#L183-L200 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.pack | public static void pack(File sourceDir, OutputStream os, NameMapper mapper) {
"""
Compresses the given directory and all of its sub-directories into the passed in
stream. It is the responsibility of the caller to close the passed in
stream properly.
@param sourceDir
root directory.
@param os
output stream ... | java | public static void pack(File sourceDir, OutputStream os, NameMapper mapper) {
pack(sourceDir, os, mapper, DEFAULT_COMPRESSION_LEVEL);
} | [
"public",
"static",
"void",
"pack",
"(",
"File",
"sourceDir",
",",
"OutputStream",
"os",
",",
"NameMapper",
"mapper",
")",
"{",
"pack",
"(",
"sourceDir",
",",
"os",
",",
"mapper",
",",
"DEFAULT_COMPRESSION_LEVEL",
")",
";",
"}"
] | Compresses the given directory and all of its sub-directories into the passed in
stream. It is the responsibility of the caller to close the passed in
stream properly.
@param sourceDir
root directory.
@param os
output stream (will be buffered in this method).
@param mapper
call-back for renaming the entries.
@since 1... | [
"Compresses",
"the",
"given",
"directory",
"and",
"all",
"of",
"its",
"sub",
"-",
"directories",
"into",
"the",
"passed",
"in",
"stream",
".",
"It",
"is",
"the",
"responsibility",
"of",
"the",
"caller",
"to",
"close",
"the",
"passed",
"in",
"stream",
"prop... | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L1670-L1672 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/AccountsImpl.java | AccountsImpl.listNodeAgentSkusNextAsync | public Observable<Page<NodeAgentSku>> listNodeAgentSkusNextAsync(final String nextPageLink, final AccountListNodeAgentSkusNextOptions accountListNodeAgentSkusNextOptions) {
"""
Lists all node agent SKUs supported by the Azure Batch service.
@param nextPageLink The NextLink from the previous successful call to L... | java | public Observable<Page<NodeAgentSku>> listNodeAgentSkusNextAsync(final String nextPageLink, final AccountListNodeAgentSkusNextOptions accountListNodeAgentSkusNextOptions) {
return listNodeAgentSkusNextWithServiceResponseAsync(nextPageLink, accountListNodeAgentSkusNextOptions)
.map(new Func1<ServiceR... | [
"public",
"Observable",
"<",
"Page",
"<",
"NodeAgentSku",
">",
">",
"listNodeAgentSkusNextAsync",
"(",
"final",
"String",
"nextPageLink",
",",
"final",
"AccountListNodeAgentSkusNextOptions",
"accountListNodeAgentSkusNextOptions",
")",
"{",
"return",
"listNodeAgentSkusNextWith... | Lists all node agent SKUs supported by the Azure Batch service.
@param nextPageLink The NextLink from the previous successful call to List operation.
@param accountListNodeAgentSkusNextOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@return the ... | [
"Lists",
"all",
"node",
"agent",
"SKUs",
"supported",
"by",
"the",
"Azure",
"Batch",
"service",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/AccountsImpl.java#L799-L807 |
Erudika/para | para-core/src/main/java/com/erudika/para/utils/Config.java | Config.getConfigBoolean | public static boolean getConfigBoolean(String key, boolean defaultValue) {
"""
Returns the boolean value of a configuration parameter.
@param key the param key
@param defaultValue the default param value
@return the value of a param
"""
return Boolean.parseBoolean(getConfigParam(key, Boolean.toString(defa... | java | public static boolean getConfigBoolean(String key, boolean defaultValue) {
return Boolean.parseBoolean(getConfigParam(key, Boolean.toString(defaultValue)));
} | [
"public",
"static",
"boolean",
"getConfigBoolean",
"(",
"String",
"key",
",",
"boolean",
"defaultValue",
")",
"{",
"return",
"Boolean",
".",
"parseBoolean",
"(",
"getConfigParam",
"(",
"key",
",",
"Boolean",
".",
"toString",
"(",
"defaultValue",
")",
")",
")",... | Returns the boolean value of a configuration parameter.
@param key the param key
@param defaultValue the default param value
@return the value of a param | [
"Returns",
"the",
"boolean",
"value",
"of",
"a",
"configuration",
"parameter",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/utils/Config.java#L324-L326 |
datumbox/datumbox-framework | datumbox-framework-common/src/main/java/com/datumbox/framework/common/dataobjects/AssociativeArray2D.java | AssociativeArray2D.put | public final AssociativeArray put(Object key, AssociativeArray value) {
"""
Adds a particular key-value into the internal map. It returns the previous
value which was associated with that key.
@param key
@param value
@return
"""
return internalData.put(key, value);
} | java | public final AssociativeArray put(Object key, AssociativeArray value) {
return internalData.put(key, value);
} | [
"public",
"final",
"AssociativeArray",
"put",
"(",
"Object",
"key",
",",
"AssociativeArray",
"value",
")",
"{",
"return",
"internalData",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Adds a particular key-value into the internal map. It returns the previous
value which was associated with that key.
@param key
@param value
@return | [
"Adds",
"a",
"particular",
"key",
"-",
"value",
"into",
"the",
"internal",
"map",
".",
"It",
"returns",
"the",
"previous",
"value",
"which",
"was",
"associated",
"with",
"that",
"key",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-common/src/main/java/com/datumbox/framework/common/dataobjects/AssociativeArray2D.java#L89-L91 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.rotateTowards | public Matrix4d rotateTowards(double dirX, double dirY, double dirZ, double upX, double upY, double upZ) {
"""
Apply a model transformation to this matrix for a right-handed coordinate system,
that aligns the local <code>+Z</code> axis with <code>(dirX, dirY, dirZ)</code>.
<p>
If <code>M</code> is <code>this</c... | java | public Matrix4d rotateTowards(double dirX, double dirY, double dirZ, double upX, double upY, double upZ) {
return rotateTowards(dirX, dirY, dirZ, upX, upY, upZ, this);
} | [
"public",
"Matrix4d",
"rotateTowards",
"(",
"double",
"dirX",
",",
"double",
"dirY",
",",
"double",
"dirZ",
",",
"double",
"upX",
",",
"double",
"upY",
",",
"double",
"upZ",
")",
"{",
"return",
"rotateTowards",
"(",
"dirX",
",",
"dirY",
",",
"dirZ",
",",... | Apply a model transformation to this matrix for a right-handed coordinate system,
that aligns the local <code>+Z</code> axis with <code>(dirX, dirY, dirZ)</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>L</code> the lookat matrix,
then the new matrix will be <code>M * L</code>. So when transforming ... | [
"Apply",
"a",
"model",
"transformation",
"to",
"this",
"matrix",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"that",
"aligns",
"the",
"local",
"<code",
">",
"+",
"Z<",
"/",
"code",
">",
"axis",
"with",
"<code",
">",
"(",
"dirX",
"dirY",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L15181-L15183 |
zerodhatech/javakiteconnect | kiteconnect/src/com/zerodhatech/kiteconnect/kitehttp/KiteRequestHandler.java | KiteRequestHandler.createGetRequest | public Request createGetRequest(String url, String commonKey, String[] values, String apiKey, String accessToken) {
"""
Creates a GET request.
@param url is the endpoint to which request has to be done.
@param apiKey is the api key of the Kite Connect app.
@param accessToken is the access token obtained after s... | java | public Request createGetRequest(String url, String commonKey, String[] values, String apiKey, String accessToken) {
HttpUrl.Builder httpBuilder = HttpUrl.parse(url).newBuilder();
for(int i = 0; i < values.length; i++) {
httpBuilder.addQueryParameter(commonKey, values[i]);
}
r... | [
"public",
"Request",
"createGetRequest",
"(",
"String",
"url",
",",
"String",
"commonKey",
",",
"String",
"[",
"]",
"values",
",",
"String",
"apiKey",
",",
"String",
"accessToken",
")",
"{",
"HttpUrl",
".",
"Builder",
"httpBuilder",
"=",
"HttpUrl",
".",
"par... | Creates a GET request.
@param url is the endpoint to which request has to be done.
@param apiKey is the api key of the Kite Connect app.
@param accessToken is the access token obtained after successful login process.
@param commonKey is the key that has to be sent in query param for quote calls.
@param values is the va... | [
"Creates",
"a",
"GET",
"request",
"."
] | train | https://github.com/zerodhatech/javakiteconnect/blob/4a3f15ff2c8a1b3b6ec61799f8bb047e4dfeb92d/kiteconnect/src/com/zerodhatech/kiteconnect/kitehttp/KiteRequestHandler.java#L184-L190 |
voldemort/voldemort | src/java/voldemort/tools/Repartitioner.java | Repartitioner.randomShufflePartitions | public static Cluster randomShufflePartitions(final Cluster nextCandidateCluster,
final int randomSwapAttempts,
final int randomSwapSuccesses,
final List<Integer> randomS... | java | public static Cluster randomShufflePartitions(final Cluster nextCandidateCluster,
final int randomSwapAttempts,
final int randomSwapSuccesses,
final List<Integer> randomS... | [
"public",
"static",
"Cluster",
"randomShufflePartitions",
"(",
"final",
"Cluster",
"nextCandidateCluster",
",",
"final",
"int",
"randomSwapAttempts",
",",
"final",
"int",
"randomSwapSuccesses",
",",
"final",
"List",
"<",
"Integer",
">",
"randomSwapZoneIds",
",",
"List... | Randomly shuffle partitions between nodes within every zone.
@param nextCandidateCluster cluster object.
@param randomSwapAttempts See RebalanceCLI.
@param randomSwapSuccesses See RebalanceCLI.
@param randomSwapZoneIds The set of zoneIds to consider. Each zone is done
independently.
@param storeDefs List of store defi... | [
"Randomly",
"shuffle",
"partitions",
"between",
"nodes",
"within",
"every",
"zone",
"."
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L705-L754 |
lessthanoptimal/ejml | main/ejml-core/src/org/ejml/ops/ComplexMath_F64.java | ComplexMath_F64.divide | public static void divide(ComplexPolar_F64 a, ComplexPolar_F64 b, ComplexPolar_F64 result) {
"""
Division in polar notation.
@param a Complex number in polar notation. Not modified.
@param b Complex number in polar notation. Not modified.
@param result Storage for output.
"""
result.r = a.r/b.r;
... | java | public static void divide(ComplexPolar_F64 a, ComplexPolar_F64 b, ComplexPolar_F64 result)
{
result.r = a.r/b.r;
result.theta = a.theta - b.theta;
} | [
"public",
"static",
"void",
"divide",
"(",
"ComplexPolar_F64",
"a",
",",
"ComplexPolar_F64",
"b",
",",
"ComplexPolar_F64",
"result",
")",
"{",
"result",
".",
"r",
"=",
"a",
".",
"r",
"/",
"b",
".",
"r",
";",
"result",
".",
"theta",
"=",
"a",
".",
"th... | Division in polar notation.
@param a Complex number in polar notation. Not modified.
@param b Complex number in polar notation. Not modified.
@param result Storage for output. | [
"Division",
"in",
"polar",
"notation",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-core/src/org/ejml/ops/ComplexMath_F64.java#L146-L150 |
openbase/jul | exception/src/main/java/org/openbase/jul/exception/printer/ExceptionPrinter.java | ExceptionPrinter.printHistoryAndExit | public static <T extends Throwable> void printHistoryAndExit(final T th, final Logger logger) {
"""
Print Exception messages without stack trace in non debug mode and call system exit afterwards. Method prints recursive all messages of the given exception stack to get a history overview of the causes. In verbose m... | java | public static <T extends Throwable> void printHistoryAndExit(final T th, final Logger logger) {
printHistory(th, logger, LogLevel.ERROR);
if (JPService.testMode()) {
assert false;
return;
}
exit(255);
} | [
"public",
"static",
"<",
"T",
"extends",
"Throwable",
">",
"void",
"printHistoryAndExit",
"(",
"final",
"T",
"th",
",",
"final",
"Logger",
"logger",
")",
"{",
"printHistory",
"(",
"th",
",",
"logger",
",",
"LogLevel",
".",
"ERROR",
")",
";",
"if",
"(",
... | Print Exception messages without stack trace in non debug mode and call system exit afterwards. Method prints recursive all messages of the given exception stack to get a history overview of the causes. In verbose mode (app
-v) the stacktrace is printed in the end of history. The logging level is fixed to level "error"... | [
"Print",
"Exception",
"messages",
"without",
"stack",
"trace",
"in",
"non",
"debug",
"mode",
"and",
"call",
"system",
"exit",
"afterwards",
".",
"Method",
"prints",
"recursive",
"all",
"messages",
"of",
"the",
"given",
"exception",
"stack",
"to",
"get",
"a",
... | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/exception/src/main/java/org/openbase/jul/exception/printer/ExceptionPrinter.java#L158-L165 |
twilio/twilio-java | src/main/java/com/twilio/rest/ipmessaging/v2/service/UserReader.java | UserReader.nextPage | @Override
public Page<User> nextPage(final Page<User> page,
final TwilioRestClient client) {
"""
Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Next Page
"""
Request requ... | java | @Override
public Page<User> nextPage(final Page<User> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getNextPageUrl(
Domains.IPMESSAGING.toString(),
client.getRegion()
... | [
"@",
"Override",
"public",
"Page",
"<",
"User",
">",
"nextPage",
"(",
"final",
"Page",
"<",
"User",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET",
",",
"page"... | Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Next Page | [
"Retrieve",
"the",
"next",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/ipmessaging/v2/service/UserReader.java#L90-L101 |
gosu-lang/gosu-lang | gosu-lab/src/main/java/editor/util/TextComponentUtil.java | TextComponentUtil.getWhiteSpaceOrCommentLineStartBefore | public static int getWhiteSpaceOrCommentLineStartBefore( String script, int start ) {
"""
Returns the start of the previous line if that line is only whitespace. Returns -1 otherwise.
"""
int startLine = getLineStart( script, start );
if( startLine > 0 )
{
int nextLineEnd = startLine - 1;
... | java | public static int getWhiteSpaceOrCommentLineStartBefore( String script, int start )
{
int startLine = getLineStart( script, start );
if( startLine > 0 )
{
int nextLineEnd = startLine - 1;
int previousLineStart = getLineStart( script, nextLineEnd );
String line = script.substring( previou... | [
"public",
"static",
"int",
"getWhiteSpaceOrCommentLineStartBefore",
"(",
"String",
"script",
",",
"int",
"start",
")",
"{",
"int",
"startLine",
"=",
"getLineStart",
"(",
"script",
",",
"start",
")",
";",
"if",
"(",
"startLine",
">",
"0",
")",
"{",
"int",
"... | Returns the start of the previous line if that line is only whitespace. Returns -1 otherwise. | [
"Returns",
"the",
"start",
"of",
"the",
"previous",
"line",
"if",
"that",
"line",
"is",
"only",
"whitespace",
".",
"Returns",
"-",
"1",
"otherwise",
"."
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-lab/src/main/java/editor/util/TextComponentUtil.java#L817-L832 |
JetBrains/xodus | environment/src/main/java/jetbrains/exodus/env/EnvironmentImpl.java | EnvironmentImpl.loadMetaTree | @Nullable
BTree loadMetaTree(final long rootAddress, final LogTip logTip) {
"""
Tries to load meta tree located at specified rootAddress.
@param rootAddress tree root address.
@return tree instance or null if the address is not valid.
"""
if (rootAddress < 0 || rootAddress >= logTip.highAddress... | java | @Nullable
BTree loadMetaTree(final long rootAddress, final LogTip logTip) {
if (rootAddress < 0 || rootAddress >= logTip.highAddress) return null;
return new BTree(log, getBTreeBalancePolicy(), rootAddress, false, META_TREE_ID) {
@NotNull
@Override
public DataIter... | [
"@",
"Nullable",
"BTree",
"loadMetaTree",
"(",
"final",
"long",
"rootAddress",
",",
"final",
"LogTip",
"logTip",
")",
"{",
"if",
"(",
"rootAddress",
"<",
"0",
"||",
"rootAddress",
">=",
"logTip",
".",
"highAddress",
")",
"return",
"null",
";",
"return",
"n... | Tries to load meta tree located at specified rootAddress.
@param rootAddress tree root address.
@return tree instance or null if the address is not valid. | [
"Tries",
"to",
"load",
"meta",
"tree",
"located",
"at",
"specified",
"rootAddress",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/environment/src/main/java/jetbrains/exodus/env/EnvironmentImpl.java#L618-L628 |
alkacon/opencms-core | src/org/opencms/configuration/preferences/CmsUserDefinedPreference.java | CmsUserDefinedPreference.fillAttributes | public static void fillAttributes(CmsPreferenceData pref, Element elem) {
"""
Helper method used to create the configuration attributes for a CmsPreferenceData bean.<p>
@param pref the preference data
@param elem the element in which the attributes should be created
"""
CmsXmlContentProperty prop ... | java | public static void fillAttributes(CmsPreferenceData pref, Element elem) {
CmsXmlContentProperty prop = pref.getPropertyDefinition();
for (String[] attrToSet : new String[][] {
{I_CmsXmlConfiguration.A_VALUE, pref.getDefaultValue()},
{CmsWorkplaceConfiguration.A_NICE_NAME, prop.g... | [
"public",
"static",
"void",
"fillAttributes",
"(",
"CmsPreferenceData",
"pref",
",",
"Element",
"elem",
")",
"{",
"CmsXmlContentProperty",
"prop",
"=",
"pref",
".",
"getPropertyDefinition",
"(",
")",
";",
"for",
"(",
"String",
"[",
"]",
"attrToSet",
":",
"new"... | Helper method used to create the configuration attributes for a CmsPreferenceData bean.<p>
@param pref the preference data
@param elem the element in which the attributes should be created | [
"Helper",
"method",
"used",
"to",
"create",
"the",
"configuration",
"attributes",
"for",
"a",
"CmsPreferenceData",
"bean",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/configuration/preferences/CmsUserDefinedPreference.java#L65-L82 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/cert/Certificate.java | Certificate.writeReplace | protected Object writeReplace() throws java.io.ObjectStreamException {
"""
Replace the Certificate to be serialized.
@return the alternate Certificate object to be serialized
@throws java.io.ObjectStreamException if a new object representing
this Certificate could not be created
@since 1.3
"""
... | java | protected Object writeReplace() throws java.io.ObjectStreamException {
try {
return new CertificateRep(type, getEncoded());
} catch (CertificateException e) {
throw new java.io.NotSerializableException
("java.security.cert.Certificate: " +
... | [
"protected",
"Object",
"writeReplace",
"(",
")",
"throws",
"java",
".",
"io",
".",
"ObjectStreamException",
"{",
"try",
"{",
"return",
"new",
"CertificateRep",
"(",
"type",
",",
"getEncoded",
"(",
")",
")",
";",
"}",
"catch",
"(",
"CertificateException",
"e"... | Replace the Certificate to be serialized.
@return the alternate Certificate object to be serialized
@throws java.io.ObjectStreamException if a new object representing
this Certificate could not be created
@since 1.3 | [
"Replace",
"the",
"Certificate",
"to",
"be",
"serialized",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/cert/Certificate.java#L296-L306 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getCharacterEquipment | public void getCharacterEquipment(String API, String name, Callback<CharacterEquipment> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on character equipment API go <a href="https://wiki.guildwars2.com/wiki/API:2/characters#Equipment">here</a><br/>
@param API API key
@param... | java | public void getCharacterEquipment(String API, String name, Callback<CharacterEquipment> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name));
gw2API.getCharacterEquipment(name, API).enqueue(callback);
} | [
"public",
"void",
"getCharacterEquipment",
"(",
"String",
"API",
",",
"String",
"name",
",",
"Callback",
"<",
"CharacterEquipment",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"... | For more info on character equipment API go <a href="https://wiki.guildwars2.com/wiki/API:2/characters#Equipment">here</a><br/>
@param API API key
@param name name of character
@param callback callback that is going to be used for {@link Call#enqueue(Callback)}
@throws GuildWars2Exception invalid API key | e... | [
"For",
"more",
"info",
"on",
"character",
"equipment",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"characters#Equipment",
">",
"here<",
"/",
"a",
">",
"<br",
"/",... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L751-L754 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.photos_upload | public T photos_upload(File photo)
throws FacebookException, IOException {
"""
Uploads a photo to Facebook.
@param photo an image file
@return a T with the standard Facebook photo information
@see <a href="http://wiki.developers.facebook.com/index.php/Photos.upload">
Developers wiki: Photos.upload</a>
... | java | public T photos_upload(File photo)
throws FacebookException, IOException {
return photos_upload(photo, /*caption*/ null, /*albumId*/ null) ;
} | [
"public",
"T",
"photos_upload",
"(",
"File",
"photo",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"return",
"photos_upload",
"(",
"photo",
",",
"/*caption*/",
"null",
",",
"/*albumId*/",
"null",
")",
";",
"}"
] | Uploads a photo to Facebook.
@param photo an image file
@return a T with the standard Facebook photo information
@see <a href="http://wiki.developers.facebook.com/index.php/Photos.upload">
Developers wiki: Photos.upload</a> | [
"Uploads",
"a",
"photo",
"to",
"Facebook",
"."
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L1282-L1285 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/CommonUtils.java | CommonUtils.getPrimaryGroupName | public static String getPrimaryGroupName(String userName, AlluxioConfiguration conf)
throws IOException {
"""
Gets the primary group name of a user.
@param userName Alluxio user name
@param conf Alluxio configuration
@return primary group name
"""
List<String> groups = getGroups(userName, conf);... | java | public static String getPrimaryGroupName(String userName, AlluxioConfiguration conf)
throws IOException {
List<String> groups = getGroups(userName, conf);
return (groups != null && groups.size() > 0) ? groups.get(0) : "";
} | [
"public",
"static",
"String",
"getPrimaryGroupName",
"(",
"String",
"userName",
",",
"AlluxioConfiguration",
"conf",
")",
"throws",
"IOException",
"{",
"List",
"<",
"String",
">",
"groups",
"=",
"getGroups",
"(",
"userName",
",",
"conf",
")",
";",
"return",
"(... | Gets the primary group name of a user.
@param userName Alluxio user name
@param conf Alluxio configuration
@return primary group name | [
"Gets",
"the",
"primary",
"group",
"name",
"of",
"a",
"user",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L321-L325 |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerItem.java | DrawerItem.setImage | public DrawerItem setImage(Drawable image, int imageMode) {
"""
Sets an image with a given image mode to the drawer item
@param image Image to set
@param imageMode Image mode to set
"""
mImage = image;
setImageMode(imageMode);
notifyDataChanged();
return this;
} | java | public DrawerItem setImage(Drawable image, int imageMode) {
mImage = image;
setImageMode(imageMode);
notifyDataChanged();
return this;
} | [
"public",
"DrawerItem",
"setImage",
"(",
"Drawable",
"image",
",",
"int",
"imageMode",
")",
"{",
"mImage",
"=",
"image",
";",
"setImageMode",
"(",
"imageMode",
")",
";",
"notifyDataChanged",
"(",
")",
";",
"return",
"this",
";",
"}"
] | Sets an image with a given image mode to the drawer item
@param image Image to set
@param imageMode Image mode to set | [
"Sets",
"an",
"image",
"with",
"a",
"given",
"image",
"mode",
"to",
"the",
"drawer",
"item"
] | train | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerItem.java#L170-L175 |
alkacon/opencms-core | src/org/opencms/cmis/CmsCmisUtil.java | CmsCmisUtil.hasChildren | public static boolean hasChildren(CmsObject cms, CmsResource resource) throws CmsException {
"""
Checks whether the given resource has any children.<p>
@param cms the CMS context
@param resource the resource to check
@return true if the resource has children
@throws CmsException if something goes wrong
... | java | public static boolean hasChildren(CmsObject cms, CmsResource resource) throws CmsException {
return !cms.getResourcesInFolder(cms.getSitePath(resource), CmsResourceFilter.ALL).isEmpty();
} | [
"public",
"static",
"boolean",
"hasChildren",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
")",
"throws",
"CmsException",
"{",
"return",
"!",
"cms",
".",
"getResourcesInFolder",
"(",
"cms",
".",
"getSitePath",
"(",
"resource",
")",
",",
"CmsResourceF... | Checks whether the given resource has any children.<p>
@param cms the CMS context
@param resource the resource to check
@return true if the resource has children
@throws CmsException if something goes wrong | [
"Checks",
"whether",
"the",
"given",
"resource",
"has",
"any",
"children",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cmis/CmsCmisUtil.java#L569-L572 |
UrielCh/ovh-java-sdk | ovh-java-sdk-metrics/src/main/java/net/minidev/ovh/api/ApiOvhMetrics.java | ApiOvhMetrics.serviceName_consumption_GET | public OvhConsumption serviceName_consumption_GET(String serviceName, Long duration) throws IOException {
"""
Get consumption for your service
REST: GET /metrics/{serviceName}/consumption
@param serviceName [required] Name of your service
@param duration [required] Last 'm' minutes. Default is 60min
API be... | java | public OvhConsumption serviceName_consumption_GET(String serviceName, Long duration) throws IOException {
String qPath = "/metrics/{serviceName}/consumption";
StringBuilder sb = path(qPath, serviceName);
query(sb, "duration", duration);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(r... | [
"public",
"OvhConsumption",
"serviceName_consumption_GET",
"(",
"String",
"serviceName",
",",
"Long",
"duration",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/metrics/{serviceName}/consumption\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
... | Get consumption for your service
REST: GET /metrics/{serviceName}/consumption
@param serviceName [required] Name of your service
@param duration [required] Last 'm' minutes. Default is 60min
API beta | [
"Get",
"consumption",
"for",
"your",
"service"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-metrics/src/main/java/net/minidev/ovh/api/ApiOvhMetrics.java#L142-L148 |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/client/ClientCollection.java | ClientCollection.createMediaEntry | public ClientMediaEntry createMediaEntry(final String title, final String slug, final String contentType, final InputStream is) throws ProponoException {
"""
Create new media entry assocaited with collection, but do not save. server. Depending on the
Atom server, you may or may not be able to. persist the propert... | java | public ClientMediaEntry createMediaEntry(final String title, final String slug, final String contentType, final InputStream is) throws ProponoException {
if (!isWritable()) {
throw new ProponoException("Collection is not writable");
}
return new ClientMediaEntry(service, this, title,... | [
"public",
"ClientMediaEntry",
"createMediaEntry",
"(",
"final",
"String",
"title",
",",
"final",
"String",
"slug",
",",
"final",
"String",
"contentType",
",",
"final",
"InputStream",
"is",
")",
"throws",
"ProponoException",
"{",
"if",
"(",
"!",
"isWritable",
"("... | Create new media entry assocaited with collection, but do not save. server. Depending on the
Atom server, you may or may not be able to. persist the properties of the entry that is
returned.
@param title Title to used for uploaded file.
@param slug String to be used in file-name of stored file
@param contentType MIME ... | [
"Create",
"new",
"media",
"entry",
"assocaited",
"with",
"collection",
"but",
"do",
"not",
"save",
".",
"server",
".",
"Depending",
"on",
"the",
"Atom",
"server",
"you",
"may",
"or",
"may",
"not",
"be",
"able",
"to",
".",
"persist",
"the",
"properties",
... | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientCollection.java#L176-L181 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java | UTF16.valueOf | public static String valueOf(char source[], int start, int limit, int offset16) {
"""
Convenience method. Returns a one or two char string containing the UTF-32 value in UTF16
format. If offset16 indexes a surrogate character, the whole supplementary codepoint will be
returned, except when either the leading or ... | java | public static String valueOf(char source[], int start, int limit, int offset16) {
switch (bounds(source, start, limit, offset16)) {
case LEAD_SURROGATE_BOUNDARY:
return new String(source, start + offset16, 2);
case TRAIL_SURROGATE_BOUNDARY:
return new String(source, start... | [
"public",
"static",
"String",
"valueOf",
"(",
"char",
"source",
"[",
"]",
",",
"int",
"start",
",",
"int",
"limit",
",",
"int",
"offset16",
")",
"{",
"switch",
"(",
"bounds",
"(",
"source",
",",
"start",
",",
"limit",
",",
"offset16",
")",
")",
"{",
... | Convenience method. Returns a one or two char string containing the UTF-32 value in UTF16
format. If offset16 indexes a surrogate character, the whole supplementary codepoint will be
returned, except when either the leading or trailing surrogate character lies out of the
specified subarray. In the latter case, only the... | [
"Convenience",
"method",
".",
"Returns",
"a",
"one",
"or",
"two",
"char",
"string",
"containing",
"the",
"UTF",
"-",
"32",
"value",
"in",
"UTF16",
"format",
".",
"If",
"offset16",
"indexes",
"a",
"surrogate",
"character",
"the",
"whole",
"supplementary",
"co... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java#L710-L718 |
alkacon/opencms-core | src/org/opencms/workplace/explorer/CmsResourceUtil.java | CmsResourceUtil.getSmallIconResource | public static Resource getSmallIconResource(CmsExplorerTypeSettings explorerType, String resourceName) {
"""
Returns the small icon resource for the given resource.<p>
@param explorerType the resource explorer type settings
@param resourceName the resource name
@return the icon resource
"""
if ... | java | public static Resource getSmallIconResource(CmsExplorerTypeSettings explorerType, String resourceName) {
if (explorerType == null) {
explorerType = OpenCms.getWorkplaceManager().getExplorerTypeSetting(
(resourceName == null) && !CmsResource.isFolder(resourceName)
? C... | [
"public",
"static",
"Resource",
"getSmallIconResource",
"(",
"CmsExplorerTypeSettings",
"explorerType",
",",
"String",
"resourceName",
")",
"{",
"if",
"(",
"explorerType",
"==",
"null",
")",
"{",
"explorerType",
"=",
"OpenCms",
".",
"getWorkplaceManager",
"(",
")",
... | Returns the small icon resource for the given resource.<p>
@param explorerType the resource explorer type settings
@param resourceName the resource name
@return the icon resource | [
"Returns",
"the",
"small",
"icon",
"resource",
"for",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/explorer/CmsResourceUtil.java#L315-L339 |
EdwardRaff/JSAT | JSAT/src/jsat/math/optimization/NelderMead.java | NelderMead.setContraction | public void setContraction(double contraction) {
"""
Sets the contraction constant, which must be in the range (0, 1)
@param contraction the contraction constant
"""
if(contraction >= 1 || contraction <= 0 || Double.isNaN(contraction) || Double.isInfinite(contraction) )
throw new Arithmeti... | java | public void setContraction(double contraction)
{
if(contraction >= 1 || contraction <= 0 || Double.isNaN(contraction) || Double.isInfinite(contraction) )
throw new ArithmeticException("Contraction constant must be > 0 and < 1, not " + contraction);
this.contraction = contraction;
} | [
"public",
"void",
"setContraction",
"(",
"double",
"contraction",
")",
"{",
"if",
"(",
"contraction",
">=",
"1",
"||",
"contraction",
"<=",
"0",
"||",
"Double",
".",
"isNaN",
"(",
"contraction",
")",
"||",
"Double",
".",
"isInfinite",
"(",
"contraction",
"... | Sets the contraction constant, which must be in the range (0, 1)
@param contraction the contraction constant | [
"Sets",
"the",
"contraction",
"constant",
"which",
"must",
"be",
"in",
"the",
"range",
"(",
"0",
"1",
")"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/optimization/NelderMead.java#L85-L90 |
aws/aws-sdk-java | aws-java-sdk-servicediscovery/src/main/java/com/amazonaws/services/servicediscovery/model/DiscoverInstancesRequest.java | DiscoverInstancesRequest.withQueryParameters | public DiscoverInstancesRequest withQueryParameters(java.util.Map<String, String> queryParameters) {
"""
<p>
A string map that contains attributes with values that you can use to filter instances by any custom attribute
that you specified when you registered the instance. Only instances that match all the specif... | java | public DiscoverInstancesRequest withQueryParameters(java.util.Map<String, String> queryParameters) {
setQueryParameters(queryParameters);
return this;
} | [
"public",
"DiscoverInstancesRequest",
"withQueryParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"queryParameters",
")",
"{",
"setQueryParameters",
"(",
"queryParameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A string map that contains attributes with values that you can use to filter instances by any custom attribute
that you specified when you registered the instance. Only instances that match all the specified key/value pairs
will be returned.
</p>
@param queryParameters
A string map that contains attributes with va... | [
"<p",
">",
"A",
"string",
"map",
"that",
"contains",
"attributes",
"with",
"values",
"that",
"you",
"can",
"use",
"to",
"filter",
"instances",
"by",
"any",
"custom",
"attribute",
"that",
"you",
"specified",
"when",
"you",
"registered",
"the",
"instance",
"."... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-servicediscovery/src/main/java/com/amazonaws/services/servicediscovery/model/DiscoverInstancesRequest.java#L242-L245 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/gen/StorableGenerator.java | StorableGenerator.branchIfDirty | private void branchIfDirty(CodeBuilder b, boolean includePk, Label label) {
"""
Generates code that branches to the given label if any properties are dirty.
"""
int count = mAllProperties.size();
int ordinal = 0;
int andMask = 0;
boolean anyNonDerived = false;
for... | java | private void branchIfDirty(CodeBuilder b, boolean includePk, Label label) {
int count = mAllProperties.size();
int ordinal = 0;
int andMask = 0;
boolean anyNonDerived = false;
for (StorableProperty property : mAllProperties.values()) {
if (!property.isDerived(... | [
"private",
"void",
"branchIfDirty",
"(",
"CodeBuilder",
"b",
",",
"boolean",
"includePk",
",",
"Label",
"label",
")",
"{",
"int",
"count",
"=",
"mAllProperties",
".",
"size",
"(",
")",
";",
"int",
"ordinal",
"=",
"0",
";",
"int",
"andMask",
"=",
"0",
"... | Generates code that branches to the given label if any properties are dirty. | [
"Generates",
"code",
"that",
"branches",
"to",
"the",
"given",
"label",
"if",
"any",
"properties",
"are",
"dirty",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java#L2423-L2458 |
Netflix/denominator | clouddns/src/main/java/denominator/clouddns/CloudDNSResourceRecordSetApi.java | CloudDNSResourceRecordSetApi.getPriority | private Integer getPriority(Map<String, Object> mutableRData) {
"""
Has the side effect of removing the priority from the mutableRData.
@return null or the priority, if it exists for a MX or SRV record
"""
Integer priority = null;
if (mutableRData.containsKey("priority")) { // SRVData
priorit... | java | private Integer getPriority(Map<String, Object> mutableRData) {
Integer priority = null;
if (mutableRData.containsKey("priority")) { // SRVData
priority = Integer.class.cast(mutableRData.remove("priority"));
} else if (mutableRData.containsKey("preference")) { // MXData
priority = Integer.class... | [
"private",
"Integer",
"getPriority",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"mutableRData",
")",
"{",
"Integer",
"priority",
"=",
"null",
";",
"if",
"(",
"mutableRData",
".",
"containsKey",
"(",
"\"priority\"",
")",
")",
"{",
"// SRVData",
"priority"... | Has the side effect of removing the priority from the mutableRData.
@return null or the priority, if it exists for a MX or SRV record | [
"Has",
"the",
"side",
"effect",
"of",
"removing",
"the",
"priority",
"from",
"the",
"mutableRData",
"."
] | train | https://github.com/Netflix/denominator/blob/c565e3b8c6043051252e0947029511f9ac5d306f/clouddns/src/main/java/denominator/clouddns/CloudDNSResourceRecordSetApi.java#L119-L129 |
apache/groovy | src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java | StaticTypeCheckingVisitor.adjustWithTraits | private static ClassNode adjustWithTraits(final MethodNode directMethodCallCandidate, final ClassNode receiver, final ClassNode[] args, final ClassNode returnType) {
"""
A special method handling the "withTrait" call for which the type checker knows more than
what the type signature is able to tell. If "withTrait... | java | private static ClassNode adjustWithTraits(final MethodNode directMethodCallCandidate, final ClassNode receiver, final ClassNode[] args, final ClassNode returnType) {
if (directMethodCallCandidate instanceof ExtensionMethodNode) {
ExtensionMethodNode emn = (ExtensionMethodNode) directMethodCallCandid... | [
"private",
"static",
"ClassNode",
"adjustWithTraits",
"(",
"final",
"MethodNode",
"directMethodCallCandidate",
",",
"final",
"ClassNode",
"receiver",
",",
"final",
"ClassNode",
"[",
"]",
"args",
",",
"final",
"ClassNode",
"returnType",
")",
"{",
"if",
"(",
"direct... | A special method handling the "withTrait" call for which the type checker knows more than
what the type signature is able to tell. If "withTrait" is detected, then a new class node
is created representing the list of trait interfaces.
@param directMethodCallCandidate a method selected by the type checker
@param receiv... | [
"A",
"special",
"method",
"handling",
"the",
"withTrait",
"call",
"for",
"which",
"the",
"type",
"checker",
"knows",
"more",
"than",
"what",
"the",
"type",
"signature",
"is",
"able",
"to",
"tell",
".",
"If",
"withTrait",
"is",
"detected",
"then",
"a",
"new... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java#L3757-L3774 |
ocelotds/ocelot | ocelot-processor/src/main/java/org/ocelotds/FileWriterServices.java | FileWriterServices.getFileObjectWriterInClassOutput | public Writer getFileObjectWriterInClassOutput(String pkg, String name) throws IOException {
"""
Create writer for write a/b/name file if pkg = a.b
this in classoutput directory
@param pkg
@param name
@return
@throws IOException
"""
FileObject resource = filer.createResource(StandardLocation.CLASS_OUTPU... | java | public Writer getFileObjectWriterInClassOutput(String pkg, String name) throws IOException {
FileObject resource = filer.createResource(StandardLocation.CLASS_OUTPUT, pkg, name);
return resource.openWriter();
} | [
"public",
"Writer",
"getFileObjectWriterInClassOutput",
"(",
"String",
"pkg",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"FileObject",
"resource",
"=",
"filer",
".",
"createResource",
"(",
"StandardLocation",
".",
"CLASS_OUTPUT",
",",
"pkg",
",",
"n... | Create writer for write a/b/name file if pkg = a.b
this in classoutput directory
@param pkg
@param name
@return
@throws IOException | [
"Create",
"writer",
"for",
"write",
"a",
"/",
"b",
"/",
"name",
"file",
"if",
"pkg",
"=",
"a",
".",
"b",
"this",
"in",
"classoutput",
"directory"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-processor/src/main/java/org/ocelotds/FileWriterServices.java#L74-L77 |
javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java | DoubleTuples.asList | public static List<Double> asList(final MutableDoubleTuple t) {
"""
Returns a <i>view</i> on the given tuple as a list that does not
allow <i>structural</i> modifications. Changes in the list will
write through to the given tuple. Changes in the backing tuple
will be visible in the returned list. The list will ... | java | public static List<Double> asList(final MutableDoubleTuple t)
{
if (t == null)
{
throw new NullPointerException("The tuple may not be null");
}
return new AbstractList<Double>()
{
@Override
public Double get(int index)
... | [
"public",
"static",
"List",
"<",
"Double",
">",
"asList",
"(",
"final",
"MutableDoubleTuple",
"t",
")",
"{",
"if",
"(",
"t",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"The tuple may not be null\"",
")",
";",
"}",
"return",
"new",... | Returns a <i>view</i> on the given tuple as a list that does not
allow <i>structural</i> modifications. Changes in the list will
write through to the given tuple. Changes in the backing tuple
will be visible in the returned list. The list will not permit
<code>null</code> elements.
@param t The tuple
@return The list
... | [
"Returns",
"a",
"<i",
">",
"view<",
"/",
"i",
">",
"on",
"the",
"given",
"tuple",
"as",
"a",
"list",
"that",
"does",
"not",
"allow",
"<i",
">",
"structural<",
"/",
"i",
">",
"modifications",
".",
"Changes",
"in",
"the",
"list",
"will",
"write",
"thro... | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L313-L341 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/MessagesApi.java | MessagesApi.getMessageAggregates | public AggregatesResponse getMessageAggregates(String sdid, String field, Long startDate, Long endDate) throws ApiException {
"""
Get Normalized Message Aggregates
Get Aggregates on normalized messages.
@param sdid Source device ID of the messages being searched. (required)
@param field Message field being quer... | java | public AggregatesResponse getMessageAggregates(String sdid, String field, Long startDate, Long endDate) throws ApiException {
ApiResponse<AggregatesResponse> resp = getMessageAggregatesWithHttpInfo(sdid, field, startDate, endDate);
return resp.getData();
} | [
"public",
"AggregatesResponse",
"getMessageAggregates",
"(",
"String",
"sdid",
",",
"String",
"field",
",",
"Long",
"startDate",
",",
"Long",
"endDate",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"AggregatesResponse",
">",
"resp",
"=",
"getMessageAggreg... | Get Normalized Message Aggregates
Get Aggregates on normalized messages.
@param sdid Source device ID of the messages being searched. (required)
@param field Message field being queried for aggregates. (required)
@param startDate Timestamp of earliest message (in milliseconds since epoch). (required)
@param endDate Tim... | [
"Get",
"Normalized",
"Message",
"Aggregates",
"Get",
"Aggregates",
"on",
"normalized",
"messages",
"."
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/MessagesApi.java#L577-L580 |
apiman/apiman | gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java | ApiRequestExecutorImpl.createResponseChain | private Chain<ApiResponse> createResponseChain(IAsyncHandler<ApiResponse> responseHandler) {
"""
Creates the chain used to apply policies in reverse order to the api response.
"""
ResponseChain chain = new ResponseChain(policyImpls, context);
chain.headHandler(responseHandler);
chain.po... | java | private Chain<ApiResponse> createResponseChain(IAsyncHandler<ApiResponse> responseHandler) {
ResponseChain chain = new ResponseChain(policyImpls, context);
chain.headHandler(responseHandler);
chain.policyFailureHandler(result -> {
if (apiConnectionResponse != null) {
apiC... | [
"private",
"Chain",
"<",
"ApiResponse",
">",
"createResponseChain",
"(",
"IAsyncHandler",
"<",
"ApiResponse",
">",
"responseHandler",
")",
"{",
"ResponseChain",
"chain",
"=",
"new",
"ResponseChain",
"(",
"policyImpls",
",",
"context",
")",
";",
"chain",
".",
"he... | Creates the chain used to apply policies in reverse order to the api response. | [
"Creates",
"the",
"chain",
"used",
"to",
"apply",
"policies",
"in",
"reverse",
"order",
"to",
"the",
"api",
"response",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java#L824-L840 |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/utils/CSVLoader.java | CSVLoader.display | private static void display(String format, Object... args) {
"""
Write the given message to stdout only. Uses {}-style parameters
"""
System.out.println(MessageFormatter.arrayFormat(format, args).getMessage());
} | java | private static void display(String format, Object... args) {
System.out.println(MessageFormatter.arrayFormat(format, args).getMessage());
} | [
"private",
"static",
"void",
"display",
"(",
"String",
"format",
",",
"Object",
"...",
"args",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"MessageFormatter",
".",
"arrayFormat",
"(",
"format",
",",
"args",
")",
".",
"getMessage",
"(",
")",
")",... | Write the given message to stdout only. Uses {}-style parameters | [
"Write",
"the",
"given",
"message",
"to",
"stdout",
"only",
".",
"Uses",
"{}",
"-",
"style",
"parameters"
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/utils/CSVLoader.java#L296-L298 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeLong.java | RedBlackTreeLong.removeInstance | @Override
public void removeInstance(long key, T instance) {
"""
Remove the node containing the given key and element. The node MUST exists, else the tree won't be valid anymore.
"""
if (first.value == key && instance == first.element) {
removeMin();
return;
}
if (last.valu... | java | @Override
public void removeInstance(long key, T instance) {
if (first.value == key && instance == first.element) {
removeMin();
return;
}
if (last.value == key && instance == last.element) {
removeMax();
return;
}
// if both children of root are black, s... | [
"@",
"Override",
"public",
"void",
"removeInstance",
"(",
"long",
"key",
",",
"T",
"instance",
")",
"{",
"if",
"(",
"first",
".",
"value",
"==",
"key",
"&&",
"instance",
"==",
"first",
".",
"element",
")",
"{",
"removeMin",
"(",
")",
";",
"return",
"... | Remove the node containing the given key and element. The node MUST exists, else the tree won't be valid anymore. | [
"Remove",
"the",
"node",
"containing",
"the",
"given",
"key",
"and",
"element",
".",
"The",
"node",
"MUST",
"exists",
"else",
"the",
"tree",
"won",
"t",
"be",
"valid",
"anymore",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeLong.java#L572-L589 |
elvishew/xLog | library/src/main/java/com/elvishew/xlog/Logger.java | Logger.println | private void println(int logLevel, String format, Object... args) {
"""
Print a log in a new line.
@param logLevel the log level of the printing log
@param format the format of the printing log, null if just need to concat arguments
@param args the arguments of the printing log
"""
if (logLevel ... | java | private void println(int logLevel, String format, Object... args) {
if (logLevel < logConfiguration.logLevel) {
return;
}
printlnInternal(logLevel, formatArgs(format, args));
} | [
"private",
"void",
"println",
"(",
"int",
"logLevel",
",",
"String",
"format",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"logLevel",
"<",
"logConfiguration",
".",
"logLevel",
")",
"{",
"return",
";",
"}",
"printlnInternal",
"(",
"logLevel",
",",
... | Print a log in a new line.
@param logLevel the log level of the printing log
@param format the format of the printing log, null if just need to concat arguments
@param args the arguments of the printing log | [
"Print",
"a",
"log",
"in",
"a",
"new",
"line",
"."
] | train | https://github.com/elvishew/xLog/blob/c6fb95555ce619d3e527f5ba6c45d4d247c5a838/library/src/main/java/com/elvishew/xlog/Logger.java#L515-L520 |
bpsm/edn-java | src/main/java/us/bpsm/edn/Symbol.java | Symbol.newSymbol | public static Symbol newSymbol(String prefix, String name) {
"""
Provide a Symbol with the given prefix and name.
@param prefix
An empty String or a non-empty String obeying the
restrictions specified by edn. Never null.
@param name
A non-empty string obeying the restrictions specified by edn.
Never null.
... | java | public static Symbol newSymbol(String prefix, String name) {
checkArguments(prefix, name);
return new Symbol(prefix, name);
} | [
"public",
"static",
"Symbol",
"newSymbol",
"(",
"String",
"prefix",
",",
"String",
"name",
")",
"{",
"checkArguments",
"(",
"prefix",
",",
"name",
")",
";",
"return",
"new",
"Symbol",
"(",
"prefix",
",",
"name",
")",
";",
"}"
] | Provide a Symbol with the given prefix and name.
@param prefix
An empty String or a non-empty String obeying the
restrictions specified by edn. Never null.
@param name
A non-empty string obeying the restrictions specified by edn.
Never null.
@return a Symbol, never null. | [
"Provide",
"a",
"Symbol",
"with",
"the",
"given",
"prefix",
"and",
"name",
"."
] | train | https://github.com/bpsm/edn-java/blob/c5dfdb77431da1aca3c257599b237a21575629b2/src/main/java/us/bpsm/edn/Symbol.java#L50-L53 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/tools/net/support/AbstractClientServerSupport.java | AbstractClientServerSupport.newSocket | public Socket newSocket(String host, int port) {
"""
Constructs and configures a new client {@link Socket}.
Sets {@link Socket#setReuseAddress(boolean)} to {@literal true} and sets the {@link Socket#setSoTimeout(int)}
to {@literal 15 seconds}.
@param host {@link String} specifying the host on which the serv... | java | public Socket newSocket(String host, int port) {
try {
Socket socket = newSocket();
socket.setReuseAddress(DEFAULT_REUSE_ADDRESS);
socket.setSoTimeout(intValue(DEFAULT_SO_TIMEOUT));
socket.connect(newSocketAddress(host, port));
return socket;
}
catch (IOException cause) {
... | [
"public",
"Socket",
"newSocket",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"try",
"{",
"Socket",
"socket",
"=",
"newSocket",
"(",
")",
";",
"socket",
".",
"setReuseAddress",
"(",
"DEFAULT_REUSE_ADDRESS",
")",
";",
"socket",
".",
"setSoTimeout",
... | Constructs and configures a new client {@link Socket}.
Sets {@link Socket#setReuseAddress(boolean)} to {@literal true} and sets the {@link Socket#setSoTimeout(int)}
to {@literal 15 seconds}.
@param host {@link String} specifying the host on which the server is running.
@param port {@link Integer} specifying the port ... | [
"Constructs",
"and",
"configures",
"a",
"new",
"client",
"{",
"@link",
"Socket",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/tools/net/support/AbstractClientServerSupport.java#L154-L165 |
real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/SbeTool.java | SbeTool.validateAgainstSchema | public static void validateAgainstSchema(final String sbeSchemaFilename, final String xsdFilename)
throws Exception {
"""
Validate the SBE Schema against the XSD.
@param sbeSchemaFilename to be validated.
@param xsdFilename XSD against which to validate.
@throws Exception if an error occurs whil... | java | public static void validateAgainstSchema(final String sbeSchemaFilename, final String xsdFilename)
throws Exception
{
final ParserOptions.Builder optionsBuilder = ParserOptions.builder()
.xsdFilename(System.getProperty(VALIDATION_XSD))
.xIncludeAware(Boolean.parseBoolean(Syst... | [
"public",
"static",
"void",
"validateAgainstSchema",
"(",
"final",
"String",
"sbeSchemaFilename",
",",
"final",
"String",
"xsdFilename",
")",
"throws",
"Exception",
"{",
"final",
"ParserOptions",
".",
"Builder",
"optionsBuilder",
"=",
"ParserOptions",
".",
"builder",
... | Validate the SBE Schema against the XSD.
@param sbeSchemaFilename to be validated.
@param xsdFilename XSD against which to validate.
@throws Exception if an error occurs while validating. | [
"Validate",
"the",
"SBE",
"Schema",
"against",
"the",
"XSD",
"."
] | train | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/SbeTool.java#L251-L272 |
requery/requery | requery/src/main/java/io/requery/sql/SchemaModifier.java | SchemaModifier.addColumn | public <T> void addColumn(Attribute<T, ?> attribute) {
"""
Alters the attribute's table and add's the column representing the given {@link Attribute}.
@param attribute being added
@param <T> parent type of the attribute
@throws TableModificationException if the addition fails.
"""
try (Con... | java | public <T> void addColumn(Attribute<T, ?> attribute) {
try (Connection connection = getConnection()) {
addColumn(connection, attribute);
} catch (SQLException e) {
throw new TableModificationException(e);
}
} | [
"public",
"<",
"T",
">",
"void",
"addColumn",
"(",
"Attribute",
"<",
"T",
",",
"?",
">",
"attribute",
")",
"{",
"try",
"(",
"Connection",
"connection",
"=",
"getConnection",
"(",
")",
")",
"{",
"addColumn",
"(",
"connection",
",",
"attribute",
")",
";"... | Alters the attribute's table and add's the column representing the given {@link Attribute}.
@param attribute being added
@param <T> parent type of the attribute
@throws TableModificationException if the addition fails. | [
"Alters",
"the",
"attribute",
"s",
"table",
"and",
"add",
"s",
"the",
"column",
"representing",
"the",
"given",
"{",
"@link",
"Attribute",
"}",
"."
] | train | https://github.com/requery/requery/blob/3070590c2ef76bb7062570bf9df03cd482db024a/requery/src/main/java/io/requery/sql/SchemaModifier.java#L252-L258 |
EsotericSoftware/jsonbeans | src/com/esotericsoftware/jsonbeans/Json.java | Json.setSerializer | public <T> void setSerializer (Class<T> type, JsonSerializer<T> serializer) {
"""
Registers a serializer to use for the specified type instead of the default behavior of serializing all of an objects
fields.
"""
classToSerializer.put(type, serializer);
} | java | public <T> void setSerializer (Class<T> type, JsonSerializer<T> serializer) {
classToSerializer.put(type, serializer);
} | [
"public",
"<",
"T",
">",
"void",
"setSerializer",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"JsonSerializer",
"<",
"T",
">",
"serializer",
")",
"{",
"classToSerializer",
".",
"put",
"(",
"type",
",",
"serializer",
")",
";",
"}"
] | Registers a serializer to use for the specified type instead of the default behavior of serializing all of an objects
fields. | [
"Registers",
"a",
"serializer",
"to",
"use",
"for",
"the",
"specified",
"type",
"instead",
"of",
"the",
"default",
"behavior",
"of",
"serializing",
"all",
"of",
"an",
"objects",
"fields",
"."
] | train | https://github.com/EsotericSoftware/jsonbeans/blob/ff4502d0ff86cc77aa5c61d47371d0c66c14fe2f/src/com/esotericsoftware/jsonbeans/Json.java#L126-L128 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java | DirectoryServiceClient.updateServiceInstanceInternalStatus | public void updateServiceInstanceInternalStatus(String serviceName, String instanceId, OperationalStatus status, final RegistrationCallback cb, Object context) {
"""
Update ServiceInstance internal status with Callback.
@param serviceName
the servicename.
@param instanceId
the instanceId.
@param status
the... | java | public void updateServiceInstanceInternalStatus(String serviceName, String instanceId, OperationalStatus status, final RegistrationCallback cb, Object context){
ProtocolHeader header = new ProtocolHeader();
header.setType(ProtocolType.UpdateServiceInstanceInternalStatus);
UpdateServiceInstanceI... | [
"public",
"void",
"updateServiceInstanceInternalStatus",
"(",
"String",
"serviceName",
",",
"String",
"instanceId",
",",
"OperationalStatus",
"status",
",",
"final",
"RegistrationCallback",
"cb",
",",
"Object",
"context",
")",
"{",
"ProtocolHeader",
"header",
"=",
"ne... | Update ServiceInstance internal status with Callback.
@param serviceName
the servicename.
@param instanceId
the instanceId.
@param status
the OperationalStaus
@param cb
the Callback.
@param context
the context object. | [
"Update",
"ServiceInstance",
"internal",
"status",
"with",
"Callback",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java#L474-L491 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.