repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
18
192
func_name
stringlengths
5
108
whole_func_string
stringlengths
75
3.91k
language
stringclasses
1 value
func_code_string
stringlengths
75
3.91k
func_code_tokens
listlengths
21
629
func_documentation_string
stringlengths
61
1.98k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
111
306
kiswanij/jk-util
src/main/java/com/jk/util/JKCollectionUtil.java
JKCollectionUtil.unifyReferences
public static Object unifyReferences(final Hashtable hash, Object object) { final Object itemAtHash = hash.get(object.hashCode()); if (itemAtHash == null) { hash.put(object.hashCode(), object); } else { object = itemAtHash; } return object; }
java
public static Object unifyReferences(final Hashtable hash, Object object) { final Object itemAtHash = hash.get(object.hashCode()); if (itemAtHash == null) { hash.put(object.hashCode(), object); } else { object = itemAtHash; } return object; }
[ "public", "static", "Object", "unifyReferences", "(", "final", "Hashtable", "hash", ",", "Object", "object", ")", "{", "final", "Object", "itemAtHash", "=", "hash", ".", "get", "(", "object", ".", "hashCode", "(", ")", ")", ";", "if", "(", "itemAtHash", ...
return unified reference. @param hash the hash @param object the object @return the object
[ "return", "unified", "reference", "." ]
train
https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKCollectionUtil.java#L120-L128
vkostyukov/la4j
src/main/java/org/la4j/Matrices.java
Matrices.asPlusFunction
public static MatrixFunction asPlusFunction(final double arg) { return new MatrixFunction() { @Override public double evaluate(int i, int j, double value) { return value + arg; } }; }
java
public static MatrixFunction asPlusFunction(final double arg) { return new MatrixFunction() { @Override public double evaluate(int i, int j, double value) { return value + arg; } }; }
[ "public", "static", "MatrixFunction", "asPlusFunction", "(", "final", "double", "arg", ")", "{", "return", "new", "MatrixFunction", "(", ")", "{", "@", "Override", "public", "double", "evaluate", "(", "int", "i", ",", "int", "j", ",", "double", "value", ")...
Creates a plus function that adds given {@code value} to it's argument. @param arg a value to be added to function's argument @return a closure object that does {@code _ + _}
[ "Creates", "a", "plus", "function", "that", "adds", "given", "{", "@code", "value", "}", "to", "it", "s", "argument", "." ]
train
https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Matrices.java#L439-L446
esigate/esigate
esigate-core/src/main/java/org/esigate/util/UriUtils.java
UriUtils.removeServer
public static URI removeServer(URI uri) { try { return new URI(null, null, null, -1, uri.getPath(), uri.getQuery(), uri.getFragment()); } catch (URISyntaxException e) { throw new InvalidUriException(e); } }
java
public static URI removeServer(URI uri) { try { return new URI(null, null, null, -1, uri.getPath(), uri.getQuery(), uri.getFragment()); } catch (URISyntaxException e) { throw new InvalidUriException(e); } }
[ "public", "static", "URI", "removeServer", "(", "URI", "uri", ")", "{", "try", "{", "return", "new", "URI", "(", "null", ",", "null", ",", "null", ",", "-", "1", ",", "uri", ".", "getPath", "(", ")", ",", "uri", ".", "getQuery", "(", ")", ",", ...
Removes the server information frome a {@link URI}. @param uri the {@link URI} @return a new {@link URI} with no scheme, host and port
[ "Removes", "the", "server", "information", "frome", "a", "{", "@link", "URI", "}", "." ]
train
https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/util/UriUtils.java#L342-L349
mojohaus/flatten-maven-plugin
src/main/java/org/codehaus/mojo/flatten/FlattenDescriptor.java
FlattenDescriptor.setHandling
public void setHandling( PomProperty<?> property, ElementHandling handling ) { this.name2handlingMap.put( property.getName(), handling ); }
java
public void setHandling( PomProperty<?> property, ElementHandling handling ) { this.name2handlingMap.put( property.getName(), handling ); }
[ "public", "void", "setHandling", "(", "PomProperty", "<", "?", ">", "property", ",", "ElementHandling", "handling", ")", "{", "this", ".", "name2handlingMap", ".", "put", "(", "property", ".", "getName", "(", ")", ",", "handling", ")", ";", "}" ]
Generic method to set an {@link ElementHandling}. @param property is the {@link PomProperty} such as {@link PomProperty#NAME}. @param handling the new {@link ElementHandling}.
[ "Generic", "method", "to", "set", "an", "{", "@link", "ElementHandling", "}", "." ]
train
https://github.com/mojohaus/flatten-maven-plugin/blob/df25d03a4d6c06c4de5cfd9f52dfbe72e823e403/src/main/java/org/codehaus/mojo/flatten/FlattenDescriptor.java#L89-L93
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/join/CompositeInputFormat.java
CompositeInputFormat.compose
public static String compose(String op, Class<? extends InputFormat> inf, Path... path) { ArrayList<String> tmp = new ArrayList<String>(path.length); for (Path p : path) { tmp.add(p.toString()); } return compose(op, inf, tmp.toArray(new String[0])); }
java
public static String compose(String op, Class<? extends InputFormat> inf, Path... path) { ArrayList<String> tmp = new ArrayList<String>(path.length); for (Path p : path) { tmp.add(p.toString()); } return compose(op, inf, tmp.toArray(new String[0])); }
[ "public", "static", "String", "compose", "(", "String", "op", ",", "Class", "<", "?", "extends", "InputFormat", ">", "inf", ",", "Path", "...", "path", ")", "{", "ArrayList", "<", "String", ">", "tmp", "=", "new", "ArrayList", "<", "String", ">", "(", ...
Convenience method for constructing composite formats. Given operation (op), Object class (inf), set of paths (p) return: {@code <op>(tbl(<inf>,<p1>),tbl(<inf>,<p2>),...,tbl(<inf>,<pn>)) }
[ "Convenience", "method", "for", "constructing", "composite", "formats", ".", "Given", "operation", "(", "op", ")", "Object", "class", "(", "inf", ")", "set", "of", "paths", "(", "p", ")", "return", ":", "{" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/join/CompositeInputFormat.java#L164-L171
Azure/azure-sdk-for-java
network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java
VirtualNetworkGatewayConnectionsInner.updateTags
public VirtualNetworkGatewayConnectionListEntityInner updateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map<String, String> tags) { return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).toBlocking().last().body(); }
java
public VirtualNetworkGatewayConnectionListEntityInner updateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName, Map<String, String> tags) { return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, tags).toBlocking().last().body(); }
[ "public", "VirtualNetworkGatewayConnectionListEntityInner", "updateTags", "(", "String", "resourceGroupName", ",", "String", "virtualNetworkGatewayConnectionName", ",", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "return", "updateTagsWithServiceResponseAsync",...
Updates a virtual network gateway connection tags. @param resourceGroupName The name of the resource group. @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. @param tags Resource tags. @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 VirtualNetworkGatewayConnectionListEntityInner object if successful.
[ "Updates", "a", "virtual", "network", "gateway", "connection", "tags", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java#L611-L613
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/TimeSeriesUtils.java
TimeSeriesUtils.reverseTimeSeries
public static INDArray reverseTimeSeries(INDArray in, LayerWorkspaceMgr workspaceMgr, ArrayType arrayType){ if(in == null){ return null; } if(in.ordering() != 'f' || in.isView() || !Shape.strideDescendingCAscendingF(in)){ in = workspaceMgr.dup(arrayType, in, 'f'); } // FIXME: int cast int[] idxs = new int[(int) in.size(2)]; int j=0; for( int i=idxs.length-1; i>=0; i--){ idxs[j++] = i; } INDArray inReshape = in.reshape('f', in.size(0)*in.size(1), in.size(2)); INDArray outReshape = workspaceMgr.create(arrayType, in.dataType(), new long[]{inReshape.size(0), idxs.length}, 'f'); Nd4j.pullRows(inReshape, outReshape, 0, idxs); return workspaceMgr.leverageTo(arrayType, outReshape.reshape('f', in.size(0), in.size(1), in.size(2))); /* INDArray out = Nd4j.createUninitialized(in.shape(), 'f'); CustomOp op = DynamicCustomOp.builder("reverse") .addIntegerArguments(new int[]{0,1}) .addInputs(in) .addOutputs(out) .callInplace(false) .build(); Nd4j.getExecutioner().exec(op); return out; */ }
java
public static INDArray reverseTimeSeries(INDArray in, LayerWorkspaceMgr workspaceMgr, ArrayType arrayType){ if(in == null){ return null; } if(in.ordering() != 'f' || in.isView() || !Shape.strideDescendingCAscendingF(in)){ in = workspaceMgr.dup(arrayType, in, 'f'); } // FIXME: int cast int[] idxs = new int[(int) in.size(2)]; int j=0; for( int i=idxs.length-1; i>=0; i--){ idxs[j++] = i; } INDArray inReshape = in.reshape('f', in.size(0)*in.size(1), in.size(2)); INDArray outReshape = workspaceMgr.create(arrayType, in.dataType(), new long[]{inReshape.size(0), idxs.length}, 'f'); Nd4j.pullRows(inReshape, outReshape, 0, idxs); return workspaceMgr.leverageTo(arrayType, outReshape.reshape('f', in.size(0), in.size(1), in.size(2))); /* INDArray out = Nd4j.createUninitialized(in.shape(), 'f'); CustomOp op = DynamicCustomOp.builder("reverse") .addIntegerArguments(new int[]{0,1}) .addInputs(in) .addOutputs(out) .callInplace(false) .build(); Nd4j.getExecutioner().exec(op); return out; */ }
[ "public", "static", "INDArray", "reverseTimeSeries", "(", "INDArray", "in", ",", "LayerWorkspaceMgr", "workspaceMgr", ",", "ArrayType", "arrayType", ")", "{", "if", "(", "in", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "in", ".", "order...
Reverse an input time series along the time dimension @param in Input activations to reverse, with shape [minibatch, size, timeSeriesLength] @return Reversed activations
[ "Reverse", "an", "input", "time", "series", "along", "the", "time", "dimension" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/TimeSeriesUtils.java#L242-L275
symphonyoss/messageml-utils
src/main/java/org/symphonyoss/symphony/entityjson/EntityJsonParser.java
EntityJsonParser.parseEntityJson
public EntityJson parseEntityJson(Object instanceSource, ObjectNode instance) throws SchemaValidationException, InvalidInstanceException { try { return new EntityJson(validate(ENTITY_JSON_SCHEMA_URL, instanceSource, instance)); } catch (NoSchemaException | InvalidSchemaException e) { // In theory this cannot happen throw new RuntimeException(e); } }
java
public EntityJson parseEntityJson(Object instanceSource, ObjectNode instance) throws SchemaValidationException, InvalidInstanceException { try { return new EntityJson(validate(ENTITY_JSON_SCHEMA_URL, instanceSource, instance)); } catch (NoSchemaException | InvalidSchemaException e) { // In theory this cannot happen throw new RuntimeException(e); } }
[ "public", "EntityJson", "parseEntityJson", "(", "Object", "instanceSource", ",", "ObjectNode", "instance", ")", "throws", "SchemaValidationException", ",", "InvalidInstanceException", "{", "try", "{", "return", "new", "EntityJson", "(", "validate", "(", "ENTITY_JSON_SCH...
Parse an EntityJSON instance from the given URL. Callers may prefer to catch EntityJSONException and treat all failures in the same way. @param instanceSource An object describing the source of the instance, typically an instance of java.net.URL or java.io.File. @param instance A JSON ObjectNode containing the JSON representation of an EntityJSON instance. @return An EntityJSON instance. @throws SchemaValidationException If the given instance does not meet the general EntityJSON schema. @throws InvalidInstanceException If the given instance is structurally invalid.
[ "Parse", "an", "EntityJSON", "instance", "from", "the", "given", "URL", "." ]
train
https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/entityjson/EntityJsonParser.java#L162-L173
alkacon/opencms-core
src-gwt/org/opencms/ade/galleries/client/preview/ui/CmsFocalPoint.java
CmsFocalPoint.setCenterCoordsRelativeToParent
public void setCenterCoordsRelativeToParent(int x, int y) { Style style = getElement().getStyle(); style.setLeft(x - 10, Unit.PX); style.setTop(y - 10, Unit.PX); }
java
public void setCenterCoordsRelativeToParent(int x, int y) { Style style = getElement().getStyle(); style.setLeft(x - 10, Unit.PX); style.setTop(y - 10, Unit.PX); }
[ "public", "void", "setCenterCoordsRelativeToParent", "(", "int", "x", ",", "int", "y", ")", "{", "Style", "style", "=", "getElement", "(", ")", ".", "getStyle", "(", ")", ";", "style", ".", "setLeft", "(", "x", "-", "10", ",", "Unit", ".", "PX", ")",...
Positions the center of this widget over the given coordinates.<p> @param x the x coordinate @param y the y coordinate
[ "Positions", "the", "center", "of", "this", "widget", "over", "the", "given", "coordinates", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/preview/ui/CmsFocalPoint.java#L83-L88
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doPut
protected void doPut(String path) throws ClientException { this.readLock.lock(); try { ClientResponse response = this.getResourceWrapper() .rewritten(path, HttpMethod.PUT) .put(ClientResponse.class); errorIfStatusNotEqualTo(response, ClientResponse.Status.OK, ClientResponse.Status.NO_CONTENT); response.close(); } catch (ClientHandlerException ex) { throw new ClientException(ClientResponse.Status.INTERNAL_SERVER_ERROR, ex.getMessage()); } finally { this.readLock.unlock(); } }
java
protected void doPut(String path) throws ClientException { this.readLock.lock(); try { ClientResponse response = this.getResourceWrapper() .rewritten(path, HttpMethod.PUT) .put(ClientResponse.class); errorIfStatusNotEqualTo(response, ClientResponse.Status.OK, ClientResponse.Status.NO_CONTENT); response.close(); } catch (ClientHandlerException ex) { throw new ClientException(ClientResponse.Status.INTERNAL_SERVER_ERROR, ex.getMessage()); } finally { this.readLock.unlock(); } }
[ "protected", "void", "doPut", "(", "String", "path", ")", "throws", "ClientException", "{", "this", ".", "readLock", ".", "lock", "(", ")", ";", "try", "{", "ClientResponse", "response", "=", "this", ".", "getResourceWrapper", "(", ")", ".", "rewritten", "...
Updates the resource specified by the path, for situations where the nature of the update is completely specified by the path alone. @param path the path to the resource. Cannot be <code>null</code>. @throws ClientException if a status code other than 204 (No Content) and 200 (OK) is returned.
[ "Updates", "the", "resource", "specified", "by", "the", "path", "for", "situations", "where", "the", "nature", "of", "the", "update", "is", "completely", "specified", "by", "the", "path", "alone", "." ]
train
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L153-L166
carewebframework/carewebframework-core
org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/chm/BaseTransform.java
BaseTransform.writeSetting
protected void writeSetting(OutputStream outputStream, String name, Object value, int level) throws IOException { write(outputStream, "<" + name + ">" + value + "</" + name + ">", true, level); }
java
protected void writeSetting(OutputStream outputStream, String name, Object value, int level) throws IOException { write(outputStream, "<" + name + ">" + value + "</" + name + ">", true, level); }
[ "protected", "void", "writeSetting", "(", "OutputStream", "outputStream", ",", "String", "name", ",", "Object", "value", ",", "int", "level", ")", "throws", "IOException", "{", "write", "(", "outputStream", ",", "\"<\"", "+", "name", "+", "\">\"", "+", "valu...
Writes a setting's name/value pair to the output stream. @param outputStream The output stream. @param name The setting name. @param value The setting value. @param level The indent level. @throws IOException Exception while writing to the output stream.
[ "Writes", "a", "setting", "s", "name", "/", "value", "pair", "to", "the", "output", "stream", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/chm/BaseTransform.java#L113-L115
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
CacheableWorkspaceDataManager.getACL
private NodeData getACL(String identifier, ACLSearch search) throws RepositoryException { final ItemData item = getItemData(identifier, false); return item != null && item.isNode() ? initACL(null, (NodeData)item, search) : null; }
java
private NodeData getACL(String identifier, ACLSearch search) throws RepositoryException { final ItemData item = getItemData(identifier, false); return item != null && item.isNode() ? initACL(null, (NodeData)item, search) : null; }
[ "private", "NodeData", "getACL", "(", "String", "identifier", ",", "ACLSearch", "search", ")", "throws", "RepositoryException", "{", "final", "ItemData", "item", "=", "getItemData", "(", "identifier", ",", "false", ")", ";", "return", "item", "!=", "null", "&&...
Find Item by identifier to get the missing ACL information. @param identifier the id of the node that we are looking for to fill the ACL research @param search the ACL search describing what we are looking for @return NodeData, data by identifier
[ "Find", "Item", "by", "identifier", "to", "get", "the", "missing", "ACL", "information", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L2536-L2540
netty/netty
codec-http/src/main/java/io/netty/handler/codec/http/cors/CorsConfigBuilder.java
CorsConfigBuilder.preflightResponseHeader
public CorsConfigBuilder preflightResponseHeader(final CharSequence name, final Object... values) { if (values.length == 1) { preflightHeaders.put(name, new ConstantValueGenerator(values[0])); } else { preflightResponseHeader(name, Arrays.asList(values)); } return this; }
java
public CorsConfigBuilder preflightResponseHeader(final CharSequence name, final Object... values) { if (values.length == 1) { preflightHeaders.put(name, new ConstantValueGenerator(values[0])); } else { preflightResponseHeader(name, Arrays.asList(values)); } return this; }
[ "public", "CorsConfigBuilder", "preflightResponseHeader", "(", "final", "CharSequence", "name", ",", "final", "Object", "...", "values", ")", "{", "if", "(", "values", ".", "length", "==", "1", ")", "{", "preflightHeaders", ".", "put", "(", "name", ",", "new...
Returns HTTP response headers that should be added to a CORS preflight response. An intermediary like a load balancer might require that a CORS preflight request have certain headers set. This enables such headers to be added. @param name the name of the HTTP header. @param values the values for the HTTP header. @return {@link CorsConfigBuilder} to support method chaining.
[ "Returns", "HTTP", "response", "headers", "that", "should", "be", "added", "to", "a", "CORS", "preflight", "response", "." ]
train
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/cors/CorsConfigBuilder.java#L283-L290
b3dgs/lionengine
lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/PathFinderImpl.java
PathFinderImpl.updateNeighbour
private int updateNeighbour(Pathfindable mover, int dtx, int dty, Node current, int xp, int yp, int maxDepth) { int nextDepth = maxDepth; final double nextStepCost = current.getCost() + getMovementCost(mover, current.getX(), current.getY()); final Node neighbour = nodes[yp][xp]; if (nextStepCost < neighbour.getCost()) { open.remove(neighbour); closed.remove(neighbour); } if (!open.contains(neighbour) && !closed.contains(neighbour)) { neighbour.setCost(nextStepCost); neighbour.setHeuristic(getHeuristicCost(xp, yp, dtx, dty)); nextDepth = Math.max(maxDepth, neighbour.setParent(current)); open.add(neighbour); } return nextDepth; }
java
private int updateNeighbour(Pathfindable mover, int dtx, int dty, Node current, int xp, int yp, int maxDepth) { int nextDepth = maxDepth; final double nextStepCost = current.getCost() + getMovementCost(mover, current.getX(), current.getY()); final Node neighbour = nodes[yp][xp]; if (nextStepCost < neighbour.getCost()) { open.remove(neighbour); closed.remove(neighbour); } if (!open.contains(neighbour) && !closed.contains(neighbour)) { neighbour.setCost(nextStepCost); neighbour.setHeuristic(getHeuristicCost(xp, yp, dtx, dty)); nextDepth = Math.max(maxDepth, neighbour.setParent(current)); open.add(neighbour); } return nextDepth; }
[ "private", "int", "updateNeighbour", "(", "Pathfindable", "mover", ",", "int", "dtx", ",", "int", "dty", ",", "Node", "current", ",", "int", "xp", ",", "int", "yp", ",", "int", "maxDepth", ")", "{", "int", "nextDepth", "=", "maxDepth", ";", "final", "d...
Update the current neighbor on search. @param mover The entity that will be moving along the path. @param dtx The x coordinate of the destination location. @param dty The y coordinate of the destination location. @param current The current node. @param xp The x coordinate of the destination location. @param yp The y coordinate of the destination location. @param maxDepth The last max depth. @return The next max depth.
[ "Update", "the", "current", "neighbor", "on", "search", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/PathFinderImpl.java#L219-L238
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/BeanO.java
BeanO.getCallerIdentity
@Override @Deprecated public java.security.Identity getCallerIdentity() { EJSDeployedSupport s = EJSContainer.getMethodContext(); // Method not allowed from ejbTimeout. LI2281.07 if (s != null && s.methodInfo.ivInterface == MethodInterface.TIMED_OBJECT) { IllegalStateException ise = new IllegalStateException("getCallerIdentity() not " + "allowed from ejbTimeout"); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "getCallerIdentity: " + ise); throw ise; } EJBSecurityCollaborator<?> securityCollaborator = container.ivSecurityCollaborator; if (securityCollaborator == null) { return null; // d740575 } return getCallerIdentity(securityCollaborator, s); }
java
@Override @Deprecated public java.security.Identity getCallerIdentity() { EJSDeployedSupport s = EJSContainer.getMethodContext(); // Method not allowed from ejbTimeout. LI2281.07 if (s != null && s.methodInfo.ivInterface == MethodInterface.TIMED_OBJECT) { IllegalStateException ise = new IllegalStateException("getCallerIdentity() not " + "allowed from ejbTimeout"); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "getCallerIdentity: " + ise); throw ise; } EJBSecurityCollaborator<?> securityCollaborator = container.ivSecurityCollaborator; if (securityCollaborator == null) { return null; // d740575 } return getCallerIdentity(securityCollaborator, s); }
[ "@", "Override", "@", "Deprecated", "public", "java", ".", "security", ".", "Identity", "getCallerIdentity", "(", ")", "{", "EJSDeployedSupport", "s", "=", "EJSContainer", ".", "getMethodContext", "(", ")", ";", "// Method not allowed from ejbTimeout. ...
Obtain the <code>Identity</code> of the bean associated with this <code>BeanO</code>. <p>
[ "Obtain", "the", "<code", ">", "Identity<", "/", "code", ">", "of", "the", "bean", "associated", "with", "this", "<code", ">", "BeanO<", "/", "code", ">", ".", "<p", ">" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/BeanO.java#L662-L688
Javen205/IJPay
src/main/java/com/jpay/weixin/api/hb/RedHbApi.java
RedHbApi.sendRedPack
public static String sendRedPack(Map<String, String> params, String certPath, String partnerKey) { return HttpUtils.postSSL(sendRedPackUrl, PaymentKit.toXml(params), certPath, partnerKey); }
java
public static String sendRedPack(Map<String, String> params, String certPath, String partnerKey) { return HttpUtils.postSSL(sendRedPackUrl, PaymentKit.toXml(params), certPath, partnerKey); }
[ "public", "static", "String", "sendRedPack", "(", "Map", "<", "String", ",", "String", ">", "params", ",", "String", "certPath", ",", "String", "partnerKey", ")", "{", "return", "HttpUtils", ".", "postSSL", "(", "sendRedPackUrl", ",", "PaymentKit", ".", "toX...
发送红包 @param params 请求参数 @param certPath 证书文件目录 @param partnerKey 证书密码 @return {String}
[ "发送红包" ]
train
https://github.com/Javen205/IJPay/blob/78da6be4b70675abc6a41df74817532fa257ef29/src/main/java/com/jpay/weixin/api/hb/RedHbApi.java#L33-L35
UrielCh/ovh-java-sdk
ovh-java-sdk-core/src/main/java/net/minidev/ovh/core/ApiOvhCore.java
ApiOvhCore.invalidateConsumerKey
private void invalidateConsumerKey(String nic, String currentCK) throws IOException { config.invalidateConsumerKey(nic, currentCK); }
java
private void invalidateConsumerKey(String nic, String currentCK) throws IOException { config.invalidateConsumerKey(nic, currentCK); }
[ "private", "void", "invalidateConsumerKey", "(", "String", "nic", ",", "String", "currentCK", ")", "throws", "IOException", "{", "config", ".", "invalidateConsumerKey", "(", "nic", ",", "currentCK", ")", ";", "}" ]
Discard a consumerKey from cache @param nic nichandler @param currentCK @throws IOException
[ "Discard", "a", "consumerKey", "from", "cache" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-core/src/main/java/net/minidev/ovh/core/ApiOvhCore.java#L111-L113
Virtlink/commons-configuration2-jackson
src/main/java/com/virtlink/commons/configuration2/jackson/JacksonConfiguration.java
JacksonConfiguration.mapToNode
private ImmutableNode mapToNode(final Builder builder, final Map<String, Object> map) { for (final Map.Entry<String, Object> entry : map.entrySet()) { final String key = entry.getKey(); final Object value = entry.getValue(); if (value instanceof List) { // For a list, add each list item as a child of this node. for (final Object item : (List)value) { addChildNode(builder, key, item); } } else { // Otherwise, add the value as a child of this node. addChildNode(builder, key, value); } } return builder.create(); }
java
private ImmutableNode mapToNode(final Builder builder, final Map<String, Object> map) { for (final Map.Entry<String, Object> entry : map.entrySet()) { final String key = entry.getKey(); final Object value = entry.getValue(); if (value instanceof List) { // For a list, add each list item as a child of this node. for (final Object item : (List)value) { addChildNode(builder, key, item); } } else { // Otherwise, add the value as a child of this node. addChildNode(builder, key, value); } } return builder.create(); }
[ "private", "ImmutableNode", "mapToNode", "(", "final", "Builder", "builder", ",", "final", "Map", "<", "String", ",", "Object", ">", "map", ")", "{", "for", "(", "final", "Map", ".", "Entry", "<", "String", ",", "Object", ">", "entry", ":", "map", ".",...
Creates a node for the specified map. @param builder The node builder. @param map The map. @return The created node.
[ "Creates", "a", "node", "for", "the", "specified", "map", "." ]
train
https://github.com/Virtlink/commons-configuration2-jackson/blob/40474ab3c641fbbb4ccd9c97d4f7075c1644ef69/src/main/java/com/virtlink/commons/configuration2/jackson/JacksonConfiguration.java#L161-L176
sdl/Testy
src/main/java/com/sdl/selenium/extjs3/tab/TabPanel.java
TabPanel.getBaseTabPanelPath
private String getBaseTabPanelPath() { String selector = getPathBuilder().getBasePath(); WebLocator el = new WebLocator().setText(getPathBuilder().getText(), SearchType.EQUALS); el.setSearchTextType(getPathBuilder().getSearchTextType().stream().toArray(SearchType[]::new)); selector += (selector.length() > 0 ? " and " : "") + "not(contains(@class, 'x-masked')) and count(*[contains(@class,'x-tab-panel-header')]//*[contains(@class, 'x-tab-strip-active')]" + el.getXPath() + ") > 0"; return "//*[" + selector + "]"; }
java
private String getBaseTabPanelPath() { String selector = getPathBuilder().getBasePath(); WebLocator el = new WebLocator().setText(getPathBuilder().getText(), SearchType.EQUALS); el.setSearchTextType(getPathBuilder().getSearchTextType().stream().toArray(SearchType[]::new)); selector += (selector.length() > 0 ? " and " : "") + "not(contains(@class, 'x-masked')) and count(*[contains(@class,'x-tab-panel-header')]//*[contains(@class, 'x-tab-strip-active')]" + el.getXPath() + ") > 0"; return "//*[" + selector + "]"; }
[ "private", "String", "getBaseTabPanelPath", "(", ")", "{", "String", "selector", "=", "getPathBuilder", "(", ")", ".", "getBasePath", "(", ")", ";", "WebLocator", "el", "=", "new", "WebLocator", "(", ")", ".", "setText", "(", "getPathBuilder", "(", ")", "....
this method return the path of the main TabPanel (that contains also this Tab/Panel) @return the path of the main TabPanel
[ "this", "method", "return", "the", "path", "of", "the", "main", "TabPanel", "(", "that", "contains", "also", "this", "Tab", "/", "Panel", ")" ]
train
https://github.com/sdl/Testy/blob/b3ae061554016f926f04694a39ff00dab7576609/src/main/java/com/sdl/selenium/extjs3/tab/TabPanel.java#L46-L52
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/libs/modules/GridNode.java
GridNode.getNodeAt
public GridNode getNodeAt( Direction direction ) { int newCol = col + direction.col; int newRow = row + direction.row; GridNode node = new GridNode(gridIter, cols, rows, xRes, yRes, newCol, newRow); return node; }
java
public GridNode getNodeAt( Direction direction ) { int newCol = col + direction.col; int newRow = row + direction.row; GridNode node = new GridNode(gridIter, cols, rows, xRes, yRes, newCol, newRow); return node; }
[ "public", "GridNode", "getNodeAt", "(", "Direction", "direction", ")", "{", "int", "newCol", "=", "col", "+", "direction", ".", "col", ";", "int", "newRow", "=", "row", "+", "direction", ".", "row", ";", "GridNode", "node", "=", "new", "GridNode", "(", ...
Get a neighbor node at a certain direction. @param direction the direction to get the node at. @return the node.
[ "Get", "a", "neighbor", "node", "at", "a", "certain", "direction", "." ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/libs/modules/GridNode.java#L410-L415
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java
ArrayUtil.removeNull
public static <T> T[] removeNull(T[] array) { return filter(array, new Editor<T>() { @Override public T edit(T t) { // 返回null便不加入集合 return t; } }); }
java
public static <T> T[] removeNull(T[] array) { return filter(array, new Editor<T>() { @Override public T edit(T t) { // 返回null便不加入集合 return t; } }); }
[ "public", "static", "<", "T", ">", "T", "[", "]", "removeNull", "(", "T", "[", "]", "array", ")", "{", "return", "filter", "(", "array", ",", "new", "Editor", "<", "T", ">", "(", ")", "{", "@", "Override", "public", "T", "edit", "(", "T", "t", ...
去除{@code null} 元素 @param array 数组 @return 处理后的数组 @since 3.2.2
[ "去除", "{", "@code", "null", "}", "元素" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L781-L789
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java
XMLUtils.formatXMLContent
public static String formatXMLContent(String content) throws TransformerFactoryConfigurationError, TransformerException { Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); StreamResult result = new StreamResult(new StringWriter()); // Use a SAX Source instead of a StreamSource so that we can control the XMLReader used and set up one that // doesn't resolve entities (and thus doesn't go out on the internet to fetch DTDs!). SAXSource source = new SAXSource(new InputSource(new StringReader(content))); try { XMLReader reader = org.xml.sax.helpers.XMLReaderFactory.createXMLReader(); reader.setEntityResolver(new org.xml.sax.EntityResolver() { @Override public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { // Return an empty resolved entity. Note that we don't return null since this would tell the reader // to go on the internet to fetch the DTD. return new InputSource(new StringReader("")); } }); source.setXMLReader(reader); } catch (Exception e) { throw new TransformerException(String.format( "Failed to create XML Reader while pretty-printing content [%s]", content), e); } transformer.transform(source, result); return result.getWriter().toString(); }
java
public static String formatXMLContent(String content) throws TransformerFactoryConfigurationError, TransformerException { Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); StreamResult result = new StreamResult(new StringWriter()); // Use a SAX Source instead of a StreamSource so that we can control the XMLReader used and set up one that // doesn't resolve entities (and thus doesn't go out on the internet to fetch DTDs!). SAXSource source = new SAXSource(new InputSource(new StringReader(content))); try { XMLReader reader = org.xml.sax.helpers.XMLReaderFactory.createXMLReader(); reader.setEntityResolver(new org.xml.sax.EntityResolver() { @Override public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { // Return an empty resolved entity. Note that we don't return null since this would tell the reader // to go on the internet to fetch the DTD. return new InputSource(new StringReader("")); } }); source.setXMLReader(reader); } catch (Exception e) { throw new TransformerException(String.format( "Failed to create XML Reader while pretty-printing content [%s]", content), e); } transformer.transform(source, result); return result.getWriter().toString(); }
[ "public", "static", "String", "formatXMLContent", "(", "String", "content", ")", "throws", "TransformerFactoryConfigurationError", ",", "TransformerException", "{", "Transformer", "transformer", "=", "TransformerFactory", ".", "newInstance", "(", ")", ".", "newTransformer...
Parse and pretty print a XML content. @param content the XML content to format @return the formated version of the passed XML content @throws TransformerFactoryConfigurationError when failing to create a {@link TransformerFactoryConfigurationError} @throws TransformerException when failing to transform the content @since 5.2M1
[ "Parse", "and", "pretty", "print", "a", "XML", "content", "." ]
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java#L450-L483
UrielCh/ovh-java-sdk
ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java
ApiOvhPrice.xdsl_options_installation_option_GET
public OvhPrice xdsl_options_installation_option_GET(net.minidev.ovh.api.price.xdsl.options.OvhInstallationEnum option) throws IOException { String qPath = "/price/xdsl/options/installation/{option}"; StringBuilder sb = path(qPath, option); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhPrice.class); }
java
public OvhPrice xdsl_options_installation_option_GET(net.minidev.ovh.api.price.xdsl.options.OvhInstallationEnum option) throws IOException { String qPath = "/price/xdsl/options/installation/{option}"; StringBuilder sb = path(qPath, option); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhPrice.class); }
[ "public", "OvhPrice", "xdsl_options_installation_option_GET", "(", "net", ".", "minidev", ".", "ovh", ".", "api", ".", "price", ".", "xdsl", ".", "options", ".", "OvhInstallationEnum", "option", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/pric...
Get the price of options installation fee REST: GET /price/xdsl/options/installation/{option} @param option [required] The option
[ "Get", "the", "price", "of", "options", "installation", "fee" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java#L76-L81
hawkular/hawkular-inventory
hawkular-inventory-api/src/main/java/org/hawkular/inventory/base/Fetcher.java
Fetcher.loadEntity
protected <T> T loadEntity(EntityConvertor<BE, E, T> conversion) throws EntityNotFoundException, RelationNotFoundException { return inTx(tx -> { BE result = tx.querySingle(context.select().get()); if (result == null) { throwNotFoundException(); } E entity = tx.convert(result, context.entityClass); if (!isApplicable(entity)) { throwNotFoundException(); } return conversion.convert(result, entity, tx); }); }
java
protected <T> T loadEntity(EntityConvertor<BE, E, T> conversion) throws EntityNotFoundException, RelationNotFoundException { return inTx(tx -> { BE result = tx.querySingle(context.select().get()); if (result == null) { throwNotFoundException(); } E entity = tx.convert(result, context.entityClass); if (!isApplicable(entity)) { throwNotFoundException(); } return conversion.convert(result, entity, tx); }); }
[ "protected", "<", "T", ">", "T", "loadEntity", "(", "EntityConvertor", "<", "BE", ",", "E", ",", "T", ">", "conversion", ")", "throws", "EntityNotFoundException", ",", "RelationNotFoundException", "{", "return", "inTx", "(", "tx", "->", "{", "BE", "result", ...
Loads the entity from the backend and let's the caller do some conversion on either the backend representation of the entity or the converted entity (both of these are required even during the loading so no unnecessary work is done by providing both of the to the caller). @param conversion the conversion function taking the backend entity as well as the model entity @param <T> the result type @return the converted result of loading the entity @throws EntityNotFoundException @throws RelationNotFoundException
[ "Loads", "the", "entity", "from", "the", "backend", "and", "let", "s", "the", "caller", "do", "some", "conversion", "on", "either", "the", "backend", "representation", "of", "the", "entity", "or", "the", "converted", "entity", "(", "both", "of", "these", "...
train
https://github.com/hawkular/hawkular-inventory/blob/f56dc10323dca21777feb5b609a9e9cc70ffaf62/hawkular-inventory-api/src/main/java/org/hawkular/inventory/base/Fetcher.java#L69-L87
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/elements/TextGroupElement.java
TextGroupElement.addChild
public void addChild(String text, Position position) { this.children.add(new Child(text, position)); }
java
public void addChild(String text, Position position) { this.children.add(new Child(text, position)); }
[ "public", "void", "addChild", "(", "String", "text", ",", "Position", "position", ")", "{", "this", ".", "children", ".", "add", "(", "new", "Child", "(", "text", ",", "position", ")", ")", ";", "}" ]
Add a child text element. @param text the child text to add @param position the position of the child relative to this parent
[ "Add", "a", "child", "text", "element", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/elements/TextGroupElement.java#L117-L119
alkacon/opencms-core
src/org/opencms/search/CmsSearchIndex.java
CmsSearchIndex.appendDateLastModifiedFilter
protected BooleanQuery.Builder appendDateLastModifiedFilter( BooleanQuery.Builder filter, long startTime, long endTime) { // create special optimized sub-filter for the date last modified search Query dateFilter = createDateRangeFilter(CmsSearchField.FIELD_DATE_LASTMODIFIED_LOOKUP, startTime, endTime); if (dateFilter != null) { // extend main filter with the created date filter filter.add(new BooleanClause(dateFilter, BooleanClause.Occur.MUST)); } return filter; }
java
protected BooleanQuery.Builder appendDateLastModifiedFilter( BooleanQuery.Builder filter, long startTime, long endTime) { // create special optimized sub-filter for the date last modified search Query dateFilter = createDateRangeFilter(CmsSearchField.FIELD_DATE_LASTMODIFIED_LOOKUP, startTime, endTime); if (dateFilter != null) { // extend main filter with the created date filter filter.add(new BooleanClause(dateFilter, BooleanClause.Occur.MUST)); } return filter; }
[ "protected", "BooleanQuery", ".", "Builder", "appendDateLastModifiedFilter", "(", "BooleanQuery", ".", "Builder", "filter", ",", "long", "startTime", ",", "long", "endTime", ")", "{", "// create special optimized sub-filter for the date last modified search", "Query", "dateFi...
Appends a date of last modification filter to the given filter clause that matches the given time range.<p> If the start time is equal to {@link Long#MIN_VALUE} and the end time is equal to {@link Long#MAX_VALUE} than the original filter is left unchanged.<p> The original filter parameter is extended and also provided as return value.<p> @param filter the filter to extend @param startTime start time of the range to search in @param endTime end time of the range to search in @return the extended filter clause
[ "Appends", "a", "date", "of", "last", "modification", "filter", "to", "the", "given", "filter", "clause", "that", "matches", "the", "given", "time", "range", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchIndex.java#L1337-L1350
opentable/otj-logging
core/src/main/java/com/opentable/logging/CommonLogHolder.java
CommonLogHolder.setEnvironment
public static void setEnvironment(String otEnv, String otEnvType, String otEnvLocation, String otEnvFlavor) { OT_ENV = otEnv; OT_ENV_TYPE = otEnvType; OT_ENV_LOCATION = otEnvLocation; OT_ENV_FLAVOR = otEnvFlavor; }
java
public static void setEnvironment(String otEnv, String otEnvType, String otEnvLocation, String otEnvFlavor) { OT_ENV = otEnv; OT_ENV_TYPE = otEnvType; OT_ENV_LOCATION = otEnvLocation; OT_ENV_FLAVOR = otEnvFlavor; }
[ "public", "static", "void", "setEnvironment", "(", "String", "otEnv", ",", "String", "otEnvType", ",", "String", "otEnvLocation", ",", "String", "otEnvFlavor", ")", "{", "OT_ENV", "=", "otEnv", ";", "OT_ENV_TYPE", "=", "otEnvType", ";", "OT_ENV_LOCATION", "=", ...
Mock out the environment. You probably don't want to do this.
[ "Mock", "out", "the", "environment", ".", "You", "probably", "don", "t", "want", "to", "do", "this", "." ]
train
https://github.com/opentable/otj-logging/blob/eaa74c877c4721ddb9af8eb7fe1612166f7ac14d/core/src/main/java/com/opentable/logging/CommonLogHolder.java#L70-L75
i-net-software/jlessc
src/com/inet/lib/less/CssFormatter.java
CssFormatter.appendColor
CssFormatter appendColor( double color, @Nullable String hint ) { if( !inlineMode && hint != null ) { output.append( hint ); } else { int argb = ColorUtils.argb( color ); output.append( '#' ); appendHex( argb, 6 ); } return this; }
java
CssFormatter appendColor( double color, @Nullable String hint ) { if( !inlineMode && hint != null ) { output.append( hint ); } else { int argb = ColorUtils.argb( color ); output.append( '#' ); appendHex( argb, 6 ); } return this; }
[ "CssFormatter", "appendColor", "(", "double", "color", ",", "@", "Nullable", "String", "hint", ")", "{", "if", "(", "!", "inlineMode", "&&", "hint", "!=", "null", ")", "{", "output", ".", "append", "(", "hint", ")", ";", "}", "else", "{", "int", "arg...
Append a color. In inline mode it is ever a 6 digit RGB value. @param color the color value @param hint the original spelling of the color if not calculated @return this
[ "Append", "a", "color", ".", "In", "inline", "mode", "it", "is", "ever", "a", "6", "digit", "RGB", "value", "." ]
train
https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/CssFormatter.java#L624-L633
UrielCh/ovh-java-sdk
ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java
ApiOvhTelephony.billingAccount_fax_serviceName_screenLists_POST
public OvhFaxScreen billingAccount_fax_serviceName_screenLists_POST(String billingAccount, String serviceName, String[] blacklistedNumbers, String[] blacklistedTSI, OvhFaxScreenListTypeEnum filteringList, String[] whitelistedNumbers, String[] whitelistedTSI) throws IOException { String qPath = "/telephony/{billingAccount}/fax/{serviceName}/screenLists"; StringBuilder sb = path(qPath, billingAccount, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "blacklistedNumbers", blacklistedNumbers); addBody(o, "blacklistedTSI", blacklistedTSI); addBody(o, "filteringList", filteringList); addBody(o, "whitelistedNumbers", whitelistedNumbers); addBody(o, "whitelistedTSI", whitelistedTSI); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhFaxScreen.class); }
java
public OvhFaxScreen billingAccount_fax_serviceName_screenLists_POST(String billingAccount, String serviceName, String[] blacklistedNumbers, String[] blacklistedTSI, OvhFaxScreenListTypeEnum filteringList, String[] whitelistedNumbers, String[] whitelistedTSI) throws IOException { String qPath = "/telephony/{billingAccount}/fax/{serviceName}/screenLists"; StringBuilder sb = path(qPath, billingAccount, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "blacklistedNumbers", blacklistedNumbers); addBody(o, "blacklistedTSI", blacklistedTSI); addBody(o, "filteringList", filteringList); addBody(o, "whitelistedNumbers", whitelistedNumbers); addBody(o, "whitelistedTSI", whitelistedTSI); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhFaxScreen.class); }
[ "public", "OvhFaxScreen", "billingAccount_fax_serviceName_screenLists_POST", "(", "String", "billingAccount", ",", "String", "serviceName", ",", "String", "[", "]", "blacklistedNumbers", ",", "String", "[", "]", "blacklistedTSI", ",", "OvhFaxScreenListTypeEnum", "filteringL...
Create a new fax ScreenLists REST: POST /telephony/{billingAccount}/fax/{serviceName}/screenLists @param whitelistedNumbers [required] List of numbers allowed to send a fax @param whitelistedTSI [required] List of logins (TSI or ID) allowed to send a fax @param blacklistedNumbers [required] List of numbers not allowed to send a fax @param blacklistedTSI [required] List of logins (TSI or ID) not allowed to send a fax @param filteringList [required] Which list is active (blackist, whitelist or none) @param billingAccount [required] The name of your billingAccount @param serviceName [required]
[ "Create", "a", "new", "fax", "ScreenLists" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L4462-L4473
netty/netty
codec-http2/src/main/java/io/netty/handler/codec/http2/HpackEncoder.java
HpackEncoder.encodeHeaders
public void encodeHeaders(int streamId, ByteBuf out, Http2Headers headers, SensitivityDetector sensitivityDetector) throws Http2Exception { if (ignoreMaxHeaderListSize) { encodeHeadersIgnoreMaxHeaderListSize(out, headers, sensitivityDetector); } else { encodeHeadersEnforceMaxHeaderListSize(streamId, out, headers, sensitivityDetector); } }
java
public void encodeHeaders(int streamId, ByteBuf out, Http2Headers headers, SensitivityDetector sensitivityDetector) throws Http2Exception { if (ignoreMaxHeaderListSize) { encodeHeadersIgnoreMaxHeaderListSize(out, headers, sensitivityDetector); } else { encodeHeadersEnforceMaxHeaderListSize(streamId, out, headers, sensitivityDetector); } }
[ "public", "void", "encodeHeaders", "(", "int", "streamId", ",", "ByteBuf", "out", ",", "Http2Headers", "headers", ",", "SensitivityDetector", "sensitivityDetector", ")", "throws", "Http2Exception", "{", "if", "(", "ignoreMaxHeaderListSize", ")", "{", "encodeHeadersIgn...
Encode the header field into the header block. <strong>The given {@link CharSequence}s must be immutable!</strong>
[ "Encode", "the", "header", "field", "into", "the", "header", "block", "." ]
train
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackEncoder.java#L101-L108
OpenLiberty/open-liberty
dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/session/internal/SessionInfo.java
SessionInfo.encodeURL
public static String encodeURL(String url, SessionInfo info) { // could be /path/page#fragment?query // could be /page/page;session=existing#fragment?query // where fragment and query are both optional HttpSession session = info.getSession(); if (null == session) { return url; } final String id = session.getId(); final String target = info.getSessionConfig().getURLRewritingMarker(); URLParser parser = new URLParser(url, target); StringBuilder sb = new StringBuilder(); if (-1 != parser.idMarker) { // a session exists in the URL, overlay this ID sb.append(url); int start = parser.idMarker + target.length(); if (start + 23 < url.length()) { sb.replace(start, start + 23, id); } else { // invalid length on existing session, just remove that // TODO: what if a fragment or query string was after the // invalid session data sb.setLength(parser.idMarker); sb.append(target).append(id); } } else { // add session data to the URL if (-1 != parser.fragmentMarker) { // prepend it before the uri fragment sb.append(url, 0, parser.fragmentMarker); sb.append(target).append(id); sb.append(url, parser.fragmentMarker, url.length()); } else if (-1 != parser.queryMarker) { // prepend it before the query data sb.append(url, 0, parser.queryMarker); sb.append(target).append(id); sb.append(url, parser.queryMarker, url.length()); } else { // just a uri sb.append(url).append(target).append(id); } } return sb.toString(); }
java
public static String encodeURL(String url, SessionInfo info) { // could be /path/page#fragment?query // could be /page/page;session=existing#fragment?query // where fragment and query are both optional HttpSession session = info.getSession(); if (null == session) { return url; } final String id = session.getId(); final String target = info.getSessionConfig().getURLRewritingMarker(); URLParser parser = new URLParser(url, target); StringBuilder sb = new StringBuilder(); if (-1 != parser.idMarker) { // a session exists in the URL, overlay this ID sb.append(url); int start = parser.idMarker + target.length(); if (start + 23 < url.length()) { sb.replace(start, start + 23, id); } else { // invalid length on existing session, just remove that // TODO: what if a fragment or query string was after the // invalid session data sb.setLength(parser.idMarker); sb.append(target).append(id); } } else { // add session data to the URL if (-1 != parser.fragmentMarker) { // prepend it before the uri fragment sb.append(url, 0, parser.fragmentMarker); sb.append(target).append(id); sb.append(url, parser.fragmentMarker, url.length()); } else if (-1 != parser.queryMarker) { // prepend it before the query data sb.append(url, 0, parser.queryMarker); sb.append(target).append(id); sb.append(url, parser.queryMarker, url.length()); } else { // just a uri sb.append(url).append(target).append(id); } } return sb.toString(); }
[ "public", "static", "String", "encodeURL", "(", "String", "url", ",", "SessionInfo", "info", ")", "{", "// could be /path/page#fragment?query", "// could be /page/page;session=existing#fragment?query", "// where fragment and query are both optional", "HttpSession", "session", "=", ...
Encode session information into the provided URL. This will replace any existing session in that URL. @param url @param info @return String
[ "Encode", "session", "information", "into", "the", "provided", "URL", ".", "This", "will", "replace", "any", "existing", "session", "in", "that", "URL", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/session/internal/SessionInfo.java#L117-L162
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java
Start.checkOneArg
private void checkOneArg(List<String> args, int index) throws OptionException { if ((index + 1) >= args.size() || args.get(index + 1).startsWith("-d")) { String text = messager.getText("main.requires_argument", args.get(index)); throw new OptionException(CMDERR, this::usage, text); } }
java
private void checkOneArg(List<String> args, int index) throws OptionException { if ((index + 1) >= args.size() || args.get(index + 1).startsWith("-d")) { String text = messager.getText("main.requires_argument", args.get(index)); throw new OptionException(CMDERR, this::usage, text); } }
[ "private", "void", "checkOneArg", "(", "List", "<", "String", ">", "args", ",", "int", "index", ")", "throws", "OptionException", "{", "if", "(", "(", "index", "+", "1", ")", ">=", "args", ".", "size", "(", ")", "||", "args", ".", "get", "(", "inde...
Check the one arg option. Error and exit if one argument is not provided.
[ "Check", "the", "one", "arg", "option", ".", "Error", "and", "exit", "if", "one", "argument", "is", "not", "provided", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java#L870-L875
aws/aws-sdk-java
aws-java-sdk-discovery/src/main/java/com/amazonaws/services/applicationdiscovery/model/ListConfigurationsResult.java
ListConfigurationsResult.withConfigurations
public ListConfigurationsResult withConfigurations(java.util.Collection<java.util.Map<String, String>> configurations) { setConfigurations(configurations); return this; }
java
public ListConfigurationsResult withConfigurations(java.util.Collection<java.util.Map<String, String>> configurations) { setConfigurations(configurations); return this; }
[ "public", "ListConfigurationsResult", "withConfigurations", "(", "java", ".", "util", ".", "Collection", "<", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", ">", "configurations", ")", "{", "setConfigurations", "(", "configurations", ")", ...
<p> Returns configuration details, including the configuration ID, attribute names, and attribute values. </p> @param configurations Returns configuration details, including the configuration ID, attribute names, and attribute values. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "Returns", "configuration", "details", "including", "the", "configuration", "ID", "attribute", "names", "and", "attribute", "values", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-discovery/src/main/java/com/amazonaws/services/applicationdiscovery/model/ListConfigurationsResult.java#L101-L104
tempodb/tempodb-java
src/main/java/com/tempodb/Client.java
Client.readDataPoints
public Cursor<DataPoint> readDataPoints(Series series, Interval interval) { return readDataPoints(series, interval, DateTimeZone.getDefault(), null, null); }
java
public Cursor<DataPoint> readDataPoints(Series series, Interval interval) { return readDataPoints(series, interval, DateTimeZone.getDefault(), null, null); }
[ "public", "Cursor", "<", "DataPoint", ">", "readDataPoints", "(", "Series", "series", ",", "Interval", "interval", ")", "{", "return", "readDataPoints", "(", "series", ",", "interval", ",", "DateTimeZone", ".", "getDefault", "(", ")", ",", "null", ",", "null...
Returns a cursor of datapoints specified by series. <p>The system default timezone is used for the returned DateTimes. @param series The series @param interval An interval of time for the query (start/end datetimes) @return A Cursor of DataPoints. The cursor.iterator().next() may throw a {@link TempoDBException} if an error occurs while making a request. @see Cursor @since 1.0.0
[ "Returns", "a", "cursor", "of", "datapoints", "specified", "by", "series", ".", "<p", ">", "The", "system", "default", "timezone", "is", "used", "for", "the", "returned", "DateTimes", "." ]
train
https://github.com/tempodb/tempodb-java/blob/5733f204fe4c8dda48916ba1f67cf44f5a3f9c69/src/main/java/com/tempodb/Client.java#L607-L609
timols/java-gitlab-api
src/main/java/org/gitlab/api/http/Query.java
Query.appendIf
public Query appendIf(final String name, final GitlabAccessLevel value) throws UnsupportedEncodingException { if (value != null) { append(name, Integer.toString(value.accessValue)); } return this; }
java
public Query appendIf(final String name, final GitlabAccessLevel value) throws UnsupportedEncodingException { if (value != null) { append(name, Integer.toString(value.accessValue)); } return this; }
[ "public", "Query", "appendIf", "(", "final", "String", "name", ",", "final", "GitlabAccessLevel", "value", ")", "throws", "UnsupportedEncodingException", "{", "if", "(", "value", "!=", "null", ")", "{", "append", "(", "name", ",", "Integer", ".", "toString", ...
Conditionally append a parameter to the query if the value of the parameter is not null @param name Parameter name @param value Parameter value @return this @throws java.io.UnsupportedEncodingException If the provided value cannot be URL Encoded
[ "Conditionally", "append", "a", "parameter", "to", "the", "query", "if", "the", "value", "of", "the", "parameter", "is", "not", "null" ]
train
https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/http/Query.java#L70-L75
i-net-software/jlessc
src/com/inet/lib/less/LessParser.java
LessParser.throwUnrecognizedInputIfAny
private void throwUnrecognizedInputIfAny( StringBuilder builder, int ch ) { if( !isWhitespace( builder ) ) { throw createException( "Unrecognized input: '" + trim( builder ) + (char)ch + "'" ); } builder.setLength( 0 ); }
java
private void throwUnrecognizedInputIfAny( StringBuilder builder, int ch ) { if( !isWhitespace( builder ) ) { throw createException( "Unrecognized input: '" + trim( builder ) + (char)ch + "'" ); } builder.setLength( 0 ); }
[ "private", "void", "throwUnrecognizedInputIfAny", "(", "StringBuilder", "builder", ",", "int", "ch", ")", "{", "if", "(", "!", "isWhitespace", "(", "builder", ")", ")", "{", "throw", "createException", "(", "\"Unrecognized input: '\"", "+", "trim", "(", "builder...
Throw an unrecognized input exception if there content in the StringBuilder. @param builder the StringBuilder @param ch the last character
[ "Throw", "an", "unrecognized", "input", "exception", "if", "there", "content", "in", "the", "StringBuilder", "." ]
train
https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/LessParser.java#L1391-L1396
playn/playn
core/src/playn/core/Surface.java
Surface.drawLine
public Surface drawLine (float x0, float y0, float x1, float y1, float width) { // swap the line end points if x1 is less than x0 if (x1 < x0) { float temp = x0; x0 = x1; x1 = temp; temp = y0; y0 = y1; y1 = temp; } float dx = x1 - x0, dy = y1 - y0; float length = FloatMath.sqrt(dx * dx + dy * dy); float wx = dx * (width / 2) / length; float wy = dy * (width / 2) / length; AffineTransform xf = new AffineTransform(); xf.setRotation(FloatMath.atan2(dy, dx)); xf.setTranslation(x0 + wy, y0 - wx); Transforms.multiply(tx(), xf, xf); if (patternTex != null) { batch.addQuad(patternTex, tint, xf, 0, 0, length, width); } else { batch.addQuad(colorTex, Tint.combine(fillColor, tint), xf, 0, 0, length, width); } return this; }
java
public Surface drawLine (float x0, float y0, float x1, float y1, float width) { // swap the line end points if x1 is less than x0 if (x1 < x0) { float temp = x0; x0 = x1; x1 = temp; temp = y0; y0 = y1; y1 = temp; } float dx = x1 - x0, dy = y1 - y0; float length = FloatMath.sqrt(dx * dx + dy * dy); float wx = dx * (width / 2) / length; float wy = dy * (width / 2) / length; AffineTransform xf = new AffineTransform(); xf.setRotation(FloatMath.atan2(dy, dx)); xf.setTranslation(x0 + wy, y0 - wx); Transforms.multiply(tx(), xf, xf); if (patternTex != null) { batch.addQuad(patternTex, tint, xf, 0, 0, length, width); } else { batch.addQuad(colorTex, Tint.combine(fillColor, tint), xf, 0, 0, length, width); } return this; }
[ "public", "Surface", "drawLine", "(", "float", "x0", ",", "float", "y0", ",", "float", "x1", ",", "float", "y1", ",", "float", "width", ")", "{", "// swap the line end points if x1 is less than x0", "if", "(", "x1", "<", "x0", ")", "{", "float", "temp", "=...
Fills a line between the specified coordinates, of the specified display unit width.
[ "Fills", "a", "line", "between", "the", "specified", "coordinates", "of", "the", "specified", "display", "unit", "width", "." ]
train
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/Surface.java#L353-L380
Labs64/swid-generator
src/main/java/com/labs64/utils/swid/support/SwidUtils.java
SwidUtils.generateSwidFileName
public static String generateSwidFileName(final String regId, final String productName, final String uniqueSoftwareId) { return generateSwidFileName(regId, productName, uniqueSoftwareId, null); }
java
public static String generateSwidFileName(final String regId, final String productName, final String uniqueSoftwareId) { return generateSwidFileName(regId, productName, uniqueSoftwareId, null); }
[ "public", "static", "String", "generateSwidFileName", "(", "final", "String", "regId", ",", "final", "String", "productName", ",", "final", "String", "uniqueSoftwareId", ")", "{", "return", "generateSwidFileName", "(", "regId", ",", "productName", ",", "uniqueSoftwa...
<p> Generate SWID tag file name. </p> <p> Example: <code>&lt;regid&gt;_&lt;product_name&gt;‐&lt;unique_software_identifier&gt;.swidtag</code> </p> @param regId the regid value @param productName the product name @param uniqueSoftwareId the unique software identifier @return SWID tag file name
[ "<p", ">", "Generate", "SWID", "tag", "file", "name", ".", "<", "/", "p", ">", "<p", ">", "Example", ":", "<code", ">", "&lt", ";", "regid&gt", ";", "_&lt", ";", "product_name&gt", ";", "‐&lt", ";", "unique_software_identifier&gt", ";", ".", "swidtag<", ...
train
https://github.com/Labs64/swid-generator/blob/cf78d2469469a09701bce7c5f966ac6de2b7c613/src/main/java/com/labs64/utils/swid/support/SwidUtils.java#L113-L116
windup/windup
rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/decompiler/DecompilerUtil.java
DecompilerUtil.getOutputDirectoryForClass
static File getOutputDirectoryForClass(GraphContext context, JavaClassFileModel fileModel) { final File result; WindupConfigurationModel configuration = WindupConfigurationService.getConfigurationModel(context); File inputPath = fileModel.getProjectModel().getRootProjectModel().getRootFileModel().asFile(); if (PathUtil.isInSubDirectory(inputPath, fileModel.asFile())) { String outputPath = configuration.getOutputPath().getFilePath(); result = Paths.get(outputPath).resolve("classes").toFile(); } else { String packageName = fileModel.getPackageName(); if (StringUtils.isBlank(packageName)) return fileModel.asFile().getParentFile(); String[] packageComponents = packageName.split("\\."); File rootFile = fileModel.asFile().getParentFile(); for (int i = 0; i < packageComponents.length; i++) { rootFile = rootFile.getParentFile(); } result = rootFile; } return result; }
java
static File getOutputDirectoryForClass(GraphContext context, JavaClassFileModel fileModel) { final File result; WindupConfigurationModel configuration = WindupConfigurationService.getConfigurationModel(context); File inputPath = fileModel.getProjectModel().getRootProjectModel().getRootFileModel().asFile(); if (PathUtil.isInSubDirectory(inputPath, fileModel.asFile())) { String outputPath = configuration.getOutputPath().getFilePath(); result = Paths.get(outputPath).resolve("classes").toFile(); } else { String packageName = fileModel.getPackageName(); if (StringUtils.isBlank(packageName)) return fileModel.asFile().getParentFile(); String[] packageComponents = packageName.split("\\."); File rootFile = fileModel.asFile().getParentFile(); for (int i = 0; i < packageComponents.length; i++) { rootFile = rootFile.getParentFile(); } result = rootFile; } return result; }
[ "static", "File", "getOutputDirectoryForClass", "(", "GraphContext", "context", ",", "JavaClassFileModel", "fileModel", ")", "{", "final", "File", "result", ";", "WindupConfigurationModel", "configuration", "=", "WindupConfigurationService", ".", "getConfigurationModel", "(...
Returns an appropriate output directory for the decompiled data based upon the provided {@link JavaClassFileModel}. This should be the top-level directory for the package (eg, /tmp/project/foo for the file /tmp/project/foo/com/example/Foo.class). This could be the same directory as the file itself, if the file is already in the output directory. If the .class file is referencing a file in the input directory, then this will be a classes folder underneath the output directory.
[ "Returns", "an", "appropriate", "output", "directory", "for", "the", "decompiled", "data", "based", "upon", "the", "provided", "{", "@link", "JavaClassFileModel", "}", "." ]
train
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/decompiler/DecompilerUtil.java#L26-L52
jayantk/jklol
src/com/jayantkrish/jklol/ccg/CcgParse.java
CcgParse.getPreUnaryLogicalForm
private Expression2 getPreUnaryLogicalForm() { if (isTerminal()) { Expression2 logicalForm = lexiconEntry.getCategory().getLogicalForm(); return logicalForm; } else { Expression2 leftLogicalForm = left.getLogicalForm(); Expression2 rightLogicalForm = right.getLogicalForm(); return getCombinatorLogicalForm(leftLogicalForm, rightLogicalForm); } }
java
private Expression2 getPreUnaryLogicalForm() { if (isTerminal()) { Expression2 logicalForm = lexiconEntry.getCategory().getLogicalForm(); return logicalForm; } else { Expression2 leftLogicalForm = left.getLogicalForm(); Expression2 rightLogicalForm = right.getLogicalForm(); return getCombinatorLogicalForm(leftLogicalForm, rightLogicalForm); } }
[ "private", "Expression2", "getPreUnaryLogicalForm", "(", ")", "{", "if", "(", "isTerminal", "(", ")", ")", "{", "Expression2", "logicalForm", "=", "lexiconEntry", ".", "getCategory", "(", ")", ".", "getLogicalForm", "(", ")", ";", "return", "logicalForm", ";",...
Gets the logical form for this parse without applying the unary rule (if any) at the root. @return
[ "Gets", "the", "logical", "form", "for", "this", "parse", "without", "applying", "the", "unary", "rule", "(", "if", "any", ")", "at", "the", "root", "." ]
train
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/CcgParse.java#L289-L299
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java
ReUtil.contains
public static boolean contains(String regex, CharSequence content) { if (null == regex || null == content) { return false; } final Pattern pattern = PatternPool.get(regex, Pattern.DOTALL); return contains(pattern, content); }
java
public static boolean contains(String regex, CharSequence content) { if (null == regex || null == content) { return false; } final Pattern pattern = PatternPool.get(regex, Pattern.DOTALL); return contains(pattern, content); }
[ "public", "static", "boolean", "contains", "(", "String", "regex", ",", "CharSequence", "content", ")", "{", "if", "(", "null", "==", "regex", "||", "null", "==", "content", ")", "{", "return", "false", ";", "}", "final", "Pattern", "pattern", "=", "Patt...
指定内容中是否有表达式匹配的内容 @param regex 正则表达式 @param content 被查找的内容 @return 指定内容中是否有表达式匹配的内容 @since 3.3.1
[ "指定内容中是否有表达式匹配的内容" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java#L519-L526
alkacon/opencms-core
src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBCmsUsers.java
CmsUpdateDBCmsUsers.addUserDateCreated
protected void addUserDateCreated(CmsSetupDb dbCon) throws SQLException { System.out.println(new Exception().getStackTrace()[0].toString()); // Add the column to the table if necessary if (!dbCon.hasTableOrColumn(CMS_USERS_TABLE, USER_DATECREATED)) { String addUserDateCreated = readQuery(QUERY_ADD_USER_DATECREATED_COLUMN); dbCon.updateSqlStatement(addUserDateCreated, null, null); String setUserDateCreated = readQuery(QUERY_SET_USER_DATECREATED); List<Object> param = new ArrayList<Object>(); // Set the creation date to the current time param.add(new Long(System.currentTimeMillis())); dbCon.updateSqlStatement(setUserDateCreated, null, param); } else { System.out.println("column " + USER_DATECREATED + " in table " + CMS_USERS_TABLE + " already exists"); } }
java
protected void addUserDateCreated(CmsSetupDb dbCon) throws SQLException { System.out.println(new Exception().getStackTrace()[0].toString()); // Add the column to the table if necessary if (!dbCon.hasTableOrColumn(CMS_USERS_TABLE, USER_DATECREATED)) { String addUserDateCreated = readQuery(QUERY_ADD_USER_DATECREATED_COLUMN); dbCon.updateSqlStatement(addUserDateCreated, null, null); String setUserDateCreated = readQuery(QUERY_SET_USER_DATECREATED); List<Object> param = new ArrayList<Object>(); // Set the creation date to the current time param.add(new Long(System.currentTimeMillis())); dbCon.updateSqlStatement(setUserDateCreated, null, param); } else { System.out.println("column " + USER_DATECREATED + " in table " + CMS_USERS_TABLE + " already exists"); } }
[ "protected", "void", "addUserDateCreated", "(", "CmsSetupDb", "dbCon", ")", "throws", "SQLException", "{", "System", ".", "out", ".", "println", "(", "new", "Exception", "(", ")", ".", "getStackTrace", "(", ")", "[", "0", "]", ".", "toString", "(", ")", ...
Adds the new column USER_DATECREATED to the CMS_USERS table.<p> @param dbCon the db connection interface @throws SQLException if something goes wrong
[ "Adds", "the", "new", "column", "USER_DATECREATED", "to", "the", "CMS_USERS", "table", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBCmsUsers.java#L216-L233
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionCategoryPersistenceImpl.java
CPOptionCategoryPersistenceImpl.findByCompanyId
@Override public List<CPOptionCategory> findByCompanyId(long companyId, int start, int end) { return findByCompanyId(companyId, start, end, null); }
java
@Override public List<CPOptionCategory> findByCompanyId(long companyId, int start, int end) { return findByCompanyId(companyId, start, end, null); }
[ "@", "Override", "public", "List", "<", "CPOptionCategory", ">", "findByCompanyId", "(", "long", "companyId", ",", "int", "start", ",", "int", "end", ")", "{", "return", "findByCompanyId", "(", "companyId", ",", "start", ",", "end", ",", "null", ")", ";", ...
Returns a range of all the cp option categories where companyId = &#63;. <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 CPOptionCategoryModelImpl}. 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 companyId the company ID @param start the lower bound of the range of cp option categories @param end the upper bound of the range of cp option categories (not inclusive) @return the range of matching cp option categories
[ "Returns", "a", "range", "of", "all", "the", "cp", "option", "categories", "where", "companyId", "=", "&#63", ";", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionCategoryPersistenceImpl.java#L2044-L2048
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/FieldAnnotation.java
FieldAnnotation.fromBCELField
public static FieldAnnotation fromBCELField(JavaClass jClass, Field field) { return new FieldAnnotation(jClass.getClassName(), field.getName(), field.getSignature(), field.isStatic()); }
java
public static FieldAnnotation fromBCELField(JavaClass jClass, Field field) { return new FieldAnnotation(jClass.getClassName(), field.getName(), field.getSignature(), field.isStatic()); }
[ "public", "static", "FieldAnnotation", "fromBCELField", "(", "JavaClass", "jClass", ",", "Field", "field", ")", "{", "return", "new", "FieldAnnotation", "(", "jClass", ".", "getClassName", "(", ")", ",", "field", ".", "getName", "(", ")", ",", "field", ".", ...
Factory method. Construct from class name and BCEL Field object. @param jClass the class which defines the field @param field the BCEL Field object @return the FieldAnnotation
[ "Factory", "method", ".", "Construct", "from", "class", "name", "and", "BCEL", "Field", "object", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/FieldAnnotation.java#L172-L174
Berico-Technologies/CLAVIN
src/main/java/com/bericotech/clavin/gazetteer/query/QueryBuilder.java
QueryBuilder.removeParentIds
public QueryBuilder removeParentIds(final Integer id1, final Integer... ids) { parentIds.remove(id1); parentIds.removeAll(Arrays.asList(ids)); return this; }
java
public QueryBuilder removeParentIds(final Integer id1, final Integer... ids) { parentIds.remove(id1); parentIds.removeAll(Arrays.asList(ids)); return this; }
[ "public", "QueryBuilder", "removeParentIds", "(", "final", "Integer", "id1", ",", "final", "Integer", "...", "ids", ")", "{", "parentIds", ".", "remove", "(", "id1", ")", ";", "parentIds", ".", "removeAll", "(", "Arrays", ".", "asList", "(", "ids", ")", ...
Remove the provided parent IDs from the set of query constraints. @param id1 the first parent ID to remove @param ids the subsequent parent IDs to remove @return this
[ "Remove", "the", "provided", "parent", "IDs", "from", "the", "set", "of", "query", "constraints", "." ]
train
https://github.com/Berico-Technologies/CLAVIN/blob/f73c741f33a01b91aa5b06e71860bc354ef3010d/src/main/java/com/bericotech/clavin/gazetteer/query/QueryBuilder.java#L322-L326
apache/incubator-heron
heron/packing/src/java/org/apache/heron/packing/roundrobin/RoundRobinPacking.java
RoundRobinPacking.repack
@Override public PackingPlan repack(PackingPlan currentPackingPlan, Map<String, Integer> componentChanges) throws PackingException { int initialNumContainer = TopologyUtils.getNumContainers(topology); int initialNumInstance = TopologyUtils.getTotalInstance(topology); double initialNumInstancePerContainer = (double) initialNumInstance / initialNumContainer; Map<String, Integer> newComponentParallelism = getNewComponentParallelism(currentPackingPlan, componentChanges); int newNumInstance = TopologyUtils.getTotalInstance(newComponentParallelism); int newNumContainer = (int) Math.ceil(newNumInstance / initialNumInstancePerContainer); return packInternal(newNumContainer, newComponentParallelism); }
java
@Override public PackingPlan repack(PackingPlan currentPackingPlan, Map<String, Integer> componentChanges) throws PackingException { int initialNumContainer = TopologyUtils.getNumContainers(topology); int initialNumInstance = TopologyUtils.getTotalInstance(topology); double initialNumInstancePerContainer = (double) initialNumInstance / initialNumContainer; Map<String, Integer> newComponentParallelism = getNewComponentParallelism(currentPackingPlan, componentChanges); int newNumInstance = TopologyUtils.getTotalInstance(newComponentParallelism); int newNumContainer = (int) Math.ceil(newNumInstance / initialNumInstancePerContainer); return packInternal(newNumContainer, newComponentParallelism); }
[ "@", "Override", "public", "PackingPlan", "repack", "(", "PackingPlan", "currentPackingPlan", ",", "Map", "<", "String", ",", "Integer", ">", "componentChanges", ")", "throws", "PackingException", "{", "int", "initialNumContainer", "=", "TopologyUtils", ".", "getNum...
Read the current packing plan with update parallelism to calculate a new packing plan. This method should determine a new number of containers based on the updated parallism while remaining the number of instances per container <= that of the old packing plan. The packing algorithm packInternal() is shared with pack() delegate to packInternal() with the new container count and component parallelism @param currentPackingPlan Existing packing plan @param componentChanges Map &lt; componentName, new component parallelism &gt; that contains the parallelism for each component whose parallelism has changed. @return new packing plan @throws PackingException
[ "Read", "the", "current", "packing", "plan", "with", "update", "parallelism", "to", "calculate", "a", "new", "packing", "plan", ".", "This", "method", "should", "determine", "a", "new", "number", "of", "containers", "based", "on", "the", "updated", "parallism"...
train
https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/packing/src/java/org/apache/heron/packing/roundrobin/RoundRobinPacking.java#L478-L491
UrielCh/ovh-java-sdk
ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java
ApiOvhIpLoadbalancing.serviceName_tcp_route_routeId_rule_POST
public OvhRouteRule serviceName_tcp_route_routeId_rule_POST(String serviceName, Long routeId, String displayName, String field, OvhRouteRuleMatchesEnum match, Boolean negate, String pattern, String subField) throws IOException { String qPath = "/ipLoadbalancing/{serviceName}/tcp/route/{routeId}/rule"; StringBuilder sb = path(qPath, serviceName, routeId); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "displayName", displayName); addBody(o, "field", field); addBody(o, "match", match); addBody(o, "negate", negate); addBody(o, "pattern", pattern); addBody(o, "subField", subField); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhRouteRule.class); }
java
public OvhRouteRule serviceName_tcp_route_routeId_rule_POST(String serviceName, Long routeId, String displayName, String field, OvhRouteRuleMatchesEnum match, Boolean negate, String pattern, String subField) throws IOException { String qPath = "/ipLoadbalancing/{serviceName}/tcp/route/{routeId}/rule"; StringBuilder sb = path(qPath, serviceName, routeId); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "displayName", displayName); addBody(o, "field", field); addBody(o, "match", match); addBody(o, "negate", negate); addBody(o, "pattern", pattern); addBody(o, "subField", subField); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhRouteRule.class); }
[ "public", "OvhRouteRule", "serviceName_tcp_route_routeId_rule_POST", "(", "String", "serviceName", ",", "Long", "routeId", ",", "String", "displayName", ",", "String", "field", ",", "OvhRouteRuleMatchesEnum", "match", ",", "Boolean", "negate", ",", "String", "pattern", ...
Add a new rule to your route REST: POST /ipLoadbalancing/{serviceName}/tcp/route/{routeId}/rule @param field [required] Name of the field to match like "protocol" or "host". See "/ipLoadbalancing/{serviceName}/availableRouteRules" for a list of available rules @param subField [required] Name of sub-field, if applicable. This may be a Cookie or Header name for instance @param pattern [required] Value to match against this match. Interpretation if this field depends on the match and field @param displayName [required] Human readable name for your rule @param match [required] Matching operator. Not all operators are available for all fields. See "/ipLoadbalancing/{serviceName}/availableRouteRules" @param negate [required] Invert the matching operator effect @param serviceName [required] The internal name of your IP load balancing @param routeId [required] Id of your route
[ "Add", "a", "new", "rule", "to", "your", "route" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1367-L1379
foundation-runtime/configuration
configuration-api/src/main/java/com/cisco/oss/foundation/configuration/ConfigUtil.java
ConfigUtil.createCompositeConfiguration
public static Configuration createCompositeConfiguration(final Class<?> clazz, final Configuration configuration) { final CompositeConfiguration compositeConfiguration = new CompositeConfiguration(); final Configuration defaultConfiguration = ConfigurationFactory.getDefaultConfiguration(); if (configuration != null) { compositeConfiguration.addConfiguration(configuration); } compositeConfiguration.addConfiguration(defaultConfiguration); return compositeConfiguration; }
java
public static Configuration createCompositeConfiguration(final Class<?> clazz, final Configuration configuration) { final CompositeConfiguration compositeConfiguration = new CompositeConfiguration(); final Configuration defaultConfiguration = ConfigurationFactory.getDefaultConfiguration(); if (configuration != null) { compositeConfiguration.addConfiguration(configuration); } compositeConfiguration.addConfiguration(defaultConfiguration); return compositeConfiguration; }
[ "public", "static", "Configuration", "createCompositeConfiguration", "(", "final", "Class", "<", "?", ">", "clazz", ",", "final", "Configuration", "configuration", ")", "{", "final", "CompositeConfiguration", "compositeConfiguration", "=", "new", "CompositeConfiguration",...
create a composite configuration that wraps the configuration sent by the user. this util will also load the "defaultConfig.properties" file loaded relative to the given "clazz" parameter @param clazz - the class that acts as referenced location of "defaultConfig.properties". @param configuration - the configuration supplied by the user that may override values in "defaultConfig.properties". If null is ignored. @return the created compsite configuration.
[ "create", "a", "composite", "configuration", "that", "wraps", "the", "configuration", "sent", "by", "the", "user", ".", "this", "util", "will", "also", "load", "the", "defaultConfig", ".", "properties", "file", "loaded", "relative", "to", "the", "given", "claz...
train
https://github.com/foundation-runtime/configuration/blob/c5bd171a2cca0dc1c8d568f987843ca47c6d1eed/configuration-api/src/main/java/com/cisco/oss/foundation/configuration/ConfigUtil.java#L88-L96
cdk/cdk
misc/extra/src/main/java/org/openscience/cdk/tools/GridGenerator.java
GridGenerator.setDimension
public void setDimension(double minx, double maxx, double miny, double maxy, double minz, double maxz) { this.minx = minx; this.maxx = maxx; this.miny = miny; this.maxy = maxy; this.minz = minz; this.maxz = maxz; }
java
public void setDimension(double minx, double maxx, double miny, double maxy, double minz, double maxz) { this.minx = minx; this.maxx = maxx; this.miny = miny; this.maxy = maxy; this.minz = minz; this.maxz = maxz; }
[ "public", "void", "setDimension", "(", "double", "minx", ",", "double", "maxx", ",", "double", "miny", ",", "double", "maxy", ",", "double", "minz", ",", "double", "maxz", ")", "{", "this", ".", "minx", "=", "minx", ";", "this", ".", "maxx", "=", "ma...
Method sets the maximal 3d dimensions to given min and max values.
[ "Method", "sets", "the", "maximal", "3d", "dimensions", "to", "given", "min", "and", "max", "values", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/tools/GridGenerator.java#L111-L118
alkacon/opencms-core
src/org/opencms/ade/configuration/CmsConfigurationReader.java
CmsConfigurationReader.getBoolean
protected boolean getBoolean(I_CmsXmlContentLocation parent, String name) { I_CmsXmlContentValueLocation location = parent.getSubValue(name); if (location == null) { return false; } String value = location.getValue().getStringValue(m_cms); return Boolean.parseBoolean(value); }
java
protected boolean getBoolean(I_CmsXmlContentLocation parent, String name) { I_CmsXmlContentValueLocation location = parent.getSubValue(name); if (location == null) { return false; } String value = location.getValue().getStringValue(m_cms); return Boolean.parseBoolean(value); }
[ "protected", "boolean", "getBoolean", "(", "I_CmsXmlContentLocation", "parent", ",", "String", "name", ")", "{", "I_CmsXmlContentValueLocation", "location", "=", "parent", ".", "getSubValue", "(", "name", ")", ";", "if", "(", "location", "==", "null", ")", "{", ...
Helper method to read a boolean value from the XML.<p> If the element is not found in the XML, false is returned.<p> @param parent the parent node @param name the name of the XML content value @return the boolean value
[ "Helper", "method", "to", "read", "a", "boolean", "value", "from", "the", "XML", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsConfigurationReader.java#L788-L796
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-scaleout/deeplearning4j-aws/src/main/java/org/deeplearning4j/aws/s3/uploader/S3Uploader.java
S3Uploader.multiPartUpload
public void multiPartUpload(File file, String bucketName) { AmazonS3 client = new AmazonS3Client(creds); bucketName = ensureValidBucketName(bucketName); List<Bucket> buckets = client.listBuckets(); for (Bucket b : buckets) if (b.getName().equals(bucketName)) { doMultiPart(client, bucketName, file); return; } //bucket didn't exist: create it client.createBucket(bucketName); doMultiPart(client, bucketName, file); }
java
public void multiPartUpload(File file, String bucketName) { AmazonS3 client = new AmazonS3Client(creds); bucketName = ensureValidBucketName(bucketName); List<Bucket> buckets = client.listBuckets(); for (Bucket b : buckets) if (b.getName().equals(bucketName)) { doMultiPart(client, bucketName, file); return; } //bucket didn't exist: create it client.createBucket(bucketName); doMultiPart(client, bucketName, file); }
[ "public", "void", "multiPartUpload", "(", "File", "file", ",", "String", "bucketName", ")", "{", "AmazonS3", "client", "=", "new", "AmazonS3Client", "(", "creds", ")", ";", "bucketName", "=", "ensureValidBucketName", "(", "bucketName", ")", ";", "List", "<", ...
Multi part upload for big files @param file the file to upload @param bucketName the bucket name to upload
[ "Multi", "part", "upload", "for", "big", "files" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/deeplearning4j-aws/src/main/java/org/deeplearning4j/aws/s3/uploader/S3Uploader.java#L45-L59
ThreeTen/threeten-extra
src/main/java/org/threeten/extra/chrono/Symmetry010Date.java
Symmetry010Date.resolvePreviousValid
private static Symmetry010Date resolvePreviousValid(int prolepticYear, int month, int dayOfMonth) { int monthR = Math.min(month, MONTHS_IN_YEAR); int dayR = Math.min(dayOfMonth, monthR == 12 && INSTANCE.isLeapYear(prolepticYear) ? DAYS_IN_MONTH + 7 : monthR % 3 == 2 ? DAYS_IN_MONTH_LONG : DAYS_IN_MONTH); return create(prolepticYear, monthR, dayR); }
java
private static Symmetry010Date resolvePreviousValid(int prolepticYear, int month, int dayOfMonth) { int monthR = Math.min(month, MONTHS_IN_YEAR); int dayR = Math.min(dayOfMonth, monthR == 12 && INSTANCE.isLeapYear(prolepticYear) ? DAYS_IN_MONTH + 7 : monthR % 3 == 2 ? DAYS_IN_MONTH_LONG : DAYS_IN_MONTH); return create(prolepticYear, monthR, dayR); }
[ "private", "static", "Symmetry010Date", "resolvePreviousValid", "(", "int", "prolepticYear", ",", "int", "month", ",", "int", "dayOfMonth", ")", "{", "int", "monthR", "=", "Math", ".", "min", "(", "month", ",", "MONTHS_IN_YEAR", ")", ";", "int", "dayR", "=",...
Consistency check for dates manipulations after calls to {@link #plus(long, TemporalUnit)}, {@link #minus(long, TemporalUnit)}, {@link #until(AbstractDate, TemporalUnit)} or {@link #with(TemporalField, long)}. @param prolepticYear the Symmetry010 proleptic-year @param month the Symmetry010 month, from 1 to 12 @param dayOfMonth the Symmetry010 day-of-month, from 1 to 30, or 1 to 31 in February, May, August, November, or 1 to 37 in December in a Leap Year @return the resolved date
[ "Consistency", "check", "for", "dates", "manipulations", "after", "calls", "to", "{", "@link", "#plus", "(", "long", "TemporalUnit", ")", "}", "{", "@link", "#minus", "(", "long", "TemporalUnit", ")", "}", "{", "@link", "#until", "(", "AbstractDate", "Tempor...
train
https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/chrono/Symmetry010Date.java#L299-L305
gallandarakhneorg/afc
advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusNetwork.java
BusNetwork.addBusHub
public BusHub addBusHub(String name, BusStop... stops) { // Do not set immediatly the container to // avoid event firing when adding the stops final BusHub hub = new BusHub(null, name); for (final BusStop stop : stops) { hub.addBusStop(stop, false); } if (addBusHub(hub)) { return hub; } return null; }
java
public BusHub addBusHub(String name, BusStop... stops) { // Do not set immediatly the container to // avoid event firing when adding the stops final BusHub hub = new BusHub(null, name); for (final BusStop stop : stops) { hub.addBusStop(stop, false); } if (addBusHub(hub)) { return hub; } return null; }
[ "public", "BusHub", "addBusHub", "(", "String", "name", ",", "BusStop", "...", "stops", ")", "{", "// Do not set immediatly the container to", "// avoid event firing when adding the stops", "final", "BusHub", "hub", "=", "new", "BusHub", "(", "null", ",", "name", ")",...
Add a bus hub in this network. At least, one bus stop must be given to create a hub if you pass a <code>null</code> name. @param name is the name of the hub. @param stops are the bus stops to put inside the hub. @return the create bus hub, or <code>null</code> if not created.
[ "Add", "a", "bus", "hub", "in", "this", "network", ".", "At", "least", "one", "bus", "stop", "must", "be", "given", "to", "create", "a", "hub", "if", "you", "pass", "a", "<code", ">", "null<", "/", "code", ">", "name", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusNetwork.java#L1070-L1081
citrusframework/citrus
modules/citrus-kubernetes/src/main/java/com/consol/citrus/kubernetes/command/AbstractCreateCommand.java
AbstractCreateCommand.getTemplateAsStream
protected InputStream getTemplateAsStream(TestContext context) { Resource resource; if (templateResource != null) { resource = templateResource; } else { resource = FileUtils.getFileResource(template, context); } String templateYml; try { templateYml = context.replaceDynamicContentInString(FileUtils.readToString(resource)); } catch (IOException e) { throw new CitrusRuntimeException("Failed to read template resource", e); } return new ByteArrayInputStream(templateYml.getBytes()); }
java
protected InputStream getTemplateAsStream(TestContext context) { Resource resource; if (templateResource != null) { resource = templateResource; } else { resource = FileUtils.getFileResource(template, context); } String templateYml; try { templateYml = context.replaceDynamicContentInString(FileUtils.readToString(resource)); } catch (IOException e) { throw new CitrusRuntimeException("Failed to read template resource", e); } return new ByteArrayInputStream(templateYml.getBytes()); }
[ "protected", "InputStream", "getTemplateAsStream", "(", "TestContext", "context", ")", "{", "Resource", "resource", ";", "if", "(", "templateResource", "!=", "null", ")", "{", "resource", "=", "templateResource", ";", "}", "else", "{", "resource", "=", "FileUtil...
Create input stream from template resource and add test variable support. @param context @return
[ "Create", "input", "stream", "from", "template", "resource", "and", "add", "test", "variable", "support", "." ]
train
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-kubernetes/src/main/java/com/consol/citrus/kubernetes/command/AbstractCreateCommand.java#L81-L96
UrielCh/ovh-java-sdk
ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java
ApiOvhHostingweb.serviceName_email_request_POST
public String serviceName_email_request_POST(String serviceName, OvhActionEnum action) throws IOException { String qPath = "/hosting/web/{serviceName}/email/request"; StringBuilder sb = path(qPath, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "action", action); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, String.class); }
java
public String serviceName_email_request_POST(String serviceName, OvhActionEnum action) throws IOException { String qPath = "/hosting/web/{serviceName}/email/request"; StringBuilder sb = path(qPath, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "action", action); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, String.class); }
[ "public", "String", "serviceName_email_request_POST", "(", "String", "serviceName", ",", "OvhActionEnum", "action", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/hosting/web/{serviceName}/email/request\"", ";", "StringBuilder", "sb", "=", "path", "(", "...
Request specific operation for your email REST: POST /hosting/web/{serviceName}/email/request @param action [required] Action you want to request @param serviceName [required] The internal name of your hosting
[ "Request", "specific", "operation", "for", "your", "email" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L1863-L1870
asterisk-java/asterisk-java
src/main/java/org/asteriskjava/live/internal/AsteriskChannelImpl.java
AsteriskChannelImpl.channelLinked
synchronized void channelLinked(Date date, AsteriskChannel linkedChannel) { final AsteriskChannel oldLinkedChannel; synchronized (this.linkedChannels) { if (this.linkedChannels.isEmpty()) { oldLinkedChannel = null; this.linkedChannels.add(linkedChannel); } else { oldLinkedChannel = this.linkedChannels.get(0); this.linkedChannels.set(0, linkedChannel); } } final LinkedChannelHistoryEntry historyEntry; historyEntry = new LinkedChannelHistoryEntry(date, linkedChannel); synchronized (linkedChannelHistory) { linkedChannelHistory.add(historyEntry); } this.wasLinked = true; firePropertyChange(PROPERTY_LINKED_CHANNEL, oldLinkedChannel, linkedChannel); }
java
synchronized void channelLinked(Date date, AsteriskChannel linkedChannel) { final AsteriskChannel oldLinkedChannel; synchronized (this.linkedChannels) { if (this.linkedChannels.isEmpty()) { oldLinkedChannel = null; this.linkedChannels.add(linkedChannel); } else { oldLinkedChannel = this.linkedChannels.get(0); this.linkedChannels.set(0, linkedChannel); } } final LinkedChannelHistoryEntry historyEntry; historyEntry = new LinkedChannelHistoryEntry(date, linkedChannel); synchronized (linkedChannelHistory) { linkedChannelHistory.add(historyEntry); } this.wasLinked = true; firePropertyChange(PROPERTY_LINKED_CHANNEL, oldLinkedChannel, linkedChannel); }
[ "synchronized", "void", "channelLinked", "(", "Date", "date", ",", "AsteriskChannel", "linkedChannel", ")", "{", "final", "AsteriskChannel", "oldLinkedChannel", ";", "synchronized", "(", "this", ".", "linkedChannels", ")", "{", "if", "(", "this", ".", "linkedChann...
Sets the channel this channel is bridged with. @param date the date this channel was linked. @param linkedChannel the channel this channel is bridged with.
[ "Sets", "the", "channel", "this", "channel", "is", "bridged", "with", "." ]
train
https://github.com/asterisk-java/asterisk-java/blob/cdc9849270d97ef75afa447a02c5194ed29121eb/src/main/java/org/asteriskjava/live/internal/AsteriskChannelImpl.java#L597-L623
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/classify/Dataset.java
Dataset.selectFeatures
public void selectFeatures(int numFeatures, double[] scores) { List<ScoredObject<F>> scoredFeatures = new ArrayList<ScoredObject<F>>(); for (int i = 0; i < scores.length; i++) { scoredFeatures.add(new ScoredObject<F>(featureIndex.get(i), scores[i])); } Collections.sort(scoredFeatures, ScoredComparator.DESCENDING_COMPARATOR); Index<F> newFeatureIndex = new HashIndex<F>(); for (int i = 0; i < scoredFeatures.size() && i < numFeatures; i++) { newFeatureIndex.add(scoredFeatures.get(i).object()); //System.err.println(scoredFeatures.get(i)); } for (int i = 0; i < size; i++) { int[] newData = new int[data[i].length]; int curIndex = 0; for (int j = 0; j < data[i].length; j++) { int index; if ((index = newFeatureIndex.indexOf(featureIndex.get(data[i][j]))) != -1) { newData[curIndex++] = index; } } int[] newDataTrimmed = new int[curIndex]; System.arraycopy(newData, 0, newDataTrimmed, 0, curIndex); data[i] = newDataTrimmed; } featureIndex = newFeatureIndex; }
java
public void selectFeatures(int numFeatures, double[] scores) { List<ScoredObject<F>> scoredFeatures = new ArrayList<ScoredObject<F>>(); for (int i = 0; i < scores.length; i++) { scoredFeatures.add(new ScoredObject<F>(featureIndex.get(i), scores[i])); } Collections.sort(scoredFeatures, ScoredComparator.DESCENDING_COMPARATOR); Index<F> newFeatureIndex = new HashIndex<F>(); for (int i = 0; i < scoredFeatures.size() && i < numFeatures; i++) { newFeatureIndex.add(scoredFeatures.get(i).object()); //System.err.println(scoredFeatures.get(i)); } for (int i = 0; i < size; i++) { int[] newData = new int[data[i].length]; int curIndex = 0; for (int j = 0; j < data[i].length; j++) { int index; if ((index = newFeatureIndex.indexOf(featureIndex.get(data[i][j]))) != -1) { newData[curIndex++] = index; } } int[] newDataTrimmed = new int[curIndex]; System.arraycopy(newData, 0, newDataTrimmed, 0, curIndex); data[i] = newDataTrimmed; } featureIndex = newFeatureIndex; }
[ "public", "void", "selectFeatures", "(", "int", "numFeatures", ",", "double", "[", "]", "scores", ")", "{", "List", "<", "ScoredObject", "<", "F", ">>", "scoredFeatures", "=", "new", "ArrayList", "<", "ScoredObject", "<", "F", ">", ">", "(", ")", ";", ...
Generic method to select features based on the feature scores vector provided as an argument. @param numFeatures number of features to be selected. @param scores a vector of size total number of features in the data.
[ "Generic", "method", "to", "select", "features", "based", "on", "the", "feature", "scores", "vector", "provided", "as", "an", "argument", "." ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/classify/Dataset.java#L598-L627
DDTH/ddth-commons
ddth-commons-core/src/main/java/com/github/ddth/commons/utils/IdGenerator.java
IdGenerator.extractTimestampTinyAscii
public static long extractTimestampTinyAscii(String idTinyAscii) throws NumberFormatException { return extractTimestampTiny(Long.parseLong(idTinyAscii, Character.MAX_RADIX)); }
java
public static long extractTimestampTinyAscii(String idTinyAscii) throws NumberFormatException { return extractTimestampTiny(Long.parseLong(idTinyAscii, Character.MAX_RADIX)); }
[ "public", "static", "long", "extractTimestampTinyAscii", "(", "String", "idTinyAscii", ")", "throws", "NumberFormatException", "{", "return", "extractTimestampTiny", "(", "Long", ".", "parseLong", "(", "idTinyAscii", ",", "Character", ".", "MAX_RADIX", ")", ")", ";"...
Extracts the (UNIX) timestamp from a tiny ascii id (radix {@link Character#MAX_RADIX}). @param idTinyAscii @return the UNIX timestamp (milliseconds) @throws NumberFormatException
[ "Extracts", "the", "(", "UNIX", ")", "timestamp", "from", "a", "tiny", "ascii", "id", "(", "radix", "{", "@link", "Character#MAX_RADIX", "}", ")", "." ]
train
https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/IdGenerator.java#L231-L233
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/BottouSchedule.java
BottouSchedule.getLearningRate
@Override public double getLearningRate(int iterCount, int i) { // We use the learning rate suggested in Leon Bottou's (2012) SGD Tricks paper. // // \gamma_t = \frac{\gamma_0}{(1 + \gamma_0 \lambda t)^p} // // For SGD p = 1.0, for ASGD p = 0.75 if (prm.power == 1.0) { return prm.initialLr / (1 + prm.initialLr * prm.lambda * iterCount); } else { return prm.initialLr / Math.pow(1 + prm.initialLr * prm.lambda * iterCount, prm.power); } }
java
@Override public double getLearningRate(int iterCount, int i) { // We use the learning rate suggested in Leon Bottou's (2012) SGD Tricks paper. // // \gamma_t = \frac{\gamma_0}{(1 + \gamma_0 \lambda t)^p} // // For SGD p = 1.0, for ASGD p = 0.75 if (prm.power == 1.0) { return prm.initialLr / (1 + prm.initialLr * prm.lambda * iterCount); } else { return prm.initialLr / Math.pow(1 + prm.initialLr * prm.lambda * iterCount, prm.power); } }
[ "@", "Override", "public", "double", "getLearningRate", "(", "int", "iterCount", ",", "int", "i", ")", "{", "// We use the learning rate suggested in Leon Bottou's (2012) SGD Tricks paper.", "// ", "// \\gamma_t = \\frac{\\gamma_0}{(1 + \\gamma_0 \\lambda t)^p}", "//", "// For SGD ...
Gets the learning rate for the current iteration. @param iterCount The current iteration. @param i The index of the current model parameter.
[ "Gets", "the", "learning", "rate", "for", "the", "current", "iteration", "." ]
train
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/BottouSchedule.java#L50-L62
Appendium/objectlabkit
utils/src/main/java/net/objectlab/kit/util/IntegerUtil.java
IntegerUtil.assign
public static Integer assign(final Integer value, final Integer defaultValueIfNull) { return value != null ? value : defaultValueIfNull; }
java
public static Integer assign(final Integer value, final Integer defaultValueIfNull) { return value != null ? value : defaultValueIfNull; }
[ "public", "static", "Integer", "assign", "(", "final", "Integer", "value", ",", "final", "Integer", "defaultValueIfNull", ")", "{", "return", "value", "!=", "null", "?", "value", ":", "defaultValueIfNull", ";", "}" ]
Return the value unless it is null, in which case it returns the default value. @param value @param defaultValueIfNull @return
[ "Return", "the", "value", "unless", "it", "is", "null", "in", "which", "case", "it", "returns", "the", "default", "value", "." ]
train
https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/utils/src/main/java/net/objectlab/kit/util/IntegerUtil.java#L116-L118
JoeKerouac/utils
src/main/java/com/joe/utils/cluster/redis/RedisClusterManagerFactory.java
RedisClusterManagerFactory.buildRedisConfig
public static RedisSingleServerConfig buildRedisConfig(String host, int port, String password) { RedisSingleServerConfig config = new RedisSingleServerConfig(); config.setAddress(host + ":" + port); config.setPassword(password); return config; }
java
public static RedisSingleServerConfig buildRedisConfig(String host, int port, String password) { RedisSingleServerConfig config = new RedisSingleServerConfig(); config.setAddress(host + ":" + port); config.setPassword(password); return config; }
[ "public", "static", "RedisSingleServerConfig", "buildRedisConfig", "(", "String", "host", ",", "int", "port", ",", "String", "password", ")", "{", "RedisSingleServerConfig", "config", "=", "new", "RedisSingleServerConfig", "(", ")", ";", "config", ".", "setAddress",...
根据host、port、password构建一个redis单机配置文件 @param host redis host @param port redis port @param password redis password @return redis 单机配置文件
[ "根据host、port、password构建一个redis单机配置文件" ]
train
https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/cluster/redis/RedisClusterManagerFactory.java#L106-L111
jaxio/celerio
celerio-engine/src/main/java/com/jaxio/celerio/template/TemplateExecution.java
TemplateExecution.require
public void require(Namer packageNamer, Namer classNamer) { requireFirstTime(packageNamer.getPackageName() + "." + classNamer.getType()); }
java
public void require(Namer packageNamer, Namer classNamer) { requireFirstTime(packageNamer.getPackageName() + "." + classNamer.getType()); }
[ "public", "void", "require", "(", "Namer", "packageNamer", ",", "Namer", "classNamer", ")", "{", "requireFirstTime", "(", "packageNamer", ".", "getPackageName", "(", ")", "+", "\".\"", "+", "classNamer", ".", "getType", "(", ")", ")", ";", "}" ]
Import the passed classNamer's type present in the passed packageNamer's package name.
[ "Import", "the", "passed", "classNamer", "s", "type", "present", "in", "the", "passed", "packageNamer", "s", "package", "name", "." ]
train
https://github.com/jaxio/celerio/blob/fbfacb639e286f9f3f3a18986f74ea275bebd887/celerio-engine/src/main/java/com/jaxio/celerio/template/TemplateExecution.java#L434-L436
intellimate/Izou
src/main/java/org/intellimate/izou/events/EventDistributor.java
EventDistributor.unregisterEventFinishedListener
@SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") public void unregisterEventFinishedListener(EventModel<EventModel> event, EventListenerModel eventListener) throws IllegalArgumentException { for (String id : event.getAllInformations()) { ArrayList<EventListenerModel> listenersList = finishListeners.get(id); if (listenersList == null) { return; } synchronized (listenersList) { listenersList.remove(eventListener); } } }
java
@SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") public void unregisterEventFinishedListener(EventModel<EventModel> event, EventListenerModel eventListener) throws IllegalArgumentException { for (String id : event.getAllInformations()) { ArrayList<EventListenerModel> listenersList = finishListeners.get(id); if (listenersList == null) { return; } synchronized (listenersList) { listenersList.remove(eventListener); } } }
[ "@", "SuppressWarnings", "(", "\"SynchronizationOnLocalVariableOrMethodParameter\"", ")", "public", "void", "unregisterEventFinishedListener", "(", "EventModel", "<", "EventModel", ">", "event", ",", "EventListenerModel", "eventListener", ")", "throws", "IllegalArgumentExceptio...
unregister an EventListener that got called when the event finished processing. It will unregister for all Descriptors individually! It will also ignore if this listener is not listening to an Event. Method is thread-safe. @param event the Event to stop listen to @param eventListener the ActivatorEventListener used to listen for events @throws IllegalArgumentException if Listener is already listening to the Event or the id is not allowed
[ "unregister", "an", "EventListener", "that", "got", "called", "when", "the", "event", "finished", "processing", "." ]
train
https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/events/EventDistributor.java#L246-L257
Netflix/astyanax
astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/locks/ColumnPrefixDistributedRowLock.java
ColumnPrefixDistributedRowLock.fillLockMutation
public String fillLockMutation(MutationBatch m, Long time, Integer ttl) { if (lockColumn != null) { if (!lockColumn.equals(prefix+lockId)) throw new IllegalStateException("Can't change prefix or lockId after acquiring the lock"); } else { lockColumn = prefix + lockId; } Long timeoutValue = (time == null) ? new Long(0) : time + TimeUnit.MICROSECONDS.convert(timeout, timeoutUnits); m.withRow(columnFamily, key).putColumn(lockColumn, generateTimeoutValue(timeoutValue), ttl); return lockColumn; }
java
public String fillLockMutation(MutationBatch m, Long time, Integer ttl) { if (lockColumn != null) { if (!lockColumn.equals(prefix+lockId)) throw new IllegalStateException("Can't change prefix or lockId after acquiring the lock"); } else { lockColumn = prefix + lockId; } Long timeoutValue = (time == null) ? new Long(0) : time + TimeUnit.MICROSECONDS.convert(timeout, timeoutUnits); m.withRow(columnFamily, key).putColumn(lockColumn, generateTimeoutValue(timeoutValue), ttl); return lockColumn; }
[ "public", "String", "fillLockMutation", "(", "MutationBatch", "m", ",", "Long", "time", ",", "Integer", "ttl", ")", "{", "if", "(", "lockColumn", "!=", "null", ")", "{", "if", "(", "!", "lockColumn", ".", "equals", "(", "prefix", "+", "lockId", ")", ")...
Fill a mutation with the lock column. This may be used when the mutation is executed externally but should be used with extreme caution to ensure the lock is properly released @param m @param time @param ttl
[ "Fill", "a", "mutation", "with", "the", "lock", "column", ".", "This", "may", "be", "used", "when", "the", "mutation", "is", "executed", "externally", "but", "should", "be", "used", "with", "extreme", "caution", "to", "ensure", "the", "lock", "is", "proper...
train
https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/locks/ColumnPrefixDistributedRowLock.java#L460-L476
fhoeben/hsac-fitnesse-fixtures
src/main/java/nl/hsac/fitnesse/fixture/util/TimeoutHelper.java
TimeoutHelper.callWithTimeout
public <T> T callWithTimeout(String description, int timeout, Callable<T> task) { Future<T> callFuture = threadPool.submit(task); return getWithTimeout(callFuture, timeout, description); }
java
public <T> T callWithTimeout(String description, int timeout, Callable<T> task) { Future<T> callFuture = threadPool.submit(task); return getWithTimeout(callFuture, timeout, description); }
[ "public", "<", "T", ">", "T", "callWithTimeout", "(", "String", "description", ",", "int", "timeout", ",", "Callable", "<", "T", ">", "task", ")", "{", "Future", "<", "T", ">", "callFuture", "=", "threadPool", ".", "submit", "(", "task", ")", ";", "r...
Calls task but ensures it ends. @param <T> expected type of return value. @param description description of task. @param timeout timeout in milliseconds. @param task task to execute. @return return value from task.
[ "Calls", "task", "but", "ensures", "it", "ends", "." ]
train
https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/TimeoutHelper.java#L25-L28
sd4324530/fastweixin
src/main/java/com/github/sd4324530/fastweixin/api/CustomAPI.java
CustomAPI.uploadHeadImg
public ResultType uploadHeadImg(String accountName, File file) { LOG.debug("设置客服帐号头像....."); BeanUtil.requireNonNull(accountName, "帐号必填"); BeanUtil.requireNonNull(file, "文件为空"); String fileName = file.getName().toLowerCase(); if (!fileName.endsWith("jpg")) { throw new WeixinException("头像必须是jpg格式"); } String url = BASE_API_URL + "customservice/kfaccount/uploadheadimg?access_token=#&kf_account=" + accountName; BaseResponse response = executePost(url, null, file); return ResultType.get(response.getErrcode()); }
java
public ResultType uploadHeadImg(String accountName, File file) { LOG.debug("设置客服帐号头像....."); BeanUtil.requireNonNull(accountName, "帐号必填"); BeanUtil.requireNonNull(file, "文件为空"); String fileName = file.getName().toLowerCase(); if (!fileName.endsWith("jpg")) { throw new WeixinException("头像必须是jpg格式"); } String url = BASE_API_URL + "customservice/kfaccount/uploadheadimg?access_token=#&kf_account=" + accountName; BaseResponse response = executePost(url, null, file); return ResultType.get(response.getErrcode()); }
[ "public", "ResultType", "uploadHeadImg", "(", "String", "accountName", ",", "File", "file", ")", "{", "LOG", ".", "debug", "(", "\"设置客服帐号头像.....\");", "", "", "BeanUtil", ".", "requireNonNull", "(", "accountName", ",", "\"帐号必填\");", "", "", "BeanUtil", ".", ...
设置客服帐号头像 @param accountName 客服帐号名 @param file 头像文件 @return 设置结果
[ "设置客服帐号头像" ]
train
https://github.com/sd4324530/fastweixin/blob/6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447/src/main/java/com/github/sd4324530/fastweixin/api/CustomAPI.java#L175-L187
iwgang/CountdownView
library/src/main/java/cn/iwgang/countdownview/CountdownView.java
CountdownView.measureSize
private int measureSize(int specType, int contentSize, int measureSpec) { int result; int specMode = MeasureSpec.getMode(measureSpec); int specSize = MeasureSpec.getSize(measureSpec); if (specMode == MeasureSpec.EXACTLY) { result = Math.max(contentSize, specSize); } else { result = contentSize; if (specType == 1) { // width result += (getPaddingLeft() + getPaddingRight()); } else { // height result += (getPaddingTop() + getPaddingBottom()); } } return result; }
java
private int measureSize(int specType, int contentSize, int measureSpec) { int result; int specMode = MeasureSpec.getMode(measureSpec); int specSize = MeasureSpec.getSize(measureSpec); if (specMode == MeasureSpec.EXACTLY) { result = Math.max(contentSize, specSize); } else { result = contentSize; if (specType == 1) { // width result += (getPaddingLeft() + getPaddingRight()); } else { // height result += (getPaddingTop() + getPaddingBottom()); } } return result; }
[ "private", "int", "measureSize", "(", "int", "specType", ",", "int", "contentSize", ",", "int", "measureSpec", ")", "{", "int", "result", ";", "int", "specMode", "=", "MeasureSpec", ".", "getMode", "(", "measureSpec", ")", ";", "int", "specSize", "=", "Mea...
measure view Size @param specType 1 width 2 height @param contentSize all content view size @param measureSpec spec @return measureSize
[ "measure", "view", "Size" ]
train
https://github.com/iwgang/CountdownView/blob/3433615826b6e0a38b92e3362ba032947d9e8be7/library/src/main/java/cn/iwgang/countdownview/CountdownView.java#L66-L86
lucee/Lucee
core/src/main/java/lucee/runtime/ComponentImpl.java
ComponentImpl.duplicateDataMember
public static MapPro duplicateDataMember(ComponentImpl c, MapPro map, MapPro newMap, boolean deepCopy) { Iterator it = map.entrySet().iterator(); Map.Entry entry; Object value; while (it.hasNext()) { entry = (Entry) it.next(); value = entry.getValue(); if (!(value instanceof UDF)) { if (deepCopy) value = Duplicator.duplicate(value, deepCopy); newMap.put(entry.getKey(), value); } } return newMap; }
java
public static MapPro duplicateDataMember(ComponentImpl c, MapPro map, MapPro newMap, boolean deepCopy) { Iterator it = map.entrySet().iterator(); Map.Entry entry; Object value; while (it.hasNext()) { entry = (Entry) it.next(); value = entry.getValue(); if (!(value instanceof UDF)) { if (deepCopy) value = Duplicator.duplicate(value, deepCopy); newMap.put(entry.getKey(), value); } } return newMap; }
[ "public", "static", "MapPro", "duplicateDataMember", "(", "ComponentImpl", "c", ",", "MapPro", "map", ",", "MapPro", "newMap", ",", "boolean", "deepCopy", ")", "{", "Iterator", "it", "=", "map", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", ...
duplicate the datamember in the map, ignores the udfs @param c @param map @param newMap @param deepCopy @return
[ "duplicate", "the", "datamember", "in", "the", "map", "ignores", "the", "udfs" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/ComponentImpl.java#L326-L340
oehf/ipf-oht-atna
auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditorFactory.java
AuditorFactory.getAuditor
public static IHEAuditor getAuditor(String className, AuditorModuleConfig config, boolean useGlobalContext) { Class<? extends IHEAuditor> clazz = AuditorFactory.getAuditorClassForClassName(className); return getAuditor(clazz, config, useGlobalContext); }
java
public static IHEAuditor getAuditor(String className, AuditorModuleConfig config, boolean useGlobalContext) { Class<? extends IHEAuditor> clazz = AuditorFactory.getAuditorClassForClassName(className); return getAuditor(clazz, config, useGlobalContext); }
[ "public", "static", "IHEAuditor", "getAuditor", "(", "String", "className", ",", "AuditorModuleConfig", "config", ",", "boolean", "useGlobalContext", ")", "{", "Class", "<", "?", "extends", "IHEAuditor", ">", "clazz", "=", "AuditorFactory", ".", "getAuditorClassForC...
Get an auditor instance for the specified auditor class name, module configuration. Auditor will use a standalone context if a non-global context is requested @param className Class name of the auditor class to instantiate @param config Auditor configuration to use @param useGlobalContext Whether to use the global (true) or standalone (false) context @return Instance of an IHE Auditor
[ "Get", "an", "auditor", "instance", "for", "the", "specified", "auditor", "class", "name", "module", "configuration", ".", "Auditor", "will", "use", "a", "standalone", "context", "if", "a", "non", "-", "global", "context", "is", "requested" ]
train
https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditorFactory.java#L121-L125
deeplearning4j/deeplearning4j
datavec/datavec-spark/src/main/java/org/datavec/spark/transform/utils/SparkExport.java
SparkExport.exportCSVSequenceLocal
public static void exportCSVSequenceLocal(File baseDir, JavaRDD<List<List<Writable>>> sequences, long seed) throws Exception { baseDir.mkdirs(); if (!baseDir.isDirectory()) throw new IllegalArgumentException("File is not a directory: " + baseDir.toString()); String baseDirStr = baseDir.toString(); List<String> fileContents = sequences.map(new SequenceToStringFunction(",")).collect(); if (!(fileContents instanceof ArrayList)) fileContents = new ArrayList<>(fileContents); Collections.shuffle(fileContents, new Random(seed)); int i = 0; for (String s : fileContents) { String path = FilenameUtils.concat(baseDirStr, i + ".csv"); File f = new File(path); FileUtils.writeStringToFile(f, s); i++; } }
java
public static void exportCSVSequenceLocal(File baseDir, JavaRDD<List<List<Writable>>> sequences, long seed) throws Exception { baseDir.mkdirs(); if (!baseDir.isDirectory()) throw new IllegalArgumentException("File is not a directory: " + baseDir.toString()); String baseDirStr = baseDir.toString(); List<String> fileContents = sequences.map(new SequenceToStringFunction(",")).collect(); if (!(fileContents instanceof ArrayList)) fileContents = new ArrayList<>(fileContents); Collections.shuffle(fileContents, new Random(seed)); int i = 0; for (String s : fileContents) { String path = FilenameUtils.concat(baseDirStr, i + ".csv"); File f = new File(path); FileUtils.writeStringToFile(f, s); i++; } }
[ "public", "static", "void", "exportCSVSequenceLocal", "(", "File", "baseDir", ",", "JavaRDD", "<", "List", "<", "List", "<", "Writable", ">", ">", ">", "sequences", ",", "long", "seed", ")", "throws", "Exception", "{", "baseDir", ".", "mkdirs", "(", ")", ...
Quick and dirty CSV export: one file per sequence, with shuffling of the order of sequences
[ "Quick", "and", "dirty", "CSV", "export", ":", "one", "file", "per", "sequence", "with", "shuffling", "of", "the", "order", "of", "sequences" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/utils/SparkExport.java#L163-L182
sebastiangraf/treetank
interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/util/RESTResponseHelper.java
RESTResponseHelper.createCollectionElementDBs
private static List<Element> createCollectionElementDBs(final IStorage pDatabase, final Document document, final IBackendFactory pStorageFac, final IRevisioning pRevision) throws WebApplicationException, TTException { final List<Element> collectionsEls = new ArrayList<Element>(); for (final String res : pDatabase.listResources()) { final Element elRes = document.createElement("resource"); // Getting the name elRes.setAttribute("name", res); // get last revision from given db name final DatabaseRepresentation dbWorker = new DatabaseRepresentation(pDatabase, pStorageFac, pRevision); final String lastRevision = Long.toString(dbWorker.getLastRevision(res.toString())); elRes.setAttribute("lastRevision", lastRevision); collectionsEls.add(elRes); } return collectionsEls; }
java
private static List<Element> createCollectionElementDBs(final IStorage pDatabase, final Document document, final IBackendFactory pStorageFac, final IRevisioning pRevision) throws WebApplicationException, TTException { final List<Element> collectionsEls = new ArrayList<Element>(); for (final String res : pDatabase.listResources()) { final Element elRes = document.createElement("resource"); // Getting the name elRes.setAttribute("name", res); // get last revision from given db name final DatabaseRepresentation dbWorker = new DatabaseRepresentation(pDatabase, pStorageFac, pRevision); final String lastRevision = Long.toString(dbWorker.getLastRevision(res.toString())); elRes.setAttribute("lastRevision", lastRevision); collectionsEls.add(elRes); } return collectionsEls; }
[ "private", "static", "List", "<", "Element", ">", "createCollectionElementDBs", "(", "final", "IStorage", "pDatabase", ",", "final", "Document", "document", ",", "final", "IBackendFactory", "pStorageFac", ",", "final", "IRevisioning", "pRevision", ")", "throws", "We...
This method creates the XML element containing a collection. This collection contains the available resources which are children of the database. @param pDatabase path where the data must be stored @param document The XML {@link Document} instance. @return A list of XML {@link Element} as the collection. @throws TTException @throws WebApplicationException
[ "This", "method", "creates", "the", "XML", "element", "containing", "a", "collection", ".", "This", "collection", "contains", "the", "available", "resources", "which", "are", "children", "of", "the", "database", "." ]
train
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/util/RESTResponseHelper.java#L112-L131
optimatika/ojAlgo-finance
src/main/java/org/ojalgo/finance/data/fetcher/YahooSession.java
YahooSession.buildChallengeRequest
static ResourceLocator.Request buildChallengeRequest(ResourceLocator.Session session, String symbol) { // The "options" part causes the cookie to be set. // Other path endings may also work, // but there has to be something after the symbol return session.request().host(FINANCE_YAHOO_COM).path("/quote/" + symbol + "/options"); }
java
static ResourceLocator.Request buildChallengeRequest(ResourceLocator.Session session, String symbol) { // The "options" part causes the cookie to be set. // Other path endings may also work, // but there has to be something after the symbol return session.request().host(FINANCE_YAHOO_COM).path("/quote/" + symbol + "/options"); }
[ "static", "ResourceLocator", ".", "Request", "buildChallengeRequest", "(", "ResourceLocator", ".", "Session", "session", ",", "String", "symbol", ")", "{", "// The \"options\" part causes the cookie to be set.", "// Other path endings may also work,", "// but there has to be someth...
A request that requires consent and will set the "B" cookie, but not the crumb
[ "A", "request", "that", "requires", "consent", "and", "will", "set", "the", "B", "cookie", "but", "not", "the", "crumb" ]
train
https://github.com/optimatika/ojAlgo-finance/blob/c8d3f7e1894d4263b7334bca3f4c060e466f8b15/src/main/java/org/ojalgo/finance/data/fetcher/YahooSession.java#L139-L144
BioPAX/Paxtools
pattern/src/main/java/org/biopax/paxtools/pattern/miner/ExtendedSIFWriter.java
ExtendedSIFWriter.writeParticipants
public static boolean writeParticipants(Set<SIFInteraction> inters, OutputStream out) { if (!inters.isEmpty()) { try { OutputStreamWriter writer = new OutputStreamWriter(out); writeSourceAndTargetDetails(inters, writer); writer.close(); return true; } catch (IOException e) { e.printStackTrace(); } } return false; }
java
public static boolean writeParticipants(Set<SIFInteraction> inters, OutputStream out) { if (!inters.isEmpty()) { try { OutputStreamWriter writer = new OutputStreamWriter(out); writeSourceAndTargetDetails(inters, writer); writer.close(); return true; } catch (IOException e) { e.printStackTrace(); } } return false; }
[ "public", "static", "boolean", "writeParticipants", "(", "Set", "<", "SIFInteraction", ">", "inters", ",", "OutputStream", "out", ")", "{", "if", "(", "!", "inters", ".", "isEmpty", "(", ")", ")", "{", "try", "{", "OutputStreamWriter", "writer", "=", "new"...
Writes down the interaction participants' (nodes) details to the given output stream. Closes the stream at the end. @param inters binary interactions @param out stream to write @return true if any output produced successfully
[ "Writes", "down", "the", "interaction", "participants", "(", "nodes", ")", "details", "to", "the", "given", "output", "stream", ".", "Closes", "the", "stream", "at", "the", "end", "." ]
train
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/miner/ExtendedSIFWriter.java#L119-L136
fcrepo3/fcrepo
fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/pdp/finder/policy/PolicyReader.java
PolicyReader.readPolicy
public synchronized Document readPolicy(InputStream input) throws ParsingException { try { return builder.parse(input); } catch (IOException ioe) { throw new ParsingException("Failed to read the stream", ioe); } catch (SAXException saxe) { throw new ParsingException("Failed to parse the stream", saxe); } }
java
public synchronized Document readPolicy(InputStream input) throws ParsingException { try { return builder.parse(input); } catch (IOException ioe) { throw new ParsingException("Failed to read the stream", ioe); } catch (SAXException saxe) { throw new ParsingException("Failed to parse the stream", saxe); } }
[ "public", "synchronized", "Document", "readPolicy", "(", "InputStream", "input", ")", "throws", "ParsingException", "{", "try", "{", "return", "builder", ".", "parse", "(", "input", ")", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "throw", "new",...
Tries to read an XACML policy or policy set from the given stream. @param input the stream containing the policy to read @return a (potentially schema-validated) policy loaded from the given file @throws ParsingException if an error occurs while reading or parsing the policy
[ "Tries", "to", "read", "an", "XACML", "policy", "or", "policy", "set", "from", "the", "given", "stream", "." ]
train
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/pdp/finder/policy/PolicyReader.java#L171-L180
banq/jdonframework
src/main/java/com/jdon/util/StringUtil.java
StringUtil.encodePassword
public static String encodePassword(String password, String algorithm) { byte[] unencodedPassword = password.getBytes(); MessageDigest md = null; try { // first create an instance, given the provider md = MessageDigest.getInstance(algorithm); } catch (Exception e) { System.err.print("Exception: " + e); return password; } md.reset(); // call the update method one or more times // (useful when you don't know the size of your data, eg. stream) md.update(unencodedPassword); // now calculate the hash byte[] encodedPassword = md.digest(); StringBuilder buf = new StringBuilder(); for (int i = 0; i < encodedPassword.length; i++) { if (((int) encodedPassword[i] & 0xff) < 0x10) { buf.append("0"); } buf.append(Long.toString((int) encodedPassword[i] & 0xff, 16)); } return buf.toString(); }
java
public static String encodePassword(String password, String algorithm) { byte[] unencodedPassword = password.getBytes(); MessageDigest md = null; try { // first create an instance, given the provider md = MessageDigest.getInstance(algorithm); } catch (Exception e) { System.err.print("Exception: " + e); return password; } md.reset(); // call the update method one or more times // (useful when you don't know the size of your data, eg. stream) md.update(unencodedPassword); // now calculate the hash byte[] encodedPassword = md.digest(); StringBuilder buf = new StringBuilder(); for (int i = 0; i < encodedPassword.length; i++) { if (((int) encodedPassword[i] & 0xff) < 0x10) { buf.append("0"); } buf.append(Long.toString((int) encodedPassword[i] & 0xff, 16)); } return buf.toString(); }
[ "public", "static", "String", "encodePassword", "(", "String", "password", ",", "String", "algorithm", ")", "{", "byte", "[", "]", "unencodedPassword", "=", "password", ".", "getBytes", "(", ")", ";", "MessageDigest", "md", "=", "null", ";", "try", "{", "/...
Encode a string using algorithm specified in web.xml and return the resulting encrypted password. If exception, the plain credentials string is returned @param password Password or other credentials to use in authenticating this username @param algorithm Algorithm used to do the digest @return encypted password based on the algorithm.
[ "Encode", "a", "string", "using", "algorithm", "specified", "in", "web", ".", "xml", "and", "return", "the", "resulting", "encrypted", "password", ".", "If", "exception", "the", "plain", "credentials", "string", "is", "returned" ]
train
https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/StringUtil.java#L496-L530
unbescape/unbescape
src/main/java/org/unbescape/xml/XmlEscape.java
XmlEscape.unescapeXml
public static void unescapeXml(final Reader reader, final Writer writer) throws IOException { if (writer == null) { throw new IllegalArgumentException("Argument 'writer' cannot be null"); } // The chosen symbols (1.0 or 1.1) don't really matter, as both contain the same CERs XmlEscapeUtil.unescape(reader, writer, XmlEscapeSymbols.XML11_SYMBOLS); }
java
public static void unescapeXml(final Reader reader, final Writer writer) throws IOException { if (writer == null) { throw new IllegalArgumentException("Argument 'writer' cannot be null"); } // The chosen symbols (1.0 or 1.1) don't really matter, as both contain the same CERs XmlEscapeUtil.unescape(reader, writer, XmlEscapeSymbols.XML11_SYMBOLS); }
[ "public", "static", "void", "unescapeXml", "(", "final", "Reader", "reader", ",", "final", "Writer", "writer", ")", "throws", "IOException", "{", "if", "(", "writer", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Argument 'writer' c...
<p> Perform an XML <strong>unescape</strong> operation on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>. </p> <p> No additional configuration arguments are required. Unescape operations will always perform <em>complete</em> XML 1.0/1.1 unescape of CERs, decimal and hexadecimal references. </p> <p> This method is <strong>thread-safe</strong>. </p> @param reader the <tt>Reader</tt> reading the text to be unescaped. @param writer the <tt>java.io.Writer</tt> to which the unescaped result will be written. Nothing will be written at all to this writer if input is <tt>null</tt>. @throws IOException if an input/output exception occurs @since 1.1.2
[ "<p", ">", "Perform", "an", "XML", "<strong", ">", "unescape<", "/", "strong", ">", "operation", "on", "a", "<tt", ">", "Reader<", "/", "tt", ">", "input", "writing", "results", "to", "a", "<tt", ">", "Writer<", "/", "tt", ">", ".", "<", "/", "p", ...
train
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/xml/XmlEscape.java#L2390-L2400
softindex/datakernel
core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBufPool.java
ByteBufPool.ensureWriteRemaining
@NotNull public static ByteBuf ensureWriteRemaining(@NotNull ByteBuf buf, int minSize, int newWriteRemaining) { if (newWriteRemaining == 0) return buf; if (buf.writeRemaining() < newWriteRemaining || buf instanceof ByteBufSlice) { ByteBuf newBuf = allocate(max(minSize, newWriteRemaining + buf.readRemaining())); newBuf.put(buf); buf.recycle(); return newBuf; } return buf; }
java
@NotNull public static ByteBuf ensureWriteRemaining(@NotNull ByteBuf buf, int minSize, int newWriteRemaining) { if (newWriteRemaining == 0) return buf; if (buf.writeRemaining() < newWriteRemaining || buf instanceof ByteBufSlice) { ByteBuf newBuf = allocate(max(minSize, newWriteRemaining + buf.readRemaining())); newBuf.put(buf); buf.recycle(); return newBuf; } return buf; }
[ "@", "NotNull", "public", "static", "ByteBuf", "ensureWriteRemaining", "(", "@", "NotNull", "ByteBuf", "buf", ",", "int", "minSize", ",", "int", "newWriteRemaining", ")", "{", "if", "(", "newWriteRemaining", "==", "0", ")", "return", "buf", ";", "if", "(", ...
Checks if current ByteBuf can accommodate the needed amount of writable bytes. <p> Returns this ByteBuf, if it contains enough writable bytes. <p> Otherwise creates a new ByteBuf which contains data from the original ByteBuf and fits the parameters. Then recycles the original ByteBuf. @param buf the ByteBuf to check @param minSize the minimal size of the ByteBuf @param newWriteRemaining amount of needed writable bytes @return a ByteBuf which fits the parameters
[ "Checks", "if", "current", "ByteBuf", "can", "accommodate", "the", "needed", "amount", "of", "writable", "bytes", ".", "<p", ">", "Returns", "this", "ByteBuf", "if", "it", "contains", "enough", "writable", "bytes", ".", "<p", ">", "Otherwise", "creates", "a"...
train
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBufPool.java#L258-L268
RestComm/sipunit
src/main/java/org/cafesip/sipunit/SipCall.java
SipCall.respondToCancel
public boolean respondToCancel(SipTransaction siptrans, int statusCode, String reasonPhrase, int expires) { return respondToCancel(siptrans, statusCode, reasonPhrase, expires, null, null, null); }
java
public boolean respondToCancel(SipTransaction siptrans, int statusCode, String reasonPhrase, int expires) { return respondToCancel(siptrans, statusCode, reasonPhrase, expires, null, null, null); }
[ "public", "boolean", "respondToCancel", "(", "SipTransaction", "siptrans", ",", "int", "statusCode", ",", "String", "reasonPhrase", ",", "int", "expires", ")", "{", "return", "respondToCancel", "(", "siptrans", ",", "statusCode", ",", "reasonPhrase", ",", "expires...
This method sends a basic response to a previously received CANCEL request. The response is constructed based on the parameters passed in. Call this method after waitForCancel() returns non-null. Call this method multiple times to send multiple responses to the received CANCEL. @param siptrans This is the object that was returned by method waitForCancel(). It identifies a specific CANCEL transaction. @param statusCode The status code of the response to send (may use SipResponse constants). @param reasonPhrase If not null, the reason phrase to send. @param expires If not -1, an expiration time is added to the response. This parameter indicates the duration the message is valid, in seconds. @return true if the response was successfully sent, false otherwise.
[ "This", "method", "sends", "a", "basic", "response", "to", "a", "previously", "received", "CANCEL", "request", ".", "The", "response", "is", "constructed", "based", "on", "the", "parameters", "passed", "in", ".", "Call", "this", "method", "after", "waitForCanc...
train
https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipCall.java#L3255-L3258
aws/aws-sdk-java
aws-java-sdk-iot1clickprojects/src/main/java/com/amazonaws/services/iot1clickprojects/model/DeviceTemplate.java
DeviceTemplate.withCallbackOverrides
public DeviceTemplate withCallbackOverrides(java.util.Map<String, String> callbackOverrides) { setCallbackOverrides(callbackOverrides); return this; }
java
public DeviceTemplate withCallbackOverrides(java.util.Map<String, String> callbackOverrides) { setCallbackOverrides(callbackOverrides); return this; }
[ "public", "DeviceTemplate", "withCallbackOverrides", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "callbackOverrides", ")", "{", "setCallbackOverrides", "(", "callbackOverrides", ")", ";", "return", "this", ";", "}" ]
<p> An optional Lambda function to invoke instead of the default Lambda function provided by the placement template. </p> @param callbackOverrides An optional Lambda function to invoke instead of the default Lambda function provided by the placement template. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "An", "optional", "Lambda", "function", "to", "invoke", "instead", "of", "the", "default", "Lambda", "function", "provided", "by", "the", "placement", "template", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot1clickprojects/src/main/java/com/amazonaws/services/iot1clickprojects/model/DeviceTemplate.java#L122-L125
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/DirectoryHelper.java
DirectoryHelper.compressDirectory
public static void compressDirectory(File rootPath, File dstZipPath) throws IOException { ZipOutputStream zip = new ZipOutputStream(new FileOutputStream(dstZipPath)); try { if (rootPath.isDirectory()) { String[] files = rootPath.list(); if (files == null || files.length == 0) { // In java 7 no ZipException is thrown in case of an empty directory // so to remain compatible we need to throw it explicitly throw new ZipException("ZIP file must have at least one entry"); } for (int i = 0; i < files.length; i++) { compressDirectory("", new File(rootPath, files[i]), zip); } } else { compressDirectory("", rootPath, zip); } } finally { if (zip != null) { zip.flush(); zip.close(); } } }
java
public static void compressDirectory(File rootPath, File dstZipPath) throws IOException { ZipOutputStream zip = new ZipOutputStream(new FileOutputStream(dstZipPath)); try { if (rootPath.isDirectory()) { String[] files = rootPath.list(); if (files == null || files.length == 0) { // In java 7 no ZipException is thrown in case of an empty directory // so to remain compatible we need to throw it explicitly throw new ZipException("ZIP file must have at least one entry"); } for (int i = 0; i < files.length; i++) { compressDirectory("", new File(rootPath, files[i]), zip); } } else { compressDirectory("", rootPath, zip); } } finally { if (zip != null) { zip.flush(); zip.close(); } } }
[ "public", "static", "void", "compressDirectory", "(", "File", "rootPath", ",", "File", "dstZipPath", ")", "throws", "IOException", "{", "ZipOutputStream", "zip", "=", "new", "ZipOutputStream", "(", "new", "FileOutputStream", "(", "dstZipPath", ")", ")", ";", "tr...
Compress data. In case when <code>rootPath</code> is a directory this method compress all files and folders inside the directory into single one. IOException will be thrown if directory is empty. If the <code>rootPath</code> is the file the only this file will be compressed. @param rootPath the root path, can be the directory or the file @param dstZipPath the path to the destination compressed file @throws IOException if any exception occurred
[ "Compress", "data", ".", "In", "case", "when", "<code", ">", "rootPath<", "/", "code", ">", "is", "a", "directory", "this", "method", "compress", "all", "files", "and", "folders", "inside", "the", "directory", "into", "single", "one", ".", "IOException", "...
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/DirectoryHelper.java#L183-L215
janus-project/guava.janusproject.io
guava/src/com/google/common/collect/ImmutableSortedMultiset.java
ImmutableSortedMultiset.naturalOrder
public static <E extends Comparable<E>> Builder<E> naturalOrder() { return new Builder<E>(Ordering.natural()); }
java
public static <E extends Comparable<E>> Builder<E> naturalOrder() { return new Builder<E>(Ordering.natural()); }
[ "public", "static", "<", "E", "extends", "Comparable", "<", "E", ">", ">", "Builder", "<", "E", ">", "naturalOrder", "(", ")", "{", "return", "new", "Builder", "<", "E", ">", "(", "Ordering", ".", "natural", "(", ")", ")", ";", "}" ]
Returns a builder that creates immutable sorted multisets whose elements are ordered by their natural ordering. The sorted multisets use {@link Ordering#natural()} as the comparator. This method provides more type-safety than {@link #builder}, as it can be called only for classes that implement {@link Comparable}. <p>Note: the type parameter {@code E} extends {@code Comparable<E>} rather than {@code Comparable<? super E>} as a workaround for javac <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6468354">bug 6468354</a>.
[ "Returns", "a", "builder", "that", "creates", "immutable", "sorted", "multisets", "whose", "elements", "are", "ordered", "by", "their", "natural", "ordering", ".", "The", "sorted", "multisets", "use", "{", "@link", "Ordering#natural", "()", "}", "as", "the", "...
train
https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/collect/ImmutableSortedMultiset.java#L415-L417
rzwitserloot/lombok
src/installer/lombok/installer/eclipse/EclipseProductLocationProvider.java
EclipseProductLocationProvider.findIdes
@Override public void findIdes(List<IdeLocation> locations, List<CorruptedIdeLocationException> problems) { switch (OsUtils.getOS()) { case WINDOWS: new WindowsFinder().findEclipse(locations, problems); break; case MAC_OS_X: new MacFinder().findEclipse(locations, problems); break; default: case UNIX: new UnixFinder().findEclipse(locations, problems); break; } }
java
@Override public void findIdes(List<IdeLocation> locations, List<CorruptedIdeLocationException> problems) { switch (OsUtils.getOS()) { case WINDOWS: new WindowsFinder().findEclipse(locations, problems); break; case MAC_OS_X: new MacFinder().findEclipse(locations, problems); break; default: case UNIX: new UnixFinder().findEclipse(locations, problems); break; } }
[ "@", "Override", "public", "void", "findIdes", "(", "List", "<", "IdeLocation", ">", "locations", ",", "List", "<", "CorruptedIdeLocationException", ">", "problems", ")", "{", "switch", "(", "OsUtils", ".", "getOS", "(", ")", ")", "{", "case", "WINDOWS", "...
Calls the OS-dependent 'find Eclipse' routine. If the local OS doesn't have a routine written for it, null is returned. @param locations List of valid eclipse locations - provide an empty list; this method will fill it. @param problems List of eclipse locations that seem to contain half-baked eclipses that can't be installed. Provide an empty list; this method will fill it.
[ "Calls", "the", "OS", "-", "dependent", "find", "Eclipse", "routine", ".", "If", "the", "local", "OS", "doesn", "t", "have", "a", "routine", "written", "for", "it", "null", "is", "returned", "." ]
train
https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/installer/lombok/installer/eclipse/EclipseProductLocationProvider.java#L164-L178
GCRC/nunaliit
nunaliit2-couch-date/src/main/java/ca/carleton/gcrc/couch/date/cluster/TreeInsertProcess.java
TreeInsertProcess.insertElements
static public Result insertElements(Tree tree, List<TreeElement> elements, NowReference now) throws Exception { ResultImpl result = new ResultImpl(tree); TreeNodeRegular regularRootNode = tree.getRegularRootNode(); TreeNodeOngoing ongoingRootNode = tree.getOngoingRootNode(); for(TreeElement element : elements){ TimeInterval elementInterval = element.getInterval(); if( elementInterval.isOngoing() ){ ongoingRootNode.insertElement(element, result, tree.getOperations(), now); } else { regularRootNode.insertElement(element, result, tree.getOperations(), now); } } return result; }
java
static public Result insertElements(Tree tree, List<TreeElement> elements, NowReference now) throws Exception { ResultImpl result = new ResultImpl(tree); TreeNodeRegular regularRootNode = tree.getRegularRootNode(); TreeNodeOngoing ongoingRootNode = tree.getOngoingRootNode(); for(TreeElement element : elements){ TimeInterval elementInterval = element.getInterval(); if( elementInterval.isOngoing() ){ ongoingRootNode.insertElement(element, result, tree.getOperations(), now); } else { regularRootNode.insertElement(element, result, tree.getOperations(), now); } } return result; }
[ "static", "public", "Result", "insertElements", "(", "Tree", "tree", ",", "List", "<", "TreeElement", ">", "elements", ",", "NowReference", "now", ")", "throws", "Exception", "{", "ResultImpl", "result", "=", "new", "ResultImpl", "(", "tree", ")", ";", "Tree...
Modifies a cluster tree as a result of adding a new elements in the tree. @param tree Tree where the element is inserted. @param elements Elements to be inserted in the tree @return Results of inserting the elements @throws Exception
[ "Modifies", "a", "cluster", "tree", "as", "a", "result", "of", "adding", "a", "new", "elements", "in", "the", "tree", "." ]
train
https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-couch-date/src/main/java/ca/carleton/gcrc/couch/date/cluster/TreeInsertProcess.java#L80-L97
negusoft/holoaccent
HoloAccent/src/com/negusoft/holoaccent/AccentResources.java
AccentResources.getTintTransformationResourceStream
private InputStream getTintTransformationResourceStream(int id, TypedValue value, int color) { Bitmap bitmap = getBitmapFromResource(id, value); bitmap = BitmapUtils.processTintTransformationMap(bitmap, color); return getStreamFromBitmap(bitmap); }
java
private InputStream getTintTransformationResourceStream(int id, TypedValue value, int color) { Bitmap bitmap = getBitmapFromResource(id, value); bitmap = BitmapUtils.processTintTransformationMap(bitmap, color); return getStreamFromBitmap(bitmap); }
[ "private", "InputStream", "getTintTransformationResourceStream", "(", "int", "id", ",", "TypedValue", "value", ",", "int", "color", ")", "{", "Bitmap", "bitmap", "=", "getBitmapFromResource", "(", "id", ",", "value", ")", ";", "bitmap", "=", "BitmapUtils", ".", ...
Get a reference to a resource that is equivalent to the one requested, but changing the tint from the original red to the given color.
[ "Get", "a", "reference", "to", "a", "resource", "that", "is", "equivalent", "to", "the", "one", "requested", "but", "changing", "the", "tint", "from", "the", "original", "red", "to", "the", "given", "color", "." ]
train
https://github.com/negusoft/holoaccent/blob/7121a02dde94834e770cb81174d0bdc596323324/HoloAccent/src/com/negusoft/holoaccent/AccentResources.java#L376-L380
codelibs/jcifs
src/main/java/jcifs/smb/NtlmAuthenticator.java
NtlmAuthenticator.requestNtlmPasswordAuthentication
public static NtlmPasswordAuthenticator requestNtlmPasswordAuthentication ( String url, SmbAuthException sae ) { return requestNtlmPasswordAuthentication(auth, url, sae); }
java
public static NtlmPasswordAuthenticator requestNtlmPasswordAuthentication ( String url, SmbAuthException sae ) { return requestNtlmPasswordAuthentication(auth, url, sae); }
[ "public", "static", "NtlmPasswordAuthenticator", "requestNtlmPasswordAuthentication", "(", "String", "url", ",", "SmbAuthException", "sae", ")", "{", "return", "requestNtlmPasswordAuthentication", "(", "auth", ",", "url", ",", "sae", ")", ";", "}" ]
Used internally by jCIFS when an <tt>SmbAuthException</tt> is trapped to retrieve new user credentials. @param url @param sae @return credentials returned by prompt
[ "Used", "internally", "by", "jCIFS", "when", "an", "<tt", ">", "SmbAuthException<", "/", "tt", ">", "is", "trapped", "to", "retrieve", "new", "user", "credentials", "." ]
train
https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb/NtlmAuthenticator.java#L77-L79
jronrun/benayn
benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/UriEscaper.java
UriEscaper.escapeQuery
public static String escapeQuery(final String query, final boolean strict) { return (strict ? STRICT_ESCAPER : ESCAPER).escapeQuery(query); }
java
public static String escapeQuery(final String query, final boolean strict) { return (strict ? STRICT_ESCAPER : ESCAPER).escapeQuery(query); }
[ "public", "static", "String", "escapeQuery", "(", "final", "String", "query", ",", "final", "boolean", "strict", ")", "{", "return", "(", "strict", "?", "STRICT_ESCAPER", ":", "ESCAPER", ")", ".", "escapeQuery", "(", "query", ")", ";", "}" ]
Escapes a string as a URI query @param query the path to escape @param strict whether or not to do strict escaping @return the escaped string
[ "Escapes", "a", "string", "as", "a", "URI", "query" ]
train
https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/UriEscaper.java#L250-L252
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/Strings.java
Strings.webContextPath
public static String webContextPath(final String first, final String... more) { if (more.length == 0 && (first == null || first.isEmpty())) { return ""; } final StringBuilder b = new StringBuilder(); if (first != null) { if (!first.startsWith("/")) { b.append('/'); } b.append(first); } for (final String s : more) { if (s != null && !s.isEmpty()) { b.append('/'); b.append(s); } } final String cleanedPath = cleanPath(b.toString()); return cleanedPath.length() == 1 ? "" : cleanedPath; }
java
public static String webContextPath(final String first, final String... more) { if (more.length == 0 && (first == null || first.isEmpty())) { return ""; } final StringBuilder b = new StringBuilder(); if (first != null) { if (!first.startsWith("/")) { b.append('/'); } b.append(first); } for (final String s : more) { if (s != null && !s.isEmpty()) { b.append('/'); b.append(s); } } final String cleanedPath = cleanPath(b.toString()); return cleanedPath.length() == 1 ? "" : cleanedPath; }
[ "public", "static", "String", "webContextPath", "(", "final", "String", "first", ",", "final", "String", "...", "more", ")", "{", "if", "(", "more", ".", "length", "==", "0", "&&", "(", "first", "==", "null", "||", "first", ".", "isEmpty", "(", ")", ...
Creates a web context path from components. Concatenates all path components using '/' character as delimiter and the result is then: <ol> <li>prefixed with '/' character</li> <li>stripped from all multiple consecutive occurrences of '/' characters</li> <li>stripped from trailing '/' character(s)</li> </ol> @param components web context path components @return empty string or string which starts with a "/" character but does not end with a "/" character
[ "Creates", "a", "web", "context", "path", "from", "components", ".", "Concatenates", "all", "path", "components", "using", "/", "character", "as", "delimiter", "and", "the", "result", "is", "then", ":", "<ol", ">", "<li", ">", "prefixed", "with", "/", "cha...
train
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/Strings.java#L98-L120
lets-blade/blade
src/main/java/com/blade/kit/UUID.java
UUID.captchaChar
public static String captchaChar(int length, boolean caseSensitivity) { StringBuilder sb = new StringBuilder(); Random rand = new Random();// 随机用以下三个随机生成器 Random randdata = new Random(); int data = 0; for (int i = 0; i < length; i++) { int index = rand.nextInt(caseSensitivity ? 3 : 2); // 目的是随机选择生成数字,大小写字母 switch (index) { case 0: data = randdata.nextInt(10);// 仅仅会生成0~9, 0~9的ASCII为48~57 sb.append(data); break; case 1: data = randdata.nextInt(26) + 97;// 保证只会产生ASCII为97~122(a-z)之间的整数, sb.append((char) data); break; case 2: // caseSensitivity为true的时候, 才会有大写字母 data = randdata.nextInt(26) + 65;// 保证只会产生ASCII为65~90(A~Z)之间的整数 sb.append((char) data); break; default: break; } } return sb.toString(); }
java
public static String captchaChar(int length, boolean caseSensitivity) { StringBuilder sb = new StringBuilder(); Random rand = new Random();// 随机用以下三个随机生成器 Random randdata = new Random(); int data = 0; for (int i = 0; i < length; i++) { int index = rand.nextInt(caseSensitivity ? 3 : 2); // 目的是随机选择生成数字,大小写字母 switch (index) { case 0: data = randdata.nextInt(10);// 仅仅会生成0~9, 0~9的ASCII为48~57 sb.append(data); break; case 1: data = randdata.nextInt(26) + 97;// 保证只会产生ASCII为97~122(a-z)之间的整数, sb.append((char) data); break; case 2: // caseSensitivity为true的时候, 才会有大写字母 data = randdata.nextInt(26) + 65;// 保证只会产生ASCII为65~90(A~Z)之间的整数 sb.append((char) data); break; default: break; } } return sb.toString(); }
[ "public", "static", "String", "captchaChar", "(", "int", "length", ",", "boolean", "caseSensitivity", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "Random", "rand", "=", "new", "Random", "(", ")", ";", "// 随机用以下三个随机生成器", "Rand...
返回指定长度随机数字+字母(大小写敏感)组成的字符串 @param length 指定长度 @param caseSensitivity 是否区分大小写 @return 随机字符串
[ "返回指定长度随机数字", "+", "字母", "(", "大小写敏感", ")", "组成的字符串" ]
train
https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/kit/UUID.java#L216-L242
raydac/java-binary-block-parser
jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java
JBBPDslBuilder.VarArray
public JBBPDslBuilder VarArray(final String name, final String sizeExpression) { return this.VarArray(name, sizeExpression, null); }
java
public JBBPDslBuilder VarArray(final String name, final String sizeExpression) { return this.VarArray(name, sizeExpression, null); }
[ "public", "JBBPDslBuilder", "VarArray", "(", "final", "String", "name", ",", "final", "String", "sizeExpression", ")", "{", "return", "this", ".", "VarArray", "(", "name", ",", "sizeExpression", ",", "null", ")", ";", "}" ]
Create named var array with fixed size. @param name name of the array, can be null for anonymous one @param sizeExpression expression to calculate size of the array, must not be null. @return the builder instance, must not be null
[ "Create", "named", "var", "array", "with", "fixed", "size", "." ]
train
https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L450-L452
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java
FormatUtil.nextPosition
private static int nextPosition(int a, int b) { return a < 0 ? b : b < 0 ? a : a < b ? a : b; }
java
private static int nextPosition(int a, int b) { return a < 0 ? b : b < 0 ? a : a < b ? a : b; }
[ "private", "static", "int", "nextPosition", "(", "int", "a", ",", "int", "b", ")", "{", "return", "a", "<", "0", "?", "b", ":", "b", "<", "0", "?", "a", ":", "a", "<", "b", "?", "a", ":", "b", ";", "}" ]
Helper that is similar to {@code Math.min(a,b)}, except that negative values are considered "invalid". @param a String position @param b String position @return {@code Math.min(a,b)} if {@code a >= 0} and {@code b >= 0}, otherwise whichever is not negative.
[ "Helper", "that", "is", "similar", "to", "{", "@code", "Math", ".", "min", "(", "a", "b", ")", "}", "except", "that", "negative", "values", "are", "considered", "invalid", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L796-L798
UrielCh/ovh-java-sdk
ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java
ApiOvhTelephony.billingAccount_line_serviceName_statistics_GET
public OvhUnitAndValues<OvhTimestampAndValue> billingAccount_line_serviceName_statistics_GET(String billingAccount, String serviceName, OvhStatisticsTimeframeEnum timeframe, OvhLineStatisticsTypeEnum type) throws IOException { String qPath = "/telephony/{billingAccount}/line/{serviceName}/statistics"; StringBuilder sb = path(qPath, billingAccount, serviceName); query(sb, "timeframe", timeframe); query(sb, "type", type); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t10); }
java
public OvhUnitAndValues<OvhTimestampAndValue> billingAccount_line_serviceName_statistics_GET(String billingAccount, String serviceName, OvhStatisticsTimeframeEnum timeframe, OvhLineStatisticsTypeEnum type) throws IOException { String qPath = "/telephony/{billingAccount}/line/{serviceName}/statistics"; StringBuilder sb = path(qPath, billingAccount, serviceName); query(sb, "timeframe", timeframe); query(sb, "type", type); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t10); }
[ "public", "OvhUnitAndValues", "<", "OvhTimestampAndValue", ">", "billingAccount_line_serviceName_statistics_GET", "(", "String", "billingAccount", ",", "String", "serviceName", ",", "OvhStatisticsTimeframeEnum", "timeframe", ",", "OvhLineStatisticsTypeEnum", "type", ")", "throw...
Get statistics of the current line REST: GET /telephony/{billingAccount}/line/{serviceName}/statistics @param timeframe [required] @param type [required] @param billingAccount [required] The name of your billingAccount @param serviceName [required]
[ "Get", "statistics", "of", "the", "current", "line" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L2050-L2057
UrielCh/ovh-java-sdk
ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java
ApiOvhMe.task_domain_id_argument_key_PUT
public void task_domain_id_argument_key_PUT(Long id, String key, OvhDomainTaskArgument body) throws IOException { String qPath = "/me/task/domain/{id}/argument/{key}"; StringBuilder sb = path(qPath, id, key); exec(qPath, "PUT", sb.toString(), body); }
java
public void task_domain_id_argument_key_PUT(Long id, String key, OvhDomainTaskArgument body) throws IOException { String qPath = "/me/task/domain/{id}/argument/{key}"; StringBuilder sb = path(qPath, id, key); exec(qPath, "PUT", sb.toString(), body); }
[ "public", "void", "task_domain_id_argument_key_PUT", "(", "Long", "id", ",", "String", "key", ",", "OvhDomainTaskArgument", "body", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/me/task/domain/{id}/argument/{key}\"", ";", "StringBuilder", "sb", "=", "...
Alter this object properties REST: PUT /me/task/domain/{id}/argument/{key} @param body [required] New object properties @param id [required] Id of the task @param key [required] Key of the argument
[ "Alter", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2389-L2393
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBeanContext.java
ControlBeanContext.setBeanContext
public synchronized void setBeanContext(BeanContext beanContext) throws PropertyVetoException { ControlBeanContext cbcs = null; if (beanContext != null) { // // ControlBeans can only be nested in context service instances that derive // from ControlBeanContext. // if (!(beanContext instanceof ControlBeanContext)) { PropertyChangeEvent pce = new PropertyChangeEvent(_bean, "beanContext", getBeanContext(), beanContext); throw new PropertyVetoException("Context does not support nesting controls: " + beanContext.getClass(), pce); } cbcs = (ControlBeanContext)beanContext; } _beanContextServicesDelegate.setBeanContext(beanContext); resetControlID(); _hasSingleThreadedParent = cbcs != null ? cbcs.isSingleThreadedContainer() : false; // // Notify the bean that its context (container) has been set. // if (_bean != null) _bean.setBeanContext(beanContext); }
java
public synchronized void setBeanContext(BeanContext beanContext) throws PropertyVetoException { ControlBeanContext cbcs = null; if (beanContext != null) { // // ControlBeans can only be nested in context service instances that derive // from ControlBeanContext. // if (!(beanContext instanceof ControlBeanContext)) { PropertyChangeEvent pce = new PropertyChangeEvent(_bean, "beanContext", getBeanContext(), beanContext); throw new PropertyVetoException("Context does not support nesting controls: " + beanContext.getClass(), pce); } cbcs = (ControlBeanContext)beanContext; } _beanContextServicesDelegate.setBeanContext(beanContext); resetControlID(); _hasSingleThreadedParent = cbcs != null ? cbcs.isSingleThreadedContainer() : false; // // Notify the bean that its context (container) has been set. // if (_bean != null) _bean.setBeanContext(beanContext); }
[ "public", "synchronized", "void", "setBeanContext", "(", "BeanContext", "beanContext", ")", "throws", "PropertyVetoException", "{", "ControlBeanContext", "cbcs", "=", "null", ";", "if", "(", "beanContext", "!=", "null", ")", "{", "//", "// ControlBeans can only be nes...
Overrides the {@link java.beans.beancontext.BeanContextChild#setBeanContext(java.beans.beancontext.BeanContext)} method. This hook is used to perform additional processing that needs to occur when the control is associated with a new nesting context.
[ "Overrides", "the", "{" ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBeanContext.java#L145-L178
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.setExperimentalProperty
public RawProperty setExperimentalProperty(String name, String value) { return setExperimentalProperty(name, null, value); }
java
public RawProperty setExperimentalProperty(String name, String value) { return setExperimentalProperty(name, null, value); }
[ "public", "RawProperty", "setExperimentalProperty", "(", "String", "name", ",", "String", "value", ")", "{", "return", "setExperimentalProperty", "(", "name", ",", "null", ",", "value", ")", ";", "}" ]
Adds an experimental property to this component, removing all existing properties that have the same name. @param name the property name (e.g. "X-ALT-DESC") @param value the property value @return the property object that was created
[ "Adds", "an", "experimental", "property", "to", "this", "component", "removing", "all", "existing", "properties", "that", "have", "the", "same", "name", "." ]
train
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L254-L256
apache/groovy
subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
Sql.executeInsert
public List<GroovyRowResult> executeInsert(String sql, List<Object> params, List<String> keyColumnNames) throws SQLException { Connection connection = createConnection(); PreparedStatement statement = null; try { this.keyColumnNames = keyColumnNames; statement = getPreparedStatement(connection, sql, params, USE_COLUMN_NAMES); this.keyColumnNames = null; this.updateCount = statement.executeUpdate(); ResultSet keys = statement.getGeneratedKeys(); return asList(sql, keys); } catch (SQLException e) { LOG.warning("Failed to execute: " + sql + " because: " + e.getMessage()); throw e; } finally { closeResources(connection, statement); } }
java
public List<GroovyRowResult> executeInsert(String sql, List<Object> params, List<String> keyColumnNames) throws SQLException { Connection connection = createConnection(); PreparedStatement statement = null; try { this.keyColumnNames = keyColumnNames; statement = getPreparedStatement(connection, sql, params, USE_COLUMN_NAMES); this.keyColumnNames = null; this.updateCount = statement.executeUpdate(); ResultSet keys = statement.getGeneratedKeys(); return asList(sql, keys); } catch (SQLException e) { LOG.warning("Failed to execute: " + sql + " because: " + e.getMessage()); throw e; } finally { closeResources(connection, statement); } }
[ "public", "List", "<", "GroovyRowResult", ">", "executeInsert", "(", "String", "sql", ",", "List", "<", "Object", ">", "params", ",", "List", "<", "String", ">", "keyColumnNames", ")", "throws", "SQLException", "{", "Connection", "connection", "=", "createConn...
Executes the given SQL statement (typically an INSERT statement). Use this variant when you want to receive the values of any auto-generated columns, such as an autoincrement ID field (or fields) and you know the column name(s) of the ID field(s). The query may contain placeholder question marks which match the given list of parameters. See {@link #executeInsert(GString)} for more details. <p> This method supports named and named ordinal parameters. See the class Javadoc for more details. <p> Resource handling is performed automatically where appropriate. @param sql The SQL statement to execute @param params The parameter values that will be substituted into the SQL statement's parameter slots @param keyColumnNames a list of column names indicating the columns that should be returned from the inserted row or rows (some drivers may be case sensitive, e.g. may require uppercase names) @return A list of the auto-generated row results for each inserted row (typically auto-generated keys) @throws SQLException if a database access error occurs @see Connection#prepareStatement(String, String[]) @since 2.3.2
[ "Executes", "the", "given", "SQL", "statement", "(", "typically", "an", "INSERT", "statement", ")", ".", "Use", "this", "variant", "when", "you", "want", "to", "receive", "the", "values", "of", "any", "auto", "-", "generated", "columns", "such", "as", "an"...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java#L2688-L2704
iig-uni-freiburg/SEWOL
ext/org/deckfour/xes/extension/std/XOrganizationalExtension.java
XOrganizationalExtension.assignGroup
public void assignGroup(XEvent event, String group) { if (group != null && group.trim().length() > 0) { XAttributeLiteral attr = (XAttributeLiteral) ATTR_GROUP.clone(); attr.setValue(group.trim()); event.getAttributes().put(KEY_GROUP, attr); } }
java
public void assignGroup(XEvent event, String group) { if (group != null && group.trim().length() > 0) { XAttributeLiteral attr = (XAttributeLiteral) ATTR_GROUP.clone(); attr.setValue(group.trim()); event.getAttributes().put(KEY_GROUP, attr); } }
[ "public", "void", "assignGroup", "(", "XEvent", "event", ",", "String", "group", ")", "{", "if", "(", "group", "!=", "null", "&&", "group", ".", "trim", "(", ")", ".", "length", "(", ")", ">", "0", ")", "{", "XAttributeLiteral", "attr", "=", "(", "...
Assigns the group attribute value for a given event. @param event Event to be modified. @param resource Group string to be assigned.
[ "Assigns", "the", "group", "attribute", "value", "for", "a", "given", "event", "." ]
train
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XOrganizationalExtension.java#L261-L267
aws/aws-sdk-java
aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/CreatePresetRequest.java
CreatePresetRequest.withTags
public CreatePresetRequest withTags(java.util.Map<String, String> tags) { setTags(tags); return this; }
java
public CreatePresetRequest withTags(java.util.Map<String, String> tags) { setTags(tags); return this; }
[ "public", "CreatePresetRequest", "withTags", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "setTags", "(", "tags", ")", ";", "return", "this", ";", "}" ]
The tags that you want to add to the resource. You can tag resources with a key-value pair or with only a key. @param tags The tags that you want to add to the resource. You can tag resources with a key-value pair or with only a key. @return Returns a reference to this object so that method calls can be chained together.
[ "The", "tags", "that", "you", "want", "to", "add", "to", "the", "resource", ".", "You", "can", "tag", "resources", "with", "a", "key", "-", "value", "pair", "or", "with", "only", "a", "key", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/CreatePresetRequest.java#L207-L210
Azure/azure-sdk-for-java
containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepsInner.java
BuildStepsInner.listBuildArgumentsWithServiceResponseAsync
public Observable<ServiceResponse<Page<BuildArgumentInner>>> listBuildArgumentsWithServiceResponseAsync(final String resourceGroupName, final String registryName, final String buildTaskName, final String stepName) { return listBuildArgumentsSinglePageAsync(resourceGroupName, registryName, buildTaskName, stepName) .concatMap(new Func1<ServiceResponse<Page<BuildArgumentInner>>, Observable<ServiceResponse<Page<BuildArgumentInner>>>>() { @Override public Observable<ServiceResponse<Page<BuildArgumentInner>>> call(ServiceResponse<Page<BuildArgumentInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listBuildArgumentsNextWithServiceResponseAsync(nextPageLink)); } }); }
java
public Observable<ServiceResponse<Page<BuildArgumentInner>>> listBuildArgumentsWithServiceResponseAsync(final String resourceGroupName, final String registryName, final String buildTaskName, final String stepName) { return listBuildArgumentsSinglePageAsync(resourceGroupName, registryName, buildTaskName, stepName) .concatMap(new Func1<ServiceResponse<Page<BuildArgumentInner>>, Observable<ServiceResponse<Page<BuildArgumentInner>>>>() { @Override public Observable<ServiceResponse<Page<BuildArgumentInner>>> call(ServiceResponse<Page<BuildArgumentInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listBuildArgumentsNextWithServiceResponseAsync(nextPageLink)); } }); }
[ "public", "Observable", "<", "ServiceResponse", "<", "Page", "<", "BuildArgumentInner", ">", ">", ">", "listBuildArgumentsWithServiceResponseAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "registryName", ",", "final", "String", "buildTaskNa...
List the build arguments for a step including the secret arguments. @param resourceGroupName The name of the resource group to which the container registry belongs. @param registryName The name of the container registry. @param buildTaskName The name of the container registry build task. @param stepName The name of a build step for a container registry build task. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;BuildArgumentInner&gt; object
[ "List", "the", "build", "arguments", "for", "a", "step", "including", "the", "secret", "arguments", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepsInner.java#L1161-L1173
authlete/authlete-java-common
src/main/java/com/authlete/common/dto/RevocationRequest.java
RevocationRequest.setParameters
public RevocationRequest setParameters(Map<String, String[]> parameters) { return setParameters(URLCoder.formUrlEncode(parameters)); }
java
public RevocationRequest setParameters(Map<String, String[]> parameters) { return setParameters(URLCoder.formUrlEncode(parameters)); }
[ "public", "RevocationRequest", "setParameters", "(", "Map", "<", "String", ",", "String", "[", "]", ">", "parameters", ")", "{", "return", "setParameters", "(", "URLCoder", ".", "formUrlEncode", "(", "parameters", ")", ")", ";", "}" ]
Set the value of {@code parameters} which are the request parameters that the OAuth 2.0 token revocation endpoint of the service implementation received from the client application. <p> This method converts the given map into a string in {@code x-www-form-urlencoded} and passes it to {@link #setParameters(String)} method. </p> @param parameters Request parameters. @return {@code this} object. @since 1.24
[ "Set", "the", "value", "of", "{", "@code", "parameters", "}", "which", "are", "the", "request", "parameters", "that", "the", "OAuth", "2", ".", "0", "token", "revocation", "endpoint", "of", "the", "service", "implementation", "received", "from", "the", "clie...
train
https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/dto/RevocationRequest.java#L170-L173
mgormley/prim
src/main/java_generated/edu/jhu/prim/sort/IntLongSort.java
IntLongSort.sortIndexAsc
public static void sortIndexAsc(int[] index, long[] values, int top) { assert top <= index.length; quicksortIndex(index, values, 0, top - 1, true); }
java
public static void sortIndexAsc(int[] index, long[] values, int top) { assert top <= index.length; quicksortIndex(index, values, 0, top - 1, true); }
[ "public", "static", "void", "sortIndexAsc", "(", "int", "[", "]", "index", ",", "long", "[", "]", "values", ",", "int", "top", ")", "{", "assert", "top", "<=", "index", ".", "length", ";", "quicksortIndex", "(", "index", ",", "values", ",", "0", ",",...
Performs an in-place quick sort on {@code index} on the positions up to but not including {@code top}. All the sorting operations on {@code index} are mirrored in {@code values}. Sorts in ascending order. @return {@code index} - sorted.
[ "Performs", "an", "in", "-", "place", "quick", "sort", "on", "{" ]
train
https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/sort/IntLongSort.java#L128-L131