repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
roboconf/roboconf-platform | core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2MachineConfigurator.java | Ec2MachineConfigurator.checkVmIsStarted | private boolean checkVmIsStarted() {
"""
Checks whether a VM is started or not (which is stronger than {@link #checkVmIsKnown()}).
@return true if the VM is started, false otherwise
"""
DescribeInstancesRequest dis = new DescribeInstancesRequest();
dis.setInstanceIds(Collections.singletonList(this.machin... | java | private boolean checkVmIsStarted() {
DescribeInstancesRequest dis = new DescribeInstancesRequest();
dis.setInstanceIds(Collections.singletonList(this.machineId));
DescribeInstancesResult disresult = this.ec2Api.describeInstances( dis );
// Obtain availability zone (for later use, eg. volume attachment).
// ... | [
"private",
"boolean",
"checkVmIsStarted",
"(",
")",
"{",
"DescribeInstancesRequest",
"dis",
"=",
"new",
"DescribeInstancesRequest",
"(",
")",
";",
"dis",
".",
"setInstanceIds",
"(",
"Collections",
".",
"singletonList",
"(",
"this",
".",
"machineId",
")",
")",
";... | Checks whether a VM is started or not (which is stronger than {@link #checkVmIsKnown()}).
@return true if the VM is started, false otherwise | [
"Checks",
"whether",
"a",
"VM",
"is",
"started",
"or",
"not",
"(",
"which",
"is",
"stronger",
"than",
"{"
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2MachineConfigurator.java#L223-L234 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/functions/FunctionUtils.java | FunctionUtils.replaceFunctionsInString | public static String replaceFunctionsInString(String str, TestContext context) {
"""
Search for functions in string and replace with respective function result.
@param str to parse
@return parsed string result
"""
return replaceFunctionsInString(str, context, false);
} | java | public static String replaceFunctionsInString(String str, TestContext context) {
return replaceFunctionsInString(str, context, false);
} | [
"public",
"static",
"String",
"replaceFunctionsInString",
"(",
"String",
"str",
",",
"TestContext",
"context",
")",
"{",
"return",
"replaceFunctionsInString",
"(",
"str",
",",
"context",
",",
"false",
")",
";",
"}"
] | Search for functions in string and replace with respective function result.
@param str to parse
@return parsed string result | [
"Search",
"for",
"functions",
"in",
"string",
"and",
"replace",
"with",
"respective",
"function",
"result",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/functions/FunctionUtils.java#L41-L43 |
apache/reef | lang/java/reef-examples-clr/src/main/java/org/apache/reef/examples/helloCLR/HelloDriver.java | HelloDriver.onNextCLR | void onNextCLR(final AllocatedEvaluator allocatedEvaluator) {
"""
Uses the AllocatedEvaluator to launch a CLR task.
@param allocatedEvaluator
"""
try {
allocatedEvaluator.setProcess(clrProcessFactory.newEvaluatorProcess());
final Configuration contextConfiguration = ContextConfiguration.CONF... | java | void onNextCLR(final AllocatedEvaluator allocatedEvaluator) {
try {
allocatedEvaluator.setProcess(clrProcessFactory.newEvaluatorProcess());
final Configuration contextConfiguration = ContextConfiguration.CONF
.set(ContextConfiguration.IDENTIFIER, "HelloREEFContext")
.build();
... | [
"void",
"onNextCLR",
"(",
"final",
"AllocatedEvaluator",
"allocatedEvaluator",
")",
"{",
"try",
"{",
"allocatedEvaluator",
".",
"setProcess",
"(",
"clrProcessFactory",
".",
"newEvaluatorProcess",
"(",
")",
")",
";",
"final",
"Configuration",
"contextConfiguration",
"=... | Uses the AllocatedEvaluator to launch a CLR task.
@param allocatedEvaluator | [
"Uses",
"the",
"AllocatedEvaluator",
"to",
"launch",
"a",
"CLR",
"task",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-examples-clr/src/main/java/org/apache/reef/examples/helloCLR/HelloDriver.java#L116-L131 |
joniles/mpxj | src/main/java/net/sf/mpxj/ResourceAssignment.java | ResourceAssignment.splitCostEnd | private TimephasedCost splitCostEnd(ProjectCalendar calendar, double totalAmount, Date finish) {
"""
Used for Cost type Resources.
Generates a TimphasedCost block for the total amount on the finish date. This is useful
for Cost resources that have an AccrueAt value of End.
@param calendar calendar used by t... | java | private TimephasedCost splitCostEnd(ProjectCalendar calendar, double totalAmount, Date finish)
{
TimephasedCost cost = new TimephasedCost();
cost.setStart(calendar.getStartDate(finish, Duration.getInstance(1, TimeUnit.DAYS)));
cost.setFinish(finish);
cost.setAmountPerDay(Double.valueOf(totalA... | [
"private",
"TimephasedCost",
"splitCostEnd",
"(",
"ProjectCalendar",
"calendar",
",",
"double",
"totalAmount",
",",
"Date",
"finish",
")",
"{",
"TimephasedCost",
"cost",
"=",
"new",
"TimephasedCost",
"(",
")",
";",
"cost",
".",
"setStart",
"(",
"calendar",
".",
... | Used for Cost type Resources.
Generates a TimphasedCost block for the total amount on the finish date. This is useful
for Cost resources that have an AccrueAt value of End.
@param calendar calendar used by this assignment
@param totalAmount cost amount for this block
@param finish finish date of the timephased cost b... | [
"Used",
"for",
"Cost",
"type",
"Resources",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L986-L995 |
motown-io/motown | ocpp/websocket-json/src/main/java/io/motown/ocpp/websocketjson/wamp/WampMessageParser.java | WampMessageParser.parseMessage | public WampMessage parseMessage(ChargingStationId chargingStationId, Reader reader) throws IOException {
"""
Parses a CALL, RESULT, or ERROR message and constructs a WampMessage
@param chargingStationId sending the message
@param reader containing the message
@return WampMessage
@throws IOException in case the... | java | public WampMessage parseMessage(ChargingStationId chargingStationId, Reader reader) throws IOException {
String rawMessage = this.convertToString(reader);
String trimmedMessage = this.removeBrackets(rawMessage);
//In case a payload is present, it always is the last part of the message
i... | [
"public",
"WampMessage",
"parseMessage",
"(",
"ChargingStationId",
"chargingStationId",
",",
"Reader",
"reader",
")",
"throws",
"IOException",
"{",
"String",
"rawMessage",
"=",
"this",
".",
"convertToString",
"(",
"reader",
")",
";",
"String",
"trimmedMessage",
"=",... | Parses a CALL, RESULT, or ERROR message and constructs a WampMessage
@param chargingStationId sending the message
@param reader containing the message
@return WampMessage
@throws IOException in case the message could not be read
@throws IllegalArgumentException in case an unknown wamp messageType is encountered | [
"Parses",
"a",
"CALL",
"RESULT",
"or",
"ERROR",
"message",
"and",
"constructs",
"a",
"WampMessage"
] | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/ocpp/websocket-json/src/main/java/io/motown/ocpp/websocketjson/wamp/WampMessageParser.java#L42-L86 |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java | AbstractEventSerializer.readArrayHeader | protected void readArrayHeader() throws IOException {
"""
Read the header of an AWS CloudTrail log.
@throws JsonParseException if the log could not be parsed.
@throws IOException if the log could not be opened or accessed.
"""
if (jsonParser.nextToken() != JsonToken.START_OBJECT) {
thro... | java | protected void readArrayHeader() throws IOException {
if (jsonParser.nextToken() != JsonToken.START_OBJECT) {
throw new JsonParseException("Not a Json object", jsonParser.getCurrentLocation());
}
jsonParser.nextToken();
if (!jsonParser.getText().equals(RECORDS)) {
... | [
"protected",
"void",
"readArrayHeader",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"jsonParser",
".",
"nextToken",
"(",
")",
"!=",
"JsonToken",
".",
"START_OBJECT",
")",
"{",
"throw",
"new",
"JsonParseException",
"(",
"\"Not a Json object\"",
",",
"jsonP... | Read the header of an AWS CloudTrail log.
@throws JsonParseException if the log could not be parsed.
@throws IOException if the log could not be opened or accessed. | [
"Read",
"the",
"header",
"of",
"an",
"AWS",
"CloudTrail",
"log",
"."
] | train | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java#L76-L89 |
PomepuyN/discreet-app-rate | DiscreetAppRate/src/main/java/fr/nicolaspomepuy/discreetapprate/Utils.java | Utils.convertDPItoPixels | public static int convertDPItoPixels(Context context, int dpi) {
"""
Convert a size in dp to a size in pixels
@param context the {@link android.content.Context} to be used
@param dpi size in dp
@return the size in pixels
"""
final float scale = context.getResources().getDisplayMetrics().densit... | java | public static int convertDPItoPixels(Context context, int dpi) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dpi * scale + 0.5f);
} | [
"public",
"static",
"int",
"convertDPItoPixels",
"(",
"Context",
"context",
",",
"int",
"dpi",
")",
"{",
"final",
"float",
"scale",
"=",
"context",
".",
"getResources",
"(",
")",
".",
"getDisplayMetrics",
"(",
")",
".",
"density",
";",
"return",
"(",
"int"... | Convert a size in dp to a size in pixels
@param context the {@link android.content.Context} to be used
@param dpi size in dp
@return the size in pixels | [
"Convert",
"a",
"size",
"in",
"dp",
"to",
"a",
"size",
"in",
"pixels"
] | train | https://github.com/PomepuyN/discreet-app-rate/blob/d9e007907d98191145f2b31057f0813e18bb320a/DiscreetAppRate/src/main/java/fr/nicolaspomepuy/discreetapprate/Utils.java#L36-L39 |
rolfl/MicroBench | src/main/java/net/tuis/ubench/TaskRunner.java | TaskRunner.inBounds | private static final boolean inBounds(final long[] times, final double bound) {
"""
Compute whether any of the values in times exceed the given bound,
relative to the minimum value in times.
@param times
the times to compute the bounds on
@param bound
the bound is represented as a value like 1.10 for 10% gr... | java | private static final boolean inBounds(final long[] times, final double bound) {
long min = times[0];
long max = times[0];
long limit = (long) (min * bound);
for (int i = 1; i < times.length; i++) {
if (times[i] < min) {
min = times[i];
limit = ... | [
"private",
"static",
"final",
"boolean",
"inBounds",
"(",
"final",
"long",
"[",
"]",
"times",
",",
"final",
"double",
"bound",
")",
"{",
"long",
"min",
"=",
"times",
"[",
"0",
"]",
";",
"long",
"max",
"=",
"times",
"[",
"0",
"]",
";",
"long",
"limi... | Compute whether any of the values in times exceed the given bound,
relative to the minimum value in times.
@param times
the times to compute the bounds on
@param bound
the bound is represented as a value like 1.10 for 10% greater
than the minimum
@return true if all values are in bounds. | [
"Compute",
"whether",
"any",
"of",
"the",
"values",
"in",
"times",
"exceed",
"the",
"given",
"bound",
"relative",
"to",
"the",
"minimum",
"value",
"in",
"times",
"."
] | train | https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/TaskRunner.java#L40-L61 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ScriptBytecodeAdapter.java | ScriptBytecodeAdapter.asType | public static Object asType(Object object, Class type) throws Throwable {
"""
Provides a hook for type coercion of the given object to the required type
@param type of object to convert the given object to
@param object the object to be converted
@return the original object or a new converted value
@throws... | java | public static Object asType(Object object, Class type) throws Throwable {
if (object == null) object = NullObject.getNullObject();
return invokeMethodN(object.getClass(), object, "asType", new Object[]{type});
} | [
"public",
"static",
"Object",
"asType",
"(",
"Object",
"object",
",",
"Class",
"type",
")",
"throws",
"Throwable",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"object",
"=",
"NullObject",
".",
"getNullObject",
"(",
")",
";",
"return",
"invokeMethodN",
"("... | Provides a hook for type coercion of the given object to the required type
@param type of object to convert the given object to
@param object the object to be converted
@return the original object or a new converted value
@throws Throwable if the coercion fails | [
"Provides",
"a",
"hook",
"for",
"type",
"coercion",
"of",
"the",
"given",
"object",
"to",
"the",
"required",
"type"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ScriptBytecodeAdapter.java#L601-L604 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/XHTMLText.java | XHTMLText.appendOpenBodyTag | private XHTMLText appendOpenBodyTag(String style, String lang) {
"""
Appends a tag that indicates that a body section begins.
@param style the XHTML style of the body
@param lang the language of the body
@return this.
"""
text.halfOpenElement(Message.BODY);
text.xmlnsAttribute(NAMESPACE);
... | java | private XHTMLText appendOpenBodyTag(String style, String lang) {
text.halfOpenElement(Message.BODY);
text.xmlnsAttribute(NAMESPACE);
text.optElement(STYLE, style);
text.xmllangAttribute(lang);
text.rightAngleBracket();
return this;
} | [
"private",
"XHTMLText",
"appendOpenBodyTag",
"(",
"String",
"style",
",",
"String",
"lang",
")",
"{",
"text",
".",
"halfOpenElement",
"(",
"Message",
".",
"BODY",
")",
";",
"text",
".",
"xmlnsAttribute",
"(",
"NAMESPACE",
")",
";",
"text",
".",
"optElement",... | Appends a tag that indicates that a body section begins.
@param style the XHTML style of the body
@param lang the language of the body
@return this. | [
"Appends",
"a",
"tag",
"that",
"indicates",
"that",
"a",
"body",
"section",
"begins",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/XHTMLText.java#L105-L112 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/PoolSchedulable.java | PoolSchedulable.addSession | public void addSession(String id, Session session) {
"""
Add a session to the pool
@param id the id of the session
@param session the session to add to the pool
"""
synchronized (session) {
SessionSchedulable schedulable =
new SessionSchedulable(session, getType());
idToSession.put(id... | java | public void addSession(String id, Session session) {
synchronized (session) {
SessionSchedulable schedulable =
new SessionSchedulable(session, getType());
idToSession.put(id, schedulable);
}
} | [
"public",
"void",
"addSession",
"(",
"String",
"id",
",",
"Session",
"session",
")",
"{",
"synchronized",
"(",
"session",
")",
"{",
"SessionSchedulable",
"schedulable",
"=",
"new",
"SessionSchedulable",
"(",
"session",
",",
"getType",
"(",
")",
")",
";",
"id... | Add a session to the pool
@param id the id of the session
@param session the session to add to the pool | [
"Add",
"a",
"session",
"to",
"the",
"pool"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolSchedulable.java#L203-L209 |
lucee/Lucee | core/src/main/java/lucee/runtime/reflection/Invoker.java | Invoker.callMethod | public static Object callMethod(Object object, String methodName, Object[] parameters)
throws NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
"""
call of a method from given object
@param object object to call method from
@param methodName name of the m... | java | public static Object callMethod(Object object, String methodName, Object[] parameters)
throws NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
MethodParameterPair pair = getMethodParameterPairIgnoreCase(object.getClass(), methodName, parameters);
return pair.g... | [
"public",
"static",
"Object",
"callMethod",
"(",
"Object",
"object",
",",
"String",
"methodName",
",",
"Object",
"[",
"]",
"parameters",
")",
"throws",
"NoSuchMethodException",
",",
"IllegalArgumentException",
",",
"IllegalAccessException",
",",
"InvocationTargetExcepti... | call of a method from given object
@param object object to call method from
@param methodName name of the method to call
@param parameters parameter for method
@return return value of the method
@throws SecurityException
@throws NoSuchMethodException
@throws IllegalArgumentException
@throws IllegalAccessException
@thr... | [
"call",
"of",
"a",
"method",
"from",
"given",
"object"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/reflection/Invoker.java#L126-L131 |
tbrooks8/Precipice | precipice-core/src/main/java/net/uncontended/precipice/GuardRail.java | GuardRail.acquirePermits | public Rejected acquirePermits(long number, long nanoTime) {
"""
Acquire permits for task execution. If the acquisition is rejected then a reason
will be returned. If the acquisition is successful, null will be returned.
@param number of permits to acquire
@param nanoTime currentInterval nano time
@return ... | java | public Rejected acquirePermits(long number, long nanoTime) {
for (int i = 0; i < backPressureList.size(); ++i) {
BackPressure<Rejected> bp = backPressureList.get(i);
Rejected rejected = bp.acquirePermit(number, nanoTime);
if (rejected != null) {
rejectedCounts... | [
"public",
"Rejected",
"acquirePermits",
"(",
"long",
"number",
",",
"long",
"nanoTime",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"backPressureList",
".",
"size",
"(",
")",
";",
"++",
"i",
")",
"{",
"BackPressure",
"<",
"Rejected",
"... | Acquire permits for task execution. If the acquisition is rejected then a reason
will be returned. If the acquisition is successful, null will be returned.
@param number of permits to acquire
@param nanoTime currentInterval nano time
@return the rejected reason | [
"Acquire",
"permits",
"for",
"task",
"execution",
".",
"If",
"the",
"acquisition",
"is",
"rejected",
"then",
"a",
"reason",
"will",
"be",
"returned",
".",
"If",
"the",
"acquisition",
"is",
"successful",
"null",
"will",
"be",
"returned",
"."
] | train | https://github.com/tbrooks8/Precipice/blob/97fae467fd676b16a96b8d88b02569d8fc1f2681/precipice-core/src/main/java/net/uncontended/precipice/GuardRail.java#L69-L83 |
jbossws/jbossws-cxf | modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java | JBossWSBusFactory.getClassLoaderDefaultBus | public static Bus getClassLoaderDefaultBus(final ClassLoader classloader, final ClientBusSelector clientBusSelector) {
"""
Gets the default bus for the given classloader; if a new Bus is needed,
the creation is delegated to the specified ClientBusSelector instance.
@param classloader
@param clientBusSelector
... | java | public static Bus getClassLoaderDefaultBus(final ClassLoader classloader, final ClientBusSelector clientBusSelector) {
Bus classLoaderBus;
synchronized (classLoaderBusses) {
classLoaderBus = classLoaderBusses.get(classloader);
if (classLoaderBus == null) {
classLoaderBus = clie... | [
"public",
"static",
"Bus",
"getClassLoaderDefaultBus",
"(",
"final",
"ClassLoader",
"classloader",
",",
"final",
"ClientBusSelector",
"clientBusSelector",
")",
"{",
"Bus",
"classLoaderBus",
";",
"synchronized",
"(",
"classLoaderBusses",
")",
"{",
"classLoaderBus",
"=",
... | Gets the default bus for the given classloader; if a new Bus is needed,
the creation is delegated to the specified ClientBusSelector instance.
@param classloader
@param clientBusSelector
@return | [
"Gets",
"the",
"default",
"bus",
"for",
"the",
"given",
"classloader",
";",
"if",
"a",
"new",
"Bus",
"is",
"needed",
"the",
"creation",
"is",
"delegated",
"to",
"the",
"specified",
"ClientBusSelector",
"instance",
"."
] | train | https://github.com/jbossws/jbossws-cxf/blob/e1d5df3664cbc2482ebc83cafd355a4d60d12150/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java#L114-L127 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java | HtmlTableRendererBase.renderCaptionFacet | protected void renderCaptionFacet(FacesContext facesContext, ResponseWriter writer, UIComponent component)
throws IOException {
"""
Renders the caption facet.
@param facesContext the <code>FacesContext</code>.
@param writer the <code>ResponseWriter</code>.
@param component the parent <code>UICompone... | java | protected void renderCaptionFacet(FacesContext facesContext, ResponseWriter writer, UIComponent component)
throws IOException
{
HtmlRendererUtils.renderTableCaption(facesContext, writer, component);
} | [
"protected",
"void",
"renderCaptionFacet",
"(",
"FacesContext",
"facesContext",
",",
"ResponseWriter",
"writer",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"HtmlRendererUtils",
".",
"renderTableCaption",
"(",
"facesContext",
",",
"writer",
",",
... | Renders the caption facet.
@param facesContext the <code>FacesContext</code>.
@param writer the <code>ResponseWriter</code>.
@param component the parent <code>UIComponent</code> containing the facets.
@throws IOException if an exception occurs. | [
"Renders",
"the",
"caption",
"facet",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java#L220-L224 |
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.beginDelete | public void beginDelete(String resourceGroupName, String virtualNetworkGatewayConnectionName) {
"""
Deletes the specified virtual network Gateway connection.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
... | java | public void beginDelete(String resourceGroupName, String virtualNetworkGatewayConnectionName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayConnectionName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetworkGatewayConnectionName",
")",
".",
"toBlocking",
"(",
")",
... | Deletes the specified virtual network Gateway connection.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if th... | [
"Deletes",
"the",
"specified",
"virtual",
"network",
"Gateway",
"connection",
"."
] | 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#L455-L457 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/cellprocessor/conversion/RegexReplace.java | RegexReplace.checkPreconditions | private static void checkPreconditions(final Pattern pattern, final String replacement) {
"""
コンスタによるインスタンスを生成する際の前提条件となる引数のチェックを行う。
@param pattern コンパイル済みの正規表現
@param replacement 置換する文字。
@throws NullPointerException if pattern or replacement is null.
"""
if(pattern == null ) {
throw... | java | private static void checkPreconditions(final Pattern pattern, final String replacement) {
if(pattern == null ) {
throw new NullPointerException("regex should not be null");
}
if(replacement == null) {
throw new NullPointerException("replacement should not b... | [
"private",
"static",
"void",
"checkPreconditions",
"(",
"final",
"Pattern",
"pattern",
",",
"final",
"String",
"replacement",
")",
"{",
"if",
"(",
"pattern",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"regex should not be null\"",
")",
... | コンスタによるインスタンスを生成する際の前提条件となる引数のチェックを行う。
@param pattern コンパイル済みの正規表現
@param replacement 置換する文字。
@throws NullPointerException if pattern or replacement is null. | [
"コンスタによるインスタンスを生成する際の前提条件となる引数のチェックを行う。"
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/cellprocessor/conversion/RegexReplace.java#L68-L76 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/graph/ui/LogFileWriter.java | LogFileWriter.writeScalarEvent | public long writeScalarEvent(String name, long time, int iteration, int epoch, Number scalar) throws IOException {
"""
Write a single scalar event to the file
@param name Name of the event. Must be registered by {@link #registerEventName(String)} first!
@param time Timestamp
@param iteration Iteration... | java | public long writeScalarEvent(String name, long time, int iteration, int epoch, Number scalar) throws IOException {
//TODO add support for plugin, variable and frame/iter
Preconditions.checkState(indexNameMap.containsKey(name), "Name \"%s\" not yet registered", name);
int idx = indexNameMap.get(n... | [
"public",
"long",
"writeScalarEvent",
"(",
"String",
"name",
",",
"long",
"time",
",",
"int",
"iteration",
",",
"int",
"epoch",
",",
"Number",
"scalar",
")",
"throws",
"IOException",
"{",
"//TODO add support for plugin, variable and frame/iter",
"Preconditions",
".",
... | Write a single scalar event to the file
@param name Name of the event. Must be registered by {@link #registerEventName(String)} first!
@param time Timestamp
@param iteration Iteration for the event
@param epoch Epoch for the event
@param scalar Scalar value to write
@return Number of bytes wri... | [
"Write",
"a",
"single",
"scalar",
"event",
"to",
"the",
"file"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/graph/ui/LogFileWriter.java#L278-L291 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/QueueManager.java | QueueManager.hasAccess | public synchronized boolean hasAccess(String queueName, QueueOperation oper,
UserGroupInformation ugi) {
"""
Return true if the given {@link QueueManager.QueueOperation} can be
performed by the specified user on the given queue.
An operation is allowed if all users are provided ... | java | public synchronized boolean hasAccess(String queueName, QueueOperation oper,
UserGroupInformation ugi) {
return hasAccess(queueName, null, oper, ugi);
} | [
"public",
"synchronized",
"boolean",
"hasAccess",
"(",
"String",
"queueName",
",",
"QueueOperation",
"oper",
",",
"UserGroupInformation",
"ugi",
")",
"{",
"return",
"hasAccess",
"(",
"queueName",
",",
"null",
",",
"oper",
",",
"ugi",
")",
";",
"}"
] | Return true if the given {@link QueueManager.QueueOperation} can be
performed by the specified user on the given queue.
An operation is allowed if all users are provided access for this
operation, or if either the user or any of the groups specified is
provided access.
@param queueName Queue on which the operation ne... | [
"Return",
"true",
"if",
"the",
"given",
"{",
"@link",
"QueueManager",
".",
"QueueOperation",
"}",
"can",
"be",
"performed",
"by",
"the",
"specified",
"user",
"on",
"the",
"given",
"queue",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/QueueManager.java#L140-L143 |
otto-de/edison-hal | src/main/java/de/otto/edison/hal/HalRepresentation.java | HalRepresentation.withEmbedded | protected HalRepresentation withEmbedded(final String rel, final HalRepresentation embeddedItem) {
"""
Adds an embedded item for a link-relation type to the HalRepresentation.
<p>
The embedded item will be rendered as a single resource object.
</p>
<p>
If {@code rel} is already present, it is replaced by the ... | java | protected HalRepresentation withEmbedded(final String rel, final HalRepresentation embeddedItem) {
embedded = copyOf(embedded).with(rel, embeddedItem).using(curies).build();
return this;
} | [
"protected",
"HalRepresentation",
"withEmbedded",
"(",
"final",
"String",
"rel",
",",
"final",
"HalRepresentation",
"embeddedItem",
")",
"{",
"embedded",
"=",
"copyOf",
"(",
"embedded",
")",
".",
"with",
"(",
"rel",
",",
"embeddedItem",
")",
".",
"using",
"(",... | Adds an embedded item for a link-relation type to the HalRepresentation.
<p>
The embedded item will be rendered as a single resource object.
</p>
<p>
If {@code rel} is already present, it is replaced by the new embedded items.
</p>
@param rel the link-relation type of the embedded item that is added or replaced
@param... | [
"Adds",
"an",
"embedded",
"item",
"for",
"a",
"link",
"-",
"relation",
"type",
"to",
"the",
"HalRepresentation",
".",
"<p",
">",
"The",
"embedded",
"item",
"will",
"be",
"rendered",
"as",
"a",
"single",
"resource",
"object",
".",
"<",
"/",
"p",
">",
"<... | train | https://github.com/otto-de/edison-hal/blob/1582d2b49d1f0d9103e03bf742f18afa9d166992/src/main/java/de/otto/edison/hal/HalRepresentation.java#L226-L229 |
hubrick/vertx-rest-client | src/main/java/com/hubrick/vertx/rest/converter/MultipartHttpMessageConverter.java | MultipartHttpMessageConverter.generateMultipartBoundary | private String generateMultipartBoundary() {
"""
Generate a multipart boundary.
<p>The default implementation returns a random boundary.
Can be overridden in subclasses.
"""
byte[] boundary = new byte[this.random.nextInt(11) + 30];
for (int i = 0; i < boundary.length; i++) {
bound... | java | private String generateMultipartBoundary() {
byte[] boundary = new byte[this.random.nextInt(11) + 30];
for (int i = 0; i < boundary.length; i++) {
boundary[i] = BOUNDARY_CHARS[this.random.nextInt(BOUNDARY_CHARS.length)];
}
final String constructedBoundry = "----" + new Strin... | [
"private",
"String",
"generateMultipartBoundary",
"(",
")",
"{",
"byte",
"[",
"]",
"boundary",
"=",
"new",
"byte",
"[",
"this",
".",
"random",
".",
"nextInt",
"(",
"11",
")",
"+",
"30",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"... | Generate a multipart boundary.
<p>The default implementation returns a random boundary.
Can be overridden in subclasses. | [
"Generate",
"a",
"multipart",
"boundary",
".",
"<p",
">",
"The",
"default",
"implementation",
"returns",
"a",
"random",
"boundary",
".",
"Can",
"be",
"overridden",
"in",
"subclasses",
"."
] | train | https://github.com/hubrick/vertx-rest-client/blob/4e6715bc2fb031555fc635adbf94a53b9cfba81e/src/main/java/com/hubrick/vertx/rest/converter/MultipartHttpMessageConverter.java#L273-L281 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java | DateTimeFormatterBuilder.appendTimeZoneName | public DateTimeFormatterBuilder appendTimeZoneName(Map<String, DateTimeZone> parseLookup) {
"""
Instructs the printer to emit a locale-specific time zone name, providing a lookup for parsing.
Time zone names are not unique, thus the API forces you to supply the lookup.
The names are searched in the order of the ... | java | public DateTimeFormatterBuilder appendTimeZoneName(Map<String, DateTimeZone> parseLookup) {
TimeZoneName pp = new TimeZoneName(TimeZoneName.LONG_NAME, parseLookup);
return append0(pp, pp);
} | [
"public",
"DateTimeFormatterBuilder",
"appendTimeZoneName",
"(",
"Map",
"<",
"String",
",",
"DateTimeZone",
">",
"parseLookup",
")",
"{",
"TimeZoneName",
"pp",
"=",
"new",
"TimeZoneName",
"(",
"TimeZoneName",
".",
"LONG_NAME",
",",
"parseLookup",
")",
";",
"return... | Instructs the printer to emit a locale-specific time zone name, providing a lookup for parsing.
Time zone names are not unique, thus the API forces you to supply the lookup.
The names are searched in the order of the map, thus it is strongly recommended
to use a {@code LinkedHashMap} or similar.
@param parseLookup th... | [
"Instructs",
"the",
"printer",
"to",
"emit",
"a",
"locale",
"-",
"specific",
"time",
"zone",
"name",
"providing",
"a",
"lookup",
"for",
"parsing",
".",
"Time",
"zone",
"names",
"are",
"not",
"unique",
"thus",
"the",
"API",
"forces",
"you",
"to",
"supply",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java#L1031-L1034 |
voldemort/voldemort | src/java/voldemort/versioning/VectorClockUtils.java | VectorClockUtils.makeClockWithCurrentTime | public static VectorClock makeClockWithCurrentTime(Set<Integer> serverIds) {
"""
Generates a vector clock with the provided nodes and current time stamp
This clock can be used to overwrite the existing value avoiding obsolete
version exceptions in most cases, except If the existing Vector Clock was
generated in... | java | public static VectorClock makeClockWithCurrentTime(Set<Integer> serverIds) {
return makeClock(serverIds, System.currentTimeMillis(), System.currentTimeMillis());
} | [
"public",
"static",
"VectorClock",
"makeClockWithCurrentTime",
"(",
"Set",
"<",
"Integer",
">",
"serverIds",
")",
"{",
"return",
"makeClock",
"(",
"serverIds",
",",
"System",
".",
"currentTimeMillis",
"(",
")",
",",
"System",
".",
"currentTimeMillis",
"(",
")",
... | Generates a vector clock with the provided nodes and current time stamp
This clock can be used to overwrite the existing value avoiding obsolete
version exceptions in most cases, except If the existing Vector Clock was
generated in custom way. (i.e. existing vector clock does not use
milliseconds)
@param serverIds ser... | [
"Generates",
"a",
"vector",
"clock",
"with",
"the",
"provided",
"nodes",
"and",
"current",
"time",
"stamp",
"This",
"clock",
"can",
"be",
"used",
"to",
"overwrite",
"the",
"existing",
"value",
"avoiding",
"obsolete",
"version",
"exceptions",
"in",
"most",
"cas... | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/versioning/VectorClockUtils.java#L154-L156 |
eyp/serfj | src/main/java/net/sf/serfj/ServletHelper.java | ServletHelper.invokeAction | private Object invokeAction(Object clazz, Method method, UrlInfo urlInfo, Object... args) throws IllegalAccessException, InvocationTargetException {
"""
Invokes a method checking previously if that method accepts requests
using a particular HTTP_METHOD.
@param clazz
A class.
@param method
A method to invoke... | java | private Object invokeAction(Object clazz, Method method, UrlInfo urlInfo, Object... args) throws IllegalAccessException, InvocationTargetException {
if (this.isRequestMethodServed(method, urlInfo.getRequestMethod())) {
return method.invoke(clazz, args);
} else {
throw new IllegalArgumentException("Method " + ... | [
"private",
"Object",
"invokeAction",
"(",
"Object",
"clazz",
",",
"Method",
"method",
",",
"UrlInfo",
"urlInfo",
",",
"Object",
"...",
"args",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"if",
"(",
"this",
".",
"isRequestMethodS... | Invokes a method checking previously if that method accepts requests
using a particular HTTP_METHOD.
@param clazz
A class.
@param method
A method to invoke.
@param urlInfo
URL information extracted by the framework.
@param args
Arguments for the method which will be invoked.
@return the object returned by the method o... | [
"Invokes",
"a",
"method",
"checking",
"previously",
"if",
"that",
"method",
"accepts",
"requests",
"using",
"a",
"particular",
"HTTP_METHOD",
"."
] | train | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/ServletHelper.java#L264-L270 |
grails/grails-core | grails-encoder/src/main/groovy/org/grails/encoder/AbstractEncodedAppender.java | AbstractEncodedAppender.encodeAndWrite | protected void encodeAndWrite(Encoder encoder, EncodingState newEncodingState, CharSequence input)
throws IOException {
"""
Encode and write input to buffer using a non-streaming encoder
@param encoder
the encoder to use
@param newEncodingState
the new encoding state after encoder has been applie... | java | protected void encodeAndWrite(Encoder encoder, EncodingState newEncodingState, CharSequence input)
throws IOException {
Object encoded = encoder.encode(input);
if (encoded != null) {
String encodedStr = String.valueOf(encoded);
write(newEncodingState, encodedStr, 0, e... | [
"protected",
"void",
"encodeAndWrite",
"(",
"Encoder",
"encoder",
",",
"EncodingState",
"newEncodingState",
",",
"CharSequence",
"input",
")",
"throws",
"IOException",
"{",
"Object",
"encoded",
"=",
"encoder",
".",
"encode",
"(",
"input",
")",
";",
"if",
"(",
... | Encode and write input to buffer using a non-streaming encoder
@param encoder
the encoder to use
@param newEncodingState
the new encoding state after encoder has been applied
@param input
the input CharSequence
@throws IOException
Signals that an I/O exception has occurred. | [
"Encode",
"and",
"write",
"input",
"to",
"buffer",
"using",
"a",
"non",
"-",
"streaming",
"encoder"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-encoder/src/main/groovy/org/grails/encoder/AbstractEncodedAppender.java#L192-L199 |
thorstenwagner/TraJ | src/main/java/de/biomedical_imaging/traJ/TrajectoryUtil.java | TrajectoryUtil.splitTrackInSubTracks | public static ArrayList<Trajectory> splitTrackInSubTracks(Trajectory t, int windowWidth, boolean overlapping) {
"""
Splits a trajectory in overlapping / non-overlapping sub-trajectories.
@param t
@param windowWidth Window width. Each sub-trajectory will have this length
@param overlapping Allows the window to o... | java | public static ArrayList<Trajectory> splitTrackInSubTracks(Trajectory t, int windowWidth, boolean overlapping){
int increment = 1;
if(overlapping==false){
increment=windowWidth;
}
ArrayList<Trajectory> subTrajectories = new ArrayList<Trajectory>();
boolean trackEndReached = false;
for(int i = 0; i < t.... | [
"public",
"static",
"ArrayList",
"<",
"Trajectory",
">",
"splitTrackInSubTracks",
"(",
"Trajectory",
"t",
",",
"int",
"windowWidth",
",",
"boolean",
"overlapping",
")",
"{",
"int",
"increment",
"=",
"1",
";",
"if",
"(",
"overlapping",
"==",
"false",
")",
"{"... | Splits a trajectory in overlapping / non-overlapping sub-trajectories.
@param t
@param windowWidth Window width. Each sub-trajectory will have this length
@param overlapping Allows the window to overlap
@return ArrayList with sub-trajectories | [
"Splits",
"a",
"trajectory",
"in",
"overlapping",
"/",
"non",
"-",
"overlapping",
"sub",
"-",
"trajectories",
"."
] | train | https://github.com/thorstenwagner/TraJ/blob/505fafb1f2f77a2d67bb2a089a2fdebe2c9bc7cb/src/main/java/de/biomedical_imaging/traJ/TrajectoryUtil.java#L131-L156 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_number_serviceName_convertToLine_POST | public OvhOfferTask billingAccount_number_serviceName_convertToLine_POST(String billingAccount, String serviceName, String offer) throws IOException {
"""
Schedule a conversion to line
REST: POST /telephony/{billingAccount}/number/{serviceName}/convertToLine
@param offer [required] The future offer of the conv... | java | public OvhOfferTask billingAccount_number_serviceName_convertToLine_POST(String billingAccount, String serviceName, String offer) throws IOException {
String qPath = "/telephony/{billingAccount}/number/{serviceName}/convertToLine";
StringBuilder sb = path(qPath, billingAccount, serviceName);
HashMap<String, Objec... | [
"public",
"OvhOfferTask",
"billingAccount_number_serviceName_convertToLine_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"String",
"offer",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/number/{serviceName... | Schedule a conversion to line
REST: POST /telephony/{billingAccount}/number/{serviceName}/convertToLine
@param offer [required] The future offer of the converted number
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] Name of the service | [
"Schedule",
"a",
"conversion",
"to",
"line"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L5680-L5687 |
Netflix/zeno | src/main/java/com/netflix/zeno/util/collections/algorithms/BinarySearch.java | BinarySearch.binarySearch | public static <T> int binarySearch(Sortable<T> a, int fromIndex, int toIndex, T key, Comparator<? super T> c) {
"""
Searches a range of the specified array for the specified object using
the binary search algorithm. The range must be sorted into ascending
order according to the specified comparator (as by the
{... | java | public static <T> int binarySearch(Sortable<T> a, int fromIndex, int toIndex, T key, Comparator<? super T> c) {
rangeCheck(a.size(), fromIndex, toIndex);
return binarySearch0(a, fromIndex, toIndex, key, c);
} | [
"public",
"static",
"<",
"T",
">",
"int",
"binarySearch",
"(",
"Sortable",
"<",
"T",
">",
"a",
",",
"int",
"fromIndex",
",",
"int",
"toIndex",
",",
"T",
"key",
",",
"Comparator",
"<",
"?",
"super",
"T",
">",
"c",
")",
"{",
"rangeCheck",
"(",
"a",
... | Searches a range of the specified array for the specified object using
the binary search algorithm. The range must be sorted into ascending
order according to the specified comparator (as by the
{@link #sort(Object[], int, int, Comparator) sort(T[], int, int,
Comparator)} method) prior to making this call. If it is not... | [
"Searches",
"a",
"range",
"of",
"the",
"specified",
"array",
"for",
"the",
"specified",
"object",
"using",
"the",
"binary",
"search",
"algorithm",
".",
"The",
"range",
"must",
"be",
"sorted",
"into",
"ascending",
"order",
"according",
"to",
"the",
"specified",... | train | https://github.com/Netflix/zeno/blob/e571a3f1e304942724d454408fe6417fe18c20fd/src/main/java/com/netflix/zeno/util/collections/algorithms/BinarySearch.java#L87-L90 |
protobufel/protobuf-el | protobufel/src/main/java/com/github/protobufel/DynamicMessage.java | DynamicMessage.parseFrom | public static DynamicMessage parseFrom(final Descriptor type, final ByteString data,
final ExtensionRegistry extensionRegistry) throws InvalidProtocolBufferException {
"""
Parse {@code data} as a message of the given type and return it.
"""
return wrap(com.google.protobuf.DynamicMessage.parseFrom(typ... | java | public static DynamicMessage parseFrom(final Descriptor type, final ByteString data,
final ExtensionRegistry extensionRegistry) throws InvalidProtocolBufferException {
return wrap(com.google.protobuf.DynamicMessage.parseFrom(type, data, extensionRegistry));
} | [
"public",
"static",
"DynamicMessage",
"parseFrom",
"(",
"final",
"Descriptor",
"type",
",",
"final",
"ByteString",
"data",
",",
"final",
"ExtensionRegistry",
"extensionRegistry",
")",
"throws",
"InvalidProtocolBufferException",
"{",
"return",
"wrap",
"(",
"com",
".",
... | Parse {@code data} as a message of the given type and return it. | [
"Parse",
"{"
] | train | https://github.com/protobufel/protobuf-el/blob/3a600e2f7a8e74b637f44eee0331ef6e57e7441c/protobufel/src/main/java/com/github/protobufel/DynamicMessage.java#L147-L150 |
FaritorKang/unmz-common-util | src/main/java/net/unmz/java/util/express/QueryExpInfoUtils.java | QueryExpInfoUtils.getExpResultInfoDto | public static ExpResultInfoVo getExpResultInfoDto(String host, String path, Map<String, String> headers, Map<String, String> queries) throws Exception {
"""
Http请求和接受响应处理
@param host 接口请求地址
@param path 接口请求项目
@param headers 请求头文件
@param queries 请求参数
@return
@throws Exception
"""
String re... | java | public static ExpResultInfoVo getExpResultInfoDto(String host, String path, Map<String, String> headers, Map<String, String> queries) throws Exception {
String result = HttpUtils.doGet(host, path, headers, queries);
//获取response的body
return JsonUtils.toBean(result, ExpResultInfoVo.class);
} | [
"public",
"static",
"ExpResultInfoVo",
"getExpResultInfoDto",
"(",
"String",
"host",
",",
"String",
"path",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
",",
"Map",
"<",
"String",
",",
"String",
">",
"queries",
")",
"throws",
"Exception",
"{",
... | Http请求和接受响应处理
@param host 接口请求地址
@param path 接口请求项目
@param headers 请求头文件
@param queries 请求参数
@return
@throws Exception | [
"Http请求和接受响应处理"
] | train | https://github.com/FaritorKang/unmz-common-util/blob/2912b8889b85ed910d536f85b24b6fa68035814a/src/main/java/net/unmz/java/util/express/QueryExpInfoUtils.java#L135-L139 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterRulesInner.java | RouteFilterRulesInner.beginUpdate | public RouteFilterRuleInner beginUpdate(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) {
"""
Updates a route in the specified route filter.
@param resourceGroupName The name of the resource group.
@param routeFilterName The name of the route f... | java | public RouteFilterRuleInner beginUpdate(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).toBlocking().single().body();
} | [
"public",
"RouteFilterRuleInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"routeFilterName",
",",
"String",
"ruleName",
",",
"PatchRouteFilterRule",
"routeFilterRuleParameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourc... | Updates a route in the specified route filter.
@param resourceGroupName The name of the resource group.
@param routeFilterName The name of the route filter.
@param ruleName The name of the route filter rule.
@param routeFilterRuleParameters Parameters supplied to the update route filter rule operation.
@throws Illegal... | [
"Updates",
"a",
"route",
"in",
"the",
"specified",
"route",
"filter",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/RouteFilterRulesInner.java#L636-L638 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLTypeComputer.java | SARLTypeComputer._computeTypes | protected void _computeTypes(SarlBreakExpression object, ITypeComputationState state) {
"""
Compute the type of a break expression.
@param object the expression.
@param state the state of the type resolver.
"""
final LightweightTypeReference primitiveVoid = getPrimitiveVoid(state);
state.acceptActualTy... | java | protected void _computeTypes(SarlBreakExpression object, ITypeComputationState state) {
final LightweightTypeReference primitiveVoid = getPrimitiveVoid(state);
state.acceptActualType(primitiveVoid);
} | [
"protected",
"void",
"_computeTypes",
"(",
"SarlBreakExpression",
"object",
",",
"ITypeComputationState",
"state",
")",
"{",
"final",
"LightweightTypeReference",
"primitiveVoid",
"=",
"getPrimitiveVoid",
"(",
"state",
")",
";",
"state",
".",
"acceptActualType",
"(",
"... | Compute the type of a break expression.
@param object the expression.
@param state the state of the type resolver. | [
"Compute",
"the",
"type",
"of",
"a",
"break",
"expression",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLTypeComputer.java#L170-L173 |
networknt/light-4j | utility/src/main/java/com/networknt/utility/StringUtils.java | StringUtils.removeStart | public static String removeStart(final String str, final String remove) {
"""
<p>Removes a substring only if it is at the beginning of a source string,
otherwise returns the source string.</p>
<p>A {@code null} source string will return {@code null}.
An empty ("") source string will return the empty string.
... | java | public static String removeStart(final String str, final String remove) {
if (isEmpty(str) || isEmpty(remove)) {
return str;
}
if (str.startsWith(remove)){
return str.substring(remove.length());
}
return str;
} | [
"public",
"static",
"String",
"removeStart",
"(",
"final",
"String",
"str",
",",
"final",
"String",
"remove",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"str",
")",
"||",
"isEmpty",
"(",
"remove",
")",
")",
"{",
"return",
"str",
";",
"}",
"if",
"(",
"str",... | <p>Removes a substring only if it is at the beginning of a source string,
otherwise returns the source string.</p>
<p>A {@code null} source string will return {@code null}.
An empty ("") source string will return the empty string.
A {@code null} search string will return the source string.</p>
<pre>
StringUtils.remov... | [
"<p",
">",
"Removes",
"a",
"substring",
"only",
"if",
"it",
"is",
"at",
"the",
"beginning",
"of",
"a",
"source",
"string",
"otherwise",
"returns",
"the",
"source",
"string",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/utility/src/main/java/com/networknt/utility/StringUtils.java#L898-L906 |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/ExternalContextAccessSkill.java | ExternalContextAccessSkill.fireContextJoined | protected final void fireContextJoined(UUID futureContext, UUID futureContextDefaultSpaceID) {
"""
Fires an {@link ContextJoined} event into the Inner Context default space of the owner agent to notify behaviors/members
that a new context has been joined.
@param futureContext ID of the newly joined context
@p... | java | protected final void fireContextJoined(UUID futureContext, UUID futureContextDefaultSpaceID) {
getBehaviorsSkill().wake(new ContextJoined(futureContext, futureContextDefaultSpaceID));
} | [
"protected",
"final",
"void",
"fireContextJoined",
"(",
"UUID",
"futureContext",
",",
"UUID",
"futureContextDefaultSpaceID",
")",
"{",
"getBehaviorsSkill",
"(",
")",
".",
"wake",
"(",
"new",
"ContextJoined",
"(",
"futureContext",
",",
"futureContextDefaultSpaceID",
")... | Fires an {@link ContextJoined} event into the Inner Context default space of the owner agent to notify behaviors/members
that a new context has been joined.
@param futureContext ID of the newly joined context
@param futureContextDefaultSpaceID ID of the default space of the newly joined context | [
"Fires",
"an",
"{",
"@link",
"ContextJoined",
"}",
"event",
"into",
"the",
"Inner",
"Context",
"default",
"space",
"of",
"the",
"owner",
"agent",
"to",
"notify",
"behaviors",
"/",
"members",
"that",
"a",
"new",
"context",
"has",
"been",
"joined",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/ExternalContextAccessSkill.java#L191-L193 |
Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java | EmbedBuilder.setFooter | public EmbedBuilder setFooter(String text, InputStream icon) {
"""
Sets the footer of the embed.
This method assumes the file type is "png"!
@param text The text of the footer.
@param icon The footer's icon.
@return The current instance in order to chain call methods.
"""
delegate.setFooter(text,... | java | public EmbedBuilder setFooter(String text, InputStream icon) {
delegate.setFooter(text, icon);
return this;
} | [
"public",
"EmbedBuilder",
"setFooter",
"(",
"String",
"text",
",",
"InputStream",
"icon",
")",
"{",
"delegate",
".",
"setFooter",
"(",
"text",
",",
"icon",
")",
";",
"return",
"this",
";",
"}"
] | Sets the footer of the embed.
This method assumes the file type is "png"!
@param text The text of the footer.
@param icon The footer's icon.
@return The current instance in order to chain call methods. | [
"Sets",
"the",
"footer",
"of",
"the",
"embed",
".",
"This",
"method",
"assumes",
"the",
"file",
"type",
"is",
"png",
"!"
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java#L156-L159 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultJsonQueryLogEntryCreator.java | DefaultJsonQueryLogEntryCreator.writeBatchEntry | protected void writeBatchEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
"""
Write whether batch execution or not as json.
<p>default: "batch": true,
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list
"""... | java | protected void writeBatchEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("\"batch\":");
sb.append(execInfo.isBatch() ? "true" : "false");
sb.append(", ");
} | [
"protected",
"void",
"writeBatchEntry",
"(",
"StringBuilder",
"sb",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"sb",
".",
"append",
"(",
"\"\\\"batch\\\":\"",
")",
";",
"sb",
".",
"append",
"(",
"execInfo",... | Write whether batch execution or not as json.
<p>default: "batch": true,
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list | [
"Write",
"whether",
"batch",
"execution",
"or",
"not",
"as",
"json",
"."
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultJsonQueryLogEntryCreator.java#L152-L156 |
landawn/AbacusUtil | src/com/landawn/abacus/util/JdbcUtil.java | JdbcUtil.prepareCallableQuery | public static PreparedCallableQuery prepareCallableQuery(final Connection conn, final Try.Function<Connection, CallableStatement, SQLException> stmtCreator)
throws SQLException {
"""
Never write below code because it will definitely cause {@code Connection} leak:
<pre>
<code>
JdbcUtil.prepareCallab... | java | public static PreparedCallableQuery prepareCallableQuery(final Connection conn, final Try.Function<Connection, CallableStatement, SQLException> stmtCreator)
throws SQLException {
return new PreparedCallableQuery(stmtCreator.apply(conn));
} | [
"public",
"static",
"PreparedCallableQuery",
"prepareCallableQuery",
"(",
"final",
"Connection",
"conn",
",",
"final",
"Try",
".",
"Function",
"<",
"Connection",
",",
"CallableStatement",
",",
"SQLException",
">",
"stmtCreator",
")",
"throws",
"SQLException",
"{",
"... | Never write below code because it will definitely cause {@code Connection} leak:
<pre>
<code>
JdbcUtil.prepareCallableQuery(dataSource.getConnection(), stmtCreator);
</code>
</pre>
@param conn the specified {@code conn} won't be close after this query is executed.
@param stmtCreator the created {@code CallableStatemen... | [
"Never",
"write",
"below",
"code",
"because",
"it",
"will",
"definitely",
"cause",
"{",
"@code",
"Connection",
"}",
"leak",
":",
"<pre",
">",
"<code",
">",
"JdbcUtil",
".",
"prepareCallableQuery",
"(",
"dataSource",
".",
"getConnection",
"()",
"stmtCreator",
"... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L1416-L1419 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/MultiCameraToEquirectangular.java | MultiCameraToEquirectangular.addCamera | public void addCamera(Se3_F32 cameraToCommon , LensDistortionWideFOV factory , int width , int height ) {
"""
Adds a camera and attempts to compute the mask from the provided distortion model. if a pixel is rendered
outside the bounds in the input image then it is masked out. If the forwards/backwards transform... | java | public void addCamera(Se3_F32 cameraToCommon , LensDistortionWideFOV factory , int width , int height ) {
Point2Transform3_F32 p2s = factory.undistortPtoS_F32();
Point3Transform2_F32 s2p = factory.distortStoP_F32();
EquiToCamera equiToCamera = new EquiToCamera(cameraToCommon.getR(),s2p);
GrayF32 equiMask = ne... | [
"public",
"void",
"addCamera",
"(",
"Se3_F32",
"cameraToCommon",
",",
"LensDistortionWideFOV",
"factory",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"Point2Transform3_F32",
"p2s",
"=",
"factory",
".",
"undistortPtoS_F32",
"(",
")",
";",
"Point3Transform2... | Adds a camera and attempts to compute the mask from the provided distortion model. if a pixel is rendered
outside the bounds in the input image then it is masked out. If the forwards/backwards transform is too
different then it is masked out.
@param cameraToCommon Rigid body transform from this camera to the common ... | [
"Adds",
"a",
"camera",
"and",
"attempts",
"to",
"compute",
"the",
"mask",
"from",
"the",
"provided",
"distortion",
"model",
".",
"if",
"a",
"pixel",
"is",
"rendered",
"outside",
"the",
"bounds",
"in",
"the",
"input",
"image",
"then",
"it",
"is",
"masked",
... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/MultiCameraToEquirectangular.java#L108-L146 |
mmazi/rescu | src/main/java/si/mazi/rescu/RestProxyFactory.java | RestProxyFactory.createProxy | public static <I> I createProxy(Class<I> restInterface, String baseUrl, ClientConfig config, Interceptor... interceptors) {
"""
Create a proxy implementation of restInterface. The interface must be annotated with jax-rs annotations. Basic support exists for {@link javax.ws.rs.Path}, {@link javax.ws.rs.GET},
{@lin... | java | public static <I> I createProxy(Class<I> restInterface, String baseUrl, ClientConfig config, Interceptor... interceptors) {
return createProxy(restInterface, wrap(new RestInvocationHandler(restInterface, baseUrl, config), interceptors));
} | [
"public",
"static",
"<",
"I",
">",
"I",
"createProxy",
"(",
"Class",
"<",
"I",
">",
"restInterface",
",",
"String",
"baseUrl",
",",
"ClientConfig",
"config",
",",
"Interceptor",
"...",
"interceptors",
")",
"{",
"return",
"createProxy",
"(",
"restInterface",
... | Create a proxy implementation of restInterface. The interface must be annotated with jax-rs annotations. Basic support exists for {@link javax.ws.rs.Path}, {@link javax.ws.rs.GET},
{@link javax.ws.rs.POST}, {@link javax.ws.rs.QueryParam}, {@link javax.ws.rs.FormParam}, {@link javax.ws.rs.HeaderParam}, {@link javax.ws.r... | [
"Create",
"a",
"proxy",
"implementation",
"of",
"restInterface",
".",
"The",
"interface",
"must",
"be",
"annotated",
"with",
"jax",
"-",
"rs",
"annotations",
".",
"Basic",
"support",
"exists",
"for",
"{",
"@link",
"javax",
".",
"ws",
".",
"rs",
".",
"Path"... | train | https://github.com/mmazi/rescu/blob/8a4f9367994da0a2617bd37acf0320c942e62de3/src/main/java/si/mazi/rescu/RestProxyFactory.java#L46-L48 |
datacleaner/AnalyzerBeans | core/src/main/java/org/eobjects/analyzer/job/runner/RowProcessingPublisher.java | RowProcessingPublisher.runRowProcessing | public void runRowProcessing(Queue<JobAndResult> resultQueue, TaskListener finishedTaskListener) {
"""
Runs the whole row processing logic, start to finish, including
initialization, process rows, result collection and cleanup/closing
resources.
@param resultQueue
a queue on which to append results
@param f... | java | public void runRowProcessing(Queue<JobAndResult> resultQueue, TaskListener finishedTaskListener) {
final LifeCycleHelper lifeCycleHelper = _publishers.getLifeCycleHelper();
final TaskRunner taskRunner = _publishers.getTaskRunner();
final List<RowProcessingConsumer> configurableConsumers = getC... | [
"public",
"void",
"runRowProcessing",
"(",
"Queue",
"<",
"JobAndResult",
">",
"resultQueue",
",",
"TaskListener",
"finishedTaskListener",
")",
"{",
"final",
"LifeCycleHelper",
"lifeCycleHelper",
"=",
"_publishers",
".",
"getLifeCycleHelper",
"(",
")",
";",
"final",
... | Runs the whole row processing logic, start to finish, including
initialization, process rows, result collection and cleanup/closing
resources.
@param resultQueue
a queue on which to append results
@param finishedTaskListener
a task listener which will be invoked once the processing is
done.
@see #processRows(RowProce... | [
"Runs",
"the",
"whole",
"row",
"processing",
"logic",
"start",
"to",
"finish",
"including",
"initialization",
"process",
"rows",
"result",
"collection",
"and",
"cleanup",
"/",
"closing",
"resources",
"."
] | train | https://github.com/datacleaner/AnalyzerBeans/blob/f82dae080d80d2a647b706a5fb22b3ea250613b3/core/src/main/java/org/eobjects/analyzer/job/runner/RowProcessingPublisher.java#L399-L443 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java | SqlBuilderHelper.generateJavaDocForContentProvider | public static void generateJavaDocForContentProvider(final SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
"""
Generate java doc for content provider.
@param method
the method
@param methodBuilder
the method builder
"""
// javadoc
String operation = method.jql.operationType.toString();... | java | public static void generateJavaDocForContentProvider(final SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
// javadoc
String operation = method.jql.operationType.toString();
methodBuilder.addJavadoc("<h1>Content provider URI ($L operation):</h1>\n", operation);
methodBuilder.addJavadoc("<pre>$L</... | [
"public",
"static",
"void",
"generateJavaDocForContentProvider",
"(",
"final",
"SQLiteModelMethod",
"method",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
")",
"{",
"// javadoc",
"String",
"operation",
"=",
"method",
".",
"jql",
".",
"operationType",
".",
"to... | Generate java doc for content provider.
@param method
the method
@param methodBuilder
the method builder | [
"Generate",
"java",
"doc",
"for",
"content",
"provider",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java#L165-L210 |
graphql-java/graphql-java | src/main/java/graphql/schema/idl/SchemaGenerator.java | SchemaGenerator.makeExecutableSchema | public GraphQLSchema makeExecutableSchema(TypeDefinitionRegistry typeRegistry, RuntimeWiring wiring) throws SchemaProblem {
"""
This will take a {@link TypeDefinitionRegistry} and a {@link RuntimeWiring} and put them together to create a executable schema
@param typeRegistry this can be obtained via {@link Sche... | java | public GraphQLSchema makeExecutableSchema(TypeDefinitionRegistry typeRegistry, RuntimeWiring wiring) throws SchemaProblem {
return makeExecutableSchema(Options.defaultOptions(), typeRegistry, wiring);
} | [
"public",
"GraphQLSchema",
"makeExecutableSchema",
"(",
"TypeDefinitionRegistry",
"typeRegistry",
",",
"RuntimeWiring",
"wiring",
")",
"throws",
"SchemaProblem",
"{",
"return",
"makeExecutableSchema",
"(",
"Options",
".",
"defaultOptions",
"(",
")",
",",
"typeRegistry",
... | This will take a {@link TypeDefinitionRegistry} and a {@link RuntimeWiring} and put them together to create a executable schema
@param typeRegistry this can be obtained via {@link SchemaParser#parse(String)}
@param wiring this can be built using {@link RuntimeWiring#newRuntimeWiring()}
@return an executable sch... | [
"This",
"will",
"take",
"a",
"{",
"@link",
"TypeDefinitionRegistry",
"}",
"and",
"a",
"{",
"@link",
"RuntimeWiring",
"}",
"and",
"put",
"them",
"together",
"to",
"create",
"a",
"executable",
"schema"
] | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/schema/idl/SchemaGenerator.java#L236-L238 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/util/ShareSheetStyle.java | ShareSheetStyle.setMoreOptionStyle | public ShareSheetStyle setMoreOptionStyle(@DrawableRes int drawableIconID, @StringRes int stringLabelID) {
"""
<p> Set the icon and label for the option to expand the application list to see more options.
Default label is set to "More" </p>
@param drawableIconID Resource ID for the drawable to set as the icon ... | java | public ShareSheetStyle setMoreOptionStyle(@DrawableRes int drawableIconID, @StringRes int stringLabelID) {
moreOptionIcon_ = getDrawable(context_, drawableIconID);
moreOptionText_ = context_.getResources().getString(stringLabelID);
return this;
} | [
"public",
"ShareSheetStyle",
"setMoreOptionStyle",
"(",
"@",
"DrawableRes",
"int",
"drawableIconID",
",",
"@",
"StringRes",
"int",
"stringLabelID",
")",
"{",
"moreOptionIcon_",
"=",
"getDrawable",
"(",
"context_",
",",
"drawableIconID",
")",
";",
"moreOptionText_",
... | <p> Set the icon and label for the option to expand the application list to see more options.
Default label is set to "More" </p>
@param drawableIconID Resource ID for the drawable to set as the icon for more option. Default icon is system menu_more icon.
@param stringLabelID Resource ID for String label for the more... | [
"<p",
">",
"Set",
"the",
"icon",
"and",
"label",
"for",
"the",
"option",
"to",
"expand",
"the",
"application",
"list",
"to",
"see",
"more",
"options",
".",
"Default",
"label",
"is",
"set",
"to",
"More",
"<",
"/",
"p",
">"
] | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/util/ShareSheetStyle.java#L104-L109 |
amlinv/amq-topo-utils | src/main/java/com/amlinv/activemq/topo/discovery/MBeanDestinationDiscoverer.java | MBeanDestinationDiscoverer.onFoundDestination | protected void onFoundDestination (String destName) {
"""
For the destination represented by the named mbean, add the destination to the registry.
@param destName name of the destination.
"""
if ( ( destName != null ) && ( ! destName.isEmpty() ) ) {
DestinationState destState =
... | java | protected void onFoundDestination (String destName) {
if ( ( destName != null ) && ( ! destName.isEmpty() ) ) {
DestinationState destState =
this.registry.putIfAbsent(destName, new DestinationState(destName, this.brokerId));
//
// If it was already there,... | [
"protected",
"void",
"onFoundDestination",
"(",
"String",
"destName",
")",
"{",
"if",
"(",
"(",
"destName",
"!=",
"null",
")",
"&&",
"(",
"!",
"destName",
".",
"isEmpty",
"(",
")",
")",
")",
"{",
"DestinationState",
"destState",
"=",
"this",
".",
"regist... | For the destination represented by the named mbean, add the destination to the registry.
@param destName name of the destination. | [
"For",
"the",
"destination",
"represented",
"by",
"the",
"named",
"mbean",
"add",
"the",
"destination",
"to",
"the",
"registry",
"."
] | train | https://github.com/amlinv/amq-topo-utils/blob/4d82d5735d59f9c95e149362a09ea4d27d9ac4ac/src/main/java/com/amlinv/activemq/topo/discovery/MBeanDestinationDiscoverer.java#L168-L180 |
threerings/nenya | core/src/main/java/com/threerings/media/AbstractMediaManager.java | AbstractMediaManager.viewLocationDidChange | public void viewLocationDidChange (int dx, int dy) {
"""
Called by a {@link VirtualMediaPanel} when the view that contains our media is scrolled.
@param dx the scrolled distance in the x direction (in pixels).
@param dy the scrolled distance in the y direction (in pixels).
"""
// let our media know... | java | public void viewLocationDidChange (int dx, int dy)
{
// let our media know
for (int ii = 0, ll = _media.size(); ii < ll; ii++) {
_media.get(ii).viewLocationDidChange(dx, dy);
}
} | [
"public",
"void",
"viewLocationDidChange",
"(",
"int",
"dx",
",",
"int",
"dy",
")",
"{",
"// let our media know",
"for",
"(",
"int",
"ii",
"=",
"0",
",",
"ll",
"=",
"_media",
".",
"size",
"(",
")",
";",
"ii",
"<",
"ll",
";",
"ii",
"++",
")",
"{",
... | Called by a {@link VirtualMediaPanel} when the view that contains our media is scrolled.
@param dx the scrolled distance in the x direction (in pixels).
@param dy the scrolled distance in the y direction (in pixels). | [
"Called",
"by",
"a",
"{",
"@link",
"VirtualMediaPanel",
"}",
"when",
"the",
"view",
"that",
"contains",
"our",
"media",
"is",
"scrolled",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/AbstractMediaManager.java#L151-L157 |
knowm/Sundial | src/main/java/org/knowm/sundial/SundialJobScheduler.java | SundialJobScheduler.createScheduler | public static Scheduler createScheduler(int threadPoolSize, String annotatedJobsPackageName)
throws SundialSchedulerException {
"""
Creates the Sundial Scheduler
@param threadPoolSize the thread pool size used by the scheduler
@param annotatedJobsPackageName A comma(,) or colon(:) can be used to specify... | java | public static Scheduler createScheduler(int threadPoolSize, String annotatedJobsPackageName)
throws SundialSchedulerException {
if (scheduler == null) {
try {
scheduler = new SchedulerFactory().getScheduler(threadPoolSize, annotatedJobsPackageName);
} catch (SchedulerException e) ... | [
"public",
"static",
"Scheduler",
"createScheduler",
"(",
"int",
"threadPoolSize",
",",
"String",
"annotatedJobsPackageName",
")",
"throws",
"SundialSchedulerException",
"{",
"if",
"(",
"scheduler",
"==",
"null",
")",
"{",
"try",
"{",
"scheduler",
"=",
"new",
"Sche... | Creates the Sundial Scheduler
@param threadPoolSize the thread pool size used by the scheduler
@param annotatedJobsPackageName A comma(,) or colon(:) can be used to specify multiple packages
to scan for Jobs.
@return | [
"Creates",
"the",
"Sundial",
"Scheduler"
] | train | https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/SundialJobScheduler.java#L103-L115 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/Zips.java | Zips.addFile | public Zips addFile(File file, FileFilter filter) {
"""
Adds a file entry. If given file is a dir, adds it and all subfiles recursively.
Adding takes precedence over removal of entries.
@param file file to add.
@param filter a filter to accept files for adding, null means all files are accepted
@return this ... | java | public Zips addFile(File file, FileFilter filter) {
return this.addFile(file, false, filter);
} | [
"public",
"Zips",
"addFile",
"(",
"File",
"file",
",",
"FileFilter",
"filter",
")",
"{",
"return",
"this",
".",
"addFile",
"(",
"file",
",",
"false",
",",
"filter",
")",
";",
"}"
] | Adds a file entry. If given file is a dir, adds it and all subfiles recursively.
Adding takes precedence over removal of entries.
@param file file to add.
@param filter a filter to accept files for adding, null means all files are accepted
@return this Zips for fluent api | [
"Adds",
"a",
"file",
"entry",
".",
"If",
"given",
"file",
"is",
"a",
"dir",
"adds",
"it",
"and",
"all",
"subfiles",
"recursively",
".",
"Adding",
"takes",
"precedence",
"over",
"removal",
"of",
"entries",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/Zips.java#L182-L184 |
alkacon/opencms-core | src/org/opencms/importexport/CmsImportHelper.java | CmsImportHelper.cacheDtdSystemId | public void cacheDtdSystemId(String dtdSystemLocation, String dtdFilename, String dtdUrlPrefix) {
"""
Adds a new DTD system id prefix mapping for internal resolution
of external URLs.<p>
@param dtdSystemLocation the internal system location of the DTD file, e.g. <code>org/opencms/configuration/</code>
@param ... | java | public void cacheDtdSystemId(String dtdSystemLocation, String dtdFilename, String dtdUrlPrefix) {
if (dtdSystemLocation != null) {
try {
String file = CmsFileUtil.readFile(dtdSystemLocation + dtdFilename, CmsEncoder.ENCODING_UTF_8);
CmsXmlEntityResolver.cacheSystemId... | [
"public",
"void",
"cacheDtdSystemId",
"(",
"String",
"dtdSystemLocation",
",",
"String",
"dtdFilename",
",",
"String",
"dtdUrlPrefix",
")",
"{",
"if",
"(",
"dtdSystemLocation",
"!=",
"null",
")",
"{",
"try",
"{",
"String",
"file",
"=",
"CmsFileUtil",
".",
"rea... | Adds a new DTD system id prefix mapping for internal resolution
of external URLs.<p>
@param dtdSystemLocation the internal system location of the DTD file, e.g. <code>org/opencms/configuration/</code>
@param dtdFilename the name of the DTD file, e.g. <code>opencms-configuration.dtd</code>
@param dtdUrlPrefix the exter... | [
"Adds",
"a",
"new",
"DTD",
"system",
"id",
"prefix",
"mapping",
"for",
"internal",
"resolution",
"of",
"external",
"URLs",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/CmsImportHelper.java#L87-L109 |
pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/ZipUtilities.java | ZipUtilities.unzipFileIntoDirectory | public static boolean unzipFileIntoDirectory(final File zipFile, final String directory) {
"""
Unzips a Zip File in byte array format to a specified directory.
@param zipFile The zip file.
@param directory The directory to unzip the file to.
@return true if the file was successfully unzipped otherwise false.... | java | public static boolean unzipFileIntoDirectory(final File zipFile, final String directory) {
final Map<ZipEntry, byte[]> zipEntries = new HashMap<ZipEntry, byte[]>();
ZipInputStream zis;
try {
zis = new ZipInputStream(new FileInputStream(zipFile));
} catch (FileNotFoundExc... | [
"public",
"static",
"boolean",
"unzipFileIntoDirectory",
"(",
"final",
"File",
"zipFile",
",",
"final",
"String",
"directory",
")",
"{",
"final",
"Map",
"<",
"ZipEntry",
",",
"byte",
"[",
"]",
">",
"zipEntries",
"=",
"new",
"HashMap",
"<",
"ZipEntry",
",",
... | Unzips a Zip File in byte array format to a specified directory.
@param zipFile The zip file.
@param directory The directory to unzip the file to.
@return true if the file was successfully unzipped otherwise false. | [
"Unzips",
"a",
"Zip",
"File",
"in",
"byte",
"array",
"format",
"to",
"a",
"specified",
"directory",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/ZipUtilities.java#L147-L172 |
walkmod/walkmod-core | src/main/java/org/walkmod/util/DomHelper.java | DomHelper.parse | public static Document parse(InputSource inputSource, Map<String, String> dtdMappings) {
"""
Creates a W3C Document that remembers the location of each element in the
source file. The location of element nodes can then be retrieved using
the {@link #getLocationObject(Element)} method.
@param inputSource
the ... | java | public static Document parse(InputSource inputSource, Map<String, String> dtdMappings) {
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setValidating((dtdMappings != null));
factory.setNamespaceAware(true);
SAXParser parser = null;
try {
parser = factory.newSAXParser();
} catch... | [
"public",
"static",
"Document",
"parse",
"(",
"InputSource",
"inputSource",
",",
"Map",
"<",
"String",
",",
"String",
">",
"dtdMappings",
")",
"{",
"SAXParserFactory",
"factory",
"=",
"SAXParserFactory",
".",
"newInstance",
"(",
")",
";",
"factory",
".",
"setV... | Creates a W3C Document that remembers the location of each element in the
source file. The location of element nodes can then be retrieved using
the {@link #getLocationObject(Element)} method.
@param inputSource
the inputSource to read the document from
@param dtdMappings
a map of DTD names and public ids
@return Docu... | [
"Creates",
"a",
"W3C",
"Document",
"that",
"remembers",
"the",
"location",
"of",
"each",
"element",
"in",
"the",
"source",
"file",
".",
"The",
"location",
"of",
"element",
"nodes",
"can",
"then",
"be",
"retrieved",
"using",
"the",
"{",
"@link",
"#getLocation... | train | https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/util/DomHelper.java#L77-L95 |
amaembo/streamex | src/main/java/one/util/streamex/LongStreamEx.java | LongStreamEx.minByDouble | public OptionalLong minByDouble(LongToDoubleFunction keyExtractor) {
"""
Returns the minimum element of this stream according to the provided key
extractor function.
<p>
This is a terminal operation.
@param keyExtractor a non-interfering, stateless function
@return an {@code OptionalLong} describing the f... | java | public OptionalLong minByDouble(LongToDoubleFunction keyExtractor) {
return collect(PrimitiveBox::new, (box, l) -> {
double key = keyExtractor.applyAsDouble(l);
if (!box.b || Double.compare(box.d, key) > 0) {
box.b = true;
box.d = key;
... | [
"public",
"OptionalLong",
"minByDouble",
"(",
"LongToDoubleFunction",
"keyExtractor",
")",
"{",
"return",
"collect",
"(",
"PrimitiveBox",
"::",
"new",
",",
"(",
"box",
",",
"l",
")",
"->",
"{",
"double",
"key",
"=",
"keyExtractor",
".",
"applyAsDouble",
"(",
... | Returns the minimum element of this stream according to the provided key
extractor function.
<p>
This is a terminal operation.
@param keyExtractor a non-interfering, stateless function
@return an {@code OptionalLong} describing the first element of this
stream for which the lowest value was returned by key extractor,... | [
"Returns",
"the",
"minimum",
"element",
"of",
"this",
"stream",
"according",
"to",
"the",
"provided",
"key",
"extractor",
"function",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/LongStreamEx.java#L990-L999 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/DebugUtil.java | DebugUtil.printDebug | public static void printDebug(final Object pObject, final String pMethodName, final PrintStream pPrintStream) {
"""
The "default" method that invokes a given method of an object and prints the results to a {@code java.io.PrintStream}.<br>
The method for invocation must have no formal parameters. If the invoking m... | java | public static void printDebug(final Object pObject, final String pMethodName, final PrintStream pPrintStream) {
if (pPrintStream == null) {
System.err.println(PRINTSTREAM_IS_NULL_ERROR_MESSAGE);
return;
}
if (pObject == null) {
pPrintStream.println(OBJECT_IS_NULL_ERROR_MESSAGE);
... | [
"public",
"static",
"void",
"printDebug",
"(",
"final",
"Object",
"pObject",
",",
"final",
"String",
"pMethodName",
",",
"final",
"PrintStream",
"pPrintStream",
")",
"{",
"if",
"(",
"pPrintStream",
"==",
"null",
")",
"{",
"System",
".",
"err",
".",
"println"... | The "default" method that invokes a given method of an object and prints the results to a {@code java.io.PrintStream}.<br>
The method for invocation must have no formal parameters. If the invoking method does not exist, the {@code toString()} method is called.
The {@code toString()} method of the returning object is ca... | [
"The",
"default",
"method",
"that",
"invokes",
"a",
"given",
"method",
"of",
"an",
"object",
"and",
"prints",
"the",
"results",
"to",
"a",
"{"
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/DebugUtil.java#L236-L264 |
fuinorg/srcgen4j-commons | src/main/java/org/fuin/srcgen4j/commons/Folder.java | Folder.getCanonicalDir | @Nullable
public final File getCanonicalDir() {
"""
Returns the full path from project and folder.
@return Directory.
"""
final String dir = getDirectory();
if (dir == null) {
return null;
}
try {
return new File(dir).getCanonicalFile();
... | java | @Nullable
public final File getCanonicalDir() {
final String dir = getDirectory();
if (dir == null) {
return null;
}
try {
return new File(dir).getCanonicalFile();
} catch (final IOException ex) {
throw new RuntimeException("Couldn... | [
"@",
"Nullable",
"public",
"final",
"File",
"getCanonicalDir",
"(",
")",
"{",
"final",
"String",
"dir",
"=",
"getDirectory",
"(",
")",
";",
"if",
"(",
"dir",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"return",
"new",
"File",
"("... | Returns the full path from project and folder.
@return Directory. | [
"Returns",
"the",
"full",
"path",
"from",
"project",
"and",
"folder",
"."
] | train | https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/Folder.java#L408-L419 |
vincentk/joptimizer | src/main/java/com/joptimizer/optimizers/BasicPhaseIPDM.java | BasicPhaseIPDM.findOneRoot | private DoubleMatrix1D findOneRoot(DoubleMatrix2D A, DoubleMatrix1D b) throws Exception {
"""
Just looking for one out of all the possible solutions.
@see "Convex Optimization, C.5 p. 681".
"""
return originalProblem.findEqFeasiblePoint(A, b);
} | java | private DoubleMatrix1D findOneRoot(DoubleMatrix2D A, DoubleMatrix1D b) throws Exception{
return originalProblem.findEqFeasiblePoint(A, b);
} | [
"private",
"DoubleMatrix1D",
"findOneRoot",
"(",
"DoubleMatrix2D",
"A",
",",
"DoubleMatrix1D",
"b",
")",
"throws",
"Exception",
"{",
"return",
"originalProblem",
".",
"findEqFeasiblePoint",
"(",
"A",
",",
"b",
")",
";",
"}"
] | Just looking for one out of all the possible solutions.
@see "Convex Optimization, C.5 p. 681". | [
"Just",
"looking",
"for",
"one",
"out",
"of",
"all",
"the",
"possible",
"solutions",
"."
] | train | https://github.com/vincentk/joptimizer/blob/65064c1bb0b26c7261358021e4c93d06dd43564f/src/main/java/com/joptimizer/optimizers/BasicPhaseIPDM.java#L226-L228 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/aromaticity/Aromaticity.java | Aromaticity.findBonds | public Set<IBond> findBonds(IAtomContainer molecule) throws CDKException {
"""
Find the bonds of a {@code molecule} which this model determined were
aromatic.
<blockquote><pre>{@code
Aromaticity aromaticity = new Aromaticity(ElectronDonation.cdk(),
Cycles.all());
IAtomContainer container = ...;
try {
Set<... | java | public Set<IBond> findBonds(IAtomContainer molecule) throws CDKException {
// build graph data-structures for fast cycle perception
final EdgeToBondMap bondMap = EdgeToBondMap.withSpaceFor(molecule);
final int[][] graph = GraphUtil.toAdjList(molecule, bondMap);
// initial ring/cycle se... | [
"public",
"Set",
"<",
"IBond",
">",
"findBonds",
"(",
"IAtomContainer",
"molecule",
")",
"throws",
"CDKException",
"{",
"// build graph data-structures for fast cycle perception",
"final",
"EdgeToBondMap",
"bondMap",
"=",
"EdgeToBondMap",
".",
"withSpaceFor",
"(",
"molecu... | Find the bonds of a {@code molecule} which this model determined were
aromatic.
<blockquote><pre>{@code
Aromaticity aromaticity = new Aromaticity(ElectronDonation.cdk(),
Cycles.all());
IAtomContainer container = ...;
try {
Set<IBond> bonds = aromaticity.findBonds(container);
int nAromaticBonds = bonds.... | [
"Find",
"the",
"bonds",
"of",
"a",
"{",
"@code",
"molecule",
"}",
"which",
"this",
"model",
"determined",
"were",
"aromatic",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/aromaticity/Aromaticity.java#L179-L209 |
voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.printErrorLog | public static void printErrorLog(int taskId, Logger logger, String message, Exception e) {
"""
Print log to the following logger ( Error level )
@param taskId Stealer node id
@param logger Logger class
@param message The message to print
"""
if(e == null) {
logger.error("Task id " + In... | java | public static void printErrorLog(int taskId, Logger logger, String message, Exception e) {
if(e == null) {
logger.error("Task id " + Integer.toString(taskId) + "] " + message);
} else {
logger.error("Task id " + Integer.toString(taskId) + "] " + message, e);
}
} | [
"public",
"static",
"void",
"printErrorLog",
"(",
"int",
"taskId",
",",
"Logger",
"logger",
",",
"String",
"message",
",",
"Exception",
"e",
")",
"{",
"if",
"(",
"e",
"==",
"null",
")",
"{",
"logger",
".",
"error",
"(",
"\"Task id \"",
"+",
"Integer",
... | Print log to the following logger ( Error level )
@param taskId Stealer node id
@param logger Logger class
@param message The message to print | [
"Print",
"log",
"to",
"the",
"following",
"logger",
"(",
"Error",
"level",
")"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L475-L481 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/ObjectTypeAttributeDefinition.java | ObjectTypeAttributeDefinition.resolveValue | @Override
public ModelNode resolveValue(ExpressionResolver resolver, ModelNode value) throws OperationFailedException {
"""
Overrides the superclass implementation to allow the AttributeDefinition for each field in the
object to in turn resolve that field.
{@inheritDoc}
"""
// Pass non-OBJECT ... | java | @Override
public ModelNode resolveValue(ExpressionResolver resolver, ModelNode value) throws OperationFailedException {
// Pass non-OBJECT values through the superclass so it can reject weird values and, in the odd chance
// that's how this object is set up, turn undefined into a default list value... | [
"@",
"Override",
"public",
"ModelNode",
"resolveValue",
"(",
"ExpressionResolver",
"resolver",
",",
"ModelNode",
"value",
")",
"throws",
"OperationFailedException",
"{",
"// Pass non-OBJECT values through the superclass so it can reject weird values and, in the odd chance",
"// that'... | Overrides the superclass implementation to allow the AttributeDefinition for each field in the
object to in turn resolve that field.
{@inheritDoc} | [
"Overrides",
"the",
"superclass",
"implementation",
"to",
"allow",
"the",
"AttributeDefinition",
"for",
"each",
"field",
"in",
"the",
"object",
"to",
"in",
"turn",
"resolve",
"that",
"field",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/ObjectTypeAttributeDefinition.java#L202-L238 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/EnvelopesApi.java | EnvelopesApi.getChunkedUpload | public ChunkedUploadResponse getChunkedUpload(String accountId, String chunkedUploadId) throws ApiException {
"""
Retrieves the current metadata of a ChunkedUpload.
@param accountId The external account number (int) or account ID Guid. (required)
@param chunkedUploadId (required)
@return ChunkedUploadRespons... | java | public ChunkedUploadResponse getChunkedUpload(String accountId, String chunkedUploadId) throws ApiException {
return getChunkedUpload(accountId, chunkedUploadId, null);
} | [
"public",
"ChunkedUploadResponse",
"getChunkedUpload",
"(",
"String",
"accountId",
",",
"String",
"chunkedUploadId",
")",
"throws",
"ApiException",
"{",
"return",
"getChunkedUpload",
"(",
"accountId",
",",
"chunkedUploadId",
",",
"null",
")",
";",
"}"
] | Retrieves the current metadata of a ChunkedUpload.
@param accountId The external account number (int) or account ID Guid. (required)
@param chunkedUploadId (required)
@return ChunkedUploadResponse | [
"Retrieves",
"the",
"current",
"metadata",
"of",
"a",
"ChunkedUpload",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/EnvelopesApi.java#L1883-L1885 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/RDN.java | RDN.toRFC2253String | public String toRFC2253String(boolean canonical) {
"""
/*
Returns a printable form of this RDN using the algorithm defined in
RFC 2253. Only RFC 2253 attribute type keywords are emitted.
If canonical is true, then additional canonicalizations
documented in X500Principal.getName are performed.
"""
i... | java | public String toRFC2253String(boolean canonical) {
if (canonical == false) {
return toRFC2253StringInternal
(false, Collections.<String, String>emptyMap());
}
String c = canonicalString;
if (c == null) {
c = toRFC2253StringInternal
... | [
"public",
"String",
"toRFC2253String",
"(",
"boolean",
"canonical",
")",
"{",
"if",
"(",
"canonical",
"==",
"false",
")",
"{",
"return",
"toRFC2253StringInternal",
"(",
"false",
",",
"Collections",
".",
"<",
"String",
",",
"String",
">",
"emptyMap",
"(",
")"... | /*
Returns a printable form of this RDN using the algorithm defined in
RFC 2253. Only RFC 2253 attribute type keywords are emitted.
If canonical is true, then additional canonicalizations
documented in X500Principal.getName are performed. | [
"/",
"*",
"Returns",
"a",
"printable",
"form",
"of",
"this",
"RDN",
"using",
"the",
"algorithm",
"defined",
"in",
"RFC",
"2253",
".",
"Only",
"RFC",
"2253",
"attribute",
"type",
"keywords",
"are",
"emitted",
".",
"If",
"canonical",
"is",
"true",
"then",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/RDN.java#L414-L426 |
ysc/HtmlExtractor | html-extractor/src/main/java/org/apdplat/extractor/html/impl/ExtractFunctionExecutor.java | ExtractFunctionExecutor.executeRemoveText | public static String executeRemoveText(String text, String parseExpression) {
"""
删除指定的文本 使用方法:removeText(作者:) 括号内的参数为文本字符,从CSS路径匹配的文本中删除参数文本
@param text CSS路径抽取出来的文本
@param parseExpression 抽取函数
@return 抽取函数处理之后的文本
"""
LOGGER.debug("removeText抽取函数之前:" + text);
String parameter = parseExpre... | java | public static String executeRemoveText(String text, String parseExpression) {
LOGGER.debug("removeText抽取函数之前:" + text);
String parameter = parseExpression.replace("removeText(", "");
parameter = parameter.substring(0, parameter.length() - 1);
text = text.replace(parameter, "");
L... | [
"public",
"static",
"String",
"executeRemoveText",
"(",
"String",
"text",
",",
"String",
"parseExpression",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"removeText抽取函数之前:\" + text);",
"",
"",
"",
"",
"String",
"parameter",
"=",
"parseExpression",
".",
"replace",
"(... | 删除指定的文本 使用方法:removeText(作者:) 括号内的参数为文本字符,从CSS路径匹配的文本中删除参数文本
@param text CSS路径抽取出来的文本
@param parseExpression 抽取函数
@return 抽取函数处理之后的文本 | [
"删除指定的文本",
"使用方法:removeText",
"(",
"作者:",
")",
"括号内的参数为文本字符,从CSS路径匹配的文本中删除参数文本"
] | train | https://github.com/ysc/HtmlExtractor/blob/5378bc5f94138562c55506cf81de1ffe72ab701e/html-extractor/src/main/java/org/apdplat/extractor/html/impl/ExtractFunctionExecutor.java#L95-L102 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/MutableBigInteger.java | MutableBigInteger.toBigDecimal | BigDecimal toBigDecimal(int sign, int scale) {
"""
Convert this MutableBigInteger to BigDecimal object with the specified sign
and scale.
"""
if (intLen == 0 || sign == 0)
return BigDecimal.zeroValueOf(scale);
int[] mag = getMagnitudeArray();
int len = mag.length;
i... | java | BigDecimal toBigDecimal(int sign, int scale) {
if (intLen == 0 || sign == 0)
return BigDecimal.zeroValueOf(scale);
int[] mag = getMagnitudeArray();
int len = mag.length;
int d = mag[0];
// If this MutableBigInteger can't be fit into long, we need to
// make a ... | [
"BigDecimal",
"toBigDecimal",
"(",
"int",
"sign",
",",
"int",
"scale",
")",
"{",
"if",
"(",
"intLen",
"==",
"0",
"||",
"sign",
"==",
"0",
")",
"return",
"BigDecimal",
".",
"zeroValueOf",
"(",
"scale",
")",
";",
"int",
"[",
"]",
"mag",
"=",
"getMagnit... | Convert this MutableBigInteger to BigDecimal object with the specified sign
and scale. | [
"Convert",
"this",
"MutableBigInteger",
"to",
"BigDecimal",
"object",
"with",
"the",
"specified",
"sign",
"and",
"scale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/MutableBigInteger.java#L201-L215 |
forge/core | javaee/impl/src/main/java/org/jboss/forge/addon/javaee/rest/generator/dto/DTOCollection.java | DTOCollection.containsDTOFor | public boolean containsDTOFor(JavaClass<?> entity, boolean root) {
"""
Indicates whether a DTO is found in the underlying collection or not.
@param entity The JPA entity for which DTOs may have been created
@param root Toplevel/Root or nested DTO?
@return <code>true</code> if a DTO at the desired level (root/... | java | public boolean containsDTOFor(JavaClass<?> entity, boolean root)
{
if (dtos.get(entity) == null)
{
return false;
}
return (root ? (dtos.get(entity).rootDTO != null) : (dtos.get(entity).nestedDTO != null));
} | [
"public",
"boolean",
"containsDTOFor",
"(",
"JavaClass",
"<",
"?",
">",
"entity",
",",
"boolean",
"root",
")",
"{",
"if",
"(",
"dtos",
".",
"get",
"(",
"entity",
")",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"root",
"?",
... | Indicates whether a DTO is found in the underlying collection or not.
@param entity The JPA entity for which DTOs may have been created
@param root Toplevel/Root or nested DTO?
@return <code>true</code> if a DTO at the desired level (root/nested) for the provided entity was found in the
collection | [
"Indicates",
"whether",
"a",
"DTO",
"is",
"found",
"in",
"the",
"underlying",
"collection",
"or",
"not",
"."
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/rest/generator/dto/DTOCollection.java#L84-L91 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/WeightedHighlighter.java | WeightedHighlighter.endFragment | private static void endFragment(StringBuilder sb, String text, int offset, int limit) {
"""
Writes the end of a fragment to the string buffer <code>sb</code>. The
last occurrence of a matching term is indicated by the
<code>offset</code> into the <code>text</code>.
@param sb where to append the start of t... | java | private static void endFragment(StringBuilder sb, String text, int offset, int limit)
{
if (limit == text.length())
{
// append all
sb.append(text.substring(offset));
return;
}
int end = offset;
for (int i = end; i < limit; i++)
{
if (Character.... | [
"private",
"static",
"void",
"endFragment",
"(",
"StringBuilder",
"sb",
",",
"String",
"text",
",",
"int",
"offset",
",",
"int",
"limit",
")",
"{",
"if",
"(",
"limit",
"==",
"text",
".",
"length",
"(",
")",
")",
"{",
"// append all",
"sb",
".",
"append... | Writes the end of a fragment to the string buffer <code>sb</code>. The
last occurrence of a matching term is indicated by the
<code>offset</code> into the <code>text</code>.
@param sb where to append the start of the fragment.
@param text the original text.
@param offset the end offset of the last matching term ... | [
"Writes",
"the",
"end",
"of",
"a",
"fragment",
"to",
"the",
"string",
"buffer",
"<code",
">",
"sb<",
"/",
"code",
">",
".",
"The",
"last",
"occurrence",
"of",
"a",
"matching",
"term",
"is",
"indicated",
"by",
"the",
"<code",
">",
"offset<",
"/",
"code"... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/WeightedHighlighter.java#L266-L284 |
j-a-w-r/jawr-main-repo | jawr-dwr2.x/jawr-dwr2.x-webapp-sample/src/main/java/org/getahead/dwrdemo/livehelp/LiveHelp.java | LiveHelp.notifyTyping | public void notifyTyping(String id, String value) {
"""
Something has changed
@param id The id of the field that changed
@param value The new value
"""
Util utilAll = new Util(getUsersToAffect());
utilAll.setValue(id, Security.replaceXmlCharacters(value));
} | java | public void notifyTyping(String id, String value)
{
Util utilAll = new Util(getUsersToAffect());
utilAll.setValue(id, Security.replaceXmlCharacters(value));
} | [
"public",
"void",
"notifyTyping",
"(",
"String",
"id",
",",
"String",
"value",
")",
"{",
"Util",
"utilAll",
"=",
"new",
"Util",
"(",
"getUsersToAffect",
"(",
")",
")",
";",
"utilAll",
".",
"setValue",
"(",
"id",
",",
"Security",
".",
"replaceXmlCharacters"... | Something has changed
@param id The id of the field that changed
@param value The new value | [
"Something",
"has",
"changed"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr-dwr2.x/jawr-dwr2.x-webapp-sample/src/main/java/org/getahead/dwrdemo/livehelp/LiveHelp.java#L38-L43 |
shrinkwrap/resolver | api/src/main/java/org/jboss/shrinkwrap/resolver/api/Invokable.java | Invokable.invokeMethod | Object invokeMethod(String name, Class<?>[] parameterTypes, Object instance, Object[] parameters)
throws InvocationException {
"""
Invokes method on class registered within {@link Invokable}. It looks also for superclasses
@param name name of the method
@param parameterTypes parameter types of the ... | java | Object invokeMethod(String name, Class<?>[] parameterTypes, Object instance, Object[] parameters)
throws InvocationException {
try {
return findMethod(name, parameterTypes).invoke(instance, parameters);
} catch (IllegalAccessException e) {
throw new InvocationExceptio... | [
"Object",
"invokeMethod",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
",",
"Object",
"instance",
",",
"Object",
"[",
"]",
"parameters",
")",
"throws",
"InvocationException",
"{",
"try",
"{",
"return",
"findMethod",
"(",
... | Invokes method on class registered within {@link Invokable}. It looks also for superclasses
@param name name of the method
@param parameterTypes parameter types of the method
@param instance instance on which method is called, {@code null} for static methods
@param parameters parameters for method invocation
@return
@... | [
"Invokes",
"method",
"on",
"class",
"registered",
"within",
"{",
"@link",
"Invokable",
"}",
".",
"It",
"looks",
"also",
"for",
"superclasses"
] | train | https://github.com/shrinkwrap/resolver/blob/e881a84b8cff5b0a014f2a5ebf612be3eb9db01f/api/src/main/java/org/jboss/shrinkwrap/resolver/api/Invokable.java#L97-L117 |
DDTH/ddth-kafka | src/main/java/com/github/ddth/kafka/KafkaClient.java | KafkaClient.consumeMessage | public KafkaMessage consumeMessage(String consumerGroupId, String topic, long waitTime,
TimeUnit waitTimeUnit) {
"""
Consumes one message from a topic, wait up to specified wait-time.
@param consumerGroupId
@param topic
@param waitTime
@param waitTimeUnit
@return
@since 1.2.0
"""
re... | java | public KafkaMessage consumeMessage(String consumerGroupId, String topic, long waitTime,
TimeUnit waitTimeUnit) {
return consumeMessage(consumerGroupId, true, topic, waitTime, waitTimeUnit);
} | [
"public",
"KafkaMessage",
"consumeMessage",
"(",
"String",
"consumerGroupId",
",",
"String",
"topic",
",",
"long",
"waitTime",
",",
"TimeUnit",
"waitTimeUnit",
")",
"{",
"return",
"consumeMessage",
"(",
"consumerGroupId",
",",
"true",
",",
"topic",
",",
"waitTime"... | Consumes one message from a topic, wait up to specified wait-time.
@param consumerGroupId
@param topic
@param waitTime
@param waitTimeUnit
@return
@since 1.2.0 | [
"Consumes",
"one",
"message",
"from",
"a",
"topic",
"wait",
"up",
"to",
"specified",
"wait",
"-",
"time",
"."
] | train | https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/KafkaClient.java#L475-L478 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java | AmazonS3Client.populateRequesterPaysHeader | protected static void populateRequesterPaysHeader(Request<?> request, boolean isRequesterPays) {
"""
<p>
Populate the specified request with {@link Constants#REQUESTER_PAYS} to header {@link Headers#REQUESTER_PAYS_HEADER},
if isRequesterPays is true.
</p>
@param request
The specified request to populate.
@... | java | protected static void populateRequesterPaysHeader(Request<?> request, boolean isRequesterPays) {
if (isRequesterPays) {
request.addHeader(Headers.REQUESTER_PAYS_HEADER, Constants.REQUESTER_PAYS);
}
} | [
"protected",
"static",
"void",
"populateRequesterPaysHeader",
"(",
"Request",
"<",
"?",
">",
"request",
",",
"boolean",
"isRequesterPays",
")",
"{",
"if",
"(",
"isRequesterPays",
")",
"{",
"request",
".",
"addHeader",
"(",
"Headers",
".",
"REQUESTER_PAYS_HEADER",
... | <p>
Populate the specified request with {@link Constants#REQUESTER_PAYS} to header {@link Headers#REQUESTER_PAYS_HEADER},
if isRequesterPays is true.
</p>
@param request
The specified request to populate.
@param isRequesterPays
The flag whether to populate the header or not. | [
"<p",
">",
"Populate",
"the",
"specified",
"request",
"with",
"{",
"@link",
"Constants#REQUESTER_PAYS",
"}",
"to",
"header",
"{",
"@link",
"Headers#REQUESTER_PAYS_HEADER",
"}",
"if",
"isRequesterPays",
"is",
"true",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L4197-L4201 |
primefaces-extensions/core | src/main/java/org/primefaces/extensions/component/sheet/SheetRenderer.java | SheetRenderer.encodeOptionalNativeAttr | protected void encodeOptionalNativeAttr(final WidgetBuilder wb, final String attrName, final Object value)
throws IOException {
"""
Encodes an optional native attribute (unquoted).
@param wb the WidgetBuilder to append to
@param attrName the attribute name
@param value the value
@throws IOExc... | java | protected void encodeOptionalNativeAttr(final WidgetBuilder wb, final String attrName, final Object value)
throws IOException {
if (value != null) {
wb.nativeAttr(attrName, value.toString());
}
} | [
"protected",
"void",
"encodeOptionalNativeAttr",
"(",
"final",
"WidgetBuilder",
"wb",
",",
"final",
"String",
"attrName",
",",
"final",
"Object",
"value",
")",
"throws",
"IOException",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"wb",
".",
"nativeAttr",
... | Encodes an optional native attribute (unquoted).
@param wb the WidgetBuilder to append to
@param attrName the attribute name
@param value the value
@throws IOException | [
"Encodes",
"an",
"optional",
"native",
"attribute",
"(",
"unquoted",
")",
"."
] | train | https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/SheetRenderer.java#L168-L173 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/renderkit/html/HtmlRenderKitImpl.java | HtmlRenderKitImpl._put | synchronized private void _put(String componentFamily, String rendererType, Renderer renderer) {
"""
Put the renderer on the double map
@param componentFamily
@param rendererType
@param renderer
"""
Map <String,Renderer> familyRendererMap = _renderers.get(componentFamily);
if (familyRender... | java | synchronized private void _put(String componentFamily, String rendererType, Renderer renderer)
{
Map <String,Renderer> familyRendererMap = _renderers.get(componentFamily);
if (familyRendererMap == null)
{
familyRendererMap = new ConcurrentHashMap<String, Renderer>(8, 0.75f, 1);
... | [
"synchronized",
"private",
"void",
"_put",
"(",
"String",
"componentFamily",
",",
"String",
"rendererType",
",",
"Renderer",
"renderer",
")",
"{",
"Map",
"<",
"String",
",",
"Renderer",
">",
"familyRendererMap",
"=",
"_renderers",
".",
"get",
"(",
"componentFami... | Put the renderer on the double map
@param componentFamily
@param rendererType
@param renderer | [
"Put",
"the",
"renderer",
"on",
"the",
"double",
"map"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/renderkit/html/HtmlRenderKitImpl.java#L202-L223 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.deleteEntityRoleAsync | public Observable<OperationStatus> deleteEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId) {
"""
Delete an entity role.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role Id.
@throws IllegalArgumentException ... | java | public Observable<OperationStatus> deleteEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId) {
return deleteEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() {
@Override
public O... | [
"public",
"Observable",
"<",
"OperationStatus",
">",
"deleteEntityRoleAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
")",
"{",
"return",
"deleteEntityRoleWithServiceResponseAsync",
"(",
"appId",
",",
"versio... | Delete an entity role.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role Id.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationStatus object | [
"Delete",
"an",
"entity",
"role",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L11076-L11083 |
gallandarakhneorg/afc | core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/AbstractTreeNode.java | AbstractTreeNode.firePropertyParentChanged | void firePropertyParentChanged(N node, N oldParent, N newParent) {
"""
Fire the event for the changes node parents.
@param node is the node for which the parent has changed.
@param oldParent is the previous parent node
@param newParent is the current parent node
"""
firePropertyParentChanged(new TreeNod... | java | void firePropertyParentChanged(N node, N oldParent, N newParent) {
firePropertyParentChanged(new TreeNodeParentChangedEvent(node, oldParent, newParent));
} | [
"void",
"firePropertyParentChanged",
"(",
"N",
"node",
",",
"N",
"oldParent",
",",
"N",
"newParent",
")",
"{",
"firePropertyParentChanged",
"(",
"new",
"TreeNodeParentChangedEvent",
"(",
"node",
",",
"oldParent",
",",
"newParent",
")",
")",
";",
"}"
] | Fire the event for the changes node parents.
@param node is the node for which the parent has changed.
@param oldParent is the previous parent node
@param newParent is the current parent node | [
"Fire",
"the",
"event",
"for",
"the",
"changes",
"node",
"parents",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/AbstractTreeNode.java#L243-L245 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cdndedicated/src/main/java/net/minidev/ovh/api/ApiOvhCdndedicated.java | ApiOvhCdndedicated.serviceName_domains_domain_cacheRules_cacheRuleId_GET | public OvhCacheRule serviceName_domains_domain_cacheRules_cacheRuleId_GET(String serviceName, String domain, Long cacheRuleId) throws IOException {
"""
Get this object properties
REST: GET /cdn/dedicated/{serviceName}/domains/{domain}/cacheRules/{cacheRuleId}
@param serviceName [required] The internal name of ... | java | public OvhCacheRule serviceName_domains_domain_cacheRules_cacheRuleId_GET(String serviceName, String domain, Long cacheRuleId) throws IOException {
String qPath = "/cdn/dedicated/{serviceName}/domains/{domain}/cacheRules/{cacheRuleId}";
StringBuilder sb = path(qPath, serviceName, domain, cacheRuleId);
String resp... | [
"public",
"OvhCacheRule",
"serviceName_domains_domain_cacheRules_cacheRuleId_GET",
"(",
"String",
"serviceName",
",",
"String",
"domain",
",",
"Long",
"cacheRuleId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cdn/dedicated/{serviceName}/domains/{domain}/cach... | Get this object properties
REST: GET /cdn/dedicated/{serviceName}/domains/{domain}/cacheRules/{cacheRuleId}
@param serviceName [required] The internal name of your CDN offer
@param domain [required] Domain of this object
@param cacheRuleId [required] Id for this cache rule | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cdndedicated/src/main/java/net/minidev/ovh/api/ApiOvhCdndedicated.java#L289-L294 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java | ClassesManager.areEqual | public static boolean areEqual(Field destination,Field source) {
"""
Returns true if destination and source have the same structure.
@param destination destination field
@param source source field
@return returns true if destination and source have the same structure
"""
return getGenericString(destinati... | java | public static boolean areEqual(Field destination,Field source){
return getGenericString(destination).equals(getGenericString(source));
} | [
"public",
"static",
"boolean",
"areEqual",
"(",
"Field",
"destination",
",",
"Field",
"source",
")",
"{",
"return",
"getGenericString",
"(",
"destination",
")",
".",
"equals",
"(",
"getGenericString",
"(",
"source",
")",
")",
";",
"}"
] | Returns true if destination and source have the same structure.
@param destination destination field
@param source source field
@return returns true if destination and source have the same structure | [
"Returns",
"true",
"if",
"destination",
"and",
"source",
"have",
"the",
"same",
"structure",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java#L359-L361 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_command.java | ns_command.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
ns_command_responses result = (ns_command_responses) service.get_payloa... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ns_command_responses result = (ns_command_responses) service.get_payload_formatter().string_to_resource(ns_command_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == S... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"ns_command_responses",
"result",
"=",
"(",
"ns_command_responses",
")",
"service",
".",
"get_payload_formatte... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_command.java#L122-L139 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ModelSerializer.java | ModelSerializer.addNormalizerToModel | public static void addNormalizerToModel(File f, Normalizer<?> normalizer) {
"""
This method appends normalizer to a given persisted model.
PLEASE NOTE: File should be model file saved earlier with ModelSerializer
@param f
@param normalizer
"""
File tempFile = null;
try {
// c... | java | public static void addNormalizerToModel(File f, Normalizer<?> normalizer) {
File tempFile = null;
try {
// copy existing model to temporary file
tempFile = DL4JFileUtils.createTempFile("dl4jModelSerializerTemp", "bin");
tempFile.deleteOnExit();
Files.copy(... | [
"public",
"static",
"void",
"addNormalizerToModel",
"(",
"File",
"f",
",",
"Normalizer",
"<",
"?",
">",
"normalizer",
")",
"{",
"File",
"tempFile",
"=",
"null",
";",
"try",
"{",
"// copy existing model to temporary file",
"tempFile",
"=",
"DL4JFileUtils",
".",
"... | This method appends normalizer to a given persisted model.
PLEASE NOTE: File should be model file saved earlier with ModelSerializer
@param f
@param normalizer | [
"This",
"method",
"appends",
"normalizer",
"to",
"a",
"given",
"persisted",
"model",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ModelSerializer.java#L731-L772 |
iobeam/iobeam-client-java | src/main/java/com/iobeam/api/resource/util/DataPointParser.java | DataPointParser.parse | public static List<DataPoint> parse(int[] values, long ts) {
"""
Takes an array of values and converts it into a list of `DataPoint`s with the same
timestamp.
@param values Array of values to be converted
@param ts Timestamp to use.
@return A List of DataPoints with the same timestamp.
"""
Li... | java | public static List<DataPoint> parse(int[] values, long ts) {
List<DataPoint> ret = new ArrayList<DataPoint>(values.length);
for (int v : values) {
ret.add(new DataPoint(ts, v));
}
return ret;
} | [
"public",
"static",
"List",
"<",
"DataPoint",
">",
"parse",
"(",
"int",
"[",
"]",
"values",
",",
"long",
"ts",
")",
"{",
"List",
"<",
"DataPoint",
">",
"ret",
"=",
"new",
"ArrayList",
"<",
"DataPoint",
">",
"(",
"values",
".",
"length",
")",
";",
"... | Takes an array of values and converts it into a list of `DataPoint`s with the same
timestamp.
@param values Array of values to be converted
@param ts Timestamp to use.
@return A List of DataPoints with the same timestamp. | [
"Takes",
"an",
"array",
"of",
"values",
"and",
"converts",
"it",
"into",
"a",
"list",
"of",
"DataPoint",
"s",
"with",
"the",
"same",
"timestamp",
"."
] | train | https://github.com/iobeam/iobeam-client-java/blob/06e7aeb2a313503392358a3671de7d28628d0e33/src/main/java/com/iobeam/api/resource/util/DataPointParser.java#L150-L156 |
JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java | SearchView.createVoiceWebSearchIntent | private Intent createVoiceWebSearchIntent(Intent baseIntent, SearchableInfo searchable) {
"""
Create and return an Intent that can launch the voice search activity for web search.
"""
Intent voiceIntent = new Intent(baseIntent);
ComponentName searchActivity = searchable.getSearchActivity();
... | java | private Intent createVoiceWebSearchIntent(Intent baseIntent, SearchableInfo searchable) {
Intent voiceIntent = new Intent(baseIntent);
ComponentName searchActivity = searchable.getSearchActivity();
voiceIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, searchActivity == null ? null
... | [
"private",
"Intent",
"createVoiceWebSearchIntent",
"(",
"Intent",
"baseIntent",
",",
"SearchableInfo",
"searchable",
")",
"{",
"Intent",
"voiceIntent",
"=",
"new",
"Intent",
"(",
"baseIntent",
")",
";",
"ComponentName",
"searchActivity",
"=",
"searchable",
".",
"get... | Create and return an Intent that can launch the voice search activity for web search. | [
"Create",
"and",
"return",
"an",
"Intent",
"that",
"can",
"launch",
"the",
"voice",
"search",
"activity",
"for",
"web",
"search",
"."
] | train | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java#L1498-L1504 |
NetsOSS/embedded-jetty | src/main/java/eu/nets/oss/jetty/EmbeddedSpringBuilder.java | EmbeddedSpringBuilder.createApplicationContext | public static WebApplicationContext createApplicationContext(final String displayName, final Class... contextConfigLocation) {
"""
Instantiates an application context for javaconfig classes.
<p/>
This context initializes in a custom manner so it can be passed from the outside into
jetty servlet contexts. Since ... | java | public static WebApplicationContext createApplicationContext(final String displayName, final Class... contextConfigLocation) {
return new AnnotationConfigWebApplicationContext() {
boolean refreshed = false;
{
setDisplayName(displayName);
register(contextC... | [
"public",
"static",
"WebApplicationContext",
"createApplicationContext",
"(",
"final",
"String",
"displayName",
",",
"final",
"Class",
"...",
"contextConfigLocation",
")",
"{",
"return",
"new",
"AnnotationConfigWebApplicationContext",
"(",
")",
"{",
"boolean",
"refreshed"... | Instantiates an application context for javaconfig classes.
<p/>
This context initializes in a custom manner so it can be passed from the outside into
jetty servlet contexts. Since they normally think they are self-contained, they try
to do the initialization themselves.
@param displayName The name of the sp... | [
"Instantiates",
"an",
"application",
"context",
"for",
"javaconfig",
"classes",
".",
"<p",
"/",
">",
"This",
"context",
"initializes",
"in",
"a",
"custom",
"manner",
"so",
"it",
"can",
"be",
"passed",
"from",
"the",
"outside",
"into",
"jetty",
"servlet",
"co... | train | https://github.com/NetsOSS/embedded-jetty/blob/c2535867ad4887c4a43a8aa7f95b711ff54c8542/src/main/java/eu/nets/oss/jetty/EmbeddedSpringBuilder.java#L46-L65 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/ActivityApi.java | ActivityApi.userComments | public ActivityResponse userComments(Integer perPage, Integer page) throws JinxException {
"""
Returns a list of recent activity on photos commented on by the calling user.
Do not poll this method more than once an hour.
<br>
This method requires authentication with 'read' permission.
@param perPage (Optiona... | java | public ActivityResponse userComments(Integer perPage, Integer page) throws JinxException {
/* sample URL:
https://api.flickr.com/services/rest/?method=flickr.activity.userComments&api_key=be21c1db5ab3dee07f7907de26d1e9be&per_page=10&page=1&format=json&nojsoncallback=1&auth_token=72157632971491247-fb7b422f825749fb&... | [
"public",
"ActivityResponse",
"userComments",
"(",
"Integer",
"perPage",
",",
"Integer",
"page",
")",
"throws",
"JinxException",
"{",
"/* sample URL:\n\t\t\thttps://api.flickr.com/services/rest/?method=flickr.activity.userComments&api_key=be21c1db5ab3dee07f7907de26d1e9be&per_page=10&page=1... | Returns a list of recent activity on photos commented on by the calling user.
Do not poll this method more than once an hour.
<br>
This method requires authentication with 'read' permission.
@param perPage (Optional) Number of items to return per page. If this argument is null or less than 1, it defaults to 10.
If thi... | [
"Returns",
"a",
"list",
"of",
"recent",
"activity",
"on",
"photos",
"commented",
"on",
"by",
"the",
"calling",
"user",
".",
"Do",
"not",
"poll",
"this",
"method",
"more",
"than",
"once",
"an",
"hour",
".",
"<br",
">",
"This",
"method",
"requires",
"authe... | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/ActivityApi.java#L55-L78 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/Widgets.java | Widgets.newShim | public static Widget newShim (int width, int height) {
"""
Makes a widget that takes up horizontal and or vertical space. Shim shimminy shim shim
shiree.
"""
Image shim = new Image(_rsrc.blank());
shim.setWidth(width + "px");
shim.setHeight(height + "px");
return shim;
} | java | public static Widget newShim (int width, int height)
{
Image shim = new Image(_rsrc.blank());
shim.setWidth(width + "px");
shim.setHeight(height + "px");
return shim;
} | [
"public",
"static",
"Widget",
"newShim",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"Image",
"shim",
"=",
"new",
"Image",
"(",
"_rsrc",
".",
"blank",
"(",
")",
")",
";",
"shim",
".",
"setWidth",
"(",
"width",
"+",
"\"px\"",
")",
";",
"shi... | Makes a widget that takes up horizontal and or vertical space. Shim shimminy shim shim
shiree. | [
"Makes",
"a",
"widget",
"that",
"takes",
"up",
"horizontal",
"and",
"or",
"vertical",
"space",
".",
"Shim",
"shimminy",
"shim",
"shim",
"shiree",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L428-L434 |
imsweb/naaccr-xml | src/main/java/com/imsweb/naaccrxml/NaaccrXmlDictionaryUtils.java | NaaccrXmlDictionaryUtils.writeDictionary | public static void writeDictionary(NaaccrDictionary dictionary, File file) throws IOException {
"""
Writes the given dictionary to the provided file.
@param dictionary dictionary to write, cannot be null
@param file file, cannot be null
@throws IOException if the dictionary could not be written
"""
... | java | public static void writeDictionary(NaaccrDictionary dictionary, File file) throws IOException {
try (Writer writer = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8)) {
writeDictionary(dictionary, writer);
}
} | [
"public",
"static",
"void",
"writeDictionary",
"(",
"NaaccrDictionary",
"dictionary",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"try",
"(",
"Writer",
"writer",
"=",
"new",
"OutputStreamWriter",
"(",
"new",
"FileOutputStream",
"(",
"file",
")",
",",... | Writes the given dictionary to the provided file.
@param dictionary dictionary to write, cannot be null
@param file file, cannot be null
@throws IOException if the dictionary could not be written | [
"Writes",
"the",
"given",
"dictionary",
"to",
"the",
"provided",
"file",
"."
] | train | https://github.com/imsweb/naaccr-xml/blob/a3a501faa2a0c3411dd5248b2c1379f279131696/src/main/java/com/imsweb/naaccrxml/NaaccrXmlDictionaryUtils.java#L301-L305 |
damnhandy/Handy-URI-Templates | src/main/java/com/damnhandy/uri/template/UriTemplate.java | UriTemplate.set | public UriTemplate set(Map<String, Object> values) {
"""
Adds the name/value pairs in the supplied {@link Map} to the collection
of values within this URI template instance.
@param values
@return
@since 1.0
"""
if (values != null && !values.isEmpty())
{
this.values.putAll(valu... | java | public UriTemplate set(Map<String, Object> values)
{
if (values != null && !values.isEmpty())
{
this.values.putAll(values);
}
return this;
} | [
"public",
"UriTemplate",
"set",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"values",
")",
"{",
"if",
"(",
"values",
"!=",
"null",
"&&",
"!",
"values",
".",
"isEmpty",
"(",
")",
")",
"{",
"this",
".",
"values",
".",
"putAll",
"(",
"values",
")",... | Adds the name/value pairs in the supplied {@link Map} to the collection
of values within this URI template instance.
@param values
@return
@since 1.0 | [
"Adds",
"the",
"name",
"/",
"value",
"pairs",
"in",
"the",
"supplied",
"{",
"@link",
"Map",
"}",
"to",
"the",
"collection",
"of",
"values",
"within",
"this",
"URI",
"template",
"instance",
"."
] | train | https://github.com/damnhandy/Handy-URI-Templates/blob/0896e13828e3d8a93dd19a8e148c3d0740201c3d/src/main/java/com/damnhandy/uri/template/UriTemplate.java#L558-L565 |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/util/Slice.java | Slice.copySlice | public Slice copySlice(int index, int length) {
"""
Returns a copy of this buffer's sub-region. Modifying the content of
the returned buffer or this buffer does not affect each other at all.
"""
checkPositionIndexes(index, index + length, this.length);
index += offset;
byte[] copiedA... | java | public Slice copySlice(int index, int length)
{
checkPositionIndexes(index, index + length, this.length);
index += offset;
byte[] copiedArray = new byte[length];
System.arraycopy(data, index, copiedArray, 0, length);
return new Slice(copiedArray);
} | [
"public",
"Slice",
"copySlice",
"(",
"int",
"index",
",",
"int",
"length",
")",
"{",
"checkPositionIndexes",
"(",
"index",
",",
"index",
"+",
"length",
",",
"this",
".",
"length",
")",
";",
"index",
"+=",
"offset",
";",
"byte",
"[",
"]",
"copiedArray",
... | Returns a copy of this buffer's sub-region. Modifying the content of
the returned buffer or this buffer does not affect each other at all. | [
"Returns",
"a",
"copy",
"of",
"this",
"buffer",
"s",
"sub",
"-",
"region",
".",
"Modifying",
"the",
"content",
"of",
"the",
"returned",
"buffer",
"or",
"this",
"buffer",
"does",
"not",
"affect",
"each",
"other",
"at",
"all",
"."
] | train | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/util/Slice.java#L527-L535 |
opencb/biodata | biodata-formats/src/main/java/org/opencb/biodata/formats/sequence/fastq/io/FastaQReader.java | FastaQReader.checkQualitySize | private void checkQualitySize(String id, String sequence, String quality) throws FileFormatException {
"""
Check that the sequence and quality strings have the same length
@param id - FastQ id
@param sequence - FastQ sequence string
@param quality - FastQ quality string
@throws FileFormatException - I... | java | private void checkQualitySize(String id, String sequence, String quality) throws FileFormatException {
if (sequence.length() != quality.length()) {
throw new FileFormatException("Quality and Sequence lenghts are different in Fasta " + id);
}
} | [
"private",
"void",
"checkQualitySize",
"(",
"String",
"id",
",",
"String",
"sequence",
",",
"String",
"quality",
")",
"throws",
"FileFormatException",
"{",
"if",
"(",
"sequence",
".",
"length",
"(",
")",
"!=",
"quality",
".",
"length",
"(",
")",
")",
"{",
... | Check that the sequence and quality strings have the same length
@param id - FastQ id
@param sequence - FastQ sequence string
@param quality - FastQ quality string
@throws FileFormatException - If the sequence and quality strings have different lengths | [
"Check",
"that",
"the",
"sequence",
"and",
"quality",
"strings",
"have",
"the",
"same",
"length"
] | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-formats/src/main/java/org/opencb/biodata/formats/sequence/fastq/io/FastaQReader.java#L220-L224 |
jhades/jhades | jhades/src/main/java/org/jhades/model/ClasspathResources.java | ClasspathResources.sortByNumberOfVersionsDesc | public static void sortByNumberOfVersionsDesc(List<ClasspathResource> resources) {
"""
Takes a list of classpath resources and sorts them by the number of classpath versions.
The resources with the biggest number of versions will be first on the list.
@param resources to be sorted
"""
// sort b... | java | public static void sortByNumberOfVersionsDesc(List<ClasspathResource> resources) {
// sort by number of version occurrences
Comparator<ClasspathResource> sortByNumberOfVersionsDesc = new Comparator<ClasspathResource>() {
@Override
public int compare(ClasspathResource resource1, C... | [
"public",
"static",
"void",
"sortByNumberOfVersionsDesc",
"(",
"List",
"<",
"ClasspathResource",
">",
"resources",
")",
"{",
"// sort by number of version occurrences",
"Comparator",
"<",
"ClasspathResource",
">",
"sortByNumberOfVersionsDesc",
"=",
"new",
"Comparator",
"<",... | Takes a list of classpath resources and sorts them by the number of classpath versions.
The resources with the biggest number of versions will be first on the list.
@param resources to be sorted | [
"Takes",
"a",
"list",
"of",
"classpath",
"resources",
"and",
"sorts",
"them",
"by",
"the",
"number",
"of",
"classpath",
"versions",
"."
] | train | https://github.com/jhades/jhades/blob/51e20b7d67f51697f947fcab94494c93f6bf1b01/jhades/src/main/java/org/jhades/model/ClasspathResources.java#L53-L62 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/promotion/UnifiedPromoteBuildAction.java | UnifiedPromoteBuildAction.doIndex | @SuppressWarnings( {
"""
Select which view to display based on the state of the promotion. Will return the form if user selects to perform
promotion. Progress will be returned if the promotion is currently in progress.
""""UnusedDeclaration"})
public void doIndex(StaplerRequest req, StaplerResponse resp) ... | java | @SuppressWarnings({"UnusedDeclaration"})
public void doIndex(StaplerRequest req, StaplerResponse resp) throws IOException, ServletException {
req.getView(this, chooseAction()).forward(req, resp);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"UnusedDeclaration\"",
"}",
")",
"public",
"void",
"doIndex",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"resp",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"req",
".",
"getView",
"(",
"this",
",",
... | Select which view to display based on the state of the promotion. Will return the form if user selects to perform
promotion. Progress will be returned if the promotion is currently in progress. | [
"Select",
"which",
"view",
"to",
"display",
"based",
"on",
"the",
"state",
"of",
"the",
"promotion",
".",
"Will",
"return",
"the",
"form",
"if",
"user",
"selects",
"to",
"perform",
"promotion",
".",
"Progress",
"will",
"be",
"returned",
"if",
"the",
"promo... | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/promotion/UnifiedPromoteBuildAction.java#L270-L273 |
pravega/pravega | common/src/main/java/io/pravega/common/concurrent/Futures.java | Futures.completeAfter | public static <T> void completeAfter(Supplier<CompletableFuture<? extends T>> futureSupplier, CompletableFuture<T> toComplete) {
"""
Given a Supplier returning a Future, completes another future either with the result of the first future, in case
of normal completion, or exceptionally with the exception of the fi... | java | public static <T> void completeAfter(Supplier<CompletableFuture<? extends T>> futureSupplier, CompletableFuture<T> toComplete) {
Preconditions.checkArgument(!toComplete.isDone(), "toComplete is already completed.");
try {
CompletableFuture<? extends T> f = futureSupplier.get();
... | [
"public",
"static",
"<",
"T",
">",
"void",
"completeAfter",
"(",
"Supplier",
"<",
"CompletableFuture",
"<",
"?",
"extends",
"T",
">",
">",
"futureSupplier",
",",
"CompletableFuture",
"<",
"T",
">",
"toComplete",
")",
"{",
"Preconditions",
".",
"checkArgument",... | Given a Supplier returning a Future, completes another future either with the result of the first future, in case
of normal completion, or exceptionally with the exception of the first future.
@param futureSupplier A Supplier returning a Future to listen to.
@param toComplete A CompletableFuture that has not yet b... | [
"Given",
"a",
"Supplier",
"returning",
"a",
"Future",
"completes",
"another",
"future",
"either",
"with",
"the",
"result",
"of",
"the",
"first",
"future",
"in",
"case",
"of",
"normal",
"completion",
"or",
"exceptionally",
"with",
"the",
"exception",
"of",
"the... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/concurrent/Futures.java#L85-L98 |
kite-sdk/kite | kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/filesystem/FileSystemView.java | FileSystemView.dirIterator | Iterator<Path> dirIterator() {
"""
Returns an iterator that provides all leaf-level directories in this view.
@return leaf-directory iterator
"""
if (dataset.getDescriptor().isPartitioned()) {
return Iterators.transform(partitionIterator(), new Function<StorageKey, Path>() {
@Override
... | java | Iterator<Path> dirIterator() {
if (dataset.getDescriptor().isPartitioned()) {
return Iterators.transform(partitionIterator(), new Function<StorageKey, Path>() {
@Override
@edu.umd.cs.findbugs.annotations.SuppressWarnings(
value="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",... | [
"Iterator",
"<",
"Path",
">",
"dirIterator",
"(",
")",
"{",
"if",
"(",
"dataset",
".",
"getDescriptor",
"(",
")",
".",
"isPartitioned",
"(",
")",
")",
"{",
"return",
"Iterators",
".",
"transform",
"(",
"partitionIterator",
"(",
")",
",",
"new",
"Function... | Returns an iterator that provides all leaf-level directories in this view.
@return leaf-directory iterator | [
"Returns",
"an",
"iterator",
"that",
"provides",
"all",
"leaf",
"-",
"level",
"directories",
"in",
"this",
"view",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/filesystem/FileSystemView.java#L194-L208 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/JavaCompilerMojo.java | JavaCompilerMojo.fileDeleted | @Override
public boolean fileDeleted(final File file) throws WatchingException {
"""
A new (accepted) file was deleted. This methods triggers the Java compilation.
@param file the file
@return {@literal true}
@throws WatchingException thrown on compilation error. The thrown exception contains the file, li... | java | @Override
public boolean fileDeleted(final File file) throws WatchingException {
// Delete the associated class file.
// We delete more than required... but the inner class case is very tricky.
Collection<File> files = FileUtils.listFiles(classes, new IOFileFilter() {
@Override
... | [
"@",
"Override",
"public",
"boolean",
"fileDeleted",
"(",
"final",
"File",
"file",
")",
"throws",
"WatchingException",
"{",
"// Delete the associated class file.",
"// We delete more than required... but the inner class case is very tricky.",
"Collection",
"<",
"File",
">",
"fi... | A new (accepted) file was deleted. This methods triggers the Java compilation.
@param file the file
@return {@literal true}
@throws WatchingException thrown on compilation error. The thrown exception contains the file, line,
character and reason of the compilation error. | [
"A",
"new",
"(",
"accepted",
")",
"file",
"was",
"deleted",
".",
"This",
"methods",
"triggers",
"the",
"Java",
"compilation",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/JavaCompilerMojo.java#L120-L144 |
redkale/redkale | src/org/redkale/net/http/HttpRequest.java | HttpRequest.getRequstURIPath | public String getRequstURIPath(String prefix, String defvalue) {
"""
获取请求URL分段中含prefix段的值 <br>
例如请求URL /pipes/record/query/name:hello <br>
获取name参数: String name = request.getRequstURIPath("name:", "none");
@param prefix prefix段前缀
@param defvalue 默认值
@return prefix截断后的值
"""
if (requestUR... | java | public String getRequstURIPath(String prefix, String defvalue) {
if (requestURI == null || prefix == null || prefix.isEmpty()) return defvalue;
int pos = requestURI.indexOf(prefix);
if (pos < 0) return defvalue;
String sub = requestURI.substring(pos + prefix.length());
pos =... | [
"public",
"String",
"getRequstURIPath",
"(",
"String",
"prefix",
",",
"String",
"defvalue",
")",
"{",
"if",
"(",
"requestURI",
"==",
"null",
"||",
"prefix",
"==",
"null",
"||",
"prefix",
".",
"isEmpty",
"(",
")",
")",
"return",
"defvalue",
";",
"int",
"p... | 获取请求URL分段中含prefix段的值 <br>
例如请求URL /pipes/record/query/name:hello <br>
获取name参数: String name = request.getRequstURIPath("name:", "none");
@param prefix prefix段前缀
@param defvalue 默认值
@return prefix截断后的值 | [
"获取请求URL分段中含prefix段的值",
"<br",
">",
"例如请求URL",
"/",
"pipes",
"/",
"record",
"/",
"query",
"/",
"name",
":",
"hello",
"<br",
">",
"获取name参数",
":",
"String",
"name",
"=",
"request",
".",
"getRequstURIPath",
"(",
"name",
":",
"none",
")",
";"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/net/http/HttpRequest.java#L798-L805 |
eclipse/xtext-extras | org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/access/binary/asm/SignatureUtil.java | SignatureUtil.scanArrayTypeSignature | private static int scanArrayTypeSignature(String string, int start) {
"""
Scans the given string for an array type signature starting at the given
index and returns the index of the last character.
<pre>
ArrayTypeSignature:
<b>[</b> TypeSignature
</pre>
@param string the signature string
@param start the ... | java | private static int scanArrayTypeSignature(String string, int start) {
int length = string.length();
// need a minimum 2 char
if (start >= length - 1) {
throw new IllegalArgumentException();
}
char c = string.charAt(start);
if (c != C_ARRAY) {
throw new IllegalArgumentException();
}
c = string.ch... | [
"private",
"static",
"int",
"scanArrayTypeSignature",
"(",
"String",
"string",
",",
"int",
"start",
")",
"{",
"int",
"length",
"=",
"string",
".",
"length",
"(",
")",
";",
"// need a minimum 2 char",
"if",
"(",
"start",
">=",
"length",
"-",
"1",
")",
"{",
... | Scans the given string for an array type signature starting at the given
index and returns the index of the last character.
<pre>
ArrayTypeSignature:
<b>[</b> TypeSignature
</pre>
@param string the signature string
@param start the 0-based character index of the first character
@return the 0-based character index of t... | [
"Scans",
"the",
"given",
"string",
"for",
"an",
"array",
"type",
"signature",
"starting",
"at",
"the",
"given",
"index",
"and",
"returns",
"the",
"index",
"of",
"the",
"last",
"character",
".",
"<pre",
">",
"ArrayTypeSignature",
":",
"<b",
">",
"[",
"<",
... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/access/binary/asm/SignatureUtil.java#L247-L267 |
stapler/stapler | jelly/src/main/java/org/kohsuke/stapler/jelly/JellyClassTearOff.java | JellyClassTearOff.createDispatcher | public RequestDispatcher createDispatcher(Object it, String viewName) throws IOException {
"""
Creates a {@link RequestDispatcher} that forwards to the jelly view, if available.
"""
try {
// backward compatible behavior that expects full file name including ".jelly"
Script scrip... | java | public RequestDispatcher createDispatcher(Object it, String viewName) throws IOException {
try {
// backward compatible behavior that expects full file name including ".jelly"
Script script = findScript(viewName);
if(script!=null)
return new JellyRequestDispat... | [
"public",
"RequestDispatcher",
"createDispatcher",
"(",
"Object",
"it",
",",
"String",
"viewName",
")",
"throws",
"IOException",
"{",
"try",
"{",
"// backward compatible behavior that expects full file name including \".jelly\"",
"Script",
"script",
"=",
"findScript",
"(",
... | Creates a {@link RequestDispatcher} that forwards to the jelly view, if available. | [
"Creates",
"a",
"{"
] | train | https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/jelly/src/main/java/org/kohsuke/stapler/jelly/JellyClassTearOff.java#L126-L143 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FailoverGroupsInner.java | FailoverGroupsInner.beginFailover | public FailoverGroupInner beginFailover(String resourceGroupName, String serverName, String failoverGroupName) {
"""
Fails over from the current primary server to this server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Ma... | java | public FailoverGroupInner beginFailover(String resourceGroupName, String serverName, String failoverGroupName) {
return beginFailoverWithServiceResponseAsync(resourceGroupName, serverName, failoverGroupName).toBlocking().single().body();
} | [
"public",
"FailoverGroupInner",
"beginFailover",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"failoverGroupName",
")",
"{",
"return",
"beginFailoverWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
"failoverGrou... | Fails over from the current primary server to this server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server containing the failover group.
@param failoverGroupName Th... | [
"Fails",
"over",
"from",
"the",
"current",
"primary",
"server",
"to",
"this",
"server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FailoverGroupsInner.java#L966-L968 |
Activiti/Activiti | activiti-engine/src/main/java/org/activiti/engine/impl/util/json/JSONObject.java | JSONObject.optString | public String optString(String key, String defaultValue) {
"""
Get an optional string associated with a key. It returns the defaultValue if there is no such key.
@param key
A key string.
@param defaultValue
The default.
@return A string which is the value.
"""
Object o = opt(key);
return o != nu... | java | public String optString(String key, String defaultValue) {
Object o = opt(key);
return o != null ? o.toString() : defaultValue;
} | [
"public",
"String",
"optString",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"Object",
"o",
"=",
"opt",
"(",
"key",
")",
";",
"return",
"o",
"!=",
"null",
"?",
"o",
".",
"toString",
"(",
")",
":",
"defaultValue",
";",
"}"
] | Get an optional string associated with a key. It returns the defaultValue if there is no such key.
@param key
A key string.
@param defaultValue
The default.
@return A string which is the value. | [
"Get",
"an",
"optional",
"string",
"associated",
"with",
"a",
"key",
".",
"It",
"returns",
"the",
"defaultValue",
"if",
"there",
"is",
"no",
"such",
"key",
"."
] | train | https://github.com/Activiti/Activiti/blob/82e2b2cd2083b2f734ca0efc7815389c0f2517d9/activiti-engine/src/main/java/org/activiti/engine/impl/util/json/JSONObject.java#L815-L818 |
trellis-ldp/trellis | auth/basic/src/main/java/org/trellisldp/auth/basic/Credentials.java | Credentials.parse | public static Credentials parse(final String encoded) {
"""
Create a set of credentials.
@param encoded the encoded header
@return credentials or null on error
"""
try {
final String decoded = new String(Base64.getDecoder().decode(encoded), UTF_8);
final String[] parts = decod... | java | public static Credentials parse(final String encoded) {
try {
final String decoded = new String(Base64.getDecoder().decode(encoded), UTF_8);
final String[] parts = decoded.split(":", 2);
if (parts.length == 2) {
return new Credentials(parts[0], parts[1]);
... | [
"public",
"static",
"Credentials",
"parse",
"(",
"final",
"String",
"encoded",
")",
"{",
"try",
"{",
"final",
"String",
"decoded",
"=",
"new",
"String",
"(",
"Base64",
".",
"getDecoder",
"(",
")",
".",
"decode",
"(",
"encoded",
")",
",",
"UTF_8",
")",
... | Create a set of credentials.
@param encoded the encoded header
@return credentials or null on error | [
"Create",
"a",
"set",
"of",
"credentials",
"."
] | train | https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/auth/basic/src/main/java/org/trellisldp/auth/basic/Credentials.java#L55-L66 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.sendInstantiationProposal | public Collection<ProposalResponse> sendInstantiationProposal(InstantiateProposalRequest instantiateProposalRequest) throws InvalidArgumentException, ProposalException {
"""
Send instantiate request to the channel. Chaincode is created and initialized.
@param instantiateProposalRequest send instantiate chaincod... | java | public Collection<ProposalResponse> sendInstantiationProposal(InstantiateProposalRequest instantiateProposalRequest) throws InvalidArgumentException, ProposalException {
return sendInstantiationProposal(instantiateProposalRequest, getChaincodePeers());
} | [
"public",
"Collection",
"<",
"ProposalResponse",
">",
"sendInstantiationProposal",
"(",
"InstantiateProposalRequest",
"instantiateProposalRequest",
")",
"throws",
"InvalidArgumentException",
",",
"ProposalException",
"{",
"return",
"sendInstantiationProposal",
"(",
"instantiatePr... | Send instantiate request to the channel. Chaincode is created and initialized.
@param instantiateProposalRequest send instantiate chaincode proposal request.
@return Collections of proposal responses
@throws InvalidArgumentException
@throws ProposalException
@deprecated See new lifecycle chaincode management. {@link L... | [
"Send",
"instantiate",
"request",
"to",
"the",
"channel",
".",
"Chaincode",
"is",
"created",
"and",
"initialized",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L2430-L2433 |
h2oai/h2o-3 | h2o-core/src/main/java/water/api/Route.java | Route.resolveMethod | private static Method resolveMethod(Class<? extends Handler> handler_class, String handler_method) {
"""
Search the provided class (and all its superclasses) for the requested method.
@param handler_class Class to be searched
@param handler_method Name of the method to look for. The method must have signature (i... | java | private static Method resolveMethod(Class<? extends Handler> handler_class, String handler_method) {
for (Method method : handler_class.getMethods())
if (method.getName().equals(handler_method)) {
Class[] pt = method.getParameterTypes();
if (pt != null && pt.length == 2 && pt[0] == Integer.TYP... | [
"private",
"static",
"Method",
"resolveMethod",
"(",
"Class",
"<",
"?",
"extends",
"Handler",
">",
"handler_class",
",",
"String",
"handler_method",
")",
"{",
"for",
"(",
"Method",
"method",
":",
"handler_class",
".",
"getMethods",
"(",
")",
")",
"if",
"(",
... | Search the provided class (and all its superclasses) for the requested method.
@param handler_class Class to be searched
@param handler_method Name of the method to look for. The method must have signature (int, Schema).
@return The callable Method object. | [
"Search",
"the",
"provided",
"class",
"(",
"and",
"all",
"its",
"superclasses",
")",
"for",
"the",
"requested",
"method",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/Route.java#L124-L132 |
wcm-io/wcm-io-wcm | ui/extjs/src/main/java/io/wcm/wcm/ui/extjs/provider/AbstractPageProvider.java | AbstractPageProvider.getPageFilter | protected PageFilter getPageFilter(SlingHttpServletRequest request) {
"""
Can be overridden by subclasses to filter page list via page filter.
If not overridden it supports defining a page filter via "predicate" request attribute.
@param request Request
@return Page filter or null if no filtering applies
""... | java | protected PageFilter getPageFilter(SlingHttpServletRequest request) {
// check for predicate filter
String predicateName = RequestParam.get(request, RP_PREDICATE);
if (StringUtils.isNotEmpty(predicateName)) {
PredicateProvider predicateProvider = getPredicateProvider();
if (predicateProvider ==... | [
"protected",
"PageFilter",
"getPageFilter",
"(",
"SlingHttpServletRequest",
"request",
")",
"{",
"// check for predicate filter",
"String",
"predicateName",
"=",
"RequestParam",
".",
"get",
"(",
"request",
",",
"RP_PREDICATE",
")",
";",
"if",
"(",
"StringUtils",
".",
... | Can be overridden by subclasses to filter page list via page filter.
If not overridden it supports defining a page filter via "predicate" request attribute.
@param request Request
@return Page filter or null if no filtering applies | [
"Can",
"be",
"overridden",
"by",
"subclasses",
"to",
"filter",
"page",
"list",
"via",
"page",
"filter",
".",
"If",
"not",
"overridden",
"it",
"supports",
"defining",
"a",
"page",
"filter",
"via",
"predicate",
"request",
"attribute",
"."
] | train | https://github.com/wcm-io/wcm-io-wcm/blob/8eff9434f2f4b6462fdb718f8769ad793c55b8d7/ui/extjs/src/main/java/io/wcm/wcm/ui/extjs/provider/AbstractPageProvider.java#L130-L147 |
lucee/Lucee | core/src/main/java/lucee/runtime/functions/conversion/DeserializeJSON.java | DeserializeJSON.toQuery | private static Collection toQuery(Collection coll, Key[] keys) throws PageException {
"""
/*
private static Object toQuery(Query qry) throws DatabaseException { int
rows=qry.getRecordcount(); String[] columns = qry.getColumns(); Object src,trg; for(int
row=1;row<=rows;row++) { for(int col=0;col<columns.length;c... | java | private static Collection toQuery(Collection coll, Key[] keys) throws PageException {
Object src, trg;
for (int i = 0; i < keys.length; i++) {
trg = toQuery(src = coll.get(keys[i], null));
if (src != trg) coll.setEL(keys[i], trg);
}
return coll;
} | [
"private",
"static",
"Collection",
"toQuery",
"(",
"Collection",
"coll",
",",
"Key",
"[",
"]",
"keys",
")",
"throws",
"PageException",
"{",
"Object",
"src",
",",
"trg",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"keys",
".",
"length",
";",... | /*
private static Object toQuery(Query qry) throws DatabaseException { int
rows=qry.getRecordcount(); String[] columns = qry.getColumns(); Object src,trg; for(int
row=1;row<=rows;row++) { for(int col=0;col<columns.length;col++) {
trg=toQuery(src=qry.getAt(columns[col], row, null)); if(src!=trg) qry.setAtEL(columns[col]... | [
"/",
"*",
"private",
"static",
"Object",
"toQuery",
"(",
"Query",
"qry",
")",
"throws",
"DatabaseException",
"{",
"int",
"rows",
"=",
"qry",
".",
"getRecordcount",
"()",
";",
"String",
"[]",
"columns",
"=",
"qry",
".",
"getColumns",
"()",
";",
"Object",
... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/functions/conversion/DeserializeJSON.java#L112-L119 |
google/closure-compiler | src/com/google/javascript/jscomp/type/ChainableReverseAbstractInterpreter.java | ChainableReverseAbstractInterpreter.getRestrictedByTypeOfResult | JSType getRestrictedByTypeOfResult(JSType type, String value,
boolean resultEqualsValue) {
"""
Returns a version of {@code type} that is restricted by some knowledge
about the result of the {@code typeof} operation.
<p>
The behavior of the {@code typeof} operator can be summ... | java | JSType getRestrictedByTypeOfResult(JSType type, String value,
boolean resultEqualsValue) {
if (type == null) {
if (resultEqualsValue) {
JSType result = getNativeTypeForTypeOf(value);
return result == null ? getNativeType(CHECKED_UNKNOWN_TYPE) : result;
... | [
"JSType",
"getRestrictedByTypeOfResult",
"(",
"JSType",
"type",
",",
"String",
"value",
",",
"boolean",
"resultEqualsValue",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"if",
"(",
"resultEqualsValue",
")",
"{",
"JSType",
"result",
"=",
"getNativeTypeF... | Returns a version of {@code type} that is restricted by some knowledge
about the result of the {@code typeof} operation.
<p>
The behavior of the {@code typeof} operator can be summarized by the
following table:
<table>
<tr><th>type</th><th>result</th></tr>
<tr><td>{@code undefined}</td><td>"undefined"</td></tr>
<tr><td... | [
"Returns",
"a",
"version",
"of",
"{"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/type/ChainableReverseAbstractInterpreter.java#L729-L741 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.