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 |
|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-java | common/azure-common-mgmt/src/main/java/com/azure/common/mgmt/AzureProxy.java | AzureProxy.createDefaultPipeline | public static HttpPipeline createDefaultPipeline(Class<?> swaggerInterface, ServiceClientCredentials credentials) {
"""
Create the default HttpPipeline.
@param swaggerInterface The interface that the pipeline will use to generate a user-agent
string.
@param credentials The credentials to use to apply authentica... | java | public static HttpPipeline createDefaultPipeline(Class<?> swaggerInterface, ServiceClientCredentials credentials) {
return createDefaultPipeline(swaggerInterface, new CredentialsPolicy(credentials));
} | [
"public",
"static",
"HttpPipeline",
"createDefaultPipeline",
"(",
"Class",
"<",
"?",
">",
"swaggerInterface",
",",
"ServiceClientCredentials",
"credentials",
")",
"{",
"return",
"createDefaultPipeline",
"(",
"swaggerInterface",
",",
"new",
"CredentialsPolicy",
"(",
"cre... | Create the default HttpPipeline.
@param swaggerInterface The interface that the pipeline will use to generate a user-agent
string.
@param credentials The credentials to use to apply authentication to the pipeline.
@return the default HttpPipeline. | [
"Create",
"the",
"default",
"HttpPipeline",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common-mgmt/src/main/java/com/azure/common/mgmt/AzureProxy.java#L169-L171 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/OutputPropertyUtils.java | OutputPropertyUtils.getIntProperty | public static int getIntProperty(String key, Properties props) {
"""
Searches for the int property with the specified key in the property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns
<code>false</code> if the ... | java | public static int getIntProperty(String key, Properties props)
{
String s = props.getProperty(key);
if (null == s)
return 0;
else
return Integer.parseInt(s);
} | [
"public",
"static",
"int",
"getIntProperty",
"(",
"String",
"key",
",",
"Properties",
"props",
")",
"{",
"String",
"s",
"=",
"props",
".",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"null",
"==",
"s",
")",
"return",
"0",
";",
"else",
"return",
"... | Searches for the int property with the specified key in the property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns
<code>false</code> if the property is not found, or if the value is other
than "yes".
@param key t... | [
"Searches",
"for",
"the",
"int",
"property",
"with",
"the",
"specified",
"key",
"in",
"the",
"property",
"list",
".",
"If",
"the",
"key",
"is",
"not",
"found",
"in",
"this",
"property",
"list",
"the",
"default",
"property",
"list",
"and",
"its",
"defaults"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/OutputPropertyUtils.java#L72-L81 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/animation/transformation/ParallelTransformation.java | ParallelTransformation.addTransformations | public ParallelTransformation addTransformations(Transformation<?, ?>... transformations) {
"""
Adds the {@link Transformation} this to {@link ParallelTransformation}
@param transformations the transformations
@return the parallel transformation
"""
for (Transformation<?, ?> transformation : transformati... | java | public ParallelTransformation addTransformations(Transformation<?, ?>... transformations)
{
for (Transformation<?, ?> transformation : transformations)
{
duration = Math.max(duration, transformation.totalDuration());
listTransformations.add(transformation);
}
return this;
} | [
"public",
"ParallelTransformation",
"addTransformations",
"(",
"Transformation",
"<",
"?",
",",
"?",
">",
"...",
"transformations",
")",
"{",
"for",
"(",
"Transformation",
"<",
"?",
",",
"?",
">",
"transformation",
":",
"transformations",
")",
"{",
"duration",
... | Adds the {@link Transformation} this to {@link ParallelTransformation}
@param transformations the transformations
@return the parallel transformation | [
"Adds",
"the",
"{",
"@link",
"Transformation",
"}",
"this",
"to",
"{",
"@link",
"ParallelTransformation",
"}"
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/animation/transformation/ParallelTransformation.java#L65-L74 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java | Apptentive.register | public static void register(Application application, ApptentiveConfiguration configuration) {
"""
Must be called from the {@link Application#onCreate()} method in the {@link Application} object defined in your app's manifest.
@param application Application object.
@param configuration Apptentive configuration co... | java | public static void register(Application application, ApptentiveConfiguration configuration) {
if (application == null) {
throw new IllegalArgumentException("Application is null");
}
if (configuration == null) {
throw new IllegalArgumentException("Apptentive configuration is null");
}
try {
Apptenti... | [
"public",
"static",
"void",
"register",
"(",
"Application",
"application",
",",
"ApptentiveConfiguration",
"configuration",
")",
"{",
"if",
"(",
"application",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Application is null\"",
")",
"... | Must be called from the {@link Application#onCreate()} method in the {@link Application} object defined in your app's manifest.
@param application Application object.
@param configuration Apptentive configuration containing SDK initialization data. | [
"Must",
"be",
"called",
"from",
"the",
"{"
] | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java#L119-L134 |
Mthwate/DatLib | src/main/java/com/mthwate/datlib/math/MathUtils.java | MathUtils.gcd | public static BigInteger gcd(BigInteger a, BigInteger b) {
"""
Gets the greatest common divisor of 2 numbers.
@since 1.3
@param a the first BigInteger
@param b the second BigInteger
@return the greatest common divisor as a BigInteger
"""
return gcd(a, b, Calculator.BIG_INTEGER_CALCULATOR);
} | java | public static BigInteger gcd(BigInteger a, BigInteger b) {
return gcd(a, b, Calculator.BIG_INTEGER_CALCULATOR);
} | [
"public",
"static",
"BigInteger",
"gcd",
"(",
"BigInteger",
"a",
",",
"BigInteger",
"b",
")",
"{",
"return",
"gcd",
"(",
"a",
",",
"b",
",",
"Calculator",
".",
"BIG_INTEGER_CALCULATOR",
")",
";",
"}"
] | Gets the greatest common divisor of 2 numbers.
@since 1.3
@param a the first BigInteger
@param b the second BigInteger
@return the greatest common divisor as a BigInteger | [
"Gets",
"the",
"greatest",
"common",
"divisor",
"of",
"2",
"numbers",
"."
] | train | https://github.com/Mthwate/DatLib/blob/f0b3a9f9cf6fdc773d4f86234ebd95986c9b6077/src/main/java/com/mthwate/datlib/math/MathUtils.java#L47-L49 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.deleteAliases | public void deleteAliases(CmsDbContext dbc, CmsProject project, CmsAliasFilter filter) throws CmsException {
"""
Deletes aliases indicated by a filter.<p>
@param dbc the current database context
@param project the current project
@param filter the filter which describes which aliases to delete
@throws CmsE... | java | public void deleteAliases(CmsDbContext dbc, CmsProject project, CmsAliasFilter filter) throws CmsException {
I_CmsVfsDriver vfsDriver = getVfsDriver(dbc);
vfsDriver.deleteAliases(dbc, project, filter);
} | [
"public",
"void",
"deleteAliases",
"(",
"CmsDbContext",
"dbc",
",",
"CmsProject",
"project",
",",
"CmsAliasFilter",
"filter",
")",
"throws",
"CmsException",
"{",
"I_CmsVfsDriver",
"vfsDriver",
"=",
"getVfsDriver",
"(",
"dbc",
")",
";",
"vfsDriver",
".",
"deleteAli... | Deletes aliases indicated by a filter.<p>
@param dbc the current database context
@param project the current project
@param filter the filter which describes which aliases to delete
@throws CmsException if something goes wrong | [
"Deletes",
"aliases",
"indicated",
"by",
"a",
"filter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L2233-L2237 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/UcsApi.java | UcsApi.setCallCompleted | public ApiSuccessResponse setCallCompleted(String id, CallCompletedData callCompletedData) throws ApiException {
"""
Set the call as being completed
@param id id of the Interaction (required)
@param callCompletedData (required)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. se... | java | public ApiSuccessResponse setCallCompleted(String id, CallCompletedData callCompletedData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = setCallCompletedWithHttpInfo(id, callCompletedData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"setCallCompleted",
"(",
"String",
"id",
",",
"CallCompletedData",
"callCompletedData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"setCallCompletedWithHttpInfo",
"(",
"id",
",",
"callC... | Set the call as being completed
@param id id of the Interaction (required)
@param callCompletedData (required)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Set",
"the",
"call",
"as",
"being",
"completed"
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/UcsApi.java#L1917-L1920 |
52inc/android-52Kit | library-attributr/src/main/java/com/ftinc/kit/attributr/Attributr.java | Attributr.openLicenses | public static void openLicenses(Context ctx, @XmlRes int configResId, String title) {
"""
Open the third party licenses activity with the supplied configuration file
@param ctx the context reference to launch the activity with
@param configResId the XML configuration resource id
@param tit... | java | public static void openLicenses(Context ctx, @XmlRes int configResId, String title){
Intent intent = new Intent(ctx, LicenseActivity.class);
intent.putExtra(com.ftinc.kit.attributr.ui.LicenseActivity.EXTRA_CONFIG, configResId);
intent.putExtra(com.ftinc.kit.attributr.ui.LicenseActivity.EXTRA_TIT... | [
"public",
"static",
"void",
"openLicenses",
"(",
"Context",
"ctx",
",",
"@",
"XmlRes",
"int",
"configResId",
",",
"String",
"title",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"ctx",
",",
"LicenseActivity",
".",
"class",
")",
";",
"intent",
... | Open the third party licenses activity with the supplied configuration file
@param ctx the context reference to launch the activity with
@param configResId the XML configuration resource id
@param title the Activity/Screen title you want to use | [
"Open",
"the",
"third",
"party",
"licenses",
"activity",
"with",
"the",
"supplied",
"configuration",
"file"
] | train | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library-attributr/src/main/java/com/ftinc/kit/attributr/Attributr.java#L43-L48 |
haifengl/smile | core/src/main/java/smile/sequence/HMM.java | HMM.scale | private void scale(double[] scaling, double[][] alpha, int t) {
"""
Normalize alpha[t] and put the normalization factor in scaling[t].
"""
double[] table = alpha[t];
double sum = 0.0;
for (int i = 0; i < table.length; i++) {
sum += table[i];
}
scaling[t] = ... | java | private void scale(double[] scaling, double[][] alpha, int t) {
double[] table = alpha[t];
double sum = 0.0;
for (int i = 0; i < table.length; i++) {
sum += table[i];
}
scaling[t] = sum;
for (int i = 0; i < table.length; i++) {
table[i] /= sum;
... | [
"private",
"void",
"scale",
"(",
"double",
"[",
"]",
"scaling",
",",
"double",
"[",
"]",
"[",
"]",
"alpha",
",",
"int",
"t",
")",
"{",
"double",
"[",
"]",
"table",
"=",
"alpha",
"[",
"t",
"]",
";",
"double",
"sum",
"=",
"0.0",
";",
"for",
"(",
... | Normalize alpha[t] and put the normalization factor in scaling[t]. | [
"Normalize",
"alpha",
"[",
"t",
"]",
"and",
"put",
"the",
"normalization",
"factor",
"in",
"scaling",
"[",
"t",
"]",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/sequence/HMM.java#L295-L307 |
kaazing/gateway | service/http.proxy/src/main/java/org/kaazing/gateway/service/http/proxy/HttpProxyServiceHandler.java | HttpProxyServiceHandler.setupForwardedHeaders | private void setupForwardedHeaders(HttpAcceptSession acceptSession, HttpConnectSession connectSession) {
"""
Compose the Forwarded header and the X-Forwarded headers and add them to the connect session write headers.
@param acceptSession
@param connectSession
@param forwardedProperty the value of the 'use-for... | java | private void setupForwardedHeaders(HttpAcceptSession acceptSession, HttpConnectSession connectSession) {
if (FORWARDED_EXCLUDE.equalsIgnoreCase(useForwarded)) {
excludeForwardedHeaders(connectSession);
return;
}
if (FORWARDED_INJECT.equalsIgnoreCase(useForwarded)) {
... | [
"private",
"void",
"setupForwardedHeaders",
"(",
"HttpAcceptSession",
"acceptSession",
",",
"HttpConnectSession",
"connectSession",
")",
"{",
"if",
"(",
"FORWARDED_EXCLUDE",
".",
"equalsIgnoreCase",
"(",
"useForwarded",
")",
")",
"{",
"excludeForwardedHeaders",
"(",
"co... | Compose the Forwarded header and the X-Forwarded headers and add them to the connect session write headers.
@param acceptSession
@param connectSession
@param forwardedProperty the value of the 'use-forwarded' property used for http.proxy type in gateway-config:
inject (add the corresponding data to the Forwarded/X-For... | [
"Compose",
"the",
"Forwarded",
"header",
"and",
"the",
"X",
"-",
"Forwarded",
"headers",
"and",
"add",
"them",
"to",
"the",
"connect",
"session",
"write",
"headers",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.proxy/src/main/java/org/kaazing/gateway/service/http/proxy/HttpProxyServiceHandler.java#L500-L529 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseThreatDetectionPoliciesInner.java | DatabaseThreatDetectionPoliciesInner.getAsync | public Observable<DatabaseSecurityAlertPolicyInner> getAsync(String resourceGroupName, String serverName, String databaseName) {
"""
Gets a database's threat detection policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Ma... | java | public Observable<DatabaseSecurityAlertPolicyInner> getAsync(String resourceGroupName, String serverName, String databaseName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<DatabaseSecurityAlertPolicyInner>, DatabaseSecurityAlertPolicyInner>() {
... | [
"public",
"Observable",
"<",
"DatabaseSecurityAlertPolicyInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName"... | Gets a database's threat detection policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database for which database Threat De... | [
"Gets",
"a",
"database",
"s",
"threat",
"detection",
"policy",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseThreatDetectionPoliciesInner.java#L105-L112 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/InputTypeUtil.java | InputTypeUtil.getPreProcessorForInputTypeCnnLayers | public static InputPreProcessor getPreProcessorForInputTypeCnnLayers(InputType inputType, String layerName) {
"""
Utility method for determining the appropriate preprocessor for CNN layers, such as {@link ConvolutionLayer} and
{@link SubsamplingLayer}
@param inputType Input type to get the preprocessor for... | java | public static InputPreProcessor getPreProcessorForInputTypeCnnLayers(InputType inputType, String layerName) {
//To add x-to-CNN preprocessor: need to know image channels/width/height after reshaping
//But this can't be inferred from the FF/RNN activations directly (could be anything)
switch (i... | [
"public",
"static",
"InputPreProcessor",
"getPreProcessorForInputTypeCnnLayers",
"(",
"InputType",
"inputType",
",",
"String",
"layerName",
")",
"{",
"//To add x-to-CNN preprocessor: need to know image channels/width/height after reshaping",
"//But this can't be inferred from the FF/RNN ac... | Utility method for determining the appropriate preprocessor for CNN layers, such as {@link ConvolutionLayer} and
{@link SubsamplingLayer}
@param inputType Input type to get the preprocessor for
@return Null if no preprocessor is required; otherwise the appropriate preprocessor for the given input type | [
"Utility",
"method",
"for",
"determining",
"the",
"appropriate",
"preprocessor",
"for",
"CNN",
"layers",
"such",
"as",
"{",
"@link",
"ConvolutionLayer",
"}",
"and",
"{",
"@link",
"SubsamplingLayer",
"}"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/InputTypeUtil.java#L442-L470 |
chanjarster/weixin-java-tools | weixin-java-common/src/main/java/me/chanjar/weixin/common/util/fs/FileUtils.java | FileUtils.createTmpFile | public static File createTmpFile(InputStream inputStream, String name, String ext) throws IOException {
"""
创建临时文件
@param inputStream
@param name 文件名
@param ext 扩展名
@return
@throws IOException
"""
return createTmpFile(inputStream, name, ext, null);
} | java | public static File createTmpFile(InputStream inputStream, String name, String ext) throws IOException {
return createTmpFile(inputStream, name, ext, null);
} | [
"public",
"static",
"File",
"createTmpFile",
"(",
"InputStream",
"inputStream",
",",
"String",
"name",
",",
"String",
"ext",
")",
"throws",
"IOException",
"{",
"return",
"createTmpFile",
"(",
"inputStream",
",",
"name",
",",
"ext",
",",
"null",
")",
";",
"}"... | 创建临时文件
@param inputStream
@param name 文件名
@param ext 扩展名
@return
@throws IOException | [
"创建临时文件"
] | train | https://github.com/chanjarster/weixin-java-tools/blob/2a0b1c30c0f60c2de466cb8933c945bc0d391edf/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/fs/FileUtils.java#L62-L64 |
jOOQ/jOOR | jOOR/src/main/java/org/joor/Reflect.java | Reflect.isSimilarSignature | private boolean isSimilarSignature(Method possiblyMatchingMethod, String desiredMethodName, Class<?>[] desiredParamTypes) {
"""
Determines if a method has a "similar" signature, especially if wrapping
primitive argument types would result in an exactly matching signature.
"""
return possiblyMatchingMe... | java | private boolean isSimilarSignature(Method possiblyMatchingMethod, String desiredMethodName, Class<?>[] desiredParamTypes) {
return possiblyMatchingMethod.getName().equals(desiredMethodName) && match(possiblyMatchingMethod.getParameterTypes(), desiredParamTypes);
} | [
"private",
"boolean",
"isSimilarSignature",
"(",
"Method",
"possiblyMatchingMethod",
",",
"String",
"desiredMethodName",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"desiredParamTypes",
")",
"{",
"return",
"possiblyMatchingMethod",
".",
"getName",
"(",
")",
".",
"equal... | Determines if a method has a "similar" signature, especially if wrapping
primitive argument types would result in an exactly matching signature. | [
"Determines",
"if",
"a",
"method",
"has",
"a",
"similar",
"signature",
"especially",
"if",
"wrapping",
"primitive",
"argument",
"types",
"would",
"result",
"in",
"an",
"exactly",
"matching",
"signature",
"."
] | train | https://github.com/jOOQ/jOOR/blob/40b42be12ecc9939560ff86921bbc57c99a21b85/jOOR/src/main/java/org/joor/Reflect.java#L647-L649 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataUnionOfImpl_CustomFieldSerializer.java | OWLDataUnionOfImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataUnionOfImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataUnionOfImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLDataUnionOfImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataUnionOfImpl_CustomFieldSerializer.java#L89-L92 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/regex/RegExHelper.java | RegExHelper.stringMatchesPattern | public static boolean stringMatchesPattern (@Nonnull @RegEx final String sRegEx, @Nonnull final String sValue) {
"""
A shortcut helper method to determine whether a string matches a certain
regular expression or not.
@param sRegEx
The regular expression to be used. The compiled regular expression
pattern is ... | java | public static boolean stringMatchesPattern (@Nonnull @RegEx final String sRegEx, @Nonnull final String sValue)
{
return getMatcher (sRegEx, sValue).matches ();
} | [
"public",
"static",
"boolean",
"stringMatchesPattern",
"(",
"@",
"Nonnull",
"@",
"RegEx",
"final",
"String",
"sRegEx",
",",
"@",
"Nonnull",
"final",
"String",
"sValue",
")",
"{",
"return",
"getMatcher",
"(",
"sRegEx",
",",
"sValue",
")",
".",
"matches",
"(",... | A shortcut helper method to determine whether a string matches a certain
regular expression or not.
@param sRegEx
The regular expression to be used. The compiled regular expression
pattern is cached. May neither be <code>null</code> nor empty.
@param sValue
The string value to compare against the regular expression.
@... | [
"A",
"shortcut",
"helper",
"method",
"to",
"determine",
"whether",
"a",
"string",
"matches",
"a",
"certain",
"regular",
"expression",
"or",
"not",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/regex/RegExHelper.java#L206-L209 |
policeman-tools/forbidden-apis | src/main/java/de/thetaphi/forbiddenapis/Checker.java | Checker.loadClassFromJigsaw | private ClassSignature loadClassFromJigsaw(String classname) throws IOException {
"""
Loads the class from Java9's module system and uses reflection to get methods and fields.
"""
if (method_Class_getModule == null || method_Module_getName == null) {
return null; // not Jigsaw Module System
}
... | java | private ClassSignature loadClassFromJigsaw(String classname) throws IOException {
if (method_Class_getModule == null || method_Module_getName == null) {
return null; // not Jigsaw Module System
}
final Class<?> clazz;
final String moduleName;
try {
clazz = Class.forName(classname, f... | [
"private",
"ClassSignature",
"loadClassFromJigsaw",
"(",
"String",
"classname",
")",
"throws",
"IOException",
"{",
"if",
"(",
"method_Class_getModule",
"==",
"null",
"||",
"method_Module_getName",
"==",
"null",
")",
"{",
"return",
"null",
";",
"// not Jigsaw Module Sy... | Loads the class from Java9's module system and uses reflection to get methods and fields. | [
"Loads",
"the",
"class",
"from",
"Java9",
"s",
"module",
"system",
"and",
"uses",
"reflection",
"to",
"get",
"methods",
"and",
"fields",
"."
] | train | https://github.com/policeman-tools/forbidden-apis/blob/df5f00c6bb779875ec6bae967f7cec96670b27d9/src/main/java/de/thetaphi/forbiddenapis/Checker.java#L187-L203 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.logv | public void logv(Level level, Throwable t, String format, Object... params) {
"""
Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting.
@param level the level
@param t the throwable
@param format the message format string
@param params the parameters
"""
... | java | public void logv(Level level, Throwable t, String format, Object... params) {
doLog(level, FQCN, format, params, t);
} | [
"public",
"void",
"logv",
"(",
"Level",
"level",
",",
"Throwable",
"t",
",",
"String",
"format",
",",
"Object",
"...",
"params",
")",
"{",
"doLog",
"(",
"level",
",",
"FQCN",
",",
"format",
",",
"params",
",",
"t",
")",
";",
"}"
] | Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting.
@param level the level
@param t the throwable
@param format the message format string
@param params the parameters | [
"Issue",
"a",
"log",
"message",
"at",
"the",
"given",
"log",
"level",
"using",
"{",
"@link",
"java",
".",
"text",
".",
"MessageFormat",
"}",
"-",
"style",
"formatting",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L2167-L2169 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/rendering/TagRenderingBase.java | TagRenderingBase.renderAttribute | protected final void renderAttribute(AbstractRenderAppender buf, String name, String value) {
"""
This method will append an attribute value to a InternalStringBuilder.
The method assumes that the attr is not <code>null</code>. If the
<code>value</code> attribute is <code>null</code> the attribute will not be a... | java | protected final void renderAttribute(AbstractRenderAppender buf, String name, String value)
{
assert (buf != null) : "Parameter 'buf' must not be null.";
assert (name != null) : "Parameter 'name' must not be null";
// without a value lets skip writting this out
if (value == null)
... | [
"protected",
"final",
"void",
"renderAttribute",
"(",
"AbstractRenderAppender",
"buf",
",",
"String",
"name",
",",
"String",
"value",
")",
"{",
"assert",
"(",
"buf",
"!=",
"null",
")",
":",
"\"Parameter 'buf' must not be null.\"",
";",
"assert",
"(",
"name",
"!=... | This method will append an attribute value to a InternalStringBuilder.
The method assumes that the attr is not <code>null</code>. If the
<code>value</code> attribute is <code>null</code> the attribute will not be appended to the
<code>InternalStringBuilder</code>.
@param buf The InternalStringBuilder to append the a... | [
"This",
"method",
"will",
"append",
"an",
"attribute",
"value",
"to",
"a",
"InternalStringBuilder",
".",
"The",
"method",
"assumes",
"that",
"the",
"attr",
"is",
"not",
"<code",
">",
"null<",
"/",
"code",
">",
".",
"If",
"the",
"<code",
">",
"value<",
"/... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/rendering/TagRenderingBase.java#L182-L196 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/node/NPM.java | NPM.getVersionFromNPM | public static String getVersionFromNPM(File npmDirectory, Log log) {
"""
Utility method to extract the version from a NPM by reading its 'package.json' file.
@param npmDirectory the directory in which the NPM is installed
@param log the logger object
@return the read version, "0.0.0" if there are not... | java | public static String getVersionFromNPM(File npmDirectory, Log log) {
File packageFile = new File(npmDirectory, PACKAGE_JSON);
if (!packageFile.isFile()) {
return "0.0.0";
}
FileReader reader = null;
try {
reader = new FileReader(packageFile); //NOSONAR
... | [
"public",
"static",
"String",
"getVersionFromNPM",
"(",
"File",
"npmDirectory",
",",
"Log",
"log",
")",
"{",
"File",
"packageFile",
"=",
"new",
"File",
"(",
"npmDirectory",
",",
"PACKAGE_JSON",
")",
";",
"if",
"(",
"!",
"packageFile",
".",
"isFile",
"(",
"... | Utility method to extract the version from a NPM by reading its 'package.json' file.
@param npmDirectory the directory in which the NPM is installed
@param log the logger object
@return the read version, "0.0.0" if there are not 'package.json' file, {@code null} if this file cannot be
read or does not contain... | [
"Utility",
"method",
"to",
"extract",
"the",
"version",
"from",
"a",
"NPM",
"by",
"reading",
"its",
"package",
".",
"json",
"file",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/node/NPM.java#L371-L389 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java | ComputeNodesImpl.enableScheduling | public void enableScheduling(String poolId, String nodeId, ComputeNodeEnableSchedulingOptions computeNodeEnableSchedulingOptions) {
"""
Enables task scheduling on the specified compute node.
You can enable task scheduling on a node only if its current scheduling state is disabled.
@param poolId The ID of the p... | java | public void enableScheduling(String poolId, String nodeId, ComputeNodeEnableSchedulingOptions computeNodeEnableSchedulingOptions) {
enableSchedulingWithServiceResponseAsync(poolId, nodeId, computeNodeEnableSchedulingOptions).toBlocking().single().body();
} | [
"public",
"void",
"enableScheduling",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"ComputeNodeEnableSchedulingOptions",
"computeNodeEnableSchedulingOptions",
")",
"{",
"enableSchedulingWithServiceResponseAsync",
"(",
"poolId",
",",
"nodeId",
",",
"computeNodeEnable... | Enables task scheduling on the specified compute node.
You can enable task scheduling on a node only if its current scheduling state is disabled.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node on which you want to enable task scheduling.
@param computeNodeEnab... | [
"Enables",
"task",
"scheduling",
"on",
"the",
"specified",
"compute",
"node",
".",
"You",
"can",
"enable",
"task",
"scheduling",
"on",
"a",
"node",
"only",
"if",
"its",
"current",
"scheduling",
"state",
"is",
"disabled",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java#L1814-L1816 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java | CmsDefaultXmlContentHandler.initRelations | protected void initRelations(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException {
"""
Initializes the relation configuration for this content handler.<p>
OpenCms performs link checks for all OPTIONAL links defined in XML content values of type
OpenCmsVfsFile. However, for most proj... | java | protected void initRelations(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException {
Iterator<Element> i = CmsXmlGenericWrapper.elementIterator(root, APPINFO_RELATION);
while (i.hasNext()) {
// iterate all "checkrule" elements in the "checkrule" node
El... | [
"protected",
"void",
"initRelations",
"(",
"Element",
"root",
",",
"CmsXmlContentDefinition",
"contentDefinition",
")",
"throws",
"CmsXmlException",
"{",
"Iterator",
"<",
"Element",
">",
"i",
"=",
"CmsXmlGenericWrapper",
".",
"elementIterator",
"(",
"root",
",",
"AP... | Initializes the relation configuration for this content handler.<p>
OpenCms performs link checks for all OPTIONAL links defined in XML content values of type
OpenCmsVfsFile. However, for most projects in the real world a more fine-grained control
over the link check process is required. For these cases, individual rel... | [
"Initializes",
"the",
"relation",
"configuration",
"for",
"this",
"content",
"handler",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java#L2845-L2865 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ScriptBytecodeAdapter.java | ScriptBytecodeAdapter.getMethodPointer | public static Closure getMethodPointer(Object object, String methodName) {
"""
Returns the method pointer for the given object name
@param object the object containing the method
@param methodName the name of the method of interest
@return the resulting Closure
"""
return InvokerHelper.getMethodPo... | java | public static Closure getMethodPointer(Object object, String methodName) {
return InvokerHelper.getMethodPointer(object, methodName);
} | [
"public",
"static",
"Closure",
"getMethodPointer",
"(",
"Object",
"object",
",",
"String",
"methodName",
")",
"{",
"return",
"InvokerHelper",
".",
"getMethodPointer",
"(",
"object",
",",
"methodName",
")",
";",
"}"
] | Returns the method pointer for the given object name
@param object the object containing the method
@param methodName the name of the method of interest
@return the resulting Closure | [
"Returns",
"the",
"method",
"pointer",
"for",
"the",
"given",
"object",
"name"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ScriptBytecodeAdapter.java#L580-L582 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/circuit/MapTileCircuitModel.java | MapTileCircuitModel.updateTile | private void updateTile(Tile tile, Tile neighbor, Circuit circuit) {
"""
Update tile with new representation.
@param tile The tile placed.
@param neighbor The tile to update.
@param circuit The circuit to set.
"""
final Iterator<TileRef> iterator = getTiles(circuit).iterator();
while (it... | java | private void updateTile(Tile tile, Tile neighbor, Circuit circuit)
{
final Iterator<TileRef> iterator = getTiles(circuit).iterator();
while (iterator.hasNext())
{
final TileRef newTile = iterator.next();
if (mapGroup.getGroup(newTile).equals(mapGroup.getGroup(ti... | [
"private",
"void",
"updateTile",
"(",
"Tile",
"tile",
",",
"Tile",
"neighbor",
",",
"Circuit",
"circuit",
")",
"{",
"final",
"Iterator",
"<",
"TileRef",
">",
"iterator",
"=",
"getTiles",
"(",
"circuit",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
... | Update tile with new representation.
@param tile The tile placed.
@param neighbor The tile to update.
@param circuit The circuit to set. | [
"Update",
"tile",
"with",
"new",
"representation",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/circuit/MapTileCircuitModel.java#L156-L168 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java | Wikipedia.getDiscussionPage | public Page getDiscussionPage(Page articlePage) throws WikiApiException {
"""
Gets the discussion page for the given article page
The provided page must not be a discussion page
@param articlePage the article page for which a discussion page should be retrieved
@return The discussion page object for the given... | java | public Page getDiscussionPage(Page articlePage) throws WikiApiException{
String articleTitle = articlePage.getTitle().toString();
if(articleTitle.startsWith(WikiConstants.DISCUSSION_PREFIX)){
return articlePage;
}else{
return new Page(this, WikiConstants.DISCUSSION_PREFIX+articleTitle);
... | [
"public",
"Page",
"getDiscussionPage",
"(",
"Page",
"articlePage",
")",
"throws",
"WikiApiException",
"{",
"String",
"articleTitle",
"=",
"articlePage",
".",
"getTitle",
"(",
")",
".",
"toString",
"(",
")",
";",
"if",
"(",
"articleTitle",
".",
"startsWith",
"(... | Gets the discussion page for the given article page
The provided page must not be a discussion page
@param articlePage the article page for which a discussion page should be retrieved
@return The discussion page object for the given article page object
@throws WikiApiException If no page or redirect with this title ex... | [
"Gets",
"the",
"discussion",
"page",
"for",
"the",
"given",
"article",
"page",
"The",
"provided",
"page",
"must",
"not",
"be",
"a",
"discussion",
"page"
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java#L303-L310 |
mikepenz/FastAdapter | library-core/src/main/java/com/mikepenz/fastadapter/adapters/ModelAdapter.java | ModelAdapter.removeByIdentifier | public ModelAdapter<Model, Item> removeByIdentifier(final long identifier) {
"""
remvoes an item by it's identifier
@param identifier the identifier to search for
@return this
"""
recursive(new AdapterPredicate<Item>() {
@Override
public boolean apply(@NonNull IAdapter<Item>... | java | public ModelAdapter<Model, Item> removeByIdentifier(final long identifier) {
recursive(new AdapterPredicate<Item>() {
@Override
public boolean apply(@NonNull IAdapter<Item> lastParentAdapter, int lastParentPosition, Item item, int position) {
if (identifier == item.getIde... | [
"public",
"ModelAdapter",
"<",
"Model",
",",
"Item",
">",
"removeByIdentifier",
"(",
"final",
"long",
"identifier",
")",
"{",
"recursive",
"(",
"new",
"AdapterPredicate",
"<",
"Item",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"apply",
"(",
... | remvoes an item by it's identifier
@param identifier the identifier to search for
@return this | [
"remvoes",
"an",
"item",
"by",
"it",
"s",
"identifier"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/adapters/ModelAdapter.java#L515-L539 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/SpecializedOps_DDRM.java | SpecializedOps_DDRM.subvector | public static void subvector(DMatrix1Row A, int rowA, int colA, int length , boolean row, int offsetV, DMatrix1Row v) {
"""
<p>
Extracts a row or column vector from matrix A. The first element in the matrix is at element (rowA,colA).
The next 'length' elements are extracted along a row or column. The results a... | java | public static void subvector(DMatrix1Row A, int rowA, int colA, int length , boolean row, int offsetV, DMatrix1Row v) {
if( row ) {
for( int i = 0; i < length; i++ ) {
v.set( offsetV +i , A.get(rowA,colA+i) );
}
} else {
for( int i = 0; i < length; i++... | [
"public",
"static",
"void",
"subvector",
"(",
"DMatrix1Row",
"A",
",",
"int",
"rowA",
",",
"int",
"colA",
",",
"int",
"length",
",",
"boolean",
"row",
",",
"int",
"offsetV",
",",
"DMatrix1Row",
"v",
")",
"{",
"if",
"(",
"row",
")",
"{",
"for",
"(",
... | <p>
Extracts a row or column vector from matrix A. The first element in the matrix is at element (rowA,colA).
The next 'length' elements are extracted along a row or column. The results are put into vector 'v'
start at its element v0.
</p>
@param A Matrix that the vector is being extracted from. Not modified.
@para... | [
"<p",
">",
"Extracts",
"a",
"row",
"or",
"column",
"vector",
"from",
"matrix",
"A",
".",
"The",
"first",
"element",
"in",
"the",
"matrix",
"is",
"at",
"element",
"(",
"rowA",
"colA",
")",
".",
"The",
"next",
"length",
"elements",
"are",
"extracted",
"a... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/SpecializedOps_DDRM.java#L320-L330 |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java | HtmlBuilder.openTagClass | public static String openTagClass(String tag, String clazz, String... content) {
"""
Build a String containing a HTML opening tag with given CSS class and concatenates the given content.
Content should contain no HTML, because it is prepared with {@link #htmlEncode(String)}.
@param tag String name of HTML tag
... | java | public static String openTagClass(String tag, String clazz, String... content) {
return openTag(tag, clazz, null, content);
} | [
"public",
"static",
"String",
"openTagClass",
"(",
"String",
"tag",
",",
"String",
"clazz",
",",
"String",
"...",
"content",
")",
"{",
"return",
"openTag",
"(",
"tag",
",",
"clazz",
",",
"null",
",",
"content",
")",
";",
"}"
] | Build a String containing a HTML opening tag with given CSS class and concatenates the given content.
Content should contain no HTML, because it is prepared with {@link #htmlEncode(String)}.
@param tag String name of HTML tag
@param clazz CSS class of the tag
@param content content string
@return HTML tag element as s... | [
"Build",
"a",
"String",
"containing",
"a",
"HTML",
"opening",
"tag",
"with",
"given",
"CSS",
"class",
"and",
"concatenates",
"the",
"given",
"content",
".",
"Content",
"should",
"contain",
"no",
"HTML",
"because",
"it",
"is",
"prepared",
"with",
"{",
"@link"... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L376-L378 |
twilio/twilio-java | src/main/java/com/twilio/rest/serverless/v1/service/environment/VariableReader.java | VariableReader.nextPage | @Override
public Page<Variable> nextPage(final Page<Variable> page,
final TwilioRestClient client) {
"""
Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Next Page
"""
... | java | @Override
public Page<Variable> nextPage(final Page<Variable> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getNextPageUrl(
Domains.SERVERLESS.toString(),
client.getRegion... | [
"@",
"Override",
"public",
"Page",
"<",
"Variable",
">",
"nextPage",
"(",
"final",
"Page",
"<",
"Variable",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET",
",",
... | Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Next Page | [
"Retrieve",
"the",
"next",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/serverless/v1/service/environment/VariableReader.java#L99-L110 |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java | AuthenticationAPIClient.delegationWithRefreshToken | @SuppressWarnings("WeakerAccess")
public DelegationRequest<Delegation> delegationWithRefreshToken(@NonNull String refreshToken) {
"""
Performs a <a href="https://auth0.com/docs/api/authentication#delegation">delegation</a> request that will yield a new Auth0 'id_token'.
Check our <a href="https://auth0.com/do... | java | @SuppressWarnings("WeakerAccess")
public DelegationRequest<Delegation> delegationWithRefreshToken(@NonNull String refreshToken) {
ParameterizableRequest<Delegation, AuthenticationException> request = delegation(Delegation.class)
.addParameter(ParameterBuilder.REFRESH_TOKEN_KEY, refreshToken)... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"DelegationRequest",
"<",
"Delegation",
">",
"delegationWithRefreshToken",
"(",
"@",
"NonNull",
"String",
"refreshToken",
")",
"{",
"ParameterizableRequest",
"<",
"Delegation",
",",
"AuthenticationException"... | Performs a <a href="https://auth0.com/docs/api/authentication#delegation">delegation</a> request that will yield a new Auth0 'id_token'.
Check our <a href="https://auth0.com/docs/refresh-token">refresh token</a> docs for more information
Example usage:
<pre>
{@code
client.delegationWithRefreshToken("{refresh token}")
.... | [
"Performs",
"a",
"<a",
"href",
"=",
"https",
":",
"//",
"auth0",
".",
"com",
"/",
"docs",
"/",
"api",
"/",
"authentication#delegation",
">",
"delegation<",
"/",
"a",
">",
"request",
"that",
"will",
"yield",
"a",
"new",
"Auth0",
"id_token",
".",
"Check",
... | train | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java#L792-L799 |
hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/function/Actions.java | Actions.toFunc | public static <T1, T2, T3, R> Func3<T1, T2, T3, R> toFunc(final Action3<T1, T2, T3> action, final R result) {
"""
Converts an {@link Action3} to a function that calls the action and returns a specified value.
@param action the {@link Action3} to convert
@param result the value to return from the function call
... | java | public static <T1, T2, T3, R> Func3<T1, T2, T3, R> toFunc(final Action3<T1, T2, T3> action, final R result) {
return new Func3<T1, T2, T3, R>() {
@Override
public R call(T1 t1, T2 t2, T3 t3) {
action.call(t1, t2, t3);
return result;
}
}... | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"Func3",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"toFunc",
"(",
"final",
"Action3",
"<",
"T1",
",",
"T2",
",",
"T3",
">",
"action",
",",
"final",
"R",
"result",
")",
... | Converts an {@link Action3} to a function that calls the action and returns a specified value.
@param action the {@link Action3} to convert
@param result the value to return from the function call
@return a {@link Func3} that calls {@code action} and returns {@code result} | [
"Converts",
"an",
"{",
"@link",
"Action3",
"}",
"to",
"a",
"function",
"that",
"calls",
"the",
"action",
"and",
"returns",
"a",
"specified",
"value",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/function/Actions.java#L253-L261 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getUploadNewVersionRequest | public BoxRequestsFile.UploadNewVersion getUploadNewVersionRequest(InputStream fileInputStream, String destinationFileId) {
"""
Gets a request that uploads a new file version from an input stream
@param fileInputStream input stream of the new file version
@param destinationFileId id of the file to upload a n... | java | public BoxRequestsFile.UploadNewVersion getUploadNewVersionRequest(InputStream fileInputStream, String destinationFileId){
BoxRequestsFile.UploadNewVersion request = new BoxRequestsFile.UploadNewVersion(fileInputStream, getFileUploadNewVersionUrl(destinationFileId), mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"UploadNewVersion",
"getUploadNewVersionRequest",
"(",
"InputStream",
"fileInputStream",
",",
"String",
"destinationFileId",
")",
"{",
"BoxRequestsFile",
".",
"UploadNewVersion",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"UploadNewVers... | Gets a request that uploads a new file version from an input stream
@param fileInputStream input stream of the new file version
@param destinationFileId id of the file to upload a new version of
@return request to upload a new file version from an input stream | [
"Gets",
"a",
"request",
"that",
"uploads",
"a",
"new",
"file",
"version",
"from",
"an",
"input",
"stream"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L336-L339 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/util/XpathUtils.java | XpathUtils.asByte | public static Byte asByte(String expression, Node node)
throws XPathExpressionException {
"""
Evaluates the specified XPath expression and returns the result as a
Byte.
<p>
This method can be expensive as a new xpath is instantiated per
invocation. Consider passing in the xpath explicitly via {
{@... | java | public static Byte asByte(String expression, Node node)
throws XPathExpressionException {
return asByte(expression, node, xpath());
} | [
"public",
"static",
"Byte",
"asByte",
"(",
"String",
"expression",
",",
"Node",
"node",
")",
"throws",
"XPathExpressionException",
"{",
"return",
"asByte",
"(",
"expression",
",",
"node",
",",
"xpath",
"(",
")",
")",
";",
"}"
] | Evaluates the specified XPath expression and returns the result as a
Byte.
<p>
This method can be expensive as a new xpath is instantiated per
invocation. Consider passing in the xpath explicitly via {
{@link #asDouble(String, Node, XPath)} instead. Note {@link XPath} is
not thread-safe and not reentrant.
@param expr... | [
"Evaluates",
"the",
"specified",
"XPath",
"expression",
"and",
"returns",
"the",
"result",
"as",
"a",
"Byte",
".",
"<p",
">",
"This",
"method",
"can",
"be",
"expensive",
"as",
"a",
"new",
"xpath",
"is",
"instantiated",
"per",
"invocation",
".",
"Consider",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/XpathUtils.java#L417-L420 |
sriharshachilakapati/WebGL4J | webgl4j/src/main/java/com/shc/webgl4j/client/WebGL10.java | WebGL10.glBindFramebuffer | public static void glBindFramebuffer(int target, int frameBuffer) {
"""
<p>{@code glBindFramebuffer} binds the framebuffer object with name framebuffer to the framebuffer target
specified by target. target must be {@link #GL_FRAMEBUFFER}. If a framebuffer object is bound, it becomes the
target for rendering or r... | java | public static void glBindFramebuffer(int target, int frameBuffer)
{
checkContextCompatibility();
nglBindFramebuffer(target, WebGLObjectMap.get().toFramebuffer(frameBuffer));
} | [
"public",
"static",
"void",
"glBindFramebuffer",
"(",
"int",
"target",
",",
"int",
"frameBuffer",
")",
"{",
"checkContextCompatibility",
"(",
")",
";",
"nglBindFramebuffer",
"(",
"target",
",",
"WebGLObjectMap",
".",
"get",
"(",
")",
".",
"toFramebuffer",
"(",
... | <p>{@code glBindFramebuffer} binds the framebuffer object with name framebuffer to the framebuffer target
specified by target. target must be {@link #GL_FRAMEBUFFER}. If a framebuffer object is bound, it becomes the
target for rendering or readback operations, respectively, until it is deleted or another framebuffer is... | [
"<p",
">",
"{",
"@code",
"glBindFramebuffer",
"}",
"binds",
"the",
"framebuffer",
"object",
"with",
"name",
"framebuffer",
"to",
"the",
"framebuffer",
"target",
"specified",
"by",
"target",
".",
"target",
"must",
"be",
"{",
"@link",
"#GL_FRAMEBUFFER",
"}",
"."... | train | https://github.com/sriharshachilakapati/WebGL4J/blob/7daa425300b08b338b50cef2935289849c92d415/webgl4j/src/main/java/com/shc/webgl4j/client/WebGL10.java#L597-L601 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/RunnableUtils.java | RunnableUtils.runWithSleepUninterrupted | public static boolean runWithSleepUninterrupted(long milliseconds, Runnable runnable) {
"""
Runs the given {@link Runnable} object and then causes the current, calling {@link Thread} to sleep
for the given number of milliseconds.
This utility method sleeps uninterrupted, resetting the interrupt bit if the curr... | java | public static boolean runWithSleepUninterrupted(long milliseconds, Runnable runnable) {
Assert.isTrue(milliseconds > 0, "Milliseconds [%d] must be greater than 0", milliseconds);
runnable.run();
return safeSleep(milliseconds);
} | [
"public",
"static",
"boolean",
"runWithSleepUninterrupted",
"(",
"long",
"milliseconds",
",",
"Runnable",
"runnable",
")",
"{",
"Assert",
".",
"isTrue",
"(",
"milliseconds",
">",
"0",
",",
"\"Milliseconds [%d] must be greater than 0\"",
",",
"milliseconds",
")",
";",
... | Runs the given {@link Runnable} object and then causes the current, calling {@link Thread} to sleep
for the given number of milliseconds.
This utility method sleeps uninterrupted, resetting the interrupt bit if the current, calling {@link Thread}
is interrupted during sleep.
This utility method can be used to simulat... | [
"Runs",
"the",
"given",
"{",
"@link",
"Runnable",
"}",
"object",
"and",
"then",
"causes",
"the",
"current",
"calling",
"{",
"@link",
"Thread",
"}",
"to",
"sleep",
"for",
"the",
"given",
"number",
"of",
"milliseconds",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/RunnableUtils.java#L104-L111 |
LearnLib/automatalib | visualization/dot-visualizer/src/main/java/net/automatalib/visualization/dot/DOT.java | DOT.renderDOT | public static void renderDOT(File dotFile, boolean modal) throws IOException {
"""
Renders a GraphVIZ description from a string and displays it in a Swing window. Convenience method, see {@link
#renderDOT(Reader, boolean)}.
@throws FileNotFoundException
if opening the file resulted in errors.
"""
... | java | public static void renderDOT(File dotFile, boolean modal) throws IOException {
renderDOT(IOUtil.asBufferedUTF8Reader(dotFile), modal);
} | [
"public",
"static",
"void",
"renderDOT",
"(",
"File",
"dotFile",
",",
"boolean",
"modal",
")",
"throws",
"IOException",
"{",
"renderDOT",
"(",
"IOUtil",
".",
"asBufferedUTF8Reader",
"(",
"dotFile",
")",
",",
"modal",
")",
";",
"}"
] | Renders a GraphVIZ description from a string and displays it in a Swing window. Convenience method, see {@link
#renderDOT(Reader, boolean)}.
@throws FileNotFoundException
if opening the file resulted in errors. | [
"Renders",
"a",
"GraphVIZ",
"description",
"from",
"a",
"string",
"and",
"displays",
"it",
"in",
"a",
"Swing",
"window",
".",
"Convenience",
"method",
"see",
"{",
"@link",
"#renderDOT",
"(",
"Reader",
"boolean",
")",
"}",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/visualization/dot-visualizer/src/main/java/net/automatalib/visualization/dot/DOT.java#L240-L242 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/StatementManager.java | StatementManager.getStatementID | private long getStatementID(HsqlName schema, String sql) {
"""
Retrieves the registered compiled statement identifier associated with
the specified SQL String, or a value less than zero, if no such
statement has been registered.
@param schema the schema id
@param sql the SQL String
@return the compiled stat... | java | private long getStatementID(HsqlName schema, String sql) {
LongValueHashMap sqlMap =
(LongValueHashMap) schemaMap.get(schema.hashCode());
if (sqlMap == null) {
return -1;
}
return sqlMap.get(sql, -1);
} | [
"private",
"long",
"getStatementID",
"(",
"HsqlName",
"schema",
",",
"String",
"sql",
")",
"{",
"LongValueHashMap",
"sqlMap",
"=",
"(",
"LongValueHashMap",
")",
"schemaMap",
".",
"get",
"(",
"schema",
".",
"hashCode",
"(",
")",
")",
";",
"if",
"(",
"sqlMap... | Retrieves the registered compiled statement identifier associated with
the specified SQL String, or a value less than zero, if no such
statement has been registered.
@param schema the schema id
@param sql the SQL String
@return the compiled statement identifier associated with the
specified SQL String | [
"Retrieves",
"the",
"registered",
"compiled",
"statement",
"identifier",
"associated",
"with",
"the",
"specified",
"SQL",
"String",
"or",
"a",
"value",
"less",
"than",
"zero",
"if",
"no",
"such",
"statement",
"has",
"been",
"registered",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/StatementManager.java#L177-L187 |
apache/flink | flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBOperationUtils.java | RocksDBOperationUtils.createColumnFamilyDescriptor | public static ColumnFamilyDescriptor createColumnFamilyDescriptor(
RegisteredStateMetaInfoBase metaInfoBase,
Function<String, ColumnFamilyOptions> columnFamilyOptionsFactory,
@Nullable RocksDbTtlCompactFiltersManager ttlCompactFiltersManager) {
"""
Creates a column descriptor for sate column family.
<p>Se... | java | public static ColumnFamilyDescriptor createColumnFamilyDescriptor(
RegisteredStateMetaInfoBase metaInfoBase,
Function<String, ColumnFamilyOptions> columnFamilyOptionsFactory,
@Nullable RocksDbTtlCompactFiltersManager ttlCompactFiltersManager) {
ColumnFamilyOptions options = createColumnFamilyOptions(columnFami... | [
"public",
"static",
"ColumnFamilyDescriptor",
"createColumnFamilyDescriptor",
"(",
"RegisteredStateMetaInfoBase",
"metaInfoBase",
",",
"Function",
"<",
"String",
",",
"ColumnFamilyOptions",
">",
"columnFamilyOptionsFactory",
",",
"@",
"Nullable",
"RocksDbTtlCompactFiltersManager"... | Creates a column descriptor for sate column family.
<p>Sets TTL compaction filter if {@code ttlCompactFiltersManager} is not {@code null}. | [
"Creates",
"a",
"column",
"descriptor",
"for",
"sate",
"column",
"family",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBOperationUtils.java#L125-L139 |
hdbeukel/james-core | src/main/java/org/jamesframework/core/subset/neigh/adv/DisjointMultiAdditionNeighbourhood.java | DisjointMultiAdditionNeighbourhood.numAdditions | private int numAdditions(Set<Integer> addCandidates, SubsetSolution sol) {
"""
Computes the number of additions that are to be performed, given the set of add candidates
and the current subset solution. Takes into account the desired number of additions \(k\)
specified at construction, the number of currently un... | java | private int numAdditions(Set<Integer> addCandidates, SubsetSolution sol){
int a = Math.min(numAdditions, Math.min(addCandidates.size(), maxSubsetSize-sol.getNumSelectedIDs()));
return Math.max(a, 0);
} | [
"private",
"int",
"numAdditions",
"(",
"Set",
"<",
"Integer",
">",
"addCandidates",
",",
"SubsetSolution",
"sol",
")",
"{",
"int",
"a",
"=",
"Math",
".",
"min",
"(",
"numAdditions",
",",
"Math",
".",
"min",
"(",
"addCandidates",
".",
"size",
"(",
")",
... | Computes the number of additions that are to be performed, given the set of add candidates
and the current subset solution. Takes into account the desired number of additions \(k\)
specified at construction, the number of currently unselected non-fixed items and the maximum
allowed subset size (if any).
@param addCand... | [
"Computes",
"the",
"number",
"of",
"additions",
"that",
"are",
"to",
"be",
"performed",
"given",
"the",
"set",
"of",
"add",
"candidates",
"and",
"the",
"current",
"subset",
"solution",
".",
"Takes",
"into",
"account",
"the",
"desired",
"number",
"of",
"addit... | train | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/subset/neigh/adv/DisjointMultiAdditionNeighbourhood.java#L210-L213 |
threerings/narya | core/src/main/java/com/threerings/crowd/client/LocationDirector.java | LocationDirector.subscribeToPlace | protected void subscribeToPlace () {
"""
Subscribe to the PlaceObject identified by _placeId and
call {@link #gotPlaceObject} with the result.
"""
_subber = new SafeSubscriber<PlaceObject>(_placeId, new Subscriber<PlaceObject>() {
public void objectAvailable (PlaceObject object) {
... | java | protected void subscribeToPlace ()
{
_subber = new SafeSubscriber<PlaceObject>(_placeId, new Subscriber<PlaceObject>() {
public void objectAvailable (PlaceObject object) {
gotPlaceObject(object);
}
public void requestFailed (int oid, ObjectAccessException ... | [
"protected",
"void",
"subscribeToPlace",
"(",
")",
"{",
"_subber",
"=",
"new",
"SafeSubscriber",
"<",
"PlaceObject",
">",
"(",
"_placeId",
",",
"new",
"Subscriber",
"<",
"PlaceObject",
">",
"(",
")",
"{",
"public",
"void",
"objectAvailable",
"(",
"PlaceObject"... | Subscribe to the PlaceObject identified by _placeId and
call {@link #gotPlaceObject} with the result. | [
"Subscribe",
"to",
"the",
"PlaceObject",
"identified",
"by",
"_placeId",
"and",
"call",
"{"
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/LocationDirector.java#L442-L460 |
undera/jmeter-plugins | infra/common/src/main/java/kg/apc/jmeter/JMeterPluginsUtils.java | JMeterPluginsUtils.addHelpLinkToPanel | public static Component addHelpLinkToPanel(Container panel, String helpPage) {
"""
Find in panel appropriate place and put hyperlink there. I know that it
is stupid way. But the result is so good!
@param panel - supposed to be result of makeTitlePanel()
@param helpPage wiki page name, or full URL in case o... | java | public static Component addHelpLinkToPanel(Container panel, String helpPage) {
if (!java.awt.Desktop.isDesktopSupported()) {
return panel;
}
JLabel icon = new JLabel();
icon.setIcon(new javax.swing.ImageIcon(JMeterPluginsUtils.class.getResource("vizualizers/information.png"))... | [
"public",
"static",
"Component",
"addHelpLinkToPanel",
"(",
"Container",
"panel",
",",
"String",
"helpPage",
")",
"{",
"if",
"(",
"!",
"java",
".",
"awt",
".",
"Desktop",
".",
"isDesktopSupported",
"(",
")",
")",
"{",
"return",
"panel",
";",
"}",
"JLabel",... | Find in panel appropriate place and put hyperlink there. I know that it
is stupid way. But the result is so good!
@param panel - supposed to be result of makeTitlePanel()
@param helpPage wiki page name, or full URL in case of external wiki
@return original panel
@see AbstractJMeterGuiComponent | [
"Find",
"in",
"panel",
"appropriate",
"place",
"and",
"put",
"hyperlink",
"there",
".",
"I",
"know",
"that",
"it",
"is",
"stupid",
"way",
".",
"But",
"the",
"result",
"is",
"so",
"good!"
] | train | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/infra/common/src/main/java/kg/apc/jmeter/JMeterPluginsUtils.java#L200-L251 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/parametrics/relatedsamples/PearsonCorrelation.java | PearsonCorrelation.scoreToPvalue | private static double scoreToPvalue(double score, int n) {
"""
Returns the Pvalue for a particular score
@param score
@param n
@return
"""
double T= score/Math.sqrt((1-score*score)/(n-2));
return ContinuousDistributions.studentsCdf(T, n-2);
} | java | private static double scoreToPvalue(double score, int n) {
double T= score/Math.sqrt((1-score*score)/(n-2));
return ContinuousDistributions.studentsCdf(T, n-2);
} | [
"private",
"static",
"double",
"scoreToPvalue",
"(",
"double",
"score",
",",
"int",
"n",
")",
"{",
"double",
"T",
"=",
"score",
"/",
"Math",
".",
"sqrt",
"(",
"(",
"1",
"-",
"score",
"*",
"score",
")",
"/",
"(",
"n",
"-",
"2",
")",
")",
";",
"r... | Returns the Pvalue for a particular score
@param score
@param n
@return | [
"Returns",
"the",
"Pvalue",
"for",
"a",
"particular",
"score"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/parametrics/relatedsamples/PearsonCorrelation.java#L101-L104 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/xml/AnnotationReader.java | AnnotationReader.hasAnnotation | public <A extends Annotation> boolean hasAnnotation(final Field field, final Class<A> annClass) {
"""
フィールドに付与されたアノテーションを持つか判定します。
@since 2.0
@param field 判定対象のフィールド
@param annClass アノテーションのタイプ
@return trueの場合、アノテーションを持ちます。
"""
return getAnnotation(field, annClass) != null;
} | java | public <A extends Annotation> boolean hasAnnotation(final Field field, final Class<A> annClass) {
return getAnnotation(field, annClass) != null;
} | [
"public",
"<",
"A",
"extends",
"Annotation",
">",
"boolean",
"hasAnnotation",
"(",
"final",
"Field",
"field",
",",
"final",
"Class",
"<",
"A",
">",
"annClass",
")",
"{",
"return",
"getAnnotation",
"(",
"field",
",",
"annClass",
")",
"!=",
"null",
";",
"}... | フィールドに付与されたアノテーションを持つか判定します。
@since 2.0
@param field 判定対象のフィールド
@param annClass アノテーションのタイプ
@return trueの場合、アノテーションを持ちます。 | [
"フィールドに付与されたアノテーションを持つか判定します。"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/xml/AnnotationReader.java#L225-L227 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcher.java | ConsumerDispatcher.eventPostCommitAdd | protected void eventPostCommitAdd(SIMPMessage msg, TransactionCommon transaction)
throws SIDiscriminatorSyntaxException, SIResourceException {
"""
Called when a message receives an eventCommittedAdd from the messageStore. i.e.
a message has been transactionally committed after being put in the... | java | protected void eventPostCommitAdd(SIMPMessage msg, TransactionCommon transaction)
throws SIDiscriminatorSyntaxException, SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "eventPostCommitAdd", new Object[] { msg, transactio... | [
"protected",
"void",
"eventPostCommitAdd",
"(",
"SIMPMessage",
"msg",
",",
"TransactionCommon",
"transaction",
")",
"throws",
"SIDiscriminatorSyntaxException",
",",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc"... | Called when a message receives an eventCommittedAdd from the messageStore. i.e.
a message has been transactionally committed after being put in the messageStore.
@param msg The message which has been committed
@param transaction The transaction used to commit the message
@throws SIStoreException Thrown if there is ANY... | [
"Called",
"when",
"a",
"message",
"receives",
"an",
"eventCommittedAdd",
"from",
"the",
"messageStore",
".",
"i",
".",
"e",
".",
"a",
"message",
"has",
"been",
"transactionally",
"committed",
"after",
"being",
"put",
"in",
"the",
"messageStore",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcher.java#L2350-L2362 |
roboconf/roboconf-platform | core/roboconf-target-iaas-openstack/src/main/java/net/roboconf/target/openstack/internal/OpenstackIaasHandler.java | OpenstackIaasHandler.expandVolumeName | static String expandVolumeName( String nameTemplate, String appName, String instanceName ) {
"""
Updates a volume name by replacing template variables.
@param nameTemplate (not null)
@param appName (not null)
@param instanceName (not null)
@return a non-null string
"""
String name = nameTemplate.replace... | java | static String expandVolumeName( String nameTemplate, String appName, String instanceName ) {
String name = nameTemplate.replace( TPL_VOLUME_NAME, instanceName );
name = name.replace( TPL_VOLUME_APP, appName );
name = name.replaceAll( "[\\W_-]", "-" );
return name;
} | [
"static",
"String",
"expandVolumeName",
"(",
"String",
"nameTemplate",
",",
"String",
"appName",
",",
"String",
"instanceName",
")",
"{",
"String",
"name",
"=",
"nameTemplate",
".",
"replace",
"(",
"TPL_VOLUME_NAME",
",",
"instanceName",
")",
";",
"name",
"=",
... | Updates a volume name by replacing template variables.
@param nameTemplate (not null)
@param appName (not null)
@param instanceName (not null)
@return a non-null string | [
"Updates",
"a",
"volume",
"name",
"by",
"replacing",
"template",
"variables",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-openstack/src/main/java/net/roboconf/target/openstack/internal/OpenstackIaasHandler.java#L532-L539 |
openbase/jul | extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/MultiLanguageTextProcessor.java | MultiLanguageTextProcessor.generateMultiLanguageTextBuilder | public static MultiLanguageText.Builder generateMultiLanguageTextBuilder(final Locale locale, final String multiLanguageText) {
"""
Create a new multiLanguageTextBuilder and register multiLanguageText with given locale.
@param locale the locale from which the language code is extracted for which the multiL... | java | public static MultiLanguageText.Builder generateMultiLanguageTextBuilder(final Locale locale, final String multiLanguageText) {
return addMultiLanguageText(MultiLanguageText.newBuilder(), locale.getLanguage(), multiLanguageText);
} | [
"public",
"static",
"MultiLanguageText",
".",
"Builder",
"generateMultiLanguageTextBuilder",
"(",
"final",
"Locale",
"locale",
",",
"final",
"String",
"multiLanguageText",
")",
"{",
"return",
"addMultiLanguageText",
"(",
"MultiLanguageText",
".",
"newBuilder",
"(",
")",... | Create a new multiLanguageTextBuilder and register multiLanguageText with given locale.
@param locale the locale from which the language code is extracted for which the multiLanguageText is added
@param multiLanguageText the multiLanguageText to be added
@return the updated multiLanguageText builder | [
"Create",
"a",
"new",
"multiLanguageTextBuilder",
"and",
"register",
"multiLanguageText",
"with",
"given",
"locale",
"."
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/MultiLanguageTextProcessor.java#L82-L84 |
JDBDT/jdbdt | src/main/java/org/jdbdt/JDBDT.java | JDBDT.assertTableDoesNotExist | public static void assertTableDoesNotExist(DB db, String tableName) throws DBAssertionError {
"""
Assert that table does not exist in a database.
@param db Database.
@param tableName Table name.
@throws DBAssertionError If the assertion fails.
@see #assertTableExists(DB,String)
@see #drop(Table)
"""
... | java | public static void assertTableDoesNotExist(DB db, String tableName) throws DBAssertionError {
DBAssert.assertTableExistence(CallInfo.create(), db, tableName, false);
} | [
"public",
"static",
"void",
"assertTableDoesNotExist",
"(",
"DB",
"db",
",",
"String",
"tableName",
")",
"throws",
"DBAssertionError",
"{",
"DBAssert",
".",
"assertTableExistence",
"(",
"CallInfo",
".",
"create",
"(",
")",
",",
"db",
",",
"tableName",
",",
"fa... | Assert that table does not exist in a database.
@param db Database.
@param tableName Table name.
@throws DBAssertionError If the assertion fails.
@see #assertTableExists(DB,String)
@see #drop(Table) | [
"Assert",
"that",
"table",
"does",
"not",
"exist",
"in",
"a",
"database",
"."
] | train | https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/JDBDT.java#L766-L768 |
acromusashi/acromusashi-stream-ml | src/main/java/acromusashi/stream/ml/anomaly/lof/LofCalculator.java | LofCalculator.calculateLrd | protected static double calculateLrd(LofPoint basePoint, LofDataSet dataSet) {
"""
basePointに対する局所到達可能密度(Local reachability density)を算出する。
@param basePoint 算出元対象点
@param dataSet 全体データ
@return 局所到達可能密度
"""
int countedData = 0;
double totalAmount = 0.0d;
for (String targetDataId : b... | java | protected static double calculateLrd(LofPoint basePoint, LofDataSet dataSet)
{
int countedData = 0;
double totalAmount = 0.0d;
for (String targetDataId : basePoint.getkDistanceNeighbor())
{
LofPoint targetPoint = dataSet.getDataMap().get(targetDataId);
if (t... | [
"protected",
"static",
"double",
"calculateLrd",
"(",
"LofPoint",
"basePoint",
",",
"LofDataSet",
"dataSet",
")",
"{",
"int",
"countedData",
"=",
"0",
";",
"double",
"totalAmount",
"=",
"0.0d",
";",
"for",
"(",
"String",
"targetDataId",
":",
"basePoint",
".",
... | basePointに対する局所到達可能密度(Local reachability density)を算出する。
@param basePoint 算出元対象点
@param dataSet 全体データ
@return 局所到達可能密度 | [
"basePointに対する局所到達可能密度",
"(",
"Local",
"reachability",
"density",
")",
"を算出する。"
] | train | https://github.com/acromusashi/acromusashi-stream-ml/blob/26d6799a917cacda68e21d506c75cfeb17d832a6/src/main/java/acromusashi/stream/ml/anomaly/lof/LofCalculator.java#L381-L406 |
eserating/siren4j | src/main/java/com/google/code/siren4j/converter/ReflectingConverter.java | ReflectingConverter.annotationToLink | private Link annotationToLink(Siren4JLink linkAnno, EntityContext context) {
"""
Convert a link annotation to an actual link. The href will not be resolved in the instantiated link, this will need
to be post processed.
@param linkAnno assumed not <code>null</code>.
@return new link, never <code>null</code>.
... | java | private Link annotationToLink(Siren4JLink linkAnno, EntityContext context) {
LinkBuilder builder = LinkBuilder.newInstance().setRelationship(linkAnno.rel()).setHref(linkAnno.href());
if (StringUtils.isNotBlank(linkAnno.title())) {
builder.setTitle(linkAnno.title());
}
if... | [
"private",
"Link",
"annotationToLink",
"(",
"Siren4JLink",
"linkAnno",
",",
"EntityContext",
"context",
")",
"{",
"LinkBuilder",
"builder",
"=",
"LinkBuilder",
".",
"newInstance",
"(",
")",
".",
"setRelationship",
"(",
"linkAnno",
".",
"rel",
"(",
")",
")",
".... | Convert a link annotation to an actual link. The href will not be resolved in the instantiated link, this will need
to be post processed.
@param linkAnno assumed not <code>null</code>.
@return new link, never <code>null</code>. | [
"Convert",
"a",
"link",
"annotation",
"to",
"an",
"actual",
"link",
".",
"The",
"href",
"will",
"not",
"be",
"resolved",
"in",
"the",
"instantiated",
"link",
"this",
"will",
"need",
"to",
"be",
"post",
"processed",
"."
] | train | https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/converter/ReflectingConverter.java#L760-L769 |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java | UtilImageIO.loadPGM_U8 | public static GrayU8 loadPGM_U8(InputStream inputStream , GrayU8 storage ) throws IOException {
"""
Loads a PGM image from an {@link InputStream}.
@param inputStream InputStream for PGM image
@param storage (Optional) Storage for output image. Must be the width and height of the image being read.
If null a n... | java | public static GrayU8 loadPGM_U8(InputStream inputStream , GrayU8 storage ) throws IOException {
DataInputStream in = new DataInputStream(inputStream);
readLine(in);
String line = readLine(in);
while( line.charAt(0) == '#')
line = readLine(in);
String s[] = line.split(" ");
int w = Integer.parseInt(s[0])... | [
"public",
"static",
"GrayU8",
"loadPGM_U8",
"(",
"InputStream",
"inputStream",
",",
"GrayU8",
"storage",
")",
"throws",
"IOException",
"{",
"DataInputStream",
"in",
"=",
"new",
"DataInputStream",
"(",
"inputStream",
")",
";",
"readLine",
"(",
"in",
")",
";",
"... | Loads a PGM image from an {@link InputStream}.
@param inputStream InputStream for PGM image
@param storage (Optional) Storage for output image. Must be the width and height of the image being read.
If null a new image will be declared.
@return The read in image
@throws IOException Thrown if there is a problem reading... | [
"Loads",
"a",
"PGM",
"image",
"from",
"an",
"{",
"@link",
"InputStream",
"}",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java#L434-L452 |
VoltDB/voltdb | src/frontend/org/voltdb/planner/AbstractParsedStmt.java | AbstractParsedStmt.addSubqueryToStmtCache | protected StmtSubqueryScan addSubqueryToStmtCache(
AbstractParsedStmt subquery, String tableAlias) {
"""
Add a sub-query to the statement cache.
@param subquery
@param tableAlias
@return the cache entry
"""
assert(subquery != null);
// If there is no usable alias because the subq... | java | protected StmtSubqueryScan addSubqueryToStmtCache(
AbstractParsedStmt subquery, String tableAlias) {
assert(subquery != null);
// If there is no usable alias because the subquery is inside an expression,
// generate a unique one for internal use.
if (tableAlias == null) {
... | [
"protected",
"StmtSubqueryScan",
"addSubqueryToStmtCache",
"(",
"AbstractParsedStmt",
"subquery",
",",
"String",
"tableAlias",
")",
"{",
"assert",
"(",
"subquery",
"!=",
"null",
")",
";",
"// If there is no usable alias because the subquery is inside an expression,",
"// genera... | Add a sub-query to the statement cache.
@param subquery
@param tableAlias
@return the cache entry | [
"Add",
"a",
"sub",
"-",
"query",
"to",
"the",
"statement",
"cache",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/AbstractParsedStmt.java#L820-L833 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationFileUtil.java | ValidationFileUtil.sendFileToHttpServiceResponse | public static void sendFileToHttpServiceResponse(String fileName, Object bodyObj, HttpServletResponse res) {
"""
Send file to http service response.
@param fileName the file name
@param bodyObj the body obj
@param res the res
"""
if (fileName == null || bodyObj == null) {
return... | java | public static void sendFileToHttpServiceResponse(String fileName, Object bodyObj, HttpServletResponse res) {
if (fileName == null || bodyObj == null) {
return;
}
String body = null;
try {
body = ValidationObjUtil.getDefaultObjectMapper().writeValueAsString(bodyO... | [
"public",
"static",
"void",
"sendFileToHttpServiceResponse",
"(",
"String",
"fileName",
",",
"Object",
"bodyObj",
",",
"HttpServletResponse",
"res",
")",
"{",
"if",
"(",
"fileName",
"==",
"null",
"||",
"bodyObj",
"==",
"null",
")",
"{",
"return",
";",
"}",
"... | Send file to http service response.
@param fileName the file name
@param bodyObj the body obj
@param res the res | [
"Send",
"file",
"to",
"http",
"service",
"response",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationFileUtil.java#L133-L156 |
DDTH/ddth-kafka | src/main/java/com/github/ddth/kafka/internal/KafkaHelper.java | KafkaHelper.seekToBeginning | public static boolean seekToBeginning(KafkaConsumer<?, ?> consumer, String topic) {
"""
Seeks the consumer's cursor to the beginning of a topic.
<p>
This method only set cursors of topic's partitions that are assigned to
the consumer!
</p>
@param consumer
@param topic
@return {@code true} if the consume... | java | public static boolean seekToBeginning(KafkaConsumer<?, ?> consumer, String topic) {
boolean result = false;
synchronized (consumer) {
Set<TopicPartition> topicParts = consumer.assignment();
if (topicParts != null) {
for (TopicPartition tp : topicParts) {
... | [
"public",
"static",
"boolean",
"seekToBeginning",
"(",
"KafkaConsumer",
"<",
"?",
",",
"?",
">",
"consumer",
",",
"String",
"topic",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"synchronized",
"(",
"consumer",
")",
"{",
"Set",
"<",
"TopicPartition",
... | Seeks the consumer's cursor to the beginning of a topic.
<p>
This method only set cursors of topic's partitions that are assigned to
the consumer!
</p>
@param consumer
@param topic
@return {@code true} if the consumer has subscribed to the specified
topic, {@code false} otherwise. | [
"Seeks",
"the",
"consumer",
"s",
"cursor",
"to",
"the",
"beginning",
"of",
"a",
"topic",
"."
] | train | https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/internal/KafkaHelper.java#L72-L94 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceId.java | InstanceId.of | public static InstanceId of(String zone, String instance) {
"""
Returns an instance identity given the zone and instance names. The instance name must be 1-63
characters long and comply with RFC1035. Specifically, the name must match the regular
expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first... | java | public static InstanceId of(String zone, String instance) {
return new InstanceId(null, zone, instance);
} | [
"public",
"static",
"InstanceId",
"of",
"(",
"String",
"zone",
",",
"String",
"instance",
")",
"{",
"return",
"new",
"InstanceId",
"(",
"null",
",",
"zone",
",",
"instance",
")",
";",
"}"
] | Returns an instance identity given the zone and instance names. The instance name must be 1-63
characters long and comply with RFC1035. Specifically, the name must match the regular
expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a
lowercase letter, and all following characters mus... | [
"Returns",
"an",
"instance",
"identity",
"given",
"the",
"zone",
"and",
"instance",
"names",
".",
"The",
"instance",
"name",
"must",
"be",
"1",
"-",
"63",
"characters",
"long",
"and",
"comply",
"with",
"RFC1035",
".",
"Specifically",
"the",
"name",
"must",
... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceId.java#L140-L142 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/persist/HsqlDatabaseProperties.java | HsqlDatabaseProperties.setURLProperties | public void setURLProperties(HsqlProperties p) {
"""
overload file database properties with any passed on URL line
do not store password etc
"""
if (p != null) {
for (Enumeration e = p.propertyNames(); e.hasMoreElements(); ) {
String propertyName = (String) e.nextElement... | java | public void setURLProperties(HsqlProperties p) {
if (p != null) {
for (Enumeration e = p.propertyNames(); e.hasMoreElements(); ) {
String propertyName = (String) e.nextElement();
Object[] row = (Object[]) meta.get(propertyName);
if (row !=... | [
"public",
"void",
"setURLProperties",
"(",
"HsqlProperties",
"p",
")",
"{",
"if",
"(",
"p",
"!=",
"null",
")",
"{",
"for",
"(",
"Enumeration",
"e",
"=",
"p",
".",
"propertyNames",
"(",
")",
";",
"e",
".",
"hasMoreElements",
"(",
")",
";",
")",
"{",
... | overload file database properties with any passed on URL line
do not store password etc | [
"overload",
"file",
"database",
"properties",
"with",
"any",
"passed",
"on",
"URL",
"line",
"do",
"not",
"store",
"password",
"etc"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/HsqlDatabaseProperties.java#L551-L568 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java | SearchIndex.cloneDirectoryManager | protected DirectoryManager cloneDirectoryManager(DirectoryManager directoryManager, String suffix) throws IOException {
"""
Clone the default Index directory manager
@return an initialized {@link DirectoryManager}.
@throws IOException
if the directory manager cannot be instantiated or an
exception occurs while... | java | protected DirectoryManager cloneDirectoryManager(DirectoryManager directoryManager, String suffix) throws IOException
{
try
{
DirectoryManager df = directoryManager.getClass().newInstance();
df.init(this.path + suffix);
return df;
}
catch (IOException e)
{
... | [
"protected",
"DirectoryManager",
"cloneDirectoryManager",
"(",
"DirectoryManager",
"directoryManager",
",",
"String",
"suffix",
")",
"throws",
"IOException",
"{",
"try",
"{",
"DirectoryManager",
"df",
"=",
"directoryManager",
".",
"getClass",
"(",
")",
".",
"newInstan... | Clone the default Index directory manager
@return an initialized {@link DirectoryManager}.
@throws IOException
if the directory manager cannot be instantiated or an
exception occurs while initializing the manager. | [
"Clone",
"the",
"default",
"Index",
"directory",
"manager"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java#L1991-L2009 |
apache/flink | flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/NFA.java | NFA.open | public void open(RuntimeContext cepRuntimeContext, Configuration conf) throws Exception {
"""
Initialization method for the NFA. It is called before any element is passed and thus suitable for one time setup
work.
@param cepRuntimeContext runtime context of the enclosing operator
@param conf The configuration c... | java | public void open(RuntimeContext cepRuntimeContext, Configuration conf) throws Exception {
for (State<T> state : getStates()) {
for (StateTransition<T> transition : state.getStateTransitions()) {
IterativeCondition condition = transition.getCondition();
FunctionUtils.setFunctionRuntimeContext(condition, cep... | [
"public",
"void",
"open",
"(",
"RuntimeContext",
"cepRuntimeContext",
",",
"Configuration",
"conf",
")",
"throws",
"Exception",
"{",
"for",
"(",
"State",
"<",
"T",
">",
"state",
":",
"getStates",
"(",
")",
")",
"{",
"for",
"(",
"StateTransition",
"<",
"T",... | Initialization method for the NFA. It is called before any element is passed and thus suitable for one time setup
work.
@param cepRuntimeContext runtime context of the enclosing operator
@param conf The configuration containing the parameters attached to the contract. | [
"Initialization",
"method",
"for",
"the",
"NFA",
".",
"It",
"is",
"called",
"before",
"any",
"element",
"is",
"passed",
"and",
"thus",
"suitable",
"for",
"one",
"time",
"setup",
"work",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/NFA.java#L179-L187 |
BotMill/fb-botmill | src/main/java/co/aurasphere/botmill/fb/internal/util/network/FbBotMillNetworkController.java | FbBotMillNetworkController.toStringEntity | private static StringEntity toStringEntity(Object object) {
"""
Utility method that converts an object to its StringEntity
representation.
@param object
the object to convert to a StringEntity.
@return a {@link StringEntity} object containing the object JSON.
"""
StringEntity input = null;
try {
S... | java | private static StringEntity toStringEntity(Object object) {
StringEntity input = null;
try {
String json = FbBotMillJsonUtils.toJson(object);
input = new StringEntity(json, "UTF-8");
input.setContentType("application/json");
logger.debug("Request: {}", inputStreamToString(input.getContent()));
} catch... | [
"private",
"static",
"StringEntity",
"toStringEntity",
"(",
"Object",
"object",
")",
"{",
"StringEntity",
"input",
"=",
"null",
";",
"try",
"{",
"String",
"json",
"=",
"FbBotMillJsonUtils",
".",
"toJson",
"(",
"object",
")",
";",
"input",
"=",
"new",
"String... | Utility method that converts an object to its StringEntity
representation.
@param object
the object to convert to a StringEntity.
@return a {@link StringEntity} object containing the object JSON. | [
"Utility",
"method",
"that",
"converts",
"an",
"object",
"to",
"its",
"StringEntity",
"representation",
"."
] | train | https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/internal/util/network/FbBotMillNetworkController.java#L432-L443 |
biojava/biojava | biojava-protein-disorder/src/main/java/org/biojava/nbio/data/sequence/SequenceUtil.java | SequenceUtil.readFasta | public static List<FastaSequence> readFasta(final InputStream inStream)
throws IOException {
"""
Reads fasta sequences from inStream into the list of FastaSequence
objects
@param inStream
from
@return list of FastaSequence objects
@throws IOException
"""
final List<FastaSequence> seqs = new ArrayList... | java | public static List<FastaSequence> readFasta(final InputStream inStream)
throws IOException {
final List<FastaSequence> seqs = new ArrayList<FastaSequence>();
final BufferedReader infasta = new BufferedReader(
new InputStreamReader(inStream, "UTF8"), 16000);
final Pattern pattern = Pattern.compile("//s+");
Str... | [
"public",
"static",
"List",
"<",
"FastaSequence",
">",
"readFasta",
"(",
"final",
"InputStream",
"inStream",
")",
"throws",
"IOException",
"{",
"final",
"List",
"<",
"FastaSequence",
">",
"seqs",
"=",
"new",
"ArrayList",
"<",
"FastaSequence",
">",
"(",
")",
... | Reads fasta sequences from inStream into the list of FastaSequence
objects
@param inStream
from
@return list of FastaSequence objects
@throws IOException | [
"Reads",
"fasta",
"sequences",
"from",
"inStream",
"into",
"the",
"list",
"of",
"FastaSequence",
"objects"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-protein-disorder/src/main/java/org/biojava/nbio/data/sequence/SequenceUtil.java#L251-L277 |
liferay/com-liferay-commerce | commerce-product-api/src/main/java/com/liferay/commerce/product/model/CPAttachmentFileEntryWrapper.java | CPAttachmentFileEntryWrapper.setTitleMap | @Override
public void setTitleMap(Map<java.util.Locale, String> titleMap) {
"""
Sets the localized titles of this cp attachment file entry from the map of locales and localized titles.
@param titleMap the locales and localized titles of this cp attachment file entry
"""
_cpAttachmentFileEntry.setTitleMap... | java | @Override
public void setTitleMap(Map<java.util.Locale, String> titleMap) {
_cpAttachmentFileEntry.setTitleMap(titleMap);
} | [
"@",
"Override",
"public",
"void",
"setTitleMap",
"(",
"Map",
"<",
"java",
".",
"util",
".",
"Locale",
",",
"String",
">",
"titleMap",
")",
"{",
"_cpAttachmentFileEntry",
".",
"setTitleMap",
"(",
"titleMap",
")",
";",
"}"
] | Sets the localized titles of this cp attachment file entry from the map of locales and localized titles.
@param titleMap the locales and localized titles of this cp attachment file entry | [
"Sets",
"the",
"localized",
"titles",
"of",
"this",
"cp",
"attachment",
"file",
"entry",
"from",
"the",
"map",
"of",
"locales",
"and",
"localized",
"titles",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/model/CPAttachmentFileEntryWrapper.java#L1004-L1007 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwxmlcontenttype.java | appfwxmlcontenttype.get | public static appfwxmlcontenttype get(nitro_service service, String xmlcontenttypevalue) throws Exception {
"""
Use this API to fetch appfwxmlcontenttype resource of given name .
"""
appfwxmlcontenttype obj = new appfwxmlcontenttype();
obj.set_xmlcontenttypevalue(xmlcontenttypevalue);
appfwxmlcontenttype... | java | public static appfwxmlcontenttype get(nitro_service service, String xmlcontenttypevalue) throws Exception{
appfwxmlcontenttype obj = new appfwxmlcontenttype();
obj.set_xmlcontenttypevalue(xmlcontenttypevalue);
appfwxmlcontenttype response = (appfwxmlcontenttype) obj.get_resource(service);
return response;
} | [
"public",
"static",
"appfwxmlcontenttype",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"xmlcontenttypevalue",
")",
"throws",
"Exception",
"{",
"appfwxmlcontenttype",
"obj",
"=",
"new",
"appfwxmlcontenttype",
"(",
")",
";",
"obj",
".",
"set_xmlcontenttypeval... | Use this API to fetch appfwxmlcontenttype resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"appfwxmlcontenttype",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwxmlcontenttype.java#L218-L223 |
apache/groovy | src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java | StaticTypeCheckingVisitor.checkOrMarkPrivateAccess | private void checkOrMarkPrivateAccess(Expression source, FieldNode fn, boolean lhsOfAssignment) {
"""
Given a field node, checks if we are accessing or setting a private field from an inner class.
"""
if (fn == null) return;
ClassNode enclosingClassNode = typeCheckingContext.getEnclosingClassNo... | java | private void checkOrMarkPrivateAccess(Expression source, FieldNode fn, boolean lhsOfAssignment) {
if (fn == null) return;
ClassNode enclosingClassNode = typeCheckingContext.getEnclosingClassNode();
ClassNode declaringClass = fn.getDeclaringClass();
if (fn.isPrivate() &&
(... | [
"private",
"void",
"checkOrMarkPrivateAccess",
"(",
"Expression",
"source",
",",
"FieldNode",
"fn",
",",
"boolean",
"lhsOfAssignment",
")",
"{",
"if",
"(",
"fn",
"==",
"null",
")",
"return",
";",
"ClassNode",
"enclosingClassNode",
"=",
"typeCheckingContext",
".",
... | Given a field node, checks if we are accessing or setting a private field from an inner class. | [
"Given",
"a",
"field",
"node",
"checks",
"if",
"we",
"are",
"accessing",
"or",
"setting",
"a",
"private",
"field",
"from",
"an",
"inner",
"class",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java#L502-L526 |
lucee/Lucee | core/src/main/java/lucee/commons/lang/ClassUtil.java | ClassUtil.loadClass | public static Class loadClass(String className, Class defaultValue) {
"""
loads a class from a String classname
@param className
@param defaultValue
@return matching Class
"""
// OSGI env
Class clazz = _loadClass(new OSGiBasedClassLoading(), className, null, null);
if (clazz != null) return clazz;
//... | java | public static Class loadClass(String className, Class defaultValue) {
// OSGI env
Class clazz = _loadClass(new OSGiBasedClassLoading(), className, null, null);
if (clazz != null) return clazz;
// core classloader
clazz = _loadClass(new ClassLoaderBasedClassLoading(SystemUtil.getCoreClassLoader()), className, null... | [
"public",
"static",
"Class",
"loadClass",
"(",
"String",
"className",
",",
"Class",
"defaultValue",
")",
"{",
"// OSGI env",
"Class",
"clazz",
"=",
"_loadClass",
"(",
"new",
"OSGiBasedClassLoading",
"(",
")",
",",
"className",
",",
"null",
",",
"null",
")",
... | loads a class from a String classname
@param className
@param defaultValue
@return matching Class | [
"loads",
"a",
"class",
"from",
"a",
"String",
"classname"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/lang/ClassUtil.java#L167-L181 |
lucee/Lucee | core/src/main/java/lucee/commons/lang/StringUtil.java | StringUtil.ltrim | public static String ltrim(String str, String defaultValue) {
"""
This function returns a string with whitespace stripped from the beginning of str
@param str String to clean
@return cleaned String
"""
if (str == null) return defaultValue;
int len = str.length();
int st = 0;
while ((st < len) && (str.... | java | public static String ltrim(String str, String defaultValue) {
if (str == null) return defaultValue;
int len = str.length();
int st = 0;
while ((st < len) && (str.charAt(st) <= ' ')) {
st++;
}
return ((st > 0)) ? str.substring(st) : str;
} | [
"public",
"static",
"String",
"ltrim",
"(",
"String",
"str",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"return",
"defaultValue",
";",
"int",
"len",
"=",
"str",
".",
"length",
"(",
")",
";",
"int",
"st",
"=",
"0",
... | This function returns a string with whitespace stripped from the beginning of str
@param str String to clean
@return cleaned String | [
"This",
"function",
"returns",
"a",
"string",
"with",
"whitespace",
"stripped",
"from",
"the",
"beginning",
"of",
"str"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/lang/StringUtil.java#L483-L492 |
GoogleCloudPlatform/bigdata-interop | util/src/main/java/com/google/cloud/hadoop/util/HttpTransportFactory.java | HttpTransportFactory.parseProxyAddress | @VisibleForTesting
static URI parseProxyAddress(@Nullable String proxyAddress) {
"""
Parse an HTTP proxy from a String address.
@param proxyAddress The address of the proxy of the form (https?://)HOST:PORT.
@return The URI of the proxy.
@throws IllegalArgumentException If the address is invalid.
"""
i... | java | @VisibleForTesting
static URI parseProxyAddress(@Nullable String proxyAddress) {
if (Strings.isNullOrEmpty(proxyAddress)) {
return null;
}
String uriString = (proxyAddress.contains("//") ? "" : "//") + proxyAddress;
try {
URI uri = new URI(uriString);
String scheme = uri.getScheme();... | [
"@",
"VisibleForTesting",
"static",
"URI",
"parseProxyAddress",
"(",
"@",
"Nullable",
"String",
"proxyAddress",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"proxyAddress",
")",
")",
"{",
"return",
"null",
";",
"}",
"String",
"uriString",
"=",
... | Parse an HTTP proxy from a String address.
@param proxyAddress The address of the proxy of the form (https?://)HOST:PORT.
@return The URI of the proxy.
@throws IllegalArgumentException If the address is invalid. | [
"Parse",
"an",
"HTTP",
"proxy",
"from",
"a",
"String",
"address",
"."
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/util/src/main/java/com/google/cloud/hadoop/util/HttpTransportFactory.java#L208-L232 |
Netflix/astyanax | astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeColumnEntityMapper.java | CompositeColumnEntityMapper.setField | public boolean setField(Object entity, ColumnList<ByteBuffer> columns) throws Exception {
"""
Set the collection field using the provided column list of embedded entities
@param entity
@param name
@param column
@return
@throws Exception
"""
List<Object> list = getOrCreateField(entity);
... | java | public boolean setField(Object entity, ColumnList<ByteBuffer> columns) throws Exception {
List<Object> list = getOrCreateField(entity);
// Iterate through columns and add embedded entities to the list
for (com.netflix.astyanax.model.Column<ByteBuffer> c : columns) {
list... | [
"public",
"boolean",
"setField",
"(",
"Object",
"entity",
",",
"ColumnList",
"<",
"ByteBuffer",
">",
"columns",
")",
"throws",
"Exception",
"{",
"List",
"<",
"Object",
">",
"list",
"=",
"getOrCreateField",
"(",
"entity",
")",
";",
"// Iterate through columns and... | Set the collection field using the provided column list of embedded entities
@param entity
@param name
@param column
@return
@throws Exception | [
"Set",
"the",
"collection",
"field",
"using",
"the",
"provided",
"column",
"list",
"of",
"embedded",
"entities"
] | train | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeColumnEntityMapper.java#L178-L187 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/I18nObject.java | I18nObject.getI18n | protected String getI18n(final String aMessageKey, final int aIntDetail) {
"""
Gets the internationalized value for the supplied message key, using an int as additional information.
@param aMessageKey A message key
@param aIntDetail Additional details for the message
@return The internationalized message
... | java | protected String getI18n(final String aMessageKey, final int aIntDetail) {
return StringUtils.normalizeWS(myBundle.get(aMessageKey, Integer.toString(aIntDetail)));
} | [
"protected",
"String",
"getI18n",
"(",
"final",
"String",
"aMessageKey",
",",
"final",
"int",
"aIntDetail",
")",
"{",
"return",
"StringUtils",
".",
"normalizeWS",
"(",
"myBundle",
".",
"get",
"(",
"aMessageKey",
",",
"Integer",
".",
"toString",
"(",
"aIntDetai... | Gets the internationalized value for the supplied message key, using an int as additional information.
@param aMessageKey A message key
@param aIntDetail Additional details for the message
@return The internationalized message | [
"Gets",
"the",
"internationalized",
"value",
"for",
"the",
"supplied",
"message",
"key",
"using",
"an",
"int",
"as",
"additional",
"information",
"."
] | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/I18nObject.java#L68-L70 |
SeaCloudsEU/SeaCloudsPlatform | sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/SeacloudsRest.java | SeacloudsRest.getMetricsBaseUrl | private String getMetricsBaseUrl(String suppliedBaseUrl, String envBaseUrl) {
"""
Return base url of the metrics endpoint of the Monitoring Platform.
If an url is supplied in the request, use that value. Else, use MODACLOUDS_METRICS_URL env var is set.
"""
String result = ("".equals(suppl... | java | private String getMetricsBaseUrl(String suppliedBaseUrl, String envBaseUrl) {
String result = ("".equals(suppliedBaseUrl))? envBaseUrl : suppliedBaseUrl;
logger.debug("getMetricsBaseUrl(env={}, supplied={}) = {}", envBaseUrl, suppliedBaseUrl, result);
return result;
} | [
"private",
"String",
"getMetricsBaseUrl",
"(",
"String",
"suppliedBaseUrl",
",",
"String",
"envBaseUrl",
")",
"{",
"String",
"result",
"=",
"(",
"\"\"",
".",
"equals",
"(",
"suppliedBaseUrl",
")",
")",
"?",
"envBaseUrl",
":",
"suppliedBaseUrl",
";",
"logger",
... | Return base url of the metrics endpoint of the Monitoring Platform.
If an url is supplied in the request, use that value. Else, use MODACLOUDS_METRICS_URL env var is set. | [
"Return",
"base",
"url",
"of",
"the",
"metrics",
"endpoint",
"of",
"the",
"Monitoring",
"Platform",
"."
] | train | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/SeacloudsRest.java#L389-L395 |
weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/RunWithinInterceptionDecorationContextGenerator.java | RunWithinInterceptionDecorationContextGenerator.endIfStarted | void endIfStarted(CodeAttribute b, ClassMethod method) {
"""
Ends interception context if it was previously stated. This is indicated by a local variable with index 0.
"""
b.aload(getLocalVariableIndex(0));
b.dup();
final BranchEnd ifnotnull = b.ifnull();
b.checkcast(Stack.class... | java | void endIfStarted(CodeAttribute b, ClassMethod method) {
b.aload(getLocalVariableIndex(0));
b.dup();
final BranchEnd ifnotnull = b.ifnull();
b.checkcast(Stack.class);
b.invokevirtual(Stack.class.getName(), END_INTERCEPTOR_CONTEXT_METHOD_NAME, EMPTY_PARENTHESES + VOID_CLASS_DESCRI... | [
"void",
"endIfStarted",
"(",
"CodeAttribute",
"b",
",",
"ClassMethod",
"method",
")",
"{",
"b",
".",
"aload",
"(",
"getLocalVariableIndex",
"(",
"0",
")",
")",
";",
"b",
".",
"dup",
"(",
")",
";",
"final",
"BranchEnd",
"ifnotnull",
"=",
"b",
".",
"ifnu... | Ends interception context if it was previously stated. This is indicated by a local variable with index 0. | [
"Ends",
"interception",
"context",
"if",
"it",
"was",
"previously",
"stated",
".",
"This",
"is",
"indicated",
"by",
"a",
"local",
"variable",
"with",
"index",
"0",
"."
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/RunWithinInterceptionDecorationContextGenerator.java#L117-L127 |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/asm/translate/Translate.java | Translate.translateVertexIds | public static <OLD, NEW, VV> DataSet<Vertex<NEW, VV>> translateVertexIds(DataSet<Vertex<OLD, VV>> vertices, TranslateFunction<OLD, NEW> translator) {
"""
Translate {@link Vertex} IDs using the given {@link TranslateFunction}.
@param vertices input vertices
@param translator implements conversion from {@code OL... | java | public static <OLD, NEW, VV> DataSet<Vertex<NEW, VV>> translateVertexIds(DataSet<Vertex<OLD, VV>> vertices, TranslateFunction<OLD, NEW> translator) {
return translateVertexIds(vertices, translator, PARALLELISM_DEFAULT);
} | [
"public",
"static",
"<",
"OLD",
",",
"NEW",
",",
"VV",
">",
"DataSet",
"<",
"Vertex",
"<",
"NEW",
",",
"VV",
">",
">",
"translateVertexIds",
"(",
"DataSet",
"<",
"Vertex",
"<",
"OLD",
",",
"VV",
">",
">",
"vertices",
",",
"TranslateFunction",
"<",
"O... | Translate {@link Vertex} IDs using the given {@link TranslateFunction}.
@param vertices input vertices
@param translator implements conversion from {@code OLD} to {@code NEW}
@param <OLD> old vertex ID type
@param <NEW> new vertex ID type
@param <VV> vertex value type
@return translated vertices | [
"Translate",
"{",
"@link",
"Vertex",
"}",
"IDs",
"using",
"the",
"given",
"{",
"@link",
"TranslateFunction",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/asm/translate/Translate.java#L54-L56 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java | Frame.getStackLocation | public int getStackLocation(int loc) throws DataflowAnalysisException {
"""
Get a the location in the frame of a value on the operand stack.
@param loc
the stack location, counting downwards from the top (location
0)
"""
int stackDepth = getStackDepth();
if (loc >= stackDepth) {
... | java | public int getStackLocation(int loc) throws DataflowAnalysisException {
int stackDepth = getStackDepth();
if (loc >= stackDepth) {
throw new DataflowAnalysisException("not enough values on stack: access=" + loc + ", avail=" + stackDepth);
}
return slotList.size() - (loc + 1);... | [
"public",
"int",
"getStackLocation",
"(",
"int",
"loc",
")",
"throws",
"DataflowAnalysisException",
"{",
"int",
"stackDepth",
"=",
"getStackDepth",
"(",
")",
";",
"if",
"(",
"loc",
">=",
"stackDepth",
")",
"{",
"throw",
"new",
"DataflowAnalysisException",
"(",
... | Get a the location in the frame of a value on the operand stack.
@param loc
the stack location, counting downwards from the top (location
0) | [
"Get",
"a",
"the",
"location",
"in",
"the",
"frame",
"of",
"a",
"value",
"on",
"the",
"operand",
"stack",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java#L263-L269 |
samskivert/samskivert | src/main/java/com/samskivert/servlet/util/ParameterUtil.java | ParameterUtil.isSet | public static boolean isSet (HttpServletRequest req, String name, boolean defaultValue) {
"""
Returns true if the specified parameter is set to a non-blank value in the request, false if
the value is blank, or <code>defaultValue</code> if the parameter is unspecified.
@return true if the specified parameter is... | java | public static boolean isSet (HttpServletRequest req, String name, boolean defaultValue)
{
String value = getParameter(req, name, true);
return (value == null) ? defaultValue : !StringUtil.isBlank(req.getParameter(name));
} | [
"public",
"static",
"boolean",
"isSet",
"(",
"HttpServletRequest",
"req",
",",
"String",
"name",
",",
"boolean",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"getParameter",
"(",
"req",
",",
"name",
",",
"true",
")",
";",
"return",
"(",
"value",
"==",... | Returns true if the specified parameter is set to a non-blank value in the request, false if
the value is blank, or <code>defaultValue</code> if the parameter is unspecified.
@return true if the specified parameter is set to a non-blank value in the request, false if
the value is blank, or <code>defaultValue</code> if... | [
"Returns",
"true",
"if",
"the",
"specified",
"parameter",
"is",
"set",
"to",
"a",
"non",
"-",
"blank",
"value",
"in",
"the",
"request",
"false",
"if",
"the",
"value",
"is",
"blank",
"or",
"<code",
">",
"defaultValue<",
"/",
"code",
">",
"if",
"the",
"p... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/util/ParameterUtil.java#L300-L304 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/index/idistance/InMemoryIDistanceIndex.java | InMemoryIDistanceIndex.binarySearch | protected static void binarySearch(ModifiableDoubleDBIDList index, DoubleDBIDListIter iter, double val) {
"""
Seek an iterator to the desired position, using binary search.
@param index Index to search
@param iter Iterator
@param val Distance to search to
"""
// Binary search. TODO: move this into the... | java | protected static void binarySearch(ModifiableDoubleDBIDList index, DoubleDBIDListIter iter, double val) {
// Binary search. TODO: move this into the DoubleDBIDList class.
int left = 0, right = index.size();
while(left < right) {
final int mid = (left + right) >>> 1;
final double curd = iter.seek... | [
"protected",
"static",
"void",
"binarySearch",
"(",
"ModifiableDoubleDBIDList",
"index",
",",
"DoubleDBIDListIter",
"iter",
",",
"double",
"val",
")",
"{",
"// Binary search. TODO: move this into the DoubleDBIDList class.",
"int",
"left",
"=",
"0",
",",
"right",
"=",
"i... | Seek an iterator to the desired position, using binary search.
@param index Index to search
@param iter Iterator
@param val Distance to search to | [
"Seek",
"an",
"iterator",
"to",
"the",
"desired",
"position",
"using",
"binary",
"search",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/index/idistance/InMemoryIDistanceIndex.java#L277-L298 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/sc/sc_stats.java | sc_stats.get_nitro_response | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
"""
<pre>
converts nitro response into object and returns the object array in case of get request.
</pre>
"""
sc_stats[] resources = new sc_stats[1];
sc_response result = (sc_response) service.get_payl... | java | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
sc_stats[] resources = new sc_stats[1];
sc_response result = (sc_response) service.get_payload_formatter().string_to_resource(sc_response.class, response);
if(result.errorcode != 0) {
if (result.errorcode ==... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"sc_stats",
"[",
"]",
"resources",
"=",
"new",
"sc_stats",
"[",
"1",
"]",
";",
"sc_response",
"result",
"... | <pre>
converts nitro response into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"converts",
"nitro",
"response",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/sc/sc_stats.java#L257-L276 |
OpenLiberty/open-liberty | dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixCompareCommandTask.java | IFixCompareCommandTask.readAparCsvFromExtractedInstall | private Set<String> readAparCsvFromExtractedInstall(File installLocation) throws ZipException, IOException {
"""
This will load the APAR archive within the extracted file at the
<code>installLocation</code> and obtain the CSV file within it that lists
the APAR ids.
@param installLocation
The location of the ... | java | private Set<String> readAparCsvFromExtractedInstall(File installLocation) throws ZipException, IOException {
// Extracted, means we can open up the zip containing the APAR CSV file
// and get the entry for it
File fixesFolder = new File(installLocation, APAR_FIX_PACK_ZIP_LOCATION);
final... | [
"private",
"Set",
"<",
"String",
">",
"readAparCsvFromExtractedInstall",
"(",
"File",
"installLocation",
")",
"throws",
"ZipException",
",",
"IOException",
"{",
"// Extracted, means we can open up the zip containing the APAR CSV file",
"// and get the entry for it",
"File",
"fixe... | This will load the APAR archive within the extracted file at the
<code>installLocation</code> and obtain the CSV file within it that lists
the APAR ids.
@param installLocation
The location of the archive install file
@return The contents of the CSV file or <code>null</code> if the file
doesn't exist or is empty
@throw... | [
"This",
"will",
"load",
"the",
"APAR",
"archive",
"within",
"the",
"extracted",
"file",
"at",
"the",
"<code",
">",
"installLocation<",
"/",
"code",
">",
"and",
"obtain",
"the",
"CSV",
"file",
"within",
"it",
"that",
"lists",
"the",
"APAR",
"ids",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixCompareCommandTask.java#L683-L721 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/util/Maps2.java | Maps2.putAllIntoListMap | public static <K, V> void putAllIntoListMap(K key, Collection<? extends V> values, Map<? super K, List<V>> map) {
"""
Puts a value into a map that supports lists as values.
The list is created on-demand.
"""
List<V> list = map.get(key);
if (list == null) {
list = Lists.newArrayList(values);
map.put(... | java | public static <K, V> void putAllIntoListMap(K key, Collection<? extends V> values, Map<? super K, List<V>> map) {
List<V> list = map.get(key);
if (list == null) {
list = Lists.newArrayList(values);
map.put(key, list);
} else {
list.addAll(values);
}
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"void",
"putAllIntoListMap",
"(",
"K",
"key",
",",
"Collection",
"<",
"?",
"extends",
"V",
">",
"values",
",",
"Map",
"<",
"?",
"super",
"K",
",",
"List",
"<",
"V",
">",
">",
"map",
")",
"{",
"List",
... | Puts a value into a map that supports lists as values.
The list is created on-demand. | [
"Puts",
"a",
"value",
"into",
"a",
"map",
"that",
"supports",
"lists",
"as",
"values",
".",
"The",
"list",
"is",
"created",
"on",
"-",
"demand",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/util/Maps2.java#L84-L92 |
shinesolutions/swagger-aem | java/generated/src/main/java/com/shinesolutions/swaggeraem4j/api/SlingApi.java | SlingApi.postConfigApacheSlingGetServletAsync | public com.squareup.okhttp.Call postConfigApacheSlingGetServletAsync(String runmode, String jsonMaximumresults, String jsonMaximumresultsTypeHint, Boolean enableHtml, String enableHtmlTypeHint, Boolean enableTxt, String enableTxtTypeHint, Boolean enableXml, String enableXmlTypeHint, final ApiCallback<Void> callback) th... | java | public com.squareup.okhttp.Call postConfigApacheSlingGetServletAsync(String runmode, String jsonMaximumresults, String jsonMaximumresultsTypeHint, Boolean enableHtml, String enableHtmlTypeHint, Boolean enableTxt, String enableTxtTypeHint, Boolean enableXml, String enableXmlTypeHint, final ApiCallback<Void> callback) th... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"postConfigApacheSlingGetServletAsync",
"(",
"String",
"runmode",
",",
"String",
"jsonMaximumresults",
",",
"String",
"jsonMaximumresultsTypeHint",
",",
"Boolean",
"enableHtml",
",",
"String",
"enableHtmlType... | (asynchronously)
@param runmode (required)
@param jsonMaximumresults (optional)
@param jsonMaximumresultsTypeHint (optional)
@param enableHtml (optional)
@param enableHtmlTypeHint (optional)
@param enableTxt (optional)
@param enableTxtTypeHint (optional)
@param enableXml (optional)
@param enableXmlTypeHint (o... | [
"(",
"asynchronously",
")"
] | train | https://github.com/shinesolutions/swagger-aem/blob/ae7da4df93e817dc2bad843779b2069d9c4e7c6b/java/generated/src/main/java/com/shinesolutions/swaggeraem4j/api/SlingApi.java#L3430-L3454 |
stratosphere/stratosphere | stratosphere-compiler/src/main/java/eu/stratosphere/compiler/PactCompiler.java | PactCompiler.createPreOptimizedPlan | public static List<DataSinkNode> createPreOptimizedPlan(Plan program) {
"""
This function performs only the first step to the compilation process - the creation of the optimizer
representation of the plan. No estimations or enumerations of alternatives are done here.
@param program The plan to generate the opt... | java | public static List<DataSinkNode> createPreOptimizedPlan(Plan program) {
GraphCreatingVisitor graphCreator = new GraphCreatingVisitor(-1, 1);
program.accept(graphCreator);
return graphCreator.sinks;
} | [
"public",
"static",
"List",
"<",
"DataSinkNode",
">",
"createPreOptimizedPlan",
"(",
"Plan",
"program",
")",
"{",
"GraphCreatingVisitor",
"graphCreator",
"=",
"new",
"GraphCreatingVisitor",
"(",
"-",
"1",
",",
"1",
")",
";",
"program",
".",
"accept",
"(",
"gra... | This function performs only the first step to the compilation process - the creation of the optimizer
representation of the plan. No estimations or enumerations of alternatives are done here.
@param program The plan to generate the optimizer representation for.
@return The optimizer representation of the plan, as a co... | [
"This",
"function",
"performs",
"only",
"the",
"first",
"step",
"to",
"the",
"compilation",
"process",
"-",
"the",
"creation",
"of",
"the",
"optimizer",
"representation",
"of",
"the",
"plan",
".",
"No",
"estimations",
"or",
"enumerations",
"of",
"alternatives",
... | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-compiler/src/main/java/eu/stratosphere/compiler/PactCompiler.java#L757-L761 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/util/StringUtil.java | StringUtil.latinIndexOf | public static int latinIndexOf(String str, int offset) {
"""
get the index of the first Latin char of the specified string
@param str
@param offset
@return integer
"""
for ( int j = offset; j < str.length(); j++ ) {
if ( isEnChar(str.charAt(j)) ) {
return j;
... | java | public static int latinIndexOf(String str, int offset)
{
for ( int j = offset; j < str.length(); j++ ) {
if ( isEnChar(str.charAt(j)) ) {
return j;
}
}
return -1;
} | [
"public",
"static",
"int",
"latinIndexOf",
"(",
"String",
"str",
",",
"int",
"offset",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"offset",
";",
"j",
"<",
"str",
".",
"length",
"(",
")",
";",
"j",
"++",
")",
"{",
"if",
"(",
"isEnChar",
"(",
"str",
... | get the index of the first Latin char of the specified string
@param str
@param offset
@return integer | [
"get",
"the",
"index",
"of",
"the",
"first",
"Latin",
"char",
"of",
"the",
"specified",
"string"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/StringUtil.java#L440-L449 |
structurizr/java | structurizr-core/src/com/structurizr/documentation/DocumentationTemplate.java | DocumentationTemplate.addSection | @Nonnull
public Section addSection(String title, Format format, String content) {
"""
Adds a custom section, that isn't related to any element in the model.
@param title the section title
@param format the {@link Format} of the documentation content
@param content a String containing the ... | java | @Nonnull
public Section addSection(String title, Format format, String content) {
return add(null, title, format, content);
} | [
"@",
"Nonnull",
"public",
"Section",
"addSection",
"(",
"String",
"title",
",",
"Format",
"format",
",",
"String",
"content",
")",
"{",
"return",
"add",
"(",
"null",
",",
"title",
",",
"format",
",",
"content",
")",
";",
"}"
] | Adds a custom section, that isn't related to any element in the model.
@param title the section title
@param format the {@link Format} of the documentation content
@param content a String containing the documentation content
@return a documentation {@link Section} | [
"Adds",
"a",
"custom",
"section",
"that",
"isn",
"t",
"related",
"to",
"any",
"element",
"in",
"the",
"model",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/documentation/DocumentationTemplate.java#L59-L62 |
apache/spark | sql/catalyst/src/main/java/org/apache/spark/sql/util/CaseInsensitiveStringMap.java | CaseInsensitiveStringMap.getBoolean | public boolean getBoolean(String key, boolean defaultValue) {
"""
Returns the boolean value to which the specified key is mapped,
or defaultValue if there is no mapping for the key. The key match is case-insensitive.
"""
String value = get(key);
// We can't use `Boolean.parseBoolean` here, as it retur... | java | public boolean getBoolean(String key, boolean defaultValue) {
String value = get(key);
// We can't use `Boolean.parseBoolean` here, as it returns false for invalid strings.
if (value == null) {
return defaultValue;
} else if (value.equalsIgnoreCase("true")) {
return true;
} else if (valu... | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"key",
",",
"boolean",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"get",
"(",
"key",
")",
";",
"// We can't use `Boolean.parseBoolean` here, as it returns false for invalid strings.",
"if",
"(",
"value",
"==",
"... | Returns the boolean value to which the specified key is mapped,
or defaultValue if there is no mapping for the key. The key match is case-insensitive. | [
"Returns",
"the",
"boolean",
"value",
"to",
"which",
"the",
"specified",
"key",
"is",
"mapped",
"or",
"defaultValue",
"if",
"there",
"is",
"no",
"mapping",
"for",
"the",
"key",
".",
"The",
"key",
"match",
"is",
"case",
"-",
"insensitive",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/catalyst/src/main/java/org/apache/spark/sql/util/CaseInsensitiveStringMap.java#L134-L146 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/EncodingManager.java | EncodingManager.acceptWay | public boolean acceptWay(ReaderWay way, AcceptWay acceptWay) {
"""
Determine whether a way is routable for one of the added encoders.
@return if at least one encoder consumes the specified way. Additionally the specified acceptWay is changed
to provide more details.
"""
if (!acceptWay.isEmpty())
... | java | public boolean acceptWay(ReaderWay way, AcceptWay acceptWay) {
if (!acceptWay.isEmpty())
throw new IllegalArgumentException("AcceptWay must be empty");
for (AbstractFlagEncoder encoder : edgeEncoders) {
acceptWay.put(encoder.toString(), encoder.getAccess(way));
}
... | [
"public",
"boolean",
"acceptWay",
"(",
"ReaderWay",
"way",
",",
"AcceptWay",
"acceptWay",
")",
"{",
"if",
"(",
"!",
"acceptWay",
".",
"isEmpty",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"AcceptWay must be empty\"",
")",
";",
"for",
"("... | Determine whether a way is routable for one of the added encoders.
@return if at least one encoder consumes the specified way. Additionally the specified acceptWay is changed
to provide more details. | [
"Determine",
"whether",
"a",
"way",
"is",
"routable",
"for",
"one",
"of",
"the",
"added",
"encoders",
"."
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/EncodingManager.java#L384-L392 |
gocd/gocd | base/src/main/java/com/thoughtworks/go/util/SelectorUtils.java | SelectorUtils.tokenizePath | public static Vector tokenizePath (String path, String separator) {
"""
Breaks a path up into a Vector of path elements, tokenizing on
@param path Path to tokenize. Must not be <code>null</code>.
@param separator the separator against which to tokenize.
@return a Vector of path elements from the tokenized p... | java | public static Vector tokenizePath (String path, String separator) {
Vector ret = new Vector();
if (FileUtil.isAbsolutePath(path)) {
String[] s = FileUtil.dissect(path);
ret.add(s[0]);
path = s[1];
}
StringTokenizer st = new StringTokenizer(path, separa... | [
"public",
"static",
"Vector",
"tokenizePath",
"(",
"String",
"path",
",",
"String",
"separator",
")",
"{",
"Vector",
"ret",
"=",
"new",
"Vector",
"(",
")",
";",
"if",
"(",
"FileUtil",
".",
"isAbsolutePath",
"(",
"path",
")",
")",
"{",
"String",
"[",
"]... | Breaks a path up into a Vector of path elements, tokenizing on
@param path Path to tokenize. Must not be <code>null</code>.
@param separator the separator against which to tokenize.
@return a Vector of path elements from the tokenized path
@since Ant 1.6 | [
"Breaks",
"a",
"path",
"up",
"into",
"a",
"Vector",
"of",
"path",
"elements",
"tokenizing",
"on"
] | train | https://github.com/gocd/gocd/blob/59a8480e23d6c06de39127635108dff57603cb71/base/src/main/java/com/thoughtworks/go/util/SelectorUtils.java#L487-L499 |
finmath/finmath-lib | src/main/java/net/finmath/modelling/productfactory/InterestRateMonteCarloProductFactory.java | InterestRateMonteCarloProductFactory.constructLiborIndex | private static AbstractIndex constructLiborIndex(String forwardCurveName, Schedule schedule) {
"""
Construct a Libor index for a given curve and schedule.
@param forwardCurveName
@param schedule
@return The Libor index or null, if forwardCurveName is null.
"""
if(forwardCurveName != null) {
//deter... | java | private static AbstractIndex constructLiborIndex(String forwardCurveName, Schedule schedule) {
if(forwardCurveName != null) {
//determine average fixing offset and period length
double fixingOffset = 0;
double periodLength = 0;
for(int i = 0; i < schedule.getNumberOfPeriods(); i++) {
fixingOffset *... | [
"private",
"static",
"AbstractIndex",
"constructLiborIndex",
"(",
"String",
"forwardCurveName",
",",
"Schedule",
"schedule",
")",
"{",
"if",
"(",
"forwardCurveName",
"!=",
"null",
")",
"{",
"//determine average fixing offset and period length",
"double",
"fixingOffset",
"... | Construct a Libor index for a given curve and schedule.
@param forwardCurveName
@param schedule
@return The Libor index or null, if forwardCurveName is null. | [
"Construct",
"a",
"Libor",
"index",
"for",
"a",
"given",
"curve",
"and",
"schedule",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/modelling/productfactory/InterestRateMonteCarloProductFactory.java#L88-L108 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PubSubInputHandler.java | PubSubInputHandler.sendFlushedMessage | @Override
public void sendFlushedMessage(SIBUuid8 ignore, SIBUuid12 streamID) throws SIResourceException {
"""
/*
(non-Javadoc)
@see com.ibm.ws.sib.processor.impl.interfaces.DownstreamControl#sendFlushedMessage(com.ibm.ws.sib.utils.SIBUuid12)
This is only called from attemptFlush() as flushQuery's are p... | java | @Override
public void sendFlushedMessage(SIBUuid8 ignore, SIBUuid12 streamID) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "sendFlushedMessage", new Object[] { streamID });
// This flush should be broadcast to all down... | [
"@",
"Override",
"public",
"void",
"sendFlushedMessage",
"(",
"SIBUuid8",
"ignore",
",",
"SIBUuid12",
"streamID",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
... | /*
(non-Javadoc)
@see com.ibm.ws.sib.processor.impl.interfaces.DownstreamControl#sendFlushedMessage(com.ibm.ws.sib.utils.SIBUuid12)
This is only called from attemptFlush() as flushQuery's are processed
by the PubSubOuputHandler | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PubSubInputHandler.java#L3198-L3236 |
aol/cyclops | cyclops/src/main/java/cyclops/companion/Streams.java | Streams.takeUntil | public static <U> Stream<U> takeUntil(final Stream<U> stream, final Predicate<? super U> predicate) {
"""
Take elements from a Stream until the predicate holds
<pre>
{@code Streams.takeUntil(Stream.of(4,3,6,7),i->i==6).collect(CyclopsCollectors.toList());
//[4,3]
}
</pre>
@param stream
@param predicate
@re... | java | public static <U> Stream<U> takeUntil(final Stream<U> stream, final Predicate<? super U> predicate) {
return takeWhile(stream, predicate.negate());
} | [
"public",
"static",
"<",
"U",
">",
"Stream",
"<",
"U",
">",
"takeUntil",
"(",
"final",
"Stream",
"<",
"U",
">",
"stream",
",",
"final",
"Predicate",
"<",
"?",
"super",
"U",
">",
"predicate",
")",
"{",
"return",
"takeWhile",
"(",
"stream",
",",
"predi... | Take elements from a Stream until the predicate holds
<pre>
{@code Streams.takeUntil(Stream.of(4,3,6,7),i->i==6).collect(CyclopsCollectors.toList());
//[4,3]
}
</pre>
@param stream
@param predicate
@return | [
"Take",
"elements",
"from",
"a",
"Stream",
"until",
"the",
"predicate",
"holds",
"<pre",
">",
"{"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/companion/Streams.java#L1307-L1310 |
agmip/ace-core | src/main/java/org/agmip/ace/io/AceGenerator.java | AceGenerator.generateACEB | public static void generateACEB(File dest, AceDataset set)
throws IOException {
"""
Write a dataset to a file (compressed).
<p>
This utility method uses {@link #generate} to write the GZIP compressed
JSON to a file. This method automatically closes the OutputStream used
to create the file.
@param dest D... | java | public static void generateACEB(File dest, AceDataset set)
throws IOException {
FileOutputStream fos = new FileOutputStream(dest);
GZIPOutputStream gos = new GZIPOutputStream(fos);
generate(gos, set, false);
gos.close();
fos.close();
} | [
"public",
"static",
"void",
"generateACEB",
"(",
"File",
"dest",
",",
"AceDataset",
"set",
")",
"throws",
"IOException",
"{",
"FileOutputStream",
"fos",
"=",
"new",
"FileOutputStream",
"(",
"dest",
")",
";",
"GZIPOutputStream",
"gos",
"=",
"new",
"GZIPOutputStre... | Write a dataset to a file (compressed).
<p>
This utility method uses {@link #generate} to write the GZIP compressed
JSON to a file. This method automatically closes the OutputStream used
to create the file.
@param dest Destination {@link File}
@param set the {@link AceDataset} to compress and write.
@throws IOExceptio... | [
"Write",
"a",
"dataset",
"to",
"a",
"file",
"(",
"compressed",
")",
".",
"<p",
">",
"This",
"utility",
"method",
"uses",
"{",
"@link",
"#generate",
"}",
"to",
"write",
"the",
"GZIP",
"compressed",
"JSON",
"to",
"a",
"file",
".",
"This",
"method",
"auto... | train | https://github.com/agmip/ace-core/blob/51957e79b4567d0083c52d0720f4a268c3a02f44/src/main/java/org/agmip/ace/io/AceGenerator.java#L108-L115 |
vlingo/vlingo-actors | src/main/java/io/vlingo/actors/Stage.java | Stage.actorProtocolFor | ActorProtocolActor<Object>[] actorProtocolFor(final Class<?>[] protocols, final Definition definition, final Actor parent, final Supervisor maybeSupervisor, final Logger logger) {
"""
Answers the ActorProtocolActor[] for the newly created Actor instance. (INTERNAL ONLY)
@param protocols the {@code Class<?>}[] pro... | java | ActorProtocolActor<Object>[] actorProtocolFor(final Class<?>[] protocols, final Definition definition, final Actor parent, final Supervisor maybeSupervisor, final Logger logger) {
assertProtocolCompliance(protocols);
return actorProtocolFor(protocols, definition, parent, null, null, maybeSupervisor, logger);
... | [
"ActorProtocolActor",
"<",
"Object",
">",
"[",
"]",
"actorProtocolFor",
"(",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"protocols",
",",
"final",
"Definition",
"definition",
",",
"final",
"Actor",
"parent",
",",
"final",
"Supervisor",
"maybeSupervisor",
",",
... | Answers the ActorProtocolActor[] for the newly created Actor instance. (INTERNAL ONLY)
@param protocols the {@code Class<?>}[] protocols of the Actor
@param definition the Definition of the Actor
@param parent the Actor parent of this Actor
@param maybeSupervisor the possible Supervisor of this Actor
@param logger the ... | [
"Answers",
"the",
"ActorProtocolActor",
"[]",
"for",
"the",
"newly",
"created",
"Actor",
"instance",
".",
"(",
"INTERNAL",
"ONLY",
")"
] | train | https://github.com/vlingo/vlingo-actors/blob/c7d046fd139c0490cf0fd2588d7dc2f792f13493/src/main/java/io/vlingo/actors/Stage.java#L400-L403 |
pac4j/pac4j | pac4j-oauth/src/main/java/org/pac4j/oauth/profile/JsonHelper.java | JsonHelper.getFirstNode | public static JsonNode getFirstNode(final String text, final String path) {
"""
Return the first node of a JSON response.
@param text JSON text
@param path path to find the first node
@return the first node of the JSON response or null if exception is thrown
"""
try {
JsonNode node = m... | java | public static JsonNode getFirstNode(final String text, final String path) {
try {
JsonNode node = mapper.readValue(text, JsonNode.class);
if (path != null) {
node = (JsonNode) getElement(node, path);
}
return node;
} catch (final IOExceptio... | [
"public",
"static",
"JsonNode",
"getFirstNode",
"(",
"final",
"String",
"text",
",",
"final",
"String",
"path",
")",
"{",
"try",
"{",
"JsonNode",
"node",
"=",
"mapper",
".",
"readValue",
"(",
"text",
",",
"JsonNode",
".",
"class",
")",
";",
"if",
"(",
... | Return the first node of a JSON response.
@param text JSON text
@param path path to find the first node
@return the first node of the JSON response or null if exception is thrown | [
"Return",
"the",
"first",
"node",
"of",
"a",
"JSON",
"response",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-oauth/src/main/java/org/pac4j/oauth/profile/JsonHelper.java#L49-L60 |
kstateome/canvas-api | src/main/java/edu/ksu/canvas/net/SimpleRestClient.java | SimpleRestClient.sendJsonPostOrPut | private Response sendJsonPostOrPut(OauthToken token, String url, String json,
int connectTimeout, int readTimeout, String method) throws IOException {
"""
PUT and POST are identical calls except for the header specifying the method
"""
LOG.debug("Sending JSON " + ... | java | private Response sendJsonPostOrPut(OauthToken token, String url, String json,
int connectTimeout, int readTimeout, String method) throws IOException {
LOG.debug("Sending JSON " + method + " to URL: " + url);
Response response = new Response();
HttpClient h... | [
"private",
"Response",
"sendJsonPostOrPut",
"(",
"OauthToken",
"token",
",",
"String",
"url",
",",
"String",
"json",
",",
"int",
"connectTimeout",
",",
"int",
"readTimeout",
",",
"String",
"method",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"debug",
"(",
... | PUT and POST are identical calls except for the header specifying the method | [
"PUT",
"and",
"POST",
"are",
"identical",
"calls",
"except",
"for",
"the",
"header",
"specifying",
"the",
"method"
] | train | https://github.com/kstateome/canvas-api/blob/426bf403a8fd7aca3f170348005feda25b374e5a/src/main/java/edu/ksu/canvas/net/SimpleRestClient.java#L102-L135 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java | CassandraSchemaManager.onSetGcGrace | private void onSetGcGrace(CfDef cfDef, Properties cfProperties, StringBuilder builder) {
"""
On set gc grace.
@param cfDef
the cf def
@param cfProperties
the cf properties
@param builder
the builder
"""
String gcGraceSeconds = cfProperties.getProperty(CassandraConstants.GC_GRACE_SECONDS);
... | java | private void onSetGcGrace(CfDef cfDef, Properties cfProperties, StringBuilder builder)
{
String gcGraceSeconds = cfProperties.getProperty(CassandraConstants.GC_GRACE_SECONDS);
if (gcGraceSeconds != null)
{
try
{
if (builder != null)
{
... | [
"private",
"void",
"onSetGcGrace",
"(",
"CfDef",
"cfDef",
",",
"Properties",
"cfProperties",
",",
"StringBuilder",
"builder",
")",
"{",
"String",
"gcGraceSeconds",
"=",
"cfProperties",
".",
"getProperty",
"(",
"CassandraConstants",
".",
"GC_GRACE_SECONDS",
")",
";",... | On set gc grace.
@param cfDef
the cf def
@param cfProperties
the cf properties
@param builder
the builder | [
"On",
"set",
"gc",
"grace",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L2496-L2518 |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/favorites/FavoritesController.java | FavoritesController.initializeView | @RenderMapping
public String initializeView(PortletRequest req, Model model) {
"""
Handles all Favorites portlet VIEW mode renders. Populates model with user's favorites and
selects a view to display those favorites.
<p>View selection:
<p>Returns "jsp/Favorites/view" in the normal case where the user ha... | java | @RenderMapping
public String initializeView(PortletRequest req, Model model) {
final IUserInstance ui =
userInstanceManager.getUserInstance(portalRequestUtils.getCurrentPortalRequest());
final UserPreferencesManager upm = (UserPreferencesManager) ui.getPreferencesManager();
f... | [
"@",
"RenderMapping",
"public",
"String",
"initializeView",
"(",
"PortletRequest",
"req",
",",
"Model",
"model",
")",
"{",
"final",
"IUserInstance",
"ui",
"=",
"userInstanceManager",
".",
"getUserInstance",
"(",
"portalRequestUtils",
".",
"getCurrentPortalRequest",
"(... | Handles all Favorites portlet VIEW mode renders. Populates model with user's favorites and
selects a view to display those favorites.
<p>View selection:
<p>Returns "jsp/Favorites/view" in the normal case where the user has at least one favorited
portlet or favorited collection.
<p>Returns "jsp/Favorites/view_zero" i... | [
"Handles",
"all",
"Favorites",
"portlet",
"VIEW",
"mode",
"renders",
".",
"Populates",
"model",
"with",
"user",
"s",
"favorites",
"and",
"selects",
"a",
"view",
"to",
"display",
"those",
"favorites",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/favorites/FavoritesController.java#L86-L151 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java | SqlDateTimeUtils.dateFormat | public static String dateFormat(long ts, String format, TimeZone tz) {
"""
Format a timestamp as specific.
@param ts the timestamp to format.
@param format the string formatter.
@param tz the time zone
"""
SimpleDateFormat formatter = FORMATTER_CACHE.get(format);
formatter.setTimeZone(tz);
Date dateTi... | java | public static String dateFormat(long ts, String format, TimeZone tz) {
SimpleDateFormat formatter = FORMATTER_CACHE.get(format);
formatter.setTimeZone(tz);
Date dateTime = new Date(ts);
return formatter.format(dateTime);
} | [
"public",
"static",
"String",
"dateFormat",
"(",
"long",
"ts",
",",
"String",
"format",
",",
"TimeZone",
"tz",
")",
"{",
"SimpleDateFormat",
"formatter",
"=",
"FORMATTER_CACHE",
".",
"get",
"(",
"format",
")",
";",
"formatter",
".",
"setTimeZone",
"(",
"tz",... | Format a timestamp as specific.
@param ts the timestamp to format.
@param format the string formatter.
@param tz the time zone | [
"Format",
"a",
"timestamp",
"as",
"specific",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java#L326-L331 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java | CommerceCountryPersistenceImpl.fetchByUUID_G | @Override
public CommerceCountry fetchByUUID_G(String uuid, long groupId) {
"""
Returns the commerce country where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce coun... | java | @Override
public CommerceCountry fetchByUUID_G(String uuid, long groupId) {
return fetchByUUID_G(uuid, groupId, true);
} | [
"@",
"Override",
"public",
"CommerceCountry",
"fetchByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"{",
"return",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
",",
"true",
")",
";",
"}"
] | Returns the commerce country where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce country, or <code>null</code> if a matching commerce country could not be found | [
"Returns",
"the",
"commerce",
"country",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"finder",
"cache",
... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java#L701-L704 |
mgledi/DRUMS | src/main/java/com/unister/semweb/drums/util/KeyUtils.java | KeyUtils.isNull | public static boolean isNull(byte[] key, int length) {
"""
Checks if the elements of the given key up the given length are 0, or the whole array is null.
@param key
@param length
@return true, if the key is null or all elements in the array are 0.
"""
if (key == null) {
return true;
... | java | public static boolean isNull(byte[] key, int length) {
if (key == null) {
return true;
}
for (int i = 0; i < Math.min(key.length, length); i++) {
if (key[i] != 0) {
return false;
}
}
return true;
} | [
"public",
"static",
"boolean",
"isNull",
"(",
"byte",
"[",
"]",
"key",
",",
"int",
"length",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"Math",
".",
"min",
... | Checks if the elements of the given key up the given length are 0, or the whole array is null.
@param key
@param length
@return true, if the key is null or all elements in the array are 0. | [
"Checks",
"if",
"the",
"elements",
"of",
"the",
"given",
"key",
"up",
"the",
"given",
"length",
"are",
"0",
"or",
"the",
"whole",
"array",
"is",
"null",
"."
] | train | https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/util/KeyUtils.java#L50-L60 |
app55/app55-java | src/support/java/org/apache/harmony/beans/internal/nls/Messages.java | Messages.getString | static public String getString(String msg, Object[] args) {
"""
Retrieves a message which takes several arguments.
@param msg
String the key to look up.
@param args
Object[] the objects to insert in the formatted output.
@return String the message for that key in the system message bundle.
"""
String ... | java | static public String getString(String msg, Object[] args)
{
String format = msg;
if (bundle != null)
{
try
{
format = bundle.getString(msg);
}
catch (MissingResourceException e)
{
}
}
return format(format, args);
} | [
"static",
"public",
"String",
"getString",
"(",
"String",
"msg",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"String",
"format",
"=",
"msg",
";",
"if",
"(",
"bundle",
"!=",
"null",
")",
"{",
"try",
"{",
"format",
"=",
"bundle",
".",
"getString",
"(",
... | Retrieves a message which takes several arguments.
@param msg
String the key to look up.
@param args
Object[] the objects to insert in the formatted output.
@return String the message for that key in the system message bundle. | [
"Retrieves",
"a",
"message",
"which",
"takes",
"several",
"arguments",
"."
] | train | https://github.com/app55/app55-java/blob/73e51d0f3141a859dfbd37ca9becef98477e553e/src/support/java/org/apache/harmony/beans/internal/nls/Messages.java#L133-L149 |
brettwooldridge/SansOrm | src/main/java/com/zaxxer/sansorm/OrmElf.java | OrmElf.insertListNotBatched | public static <T> void insertListNotBatched(Connection connection, Iterable<T> iterable) throws SQLException {
"""
Insert a collection of objects in a non-batched manner (i.e. using iteration and individual INSERTs).
@param connection a SQL connection
@param iterable a list (or other {@link Iterable} collectio... | java | public static <T> void insertListNotBatched(Connection connection, Iterable<T> iterable) throws SQLException
{
OrmWriter.insertListNotBatched(connection, iterable);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"insertListNotBatched",
"(",
"Connection",
"connection",
",",
"Iterable",
"<",
"T",
">",
"iterable",
")",
"throws",
"SQLException",
"{",
"OrmWriter",
".",
"insertListNotBatched",
"(",
"connection",
",",
"iterable",
")",... | Insert a collection of objects in a non-batched manner (i.e. using iteration and individual INSERTs).
@param connection a SQL connection
@param iterable a list (or other {@link Iterable} collection) of annotated objects to insert
@param <T> the class template
@throws SQLException if a {@link SQLException} occurs | [
"Insert",
"a",
"collection",
"of",
"objects",
"in",
"a",
"non",
"-",
"batched",
"manner",
"(",
"i",
".",
"e",
".",
"using",
"iteration",
"and",
"individual",
"INSERTs",
")",
"."
] | train | https://github.com/brettwooldridge/SansOrm/blob/ab22721db79c5f20c0e8483f09eda2844d596557/src/main/java/com/zaxxer/sansorm/OrmElf.java#L220-L223 |
Cleveroad/AdaptiveTableLayout | library/src/main/java/com/cleveroad/adaptivetablelayout/AdaptiveTableManager.java | AdaptiveTableManager.getRowByYWithShift | int getRowByYWithShift(int y, int shiftEveryStep) {
"""
Return row number which bounds contains Y
@param y coordinate
@return row number
"""
checkForInit();
int sum = 0;
// header offset
int tempY = y - mHeaderColumnHeight;
if (tempY <= sum) {
return 0;
... | java | int getRowByYWithShift(int y, int shiftEveryStep) {
checkForInit();
int sum = 0;
// header offset
int tempY = y - mHeaderColumnHeight;
if (tempY <= sum) {
return 0;
}
for (int count = mRowHeights.length, i = 0; i < count; i++) {
int nextSum... | [
"int",
"getRowByYWithShift",
"(",
"int",
"y",
",",
"int",
"shiftEveryStep",
")",
"{",
"checkForInit",
"(",
")",
";",
"int",
"sum",
"=",
"0",
";",
"// header offset",
"int",
"tempY",
"=",
"y",
"-",
"mHeaderColumnHeight",
";",
"if",
"(",
"tempY",
"<=",
"su... | Return row number which bounds contains Y
@param y coordinate
@return row number | [
"Return",
"row",
"number",
"which",
"bounds",
"contains",
"Y"
] | train | https://github.com/Cleveroad/AdaptiveTableLayout/blob/188213b35e05e635497b03fe741799782dde7208/library/src/main/java/com/cleveroad/adaptivetablelayout/AdaptiveTableManager.java#L277-L296 |
atomix/atomix | core/src/main/java/io/atomix/core/AtomixConfig.java | AtomixConfig.setPartitionGroups | public AtomixConfig setPartitionGroups(Map<String, PartitionGroupConfig<?>> partitionGroups) {
"""
Sets the partition group configurations.
@param partitionGroups the partition group configurations
@return the Atomix configuration
"""
partitionGroups.forEach((name, group) -> group.setName(name));
t... | java | public AtomixConfig setPartitionGroups(Map<String, PartitionGroupConfig<?>> partitionGroups) {
partitionGroups.forEach((name, group) -> group.setName(name));
this.partitionGroups = partitionGroups;
return this;
} | [
"public",
"AtomixConfig",
"setPartitionGroups",
"(",
"Map",
"<",
"String",
",",
"PartitionGroupConfig",
"<",
"?",
">",
">",
"partitionGroups",
")",
"{",
"partitionGroups",
".",
"forEach",
"(",
"(",
"name",
",",
"group",
")",
"->",
"group",
".",
"setName",
"(... | Sets the partition group configurations.
@param partitionGroups the partition group configurations
@return the Atomix configuration | [
"Sets",
"the",
"partition",
"group",
"configurations",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/core/src/main/java/io/atomix/core/AtomixConfig.java#L123-L127 |
cdapio/tigon | tigon-yarn/src/main/java/co/cask/tigon/internal/io/DatumWriterGenerator.java | DatumWriterGenerator.generateEncode | private void generateEncode(TypeToken<?> outputType, Schema schema) {
"""
Generates the {@link DatumWriter#encode(Object, co.cask.tigon.io.Encoder)} method.
@param outputType Type information of the data type for output
@param schema Schema to use for output.
"""
TypeToken<?> callOutputType = getCallType... | java | private void generateEncode(TypeToken<?> outputType, Schema schema) {
TypeToken<?> callOutputType = getCallTypeToken(outputType, schema);
Method encodeMethod = getMethod(void.class, "encode", callOutputType.getRawType(), Encoder.class);
if (!Object.class.equals(callOutputType.getRawType())) {
// Gen... | [
"private",
"void",
"generateEncode",
"(",
"TypeToken",
"<",
"?",
">",
"outputType",
",",
"Schema",
"schema",
")",
"{",
"TypeToken",
"<",
"?",
">",
"callOutputType",
"=",
"getCallTypeToken",
"(",
"outputType",
",",
"schema",
")",
";",
"Method",
"encodeMethod",
... | Generates the {@link DatumWriter#encode(Object, co.cask.tigon.io.Encoder)} method.
@param outputType Type information of the data type for output
@param schema Schema to use for output. | [
"Generates",
"the",
"{"
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-yarn/src/main/java/co/cask/tigon/internal/io/DatumWriterGenerator.java#L235-L275 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.