repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/PropertiesField.java | PropertiesField.setupDefaultView | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) {
"""
Set up the default screen control for this field.
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param t... | java | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties)
{
ScreenComponent screenField = null;
if (ScreenModel.SWING_TYPE.equalsIgnoreCase(targetScreen.getViewType()))
{
... | [
"public",
"ScreenComponent",
"setupDefaultView",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"Convert",
"converter",
",",
"int",
"iDisplayFieldDesc",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"ScreenComp... | Set up the default screen control for this field.
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param targetScreen Where to place this component (ie., Parent screen or GridBagLayout).
@param converter The converter to set the screenfield to.
@param iDisplayFieldDesc Display the labe... | [
"Set",
"up",
"the",
"default",
"screen",
"control",
"for",
"this",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/PropertiesField.java#L307-L340 |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java | Cnf.getUnsatisfied | public static IConjunct getUnsatisfied( IConjunct condition, PropertySet properties) {
"""
Returns the part of the given condition unsatisfied by the given properties.
"""
Conjunction unsatisfied = new Conjunction();
for( Iterator<IDisjunct> disjuncts = condition.getDisjuncts();
disjuncts.hasN... | java | public static IConjunct getUnsatisfied( IConjunct condition, PropertySet properties)
{
Conjunction unsatisfied = new Conjunction();
for( Iterator<IDisjunct> disjuncts = condition.getDisjuncts();
disjuncts.hasNext();)
{
IDisjunct disjunct = disjuncts.next();
if( !disjunct.satisfied... | [
"public",
"static",
"IConjunct",
"getUnsatisfied",
"(",
"IConjunct",
"condition",
",",
"PropertySet",
"properties",
")",
"{",
"Conjunction",
"unsatisfied",
"=",
"new",
"Conjunction",
"(",
")",
";",
"for",
"(",
"Iterator",
"<",
"IDisjunct",
">",
"disjuncts",
"=",... | Returns the part of the given condition unsatisfied by the given properties. | [
"Returns",
"the",
"part",
"of",
"the",
"given",
"condition",
"unsatisfied",
"by",
"the",
"given",
"properties",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java#L346-L360 |
alkacon/opencms-core | src/org/opencms/ui/dialogs/embedded/CmsDataViewParams.java | CmsDataViewParams.createViewInstance | public I_CmsDataView createViewInstance(CmsObject cms, Locale locale) {
"""
Creates the data view instance.<p>
@param cms the CMS context
@param locale the locale
@return the new data view instance
"""
try {
Class<?> cls = Class.forName(m_viewClass);
Object viewObj = cls.n... | java | public I_CmsDataView createViewInstance(CmsObject cms, Locale locale) {
try {
Class<?> cls = Class.forName(m_viewClass);
Object viewObj = cls.newInstance();
I_CmsDataView dataView = (I_CmsDataView)viewObj;
dataView.initialize(cms, m_viewArg, locale);
... | [
"public",
"I_CmsDataView",
"createViewInstance",
"(",
"CmsObject",
"cms",
",",
"Locale",
"locale",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"cls",
"=",
"Class",
".",
"forName",
"(",
"m_viewClass",
")",
";",
"Object",
"viewObj",
"=",
"cls",
".",
"new... | Creates the data view instance.<p>
@param cms the CMS context
@param locale the locale
@return the new data view instance | [
"Creates",
"the",
"data",
"view",
"instance",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/dialogs/embedded/CmsDataViewParams.java#L103-L115 |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/SplitRegexOperation.java | SplitRegexOperation.performSplitting | private String performSplitting(String source, String splitString, String indexString)
throws TransformationOperationException {
"""
Performs the actual splitting operation. Throws a TransformationOperationException if the index string is not a
number or causes an IndexOutOfBoundsException.
"""
... | java | private String performSplitting(String source, String splitString, String indexString)
throws TransformationOperationException {
Integer index = parseIntString(indexString, false, 0);
Matcher matcher = generateMatcher(splitString, source);
for (int i = 0; i <= index; i++) {
m... | [
"private",
"String",
"performSplitting",
"(",
"String",
"source",
",",
"String",
"splitString",
",",
"String",
"indexString",
")",
"throws",
"TransformationOperationException",
"{",
"Integer",
"index",
"=",
"parseIntString",
"(",
"indexString",
",",
"false",
",",
"0... | Performs the actual splitting operation. Throws a TransformationOperationException if the index string is not a
number or causes an IndexOutOfBoundsException. | [
"Performs",
"the",
"actual",
"splitting",
"operation",
".",
"Throws",
"a",
"TransformationOperationException",
"if",
"the",
"index",
"string",
"is",
"not",
"a",
"number",
"or",
"causes",
"an",
"IndexOutOfBoundsException",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/SplitRegexOperation.java#L74-L87 |
cloudfoundry/uaa | server/src/main/java/org/cloudfoundry/identity/uaa/oauth/UaaAuthorizationEndpoint.java | UaaAuthorizationEndpoint.commence | @Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException {
"""
This method handles /oauth/authorize calls when user is not logged in and the prompt=none param is used
"""
String clientId = re... | java | @Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException {
String clientId = request.getParameter(OAuth2Utils.CLIENT_ID);
String redirectUri = request.getParameter(OAuth2Utils.REDIRECT_URI);
... | [
"@",
"Override",
"public",
"void",
"commence",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"AuthenticationException",
"authException",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"String",
"clientId",
"=",
"request"... | This method handles /oauth/authorize calls when user is not logged in and the prompt=none param is used | [
"This",
"method",
"handles",
"/",
"oauth",
"/",
"authorize",
"calls",
"when",
"user",
"is",
"not",
"logged",
"in",
"and",
"the",
"prompt",
"=",
"none",
"param",
"is",
"used"
] | train | https://github.com/cloudfoundry/uaa/blob/e8df3d7060580c92d33461106399f9e4f36e3cd2/server/src/main/java/org/cloudfoundry/identity/uaa/oauth/UaaAuthorizationEndpoint.java#L252-L299 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/CmsGalleryTreeItem.java | CmsGalleryTreeItem.showGallery | protected void showGallery(CmsClientSitemapEntry entry) {
"""
Shows the gallery dialog for the given entry.<p>
@param entry the gallery folder entry
"""
CmsGalleryConfiguration configuration = new CmsGalleryConfiguration();
List<String> typeNames = CmsSitemapView.getInstance().getController... | java | protected void showGallery(CmsClientSitemapEntry entry) {
CmsGalleryConfiguration configuration = new CmsGalleryConfiguration();
List<String> typeNames = CmsSitemapView.getInstance().getController().getGalleryType(
new Integer(entry.getResourceTypeId())).getContentTypeNames();
confi... | [
"protected",
"void",
"showGallery",
"(",
"CmsClientSitemapEntry",
"entry",
")",
"{",
"CmsGalleryConfiguration",
"configuration",
"=",
"new",
"CmsGalleryConfiguration",
"(",
")",
";",
"List",
"<",
"String",
">",
"typeNames",
"=",
"CmsSitemapView",
".",
"getInstance",
... | Shows the gallery dialog for the given entry.<p>
@param entry the gallery folder entry | [
"Shows",
"the",
"gallery",
"dialog",
"for",
"the",
"given",
"entry",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/CmsGalleryTreeItem.java#L188-L202 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Widget.java | Widget.addChild | protected boolean addChild(final Widget child,
final GVRSceneObject childRootSceneObject, boolean preventLayout) {
"""
Add another {@link Widget} as a child of this one. Convenience method for
{@link #addChild(Widget, GVRSceneObject, int, boolean) addChild(child, childRootSceneObjec... | java | protected boolean addChild(final Widget child,
final GVRSceneObject childRootSceneObject, boolean preventLayout) {
return addChild(child, childRootSceneObject, -1, preventLayout);
} | [
"protected",
"boolean",
"addChild",
"(",
"final",
"Widget",
"child",
",",
"final",
"GVRSceneObject",
"childRootSceneObject",
",",
"boolean",
"preventLayout",
")",
"{",
"return",
"addChild",
"(",
"child",
",",
"childRootSceneObject",
",",
"-",
"1",
",",
"preventLay... | Add another {@link Widget} as a child of this one. Convenience method for
{@link #addChild(Widget, GVRSceneObject, int, boolean) addChild(child, childRootSceneObject,
-1, preventLayout)}.
@param child
The {@code Widget} to add as a child.
@param childRootSceneObject
The root {@link GVRSceneObject} of the child.
@param... | [
"Add",
"another",
"{",
"@link",
"Widget",
"}",
"as",
"a",
"child",
"of",
"this",
"one",
".",
"Convenience",
"method",
"for",
"{",
"@link",
"#addChild",
"(",
"Widget",
"GVRSceneObject",
"int",
"boolean",
")",
"addChild",
"(",
"child",
"childRootSceneObject",
... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Widget.java#L2973-L2976 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.fixCyclicInheritance | @Fix(IssueCodes.CYCLIC_INHERITANCE)
public void fixCyclicInheritance(final Issue issue, IssueResolutionAcceptor acceptor) {
"""
Quick fix for "Cyclic hierarchy".
@param issue the issue.
@param acceptor the quick fix acceptor.
"""
ExtendedTypeRemoveModification.accept(this, issue, acceptor);
} | java | @Fix(IssueCodes.CYCLIC_INHERITANCE)
public void fixCyclicInheritance(final Issue issue, IssueResolutionAcceptor acceptor) {
ExtendedTypeRemoveModification.accept(this, issue, acceptor);
} | [
"@",
"Fix",
"(",
"IssueCodes",
".",
"CYCLIC_INHERITANCE",
")",
"public",
"void",
"fixCyclicInheritance",
"(",
"final",
"Issue",
"issue",
",",
"IssueResolutionAcceptor",
"acceptor",
")",
"{",
"ExtendedTypeRemoveModification",
".",
"accept",
"(",
"this",
",",
"issue",... | Quick fix for "Cyclic hierarchy".
@param issue the issue.
@param acceptor the quick fix acceptor. | [
"Quick",
"fix",
"for",
"Cyclic",
"hierarchy",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L825-L828 |
sahan/RoboZombie | robozombie/src/main/java/com/lonepulse/robozombie/AbstractGenericFactory.java | AbstractGenericFactory.newInstance | @Override
public OUTPUT newInstance(Map<String, INPUT> inputMap) throws FAILURE {
"""
<p><b>Unsupported</b>. Override to provide an implementation.</p>
<p>See {@link GenericFactory#newInstance(Map)}</p>
@since 1.3.0
"""
StringBuilder builder = new StringBuilder()
.append(getClass().getName())
.... | java | @Override
public OUTPUT newInstance(Map<String, INPUT> inputMap) throws FAILURE {
StringBuilder builder = new StringBuilder()
.append(getClass().getName())
.append(".newInstance(Map<String, Input>) is unsupported.");
throw new UnsupportedOperationException(builder.toString());
} | [
"@",
"Override",
"public",
"OUTPUT",
"newInstance",
"(",
"Map",
"<",
"String",
",",
"INPUT",
">",
"inputMap",
")",
"throws",
"FAILURE",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
".",
"append",
"(",
"getClass",
"(",
")",
".",
... | <p><b>Unsupported</b>. Override to provide an implementation.</p>
<p>See {@link GenericFactory#newInstance(Map)}</p>
@since 1.3.0 | [
"<p",
">",
"<b",
">",
"Unsupported<",
"/",
"b",
">",
".",
"Override",
"to",
"provide",
"an",
"implementation",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/sahan/RoboZombie/blob/2e02f0d41647612e9d89360c5c48811ea86b33c8/robozombie/src/main/java/com/lonepulse/robozombie/AbstractGenericFactory.java#L66-L74 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/conversion/smile/SmileConverter.java | SmileConverter.numericDataset | public AttributeDataset numericDataset(int responseColIndex, int... variablesColIndices) {
"""
Returns a dataset where the response column is numeric. E.g. to be used for a regression
"""
return dataset(table.numberColumn(responseColIndex), AttributeType.NUMERIC, table.columns(variablesColIndices));
... | java | public AttributeDataset numericDataset(int responseColIndex, int... variablesColIndices) {
return dataset(table.numberColumn(responseColIndex), AttributeType.NUMERIC, table.columns(variablesColIndices));
} | [
"public",
"AttributeDataset",
"numericDataset",
"(",
"int",
"responseColIndex",
",",
"int",
"...",
"variablesColIndices",
")",
"{",
"return",
"dataset",
"(",
"table",
".",
"numberColumn",
"(",
"responseColIndex",
")",
",",
"AttributeType",
".",
"NUMERIC",
",",
"ta... | Returns a dataset where the response column is numeric. E.g. to be used for a regression | [
"Returns",
"a",
"dataset",
"where",
"the",
"response",
"column",
"is",
"numeric",
".",
"E",
".",
"g",
".",
"to",
"be",
"used",
"for",
"a",
"regression"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/conversion/smile/SmileConverter.java#L39-L41 |
tweea/matrixjavalib-main-common | src/main/java/net/matrix/util/Collections3.java | Collections3.extractToList | public static List extractToList(final Collection collection, final String propertyName) {
"""
提取集合中的对象的一个属性(通过 Getter 函数),组合成 List。
@param collection
来源集合
@param propertyName
要提取的属性名
@return 属性列表
"""
List list = new ArrayList(collection.size());
try {
for (Object obj : collection) {
list.ad... | java | public static List extractToList(final Collection collection, final String propertyName) {
List list = new ArrayList(collection.size());
try {
for (Object obj : collection) {
list.add(PropertyUtils.getProperty(obj, propertyName));
}
} catch (ReflectiveOperationException e) {
throw new ReflectionRunt... | [
"public",
"static",
"List",
"extractToList",
"(",
"final",
"Collection",
"collection",
",",
"final",
"String",
"propertyName",
")",
"{",
"List",
"list",
"=",
"new",
"ArrayList",
"(",
"collection",
".",
"size",
"(",
")",
")",
";",
"try",
"{",
"for",
"(",
... | 提取集合中的对象的一个属性(通过 Getter 函数),组合成 List。
@param collection
来源集合
@param propertyName
要提取的属性名
@return 属性列表 | [
"提取集合中的对象的一个属性(通过",
"Getter",
"函数),组合成",
"List。"
] | train | https://github.com/tweea/matrixjavalib-main-common/blob/ac8f98322a422e3ef76c3e12d47b98268cec7006/src/main/java/net/matrix/util/Collections3.java#L63-L75 |
EdwardRaff/JSAT | JSAT/src/jsat/distributions/discrete/UniformDiscrete.java | UniformDiscrete.setMinMax | public void setMinMax(int min, int max) {
"""
Sets the minimum and maximum values at the same time, this is useful if
setting them one at a time may have caused a conflict with the previous
values
@param min the new minimum value to occur
@param max the new maximum value to occur
"""
if(min >= m... | java | public void setMinMax(int min, int max)
{
if(min >= max)
throw new IllegalArgumentException("The input minimum (" + min + ") must be less than the given max (" + max + ")");
this.min = min;
this.max = max;
} | [
"public",
"void",
"setMinMax",
"(",
"int",
"min",
",",
"int",
"max",
")",
"{",
"if",
"(",
"min",
">=",
"max",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The input minimum (\"",
"+",
"min",
"+",
"\") must be less than the given max (\"",
"+",
"max",... | Sets the minimum and maximum values at the same time, this is useful if
setting them one at a time may have caused a conflict with the previous
values
@param min the new minimum value to occur
@param max the new maximum value to occur | [
"Sets",
"the",
"minimum",
"and",
"maximum",
"values",
"at",
"the",
"same",
"time",
"this",
"is",
"useful",
"if",
"setting",
"them",
"one",
"at",
"a",
"time",
"may",
"have",
"caused",
"a",
"conflict",
"with",
"the",
"previous",
"values"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/discrete/UniformDiscrete.java#L55-L61 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.getAccountInvoices | public Invoices getAccountInvoices(final String accountCode, final InvoiceState state, final QueryParams params) {
"""
Lookup an account's invoices given query params
<p>
Returns the account's invoices
@param accountCode recurly account id
@param state {@link InvoiceState} state of the invoices
@param param... | java | public Invoices getAccountInvoices(final String accountCode, final InvoiceState state, final QueryParams params) {
if (state != null) params.put("state", state.getType());
return doGET(Accounts.ACCOUNTS_RESOURCE + "/" + accountCode + Invoices.INVOICES_RESOURCE,
Invoices.class, params);
... | [
"public",
"Invoices",
"getAccountInvoices",
"(",
"final",
"String",
"accountCode",
",",
"final",
"InvoiceState",
"state",
",",
"final",
"QueryParams",
"params",
")",
"{",
"if",
"(",
"state",
"!=",
"null",
")",
"params",
".",
"put",
"(",
"\"state\"",
",",
"st... | Lookup an account's invoices given query params
<p>
Returns the account's invoices
@param accountCode recurly account id
@param state {@link InvoiceState} state of the invoices
@param params {@link QueryParams}
@return the invoices associated with this account on success, null otherwise | [
"Lookup",
"an",
"account",
"s",
"invoices",
"given",
"query",
"params",
"<p",
">",
"Returns",
"the",
"account",
"s",
"invoices"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L1245-L1249 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspNavBuilder.java | CmsJspNavBuilder.getNavigationBreadCrumb | public List<CmsJspNavElement> getNavigationBreadCrumb(int startlevel, int endlevel) {
"""
Build a "bread crumb" path navigation to the current folder.<p>
@param startlevel the start level, if negative, go down |n| steps from selected folder
@param endlevel the end level, if -1, build navigation to selected fol... | java | public List<CmsJspNavElement> getNavigationBreadCrumb(int startlevel, int endlevel) {
return getNavigationBreadCrumb(m_requestUriFolder, startlevel, endlevel, true);
} | [
"public",
"List",
"<",
"CmsJspNavElement",
">",
"getNavigationBreadCrumb",
"(",
"int",
"startlevel",
",",
"int",
"endlevel",
")",
"{",
"return",
"getNavigationBreadCrumb",
"(",
"m_requestUriFolder",
",",
"startlevel",
",",
"endlevel",
",",
"true",
")",
";",
"}"
] | Build a "bread crumb" path navigation to the current folder.<p>
@param startlevel the start level, if negative, go down |n| steps from selected folder
@param endlevel the end level, if -1, build navigation to selected folder
@return sorted list of navigation elements
@see #getNavigationBreadCrumb(String, int, int, b... | [
"Build",
"a",
"bread",
"crumb",
"path",
"navigation",
"to",
"the",
"current",
"folder",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspNavBuilder.java#L398-L401 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeBuilder.java | AnnotationTypeBuilder.buildAnnotationTypeFieldDetails | public void buildAnnotationTypeFieldDetails(XMLNode node, Content memberDetailsTree)
throws DocletException {
"""
Build the annotation type field documentation.
@param node the XML element that specifies which components to document
@param memberDetailsTree the content tree to which the documentati... | java | public void buildAnnotationTypeFieldDetails(XMLNode node, Content memberDetailsTree)
throws DocletException {
configuration.getBuilderFactory().
getAnnotationTypeFieldsBuilder(writer).buildChildren(node, memberDetailsTree);
} | [
"public",
"void",
"buildAnnotationTypeFieldDetails",
"(",
"XMLNode",
"node",
",",
"Content",
"memberDetailsTree",
")",
"throws",
"DocletException",
"{",
"configuration",
".",
"getBuilderFactory",
"(",
")",
".",
"getAnnotationTypeFieldsBuilder",
"(",
"writer",
")",
".",
... | Build the annotation type field documentation.
@param node the XML element that specifies which components to document
@param memberDetailsTree the content tree to which the documentation will be added
@throws DocletException if there is a problem building the documentation | [
"Build",
"the",
"annotation",
"type",
"field",
"documentation",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeBuilder.java#L242-L246 |
haifengl/smile | core/src/main/java/smile/association/FPGrowth.java | FPGrowth.getLocalFPTree | private FPTree getLocalFPTree(FPTree.Node node, int[] localItemSupport, int[] prefixItemset) {
"""
Generates a local FP tree
@param node the conditional patterns given this node to construct the local FP-tree.
@rerurn the local FP-tree.
"""
FPTree tree = new FPTree(localItemSupport, minSupport);
... | java | private FPTree getLocalFPTree(FPTree.Node node, int[] localItemSupport, int[] prefixItemset) {
FPTree tree = new FPTree(localItemSupport, minSupport);
while (node != null) {
Node parent = node.parent;
int i = prefixItemset.length;
while (parent != null) {
... | [
"private",
"FPTree",
"getLocalFPTree",
"(",
"FPTree",
".",
"Node",
"node",
",",
"int",
"[",
"]",
"localItemSupport",
",",
"int",
"[",
"]",
"prefixItemset",
")",
"{",
"FPTree",
"tree",
"=",
"new",
"FPTree",
"(",
"localItemSupport",
",",
"minSupport",
")",
"... | Generates a local FP tree
@param node the conditional patterns given this node to construct the local FP-tree.
@rerurn the local FP-tree. | [
"Generates",
"a",
"local",
"FP",
"tree"
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/association/FPGrowth.java#L444-L464 |
google/closure-templates | java/src/com/google/template/soy/parsepasses/contextautoesc/InferenceEngine.java | InferenceEngine.inferStrictRenderUnitNode | static void inferStrictRenderUnitNode(
RenderUnitNode node, Inferences inferences, ErrorReporter errorReporter) {
"""
Applies strict contextual autoescaping to the given node's children.
<p>The start context is the given node's declared {@link ContentKind}, and it is enforced that
the block's inferred en... | java | static void inferStrictRenderUnitNode(
RenderUnitNode node, Inferences inferences, ErrorReporter errorReporter) {
InferenceEngine inferenceEngine = new InferenceEngine(inferences, errorReporter);
// Context started off as startContext and we have propagated context through all of
// node's children, s... | [
"static",
"void",
"inferStrictRenderUnitNode",
"(",
"RenderUnitNode",
"node",
",",
"Inferences",
"inferences",
",",
"ErrorReporter",
"errorReporter",
")",
"{",
"InferenceEngine",
"inferenceEngine",
"=",
"new",
"InferenceEngine",
"(",
"inferences",
",",
"errorReporter",
... | Applies strict contextual autoescaping to the given node's children.
<p>The start context is the given node's declared {@link ContentKind}, and it is enforced that
the block's inferred end context matches the start context.
<p>This method is used to visit the content of {let} and {param} nodes with a {@code kind}
att... | [
"Applies",
"strict",
"contextual",
"autoescaping",
"to",
"the",
"given",
"node",
"s",
"children",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/parsepasses/contextautoesc/InferenceEngine.java#L135-L145 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java | MPD9AbstractReader.processProjectListItem | protected void processProjectListItem(Map<Integer, String> result, Row row) {
"""
Retrieve the details of a single project from the database.
@param result Map instance containing the results
@param row result set row read from the database
"""
Integer id = row.getInteger("PROJ_ID");
String nam... | java | protected void processProjectListItem(Map<Integer, String> result, Row row)
{
Integer id = row.getInteger("PROJ_ID");
String name = row.getString("PROJ_NAME");
result.put(id, name);
} | [
"protected",
"void",
"processProjectListItem",
"(",
"Map",
"<",
"Integer",
",",
"String",
">",
"result",
",",
"Row",
"row",
")",
"{",
"Integer",
"id",
"=",
"row",
".",
"getInteger",
"(",
"\"PROJ_ID\"",
")",
";",
"String",
"name",
"=",
"row",
".",
"getStr... | Retrieve the details of a single project from the database.
@param result Map instance containing the results
@param row result set row read from the database | [
"Retrieve",
"the",
"details",
"of",
"a",
"single",
"project",
"from",
"the",
"database",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java#L92-L97 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java | Value.structArray | public static Value structArray(Type elementType, @Nullable Iterable<Struct> v) {
"""
Returns an {@code ARRAY<STRUCT<...>>} value.
@param elementType
@param v the source of element values. This may be {@code null} to produce a value for which
{@code isNull()} is {@code true}. Individual elements may also be {... | java | public static Value structArray(Type elementType, @Nullable Iterable<Struct> v) {
if (v == null) {
Preconditions.checkArgument(
elementType.getCode() == Code.STRUCT,
"Illegal call to create a NULL array-of-struct with a non-struct element type.");
return new StructArrayImpl(elementTy... | [
"public",
"static",
"Value",
"structArray",
"(",
"Type",
"elementType",
",",
"@",
"Nullable",
"Iterable",
"<",
"Struct",
">",
"v",
")",
"{",
"if",
"(",
"v",
"==",
"null",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"elementType",
".",
"getCode",
... | Returns an {@code ARRAY<STRUCT<...>>} value.
@param elementType
@param v the source of element values. This may be {@code null} to produce a value for which
{@code isNull()} is {@code true}. Individual elements may also be {@code null}. | [
"Returns",
"an",
"{",
"@code",
"ARRAY<STRUCT<",
"...",
">>",
"}",
"value",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java#L335-L353 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java | LocationHelper.getMin | public static Location getMin(List<Location> locations) {
"""
Scans through a list of locations to find the Location with the
lowest start
"""
return scanLocations(locations, new LocationPredicate() {
@Override
public boolean accept(Location previous, Location current) {
int res = current.getStart... | java | public static Location getMin(List<Location> locations) {
return scanLocations(locations, new LocationPredicate() {
@Override
public boolean accept(Location previous, Location current) {
int res = current.getStart().compareTo(previous.getStart());
return res < 0;
}
});
} | [
"public",
"static",
"Location",
"getMin",
"(",
"List",
"<",
"Location",
">",
"locations",
")",
"{",
"return",
"scanLocations",
"(",
"locations",
",",
"new",
"LocationPredicate",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"accept",
"(",
"Location",
... | Scans through a list of locations to find the Location with the
lowest start | [
"Scans",
"through",
"a",
"list",
"of",
"locations",
"to",
"find",
"the",
"Location",
"with",
"the",
"lowest",
"start"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java#L174-L182 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java | PAbstractObject.getString | @Override
public final String getString(final String key) {
"""
Get a property as a string or throw an exception.
@param key the property name
"""
String result = optString(key);
if (result == null) {
throw new ObjectMissingException(this, key);
}
return resul... | java | @Override
public final String getString(final String key) {
String result = optString(key);
if (result == null) {
throw new ObjectMissingException(this, key);
}
return result;
} | [
"@",
"Override",
"public",
"final",
"String",
"getString",
"(",
"final",
"String",
"key",
")",
"{",
"String",
"result",
"=",
"optString",
"(",
"key",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"throw",
"new",
"ObjectMissingException",
"(",
"t... | Get a property as a string or throw an exception.
@param key the property name | [
"Get",
"a",
"property",
"as",
"a",
"string",
"or",
"throw",
"an",
"exception",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java#L24-L31 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.writeMBeanInfo | public void writeMBeanInfo(OutputStream out, MBeanInfoWrapper value) throws IOException {
"""
Encode an MBeanInfoWrapper instance as JSON:
{
"className" : String,
"description" : String,
"descriptor" : Descriptor,
"attributes" : [ MBeanAttributeInfo* ],
"attributes_URL" : URL,
"constructors" : [ MBeanConstr... | java | public void writeMBeanInfo(OutputStream out, MBeanInfoWrapper value) throws IOException {
// TODO: MBeanInfo has 2 sub-classes, Model*Support and Open*Support.
// How to handle them? "Open" has references to OpenTMBean*Info.
// Model has more convenience methods for retrieving individual
... | [
"public",
"void",
"writeMBeanInfo",
"(",
"OutputStream",
"out",
",",
"MBeanInfoWrapper",
"value",
")",
"throws",
"IOException",
"{",
"// TODO: MBeanInfo has 2 sub-classes, Model*Support and Open*Support.",
"// How to handle them? \"Open\" has references to OpenTMBean*Info.",
"// Model ... | Encode an MBeanInfoWrapper instance as JSON:
{
"className" : String,
"description" : String,
"descriptor" : Descriptor,
"attributes" : [ MBeanAttributeInfo* ],
"attributes_URL" : URL,
"constructors" : [ MBeanConstructorInfo* ],
"notifications" : [ MBeanNotificationInfo* ],
"operations" : [ MBeanOperationInfo* ]
}
Desc... | [
"Encode",
"an",
"MBeanInfoWrapper",
"instance",
"as",
"JSON",
":",
"{",
"className",
":",
"String",
"description",
":",
"String",
"descriptor",
":",
"Descriptor",
"attributes",
":",
"[",
"MBeanAttributeInfo",
"*",
"]",
"attributes_URL",
":",
"URL",
"constructors",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1250-L1276 |
apereo/cas | support/cas-server-support-aws/src/main/java/org/apereo/cas/aws/AmazonEnvironmentAwareClientBuilder.java | AmazonEnvironmentAwareClientBuilder.getSetting | public <T> T getSetting(final String key, final Class<T> targetType) {
"""
Gets setting.
@param <T> the type parameter
@param key the key
@param targetType the target type
@return the setting
"""
return environment.getProperty(this.propertyPrefix + '.' + key, targetType);
} | java | public <T> T getSetting(final String key, final Class<T> targetType) {
return environment.getProperty(this.propertyPrefix + '.' + key, targetType);
} | [
"public",
"<",
"T",
">",
"T",
"getSetting",
"(",
"final",
"String",
"key",
",",
"final",
"Class",
"<",
"T",
">",
"targetType",
")",
"{",
"return",
"environment",
".",
"getProperty",
"(",
"this",
".",
"propertyPrefix",
"+",
"'",
"'",
"+",
"key",
",",
... | Gets setting.
@param <T> the type parameter
@param key the key
@param targetType the target type
@return the setting | [
"Gets",
"setting",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-aws/src/main/java/org/apereo/cas/aws/AmazonEnvironmentAwareClientBuilder.java#L56-L58 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/container/impl/metadata/PropertyHelper.java | PropertyHelper.resolveProperty | public static String resolveProperty(Properties props, String original) {
"""
Replaces Ant-style property references if the corresponding keys exist in the provided {@link Properties}.
@param props contains possible replacements
@param original may contain Ant-style templates
@return the original string with ... | java | public static String resolveProperty(Properties props, String original) {
Matcher matcher = PROPERTY_TEMPLATE.matcher(original);
StringBuilder buffer = new StringBuilder();
boolean found = false;
while(matcher.find()) {
found = true;
String propertyName = matcher.group(2).trim();
buffe... | [
"public",
"static",
"String",
"resolveProperty",
"(",
"Properties",
"props",
",",
"String",
"original",
")",
"{",
"Matcher",
"matcher",
"=",
"PROPERTY_TEMPLATE",
".",
"matcher",
"(",
"original",
")",
";",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"... | Replaces Ant-style property references if the corresponding keys exist in the provided {@link Properties}.
@param props contains possible replacements
@param original may contain Ant-style templates
@return the original string with replaced properties or the unchanged original string if no placeholder found. | [
"Replaces",
"Ant",
"-",
"style",
"property",
"references",
"if",
"the",
"corresponding",
"keys",
"exist",
"in",
"the",
"provided",
"{",
"@link",
"Properties",
"}",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/container/impl/metadata/PropertyHelper.java#L122-L134 |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/knxnetip/ConnectionImpl.java | ConnectionImpl.fireFrameReceived | protected void fireFrameReceived(CEMI frame) {
"""
Fires a frame received event ({@link KNXListener#frameReceived(FrameEvent)}) for
the supplied cEMI <code>frame</code>.
@param frame the cEMI to generate the event for
"""
final FrameEvent fe = new FrameEvent(this, frame);
for (final Iterator i = list... | java | protected void fireFrameReceived(CEMI frame)
{
final FrameEvent fe = new FrameEvent(this, frame);
for (final Iterator i = listenersCopy.iterator(); i.hasNext();) {
final KNXListener l = (KNXListener) i.next();
try {
l.frameReceived(fe);
}
catch (final RuntimeException e) {
removeConnec... | [
"protected",
"void",
"fireFrameReceived",
"(",
"CEMI",
"frame",
")",
"{",
"final",
"FrameEvent",
"fe",
"=",
"new",
"FrameEvent",
"(",
"this",
",",
"frame",
")",
";",
"for",
"(",
"final",
"Iterator",
"i",
"=",
"listenersCopy",
".",
"iterator",
"(",
")",
"... | Fires a frame received event ({@link KNXListener#frameReceived(FrameEvent)}) for
the supplied cEMI <code>frame</code>.
@param frame the cEMI to generate the event for | [
"Fires",
"a",
"frame",
"received",
"event",
"(",
"{",
"@link",
"KNXListener#frameReceived",
"(",
"FrameEvent",
")",
"}",
")",
"for",
"the",
"supplied",
"cEMI",
"<code",
">",
"frame<",
"/",
"code",
">",
"."
] | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/knxnetip/ConnectionImpl.java#L481-L494 |
JoeKerouac/utils | src/main/java/com/joe/utils/common/Assert.java | Assert.isTimeZone | public static void isTimeZone(String beginTime, String endTime, String format) {
"""
断言给定时间是一个正确的时间段(即开始时间小于结束时间)
@param beginTime 开始时间
@param endTime 结束时间
@param format 时间格式
"""
DateUtil.parse(beginTime, format);
DateUtil.parse(endTime, format);
if (beginTime.compareTo(endTime) > 0)... | java | public static void isTimeZone(String beginTime, String endTime, String format) {
DateUtil.parse(beginTime, format);
DateUtil.parse(endTime, format);
if (beginTime.compareTo(endTime) > 0) {
throw new IllegalArgumentException("开始时间必须小于结束时间");
}
} | [
"public",
"static",
"void",
"isTimeZone",
"(",
"String",
"beginTime",
",",
"String",
"endTime",
",",
"String",
"format",
")",
"{",
"DateUtil",
".",
"parse",
"(",
"beginTime",
",",
"format",
")",
";",
"DateUtil",
".",
"parse",
"(",
"endTime",
",",
"format",... | 断言给定时间是一个正确的时间段(即开始时间小于结束时间)
@param beginTime 开始时间
@param endTime 结束时间
@param format 时间格式 | [
"断言给定时间是一个正确的时间段(即开始时间小于结束时间)"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/common/Assert.java#L36-L42 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/util/cache/WrapperBucket.java | WrapperBucket.insertByKey | public Element insertByKey(Object key, Object object) {
"""
Insert the specified object into the bucket and associate it with
the specified key. Returns the Element which holds the newly-
inserted object.
@param key key of the object element to be inserted.
@param object the object to be inserted for the spe... | java | public Element insertByKey(Object key, Object object)
{
EJSWrapperCommon element = (EJSWrapperCommon) object;
if (ivWrappers == null)
{
ivWrappers = new HashMap<Object, EJSWrapperCommon>(DEFAULT_BUCKET_SIZE);
}
Object duplicate = ivWrappers.put(key, element);
... | [
"public",
"Element",
"insertByKey",
"(",
"Object",
"key",
",",
"Object",
"object",
")",
"{",
"EJSWrapperCommon",
"element",
"=",
"(",
"EJSWrapperCommon",
")",
"object",
";",
"if",
"(",
"ivWrappers",
"==",
"null",
")",
"{",
"ivWrappers",
"=",
"new",
"HashMap"... | Insert the specified object into the bucket and associate it with
the specified key. Returns the Element which holds the newly-
inserted object.
@param key key of the object element to be inserted.
@param object the object to be inserted for the specified key.
@return the Element holding the target object just inserte... | [
"Insert",
"the",
"specified",
"object",
"into",
"the",
"bucket",
"and",
"associate",
"it",
"with",
"the",
"specified",
"key",
".",
"Returns",
"the",
"Element",
"which",
"holds",
"the",
"newly",
"-",
"inserted",
"object",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/util/cache/WrapperBucket.java#L119-L163 |
joniles/mpxj | src/main/java/net/sf/mpxj/explorer/ObjectPropertiesController.java | ObjectPropertiesController.getSingleValue | private void getSingleValue(Method method, Object object, Map<String, String> map) {
"""
Retrieve a single value property.
@param method method definition
@param object target object
@param map parameter values
"""
Object value;
try
{
value = filterValue(method.invoke(object));
... | java | private void getSingleValue(Method method, Object object, Map<String, String> map)
{
Object value;
try
{
value = filterValue(method.invoke(object));
}
catch (Exception ex)
{
value = ex.toString();
}
if (value != null)
{
map.put(getProp... | [
"private",
"void",
"getSingleValue",
"(",
"Method",
"method",
",",
"Object",
"object",
",",
"Map",
"<",
"String",
",",
"String",
">",
"map",
")",
"{",
"Object",
"value",
";",
"try",
"{",
"value",
"=",
"filterValue",
"(",
"method",
".",
"invoke",
"(",
"... | Retrieve a single value property.
@param method method definition
@param object target object
@param map parameter values | [
"Retrieve",
"a",
"single",
"value",
"property",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/explorer/ObjectPropertiesController.java#L167-L183 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/io/ByteIOUtils.java | ByteIOUtils.writeInt | public static void writeInt(ByteBuffer buf, int pos, int v) {
"""
Writes a specific integer value (4 bytes) to the output byte buffer at the given offset.
@param buf output byte buffer
@param pos offset into the byte buffer to write
@param v int value to write
"""
buf.put(pos++, (byte) (0xff & (v >> 2... | java | public static void writeInt(ByteBuffer buf, int pos, int v) {
buf.put(pos++, (byte) (0xff & (v >> 24)));
buf.put(pos++, (byte) (0xff & (v >> 16)));
buf.put(pos++, (byte) (0xff & (v >> 8)));
buf.put(pos, (byte) (0xff & v));
} | [
"public",
"static",
"void",
"writeInt",
"(",
"ByteBuffer",
"buf",
",",
"int",
"pos",
",",
"int",
"v",
")",
"{",
"buf",
".",
"put",
"(",
"pos",
"++",
",",
"(",
"byte",
")",
"(",
"0xff",
"&",
"(",
"v",
">>",
"24",
")",
")",
")",
";",
"buf",
"."... | Writes a specific integer value (4 bytes) to the output byte buffer at the given offset.
@param buf output byte buffer
@param pos offset into the byte buffer to write
@param v int value to write | [
"Writes",
"a",
"specific",
"integer",
"value",
"(",
"4",
"bytes",
")",
"to",
"the",
"output",
"byte",
"buffer",
"at",
"the",
"given",
"offset",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/ByteIOUtils.java#L183-L188 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.dedicated_server_serviceName_bandwidth_duration_GET | public OvhOrder dedicated_server_serviceName_bandwidth_duration_GET(String serviceName, String duration, OvhBandwidthOrderEnum bandwidth, OvhBandwidthOrderTypeEnum type) throws IOException {
"""
Get prices and contracts information
REST: GET /order/dedicated/server/{serviceName}/bandwidth/{duration}
@param ban... | java | public OvhOrder dedicated_server_serviceName_bandwidth_duration_GET(String serviceName, String duration, OvhBandwidthOrderEnum bandwidth, OvhBandwidthOrderTypeEnum type) throws IOException {
String qPath = "/order/dedicated/server/{serviceName}/bandwidth/{duration}";
StringBuilder sb = path(qPath, serviceName, dura... | [
"public",
"OvhOrder",
"dedicated_server_serviceName_bandwidth_duration_GET",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"OvhBandwidthOrderEnum",
"bandwidth",
",",
"OvhBandwidthOrderTypeEnum",
"type",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"... | Get prices and contracts information
REST: GET /order/dedicated/server/{serviceName}/bandwidth/{duration}
@param bandwidth [required] Bandwidth to allocate
@param type [required] bandwidth type
@param serviceName [required] The internal name of your dedicated server
@param duration [required] Duration | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L2501-L2508 |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java | HttpBuilder.optionsAsync | public CompletableFuture<Object> optionsAsync(@DelegatesTo(HttpConfig.class) final Closure closure) {
"""
Executes an asynchronous OPTIONS request on the configured URI (asynchronous alias to the `options(Closure)` method), with additional configuration
provided by the configuration closure.
[source,groovy]
-... | java | public CompletableFuture<Object> optionsAsync(@DelegatesTo(HttpConfig.class) final Closure closure) {
return CompletableFuture.supplyAsync(() -> options(closure), getExecutor());
} | [
"public",
"CompletableFuture",
"<",
"Object",
">",
"optionsAsync",
"(",
"@",
"DelegatesTo",
"(",
"HttpConfig",
".",
"class",
")",
"final",
"Closure",
"closure",
")",
"{",
"return",
"CompletableFuture",
".",
"supplyAsync",
"(",
"(",
")",
"->",
"options",
"(",
... | Executes an asynchronous OPTIONS request on the configured URI (asynchronous alias to the `options(Closure)` method), with additional configuration
provided by the configuration closure.
[source,groovy]
----
def http = HttpBuilder.configure {
request.uri = 'http://localhost:10101'
}
http.optionsAsync(){
request.uri.pa... | [
"Executes",
"an",
"asynchronous",
"OPTIONS",
"request",
"on",
"the",
"configured",
"URI",
"(",
"asynchronous",
"alias",
"to",
"the",
"options",
"(",
"Closure",
")",
"method",
")",
"with",
"additional",
"configuration",
"provided",
"by",
"the",
"configuration",
"... | train | https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L1902-L1904 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsXmlContainerPageFactory.java | CmsXmlContainerPageFactory.createDocument | public static CmsXmlContainerPage createDocument(
CmsObject cms,
Locale locale,
String encoding,
CmsXmlContentDefinition contentDefinition) {
"""
Create a new instance of a container page based on the given content definition,
that will have one language node for the given locale a... | java | public static CmsXmlContainerPage createDocument(
CmsObject cms,
Locale locale,
String encoding,
CmsXmlContentDefinition contentDefinition) {
// create the XML content
CmsXmlContainerPage content = new CmsXmlContainerPage(cms, locale, encoding, contentDefinition);
... | [
"public",
"static",
"CmsXmlContainerPage",
"createDocument",
"(",
"CmsObject",
"cms",
",",
"Locale",
"locale",
",",
"String",
"encoding",
",",
"CmsXmlContentDefinition",
"contentDefinition",
")",
"{",
"// create the XML content",
"CmsXmlContainerPage",
"content",
"=",
"ne... | Create a new instance of a container page based on the given content definition,
that will have one language node for the given locale all initialized with default values.<p>
The given encoding is used when marshalling the XML again later.<p>
@param cms the current users OpenCms content
@param locale the locale to ge... | [
"Create",
"a",
"new",
"instance",
"of",
"a",
"container",
"page",
"based",
"on",
"the",
"given",
"content",
"definition",
"that",
"will",
"have",
"one",
"language",
"node",
"for",
"the",
"given",
"locale",
"all",
"initialized",
"with",
"default",
"values",
"... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsXmlContainerPageFactory.java#L106-L116 |
rundeck/rundeck | rundeckapp/src/main/groovy/com/dtolabs/rundeck/jetty/jaas/JettyCachingLdapLoginModule.java | JettyCachingLdapLoginModule.getUserRoles | @SuppressWarnings("unchecked")
protected List getUserRoles(DirContext dirContext, String username) throws LoginException,
NamingException {
"""
attempts to get the users roles from the root context
NOTE: this is not an user authenticated operation
@param dirContext
@param username
@return
... | java | @SuppressWarnings("unchecked")
protected List getUserRoles(DirContext dirContext, String username) throws LoginException,
NamingException {
String userDn = _userRdnAttribute + "=" + username + "," + _userBaseDn;
return getUserRolesByDn(dirContext, userDn, username);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"List",
"getUserRoles",
"(",
"DirContext",
"dirContext",
",",
"String",
"username",
")",
"throws",
"LoginException",
",",
"NamingException",
"{",
"String",
"userDn",
"=",
"_userRdnAttribute",
"+",
"\"=... | attempts to get the users roles from the root context
NOTE: this is not an user authenticated operation
@param dirContext
@param username
@return
@throws LoginException | [
"attempts",
"to",
"get",
"the",
"users",
"roles",
"from",
"the",
"root",
"context"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/rundeckapp/src/main/groovy/com/dtolabs/rundeck/jetty/jaas/JettyCachingLdapLoginModule.java#L437-L443 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java | HttpChannelConfig.parseLimitFieldSize | private void parseLimitFieldSize(Map<Object, Object> props) {
"""
Check the input configuration for a maximum size allowed for HTTP fields.
@param props
"""
Object value = props.get(HttpConfigConstants.PROPNAME_LIMIT_FIELDSIZE);
if (null != value) {
try {
this.lim... | java | private void parseLimitFieldSize(Map<Object, Object> props) {
Object value = props.get(HttpConfigConstants.PROPNAME_LIMIT_FIELDSIZE);
if (null != value) {
try {
this.limitFieldSize = rangeLimit(convertInteger(value), HttpConfigConstants.MIN_LIMIT_FIELDSIZE, HttpConfigConstant... | [
"private",
"void",
"parseLimitFieldSize",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"props",
")",
"{",
"Object",
"value",
"=",
"props",
".",
"get",
"(",
"HttpConfigConstants",
".",
"PROPNAME_LIMIT_FIELDSIZE",
")",
";",
"if",
"(",
"null",
"!=",
"value",
... | Check the input configuration for a maximum size allowed for HTTP fields.
@param props | [
"Check",
"the",
"input",
"configuration",
"for",
"a",
"maximum",
"size",
"allowed",
"for",
"HTTP",
"fields",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L812-L827 |
grpc/grpc-java | netty/src/main/java/io/grpc/netty/GrpcSslContexts.java | GrpcSslContexts.forServer | public static SslContextBuilder forServer(
File keyCertChainFile, File keyFile, String keyPassword) {
"""
Creates a SslContextBuilder with ciphers and APN appropriate for gRPC.
@see SslContextBuilder#forServer(File, File, String)
@see #configure(SslContextBuilder)
"""
return configure(SslContextB... | java | public static SslContextBuilder forServer(
File keyCertChainFile, File keyFile, String keyPassword) {
return configure(SslContextBuilder.forServer(keyCertChainFile, keyFile, keyPassword));
} | [
"public",
"static",
"SslContextBuilder",
"forServer",
"(",
"File",
"keyCertChainFile",
",",
"File",
"keyFile",
",",
"String",
"keyPassword",
")",
"{",
"return",
"configure",
"(",
"SslContextBuilder",
".",
"forServer",
"(",
"keyCertChainFile",
",",
"keyFile",
",",
... | Creates a SslContextBuilder with ciphers and APN appropriate for gRPC.
@see SslContextBuilder#forServer(File, File, String)
@see #configure(SslContextBuilder) | [
"Creates",
"a",
"SslContextBuilder",
"with",
"ciphers",
"and",
"APN",
"appropriate",
"for",
"gRPC",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/netty/src/main/java/io/grpc/netty/GrpcSslContexts.java#L139-L142 |
zaproxy/zaproxy | src/org/parosproxy/paros/network/HttpHeader.java | HttpHeader.addHeader | public void addHeader(String name, String val) {
"""
Add a header with the name and value given. It will be appended to the
header string.
@param name
@param val
"""
mMsgHeader = mMsgHeader + name + ": " + val + mLineDelimiter;
addInternalHeaderFields(name, val);
} | java | public void addHeader(String name, String val) {
mMsgHeader = mMsgHeader + name + ": " + val + mLineDelimiter;
addInternalHeaderFields(name, val);
} | [
"public",
"void",
"addHeader",
"(",
"String",
"name",
",",
"String",
"val",
")",
"{",
"mMsgHeader",
"=",
"mMsgHeader",
"+",
"name",
"+",
"\": \"",
"+",
"val",
"+",
"mLineDelimiter",
";",
"addInternalHeaderFields",
"(",
"name",
",",
"val",
")",
";",
"}"
] | Add a header with the name and value given. It will be appended to the
header string.
@param name
@param val | [
"Add",
"a",
"header",
"with",
"the",
"name",
"and",
"value",
"given",
".",
"It",
"will",
"be",
"appended",
"to",
"the",
"header",
"string",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/network/HttpHeader.java#L238-L241 |
unbescape/unbescape | src/main/java/org/unbescape/xml/XmlEscape.java | XmlEscape.escapeXml11 | public static String escapeXml11(final String text, final XmlEscapeType type, final XmlEscapeLevel level) {
"""
<p>
Perform a (configurable) XML 1.1 <strong>escape</strong> operation on a <tt>String</tt> input.
</p>
<p>
This method will perform an escape operation according to the specified
{@link org.unbesca... | java | public static String escapeXml11(final String text, final XmlEscapeType type, final XmlEscapeLevel level) {
return escapeXml(text, XmlEscapeSymbols.XML11_SYMBOLS, type, level);
} | [
"public",
"static",
"String",
"escapeXml11",
"(",
"final",
"String",
"text",
",",
"final",
"XmlEscapeType",
"type",
",",
"final",
"XmlEscapeLevel",
"level",
")",
"{",
"return",
"escapeXml",
"(",
"text",
",",
"XmlEscapeSymbols",
".",
"XML11_SYMBOLS",
",",
"type",... | <p>
Perform a (configurable) XML 1.1 <strong>escape</strong> operation on a <tt>String</tt> input.
</p>
<p>
This method will perform an escape operation according to the specified
{@link org.unbescape.xml.XmlEscapeType} and {@link org.unbescape.xml.XmlEscapeLevel}
argument values.
</p>
<p>
All other <tt>String</tt>-bas... | [
"<p",
">",
"Perform",
"a",
"(",
"configurable",
")",
"XML",
"1",
".",
"1",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">",
"This",
"method"... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/xml/XmlEscape.java#L560-L562 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.consumption_usage_history_GET | public ArrayList<net.minidev.ovh.api.me.consumption.OvhTransaction> consumption_usage_history_GET(Date beginDate, Date endDate) throws IOException {
"""
Get list of transactions between two dates
REST: GET /me/consumption/usage/history
@param beginDate [required] Begin date
@param endDate [required] End date
... | java | public ArrayList<net.minidev.ovh.api.me.consumption.OvhTransaction> consumption_usage_history_GET(Date beginDate, Date endDate) throws IOException {
String qPath = "/me/consumption/usage/history";
StringBuilder sb = path(qPath);
query(sb, "beginDate", beginDate);
query(sb, "endDate", endDate);
String resp = e... | [
"public",
"ArrayList",
"<",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"me",
".",
"consumption",
".",
"OvhTransaction",
">",
"consumption_usage_history_GET",
"(",
"Date",
"beginDate",
",",
"Date",
"endDate",
")",
"throws",
"IOException",
"{",
"String"... | Get list of transactions between two dates
REST: GET /me/consumption/usage/history
@param beginDate [required] Begin date
@param endDate [required] End date | [
"Get",
"list",
"of",
"transactions",
"between",
"two",
"dates"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2128-L2135 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java | ExpressionUtils.notInAny | public static <D> Predicate notInAny(Expression<D> left, Iterable<? extends Collection<? extends D>> lists) {
"""
Create a {@code left not in right and...} expression for each list
@param <D>
@param left
@param lists
@return a {@code left not in right and...} expression
"""
BooleanBuilder rv = ne... | java | public static <D> Predicate notInAny(Expression<D> left, Iterable<? extends Collection<? extends D>> lists) {
BooleanBuilder rv = new BooleanBuilder();
for (Collection<? extends D> list : lists) {
rv.and(notIn(left, list));
}
return rv;
} | [
"public",
"static",
"<",
"D",
">",
"Predicate",
"notInAny",
"(",
"Expression",
"<",
"D",
">",
"left",
",",
"Iterable",
"<",
"?",
"extends",
"Collection",
"<",
"?",
"extends",
"D",
">",
">",
"lists",
")",
"{",
"BooleanBuilder",
"rv",
"=",
"new",
"Boolea... | Create a {@code left not in right and...} expression for each list
@param <D>
@param left
@param lists
@return a {@code left not in right and...} expression | [
"Create",
"a",
"{",
"@code",
"left",
"not",
"in",
"right",
"and",
"...",
"}",
"expression",
"for",
"each",
"list"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java#L771-L777 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/execution/script/ScriptfileUtils.java | ScriptfileUtils.writeStream | private static void writeStream(final InputStream input, final FileWriter writer)
throws IOException {
"""
Write an inputstream to a FileWriter
@param input input stream
@param writer writer
@throws IOException if an error occurs
"""
writeStream(input, writer, LineEndingStyle.LOCAL);
... | java | private static void writeStream(final InputStream input, final FileWriter writer)
throws IOException
{
writeStream(input, writer, LineEndingStyle.LOCAL);
} | [
"private",
"static",
"void",
"writeStream",
"(",
"final",
"InputStream",
"input",
",",
"final",
"FileWriter",
"writer",
")",
"throws",
"IOException",
"{",
"writeStream",
"(",
"input",
",",
"writer",
",",
"LineEndingStyle",
".",
"LOCAL",
")",
";",
"}"
] | Write an inputstream to a FileWriter
@param input input stream
@param writer writer
@throws IOException if an error occurs | [
"Write",
"an",
"inputstream",
"to",
"a",
"FileWriter"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/execution/script/ScriptfileUtils.java#L99-L103 |
infinispan/infinispan | core/src/main/java/org/infinispan/container/offheap/OffHeapConcurrentMap.java | OffHeapConcurrentMap.performGet | private long performGet(long bucketHeadAddress, WrappedBytes k) {
"""
Gets the actual address for the given key in the given bucket or 0 if it isn't present or expired
@param bucketHeadAddress the starting address of the address hash
@param k the key to retrieve the address for it if matches
@return the address... | java | private long performGet(long bucketHeadAddress, WrappedBytes k) {
long address = bucketHeadAddress;
while (address != 0) {
long nextAddress = offHeapEntryFactory.getNext(address);
if (offHeapEntryFactory.equalsKey(address, k)) {
break;
} else {
address = ne... | [
"private",
"long",
"performGet",
"(",
"long",
"bucketHeadAddress",
",",
"WrappedBytes",
"k",
")",
"{",
"long",
"address",
"=",
"bucketHeadAddress",
";",
"while",
"(",
"address",
"!=",
"0",
")",
"{",
"long",
"nextAddress",
"=",
"offHeapEntryFactory",
".",
"getN... | Gets the actual address for the given key in the given bucket or 0 if it isn't present or expired
@param bucketHeadAddress the starting address of the address hash
@param k the key to retrieve the address for it if matches
@return the address matching the key or 0 | [
"Gets",
"the",
"actual",
"address",
"for",
"the",
"given",
"key",
"in",
"the",
"given",
"bucket",
"or",
"0",
"if",
"it",
"isn",
"t",
"present",
"or",
"expired"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/container/offheap/OffHeapConcurrentMap.java#L291-L302 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/LinkedList.java | LinkedList.insertAfter | public Entry insertAfter(Entry newEntry, Entry insertAfter) {
"""
Synchronized. Insert an entry into the list after a given one. The
new entry must not already be in a list. The entry after which the new
one is to be inserted must be in this list.
@param newEntry The entry to be added.
@param insertAfter The... | java | public Entry insertAfter(Entry newEntry, Entry insertAfter)
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "insertAfter", new Object[] { newEntry, insertAfter });
Entry insertedEntry = null;
//check that the params are not null, if either is, there is nothing to do.
if(newEntry != null &&
... | [
"public",
"Entry",
"insertAfter",
"(",
"Entry",
"newEntry",
",",
"Entry",
"insertAfter",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"insertAfter\"",
",",
"new",
"Object",
"[",
"]",
"{",
"ne... | Synchronized. Insert an entry into the list after a given one. The
new entry must not already be in a list. The entry after which the new
one is to be inserted must be in this list.
@param newEntry The entry to be added.
@param insertAfter The entry after which the new one is to be inserted | [
"Synchronized",
".",
"Insert",
"an",
"entry",
"into",
"the",
"list",
"after",
"a",
"given",
"one",
".",
"The",
"new",
"entry",
"must",
"not",
"already",
"be",
"in",
"a",
"list",
".",
"The",
"entry",
"after",
"which",
"the",
"new",
"one",
"is",
"to",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/LinkedList.java#L248-L267 |
alkacon/opencms-core | src-gwt/org/opencms/ade/editprovider/client/CmsEditablePositionCalculator.java | CmsEditablePositionCalculator.intersectsVertically | protected boolean intersectsVertically(CmsPositionBean p1, CmsPositionBean p2) {
"""
Checks whether two positions intersect vertically.<p>
@param p1 the first position
@param p2 the second position
@return if the positions intersect vertically
"""
return intersectIntervals(p1.getTop(), p1.getTo... | java | protected boolean intersectsVertically(CmsPositionBean p1, CmsPositionBean p2) {
return intersectIntervals(p1.getTop(), p1.getTop() + HEIGHT, p2.getTop(), p2.getTop() + HEIGHT);
} | [
"protected",
"boolean",
"intersectsVertically",
"(",
"CmsPositionBean",
"p1",
",",
"CmsPositionBean",
"p2",
")",
"{",
"return",
"intersectIntervals",
"(",
"p1",
".",
"getTop",
"(",
")",
",",
"p1",
".",
"getTop",
"(",
")",
"+",
"HEIGHT",
",",
"p2",
".",
"ge... | Checks whether two positions intersect vertically.<p>
@param p1 the first position
@param p2 the second position
@return if the positions intersect vertically | [
"Checks",
"whether",
"two",
"positions",
"intersect",
"vertically",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/editprovider/client/CmsEditablePositionCalculator.java#L185-L188 |
finmath/finmath-lib | src/main/java/net/finmath/marketdata2/model/curves/ForwardCurveInterpolation.java | ForwardCurveInterpolation.createForwardCurveFromMonteCarloLiborModel | public static ForwardCurveInterpolation createForwardCurveFromMonteCarloLiborModel(String name, LIBORModelMonteCarloSimulationModel model, double startTime) throws CalculationException {
"""
Create a forward curve from forwards given by a LIBORMonteCarloModel.
@param name name of the forward curve.
@param... | java | public static ForwardCurveInterpolation createForwardCurveFromMonteCarloLiborModel(String name, LIBORModelMonteCarloSimulationModel model, double startTime) throws CalculationException{
int timeIndex = model.getTimeIndex(startTime);
// Get all Libors at timeIndex which are not yet fixed (others null) and times for... | [
"public",
"static",
"ForwardCurveInterpolation",
"createForwardCurveFromMonteCarloLiborModel",
"(",
"String",
"name",
",",
"LIBORModelMonteCarloSimulationModel",
"model",
",",
"double",
"startTime",
")",
"throws",
"CalculationException",
"{",
"int",
"timeIndex",
"=",
"model",... | Create a forward curve from forwards given by a LIBORMonteCarloModel.
@param name name of the forward curve.
@param model Monte Carlo model providing the forwards.
@param startTime time at which the curve starts, i.e. zero time for the curve
@return a forward curve from forwards given by a LIBORMonteCarloMode... | [
"Create",
"a",
"forward",
"curve",
"from",
"forwards",
"given",
"by",
"a",
"LIBORMonteCarloModel",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata2/model/curves/ForwardCurveInterpolation.java#L334-L356 |
landawn/AbacusUtil | src/com/landawn/abacus/util/ClassUtil.java | ClassUtil.getPropValue | @SuppressWarnings("unchecked")
public static <T> T getPropValue(final Object entity, final String propName) {
"""
Refer to getPropValue(Method, Object)
@param entity
@param propName
is case insensitive
@return {@link #getPropValue(Object, Method)}
"""
return getPropValue(entity, propName, f... | java | @SuppressWarnings("unchecked")
public static <T> T getPropValue(final Object entity, final String propName) {
return getPropValue(entity, propName, false);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getPropValue",
"(",
"final",
"Object",
"entity",
",",
"final",
"String",
"propName",
")",
"{",
"return",
"getPropValue",
"(",
"entity",
",",
"propName",
",",
"false"... | Refer to getPropValue(Method, Object)
@param entity
@param propName
is case insensitive
@return {@link #getPropValue(Object, Method)} | [
"Refer",
"to",
"getPropValue",
"(",
"Method",
"Object",
")"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/ClassUtil.java#L1826-L1829 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_hotfix.java | xen_hotfix.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
xen_hotfix_responses result = (xen_hotfix_responses) service.get_payloa... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_hotfix_responses result = (xen_hotfix_responses) service.get_payload_formatter().string_to_resource(xen_hotfix_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == S... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"xen_hotfix_responses",
"result",
"=",
"(",
"xen_hotfix_responses",
")",
"service",
".",
"get_payload_formatte... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_hotfix.java#L319-L336 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java | GVRVertexBuffer.setFloatArray | public void setFloatArray(String attributeName, float[] data) {
"""
Updates a vertex attribute from a float array.
All of the entries of the input float array are copied into
the storage for the named vertex attribute. Other vertex
attributes are not affected.
The attribute name must be one of the attributes n... | java | public void setFloatArray(String attributeName, float[] data)
{
if (!NativeVertexBuffer.setFloatArray(getNative(), attributeName, data, 0, 0))
{
throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be updated");
}
} | [
"public",
"void",
"setFloatArray",
"(",
"String",
"attributeName",
",",
"float",
"[",
"]",
"data",
")",
"{",
"if",
"(",
"!",
"NativeVertexBuffer",
".",
"setFloatArray",
"(",
"getNative",
"(",
")",
",",
"attributeName",
",",
"data",
",",
"0",
",",
"0",
")... | Updates a vertex attribute from a float array.
All of the entries of the input float array are copied into
the storage for the named vertex attribute. Other vertex
attributes are not affected.
The attribute name must be one of the attributes named
in the descriptor passed to the constructor.
<p>
All vertex attributes h... | [
"Updates",
"a",
"vertex",
"attribute",
"from",
"a",
"float",
"array",
".",
"All",
"of",
"the",
"entries",
"of",
"the",
"input",
"float",
"array",
"are",
"copied",
"into",
"the",
"storage",
"for",
"the",
"named",
"vertex",
"attribute",
".",
"Other",
"vertex... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java#L314-L320 |
eclipse/hawkbit | hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/autoassign/AutoAssignChecker.java | AutoAssignChecker.runTransactionalAssignment | private int runTransactionalAssignment(final TargetFilterQuery targetFilterQuery, final Long dsId) {
"""
Runs one page of target assignments within a dedicated transaction
@param targetFilterQuery
the target filter query
@param dsId
distribution set id to assign
@return count of targets
"""
fina... | java | private int runTransactionalAssignment(final TargetFilterQuery targetFilterQuery, final Long dsId) {
final String actionMessage = String.format(ACTION_MESSAGE, targetFilterQuery.getName());
return DeploymentHelper.runInNewTransaction(transactionManager, "autoAssignDSToTargets",
Isolatio... | [
"private",
"int",
"runTransactionalAssignment",
"(",
"final",
"TargetFilterQuery",
"targetFilterQuery",
",",
"final",
"Long",
"dsId",
")",
"{",
"final",
"String",
"actionMessage",
"=",
"String",
".",
"format",
"(",
"ACTION_MESSAGE",
",",
"targetFilterQuery",
".",
"g... | Runs one page of target assignments within a dedicated transaction
@param targetFilterQuery
the target filter query
@param dsId
distribution set id to assign
@return count of targets | [
"Runs",
"one",
"page",
"of",
"target",
"assignments",
"within",
"a",
"dedicated",
"transaction"
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/autoassign/AutoAssignChecker.java#L141-L154 |
codegist/crest | core/src/main/java/org/codegist/crest/CRestBuilder.java | CRestBuilder.bindDeserializer | public CRestBuilder bindDeserializer(Class<? extends Deserializer> deserializer, String... mimeTypes) {
"""
<p>Binds a deserializer to a list of response Content-Type mime-types.</p>
<p>By default, <b>CRest</b> handle the following types:</p>
<ul>
<li>application/xml, text/xml for Xml deserialization</li>
<li>... | java | public CRestBuilder bindDeserializer(Class<? extends Deserializer> deserializer, String... mimeTypes) {
return bindDeserializer(deserializer, mimeTypes, Collections.<String, Object>emptyMap());
} | [
"public",
"CRestBuilder",
"bindDeserializer",
"(",
"Class",
"<",
"?",
"extends",
"Deserializer",
">",
"deserializer",
",",
"String",
"...",
"mimeTypes",
")",
"{",
"return",
"bindDeserializer",
"(",
"deserializer",
",",
"mimeTypes",
",",
"Collections",
".",
"<",
... | <p>Binds a deserializer to a list of response Content-Type mime-types.</p>
<p>By default, <b>CRest</b> handle the following types:</p>
<ul>
<li>application/xml, text/xml for Xml deserialization</li>
<li>application/json, application/javascript, text/javascript, text/json for Json deserialization</li>
</ul>
@param deser... | [
"<p",
">",
"Binds",
"a",
"deserializer",
"to",
"a",
"list",
"of",
"response",
"Content",
"-",
"Type",
"mime",
"-",
"types",
".",
"<",
"/",
"p",
">",
"<p",
">",
"By",
"default",
"<b",
">",
"CRest<",
"/",
"b",
">",
"handle",
"the",
"following",
"type... | train | https://github.com/codegist/crest/blob/e99ba7728b27d2ddb2c247261350f1b6fa7a6698/core/src/main/java/org/codegist/crest/CRestBuilder.java#L511-L513 |
entrusc/xdata | src/main/java/com/moebiusgames/xdata/XData.java | XData.serializePrimitive | private static void serializePrimitive(DataOutputStream dOut, Object primitive) throws IOException {
"""
serializes a primitive or null
@param serializerMap
@param dOut
@param primitive
@throws IOException
"""
if (primitive == null) {
dOut.writeByte(VAL_NULL);
} else {
... | java | private static void serializePrimitive(DataOutputStream dOut, Object primitive) throws IOException {
if (primitive == null) {
dOut.writeByte(VAL_NULL);
} else {
dOut.writeByte(VAL_ELEMENT);
final Class<?> resolvedObjectClass = primitive.getClass();
Seriali... | [
"private",
"static",
"void",
"serializePrimitive",
"(",
"DataOutputStream",
"dOut",
",",
"Object",
"primitive",
")",
"throws",
"IOException",
"{",
"if",
"(",
"primitive",
"==",
"null",
")",
"{",
"dOut",
".",
"writeByte",
"(",
"VAL_NULL",
")",
";",
"}",
"else... | serializes a primitive or null
@param serializerMap
@param dOut
@param primitive
@throws IOException | [
"serializes",
"a",
"primitive",
"or",
"null"
] | train | https://github.com/entrusc/xdata/blob/44ba4c59fd639c99b89fc8995ba83fe89ca4239d/src/main/java/com/moebiusgames/xdata/XData.java#L1336-L1349 |
forge/core | maven/impl-projects/src/main/java/org/jboss/forge/addon/maven/projects/util/NativeSystemCall.java | NativeSystemCall.execFromPath | public static int execFromPath(final String command, final String[] parms, final OutputStream out,
final DirectoryResource path) throws IOException {
"""
Execute a native system command as if it were run from the given path.
@param command the system command to execute
@param parms the command para... | java | public static int execFromPath(final String command, final String[] parms, final OutputStream out,
final DirectoryResource path) throws IOException
{
Assert.notNull(command, "Command must not be null.");
Assert.notNull(path, "Directory path must not be null.");
Assert.notNull(out, "Outp... | [
"public",
"static",
"int",
"execFromPath",
"(",
"final",
"String",
"command",
",",
"final",
"String",
"[",
"]",
"parms",
",",
"final",
"OutputStream",
"out",
",",
"final",
"DirectoryResource",
"path",
")",
"throws",
"IOException",
"{",
"Assert",
".",
"notNull"... | Execute a native system command as if it were run from the given path.
@param command the system command to execute
@param parms the command parameters
@param out a print writer to which command output will be streamed
@param path the path from which to execute the command
@return 0 on successful completion, any othe... | [
"Execute",
"a",
"native",
"system",
"command",
"as",
"if",
"it",
"were",
"run",
"from",
"the",
"given",
"path",
"."
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/maven/impl-projects/src/main/java/org/jboss/forge/addon/maven/projects/util/NativeSystemCall.java#L34-L69 |
lucee/Lucee | core/src/main/java/lucee/transformer/library/tag/TagLibTag.java | TagLibTag.setAttributeEvaluatorClassDefinition | public void setAttributeEvaluatorClassDefinition(String className, Identification id, Attributes attr) {
"""
Setzt den Namen der Klasse welche einen AttributeEvaluator implementiert.
@param value Name der AttributeEvaluator Klassse
"""
cdAttributeEvaluator = ClassDefinitionImpl.toClassDefinition(className,... | java | public void setAttributeEvaluatorClassDefinition(String className, Identification id, Attributes attr) {
cdAttributeEvaluator = ClassDefinitionImpl.toClassDefinition(className, id, attr);
;
} | [
"public",
"void",
"setAttributeEvaluatorClassDefinition",
"(",
"String",
"className",
",",
"Identification",
"id",
",",
"Attributes",
"attr",
")",
"{",
"cdAttributeEvaluator",
"=",
"ClassDefinitionImpl",
".",
"toClassDefinition",
"(",
"className",
",",
"id",
",",
"att... | Setzt den Namen der Klasse welche einen AttributeEvaluator implementiert.
@param value Name der AttributeEvaluator Klassse | [
"Setzt",
"den",
"Namen",
"der",
"Klasse",
"welche",
"einen",
"AttributeEvaluator",
"implementiert",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/tag/TagLibTag.java#L695-L699 |
alkacon/opencms-core | src/org/opencms/synchronize/CmsSynchronize.java | CmsSynchronize.writeFileByte | private void writeFileByte(byte[] content, File file) throws IOException {
"""
This writes the byte content of a resource to the file on the server
file system.<p>
@param content the content of the file in the VFS
@param file the file in SFS that has to be updated with content
@throws IOException if someth... | java | private void writeFileByte(byte[] content, File file) throws IOException {
FileOutputStream fOut = null;
DataOutputStream dOut = null;
try {
// write the content to the file in server filesystem
fOut = new FileOutputStream(file);
dOut = new DataOutputStream(f... | [
"private",
"void",
"writeFileByte",
"(",
"byte",
"[",
"]",
"content",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"FileOutputStream",
"fOut",
"=",
"null",
";",
"DataOutputStream",
"dOut",
"=",
"null",
";",
"try",
"{",
"// write the content to the fil... | This writes the byte content of a resource to the file on the server
file system.<p>
@param content the content of the file in the VFS
@param file the file in SFS that has to be updated with content
@throws IOException if something goes wrong | [
"This",
"writes",
"the",
"byte",
"content",
"of",
"a",
"resource",
"to",
"the",
"file",
"on",
"the",
"server",
"file",
"system",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/synchronize/CmsSynchronize.java#L1017-L1045 |
wcm-io/wcm-io-handler | url/src/main/java/io/wcm/handler/url/impl/Externalizer.java | Externalizer.externalizeUrl | public static @Nullable String externalizeUrl(@NotNull String url, @NotNull ResourceResolver resolver, @Nullable SlingHttpServletRequest request) {
"""
Externalizes an URL by applying Sling Mapping. Hostname and scheme are not added because they are added by the
link handler depending on site URL configuration an... | java | public static @Nullable String externalizeUrl(@NotNull String url, @NotNull ResourceResolver resolver, @Nullable SlingHttpServletRequest request) {
// apply externalization only path part
String path = url;
// split off query string or fragment that may be appended to the URL
String urlRemainder = nul... | [
"public",
"static",
"@",
"Nullable",
"String",
"externalizeUrl",
"(",
"@",
"NotNull",
"String",
"url",
",",
"@",
"NotNull",
"ResourceResolver",
"resolver",
",",
"@",
"Nullable",
"SlingHttpServletRequest",
"request",
")",
"{",
"// apply externalization only path part",
... | Externalizes an URL by applying Sling Mapping. Hostname and scheme are not added because they are added by the
link handler depending on site URL configuration and secure/non-secure mode. URLs that are already externalized
remain untouched.
@param url Unexternalized URL (without scheme or hostname)
@param resolver Reso... | [
"Externalizes",
"an",
"URL",
"by",
"applying",
"Sling",
"Mapping",
".",
"Hostname",
"and",
"scheme",
"are",
"not",
"added",
"because",
"they",
"are",
"added",
"by",
"the",
"link",
"handler",
"depending",
"on",
"site",
"URL",
"configuration",
"and",
"secure",
... | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/impl/Externalizer.java#L54-L100 |
structr/structr | structr-core/src/main/java/org/structr/core/entity/AbstractEndpoint.java | AbstractEndpoint.getNotionProperties | protected PropertyMap getNotionProperties(final SecurityContext securityContext, final Class type, final String storageKey) {
"""
Loads a PropertyMap from the current security context that was previously stored
there by one of the Notions that was executed before this relationship creation.
@param securityCont... | java | protected PropertyMap getNotionProperties(final SecurityContext securityContext, final Class type, final String storageKey) {
final Map<String, PropertyMap> notionPropertyMap = (Map<String, PropertyMap>)securityContext.getAttribute("notionProperties");
if (notionPropertyMap != null) {
final Set<PropertyKey> ke... | [
"protected",
"PropertyMap",
"getNotionProperties",
"(",
"final",
"SecurityContext",
"securityContext",
",",
"final",
"Class",
"type",
",",
"final",
"String",
"storageKey",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"PropertyMap",
">",
"notionPropertyMap",
"=",
... | Loads a PropertyMap from the current security context that was previously stored
there by one of the Notions that was executed before this relationship creation.
@param securityContext the security context
@param type the entity type
@param storageKey the key for which the PropertyMap was stored
@return a PropertyMap... | [
"Loads",
"a",
"PropertyMap",
"from",
"the",
"current",
"security",
"context",
"that",
"was",
"previously",
"stored",
"there",
"by",
"one",
"of",
"the",
"Notions",
"that",
"was",
"executed",
"before",
"this",
"relationship",
"creation",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/entity/AbstractEndpoint.java#L73-L97 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/NotificationsApi.java | NotificationsApi.notificationsSubscribeWithHttpInfo | public ApiResponse<Void> notificationsSubscribeWithHttpInfo() throws ApiException {
"""
Subscribe to CometD channel notification
See the [CometD documentation](https://docs.cometd.org/current/reference/#_bayeux_meta_subscribe) for details. For a list of all available channels, see the [CometD section](/reference/... | java | public ApiResponse<Void> notificationsSubscribeWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = notificationsSubscribeValidateBeforeCall(null, null);
return apiClient.execute(call);
} | [
"public",
"ApiResponse",
"<",
"Void",
">",
"notificationsSubscribeWithHttpInfo",
"(",
")",
"throws",
"ApiException",
"{",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"call",
"=",
"notificationsSubscribeValidateBeforeCall",
"(",
"null",
",",
"null",
")",
";... | Subscribe to CometD channel notification
See the [CometD documentation](https://docs.cometd.org/current/reference/#_bayeux_meta_subscribe) for details. For a list of all available channels, see the [CometD section](/reference/workspace/index.html) in the Workspace API overview.
@return ApiResponse<Void>
@throws A... | [
"Subscribe",
"to",
"CometD",
"channel",
"notification",
"See",
"the",
"[",
"CometD",
"documentation",
"]",
"(",
"https",
":",
"//",
"docs",
".",
"cometd",
".",
"org",
"/",
"current",
"/",
"reference",
"/",
"#_bayeux_meta_subscribe",
")",
"for",
"details",
".... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/NotificationsApi.java#L564-L567 |
JodaOrg/joda-time | src/main/java/org/joda/time/LocalDateTime.java | LocalDateTime.correctDstTransition | private Date correctDstTransition(Date date, final TimeZone timeZone) {
"""
Correct <code>date</code> in case of DST overlap.
<p>
The <code>Date</code> object created has exactly the same fields as this
date-time, except when the time would be invalid due to a daylight savings
gap. In that case, the time will ... | java | private Date correctDstTransition(Date date, final TimeZone timeZone) {
Calendar calendar = Calendar.getInstance(timeZone);
calendar.setTime(date);
LocalDateTime check = LocalDateTime.fromCalendarFields(calendar);
if (check.isBefore(this)) {
// DST gap
// move for... | [
"private",
"Date",
"correctDstTransition",
"(",
"Date",
"date",
",",
"final",
"TimeZone",
"timeZone",
")",
"{",
"Calendar",
"calendar",
"=",
"Calendar",
".",
"getInstance",
"(",
"timeZone",
")",
";",
"calendar",
".",
"setTime",
"(",
"date",
")",
";",
"LocalD... | Correct <code>date</code> in case of DST overlap.
<p>
The <code>Date</code> object created has exactly the same fields as this
date-time, except when the time would be invalid due to a daylight savings
gap. In that case, the time will be set to the earliest valid time after the gap.
<p>
In the case of a daylight saving... | [
"Correct",
"<code",
">",
"date<",
"/",
"code",
">",
"in",
"case",
"of",
"DST",
"overlap",
".",
"<p",
">",
"The",
"<code",
">",
"Date<",
"/",
"code",
">",
"object",
"created",
"has",
"exactly",
"the",
"same",
"fields",
"as",
"this",
"date",
"-",
"time... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/LocalDateTime.java#L848-L875 |
JoeKerouac/utils | src/main/java/com/joe/utils/common/DateUtil.java | DateUtil.parse | public static Date parse(String date, String format) {
"""
将指定日期字符串按照指定格式转换为日期对象(如果传入的时间没有当前时分秒信息或者年月日信息则默认填充当前时间)
@param date 格式化日期字符串
@param format 日期字符串的格式
@return 格式化日期字符串对应的日期对象
@throws DateUtilException 格式错误时返回该异常
"""
LocalDateTime time = getTime(format, date);
//返回对应日期
re... | java | public static Date parse(String date, String format) {
LocalDateTime time = getTime(format, date);
//返回对应日期
return Date.from(time.toInstant(ZoneOffset.ofTotalSeconds(60 * 60 * 8)));
} | [
"public",
"static",
"Date",
"parse",
"(",
"String",
"date",
",",
"String",
"format",
")",
"{",
"LocalDateTime",
"time",
"=",
"getTime",
"(",
"format",
",",
"date",
")",
";",
"//返回对应日期",
"return",
"Date",
".",
"from",
"(",
"time",
".",
"toInstant",
"(",
... | 将指定日期字符串按照指定格式转换为日期对象(如果传入的时间没有当前时分秒信息或者年月日信息则默认填充当前时间)
@param date 格式化日期字符串
@param format 日期字符串的格式
@return 格式化日期字符串对应的日期对象
@throws DateUtilException 格式错误时返回该异常 | [
"将指定日期字符串按照指定格式转换为日期对象(如果传入的时间没有当前时分秒信息或者年月日信息则默认填充当前时间)"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/common/DateUtil.java#L90-L94 |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/BackupUploadServlet.java | BackupUploadServlet.getParameter | private String getParameter(List<FileItem> items, String name) {
"""
Extracts value of the parameter with given name.
@param items
@param name
@return parameter value or null.
"""
for (FileItem i : items) {
if (i.isFormField() && i.getFieldName().equals(name)) {
return ... | java | private String getParameter(List<FileItem> items, String name) {
for (FileItem i : items) {
if (i.isFormField() && i.getFieldName().equals(name)) {
return i.getString();
}
}
return null;
} | [
"private",
"String",
"getParameter",
"(",
"List",
"<",
"FileItem",
">",
"items",
",",
"String",
"name",
")",
"{",
"for",
"(",
"FileItem",
"i",
":",
"items",
")",
"{",
"if",
"(",
"i",
".",
"isFormField",
"(",
")",
"&&",
"i",
".",
"getFieldName",
"(",
... | Extracts value of the parameter with given name.
@param items
@param name
@return parameter value or null. | [
"Extracts",
"value",
"of",
"the",
"parameter",
"with",
"given",
"name",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/BackupUploadServlet.java#L105-L112 |
azkaban/azkaban | azkaban-exec-server/src/main/java/azkaban/execapp/FlowPreparer.java | FlowPreparer.downloadProjectIfNotExists | @VisibleForTesting
File downloadProjectIfNotExists(final ProjectDirectoryMetadata proj, final int execId)
throws IOException {
"""
Download project zip and unzip it if not exists locally.
@param proj project to download
@return the temp dir where the new project is downloaded to, null if no project is ... | java | @VisibleForTesting
File downloadProjectIfNotExists(final ProjectDirectoryMetadata proj, final int execId)
throws IOException {
final String projectDir = generateProjectDirName(proj);
if (proj.getInstalledDir() == null) {
proj.setInstalledDir(new File(this.projectCacheDir, projectDir));
}
... | [
"@",
"VisibleForTesting",
"File",
"downloadProjectIfNotExists",
"(",
"final",
"ProjectDirectoryMetadata",
"proj",
",",
"final",
"int",
"execId",
")",
"throws",
"IOException",
"{",
"final",
"String",
"projectDir",
"=",
"generateProjectDirName",
"(",
"proj",
")",
";",
... | Download project zip and unzip it if not exists locally.
@param proj project to download
@return the temp dir where the new project is downloaded to, null if no project is downloaded.
@throws IOException if downloading or unzipping fails. | [
"Download",
"project",
"zip",
"and",
"unzip",
"it",
"if",
"not",
"exists",
"locally",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/FlowPreparer.java#L225-L259 |
haifengl/smile | interpolation/src/main/java/smile/interpolation/CubicSplineInterpolation1D.java | CubicSplineInterpolation1D.sety2 | private void sety2(double[] x, double[] y) {
"""
Calculate the second derivatives of the interpolating function at the
tabulated points. At the endpoints, we use a natural spline
with zero second derivative on that boundary.
"""
double p, qn, sig, un;
double[] u = new double[n - 1];
... | java | private void sety2(double[] x, double[] y) {
double p, qn, sig, un;
double[] u = new double[n - 1];
y2[0] = u[0] = 0.0;
for (int i = 1; i < n - 1; i++) {
sig = (x[i] - x[i - 1]) / (x[i + 1] - x[i - 1]);
p = sig * y2[i - 1] + 2.0;
y2[i] = (sig - 1.0) ... | [
"private",
"void",
"sety2",
"(",
"double",
"[",
"]",
"x",
",",
"double",
"[",
"]",
"y",
")",
"{",
"double",
"p",
",",
"qn",
",",
"sig",
",",
"un",
";",
"double",
"[",
"]",
"u",
"=",
"new",
"double",
"[",
"n",
"-",
"1",
"]",
";",
"y2",
"[",
... | Calculate the second derivatives of the interpolating function at the
tabulated points. At the endpoints, we use a natural spline
with zero second derivative on that boundary. | [
"Calculate",
"the",
"second",
"derivatives",
"of",
"the",
"interpolating",
"function",
"at",
"the",
"tabulated",
"points",
".",
"At",
"the",
"endpoints",
"we",
"use",
"a",
"natural",
"spline",
"with",
"zero",
"second",
"derivative",
"on",
"that",
"boundary",
"... | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/interpolation/src/main/java/smile/interpolation/CubicSplineInterpolation1D.java#L73-L92 |
reactor/reactor-netty | src/main/java/reactor/netty/tcp/TcpServer.java | TcpServer.doOnBind | public final TcpServer doOnBind(Consumer<? super ServerBootstrap> doOnBind) {
"""
Setups a callback called when {@link io.netty.channel.ServerChannel} is about to
bind.
@param doOnBind a consumer observing server start event
@return a new {@link TcpServer}
"""
Objects.requireNonNull(doOnBind, "doOnBin... | java | public final TcpServer doOnBind(Consumer<? super ServerBootstrap> doOnBind) {
Objects.requireNonNull(doOnBind, "doOnBind");
return new TcpServerDoOn(this, doOnBind, null, null);
} | [
"public",
"final",
"TcpServer",
"doOnBind",
"(",
"Consumer",
"<",
"?",
"super",
"ServerBootstrap",
">",
"doOnBind",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"doOnBind",
",",
"\"doOnBind\"",
")",
";",
"return",
"new",
"TcpServerDoOn",
"(",
"this",
",",
... | Setups a callback called when {@link io.netty.channel.ServerChannel} is about to
bind.
@param doOnBind a consumer observing server start event
@return a new {@link TcpServer} | [
"Setups",
"a",
"callback",
"called",
"when",
"{",
"@link",
"io",
".",
"netty",
".",
"channel",
".",
"ServerChannel",
"}",
"is",
"about",
"to",
"bind",
"."
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/tcp/TcpServer.java#L246-L250 |
JOML-CI/JOML | src/org/joml/Matrix4x3f.java | Matrix4x3f.rotateLocalX | public Matrix4x3f rotateLocalX(float ang, Matrix4x3f dest) {
"""
Pre-multiply a rotation around the X axis to this matrix by rotating the given amount of radians
about the X axis and store the result in <code>dest</code>.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a v... | java | public Matrix4x3f rotateLocalX(float ang, Matrix4x3f dest) {
float sin = (float) Math.sin(ang);
float cos = (float) Math.cosFromSin(sin, ang);
float nm01 = cos * m01 - sin * m02;
float nm02 = sin * m01 + cos * m02;
float nm11 = cos * m11 - sin * m12;
float nm12 = sin * m1... | [
"public",
"Matrix4x3f",
"rotateLocalX",
"(",
"float",
"ang",
",",
"Matrix4x3f",
"dest",
")",
"{",
"float",
"sin",
"=",
"(",
"float",
")",
"Math",
".",
"sin",
"(",
"ang",
")",
";",
"float",
"cos",
"=",
"(",
"float",
")",
"Math",
".",
"cosFromSin",
"("... | Pre-multiply a rotation around the X axis to this matrix by rotating the given amount of radians
about the X axis and store the result in <code>dest</code>.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clockwise around the rotation axis, when viewing along the ... | [
"Pre",
"-",
"multiply",
"a",
"rotation",
"around",
"the",
"X",
"axis",
"to",
"this",
"matrix",
"by",
"rotating",
"the",
"given",
"amount",
"of",
"radians",
"about",
"the",
"X",
"axis",
"and",
"store",
"the",
"result",
"in",
"<code",
">",
"dest<",
"/",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L4244-L4269 |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/schema/analysis/SnowballAnalyzerBuilder.java | SnowballAnalyzerBuilder.getStopwords | private static CharArraySet getStopwords(String stopwords) {
"""
Returns the stopwords {@link CharArraySet} for the specified comma separated stopwords {@code String}.
@param stopwords a {@code String} comma separated stopwords list
@return the stopwords list as a char array set
"""
List<String> st... | java | private static CharArraySet getStopwords(String stopwords) {
List<String> stopwordsList = new ArrayList<>();
for (String stop : stopwords.split(",")) {
stopwordsList.add(stop.trim());
}
return new CharArraySet(stopwordsList, true);
} | [
"private",
"static",
"CharArraySet",
"getStopwords",
"(",
"String",
"stopwords",
")",
"{",
"List",
"<",
"String",
">",
"stopwordsList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"String",
"stop",
":",
"stopwords",
".",
"split",
"(",
"\",\""... | Returns the stopwords {@link CharArraySet} for the specified comma separated stopwords {@code String}.
@param stopwords a {@code String} comma separated stopwords list
@return the stopwords list as a char array set | [
"Returns",
"the",
"stopwords",
"{",
"@link",
"CharArraySet",
"}",
"for",
"the",
"specified",
"comma",
"separated",
"stopwords",
"{",
"@code",
"String",
"}",
"."
] | train | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/schema/analysis/SnowballAnalyzerBuilder.java#L98-L104 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.assertTrueOfInvalidConstructor | public static void assertTrueOfInvalidConstructor(boolean expression, ModelClass<?> entity) {
"""
When a pojo has a valid constructor
@param expression
@param entity
"""
if (!expression) {
String msg = String.format(
"Class '%s' has no constructor without parameters (to be a mutable class) or wit... | java | public static void assertTrueOfInvalidConstructor(boolean expression, ModelClass<?> entity) {
if (!expression) {
String msg = String.format(
"Class '%s' has no constructor without parameters (to be a mutable class) or with all parameters (to be an immutable class).",
entity.getElement().getQualifiedName(... | [
"public",
"static",
"void",
"assertTrueOfInvalidConstructor",
"(",
"boolean",
"expression",
",",
"ModelClass",
"<",
"?",
">",
"entity",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"String",
"msg",
"=",
"String",
".",
"format",
"(",
"\"Class '%s' has no c... | When a pojo has a valid constructor
@param expression
@param entity | [
"When",
"a",
"pojo",
"has",
"a",
"valid",
"constructor"
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L465-L473 |
omise/omise-java | src/main/java/co/omise/Serializer.java | Serializer.deserializeFromMap | public <T extends OmiseObject> T deserializeFromMap(Map<String, Object> map, Class<T> klass) {
"""
Deserialize an instance of the given class from the map.
@param map The {@link Map} containing the JSON structure to deserialize from.
@param klass The {@link Class} to deserialize the result into.
@param <T> ... | java | public <T extends OmiseObject> T deserializeFromMap(Map<String, Object> map, Class<T> klass) {
return objectMapper.convertValue(map, klass);
} | [
"public",
"<",
"T",
"extends",
"OmiseObject",
">",
"T",
"deserializeFromMap",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
",",
"Class",
"<",
"T",
">",
"klass",
")",
"{",
"return",
"objectMapper",
".",
"convertValue",
"(",
"map",
",",
"klass",
... | Deserialize an instance of the given class from the map.
@param map The {@link Map} containing the JSON structure to deserialize from.
@param klass The {@link Class} to deserialize the result into.
@param <T> The type to deserialize the result into.
@return An instance of type T deserialized from the map. | [
"Deserialize",
"an",
"instance",
"of",
"the",
"given",
"class",
"from",
"the",
"map",
"."
] | train | https://github.com/omise/omise-java/blob/95aafc5e8c21b44e6d00a5a9080b9e353fe98042/src/main/java/co/omise/Serializer.java#L140-L142 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.addTag | public GitlabTag addTag(GitlabProject project, String tagName, String ref, String message, String releaseDescription) throws IOException {
"""
Create tag in specific project
@param project
@param tagName
@param ref
@param message
@param releaseDescription
@return
@throws IOException on gitlab api call err... | java | public GitlabTag addTag(GitlabProject project, String tagName, String ref, String message, String releaseDescription) throws IOException {
String tailUrl = GitlabProject.URL + "/" + project.getId() + GitlabTag.URL;
return dispatch()
.with("tag_name", tagName)
.with("ref",... | [
"public",
"GitlabTag",
"addTag",
"(",
"GitlabProject",
"project",
",",
"String",
"tagName",
",",
"String",
"ref",
",",
"String",
"message",
",",
"String",
"releaseDescription",
")",
"throws",
"IOException",
"{",
"String",
"tailUrl",
"=",
"GitlabProject",
".",
"U... | Create tag in specific project
@param project
@param tagName
@param ref
@param message
@param releaseDescription
@return
@throws IOException on gitlab api call error | [
"Create",
"tag",
"in",
"specific",
"project"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L3410-L3418 |
febit/wit | wit-core/src/main/java/org/febit/wit_shaded/asm/ClassWriter.java | ClassWriter.newInteger | private Item newInteger(final int value) {
"""
Adds an integer to the constant pool of the class being build. Does nothing if the constant pool already contains
a similar item.
@param value the int value.
@return a new or already existing int item.
"""
Item result = get(key.set(INT, value));
... | java | private Item newInteger(final int value) {
Item result = get(key.set(INT, value));
if (result == null) {
pool.putByte(INT).putInt(value);
result = new Item(poolIndex++, key);
put(result);
}
return result;
} | [
"private",
"Item",
"newInteger",
"(",
"final",
"int",
"value",
")",
"{",
"Item",
"result",
"=",
"get",
"(",
"key",
".",
"set",
"(",
"INT",
",",
"value",
")",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"pool",
".",
"putByte",
"(",
"INT... | Adds an integer to the constant pool of the class being build. Does nothing if the constant pool already contains
a similar item.
@param value the int value.
@return a new or already existing int item. | [
"Adds",
"an",
"integer",
"to",
"the",
"constant",
"pool",
"of",
"the",
"class",
"being",
"build",
".",
"Does",
"nothing",
"if",
"the",
"constant",
"pool",
"already",
"contains",
"a",
"similar",
"item",
"."
] | train | https://github.com/febit/wit/blob/89ee29efbc5633b79c30c3c7b953c9f4130575af/wit-core/src/main/java/org/febit/wit_shaded/asm/ClassWriter.java#L614-L622 |
CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java | CleverTapAPI.changeCredentials | @SuppressWarnings( {
"""
This method is used to change the credentials of CleverTap account Id, token and region programmatically
@param accountID CleverTap Account Id
@param token CleverTap Account Token
@param region Clever Tap Account Region
""""unused", "WeakerAccess"})
public static void changeCred... | java | @SuppressWarnings({"unused", "WeakerAccess"})
public static void changeCredentials(String accountID, String token, String region) {
if(defaultConfig != null){
Logger.i("CleverTap SDK already initialized with accountID:"+defaultConfig.getAccountId()
+" and token:"+defaultConfi... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unused\"",
",",
"\"WeakerAccess\"",
"}",
")",
"public",
"static",
"void",
"changeCredentials",
"(",
"String",
"accountID",
",",
"String",
"token",
",",
"String",
"region",
")",
"{",
"if",
"(",
"defaultConfig",
"!=",
"null"... | This method is used to change the credentials of CleverTap account Id, token and region programmatically
@param accountID CleverTap Account Id
@param token CleverTap Account Token
@param region Clever Tap Account Region | [
"This",
"method",
"is",
"used",
"to",
"change",
"the",
"credentials",
"of",
"CleverTap",
"account",
"Id",
"token",
"and",
"region",
"programmatically"
] | train | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java#L5983-L5993 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javadoc/Messager.java | Messager.printNotice | public void printNotice(SourcePosition pos, String msg) {
"""
Print a message.
Part of DocErrorReporter.
@param pos the position where the error occurs
@param msg message to print
"""
if (diagListener != null) {
report(DiagnosticType.NOTE, pos, msg);
return;
}
... | java | public void printNotice(SourcePosition pos, String msg) {
if (diagListener != null) {
report(DiagnosticType.NOTE, pos, msg);
return;
}
if (pos == null)
noticeWriter.println(msg);
else
noticeWriter.println(pos + ": " + msg);
noticeW... | [
"public",
"void",
"printNotice",
"(",
"SourcePosition",
"pos",
",",
"String",
"msg",
")",
"{",
"if",
"(",
"diagListener",
"!=",
"null",
")",
"{",
"report",
"(",
"DiagnosticType",
".",
"NOTE",
",",
"pos",
",",
"msg",
")",
";",
"return",
";",
"}",
"if",
... | Print a message.
Part of DocErrorReporter.
@param pos the position where the error occurs
@param msg message to print | [
"Print",
"a",
"message",
".",
"Part",
"of",
"DocErrorReporter",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javadoc/Messager.java#L228-L239 |
BlueBrain/bluima | modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/grobid/diff_match_patch.java | diff_match_patch.diff_main | public LinkedList<Diff> diff_main(String text1, String text2,
boolean checklines) {
"""
Find the differences between two texts.
@param text1
Old string to be diffed.
@param text2
New string to be diffed.
@param checklines
Speedup flag. If false, then don't run a line-level diff first
to identi... | java | public LinkedList<Diff> diff_main(String text1, String text2,
boolean checklines) {
// Set a deadline by which time the diff must be complete.
long deadline;
if (Diff_Timeout <= 0) {
deadline = Long.MAX_VALUE;
} else {
deadline = System.currentTimeMill... | [
"public",
"LinkedList",
"<",
"Diff",
">",
"diff_main",
"(",
"String",
"text1",
",",
"String",
"text2",
",",
"boolean",
"checklines",
")",
"{",
"// Set a deadline by which time the diff must be complete.",
"long",
"deadline",
";",
"if",
"(",
"Diff_Timeout",
"<=",
"0"... | Find the differences between two texts.
@param text1
Old string to be diffed.
@param text2
New string to be diffed.
@param checklines
Speedup flag. If false, then don't run a line-level diff first
to identify the changed areas. If true, then run a faster
slightly less optimal diff.
@return Linked List of Diff objects. | [
"Find",
"the",
"differences",
"between",
"two",
"texts",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/grobid/diff_match_patch.java#L147-L158 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java | Blob.copyTo | public CopyWriter copyTo(BlobId targetBlob, BlobSourceOption... options) {
"""
Sends a copy request for the current blob to the target blob. Possibly also some of the
metadata are copied (e.g. content-type).
<p>Example of copying the blob to a different bucket with a different name.
<pre>{@code
String buck... | java | public CopyWriter copyTo(BlobId targetBlob, BlobSourceOption... options) {
CopyRequest copyRequest =
CopyRequest.newBuilder()
.setSource(getBucket(), getName())
.setSourceOptions(toSourceOptions(this, options))
.setTarget(targetBlob)
.build();
return stora... | [
"public",
"CopyWriter",
"copyTo",
"(",
"BlobId",
"targetBlob",
",",
"BlobSourceOption",
"...",
"options",
")",
"{",
"CopyRequest",
"copyRequest",
"=",
"CopyRequest",
".",
"newBuilder",
"(",
")",
".",
"setSource",
"(",
"getBucket",
"(",
")",
",",
"getName",
"("... | Sends a copy request for the current blob to the target blob. Possibly also some of the
metadata are copied (e.g. content-type).
<p>Example of copying the blob to a different bucket with a different name.
<pre>{@code
String bucketName = "my_unique_bucket";
String blobName = "copy_blob_name";
CopyWriter copyWriter = b... | [
"Sends",
"a",
"copy",
"request",
"for",
"the",
"current",
"blob",
"to",
"the",
"target",
"blob",
".",
"Possibly",
"also",
"some",
"of",
"the",
"metadata",
"are",
"copied",
"(",
"e",
".",
"g",
".",
"content",
"-",
"type",
")",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java#L578-L586 |
negusoft/holoaccent | HoloAccent/src/com/negusoft/holoaccent/util/BitmapUtils.java | BitmapUtils.writeToFile | public static void writeToFile(Bitmap bitmap, String dir, String filename) throws FileNotFoundException, IOException {
"""
Write the given bitmap to a file in the external storage. Requires
"android.permission.WRITE_EXTERNAL_STORAGE" permission.
"""
File sdCard = Environment.getExternalStorageDirectory();
... | java | public static void writeToFile(Bitmap bitmap, String dir, String filename) throws FileNotFoundException, IOException {
File sdCard = Environment.getExternalStorageDirectory();
File dirFile = new File (sdCard.getAbsolutePath() + "/" + dir);
dirFile.mkdirs();
File f = new File(dirFile, filename);
FileOutputStre... | [
"public",
"static",
"void",
"writeToFile",
"(",
"Bitmap",
"bitmap",
",",
"String",
"dir",
",",
"String",
"filename",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"File",
"sdCard",
"=",
"Environment",
".",
"getExternalStorageDirectory",
"(",
")"... | Write the given bitmap to a file in the external storage. Requires
"android.permission.WRITE_EXTERNAL_STORAGE" permission. | [
"Write",
"the",
"given",
"bitmap",
"to",
"a",
"file",
"in",
"the",
"external",
"storage",
".",
"Requires",
"android",
".",
"permission",
".",
"WRITE_EXTERNAL_STORAGE",
"permission",
"."
] | train | https://github.com/negusoft/holoaccent/blob/7121a02dde94834e770cb81174d0bdc596323324/HoloAccent/src/com/negusoft/holoaccent/util/BitmapUtils.java#L232-L241 |
citiususc/hipster | hipster-core/src/main/java/es/usc/citius/lab/hipster/collections/FibonacciHeap.java | FibonacciHeap.decreaseKeyUnchecked | private void decreaseKeyUnchecked(Entry<T> entry, double priority) {
"""
Decreases the key of a node in the tree without doing any checking to ensure
that the new priority is valid.
@param entry The node whose key should be decreased.
@param priority The node's new priority.
"""
/* First, chang... | java | private void decreaseKeyUnchecked(Entry<T> entry, double priority) {
/* First, change the node's priority. */
entry.mPriority = priority;
/* If the node no longer has a higher priority than its parent, cut it.
* Note that this also means that if we try to run a delete operation
... | [
"private",
"void",
"decreaseKeyUnchecked",
"(",
"Entry",
"<",
"T",
">",
"entry",
",",
"double",
"priority",
")",
"{",
"/* First, change the node's priority. */",
"entry",
".",
"mPriority",
"=",
"priority",
";",
"/* If the node no longer has a higher priority than its parent... | Decreases the key of a node in the tree without doing any checking to ensure
that the new priority is valid.
@param entry The node whose key should be decreased.
@param priority The node's new priority. | [
"Decreases",
"the",
"key",
"of",
"a",
"node",
"in",
"the",
"tree",
"without",
"doing",
"any",
"checking",
"to",
"ensure",
"that",
"the",
"new",
"priority",
"is",
"valid",
"."
] | train | https://github.com/citiususc/hipster/blob/9ab1236abb833a27641ae73ba9ca890d5c17598e/hipster-core/src/main/java/es/usc/citius/lab/hipster/collections/FibonacciHeap.java#L520-L538 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/ValueUtils.java | ValueUtils.convertDate | public static Date convertDate(Object target, String dateTimeFormat) {
"""
Convert a target object to {@link Date}. If the target object is a string, parse it as a
{@link Date} using the specified date-time format.
@param target
@param dateTimeFormat
@return
@since 0.6.3.1
"""
if (target instanc... | java | public static Date convertDate(Object target, String dateTimeFormat) {
if (target instanceof JsonNode) {
return convertDate((JsonNode) target, dateTimeFormat);
}
return target instanceof Number ? new Date(((Number) target).longValue())
: (target instanceof String
... | [
"public",
"static",
"Date",
"convertDate",
"(",
"Object",
"target",
",",
"String",
"dateTimeFormat",
")",
"{",
"if",
"(",
"target",
"instanceof",
"JsonNode",
")",
"{",
"return",
"convertDate",
"(",
"(",
"JsonNode",
")",
"target",
",",
"dateTimeFormat",
")",
... | Convert a target object to {@link Date}. If the target object is a string, parse it as a
{@link Date} using the specified date-time format.
@param target
@param dateTimeFormat
@return
@since 0.6.3.1 | [
"Convert",
"a",
"target",
"object",
"to",
"{",
"@link",
"Date",
"}",
".",
"If",
"the",
"target",
"object",
"is",
"a",
"string",
"parse",
"it",
"as",
"a",
"{",
"@link",
"Date",
"}",
"using",
"the",
"specified",
"date",
"-",
"time",
"format",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/ValueUtils.java#L180-L188 |
apache/groovy | subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java | DateTimeExtensions.toZoneOffset | public static ZoneOffset toZoneOffset(final TimeZone self, Instant instant) {
"""
Converts this TimeZone to a corresponding {@link java.time.ZoneOffset}. The offset is determined
using the date/time of specified Instant.
@param self a TimeZone
@return a ZoneOffset
@since 2.5.0
"""
return self.toZ... | java | public static ZoneOffset toZoneOffset(final TimeZone self, Instant instant) {
return self.toZoneId().getRules().getOffset(instant);
} | [
"public",
"static",
"ZoneOffset",
"toZoneOffset",
"(",
"final",
"TimeZone",
"self",
",",
"Instant",
"instant",
")",
"{",
"return",
"self",
".",
"toZoneId",
"(",
")",
".",
"getRules",
"(",
")",
".",
"getOffset",
"(",
"instant",
")",
";",
"}"
] | Converts this TimeZone to a corresponding {@link java.time.ZoneOffset}. The offset is determined
using the date/time of specified Instant.
@param self a TimeZone
@return a ZoneOffset
@since 2.5.0 | [
"Converts",
"this",
"TimeZone",
"to",
"a",
"corresponding",
"{",
"@link",
"java",
".",
"time",
".",
"ZoneOffset",
"}",
".",
"The",
"offset",
"is",
"determined",
"using",
"the",
"date",
"/",
"time",
"of",
"specified",
"Instant",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java#L2416-L2418 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToUnknownStream.java | ToUnknownStream.namespaceAfterStartElement | public void namespaceAfterStartElement(String prefix, String uri)
throws SAXException {
"""
This method is used when a prefix/uri namespace mapping
is indicated after the element was started with a
startElement() and before and endElement().
startPrefixMapping(prefix,uri) would be used before the
start... | java | public void namespaceAfterStartElement(String prefix, String uri)
throws SAXException
{
// hack for XSLTC with finding URI for default namespace
if (m_firstTagNotEmitted && m_firstElementURI == null && m_firstElementName != null)
{
String prefix1 = getPrefixPart(m_firs... | [
"public",
"void",
"namespaceAfterStartElement",
"(",
"String",
"prefix",
",",
"String",
"uri",
")",
"throws",
"SAXException",
"{",
"// hack for XSLTC with finding URI for default namespace",
"if",
"(",
"m_firstTagNotEmitted",
"&&",
"m_firstElementURI",
"==",
"null",
"&&",
... | This method is used when a prefix/uri namespace mapping
is indicated after the element was started with a
startElement() and before and endElement().
startPrefixMapping(prefix,uri) would be used before the
startElement() call.
@param uri the URI of the namespace
@param prefix the prefix associated with the given URI.
... | [
"This",
"method",
"is",
"used",
"when",
"a",
"prefix",
"/",
"uri",
"namespace",
"mapping",
"is",
"indicated",
"after",
"the",
"element",
"was",
"started",
"with",
"a",
"startElement",
"()",
"and",
"before",
"and",
"endElement",
"()",
".",
"startPrefixMapping",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToUnknownStream.java#L363-L380 |
scireum/server-sass | src/main/java/org/serversass/ast/Section.java | Section.getMediaQuery | public String getMediaQuery(Scope scope, Generator gen) {
"""
Compiles the effective media query of this section into a string
@param scope the scope used to resolve variables
@param gen the generator used to evaluate functions
@return the effective media query as string or "" if there is no media query
... | java | public String getMediaQuery(Scope scope, Generator gen) {
StringBuilder sb = new StringBuilder();
for (Expression expr : mediaQueries) {
if (sb.length() > 0) {
sb.append(" and ");
}
sb.append(expr.eval(scope, gen));
}
return sb.toString... | [
"public",
"String",
"getMediaQuery",
"(",
"Scope",
"scope",
",",
"Generator",
"gen",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Expression",
"expr",
":",
"mediaQueries",
")",
"{",
"if",
"(",
"sb",
".",
"leng... | Compiles the effective media query of this section into a string
@param scope the scope used to resolve variables
@param gen the generator used to evaluate functions
@return the effective media query as string or "" if there is no media query | [
"Compiles",
"the",
"effective",
"media",
"query",
"of",
"this",
"section",
"into",
"a",
"string"
] | train | https://github.com/scireum/server-sass/blob/e74af983567f10c43420d70cd31165dd080ba8fc/src/main/java/org/serversass/ast/Section.java#L128-L137 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/view/ApptentiveNestedScrollView.java | ApptentiveNestedScrollView.isViewDescendantOf | private static boolean isViewDescendantOf(View child, View parent) {
"""
Return true if child is a descendant of parent, (or equal to the parent).
"""
if (child == parent) {
return true;
}
final ViewParent theParent = child.getParent();
return (theParent instanceof ViewGroup) && isViewDescendantOf(... | java | private static boolean isViewDescendantOf(View child, View parent) {
if (child == parent) {
return true;
}
final ViewParent theParent = child.getParent();
return (theParent instanceof ViewGroup) && isViewDescendantOf((View) theParent, parent);
} | [
"private",
"static",
"boolean",
"isViewDescendantOf",
"(",
"View",
"child",
",",
"View",
"parent",
")",
"{",
"if",
"(",
"child",
"==",
"parent",
")",
"{",
"return",
"true",
";",
"}",
"final",
"ViewParent",
"theParent",
"=",
"child",
".",
"getParent",
"(",
... | Return true if child is a descendant of parent, (or equal to the parent). | [
"Return",
"true",
"if",
"child",
"is",
"a",
"descendant",
"of",
"parent",
"(",
"or",
"equal",
"to",
"the",
"parent",
")",
"."
] | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/view/ApptentiveNestedScrollView.java#L1678-L1685 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.serialDocInclude | private static boolean serialDocInclude(Utils utils, Element element) {
"""
Return true if the given Element should be included
in the serialized form.
@param element the Element to check for serializability.
"""
if (utils.isEnum(element)) {
return false;
}
List<? extend... | java | private static boolean serialDocInclude(Utils utils, Element element) {
if (utils.isEnum(element)) {
return false;
}
List<? extends DocTree> serial = utils.getSerialTrees(element);
if (!serial.isEmpty()) {
CommentHelper ch = utils.getCommentHelper(element);
... | [
"private",
"static",
"boolean",
"serialDocInclude",
"(",
"Utils",
"utils",
",",
"Element",
"element",
")",
"{",
"if",
"(",
"utils",
".",
"isEnum",
"(",
"element",
")",
")",
"{",
"return",
"false",
";",
"}",
"List",
"<",
"?",
"extends",
"DocTree",
">",
... | Return true if the given Element should be included
in the serialized form.
@param element the Element to check for serializability. | [
"Return",
"true",
"if",
"the",
"given",
"Element",
"should",
"be",
"included",
"in",
"the",
"serialized",
"form",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java#L592-L607 |
EMCECS/nfs-client-java | src/main/java/com/emc/ecs/nfsclient/network/NetMgr.java | NetMgr.sendAndWait | public Xdr sendAndWait(String serverIP, int port, boolean usePrivilegedPort, Xdr xdrRequest, int timeout) throws RpcException {
"""
Basic RPC call functionality only. Send the request, creating a new
connection as necessary, and return the raw Xdr returned.
@param serverIP
The endpoint of the server being cal... | java | public Xdr sendAndWait(String serverIP, int port, boolean usePrivilegedPort, Xdr xdrRequest, int timeout) throws RpcException {
InetSocketAddress key = InetSocketAddress.createUnresolved(serverIP, port);
Map<InetSocketAddress, Connection> connectionMap = usePrivilegedPort ? _privilegedConnectionMap : _... | [
"public",
"Xdr",
"sendAndWait",
"(",
"String",
"serverIP",
",",
"int",
"port",
",",
"boolean",
"usePrivilegedPort",
",",
"Xdr",
"xdrRequest",
",",
"int",
"timeout",
")",
"throws",
"RpcException",
"{",
"InetSocketAddress",
"key",
"=",
"InetSocketAddress",
".",
"c... | Basic RPC call functionality only. Send the request, creating a new
connection as necessary, and return the raw Xdr returned.
@param serverIP
The endpoint of the server being called.
@param port
The remote host port being called for this operation.
@param usePrivilegedPort
<ul>
<li>If <code>true</code>, use a privileg... | [
"Basic",
"RPC",
"call",
"functionality",
"only",
".",
"Send",
"the",
"request",
"creating",
"a",
"new",
"connection",
"as",
"necessary",
"and",
"return",
"the",
"raw",
"Xdr",
"returned",
"."
] | train | https://github.com/EMCECS/nfs-client-java/blob/7ba25bad5052b95cd286052745327729288b2843/src/main/java/com/emc/ecs/nfsclient/network/NetMgr.java#L117-L129 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/util/PathPattern.java | PathPattern.matches | public boolean matches(List<String> path) {
"""
Return true if the given list of path elements is matching this pattern.
"""
if (nbAny == 0 && path.size() != nbWildcards)
return false;
if (path.size() < nbWildcards)
return false;
return check(path, 0, 0, nbWildcards, nbAny);
} | java | public boolean matches(List<String> path) {
if (nbAny == 0 && path.size() != nbWildcards)
return false;
if (path.size() < nbWildcards)
return false;
return check(path, 0, 0, nbWildcards, nbAny);
} | [
"public",
"boolean",
"matches",
"(",
"List",
"<",
"String",
">",
"path",
")",
"{",
"if",
"(",
"nbAny",
"==",
"0",
"&&",
"path",
".",
"size",
"(",
")",
"!=",
"nbWildcards",
")",
"return",
"false",
";",
"if",
"(",
"path",
".",
"size",
"(",
")",
"<"... | Return true if the given list of path elements is matching this pattern. | [
"Return",
"true",
"if",
"the",
"given",
"list",
"of",
"path",
"elements",
"is",
"matching",
"this",
"pattern",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/util/PathPattern.java#L46-L52 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/DefaultPageShell.java | DefaultPageShell.addHeadlines | private void addHeadlines(final PrintWriter writer, final List headlines) {
"""
Add a list of html headline entries intended to be added only once to the page.
@param writer the writer to write to.
@param headlines a list of html entries to be added to the page as a whole.
"""
if (headlines == null || he... | java | private void addHeadlines(final PrintWriter writer, final List headlines) {
if (headlines == null || headlines.isEmpty()) {
return;
}
writer.write("\n<!-- Start general headlines -->");
for (Object line : headlines) {
writer.write("\n" + line);
}
writer.println("\n<!-- End general headlines -->");
... | [
"private",
"void",
"addHeadlines",
"(",
"final",
"PrintWriter",
"writer",
",",
"final",
"List",
"headlines",
")",
"{",
"if",
"(",
"headlines",
"==",
"null",
"||",
"headlines",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"writer",
".",
"write"... | Add a list of html headline entries intended to be added only once to the page.
@param writer the writer to write to.
@param headlines a list of html entries to be added to the page as a whole. | [
"Add",
"a",
"list",
"of",
"html",
"headline",
"entries",
"intended",
"to",
"be",
"added",
"only",
"once",
"to",
"the",
"page",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/DefaultPageShell.java#L142-L154 |
EdwardRaff/JSAT | JSAT/src/jsat/io/LIBSVMLoader.java | LIBSVMLoader.loadR | public static RegressionDataSet loadR(Reader reader, double sparseRatio, int vectorLength, DataStore store) throws IOException {
"""
Loads a new regression data set from a LIBSVM file, assuming the label is
a numeric target value to predict.
@param reader the reader for the file to load
@param sparseRatio the... | java | public static RegressionDataSet loadR(Reader reader, double sparseRatio, int vectorLength, DataStore store) throws IOException
{
return (RegressionDataSet) loadG(reader, sparseRatio, vectorLength, false, store);
} | [
"public",
"static",
"RegressionDataSet",
"loadR",
"(",
"Reader",
"reader",
",",
"double",
"sparseRatio",
",",
"int",
"vectorLength",
",",
"DataStore",
"store",
")",
"throws",
"IOException",
"{",
"return",
"(",
"RegressionDataSet",
")",
"loadG",
"(",
"reader",
",... | Loads a new regression data set from a LIBSVM file, assuming the label is
a numeric target value to predict.
@param reader the reader for the file to load
@param sparseRatio the fraction of non zero values to qualify a data
point as sparse
@param vectorLength the pre-determined length of each vector. If given a
negati... | [
"Loads",
"a",
"new",
"regression",
"data",
"set",
"from",
"a",
"LIBSVM",
"file",
"assuming",
"the",
"label",
"is",
"a",
"numeric",
"target",
"value",
"to",
"predict",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/io/LIBSVMLoader.java#L150-L153 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/Temporals.java | Temporals.parseFirstMatching | public static <T> T parseFirstMatching(CharSequence text, TemporalQuery<T> query, DateTimeFormatter... formatters) {
"""
Parses the text using one of the formatters.
<p>
This will try each formatter in turn, attempting to fully parse the specified text.
The temporal query is typically a method reference to a {@... | java | public static <T> T parseFirstMatching(CharSequence text, TemporalQuery<T> query, DateTimeFormatter... formatters) {
Objects.requireNonNull(text, "text");
Objects.requireNonNull(query, "query");
Objects.requireNonNull(formatters, "formatters");
if (formatters.length == 0) {
t... | [
"public",
"static",
"<",
"T",
">",
"T",
"parseFirstMatching",
"(",
"CharSequence",
"text",
",",
"TemporalQuery",
"<",
"T",
">",
"query",
",",
"DateTimeFormatter",
"...",
"formatters",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"text",
",",
"\"text\"",
... | Parses the text using one of the formatters.
<p>
This will try each formatter in turn, attempting to fully parse the specified text.
The temporal query is typically a method reference to a {@code from(TemporalAccessor)} method.
For example:
<pre>
LocalDateTime dt = Temporals.parseFirstMatching(str, LocalDateTime::from,... | [
"Parses",
"the",
"text",
"using",
"one",
"of",
"the",
"formatters",
".",
"<p",
">",
"This",
"will",
"try",
"each",
"formatter",
"in",
"turn",
"attempting",
"to",
"fully",
"parse",
"the",
"specified",
"text",
".",
"The",
"temporal",
"query",
"is",
"typicall... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/Temporals.java#L216-L239 |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java | Searcher.removeNumericRefinement | @SuppressWarnings( {
"""
Removes the given numeric refinement for the next queries.
@param refinement a description of the refinement to remove.
@return this {@link Searcher} for chaining.
""""WeakerAccess", "unused"}) // For library users
public Searcher removeNumericRefinement(@NonNull NumericRefinem... | java | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public Searcher removeNumericRefinement(@NonNull NumericRefinement refinement) {
if (refinement.operator == NumericRefinement.OPERATOR_UNKNOWN) {
numericRefinements.remove(refinement.attribute);
} else {
Numer... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"// For library users",
"public",
"Searcher",
"removeNumericRefinement",
"(",
"@",
"NonNull",
"NumericRefinement",
"refinement",
")",
"{",
"if",
"(",
"refinement",
".",
"operator",
"... | Removes the given numeric refinement for the next queries.
@param refinement a description of the refinement to remove.
@return this {@link Searcher} for chaining. | [
"Removes",
"the",
"given",
"numeric",
"refinement",
"for",
"the",
"next",
"queries",
"."
] | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java#L742-L756 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.fixDiscouragedCapacityDefinition | @Fix(io.sarl.lang.validation.IssueCodes.DISCOURAGED_CAPACITY_DEFINITION)
public void fixDiscouragedCapacityDefinition(Issue issue, IssueResolutionAcceptor acceptor) {
"""
Quick fix for "Discouraged capacity definition".
@param issue the issue.
@param acceptor the quick fix acceptor.
"""
MemberRemoveModi... | java | @Fix(io.sarl.lang.validation.IssueCodes.DISCOURAGED_CAPACITY_DEFINITION)
public void fixDiscouragedCapacityDefinition(Issue issue, IssueResolutionAcceptor acceptor) {
MemberRemoveModification.accept(this, issue, acceptor, SarlCapacity.class);
ActionAddModification.accept(this, issue, acceptor);
} | [
"@",
"Fix",
"(",
"io",
".",
"sarl",
".",
"lang",
".",
"validation",
".",
"IssueCodes",
".",
"DISCOURAGED_CAPACITY_DEFINITION",
")",
"public",
"void",
"fixDiscouragedCapacityDefinition",
"(",
"Issue",
"issue",
",",
"IssueResolutionAcceptor",
"acceptor",
")",
"{",
"... | Quick fix for "Discouraged capacity definition".
@param issue the issue.
@param acceptor the quick fix acceptor. | [
"Quick",
"fix",
"for",
"Discouraged",
"capacity",
"definition",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L855-L859 |
apache/groovy | src/main/java/org/codehaus/groovy/ast/tools/GeneralUtils.java | GeneralUtils.getterThisX | public static Expression getterThisX(ClassNode annotatedNode, PropertyNode pNode) {
"""
This method is similar to {@link #propX(Expression, Expression)} but will make sure that if the property
being accessed is defined inside the classnode provided as a parameter, then a getter call is generated
instead of a fie... | java | public static Expression getterThisX(ClassNode annotatedNode, PropertyNode pNode) {
ClassNode owner = pNode.getDeclaringClass();
if (annotatedNode.equals(owner)) {
return callThisX(getterName(annotatedNode, pNode));
}
return propX(new VariableExpression("this"), pNode.getName... | [
"public",
"static",
"Expression",
"getterThisX",
"(",
"ClassNode",
"annotatedNode",
",",
"PropertyNode",
"pNode",
")",
"{",
"ClassNode",
"owner",
"=",
"pNode",
".",
"getDeclaringClass",
"(",
")",
";",
"if",
"(",
"annotatedNode",
".",
"equals",
"(",
"owner",
")... | This method is similar to {@link #propX(Expression, Expression)} but will make sure that if the property
being accessed is defined inside the classnode provided as a parameter, then a getter call is generated
instead of a field access.
@param annotatedNode the class node where the property node is accessed from
@param ... | [
"This",
"method",
"is",
"similar",
"to",
"{"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/tools/GeneralUtils.java#L790-L796 |
alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStoreUtils.java | BlobStoreUtils.downloadResourcesAsSupervisor | public static void downloadResourcesAsSupervisor(String key, String localFile, ClientBlobStore cb, Map conf)
throws KeyNotFoundException, IOException {
"""
Meant to be called only by the supervisor for stormjar/stormconf/stormcode files.
@param key
@param localFile
@param cb
@throws KeyNotFoundEx... | java | public static void downloadResourcesAsSupervisor(String key, String localFile, ClientBlobStore cb, Map conf)
throws KeyNotFoundException, IOException {
if (cb instanceof NimbusBlobStore) {
List<NimbusInfo> nimbusInfos = null;
CuratorFramework zkClient = null;
try ... | [
"public",
"static",
"void",
"downloadResourcesAsSupervisor",
"(",
"String",
"key",
",",
"String",
"localFile",
",",
"ClientBlobStore",
"cb",
",",
"Map",
"conf",
")",
"throws",
"KeyNotFoundException",
",",
"IOException",
"{",
"if",
"(",
"cb",
"instanceof",
"NimbusB... | Meant to be called only by the supervisor for stormjar/stormconf/stormcode files.
@param key
@param localFile
@param cb
@throws KeyNotFoundException
@throws IOException | [
"Meant",
"to",
"be",
"called",
"only",
"by",
"the",
"supervisor",
"for",
"stormjar",
"/",
"stormconf",
"/",
"stormcode",
"files",
"."
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStoreUtils.java#L337-L370 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/mains/FixedDurationTemporalRandomIndexingMain.java | FixedDurationTemporalRandomIndexingMain.printSpace | private void printSpace(SemanticSpace sspace, String tag) {
"""
Prints the semantic space to file, inserting the tag into the .sspace
file name
"""
try {
String EXT = ".sspace";
File output = (overwrite)
? new File(outputDir, sspace.getSpaceName() + tag + EXT)
... | java | private void printSpace(SemanticSpace sspace, String tag) {
try {
String EXT = ".sspace";
File output = (overwrite)
? new File(outputDir, sspace.getSpaceName() + tag + EXT)
: File.createTempFile(sspace.getSpaceName() + tag, EXT,
... | [
"private",
"void",
"printSpace",
"(",
"SemanticSpace",
"sspace",
",",
"String",
"tag",
")",
"{",
"try",
"{",
"String",
"EXT",
"=",
"\".sspace\"",
";",
"File",
"output",
"=",
"(",
"overwrite",
")",
"?",
"new",
"File",
"(",
"outputDir",
",",
"sspace",
".",... | Prints the semantic space to file, inserting the tag into the .sspace
file name | [
"Prints",
"the",
"semantic",
"space",
"to",
"file",
"inserting",
"the",
"tag",
"into",
"the",
".",
"sspace",
"file",
"name"
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/mains/FixedDurationTemporalRandomIndexingMain.java#L481-L497 |
MenoData/Time4J | base/src/main/java/net/time4j/clock/NetTimeConnector.java | NetTimeConnector.connect | public final void connect() throws IOException {
"""
/*[deutsch]
<p>Fragt einen Server nach der aktuellen Uhrzeit ab. </p>
<p>Das Ergebnis kann dann mit Hilfe der Methode {@code currentTime()}
abgelesen werden, welche auf dem durch die letzte Abfrage gewonnenen
Netzwerk-Offset basiert. Somit findet eine Verb... | java | public final void connect() throws IOException {
try {
Moment moment = this.doConnect();
long localMicros = SystemClock.MONOTONIC.realTimeInMicros();
final ConnectionResult cr = this.result;
long currentOffset = (
(cr == null)
? Lo... | [
"public",
"final",
"void",
"connect",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"Moment",
"moment",
"=",
"this",
".",
"doConnect",
"(",
")",
";",
"long",
"localMicros",
"=",
"SystemClock",
".",
"MONOTONIC",
".",
"realTimeInMicros",
"(",
")",
";",... | /*[deutsch]
<p>Fragt einen Server nach der aktuellen Uhrzeit ab. </p>
<p>Das Ergebnis kann dann mit Hilfe der Methode {@code currentTime()}
abgelesen werden, welche auf dem durch die letzte Abfrage gewonnenen
Netzwerk-Offset basiert. Somit findet eine Verbindung zum Server nur
hier und nicht in der besagten Zeitermitt... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Fragt",
"einen",
"Server",
"nach",
"der",
"aktuellen",
"Uhrzeit",
"ab",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/clock/NetTimeConnector.java#L210-L231 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-data/deeplearning4j-datasets/src/main/java/org/deeplearning4j/datasets/iterator/impl/Cifar10DataSetIterator.java | Cifar10DataSetIterator.getLabels | public static List<String> getLabels(boolean categories) {
"""
Get the labels - either in "categories" (imagenet synsets format, "n01910747" or similar) or human-readable format,
such as "jellyfish"
@param categories If true: return category/synset format; false: return "human readable" label format
@return Lab... | java | public static List<String> getLabels(boolean categories){
List<String> rawLabels = new Cifar10DataSetIterator(1).getLabels();
if(categories){
return rawLabels;
}
//Otherwise, convert to human-readable format, using 'words.txt' file
File baseDir = DL4JResources.getDir... | [
"public",
"static",
"List",
"<",
"String",
">",
"getLabels",
"(",
"boolean",
"categories",
")",
"{",
"List",
"<",
"String",
">",
"rawLabels",
"=",
"new",
"Cifar10DataSetIterator",
"(",
"1",
")",
".",
"getLabels",
"(",
")",
";",
"if",
"(",
"categories",
"... | Get the labels - either in "categories" (imagenet synsets format, "n01910747" or similar) or human-readable format,
such as "jellyfish"
@param categories If true: return category/synset format; false: return "human readable" label format
@return Labels | [
"Get",
"the",
"labels",
"-",
"either",
"in",
"categories",
"(",
"imagenet",
"synsets",
"format",
"n01910747",
"or",
"similar",
")",
"or",
"human",
"-",
"readable",
"format",
"such",
"as",
"jellyfish"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-data/deeplearning4j-datasets/src/main/java/org/deeplearning4j/datasets/iterator/impl/Cifar10DataSetIterator.java#L102-L131 |
RoaringBitmap/RoaringBitmap | roaringbitmap/src/main/java/org/roaringbitmap/ParallelAggregation.java | ParallelAggregation.or | public static RoaringBitmap or(RoaringBitmap... bitmaps) {
"""
Computes the bitwise union of the input bitmaps
@param bitmaps the input bitmaps
@return the union of the bitmaps
"""
SortedMap<Short, List<Container>> grouped = groupByKey(bitmaps);
short[] keys = new short[grouped.size()];
Container... | java | public static RoaringBitmap or(RoaringBitmap... bitmaps) {
SortedMap<Short, List<Container>> grouped = groupByKey(bitmaps);
short[] keys = new short[grouped.size()];
Container[] values = new Container[grouped.size()];
List<List<Container>> slices = new ArrayList<>(grouped.size());
int i = 0;
for... | [
"public",
"static",
"RoaringBitmap",
"or",
"(",
"RoaringBitmap",
"...",
"bitmaps",
")",
"{",
"SortedMap",
"<",
"Short",
",",
"List",
"<",
"Container",
">",
">",
"grouped",
"=",
"groupByKey",
"(",
"bitmaps",
")",
";",
"short",
"[",
"]",
"keys",
"=",
"new"... | Computes the bitwise union of the input bitmaps
@param bitmaps the input bitmaps
@return the union of the bitmaps | [
"Computes",
"the",
"bitwise",
"union",
"of",
"the",
"input",
"bitmaps"
] | train | https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/ParallelAggregation.java#L164-L178 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/wishlists/WishlistItemUrl.java | WishlistItemUrl.updateWishlistItemQuantityUrl | public static MozuUrl updateWishlistItemQuantityUrl(Integer quantity, String responseFields, String wishlistId, String wishlistItemId) {
"""
Get Resource Url for UpdateWishlistItemQuantity
@param quantity The number of cart items in the shopper's active cart.
@param responseFields Filtering syntax appended to an... | java | public static MozuUrl updateWishlistItemQuantityUrl(Integer quantity, String responseFields, String wishlistId, String wishlistItemId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/wishlists/{wishlistId}/items/{wishlistItemId}/{quantity}?responseFields={responseFields}");
formatter.formatUrl("quant... | [
"public",
"static",
"MozuUrl",
"updateWishlistItemQuantityUrl",
"(",
"Integer",
"quantity",
",",
"String",
"responseFields",
",",
"String",
"wishlistId",
",",
"String",
"wishlistItemId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/c... | Get Resource Url for UpdateWishlistItemQuantity
@param quantity The number of cart items in the shopper's active cart.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting ... | [
"Get",
"Resource",
"Url",
"for",
"UpdateWishlistItemQuantity"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/wishlists/WishlistItemUrl.java#L100-L108 |
inferred/FreeBuilder | src/main/java/org/inferred/freebuilder/processor/naming/NamingConventions.java | NamingConventions.determineNamingConvention | public static NamingConvention determineNamingConvention(
TypeElement type,
Iterable<ExecutableElement> methods,
Messager messager,
Types types) {
"""
Determine whether the user has followed bean-like naming convention or not.
"""
ExecutableElement beanMethod = null;
ExecutableE... | java | public static NamingConvention determineNamingConvention(
TypeElement type,
Iterable<ExecutableElement> methods,
Messager messager,
Types types) {
ExecutableElement beanMethod = null;
ExecutableElement prefixlessMethod = null;
for (ExecutableElement method : methods) {
switch (... | [
"public",
"static",
"NamingConvention",
"determineNamingConvention",
"(",
"TypeElement",
"type",
",",
"Iterable",
"<",
"ExecutableElement",
">",
"methods",
",",
"Messager",
"messager",
",",
"Types",
"types",
")",
"{",
"ExecutableElement",
"beanMethod",
"=",
"null",
... | Determine whether the user has followed bean-like naming convention or not. | [
"Determine",
"whether",
"the",
"user",
"has",
"followed",
"bean",
"-",
"like",
"naming",
"convention",
"or",
"not",
"."
] | train | https://github.com/inferred/FreeBuilder/blob/d5a222f90648aece135da4b971c55a60afe8649c/src/main/java/org/inferred/freebuilder/processor/naming/NamingConventions.java#L37-L68 |
krotscheck/data-file-reader | data-file-reader-csv/src/main/java/net/krotscheck/dfr/csv/CSVDataEncoder.java | CSVDataEncoder.writeToOutput | @Override
protected void writeToOutput(final Map<String, Object> row)
throws IOException {
"""
Write a row to the destination.
@param row The row to write.
@throws java.io.IOException Exception thrown when there's problems
writing to the output.
"""
if (writer == null) {
... | java | @Override
protected void writeToOutput(final Map<String, Object> row)
throws IOException {
if (writer == null) {
CsvMapper mapper = new CsvMapper();
mapper.disable(SerializationFeature.CLOSE_CLOSEABLE);
mapper.getFactory()
.configure(JsonGe... | [
"@",
"Override",
"protected",
"void",
"writeToOutput",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"row",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"{",
"CsvMapper",
"mapper",
"=",
"new",
"CsvMapper",
"(",
")"... | Write a row to the destination.
@param row The row to write.
@throws java.io.IOException Exception thrown when there's problems
writing to the output. | [
"Write",
"a",
"row",
"to",
"the",
"destination",
"."
] | train | https://github.com/krotscheck/data-file-reader/blob/b9a85bd07dc9f9b8291ffbfb6945443d96371811/data-file-reader-csv/src/main/java/net/krotscheck/dfr/csv/CSVDataEncoder.java#L47-L61 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/rest/DatastreamResource.java | DatastreamResource.getDatastream | @Path("/ {
"""
<p>Invoke API-A.getDatastreamDissemination(context, pid, dsID, asOfDateTime)
</p><p>
GET /objects/{pid}/datastreams/{dsID}/content ? asOfDateTime</p>
"""dsID}/content")
@GET
public Response getDatastream(@PathParam(RestParam.PID) String pid,
@PathParam... | java | @Path("/{dsID}/content")
@GET
public Response getDatastream(@PathParam(RestParam.PID) String pid,
@PathParam(RestParam.DSID) String dsID,
@QueryParam(RestParam.AS_OF_DATE_TIME) String dateTime,
@QueryParam(Rest... | [
"@",
"Path",
"(",
"\"/{dsID}/content\"",
")",
"@",
"GET",
"public",
"Response",
"getDatastream",
"(",
"@",
"PathParam",
"(",
"RestParam",
".",
"PID",
")",
"String",
"pid",
",",
"@",
"PathParam",
"(",
"RestParam",
".",
"DSID",
")",
"String",
"dsID",
",",
... | <p>Invoke API-A.getDatastreamDissemination(context, pid, dsID, asOfDateTime)
</p><p>
GET /objects/{pid}/datastreams/{dsID}/content ? asOfDateTime</p> | [
"<p",
">",
"Invoke",
"API",
"-",
"A",
".",
"getDatastreamDissemination",
"(",
"context",
"pid",
"dsID",
"asOfDateTime",
")",
"<",
"/",
"p",
">",
"<p",
">",
"GET",
"/",
"objects",
"/",
"{",
"pid",
"}",
"/",
"datastreams",
"/",
"{",
"dsID",
"}",
"/",
... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/rest/DatastreamResource.java#L256-L286 |
bluelinelabs/Conductor | conductor/src/main/java/com/bluelinelabs/conductor/changehandler/TransitionChangeHandler.java | TransitionChangeHandler.executePropertyChanges | public void executePropertyChanges(@NonNull ViewGroup container, @Nullable View from, @Nullable View to, @Nullable Transition transition, boolean isPush) {
"""
This should set all view properties needed for the transition to work properly. By default it removes the "from" view
and adds the "to" view.
@param co... | java | public void executePropertyChanges(@NonNull ViewGroup container, @Nullable View from, @Nullable View to, @Nullable Transition transition, boolean isPush) {
if (from != null && (removesFromViewOnPush() || !isPush) && from.getParent() == container) {
container.removeView(from);
}
if (t... | [
"public",
"void",
"executePropertyChanges",
"(",
"@",
"NonNull",
"ViewGroup",
"container",
",",
"@",
"Nullable",
"View",
"from",
",",
"@",
"Nullable",
"View",
"to",
",",
"@",
"Nullable",
"Transition",
"transition",
",",
"boolean",
"isPush",
")",
"{",
"if",
"... | This should set all view properties needed for the transition to work properly. By default it removes the "from" view
and adds the "to" view.
@param container The container these Views are hosted in
@param from The previous View in the container or {@code null} if there was no Controller before this transition
... | [
"This",
"should",
"set",
"all",
"view",
"properties",
"needed",
"for",
"the",
"transition",
"to",
"work",
"properly",
".",
"By",
"default",
"it",
"removes",
"the",
"from",
"view",
"and",
"adds",
"the",
"to",
"view",
"."
] | train | https://github.com/bluelinelabs/Conductor/blob/94c9121bb16f93b481954513a8e3905846829fb2/conductor/src/main/java/com/bluelinelabs/conductor/changehandler/TransitionChangeHandler.java#L134-L141 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApi.java | GitLabApi.oauth2Login | public static GitLabApi oauth2Login(String url, String username, char[] password) throws GitLabApiException {
"""
<p>Logs into GitLab using OAuth2 with the provided {@code username} and {@code password},
and creates a new {@code GitLabApi} instance using returned access token.</p>
@param url GitLab URL
@param... | java | public static GitLabApi oauth2Login(String url, String username, char[] password) throws GitLabApiException {
try (SecretString secretPassword = new SecretString(password)) {
return (GitLabApi.oauth2Login(ApiVersion.V4, url, username, secretPassword, null, null, false));
}
} | [
"public",
"static",
"GitLabApi",
"oauth2Login",
"(",
"String",
"url",
",",
"String",
"username",
",",
"char",
"[",
"]",
"password",
")",
"throws",
"GitLabApiException",
"{",
"try",
"(",
"SecretString",
"secretPassword",
"=",
"new",
"SecretString",
"(",
"password... | <p>Logs into GitLab using OAuth2 with the provided {@code username} and {@code password},
and creates a new {@code GitLabApi} instance using returned access token.</p>
@param url GitLab URL
@param username user name for which private token should be obtained
@param password a char array holding the password for a give... | [
"<p",
">",
"Logs",
"into",
"GitLab",
"using",
"OAuth2",
"with",
"the",
"provided",
"{",
"@code",
"username",
"}",
"and",
"{",
"@code",
"password",
"}",
"and",
"creates",
"a",
"new",
"{",
"@code",
"GitLabApi",
"}",
"instance",
"using",
"returned",
"access",... | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApi.java#L143-L148 |
google/error-prone-javac | src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java | Main.processRelease | boolean processRelease(String release, Collection<String> classes) throws IOException {
"""
Process classes from a particular JDK release, using only information
in this JDK.
@param release "6", "7", "8", or "9"
@param classes collection of classes to process, may be empty
@return success value
"""
... | java | boolean processRelease(String release, Collection<String> classes) throws IOException {
options.addAll(List.of("--release", release));
if (release.equals("9")) {
List<String> rootMods = List.of("java.se", "java.se.ee");
TraverseProc proc = new TraverseProc(rootMods);
... | [
"boolean",
"processRelease",
"(",
"String",
"release",
",",
"Collection",
"<",
"String",
">",
"classes",
")",
"throws",
"IOException",
"{",
"options",
".",
"addAll",
"(",
"List",
".",
"of",
"(",
"\"--release\"",
",",
"release",
")",
")",
";",
"if",
"(",
... | Process classes from a particular JDK release, using only information
in this JDK.
@param release "6", "7", "8", or "9"
@param classes collection of classes to process, may be empty
@return success value | [
"Process",
"classes",
"from",
"a",
"particular",
"JDK",
"release",
"using",
"only",
"information",
"in",
"this",
"JDK",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java#L360-L413 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.