repository_name
stringlengths
7
54
func_path_in_repository
stringlengths
18
218
func_name
stringlengths
5
140
whole_func_string
stringlengths
79
3.99k
language
stringclasses
1 value
func_code_string
stringlengths
79
3.99k
func_code_tokens
listlengths
20
624
func_documentation_string
stringlengths
61
1.96k
func_documentation_tokens
listlengths
1
478
split_name
stringclasses
1 value
func_code_url
stringlengths
107
339
vanilladb/vanillacore
src/main/java/org/vanilladb/core/storage/file/Page.java
Page.getVal
public synchronized Constant getVal(int offset, Type type) { int size; byte[] byteVal = null; // Check the length of bytes if (type.isFixedSize()) { size = type.maxSize(); } else { byteVal = new byte[ByteHelper.INT_SIZE]; contents.get(offset, byteVal); size = ByteHelper.toInteger(byteVal); offset += ByteHelper.INT_SIZE; } // Get bytes and translate it to Constant byteVal = new byte[size]; contents.get(offset, byteVal); return Constant.newInstance(type, byteVal); }
java
public synchronized Constant getVal(int offset, Type type) { int size; byte[] byteVal = null; // Check the length of bytes if (type.isFixedSize()) { size = type.maxSize(); } else { byteVal = new byte[ByteHelper.INT_SIZE]; contents.get(offset, byteVal); size = ByteHelper.toInteger(byteVal); offset += ByteHelper.INT_SIZE; } // Get bytes and translate it to Constant byteVal = new byte[size]; contents.get(offset, byteVal); return Constant.newInstance(type, byteVal); }
[ "public", "synchronized", "Constant", "getVal", "(", "int", "offset", ",", "Type", "type", ")", "{", "int", "size", ";", "byte", "[", "]", "byteVal", "=", "null", ";", "// Check the length of bytes\r", "if", "(", "type", ".", "isFixedSize", "(", ")", ")", ...
Returns the value at a specified offset of this page. If a constant was not stored at that offset, the behavior of the method is unpredictable. @param offset the byte offset within the page @param type the type of the value @return the constant value at that offset
[ "Returns", "the", "value", "at", "a", "specified", "offset", "of", "this", "page", ".", "If", "a", "constant", "was", "not", "stored", "at", "that", "offset", "the", "behavior", "of", "the", "method", "is", "unpredictable", "." ]
train
https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/file/Page.java#L150-L168
Ordinastie/MalisisCore
src/main/java/net/malisis/core/client/gui/component/UIComponent.java
UIComponent.isInsideBounds
public boolean isInsideBounds(int x, int y) { if (!isVisible()) return false; int sx = screenPosition().x(); int sy = screenPosition().y(); return x >= sx && x <= sx + size().width() && y >= sy && y <= sy + size().height(); }
java
public boolean isInsideBounds(int x, int y) { if (!isVisible()) return false; int sx = screenPosition().x(); int sy = screenPosition().y(); return x >= sx && x <= sx + size().width() && y >= sy && y <= sy + size().height(); }
[ "public", "boolean", "isInsideBounds", "(", "int", "x", ",", "int", "y", ")", "{", "if", "(", "!", "isVisible", "(", ")", ")", "return", "false", ";", "int", "sx", "=", "screenPosition", "(", ")", ".", "x", "(", ")", ";", "int", "sy", "=", "scree...
Checks if supplied coordinates are inside this {@link UIComponent} bounds. @param x the x @param y the y @return true, if coordinates are inside bounds
[ "Checks", "if", "supplied", "coordinates", "are", "inside", "this", "{", "@link", "UIComponent", "}", "bounds", "." ]
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/client/gui/component/UIComponent.java#L685-L692
hibernate/hibernate-ogm
neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/remote/bolt/dialect/impl/BoltNeo4jSequenceGenerator.java
BoltNeo4jSequenceGenerator.addUniqueConstraintForTableBasedSequence
private void addUniqueConstraintForTableBasedSequence(List<Statement> statements, IdSourceKeyMetadata generatorKeyMetadata) { Statement statement = createUniqueConstraintStatement( generatorKeyMetadata.getKeyColumnName(), generatorKeyMetadata.getName() ); statements.add( statement ); }
java
private void addUniqueConstraintForTableBasedSequence(List<Statement> statements, IdSourceKeyMetadata generatorKeyMetadata) { Statement statement = createUniqueConstraintStatement( generatorKeyMetadata.getKeyColumnName(), generatorKeyMetadata.getName() ); statements.add( statement ); }
[ "private", "void", "addUniqueConstraintForTableBasedSequence", "(", "List", "<", "Statement", ">", "statements", ",", "IdSourceKeyMetadata", "generatorKeyMetadata", ")", "{", "Statement", "statement", "=", "createUniqueConstraintStatement", "(", "generatorKeyMetadata", ".", ...
Adds a unique constraint to make sure that each node of the same "sequence table" is unique.
[ "Adds", "a", "unique", "constraint", "to", "make", "sure", "that", "each", "node", "of", "the", "same", "sequence", "table", "is", "unique", "." ]
train
https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/remote/bolt/dialect/impl/BoltNeo4jSequenceGenerator.java#L92-L95
LAW-Unimi/BUbiNG
src/it/unimi/di/law/warc/io/gzarc/GZIPArchiveWriter.java
GZIPArchiveWriter.getEntry
public GZIPArchive.WriteEntry getEntry(final String name, final String comment, final Date creationDate) { crc.reset(); deflater.reset(); deflaterStream.reset(); final GZIPArchive.WriteEntry entry = new GZIPArchive.WriteEntry(); entry.setName(name); entry.setComment(comment); entry.deflater = new FilterOutputStream(new DeflaterOutputStream(deflaterStream, deflater)) { private final byte[] oneCharBuffer = new byte[1]; private long length = 0; @Override public void write(int b) throws IOException { // This avoids byte-array creation in DeflaterOutputStream.write() oneCharBuffer[0] = (byte)b; this.out.write(oneCharBuffer); crc.update(oneCharBuffer); this.length++; } @Override public void write(byte[] b, int off, int len) throws IOException { this.out.write(b, off, len); crc.update(b, off, len); this.length += len; } @Override public void close() throws IOException { this.out.flush(); ((DeflaterOutputStream)this.out).finish(); entry.compressedSkipLength = GZIPArchive.FIX_LEN + (entry.name.length + 1) + (entry.comment.length + 1) + deflaterStream.length; entry.uncompressedSkipLength = (int)(this.length & 0xFFFFFFFF); entry.mtime = (int)(creationDate.getTime() / 1000); entry.crc32 = (int)(crc.getValue() & 0xFFFFFFFF); writeEntry(entry); } }; return entry; }
java
public GZIPArchive.WriteEntry getEntry(final String name, final String comment, final Date creationDate) { crc.reset(); deflater.reset(); deflaterStream.reset(); final GZIPArchive.WriteEntry entry = new GZIPArchive.WriteEntry(); entry.setName(name); entry.setComment(comment); entry.deflater = new FilterOutputStream(new DeflaterOutputStream(deflaterStream, deflater)) { private final byte[] oneCharBuffer = new byte[1]; private long length = 0; @Override public void write(int b) throws IOException { // This avoids byte-array creation in DeflaterOutputStream.write() oneCharBuffer[0] = (byte)b; this.out.write(oneCharBuffer); crc.update(oneCharBuffer); this.length++; } @Override public void write(byte[] b, int off, int len) throws IOException { this.out.write(b, off, len); crc.update(b, off, len); this.length += len; } @Override public void close() throws IOException { this.out.flush(); ((DeflaterOutputStream)this.out).finish(); entry.compressedSkipLength = GZIPArchive.FIX_LEN + (entry.name.length + 1) + (entry.comment.length + 1) + deflaterStream.length; entry.uncompressedSkipLength = (int)(this.length & 0xFFFFFFFF); entry.mtime = (int)(creationDate.getTime() / 1000); entry.crc32 = (int)(crc.getValue() & 0xFFFFFFFF); writeEntry(entry); } }; return entry; }
[ "public", "GZIPArchive", ".", "WriteEntry", "getEntry", "(", "final", "String", "name", ",", "final", "String", "comment", ",", "final", "Date", "creationDate", ")", "{", "crc", ".", "reset", "(", ")", ";", "deflater", ".", "reset", "(", ")", ";", "defla...
Returns an object that can be used to write an entry in the GZIP archive. In order to write the actual entry, one must write the entry content on the {@link GZIPArchive.WriteEntry#deflater} and, at the end, call its <code>close()</code> method (to actually write the compressed content). @param name the name of the entry. @param comment the comment of the entry. @param creationDate the date in which the entry has been created.
[ "Returns", "an", "object", "that", "can", "be", "used", "to", "write", "an", "entry", "in", "the", "GZIP", "archive", "." ]
train
https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/io/gzarc/GZIPArchiveWriter.java#L127-L171
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/PagedWidget.java
PagedWidget.setModel
public void setModel (DataModel<T> model, int page) { _model = model; displayPage(page, true); }
java
public void setModel (DataModel<T> model, int page) { _model = model; displayPage(page, true); }
[ "public", "void", "setModel", "(", "DataModel", "<", "T", ">", "model", ",", "int", "page", ")", "{", "_model", "=", "model", ";", "displayPage", "(", "page", ",", "true", ")", ";", "}" ]
Configures this panel with a {@link DataModel} and kicks the data retrieval off by requesting the specified page to be displayed.
[ "Configures", "this", "panel", "with", "a", "{" ]
train
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/PagedWidget.java#L129-L133
alkacon/opencms-core
src/org/opencms/main/CmsSessionManager.java
CmsSessionManager.sendBroadcast
public void sendBroadcast(CmsUser fromUser, String message, CmsUser toUser) { if (CmsStringUtil.isEmptyOrWhitespaceOnly(message)) { // don't broadcast empty messages return; } // create the broadcast CmsBroadcast broadcast = new CmsBroadcast(fromUser, message); List<CmsSessionInfo> userSessions = getSessionInfos(toUser.getId()); Iterator<CmsSessionInfo> i = userSessions.iterator(); // send the broadcast to all sessions of the selected user while (i.hasNext()) { CmsSessionInfo sessionInfo = i.next(); if (m_sessionStorageProvider.get(sessionInfo.getSessionId()) != null) { // double check for concurrent modification sessionInfo.getBroadcastQueue().add(broadcast); } } }
java
public void sendBroadcast(CmsUser fromUser, String message, CmsUser toUser) { if (CmsStringUtil.isEmptyOrWhitespaceOnly(message)) { // don't broadcast empty messages return; } // create the broadcast CmsBroadcast broadcast = new CmsBroadcast(fromUser, message); List<CmsSessionInfo> userSessions = getSessionInfos(toUser.getId()); Iterator<CmsSessionInfo> i = userSessions.iterator(); // send the broadcast to all sessions of the selected user while (i.hasNext()) { CmsSessionInfo sessionInfo = i.next(); if (m_sessionStorageProvider.get(sessionInfo.getSessionId()) != null) { // double check for concurrent modification sessionInfo.getBroadcastQueue().add(broadcast); } } }
[ "public", "void", "sendBroadcast", "(", "CmsUser", "fromUser", ",", "String", "message", ",", "CmsUser", "toUser", ")", "{", "if", "(", "CmsStringUtil", ".", "isEmptyOrWhitespaceOnly", "(", "message", ")", ")", "{", "// don't broadcast empty messages", "return", "...
Sends a broadcast to all sessions of a given user.<p> The user sending the message may be a real user like <code>cms.getRequestContext().currentUser()</code> or <code>null</code> for a system message.<p> @param fromUser the user sending the broadcast @param message the message to broadcast @param toUser the target (receiver) of the broadcast
[ "Sends", "a", "broadcast", "to", "all", "sessions", "of", "a", "given", "user", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsSessionManager.java#L419-L437
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
Drawer.setSelection
public void setSelection(long identifier, boolean fireOnClick) { SelectExtension<IDrawerItem> select = getAdapter().getExtension(SelectExtension.class); if (select != null) { select.deselect(); select.selectByIdentifier(identifier, false, true); //we also have to call the general notify Pair<IDrawerItem, Integer> res = getAdapter().getItemById(identifier); if (res != null) { Integer position = res.second; notifySelect(position != null ? position : -1, fireOnClick); } } }
java
public void setSelection(long identifier, boolean fireOnClick) { SelectExtension<IDrawerItem> select = getAdapter().getExtension(SelectExtension.class); if (select != null) { select.deselect(); select.selectByIdentifier(identifier, false, true); //we also have to call the general notify Pair<IDrawerItem, Integer> res = getAdapter().getItemById(identifier); if (res != null) { Integer position = res.second; notifySelect(position != null ? position : -1, fireOnClick); } } }
[ "public", "void", "setSelection", "(", "long", "identifier", ",", "boolean", "fireOnClick", ")", "{", "SelectExtension", "<", "IDrawerItem", ">", "select", "=", "getAdapter", "(", ")", ".", "getExtension", "(", "SelectExtension", ".", "class", ")", ";", "if", ...
set the current selection in the drawer NOTE: This will trigger onDrawerItemSelected without a view if you pass fireOnClick = true; @param identifier the identifier to search for @param fireOnClick true if the click listener should be called
[ "set", "the", "current", "selection", "in", "the", "drawer", "NOTE", ":", "This", "will", "trigger", "onDrawerItemSelected", "without", "a", "view", "if", "you", "pass", "fireOnClick", "=", "true", ";" ]
train
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L532-L545
UrielCh/ovh-java-sdk
ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java
ApiOvhEmailexchange.organizationName_service_exchangeService_device_identity_GET
public OvhExchangeServiceDevice organizationName_service_exchangeService_device_identity_GET(String organizationName, String exchangeService, String identity) throws IOException { String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/device/{identity}"; StringBuilder sb = path(qPath, organizationName, exchangeService, identity); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhExchangeServiceDevice.class); }
java
public OvhExchangeServiceDevice organizationName_service_exchangeService_device_identity_GET(String organizationName, String exchangeService, String identity) throws IOException { String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/device/{identity}"; StringBuilder sb = path(qPath, organizationName, exchangeService, identity); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhExchangeServiceDevice.class); }
[ "public", "OvhExchangeServiceDevice", "organizationName_service_exchangeService_device_identity_GET", "(", "String", "organizationName", ",", "String", "exchangeService", ",", "String", "identity", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/email/exchange/{o...
Get this object properties REST: GET /email/exchange/{organizationName}/service/{exchangeService}/device/{identity} @param organizationName [required] The internal name of your exchange organization @param exchangeService [required] The internal name of your exchange service @param identity [required] Exchange identity
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L2218-L2223
udoprog/ffwd-client-java
src/main/java/com/google/protobuf250/AbstractMessage.java
AbstractMessage.hashFields
@SuppressWarnings("unchecked") protected int hashFields(int hash, Map<FieldDescriptor, Object> map) { for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) { FieldDescriptor field = entry.getKey(); Object value = entry.getValue(); hash = (37 * hash) + field.getNumber(); if (field.getType() != FieldDescriptor.Type.ENUM){ hash = (53 * hash) + value.hashCode(); } else if (field.isRepeated()) { List<? extends EnumLite> list = (List<? extends EnumLite>) value; hash = (53 * hash) + hashEnumList(list); } else { hash = (53 * hash) + hashEnum((EnumLite) value); } } return hash; }
java
@SuppressWarnings("unchecked") protected int hashFields(int hash, Map<FieldDescriptor, Object> map) { for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) { FieldDescriptor field = entry.getKey(); Object value = entry.getValue(); hash = (37 * hash) + field.getNumber(); if (field.getType() != FieldDescriptor.Type.ENUM){ hash = (53 * hash) + value.hashCode(); } else if (field.isRepeated()) { List<? extends EnumLite> list = (List<? extends EnumLite>) value; hash = (53 * hash) + hashEnumList(list); } else { hash = (53 * hash) + hashEnum((EnumLite) value); } } return hash; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "int", "hashFields", "(", "int", "hash", ",", "Map", "<", "FieldDescriptor", ",", "Object", ">", "map", ")", "{", "for", "(", "Map", ".", "Entry", "<", "FieldDescriptor", ",", "Object", ">", ...
Get a hash code for given fields and values, using the given seed.
[ "Get", "a", "hash", "code", "for", "given", "fields", "and", "values", "using", "the", "given", "seed", "." ]
train
https://github.com/udoprog/ffwd-client-java/blob/b4161d2b138e3edb8fa9420cc3cc653d5764cf5b/src/main/java/com/google/protobuf250/AbstractMessage.java#L197-L213
Azure/azure-sdk-for-java
compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java
VirtualMachineScaleSetsInner.deleteInstances
public OperationStatusResponseInner deleteInstances(String resourceGroupName, String vmScaleSetName, List<String> instanceIds) { return deleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); }
java
public OperationStatusResponseInner deleteInstances(String resourceGroupName, String vmScaleSetName, List<String> instanceIds) { return deleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); }
[ "public", "OperationStatusResponseInner", "deleteInstances", "(", "String", "resourceGroupName", ",", "String", "vmScaleSetName", ",", "List", "<", "String", ">", "instanceIds", ")", "{", "return", "deleteInstancesWithServiceResponseAsync", "(", "resourceGroupName", ",", ...
Deletes virtual machines in a VM scale set. @param resourceGroupName The name of the resource group. @param vmScaleSetName The name of the VM scale set. @param instanceIds The virtual machine scale set instance ids. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the OperationStatusResponseInner object if successful.
[ "Deletes", "virtual", "machines", "in", "a", "VM", "scale", "set", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L1120-L1122
mguymon/naether
src/main/java/com/tobedevoured/naether/maven/Project.java
Project.addDependency
public void addDependency(String notation, String scope ) { Map<String, String> notationMap = Notation.parse(notation); Dependency dependency = new Dependency(); dependency.setGroupId(notationMap.get("groupId")); dependency.setArtifactId(notationMap.get("artifactId")); dependency.setType(notationMap.get("type")); dependency.setVersion(notationMap.get("version")); dependency.setScope( scope ); addDependency(dependency); }
java
public void addDependency(String notation, String scope ) { Map<String, String> notationMap = Notation.parse(notation); Dependency dependency = new Dependency(); dependency.setGroupId(notationMap.get("groupId")); dependency.setArtifactId(notationMap.get("artifactId")); dependency.setType(notationMap.get("type")); dependency.setVersion(notationMap.get("version")); dependency.setScope( scope ); addDependency(dependency); }
[ "public", "void", "addDependency", "(", "String", "notation", ",", "String", "scope", ")", "{", "Map", "<", "String", ",", "String", ">", "notationMap", "=", "Notation", ".", "parse", "(", "notation", ")", ";", "Dependency", "dependency", "=", "new", "Depe...
Add a Dependency by String notation @param notation String @param scope String
[ "Add", "a", "Dependency", "by", "String", "notation" ]
train
https://github.com/mguymon/naether/blob/218d8fd36c0b8b6e16d66e5715975570b4560ec4/src/main/java/com/tobedevoured/naether/maven/Project.java#L401-L410
apereo/cas
support/cas-server-support-saml-mdui-core/src/main/java/org/apereo/cas/support/saml/mdui/AbstractMetadataResolverAdapter.java
AbstractMetadataResolverAdapter.loadMetadataFromResource
private List<MetadataResolver> loadMetadataFromResource(final MetadataFilter metadataFilter, final Resource resource, final String entityId) { LOGGER.debug("Evaluating metadata resource [{}]", resource.getFilename()); try (val in = getResourceInputStream(resource, entityId)) { if (in.available() > 0 && in.markSupported()) { LOGGER.debug("Parsing [{}]", resource.getFilename()); val document = this.configBean.getParserPool().parse(in); return buildSingleMetadataResolver(metadataFilter, resource, document); } LOGGER.warn("Input stream from resource [{}] appears empty. Moving on...", resource.getFilename()); } catch (final Exception e) { LOGGER.warn("Could not retrieve input stream from resource. Moving on...", e); } return new ArrayList<>(0); }
java
private List<MetadataResolver> loadMetadataFromResource(final MetadataFilter metadataFilter, final Resource resource, final String entityId) { LOGGER.debug("Evaluating metadata resource [{}]", resource.getFilename()); try (val in = getResourceInputStream(resource, entityId)) { if (in.available() > 0 && in.markSupported()) { LOGGER.debug("Parsing [{}]", resource.getFilename()); val document = this.configBean.getParserPool().parse(in); return buildSingleMetadataResolver(metadataFilter, resource, document); } LOGGER.warn("Input stream from resource [{}] appears empty. Moving on...", resource.getFilename()); } catch (final Exception e) { LOGGER.warn("Could not retrieve input stream from resource. Moving on...", e); } return new ArrayList<>(0); }
[ "private", "List", "<", "MetadataResolver", ">", "loadMetadataFromResource", "(", "final", "MetadataFilter", "metadataFilter", ",", "final", "Resource", "resource", ",", "final", "String", "entityId", ")", "{", "LOGGER", ".", "debug", "(", "\"Evaluating metadata resou...
Load metadata from resource. @param metadataFilter the metadata filter @param resource the resource @param entityId the entity id @return the list
[ "Load", "metadata", "from", "resource", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-mdui-core/src/main/java/org/apereo/cas/support/saml/mdui/AbstractMetadataResolverAdapter.java#L139-L152
facebookarchive/hadoop-20
src/core/org/apache/hadoop/util/DataChecksum.java
DataChecksum.newDataChecksum
public static DataChecksum newDataChecksum( byte bytes[], int offset ) { if ( offset < 0 || bytes.length < offset + HEADER_LEN ) { return null; } // like readInt(): int bytesPerChecksum = getIntFromBytes(bytes, offset + 1); return newDataChecksum( bytes[offset], bytesPerChecksum ); }
java
public static DataChecksum newDataChecksum( byte bytes[], int offset ) { if ( offset < 0 || bytes.length < offset + HEADER_LEN ) { return null; } // like readInt(): int bytesPerChecksum = getIntFromBytes(bytes, offset + 1); return newDataChecksum( bytes[offset], bytesPerChecksum ); }
[ "public", "static", "DataChecksum", "newDataChecksum", "(", "byte", "bytes", "[", "]", ",", "int", "offset", ")", "{", "if", "(", "offset", "<", "0", "||", "bytes", ".", "length", "<", "offset", "+", "HEADER_LEN", ")", "{", "return", "null", ";", "}", ...
Creates a DataChecksum from HEADER_LEN bytes from arr[offset]. @return DataChecksum of the type in the array or null in case of an error.
[ "Creates", "a", "DataChecksum", "from", "HEADER_LEN", "bytes", "from", "arr", "[", "offset", "]", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/DataChecksum.java#L115-L123
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java
TldVarianceFilter.computeVariance
protected double computeVariance(int x0, int y0, int x1, int y1) { // can use unsafe operations here since x0 > 0 and y0 > 0 double square = GIntegralImageOps.block_unsafe(integralSq, x0 - 1, y0 - 1, x1 - 1, y1 - 1); double area = (x1-x0)*(y1-y0); double mean = GIntegralImageOps.block_unsafe(integral, x0 - 1, y0 - 1, x1 - 1, y1 - 1)/area; return square/area - mean*mean; }
java
protected double computeVariance(int x0, int y0, int x1, int y1) { // can use unsafe operations here since x0 > 0 and y0 > 0 double square = GIntegralImageOps.block_unsafe(integralSq, x0 - 1, y0 - 1, x1 - 1, y1 - 1); double area = (x1-x0)*(y1-y0); double mean = GIntegralImageOps.block_unsafe(integral, x0 - 1, y0 - 1, x1 - 1, y1 - 1)/area; return square/area - mean*mean; }
[ "protected", "double", "computeVariance", "(", "int", "x0", ",", "int", "y0", ",", "int", "x1", ",", "int", "y1", ")", "{", "// can use unsafe operations here since x0 > 0 and y0 > 0", "double", "square", "=", "GIntegralImageOps", ".", "block_unsafe", "(", "integral...
Computes the variance inside the specified rectangle. x0 and y0 must be &gt; 0. @return variance
[ "Computes", "the", "variance", "inside", "the", "specified", "rectangle", ".", "x0", "and", "y0", "must", "be", "&gt", ";", "0", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java#L106-L114
OpenTSDB/opentsdb
src/tools/ConfigArgP.java
ConfigArgP.loadConfig
protected static Properties loadConfig(String source, InputStream is) { try { Properties p = new Properties(); p.load(is); // trim the value as it may have trailing white-space Set<String> keys = p.stringPropertyNames(); for(String key: keys) { p.setProperty(key, p.getProperty(key).trim()); } return p; } catch (IllegalArgumentException iae) { throw iae; } catch (Exception ex) { throw new IllegalArgumentException("Failed to load configuration from [" + source + "]"); } }
java
protected static Properties loadConfig(String source, InputStream is) { try { Properties p = new Properties(); p.load(is); // trim the value as it may have trailing white-space Set<String> keys = p.stringPropertyNames(); for(String key: keys) { p.setProperty(key, p.getProperty(key).trim()); } return p; } catch (IllegalArgumentException iae) { throw iae; } catch (Exception ex) { throw new IllegalArgumentException("Failed to load configuration from [" + source + "]"); } }
[ "protected", "static", "Properties", "loadConfig", "(", "String", "source", ",", "InputStream", "is", ")", "{", "try", "{", "Properties", "p", "=", "new", "Properties", "(", ")", ";", "p", ".", "load", "(", "is", ")", ";", "// trim the value as it may have t...
Loads properties from the passed input stream @param source The name of the source the properties are being loaded from @param is The input stream to load from @return the loaded properties
[ "Loads", "properties", "from", "the", "passed", "input", "stream" ]
train
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/ConfigArgP.java#L240-L255
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/PgCallableStatement.java
PgCallableStatement.registerOutParameter
@Override public void registerOutParameter(int parameterIndex, int sqlType) throws SQLException { checkClosed(); switch (sqlType) { case Types.TINYINT: // we don't have a TINYINT type use SMALLINT sqlType = Types.SMALLINT; break; case Types.LONGVARCHAR: sqlType = Types.VARCHAR; break; case Types.DECIMAL: sqlType = Types.NUMERIC; break; case Types.FLOAT: // float is the same as double sqlType = Types.DOUBLE; break; case Types.VARBINARY: case Types.LONGVARBINARY: sqlType = Types.BINARY; break; case Types.BOOLEAN: sqlType = Types.BIT; break; default: break; } if (!isFunction) { throw new PSQLException( GT.tr( "This statement does not declare an OUT parameter. Use '{' ?= call ... '}' to declare one."), PSQLState.STATEMENT_NOT_ALLOWED_IN_FUNCTION_CALL); } checkIndex(parameterIndex, false); preparedParameters.registerOutParameter(parameterIndex, sqlType); // functionReturnType contains the user supplied value to check // testReturn contains a modified version to make it easier to // check the getXXX methods.. functionReturnType[parameterIndex - 1] = sqlType; testReturn[parameterIndex - 1] = sqlType; if (functionReturnType[parameterIndex - 1] == Types.CHAR || functionReturnType[parameterIndex - 1] == Types.LONGVARCHAR) { testReturn[parameterIndex - 1] = Types.VARCHAR; } else if (functionReturnType[parameterIndex - 1] == Types.FLOAT) { testReturn[parameterIndex - 1] = Types.REAL; // changes to streamline later error checking } returnTypeSet = true; }
java
@Override public void registerOutParameter(int parameterIndex, int sqlType) throws SQLException { checkClosed(); switch (sqlType) { case Types.TINYINT: // we don't have a TINYINT type use SMALLINT sqlType = Types.SMALLINT; break; case Types.LONGVARCHAR: sqlType = Types.VARCHAR; break; case Types.DECIMAL: sqlType = Types.NUMERIC; break; case Types.FLOAT: // float is the same as double sqlType = Types.DOUBLE; break; case Types.VARBINARY: case Types.LONGVARBINARY: sqlType = Types.BINARY; break; case Types.BOOLEAN: sqlType = Types.BIT; break; default: break; } if (!isFunction) { throw new PSQLException( GT.tr( "This statement does not declare an OUT parameter. Use '{' ?= call ... '}' to declare one."), PSQLState.STATEMENT_NOT_ALLOWED_IN_FUNCTION_CALL); } checkIndex(parameterIndex, false); preparedParameters.registerOutParameter(parameterIndex, sqlType); // functionReturnType contains the user supplied value to check // testReturn contains a modified version to make it easier to // check the getXXX methods.. functionReturnType[parameterIndex - 1] = sqlType; testReturn[parameterIndex - 1] = sqlType; if (functionReturnType[parameterIndex - 1] == Types.CHAR || functionReturnType[parameterIndex - 1] == Types.LONGVARCHAR) { testReturn[parameterIndex - 1] = Types.VARCHAR; } else if (functionReturnType[parameterIndex - 1] == Types.FLOAT) { testReturn[parameterIndex - 1] = Types.REAL; // changes to streamline later error checking } returnTypeSet = true; }
[ "@", "Override", "public", "void", "registerOutParameter", "(", "int", "parameterIndex", ",", "int", "sqlType", ")", "throws", "SQLException", "{", "checkClosed", "(", ")", ";", "switch", "(", "sqlType", ")", "{", "case", "Types", ".", "TINYINT", ":", "// we...
{@inheritDoc} <p>Before executing a stored procedure call you must explicitly call registerOutParameter to register the java.sql.Type of each out parameter.</p> <p>Note: When reading the value of an out parameter, you must use the getXXX method whose Java type XXX corresponds to the parameter's registered SQL type.</p> <p>ONLY 1 RETURN PARAMETER if {?= call ..} syntax is used</p> @param parameterIndex the first parameter is 1, the second is 2,... @param sqlType SQL type code defined by java.sql.Types; for parameters of type Numeric or Decimal use the version of registerOutParameter that accepts a scale value @throws SQLException if a database-access error occurs.
[ "{", "@inheritDoc", "}" ]
train
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgCallableStatement.java#L174-L225
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/GeoPackageCache.java
GeoPackageCache.getOrOpen
private GeoPackage getOrOpen(String name, File file, boolean cache) { GeoPackage geoPackage = get(name); if (geoPackage == null) { geoPackage = GeoPackageManager.open(name, file); if (cache) { add(geoPackage); } } return geoPackage; }
java
private GeoPackage getOrOpen(String name, File file, boolean cache) { GeoPackage geoPackage = get(name); if (geoPackage == null) { geoPackage = GeoPackageManager.open(name, file); if (cache) { add(geoPackage); } } return geoPackage; }
[ "private", "GeoPackage", "getOrOpen", "(", "String", "name", ",", "File", "file", ",", "boolean", "cache", ")", "{", "GeoPackage", "geoPackage", "=", "get", "(", "name", ")", ";", "if", "(", "geoPackage", "==", "null", ")", "{", "geoPackage", "=", "GeoPa...
Get the cached GeoPackage or open the GeoPackage file without caching it @param name GeoPackage name @param file GeoPackage file @param cache true to cache opened GeoPackages @return GeoPackage
[ "Get", "the", "cached", "GeoPackage", "or", "open", "the", "GeoPackage", "file", "without", "caching", "it" ]
train
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/GeoPackageCache.java#L83-L92
jbundle/jbundle
app/program/script/src/main/java/org/jbundle/app/program/script/data/importfix/base/MergeData.java
MergeData.readDestRecord
public boolean readDestRecord(FieldList recSource, Record recDest) { FieldInfo fldSecond = recSource.getField("Name"); if (fldSecond == null) fldSecond = recSource.getField("Description"); if (fldSecond == null) return false; recDest = BaseFixData.getRecordFromDescription(fldSecond.toString(), fldSecond.getFieldName(), recDest); return (recDest != null); }
java
public boolean readDestRecord(FieldList recSource, Record recDest) { FieldInfo fldSecond = recSource.getField("Name"); if (fldSecond == null) fldSecond = recSource.getField("Description"); if (fldSecond == null) return false; recDest = BaseFixData.getRecordFromDescription(fldSecond.toString(), fldSecond.getFieldName(), recDest); return (recDest != null); }
[ "public", "boolean", "readDestRecord", "(", "FieldList", "recSource", ",", "Record", "recDest", ")", "{", "FieldInfo", "fldSecond", "=", "recSource", ".", "getField", "(", "\"Name\"", ")", ";", "if", "(", "fldSecond", "==", "null", ")", "fldSecond", "=", "re...
Given this source record, read the destination record. @param recSource The source record @param recDest The destination record @return True if found.
[ "Given", "this", "source", "record", "read", "the", "destination", "record", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/script/src/main/java/org/jbundle/app/program/script/data/importfix/base/MergeData.java#L139-L148
vanilladb/vanillacore
src/main/java/org/vanilladb/core/storage/file/FileMgr.java
FileMgr.getFileChannel
private IoChannel getFileChannel(String fileName) throws IOException { synchronized (prepareAnchor(fileName)) { IoChannel fileChannel = openFiles.get(fileName); if (fileChannel == null) { File dbFile = fileName.equals(DEFAULT_LOG_FILE) ? new File(logDirectory, fileName) : new File(dbDirectory, fileName); fileChannel = IoAllocator.newIoChannel(dbFile); openFiles.put(fileName, fileChannel); } return fileChannel; } }
java
private IoChannel getFileChannel(String fileName) throws IOException { synchronized (prepareAnchor(fileName)) { IoChannel fileChannel = openFiles.get(fileName); if (fileChannel == null) { File dbFile = fileName.equals(DEFAULT_LOG_FILE) ? new File(logDirectory, fileName) : new File(dbDirectory, fileName); fileChannel = IoAllocator.newIoChannel(dbFile); openFiles.put(fileName, fileChannel); } return fileChannel; } }
[ "private", "IoChannel", "getFileChannel", "(", "String", "fileName", ")", "throws", "IOException", "{", "synchronized", "(", "prepareAnchor", "(", "fileName", ")", ")", "{", "IoChannel", "fileChannel", "=", "openFiles", ".", "get", "(", "fileName", ")", ";", "...
Returns the file channel for the specified filename. The file channel is stored in a map keyed on the filename. If the file is not open, then it is opened and the file channel is added to the map. @param fileName the specified filename @return the file channel associated with the open file. @throws IOException
[ "Returns", "the", "file", "channel", "for", "the", "specified", "filename", ".", "The", "file", "channel", "is", "stored", "in", "a", "map", "keyed", "on", "the", "filename", ".", "If", "the", "file", "is", "not", "open", "then", "it", "is", "opened", ...
train
https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/file/FileMgr.java#L241-L255
structurizr/java
structurizr-core/src/com/structurizr/documentation/StructurizrDocumentationTemplate.java
StructurizrDocumentationTemplate.addDataSection
@Nonnull public Section addDataSection(@Nullable SoftwareSystem softwareSystem, File... files) throws IOException { return addSection(softwareSystem, "Data", files); }
java
@Nonnull public Section addDataSection(@Nullable SoftwareSystem softwareSystem, File... files) throws IOException { return addSection(softwareSystem, "Data", files); }
[ "@", "Nonnull", "public", "Section", "addDataSection", "(", "@", "Nullable", "SoftwareSystem", "softwareSystem", ",", "File", "...", "files", ")", "throws", "IOException", "{", "return", "addSection", "(", "softwareSystem", ",", "\"Data\"", ",", "files", ")", ";...
Adds a "Data" section relating to a {@link SoftwareSystem} from one or more files. @param softwareSystem the {@link SoftwareSystem} the documentation content relates to @param files one or more File objects that point to the documentation content @return a documentation {@link Section} @throws IOException if there is an error reading the files
[ "Adds", "a", "Data", "section", "relating", "to", "a", "{", "@link", "SoftwareSystem", "}", "from", "one", "or", "more", "files", "." ]
train
https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/documentation/StructurizrDocumentationTemplate.java#L291-L294
craftercms/profile
security-provider/src/main/java/org/craftercms/security/processors/impl/UrlAccessRestrictionCheckingProcessor.java
UrlAccessRestrictionCheckingProcessor.processRequest
public void processRequest(RequestContext context, RequestSecurityProcessorChain processorChain) throws Exception { Map<String, Expression> urlRestrictions = getUrlRestrictions(); if (MapUtils.isNotEmpty(urlRestrictions)) { HttpServletRequest request = context.getRequest(); String requestUrl = getRequestUrl(context.getRequest()); logger.debug("Checking access restrictions for URL {}", requestUrl); for (Map.Entry<String, Expression> entry : urlRestrictions.entrySet()) { String urlPattern = entry.getKey(); Expression expression = entry.getValue(); if (pathMatcher.match(urlPattern, requestUrl)) { logger.debug("Checking restriction [{} => {}]", requestUrl, expression.getExpressionString()); if (isAccessAllowed(request, expression)) { logger.debug("Restriction [{}' => {}] evaluated to true for user: access allowed", requestUrl, expression.getExpressionString()); break; } else { throw new AccessDeniedException("Restriction ['" + requestUrl + "' => " + expression.getExpressionString() + "] evaluated to false " + "for user: access denied"); } } } } processorChain.processRequest(context); }
java
public void processRequest(RequestContext context, RequestSecurityProcessorChain processorChain) throws Exception { Map<String, Expression> urlRestrictions = getUrlRestrictions(); if (MapUtils.isNotEmpty(urlRestrictions)) { HttpServletRequest request = context.getRequest(); String requestUrl = getRequestUrl(context.getRequest()); logger.debug("Checking access restrictions for URL {}", requestUrl); for (Map.Entry<String, Expression> entry : urlRestrictions.entrySet()) { String urlPattern = entry.getKey(); Expression expression = entry.getValue(); if (pathMatcher.match(urlPattern, requestUrl)) { logger.debug("Checking restriction [{} => {}]", requestUrl, expression.getExpressionString()); if (isAccessAllowed(request, expression)) { logger.debug("Restriction [{}' => {}] evaluated to true for user: access allowed", requestUrl, expression.getExpressionString()); break; } else { throw new AccessDeniedException("Restriction ['" + requestUrl + "' => " + expression.getExpressionString() + "] evaluated to false " + "for user: access denied"); } } } } processorChain.processRequest(context); }
[ "public", "void", "processRequest", "(", "RequestContext", "context", ",", "RequestSecurityProcessorChain", "processorChain", ")", "throws", "Exception", "{", "Map", "<", "String", ",", "Expression", ">", "urlRestrictions", "=", "getUrlRestrictions", "(", ")", ";", ...
Matches the request URL against the keys of the {@code restriction} map, which are ANT-style path patterns. If a key matches, the value is interpreted as a Spring EL expression, the expression is executed, and if it returns true, the processor chain is continued, if not an {@link AccessDeniedException} is thrown. @param context the context which holds the current request and response @param processorChain the processor chain, used to call the next processor
[ "Matches", "the", "request", "URL", "against", "the", "keys", "of", "the", "{", "@code", "restriction", "}", "map", "which", "are", "ANT", "-", "style", "path", "patterns", ".", "If", "a", "key", "matches", "the", "value", "is", "interpreted", "as", "a",...
train
https://github.com/craftercms/profile/blob/d829c1136b0fd21d87dc925cb7046cbd38a300a4/security-provider/src/main/java/org/craftercms/security/processors/impl/UrlAccessRestrictionCheckingProcessor.java#L118-L149
logic-ng/LogicNG
src/main/java/org/logicng/solvers/MiniSat.java
MiniSat.createAssignment
private Assignment createAssignment(final LNGBooleanVector vec, final LNGIntVector relevantIndices) { final Assignment model = new Assignment(); if (relevantIndices == null) { for (int i = 0; i < vec.size(); i++) { model.addLiteral(this.f.literal(this.solver.nameForIdx(i), vec.get(i))); } } else { for (int i = 0; i < relevantIndices.size(); i++) { final int index = relevantIndices.get(i); if (index != -1) { model.addLiteral(this.f.literal(this.solver.nameForIdx(index), vec.get(index))); } } } return model; }
java
private Assignment createAssignment(final LNGBooleanVector vec, final LNGIntVector relevantIndices) { final Assignment model = new Assignment(); if (relevantIndices == null) { for (int i = 0; i < vec.size(); i++) { model.addLiteral(this.f.literal(this.solver.nameForIdx(i), vec.get(i))); } } else { for (int i = 0; i < relevantIndices.size(); i++) { final int index = relevantIndices.get(i); if (index != -1) { model.addLiteral(this.f.literal(this.solver.nameForIdx(index), vec.get(index))); } } } return model; }
[ "private", "Assignment", "createAssignment", "(", "final", "LNGBooleanVector", "vec", ",", "final", "LNGIntVector", "relevantIndices", ")", "{", "final", "Assignment", "model", "=", "new", "Assignment", "(", ")", ";", "if", "(", "relevantIndices", "==", "null", ...
Creates an assignment from a Boolean vector of the solver. @param vec the vector of the solver @param relevantIndices the solver's indices of the relevant variables for the model. If {@code null}, all variables are relevant. @return the assignment
[ "Creates", "an", "assignment", "from", "a", "Boolean", "vector", "of", "the", "solver", "." ]
train
https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/MiniSat.java#L489-L504
opsmatters/opsmatters-core
src/main/java/com/opsmatters/core/util/StringUtilities.java
StringUtilities.getWildcardMatcher
public static Matcher getWildcardMatcher(String str, String expr) { return getWildcardMatcher(str, expr, false); }
java
public static Matcher getWildcardMatcher(String str, String expr) { return getWildcardMatcher(str, expr, false); }
[ "public", "static", "Matcher", "getWildcardMatcher", "(", "String", "str", ",", "String", "expr", ")", "{", "return", "getWildcardMatcher", "(", "str", ",", "expr", ",", "false", ")", ";", "}" ]
Returns <CODE>true</CODE> if the given string matches the given regular expression. @param str The string against which the expression is to be matched @param expr The regular expression to match with the input string @return An object giving the results of the search (or null if no match found)
[ "Returns", "<CODE", ">", "true<", "/", "CODE", ">", "if", "the", "given", "string", "matches", "the", "given", "regular", "expression", "." ]
train
https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/StringUtilities.java#L334-L337
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.readResultSet
private void readResultSet(Buffer buffer, Results results) throws SQLException { long fieldCount = buffer.getLengthEncodedNumeric(); try { //read columns information's ColumnInformation[] ci = new ColumnInformation[(int) fieldCount]; for (int i = 0; i < fieldCount; i++) { ci[i] = new ColumnInformation(reader.getPacket(false)); } boolean callableResult = false; if (!eofDeprecated) { //read EOF packet //EOF status is mandatory because : // - Call query will have an callable resultSet for OUT parameters // -> this resultSet must be identified and not listed in JDBC statement.getResultSet() // - after a callable resultSet, a OK packet is send, but mysql does send the a bad "more result flag" Buffer bufferEof = reader.getPacket(true); if (bufferEof.readByte() != EOF) { //using IOException to close connection, throw new IOException( "Packets out of order when reading field packets, expected was EOF stream." + ((options.enablePacketDebug) ? getTraces() : "Packet contents (hex) = " + Utils.hexdump(options.maxQuerySizeToLog, 0, bufferEof.limit, bufferEof.buf))); } bufferEof.skipBytes(2); //Skip warningCount callableResult = (bufferEof.readShort() & ServerStatus.PS_OUT_PARAMETERS) != 0; } //read resultSet SelectResultSet selectResultSet; if (results.getResultSetConcurrency() == ResultSet.CONCUR_READ_ONLY) { selectResultSet = new SelectResultSet(ci, results, this, reader, callableResult, eofDeprecated); } else { //remove fetch size to permit updating results without creating new connection results.removeFetchSize(); selectResultSet = new UpdatableResultSet(ci, results, this, reader, callableResult, eofDeprecated); } results.addResultSet(selectResultSet, hasMoreResults() || results.getFetchSize() > 0); } catch (IOException e) { throw handleIoException(e); } }
java
private void readResultSet(Buffer buffer, Results results) throws SQLException { long fieldCount = buffer.getLengthEncodedNumeric(); try { //read columns information's ColumnInformation[] ci = new ColumnInformation[(int) fieldCount]; for (int i = 0; i < fieldCount; i++) { ci[i] = new ColumnInformation(reader.getPacket(false)); } boolean callableResult = false; if (!eofDeprecated) { //read EOF packet //EOF status is mandatory because : // - Call query will have an callable resultSet for OUT parameters // -> this resultSet must be identified and not listed in JDBC statement.getResultSet() // - after a callable resultSet, a OK packet is send, but mysql does send the a bad "more result flag" Buffer bufferEof = reader.getPacket(true); if (bufferEof.readByte() != EOF) { //using IOException to close connection, throw new IOException( "Packets out of order when reading field packets, expected was EOF stream." + ((options.enablePacketDebug) ? getTraces() : "Packet contents (hex) = " + Utils.hexdump(options.maxQuerySizeToLog, 0, bufferEof.limit, bufferEof.buf))); } bufferEof.skipBytes(2); //Skip warningCount callableResult = (bufferEof.readShort() & ServerStatus.PS_OUT_PARAMETERS) != 0; } //read resultSet SelectResultSet selectResultSet; if (results.getResultSetConcurrency() == ResultSet.CONCUR_READ_ONLY) { selectResultSet = new SelectResultSet(ci, results, this, reader, callableResult, eofDeprecated); } else { //remove fetch size to permit updating results without creating new connection results.removeFetchSize(); selectResultSet = new UpdatableResultSet(ci, results, this, reader, callableResult, eofDeprecated); } results.addResultSet(selectResultSet, hasMoreResults() || results.getFetchSize() > 0); } catch (IOException e) { throw handleIoException(e); } }
[ "private", "void", "readResultSet", "(", "Buffer", "buffer", ",", "Results", "results", ")", "throws", "SQLException", "{", "long", "fieldCount", "=", "buffer", ".", "getLengthEncodedNumeric", "(", ")", ";", "try", "{", "//read columns information's", "ColumnInforma...
Read ResultSet Packet. @param buffer current buffer @param results result object @throws SQLException if sub-result connection fail @see <a href="https://mariadb.com/kb/en/mariadb/resultset/">resultSet packets</a>
[ "Read", "ResultSet", "Packet", "." ]
train
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1688-L1735
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/kdtree/KDTree.java
KDTree.nn
public Pair<Double, INDArray> nn(INDArray point) { return nn(root, point, rect, Double.POSITIVE_INFINITY, null, 0); }
java
public Pair<Double, INDArray> nn(INDArray point) { return nn(root, point, rect, Double.POSITIVE_INFINITY, null, 0); }
[ "public", "Pair", "<", "Double", ",", "INDArray", ">", "nn", "(", "INDArray", "point", ")", "{", "return", "nn", "(", "root", ",", "point", ",", "rect", ",", "Double", ".", "POSITIVE_INFINITY", ",", "null", ",", "0", ")", ";", "}" ]
Query for nearest neighbor. Returns the distance and point @param point the point to query for @return
[ "Query", "for", "nearest", "neighbor", ".", "Returns", "the", "distance", "and", "point" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/kdtree/KDTree.java#L167-L169
b3dgs/lionengine
lionengine-core/src/main/java/com/b3dgs/lionengine/Resolution.java
Resolution.getScaled
public Resolution getScaled(double factorX, double factorY) { Check.superiorStrict(factorX, 0); Check.superiorStrict(factorY, 0); return new Resolution((int) (width * factorX), (int) (height * factorY), rate); }
java
public Resolution getScaled(double factorX, double factorY) { Check.superiorStrict(factorX, 0); Check.superiorStrict(factorY, 0); return new Resolution((int) (width * factorX), (int) (height * factorY), rate); }
[ "public", "Resolution", "getScaled", "(", "double", "factorX", ",", "double", "factorY", ")", "{", "Check", ".", "superiorStrict", "(", "factorX", ",", "0", ")", ";", "Check", ".", "superiorStrict", "(", "factorY", ",", "0", ")", ";", "return", "new", "R...
Get scaled resolution. @param factorX The horizontal scale factor (strictly superior to 0). @param factorY The vertical scale factor (strictly superior to 0). @return The scaled resolution. @throws LionEngineException If invalid arguments.
[ "Get", "scaled", "resolution", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/Resolution.java#L99-L105
j-easy/easy-random
easy-random-core/src/main/java/org/jeasy/random/randomizers/range/YearRangeRandomizer.java
YearRangeRandomizer.aNewYearRangeRandomizer
public static YearRangeRandomizer aNewYearRangeRandomizer(final Year min, final Year max, final long seed) { return new YearRangeRandomizer(min, max, seed); }
java
public static YearRangeRandomizer aNewYearRangeRandomizer(final Year min, final Year max, final long seed) { return new YearRangeRandomizer(min, max, seed); }
[ "public", "static", "YearRangeRandomizer", "aNewYearRangeRandomizer", "(", "final", "Year", "min", ",", "final", "Year", "max", ",", "final", "long", "seed", ")", "{", "return", "new", "YearRangeRandomizer", "(", "min", ",", "max", ",", "seed", ")", ";", "}"...
Create a new {@link YearRangeRandomizer}. @param min min value @param max max value @param seed initial seed @return a new {@link YearRangeRandomizer}.
[ "Create", "a", "new", "{", "@link", "YearRangeRandomizer", "}", "." ]
train
https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/randomizers/range/YearRangeRandomizer.java#L76-L78
eclipse/xtext-extras
org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/serializer/AbstractXbaseSemanticSequencer.java
AbstractXbaseSemanticSequencer.sequence_XWhileExpression
protected void sequence_XWhileExpression(ISerializationContext context, XWhileExpression semanticObject) { if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject, XbasePackage.Literals.XABSTRACT_WHILE_EXPRESSION__PREDICATE) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, XbasePackage.Literals.XABSTRACT_WHILE_EXPRESSION__PREDICATE)); if (transientValues.isValueTransient(semanticObject, XbasePackage.Literals.XABSTRACT_WHILE_EXPRESSION__BODY) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, XbasePackage.Literals.XABSTRACT_WHILE_EXPRESSION__BODY)); } SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); feeder.accept(grammarAccess.getXWhileExpressionAccess().getPredicateXExpressionParserRuleCall_3_0(), semanticObject.getPredicate()); feeder.accept(grammarAccess.getXWhileExpressionAccess().getBodyXExpressionParserRuleCall_5_0(), semanticObject.getBody()); feeder.finish(); }
java
protected void sequence_XWhileExpression(ISerializationContext context, XWhileExpression semanticObject) { if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject, XbasePackage.Literals.XABSTRACT_WHILE_EXPRESSION__PREDICATE) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, XbasePackage.Literals.XABSTRACT_WHILE_EXPRESSION__PREDICATE)); if (transientValues.isValueTransient(semanticObject, XbasePackage.Literals.XABSTRACT_WHILE_EXPRESSION__BODY) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, XbasePackage.Literals.XABSTRACT_WHILE_EXPRESSION__BODY)); } SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); feeder.accept(grammarAccess.getXWhileExpressionAccess().getPredicateXExpressionParserRuleCall_3_0(), semanticObject.getPredicate()); feeder.accept(grammarAccess.getXWhileExpressionAccess().getBodyXExpressionParserRuleCall_5_0(), semanticObject.getBody()); feeder.finish(); }
[ "protected", "void", "sequence_XWhileExpression", "(", "ISerializationContext", "context", ",", "XWhileExpression", "semanticObject", ")", "{", "if", "(", "errorAcceptor", "!=", "null", ")", "{", "if", "(", "transientValues", ".", "isValueTransient", "(", "semanticObj...
Contexts: XExpression returns XWhileExpression XAssignment returns XWhileExpression XAssignment.XBinaryOperation_1_1_0_0_0 returns XWhileExpression XOrExpression returns XWhileExpression XOrExpression.XBinaryOperation_1_0_0_0 returns XWhileExpression XAndExpression returns XWhileExpression XAndExpression.XBinaryOperation_1_0_0_0 returns XWhileExpression XEqualityExpression returns XWhileExpression XEqualityExpression.XBinaryOperation_1_0_0_0 returns XWhileExpression XRelationalExpression returns XWhileExpression XRelationalExpression.XInstanceOfExpression_1_0_0_0_0 returns XWhileExpression XRelationalExpression.XBinaryOperation_1_1_0_0_0 returns XWhileExpression XOtherOperatorExpression returns XWhileExpression XOtherOperatorExpression.XBinaryOperation_1_0_0_0 returns XWhileExpression XAdditiveExpression returns XWhileExpression XAdditiveExpression.XBinaryOperation_1_0_0_0 returns XWhileExpression XMultiplicativeExpression returns XWhileExpression XMultiplicativeExpression.XBinaryOperation_1_0_0_0 returns XWhileExpression XUnaryOperation returns XWhileExpression XCastedExpression returns XWhileExpression XCastedExpression.XCastedExpression_1_0_0_0 returns XWhileExpression XPostfixOperation returns XWhileExpression XPostfixOperation.XPostfixOperation_1_0_0 returns XWhileExpression XMemberFeatureCall returns XWhileExpression XMemberFeatureCall.XAssignment_1_0_0_0_0 returns XWhileExpression XMemberFeatureCall.XMemberFeatureCall_1_1_0_0_0 returns XWhileExpression XPrimaryExpression returns XWhileExpression XParenthesizedExpression returns XWhileExpression XWhileExpression returns XWhileExpression XExpressionOrVarDeclaration returns XWhileExpression Constraint: (predicate=XExpression body=XExpression)
[ "Contexts", ":", "XExpression", "returns", "XWhileExpression", "XAssignment", "returns", "XWhileExpression", "XAssignment", ".", "XBinaryOperation_1_1_0_0_0", "returns", "XWhileExpression", "XOrExpression", "returns", "XWhileExpression", "XOrExpression", ".", "XBinaryOperation_1_...
train
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/serializer/AbstractXbaseSemanticSequencer.java#L1832-L1843
mozilla/rhino
src/org/mozilla/javascript/MemberBox.java
MemberBox.writeMember
private static void writeMember(ObjectOutputStream out, Executable member) throws IOException { if (member == null) { out.writeBoolean(false); return; } out.writeBoolean(true); if (!(member instanceof Method || member instanceof Constructor)) throw new IllegalArgumentException("not Method or Constructor"); out.writeBoolean(member instanceof Method); out.writeObject(member.getName()); out.writeObject(member.getDeclaringClass()); writeParameters(out, member.getParameterTypes()); }
java
private static void writeMember(ObjectOutputStream out, Executable member) throws IOException { if (member == null) { out.writeBoolean(false); return; } out.writeBoolean(true); if (!(member instanceof Method || member instanceof Constructor)) throw new IllegalArgumentException("not Method or Constructor"); out.writeBoolean(member instanceof Method); out.writeObject(member.getName()); out.writeObject(member.getDeclaringClass()); writeParameters(out, member.getParameterTypes()); }
[ "private", "static", "void", "writeMember", "(", "ObjectOutputStream", "out", ",", "Executable", "member", ")", "throws", "IOException", "{", "if", "(", "member", "==", "null", ")", "{", "out", ".", "writeBoolean", "(", "false", ")", ";", "return", ";", "}...
Writes a Constructor or Method object. Methods and Constructors are not serializable, so we must serialize information about the class, the name, and the parameters and recreate upon deserialization.
[ "Writes", "a", "Constructor", "or", "Method", "object", "." ]
train
https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/MemberBox.java#L227-L241
jpaoletti/java-presentation-manager
modules/jpm-core/src/main/java/jpaoletti/jpm/util/Properties.java
Properties.getInt
public Integer getInt(String name, Integer def) { final String s = getProperty(name); try { return Integer.parseInt(s); } catch (Exception e) { return def; } }
java
public Integer getInt(String name, Integer def) { final String s = getProperty(name); try { return Integer.parseInt(s); } catch (Exception e) { return def; } }
[ "public", "Integer", "getInt", "(", "String", "name", ",", "Integer", "def", ")", "{", "final", "String", "s", "=", "getProperty", "(", "name", ")", ";", "try", "{", "return", "Integer", ".", "parseInt", "(", "s", ")", ";", "}", "catch", "(", "Except...
Returns the property assuming its an int. If it isn't or if its not defined, returns default value @param name Property name @param def Default value @return Property value or def
[ "Returns", "the", "property", "assuming", "its", "an", "int", ".", "If", "it", "isn", "t", "or", "if", "its", "not", "defined", "returns", "default", "value" ]
train
https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/util/Properties.java#L48-L55
apache/flink
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/AnalyticHelper.java
AnalyticHelper.getAccumulator
public <A> A getAccumulator(ExecutionEnvironment env, String accumulatorName) { JobExecutionResult result = env.getLastJobExecutionResult(); Preconditions.checkNotNull(result, "No result found for job, was execute() called before getting the result?"); return result.getAccumulatorResult(id + SEPARATOR + accumulatorName); }
java
public <A> A getAccumulator(ExecutionEnvironment env, String accumulatorName) { JobExecutionResult result = env.getLastJobExecutionResult(); Preconditions.checkNotNull(result, "No result found for job, was execute() called before getting the result?"); return result.getAccumulatorResult(id + SEPARATOR + accumulatorName); }
[ "public", "<", "A", ">", "A", "getAccumulator", "(", "ExecutionEnvironment", "env", ",", "String", "accumulatorName", ")", "{", "JobExecutionResult", "result", "=", "env", ".", "getLastJobExecutionResult", "(", ")", ";", "Preconditions", ".", "checkNotNull", "(", ...
Gets the accumulator with the given name. Returns {@code null}, if no accumulator with that name was produced. @param accumulatorName The name of the accumulator @param <A> The generic type of the accumulator value @return The value of the accumulator with the given name
[ "Gets", "the", "accumulator", "with", "the", "given", "name", ".", "Returns", "{", "@code", "null", "}", "if", "no", "accumulator", "with", "that", "name", "was", "produced", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/AnalyticHelper.java#L78-L84
andkulikov/Transitions-Everywhere
library(1.x)/src/main/java/com/transitionseverywhere/PatternPathMotion.java
PatternPathMotion.setPatternPath
public void setPatternPath(@Nullable Path patternPath) { PathMeasure pathMeasure = new PathMeasure(patternPath, false); float length = pathMeasure.getLength(); float[] pos = new float[2]; pathMeasure.getPosTan(length, pos, null); float endX = pos[0]; float endY = pos[1]; pathMeasure.getPosTan(0, pos, null); float startX = pos[0]; float startY = pos[1]; if (startX == endX && startY == endY) { throw new IllegalArgumentException("pattern must not end at the starting point"); } mTempMatrix.setTranslate(-startX, -startY); float dx = endX - startX; float dy = endY - startY; float distance = (float) Math.hypot(dx, dy); float scale = 1 / distance; mTempMatrix.postScale(scale, scale); double angle = Math.atan2(dy, dx); mTempMatrix.postRotate((float) Math.toDegrees(-angle)); if (patternPath != null) { patternPath.transform(mTempMatrix, mPatternPath); } mOriginalPatternPath = patternPath; }
java
public void setPatternPath(@Nullable Path patternPath) { PathMeasure pathMeasure = new PathMeasure(patternPath, false); float length = pathMeasure.getLength(); float[] pos = new float[2]; pathMeasure.getPosTan(length, pos, null); float endX = pos[0]; float endY = pos[1]; pathMeasure.getPosTan(0, pos, null); float startX = pos[0]; float startY = pos[1]; if (startX == endX && startY == endY) { throw new IllegalArgumentException("pattern must not end at the starting point"); } mTempMatrix.setTranslate(-startX, -startY); float dx = endX - startX; float dy = endY - startY; float distance = (float) Math.hypot(dx, dy); float scale = 1 / distance; mTempMatrix.postScale(scale, scale); double angle = Math.atan2(dy, dx); mTempMatrix.postRotate((float) Math.toDegrees(-angle)); if (patternPath != null) { patternPath.transform(mTempMatrix, mPatternPath); } mOriginalPatternPath = patternPath; }
[ "public", "void", "setPatternPath", "(", "@", "Nullable", "Path", "patternPath", ")", "{", "PathMeasure", "pathMeasure", "=", "new", "PathMeasure", "(", "patternPath", ",", "false", ")", ";", "float", "length", "=", "pathMeasure", ".", "getLength", "(", ")", ...
Sets the Path defining a pattern of motion between two coordinates. The pattern will be translated, rotated, and scaled to fit between the start and end points. The pattern must not be empty and must have the end point differ from the start point. @param patternPath A Path to be used as a pattern for two-dimensional motion. @attr ref android.R.styleable#PatternPathMotion_patternPathData
[ "Sets", "the", "Path", "defining", "a", "pattern", "of", "motion", "between", "two", "coordinates", ".", "The", "pattern", "will", "be", "translated", "rotated", "and", "scaled", "to", "fit", "between", "the", "start", "and", "end", "points", ".", "The", "...
train
https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/PatternPathMotion.java#L106-L133
matthewhorridge/owlapi-gwt
owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLNamedIndividualImpl_CustomFieldSerializer.java
OWLNamedIndividualImpl_CustomFieldSerializer.serializeInstance
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLNamedIndividualImpl instance) throws SerializationException { serialize(streamWriter, instance); }
java
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLNamedIndividualImpl instance) throws SerializationException { serialize(streamWriter, instance); }
[ "@", "Override", "public", "void", "serializeInstance", "(", "SerializationStreamWriter", "streamWriter", ",", "OWLNamedIndividualImpl", "instance", ")", "throws", "SerializationException", "{", "serialize", "(", "streamWriter", ",", "instance", ")", ";", "}" ]
Serializes the content of the object into the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter}. @param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the object's content to @param instance the object instance to serialize @throws com.google.gwt.user.client.rpc.SerializationException if the serialization operation is not successful
[ "Serializes", "the", "content", "of", "the", "object", "into", "the", "{" ]
train
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLNamedIndividualImpl_CustomFieldSerializer.java#L63-L66
wg/lettuce
src/main/java/com/lambdaworks/redis/protocol/Command.java
Command.await
public boolean await(long timeout, TimeUnit unit) { try { return latch.await(timeout, unit); } catch (InterruptedException e) { throw new RedisCommandInterruptedException(e); } }
java
public boolean await(long timeout, TimeUnit unit) { try { return latch.await(timeout, unit); } catch (InterruptedException e) { throw new RedisCommandInterruptedException(e); } }
[ "public", "boolean", "await", "(", "long", "timeout", ",", "TimeUnit", "unit", ")", "{", "try", "{", "return", "latch", ".", "await", "(", "timeout", ",", "unit", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "throw", "new", "Redi...
Wait up to the specified time for the command output to become available. @param timeout Maximum time to wait for a result. @param unit Unit of time for the timeout. @return true if the output became available.
[ "Wait", "up", "to", "the", "specified", "time", "for", "the", "command", "output", "to", "become", "available", "." ]
train
https://github.com/wg/lettuce/blob/5141640dc8289ff3af07b44a87020cef719c5f4a/src/main/java/com/lambdaworks/redis/protocol/Command.java#L128-L134
datastax/java-driver
query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java
SchemaBuilder.createFunction
@NonNull public static CreateFunctionStart createFunction( @Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier functionName) { return new DefaultCreateFunction(keyspace, functionName); }
java
@NonNull public static CreateFunctionStart createFunction( @Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier functionName) { return new DefaultCreateFunction(keyspace, functionName); }
[ "@", "NonNull", "public", "static", "CreateFunctionStart", "createFunction", "(", "@", "Nullable", "CqlIdentifier", "keyspace", ",", "@", "NonNull", "CqlIdentifier", "functionName", ")", "{", "return", "new", "DefaultCreateFunction", "(", "keyspace", ",", "functionNam...
Starts a CREATE FUNCTION query with the given function name for the given keyspace name.
[ "Starts", "a", "CREATE", "FUNCTION", "query", "with", "the", "given", "function", "name", "for", "the", "given", "keyspace", "name", "." ]
train
https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java#L480-L484
JOML-CI/JOML
src/org/joml/Matrix4f.java
Matrix4f.translationRotateScaleInvert
public Matrix4f translationRotateScaleInvert(float tx, float ty, float tz, float qx, float qy, float qz, float qw, float sx, float sy, float sz) { boolean one = Math.abs(sx) == 1.0f && Math.abs(sy) == 1.0f && Math.abs(sz) == 1.0f; if (one) return translationRotateScale(tx, ty, tz, qx, qy, qz, qw, sx, sy, sz).invertOrthonormal(this); float nqx = -qx, nqy = -qy, nqz = -qz; float dqx = nqx + nqx; float dqy = nqy + nqy; float dqz = nqz + nqz; float q00 = dqx * nqx; float q11 = dqy * nqy; float q22 = dqz * nqz; float q01 = dqx * nqy; float q02 = dqx * nqz; float q03 = dqx * qw; float q12 = dqy * nqz; float q13 = dqy * qw; float q23 = dqz * qw; float isx = 1/sx, isy = 1/sy, isz = 1/sz; this._m00(isx * (1.0f - q11 - q22)); this._m01(isy * (q01 + q23)); this._m02(isz * (q02 - q13)); this._m03(0.0f); this._m10(isx * (q01 - q23)); this._m11(isy * (1.0f - q22 - q00)); this._m12(isz * (q12 + q03)); this._m13(0.0f); this._m20(isx * (q02 + q13)); this._m21(isy * (q12 - q03)); this._m22(isz * (1.0f - q11 - q00)); this._m23(0.0f); this._m30(-m00 * tx - m10 * ty - m20 * tz); this._m31(-m01 * tx - m11 * ty - m21 * tz); this._m32(-m02 * tx - m12 * ty - m22 * tz); this._m33(1.0f); _properties(PROPERTY_AFFINE); return this; }
java
public Matrix4f translationRotateScaleInvert(float tx, float ty, float tz, float qx, float qy, float qz, float qw, float sx, float sy, float sz) { boolean one = Math.abs(sx) == 1.0f && Math.abs(sy) == 1.0f && Math.abs(sz) == 1.0f; if (one) return translationRotateScale(tx, ty, tz, qx, qy, qz, qw, sx, sy, sz).invertOrthonormal(this); float nqx = -qx, nqy = -qy, nqz = -qz; float dqx = nqx + nqx; float dqy = nqy + nqy; float dqz = nqz + nqz; float q00 = dqx * nqx; float q11 = dqy * nqy; float q22 = dqz * nqz; float q01 = dqx * nqy; float q02 = dqx * nqz; float q03 = dqx * qw; float q12 = dqy * nqz; float q13 = dqy * qw; float q23 = dqz * qw; float isx = 1/sx, isy = 1/sy, isz = 1/sz; this._m00(isx * (1.0f - q11 - q22)); this._m01(isy * (q01 + q23)); this._m02(isz * (q02 - q13)); this._m03(0.0f); this._m10(isx * (q01 - q23)); this._m11(isy * (1.0f - q22 - q00)); this._m12(isz * (q12 + q03)); this._m13(0.0f); this._m20(isx * (q02 + q13)); this._m21(isy * (q12 - q03)); this._m22(isz * (1.0f - q11 - q00)); this._m23(0.0f); this._m30(-m00 * tx - m10 * ty - m20 * tz); this._m31(-m01 * tx - m11 * ty - m21 * tz); this._m32(-m02 * tx - m12 * ty - m22 * tz); this._m33(1.0f); _properties(PROPERTY_AFFINE); return this; }
[ "public", "Matrix4f", "translationRotateScaleInvert", "(", "float", "tx", ",", "float", "ty", ",", "float", "tz", ",", "float", "qx", ",", "float", "qy", ",", "float", "qz", ",", "float", "qw", ",", "float", "sx", ",", "float", "sy", ",", "float", "sz"...
Set <code>this</code> matrix to <code>(T * R * S)<sup>-1</sup></code>, where <code>T</code> is a translation by the given <code>(tx, ty, tz)</code>, <code>R</code> is a rotation transformation specified by the quaternion <code>(qx, qy, qz, qw)</code>, and <code>S</code> is a scaling transformation which scales the three axes x, y and z by <code>(sx, sy, sz)</code>. <p> This method is equivalent to calling: <code>translationRotateScale(...).invert()</code> @see #translationRotateScale(float, float, float, float, float, float, float, float, float, float) @see #invert() @param tx the number of units by which to translate the x-component @param ty the number of units by which to translate the y-component @param tz the number of units by which to translate the z-component @param qx the x-coordinate of the vector part of the quaternion @param qy the y-coordinate of the vector part of the quaternion @param qz the z-coordinate of the vector part of the quaternion @param qw the scalar part of the quaternion @param sx the scaling factor for the x-axis @param sy the scaling factor for the y-axis @param sz the scaling factor for the z-axis @return this
[ "Set", "<code", ">", "this<", "/", "code", ">", "matrix", "to", "<code", ">", "(", "T", "*", "R", "*", "S", ")", "<sup", ">", "-", "1<", "/", "sup", ">", "<", "/", "code", ">", "where", "<code", ">", "T<", "/", "code", ">", "is", "a", "tran...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L4177-L4215
apache/reef
lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexFuture.java
VortexFuture.get
@Override public TOutput get(final long timeout, final TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException, CancellationException { if (!countDownLatch.await(timeout, unit)) { throw new TimeoutException("Waiting for the results of the task timed out. Timeout = " + timeout + " in time units: " + unit); } return get(); }
java
@Override public TOutput get(final long timeout, final TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException, CancellationException { if (!countDownLatch.await(timeout, unit)) { throw new TimeoutException("Waiting for the results of the task timed out. Timeout = " + timeout + " in time units: " + unit); } return get(); }
[ "@", "Override", "public", "TOutput", "get", "(", "final", "long", "timeout", ",", "final", "TimeUnit", "unit", ")", "throws", "InterruptedException", ",", "ExecutionException", ",", "TimeoutException", ",", "CancellationException", "{", "if", "(", "!", "countDown...
Wait a certain period of time for the result of the task. @throws TimeoutException if the timeout provided hits before the Tasklet is done. @throws InterruptedException if the thread is interrupted. @throws ExecutionException if the Tasklet execution failed to complete. @throws CancellationException if the Tasklet was cancelled.
[ "Wait", "a", "certain", "period", "of", "time", "for", "the", "result", "of", "the", "task", "." ]
train
https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexFuture.java#L168-L177
kiegroup/drools
drools-compiler/src/main/java/org/drools/compiler/builder/impl/KnowledgeBuilderImpl.java
KnowledgeBuilderImpl.addPackageFromXml
public void addPackageFromXml(final Reader reader) throws DroolsParserException, IOException { this.resource = new ReaderResource(reader, ResourceType.XDRL); final XmlPackageReader xmlReader = new XmlPackageReader(this.configuration.getSemanticModules()); xmlReader.getParser().setClassLoader(this.rootClassLoader); try { xmlReader.read(reader); } catch (final SAXException e) { throw new DroolsParserException(e.toString(), e.getCause()); } addPackage(xmlReader.getPackageDescr()); this.resource = null; }
java
public void addPackageFromXml(final Reader reader) throws DroolsParserException, IOException { this.resource = new ReaderResource(reader, ResourceType.XDRL); final XmlPackageReader xmlReader = new XmlPackageReader(this.configuration.getSemanticModules()); xmlReader.getParser().setClassLoader(this.rootClassLoader); try { xmlReader.read(reader); } catch (final SAXException e) { throw new DroolsParserException(e.toString(), e.getCause()); } addPackage(xmlReader.getPackageDescr()); this.resource = null; }
[ "public", "void", "addPackageFromXml", "(", "final", "Reader", "reader", ")", "throws", "DroolsParserException", ",", "IOException", "{", "this", ".", "resource", "=", "new", "ReaderResource", "(", "reader", ",", "ResourceType", ".", "XDRL", ")", ";", "final", ...
Load a rule package from XML source. @param reader @throws DroolsParserException @throws IOException
[ "Load", "a", "rule", "package", "from", "XML", "source", "." ]
train
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/builder/impl/KnowledgeBuilderImpl.java#L586-L601
nohana/Amalgam
amalgam/src/main/java/com/amalgam/content/pm/SignatureUtils.java
SignatureUtils.getSignatureHexCode
public static String getSignatureHexCode(Context context, String targetPackageName) { if (TextUtils.isEmpty(targetPackageName)) { return null; } try { PackageInfo info = PackageManagerUtils.getSignaturePackageInfo(context, targetPackageName); if (info.signatures.length != 1) { // multiple signature would not treated return null; } Signature sig = info.signatures[0]; byte[] sha256 = MessageDigestUtils.computeSha256(sig.toByteArray()); return StringUtils.byteToHex(sha256); } catch (NameNotFoundException e) { Log.e(TAG, "target package not found: ", e); return null; } }
java
public static String getSignatureHexCode(Context context, String targetPackageName) { if (TextUtils.isEmpty(targetPackageName)) { return null; } try { PackageInfo info = PackageManagerUtils.getSignaturePackageInfo(context, targetPackageName); if (info.signatures.length != 1) { // multiple signature would not treated return null; } Signature sig = info.signatures[0]; byte[] sha256 = MessageDigestUtils.computeSha256(sig.toByteArray()); return StringUtils.byteToHex(sha256); } catch (NameNotFoundException e) { Log.e(TAG, "target package not found: ", e); return null; } }
[ "public", "static", "String", "getSignatureHexCode", "(", "Context", "context", ",", "String", "targetPackageName", ")", "{", "if", "(", "TextUtils", ".", "isEmpty", "(", "targetPackageName", ")", ")", "{", "return", "null", ";", "}", "try", "{", "PackageInfo"...
Obtains the signature hex code. @param context the context. @param targetPackageName the target package name. @return the hex code of the signature.
[ "Obtains", "the", "signature", "hex", "code", "." ]
train
https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/content/pm/SignatureUtils.java#L80-L97
googleapis/google-cloud-java
google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequest.java
CreateTableRequest.addFamily
public CreateTableRequest addFamily(String familyId, GCRule gcRule) { Preconditions.checkNotNull(familyId); tableRequest.putColumnFamilies( familyId, ColumnFamily.newBuilder().setGcRule(gcRule.toProto()).build()); return this; }
java
public CreateTableRequest addFamily(String familyId, GCRule gcRule) { Preconditions.checkNotNull(familyId); tableRequest.putColumnFamilies( familyId, ColumnFamily.newBuilder().setGcRule(gcRule.toProto()).build()); return this; }
[ "public", "CreateTableRequest", "addFamily", "(", "String", "familyId", ",", "GCRule", "gcRule", ")", "{", "Preconditions", ".", "checkNotNull", "(", "familyId", ")", ";", "tableRequest", ".", "putColumnFamilies", "(", "familyId", ",", "ColumnFamily", ".", "newBui...
Adds a new columnFamily with {@link GCRule} to the configuration. Please note that calling this method with the same familyId will overwrite the previous family. @param familyId @param gcRule
[ "Adds", "a", "new", "columnFamily", "with", "{", "@link", "GCRule", "}", "to", "the", "configuration", ".", "Please", "note", "that", "calling", "this", "method", "with", "the", "same", "familyId", "will", "overwrite", "the", "previous", "family", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequest.java#L77-L82
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) { 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 && otherPos <= seg2.addressLimit - len) { // this -> temp buffer UNSAFE.copyMemory(this.heapMemory, thisPos, tempBuffer, BYTE_ARRAY_BASE_OFFSET, len); // other -> this UNSAFE.copyMemory(seg2.heapMemory, otherPos, this.heapMemory, thisPos, len); // temp buffer -> other UNSAFE.copyMemory(tempBuffer, BYTE_ARRAY_BASE_OFFSET, seg2.heapMemory, otherPos, len); return; } else if (this.address > this.addressLimit) { throw new IllegalStateException("this memory segment has been freed."); } else if (seg2.address > seg2.addressLimit) { throw new IllegalStateException("other memory segment has been freed."); } } // index is in fact invalid throw new IndexOutOfBoundsException( String.format("offset1=%d, offset2=%d, len=%d, bufferSize=%d, address1=%d, address2=%d", offset1, offset2, len, tempBuffer.length, this.address, seg2.address)); }
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 && otherPos <= seg2.addressLimit - len) { // this -> temp buffer UNSAFE.copyMemory(this.heapMemory, thisPos, tempBuffer, BYTE_ARRAY_BASE_OFFSET, len); // other -> this UNSAFE.copyMemory(seg2.heapMemory, otherPos, this.heapMemory, thisPos, len); // temp buffer -> other UNSAFE.copyMemory(tempBuffer, BYTE_ARRAY_BASE_OFFSET, seg2.heapMemory, otherPos, len); return; } else if (this.address > this.addressLimit) { throw new IllegalStateException("this memory segment has been freed."); } else if (seg2.address > seg2.addressLimit) { throw new IllegalStateException("other memory segment has been freed."); } } // index is in fact invalid throw new IndexOutOfBoundsException( String.format("offset1=%d, offset2=%d, len=%d, bufferSize=%d, address1=%d, address2=%d", offset1, offset2, len, tempBuffer.length, this.address, seg2.address)); }
[ "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 of the swapped memory region
[ "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
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) { 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
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) { 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); decimal = result; if (fiveScale == 0) { return; } } }
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); decimal = result; if (fiveScale == 0) { return; } } }
[ "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
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) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } final String name = createPrebuiltEntityRoleOptionalParameter != null ? createPrebuiltEntityRoleOptionalParameter.name() : null; return createPrebuiltEntityRoleWithServiceResponseAsync(appId, versionId, entityId, name); }
java
public Observable<ServiceResponse<UUID>> createPrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, CreatePrebuiltEntityRoleOptionalParameter createPrebuiltEntityRoleOptionalParameter) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } final String name = createPrebuiltEntityRoleOptionalParameter != null ? createPrebuiltEntityRoleOptionalParameter.name() : null; return createPrebuiltEntityRoleWithServiceResponseAsync(appId, versionId, entityId, name); }
[ "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 IllegalArgumentException thrown if parameters fail the validation @return the observable to the UUID object
[ "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
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) { LinkedHashMap<String, Long> values = new LinkedHashMap<String, Long>(currentMap.size()); if(currentMap.size() != previousMap.size()) { throw new IllegalArgumentException("Maps must have the same keys"); } for (Entry<String, Object> k : currentMap.entrySet()) { Object v = k.getValue(); Number current = getNumber(v); Object p = previousMap.get(k.getKey()); Number previous = null; if (p == null) { previous = 0; } else { previous = getNumber(p); } long d = (current.longValue() - previous.longValue()); values.put(k.getKey(), d); } return new NumberList(values); }
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 keys"); } for (Entry<String, Object> k : currentMap.entrySet()) { Object v = k.getValue(); Number current = getNumber(v); Object p = previousMap.get(k.getKey()); Number previous = null; if (p == null) { previous = 0; } else { previous = getNumber(p); } long d = (current.longValue() - previous.longValue()); values.put(k.getKey(), d); } return new NumberList(values); }
[ "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
haifengl/smile
core/src/main/java/smile/validation/Validation.java
Validation.loocv
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, loocv.train[i]); Regression<T> model = trainer.train(trainx, trainy); rmse += Math.sqr(model.predict(x[loocv.test[i]]) - y[loocv.test[i]]); } return Math.sqrt(rmse / n); }
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, loocv.train[i]); Regression<T> model = trainer.train(trainx, trainy); rmse += Math.sqr(model.predict(x[loocv.test[i]]) - y[loocv.test[i]]); } return Math.sqrt(rmse / n); }
[ "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
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{ return searchAllParallel(index, fetchSize,(ScrollHandler<T>)null,type,thread); }
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
algolia/algoliasearch-client-java
src/main/java/com/algolia/search/saas/APIClient.java
APIClient.setUserAgent
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); }
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
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 { CallableStatement call = null; try { call = StatementUtil.prepareCall(conn, sql, params); return call.execute(); } finally { DbUtil.close(call); } }
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
Carbonado/Carbonado
src/main/java/com/amazon/carbonado/info/ChainedProperty.java
ChainedProperty.identityEquals
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; } for (int i=0; i<length; i++) { if (a[i] != a2[i]) { return false; } } return true; }
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; } for (int i=0; i<length; i++) { if (a[i] != a2[i]) { return false; } } return true; }
[ "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
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/partition/operation/BaseMigrationOperation.java
BaseMigrationOperation.verifyPartitionStateVersion
private void verifyPartitionStateVersion() { InternalPartitionService partitionService = getService(); int localPartitionStateVersion = partitionService.getPartitionStateVersion(); if (partitionStateVersion != localPartitionStateVersion) { if (getNodeEngine().getThisAddress().equals(migrationInfo.getMaster())) { return; } // this is expected when cluster member list changes during migration throw new PartitionStateVersionMismatchException(partitionStateVersion, localPartitionStateVersion); } }
java
private void verifyPartitionStateVersion() { InternalPartitionService partitionService = getService(); int localPartitionStateVersion = partitionService.getPartitionStateVersion(); if (partitionStateVersion != localPartitionStateVersion) { if (getNodeEngine().getThisAddress().equals(migrationInfo.getMaster())) { return; } // this is expected when cluster member list changes during migration throw new PartitionStateVersionMismatchException(partitionStateVersion, localPartitionStateVersion); } }
[ "private", "void", "verifyPartitionStateVersion", "(", ")", "{", "InternalPartitionService", "partitionService", "=", "getService", "(", ")", ";", "int", "localPartitionStateVersion", "=", "partitionService", ".", "getPartitionStateVersion", "(", ")", ";", "if", "(", ...
Verifies that the sent partition state version matches the local version or this node is master.
[ "Verifies", "that", "the", "sent", "partition", "state", "version", "matches", "the", "local", "version", "or", "this", "node", "is", "master", "." ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/operation/BaseMigrationOperation.java#L118-L129
ThreeTen/threeten-extra
src/main/java/org/threeten/extra/PeriodDuration.java
PeriodDuration.of
public static PeriodDuration of(Duration duration) { Objects.requireNonNull(duration, "The duration must not be null"); return new PeriodDuration(Period.ZERO, duration); }
java
public static PeriodDuration of(Duration duration) { Objects.requireNonNull(duration, "The duration must not be null"); return new PeriodDuration(Period.ZERO, duration); }
[ "public", "static", "PeriodDuration", "of", "(", "Duration", "duration", ")", "{", "Objects", ".", "requireNonNull", "(", "duration", ",", "\"The duration must not be null\"", ")", ";", "return", "new", "PeriodDuration", "(", "Period", ".", "ZERO", ",", "duration"...
Obtains an instance based on a duration. <p> The period will be zero. @param duration the duration, not null @return the combined period-duration, not null
[ "Obtains", "an", "instance", "based", "on", "a", "duration", ".", "<p", ">", "The", "period", "will", "be", "zero", "." ]
train
https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/PeriodDuration.java#L152-L155
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/Solo.java
Solo.waitForFragmentById
public boolean waitForFragmentById(int id, int timeout){ if(config.commandLogging){ Log.d(config.commandLoggingTag, "waitForFragmentById("+id+", "+timeout+")"); } return waiter.waitForFragment(null, id, timeout); }
java
public boolean waitForFragmentById(int id, int timeout){ if(config.commandLogging){ Log.d(config.commandLoggingTag, "waitForFragmentById("+id+", "+timeout+")"); } return waiter.waitForFragment(null, id, timeout); }
[ "public", "boolean", "waitForFragmentById", "(", "int", "id", ",", "int", "timeout", ")", "{", "if", "(", "config", ".", "commandLogging", ")", "{", "Log", ".", "d", "(", "config", ".", "commandLoggingTag", ",", "\"waitForFragmentById(\"", "+", "id", "+", ...
Waits for a Fragment matching the specified resource id. @param id the R.id of the fragment @param timeout the amount of time in milliseconds to wait @return {@code true} if fragment appears and {@code false} if it does not appear before the timeout
[ "Waits", "for", "a", "Fragment", "matching", "the", "specified", "resource", "id", "." ]
train
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L3709-L3715
jbehave/jbehave-core
jbehave-core/src/main/java/org/jbehave/core/io/StoryFinder.java
StoryFinder.findPaths
public List<String> findPaths(String searchIn, String include, String exclude) { return findPaths(searchIn, asCSVList(include), asCSVList(exclude)); }
java
public List<String> findPaths(String searchIn, String include, String exclude) { return findPaths(searchIn, asCSVList(include), asCSVList(exclude)); }
[ "public", "List", "<", "String", ">", "findPaths", "(", "String", "searchIn", ",", "String", "include", ",", "String", "exclude", ")", "{", "return", "findPaths", "(", "searchIn", ",", "asCSVList", "(", "include", ")", ",", "asCSVList", "(", "exclude", ")"...
Finds paths from a source path, allowing for include/exclude patterns, which can be comma-separated values of multiple patterns. Paths found are normalised by {@link StoryFinder#normalise(List<String>)} @param searchIn the source path to search in @param include the CSV include pattern, or <code>null</code> if none @param exclude the CSV exclude pattern, or <code>null</code> if none @return A List of paths found
[ "Finds", "paths", "from", "a", "source", "path", "allowing", "for", "include", "/", "exclude", "patterns", "which", "can", "be", "comma", "-", "separated", "values", "of", "multiple", "patterns", "." ]
train
https://github.com/jbehave/jbehave-core/blob/bdd6a6199528df3c35087e72d4644870655b23e6/jbehave-core/src/main/java/org/jbehave/core/io/StoryFinder.java#L104-L106
Jasig/uPortal
uPortal-groups/uPortal-groups-filesystem/src/main/java/org/apereo/portal/groups/filesystem/FileSystemGroupStore.java
FileSystemGroupStore.findParentGroups
protected Iterator findParentGroups(IEntityGroup group) throws GroupsException { if (log.isDebugEnabled()) log.debug(DEBUG_CLASS_NAME + ".findParentGroups(): for " + group); List groups = new ArrayList(); { String typeName = group.getLeafType().getName(); File parent = getFile(group).getParentFile(); if (!parent.getName().equals(typeName)) { groups.add(find(parent)); } File root = getFileRoot(group.getLeafType()); File[] files = getAllFilesBelow(root); try { for (int i = 0; i < files.length; i++) { Collection ids = getGroupIdsFromFile(files[i]); if (ids.contains(group.getLocalKey())) { groups.add(find(files[i])); } } } catch (IOException ex) { throw new GroupsException("Problem reading group files", ex); } } return groups.iterator(); }
java
protected Iterator findParentGroups(IEntityGroup group) throws GroupsException { if (log.isDebugEnabled()) log.debug(DEBUG_CLASS_NAME + ".findParentGroups(): for " + group); List groups = new ArrayList(); { String typeName = group.getLeafType().getName(); File parent = getFile(group).getParentFile(); if (!parent.getName().equals(typeName)) { groups.add(find(parent)); } File root = getFileRoot(group.getLeafType()); File[] files = getAllFilesBelow(root); try { for (int i = 0; i < files.length; i++) { Collection ids = getGroupIdsFromFile(files[i]); if (ids.contains(group.getLocalKey())) { groups.add(find(files[i])); } } } catch (IOException ex) { throw new GroupsException("Problem reading group files", ex); } } return groups.iterator(); }
[ "protected", "Iterator", "findParentGroups", "(", "IEntityGroup", "group", ")", "throws", "GroupsException", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "log", ".", "debug", "(", "DEBUG_CLASS_NAME", "+", "\".findParentGroups(): for \"", "+", "grou...
Returns an <code>Iterator</code> over the <code>Collection</code> of <code>IEntityGroups </code> that the <code>IGroupMember</code> belongs to. @return java.util.Iterator @param group org.apereo.portal.groups.IEntityGroup
[ "Returns", "an", "<code", ">", "Iterator<", "/", "code", ">", "over", "the", "<code", ">", "Collection<", "/", "code", ">", "of", "<code", ">", "IEntityGroups", "<", "/", "code", ">", "that", "the", "<code", ">", "IGroupMember<", "/", "code", ">", "bel...
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-filesystem/src/main/java/org/apereo/portal/groups/filesystem/FileSystemGroupStore.java#L308-L333
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/logging/Logger.java
Logger.logDebug
public final void logDebug(@NonNull final Class<?> tag, @NonNull final String message) { Condition.INSTANCE.ensureNotNull(tag, "The tag may not be null"); Condition.INSTANCE.ensureNotNull(message, "The message may not be null"); Condition.INSTANCE.ensureNotEmpty(message, "The message may not be empty"); if (LogLevel.DEBUG.getRank() >= getLogLevel().getRank()) { Log.d(ClassUtil.INSTANCE.getTruncatedName(tag), message); } }
java
public final void logDebug(@NonNull final Class<?> tag, @NonNull final String message) { Condition.INSTANCE.ensureNotNull(tag, "The tag may not be null"); Condition.INSTANCE.ensureNotNull(message, "The message may not be null"); Condition.INSTANCE.ensureNotEmpty(message, "The message may not be empty"); if (LogLevel.DEBUG.getRank() >= getLogLevel().getRank()) { Log.d(ClassUtil.INSTANCE.getTruncatedName(tag), message); } }
[ "public", "final", "void", "logDebug", "(", "@", "NonNull", "final", "Class", "<", "?", ">", "tag", ",", "@", "NonNull", "final", "String", "message", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "tag", ",", "\"The tag may not be null\"...
Logs a specific message on the log level DEBUG. @param tag The tag, which identifies the source of the log message, as an instance of the class {@link Class}. The tag may not be null @param message The message, which should be logged, as a {@link String}. The message may neither be null, nor empty
[ "Logs", "a", "specific", "message", "on", "the", "log", "level", "DEBUG", "." ]
train
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/logging/Logger.java#L127-L135
OpenLiberty/open-liberty
dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/services/impl/JPAPersistenceManagerImpl.java
JPAPersistenceManagerImpl.createPsu
private PersistenceServiceUnit createPsu(int jobInstanceVersion, int jobExecutionVersion) throws Exception { return databaseStore.createPersistenceServiceUnit(getJobInstanceEntityClass(jobInstanceVersion).getClassLoader(), getJobExecutionEntityClass(jobExecutionVersion).getName(), getJobInstanceEntityClass(jobInstanceVersion).getName(), StepThreadExecutionEntity.class.getName(), StepThreadInstanceEntity.class.getName(), TopLevelStepExecutionEntity.class.getName(), TopLevelStepInstanceEntity.class.getName()); }
java
private PersistenceServiceUnit createPsu(int jobInstanceVersion, int jobExecutionVersion) throws Exception { return databaseStore.createPersistenceServiceUnit(getJobInstanceEntityClass(jobInstanceVersion).getClassLoader(), getJobExecutionEntityClass(jobExecutionVersion).getName(), getJobInstanceEntityClass(jobInstanceVersion).getName(), StepThreadExecutionEntity.class.getName(), StepThreadInstanceEntity.class.getName(), TopLevelStepExecutionEntity.class.getName(), TopLevelStepInstanceEntity.class.getName()); }
[ "private", "PersistenceServiceUnit", "createPsu", "(", "int", "jobInstanceVersion", ",", "int", "jobExecutionVersion", ")", "throws", "Exception", "{", "return", "databaseStore", ".", "createPersistenceServiceUnit", "(", "getJobInstanceEntityClass", "(", "jobInstanceVersion",...
Creates a PersistenceServiceUnit using the specified entity versions.
[ "Creates", "a", "PersistenceServiceUnit", "using", "the", "specified", "entity", "versions", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/services/impl/JPAPersistenceManagerImpl.java#L270-L278
alkacon/opencms-core
src/org/opencms/search/CmsSearchManager.java
CmsSearchManager.getDocumentFactory
public I_CmsDocumentFactory getDocumentFactory(String resourceType, String mimeType) { I_CmsDocumentFactory result = null; if (resourceType != null) { // create the factory lookup key for the document String documentTypeKey = A_CmsVfsDocument.getDocumentKey(resourceType, mimeType); // check if a setting is available for this specific MIME type result = m_documentTypes.get(documentTypeKey); if (result == null) { // no setting is available, try to use a generic setting without MIME type result = m_documentTypes.get(A_CmsVfsDocument.getDocumentKey(resourceType, null)); // please note: the result may still be null } } return result; }
java
public I_CmsDocumentFactory getDocumentFactory(String resourceType, String mimeType) { I_CmsDocumentFactory result = null; if (resourceType != null) { // create the factory lookup key for the document String documentTypeKey = A_CmsVfsDocument.getDocumentKey(resourceType, mimeType); // check if a setting is available for this specific MIME type result = m_documentTypes.get(documentTypeKey); if (result == null) { // no setting is available, try to use a generic setting without MIME type result = m_documentTypes.get(A_CmsVfsDocument.getDocumentKey(resourceType, null)); // please note: the result may still be null } } return result; }
[ "public", "I_CmsDocumentFactory", "getDocumentFactory", "(", "String", "resourceType", ",", "String", "mimeType", ")", "{", "I_CmsDocumentFactory", "result", "=", "null", ";", "if", "(", "resourceType", "!=", "null", ")", "{", "// create the factory lookup key for the d...
Returns a lucene document factory for given resource type and MIME type.<p> The type of the document factory is selected according to the configuration in <code>opencms-search.xml</code>.<p> @param resourceType the resource type name @param mimeType the MIME type @return a lucene document factory or null in case no matching factory was found
[ "Returns", "a", "lucene", "document", "factory", "for", "given", "resource", "type", "and", "MIME", "type", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchManager.java#L1141-L1156
phax/ph-commons
ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java
JAXBMarshallerHelper.setSunIndentString
public static void setSunIndentString (@Nonnull final Marshaller aMarshaller, @Nullable final String sIndentString) { final String sPropertyName = SUN_INDENT_STRING; _setProperty (aMarshaller, sPropertyName, sIndentString); }
java
public static void setSunIndentString (@Nonnull final Marshaller aMarshaller, @Nullable final String sIndentString) { final String sPropertyName = SUN_INDENT_STRING; _setProperty (aMarshaller, sPropertyName, sIndentString); }
[ "public", "static", "void", "setSunIndentString", "(", "@", "Nonnull", "final", "Marshaller", "aMarshaller", ",", "@", "Nullable", "final", "String", "sIndentString", ")", "{", "final", "String", "sPropertyName", "=", "SUN_INDENT_STRING", ";", "_setProperty", "(", ...
Set the Sun specific property for the indent string. @param aMarshaller The marshaller to set the property. May not be <code>null</code>. @param sIndentString the value to be set
[ "Set", "the", "Sun", "specific", "property", "for", "the", "indent", "string", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java#L205-L209
lastaflute/lastaflute
src/main/java/org/lastaflute/web/ruts/message/objective/ObjectiveMessageResources.java
ObjectiveMessageResources.wrapBundle
protected MessageResourceBundleObjectiveWrapper wrapBundle(String messageName, MessageResourceBundle bundle, Integer extendsLevel) { final boolean existsDefaultLangProperties = existsDefaultLangProperties(messageName); final List<MessageResourceBundle> bundleList = new ArrayList<MessageResourceBundle>(); bundleList.add(bundle); MessageResourceBundle currentBundle = bundle; int parentLevel = 1; while (true) { MessageResourceBundle parentBundle = currentBundle.getParent(); if (parentBundle == null) { break; } final boolean defaultLang = isDefaultLangBundle(existsDefaultLangProperties, parentBundle); currentBundle.setParent(createBundleWrapper(parentBundle, defaultLang, parentLevel, extendsLevel)); currentBundle = parentBundle; ++parentLevel; } return createBundleWrapper(bundle, isDefaultLangBundle(existsDefaultLangProperties, bundle), null, extendsLevel); }
java
protected MessageResourceBundleObjectiveWrapper wrapBundle(String messageName, MessageResourceBundle bundle, Integer extendsLevel) { final boolean existsDefaultLangProperties = existsDefaultLangProperties(messageName); final List<MessageResourceBundle> bundleList = new ArrayList<MessageResourceBundle>(); bundleList.add(bundle); MessageResourceBundle currentBundle = bundle; int parentLevel = 1; while (true) { MessageResourceBundle parentBundle = currentBundle.getParent(); if (parentBundle == null) { break; } final boolean defaultLang = isDefaultLangBundle(existsDefaultLangProperties, parentBundle); currentBundle.setParent(createBundleWrapper(parentBundle, defaultLang, parentLevel, extendsLevel)); currentBundle = parentBundle; ++parentLevel; } return createBundleWrapper(bundle, isDefaultLangBundle(existsDefaultLangProperties, bundle), null, extendsLevel); }
[ "protected", "MessageResourceBundleObjectiveWrapper", "wrapBundle", "(", "String", "messageName", ",", "MessageResourceBundle", "bundle", ",", "Integer", "extendsLevel", ")", "{", "final", "boolean", "existsDefaultLangProperties", "=", "existsDefaultLangProperties", "(", "mes...
Wrap the bundle with detail info of message resource. <br> The parents also wrapped. @param messageName The message name for the bundle. (NotNull) @param bundle The bundle of message resource. (NotNull) @param extendsLevel The level as integer for extends. e.g. first extends is 1 (NullAllowed: when application) @return The wrapper for the bundle. (NotNull)
[ "Wrap", "the", "bundle", "with", "detail", "info", "of", "message", "resource", ".", "<br", ">", "The", "parents", "also", "wrapped", "." ]
train
https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/ruts/message/objective/ObjectiveMessageResources.java#L545-L562
lightblueseas/file-worker
src/main/java/de/alpharogroup/file/search/FileSearchExtensions.java
FileSearchExtensions.containsFile
public static boolean containsFile(final File parent, final File search) { boolean exists = false; final String[] children = parent.list(); if (children == null) { return false; } final List<String> fileList = Arrays.asList(children); if (fileList.contains(search.getName())) { exists = true; } return exists; }
java
public static boolean containsFile(final File parent, final File search) { boolean exists = false; final String[] children = parent.list(); if (children == null) { return false; } final List<String> fileList = Arrays.asList(children); if (fileList.contains(search.getName())) { exists = true; } return exists; }
[ "public", "static", "boolean", "containsFile", "(", "final", "File", "parent", ",", "final", "File", "search", ")", "{", "boolean", "exists", "=", "false", ";", "final", "String", "[", "]", "children", "=", "parent", ".", "list", "(", ")", ";", "if", "...
Checks if the given file contains only in the parent file, not in the subdirectories. @param parent The parent directory to search. @param search The file to search. @return 's true if the file exists in the parent directory otherwise false.
[ "Checks", "if", "the", "given", "file", "contains", "only", "in", "the", "parent", "file", "not", "in", "the", "subdirectories", "." ]
train
https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/search/FileSearchExtensions.java#L55-L69
litsec/eidas-opensaml
opensaml3/src/main/java/se/litsec/eidas/opensaml/ext/RequestedAttributeTemplates.java
RequestedAttributeTemplates.CURRENT_FAMILY_NAME
public static RequestedAttribute CURRENT_FAMILY_NAME(Boolean isRequired, boolean includeFriendlyName) { return create(AttributeConstants.EIDAS_CURRENT_FAMILY_NAME_ATTRIBUTE_NAME, includeFriendlyName ? AttributeConstants.EIDAS_CURRENT_FAMILY_NAME_ATTRIBUTE_FRIENDLY_NAME : null, Attribute.URI_REFERENCE, isRequired); }
java
public static RequestedAttribute CURRENT_FAMILY_NAME(Boolean isRequired, boolean includeFriendlyName) { return create(AttributeConstants.EIDAS_CURRENT_FAMILY_NAME_ATTRIBUTE_NAME, includeFriendlyName ? AttributeConstants.EIDAS_CURRENT_FAMILY_NAME_ATTRIBUTE_FRIENDLY_NAME : null, Attribute.URI_REFERENCE, isRequired); }
[ "public", "static", "RequestedAttribute", "CURRENT_FAMILY_NAME", "(", "Boolean", "isRequired", ",", "boolean", "includeFriendlyName", ")", "{", "return", "create", "(", "AttributeConstants", ".", "EIDAS_CURRENT_FAMILY_NAME_ATTRIBUTE_NAME", ",", "includeFriendlyName", "?", "...
Creates a {@code RequestedAttribute} object for the CurrentFamilyName attribute. @param isRequired flag to tell whether the attribute is required @param includeFriendlyName flag that tells whether the friendly name should be included @return a {@code RequestedAttribute} object representing the CurrentFamilyName attribute
[ "Creates", "a", "{", "@code", "RequestedAttribute", "}", "object", "for", "the", "CurrentFamilyName", "attribute", "." ]
train
https://github.com/litsec/eidas-opensaml/blob/522ba6dba433a9524cb8a02464cc3b087b47a2b7/opensaml3/src/main/java/se/litsec/eidas/opensaml/ext/RequestedAttributeTemplates.java#L56-L60
knightliao/disconf
disconf-core/src/main/java/com/baidu/disconf/core/common/utils/OsUtil.java
OsUtil.transferFile
public static void transferFile(File src, File dest) throws Exception { // 删除文件 // LOGGER.info("start to remove download file: " + "" // + dest.getAbsolutePath()); if (dest.exists()) { dest.delete(); } // 转移临时下载文件至下载文件夹 FileUtils.copyFile(src, dest); }
java
public static void transferFile(File src, File dest) throws Exception { // 删除文件 // LOGGER.info("start to remove download file: " + "" // + dest.getAbsolutePath()); if (dest.exists()) { dest.delete(); } // 转移临时下载文件至下载文件夹 FileUtils.copyFile(src, dest); }
[ "public", "static", "void", "transferFile", "(", "File", "src", ",", "File", "dest", ")", "throws", "Exception", "{", "// 删除文件", "// LOGGER.info(\"start to remove download file: \" + \"\"", "// + dest.getAbsolutePath());", "if", "(", "dest", ".", "exists", "(", ")", "...
@param src @param dest @return void @Description: 转移文件 @author liaoqiqi @date 2013-6-20
[ "@param", "src", "@param", "dest" ]
train
https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-core/src/main/java/com/baidu/disconf/core/common/utils/OsUtil.java#L127-L138
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java
SessionDataManager.getItemByIdentifier
public ItemImpl getItemByIdentifier(String identifier, boolean pool) throws RepositoryException { return getItemByIdentifier(identifier, pool, true); }
java
public ItemImpl getItemByIdentifier(String identifier, boolean pool) throws RepositoryException { return getItemByIdentifier(identifier, pool, true); }
[ "public", "ItemImpl", "getItemByIdentifier", "(", "String", "identifier", ",", "boolean", "pool", ")", "throws", "RepositoryException", "{", "return", "getItemByIdentifier", "(", "identifier", ",", "pool", ",", "true", ")", ";", "}" ]
Return item by identifier in this transient storage then in workspace container. @param identifier - identifier of searched item @param pool - indicates does the item fall in pool @return existed item data or null if not found @throws RepositoryException
[ "Return", "item", "by", "identifier", "in", "this", "transient", "storage", "then", "in", "workspace", "container", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java#L650-L653
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/MSTransactionFactory.java
MSTransactionFactory.createAutoCommitTransaction
public ExternalAutoCommitTransaction createAutoCommitTransaction() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createAutoCommitTransaction"); ExternalAutoCommitTransaction instance = new MSAutoCommitTransaction(_ms, _persistence, getMaximumTransactionSize()); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createAutoCommitTransaction", "return="+instance); return instance; }
java
public ExternalAutoCommitTransaction createAutoCommitTransaction() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createAutoCommitTransaction"); ExternalAutoCommitTransaction instance = new MSAutoCommitTransaction(_ms, _persistence, getMaximumTransactionSize()); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createAutoCommitTransaction", "return="+instance); return instance; }
[ "public", "ExternalAutoCommitTransaction", "createAutoCommitTransaction", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createAutoCommit...
This method returns an object that represents a zero-phase or AutoCommit transaction. It can be used to ensure that a piece of work is carried out at once, essentially outside of a transaction coordination scope. @return An instance of AutoCommitTransaction
[ "This", "method", "returns", "an", "object", "that", "represents", "a", "zero", "-", "phase", "or", "AutoCommit", "transaction", ".", "It", "can", "be", "used", "to", "ensure", "that", "a", "piece", "of", "work", "is", "carried", "out", "at", "once", "es...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/MSTransactionFactory.java#L59-L67
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/JobApi.java
JobApi.getTrace
public String getTrace(Object projectIdOrPath, int jobId) throws GitLabApiException { Response response = get(Response.Status.OK, getDefaultPerPageParam(), "projects", getProjectIdOrPath(projectIdOrPath), "jobs", jobId, "trace"); return (response.readEntity(String.class)); }
java
public String getTrace(Object projectIdOrPath, int jobId) throws GitLabApiException { Response response = get(Response.Status.OK, getDefaultPerPageParam(), "projects", getProjectIdOrPath(projectIdOrPath), "jobs", jobId, "trace"); return (response.readEntity(String.class)); }
[ "public", "String", "getTrace", "(", "Object", "projectIdOrPath", ",", "int", "jobId", ")", "throws", "GitLabApiException", "{", "Response", "response", "=", "get", "(", "Response", ".", "Status", ".", "OK", ",", "getDefaultPerPageParam", "(", ")", ",", "\"pro...
Get a trace of a specific job of a project <pre><code>GitLab Endpoint: GET /projects/:id/jobs/:id/trace</code></pre> @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path to get the specified job's trace for @param jobId the job ID to get the trace for @return a String containing the specified job's trace @throws GitLabApiException if any exception occurs during execution
[ "Get", "a", "trace", "of", "a", "specific", "job", "of", "a", "project" ]
train
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/JobApi.java#L425-L429
matomo-org/piwik-java-tracker
src/main/java/org/piwik/java/tracking/PiwikRequest.java
PiwikRequest.getCustomVariable
private CustomVariable getCustomVariable(String parameter, int index){ CustomVariableList cvl = (CustomVariableList)parameters.get(parameter); if (cvl == null){ return null; } return cvl.get(index); }
java
private CustomVariable getCustomVariable(String parameter, int index){ CustomVariableList cvl = (CustomVariableList)parameters.get(parameter); if (cvl == null){ return null; } return cvl.get(index); }
[ "private", "CustomVariable", "getCustomVariable", "(", "String", "parameter", ",", "int", "index", ")", "{", "CustomVariableList", "cvl", "=", "(", "CustomVariableList", ")", "parameters", ".", "get", "(", "parameter", ")", ";", "if", "(", "cvl", "==", "null",...
Get a value that is stored in a json object at the specified parameter. @param parameter the parameter to retrieve the json object from @param key the key of the value. Cannot be null @return the value
[ "Get", "a", "value", "that", "is", "stored", "in", "a", "json", "object", "at", "the", "specified", "parameter", "." ]
train
https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikRequest.java#L1830-L1837
codeprimate-software/cp-elements
src/main/java/org/cp/elements/lang/Assert.java
Assert.isInstanceOf
public static void isInstanceOf(Object obj, Class<?> type, String message, Object... arguments) { isInstanceOf(obj, type, new IllegalTypeException(format(message, arguments))); }
java
public static void isInstanceOf(Object obj, Class<?> type, String message, Object... arguments) { isInstanceOf(obj, type, new IllegalTypeException(format(message, arguments))); }
[ "public", "static", "void", "isInstanceOf", "(", "Object", "obj", ",", "Class", "<", "?", ">", "type", ",", "String", "message", ",", "Object", "...", "arguments", ")", "{", "isInstanceOf", "(", "obj", ",", "type", ",", "new", "IllegalTypeException", "(", ...
Asserts that the given {@link Object} is an instance of the specified {@link Class type}. The assertion holds if and only if the {@link Object} is not {@literal null} and is an instance of the specified {@link Class type}. This assertion functions exactly the same as the Java {@literal instanceof} operator. @param obj {@link Object} evaluated as an instance of the {@link Class type}. @param type {@link Class type} used to evaluate the {@link Object} in the {@literal instanceof} operator. @param message {@link String} containing the message used in the {@link IllegalArgumentException} thrown if the assertion fails. @param arguments array of {@link Object arguments} used as placeholder values when formatting the {@link String message}. @throws org.cp.elements.lang.IllegalTypeException if the {@link Object} is not an instance of the specified {@link Class type}. @see #isInstanceOf(Object, Class, RuntimeException) @see java.lang.Class#isInstance(Object)
[ "Asserts", "that", "the", "given", "{", "@link", "Object", "}", "is", "an", "instance", "of", "the", "specified", "{", "@link", "Class", "type", "}", "." ]
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L719-L721
VoltDB/voltdb
src/frontend/org/voltdb/DeprecatedProcedureAPIAccess.java
DeprecatedProcedureAPIAccess.voltLoadTable
@Deprecated public static byte[] voltLoadTable(VoltProcedure procedure, String clusterName, String databaseName, String tableName, VoltTable data, boolean returnUniqueViolations, boolean shouldDRStream) throws VoltAbortException { return voltLoadTable(procedure, clusterName, databaseName, tableName, data, returnUniqueViolations, shouldDRStream, false); }
java
@Deprecated public static byte[] voltLoadTable(VoltProcedure procedure, String clusterName, String databaseName, String tableName, VoltTable data, boolean returnUniqueViolations, boolean shouldDRStream) throws VoltAbortException { return voltLoadTable(procedure, clusterName, databaseName, tableName, data, returnUniqueViolations, shouldDRStream, false); }
[ "@", "Deprecated", "public", "static", "byte", "[", "]", "voltLoadTable", "(", "VoltProcedure", "procedure", ",", "String", "clusterName", ",", "String", "databaseName", ",", "String", "tableName", ",", "VoltTable", "data", ",", "boolean", "returnUniqueViolations", ...
<p>Currently unsupported in VoltDB.</p> <p>Batch load method for populating a table with a large number of records.</p> <p>Faster than calling {@link #voltQueueSQL(SQLStmt, Expectation, Object...)} and {@link #voltExecuteSQL()} to insert one row at a time.</p> @deprecated This method is not fully tested to be used in all contexts. @param procedure {@link org.voltdb.VoltProcedure VoltProcedure} instance on which to access deprecated method. @param clusterName Name of the cluster containing the database, containing the table that the records will be loaded in. @param databaseName Name of the database containing the table to be loaded. @param tableName Name of the table records should be loaded in. @param data {@link org.voltdb.VoltTable VoltTable} containing the records to be loaded. {@link org.voltdb.VoltTable.ColumnInfo VoltTable.ColumnInfo} schema must match the schema of the table being loaded. @param returnUniqueViolations If true will not fail on unique violations, will return the violating rows. @return A byte array representing constraint violations in a semi-opaque format. @throws VoltAbortException on failure.
[ "<p", ">", "Currently", "unsupported", "in", "VoltDB", ".", "<", "/", "p", ">", "<p", ">", "Batch", "load", "method", "for", "populating", "a", "table", "with", "a", "large", "number", "of", "records", ".", "<", "/", "p", ">" ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/DeprecatedProcedureAPIAccess.java#L85-L96
docusign/docusign-java-client
src/main/java/com/docusign/esign/api/EnvelopesApi.java
EnvelopesApi.getConsumerDisclosure
public ConsumerDisclosure getConsumerDisclosure(String accountId, String envelopeId, String recipientId, String langCode) throws ApiException { return getConsumerDisclosure(accountId, envelopeId, recipientId, langCode, null); }
java
public ConsumerDisclosure getConsumerDisclosure(String accountId, String envelopeId, String recipientId, String langCode) throws ApiException { return getConsumerDisclosure(accountId, envelopeId, recipientId, langCode, null); }
[ "public", "ConsumerDisclosure", "getConsumerDisclosure", "(", "String", "accountId", ",", "String", "envelopeId", ",", "String", "recipientId", ",", "String", "langCode", ")", "throws", "ApiException", "{", "return", "getConsumerDisclosure", "(", "accountId", ",", "en...
Reserved: Gets the Electronic Record and Signature Disclosure associated with the account. Reserved: Retrieves the Electronic Record and Signature Disclosure, with HTML formatting, associated with the account. @param accountId The external account number (int) or account ID Guid. (required) @param envelopeId The envelopeId Guid of the envelope being accessed. (required) @param recipientId The ID of the recipient being accessed. (required) @param langCode The simple type enumeration the language used in the response. The supported languages, with the language value shown in parenthesis, are:Arabic (ar), Bulgarian (bg), Czech (cs), Chinese Simplified (zh_CN), Chinese Traditional (zh_TW), Croatian (hr), Danish (da), Dutch (nl), English US (en), English UK (en_GB), Estonian (et), Farsi (fa), Finnish (fi), French (fr), French Canada (fr_CA), German (de), Greek (el), Hebrew (he), Hindi (hi), Hungarian (hu), Bahasa Indonesia (id), Italian (it), Japanese (ja), Korean (ko), Latvian (lv), Lithuanian (lt), Bahasa Melayu (ms), Norwegian (no), Polish (pl), Portuguese (pt), Portuguese Brazil (pt_BR), Romanian (ro), Russian (ru), Serbian (sr), Slovak (sk), Slovenian (sl), Spanish (es),Spanish Latin America (es_MX), Swedish (sv), Thai (th), Turkish (tr), Ukrainian (uk) and Vietnamese (vi). Additionally, the value can be set to �browser� to automatically detect the browser language being used by the viewer and display the disclosure in that language. (required) @return ConsumerDisclosure
[ "Reserved", ":", "Gets", "the", "Electronic", "Record", "and", "Signature", "Disclosure", "associated", "with", "the", "account", ".", "Reserved", ":", "Retrieves", "the", "Electronic", "Record", "and", "Signature", "Disclosure", "with", "HTML", "formatting", "ass...
train
https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/EnvelopesApi.java#L1966-L1968
sebastiangraf/treetank
coremodules/node/src/main/java/org/treetank/axis/AbsAxis.java
AbsAxis.addAtomicToItemList
public static int addAtomicToItemList(final INodeReadTrx pRtx, final AtomicValue pVal) { if (!atomics.containsKey(pRtx)) { atomics.put(pRtx, new ItemList()); } return atomics.get(pRtx).addItem(pVal); }
java
public static int addAtomicToItemList(final INodeReadTrx pRtx, final AtomicValue pVal) { if (!atomics.containsKey(pRtx)) { atomics.put(pRtx, new ItemList()); } return atomics.get(pRtx).addItem(pVal); }
[ "public", "static", "int", "addAtomicToItemList", "(", "final", "INodeReadTrx", "pRtx", ",", "final", "AtomicValue", "pVal", ")", "{", "if", "(", "!", "atomics", ".", "containsKey", "(", "pRtx", ")", ")", "{", "atomics", ".", "put", "(", "pRtx", ",", "ne...
Adding any AtomicVal to any ItemList staticly. @param pRtx as key @param pVal to be added @return the index in the ItemList
[ "Adding", "any", "AtomicVal", "to", "any", "ItemList", "staticly", "." ]
train
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/coremodules/node/src/main/java/org/treetank/axis/AbsAxis.java#L264-L270
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexChangeAdapters.java
IndexChangeAdapters.forEnumeratedProperty
public static IndexChangeAdapter forEnumeratedProperty( ExecutionContext context, NodeTypePredicate matcher, String workspaceName, Name propertyName, ProvidedIndex<?> index ) { return new EnumeratedPropertyChangeAdapter(context, matcher, workspaceName, propertyName, index); }
java
public static IndexChangeAdapter forEnumeratedProperty( ExecutionContext context, NodeTypePredicate matcher, String workspaceName, Name propertyName, ProvidedIndex<?> index ) { return new EnumeratedPropertyChangeAdapter(context, matcher, workspaceName, propertyName, index); }
[ "public", "static", "IndexChangeAdapter", "forEnumeratedProperty", "(", "ExecutionContext", "context", ",", "NodeTypePredicate", "matcher", ",", "String", "workspaceName", ",", "Name", "propertyName", ",", "ProvidedIndex", "<", "?", ">", "index", ")", "{", "return", ...
Create an {@link IndexChangeAdapter} implementation that handles a enumerated properties, either single or multi-valued. @param context the execution context; may not be null @param matcher the node type matcher used to determine which nodes should be included in the index; may not be null @param workspaceName the name of the workspace; may not be null @param propertyName the name of the property; may not be null @param index the local index that should be used; may not be null @return the new {@link IndexChangeAdapter}; never null
[ "Create", "an", "{", "@link", "IndexChangeAdapter", "}", "implementation", "that", "handles", "a", "enumerated", "properties", "either", "single", "or", "multi", "-", "valued", "." ]
train
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexChangeAdapters.java#L218-L224
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/variational/VariationalAutoencoder.java
VariationalAutoencoder.generateRandomGivenZ
public INDArray generateRandomGivenZ(INDArray latentSpaceValues, LayerWorkspaceMgr workspaceMgr) { INDArray pxzDistributionPreOut = decodeGivenLatentSpaceValues(latentSpaceValues, workspaceMgr); return reconstructionDistribution.generateRandom(pxzDistributionPreOut); }
java
public INDArray generateRandomGivenZ(INDArray latentSpaceValues, LayerWorkspaceMgr workspaceMgr) { INDArray pxzDistributionPreOut = decodeGivenLatentSpaceValues(latentSpaceValues, workspaceMgr); return reconstructionDistribution.generateRandom(pxzDistributionPreOut); }
[ "public", "INDArray", "generateRandomGivenZ", "(", "INDArray", "latentSpaceValues", ",", "LayerWorkspaceMgr", "workspaceMgr", ")", "{", "INDArray", "pxzDistributionPreOut", "=", "decodeGivenLatentSpaceValues", "(", "latentSpaceValues", ",", "workspaceMgr", ")", ";", "return...
Given a specified values for the latent space as input (latent space being z in p(z|data)), randomly generate output x, where x ~ P(x|z) @param latentSpaceValues Values for the latent space. size(1) must equal nOut configuration parameter @return Sample of data: x ~ P(x|z)
[ "Given", "a", "specified", "values", "for", "the", "latent", "space", "as", "input", "(", "latent", "space", "being", "z", "in", "p", "(", "z|data", "))", "randomly", "generate", "output", "x", "where", "x", "~", "P", "(", "x|z", ")" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/variational/VariationalAutoencoder.java#L1054-L1057
lucidworks/spark-solr
src/main/java/com/lucidworks/spark/query/StreamingExpressionResultIterator.java
StreamingExpressionResultIterator.getStreamContext
protected StreamContext getStreamContext() { StreamContext context = new StreamContext(); solrClientCache = new SparkSolrClientCache(cloudSolrClient, httpSolrClient); context.setSolrClientCache(solrClientCache); return context; }
java
protected StreamContext getStreamContext() { StreamContext context = new StreamContext(); solrClientCache = new SparkSolrClientCache(cloudSolrClient, httpSolrClient); context.setSolrClientCache(solrClientCache); return context; }
[ "protected", "StreamContext", "getStreamContext", "(", ")", "{", "StreamContext", "context", "=", "new", "StreamContext", "(", ")", ";", "solrClientCache", "=", "new", "SparkSolrClientCache", "(", "cloudSolrClient", ",", "httpSolrClient", ")", ";", "context", ".", ...
We have to set the streaming context so that we can pass our own cloud client with authentication
[ "We", "have", "to", "set", "the", "streaming", "context", "so", "that", "we", "can", "pass", "our", "own", "cloud", "client", "with", "authentication" ]
train
https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/query/StreamingExpressionResultIterator.java#L92-L97
Impetus/Kundera
src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBUtils.java
CouchDBUtils.createDesignDocumentIfNotExist
public static void createDesignDocumentIfNotExist(HttpClient httpClient, HttpHost httpHost, Gson gson, String tableName, String schemaName, String viewName, List<String> columns) throws URISyntaxException, UnsupportedEncodingException, IOException, ClientProtocolException { URI uri; HttpResponse response = null; CouchDBDesignDocument designDocument = CouchDBUtils.getDesignDocument(httpClient, httpHost, gson, tableName, schemaName); Map<String, MapReduce> views = designDocument.getViews(); if (views == null) { views = new HashMap<String, MapReduce>(); } if (views.get(viewName.toString()) == null) { CouchDBUtils.createView(views, viewName, columns); } String id = CouchDBConstants.DESIGN + tableName; if (designDocument.get_rev() == null) { uri = new URI(CouchDBConstants.PROTOCOL, null, httpHost.getHostName(), httpHost.getPort(), CouchDBConstants.URL_SEPARATOR + schemaName.toLowerCase() + CouchDBConstants.URL_SEPARATOR + id, null, null); } else { StringBuilder builder = new StringBuilder("rev="); builder.append(designDocument.get_rev()); uri = new URI(CouchDBConstants.PROTOCOL, null, httpHost.getHostName(), httpHost.getPort(), CouchDBConstants.URL_SEPARATOR + schemaName.toLowerCase() + CouchDBConstants.URL_SEPARATOR + id, builder.toString(), null); } HttpPut put = new HttpPut(uri); designDocument.setViews(views); String jsonObject = gson.toJson(designDocument); StringEntity entity = new StringEntity(jsonObject); put.setEntity(entity); try { response = httpClient.execute(httpHost, put, CouchDBUtils.getContext(httpHost)); } finally { CouchDBUtils.closeContent(response); } }
java
public static void createDesignDocumentIfNotExist(HttpClient httpClient, HttpHost httpHost, Gson gson, String tableName, String schemaName, String viewName, List<String> columns) throws URISyntaxException, UnsupportedEncodingException, IOException, ClientProtocolException { URI uri; HttpResponse response = null; CouchDBDesignDocument designDocument = CouchDBUtils.getDesignDocument(httpClient, httpHost, gson, tableName, schemaName); Map<String, MapReduce> views = designDocument.getViews(); if (views == null) { views = new HashMap<String, MapReduce>(); } if (views.get(viewName.toString()) == null) { CouchDBUtils.createView(views, viewName, columns); } String id = CouchDBConstants.DESIGN + tableName; if (designDocument.get_rev() == null) { uri = new URI(CouchDBConstants.PROTOCOL, null, httpHost.getHostName(), httpHost.getPort(), CouchDBConstants.URL_SEPARATOR + schemaName.toLowerCase() + CouchDBConstants.URL_SEPARATOR + id, null, null); } else { StringBuilder builder = new StringBuilder("rev="); builder.append(designDocument.get_rev()); uri = new URI(CouchDBConstants.PROTOCOL, null, httpHost.getHostName(), httpHost.getPort(), CouchDBConstants.URL_SEPARATOR + schemaName.toLowerCase() + CouchDBConstants.URL_SEPARATOR + id, builder.toString(), null); } HttpPut put = new HttpPut(uri); designDocument.setViews(views); String jsonObject = gson.toJson(designDocument); StringEntity entity = new StringEntity(jsonObject); put.setEntity(entity); try { response = httpClient.execute(httpHost, put, CouchDBUtils.getContext(httpHost)); } finally { CouchDBUtils.closeContent(response); } }
[ "public", "static", "void", "createDesignDocumentIfNotExist", "(", "HttpClient", "httpClient", ",", "HttpHost", "httpHost", ",", "Gson", "gson", ",", "String", "tableName", ",", "String", "schemaName", ",", "String", "viewName", ",", "List", "<", "String", ">", ...
Creates the design document if not exist. @param httpClient the http client @param httpHost the http host @param gson the gson @param tableName the table name @param schemaName the schema name @param viewName the view name @param columns the columns @throws URISyntaxException the URI syntax exception @throws UnsupportedEncodingException the unsupported encoding exception @throws IOException Signals that an I/O exception has occurred. @throws ClientProtocolException the client protocol exception
[ "Creates", "the", "design", "document", "if", "not", "exist", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBUtils.java#L194-L241
sagiegurari/fax4j
src/main/java/org/fax4j/spi/java4less/RFaxFaxClientSpi.java
RFaxFaxClientSpi.submitFaxJobImpl
@Override protected void submitFaxJobImpl(FaxJob faxJob) { try { this.submitFaxJobViaFaxModem(faxJob); } catch(RuntimeException exception) { throw exception; } catch(Exception exception) { throw new FaxException("Unable to send fax via fax modem.",exception); } }
java
@Override protected void submitFaxJobImpl(FaxJob faxJob) { try { this.submitFaxJobViaFaxModem(faxJob); } catch(RuntimeException exception) { throw exception; } catch(Exception exception) { throw new FaxException("Unable to send fax via fax modem.",exception); } }
[ "@", "Override", "protected", "void", "submitFaxJobImpl", "(", "FaxJob", "faxJob", ")", "{", "try", "{", "this", ".", "submitFaxJobViaFaxModem", "(", "faxJob", ")", ";", "}", "catch", "(", "RuntimeException", "exception", ")", "{", "throw", "exception", ";", ...
This function will submit a new fax job.<br> The fax job ID may be populated by this method in the provided fax job object. @param faxJob The fax job object containing the needed information
[ "This", "function", "will", "submit", "a", "new", "fax", "job", ".", "<br", ">", "The", "fax", "job", "ID", "may", "be", "populated", "by", "this", "method", "in", "the", "provided", "fax", "job", "object", "." ]
train
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/java4less/RFaxFaxClientSpi.java#L204-L219
Azure/azure-sdk-for-java
locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java
ManagementLocksInner.createOrUpdateAtResourceGroupLevelAsync
public Observable<ManagementLockObjectInner> createOrUpdateAtResourceGroupLevelAsync(String resourceGroupName, String lockName, ManagementLockObjectInner parameters) { return createOrUpdateAtResourceGroupLevelWithServiceResponseAsync(resourceGroupName, lockName, parameters).map(new Func1<ServiceResponse<ManagementLockObjectInner>, ManagementLockObjectInner>() { @Override public ManagementLockObjectInner call(ServiceResponse<ManagementLockObjectInner> response) { return response.body(); } }); }
java
public Observable<ManagementLockObjectInner> createOrUpdateAtResourceGroupLevelAsync(String resourceGroupName, String lockName, ManagementLockObjectInner parameters) { return createOrUpdateAtResourceGroupLevelWithServiceResponseAsync(resourceGroupName, lockName, parameters).map(new Func1<ServiceResponse<ManagementLockObjectInner>, ManagementLockObjectInner>() { @Override public ManagementLockObjectInner call(ServiceResponse<ManagementLockObjectInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "ManagementLockObjectInner", ">", "createOrUpdateAtResourceGroupLevelAsync", "(", "String", "resourceGroupName", ",", "String", "lockName", ",", "ManagementLockObjectInner", "parameters", ")", "{", "return", "createOrUpdateAtResourceGroupLevelWithServ...
Creates or updates a management lock at the resource group level. When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. @param resourceGroupName The name of the resource group to lock. @param lockName The lock name. The lock name can be a maximum of 260 characters. It cannot contain &lt;, &gt; %, &amp;, :, \, ?, /, or any control characters. @param parameters The management lock parameters. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the ManagementLockObjectInner object
[ "Creates", "or", "updates", "a", "management", "lock", "at", "the", "resource", "group", "level", ".", "When", "you", "apply", "a", "lock", "at", "a", "parent", "scope", "all", "child", "resources", "inherit", "the", "same", "lock", ".", "To", "create", ...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java#L181-L188
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/IssueManager.java
IssueManager.getSavedQueries
public List<SavedQuery> getSavedQueries(String projectKey) throws RedmineException { Set<NameValuePair> params = new HashSet<>(); if ((projectKey != null) && (projectKey.length() > 0)) { params.add(new BasicNameValuePair("project_id", projectKey)); } return transport.getObjectsList(SavedQuery.class, params); }
java
public List<SavedQuery> getSavedQueries(String projectKey) throws RedmineException { Set<NameValuePair> params = new HashSet<>(); if ((projectKey != null) && (projectKey.length() > 0)) { params.add(new BasicNameValuePair("project_id", projectKey)); } return transport.getObjectsList(SavedQuery.class, params); }
[ "public", "List", "<", "SavedQuery", ">", "getSavedQueries", "(", "String", "projectKey", ")", "throws", "RedmineException", "{", "Set", "<", "NameValuePair", ">", "params", "=", "new", "HashSet", "<>", "(", ")", ";", "if", "(", "(", "projectKey", "!=", "n...
Get "saved queries" for the given project available to the current user. <p>This REST API feature was added in Redmine 1.3.0. See http://www.redmine.org/issues/5737</p>
[ "Get", "saved", "queries", "for", "the", "given", "project", "available", "to", "the", "current", "user", "." ]
train
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/IssueManager.java#L326-L334
haifengl/smile
core/src/main/java/smile/association/ARM.java
ARM.learn
private long learn(PrintStream out, List<AssociationRule> list, int[] itemset, int support, double confidence) { long n = 0; // Determine combinations int[][] combinations = getPowerSet(itemset); // Loop through combinations for (int i = 0; i < combinations.length; i++) { // Find complement of combination in given itemSet int[] complement = getComplement(combinations[i], itemset); // If complement is not empty generate rule if (complement != null) { double arc = getConfidence(combinations[i], support); if (arc >= confidence) { double supp = (double) support / fim.size(); AssociationRule ar = new AssociationRule(combinations[i], complement, supp, arc); n++; if (out != null) { out.println(ar); } if (list != null) { list.add(ar); } } } } return n; }
java
private long learn(PrintStream out, List<AssociationRule> list, int[] itemset, int support, double confidence) { long n = 0; // Determine combinations int[][] combinations = getPowerSet(itemset); // Loop through combinations for (int i = 0; i < combinations.length; i++) { // Find complement of combination in given itemSet int[] complement = getComplement(combinations[i], itemset); // If complement is not empty generate rule if (complement != null) { double arc = getConfidence(combinations[i], support); if (arc >= confidence) { double supp = (double) support / fim.size(); AssociationRule ar = new AssociationRule(combinations[i], complement, supp, arc); n++; if (out != null) { out.println(ar); } if (list != null) { list.add(ar); } } } } return n; }
[ "private", "long", "learn", "(", "PrintStream", "out", ",", "List", "<", "AssociationRule", ">", "list", ",", "int", "[", "]", "itemset", ",", "int", "support", ",", "double", "confidence", ")", "{", "long", "n", "=", "0", ";", "// Determine combinations",...
Generates all association rules for a given item set. @param itemset the given frequent item set. @param support the associated support value for the item set. @param confidence the confidence threshold for association rules.
[ "Generates", "all", "association", "rules", "for", "a", "given", "item", "set", "." ]
train
https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/association/ARM.java#L171-L200
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.deleteServerGroup
public List<ServerGroup> deleteServerGroup(int serverGroupId) { ArrayList<ServerGroup> groups = new ArrayList<ServerGroup>(); try { JSONArray serverArray = new JSONArray(doDelete(BASE_SERVERGROUP + "/" + serverGroupId, null)); for (int i = 0; i < serverArray.length(); i++) { JSONObject jsonServerGroup = serverArray.getJSONObject(i); ServerGroup group = getServerGroupFromJSON(jsonServerGroup); groups.add(group); } } catch (Exception e) { e.printStackTrace(); return null; } return groups; }
java
public List<ServerGroup> deleteServerGroup(int serverGroupId) { ArrayList<ServerGroup> groups = new ArrayList<ServerGroup>(); try { JSONArray serverArray = new JSONArray(doDelete(BASE_SERVERGROUP + "/" + serverGroupId, null)); for (int i = 0; i < serverArray.length(); i++) { JSONObject jsonServerGroup = serverArray.getJSONObject(i); ServerGroup group = getServerGroupFromJSON(jsonServerGroup); groups.add(group); } } catch (Exception e) { e.printStackTrace(); return null; } return groups; }
[ "public", "List", "<", "ServerGroup", ">", "deleteServerGroup", "(", "int", "serverGroupId", ")", "{", "ArrayList", "<", "ServerGroup", ">", "groups", "=", "new", "ArrayList", "<", "ServerGroup", ">", "(", ")", ";", "try", "{", "JSONArray", "serverArray", "=...
Delete a server group @param serverGroupId ID of serverGroup @return Collection of active Server Groups
[ "Delete", "a", "server", "group" ]
train
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L1228-L1242
Red5/red5-io
src/main/java/org/red5/io/amf/Input.java
Input.readKeyValues
protected void readKeyValues(Map<String, Object> result) { while (hasMoreProperties()) { String name = readPropertyName(); log.debug("property: {}", name); Object property = Deserializer.deserialize(this, Object.class); log.debug("val: {}", property); result.put(name, property); if (hasMoreProperties()) { skipPropertySeparator(); } else { break; } } }
java
protected void readKeyValues(Map<String, Object> result) { while (hasMoreProperties()) { String name = readPropertyName(); log.debug("property: {}", name); Object property = Deserializer.deserialize(this, Object.class); log.debug("val: {}", property); result.put(name, property); if (hasMoreProperties()) { skipPropertySeparator(); } else { break; } } }
[ "protected", "void", "readKeyValues", "(", "Map", "<", "String", ",", "Object", ">", "result", ")", "{", "while", "(", "hasMoreProperties", "(", ")", ")", "{", "String", "name", "=", "readPropertyName", "(", ")", ";", "log", ".", "debug", "(", "\"propert...
Read key - value pairs into Map object @param result Map to put resulting pair to
[ "Read", "key", "-", "value", "pairs", "into", "Map", "object" ]
train
https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/amf/Input.java#L340-L353
alkacon/opencms-core
src/org/opencms/ui/apps/resourcetypes/CmsNewResourceTypeDialog.java
CmsNewResourceTypeDialog.adjustSchema
private void adjustSchema(String schemaPath, String newElementString) { newElementString = newElementString.substring(0, 1).toUpperCase() + newElementString.substring(1); try { CmsFile file = m_cms.readFile(schemaPath); CmsMacroResolver macroResolver = new CmsMacroResolver(); macroResolver.setKeepEmptyMacros(true); macroResolver.addMacro(SAMPLE_TYPE_SCHEMA_ELEMENT, newElementString); String bundleName = m_bundle.getValue(); bundleName = bundleName.split("/")[bundleName.split("/").length - 1]; if (bundleName.contains("_")) { bundleName = bundleName.split("_")[0]; } macroResolver.addMacro("ResourceBundle", bundleName); macroResolver.addMacro("typeName", m_typeShortName.getValue()); String encoding = m_cms.readPropertyObject( file, CmsPropertyDefinition.PROPERTY_CONTENT_ENCODING, true).getValue(OpenCms.getSystemInfo().getDefaultEncoding()); String newContent = macroResolver.resolveMacros(new String(file.getContents(), encoding)); // update the content try { file.setContents(newContent.getBytes(encoding)); } catch (UnsupportedEncodingException e) { try { file.setContents(newContent.getBytes(Charset.defaultCharset().toString())); } catch (UnsupportedEncodingException e1) { file.setContents(newContent.getBytes()); } } // write the target file CmsLockUtil.ensureLock(m_cms, file); m_cms.writeFile(file); CmsLockUtil.tryUnlock(m_cms, file); } catch ( CmsException e) { LOG.error("Unable to read schema definition", e); } catch (UnsupportedEncodingException e) { LOG.error("Unable to fetch encoding", e); } }
java
private void adjustSchema(String schemaPath, String newElementString) { newElementString = newElementString.substring(0, 1).toUpperCase() + newElementString.substring(1); try { CmsFile file = m_cms.readFile(schemaPath); CmsMacroResolver macroResolver = new CmsMacroResolver(); macroResolver.setKeepEmptyMacros(true); macroResolver.addMacro(SAMPLE_TYPE_SCHEMA_ELEMENT, newElementString); String bundleName = m_bundle.getValue(); bundleName = bundleName.split("/")[bundleName.split("/").length - 1]; if (bundleName.contains("_")) { bundleName = bundleName.split("_")[0]; } macroResolver.addMacro("ResourceBundle", bundleName); macroResolver.addMacro("typeName", m_typeShortName.getValue()); String encoding = m_cms.readPropertyObject( file, CmsPropertyDefinition.PROPERTY_CONTENT_ENCODING, true).getValue(OpenCms.getSystemInfo().getDefaultEncoding()); String newContent = macroResolver.resolveMacros(new String(file.getContents(), encoding)); // update the content try { file.setContents(newContent.getBytes(encoding)); } catch (UnsupportedEncodingException e) { try { file.setContents(newContent.getBytes(Charset.defaultCharset().toString())); } catch (UnsupportedEncodingException e1) { file.setContents(newContent.getBytes()); } } // write the target file CmsLockUtil.ensureLock(m_cms, file); m_cms.writeFile(file); CmsLockUtil.tryUnlock(m_cms, file); } catch ( CmsException e) { LOG.error("Unable to read schema definition", e); } catch (UnsupportedEncodingException e) { LOG.error("Unable to fetch encoding", e); } }
[ "private", "void", "adjustSchema", "(", "String", "schemaPath", ",", "String", "newElementString", ")", "{", "newElementString", "=", "newElementString", ".", "substring", "(", "0", ",", "1", ")", ".", "toUpperCase", "(", ")", "+", "newElementString", ".", "su...
Adjustes schema.<p> @param schemaPath path to schema resource @param newElementString new Element name
[ "Adjustes", "schema", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/resourcetypes/CmsNewResourceTypeDialog.java#L677-L721
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java
GVRPose.setLocalMatrix
public void setLocalMatrix(int boneindex, Matrix4f mtx) { Bone bone = mBones[boneindex]; int parentid = mSkeleton.getParentBoneIndex(boneindex); bone.LocalMatrix.set(mtx); bone.Changed = Bone.LOCAL_ROT; if (parentid < 0) { bone.WorldMatrix.set(bone.LocalMatrix); } else { mNeedSync = true; } if (sDebug) { Log.d("BONE", "setLocalMatrix: %s %s", mSkeleton.getBoneName(boneindex), bone.toString()); } }
java
public void setLocalMatrix(int boneindex, Matrix4f mtx) { Bone bone = mBones[boneindex]; int parentid = mSkeleton.getParentBoneIndex(boneindex); bone.LocalMatrix.set(mtx); bone.Changed = Bone.LOCAL_ROT; if (parentid < 0) { bone.WorldMatrix.set(bone.LocalMatrix); } else { mNeedSync = true; } if (sDebug) { Log.d("BONE", "setLocalMatrix: %s %s", mSkeleton.getBoneName(boneindex), bone.toString()); } }
[ "public", "void", "setLocalMatrix", "(", "int", "boneindex", ",", "Matrix4f", "mtx", ")", "{", "Bone", "bone", "=", "mBones", "[", "boneindex", "]", ";", "int", "parentid", "=", "mSkeleton", ".", "getParentBoneIndex", "(", "boneindex", ")", ";", "bone", "....
Set the local matrix for this bone (relative to parent bone). <p> All bones in the skeleton start out at the origin oriented along the bone axis (usually 0,0,1). The pose orients and positions each bone in the skeleton with respect to this initial state. The local bone matrix expresses the orientation and position of the bone relative to the parent of this bone. @param boneindex zero based index of bone to set matrix for. @param mtx new bone matrix. @see #getLocalRotation @see #setWorldRotation @see #getWorldMatrix
[ "Set", "the", "local", "matrix", "for", "this", "bone", "(", "relative", "to", "parent", "bone", ")", ".", "<p", ">", "All", "bones", "in", "the", "skeleton", "start", "out", "at", "the", "origin", "oriented", "along", "the", "bone", "axis", "(", "usua...
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java#L513-L536
OpenLiberty/open-liberty
dev/com.ibm.ws.security.audit.reader/src/com/ibm/ws/security/audit/reader/tasks/AuditReaderTask.java
AuditReaderTask.auditReader
private String auditReader(PrintStream stderr, Map<String, String> props) throws Exception { try { return AuditLogReader.getReport(props.get("auditFileLocation"), props.get("outputFileLocation"), props.get("encrypted"), props.get("encKeyStoreLocation"), props.get("encKeyStorePassword"), props.get("encKeyStoreType"), props.get("signed"), props.get("signingKeyStoreLocation"), props.get("signingKeyStorePassword"), props.get("signingKeyStoreType"), isDebug); } catch (Exception e) { throw e; } }
java
private String auditReader(PrintStream stderr, Map<String, String> props) throws Exception { try { return AuditLogReader.getReport(props.get("auditFileLocation"), props.get("outputFileLocation"), props.get("encrypted"), props.get("encKeyStoreLocation"), props.get("encKeyStorePassword"), props.get("encKeyStoreType"), props.get("signed"), props.get("signingKeyStoreLocation"), props.get("signingKeyStorePassword"), props.get("signingKeyStoreType"), isDebug); } catch (Exception e) { throw e; } }
[ "private", "String", "auditReader", "(", "PrintStream", "stderr", ",", "Map", "<", "String", ",", "String", ">", "props", ")", "throws", "Exception", "{", "try", "{", "return", "AuditLogReader", ".", "getReport", "(", "props", ".", "get", "(", "\"auditFileLo...
Decrypt and/or unsign the audit log. Capture any Exceptions and print the stack trace. @param auditLogLocation @param outputLocation @param password @return String @throws Exception
[ "Decrypt", "and", "/", "or", "unsign", "the", "audit", "log", ".", "Capture", "any", "Exceptions", "and", "print", "the", "stack", "trace", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.audit.reader/src/com/ibm/ws/security/audit/reader/tasks/AuditReaderTask.java#L109-L125
looly/hutool
hutool-core/src/main/java/cn/hutool/core/date/DateTime.java
DateTime.toCalendar
public Calendar toCalendar(TimeZone zone) { return toCalendar(zone, Locale.getDefault(Locale.Category.FORMAT)); }
java
public Calendar toCalendar(TimeZone zone) { return toCalendar(zone, Locale.getDefault(Locale.Category.FORMAT)); }
[ "public", "Calendar", "toCalendar", "(", "TimeZone", "zone", ")", "{", "return", "toCalendar", "(", "zone", ",", "Locale", ".", "getDefault", "(", "Locale", ".", "Category", ".", "FORMAT", ")", ")", ";", "}" ]
转换为Calendar @param zone 时区 {@link TimeZone} @return {@link Calendar}
[ "转换为Calendar" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateTime.java#L530-L532
javalite/activeweb
activeweb/src/main/java/org/javalite/activeweb/HttpSupport.java
HttpSupport.getFile
protected org.javalite.activeweb.FileItem getFile(String fieldName, List<FormItem> formItems){ for (FormItem formItem : formItems) { if(formItem instanceof org.javalite.activeweb.FileItem && formItem.getFieldName().equals(fieldName)){ return (org.javalite.activeweb.FileItem)formItem; } } return null; }
java
protected org.javalite.activeweb.FileItem getFile(String fieldName, List<FormItem> formItems){ for (FormItem formItem : formItems) { if(formItem instanceof org.javalite.activeweb.FileItem && formItem.getFieldName().equals(fieldName)){ return (org.javalite.activeweb.FileItem)formItem; } } return null; }
[ "protected", "org", ".", "javalite", ".", "activeweb", ".", "FileItem", "getFile", "(", "String", "fieldName", ",", "List", "<", "FormItem", ">", "formItems", ")", "{", "for", "(", "FormItem", "formItem", ":", "formItems", ")", "{", "if", "(", "formItem", ...
Convenience method to get file content from <code>multipart/form-data</code> request. If more than one files with the same name are submitted, only one is returned. @param fieldName name of form field from the <code>multipart/form-data</code> request corresponding to the uploaded file. @param formItems form items retrieved from <code>multipart/form-data</code> request. @return <code>InputStream</code> from which to read content of uploaded file or null if FileItem with this name is not found.
[ "Convenience", "method", "to", "get", "file", "content", "from", "<code", ">", "multipart", "/", "form", "-", "data<", "/", "code", ">", "request", ".", "If", "more", "than", "one", "files", "with", "the", "same", "name", "are", "submitted", "only", "one...
train
https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/HttpSupport.java#L554-L561
pip-services3-java/pip-services3-commons-java
src/org/pipservices3/commons/run/Executor.java
Executor.executeOne
public static Object executeOne(String correlationId, Object component, Parameters args) throws ApplicationException { if (component instanceof IExecutable) return ((IExecutable) component).execute(correlationId, args); else return null; }
java
public static Object executeOne(String correlationId, Object component, Parameters args) throws ApplicationException { if (component instanceof IExecutable) return ((IExecutable) component).execute(correlationId, args); else return null; }
[ "public", "static", "Object", "executeOne", "(", "String", "correlationId", ",", "Object", "component", ",", "Parameters", "args", ")", "throws", "ApplicationException", "{", "if", "(", "component", "instanceof", "IExecutable", ")", "return", "(", "(", "IExecutabl...
Executes specific component. To be executed components must implement IExecutable interface. If they don't the call to this method has no effect. @param correlationId (optional) transaction id to trace execution through call chain. @param component the component that is to be executed. @param args execution arguments. @return execution result. @throws ApplicationException when errors occured. @see IExecutable @see Parameters
[ "Executes", "specific", "component", "." ]
train
https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/run/Executor.java#L29-L36
igniterealtime/Smack
smack-core/src/main/java/org/jivesoftware/smack/util/DNSUtil.java
DNSUtil.resolveXMPPServerDomain
public static List<HostAddress> resolveXMPPServerDomain(DnsName domain, List<HostAddress> failedAddresses, DnssecMode dnssecMode) { return resolveDomain(domain, DomainType.server, failedAddresses, dnssecMode); }
java
public static List<HostAddress> resolveXMPPServerDomain(DnsName domain, List<HostAddress> failedAddresses, DnssecMode dnssecMode) { return resolveDomain(domain, DomainType.server, failedAddresses, dnssecMode); }
[ "public", "static", "List", "<", "HostAddress", ">", "resolveXMPPServerDomain", "(", "DnsName", "domain", ",", "List", "<", "HostAddress", ">", "failedAddresses", ",", "DnssecMode", "dnssecMode", ")", "{", "return", "resolveDomain", "(", "domain", ",", "DomainType...
Returns a list of HostAddresses under which the specified XMPP server can be reached at for server-to-server communication. A DNS lookup for a SRV record in the form "_xmpp-server._tcp.example.com" is attempted, according to section 3.2.1 of RFC 6120. If that lookup fails , it's assumed that the XMPP server lives at the host resolved by a DNS lookup at the specified domain on the default port of 5269. <p> As an example, a lookup for "example.com" may return "im.example.com:5269". </p> @param domain the domain. @param failedAddresses on optional list that will be populated with host addresses that failed to resolve. @param dnssecMode DNSSec mode. @return List of HostAddress, which encompasses the hostname and port that the XMPP server can be reached at for the specified domain.
[ "Returns", "a", "list", "of", "HostAddresses", "under", "which", "the", "specified", "XMPP", "server", "can", "be", "reached", "at", "for", "server", "-", "to", "-", "server", "communication", ".", "A", "DNS", "lookup", "for", "a", "SRV", "record", "in", ...
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/util/DNSUtil.java#L133-L135
Coveros/selenified
src/main/java/com/coveros/selenified/Selenified.java
Selenified.getServiceUserCredential
private static String getServiceUserCredential(String clazz, ITestContext context) { if (System.getenv("SERVICES_USER") != null) { return System.getenv("SERVICES_USER"); } if (context.getAttribute(clazz + SERVICES_USER) != null) { return (String) context.getAttribute(clazz + SERVICES_USER); } else { return ""; } }
java
private static String getServiceUserCredential(String clazz, ITestContext context) { if (System.getenv("SERVICES_USER") != null) { return System.getenv("SERVICES_USER"); } if (context.getAttribute(clazz + SERVICES_USER) != null) { return (String) context.getAttribute(clazz + SERVICES_USER); } else { return ""; } }
[ "private", "static", "String", "getServiceUserCredential", "(", "String", "clazz", ",", "ITestContext", "context", ")", "{", "if", "(", "System", ".", "getenv", "(", "\"SERVICES_USER\"", ")", "!=", "null", ")", "{", "return", "System", ".", "getenv", "(", "\...
Obtains the web services username provided for the current test suite being executed. Anything passed in from the command line will first be taken, to override any other values. Next, values being set in the classes will be checked for. If neither of these are set, an empty string will be returned @param clazz - the test suite class, used for making threadsafe storage of application, allowing suites to have independent applications under test, run at the same time @param context - the TestNG context associated with the test suite, used for storing app url information @return String: the web services username to use for authentication
[ "Obtains", "the", "web", "services", "username", "provided", "for", "the", "current", "test", "suite", "being", "executed", ".", "Anything", "passed", "in", "from", "the", "command", "line", "will", "first", "be", "taken", "to", "override", "any", "other", "...
train
https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L244-L253
alkacon/opencms-core
src/org/opencms/search/documents/CmsDocumentMsOfficeOLE2.java
CmsDocumentMsOfficeOLE2.extractContent
public I_CmsExtractionResult extractContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index) throws CmsIndexException, CmsException { logContentExtraction(resource, index); CmsFile file = readFile(cms, resource); try { return CmsExtractorMsOfficeOLE2.getExtractor().extractText(file.getContents()); } catch (Throwable e) { throw new CmsIndexException( Messages.get().container(Messages.ERR_TEXT_EXTRACTION_1, resource.getRootPath()), e); } }
java
public I_CmsExtractionResult extractContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index) throws CmsIndexException, CmsException { logContentExtraction(resource, index); CmsFile file = readFile(cms, resource); try { return CmsExtractorMsOfficeOLE2.getExtractor().extractText(file.getContents()); } catch (Throwable e) { throw new CmsIndexException( Messages.get().container(Messages.ERR_TEXT_EXTRACTION_1, resource.getRootPath()), e); } }
[ "public", "I_CmsExtractionResult", "extractContent", "(", "CmsObject", "cms", ",", "CmsResource", "resource", ",", "I_CmsSearchIndex", "index", ")", "throws", "CmsIndexException", ",", "CmsException", "{", "logContentExtraction", "(", "resource", ",", "index", ")", ";...
Returns the raw text content of a given vfs resource containing MS Word data.<p> @see org.opencms.search.documents.I_CmsSearchExtractor#extractContent(CmsObject, CmsResource, I_CmsSearchIndex)
[ "Returns", "the", "raw", "text", "content", "of", "a", "given", "vfs", "resource", "containing", "MS", "Word", "data", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/documents/CmsDocumentMsOfficeOLE2.java#L66-L78
CODAIT/stocator
src/main/java/com/ibm/stocator/fs/swift/SwiftInputStream.java
SwiftInputStream.closeStream
private void closeStream(String msg, long length) { if (wrappedStream != null) { long remaining = remainingInCurrentRequest(); boolean shouldAbort = remaining > readahead; if (!shouldAbort) { try { wrappedStream.close(); } catch (IOException e) { LOG.debug("When closing {} stream for {}", uri, msg, e); shouldAbort = true; } } if (shouldAbort) { wrappedStream.abort(); } LOG.trace("Close stream {} {}: {}; streamPos={}, nextReadPos={}," + " request range {}-{} length={}", uri, (shouldAbort ? "aborted" : "closed"), msg, pos, nextReadPos, contentRangeStart, contentRangeFinish, length); wrappedStream = null; } }
java
private void closeStream(String msg, long length) { if (wrappedStream != null) { long remaining = remainingInCurrentRequest(); boolean shouldAbort = remaining > readahead; if (!shouldAbort) { try { wrappedStream.close(); } catch (IOException e) { LOG.debug("When closing {} stream for {}", uri, msg, e); shouldAbort = true; } } if (shouldAbort) { wrappedStream.abort(); } LOG.trace("Close stream {} {}: {}; streamPos={}, nextReadPos={}," + " request range {}-{} length={}", uri, (shouldAbort ? "aborted" : "closed"), msg, pos, nextReadPos, contentRangeStart, contentRangeFinish, length); wrappedStream = null; } }
[ "private", "void", "closeStream", "(", "String", "msg", ",", "long", "length", ")", "{", "if", "(", "wrappedStream", "!=", "null", ")", "{", "long", "remaining", "=", "remainingInCurrentRequest", "(", ")", ";", "boolean", "shouldAbort", "=", "remaining", ">"...
close the stream @param msg close message @param length length
[ "close", "the", "stream" ]
train
https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/swift/SwiftInputStream.java#L332-L352
ReactiveX/RxApacheHttp
src/main/java/rx/apache/http/ObservableHttp.java
ObservableHttp.createRequest
public static ObservableHttp<ObservableHttpResponse> createRequest(final HttpAsyncRequestProducer requestProducer, final HttpAsyncClient client) { return createRequest(requestProducer, client, new BasicHttpContext()); }
java
public static ObservableHttp<ObservableHttpResponse> createRequest(final HttpAsyncRequestProducer requestProducer, final HttpAsyncClient client) { return createRequest(requestProducer, client, new BasicHttpContext()); }
[ "public", "static", "ObservableHttp", "<", "ObservableHttpResponse", ">", "createRequest", "(", "final", "HttpAsyncRequestProducer", "requestProducer", ",", "final", "HttpAsyncClient", "client", ")", "{", "return", "createRequest", "(", "requestProducer", ",", "client", ...
Execute request using {@link HttpAsyncRequestProducer} to define HTTP Method, URI and payload (if applicable). <p> If the response is chunked (or flushed progressively such as with <i>text/event-stream</i> <a href="http://www.w3.org/TR/2009/WD-eventsource-20091029/">Server-Sent Events</a>) this will call {@link Observer#onNext} multiple times. <p> Use {@code HttpAsyncMethods.create* } factory methods to create {@link HttpAsyncRequestProducer} instances. <p> A client can be retrieved like this: <p> <pre> {@code CloseableHttpAsyncClient httpclient = HttpAsyncClients.createDefault(); } </pre> <p> A client with custom configurations can be created like this: </p> <pre> {@code final RequestConfig requestConfig = RequestConfig.custom() .setSocketTimeout(3000) .setConnectTimeout(3000).build(); final CloseableHttpAsyncClient httpclient = HttpAsyncClients.custom() .setDefaultRequestConfig(requestConfig) .setMaxConnPerRoute(20) .setMaxConnTotal(50) .build(); httpclient.start(); }</pre> @param requestProducer @param client @return the observable HTTP response stream
[ "Execute", "request", "using", "{", "@link", "HttpAsyncRequestProducer", "}", "to", "define", "HTTP", "Method", "URI", "and", "payload", "(", "if", "applicable", ")", ".", "<p", ">", "If", "the", "response", "is", "chunked", "(", "or", "flushed", "progressiv...
train
https://github.com/ReactiveX/RxApacheHttp/blob/7494169cdc1199f11ca9744f18c28e6fcb694a6e/src/main/java/rx/apache/http/ObservableHttp.java#L138-L140
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/action/ActionUtil.java
ActionUtil.createAction
public static IAction createAction(String label, String script) { return new Action(script, label, script); }
java
public static IAction createAction(String label, String script) { return new Action(script, label, script); }
[ "public", "static", "IAction", "createAction", "(", "String", "label", ",", "String", "script", ")", "{", "return", "new", "Action", "(", "script", ",", "label", ",", "script", ")", ";", "}" ]
Creates an action object from fields. @param label Action's label name. May be a label reference (prefixed with an '@' character) or the label itself. @param script Action's script. @return An action object.
[ "Creates", "an", "action", "object", "from", "fields", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/action/ActionUtil.java#L59-L61
liferay/com-liferay-commerce
commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUsageEntryPersistenceImpl.java
CommerceDiscountUsageEntryPersistenceImpl.findAll
@Override public List<CommerceDiscountUsageEntry> findAll(int start, int end) { return findAll(start, end, null); }
java
@Override public List<CommerceDiscountUsageEntry> findAll(int start, int end) { return findAll(start, end, null); }
[ "@", "Override", "public", "List", "<", "CommerceDiscountUsageEntry", ">", "findAll", "(", "int", "start", ",", "int", "end", ")", "{", "return", "findAll", "(", "start", ",", "end", ",", "null", ")", ";", "}" ]
Returns a range of all the commerce discount usage entries. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CommerceDiscountUsageEntryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. </p> @param start the lower bound of the range of commerce discount usage entries @param end the upper bound of the range of commerce discount usage entries (not inclusive) @return the range of commerce discount usage entries
[ "Returns", "a", "range", "of", "all", "the", "commerce", "discount", "usage", "entries", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUsageEntryPersistenceImpl.java#L1133-L1136
threerings/nenya
core/src/main/java/com/threerings/media/image/ImageManager.java
ImageManager.getMirage
public Mirage getMirage (ImageKey key, Colorization[] zations) { return getMirage(key, null, zations); }
java
public Mirage getMirage (ImageKey key, Colorization[] zations) { return getMirage(key, null, zations); }
[ "public", "Mirage", "getMirage", "(", "ImageKey", "key", ",", "Colorization", "[", "]", "zations", ")", "{", "return", "getMirage", "(", "key", ",", "null", ",", "zations", ")", ";", "}" ]
Like {@link #getMirage(ImageKey)} but the supplied colorizations are applied to the source image before creating the mirage.
[ "Like", "{" ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageManager.java#L347-L350
joniles/mpxj
src/main/java/net/sf/mpxj/ResourceAssignment.java
ResourceAssignment.getTimephasedOvertimeWork
public List<TimephasedWork> getTimephasedOvertimeWork() { if (m_timephasedOvertimeWork == null && m_timephasedWork != null && getOvertimeWork() != null) { double perDayFactor = getRemainingOvertimeWork().getDuration() / (getRemainingWork().getDuration() - getRemainingOvertimeWork().getDuration()); double totalFactor = getRemainingOvertimeWork().getDuration() / getRemainingWork().getDuration(); perDayFactor = Double.isNaN(perDayFactor) ? 0 : perDayFactor; totalFactor = Double.isNaN(totalFactor) ? 0 : totalFactor; m_timephasedOvertimeWork = new DefaultTimephasedWorkContainer(m_timephasedWork, perDayFactor, totalFactor); } return m_timephasedOvertimeWork == null ? null : m_timephasedOvertimeWork.getData(); }
java
public List<TimephasedWork> getTimephasedOvertimeWork() { if (m_timephasedOvertimeWork == null && m_timephasedWork != null && getOvertimeWork() != null) { double perDayFactor = getRemainingOvertimeWork().getDuration() / (getRemainingWork().getDuration() - getRemainingOvertimeWork().getDuration()); double totalFactor = getRemainingOvertimeWork().getDuration() / getRemainingWork().getDuration(); perDayFactor = Double.isNaN(perDayFactor) ? 0 : perDayFactor; totalFactor = Double.isNaN(totalFactor) ? 0 : totalFactor; m_timephasedOvertimeWork = new DefaultTimephasedWorkContainer(m_timephasedWork, perDayFactor, totalFactor); } return m_timephasedOvertimeWork == null ? null : m_timephasedOvertimeWork.getData(); }
[ "public", "List", "<", "TimephasedWork", ">", "getTimephasedOvertimeWork", "(", ")", "{", "if", "(", "m_timephasedOvertimeWork", "==", "null", "&&", "m_timephasedWork", "!=", "null", "&&", "getOvertimeWork", "(", ")", "!=", "null", ")", "{", "double", "perDayFac...
Retrieves the timephased breakdown of the planned overtime work for this resource assignment. @return timephased planned work
[ "Retrieves", "the", "timephased", "breakdown", "of", "the", "planned", "overtime", "work", "for", "this", "resource", "assignment", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L587-L600
badamowicz/sonar-hla
sonar-hla/src/main/java/com/github/badamowicz/sonar/hla/impl/DefaultSonarConverter.java
DefaultSonarConverter.surroundFields
private String surroundFields(String csvData) { StringBuilder surroundedCSV = null; StringTokenizer currTokenizer = null; surroundedCSV = new StringBuilder(); for (String currLine : csvData.split(BREAK)) { currTokenizer = new StringTokenizer(currLine, SEP); while (currTokenizer.hasMoreTokens()) { surroundedCSV.append(QUOTATION).append(currTokenizer.nextToken()).append(QUOTATION); if (currTokenizer.hasMoreTokens()) surroundedCSV.append(SEP); } surroundedCSV.append(BREAK); } return surroundedCSV.toString(); }
java
private String surroundFields(String csvData) { StringBuilder surroundedCSV = null; StringTokenizer currTokenizer = null; surroundedCSV = new StringBuilder(); for (String currLine : csvData.split(BREAK)) { currTokenizer = new StringTokenizer(currLine, SEP); while (currTokenizer.hasMoreTokens()) { surroundedCSV.append(QUOTATION).append(currTokenizer.nextToken()).append(QUOTATION); if (currTokenizer.hasMoreTokens()) surroundedCSV.append(SEP); } surroundedCSV.append(BREAK); } return surroundedCSV.toString(); }
[ "private", "String", "surroundFields", "(", "String", "csvData", ")", "{", "StringBuilder", "surroundedCSV", "=", "null", ";", "StringTokenizer", "currTokenizer", "=", "null", ";", "surroundedCSV", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "String"...
Surround the given CSV data with quotations for every field. @param csvData The original data without quotations. @return A new string object with all fields being quoted.
[ "Surround", "the", "given", "CSV", "data", "with", "quotations", "for", "every", "field", "." ]
train
https://github.com/badamowicz/sonar-hla/blob/21bd8a853d81966b47e96b518430abbc07ccd5f3/sonar-hla/src/main/java/com/github/badamowicz/sonar/hla/impl/DefaultSonarConverter.java#L192-L215
apache/flink
flink-core/src/main/java/org/apache/flink/configuration/Configuration.java
Configuration.getLong
public long getLong(String key, long defaultValue) { Object o = getRawValue(key); if (o == null) { return defaultValue; } return convertToLong(o, defaultValue); }
java
public long getLong(String key, long defaultValue) { Object o = getRawValue(key); if (o == null) { return defaultValue; } return convertToLong(o, defaultValue); }
[ "public", "long", "getLong", "(", "String", "key", ",", "long", "defaultValue", ")", "{", "Object", "o", "=", "getRawValue", "(", "key", ")", ";", "if", "(", "o", "==", "null", ")", "{", "return", "defaultValue", ";", "}", "return", "convertToLong", "(...
Returns the value associated with the given key as a long. @param key the key pointing to the associated value @param defaultValue the default value which is returned in case there is no value associated with the given key @return the (default) value associated with the given key
[ "Returns", "the", "value", "associated", "with", "the", "given", "key", "as", "a", "long", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L278-L285
cdk/cdk
legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKMCS.java
CDKMCS.buildRGraph
public static CDKRGraph buildRGraph(IAtomContainer sourceGraph, IAtomContainer targetGraph, boolean shouldMatchBonds) throws CDKException { CDKRGraph rGraph = new CDKRGraph(); nodeConstructor(rGraph, sourceGraph, targetGraph, shouldMatchBonds); arcConstructor(rGraph, sourceGraph, targetGraph); return rGraph; }
java
public static CDKRGraph buildRGraph(IAtomContainer sourceGraph, IAtomContainer targetGraph, boolean shouldMatchBonds) throws CDKException { CDKRGraph rGraph = new CDKRGraph(); nodeConstructor(rGraph, sourceGraph, targetGraph, shouldMatchBonds); arcConstructor(rGraph, sourceGraph, targetGraph); return rGraph; }
[ "public", "static", "CDKRGraph", "buildRGraph", "(", "IAtomContainer", "sourceGraph", ",", "IAtomContainer", "targetGraph", ",", "boolean", "shouldMatchBonds", ")", "throws", "CDKException", "{", "CDKRGraph", "rGraph", "=", "new", "CDKRGraph", "(", ")", ";", "nodeCo...
Builds the CDKRGraph ( resolution graph ), from two atomContainer (description of the two molecules to compare) This is the interface point between the CDK model and the generic MCSS algorithm based on the RGRaph. @param sourceGraph Description of the first molecule @param targetGraph Description of the second molecule @param shouldMatchBonds @return the rGraph @throws CDKException
[ "Builds", "the", "CDKRGraph", "(", "resolution", "graph", ")", "from", "two", "atomContainer", "(", "description", "of", "the", "two", "molecules", "to", "compare", ")", "This", "is", "the", "interface", "point", "between", "the", "CDK", "model", "and", "the...
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKMCS.java#L449-L455
aws/aws-sdk-java
aws-java-sdk-ecs/src/main/java/com/amazonaws/services/ecs/model/TaskDefinition.java
TaskDefinition.getCompatibilities
public java.util.List<String> getCompatibilities() { if (compatibilities == null) { compatibilities = new com.amazonaws.internal.SdkInternalList<String>(); } return compatibilities; }
java
public java.util.List<String> getCompatibilities() { if (compatibilities == null) { compatibilities = new com.amazonaws.internal.SdkInternalList<String>(); } return compatibilities; }
[ "public", "java", ".", "util", ".", "List", "<", "String", ">", "getCompatibilities", "(", ")", "{", "if", "(", "compatibilities", "==", "null", ")", "{", "compatibilities", "=", "new", "com", ".", "amazonaws", ".", "internal", ".", "SdkInternalList", "<",...
<p> The launch type to use with your task. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html">Amazon ECS Launch Types</a> in the <i>Amazon Elastic Container Service Developer Guide</i>. </p> @return The launch type to use with your task. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html">Amazon ECS Launch Types</a> in the <i>Amazon Elastic Container Service Developer Guide</i>. @see Compatibility
[ "<p", ">", "The", "launch", "type", "to", "use", "with", "your", "task", ".", "For", "more", "information", "see", "<a", "href", "=", "https", ":", "//", "docs", ".", "aws", ".", "amazon", ".", "com", "/", "AmazonECS", "/", "latest", "/", "developerg...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ecs/src/main/java/com/amazonaws/services/ecs/model/TaskDefinition.java#L1543-L1548