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 |
|---|---|---|---|---|---|---|---|---|---|---|
apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.swapBytes | public final void swapBytes(byte[] tempBuffer, MemorySegment seg2, int offset1, int offset2, int len) {
"""
Swaps bytes between two memory segments, using the given auxiliary buffer.
@param tempBuffer The auxiliary buffer in which to put data during triangle swap.
@param seg2 Segment to swap bytes with
@param... | java | public final void swapBytes(byte[] tempBuffer, MemorySegment seg2, int offset1, int offset2, int len) {
if ((offset1 | offset2 | len | (tempBuffer.length - len)) >= 0) {
final long thisPos = this.address + offset1;
final long otherPos = seg2.address + offset2;
if (thisPos <= this.addressLimit - len && other... | [
"public",
"final",
"void",
"swapBytes",
"(",
"byte",
"[",
"]",
"tempBuffer",
",",
"MemorySegment",
"seg2",
",",
"int",
"offset1",
",",
"int",
"offset2",
",",
"int",
"len",
")",
"{",
"if",
"(",
"(",
"offset1",
"|",
"offset2",
"|",
"len",
"|",
"(",
"te... | Swaps bytes between two memory segments, using the given auxiliary buffer.
@param tempBuffer The auxiliary buffer in which to put data during triangle swap.
@param seg2 Segment to swap bytes with
@param offset1 Offset of this segment to start swapping
@param offset2 Offset of seg2 to start swapping
@param len Length o... | [
"Swaps",
"bytes",
"between",
"two",
"memory",
"segments",
"using",
"the",
"given",
"auxiliary",
"buffer",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L1367-L1395 |
VoltDB/voltdb | src/frontend/org/voltdb/sysprocs/AdHocNTBase.java | AdHocNTBase.processExplainDefaultProc | static CompletableFuture<ClientResponse> processExplainDefaultProc(AdHocPlannedStmtBatch planBatch) {
"""
Explain Proc for a default proc is routed through the regular Explain
path using ad hoc planning and all. Take the result from that async
process and format it like other explains for procedures.
"""
... | java | static CompletableFuture<ClientResponse> processExplainDefaultProc(AdHocPlannedStmtBatch planBatch) {
Database db = VoltDB.instance().getCatalogContext().database;
// there better be one statement if this is really SQL
// from a default procedure
assert(planBatch.getPlannedStatementCoun... | [
"static",
"CompletableFuture",
"<",
"ClientResponse",
">",
"processExplainDefaultProc",
"(",
"AdHocPlannedStmtBatch",
"planBatch",
")",
"{",
"Database",
"db",
"=",
"VoltDB",
".",
"instance",
"(",
")",
".",
"getCatalogContext",
"(",
")",
".",
"database",
";",
"// t... | Explain Proc for a default proc is routed through the regular Explain
path using ad hoc planning and all. Take the result from that async
process and format it like other explains for procedures. | [
"Explain",
"Proc",
"for",
"a",
"default",
"proc",
"is",
"routed",
"through",
"the",
"regular",
"Explain",
"path",
"using",
"ad",
"hoc",
"planning",
"and",
"all",
".",
"Take",
"the",
"result",
"from",
"that",
"async",
"process",
"and",
"format",
"it",
"like... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/sysprocs/AdHocNTBase.java#L414-L440 |
Red5/red5-io | src/main/java/org/red5/io/amf/Output.java | Output.writeArbitraryObject | protected void writeArbitraryObject(Object object) {
"""
Writes an arbitrary object to the output.
@param object
Object to write
"""
log.debug("writeObject");
// If we need to serialize class information...
Class<?> objectClass = object.getClass();
if (!objectClass.isAnnotat... | java | protected void writeArbitraryObject(Object object) {
log.debug("writeObject");
// If we need to serialize class information...
Class<?> objectClass = object.getClass();
if (!objectClass.isAnnotationPresent(Anonymous.class)) {
// Write out start object marker for class name
... | [
"protected",
"void",
"writeArbitraryObject",
"(",
"Object",
"object",
")",
"{",
"log",
".",
"debug",
"(",
"\"writeObject\"",
")",
";",
"// If we need to serialize class information...",
"Class",
"<",
"?",
">",
"objectClass",
"=",
"object",
".",
"getClass",
"(",
")... | Writes an arbitrary object to the output.
@param object
Object to write | [
"Writes",
"an",
"arbitrary",
"object",
"to",
"the",
"output",
"."
] | train | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/amf/Output.java#L435-L470 |
kaichunlin/android-transition | core/src/main/java/com/kaichunlin/transition/internal/TransitionControllerManager.java | TransitionControllerManager.addAnimatorSetAsTransition | public TransitionController addAnimatorSetAsTransition(@Nullable View target, @NonNull AnimatorSet animatorSet) {
"""
Adds an AnimatorSet as {@link TransitionController}
@param target
@param animatorSet
@return
"""
return addTransitionController(new DefaultTransitionController(target, animatorSet)... | java | public TransitionController addAnimatorSetAsTransition(@Nullable View target, @NonNull AnimatorSet animatorSet) {
return addTransitionController(new DefaultTransitionController(target, animatorSet));
} | [
"public",
"TransitionController",
"addAnimatorSetAsTransition",
"(",
"@",
"Nullable",
"View",
"target",
",",
"@",
"NonNull",
"AnimatorSet",
"animatorSet",
")",
"{",
"return",
"addTransitionController",
"(",
"new",
"DefaultTransitionController",
"(",
"target",
",",
"anim... | Adds an AnimatorSet as {@link TransitionController}
@param target
@param animatorSet
@return | [
"Adds",
"an",
"AnimatorSet",
"as",
"{",
"@link",
"TransitionController",
"}"
] | train | https://github.com/kaichunlin/android-transition/blob/7b53074206622f5cf5d82091d891a7ed8b9f06cd/core/src/main/java/com/kaichunlin/transition/internal/TransitionControllerManager.java#L76-L78 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/PortableUtils.java | PortableUtils.validateAndGetArrayQuantifierFromCurrentToken | static int validateAndGetArrayQuantifierFromCurrentToken(String token, String fullPath) {
"""
Extracts and validates the quantifier from the given path token
@param token token from which the quantifier is retrieved
@param fullPath fullPath to which the token belongs - just for output
@return validated qua... | java | static int validateAndGetArrayQuantifierFromCurrentToken(String token, String fullPath) {
String quantifier = extractArgumentsFromAttributeName(token);
if (quantifier == null) {
throw new IllegalArgumentException("Malformed quantifier in " + fullPath);
}
int index = Integer.p... | [
"static",
"int",
"validateAndGetArrayQuantifierFromCurrentToken",
"(",
"String",
"token",
",",
"String",
"fullPath",
")",
"{",
"String",
"quantifier",
"=",
"extractArgumentsFromAttributeName",
"(",
"token",
")",
";",
"if",
"(",
"quantifier",
"==",
"null",
")",
"{",
... | Extracts and validates the quantifier from the given path token
@param token token from which the quantifier is retrieved
@param fullPath fullPath to which the token belongs - just for output
@return validated quantifier | [
"Extracts",
"and",
"validates",
"the",
"quantifier",
"from",
"the",
"given",
"path",
"token"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/PortableUtils.java#L44-L54 |
andkulikov/Transitions-Everywhere | library(1.x)/src/main/java/com/transitionseverywhere/TransitionManager.java | TransitionManager.setTransition | public void setTransition(@NonNull Scene scene, @Nullable Transition transition) {
"""
Sets a specific transition to occur when the given scene is entered.
@param scene The scene which, when applied, will cause the given
transition to run.
@param transition The transition that will play when the given sc... | java | public void setTransition(@NonNull Scene scene, @Nullable Transition transition) {
mSceneTransitions.put(scene, transition);
} | [
"public",
"void",
"setTransition",
"(",
"@",
"NonNull",
"Scene",
"scene",
",",
"@",
"Nullable",
"Transition",
"transition",
")",
"{",
"mSceneTransitions",
".",
"put",
"(",
"scene",
",",
"transition",
")",
";",
"}"
] | Sets a specific transition to occur when the given scene is entered.
@param scene The scene which, when applied, will cause the given
transition to run.
@param transition The transition that will play when the given scene is
entered. A value of null will result in the default behavior of
using the default transit... | [
"Sets",
"a",
"specific",
"transition",
"to",
"occur",
"when",
"the",
"given",
"scene",
"is",
"entered",
"."
] | train | https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/TransitionManager.java#L121-L123 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.doEntryEquals | private static boolean doEntryEquals(ZipFile zf1, ZipFile zf2, String path1, String path2) throws IOException {
"""
Compares two ZIP entries (byte-by-byte). .
@param zf1
first ZIP file.
@param zf2
second ZIP file.
@param path1
name of the first entry.
@param path2
name of the second entry.
@return <code... | java | private static boolean doEntryEquals(ZipFile zf1, ZipFile zf2, String path1, String path2) throws IOException {
InputStream is1 = null;
InputStream is2 = null;
try {
ZipEntry e1 = zf1.getEntry(path1);
ZipEntry e2 = zf2.getEntry(path2);
if (e1 == null && e2 == null) {
return true;
... | [
"private",
"static",
"boolean",
"doEntryEquals",
"(",
"ZipFile",
"zf1",
",",
"ZipFile",
"zf2",
",",
"String",
"path1",
",",
"String",
"path2",
")",
"throws",
"IOException",
"{",
"InputStream",
"is1",
"=",
"null",
";",
"InputStream",
"is2",
"=",
"null",
";",
... | Compares two ZIP entries (byte-by-byte). .
@param zf1
first ZIP file.
@param zf2
second ZIP file.
@param path1
name of the first entry.
@param path2
name of the second entry.
@return <code>true</code> if the contents of the entries were same. | [
"Compares",
"two",
"ZIP",
"entries",
"(",
"byte",
"-",
"by",
"-",
"byte",
")",
".",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L3285-L3315 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java | GraphHelper.getVertexForInstanceByUniqueAttribute | public AtlasVertex getVertexForInstanceByUniqueAttribute(ClassType classType, IReferenceableInstance instance)
throws AtlasException {
"""
For the given type, finds an unique attribute and checks if there is an existing instance with the same
unique value
@param classType
@param instance
@return
@th... | java | public AtlasVertex getVertexForInstanceByUniqueAttribute(ClassType classType, IReferenceableInstance instance)
throws AtlasException {
if (LOG.isDebugEnabled()) {
LOG.debug("Checking if there is an instance with the same unique attributes for instance {}", instance.toShortString());
... | [
"public",
"AtlasVertex",
"getVertexForInstanceByUniqueAttribute",
"(",
"ClassType",
"classType",
",",
"IReferenceableInstance",
"instance",
")",
"throws",
"AtlasException",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
... | For the given type, finds an unique attribute and checks if there is an existing instance with the same
unique value
@param classType
@param instance
@return
@throws AtlasException | [
"For",
"the",
"given",
"type",
"finds",
"an",
"unique",
"attribute",
"and",
"checks",
"if",
"there",
"is",
"an",
"existing",
"instance",
"with",
"the",
"same",
"unique",
"value"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java#L768-L792 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/CollisionConstraintConfig.java | CollisionConstraintConfig.exports | public static void exports(Xml root, CollisionConstraint constraint) {
"""
Export the collision constraint as a node.
@param root The node root (must not be <code>null</code>).
@param constraint The collision constraint to export (must not be <code>null</code>).
@throws LionEngineException If error on writing... | java | public static void exports(Xml root, CollisionConstraint constraint)
{
Check.notNull(root);
Check.notNull(constraint);
for (final Entry<Orientation, Collection<String>> entry : constraint.getConstraints().entrySet())
{
final Orientation orientation = entry.getKey(... | [
"public",
"static",
"void",
"exports",
"(",
"Xml",
"root",
",",
"CollisionConstraint",
"constraint",
")",
"{",
"Check",
".",
"notNull",
"(",
"root",
")",
";",
"Check",
".",
"notNull",
"(",
"constraint",
")",
";",
"for",
"(",
"final",
"Entry",
"<",
"Orien... | Export the collision constraint as a node.
@param root The node root (must not be <code>null</code>).
@param constraint The collision constraint to export (must not be <code>null</code>).
@throws LionEngineException If error on writing. | [
"Export",
"the",
"collision",
"constraint",
"as",
"a",
"node",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/CollisionConstraintConfig.java#L79-L95 |
Commonjava/webdav-handler | common/src/main/java/net/sf/webdav/util/RequestUtil.java | RequestUtil.parseParameters | public static void parseParameters( final Map<String, String[]> map, final byte[] data, final String encoding )
throws UnsupportedEncodingException {
"""
Append request parameters from the specified String to the specified Map.
It is presumed that the specified Map is not accessed from any other
thread, ... | java | public static void parseParameters( final Map<String, String[]> map, final byte[] data, final String encoding )
throws UnsupportedEncodingException
{
if ( data != null && data.length > 0 )
{
int ix = 0;
int ox = 0;
String key = null;
String va... | [
"public",
"static",
"void",
"parseParameters",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"map",
",",
"final",
"byte",
"[",
"]",
"data",
",",
"final",
"String",
"encoding",
")",
"throws",
"UnsupportedEncodingException",
"{",
"if",
"(... | Append request parameters from the specified String to the specified Map.
It is presumed that the specified Map is not accessed from any other
thread, so no synchronization is performed.
<p>
<strong>IMPLEMENTATION NOTE</strong>: URL decoding is performed
individually on the parsed name and value elements, rather than o... | [
"Append",
"request",
"parameters",
"from",
"the",
"specified",
"String",
"to",
"the",
"specified",
"Map",
".",
"It",
"is",
"presumed",
"that",
"the",
"specified",
"Map",
"is",
"not",
"accessed",
"from",
"any",
"other",
"thread",
"so",
"no",
"synchronization",
... | train | https://github.com/Commonjava/webdav-handler/blob/39bb7032fc75c1b67d3f2440dd1c234ead96cb9d/common/src/main/java/net/sf/webdav/util/RequestUtil.java#L712-L765 |
DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/nosql/lucene/BaseLuceneStorage.java | BaseLuceneStorage.buildIdTerm | protected Term buildIdTerm(String spaceId, String key) {
"""
Build the "id" term ({@code id="spaceId:key"}
@param spaceId
@param key
@return
"""
return new Term(FIELD_ID, spaceId.trim() + ":" + key.trim());
} | java | protected Term buildIdTerm(String spaceId, String key) {
return new Term(FIELD_ID, spaceId.trim() + ":" + key.trim());
} | [
"protected",
"Term",
"buildIdTerm",
"(",
"String",
"spaceId",
",",
"String",
"key",
")",
"{",
"return",
"new",
"Term",
"(",
"FIELD_ID",
",",
"spaceId",
".",
"trim",
"(",
")",
"+",
"\":\"",
"+",
"key",
".",
"trim",
"(",
")",
")",
";",
"}"
] | Build the "id" term ({@code id="spaceId:key"}
@param spaceId
@param key
@return | [
"Build",
"the",
"id",
"term",
"(",
"{",
"@code",
"id",
"=",
"spaceId",
":",
"key",
"}"
] | train | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/nosql/lucene/BaseLuceneStorage.java#L250-L252 |
jbossws/jbossws-common | src/main/java/org/jboss/ws/common/DOMUtils.java | DOMUtils.node2String | public static String node2String(final Node node) throws UnsupportedEncodingException {
"""
Converts XML node in pretty mode using UTF-8 encoding to string.
@param node XML document or element
@return XML string
@throws Exception if some error occurs
"""
return node2String(node, true, Constants.DEFA... | java | public static String node2String(final Node node) throws UnsupportedEncodingException
{
return node2String(node, true, Constants.DEFAULT_XML_CHARSET);
} | [
"public",
"static",
"String",
"node2String",
"(",
"final",
"Node",
"node",
")",
"throws",
"UnsupportedEncodingException",
"{",
"return",
"node2String",
"(",
"node",
",",
"true",
",",
"Constants",
".",
"DEFAULT_XML_CHARSET",
")",
";",
"}"
] | Converts XML node in pretty mode using UTF-8 encoding to string.
@param node XML document or element
@return XML string
@throws Exception if some error occurs | [
"Converts",
"XML",
"node",
"in",
"pretty",
"mode",
"using",
"UTF",
"-",
"8",
"encoding",
"to",
"string",
"."
] | train | https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/DOMUtils.java#L444-L447 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X500Name.java | X500Name.asX500Principal | public X500Principal asX500Principal() {
"""
Get an X500Principal backed by this X500Name.
Note that we are using privileged reflection to access the hidden
package private constructor in X500Principal.
"""
if (x500Principal == null) {
try {
Object[] args = new Object[] ... | java | public X500Principal asX500Principal() {
if (x500Principal == null) {
try {
Object[] args = new Object[] {this};
x500Principal =
(X500Principal)principalConstructor.newInstance(args);
} catch (Exception e) {
throw ne... | [
"public",
"X500Principal",
"asX500Principal",
"(",
")",
"{",
"if",
"(",
"x500Principal",
"==",
"null",
")",
"{",
"try",
"{",
"Object",
"[",
"]",
"args",
"=",
"new",
"Object",
"[",
"]",
"{",
"this",
"}",
";",
"x500Principal",
"=",
"(",
"X500Principal",
... | Get an X500Principal backed by this X500Name.
Note that we are using privileged reflection to access the hidden
package private constructor in X500Principal. | [
"Get",
"an",
"X500Principal",
"backed",
"by",
"this",
"X500Name",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X500Name.java#L1437-L1448 |
zerodhatech/javakiteconnect | kiteconnect/src/com/zerodhatech/kiteconnect/KiteConnect.java | KiteConnect.cancelOrder | public Order cancelOrder(String orderId, String variety) throws KiteException, JSONException, IOException {
"""
Cancels an order.
@param orderId order id of the order to be cancelled.
@param variety [variety="regular"]. Order variety can be bo, co, amo, regular.
@return Order object contains only orderId.
@thr... | java | public Order cancelOrder(String orderId, String variety) throws KiteException, JSONException, IOException {
String url = routes.get("orders.cancel").replace(":variety", variety).replace(":order_id", orderId);
Map<String, Object> params = new HashMap<String, Object>();
JSONObject jsonObject = ne... | [
"public",
"Order",
"cancelOrder",
"(",
"String",
"orderId",
",",
"String",
"variety",
")",
"throws",
"KiteException",
",",
"JSONException",
",",
"IOException",
"{",
"String",
"url",
"=",
"routes",
".",
"get",
"(",
"\"orders.cancel\"",
")",
".",
"replace",
"(",... | Cancels an order.
@param orderId order id of the order to be cancelled.
@param variety [variety="regular"]. Order variety can be bo, co, amo, regular.
@return Order object contains only orderId.
@throws KiteException is thrown for all Kite trade related errors.
@throws JSONException is thrown when there is exception wh... | [
"Cancels",
"an",
"order",
"."
] | train | https://github.com/zerodhatech/javakiteconnect/blob/4a3f15ff2c8a1b3b6ec61799f8bb047e4dfeb92d/kiteconnect/src/com/zerodhatech/kiteconnect/KiteConnect.java#L334-L342 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/sr/InputElementStack.java | InputElementStack.addNsBinding | public void addNsBinding(String prefix, String uri) {
"""
Callback method called by the namespace default provider. At
this point we can trust it to only call this method with somewhat
valid arguments (no dups etc).
"""
// Unbind? (xml 1.1...)
if ((uri == null) || (uri.length() == 0)) {
... | java | public void addNsBinding(String prefix, String uri)
{
// Unbind? (xml 1.1...)
if ((uri == null) || (uri.length() == 0)) {
uri = null;
}
// Default ns declaration?
if ((prefix == null) || (prefix.length() == 0)) {
prefix = null;
mCurrElemen... | [
"public",
"void",
"addNsBinding",
"(",
"String",
"prefix",
",",
"String",
"uri",
")",
"{",
"// Unbind? (xml 1.1...)",
"if",
"(",
"(",
"uri",
"==",
"null",
")",
"||",
"(",
"uri",
".",
"length",
"(",
")",
"==",
"0",
")",
")",
"{",
"uri",
"=",
"null",
... | Callback method called by the namespace default provider. At
this point we can trust it to only call this method with somewhat
valid arguments (no dups etc). | [
"Callback",
"method",
"called",
"by",
"the",
"namespace",
"default",
"provider",
".",
"At",
"this",
"point",
"we",
"can",
"trust",
"it",
"to",
"only",
"call",
"this",
"method",
"with",
"somewhat",
"valid",
"arguments",
"(",
"no",
"dups",
"etc",
")",
"."
] | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sr/InputElementStack.java#L893-L906 |
alkacon/opencms-core | src/org/opencms/db/CmsImportFolder.java | CmsImportFolder.importFolder | public void importFolder(String importFolderName, String importPath, CmsObject cms) throws CmsException {
"""
Import that will read from the real file system.<p>
@param importFolderName the folder to import
@param importPath the path to the OpenCms VFS to import to
@param cms a OpenCms context to provide the ... | java | public void importFolder(String importFolderName, String importPath, CmsObject cms) throws CmsException {
try {
m_importedResources = new ArrayList<CmsResource>();
m_importFolderName = importFolderName;
m_importPath = importPath;
m_cms = cms;
// open ... | [
"public",
"void",
"importFolder",
"(",
"String",
"importFolderName",
",",
"String",
"importPath",
",",
"CmsObject",
"cms",
")",
"throws",
"CmsException",
"{",
"try",
"{",
"m_importedResources",
"=",
"new",
"ArrayList",
"<",
"CmsResource",
">",
"(",
")",
";",
"... | Import that will read from the real file system.<p>
@param importFolderName the folder to import
@param importPath the path to the OpenCms VFS to import to
@param cms a OpenCms context to provide the permissions
@throws CmsException if something goes wrong | [
"Import",
"that",
"will",
"read",
"from",
"the",
"real",
"file",
"system",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsImportFolder.java#L139-L164 |
leancloud/java-sdk-all | android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/game/GameLoginSignUtil.java | GameLoginSignUtil.doCheck | private static void doCheck(String appId, String cpId, String privateKey, String publicKey, GameUserData userData, ICheckLoginSignHandler callback) {
"""
验签
@param appId 应用程序id,来源于华为开发者联盟上参数
@param cpId 开发者id,来源于开发者联盟
@param privateKey 私钥,来源于开发者联盟,非常重要的信息,注意保存避免泄露
@param publicKey 公钥,用来验签服务端返回的结果
@param userD... | java | private static void doCheck(String appId, String cpId, String privateKey, String publicKey, GameUserData userData, ICheckLoginSignHandler callback) {
// 创建body参数
byte[] body = getRequestBody(appId, cpId, privateKey, userData);
// 发送请求
sendRequest(URL, body, publicKey, callback);
... | [
"private",
"static",
"void",
"doCheck",
"(",
"String",
"appId",
",",
"String",
"cpId",
",",
"String",
"privateKey",
",",
"String",
"publicKey",
",",
"GameUserData",
"userData",
",",
"ICheckLoginSignHandler",
"callback",
")",
"{",
"// 创建body参数\r",
"byte",
"[",
"]... | 验签
@param appId 应用程序id,来源于华为开发者联盟上参数
@param cpId 开发者id,来源于开发者联盟
@param privateKey 私钥,来源于开发者联盟,非常重要的信息,注意保存避免泄露
@param publicKey 公钥,用来验签服务端返回的结果
@param userData 用户的登录结果数据
@param callback 验签结果回调 | [
"验签"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/game/GameLoginSignUtil.java#L78-L84 |
korpling/ANNIS | annis-service/src/main/java/annis/administration/AdministrationDao.java | AdministrationDao.fixResolverVisMapTable | private void fixResolverVisMapTable(String toplevelCorpus, String table) {
"""
Removes any unwanted entries from the resolver_vis_map table
@param toplevelCorpus
@param table
"""
log.info("checking resolver_vis_map for errors");
// delete all entries that reference a different corpus than the impo... | java | private void fixResolverVisMapTable(String toplevelCorpus, String table)
{
log.info("checking resolver_vis_map for errors");
// delete all entries that reference a different corpus than the imported one
int invalidRows = getJdbcTemplate().update("DELETE FROM " + table
+ " WHERE corpus <> ?", toplev... | [
"private",
"void",
"fixResolverVisMapTable",
"(",
"String",
"toplevelCorpus",
",",
"String",
"table",
")",
"{",
"log",
".",
"info",
"(",
"\"checking resolver_vis_map for errors\"",
")",
";",
"// delete all entries that reference a different corpus than the imported one",
"int",... | Removes any unwanted entries from the resolver_vis_map table
@param toplevelCorpus
@param table | [
"Removes",
"any",
"unwanted",
"entries",
"from",
"the",
"resolver_vis_map",
"table"
] | train | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L2070-L2083 |
carrotsearch/hppc | hppc/src/main/templates/com/carrotsearch/hppc/KTypeHashSet.java | KTypeHashSet.indexReplace | public KType indexReplace(int index, KType equivalentKey) {
"""
Replaces the existing equivalent key with the given one and returns any previous value
stored for that key.
@see #indexOf
@param index The index of an existing key.
@param equivalentKey The key to put in the set as a replacement. Must be equiv... | java | public KType indexReplace(int index, KType equivalentKey) {
assert index >= 0 : "The index must point at an existing key.";
assert index <= mask ||
(index == mask + 1 && hasEmptyKey);
assert Intrinsics.equals(this, keys[index], equivalentKey);
KType previousValue = Intrinsics.<KType> cast(ke... | [
"public",
"KType",
"indexReplace",
"(",
"int",
"index",
",",
"KType",
"equivalentKey",
")",
"{",
"assert",
"index",
">=",
"0",
":",
"\"The index must point at an existing key.\"",
";",
"assert",
"index",
"<=",
"mask",
"||",
"(",
"index",
"==",
"mask",
"+",
"1"... | Replaces the existing equivalent key with the given one and returns any previous value
stored for that key.
@see #indexOf
@param index The index of an existing key.
@param equivalentKey The key to put in the set as a replacement. Must be equivalent to
the key currently stored at the provided index.
@return Returns th... | [
"Replaces",
"the",
"existing",
"equivalent",
"key",
"with",
"the",
"given",
"one",
"and",
"returns",
"any",
"previous",
"value",
"stored",
"for",
"that",
"key",
"."
] | train | https://github.com/carrotsearch/hppc/blob/e359e9da358e846fcbffc64a765611df954ba3f6/hppc/src/main/templates/com/carrotsearch/hppc/KTypeHashSet.java#L659-L668 |
andygibson/datafactory | src/main/java/org/fluttercode/datafactory/impl/DataFactory.java | DataFactory.getDateBetween | public Date getDateBetween(final Date minDate, final Date maxDate) {
"""
Returns a random date between two dates. This method will alter the time component of the dates
@param minDate Minimum date that can be returned
@param maxDate Maximum date that can be returned
@return random date between these two dates... | java | public Date getDateBetween(final Date minDate, final Date maxDate) {
// this can break if seconds is an int
long seconds = (maxDate.getTime() - minDate.getTime()) / 1000;
seconds = (long) (random.nextDouble() * seconds);
Date result = new Date();
result.setTime(minDate.getTime() + (seconds * 10... | [
"public",
"Date",
"getDateBetween",
"(",
"final",
"Date",
"minDate",
",",
"final",
"Date",
"maxDate",
")",
"{",
"// this can break if seconds is an int\r",
"long",
"seconds",
"=",
"(",
"maxDate",
".",
"getTime",
"(",
")",
"-",
"minDate",
".",
"getTime",
"(",
"... | Returns a random date between two dates. This method will alter the time component of the dates
@param minDate Minimum date that can be returned
@param maxDate Maximum date that can be returned
@return random date between these two dates. | [
"Returns",
"a",
"random",
"date",
"between",
"two",
"dates",
".",
"This",
"method",
"will",
"alter",
"the",
"time",
"component",
"of",
"the",
"dates"
] | train | https://github.com/andygibson/datafactory/blob/f748beb93844dea2ad6174715be3b70df0448a9c/src/main/java/org/fluttercode/datafactory/impl/DataFactory.java#L374-L381 |
prestodb/presto | presto-spi/src/main/java/com/facebook/presto/spi/type/UnscaledDecimal128Arithmetic.java | UnscaledDecimal128Arithmetic.scaleDownFive | private static void scaleDownFive(Slice decimal, int fiveScale, Slice result) {
"""
Scale down the value for 5**fiveScale (result := decimal / 5**fiveScale).
"""
while (true) {
int powerFive = Math.min(fiveScale, MAX_POWER_OF_FIVE_INT);
fiveScale -= powerFive;
int d... | java | private static void scaleDownFive(Slice decimal, int fiveScale, Slice result)
{
while (true) {
int powerFive = Math.min(fiveScale, MAX_POWER_OF_FIVE_INT);
fiveScale -= powerFive;
int divisor = POWERS_OF_FIVES_INT[powerFive];
divide(decimal, divisor, result);
... | [
"private",
"static",
"void",
"scaleDownFive",
"(",
"Slice",
"decimal",
",",
"int",
"fiveScale",
",",
"Slice",
"result",
")",
"{",
"while",
"(",
"true",
")",
"{",
"int",
"powerFive",
"=",
"Math",
".",
"min",
"(",
"fiveScale",
",",
"MAX_POWER_OF_FIVE_INT",
"... | Scale down the value for 5**fiveScale (result := decimal / 5**fiveScale). | [
"Scale",
"down",
"the",
"value",
"for",
"5",
"**",
"fiveScale",
"(",
"result",
":",
"=",
"decimal",
"/",
"5",
"**",
"fiveScale",
")",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-spi/src/main/java/com/facebook/presto/spi/type/UnscaledDecimal128Arithmetic.java#L848-L862 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/json/ObjectToJsonConverter.java | ObjectToJsonConverter.setInnerValue | public Object setInnerValue(Object pOuterObject, Object pNewValue, List<String> pPathParts)
throws AttributeNotFoundException, IllegalAccessException, InvocationTargetException {
"""
Set an inner value of a complex object. A given path must point to the attribute/index to set within the outer object.
... | java | public Object setInnerValue(Object pOuterObject, Object pNewValue, List<String> pPathParts)
throws AttributeNotFoundException, IllegalAccessException, InvocationTargetException {
String lastPathElement = pPathParts.remove(pPathParts.size()-1);
Stack<String> extraStack = EscapeUtil.reversePat... | [
"public",
"Object",
"setInnerValue",
"(",
"Object",
"pOuterObject",
",",
"Object",
"pNewValue",
",",
"List",
"<",
"String",
">",
"pPathParts",
")",
"throws",
"AttributeNotFoundException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"String",
... | Set an inner value of a complex object. A given path must point to the attribute/index to set within the outer object.
@param pOuterObject the object to dive in
@param pNewValue the value to set
@param pPathParts the path within the outer object. This object will be modified and be a modifiable list.
@return the old ... | [
"Set",
"an",
"inner",
"value",
"of",
"a",
"complex",
"object",
".",
"A",
"given",
"path",
"must",
"point",
"to",
"the",
"attribute",
"/",
"index",
"to",
"set",
"within",
"the",
"outer",
"object",
"."
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/ObjectToJsonConverter.java#L127-L140 |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/Coordinate.java | Coordinate.equalsDelta | public boolean equalsDelta(Coordinate coordinate, double delta) {
"""
Comparison using a tolerance for the equality check.
@param coordinate
coordinate to compare with
@param delta
maximum deviation (along one axis, the actual maximum distance is sqrt(2*delta^2))
@return true
"""
return null != coordi... | java | public boolean equalsDelta(Coordinate coordinate, double delta) {
return null != coordinate &&
(Math.abs(this.x - coordinate.x) < delta && Math.abs(this.y - coordinate.y) < delta);
} | [
"public",
"boolean",
"equalsDelta",
"(",
"Coordinate",
"coordinate",
",",
"double",
"delta",
")",
"{",
"return",
"null",
"!=",
"coordinate",
"&&",
"(",
"Math",
".",
"abs",
"(",
"this",
".",
"x",
"-",
"coordinate",
".",
"x",
")",
"<",
"delta",
"&&",
"Ma... | Comparison using a tolerance for the equality check.
@param coordinate
coordinate to compare with
@param delta
maximum deviation (along one axis, the actual maximum distance is sqrt(2*delta^2))
@return true | [
"Comparison",
"using",
"a",
"tolerance",
"for",
"the",
"equality",
"check",
"."
] | train | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/Coordinate.java#L115-L118 |
NoraUi/NoraUi | src/main/java/com/github/noraui/cucumber/interceptor/ConditionedInterceptor.java | ConditionedInterceptor.displayMessageAtTheBeginningOfMethod | private void displayMessageAtTheBeginningOfMethod(String methodName, List<GherkinStepCondition> conditions) {
"""
Display a message at the beginning of method.
@param methodName
is the name of method for logs
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.... | java | private void displayMessageAtTheBeginningOfMethod(String methodName, List<GherkinStepCondition> conditions) {
logger.debug("{} with {} contition(s)", methodName, conditions.size());
displayConditionsAtTheBeginningOfMethod(conditions);
} | [
"private",
"void",
"displayMessageAtTheBeginningOfMethod",
"(",
"String",
"methodName",
",",
"List",
"<",
"GherkinStepCondition",
">",
"conditions",
")",
"{",
"logger",
".",
"debug",
"(",
"\"{} with {} contition(s)\"",
",",
"methodName",
",",
"conditions",
".",
"size"... | Display a message at the beginning of method.
@param methodName
is the name of method for logs
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}). | [
"Display",
"a",
"message",
"at",
"the",
"beginning",
"of",
"method",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/cucumber/interceptor/ConditionedInterceptor.java#L63-L66 |
raydac/java-comment-preprocessor | jcp/src/main/java/com/igormaznitsa/jcp/context/PreprocessorContext.java | PreprocessorContext.findVariableForName | @Nullable
public Value findVariableForName(@Nullable final String name, final boolean enforceUnknownVarAsNull) {
"""
Find value among local and global variables for a name. It finds in the order: special processors, local variables, global variables
@param name the name for the needed varia... | java | @Nullable
public Value findVariableForName(@Nullable final String name, final boolean enforceUnknownVarAsNull) {
if (name == null) {
return null;
}
final String normalized = assertNotNull(PreprocessorUtils.normalizeVariableName(name));
if (normalized.isEmpty()) {
return null;
}
... | [
"@",
"Nullable",
"public",
"Value",
"findVariableForName",
"(",
"@",
"Nullable",
"final",
"String",
"name",
",",
"final",
"boolean",
"enforceUnknownVarAsNull",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"String"... | Find value among local and global variables for a name. It finds in the order: special processors, local variables, global variables
@param name the name for the needed variable, it will be normalized to the supported format
@param enforceUnknownVarAsNull if true then state of the unknownVariableAsF... | [
"Find",
"value",
"among",
"local",
"and",
"global",
"variables",
"for",
"a",
"name",
".",
"It",
"finds",
"in",
"the",
"order",
":",
"special",
"processors",
"local",
"variables",
"global",
"variables"
] | train | https://github.com/raydac/java-comment-preprocessor/blob/83ac87b575ac084914d77695a8c8673de3b8300c/jcp/src/main/java/com/igormaznitsa/jcp/context/PreprocessorContext.java#L641-L672 |
simlife/simlife | simlife-framework/src/main/java/io/github/simlife/service/QueryService.java | QueryService.buildSpecification | protected <X> Specification<ENTITY> buildSpecification(Filter<X> filter, SingularAttribute<? super ENTITY, X>
field) {
"""
Helper function to return a specification for filtering on a single field, where equality, and null/non-null
conditions are supported.
@param filter the individual attribute filter... | java | protected <X> Specification<ENTITY> buildSpecification(Filter<X> filter, SingularAttribute<? super ENTITY, X>
field) {
if (filter.getEquals() != null) {
return equalsSpecification(field, filter.getEquals());
} else if (filter.getIn() != null) {
return valueIn(field, filte... | [
"protected",
"<",
"X",
">",
"Specification",
"<",
"ENTITY",
">",
"buildSpecification",
"(",
"Filter",
"<",
"X",
">",
"filter",
",",
"SingularAttribute",
"<",
"?",
"super",
"ENTITY",
",",
"X",
">",
"field",
")",
"{",
"if",
"(",
"filter",
".",
"getEquals",... | Helper function to return a specification for filtering on a single field, where equality, and null/non-null
conditions are supported.
@param filter the individual attribute filter coming from the frontend.
@param field the JPA static metamodel representing the field.
@param <X> The type of the attribute which is ... | [
"Helper",
"function",
"to",
"return",
"a",
"specification",
"for",
"filtering",
"on",
"a",
"single",
"field",
"where",
"equality",
"and",
"null",
"/",
"non",
"-",
"null",
"conditions",
"are",
"supported",
"."
] | train | https://github.com/simlife/simlife/blob/357bb8f3fb39e085239b89bc7f9a19248ff3d0bb/simlife-framework/src/main/java/io/github/simlife/service/QueryService.java#L51-L61 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileSystem.java | FileSystem.getFileBlockLocations | public BlockLocation[] getFileBlockLocations(FileStatus file,
long start, long len) throws IOException {
"""
Return an array containing hostnames, offset and size of
portions of the given file. For a nonexistent
file or regions, null will be returned.
This call is most helpful with DFS, where it retur... | java | public BlockLocation[] getFileBlockLocations(FileStatus file,
long start, long len) throws IOException {
if (file == null) {
return null;
}
if ( (start<0) || (len < 0) ) {
throw new IllegalArgumentException("Invalid start or len parameter");
}
if (file.getLen() < start) {
... | [
"public",
"BlockLocation",
"[",
"]",
"getFileBlockLocations",
"(",
"FileStatus",
"file",
",",
"long",
"start",
",",
"long",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"file",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"(",
... | Return an array containing hostnames, offset and size of
portions of the given file. For a nonexistent
file or regions, null will be returned.
This call is most helpful with DFS, where it returns
hostnames of machines that contain the given file.
The FileSystem will simply return an elt containing 'localhost'. | [
"Return",
"an",
"array",
"containing",
"hostnames",
"offset",
"and",
"size",
"of",
"portions",
"of",
"the",
"given",
"file",
".",
"For",
"a",
"nonexistent",
"file",
"or",
"regions",
"null",
"will",
"be",
"returned",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileSystem.java#L399-L416 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/Tr.java | Tr.formatMessage | public static final String formatMessage(TraceComponent tc, String msgKey, Object... objs) {
"""
Translate a message in the context of the input trace component using
the default locale. This method is typically used to provide translated
messages that might help resolve an exception that is surfaced to a user.
... | java | public static final String formatMessage(TraceComponent tc, String msgKey, Object... objs) {
return formatMessage(tc, Locale.getDefault(), msgKey, objs);
} | [
"public",
"static",
"final",
"String",
"formatMessage",
"(",
"TraceComponent",
"tc",
",",
"String",
"msgKey",
",",
"Object",
"...",
"objs",
")",
"{",
"return",
"formatMessage",
"(",
"tc",
",",
"Locale",
".",
"getDefault",
"(",
")",
",",
"msgKey",
",",
"obj... | Translate a message in the context of the input trace component using
the default locale. This method is typically used to provide translated
messages that might help resolve an exception that is surfaced to a user.
@param tc
the non-null <code>TraceComponent</code> of the message
@param msgKey
the message key identif... | [
"Translate",
"a",
"message",
"in",
"the",
"context",
"of",
"the",
"input",
"trace",
"component",
"using",
"the",
"default",
"locale",
".",
"This",
"method",
"is",
"typically",
"used",
"to",
"provide",
"translated",
"messages",
"that",
"might",
"help",
"resolve... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/Tr.java#L675-L677 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/ValueNumberFrameModelingVisitor.java | ValueNumberFrameModelingVisitor.storeInstanceField | private void storeInstanceField(XField instanceField, Instruction obj, boolean pushStoredValue) {
"""
Store an instance field.
@param instanceField
the field
@param obj
the instruction which stores the field
@param pushStoredValue
push the stored value onto the stack (because we are modeling
an inner-clas... | java | private void storeInstanceField(XField instanceField, Instruction obj, boolean pushStoredValue) {
if (RLE_DEBUG) {
System.out.println("[storeInstanceField for field " + instanceField + " in instruction " + handle);
}
ValueNumberFrame frame = getFrame();
int numWordsConsumed... | [
"private",
"void",
"storeInstanceField",
"(",
"XField",
"instanceField",
",",
"Instruction",
"obj",
",",
"boolean",
"pushStoredValue",
")",
"{",
"if",
"(",
"RLE_DEBUG",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"[storeInstanceField for field \"",
"+",... | Store an instance field.
@param instanceField
the field
@param obj
the instruction which stores the field
@param pushStoredValue
push the stored value onto the stack (because we are modeling
an inner-class field access method) | [
"Store",
"an",
"instance",
"field",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/ValueNumberFrameModelingVisitor.java#L780-L818 |
camunda/camunda-commons | logging/src/main/java/org/camunda/commons/logging/BaseLogger.java | BaseLogger.logInfo | protected void logInfo(String id, String messageTemplate, Object... parameters) {
"""
Logs an 'INFO' message
@param id the unique id of this log message
@param messageTemplate the message template to use
@param parameters a list of optional parameters
"""
if(delegateLogger.isInfoEnabled()) {
Str... | java | protected void logInfo(String id, String messageTemplate, Object... parameters) {
if(delegateLogger.isInfoEnabled()) {
String msg = formatMessageTemplate(id, messageTemplate);
delegateLogger.info(msg, parameters);
}
} | [
"protected",
"void",
"logInfo",
"(",
"String",
"id",
",",
"String",
"messageTemplate",
",",
"Object",
"...",
"parameters",
")",
"{",
"if",
"(",
"delegateLogger",
".",
"isInfoEnabled",
"(",
")",
")",
"{",
"String",
"msg",
"=",
"formatMessageTemplate",
"(",
"i... | Logs an 'INFO' message
@param id the unique id of this log message
@param messageTemplate the message template to use
@param parameters a list of optional parameters | [
"Logs",
"an",
"INFO",
"message"
] | train | https://github.com/camunda/camunda-commons/blob/bd3195db47c92c25717288fe9e6735f8e882f247/logging/src/main/java/org/camunda/commons/logging/BaseLogger.java#L129-L134 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.createPrebuiltEntityRoleWithServiceResponseAsync | public Observable<ServiceResponse<UUID>> createPrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, CreatePrebuiltEntityRoleOptionalParameter createPrebuiltEntityRoleOptionalParameter) {
"""
Create an entity role for an entity in the application.
@param appId The application I... | java | public Observable<ServiceResponse<UUID>> createPrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, CreatePrebuiltEntityRoleOptionalParameter createPrebuiltEntityRoleOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Para... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"UUID",
">",
">",
"createPrebuiltEntityRoleWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"CreatePrebuiltEntityRoleOptionalParameter",
"createPrebuiltEntityRoleOpt... | Create an entity role for an entity in the application.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity model ID.
@param createPrebuiltEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentExcept... | [
"Create",
"an",
"entity",
"role",
"for",
"an",
"entity",
"in",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L8080-L8096 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.truncateTableInMongo | @Given("^I drop every document at a MongoDB database '(.+?)' and table '(.+?)'")
public void truncateTableInMongo(String database, String table) {
"""
Truncate table in MongoDB.
@param database Mongo database
@param table Mongo table
"""
commonspec.getMongoDBClient().connectToMongoDBDataBase... | java | @Given("^I drop every document at a MongoDB database '(.+?)' and table '(.+?)'")
public void truncateTableInMongo(String database, String table) {
commonspec.getMongoDBClient().connectToMongoDBDataBase(database);
commonspec.getMongoDBClient().dropAllDataMongoDBCollection(table);
} | [
"@",
"Given",
"(",
"\"^I drop every document at a MongoDB database '(.+?)' and table '(.+?)'\"",
")",
"public",
"void",
"truncateTableInMongo",
"(",
"String",
"database",
",",
"String",
"table",
")",
"{",
"commonspec",
".",
"getMongoDBClient",
"(",
")",
".",
"connectToMon... | Truncate table in MongoDB.
@param database Mongo database
@param table Mongo table | [
"Truncate",
"table",
"in",
"MongoDB",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L325-L329 |
diffplug/JMatIO | src/main/java/ca/mjdsystems/jmatio/types/MLNumericArray.java | MLNumericArray.setImaginary | public void setImaginary(T value, int m, int n) {
"""
Sets single imaginary array element.
@param value - element value
@param m - row index
@param n - column index
"""
setImaginary( value, getIndex(m,n) );
} | java | public void setImaginary(T value, int m, int n)
{
setImaginary( value, getIndex(m,n) );
} | [
"public",
"void",
"setImaginary",
"(",
"T",
"value",
",",
"int",
"m",
",",
"int",
"n",
")",
"{",
"setImaginary",
"(",
"value",
",",
"getIndex",
"(",
"m",
",",
"n",
")",
")",
";",
"}"
] | Sets single imaginary array element.
@param value - element value
@param m - row index
@param n - column index | [
"Sets",
"single",
"imaginary",
"array",
"element",
"."
] | train | https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/types/MLNumericArray.java#L133-L136 |
jbossas/remoting-jmx | src/main/java/org/jboss/remotingjmx/protocol/v1/Common.java | Common.prepareForUnMarshalling | protected Unmarshaller prepareForUnMarshalling(final DataInput dataInput, final ClassResolver classResolver)
throws IOException {
"""
Creates and returns a {@link org.jboss.marshalling.Unmarshaller} which is ready to be used for unmarshalling. The
{@link org.jboss.marshalling.Unmarshaller#start(org.jb... | java | protected Unmarshaller prepareForUnMarshalling(final DataInput dataInput, final ClassResolver classResolver)
throws IOException {
final Unmarshaller unmarshaller = this.getUnMarshaller(marshallerFactory, classResolver);
final InputStream is = new InputStream() {
@Override
... | [
"protected",
"Unmarshaller",
"prepareForUnMarshalling",
"(",
"final",
"DataInput",
"dataInput",
",",
"final",
"ClassResolver",
"classResolver",
")",
"throws",
"IOException",
"{",
"final",
"Unmarshaller",
"unmarshaller",
"=",
"this",
".",
"getUnMarshaller",
"(",
"marshal... | Creates and returns a {@link org.jboss.marshalling.Unmarshaller} which is ready to be used for unmarshalling. The
{@link org.jboss.marshalling.Unmarshaller#start(org.jboss.marshalling.ByteInput)} will be invoked by this method, to use
the passed {@link java.io.DataInput dataInput}, before returning the unmarshaller.
@... | [
"Creates",
"and",
"returns",
"a",
"{",
"@link",
"org",
".",
"jboss",
".",
"marshalling",
".",
"Unmarshaller",
"}",
"which",
"is",
"ready",
"to",
"be",
"used",
"for",
"unmarshalling",
".",
"The",
"{",
"@link",
"org",
".",
"jboss",
".",
"marshalling",
".",... | train | https://github.com/jbossas/remoting-jmx/blob/dbc87bfed47e5bb9e37c355a77ca0ae9a6ea1363/src/main/java/org/jboss/remotingjmx/protocol/v1/Common.java#L130-L150 |
stevespringett/Alpine | alpine/src/main/java/alpine/persistence/AbstractAlpineQueryManager.java | AbstractAlpineQueryManager.getObjectByUuid | @SuppressWarnings("unchecked")
public <T> T getObjectByUuid(Class<T> clazz, UUID uuid, String fetchGroup) {
"""
Retrieves an object by its UUID.
@param <T> A type parameter. This type will be returned
@param clazz the persistence class to retrive the ID for
@param uuid the uuid of the object to retrieve
@p... | java | @SuppressWarnings("unchecked")
public <T> T getObjectByUuid(Class<T> clazz, UUID uuid, String fetchGroup) {
pm.getFetchPlan().addGroup(fetchGroup);
return getObjectByUuid(clazz, uuid);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"getObjectByUuid",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"UUID",
"uuid",
",",
"String",
"fetchGroup",
")",
"{",
"pm",
".",
"getFetchPlan",
"(",
")",
".",
"addGroup",
... | Retrieves an object by its UUID.
@param <T> A type parameter. This type will be returned
@param clazz the persistence class to retrive the ID for
@param uuid the uuid of the object to retrieve
@param fetchGroup the JDO fetchgroup to use when making the query
@return an object of the specified type
@since 1.0.0 | [
"Retrieves",
"an",
"object",
"by",
"its",
"UUID",
"."
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/persistence/AbstractAlpineQueryManager.java#L544-L548 |
cerner/beadledom | pagination/src/main/java/com/cerner/beadledom/pagination/OffsetPaginationLinks.java | OffsetPaginationLinks.lastLink | String lastLink() {
"""
Returns the last page link; null if no last page link is available.
"""
if (totalResults == null || currentLimit == 0L) {
return null;
}
Long lastOffset;
if (totalResults % currentLimit == 0L) {
lastOffset = totalResults - currentLimit;
} else {
//... | java | String lastLink() {
if (totalResults == null || currentLimit == 0L) {
return null;
}
Long lastOffset;
if (totalResults % currentLimit == 0L) {
lastOffset = totalResults - currentLimit;
} else {
// Truncation due to integral division gives floor-like behavior for free.
lastOf... | [
"String",
"lastLink",
"(",
")",
"{",
"if",
"(",
"totalResults",
"==",
"null",
"||",
"currentLimit",
"==",
"0L",
")",
"{",
"return",
"null",
";",
"}",
"Long",
"lastOffset",
";",
"if",
"(",
"totalResults",
"%",
"currentLimit",
"==",
"0L",
")",
"{",
"last... | Returns the last page link; null if no last page link is available. | [
"Returns",
"the",
"last",
"page",
"link",
";",
"null",
"if",
"no",
"last",
"page",
"link",
"is",
"available",
"."
] | train | https://github.com/cerner/beadledom/blob/75435bced5187d5455b46518fadf85c93cf32014/pagination/src/main/java/com/cerner/beadledom/pagination/OffsetPaginationLinks.java#L80-L94 |
aws/aws-sdk-java | aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/UnlinkIdentityRequest.java | UnlinkIdentityRequest.withLogins | public UnlinkIdentityRequest withLogins(java.util.Map<String, String> logins) {
"""
<p>
A set of optional name-value pairs that map provider names to provider tokens.
</p>
@param logins
A set of optional name-value pairs that map provider names to provider tokens.
@return Returns a reference to this object ... | java | public UnlinkIdentityRequest withLogins(java.util.Map<String, String> logins) {
setLogins(logins);
return this;
} | [
"public",
"UnlinkIdentityRequest",
"withLogins",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"logins",
")",
"{",
"setLogins",
"(",
"logins",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A set of optional name-value pairs that map provider names to provider tokens.
</p>
@param logins
A set of optional name-value pairs that map provider names to provider tokens.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"A",
"set",
"of",
"optional",
"name",
"-",
"value",
"pairs",
"that",
"map",
"provider",
"names",
"to",
"provider",
"tokens",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/UnlinkIdentityRequest.java#L125-L128 |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/AbstractHttpLogicHandler.java | AbstractHttpLogicHandler.decodeResponse | protected HttpProxyResponse decodeResponse(final String response)
throws Exception {
"""
Parse a HTTP response from the proxy server.
@param response The response string.
"""
LOGGER.debug(" parseResponse()");
// Break response into lines
String[] responseLines = respons... | java | protected HttpProxyResponse decodeResponse(final String response)
throws Exception {
LOGGER.debug(" parseResponse()");
// Break response into lines
String[] responseLines = response.split(HttpProxyConstants.CRLF);
// Status-Line = HTTP-Version SP Status-Code SP Reason-Phra... | [
"protected",
"HttpProxyResponse",
"decodeResponse",
"(",
"final",
"String",
"response",
")",
"throws",
"Exception",
"{",
"LOGGER",
".",
"debug",
"(",
"\" parseResponse()\"",
")",
";",
"// Break response into lines",
"String",
"[",
"]",
"responseLines",
"=",
"response... | Parse a HTTP response from the proxy server.
@param response The response string. | [
"Parse",
"a",
"HTTP",
"response",
"from",
"the",
"proxy",
"server",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/AbstractHttpLogicHandler.java#L386-L417 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/storefront/ProductUrl.java | ProductUrl.validateDiscountsUrl | public static MozuUrl validateDiscountsUrl(Boolean allowInactive, Integer customerAccountId, String productCode, String responseFields, Boolean skipInventoryCheck, String variationProductCode) {
"""
Get Resource Url for ValidateDiscounts
@param allowInactive If true, allow inactive categories to be retrieved in t... | java | public static MozuUrl validateDiscountsUrl(Boolean allowInactive, Integer customerAccountId, String productCode, String responseFields, Boolean skipInventoryCheck, String variationProductCode)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/storefront/products/{productCode}/validateDiscounts?var... | [
"public",
"static",
"MozuUrl",
"validateDiscountsUrl",
"(",
"Boolean",
"allowInactive",
",",
"Integer",
"customerAccountId",
",",
"String",
"productCode",
",",
"String",
"responseFields",
",",
"Boolean",
"skipInventoryCheck",
",",
"String",
"variationProductCode",
")",
... | Get Resource Url for ValidateDiscounts
@param allowInactive If true, allow inactive categories to be retrieved in the category list response. If false, the categories retrieved will not include ones marked inactive.
@param customerAccountId The unique identifier of the customer account for which to retrieve wish lists.... | [
"Get",
"Resource",
"Url",
"for",
"ValidateDiscounts"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/storefront/ProductUrl.java#L162-L172 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/FactionWarfareApi.java | FactionWarfareApi.getFwLeaderboardsCharacters | public FactionWarfareLeaderboardCharactersResponse getFwLeaderboardsCharacters(String datasource, String ifNoneMatch)
throws ApiException {
"""
List of the top pilots in faction warfare Top 100 leaderboard of pilots
for kills and victory points separated by total, last week and yesterday
--- This rou... | java | public FactionWarfareLeaderboardCharactersResponse getFwLeaderboardsCharacters(String datasource, String ifNoneMatch)
throws ApiException {
ApiResponse<FactionWarfareLeaderboardCharactersResponse> resp = getFwLeaderboardsCharactersWithHttpInfo(
datasource, ifNoneMatch);
retur... | [
"public",
"FactionWarfareLeaderboardCharactersResponse",
"getFwLeaderboardsCharacters",
"(",
"String",
"datasource",
",",
"String",
"ifNoneMatch",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"FactionWarfareLeaderboardCharactersResponse",
">",
"resp",
"=",
"getFwLead... | List of the top pilots in faction warfare Top 100 leaderboard of pilots
for kills and victory points separated by total, last week and yesterday
--- This route expires daily at 11:05
@param datasource
The server name you would like data from (optional, default to
tranquility)
@param ifNoneMatch
ETag from a previous re... | [
"List",
"of",
"the",
"top",
"pilots",
"in",
"faction",
"warfare",
"Top",
"100",
"leaderboard",
"of",
"pilots",
"for",
"kills",
"and",
"victory",
"points",
"separated",
"by",
"total",
"last",
"week",
"and",
"yesterday",
"---",
"This",
"route",
"expires",
"dai... | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/FactionWarfareApi.java#L602-L607 |
Netflix/Turbine | turbine-core/src/main/java/com/netflix/turbine/aggregator/NumberList.java | NumberList.delta | public static NumberList delta(Map<String, Object> currentMap, Map<String, Object> previousMap) {
"""
This assumes both maps contain the same keys. If they don't then keys will be lost.
@param currentMap
@param previousMap
@return
"""
LinkedHashMap<String, Long> values = new LinkedHashMap<String, ... | java | public static NumberList delta(Map<String, Object> currentMap, Map<String, Object> previousMap) {
LinkedHashMap<String, Long> values = new LinkedHashMap<String, Long>(currentMap.size());
if(currentMap.size() != previousMap.size()) {
throw new IllegalArgumentException("Maps must have the same... | [
"public",
"static",
"NumberList",
"delta",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"currentMap",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"previousMap",
")",
"{",
"LinkedHashMap",
"<",
"String",
",",
"Long",
">",
"values",
"=",
"new",
"Linke... | This assumes both maps contain the same keys. If they don't then keys will be lost.
@param currentMap
@param previousMap
@return | [
"This",
"assumes",
"both",
"maps",
"contain",
"the",
"same",
"keys",
".",
"If",
"they",
"don",
"t",
"then",
"keys",
"will",
"be",
"lost",
"."
] | train | https://github.com/Netflix/Turbine/blob/0e924058aa4d1d526310206a51dcf82f65274d58/turbine-core/src/main/java/com/netflix/turbine/aggregator/NumberList.java#L65-L86 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java | ProxyDataSourceBuilder.autoRetrieveGeneratedKeys | public ProxyDataSourceBuilder autoRetrieveGeneratedKeys(boolean autoClose, ResultSetProxyLogicFactory factory) {
"""
Enable auto retrieval of generated keys with proxy created by specified factory.
See detail on {@link #autoRetrieveGeneratedKeys(boolean)}.
@param autoClose set {@code true} to close the gener... | java | public ProxyDataSourceBuilder autoRetrieveGeneratedKeys(boolean autoClose, ResultSetProxyLogicFactory factory) {
this.autoRetrieveGeneratedKeys = true;
this.autoCloseGeneratedKeys = autoClose;
this.generatedKeysProxyLogicFactory = factory;
return this;
} | [
"public",
"ProxyDataSourceBuilder",
"autoRetrieveGeneratedKeys",
"(",
"boolean",
"autoClose",
",",
"ResultSetProxyLogicFactory",
"factory",
")",
"{",
"this",
".",
"autoRetrieveGeneratedKeys",
"=",
"true",
";",
"this",
".",
"autoCloseGeneratedKeys",
"=",
"autoClose",
";",
... | Enable auto retrieval of generated keys with proxy created by specified factory.
See detail on {@link #autoRetrieveGeneratedKeys(boolean)}.
@param autoClose set {@code true} to close the generated-keys {@link java.sql.ResultSet} after query listener execution
@param factory a factory to create a generated-keys prox... | [
"Enable",
"auto",
"retrieval",
"of",
"generated",
"keys",
"with",
"proxy",
"created",
"by",
"specified",
"factory",
"."
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java#L769-L774 |
sagiegurari/fax4j | src/main/java/org/fax4j/common/LoggerManager.java | LoggerManager.createLogger | private void createLogger(Map<String,String> systemConfiguration) {
"""
This function creates the logger used by the fax4j framework.<br>
The logger must extend org.fax4j.util.Logger and it's class name is defined
by the org.fax4j.logger.class.name property in the fax4j configuration.<br>
The org.fax4j.logger.l... | java | private void createLogger(Map<String,String> systemConfiguration)
{
//get class name
String className=systemConfiguration.get(LoggerManager.LOGGER_CLASS_NAME_PROPERTY_KEY);
if((className==null)||(className.length()==0))
{
className=SimpleLogger.class.getName();
}
... | [
"private",
"void",
"createLogger",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"systemConfiguration",
")",
"{",
"//get class name",
"String",
"className",
"=",
"systemConfiguration",
".",
"get",
"(",
"LoggerManager",
".",
"LOGGER_CLASS_NAME_PROPERTY_KEY",
")",
";... | This function creates the logger used by the fax4j framework.<br>
The logger must extend org.fax4j.util.Logger and it's class name is defined
by the org.fax4j.logger.class.name property in the fax4j configuration.<br>
The org.fax4j.logger.log.level property is used to set the intial log level of
the logger.
@param s... | [
"This",
"function",
"creates",
"the",
"logger",
"used",
"by",
"the",
"fax4j",
"framework",
".",
"<br",
">",
"The",
"logger",
"must",
"extend",
"org",
".",
"fax4j",
".",
"util",
".",
"Logger",
"and",
"it",
"s",
"class",
"name",
"is",
"defined",
"by",
"t... | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/common/LoggerManager.java#L78-L115 |
offbynull/coroutines | instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java | SearchUtils.findField | public static FieldNode findField(ClassNode classNode, String name) {
"""
Find field within a class by its name.
@param classNode class to search
@param name name to search for
@return found field (or {@code null} if not found)
@throws NullPointerException if any argument is {@code null}
@throws IllegalArgume... | java | public static FieldNode findField(ClassNode classNode, String name) {
Validate.notNull(classNode);
Validate.notNull(name);
Validate.notEmpty(name);
return classNode.fields.stream()
.filter(x -> name.equals(x.name))
.findAny().orElse(null);
} | [
"public",
"static",
"FieldNode",
"findField",
"(",
"ClassNode",
"classNode",
",",
"String",
"name",
")",
"{",
"Validate",
".",
"notNull",
"(",
"classNode",
")",
";",
"Validate",
".",
"notNull",
"(",
"name",
")",
";",
"Validate",
".",
"notEmpty",
"(",
"name... | Find field within a class by its name.
@param classNode class to search
@param name name to search for
@return found field (or {@code null} if not found)
@throws NullPointerException if any argument is {@code null}
@throws IllegalArgumentException if {@code name} is empty | [
"Find",
"field",
"within",
"a",
"class",
"by",
"its",
"name",
"."
] | train | https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java#L540-L547 |
gosu-lang/gosu-lang | gosu-core/src/main/java/gw/internal/gosu/ir/transform/statement/ForEachStatementTransformer.java | ForEachStatementTransformer.makeLoop | public static IRForEachStatement makeLoop( TopLevelTransformationContext cc, IRExpression rootExpression, IType type,
Symbol identifier, Symbol indexSymbol ) {
"""
Helper for creating iterative loops. Note that after calling this method, you should compile and call
gw... | java | public static IRForEachStatement makeLoop( TopLevelTransformationContext cc, IRExpression rootExpression, IType type,
Symbol identifier, Symbol indexSymbol )
{
return new ForEachStatementTransformer( cc, null )
.makeLoopImpl( cc, rootExpression, type, identifier,... | [
"public",
"static",
"IRForEachStatement",
"makeLoop",
"(",
"TopLevelTransformationContext",
"cc",
",",
"IRExpression",
"rootExpression",
",",
"IType",
"type",
",",
"Symbol",
"identifier",
",",
"Symbol",
"indexSymbol",
")",
"{",
"return",
"new",
"ForEachStatementTransfor... | Helper for creating iterative loops. Note that after calling this method, you should compile and call
gw.internal.gosu.ir.nodes.statement.IRForEachStatement#setBody(gw.internal.gosu.ir.nodes.IRStatement) on the
IRForEachStatement. Since the body often depends on symbols introduced in the loop, you must usually compil... | [
"Helper",
"for",
"creating",
"iterative",
"loops",
".",
"Note",
"that",
"after",
"calling",
"this",
"method",
"you",
"should",
"compile",
"and",
"call",
"gw",
".",
"internal",
".",
"gosu",
".",
"ir",
".",
"nodes",
".",
"statement",
".",
"IRForEachStatement#s... | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core/src/main/java/gw/internal/gosu/ir/transform/statement/ForEachStatementTransformer.java#L75-L80 |
meertensinstituut/mtas | src/main/java/mtas/codec/util/CodecInfo.java | CodecInfo.getPrefixFilteredObjectsByPositions | public List<MtasTokenString> getPrefixFilteredObjectsByPositions(String field,
int docId, List<String> prefixes, int startPosition, int endPosition)
throws IOException {
"""
Gets the prefix filtered objects by positions.
@param field
the field
@param docId
the doc id
@param prefixes
the prefixe... | java | public List<MtasTokenString> getPrefixFilteredObjectsByPositions(String field,
int docId, List<String> prefixes, int startPosition, int endPosition)
throws IOException {
IndexDoc doc = getDoc(field, docId);
IndexInput inIndexObjectPosition = indexInputList
.get("indexObjectPosition");
if... | [
"public",
"List",
"<",
"MtasTokenString",
">",
"getPrefixFilteredObjectsByPositions",
"(",
"String",
"field",
",",
"int",
"docId",
",",
"List",
"<",
"String",
">",
"prefixes",
",",
"int",
"startPosition",
",",
"int",
"endPosition",
")",
"throws",
"IOException",
... | Gets the prefix filtered objects by positions.
@param field
the field
@param docId
the doc id
@param prefixes
the prefixes
@param startPosition
the start position
@param endPosition
the end position
@return the prefix filtered objects by positions
@throws IOException
Signals that an I/O exception has occurred. | [
"Gets",
"the",
"prefix",
"filtered",
"objects",
"by",
"positions",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/util/CodecInfo.java#L260-L274 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/AsyncTableEntryReader.java | AsyncTableEntryReader.readEntry | static AsyncTableEntryReader<TableEntry> readEntry(ArrayView soughtKey, long keyVersion, EntrySerializer serializer, TimeoutTimer timer) {
"""
Creates a new {@link AsyncTableEntryReader} that can be used to read a {@link TableEntry} with a an optional
matching key.
@param soughtKey (Optional) An {@link ArrayV... | java | static AsyncTableEntryReader<TableEntry> readEntry(ArrayView soughtKey, long keyVersion, EntrySerializer serializer, TimeoutTimer timer) {
return new EntryReader(soughtKey, keyVersion, serializer, timer);
} | [
"static",
"AsyncTableEntryReader",
"<",
"TableEntry",
">",
"readEntry",
"(",
"ArrayView",
"soughtKey",
",",
"long",
"keyVersion",
",",
"EntrySerializer",
"serializer",
",",
"TimeoutTimer",
"timer",
")",
"{",
"return",
"new",
"EntryReader",
"(",
"soughtKey",
",",
"... | Creates a new {@link AsyncTableEntryReader} that can be used to read a {@link TableEntry} with a an optional
matching key.
@param soughtKey (Optional) An {@link ArrayView} representing the Key to match. If provided, a {@link TableEntry}
will only be returned if its {@link TableEntry#getKey()} matches this value.
@par... | [
"Creates",
"a",
"new",
"{",
"@link",
"AsyncTableEntryReader",
"}",
"that",
"can",
"be",
"used",
"to",
"read",
"a",
"{",
"@link",
"TableEntry",
"}",
"with",
"a",
"an",
"optional",
"matching",
"key",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/AsyncTableEntryReader.java#L91-L93 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java | XMLUtil.getNodeFromPath | @Pure
public static Node getNodeFromPath(Node document, boolean caseSensitive, String... path) {
"""
Replies the node that corresponds to the specified path.
<p>The path is an ordered list of tag's names and ended by the name of
the desired node.
@param document is the XML document to explore.
@param case... | java | @Pure
public static Node getNodeFromPath(Node document, boolean caseSensitive, String... path) {
assert document != null : AssertMessages.notNullParameter(0);
return getNodeFromPath(document, caseSensitive, 0, path);
} | [
"@",
"Pure",
"public",
"static",
"Node",
"getNodeFromPath",
"(",
"Node",
"document",
",",
"boolean",
"caseSensitive",
",",
"String",
"...",
"path",
")",
"{",
"assert",
"document",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
"(",
"0",
")",
"... | Replies the node that corresponds to the specified path.
<p>The path is an ordered list of tag's names and ended by the name of
the desired node.
@param document is the XML document to explore.
@param caseSensitive indicates of the {@code path}'s components are case sensitive.
@param path is the list of names.
@retur... | [
"Replies",
"the",
"node",
"that",
"corresponds",
"to",
"the",
"specified",
"path",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L1568-L1572 |
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-kms/src/main/java/com/ibm/cloud/objectstorage/services/kms/model/GenerateDataKeyRequest.java | GenerateDataKeyRequest.withEncryptionContext | public GenerateDataKeyRequest withEncryptionContext(java.util.Map<String, String> encryptionContext) {
"""
<p>
A set of key-value pairs that represents additional authenticated data.
</p>
<p>
For more information, see <a
href="http://docs.aws.amazon.com/kms/latest/developerguide/encryption-context.html">Encry... | java | public GenerateDataKeyRequest withEncryptionContext(java.util.Map<String, String> encryptionContext) {
setEncryptionContext(encryptionContext);
return this;
} | [
"public",
"GenerateDataKeyRequest",
"withEncryptionContext",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"encryptionContext",
")",
"{",
"setEncryptionContext",
"(",
"encryptionContext",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A set of key-value pairs that represents additional authenticated data.
</p>
<p>
For more information, see <a
href="http://docs.aws.amazon.com/kms/latest/developerguide/encryption-context.html">Encryption Context</a> in the
<i>AWS Key Management Service Developer Guide</i>.
</p>
@param encryptionContext
A set of k... | [
"<p",
">",
"A",
"set",
"of",
"key",
"-",
"value",
"pairs",
"that",
"represents",
"additional",
"authenticated",
"data",
".",
"<",
"/",
"p",
">",
"<p",
">",
"For",
"more",
"information",
"see",
"<a",
"href",
"=",
"http",
":",
"//",
"docs",
".",
"aws",... | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-kms/src/main/java/com/ibm/cloud/objectstorage/services/kms/model/GenerateDataKeyRequest.java#L356-L359 |
paypal/SeLion | dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ReflectionUtils.java | ReflectionUtils.instantiateDefaultCustomTypeArray | public static Object instantiateDefaultCustomTypeArray(DefaultCustomType type, String[] values) {
"""
This helper method facilitates creation of {@link DefaultCustomTypeTest} arrays and pre-populates them with the
set of String values provided.
@param type
A {@link DefaultCustomType} object that represents th... | java | public static Object instantiateDefaultCustomTypeArray(DefaultCustomType type, String[] values) {
logger.entering(new Object[] { type, values });
checkArgument(type != null, "type cannot be null.");
checkArgument((values != null && values.length != 0), "The values cannot be null (or) empty.");... | [
"public",
"static",
"Object",
"instantiateDefaultCustomTypeArray",
"(",
"DefaultCustomType",
"type",
",",
"String",
"[",
"]",
"values",
")",
"{",
"logger",
".",
"entering",
"(",
"new",
"Object",
"[",
"]",
"{",
"type",
",",
"values",
"}",
")",
";",
"checkArgu... | This helper method facilitates creation of {@link DefaultCustomTypeTest} arrays and pre-populates them with the
set of String values provided.
@param type
A {@link DefaultCustomType} object that represents the type of the array to be instantiated.
@param values
A {@link String} array that represents the set of values ... | [
"This",
"helper",
"method",
"facilitates",
"creation",
"of",
"{",
"@link",
"DefaultCustomTypeTest",
"}",
"arrays",
"and",
"pre",
"-",
"populates",
"them",
"with",
"the",
"set",
"of",
"String",
"values",
"provided",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ReflectionUtils.java#L134-L146 |
haifengl/smile | core/src/main/java/smile/validation/Validation.java | Validation.loocv | public static <T> double loocv(RegressionTrainer<T> trainer, T[] x, double[] y) {
"""
Leave-one-out cross validation of a regression model.
@param <T> the data type of input objects.
@param trainer a regression model trainer that is properly parameterized.
@param x the test data set.
@param y the test data r... | java | public static <T> double loocv(RegressionTrainer<T> trainer, T[] x, double[] y) {
double rmse = 0.0;
int n = x.length;
LOOCV loocv = new LOOCV(n);
for (int i = 0; i < n; i++) {
T[] trainx = Math.slice(x, loocv.train[i]);
double[] trainy = Math.slice(y, loo... | [
"public",
"static",
"<",
"T",
">",
"double",
"loocv",
"(",
"RegressionTrainer",
"<",
"T",
">",
"trainer",
",",
"T",
"[",
"]",
"x",
",",
"double",
"[",
"]",
"y",
")",
"{",
"double",
"rmse",
"=",
"0.0",
";",
"int",
"n",
"=",
"x",
".",
"length",
"... | Leave-one-out cross validation of a regression model.
@param <T> the data type of input objects.
@param trainer a regression model trainer that is properly parameterized.
@param x the test data set.
@param y the test data response values.
@return root mean squared error | [
"Leave",
"-",
"one",
"-",
"out",
"cross",
"validation",
"of",
"a",
"regression",
"model",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/validation/Validation.java#L197-L211 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/AppEventsLogger.java | AppEventsLogger.newLogger | public static AppEventsLogger newLogger(Context context, Session session) {
"""
Build an AppEventsLogger instance to log events through.
@param context Used to access the attributionId for non-authenticated users.
@param session Explicitly specified Session to log events against. If null, the activeSession
w... | java | public static AppEventsLogger newLogger(Context context, Session session) {
return new AppEventsLogger(context, null, session);
} | [
"public",
"static",
"AppEventsLogger",
"newLogger",
"(",
"Context",
"context",
",",
"Session",
"session",
")",
"{",
"return",
"new",
"AppEventsLogger",
"(",
"context",
",",
"null",
",",
"session",
")",
";",
"}"
] | Build an AppEventsLogger instance to log events through.
@param context Used to access the attributionId for non-authenticated users.
@param session Explicitly specified Session to log events against. If null, the activeSession
will be used if it's open, otherwise the logging will happen against the default
app ID sp... | [
"Build",
"an",
"AppEventsLogger",
"instance",
"to",
"log",
"events",
"through",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/AppEventsLogger.java#L356-L358 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/transferlearning/TransferLearningHelper.java | TransferLearningHelper.featurize | public MultiDataSet featurize(MultiDataSet input) {
"""
During training frozen vertices/layers can be treated as "featurizing" the input
The forward pass through these frozen layer/vertices can be done in advance and the dataset saved to disk to iterate
quickly on the smaller unfrozen part of the model
Currentl... | java | public MultiDataSet featurize(MultiDataSet input) {
if (!isGraph) {
throw new IllegalArgumentException("Cannot use multidatasets with MultiLayerNetworks.");
}
INDArray[] labels = input.getLabels();
INDArray[] features = input.getFeatures();
if (input.getFeaturesMaskAr... | [
"public",
"MultiDataSet",
"featurize",
"(",
"MultiDataSet",
"input",
")",
"{",
"if",
"(",
"!",
"isGraph",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot use multidatasets with MultiLayerNetworks.\"",
")",
";",
"}",
"INDArray",
"[",
"]",
"labels... | During training frozen vertices/layers can be treated as "featurizing" the input
The forward pass through these frozen layer/vertices can be done in advance and the dataset saved to disk to iterate
quickly on the smaller unfrozen part of the model
Currently does not support datasets with feature masks
@param input mul... | [
"During",
"training",
"frozen",
"vertices",
"/",
"layers",
"can",
"be",
"treated",
"as",
"featurizing",
"the",
"input",
"The",
"forward",
"pass",
"through",
"these",
"frozen",
"layer",
"/",
"vertices",
"can",
"be",
"done",
"in",
"advance",
"and",
"the",
"dat... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/transferlearning/TransferLearningHelper.java#L322-L349 |
google/closure-templates | java/src/com/google/template/soy/types/SoyTypeRegistry.java | SoyTypeRegistry.getType | @Nullable
public SoyType getType(String typeName) {
"""
Look up a type by name. Returns null if there is no such type.
@param typeName The fully-qualified name of the type.
@return The type object, or {@code null}.
"""
SoyType result = BUILTIN_TYPES.get(typeName);
if (result != null) {
retu... | java | @Nullable
public SoyType getType(String typeName) {
SoyType result = BUILTIN_TYPES.get(typeName);
if (result != null) {
return result;
}
synchronized (lock) {
result = protoTypeCache.get(typeName);
if (result == null) {
GenericDescriptor descriptor = descriptors.get(typeName)... | [
"@",
"Nullable",
"public",
"SoyType",
"getType",
"(",
"String",
"typeName",
")",
"{",
"SoyType",
"result",
"=",
"BUILTIN_TYPES",
".",
"get",
"(",
"typeName",
")",
";",
"if",
"(",
"result",
"!=",
"null",
")",
"{",
"return",
"result",
";",
"}",
"synchroniz... | Look up a type by name. Returns null if there is no such type.
@param typeName The fully-qualified name of the type.
@return The type object, or {@code null}. | [
"Look",
"up",
"a",
"type",
"by",
"name",
".",
"Returns",
"null",
"if",
"there",
"is",
"no",
"such",
"type",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/types/SoyTypeRegistry.java#L176-L198 |
fcrepo3/fcrepo | fcrepo-client/fcrepo-client-admin/src/main/java/org/fcrepo/client/objecteditor/ContentHandlerFactory.java | ContentHandlerFactory.getViewer | public static ContentViewer getViewer(String type, InputStream data)
throws IOException {
"""
Get a viewer for the given type, initialized with the given data. This
should only be called if the caller knows there is a viewer for the type.
"""
ContentViewer viewer = (ContentViewer) s_viewer... | java | public static ContentViewer getViewer(String type, InputStream data)
throws IOException {
ContentViewer viewer = (ContentViewer) s_viewers.get(type);
if (viewer == null && type.endsWith("+xml")) {
viewer = (ContentViewer) s_viewers.get("text/xml");
}
return viewer... | [
"public",
"static",
"ContentViewer",
"getViewer",
"(",
"String",
"type",
",",
"InputStream",
"data",
")",
"throws",
"IOException",
"{",
"ContentViewer",
"viewer",
"=",
"(",
"ContentViewer",
")",
"s_viewers",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"vie... | Get a viewer for the given type, initialized with the given data. This
should only be called if the caller knows there is a viewer for the type. | [
"Get",
"a",
"viewer",
"for",
"the",
"given",
"type",
"initialized",
"with",
"the",
"given",
"data",
".",
"This",
"should",
"only",
"be",
"called",
"if",
"the",
"caller",
"knows",
"there",
"is",
"a",
"viewer",
"for",
"the",
"type",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-client/fcrepo-client-admin/src/main/java/org/fcrepo/client/objecteditor/ContentHandlerFactory.java#L78-L85 |
spring-projects/spring-android | spring-android-core/src/main/java/org/springframework/util/NumberUtils.java | NumberUtils.decodeBigInteger | private static BigInteger decodeBigInteger(String value) {
"""
Decode a {@link java.math.BigInteger} from a {@link String} value.
Supports decimal, hex and octal notation.
@see BigInteger#BigInteger(String, int)
"""
int radix = 10;
int index = 0;
boolean negative = false;
// Handle minus sign, if pr... | java | private static BigInteger decodeBigInteger(String value) {
int radix = 10;
int index = 0;
boolean negative = false;
// Handle minus sign, if present.
if (value.startsWith("-")) {
negative = true;
index++;
}
// Handle radix specifier, if present.
if (value.startsWith("0x", index) || value.startsW... | [
"private",
"static",
"BigInteger",
"decodeBigInteger",
"(",
"String",
"value",
")",
"{",
"int",
"radix",
"=",
"10",
";",
"int",
"index",
"=",
"0",
";",
"boolean",
"negative",
"=",
"false",
";",
"// Handle minus sign, if present.",
"if",
"(",
"value",
".",
"s... | Decode a {@link java.math.BigInteger} from a {@link String} value.
Supports decimal, hex and octal notation.
@see BigInteger#BigInteger(String, int) | [
"Decode",
"a",
"{"
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/util/NumberUtils.java#L238-L265 |
carewebframework/carewebframework-core | org.carewebframework.messaging-parent/org.carewebframework.messaging.amqp-parent/org.carewebframework.messaging.amqp.rabbitmq/src/main/java/org/carewebframework/messaging/amqp/rabbitmq/Broker.java | Broker.createChannel | private synchronized void createChannel(String channel) {
"""
Creates an event queue (thread safe) with the correct binding.
@param channel Name of event handled by queue.
"""
if (!channelExists(channel)) {
Queue queue = new Queue(channel, true, false, true);
admin.declareQue... | java | private synchronized void createChannel(String channel) {
if (!channelExists(channel)) {
Queue queue = new Queue(channel, true, false, true);
admin.declareQueue(queue);
Binding binding = new Binding(channel, DestinationType.QUEUE, exchange.getName(), channel + ".#", null);
... | [
"private",
"synchronized",
"void",
"createChannel",
"(",
"String",
"channel",
")",
"{",
"if",
"(",
"!",
"channelExists",
"(",
"channel",
")",
")",
"{",
"Queue",
"queue",
"=",
"new",
"Queue",
"(",
"channel",
",",
"true",
",",
"false",
",",
"true",
")",
... | Creates an event queue (thread safe) with the correct binding.
@param channel Name of event handled by queue. | [
"Creates",
"an",
"event",
"queue",
"(",
"thread",
"safe",
")",
"with",
"the",
"correct",
"binding",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.messaging-parent/org.carewebframework.messaging.amqp-parent/org.carewebframework.messaging.amqp.rabbitmq/src/main/java/org/carewebframework/messaging/amqp/rabbitmq/Broker.java#L89-L96 |
TheHolyWaffle/League-of-Legends-XMPP-Chat-Library | src/main/java/com/github/theholywaffle/lolchatapi/LolStatus.java | LolStatus.getInt | private int getInt(XMLProperty p, int defaultValue) {
"""
If the value exists it returns its value else the default value
@param p the {@link XMLProperty}
@param defaultValue the fallback value
@return returns the value of the given {@link XMLProperty}
"""
final String value = get(p);
if (value.isEmpt... | java | private int getInt(XMLProperty p, int defaultValue) {
final String value = get(p);
if (value.isEmpty()) {
return defaultValue;
}
return Integer.parseInt(value);
} | [
"private",
"int",
"getInt",
"(",
"XMLProperty",
"p",
",",
"int",
"defaultValue",
")",
"{",
"final",
"String",
"value",
"=",
"get",
"(",
"p",
")",
";",
"if",
"(",
"value",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"defaultValue",
";",
"}",
"return... | If the value exists it returns its value else the default value
@param p the {@link XMLProperty}
@param defaultValue the fallback value
@return returns the value of the given {@link XMLProperty} | [
"If",
"the",
"value",
"exists",
"it",
"returns",
"its",
"value",
"else",
"the",
"default",
"value"
] | train | https://github.com/TheHolyWaffle/League-of-Legends-XMPP-Chat-Library/blob/5e4d87d0c054ff2f6510545b0e9f838338695c70/src/main/java/com/github/theholywaffle/lolchatapi/LolStatus.java#L264-L270 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/naming/FormDataNameInterceptor.java | FormDataNameInterceptor.rewriteName | public String rewriteName(String name, Tag currentTag)
throws ExpressionEvaluationException {
"""
Qualify the name of a NetUI JSP tag into the "actionForm" data binding context.
This feature is used to convert non-expression tag names, as those used in Struts,
into actionForm expressions that NetUI c... | java | public String rewriteName(String name, Tag currentTag)
throws ExpressionEvaluationException
{
ExpressionEvaluator eval = ExpressionEvaluatorFactory.getInstance();
try {
if (!eval.isExpression(name))
return eval.qualify("actionForm", name);
return ... | [
"public",
"String",
"rewriteName",
"(",
"String",
"name",
",",
"Tag",
"currentTag",
")",
"throws",
"ExpressionEvaluationException",
"{",
"ExpressionEvaluator",
"eval",
"=",
"ExpressionEvaluatorFactory",
".",
"getInstance",
"(",
")",
";",
"try",
"{",
"if",
"(",
"!"... | Qualify the name of a NetUI JSP tag into the "actionForm" data binding context.
This feature is used to convert non-expression tag names, as those used in Struts,
into actionForm expressions that NetUI consumes.
@param name the name to qualify into the actionForm binding context. If this is "foo", the returned value
i... | [
"Qualify",
"the",
"name",
"of",
"a",
"NetUI",
"JSP",
"tag",
"into",
"the",
"actionForm",
"data",
"binding",
"context",
".",
"This",
"feature",
"is",
"used",
"to",
"convert",
"non",
"-",
"expression",
"tag",
"names",
"as",
"those",
"used",
"in",
"Struts",
... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/naming/FormDataNameInterceptor.java#L56-L74 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/publickey/PublicKeySubsystem.java | PublicKeySubsystem.readStatusResponse | void readStatusResponse() throws SshException, PublicKeySubsystemException {
"""
Read a status response and throw an exception if an error has occurred.
@throws SshException
@throws PublicKeyStatusException
"""
ByteArrayReader msg = new ByteArrayReader(nextMessage());
try {
msg.readString();
i... | java | void readStatusResponse() throws SshException, PublicKeySubsystemException {
ByteArrayReader msg = new ByteArrayReader(nextMessage());
try {
msg.readString();
int status = (int) msg.readInt();
String desc = msg.readString();
if (status != PublicKeySubsystemException.SUCCESS) {
throw new PublicKe... | [
"void",
"readStatusResponse",
"(",
")",
"throws",
"SshException",
",",
"PublicKeySubsystemException",
"{",
"ByteArrayReader",
"msg",
"=",
"new",
"ByteArrayReader",
"(",
"nextMessage",
"(",
")",
")",
";",
"try",
"{",
"msg",
".",
"readString",
"(",
")",
";",
"in... | Read a status response and throw an exception if an error has occurred.
@throws SshException
@throws PublicKeyStatusException | [
"Read",
"a",
"status",
"response",
"and",
"throw",
"an",
"exception",
"if",
"an",
"error",
"has",
"occurred",
"."
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/publickey/PublicKeySubsystem.java#L243-L264 |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java | RestClientUtil.searchAllParallel | public <T> ESDatas<T> searchAllParallel(String index, int fetchSize ,Class<T> type,int thread) throws ElasticSearchException {
"""
并行检索索引所有数据
@param index
@param fetchSize 指定每批次返回的数据,不指定默认为5000
@param type
@param <T>
@return
@throws ElasticSearchException
"""
return searchAllParallel(index, fetchSize... | java | public <T> ESDatas<T> searchAllParallel(String index, int fetchSize ,Class<T> type,int thread) throws ElasticSearchException{
return searchAllParallel(index, fetchSize,(ScrollHandler<T>)null,type,thread);
} | [
"public",
"<",
"T",
">",
"ESDatas",
"<",
"T",
">",
"searchAllParallel",
"(",
"String",
"index",
",",
"int",
"fetchSize",
",",
"Class",
"<",
"T",
">",
"type",
",",
"int",
"thread",
")",
"throws",
"ElasticSearchException",
"{",
"return",
"searchAllParallel",
... | 并行检索索引所有数据
@param index
@param fetchSize 指定每批次返回的数据,不指定默认为5000
@param type
@param <T>
@return
@throws ElasticSearchException | [
"并行检索索引所有数据"
] | train | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java#L1706-L1708 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/PipelineApi.java | PipelineApi.createPipeline | public Pipeline createPipeline(Object projectIdOrPath, String ref) throws GitLabApiException {
"""
Create a pipelines in a project.
<pre><code>GitLab Endpoint: POST /projects/:id/pipeline</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param ... | java | public Pipeline createPipeline(Object projectIdOrPath, String ref) throws GitLabApiException {
return (createPipeline(projectIdOrPath, ref, null));
} | [
"public",
"Pipeline",
"createPipeline",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"ref",
")",
"throws",
"GitLabApiException",
"{",
"return",
"(",
"createPipeline",
"(",
"projectIdOrPath",
",",
"ref",
",",
"null",
")",
")",
";",
"}"
] | Create a pipelines in a project.
<pre><code>GitLab Endpoint: POST /projects/:id/pipeline</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param ref reference to commit
@return a Pipeline instance with the newly created pipeline info
@throws GitLabApiExc... | [
"Create",
"a",
"pipelines",
"in",
"a",
"project",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/PipelineApi.java#L228-L230 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivision.java | AddressDivision.isPrefixBlock | protected boolean isPrefixBlock(long divisionValue, long upperValue, int divisionPrefixLen) {
"""
Returns whether the division range includes the block of values for its prefix length
"""
if(divisionPrefixLen == 0) {
return divisionValue == 0 && upperValue == getMaxValue();
}
long ones = ~0L;
long d... | java | protected boolean isPrefixBlock(long divisionValue, long upperValue, int divisionPrefixLen) {
if(divisionPrefixLen == 0) {
return divisionValue == 0 && upperValue == getMaxValue();
}
long ones = ~0L;
long divisionBitMask = ~(ones << getBitCount());
long divisionPrefixMask = ones << (getBitCount() - divisio... | [
"protected",
"boolean",
"isPrefixBlock",
"(",
"long",
"divisionValue",
",",
"long",
"upperValue",
",",
"int",
"divisionPrefixLen",
")",
"{",
"if",
"(",
"divisionPrefixLen",
"==",
"0",
")",
"{",
"return",
"divisionValue",
"==",
"0",
"&&",
"upperValue",
"==",
"g... | Returns whether the division range includes the block of values for its prefix length | [
"Returns",
"whether",
"the",
"division",
"range",
"includes",
"the",
"block",
"of",
"values",
"for",
"its",
"prefix",
"length"
] | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivision.java#L196-L209 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java | SDNN.multiHeadDotProductAttention | public List<SDVariable> multiHeadDotProductAttention(SDVariable queries, SDVariable keys, SDVariable values, SDVariable Wq, SDVariable Wk, SDVariable Wv, SDVariable Wo, SDVariable mask, boolean scaled, boolean withWeights) {
"""
This performs multi-headed dot product attention on the given timeseries input
@see #... | java | public List<SDVariable> multiHeadDotProductAttention(SDVariable queries, SDVariable keys, SDVariable values, SDVariable Wq, SDVariable Wk, SDVariable Wv, SDVariable Wo, SDVariable mask, boolean scaled, boolean withWeights){
return multiHeadDotProductAttention(null, queries, keys, values, Wq, Wk, Wv, Wo, mask, s... | [
"public",
"List",
"<",
"SDVariable",
">",
"multiHeadDotProductAttention",
"(",
"SDVariable",
"queries",
",",
"SDVariable",
"keys",
",",
"SDVariable",
"values",
",",
"SDVariable",
"Wq",
",",
"SDVariable",
"Wk",
",",
"SDVariable",
"Wv",
",",
"SDVariable",
"Wo",
",... | This performs multi-headed dot product attention on the given timeseries input
@see #multiHeadDotProductAttention(String, SDVariable, SDVariable, SDVariable, SDVariable, SDVariable, SDVariable, SDVariable, SDVariable, boolean, boolean) | [
"This",
"performs",
"multi",
"-",
"headed",
"dot",
"product",
"attention",
"on",
"the",
"given",
"timeseries",
"input"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java#L923-L925 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.getImagePerformanceCountWithServiceResponseAsync | public Observable<ServiceResponse<Integer>> getImagePerformanceCountWithServiceResponseAsync(UUID projectId, UUID iterationId, GetImagePerformanceCountOptionalParameter getImagePerformanceCountOptionalParameter) {
"""
Gets the number of images tagged with the provided {tagIds} that have prediction results from
tr... | java | public Observable<ServiceResponse<Integer>> getImagePerformanceCountWithServiceResponseAsync(UUID projectId, UUID iterationId, GetImagePerformanceCountOptionalParameter getImagePerformanceCountOptionalParameter) {
if (projectId == null) {
throw new IllegalArgumentException("Parameter projectId is re... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Integer",
">",
">",
"getImagePerformanceCountWithServiceResponseAsync",
"(",
"UUID",
"projectId",
",",
"UUID",
"iterationId",
",",
"GetImagePerformanceCountOptionalParameter",
"getImagePerformanceCountOptionalParameter",
")",
... | Gets the number of images tagged with the provided {tagIds} that have prediction results from
training for the provided iteration {iterationId}.
The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and
"Cat" tags, then only images tagged with Dog and/or Cat will be returned... | [
"Gets",
"the",
"number",
"of",
"images",
"tagged",
"with",
"the",
"provided",
"{",
"tagIds",
"}",
"that",
"have",
"prediction",
"results",
"from",
"training",
"for",
"the",
"provided",
"iteration",
"{",
"iterationId",
"}",
".",
"The",
"filtering",
"is",
"on"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L1271-L1284 |
alkacon/opencms-core | src/org/opencms/xml/CmsXmlContentTypeManager.java | CmsXmlContentTypeManager.addSchemaType | public void addSchemaType(String className, String defaultWidget) {
"""
Adds a new XML content type schema class and XML widget to the manager by class names.<p>
@param className class name of the XML content schema type class to add
@param defaultWidget class name of the default XML widget class for the added... | java | public void addSchemaType(String className, String defaultWidget) {
Class<?> classClazz;
// initialize class for schema type
try {
classClazz = Class.forName(className);
} catch (ClassNotFoundException e) {
LOG.error(
Messages.get().getBundle().ke... | [
"public",
"void",
"addSchemaType",
"(",
"String",
"className",
",",
"String",
"defaultWidget",
")",
"{",
"Class",
"<",
"?",
">",
"classClazz",
";",
"// initialize class for schema type",
"try",
"{",
"classClazz",
"=",
"Class",
".",
"forName",
"(",
"className",
"... | Adds a new XML content type schema class and XML widget to the manager by class names.<p>
@param className class name of the XML content schema type class to add
@param defaultWidget class name of the default XML widget class for the added XML content type | [
"Adds",
"a",
"new",
"XML",
"content",
"type",
"schema",
"class",
"and",
"XML",
"widget",
"to",
"the",
"manager",
"by",
"class",
"names",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/CmsXmlContentTypeManager.java#L171-L218 |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/cpptasks/platforms/WindowsPlatform.java | WindowsPlatform.hasSameContent | private static boolean hasSameContent(final InputStream stream1, final InputStream stream2) throws IOException {
"""
Compare two input streams for duplicate content
Naive implementation, but should not be performance issue.
@param stream1
stream
@param stream2
stream
@return true if streams are identical... | java | private static boolean hasSameContent(final InputStream stream1, final InputStream stream2) throws IOException {
int byte1 = -1;
int byte2 = -1;
do {
byte1 = stream1.read();
byte2 = stream2.read();
} while (byte1 == byte2 && byte1 != -1);
return byte1 == byte2;
} | [
"private",
"static",
"boolean",
"hasSameContent",
"(",
"final",
"InputStream",
"stream1",
",",
"final",
"InputStream",
"stream2",
")",
"throws",
"IOException",
"{",
"int",
"byte1",
"=",
"-",
"1",
";",
"int",
"byte2",
"=",
"-",
"1",
";",
"do",
"{",
"byte1",... | Compare two input streams for duplicate content
Naive implementation, but should not be performance issue.
@param stream1
stream
@param stream2
stream
@return true if streams are identical in content
@throws IOException
if error reading streams | [
"Compare",
"two",
"input",
"streams",
"for",
"duplicate",
"content"
] | train | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/platforms/WindowsPlatform.java#L149-L158 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ServerKeysInner.java | ServerKeysInner.getAsync | public Observable<ServerKeyInner> getAsync(String resourceGroupName, String serverName, String keyName) {
"""
Gets a server key.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The... | java | public Observable<ServerKeyInner> getAsync(String resourceGroupName, String serverName, String keyName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, keyName).map(new Func1<ServiceResponse<ServerKeyInner>, ServerKeyInner>() {
@Override
public ServerKeyInner call(Ser... | [
"public",
"Observable",
"<",
"ServerKeyInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"keyName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
"keyName",
... | Gets a server key.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param keyName The name of the server key to be retrieved.
@throws IllegalArgumentException throw... | [
"Gets",
"a",
"server",
"key",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ServerKeysInner.java#L255-L262 |
JOML-CI/JOML | src/org/joml/AABBf.java | AABBf.intersectLineSegment | public int intersectLineSegment(float p0X, float p0Y, float p0Z, float p1X, float p1Y, float p1Z, Vector2f result) {
"""
Determine whether the undirected line segment with the end points <code>(p0X, p0Y, p0Z)</code> and <code>(p1X, p1Y, p1Z)</code>
intersects this AABB, and return the values of the parameter <i>t... | java | public int intersectLineSegment(float p0X, float p0Y, float p0Z, float p1X, float p1Y, float p1Z, Vector2f result) {
return Intersectionf.intersectLineSegmentAab(p0X, p0Y, p0Z, p1X, p1Y, p1Z, minX, minY, minZ, maxX, maxY, maxZ, result);
} | [
"public",
"int",
"intersectLineSegment",
"(",
"float",
"p0X",
",",
"float",
"p0Y",
",",
"float",
"p0Z",
",",
"float",
"p1X",
",",
"float",
"p1Y",
",",
"float",
"p1Z",
",",
"Vector2f",
"result",
")",
"{",
"return",
"Intersectionf",
".",
"intersectLineSegmentA... | Determine whether the undirected line segment with the end points <code>(p0X, p0Y, p0Z)</code> and <code>(p1X, p1Y, p1Z)</code>
intersects this AABB, and return the values of the parameter <i>t</i> in the ray equation
<i>p(t) = origin + p0 * (p1 - p0)</i> of the near and far point of intersection.
<p>
This method retur... | [
"Determine",
"whether",
"the",
"undirected",
"line",
"segment",
"with",
"the",
"end",
"points",
"<code",
">",
"(",
"p0X",
"p0Y",
"p0Z",
")",
"<",
"/",
"code",
">",
"and",
"<code",
">",
"(",
"p1X",
"p1Y",
"p1Z",
")",
"<",
"/",
"code",
">",
"intersects... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/AABBf.java#L507-L509 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/stats/StatsInterface.java | StatsInterface.getPhotostreamDomains | public DomainList getPhotostreamDomains(Date date, int perPage, int page) throws FlickrException {
"""
Get a list of referring domains for a photostream.
@param date
(Required) Stats will be returned for this date. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will
autom... | java | public DomainList getPhotostreamDomains(Date date, int perPage, int page) throws FlickrException {
return getDomains(METHOD_GET_PHOTOSTREAM_DOMAINS, null, null, date, perPage, page);
} | [
"public",
"DomainList",
"getPhotostreamDomains",
"(",
"Date",
"date",
",",
"int",
"perPage",
",",
"int",
"page",
")",
"throws",
"FlickrException",
"{",
"return",
"getDomains",
"(",
"METHOD_GET_PHOTOSTREAM_DOMAINS",
",",
"null",
",",
"null",
",",
"date",
",",
"pe... | Get a list of referring domains for a photostream.
@param date
(Required) Stats will be returned for this date. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will
automatically be rounded down to the start of the day.
@param perPage
(Optional) Number of domains to return per page... | [
"Get",
"a",
"list",
"of",
"referring",
"domains",
"for",
"a",
"photostream",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/stats/StatsInterface.java#L270-L273 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/APIClient.java | APIClient.setUserAgent | public void setUserAgent(String agent, String agentVersion) {
"""
Allow to modify the user-agent in order to add the user agent of the integration
"""
userAgent = String.format("Algolia for Java (%s); JVM (%s); %s (%s)", version, System.getProperty("java.version"), agent, agentVersion);
} | java | public void setUserAgent(String agent, String agentVersion) {
userAgent = String.format("Algolia for Java (%s); JVM (%s); %s (%s)", version, System.getProperty("java.version"), agent, agentVersion);
} | [
"public",
"void",
"setUserAgent",
"(",
"String",
"agent",
",",
"String",
"agentVersion",
")",
"{",
"userAgent",
"=",
"String",
".",
"format",
"(",
"\"Algolia for Java (%s); JVM (%s); %s (%s)\"",
",",
"version",
",",
"System",
".",
"getProperty",
"(",
"\"java.version... | Allow to modify the user-agent in order to add the user agent of the integration | [
"Allow",
"to",
"modify",
"the",
"user",
"-",
"agent",
"in",
"order",
"to",
"add",
"the",
"user",
"agent",
"of",
"the",
"integration"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/APIClient.java#L225-L227 |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/features/ExampleTemplateMatching.java | ExampleTemplateMatching.showMatchIntensity | public static void showMatchIntensity(GrayF32 image, GrayF32 template, GrayF32 mask) {
"""
Computes the template match intensity image and displays the results. Brighter intensity indicates
a better match to the template.
"""
// create algorithm for computing intensity image
TemplateMatchingIntensity<Gra... | java | public static void showMatchIntensity(GrayF32 image, GrayF32 template, GrayF32 mask) {
// create algorithm for computing intensity image
TemplateMatchingIntensity<GrayF32> matchIntensity =
FactoryTemplateMatching.createIntensity(TemplateScoreType.SUM_DIFF_SQ, GrayF32.class);
// apply the template to the ima... | [
"public",
"static",
"void",
"showMatchIntensity",
"(",
"GrayF32",
"image",
",",
"GrayF32",
"template",
",",
"GrayF32",
"mask",
")",
"{",
"// create algorithm for computing intensity image",
"TemplateMatchingIntensity",
"<",
"GrayF32",
">",
"matchIntensity",
"=",
"FactoryT... | Computes the template match intensity image and displays the results. Brighter intensity indicates
a better match to the template. | [
"Computes",
"the",
"template",
"match",
"intensity",
"image",
"and",
"displays",
"the",
"results",
".",
"Brighter",
"intensity",
"indicates",
"a",
"better",
"match",
"to",
"the",
"template",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleTemplateMatching.java#L76-L101 |
h2oai/h2o-3 | h2o-parsers/h2o-parquet-parser/src/main/java/water/parser/parquet/ParquetInt96TimestampConverter.java | ParquetInt96TimestampConverter.getTimestampMillis | public static long getTimestampMillis(Binary timestampBinary) {
"""
Returns GMT timestamp from binary encoded parquet timestamp (12 bytes - julian date + time of day nanos).
@param timestampBinary INT96 parquet timestamp
@return timestamp in millis, GMT timezone
"""
if (timestampBinary.length() != BYTE... | java | public static long getTimestampMillis(Binary timestampBinary) {
if (timestampBinary.length() != BYTES_IN_INT96_TIMESTAMP) {
throw new IllegalArgumentException("Parquet timestamp must be 12 bytes long, actual " + timestampBinary.length());
}
byte[] bytes = timestampBinary.getBytes();
// little end... | [
"public",
"static",
"long",
"getTimestampMillis",
"(",
"Binary",
"timestampBinary",
")",
"{",
"if",
"(",
"timestampBinary",
".",
"length",
"(",
")",
"!=",
"BYTES_IN_INT96_TIMESTAMP",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Parquet timestamp must ... | Returns GMT timestamp from binary encoded parquet timestamp (12 bytes - julian date + time of day nanos).
@param timestampBinary INT96 parquet timestamp
@return timestamp in millis, GMT timezone | [
"Returns",
"GMT",
"timestamp",
"from",
"binary",
"encoded",
"parquet",
"timestamp",
"(",
"12",
"bytes",
"-",
"julian",
"date",
"+",
"time",
"of",
"day",
"nanos",
")",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-parsers/h2o-parquet-parser/src/main/java/water/parser/parquet/ParquetInt96TimestampConverter.java#L44-L55 |
Hygieia/Hygieia | collectors/artifact/artifactory/src/main/java/com/capitalone/dashboard/collector/DefaultArtifactoryClient.java | DefaultArtifactoryClient.createArtifact | private BinaryArtifact createArtifact(String artifactCanonicalName, String artifactPath, long timestamp, JSONObject jsonArtifact) {
"""
Creates an artifact given its canonical name and path.
Artifacts are created by supplied pattern configurations. By default three are supplied:
1. Maven artifacts:
[org]/[modul... | java | private BinaryArtifact createArtifact(String artifactCanonicalName, String artifactPath, long timestamp, JSONObject jsonArtifact) {
BinaryArtifact result = null;
String fullPath = artifactPath + "/" + artifactCanonicalName;
int idx = 0;
for (Pattern pattern : artifactPatterns) {
result = ArtifactUtil.... | [
"private",
"BinaryArtifact",
"createArtifact",
"(",
"String",
"artifactCanonicalName",
",",
"String",
"artifactPath",
",",
"long",
"timestamp",
",",
"JSONObject",
"jsonArtifact",
")",
"{",
"BinaryArtifact",
"result",
"=",
"null",
";",
"String",
"fullPath",
"=",
"art... | Creates an artifact given its canonical name and path.
Artifacts are created by supplied pattern configurations. By default three are supplied:
1. Maven artifacts:
[org]/[module]/[version]/[module]-[version]([-classifier])(.[ext])
2. Ivy artifacts:
(a) [org]/[module]/[revision]/[type]/[artifact]-[revision](-[classifier... | [
"Creates",
"an",
"artifact",
"given",
"its",
"canonical",
"name",
"and",
"path",
".",
"Artifacts",
"are",
"created",
"by",
"supplied",
"pattern",
"configurations",
".",
"By",
"default",
"three",
"are",
"supplied",
":",
"1",
".",
"Maven",
"artifacts",
":",
"[... | train | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/artifact/artifactory/src/main/java/com/capitalone/dashboard/collector/DefaultArtifactoryClient.java#L255-L291 |
networknt/light-4j | service/src/main/java/com/networknt/service/ServiceUtil.java | ServiceUtil.constructByNamedParams | public static Object constructByNamedParams(Class clazz, Map params) throws Exception {
"""
Build an object out of a given class and a map for field names to values.
@param clazz The class to be created.
@param params A map of the parameters.
@return An instantiated object.
@throws Exception when constructor f... | java | public static Object constructByNamedParams(Class clazz, Map params) throws Exception {
Object obj = clazz.getConstructor().newInstance();
Method[] allMethods = clazz.getMethods();
for(Method method : allMethods) {
if(method.getName().startsWith("set")) {
Object [] o... | [
"public",
"static",
"Object",
"constructByNamedParams",
"(",
"Class",
"clazz",
",",
"Map",
"params",
")",
"throws",
"Exception",
"{",
"Object",
"obj",
"=",
"clazz",
".",
"getConstructor",
"(",
")",
".",
"newInstance",
"(",
")",
";",
"Method",
"[",
"]",
"al... | Build an object out of a given class and a map for field names to values.
@param clazz The class to be created.
@param params A map of the parameters.
@return An instantiated object.
@throws Exception when constructor fails. | [
"Build",
"an",
"object",
"out",
"of",
"a",
"given",
"class",
"and",
"a",
"map",
"for",
"field",
"names",
"to",
"values",
"."
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/service/src/main/java/com/networknt/service/ServiceUtil.java#L66-L81 |
apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/sql/statement/ddl/AlterTableStatement.java | AlterTableStatement.findColumnDefinitionFromMetaData | public Optional<ColumnDefinitionSegment> findColumnDefinitionFromMetaData(final String columnName, final ShardingTableMetaData shardingTableMetaData) {
"""
Find column definition from meta data.
@param columnName column name
@param shardingTableMetaData sharding table meta data
@return column definition
"... | java | public Optional<ColumnDefinitionSegment> findColumnDefinitionFromMetaData(final String columnName, final ShardingTableMetaData shardingTableMetaData) {
if (!shardingTableMetaData.containsTable(getTables().getSingleTableName())) {
return Optional.absent();
}
for (ColumnMetaData each :... | [
"public",
"Optional",
"<",
"ColumnDefinitionSegment",
">",
"findColumnDefinitionFromMetaData",
"(",
"final",
"String",
"columnName",
",",
"final",
"ShardingTableMetaData",
"shardingTableMetaData",
")",
"{",
"if",
"(",
"!",
"shardingTableMetaData",
".",
"containsTable",
"(... | Find column definition from meta data.
@param columnName column name
@param shardingTableMetaData sharding table meta data
@return column definition | [
"Find",
"column",
"definition",
"from",
"meta",
"data",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/sql/statement/ddl/AlterTableStatement.java#L83-L93 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/brk/BreakpointMessageHandler.java | BreakpointMessageHandler.handleMessageReceivedFromServer | public boolean handleMessageReceivedFromServer(Message aMessage, boolean onlyIfInScope) {
"""
Do not call if in {@link Mode#safe}.
@param aMessage
@param onlyIfInScope
@return False if message should be dropped.
"""
if (! isBreakpoint(aMessage, false, onlyIfInScope)) {
return true;
... | java | public boolean handleMessageReceivedFromServer(Message aMessage, boolean onlyIfInScope) {
if (! isBreakpoint(aMessage, false, onlyIfInScope)) {
return true;
}
// Do this outside of the semaphore loop so that the 'continue' button can apply to all queued break points
... | [
"public",
"boolean",
"handleMessageReceivedFromServer",
"(",
"Message",
"aMessage",
",",
"boolean",
"onlyIfInScope",
")",
"{",
"if",
"(",
"!",
"isBreakpoint",
"(",
"aMessage",
",",
"false",
",",
"onlyIfInScope",
")",
")",
"{",
"return",
"true",
";",
"}",
"// D... | Do not call if in {@link Mode#safe}.
@param aMessage
@param onlyIfInScope
@return False if message should be dropped. | [
"Do",
"not",
"call",
"if",
"in",
"{",
"@link",
"Mode#safe",
"}",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/brk/BreakpointMessageHandler.java#L97-L116 |
jamel/dbf | dbf-reader/src/main/java/org/jamel/dbf/processor/DbfProcessor.java | DbfProcessor.readDbfInfo | public static String readDbfInfo(File dbf) {
"""
Create string with dbf information:
- creation date
- total records count
- columns info
@param dbf .dbf file
@return string with dbf information
"""
try (DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(dbf))))... | java | public static String readDbfInfo(File dbf) {
try (DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(dbf)))) {
DbfHeader header = DbfHeader.read(in);
StringBuilder sb = new StringBuilder(512);
sb.append("Created at: ")
.ap... | [
"public",
"static",
"String",
"readDbfInfo",
"(",
"File",
"dbf",
")",
"{",
"try",
"(",
"DataInputStream",
"in",
"=",
"new",
"DataInputStream",
"(",
"new",
"BufferedInputStream",
"(",
"new",
"FileInputStream",
"(",
"dbf",
")",
")",
")",
")",
"{",
"DbfHeader",... | Create string with dbf information:
- creation date
- total records count
- columns info
@param dbf .dbf file
@return string with dbf information | [
"Create",
"string",
"with",
"dbf",
"information",
":",
"-",
"creation",
"date",
"-",
"total",
"records",
"count",
"-",
"columns",
"info"
] | train | https://github.com/jamel/dbf/blob/5f065f8a13d9a4ffe27c617e7ec321771c95da7f/dbf-reader/src/main/java/org/jamel/dbf/processor/DbfProcessor.java#L123-L158 |
gotev/android-upload-service | uploadservice/src/main/java/net/gotev/uploadservice/HttpUploadRequest.java | HttpUploadRequest.addHeader | public B addHeader(final String headerName, final String headerValue) {
"""
Adds a header to this upload request.
@param headerName header name
@param headerValue header value
@return self instance
"""
httpParams.addHeader(headerName, headerValue);
return self();
} | java | public B addHeader(final String headerName, final String headerValue) {
httpParams.addHeader(headerName, headerValue);
return self();
} | [
"public",
"B",
"addHeader",
"(",
"final",
"String",
"headerName",
",",
"final",
"String",
"headerValue",
")",
"{",
"httpParams",
".",
"addHeader",
"(",
"headerName",
",",
"headerValue",
")",
";",
"return",
"self",
"(",
")",
";",
"}"
] | Adds a header to this upload request.
@param headerName header name
@param headerValue header value
@return self instance | [
"Adds",
"a",
"header",
"to",
"this",
"upload",
"request",
"."
] | train | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice/src/main/java/net/gotev/uploadservice/HttpUploadRequest.java#L61-L64 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpHeaders.java | HttpHeaders.setBasicAuthentication | public HttpHeaders setBasicAuthentication(String username, String password) {
"""
Sets the {@link #authorization} header as specified in <a
href="http://tools.ietf.org/html/rfc2617#section-2">Basic Authentication Scheme</a>.
<p>Overriding is only supported for the purpose of calling the super implementation an... | java | public HttpHeaders setBasicAuthentication(String username, String password) {
String userPass =
Preconditions.checkNotNull(username) + ":" + Preconditions.checkNotNull(password);
String encoded = Base64.encodeBase64String(StringUtils.getBytesUtf8(userPass));
return setAuthorization("Basic " + encode... | [
"public",
"HttpHeaders",
"setBasicAuthentication",
"(",
"String",
"username",
",",
"String",
"password",
")",
"{",
"String",
"userPass",
"=",
"Preconditions",
".",
"checkNotNull",
"(",
"username",
")",
"+",
"\":\"",
"+",
"Preconditions",
".",
"checkNotNull",
"(",
... | Sets the {@link #authorization} header as specified in <a
href="http://tools.ietf.org/html/rfc2617#section-2">Basic Authentication Scheme</a>.
<p>Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.
@since 1.2 | [
"Sets",
"the",
"{",
"@link",
"#authorization",
"}",
"header",
"as",
"specified",
"in",
"<a",
"href",
"=",
"http",
":",
"//",
"tools",
".",
"ietf",
".",
"org",
"/",
"html",
"/",
"rfc2617#section",
"-",
"2",
">",
"Basic",
"Authentication",
"Scheme<",
"/",
... | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpHeaders.java#L819-L824 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java | SqlExecutor.call | public static boolean call(Connection conn, String sql, Object... params) throws SQLException {
"""
执行调用存储过程<br>
此方法不会关闭Connection
@param conn 数据库连接对象
@param sql SQL
@param params 参数
@return 如果执行后第一个结果是ResultSet,则返回true,否则返回false。
@throws SQLException SQL执行异常
"""
CallableStatement call = null;
try ... | java | public static boolean call(Connection conn, String sql, Object... params) throws SQLException {
CallableStatement call = null;
try {
call = StatementUtil.prepareCall(conn, sql, params);
return call.execute();
} finally {
DbUtil.close(call);
}
} | [
"public",
"static",
"boolean",
"call",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"Object",
"...",
"params",
")",
"throws",
"SQLException",
"{",
"CallableStatement",
"call",
"=",
"null",
";",
"try",
"{",
"call",
"=",
"StatementUtil",
".",
"prepare... | 执行调用存储过程<br>
此方法不会关闭Connection
@param conn 数据库连接对象
@param sql SQL
@param params 参数
@return 如果执行后第一个结果是ResultSet,则返回true,否则返回false。
@throws SQLException SQL执行异常 | [
"执行调用存储过程<br",
">",
"此方法不会关闭Connection"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java#L73-L81 |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/cpptasks/TargetInfo.java | TargetInfo.getSourceHistories | public SourceHistory[] getSourceHistories(final String basePath) {
"""
Returns an array of SourceHistory objects (contains relative path and
last modified time) for the source[s] of this target
"""
final SourceHistory[] histories = new SourceHistory[this.sources.length];
for (int i = 0; i < this.sourc... | java | public SourceHistory[] getSourceHistories(final String basePath) {
final SourceHistory[] histories = new SourceHistory[this.sources.length];
for (int i = 0; i < this.sources.length; i++) {
final String relativeName = CUtil.getRelativePath(basePath, this.sources[i]);
final long lastModified = this.so... | [
"public",
"SourceHistory",
"[",
"]",
"getSourceHistories",
"(",
"final",
"String",
"basePath",
")",
"{",
"final",
"SourceHistory",
"[",
"]",
"histories",
"=",
"new",
"SourceHistory",
"[",
"this",
".",
"sources",
".",
"length",
"]",
";",
"for",
"(",
"int",
... | Returns an array of SourceHistory objects (contains relative path and
last modified time) for the source[s] of this target | [
"Returns",
"an",
"array",
"of",
"SourceHistory",
"objects",
"(",
"contains",
"relative",
"path",
"and",
"last",
"modified",
"time",
")",
"for",
"the",
"source",
"[",
"s",
"]",
"of",
"this",
"target"
] | train | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/TargetInfo.java#L101-L109 |
Azure/azure-sdk-for-java | datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRulesInner.java | FirewallRulesInner.createOrUpdate | public FirewallRuleInner createOrUpdate(String resourceGroupName, String accountName, String firewallRuleName, CreateOrUpdateFirewallRuleParameters parameters) {
"""
Creates or updates the specified firewall rule. During update, the firewall rule with the specified name will be replaced with this new firewall rule... | java | public FirewallRuleInner createOrUpdate(String resourceGroupName, String accountName, String firewallRuleName, CreateOrUpdateFirewallRuleParameters parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters).toBlocking().single().body();
} | [
"public",
"FirewallRuleInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"firewallRuleName",
",",
"CreateOrUpdateFirewallRuleParameters",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
... | Creates or updates the specified firewall rule. During update, the firewall rule with the specified name will be replaced with this new firewall rule.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name of the Data Lake Store account.
@param firewallRuleName The name of the firew... | [
"Creates",
"or",
"updates",
"the",
"specified",
"firewall",
"rule",
".",
"During",
"update",
"the",
"firewall",
"rule",
"with",
"the",
"specified",
"name",
"will",
"be",
"replaced",
"with",
"this",
"new",
"firewall",
"rule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRulesInner.java#L228-L230 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSContainer.java | EJSContainer.getBean | public EJBObject getBean(ContainerTx tx, BeanId id) throws RemoteException {
"""
Attempt to retrieve from cache bean with given <code>beanId</code>
in current transaction context. <p>
This method returns null if a bean with given id is not found. <p>
@param id the <code>BeanId</code> to retrieve bean for <p... | java | public EJBObject getBean(ContainerTx tx, BeanId id) throws RemoteException {
EJBObject result = null;
BeanO beanO = activator.getBean(tx, id);
if (beanO != null) {
try { // d116480
result = wrapperManager.getWrapper(id).getRemoteWrapper(); // f111627 d156807.1
... | [
"public",
"EJBObject",
"getBean",
"(",
"ContainerTx",
"tx",
",",
"BeanId",
"id",
")",
"throws",
"RemoteException",
"{",
"EJBObject",
"result",
"=",
"null",
";",
"BeanO",
"beanO",
"=",
"activator",
".",
"getBean",
"(",
"tx",
",",
"id",
")",
";",
"if",
"("... | Attempt to retrieve from cache bean with given <code>beanId</code>
in current transaction context. <p>
This method returns null if a bean with given id is not found. <p>
@param id the <code>BeanId</code> to retrieve bean for <p> | [
"Attempt",
"to",
"retrieve",
"from",
"cache",
"bean",
"with",
"given",
"<code",
">",
"beanId<",
"/",
"code",
">",
"in",
"current",
"transaction",
"context",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSContainer.java#L1793-L1806 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/WeibullDistribution.java | WeibullDistribution.logpdf | public static double logpdf(double x, double k, double lambda, double theta) {
"""
PDF of Weibull distribution
@param x Value
@param k Shape parameter
@param lambda Scale parameter
@param theta Shift offset parameter
@return PDF at position x.
"""
if(x <= theta || x == Double.POSITIVE_INFINITY) {
... | java | public static double logpdf(double x, double k, double lambda, double theta) {
if(x <= theta || x == Double.POSITIVE_INFINITY) {
return Double.NEGATIVE_INFINITY;
}
double xl = (x - theta) / lambda;
return FastMath.log(k / lambda) + (k - 1) * FastMath.log(xl) - FastMath.pow(xl, k);
} | [
"public",
"static",
"double",
"logpdf",
"(",
"double",
"x",
",",
"double",
"k",
",",
"double",
"lambda",
",",
"double",
"theta",
")",
"{",
"if",
"(",
"x",
"<=",
"theta",
"||",
"x",
"==",
"Double",
".",
"POSITIVE_INFINITY",
")",
"{",
"return",
"Double",... | PDF of Weibull distribution
@param x Value
@param k Shape parameter
@param lambda Scale parameter
@param theta Shift offset parameter
@return PDF at position x. | [
"PDF",
"of",
"Weibull",
"distribution"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/WeibullDistribution.java#L178-L184 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/xml/CWF2XML.java | CWF2XML.toDocument | public static Document toDocument(BaseComponent root, String... excludedProperties) {
"""
Returns an XML document that mirrors the CWF component tree starting at the specified root.
@param root BaseComponent whose subtree is to be traversed.
@param excludedProperties An optional list of properties that should ... | java | public static Document toDocument(BaseComponent root, String... excludedProperties) {
try {
CWF2XML instance = new CWF2XML(excludedProperties);
instance.toXML(root, instance.doc);
return instance.doc;
} catch (ParserConfigurationException e) {
return null;... | [
"public",
"static",
"Document",
"toDocument",
"(",
"BaseComponent",
"root",
",",
"String",
"...",
"excludedProperties",
")",
"{",
"try",
"{",
"CWF2XML",
"instance",
"=",
"new",
"CWF2XML",
"(",
"excludedProperties",
")",
";",
"instance",
".",
"toXML",
"(",
"roo... | Returns an XML document that mirrors the CWF component tree starting at the specified root.
@param root BaseComponent whose subtree is to be traversed.
@param excludedProperties An optional list of properties that should be excluded from the
output. These may either be the property name (e.g., "uuid") or a property na... | [
"Returns",
"an",
"XML",
"document",
"that",
"mirrors",
"the",
"CWF",
"component",
"tree",
"starting",
"at",
"the",
"specified",
"root",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/xml/CWF2XML.java#L68-L76 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java | DefaultMetadataService.validateUniqueAttribute | private void validateUniqueAttribute(String entityType, String attributeName) throws AtlasException {
"""
Validate that attribute is unique attribute
@param entityType the entity type
@param attributeName the name of the attribute
"""
ClassType type = typeSystem.getDataType(ClassType.class, enti... | java | private void validateUniqueAttribute(String entityType, String attributeName) throws AtlasException {
ClassType type = typeSystem.getDataType(ClassType.class, entityType);
AttributeInfo attribute = type.fieldMapping().fields.get(attributeName);
if(attribute == null) {
throw new Illeg... | [
"private",
"void",
"validateUniqueAttribute",
"(",
"String",
"entityType",
",",
"String",
"attributeName",
")",
"throws",
"AtlasException",
"{",
"ClassType",
"type",
"=",
"typeSystem",
".",
"getDataType",
"(",
"ClassType",
".",
"class",
",",
"entityType",
")",
";"... | Validate that attribute is unique attribute
@param entityType the entity type
@param attributeName the name of the attribute | [
"Validate",
"that",
"attribute",
"is",
"unique",
"attribute"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java#L353-L364 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/AttachmentStreamFactory.java | AttachmentStreamFactory.getOutputStream | public OutputStream getOutputStream(File file, Attachment.Encoding encoding) throws
IOException {
"""
Get stream for writing attachment data to disk.
Opens the output stream using {@link FileUtils#openOutputStream(File)}.
Data should be written to the stream unencoded, unencrypted.
@param file... | java | public OutputStream getOutputStream(File file, Attachment.Encoding encoding) throws
IOException {
// First, open a stream to the raw bytes on disk.
// Then, if we have a key assume the file should be encrypted before writing,
// so wrap the file stream in a stream which encrypts dur... | [
"public",
"OutputStream",
"getOutputStream",
"(",
"File",
"file",
",",
"Attachment",
".",
"Encoding",
"encoding",
")",
"throws",
"IOException",
"{",
"// First, open a stream to the raw bytes on disk.",
"// Then, if we have a key assume the file should be encrypted before writing,",
... | Get stream for writing attachment data to disk.
Opens the output stream using {@link FileUtils#openOutputStream(File)}.
Data should be written to the stream unencoded, unencrypted.
@param file File to write to.
@param encoding Encoding to use.
@return Stream for writing.
@throws IOException if there's a problem writ... | [
"Get",
"stream",
"for",
"writing",
"attachment",
"data",
"to",
"disk",
"."
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/AttachmentStreamFactory.java#L129-L176 |
sebastiangraf/treetank | interfacemodules/jax-rx/src/main/java/org/jaxrx/resource/JaxRxResource.java | JaxRxResource.postQuery | @Path(JaxRxConstants.JAXRXPATH)
@POST
@Consumes(APPLICATION_QUERY_XML)
public Response postQuery(@PathParam(JaxRxConstants.SYSTEM) final String system, final InputStream input,
@Context final HttpHeaders headers) {
"""
This method will be called when a HTTP client sends a POST request to an
ex... | java | @Path(JaxRxConstants.JAXRXPATH)
@POST
@Consumes(APPLICATION_QUERY_XML)
public Response postQuery(@PathParam(JaxRxConstants.SYSTEM) final String system, final InputStream input,
@Context final HttpHeaders headers) {
return postQuery(system, input, "", headers);
} | [
"@",
"Path",
"(",
"JaxRxConstants",
".",
"JAXRXPATH",
")",
"@",
"POST",
"@",
"Consumes",
"(",
"APPLICATION_QUERY_XML",
")",
"public",
"Response",
"postQuery",
"(",
"@",
"PathParam",
"(",
"JaxRxConstants",
".",
"SYSTEM",
")",
"final",
"String",
"system",
",",
... | This method will be called when a HTTP client sends a POST request to an
existing resource with 'application/query+xml' as Content-Type.
@param system
The implementation system.
@param input
The input stream.
@param headers
HTTP header attributes.
@return The {@link Response} which can be empty when no response is
exp... | [
"This",
"method",
"will",
"be",
"called",
"when",
"a",
"HTTP",
"client",
"sends",
"a",
"POST",
"request",
"to",
"an",
"existing",
"resource",
"with",
"application",
"/",
"query",
"+",
"xml",
"as",
"Content",
"-",
"Type",
"."
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/jax-rx/src/main/java/org/jaxrx/resource/JaxRxResource.java#L131-L137 |
opentelecoms-org/jsmpp | jsmpp/src/main/java/org/jsmpp/util/StrictBufferedInputStream.java | StrictBufferedInputStream.read | @Override
public int read(final byte[] buffer, final int bufPos, final int length)
throws IOException {
"""
Workaround for an unexpected behavior of 'BufferedInputStream'!
"""
int i = super.read(buffer, bufPos, length);
if ((i == length) || (i == -1))
return i;
... | java | @Override
public int read(final byte[] buffer, final int bufPos, final int length)
throws IOException {
int i = super.read(buffer, bufPos, length);
if ((i == length) || (i == -1))
return i;
int j = super.read(buffer, bufPos + i, length - i);
if (j == -1... | [
"@",
"Override",
"public",
"int",
"read",
"(",
"final",
"byte",
"[",
"]",
"buffer",
",",
"final",
"int",
"bufPos",
",",
"final",
"int",
"length",
")",
"throws",
"IOException",
"{",
"int",
"i",
"=",
"super",
".",
"read",
"(",
"buffer",
",",
"bufPos",
... | Workaround for an unexpected behavior of 'BufferedInputStream'! | [
"Workaround",
"for",
"an",
"unexpected",
"behavior",
"of",
"BufferedInputStream",
"!"
] | train | https://github.com/opentelecoms-org/jsmpp/blob/acc15e73e7431deabc803731971b15323315baaf/jsmpp/src/main/java/org/jsmpp/util/StrictBufferedInputStream.java#L37-L47 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/info/ChainedProperty.java | ChainedProperty.identityEquals | private static boolean identityEquals(Object[] a, Object[] a2) {
"""
Compares objects for equality using '==' operator instead of equals method.
"""
if (a == a2) {
return true;
}
if (a == null || a2 == null) {
return false;
}
int length =... | java | private static boolean identityEquals(Object[] a, Object[] a2) {
if (a == a2) {
return true;
}
if (a == null || a2 == null) {
return false;
}
int length = a.length;
if (a2.length != length) {
return false;
}
... | [
"private",
"static",
"boolean",
"identityEquals",
"(",
"Object",
"[",
"]",
"a",
",",
"Object",
"[",
"]",
"a2",
")",
"{",
"if",
"(",
"a",
"==",
"a2",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"a",
"==",
"null",
"||",
"a2",
"==",
"null",
"... | Compares objects for equality using '==' operator instead of equals method. | [
"Compares",
"objects",
"for",
"equality",
"using",
"==",
"operator",
"instead",
"of",
"equals",
"method",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/info/ChainedProperty.java#L515-L535 |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/html/Table.java | Table.checkCheckboxInCell | public void checkCheckboxInCell(int row, int column) {
"""
Tick the checkbox in a cell of a table indicated by input row and column indices
@param row
int number of row for cell
@param column
int number of column for cell
"""
String checkboxLocator = getXPathBase() + "tr[" + row + "]/td[" + colum... | java | public void checkCheckboxInCell(int row, int column) {
String checkboxLocator = getXPathBase() + "tr[" + row + "]/td[" + column + "]/input";
CheckBox cb = new CheckBox(checkboxLocator);
cb.check();
} | [
"public",
"void",
"checkCheckboxInCell",
"(",
"int",
"row",
",",
"int",
"column",
")",
"{",
"String",
"checkboxLocator",
"=",
"getXPathBase",
"(",
")",
"+",
"\"tr[\"",
"+",
"row",
"+",
"\"]/td[\"",
"+",
"column",
"+",
"\"]/input\"",
";",
"CheckBox",
"cb",
... | Tick the checkbox in a cell of a table indicated by input row and column indices
@param row
int number of row for cell
@param column
int number of column for cell | [
"Tick",
"the",
"checkbox",
"in",
"a",
"cell",
"of",
"a",
"table",
"indicated",
"by",
"input",
"row",
"and",
"column",
"indices"
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/Table.java#L310-L314 |
RoaringBitmap/RoaringBitmap | roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java | RoaringBitmap.xorCardinality | public static int xorCardinality(final RoaringBitmap x1, final RoaringBitmap x2) {
"""
Cardinality of the bitwise XOR (symmetric difference) operation.
The provided bitmaps are *not* modified. This operation is thread-safe
as long as the provided bitmaps remain unchanged.
@param x1 first bitmap
@param x2 oth... | java | public static int xorCardinality(final RoaringBitmap x1, final RoaringBitmap x2) {
return x1.getCardinality() + x2.getCardinality() - 2 * andCardinality(x1, x2);
} | [
"public",
"static",
"int",
"xorCardinality",
"(",
"final",
"RoaringBitmap",
"x1",
",",
"final",
"RoaringBitmap",
"x2",
")",
"{",
"return",
"x1",
".",
"getCardinality",
"(",
")",
"+",
"x2",
".",
"getCardinality",
"(",
")",
"-",
"2",
"*",
"andCardinality",
"... | Cardinality of the bitwise XOR (symmetric difference) operation.
The provided bitmaps are *not* modified. This operation is thread-safe
as long as the provided bitmaps remain unchanged.
@param x1 first bitmap
@param x2 other bitmap
@return cardinality of the symmetric difference | [
"Cardinality",
"of",
"the",
"bitwise",
"XOR",
"(",
"symmetric",
"difference",
")",
"operation",
".",
"The",
"provided",
"bitmaps",
"are",
"*",
"not",
"*",
"modified",
".",
"This",
"operation",
"is",
"thread",
"-",
"safe",
"as",
"long",
"as",
"the",
"provid... | train | https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java#L858-L860 |
raphw/byte-buddy | byte-buddy-maven-plugin/src/main/java/net/bytebuddy/build/maven/Initialization.java | Initialization.getEntryPoint | @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Applies Maven exception wrapper")
public EntryPoint getEntryPoint(ClassLoaderResolver classLoaderResolver, String groupId, String artifactId, String version, String packaging) throws MojoExecutionException {
"""
Resolves the described entry po... | java | @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Applies Maven exception wrapper")
public EntryPoint getEntryPoint(ClassLoaderResolver classLoaderResolver, String groupId, String artifactId, String version, String packaging) throws MojoExecutionException {
if (entryPoint == null || entryP... | [
"@",
"SuppressFBWarnings",
"(",
"value",
"=",
"\"REC_CATCH_EXCEPTION\"",
",",
"justification",
"=",
"\"Applies Maven exception wrapper\"",
")",
"public",
"EntryPoint",
"getEntryPoint",
"(",
"ClassLoaderResolver",
"classLoaderResolver",
",",
"String",
"groupId",
",",
"String... | Resolves the described entry point.
@param classLoaderResolver The class loader resolved to use.
@param groupId This project's group id.
@param artifactId This project's artifact id.
@param version This project's version id.
@param packaging This project's packaging
@return T... | [
"Resolves",
"the",
"described",
"entry",
"point",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-maven-plugin/src/main/java/net/bytebuddy/build/maven/Initialization.java#L55-L72 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.getPrebuiltEntityRolesAsync | public Observable<List<EntityRole>> getPrebuiltEntityRolesAsync(UUID appId, String versionId, UUID entityId) {
"""
Get All Entity Roles for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId entity Id
@throws IllegalArgumentException thrown if parameters fail th... | java | public Observable<List<EntityRole>> getPrebuiltEntityRolesAsync(UUID appId, String versionId, UUID entityId) {
return getPrebuiltEntityRolesWithServiceResponseAsync(appId, versionId, entityId).map(new Func1<ServiceResponse<List<EntityRole>>, List<EntityRole>>() {
@Override
public List<En... | [
"public",
"Observable",
"<",
"List",
"<",
"EntityRole",
">",
">",
"getPrebuiltEntityRolesAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
")",
"{",
"return",
"getPrebuiltEntityRolesWithServiceResponseAsync",
"(",
"appId",
",",
"vers... | Get All Entity Roles for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId entity Id
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<EntityRole> object | [
"Get",
"All",
"Entity",
"Roles",
"for",
"a",
"given",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L7966-L7973 |
alkacon/opencms-core | src/org/opencms/ade/sitemap/shared/CmsSitemapChange.java | CmsSitemapChange.addChangeTitle | public void addChangeTitle(String title) {
"""
Adds a property change for a changed title.<p>
@param title the changed title
"""
CmsPropertyModification propChange = new CmsPropertyModification(
m_entryId,
CmsClientProperty.PROPERTY_NAVTEXT,
title,
tr... | java | public void addChangeTitle(String title) {
CmsPropertyModification propChange = new CmsPropertyModification(
m_entryId,
CmsClientProperty.PROPERTY_NAVTEXT,
title,
true);
m_propertyModifications.add(propChange);
m_ownInternalProperties.put("NavText... | [
"public",
"void",
"addChangeTitle",
"(",
"String",
"title",
")",
"{",
"CmsPropertyModification",
"propChange",
"=",
"new",
"CmsPropertyModification",
"(",
"m_entryId",
",",
"CmsClientProperty",
".",
"PROPERTY_NAVTEXT",
",",
"title",
",",
"true",
")",
";",
"m_propert... | Adds a property change for a changed title.<p>
@param title the changed title | [
"Adds",
"a",
"property",
"change",
"for",
"a",
"changed",
"title",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/sitemap/shared/CmsSitemapChange.java#L180-L189 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/AppUtil.java | AppUtil.startGalleryApp | public static void startGalleryApp(@NonNull final Activity activity, final int requestCode) {
"""
Starts the gallery app in order to choose a picture. In an error occurs while starting the
gallery app, an {@link ActivityNotFoundException} will be thrown.
@param activity
The activity, the chosen image should b... | java | public static void startGalleryApp(@NonNull final Activity activity, final int requestCode) {
Condition.INSTANCE.ensureNotNull(activity, "The activity may not be null");
Intent intent =
new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
if (intent.reso... | [
"public",
"static",
"void",
"startGalleryApp",
"(",
"@",
"NonNull",
"final",
"Activity",
"activity",
",",
"final",
"int",
"requestCode",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"activity",
",",
"\"The activity may not be null\"",
")",
";... | Starts the gallery app in order to choose a picture. In an error occurs while starting the
gallery app, an {@link ActivityNotFoundException} will be thrown.
@param activity
The activity, the chosen image should be passed to by calling its
<code>onActivityResult</code> method, as an instance of the class {@link Activit... | [
"Starts",
"the",
"gallery",
"app",
"in",
"order",
"to",
"choose",
"a",
"picture",
".",
"In",
"an",
"error",
"occurs",
"while",
"starting",
"the",
"gallery",
"app",
"an",
"{",
"@link",
"ActivityNotFoundException",
"}",
"will",
"be",
"thrown",
"."
] | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/AppUtil.java#L112-L122 |
logic-ng/LogicNG | src/main/java/org/logicng/formulas/Formula.java | Formula.setPredicateCacheEntry | public void setPredicateCacheEntry(final CacheEntry key, final boolean value) {
"""
Sets an entry in the predicate cache of this formula
@param key the cache key
@param value the cache value
"""
this.predicateCache.put(key, Tristate.fromBool(value));
} | java | public void setPredicateCacheEntry(final CacheEntry key, final boolean value) {
this.predicateCache.put(key, Tristate.fromBool(value));
} | [
"public",
"void",
"setPredicateCacheEntry",
"(",
"final",
"CacheEntry",
"key",
",",
"final",
"boolean",
"value",
")",
"{",
"this",
".",
"predicateCache",
".",
"put",
"(",
"key",
",",
"Tristate",
".",
"fromBool",
"(",
"value",
")",
")",
";",
"}"
] | Sets an entry in the predicate cache of this formula
@param key the cache key
@param value the cache value | [
"Sets",
"an",
"entry",
"in",
"the",
"predicate",
"cache",
"of",
"this",
"formula"
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/Formula.java#L367-L369 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/AlphabeticIndex.java | AlphabeticIndex.getCollator | public RuleBasedCollator getCollator() {
"""
Get a clone of the collator used internally. Note that for performance reasons, the clone is only done once, and
then stored. The next time it is accessed, the same instance is returned.
<p>
<b><i>Don't use this method across threads if you are changing the settings ... | java | public RuleBasedCollator getCollator() {
if (collatorExternal == null) {
try {
collatorExternal = (RuleBasedCollator) (collatorOriginal.clone());
} catch (Exception e) {
// should never happen
throw new IllegalStateException("Collator canno... | [
"public",
"RuleBasedCollator",
"getCollator",
"(",
")",
"{",
"if",
"(",
"collatorExternal",
"==",
"null",
")",
"{",
"try",
"{",
"collatorExternal",
"=",
"(",
"RuleBasedCollator",
")",
"(",
"collatorOriginal",
".",
"clone",
"(",
")",
")",
";",
"}",
"catch",
... | Get a clone of the collator used internally. Note that for performance reasons, the clone is only done once, and
then stored. The next time it is accessed, the same instance is returned.
<p>
<b><i>Don't use this method across threads if you are changing the settings on the collator, at least not without
synchronizing.<... | [
"Get",
"a",
"clone",
"of",
"the",
"collator",
"used",
"internally",
".",
"Note",
"that",
"for",
"performance",
"reasons",
"the",
"clone",
"is",
"only",
"done",
"once",
"and",
"then",
"stored",
".",
"The",
"next",
"time",
"it",
"is",
"accessed",
"the",
"s... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/AlphabeticIndex.java#L638-L648 |
samskivert/pythagoras | src/main/java/pythagoras/d/Arc.java | Arc.setAngles | public void setAngles (XY p1, XY p2) {
"""
Sets the starting angle and angular extent of this arc using two sets of coordinates. The
first set of coordinates is used to determine the angle of the starting point relative to
the arc's center. The second set of coordinates is used to determine the angle of the end
... | java | public void setAngles (XY p1, XY p2) {
setAngles(p1.x(), p1.y(), p2.x(), p2.y());
} | [
"public",
"void",
"setAngles",
"(",
"XY",
"p1",
",",
"XY",
"p2",
")",
"{",
"setAngles",
"(",
"p1",
".",
"x",
"(",
")",
",",
"p1",
".",
"y",
"(",
")",
",",
"p2",
".",
"x",
"(",
")",
",",
"p2",
".",
"y",
"(",
")",
")",
";",
"}"
] | Sets the starting angle and angular extent of this arc using two sets of coordinates. The
first set of coordinates is used to determine the angle of the starting point relative to
the arc's center. The second set of coordinates is used to determine the angle of the end
point relative to the arc's center. The arc will a... | [
"Sets",
"the",
"starting",
"angle",
"and",
"angular",
"extent",
"of",
"this",
"arc",
"using",
"two",
"sets",
"of",
"coordinates",
".",
"The",
"first",
"set",
"of",
"coordinates",
"is",
"used",
"to",
"determine",
"the",
"angle",
"of",
"the",
"starting",
"po... | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Arc.java#L232-L234 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.