repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 188 | func_name stringlengths 7 127 | whole_func_string stringlengths 77 3.91k | language stringclasses 1
value | func_code_string stringlengths 77 3.91k | func_code_tokens listlengths 20 745 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 477 | split_name stringclasses 1
value | func_code_url stringlengths 111 288 |
|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java | InstanceFailoverGroupsInner.getAsync | public Observable<InstanceFailoverGroupInner> getAsync(String resourceGroupName, String locationName, String failoverGroupName) {
return getWithServiceResponseAsync(resourceGroupName, locationName, failoverGroupName).map(new Func1<ServiceResponse<InstanceFailoverGroupInner>, InstanceFailoverGroupInner>() {
... | java | public Observable<InstanceFailoverGroupInner> getAsync(String resourceGroupName, String locationName, String failoverGroupName) {
return getWithServiceResponseAsync(resourceGroupName, locationName, failoverGroupName).map(new Func1<ServiceResponse<InstanceFailoverGroupInner>, InstanceFailoverGroupInner>() {
... | [
"public",
"Observable",
"<",
"InstanceFailoverGroupInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"locationName",
",",
"String",
"failoverGroupName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"locationNa... | Gets a failover group.
@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 locationName The name of the region where the resource is located.
@param failoverGroupName The name of the failover group.
@thr... | [
"Gets",
"a",
"failover",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java#L149-L156 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/UnitCellBoundingBox.java | UnitCellBoundingBox.getTranslatedBbs | public UnitCellBoundingBox getTranslatedBbs(Vector3d translation) {
UnitCellBoundingBox translatedBbs = new UnitCellBoundingBox(numOperatorsSg, numPolyChainsAu);
for (int i=0; i<numOperatorsSg; i++) {
for (int j = 0;j<numPolyChainsAu; j++) {
translatedBbs.chainBbs[i][j] = new BoundingBox(this.chainBbs[i][j]... | java | public UnitCellBoundingBox getTranslatedBbs(Vector3d translation) {
UnitCellBoundingBox translatedBbs = new UnitCellBoundingBox(numOperatorsSg, numPolyChainsAu);
for (int i=0; i<numOperatorsSg; i++) {
for (int j = 0;j<numPolyChainsAu; j++) {
translatedBbs.chainBbs[i][j] = new BoundingBox(this.chainBbs[i][j]... | [
"public",
"UnitCellBoundingBox",
"getTranslatedBbs",
"(",
"Vector3d",
"translation",
")",
"{",
"UnitCellBoundingBox",
"translatedBbs",
"=",
"new",
"UnitCellBoundingBox",
"(",
"numOperatorsSg",
",",
"numPolyChainsAu",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | Returns a new BoundingBoxes object containing the same bounds as this
BoundingBoxes object translated by the given translation
@param translation
@return | [
"Returns",
"a",
"new",
"BoundingBoxes",
"object",
"containing",
"the",
"same",
"bounds",
"as",
"this",
"BoundingBoxes",
"object",
"translated",
"by",
"the",
"given",
"translation"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/UnitCellBoundingBox.java#L114-L126 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Locale.java | Locale.composeList | private static String[] composeList(MessageFormat format, String[] list) {
if (list.length <= 3) return list;
// Use the given format to compose the first two elements into one
String[] listItems = { list[0], list[1] };
String newItem = format.format(listItems);
// Form a new l... | java | private static String[] composeList(MessageFormat format, String[] list) {
if (list.length <= 3) return list;
// Use the given format to compose the first two elements into one
String[] listItems = { list[0], list[1] };
String newItem = format.format(listItems);
// Form a new l... | [
"private",
"static",
"String",
"[",
"]",
"composeList",
"(",
"MessageFormat",
"format",
",",
"String",
"[",
"]",
"list",
")",
"{",
"if",
"(",
"list",
".",
"length",
"<=",
"3",
")",
"return",
"list",
";",
"// Use the given format to compose the first two elements... | Given a list of strings, return a list shortened to three elements.
Shorten it by applying the given format to the first two elements
recursively.
@param format a format which takes two arguments
@param list a list of strings
@return if the list is three elements or shorter, the same list;
otherwise, a new list of thre... | [
"Given",
"a",
"list",
"of",
"strings",
"return",
"a",
"list",
"shortened",
"to",
"three",
"elements",
".",
"Shorten",
"it",
"by",
"applying",
"the",
"given",
"format",
"to",
"the",
"first",
"two",
"elements",
"recursively",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Locale.java#L2082-L2096 |
morimekta/providence | providence-config/src/main/java/net/morimekta/providence/config/impl/ProvidenceConfigParser.java | ProvidenceConfigParser.parseConfig | @Nonnull
<M extends PMessage<M, F>, F extends PField> Pair<M, Set<String>> parseConfig(@Nonnull Path configFile, @Nullable M parent)
throws ProvidenceConfigException {
try {
configFile = canonicalFileLocation(configFile);
} catch (IOException e) {
throw new Provid... | java | @Nonnull
<M extends PMessage<M, F>, F extends PField> Pair<M, Set<String>> parseConfig(@Nonnull Path configFile, @Nullable M parent)
throws ProvidenceConfigException {
try {
configFile = canonicalFileLocation(configFile);
} catch (IOException e) {
throw new Provid... | [
"@",
"Nonnull",
"<",
"M",
"extends",
"PMessage",
"<",
"M",
",",
"F",
">",
",",
"F",
"extends",
"PField",
">",
"Pair",
"<",
"M",
",",
"Set",
"<",
"String",
">",
">",
"parseConfig",
"(",
"@",
"Nonnull",
"Path",
"configFile",
",",
"@",
"Nullable",
"M"... | Parse a providence config into a message.
@param configFile The config file to be parsed.
@param parent The parent config message.
@param <M> The config message type.
@param <F> The config field type.
@return Pair of parsed config and set of included file paths.
@throws ProvidenceConfigException If parsing failed. | [
"Parse",
"a",
"providence",
"config",
"into",
"a",
"message",
"."
] | train | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-config/src/main/java/net/morimekta/providence/config/impl/ProvidenceConfigParser.java#L106-L123 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java | XsdAsmInterfaces.checkForSequenceMethod | void checkForSequenceMethod(ClassWriter classWriter, String className) {
Consumer<ClassWriter> sequenceMethodCreator = pendingSequenceMethods.get(className);
if (sequenceMethodCreator != null){
sequenceMethodCreator.accept(classWriter);
}
} | java | void checkForSequenceMethod(ClassWriter classWriter, String className) {
Consumer<ClassWriter> sequenceMethodCreator = pendingSequenceMethods.get(className);
if (sequenceMethodCreator != null){
sequenceMethodCreator.accept(classWriter);
}
} | [
"void",
"checkForSequenceMethod",
"(",
"ClassWriter",
"classWriter",
",",
"String",
"className",
")",
"{",
"Consumer",
"<",
"ClassWriter",
">",
"sequenceMethodCreator",
"=",
"pendingSequenceMethods",
".",
"get",
"(",
"className",
")",
";",
"if",
"(",
"sequenceMethod... | Verifies if there is any postponed sequence method creation in pendingSequenceMethods and performs the method if
it exists.
@param classWriter The {@link ClassWriter} object for the class that contains the postponed sequence method creation.
@param className The name of the class that contains the sequence. | [
"Verifies",
"if",
"there",
"is",
"any",
"postponed",
"sequence",
"method",
"creation",
"in",
"pendingSequenceMethods",
"and",
"performs",
"the",
"method",
"if",
"it",
"exists",
"."
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java#L867-L873 |
carrotsearch/hppc | hppc/src/main/java/com/carrotsearch/hppc/sorting/IndirectSort.java | IndirectSort.topDownMergeSort | private static void topDownMergeSort(int[] src, int[] dst, int fromIndex, int toIndex, IndirectComparator comp) {
if (toIndex - fromIndex <= MIN_LENGTH_FOR_INSERTION_SORT) {
insertionSort(fromIndex, toIndex - fromIndex, dst, comp);
return;
}
final int mid = (fromIndex + toIndex) >>> 1;
topD... | java | private static void topDownMergeSort(int[] src, int[] dst, int fromIndex, int toIndex, IndirectComparator comp) {
if (toIndex - fromIndex <= MIN_LENGTH_FOR_INSERTION_SORT) {
insertionSort(fromIndex, toIndex - fromIndex, dst, comp);
return;
}
final int mid = (fromIndex + toIndex) >>> 1;
topD... | [
"private",
"static",
"void",
"topDownMergeSort",
"(",
"int",
"[",
"]",
"src",
",",
"int",
"[",
"]",
"dst",
",",
"int",
"fromIndex",
",",
"int",
"toIndex",
",",
"IndirectComparator",
"comp",
")",
"{",
"if",
"(",
"toIndex",
"-",
"fromIndex",
"<=",
"MIN_LEN... | Perform a recursive, descending merge sort.
@param fromIndex
inclusive
@param toIndex
exclusive | [
"Perform",
"a",
"recursive",
"descending",
"merge",
"sort",
"."
] | train | https://github.com/carrotsearch/hppc/blob/e359e9da358e846fcbffc64a765611df954ba3f6/hppc/src/main/java/com/carrotsearch/hppc/sorting/IndirectSort.java#L70-L101 |
orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/TriMarkers.java | TriMarkers.getNormalVector | public static Vector3D getNormalVector(Triangle t) throws IllegalArgumentException {
if(Double.isNaN(t.p0.z) || Double.isNaN(t.p1.z) || Double.isNaN(t.p2.z)) {
throw new IllegalArgumentException("Z is required, cannot compute triangle normal of "+t);
}
double dx1 = t.p0.x - t.p1.x;
... | java | public static Vector3D getNormalVector(Triangle t) throws IllegalArgumentException {
if(Double.isNaN(t.p0.z) || Double.isNaN(t.p1.z) || Double.isNaN(t.p2.z)) {
throw new IllegalArgumentException("Z is required, cannot compute triangle normal of "+t);
}
double dx1 = t.p0.x - t.p1.x;
... | [
"public",
"static",
"Vector3D",
"getNormalVector",
"(",
"Triangle",
"t",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"t",
".",
"p0",
".",
"z",
")",
"||",
"Double",
".",
"isNaN",
"(",
"t",
".",
"p1",
".",
"z",... | Get the normal vector to this triangle, of length 1.
@param t input triangle
@return vector normal to the triangle. | [
"Get",
"the",
"normal",
"vector",
"to",
"this",
"triangle",
"of",
"length",
"1",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/TriMarkers.java#L171-L182 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/options/navigation/impl/ConfigurationContextImpl.java | ConfigurationContextImpl.createGlobalContext | @Override
public <G extends GlobalContext<?, ?>> G createGlobalContext(Class<? extends G> globalContextImplType,
final Class<? extends EntityContext<?, ?>> entityContextImplType, Class<? extends PropertyContext<?, ?>> propertyContextImplType) {
// ByteBuddyState#resolveClassLoadingStrategy static method is an Hi... | java | @Override
public <G extends GlobalContext<?, ?>> G createGlobalContext(Class<? extends G> globalContextImplType,
final Class<? extends EntityContext<?, ?>> entityContextImplType, Class<? extends PropertyContext<?, ?>> propertyContextImplType) {
// ByteBuddyState#resolveClassLoadingStrategy static method is an Hi... | [
"@",
"Override",
"public",
"<",
"G",
"extends",
"GlobalContext",
"<",
"?",
",",
"?",
">",
">",
"G",
"createGlobalContext",
"(",
"Class",
"<",
"?",
"extends",
"G",
">",
"globalContextImplType",
",",
"final",
"Class",
"<",
"?",
"extends",
"EntityContext",
"<... | Creates a new {@link GlobalContext} object based on the given context implementation types. All implementation
types must declare a public or protected constructor with a single parameter, accepting {@link ConfigurationContext}.
<p>
Each context implementation type must provide an implementation of the method(s) declar... | [
"Creates",
"a",
"new",
"{",
"@link",
"GlobalContext",
"}",
"object",
"based",
"on",
"the",
"given",
"context",
"implementation",
"types",
".",
"All",
"implementation",
"types",
"must",
"declare",
"a",
"public",
"or",
"protected",
"constructor",
"with",
"a",
"s... | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/options/navigation/impl/ConfigurationContextImpl.java#L110-L129 |
SixDimensions/Component-Bindings-Provider | impl/src/main/java/com/sixdimensions/wcm/cq/component/bindings/impl/ComponentBindingsProviderCache.java | ComponentBindingsProviderCache.getReferences | public List<ServiceReference> getReferences(String resourceType) {
List<ServiceReference> references = new ArrayList<ServiceReference>();
if (containsKey(resourceType)) {
references.addAll(get(resourceType));
Collections.sort(references, new Comparator<ServiceReference>() {
@Override
public int compar... | java | public List<ServiceReference> getReferences(String resourceType) {
List<ServiceReference> references = new ArrayList<ServiceReference>();
if (containsKey(resourceType)) {
references.addAll(get(resourceType));
Collections.sort(references, new Comparator<ServiceReference>() {
@Override
public int compar... | [
"public",
"List",
"<",
"ServiceReference",
">",
"getReferences",
"(",
"String",
"resourceType",
")",
"{",
"List",
"<",
"ServiceReference",
">",
"references",
"=",
"new",
"ArrayList",
"<",
"ServiceReference",
">",
"(",
")",
";",
"if",
"(",
"containsKey",
"(",
... | Gets the ComponentBindingProvider references for the specified resource
type.
@param resourceType
the resource type for which to retrieve the references
@return the references for the resource type | [
"Gets",
"the",
"ComponentBindingProvider",
"references",
"for",
"the",
"specified",
"resource",
"type",
"."
] | train | https://github.com/SixDimensions/Component-Bindings-Provider/blob/1d4da2f8c274d32edcd0a2593bec1255b8340b5b/impl/src/main/java/com/sixdimensions/wcm/cq/component/bindings/impl/ComponentBindingsProviderCache.java#L61-L80 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/xml/XmlUtil.java | XmlUtil.printDocument | public static void printDocument(Node _docOrNode, OutputStream _outStream) throws IOException {
if (_docOrNode == null || _outStream == null) {
throw new IOException("Cannot print (on) 'null' object");
}
TransformerFactory tf = TransformerFactory.newInstance();
Transformer t... | java | public static void printDocument(Node _docOrNode, OutputStream _outStream) throws IOException {
if (_docOrNode == null || _outStream == null) {
throw new IOException("Cannot print (on) 'null' object");
}
TransformerFactory tf = TransformerFactory.newInstance();
Transformer t... | [
"public",
"static",
"void",
"printDocument",
"(",
"Node",
"_docOrNode",
",",
"OutputStream",
"_outStream",
")",
"throws",
"IOException",
"{",
"if",
"(",
"_docOrNode",
"==",
"null",
"||",
"_outStream",
"==",
"null",
")",
"{",
"throw",
"new",
"IOException",
"(",... | Dump a {@link Document} or {@link Node}-compatible object to the given {@link OutputStream} (e.g. System.out).
@param _docOrNode {@link Document} or {@link Node} object
@param _outStream {@link OutputStream} to print on
@throws IOException on error | [
"Dump",
"a",
"{",
"@link",
"Document",
"}",
"or",
"{",
"@link",
"Node",
"}",
"-",
"compatible",
"object",
"to",
"the",
"given",
"{",
"@link",
"OutputStream",
"}",
"(",
"e",
".",
"g",
".",
"System",
".",
"out",
")",
"."
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/xml/XmlUtil.java#L208-L229 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/RedundentExprEliminator.java | RedundentExprEliminator.eleminateSharedPartialPaths | protected void eleminateSharedPartialPaths(ElemTemplateElement psuedoVarRecipient, Vector paths)
{
MultistepExprHolder list = createMultistepExprList(paths);
if(null != list)
{
if(DIAGNOSE_MULTISTEPLIST)
list.diagnose();
boolean isGlobal = (paths == m_absPaths);
... | java | protected void eleminateSharedPartialPaths(ElemTemplateElement psuedoVarRecipient, Vector paths)
{
MultistepExprHolder list = createMultistepExprList(paths);
if(null != list)
{
if(DIAGNOSE_MULTISTEPLIST)
list.diagnose();
boolean isGlobal = (paths == m_absPaths);
... | [
"protected",
"void",
"eleminateSharedPartialPaths",
"(",
"ElemTemplateElement",
"psuedoVarRecipient",
",",
"Vector",
"paths",
")",
"{",
"MultistepExprHolder",
"list",
"=",
"createMultistepExprList",
"(",
"paths",
")",
";",
"if",
"(",
"null",
"!=",
"list",
")",
"{",
... | Eliminate the shared partial paths in the expression list.
@param psuedoVarRecipient The recipient of the psuedo vars.
@param paths A vector of paths that hold ExpressionOwner objects,
which must yield LocationPathIterators. | [
"Eliminate",
"the",
"shared",
"partial",
"paths",
"in",
"the",
"expression",
"list",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/RedundentExprEliminator.java#L152-L177 |
Mangopay/mangopay2-java-sdk | src/main/java/com/mangopay/core/UrlTool.java | UrlTool.getRestUrl | public String getRestUrl(String urlKey, Boolean addClientId, Pagination pagination, Map<String, String> additionalUrlParams) throws UnsupportedEncodingException {
String url;
if (!addClientId) {
url = "/v2.01" + urlKey;
} else {
url = "/v2.01/" + root.getConfig().getCli... | java | public String getRestUrl(String urlKey, Boolean addClientId, Pagination pagination, Map<String, String> additionalUrlParams) throws UnsupportedEncodingException {
String url;
if (!addClientId) {
url = "/v2.01" + urlKey;
} else {
url = "/v2.01/" + root.getConfig().getCli... | [
"public",
"String",
"getRestUrl",
"(",
"String",
"urlKey",
",",
"Boolean",
"addClientId",
",",
"Pagination",
"pagination",
",",
"Map",
"<",
"String",
",",
"String",
">",
"additionalUrlParams",
")",
"throws",
"UnsupportedEncodingException",
"{",
"String",
"url",
";... | Gets REST url.
@param urlKey Url key.
@param addClientId Denotes whether client identifier should be composed into final url.
@param pagination Pagination object.
@param additionalUrlParams Additional parameters.
@return Final REST url.
@throws UnsupportedEncodingException | [
"Gets",
"REST",
"url",
"."
] | train | https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/UrlTool.java#L85-L110 |
carewebframework/carewebframework-vista | org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/Version.java | Version.appendVersion | private void appendVersion(StringBuilder sb, long ver) {
if (sb.length() > 0) {
sb.append(".");
}
sb.append(ver);
} | java | private void appendVersion(StringBuilder sb, long ver) {
if (sb.length() > 0) {
sb.append(".");
}
sb.append(ver);
} | [
"private",
"void",
"appendVersion",
"(",
"StringBuilder",
"sb",
",",
"long",
"ver",
")",
"{",
"if",
"(",
"sb",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"sb",
".",
"append",
"(",
"\".\"",
")",
";",
"}",
"sb",
".",
"append",
"(",
"ver",
")",
... | Append version component.
@param sb String builder.
@param ver Version component value. | [
"Append",
"version",
"component",
"."
] | train | https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/Version.java#L109-L115 |
alkacon/opencms-core | src/org/opencms/ade/containerpage/shared/CmsContainerElementData.java | CmsContainerElementData.getFormatedIndividualSettings | public List<CmsAdditionalInfoBean> getFormatedIndividualSettings(String containerId) {
List<CmsAdditionalInfoBean> result = new ArrayList<CmsAdditionalInfoBean>();
CmsFormatterConfig config = getFormatterConfig(containerId);
if ((m_settings != null) && (config != null)) {
for (Entry... | java | public List<CmsAdditionalInfoBean> getFormatedIndividualSettings(String containerId) {
List<CmsAdditionalInfoBean> result = new ArrayList<CmsAdditionalInfoBean>();
CmsFormatterConfig config = getFormatterConfig(containerId);
if ((m_settings != null) && (config != null)) {
for (Entry... | [
"public",
"List",
"<",
"CmsAdditionalInfoBean",
">",
"getFormatedIndividualSettings",
"(",
"String",
"containerId",
")",
"{",
"List",
"<",
"CmsAdditionalInfoBean",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"CmsAdditionalInfoBean",
">",
"(",
")",
";",
"CmsFormatte... | Returns the individual element settings formated with nice-names to be used as additional-info.<p>
@param containerId the container id
@return the settings list | [
"Returns",
"the",
"individual",
"element",
"settings",
"formated",
"with",
"nice",
"-",
"names",
"to",
"be",
"used",
"as",
"additional",
"-",
"info",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/containerpage/shared/CmsContainerElementData.java#L144-L162 |
stratosphere/stratosphere | stratosphere-clients/src/main/java/eu/stratosphere/client/web/JobsInfoServlet.java | JobsInfoServlet.getJMConnection | private ExtendedManagementProtocol getJMConnection() throws IOException {
String jmHost = config.getString(ConfigConstants.JOB_MANAGER_IPC_ADDRESS_KEY, null);
String jmPort = config.getString(ConfigConstants.JOB_MANAGER_IPC_PORT_KEY, null);
return RPC.getProxy(ExtendedManagementProtocol.class,
new InetSock... | java | private ExtendedManagementProtocol getJMConnection() throws IOException {
String jmHost = config.getString(ConfigConstants.JOB_MANAGER_IPC_ADDRESS_KEY, null);
String jmPort = config.getString(ConfigConstants.JOB_MANAGER_IPC_PORT_KEY, null);
return RPC.getProxy(ExtendedManagementProtocol.class,
new InetSock... | [
"private",
"ExtendedManagementProtocol",
"getJMConnection",
"(",
")",
"throws",
"IOException",
"{",
"String",
"jmHost",
"=",
"config",
".",
"getString",
"(",
"ConfigConstants",
".",
"JOB_MANAGER_IPC_ADDRESS_KEY",
",",
"null",
")",
";",
"String",
"jmPort",
"=",
"conf... | Sets up a connection to the JobManager.
@return Connection to the JobManager.
@throws IOException | [
"Sets",
"up",
"a",
"connection",
"to",
"the",
"JobManager",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-clients/src/main/java/eu/stratosphere/client/web/JobsInfoServlet.java#L104-L110 |
jenkinsci/jenkins | core/src/main/java/hudson/model/Items.java | Items.whileUpdatingByXml | public static <V,T extends Throwable> V whileUpdatingByXml(Callable<V,T> callable) throws T {
updatingByXml.set(true);
try {
return callable.call();
} finally {
updatingByXml.set(false);
}
} | java | public static <V,T extends Throwable> V whileUpdatingByXml(Callable<V,T> callable) throws T {
updatingByXml.set(true);
try {
return callable.call();
} finally {
updatingByXml.set(false);
}
} | [
"public",
"static",
"<",
"V",
",",
"T",
"extends",
"Throwable",
">",
"V",
"whileUpdatingByXml",
"(",
"Callable",
"<",
"V",
",",
"T",
">",
"callable",
")",
"throws",
"T",
"{",
"updatingByXml",
".",
"set",
"(",
"true",
")",
";",
"try",
"{",
"return",
"... | Runs a block while making {@link #currentlyUpdatingByXml} be temporarily true.
Use this when you are creating or changing an item.
@param <V> a return value type (may be {@link Void})
@param <T> an error type (may be {@link Error})
@param callable a block, typically running {@link #load} or {@link Item#onLoad}
@return ... | [
"Runs",
"a",
"block",
"while",
"making",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Items.java#L133-L140 |
meertensinstituut/mtas | src/main/java/mtas/search/spans/util/MtasIgnoreItem.java | MtasIgnoreItem.getMaxEndPosition | public int getMaxEndPosition(int docId, int position) throws IOException {
if (ignoreSpans != null && docId == currentDocId) {
if (position < minimumPosition) {
throw new IOException(
"Unexpected position, should be >= " + minimumPosition + "!");
}
computeFullEndPositionList(po... | java | public int getMaxEndPosition(int docId, int position) throws IOException {
if (ignoreSpans != null && docId == currentDocId) {
if (position < minimumPosition) {
throw new IOException(
"Unexpected position, should be >= " + minimumPosition + "!");
}
computeFullEndPositionList(po... | [
"public",
"int",
"getMaxEndPosition",
"(",
"int",
"docId",
",",
"int",
"position",
")",
"throws",
"IOException",
"{",
"if",
"(",
"ignoreSpans",
"!=",
"null",
"&&",
"docId",
"==",
"currentDocId",
")",
"{",
"if",
"(",
"position",
"<",
"minimumPosition",
")",
... | Gets the max end position.
@param docId the doc id
@param position the position
@return the max end position
@throws IOException Signals that an I/O exception has occurred. | [
"Gets",
"the",
"max",
"end",
"position",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/search/spans/util/MtasIgnoreItem.java#L144-L159 |
bladecoder/blade-ink | src/main/java/com/bladecoder/ink/runtime/CallStack.java | CallStack.getTemporaryVariableWithName | public RTObject getTemporaryVariableWithName(String name, int contextIndex) {
if (contextIndex == -1)
contextIndex = getCurrentElementIndex() + 1;
Element contextElement = getCallStack().get(contextIndex - 1);
RTObject varValue = contextElement.temporaryVariables.get(name);
return varValue;
} | java | public RTObject getTemporaryVariableWithName(String name, int contextIndex) {
if (contextIndex == -1)
contextIndex = getCurrentElementIndex() + 1;
Element contextElement = getCallStack().get(contextIndex - 1);
RTObject varValue = contextElement.temporaryVariables.get(name);
return varValue;
} | [
"public",
"RTObject",
"getTemporaryVariableWithName",
"(",
"String",
"name",
",",
"int",
"contextIndex",
")",
"{",
"if",
"(",
"contextIndex",
"==",
"-",
"1",
")",
"contextIndex",
"=",
"getCurrentElementIndex",
"(",
")",
"+",
"1",
";",
"Element",
"contextElement"... | Get variable value, dereferencing a variable pointer if necessary | [
"Get",
"variable",
"value",
"dereferencing",
"a",
"variable",
"pointer",
"if",
"necessary"
] | train | https://github.com/bladecoder/blade-ink/blob/930922099f7073f50f956479adaa3cbd47c70225/src/main/java/com/bladecoder/ink/runtime/CallStack.java#L249-L257 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/listener/FallbackEventHandler.java | FallbackEventHandler.handleEventMessage | public String handleEventMessage(String message, Object msgdoc, Map<String,String> metaInfo)
throws EventHandlerException {
String msg;
int code;
if (msgdoc == null) {
msg = "failed to parse XML message";
code = ListenerHelper.RETURN_STATUS_NON_XML;
} ... | java | public String handleEventMessage(String message, Object msgdoc, Map<String,String> metaInfo)
throws EventHandlerException {
String msg;
int code;
if (msgdoc == null) {
msg = "failed to parse XML message";
code = ListenerHelper.RETURN_STATUS_NON_XML;
} ... | [
"public",
"String",
"handleEventMessage",
"(",
"String",
"message",
",",
"Object",
"msgdoc",
",",
"Map",
"<",
"String",
",",
"String",
">",
"metaInfo",
")",
"throws",
"EventHandlerException",
"{",
"String",
"msg",
";",
"int",
"code",
";",
"if",
"(",
"msgdoc"... | The handler creates a standard error response message.
The status code and status message are set in the following
ways:
<ul>
<li>If the message cannot be parsed by the generic XML Bean,
the status code is set to -2 and the status message is
status message "failed to parse XML message"</li>
<li>If there is no matching ... | [
"The",
"handler",
"creates",
"a",
"standard",
"error",
"response",
"message",
".",
"The",
"status",
"code",
"and",
"status",
"message",
"are",
"set",
"in",
"the",
"following",
"ways",
":",
"<ul",
">",
"<li",
">",
"If",
"the",
"message",
"cannot",
"be",
"... | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/listener/FallbackEventHandler.java#L83-L109 |
ben-manes/caffeine | caffeine/src/main/java/com/github/benmanes/caffeine/cache/CaffeineSpec.java | CaffeineSpec.durationInNanos | static long durationInNanos(long duration, @Nullable TimeUnit unit) {
return (unit == null) ? UNSET_INT : unit.toNanos(duration);
} | java | static long durationInNanos(long duration, @Nullable TimeUnit unit) {
return (unit == null) ? UNSET_INT : unit.toNanos(duration);
} | [
"static",
"long",
"durationInNanos",
"(",
"long",
"duration",
",",
"@",
"Nullable",
"TimeUnit",
"unit",
")",
"{",
"return",
"(",
"unit",
"==",
"null",
")",
"?",
"UNSET_INT",
":",
"unit",
".",
"toNanos",
"(",
"duration",
")",
";",
"}"
] | Converts an expiration duration/unit pair into a single long for hashing and equality. | [
"Converts",
"an",
"expiration",
"duration",
"/",
"unit",
"pair",
"into",
"a",
"single",
"long",
"for",
"hashing",
"and",
"equality",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/caffeine/src/main/java/com/github/benmanes/caffeine/cache/CaffeineSpec.java#L361-L363 |
drinkjava2/jDialects | core/src/main/java/com/github/drinkjava2/jdialects/ClassCacheUtils.java | ClassCacheUtils.getClassFieldReadMethod | public static Method getClassFieldReadMethod(Class<?> clazz, String fieldName) {
return getClassReadMethods(clazz).get(fieldName);
} | java | public static Method getClassFieldReadMethod(Class<?> clazz, String fieldName) {
return getClassReadMethods(clazz).get(fieldName);
} | [
"public",
"static",
"Method",
"getClassFieldReadMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"fieldName",
")",
"{",
"return",
"getClassReadMethods",
"(",
"clazz",
")",
".",
"get",
"(",
"fieldName",
")",
";",
"}"
] | Return cached class field read method to avoid each time use reflect | [
"Return",
"cached",
"class",
"field",
"read",
"method",
"to",
"avoid",
"each",
"time",
"use",
"reflect"
] | train | https://github.com/drinkjava2/jDialects/blob/1c165f09c6042a599b681c279024abcc1b848b88/core/src/main/java/com/github/drinkjava2/jdialects/ClassCacheUtils.java#L162-L164 |
craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.addFile | public void addFile( final String path, final File source, final int mode, final int dirmode, final Directive directive, final String uname, final String gname, final boolean addParents) throws NoSuchAlgorithmException, IOException {
contents.addFile( path, source, mode, directive, uname, gname, dirmode, addPar... | java | public void addFile( final String path, final File source, final int mode, final int dirmode, final Directive directive, final String uname, final String gname, final boolean addParents) throws NoSuchAlgorithmException, IOException {
contents.addFile( path, source, mode, directive, uname, gname, dirmode, addPar... | [
"public",
"void",
"addFile",
"(",
"final",
"String",
"path",
",",
"final",
"File",
"source",
",",
"final",
"int",
"mode",
",",
"final",
"int",
"dirmode",
",",
"final",
"Directive",
"directive",
",",
"final",
"String",
"uname",
",",
"final",
"String",
"gnam... | Add the specified file to the repository payload in order.
The required header entries will automatically be generated
to record the directory names and file names, as well as their
digests.
@param path the absolute path at which this file will be installed.
@param source the file content to include in this rpm.
@para... | [
"Add",
"the",
"specified",
"file",
"to",
"the",
"repository",
"payload",
"in",
"order",
".",
"The",
"required",
"header",
"entries",
"will",
"automatically",
"be",
"generated",
"to",
"record",
"the",
"directory",
"names",
"and",
"file",
"names",
"as",
"well",
... | train | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L942-L944 |
ops4j/org.ops4j.pax.logging | pax-logging-log4j2/src/main/java/org/ops4j/pax/logging/log4j2/internal/PaxLoggingServiceImpl.java | PaxLoggingServiceImpl.setLevelToJavaLogging | private static void setLevelToJavaLogging( final Dictionary<String, ?> configuration )
{
for( Enumeration enum_ = java.util.logging.LogManager.getLogManager().getLoggerNames(); enum_.hasMoreElements();) {
String name = (String) enum_.nextElement();
java.util.logging.Logger.getLogger(... | java | private static void setLevelToJavaLogging( final Dictionary<String, ?> configuration )
{
for( Enumeration enum_ = java.util.logging.LogManager.getLogManager().getLoggerNames(); enum_.hasMoreElements();) {
String name = (String) enum_.nextElement();
java.util.logging.Logger.getLogger(... | [
"private",
"static",
"void",
"setLevelToJavaLogging",
"(",
"final",
"Dictionary",
"<",
"String",
",",
"?",
">",
"configuration",
")",
"{",
"for",
"(",
"Enumeration",
"enum_",
"=",
"java",
".",
"util",
".",
"logging",
".",
"LogManager",
".",
"getLogManager",
... | Configure Java Util Logging according to the provided configuration.
Convert the log4j configuration to JUL config.
It's necessary to do that, because with pax logging, JUL loggers are not replaced.
So we need to configure JUL loggers in order that log messages goes correctly to log Handlers.
@param configuration Pro... | [
"Configure",
"Java",
"Util",
"Logging",
"according",
"to",
"the",
"provided",
"configuration",
".",
"Convert",
"the",
"log4j",
"configuration",
"to",
"JUL",
"config",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-log4j2/src/main/java/org/ops4j/pax/logging/log4j2/internal/PaxLoggingServiceImpl.java#L485-L512 |
apache/groovy | subprojects/groovy-xml/src/main/java/groovy/xml/MarkupBuilder.java | MarkupBuilder.escapeXmlValue | private String escapeXmlValue(String value, boolean isAttrValue) {
if (value == null)
throw new IllegalArgumentException();
return StringGroovyMethods.collectReplacements(value, new ReplacingClosure(isAttrValue, useDoubleQuotes));
} | java | private String escapeXmlValue(String value, boolean isAttrValue) {
if (value == null)
throw new IllegalArgumentException();
return StringGroovyMethods.collectReplacements(value, new ReplacingClosure(isAttrValue, useDoubleQuotes));
} | [
"private",
"String",
"escapeXmlValue",
"(",
"String",
"value",
",",
"boolean",
"isAttrValue",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"return",
"StringGroovyMethods",
".",
"collectReplacements",
... | Escapes a string so that it can be used in XML text successfully.
It replaces the following characters with the corresponding XML
entities:
<ul>
<li>& as &amp;</li>
<li>< as &lt;</li>
<li>> as &gt;</li>
</ul>
If the string is to be added as an attribute value, these
characters are also escaped:
<u... | [
"Escapes",
"a",
"string",
"so",
"that",
"it",
"can",
"be",
"used",
"in",
"XML",
"text",
"successfully",
".",
"It",
"replaces",
"the",
"following",
"characters",
"with",
"the",
"corresponding",
"XML",
"entities",
":",
"<ul",
">",
"<li",
">",
"&",
";",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/xml/MarkupBuilder.java#L390-L394 |
OpenLiberty/open-liberty | dev/com.ibm.ws.concurrent/src/com/ibm/ws/concurrent/internal/ManagedExecutorServiceImpl.java | ManagedExecutorServiceImpl.getExecutionProperties | final Map<String, String> getExecutionProperties(Object task) {
if (task == null) // NullPointerException is required per the JavaDoc API
throw new NullPointerException(Tr.formatMessage(tc, "CWWKC1111.task.invalid", (Object) null));
Map<String, String> execProps = task instanceof ManagedTas... | java | final Map<String, String> getExecutionProperties(Object task) {
if (task == null) // NullPointerException is required per the JavaDoc API
throw new NullPointerException(Tr.formatMessage(tc, "CWWKC1111.task.invalid", (Object) null));
Map<String, String> execProps = task instanceof ManagedTas... | [
"final",
"Map",
"<",
"String",
",",
"String",
">",
"getExecutionProperties",
"(",
"Object",
"task",
")",
"{",
"if",
"(",
"task",
"==",
"null",
")",
"// NullPointerException is required per the JavaDoc API",
"throw",
"new",
"NullPointerException",
"(",
"Tr",
".",
"... | Returns execution properties for the task.
@param task the task being submitted for execution.
@return execution properties for the task. | [
"Returns",
"execution",
"properties",
"for",
"the",
"task",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.concurrent/src/com/ibm/ws/concurrent/internal/ManagedExecutorServiceImpl.java#L367-L385 |
alkacon/opencms-core | src/org/opencms/repository/CmsRepositoryFilter.java | CmsRepositoryFilter.isPartialMatch | private boolean isPartialMatch(Pattern pattern, String path) {
Matcher matcher = pattern.matcher(path);
if (matcher.matches()) {
return true;
}
if (!path.endsWith("/")) {
matcher = pattern.matcher(path + "/");
return matcher.matches();
}
... | java | private boolean isPartialMatch(Pattern pattern, String path) {
Matcher matcher = pattern.matcher(path);
if (matcher.matches()) {
return true;
}
if (!path.endsWith("/")) {
matcher = pattern.matcher(path + "/");
return matcher.matches();
}
... | [
"private",
"boolean",
"isPartialMatch",
"(",
"Pattern",
"pattern",
",",
"String",
"path",
")",
"{",
"Matcher",
"matcher",
"=",
"pattern",
".",
"matcher",
"(",
"path",
")",
";",
"if",
"(",
"matcher",
".",
"matches",
"(",
")",
")",
"{",
"return",
"true",
... | Returns if the given path matches or partially matches the pattern.<p>
For example the regex "/system/modules/" should match the path "/system/".
That's not working with Java 1.4. Starting with Java 1.5 there are possiblities
to do that. Until then you have to configure all parent paths as a regex filter.<p>
@param p... | [
"Returns",
"if",
"the",
"given",
"path",
"matches",
"or",
"partially",
"matches",
"the",
"pattern",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/repository/CmsRepositoryFilter.java#L174-L188 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java | DateTimeFormatterBuilder.appendShortText | public DateTimeFormatterBuilder appendShortText(DateTimeFieldType fieldType) {
if (fieldType == null) {
throw new IllegalArgumentException("Field type must not be null");
}
return append0(new TextField(fieldType, true));
} | java | public DateTimeFormatterBuilder appendShortText(DateTimeFieldType fieldType) {
if (fieldType == null) {
throw new IllegalArgumentException("Field type must not be null");
}
return append0(new TextField(fieldType, true));
} | [
"public",
"DateTimeFormatterBuilder",
"appendShortText",
"(",
"DateTimeFieldType",
"fieldType",
")",
"{",
"if",
"(",
"fieldType",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Field type must not be null\"",
")",
";",
"}",
"return",
"appe... | Instructs the printer to emit a field value as short text, and the
parser to expect text.
@param fieldType type of field to append
@return this DateTimeFormatterBuilder, for chaining
@throws IllegalArgumentException if field type is null | [
"Instructs",
"the",
"printer",
"to",
"emit",
"a",
"field",
"value",
"as",
"short",
"text",
"and",
"the",
"parser",
"to",
"expect",
"text",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java#L549-L554 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java | AipImageSearch.productUpdateUrl | public JSONObject productUpdateUrl(String url, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("url", url);
if (options != null) {
request.addBody(options);
}
request.setUri(ImageSearchC... | java | public JSONObject productUpdateUrl(String url, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("url", url);
if (options != null) {
request.addBody(options);
}
request.setUri(ImageSearchC... | [
"public",
"JSONObject",
"productUpdateUrl",
"(",
"String",
"url",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"request",
... | 商品检索—更新接口
**更新图库中图片的摘要和分类信息(具体变量为brief、class_id1/class_id2)**
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key: value都为string类型
options - options列表:
brief 更新的摘要信息,最长256B。样例:{"name":"周杰伦", "id":"666"}
class_id1 更新的商品分类1,支持1... | [
"商品检索—更新接口",
"**",
"更新图库中图片的摘要和分类信息(具体变量为brief、class_id1",
"/",
"class_id2)",
"**"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java#L893-L904 |
jbundle/jbundle | main/screen/src/main/java/org/jbundle/main/user/screen/UserPasswordChange.java | UserPasswordChange.addToolbars | public ToolScreen addToolbars()
{
ToolScreen screen = new ToolScreen(null, this, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null);
new SCannedBox(screen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), screen, null, ScreenConstants.DEFAULT_DISPLAY, MenuConstants.SUBMIT)... | java | public ToolScreen addToolbars()
{
ToolScreen screen = new ToolScreen(null, this, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null);
new SCannedBox(screen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), screen, null, ScreenConstants.DEFAULT_DISPLAY, MenuConstants.SUBMIT)... | [
"public",
"ToolScreen",
"addToolbars",
"(",
")",
"{",
"ToolScreen",
"screen",
"=",
"new",
"ToolScreen",
"(",
"null",
",",
"this",
",",
"null",
",",
"ScreenConstants",
".",
"DONT_DISPLAY_FIELD_DESC",
",",
"null",
")",
";",
"new",
"SCannedBox",
"(",
"screen",
... | Add the toolbars that belong with this screen.
@return The new toolbar. | [
"Add",
"the",
"toolbars",
"that",
"belong",
"with",
"this",
"screen",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/screen/src/main/java/org/jbundle/main/user/screen/UserPasswordChange.java#L78-L86 |
biezhi/webp-io | src/main/java/io/github/biezhi/webp/WebpIO.java | WebpIO.toWEBP | public void toWEBP(String src, String dest) {
toWEBP(new File(src), new File(dest));
} | java | public void toWEBP(String src, String dest) {
toWEBP(new File(src), new File(dest));
} | [
"public",
"void",
"toWEBP",
"(",
"String",
"src",
",",
"String",
"dest",
")",
"{",
"toWEBP",
"(",
"new",
"File",
"(",
"src",
")",
",",
"new",
"File",
"(",
"dest",
")",
")",
";",
"}"
] | Convert normal image to webp file
@param src nomal image path
@param dest webp file path | [
"Convert",
"normal",
"image",
"to",
"webp",
"file"
] | train | https://github.com/biezhi/webp-io/blob/8eefe535087b3abccacff76de2b6e27bb7301bcc/src/main/java/io/github/biezhi/webp/WebpIO.java#L97-L99 |
Cleveroad/AdaptiveTableLayout | library/src/main/java/com/cleveroad/adaptivetablelayout/AdaptiveTableManager.java | AdaptiveTableManager.switchTwoRows | void switchTwoRows(int rowIndex, int rowToIndex) {
checkForInit();
int cellData = mRowHeights[rowToIndex];
mRowHeights[rowToIndex] = mRowHeights[rowIndex];
mRowHeights[rowIndex] = cellData;
} | java | void switchTwoRows(int rowIndex, int rowToIndex) {
checkForInit();
int cellData = mRowHeights[rowToIndex];
mRowHeights[rowToIndex] = mRowHeights[rowIndex];
mRowHeights[rowIndex] = cellData;
} | [
"void",
"switchTwoRows",
"(",
"int",
"rowIndex",
",",
"int",
"rowToIndex",
")",
"{",
"checkForInit",
"(",
")",
";",
"int",
"cellData",
"=",
"mRowHeights",
"[",
"rowToIndex",
"]",
";",
"mRowHeights",
"[",
"rowToIndex",
"]",
"=",
"mRowHeights",
"[",
"rowIndex"... | Switch 2 items in array with rows data
@param rowIndex from row index
@param rowToIndex to row index | [
"Switch",
"2",
"items",
"in",
"array",
"with",
"rows",
"data"
] | train | https://github.com/Cleveroad/AdaptiveTableLayout/blob/188213b35e05e635497b03fe741799782dde7208/library/src/main/java/com/cleveroad/adaptivetablelayout/AdaptiveTableManager.java#L354-L359 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java | Types.makeArrayType | public ArrayType makeArrayType(Type t) {
if (t.hasTag(VOID) || t.hasTag(PACKAGE)) {
Assert.error("Type t must not be a VOID or PACKAGE type, " + t.toString());
}
return new ArrayType(t, syms.arrayClass);
} | java | public ArrayType makeArrayType(Type t) {
if (t.hasTag(VOID) || t.hasTag(PACKAGE)) {
Assert.error("Type t must not be a VOID or PACKAGE type, " + t.toString());
}
return new ArrayType(t, syms.arrayClass);
} | [
"public",
"ArrayType",
"makeArrayType",
"(",
"Type",
"t",
")",
"{",
"if",
"(",
"t",
".",
"hasTag",
"(",
"VOID",
")",
"||",
"t",
".",
"hasTag",
"(",
"PACKAGE",
")",
")",
"{",
"Assert",
".",
"error",
"(",
"\"Type t must not be a VOID or PACKAGE type, \"",
"+... | Returns an ArrayType with the component type t
@param t The component type of the ArrayType
@return the ArrayType for the given component | [
"Returns",
"an",
"ArrayType",
"with",
"the",
"component",
"type",
"t"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java#L1832-L1837 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/TitlePaneMenuButtonPainter.java | TitlePaneMenuButtonPainter.decodeMarkBorder | private Shape decodeMarkBorder(int width, int height) {
double left = width / 2.0 - 4;
double top = height / 2.0 - 4;
path.reset();
path.moveTo(left + 0, top + 0);
path.lineTo(left + 8, top);
path.lineTo(left + 4, top + 6);
path.closePath();
return path... | java | private Shape decodeMarkBorder(int width, int height) {
double left = width / 2.0 - 4;
double top = height / 2.0 - 4;
path.reset();
path.moveTo(left + 0, top + 0);
path.lineTo(left + 8, top);
path.lineTo(left + 4, top + 6);
path.closePath();
return path... | [
"private",
"Shape",
"decodeMarkBorder",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"double",
"left",
"=",
"width",
"/",
"2.0",
"-",
"4",
";",
"double",
"top",
"=",
"height",
"/",
"2.0",
"-",
"4",
";",
"path",
".",
"reset",
"(",
")",
";",
... | Create the mark border shape.
@param width the width.
@param height the height.
@return the shape of the mark border. | [
"Create",
"the",
"mark",
"border",
"shape",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TitlePaneMenuButtonPainter.java#L255-L266 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/photos/geo/GeoInterface.java | GeoInterface.batchCorrectLocation | public void batchCorrectLocation(GeoData location, String placeId, String woeId) throws FlickrException {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("method", METHOD_BATCH_CORRECT_LOCATION);
if (placeId != null) {
parameters.put("place_id", p... | java | public void batchCorrectLocation(GeoData location, String placeId, String woeId) throws FlickrException {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("method", METHOD_BATCH_CORRECT_LOCATION);
if (placeId != null) {
parameters.put("place_id", p... | [
"public",
"void",
"batchCorrectLocation",
"(",
"GeoData",
"location",
",",
"String",
"placeId",
",",
"String",
"woeId",
")",
"throws",
"FlickrException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
"=",
"new",
"HashMap",
"<",
"String",
",",
... | Correct the places hierarchy for all the photos for a user at a given latitude, longitude and accuracy.
<p>
Batch corrections are processed in a delayed queue so it may take a few minutes before the changes are reflected in a user's photos.
@param location
The latitude/longitude and accuracy of the photos to be updat... | [
"Correct",
"the",
"places",
"hierarchy",
"for",
"all",
"the",
"photos",
"for",
"a",
"user",
"at",
"a",
"given",
"latitude",
"longitude",
"and",
"accuracy",
".",
"<p",
">"
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photos/geo/GeoInterface.java#L226-L247 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDOAuth2UserDaoImpl.java | GeneratedDOAuth2UserDaoImpl.queryByRoles | public Iterable<DOAuth2User> queryByRoles(java.lang.Object roles) {
return queryByField(null, DOAuth2UserMapper.Field.ROLES.getFieldName(), roles);
} | java | public Iterable<DOAuth2User> queryByRoles(java.lang.Object roles) {
return queryByField(null, DOAuth2UserMapper.Field.ROLES.getFieldName(), roles);
} | [
"public",
"Iterable",
"<",
"DOAuth2User",
">",
"queryByRoles",
"(",
"java",
".",
"lang",
".",
"Object",
"roles",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DOAuth2UserMapper",
".",
"Field",
".",
"ROLES",
".",
"getFieldName",
"(",
")",
",",
"rol... | query-by method for field roles
@param roles the specified attribute
@return an Iterable of DOAuth2Users for the specified roles | [
"query",
"-",
"by",
"method",
"for",
"field",
"roles"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDOAuth2UserDaoImpl.java#L115-L117 |
google/j2objc | translator/src/main/java/com/google/devtools/j2objc/translate/DeadCodeEliminator.java | DeadCodeEliminator.removeDeadFields | private void removeDeadFields(String clazz, List<BodyDeclaration> declarations) {
Iterator<BodyDeclaration> declarationsIter = declarations.iterator();
while (declarationsIter.hasNext()) {
BodyDeclaration declaration = declarationsIter.next();
if (declaration instanceof FieldDeclaration) {
F... | java | private void removeDeadFields(String clazz, List<BodyDeclaration> declarations) {
Iterator<BodyDeclaration> declarationsIter = declarations.iterator();
while (declarationsIter.hasNext()) {
BodyDeclaration declaration = declarationsIter.next();
if (declaration instanceof FieldDeclaration) {
F... | [
"private",
"void",
"removeDeadFields",
"(",
"String",
"clazz",
",",
"List",
"<",
"BodyDeclaration",
">",
"declarations",
")",
"{",
"Iterator",
"<",
"BodyDeclaration",
">",
"declarationsIter",
"=",
"declarations",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"... | Deletes non-constant dead fields from a type's body declarations list. | [
"Deletes",
"non",
"-",
"constant",
"dead",
"fields",
"from",
"a",
"type",
"s",
"body",
"declarations",
"list",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/translate/DeadCodeEliminator.java#L204-L227 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/GregorianCalendar.java | GregorianCalendar.monthLength | private int monthLength(int month) {
int year = internalGet(YEAR);
if (internalGetEra() == BCE) {
year = 1 - year;
}
return monthLength(month, year);
} | java | private int monthLength(int month) {
int year = internalGet(YEAR);
if (internalGetEra() == BCE) {
year = 1 - year;
}
return monthLength(month, year);
} | [
"private",
"int",
"monthLength",
"(",
"int",
"month",
")",
"{",
"int",
"year",
"=",
"internalGet",
"(",
"YEAR",
")",
";",
"if",
"(",
"internalGetEra",
"(",
")",
"==",
"BCE",
")",
"{",
"year",
"=",
"1",
"-",
"year",
";",
"}",
"return",
"monthLength",
... | Returns the length of the specified month in the year provided
by internalGet(YEAR).
@see #isLeapYear(int) | [
"Returns",
"the",
"length",
"of",
"the",
"specified",
"month",
"in",
"the",
"year",
"provided",
"by",
"internalGet",
"(",
"YEAR",
")",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/GregorianCalendar.java#L3270-L3276 |
GenesysPureEngage/authentication-client-java | src/main/java/com/genesys/authentication/AuthenticationApi.java | AuthenticationApi.changePassword | public ModelApiResponse changePassword(ChangePasswordOperation request, String authorization) throws AuthenticationApiException {
try {
ApiRequestChangePasswordOperation req = new ApiRequestChangePasswordOperation();
req.data(request);
return authenticationApi.changePassword(... | java | public ModelApiResponse changePassword(ChangePasswordOperation request, String authorization) throws AuthenticationApiException {
try {
ApiRequestChangePasswordOperation req = new ApiRequestChangePasswordOperation();
req.data(request);
return authenticationApi.changePassword(... | [
"public",
"ModelApiResponse",
"changePassword",
"(",
"ChangePasswordOperation",
"request",
",",
"String",
"authorization",
")",
"throws",
"AuthenticationApiException",
"{",
"try",
"{",
"ApiRequestChangePasswordOperation",
"req",
"=",
"new",
"ApiRequestChangePasswordOperation",
... | Change password
Change the user's password.
@param request request (required)
@param authorization The OAuth 2 bearer access token you received from [/auth/v3/oauth/token](/reference/authentication/Authentication/index.html#retrieveToken). For example: \"Authorization: bearer a4b5da75-a584-4053-9227-0f0... | [
"Change",
"password",
"Change",
"the",
"user'",
";",
"s",
"password",
"."
] | train | https://github.com/GenesysPureEngage/authentication-client-java/blob/eb0d58343ee42ebd3c037163c1137f611dfcbb3a/src/main/java/com/genesys/authentication/AuthenticationApi.java#L70-L78 |
WiQuery/wiquery | wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java | AjaxSlider.setAjaxChangeEvent | public void setAjaxChangeEvent(ISliderAjaxEvent ajaxChangeEvent)
{
this.ajaxEvents.put(SliderAjaxEvent.ajaxChangeEvent, ajaxChangeEvent);
setChangeEvent(new SliderAjaxJsScopeUiEvent(this, SliderAjaxEvent.ajaxChangeEvent));
} | java | public void setAjaxChangeEvent(ISliderAjaxEvent ajaxChangeEvent)
{
this.ajaxEvents.put(SliderAjaxEvent.ajaxChangeEvent, ajaxChangeEvent);
setChangeEvent(new SliderAjaxJsScopeUiEvent(this, SliderAjaxEvent.ajaxChangeEvent));
} | [
"public",
"void",
"setAjaxChangeEvent",
"(",
"ISliderAjaxEvent",
"ajaxChangeEvent",
")",
"{",
"this",
".",
"ajaxEvents",
".",
"put",
"(",
"SliderAjaxEvent",
".",
"ajaxChangeEvent",
",",
"ajaxChangeEvent",
")",
";",
"setChangeEvent",
"(",
"new",
"SliderAjaxJsScopeUiEve... | Sets the call-back for the AJAX Change Event.
@param ajaxChangeEvent | [
"Sets",
"the",
"call",
"-",
"back",
"for",
"the",
"AJAX",
"Change",
"Event",
"."
] | train | https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java#L329-L333 |
mangstadt/biweekly | src/main/java/biweekly/util/com/google/ical/util/TimeUtils.java | TimeUtils.firstDayOfWeekInMonth | public static DayOfWeek firstDayOfWeekInMonth(int year, int month) {
int result = fixedFromGregorian(year, month, 1) % 7;
if (result < 0) {
result += 7;
}
return DAYS_OF_WEEK[result];
} | java | public static DayOfWeek firstDayOfWeekInMonth(int year, int month) {
int result = fixedFromGregorian(year, month, 1) % 7;
if (result < 0) {
result += 7;
}
return DAYS_OF_WEEK[result];
} | [
"public",
"static",
"DayOfWeek",
"firstDayOfWeekInMonth",
"(",
"int",
"year",
",",
"int",
"month",
")",
"{",
"int",
"result",
"=",
"fixedFromGregorian",
"(",
"year",
",",
"month",
",",
"1",
")",
"%",
"7",
";",
"if",
"(",
"result",
"<",
"0",
")",
"{",
... | Gets the day of the week of the first day in the given month.
@param year the year
@param month the month (1-12)
@return the day of the week | [
"Gets",
"the",
"day",
"of",
"the",
"week",
"of",
"the",
"first",
"day",
"in",
"the",
"given",
"month",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/util/TimeUtils.java#L308-L314 |
atteo/classindex | classindex/src/main/java/org/atteo/classindex/ClassIndex.java | ClassIndex.getAnnotated | public static Iterable<Class<?>> getAnnotated(Class<? extends Annotation> annotation) {
return getAnnotated(annotation, Thread.currentThread().getContextClassLoader());
} | java | public static Iterable<Class<?>> getAnnotated(Class<? extends Annotation> annotation) {
return getAnnotated(annotation, Thread.currentThread().getContextClassLoader());
} | [
"public",
"static",
"Iterable",
"<",
"Class",
"<",
"?",
">",
">",
"getAnnotated",
"(",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
")",
"{",
"return",
"getAnnotated",
"(",
"annotation",
",",
"Thread",
".",
"currentThread",
"(",
")",
".",... | Retrieves a list of classes annotated by given annotation.
<p/>
<p>
The annotation must be annotated with {@link IndexAnnotated} for annotated classes
to be indexed at compile-time by {@link org.atteo.classindex.processor.ClassIndexProcessor}.
</p>
@param annotation annotation to search class for
@return list of annot... | [
"Retrieves",
"a",
"list",
"of",
"classes",
"annotated",
"by",
"given",
"annotation",
".",
"<p",
"/",
">",
"<p",
">",
"The",
"annotation",
"must",
"be",
"annotated",
"with",
"{",
"@link",
"IndexAnnotated",
"}",
"for",
"annotated",
"classes",
"to",
"be",
"in... | train | https://github.com/atteo/classindex/blob/ad76c6bd8b4e84c594d94e48f466a095ffe2306a/classindex/src/main/java/org/atteo/classindex/ClassIndex.java#L248-L250 |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/RestProxy.java | RestProxy.createHttpRequest | @SuppressWarnings("unchecked")
private HttpRequest createHttpRequest(OperationDescription operationDescription, SwaggerMethodParser methodParser, Object[] args) throws IOException {
final HttpRequest request = configRequest(new HttpRequest(methodParser.httpMethod(), operationDescription.url()), methodParser... | java | @SuppressWarnings("unchecked")
private HttpRequest createHttpRequest(OperationDescription operationDescription, SwaggerMethodParser methodParser, Object[] args) throws IOException {
final HttpRequest request = configRequest(new HttpRequest(methodParser.httpMethod(), operationDescription.url()), methodParser... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"HttpRequest",
"createHttpRequest",
"(",
"OperationDescription",
"operationDescription",
",",
"SwaggerMethodParser",
"methodParser",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"IOException",
"{",
"final... | Create a HttpRequest for the provided Swagger method using the provided arguments.
@param methodParser the Swagger method parser to use
@param args the arguments to use to populate the method's annotation values
@return a HttpRequest
@throws IOException thrown if the body contents cannot be serialized | [
"Create",
"a",
"HttpRequest",
"for",
"the",
"provided",
"Swagger",
"method",
"using",
"the",
"provided",
"arguments",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/RestProxy.java#L210-L220 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java | AppsImpl.updateSettingsAsync | public Observable<OperationStatus> updateSettingsAsync(UUID appId, UpdateSettingsOptionalParameter updateSettingsOptionalParameter) {
return updateSettingsWithServiceResponseAsync(appId, updateSettingsOptionalParameter).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() {
@Override
... | java | public Observable<OperationStatus> updateSettingsAsync(UUID appId, UpdateSettingsOptionalParameter updateSettingsOptionalParameter) {
return updateSettingsWithServiceResponseAsync(appId, updateSettingsOptionalParameter).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() {
@Override
... | [
"public",
"Observable",
"<",
"OperationStatus",
">",
"updateSettingsAsync",
"(",
"UUID",
"appId",
",",
"UpdateSettingsOptionalParameter",
"updateSettingsOptionalParameter",
")",
"{",
"return",
"updateSettingsWithServiceResponseAsync",
"(",
"appId",
",",
"updateSettingsOptionalP... | Updates the application settings.
@param appId The application ID.
@param updateSettingsOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationStatus object | [
"Updates",
"the",
"application",
"settings",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java#L1335-L1342 |
CodeNarc/CodeNarc | src/main/java/org/codenarc/util/AstUtil.java | AstUtil.isConstant | public static boolean isConstant(Expression expression, Object expected) {
return expression instanceof ConstantExpression && expected.equals(((ConstantExpression) expression).getValue());
} | java | public static boolean isConstant(Expression expression, Object expected) {
return expression instanceof ConstantExpression && expected.equals(((ConstantExpression) expression).getValue());
} | [
"public",
"static",
"boolean",
"isConstant",
"(",
"Expression",
"expression",
",",
"Object",
"expected",
")",
"{",
"return",
"expression",
"instanceof",
"ConstantExpression",
"&&",
"expected",
".",
"equals",
"(",
"(",
"(",
"ConstantExpression",
")",
"expression",
... | Tells you if an expression is the expected constant.
@param expression
any expression
@param expected
the expected int or String
@return
as described | [
"Tells",
"you",
"if",
"an",
"expression",
"is",
"the",
"expected",
"constant",
"."
] | train | https://github.com/CodeNarc/CodeNarc/blob/9a7cec02cb8cbaf845030f2434309e8968f5d7a7/src/main/java/org/codenarc/util/AstUtil.java#L156-L158 |
zxing/zxing | core/src/main/java/com/google/zxing/aztec/detector/Detector.java | Detector.getFirstDifferent | private Point getFirstDifferent(Point init, boolean color, int dx, int dy) {
int x = init.getX() + dx;
int y = init.getY() + dy;
while (isValid(x, y) && image.get(x, y) == color) {
x += dx;
y += dy;
}
x -= dx;
y -= dy;
while (isValid(x, y) && image.get(x, y) == color) {
... | java | private Point getFirstDifferent(Point init, boolean color, int dx, int dy) {
int x = init.getX() + dx;
int y = init.getY() + dy;
while (isValid(x, y) && image.get(x, y) == color) {
x += dx;
y += dy;
}
x -= dx;
y -= dy;
while (isValid(x, y) && image.get(x, y) == color) {
... | [
"private",
"Point",
"getFirstDifferent",
"(",
"Point",
"init",
",",
"boolean",
"color",
",",
"int",
"dx",
",",
"int",
"dy",
")",
"{",
"int",
"x",
"=",
"init",
".",
"getX",
"(",
")",
"+",
"dx",
";",
"int",
"y",
"=",
"init",
".",
"getY",
"(",
")",
... | Gets the coordinate of the first point with a different color in the given direction | [
"Gets",
"the",
"coordinate",
"of",
"the",
"first",
"point",
"with",
"a",
"different",
"color",
"in",
"the",
"given",
"direction"
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/aztec/detector/Detector.java#L494-L517 |
jeffreyning/nh-micro | nh-micro-template/src/main/java/com/nh/micro/template/MicroServiceTemplateSupport.java | MicroServiceTemplateSupport.updateInfoServiceInner | public Integer updateInfoServiceInner(String id,Map requestParamMap,String tableName,String cusCondition,String cusSetStr,String modelName) throws Exception{
String tempKeyId=calcuIdKey();
//add 20170829 ninghao
Integer filterViewRet=filterView(tableName,requestParamMap,id,tempKeyId,TYPE_UPDATE_ID);
if(filt... | java | public Integer updateInfoServiceInner(String id,Map requestParamMap,String tableName,String cusCondition,String cusSetStr,String modelName) throws Exception{
String tempKeyId=calcuIdKey();
//add 20170829 ninghao
Integer filterViewRet=filterView(tableName,requestParamMap,id,tempKeyId,TYPE_UPDATE_ID);
if(filt... | [
"public",
"Integer",
"updateInfoServiceInner",
"(",
"String",
"id",
",",
"Map",
"requestParamMap",
",",
"String",
"tableName",
",",
"String",
"cusCondition",
",",
"String",
"cusSetStr",
",",
"String",
"modelName",
")",
"throws",
"Exception",
"{",
"String",
"tempKe... | ������ݼ�¼
@param requestParamMap �ύ����
@param tableName �����
@param cusCondition ���������ַ�
@param cusSetStr ����set�ַ�
@param modelName ����
@return
@throws Exception | [
"������ݼ�¼"
] | train | https://github.com/jeffreyning/nh-micro/blob/f1cb420a092f8ba94317519ede739974decb5617/nh-micro-template/src/main/java/com/nh/micro/template/MicroServiceTemplateSupport.java#L1600-L1638 |
iipc/webarchive-commons | src/main/java/org/archive/io/RecordingOutputStream.java | RecordingOutputStream.tailRecord | private void tailRecord(byte[] b, int off, int len) throws IOException {
if(this.position >= this.buffer.length){
this.ensureDiskStream().write(b, off, len);
this.position += len;
} else {
assert this.buffer != null: "Buffer is null";
int toCopy = (int)Mat... | java | private void tailRecord(byte[] b, int off, int len) throws IOException {
if(this.position >= this.buffer.length){
this.ensureDiskStream().write(b, off, len);
this.position += len;
} else {
assert this.buffer != null: "Buffer is null";
int toCopy = (int)Mat... | [
"private",
"void",
"tailRecord",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"position",
">=",
"this",
".",
"buffer",
".",
"length",
")",
"{",
"this",
".",
"ensureDiskSt... | Record without digesting.
@param b Buffer to record.
@param off Offset into buffer at which to start recording.
@param len Length of buffer to record.
@exception IOException Failed write to backing file. | [
"Record",
"without",
"digesting",
"."
] | train | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/RecordingOutputStream.java#L388-L403 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java | SerializationUtils.fromJsonString | public static <T> T fromJsonString(String jsonString, Class<T> clazz, ClassLoader classLoader) {
if (jsonString == null) {
return null;
}
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
if (classLoader != null) {
Thread.currentThread()... | java | public static <T> T fromJsonString(String jsonString, Class<T> clazz, ClassLoader classLoader) {
if (jsonString == null) {
return null;
}
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
if (classLoader != null) {
Thread.currentThread()... | [
"public",
"static",
"<",
"T",
">",
"T",
"fromJsonString",
"(",
"String",
"jsonString",
",",
"Class",
"<",
"T",
">",
"clazz",
",",
"ClassLoader",
"classLoader",
")",
"{",
"if",
"(",
"jsonString",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Clas... | Deserialize a JSON string, with custom class loader.
@param jsonString
@param clazz
@return | [
"Deserialize",
"a",
"JSON",
"string",
"with",
"custom",
"class",
"loader",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java#L657-L681 |
unbescape/unbescape | src/main/java/org/unbescape/json/JsonEscape.java | JsonEscape.escapeJsonMinimal | public static void escapeJsonMinimal(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
escapeJson(text, offset, len, writer,
JsonEscapeType.SINGLE_ESCAPE_CHARS_DEFAULT_TO_UHEXA,
JsonEscapeL... | java | public static void escapeJsonMinimal(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
escapeJson(text, offset, len, writer,
JsonEscapeType.SINGLE_ESCAPE_CHARS_DEFAULT_TO_UHEXA,
JsonEscapeL... | [
"public",
"static",
"void",
"escapeJsonMinimal",
"(",
"final",
"char",
"[",
"]",
"text",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"len",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeJson",
"(",
"text",
",",
"offset... | <p>
Perform a JSON level 1 (only basic set) <strong>escape</strong> operation
on a <tt>char[]</tt> input.
</p>
<p>
<em>Level 1</em> means this method will only escape the JSON basic escape set:
</p>
<ul>
<li>The <em>Single Escape Characters</em>:
<tt>\b</tt> (<tt>U+0008</tt>),
<tt>\t</tt> (<tt>U+0009</tt>),
<tt... | [
"<p",
">",
"Perform",
"a",
"JSON",
"level",
"1",
"(",
"only",
"basic",
"set",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"char",
"[]",
"<",
"/",
"tt",
">",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">"... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/json/JsonEscape.java#L725-L730 |
Alluxio/alluxio | core/client/fs/src/main/java/alluxio/client/block/AlluxioBlockStore.java | AlluxioBlockStore.getInStream | public BlockInStream getInStream(long blockId, InStreamOptions options) throws IOException {
return getInStream(blockId, options, ImmutableMap.of());
} | java | public BlockInStream getInStream(long blockId, InStreamOptions options) throws IOException {
return getInStream(blockId, options, ImmutableMap.of());
} | [
"public",
"BlockInStream",
"getInStream",
"(",
"long",
"blockId",
",",
"InStreamOptions",
"options",
")",
"throws",
"IOException",
"{",
"return",
"getInStream",
"(",
"blockId",
",",
"options",
",",
"ImmutableMap",
".",
"of",
"(",
")",
")",
";",
"}"
] | Gets a stream to read the data of a block. This method is primarily responsible for
determining the data source and type of data source. The latest BlockInfo will be fetched
from the master to ensure the locations are up to date.
@param blockId the id of the block to read
@param options the options associated with the... | [
"Gets",
"a",
"stream",
"to",
"read",
"the",
"data",
"of",
"a",
"block",
".",
"This",
"method",
"is",
"primarily",
"responsible",
"for",
"determining",
"the",
"data",
"source",
"and",
"type",
"of",
"data",
"source",
".",
"The",
"latest",
"BlockInfo",
"will"... | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/block/AlluxioBlockStore.java#L148-L150 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java | Apptentive.register | 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... | 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 |
jOOQ/jOOR | jOOR/src/main/java/org/joor/Reflect.java | Reflect.isSimilarSignature | private boolean isSimilarSignature(Method possiblyMatchingMethod, String desiredMethodName, Class<?>[] desiredParamTypes) {
return possiblyMatchingMethod.getName().equals(desiredMethodName) && match(possiblyMatchingMethod.getParameterTypes(), desiredParamTypes);
} | 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 |
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)
{
final Iterator<TileRef> iterator = getTiles(circuit).iterator();
while (iterator.hasNext())
{
final TileRef newTile = iterator.next();
if (mapGroup.getGroup(newTile).equals(mapGroup.getGroup(ti... | 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 |
sriharshachilakapati/WebGL4J | webgl4j/src/main/java/com/shc/webgl4j/client/WebGL10.java | WebGL10.glBindFramebuffer | public static void glBindFramebuffer(int target, int frameBuffer)
{
checkContextCompatibility();
nglBindFramebuffer(target, WebGLObjectMap.get().toFramebuffer(frameBuffer));
} | 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 |
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
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "eventPostCommitAdd", new Object[] { msg, transactio... | 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 |
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) {
return new InstanceId(null, zone, instance);
} | 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 |
lucee/Lucee | core/src/main/java/lucee/commons/lang/StringUtil.java | StringUtil.ltrim | 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;
} | 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 |
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 {
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 ==... | 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 |
finmath/finmath-lib | src/main/java/net/finmath/modelling/productfactory/InterestRateMonteCarloProductFactory.java | InterestRateMonteCarloProductFactory.constructLiborIndex | 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 *... | 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 |
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) {
return fetchByUUID_G(uuid, groupId, true);
} | 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 |
restfb/restfb | src/main/java/com/restfb/BaseFacebookClient.java | BaseFacebookClient.urlEncodedValueForParameterName | protected String urlEncodedValueForParameterName(String name, String value) {
// Special handling for access_token -
// '%7C' is the pipe character and will be present in any access_token
// parameter that's already URL-encoded. If we see this combination, don't
// URL-encode. Otherwise, URL-encode as n... | java | protected String urlEncodedValueForParameterName(String name, String value) {
// Special handling for access_token -
// '%7C' is the pipe character and will be present in any access_token
// parameter that's already URL-encoded. If we see this combination, don't
// URL-encode. Otherwise, URL-encode as n... | [
"protected",
"String",
"urlEncodedValueForParameterName",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"// Special handling for access_token -",
"// '%7C' is the pipe character and will be present in any access_token",
"// parameter that's already URL-encoded. If we see this co... | Gets the URL-encoded version of the given {@code value} for the parameter named {@code name}.
<p>
Includes special-case handling for access token parameters where we check if the token is already URL-encoded - if
so, we don't encode again. All other parameter types are always URL-encoded.
@param name
The name of the p... | [
"Gets",
"the",
"URL",
"-",
"encoded",
"version",
"of",
"the",
"given",
"{",
"@code",
"value",
"}",
"for",
"the",
"parameter",
"named",
"{",
"@code",
"name",
"}",
".",
"<p",
">",
"Includes",
"special",
"-",
"case",
"handling",
"for",
"access",
"token",
... | train | https://github.com/restfb/restfb/blob/fb77ba5486d1339e7deb81b9830670fa209b1047/src/main/java/com/restfb/BaseFacebookClient.java#L106-L112 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_config_diff.java | ns_config_diff.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ns_config_diff_responses result = (ns_config_diff_responses) service.get_payload_formatter().string_to_resource(ns_config_diff_responses.class, response);
if(result.errorcode != 0)
{
if (result.er... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ns_config_diff_responses result = (ns_config_diff_responses) service.get_payload_formatter().string_to_resource(ns_config_diff_responses.class, response);
if(result.errorcode != 0)
{
if (result.er... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"ns_config_diff_responses",
"result",
"=",
"(",
"ns_config_diff_responses",
")",
"service",
".",
"get_payload_... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_config_diff.java#L227-L244 |
ops4j/org.ops4j.base | ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java | StreamUtils.copyReaderToStream | public static void copyReaderToStream( Reader in, OutputStream out, String encoding, boolean close )
throws IOException
{
OutputStreamWriter writer = new OutputStreamWriter( out, encoding );
copyReaderToWriter( in, writer, close );
} | java | public static void copyReaderToStream( Reader in, OutputStream out, String encoding, boolean close )
throws IOException
{
OutputStreamWriter writer = new OutputStreamWriter( out, encoding );
copyReaderToWriter( in, writer, close );
} | [
"public",
"static",
"void",
"copyReaderToStream",
"(",
"Reader",
"in",
",",
"OutputStream",
"out",
",",
"String",
"encoding",
",",
"boolean",
"close",
")",
"throws",
"IOException",
"{",
"OutputStreamWriter",
"writer",
"=",
"new",
"OutputStreamWriter",
"(",
"out",
... | Copies the content of the Reader to the provided OutputStream using the provided encoding.
@param in The character data to convert.
@param out The OutputStream to send the data to.
@param encoding The character encoding that should be used for the byte stream.
@param close true if the Reader and OutputSt... | [
"Copies",
"the",
"content",
"of",
"the",
"Reader",
"to",
"the",
"provided",
"OutputStream",
"using",
"the",
"provided",
"encoding",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java#L299-L304 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getCreateUploadSessionRequest | public BoxRequestsFile.CreateUploadSession getCreateUploadSessionRequest(InputStream is, String fileName, long fileSize, String folderId) {
return new BoxRequestsFile.CreateUploadSession(is, fileName, fileSize, folderId, getUploadSessionForNewFileUrl(), mSession);
} | java | public BoxRequestsFile.CreateUploadSession getCreateUploadSessionRequest(InputStream is, String fileName, long fileSize, String folderId) {
return new BoxRequestsFile.CreateUploadSession(is, fileName, fileSize, folderId, getUploadSessionForNewFileUrl(), mSession);
} | [
"public",
"BoxRequestsFile",
".",
"CreateUploadSession",
"getCreateUploadSessionRequest",
"(",
"InputStream",
"is",
",",
"String",
"fileName",
",",
"long",
"fileSize",
",",
"String",
"folderId",
")",
"{",
"return",
"new",
"BoxRequestsFile",
".",
"CreateUploadSession",
... | Gets a request that creates an upload session for uploading a new file
@param is InputStream for the file to be uplaoded
@param fileName the file name for the file to be created/uploaded
@param fileSize the inputStream size (or the origin file size)
@param folderId the folder ID where this file will be uploaded
@return... | [
"Gets",
"a",
"request",
"that",
"creates",
"an",
"upload",
"session",
"for",
"uploading",
"a",
"new",
"file"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L592-L594 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.registerBlockListener | public String registerBlockListener(BlockListener listener) throws InvalidArgumentException {
if (shutdown) {
throw new InvalidArgumentException(format("Channel %s has been shutdown.", name));
}
if (null == listener) {
throw new InvalidArgumentException("Listener parame... | java | public String registerBlockListener(BlockListener listener) throws InvalidArgumentException {
if (shutdown) {
throw new InvalidArgumentException(format("Channel %s has been shutdown.", name));
}
if (null == listener) {
throw new InvalidArgumentException("Listener parame... | [
"public",
"String",
"registerBlockListener",
"(",
"BlockListener",
"listener",
")",
"throws",
"InvalidArgumentException",
"{",
"if",
"(",
"shutdown",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"format",
"(",
"\"Channel %s has been shutdown.\"",
",",
"nam... | Register a block listener.
@param listener function with single argument with type {@link BlockEvent}
@return The handle of the registered block listener.
@throws InvalidArgumentException if the channel is shutdown. | [
"Register",
"a",
"block",
"listener",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L5489-L5505 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/ZoneId.java | ZoneId.getDisplayName | public String getDisplayName(TextStyle style, Locale locale) {
return new DateTimeFormatterBuilder().appendZoneText(style).toFormatter(locale).format(new DefaultInterfaceTemporalAccessor() {
@Override
public boolean isSupported(TemporalField field) {
return false;
... | java | public String getDisplayName(TextStyle style, Locale locale) {
return new DateTimeFormatterBuilder().appendZoneText(style).toFormatter(locale).format(new DefaultInterfaceTemporalAccessor() {
@Override
public boolean isSupported(TemporalField field) {
return false;
... | [
"public",
"String",
"getDisplayName",
"(",
"TextStyle",
"style",
",",
"Locale",
"locale",
")",
"{",
"return",
"new",
"DateTimeFormatterBuilder",
"(",
")",
".",
"appendZoneText",
"(",
"style",
")",
".",
"toFormatter",
"(",
"locale",
")",
".",
"format",
"(",
"... | Gets the textual representation of the zone, such as 'British Time' or
'+02:00'.
<p>
This returns the textual name used to identify the time-zone ID,
suitable for presentation to the user.
The parameters control the style of the returned text and the locale.
<p>
If no textual mapping is found then the {@link #getId() f... | [
"Gets",
"the",
"textual",
"representation",
"of",
"the",
"zone",
"such",
"as",
"British",
"Time",
"or",
"+",
"02",
":",
"00",
".",
"<p",
">",
"This",
"returns",
"the",
"textual",
"name",
"used",
"to",
"identify",
"the",
"time",
"-",
"zone",
"ID",
"suit... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/ZoneId.java#L474-L493 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterJoinManager.java | ClusterJoinManager.sendJoinRequest | public boolean sendJoinRequest(Address toAddress, boolean withCredentials) {
if (toAddress == null) {
toAddress = clusterService.getMasterAddress();
}
JoinRequestOp joinRequest = new JoinRequestOp(node.createJoinRequest(withCredentials));
return nodeEngine.getOperationService... | java | public boolean sendJoinRequest(Address toAddress, boolean withCredentials) {
if (toAddress == null) {
toAddress = clusterService.getMasterAddress();
}
JoinRequestOp joinRequest = new JoinRequestOp(node.createJoinRequest(withCredentials));
return nodeEngine.getOperationService... | [
"public",
"boolean",
"sendJoinRequest",
"(",
"Address",
"toAddress",
",",
"boolean",
"withCredentials",
")",
"{",
"if",
"(",
"toAddress",
"==",
"null",
")",
"{",
"toAddress",
"=",
"clusterService",
".",
"getMasterAddress",
"(",
")",
";",
"}",
"JoinRequestOp",
... | Send join request to {@code toAddress}.
@param toAddress the currently known master address.
@param withCredentials use cluster credentials
@return {@code true} if join request was sent successfully, otherwise {@code false}. | [
"Send",
"join",
"request",
"to",
"{",
"@code",
"toAddress",
"}",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterJoinManager.java#L446-L452 |
guardtime/ksi-java-sdk | ksi-service-client-apache-http/src/main/java/com/guardtime/ksi/service/client/http/apache/AbstractApacheHttpClient.java | AbstractApacheHttpClient.createProxyRoutePlanner | private DefaultProxyRoutePlanner createProxyRoutePlanner(HttpSettings settings, HttpAsyncClientBuilder httpClientBuilder) {
HttpHost proxy = new HttpHost(settings.getProxyUrl().getHost(), settings.getProxyUrl().getPort());
if (settings.getProxyUser() != null) {
CredentialsProvider credential... | java | private DefaultProxyRoutePlanner createProxyRoutePlanner(HttpSettings settings, HttpAsyncClientBuilder httpClientBuilder) {
HttpHost proxy = new HttpHost(settings.getProxyUrl().getHost(), settings.getProxyUrl().getPort());
if (settings.getProxyUser() != null) {
CredentialsProvider credential... | [
"private",
"DefaultProxyRoutePlanner",
"createProxyRoutePlanner",
"(",
"HttpSettings",
"settings",
",",
"HttpAsyncClientBuilder",
"httpClientBuilder",
")",
"{",
"HttpHost",
"proxy",
"=",
"new",
"HttpHost",
"(",
"settings",
".",
"getProxyUrl",
"(",
")",
".",
"getHost",
... | Creates default proxy route planner.
@param settings
settings to use.
@param httpClientBuilder
http client builder.
@return Instance of {@link DefaultProxyRoutePlanner}. | [
"Creates",
"default",
"proxy",
"route",
"planner",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-service-client-apache-http/src/main/java/com/guardtime/ksi/service/client/http/apache/AbstractApacheHttpClient.java#L153-L164 |
aoindustries/aocode-public | src/main/java/com/aoindustries/io/NativeToUnixWriter.java | NativeToUnixWriter.getInstance | public static Writer getInstance(Writer out) {
// Already in Unix format, no conversion necessary
if(UNIX_EOL.equals(EOL)) return out;
// Use FindReplaceWriter
return new FindReplaceWriter(out, EOL, UNIX_EOL);
} | java | public static Writer getInstance(Writer out) {
// Already in Unix format, no conversion necessary
if(UNIX_EOL.equals(EOL)) return out;
// Use FindReplaceWriter
return new FindReplaceWriter(out, EOL, UNIX_EOL);
} | [
"public",
"static",
"Writer",
"getInstance",
"(",
"Writer",
"out",
")",
"{",
"// Already in Unix format, no conversion necessary",
"if",
"(",
"UNIX_EOL",
".",
"equals",
"(",
"EOL",
")",
")",
"return",
"out",
";",
"// Use FindReplaceWriter",
"return",
"new",
"FindRep... | Gets an instance of the Writer that performs the conversion.
The implementation may be optimized for common platforms. | [
"Gets",
"an",
"instance",
"of",
"the",
"Writer",
"that",
"performs",
"the",
"conversion",
".",
"The",
"implementation",
"may",
"be",
"optimized",
"for",
"common",
"platforms",
"."
] | train | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/NativeToUnixWriter.java#L54-L59 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/DocRootTaglet.java | DocRootTaglet.getTagletOutput | public Content getTagletOutput(Element holder, DocTree tag, TagletWriter writer) {
return writer.getDocRootOutput();
} | java | public Content getTagletOutput(Element holder, DocTree tag, TagletWriter writer) {
return writer.getDocRootOutput();
} | [
"public",
"Content",
"getTagletOutput",
"(",
"Element",
"holder",
",",
"DocTree",
"tag",
",",
"TagletWriter",
"writer",
")",
"{",
"return",
"writer",
".",
"getDocRootOutput",
"(",
")",
";",
"}"
] | Given a <code>Doc</code> object, check if it holds any tags of
this type. If it does, return the string representing the output.
If it does not, return null.
@param holder
@param tag a tag representing the custom tag.
@param writer a {@link TagletWriter} Taglet writer.
@return the string representation of this <code>T... | [
"Given",
"a",
"<code",
">",
"Doc<",
"/",
"code",
">",
"object",
"check",
"if",
"it",
"holds",
"any",
"tags",
"of",
"this",
"type",
".",
"If",
"it",
"does",
"return",
"the",
"string",
"representing",
"the",
"output",
".",
"If",
"it",
"does",
"not",
"r... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/DocRootTaglet.java#L68-L70 |
icode/ameba | src/main/java/ameba/message/internal/MessageHelper.java | MessageHelper.getHeaderString | public static String getHeaderString(MultivaluedMap<String, Object> headers, String name) {
return HeaderUtils.asHeaderString(headers.get(name), RuntimeDelegate.getInstance());
} | java | public static String getHeaderString(MultivaluedMap<String, Object> headers, String name) {
return HeaderUtils.asHeaderString(headers.get(name), RuntimeDelegate.getInstance());
} | [
"public",
"static",
"String",
"getHeaderString",
"(",
"MultivaluedMap",
"<",
"String",
",",
"Object",
">",
"headers",
",",
"String",
"name",
")",
"{",
"return",
"HeaderUtils",
".",
"asHeaderString",
"(",
"headers",
".",
"get",
"(",
"name",
")",
",",
"Runtime... | <p>getHeaderString.</p>
@param headers a {@link javax.ws.rs.core.MultivaluedMap} object.
@param name a {@link java.lang.String} object.
@return a {@link java.lang.String} object. | [
"<p",
">",
"getHeaderString",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/message/internal/MessageHelper.java#L77-L79 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/PippoSettings.java | PippoSettings.extractTimeUnit | private TimeUnit extractTimeUnit(String name, String defaultValue) {
String value = getString(name, defaultValue);
try {
final String[] s = value.split(" ", 2);
return TimeUnit.valueOf(s[1].trim().toUpperCase());
} catch (Exception e) {
throw new PippoRuntimeE... | java | private TimeUnit extractTimeUnit(String name, String defaultValue) {
String value = getString(name, defaultValue);
try {
final String[] s = value.split(" ", 2);
return TimeUnit.valueOf(s[1].trim().toUpperCase());
} catch (Exception e) {
throw new PippoRuntimeE... | [
"private",
"TimeUnit",
"extractTimeUnit",
"(",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"getString",
"(",
"name",
",",
"defaultValue",
")",
";",
"try",
"{",
"final",
"String",
"[",
"]",
"s",
"=",
"value",
".",
"s... | Extracts the TimeUnit from the name.
@param name
@param defaultValue
@return the extracted TimeUnit | [
"Extracts",
"the",
"TimeUnit",
"from",
"the",
"name",
"."
] | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/PippoSettings.java#L985-L993 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.setUsersOrganizationalUnit | public void setUsersOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsUser user)
throws CmsException {
if (!getGroupsOfUser(dbc, user.getName(), false).isEmpty()) {
throw new CmsDbConsistencyException(
Messages.get().container(Messages.ERR_ORGUNIT_MOVE_USER_... | java | public void setUsersOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsUser user)
throws CmsException {
if (!getGroupsOfUser(dbc, user.getName(), false).isEmpty()) {
throw new CmsDbConsistencyException(
Messages.get().container(Messages.ERR_ORGUNIT_MOVE_USER_... | [
"public",
"void",
"setUsersOrganizationalUnit",
"(",
"CmsDbContext",
"dbc",
",",
"CmsOrganizationalUnit",
"orgUnit",
",",
"CmsUser",
"user",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"!",
"getGroupsOfUser",
"(",
"dbc",
",",
"user",
".",
"getName",
"(",
")",... | Moves an user to the given organizational unit.<p>
@param dbc the current db context
@param orgUnit the organizational unit to add the resource to
@param user the user that is to be moved to the organizational unit
@throws CmsException if something goes wrong
@see org.opencms.security.CmsOrgUnitManager#setUsersOrgan... | [
"Moves",
"an",
"user",
"to",
"the",
"given",
"organizational",
"unit",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L9038-L9061 |
legsem/legstar-core2 | legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/antlr/RecognizerErrorHandler.java | RecognizerErrorHandler.getErrorMessage | public static String getErrorMessage(
final Logger log,
final BaseRecognizer recognizer,
final RecognitionException e,
final String superMessage,
final String[] tokenNames) {
if (log.isDebugEnabled()) {
List < ? > stack = BaseRecognizer.get... | java | public static String getErrorMessage(
final Logger log,
final BaseRecognizer recognizer,
final RecognitionException e,
final String superMessage,
final String[] tokenNames) {
if (log.isDebugEnabled()) {
List < ? > stack = BaseRecognizer.get... | [
"public",
"static",
"String",
"getErrorMessage",
"(",
"final",
"Logger",
"log",
",",
"final",
"BaseRecognizer",
"recognizer",
",",
"final",
"RecognitionException",
"e",
",",
"final",
"String",
"superMessage",
",",
"final",
"String",
"[",
"]",
"tokenNames",
")",
... | Format an error message as expected by ANTLR. It is basically the
same error message that ANTL BaseRecognizer generates with some
additional data.
Also used to log debugging information.
@param log the logger to use at debug time
@param recognizer the lexer or parser who generated the error
@param e the exception that ... | [
"Format",
"an",
"error",
"message",
"as",
"expected",
"by",
"ANTLR",
".",
"It",
"is",
"basically",
"the",
"same",
"error",
"message",
"that",
"ANTL",
"BaseRecognizer",
"generates",
"with",
"some",
"additional",
"data",
".",
"Also",
"used",
"to",
"log",
"debu... | train | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/antlr/RecognizerErrorHandler.java#L51-L82 |
json-path/JsonPath | json-path/src/main/java/com/jayway/jsonpath/Criteria.java | Criteria.and | public Criteria and(String key) {
checkComplete();
return new Criteria(this.criteriaChain, ValueNode.toValueNode(prefixPath(key)));
} | java | public Criteria and(String key) {
checkComplete();
return new Criteria(this.criteriaChain, ValueNode.toValueNode(prefixPath(key)));
} | [
"public",
"Criteria",
"and",
"(",
"String",
"key",
")",
"{",
"checkComplete",
"(",
")",
";",
"return",
"new",
"Criteria",
"(",
"this",
".",
"criteriaChain",
",",
"ValueNode",
".",
"toValueNode",
"(",
"prefixPath",
"(",
"key",
")",
")",
")",
";",
"}"
] | Static factory method to create a Criteria using the provided key
@param key ads new filed to criteria
@return the criteria builder | [
"Static",
"factory",
"method",
"to",
"create",
"a",
"Criteria",
"using",
"the",
"provided",
"key"
] | train | https://github.com/json-path/JsonPath/blob/5a09489c3252b74bbf81992aadb3073be59c04f9/json-path/src/main/java/com/jayway/jsonpath/Criteria.java#L109-L112 |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contract/config/ConfigurationBuilder.java | ConfigurationBuilder.getConfiguration | public TransportsConfiguration getConfiguration(String configFileLocation) {
TransportsConfiguration transportsConfiguration;
File file = new File(configFileLocation);
if (file.exists()) {
try (Reader in = new InputStreamReader(new FileInputStream(file), StandardCharsets.ISO_8859_1)... | java | public TransportsConfiguration getConfiguration(String configFileLocation) {
TransportsConfiguration transportsConfiguration;
File file = new File(configFileLocation);
if (file.exists()) {
try (Reader in = new InputStreamReader(new FileInputStream(file), StandardCharsets.ISO_8859_1)... | [
"public",
"TransportsConfiguration",
"getConfiguration",
"(",
"String",
"configFileLocation",
")",
"{",
"TransportsConfiguration",
"transportsConfiguration",
";",
"File",
"file",
"=",
"new",
"File",
"(",
"configFileLocation",
")",
";",
"if",
"(",
"file",
".",
"exists"... | Get the {@code TransportsConfiguration} represented by a particular configuration file.
@param configFileLocation configuration file location
@return TransportsConfiguration represented by a particular configuration file | [
"Get",
"the",
"{",
"@code",
"TransportsConfiguration",
"}",
"represented",
"by",
"a",
"particular",
"configuration",
"file",
"."
] | train | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contract/config/ConfigurationBuilder.java#L76-L97 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/time/DateFormatUtils.java | DateFormatUtils.formatUTC | public static String formatUTC(final long millis, final String pattern, final Locale locale) {
return format(new Date(millis), pattern, UTC_TIME_ZONE, locale);
} | java | public static String formatUTC(final long millis, final String pattern, final Locale locale) {
return format(new Date(millis), pattern, UTC_TIME_ZONE, locale);
} | [
"public",
"static",
"String",
"formatUTC",
"(",
"final",
"long",
"millis",
",",
"final",
"String",
"pattern",
",",
"final",
"Locale",
"locale",
")",
"{",
"return",
"format",
"(",
"new",
"Date",
"(",
"millis",
")",
",",
"pattern",
",",
"UTC_TIME_ZONE",
",",... | <p>Formats a date/time into a specific pattern using the UTC time zone.</p>
@param millis the date to format expressed in milliseconds
@param pattern the pattern to use to format the date, not null
@param locale the locale to use, may be <code>null</code>
@return the formatted date | [
"<p",
">",
"Formats",
"a",
"date",
"/",
"time",
"into",
"a",
"specific",
"pattern",
"using",
"the",
"UTC",
"time",
"zone",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/DateFormatUtils.java#L240-L242 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java | HttpUtil.getCharset | public static Charset getCharset(HttpMessage message, Charset defaultCharset) {
CharSequence contentTypeValue = message.headers().get(HttpHeaderNames.CONTENT_TYPE);
if (contentTypeValue != null) {
return getCharset(contentTypeValue, defaultCharset);
} else {
return defaul... | java | public static Charset getCharset(HttpMessage message, Charset defaultCharset) {
CharSequence contentTypeValue = message.headers().get(HttpHeaderNames.CONTENT_TYPE);
if (contentTypeValue != null) {
return getCharset(contentTypeValue, defaultCharset);
} else {
return defaul... | [
"public",
"static",
"Charset",
"getCharset",
"(",
"HttpMessage",
"message",
",",
"Charset",
"defaultCharset",
")",
"{",
"CharSequence",
"contentTypeValue",
"=",
"message",
".",
"headers",
"(",
")",
".",
"get",
"(",
"HttpHeaderNames",
".",
"CONTENT_TYPE",
")",
";... | Fetch charset from message's Content-Type header.
@param message entity to fetch Content-Type header from
@param defaultCharset result to use in case of empty, incorrect or doesn't contain required part header value
@return the charset from message's Content-Type header or {@code defaultCharset}
if charset is n... | [
"Fetch",
"charset",
"from",
"message",
"s",
"Content",
"-",
"Type",
"header",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java#L371-L378 |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/InjectionBinding.java | InjectionBinding.setObjects | public final void setObjects(Object injectionObject, Object bindingObject)
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "setObjects", injectionObject, bindingObject);
this.ivInjectedObject = injectionObject;... | java | public final void setObjects(Object injectionObject, Object bindingObject)
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "setObjects", injectionObject, bindingObject);
this.ivInjectedObject = injectionObject;... | [
"public",
"final",
"void",
"setObjects",
"(",
"Object",
"injectionObject",
",",
"Object",
"bindingObject",
")",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"is... | Sets the objects to use for injection and binding. Usually, these
objects are the same; otherwise, {@link #setObjects(Object, Reference)} should be used instead.
@param injectionObject the object to inject
@param bindingObject the object to bind, or null if injectionObject
should be bound directly | [
"Sets",
"the",
"objects",
"to",
"use",
"for",
"injection",
"and",
"binding",
".",
"Usually",
"these",
"objects",
"are",
"the",
"same",
";",
"otherwise",
"{",
"@link",
"#setObjects",
"(",
"Object",
"Reference",
")",
"}",
"should",
"be",
"used",
"instead",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/InjectionBinding.java#L1257-L1270 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/common/Similarity.java | Similarity.kendallsTau | public static double kendallsTau(Vector a, Vector b) {
return kendallsTau(Vectors.asDouble(a), Vectors.asDouble(b));
} | java | public static double kendallsTau(Vector a, Vector b) {
return kendallsTau(Vectors.asDouble(a), Vectors.asDouble(b));
} | [
"public",
"static",
"double",
"kendallsTau",
"(",
"Vector",
"a",
",",
"Vector",
"b",
")",
"{",
"return",
"kendallsTau",
"(",
"Vectors",
".",
"asDouble",
"(",
"a",
")",
",",
"Vectors",
".",
"asDouble",
"(",
"b",
")",
")",
";",
"}"
] | Computes <a href="http://en.wikipedia.org/wiki/Kendall%27s_tau">Kendall's
tau</a> of the values in the two vectors. This method uses tau-b, which
is suitable for vectors with duplicate values.
@throws IllegalArgumentException when the length of the two vectors are
not the same. | [
"Computes",
"<a",
"href",
"=",
"http",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"Kendall%27s_tau",
">",
"Kendall",
"s",
"tau<",
"/",
"a",
">",
"of",
"the",
"values",
"in",
"the",
"two",
"vectors",
".",
"This",
"method",
"uses"... | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/common/Similarity.java#L2055-L2057 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/TransactionWriteRequest.java | TransactionWriteRequest.addConditionCheck | public TransactionWriteRequest addConditionCheck(Object key, DynamoDBTransactionWriteExpression transactionWriteExpression) {
return addConditionCheck(key, transactionWriteExpression, null /* returnValuesOnConditionCheckFailure */);
} | java | public TransactionWriteRequest addConditionCheck(Object key, DynamoDBTransactionWriteExpression transactionWriteExpression) {
return addConditionCheck(key, transactionWriteExpression, null /* returnValuesOnConditionCheckFailure */);
} | [
"public",
"TransactionWriteRequest",
"addConditionCheck",
"(",
"Object",
"key",
",",
"DynamoDBTransactionWriteExpression",
"transactionWriteExpression",
")",
"{",
"return",
"addConditionCheck",
"(",
"key",
",",
"transactionWriteExpression",
",",
"null",
"/* returnValuesOnCondit... | Adds conditionCheck operation (to be executed on the object represented by key) to the list of transaction write operations.
transactionWriteExpression is used to condition check on the object represented by key. | [
"Adds",
"conditionCheck",
"operation",
"(",
"to",
"be",
"executed",
"on",
"the",
"object",
"represented",
"by",
"key",
")",
"to",
"the",
"list",
"of",
"transaction",
"write",
"operations",
".",
"transactionWriteExpression",
"is",
"used",
"to",
"condition",
"chec... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/TransactionWriteRequest.java#L132-L134 |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java | MathBindings.multiplyExact | public static LongBinding multiplyExact(final long x, final ObservableLongValue y) {
return createLongBinding(() -> Math.multiplyExact(x, y.get()), y);
} | java | public static LongBinding multiplyExact(final long x, final ObservableLongValue y) {
return createLongBinding(() -> Math.multiplyExact(x, y.get()), y);
} | [
"public",
"static",
"LongBinding",
"multiplyExact",
"(",
"final",
"long",
"x",
",",
"final",
"ObservableLongValue",
"y",
")",
"{",
"return",
"createLongBinding",
"(",
"(",
")",
"->",
"Math",
".",
"multiplyExact",
"(",
"x",
",",
"y",
".",
"get",
"(",
")",
... | Binding for {@link java.lang.Math#multiplyExact(long, long)}
@param x the first value
@param y the second value
@return the result
@throws ArithmeticException if the result overflows a long | [
"Binding",
"for",
"{",
"@link",
"java",
".",
"lang",
".",
"Math#multiplyExact",
"(",
"long",
"long",
")",
"}"
] | train | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java#L1035-L1037 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/base/base_resource.java | base_resource.rename_resource | protected base_response rename_resource(nitro_service service, String newname) throws Exception
{
if (!service.isLogin() && !get_object_type().equals("login"))
service.login();
options option = new options();
option.set_action("rename");
this.set_newname(newname);
base_response response = post_request(s... | java | protected base_response rename_resource(nitro_service service, String newname) throws Exception
{
if (!service.isLogin() && !get_object_type().equals("login"))
service.login();
options option = new options();
option.set_action("rename");
this.set_newname(newname);
base_response response = post_request(s... | [
"protected",
"base_response",
"rename_resource",
"(",
"nitro_service",
"service",
",",
"String",
"newname",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"service",
".",
"isLogin",
"(",
")",
"&&",
"!",
"get_object_type",
"(",
")",
".",
"equals",
"(",
"\"l... | Use this method to perform a rename operation on netscaler resource.
@param service nitro_service object.
@param newname new name to be set to the specified resource.
@return status of the operation performed.
@throws Exception Nitro exception is thrown. | [
"Use",
"this",
"method",
"to",
"perform",
"a",
"rename",
"operation",
"on",
"netscaler",
"resource",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/base/base_resource.java#L458-L468 |
molgenis/molgenis | molgenis-data-validation/src/main/java/org/molgenis/data/validation/meta/EntityTypeValidator.java | EntityTypeValidator.validateEntityId | static void validateEntityId(EntityType entityType) {
// validate entity name (e.g. illegal characters, length)
String id = entityType.getId();
if (!id.equals(ATTRIBUTE_META_DATA)
&& !id.equals(ENTITY_TYPE_META_DATA)
&& !id.equals(PACKAGE)) {
try {
NameValidator.validateEntityN... | java | static void validateEntityId(EntityType entityType) {
// validate entity name (e.g. illegal characters, length)
String id = entityType.getId();
if (!id.equals(ATTRIBUTE_META_DATA)
&& !id.equals(ENTITY_TYPE_META_DATA)
&& !id.equals(PACKAGE)) {
try {
NameValidator.validateEntityN... | [
"static",
"void",
"validateEntityId",
"(",
"EntityType",
"entityType",
")",
"{",
"// validate entity name (e.g. illegal characters, length)",
"String",
"id",
"=",
"entityType",
".",
"getId",
"(",
")",
";",
"if",
"(",
"!",
"id",
".",
"equals",
"(",
"ATTRIBUTE_META_DA... | Validates the entity ID: - Validates that the entity ID does not contain illegal characters and
validates the name length
@param entityType entity meta data
@throws MolgenisValidationException if the entity simple name content is invalid or the fully
qualified name, simple name and package name are not consistent | [
"Validates",
"the",
"entity",
"ID",
":",
"-",
"Validates",
"that",
"the",
"entity",
"ID",
"does",
"not",
"contain",
"illegal",
"characters",
"and",
"validates",
"the",
"name",
"length"
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data-validation/src/main/java/org/molgenis/data/validation/meta/EntityTypeValidator.java#L292-L304 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/SystemUtil.java | SystemUtil.appendSuffixIfMissing | public static String appendSuffixIfMissing(String _str, String _suffix) {
if (_str == null) {
return null;
}
if (!_str.endsWith(_suffix)) {
_str += _suffix;
}
return _str;
} | java | public static String appendSuffixIfMissing(String _str, String _suffix) {
if (_str == null) {
return null;
}
if (!_str.endsWith(_suffix)) {
_str += _suffix;
}
return _str;
} | [
"public",
"static",
"String",
"appendSuffixIfMissing",
"(",
"String",
"_str",
",",
"String",
"_suffix",
")",
"{",
"if",
"(",
"_str",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"_str",
".",
"endsWith",
"(",
"_suffix",
")",
")",
... | Append a suffix to the string (e.g. filename) if it doesn't have it already.
@param _str string to check
@param _suffix suffix to append
@return string with suffix or original if no suffix was appended | [
"Append",
"a",
"suffix",
"to",
"the",
"string",
"(",
"e",
".",
"g",
".",
"filename",
")",
"if",
"it",
"doesn",
"t",
"have",
"it",
"already",
"."
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/SystemUtil.java#L168-L176 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPaymentPersistenceImpl.java | CommerceOrderPaymentPersistenceImpl.findAll | @Override
public List<CommerceOrderPayment> findAll(int start, int end) {
return findAll(start, end, null);
} | java | @Override
public List<CommerceOrderPayment> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceOrderPayment",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce order payments.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <co... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"order",
"payments",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPaymentPersistenceImpl.java#L1137-L1140 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java | Validator.validateTrue | public void validateTrue(boolean value, String name) {
validateTrue(value, name, messages.get(Validation.TRUE_KEY.name(), name));
} | java | public void validateTrue(boolean value, String name) {
validateTrue(value, name, messages.get(Validation.TRUE_KEY.name(), name));
} | [
"public",
"void",
"validateTrue",
"(",
"boolean",
"value",
",",
"String",
"name",
")",
"{",
"validateTrue",
"(",
"value",
",",
"name",
",",
"messages",
".",
"get",
"(",
"Validation",
".",
"TRUE_KEY",
".",
"name",
"(",
")",
",",
"name",
")",
")",
";",
... | Validates a given value to be true
@param value The value to check
@param name The name of the field to display the error message | [
"Validates",
"a",
"given",
"value",
"to",
"be",
"true"
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java#L441-L443 |
TheHortonMachine/hortonmachine | apps/src/main/java/org/hortonmachine/nww/utils/NwwUtilities.java | NwwUtilities.getScreenPointsPolygon | public static Geometry getScreenPointsPolygon( WorldWindow wwd, int x1, int y1, int x2, int y2 ) {
View view = wwd.getView();
Position p1 = view.computePositionFromScreenPoint(x1, y1);
Position p2 = view.computePositionFromScreenPoint(x1, y2);
Position p3 = view.computePositionFromScreen... | java | public static Geometry getScreenPointsPolygon( WorldWindow wwd, int x1, int y1, int x2, int y2 ) {
View view = wwd.getView();
Position p1 = view.computePositionFromScreenPoint(x1, y1);
Position p2 = view.computePositionFromScreenPoint(x1, y2);
Position p3 = view.computePositionFromScreen... | [
"public",
"static",
"Geometry",
"getScreenPointsPolygon",
"(",
"WorldWindow",
"wwd",
",",
"int",
"x1",
",",
"int",
"y1",
",",
"int",
"x2",
",",
"int",
"y2",
")",
"{",
"View",
"view",
"=",
"wwd",
".",
"getView",
"(",
")",
";",
"Position",
"p1",
"=",
"... | Get the lat/long world geometry from two screen corner coordinates.
@param wwd
the {@link WorldWindow} instance.
@param x1
the first point screen x.
@param y1
the first point screen y.
@param x2
the second point screen x.
@param y2
the second point screen y.
@return the world geomnetry. | [
"Get",
"the",
"lat",
"/",
"long",
"world",
"geometry",
"from",
"two",
"screen",
"corner",
"coordinates",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/nww/utils/NwwUtilities.java#L246-L261 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/recurrent/KerasRnnUtils.java | KerasRnnUtils.getUnrollRecurrentLayer | public static boolean getUnrollRecurrentLayer(KerasLayerConfiguration conf, Map<String, Object> layerConfig)
throws InvalidKerasConfigurationException {
Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
if (!innerConfig.containsKey(conf.getLA... | java | public static boolean getUnrollRecurrentLayer(KerasLayerConfiguration conf, Map<String, Object> layerConfig)
throws InvalidKerasConfigurationException {
Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
if (!innerConfig.containsKey(conf.getLA... | [
"public",
"static",
"boolean",
"getUnrollRecurrentLayer",
"(",
"KerasLayerConfiguration",
"conf",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"layerConfig",
")",
"throws",
"InvalidKerasConfigurationException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"inner... | Get unroll parameter to decide whether to unroll RNN with BPTT or not.
@param conf KerasLayerConfiguration
@param layerConfig dictionary containing Keras layer properties
@return boolean unroll parameter
@throws InvalidKerasConfigurationException Invalid Keras configuration | [
"Get",
"unroll",
"parameter",
"to",
"decide",
"whether",
"to",
"unroll",
"RNN",
"with",
"BPTT",
"or",
"not",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/recurrent/KerasRnnUtils.java#L41-L48 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java | FactoryMultiView.triangulateNViewCalibrated | public static TriangulateNViewsMetric triangulateNViewCalibrated(@Nullable ConfigTriangulation config ) {
if( config == null )
config = new ConfigTriangulation();
switch ( config.type ) {
case DLT:
return new WrapNViewsTriangulateMetricDLT();
case GEOMETRIC: {
TriangulateNViewsMetric estimator = ... | java | public static TriangulateNViewsMetric triangulateNViewCalibrated(@Nullable ConfigTriangulation config ) {
if( config == null )
config = new ConfigTriangulation();
switch ( config.type ) {
case DLT:
return new WrapNViewsTriangulateMetricDLT();
case GEOMETRIC: {
TriangulateNViewsMetric estimator = ... | [
"public",
"static",
"TriangulateNViewsMetric",
"triangulateNViewCalibrated",
"(",
"@",
"Nullable",
"ConfigTriangulation",
"config",
")",
"{",
"if",
"(",
"config",
"==",
"null",
")",
"config",
"=",
"new",
"ConfigTriangulation",
"(",
")",
";",
"switch",
"(",
"config... | Triangulate N views using the Discrete Linear Transform (DLT) with a calibrated camera
@see TriangulateMetricLinearDLT
@return Two view triangulation algorithm | [
"Triangulate",
"N",
"views",
"using",
"the",
"Discrete",
"Linear",
"Transform",
"(",
"DLT",
")",
"with",
"a",
"calibrated",
"camera"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java#L585-L601 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/util/Environment.java | Environment.get | public String get(String environmentVariableName, String defaultValue) {
return environmentVariables().get(environmentVariableName, defaultValue);
} | java | public String get(String environmentVariableName, String defaultValue) {
return environmentVariables().get(environmentVariableName, defaultValue);
} | [
"public",
"String",
"get",
"(",
"String",
"environmentVariableName",
",",
"String",
"defaultValue",
")",
"{",
"return",
"environmentVariables",
"(",
")",
".",
"get",
"(",
"environmentVariableName",
",",
"defaultValue",
")",
";",
"}"
] | Returns the value set for the environment variable identified by the given name. If the environment variable
is not set, then {@code defaultValue} is returned.
@param environmentVariableName {@link String} name of the environment variable.
@param defaultValue the default value to return if the specified environment v... | [
"Returns",
"the",
"value",
"set",
"for",
"the",
"environment",
"variable",
"identified",
"by",
"the",
"given",
"name",
".",
"If",
"the",
"environment",
"variable",
"is",
"not",
"set",
"then",
"{",
"@code",
"defaultValue",
"}",
"is",
"returned",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/Environment.java#L234-L236 |
jfinal/jfinal | src/main/java/com/jfinal/template/expr/ExprParser.java | ExprParser.staticMember | Expr staticMember() {
if (peek().sym != Sym.ID) {
return sharedMethod();
}
int begin = forward;
while (move().sym == Sym.DOT && move().sym == Sym.ID) {
;
}
// ID.ID.ID::
if (peek().sym != Sym.STATIC || tokenList.get(forward - 1).sym != Sym.ID) {
resetForward(begin);
return share... | java | Expr staticMember() {
if (peek().sym != Sym.ID) {
return sharedMethod();
}
int begin = forward;
while (move().sym == Sym.DOT && move().sym == Sym.ID) {
;
}
// ID.ID.ID::
if (peek().sym != Sym.STATIC || tokenList.get(forward - 1).sym != Sym.ID) {
resetForward(begin);
return share... | [
"Expr",
"staticMember",
"(",
")",
"{",
"if",
"(",
"peek",
"(",
")",
".",
"sym",
"!=",
"Sym",
".",
"ID",
")",
"{",
"return",
"sharedMethod",
"(",
")",
";",
"}",
"int",
"begin",
"=",
"forward",
";",
"while",
"(",
"move",
"(",
")",
".",
"sym",
"==... | staticMember
: ID_list '::' ID
| ID_list '::' ID '(' exprList? ')' | [
"staticMember",
":",
"ID_list",
"::",
"ID",
"|",
"ID_list",
"::",
"ID",
"(",
"exprList?",
")"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/template/expr/ExprParser.java#L303-L337 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java | ComputationGraph.feedForward | public Map<String, INDArray> feedForward(INDArray[] input, boolean train, boolean clearInputs){
setInputs(input);
try {
return ffToLayerActivationsDetached(train, FwdPassType.STANDARD, false, vertices.length - 1,
null, input, inputMaskArrays, labelMaskArrays, clearInputs)... | java | public Map<String, INDArray> feedForward(INDArray[] input, boolean train, boolean clearInputs){
setInputs(input);
try {
return ffToLayerActivationsDetached(train, FwdPassType.STANDARD, false, vertices.length - 1,
null, input, inputMaskArrays, labelMaskArrays, clearInputs)... | [
"public",
"Map",
"<",
"String",
",",
"INDArray",
">",
"feedForward",
"(",
"INDArray",
"[",
"]",
"input",
",",
"boolean",
"train",
",",
"boolean",
"clearInputs",
")",
"{",
"setInputs",
"(",
"input",
")",
";",
"try",
"{",
"return",
"ffToLayerActivationsDetache... | Conduct forward pass using an array of inputs. This overload allows the forward pass to be conducted, optionally
(not) clearing the layer input arrays.<br>
Note: this method should NOT be used with clearInputs = true, unless you know what you are doing. Specifically:
when using clearInputs=false, in combination with wo... | [
"Conduct",
"forward",
"pass",
"using",
"an",
"array",
"of",
"inputs",
".",
"This",
"overload",
"allows",
"the",
"forward",
"pass",
"to",
"be",
"conducted",
"optionally",
"(",
"not",
")",
"clearing",
"the",
"layer",
"input",
"arrays",
".",
"<br",
">",
"Note... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java#L1549-L1558 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeInference.java | TypeInference.inferTemplatedTypesForCall | private boolean inferTemplatedTypesForCall(Node n, FunctionType fnType, FlowScope scope) {
ImmutableList<TemplateType> keys = fnType.getTemplateTypeMap().getTemplateKeys();
if (keys.isEmpty()) {
return false;
}
// Try to infer the template types
Map<TemplateType, JSType> rawInferrence = infer... | java | private boolean inferTemplatedTypesForCall(Node n, FunctionType fnType, FlowScope scope) {
ImmutableList<TemplateType> keys = fnType.getTemplateTypeMap().getTemplateKeys();
if (keys.isEmpty()) {
return false;
}
// Try to infer the template types
Map<TemplateType, JSType> rawInferrence = infer... | [
"private",
"boolean",
"inferTemplatedTypesForCall",
"(",
"Node",
"n",
",",
"FunctionType",
"fnType",
",",
"FlowScope",
"scope",
")",
"{",
"ImmutableList",
"<",
"TemplateType",
">",
"keys",
"=",
"fnType",
".",
"getTemplateTypeMap",
"(",
")",
".",
"getTemplateKeys",... | For functions that use template types, specialize the function type for the call target based
on the call-site specific arguments. Specifically, this enables inference to set the type of
any function literal parameters based on these inferred types. | [
"For",
"functions",
"that",
"use",
"template",
"types",
"specialize",
"the",
"function",
"type",
"for",
"the",
"call",
"target",
"based",
"on",
"the",
"call",
"-",
"site",
"specific",
"arguments",
".",
"Specifically",
"this",
"enables",
"inference",
"to",
"set... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeInference.java#L2040-L2075 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.delegatedAccount_email_responder_PUT | public void delegatedAccount_email_responder_PUT(String email, OvhResponderAccount body) throws IOException {
String qPath = "/email/domain/delegatedAccount/{email}/responder";
StringBuilder sb = path(qPath, email);
exec(qPath, "PUT", sb.toString(), body);
} | java | public void delegatedAccount_email_responder_PUT(String email, OvhResponderAccount body) throws IOException {
String qPath = "/email/domain/delegatedAccount/{email}/responder";
StringBuilder sb = path(qPath, email);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"delegatedAccount_email_responder_PUT",
"(",
"String",
"email",
",",
"OvhResponderAccount",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/delegatedAccount/{email}/responder\"",
";",
"StringBuilder",
"sb",
"=",
"path",
... | Alter this object properties
REST: PUT /email/domain/delegatedAccount/{email}/responder
@param body [required] New object properties
@param email [required] Email | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L311-L315 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-logging/xwiki-commons-logging-api/src/main/java/org/xwiki/logging/LogUtils.java | LogUtils.newLogEvent | public static LogEvent newLogEvent(Marker marker, LogLevel level, String message, Object[] argumentArray,
Throwable throwable)
{
return newLogEvent(marker, level, message, argumentArray, throwable, System.currentTimeMillis());
} | java | public static LogEvent newLogEvent(Marker marker, LogLevel level, String message, Object[] argumentArray,
Throwable throwable)
{
return newLogEvent(marker, level, message, argumentArray, throwable, System.currentTimeMillis());
} | [
"public",
"static",
"LogEvent",
"newLogEvent",
"(",
"Marker",
"marker",
",",
"LogLevel",
"level",
",",
"String",
"message",
",",
"Object",
"[",
"]",
"argumentArray",
",",
"Throwable",
"throwable",
")",
"{",
"return",
"newLogEvent",
"(",
"marker",
",",
"level",... | Create and return a new {@link LogEvent} instance based on the passed parameters.
@param marker the log marker
@param level the log level
@param message the log message
@param argumentArray the event arguments to insert in the message
@param throwable the throwable associated to the event
@return the {@link LogEvent} | [
"Create",
"and",
"return",
"a",
"new",
"{",
"@link",
"LogEvent",
"}",
"instance",
"based",
"on",
"the",
"passed",
"parameters",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-logging/xwiki-commons-logging-api/src/main/java/org/xwiki/logging/LogUtils.java#L51-L55 |
jbundle/jbundle | thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/mem/memory/MKeyArea.java | MKeyArea.doRemove | public void doRemove(FieldTable table, KeyAreaInfo keyArea, BaseBuffer buffer) throws DBException
{
super.doRemove(table, keyArea, buffer);
} | java | public void doRemove(FieldTable table, KeyAreaInfo keyArea, BaseBuffer buffer) throws DBException
{
super.doRemove(table, keyArea, buffer);
} | [
"public",
"void",
"doRemove",
"(",
"FieldTable",
"table",
",",
"KeyAreaInfo",
"keyArea",
",",
"BaseBuffer",
"buffer",
")",
"throws",
"DBException",
"{",
"super",
".",
"doRemove",
"(",
"table",
",",
"keyArea",
",",
"buffer",
")",
";",
"}"
] | Delete the key from this buffer.
@param table The basetable.
@param keyArea The basetable's key area.
@param buffer The buffer to compare.
@exception DBException File exception. | [
"Delete",
"the",
"key",
"from",
"this",
"buffer",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/mem/memory/MKeyArea.java#L152-L155 |
Azure/azure-sdk-for-java | common/azure-common-auth/src/main/java/com/azure/common/auth/credentials/DelegatedTokenCredentials.java | DelegatedTokenCredentials.generateAuthenticationUrl | public String generateAuthenticationUrl(ResponseMode responseMode, String state) {
return String.format("%s/%s/oauth2/authorize?client_id=%s&response_type=code&redirect_uri=%s&response_mode=%s&state=%s",
environment().activeDirectoryEndpoint(), domain(), clientId(), this.redirectUrl, responseMod... | java | public String generateAuthenticationUrl(ResponseMode responseMode, String state) {
return String.format("%s/%s/oauth2/authorize?client_id=%s&response_type=code&redirect_uri=%s&response_mode=%s&state=%s",
environment().activeDirectoryEndpoint(), domain(), clientId(), this.redirectUrl, responseMod... | [
"public",
"String",
"generateAuthenticationUrl",
"(",
"ResponseMode",
"responseMode",
",",
"String",
"state",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"%s/%s/oauth2/authorize?client_id=%s&response_type=code&redirect_uri=%s&response_mode=%s&state=%s\"",
",",
"environmen... | Generate the URL to authenticate through OAuth2.
@param responseMode the method that should be used to send the resulting token back to your app
@param state a value included in the request that is also returned in the token response
@return the URL to authenticate through OAuth2 | [
"Generate",
"the",
"URL",
"to",
"authenticate",
"through",
"OAuth2",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common-auth/src/main/java/com/azure/common/auth/credentials/DelegatedTokenCredentials.java#L113-L116 |
scalecube/socketio | src/main/java/io/scalecube/socketio/SocketIOServer.java | SocketIOServer.newInstance | public static SocketIOServer newInstance(int port, SSLContext sslContext) {
SslContext nettySslContext = new JdkSslContext(sslContext, false, ClientAuth.NONE);
return newInstance(port, nettySslContext);
} | java | public static SocketIOServer newInstance(int port, SSLContext sslContext) {
SslContext nettySslContext = new JdkSslContext(sslContext, false, ClientAuth.NONE);
return newInstance(port, nettySslContext);
} | [
"public",
"static",
"SocketIOServer",
"newInstance",
"(",
"int",
"port",
",",
"SSLContext",
"sslContext",
")",
"{",
"SslContext",
"nettySslContext",
"=",
"new",
"JdkSslContext",
"(",
"sslContext",
",",
"false",
",",
"ClientAuth",
".",
"NONE",
")",
";",
"return",... | Creates instance of Socket.IO server with the given secure port. | [
"Creates",
"instance",
"of",
"Socket",
".",
"IO",
"server",
"with",
"the",
"given",
"secure",
"port",
"."
] | train | https://github.com/scalecube/socketio/blob/bad28fe7a132320750173e7cb71ad6d3688fb626/src/main/java/io/scalecube/socketio/SocketIOServer.java#L75-L78 |
SonarSource/sonarqube | server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/issue/SiblingsIssueMerger.java | SiblingsIssueMerger.tryMerge | public void tryMerge(Component component, Collection<DefaultIssue> newIssues) {
Collection<SiblingIssue> siblingIssues = siblingsIssuesLoader.loadCandidateSiblingIssuesForMerging(component);
Tracking<DefaultIssue, SiblingIssue> tracking = tracker.track(newIssues, siblingIssues);
Map<DefaultIssue, SiblingIs... | java | public void tryMerge(Component component, Collection<DefaultIssue> newIssues) {
Collection<SiblingIssue> siblingIssues = siblingsIssuesLoader.loadCandidateSiblingIssuesForMerging(component);
Tracking<DefaultIssue, SiblingIssue> tracking = tracker.track(newIssues, siblingIssues);
Map<DefaultIssue, SiblingIs... | [
"public",
"void",
"tryMerge",
"(",
"Component",
"component",
",",
"Collection",
"<",
"DefaultIssue",
">",
"newIssues",
")",
"{",
"Collection",
"<",
"SiblingIssue",
">",
"siblingIssues",
"=",
"siblingsIssuesLoader",
".",
"loadCandidateSiblingIssuesForMerging",
"(",
"co... | Look for all unclosed issues in branches/PR targeting the same long living branch, and run
a light issue tracking to find matches. Then merge issue attributes in the new issues. | [
"Look",
"for",
"all",
"unclosed",
"issues",
"in",
"branches",
"/",
"PR",
"targeting",
"the",
"same",
"long",
"living",
"branch",
"and",
"run",
"a",
"light",
"issue",
"tracking",
"to",
"find",
"matches",
".",
"Then",
"merge",
"issue",
"attributes",
"in",
"t... | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/issue/SiblingsIssueMerger.java#L48-L60 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.