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 |
|---|---|---|---|---|---|---|---|---|---|---|
tvesalainen/util | util/src/main/java/org/vesalainen/ui/LineDrawer.java | LineDrawer.drawLine | public static void drawLine(Point p1, Point p2, PlotOperator plot) {
"""
Draws line (p1, p2) by plotting points using plot
@param p1
@param p2
@param plot
@param color
"""
drawLine(p1.x, p1.y, p2.x, p2.y, plot);
} | java | public static void drawLine(Point p1, Point p2, PlotOperator plot)
{
drawLine(p1.x, p1.y, p2.x, p2.y, plot);
} | [
"public",
"static",
"void",
"drawLine",
"(",
"Point",
"p1",
",",
"Point",
"p2",
",",
"PlotOperator",
"plot",
")",
"{",
"drawLine",
"(",
"p1",
".",
"x",
",",
"p1",
".",
"y",
",",
"p2",
".",
"x",
",",
"p2",
".",
"y",
",",
"plot",
")",
";",
"}"
] | Draws line (p1, p2) by plotting points using plot
@param p1
@param p2
@param plot
@param color | [
"Draws",
"line",
"(",
"p1",
"p2",
")",
"by",
"plotting",
"points",
"using",
"plot"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/ui/LineDrawer.java#L71-L74 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java | ParagraphVectors.predictSeveral | public Collection<String> predictSeveral(String rawText, int limit) {
"""
Predict several labels based on the document.
Computes a similarity wrt the mean of the
representation of words in the document
@param rawText raw text of the document
@return possible labels in descending order
"""
if (token... | java | public Collection<String> predictSeveral(String rawText, int limit) {
if (tokenizerFactory == null)
throw new IllegalStateException("TokenizerFactory should be defined, prior to predict() call");
List<String> tokens = tokenizerFactory.create(rawText).getTokens();
List<VocabWord> doc... | [
"public",
"Collection",
"<",
"String",
">",
"predictSeveral",
"(",
"String",
"rawText",
",",
"int",
"limit",
")",
"{",
"if",
"(",
"tokenizerFactory",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"TokenizerFactory should be defined, prior to predi... | Predict several labels based on the document.
Computes a similarity wrt the mean of the
representation of words in the document
@param rawText raw text of the document
@return possible labels in descending order | [
"Predict",
"several",
"labels",
"based",
"on",
"the",
"document",
".",
"Computes",
"a",
"similarity",
"wrt",
"the",
"mean",
"of",
"the",
"representation",
"of",
"words",
"in",
"the",
"document"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java#L464-L477 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_vrack_network_vrackNetworkId_updateFarmId_POST | public OvhVrackNetwork serviceName_vrack_network_vrackNetworkId_updateFarmId_POST(String serviceName, Long vrackNetworkId, Long[] farmId) throws IOException {
"""
Update farm attached to that vrack network id
REST: POST /ipLoadbalancing/{serviceName}/vrack/network/{vrackNetworkId}/updateFarmId
@param farmId [r... | java | public OvhVrackNetwork serviceName_vrack_network_vrackNetworkId_updateFarmId_POST(String serviceName, Long vrackNetworkId, Long[] farmId) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/vrack/network/{vrackNetworkId}/updateFarmId";
StringBuilder sb = path(qPath, serviceName, vrackNetworkId);
H... | [
"public",
"OvhVrackNetwork",
"serviceName_vrack_network_vrackNetworkId_updateFarmId_POST",
"(",
"String",
"serviceName",
",",
"Long",
"vrackNetworkId",
",",
"Long",
"[",
"]",
"farmId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceNa... | Update farm attached to that vrack network id
REST: POST /ipLoadbalancing/{serviceName}/vrack/network/{vrackNetworkId}/updateFarmId
@param farmId [required] Farm Id you want to attach to that vrack network
@param serviceName [required] The internal name of your IP load balancing
@param vrackNetworkId [required] Intern... | [
"Update",
"farm",
"attached",
"to",
"that",
"vrack",
"network",
"id"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1091-L1098 |
intellimate/Izou | src/main/java/org/intellimate/izou/identification/AddOnInformationManager.java | AddOnInformationManager.unregisterHelper | private boolean unregisterHelper(Supplier<Optional<AddOnModel>> suppAdd, Supplier<Optional<AddOnInformation>> suppAddInf) {
"""
Helper to unregister an addOn.
@param suppAdd The first get function to find the right addon.
@param suppAddInf The second get function to find the right addonInformation.
@return Tr... | java | private boolean unregisterHelper(Supplier<Optional<AddOnModel>> suppAdd, Supplier<Optional<AddOnInformation>> suppAddInf) {
boolean success1 = false;
Optional<AddOnModel> addOnModel = suppAdd.get();
if (addOnModel.isPresent()) {
success1 = addOns.remove(addOnModel.get());
}
... | [
"private",
"boolean",
"unregisterHelper",
"(",
"Supplier",
"<",
"Optional",
"<",
"AddOnModel",
">",
">",
"suppAdd",
",",
"Supplier",
"<",
"Optional",
"<",
"AddOnInformation",
">",
">",
"suppAddInf",
")",
"{",
"boolean",
"success1",
"=",
"false",
";",
"Optional... | Helper to unregister an addOn.
@param suppAdd The first get function to find the right addon.
@param suppAddInf The second get function to find the right addonInformation.
@return True if the operation was successful, otherwise false. | [
"Helper",
"to",
"unregister",
"an",
"addOn",
"."
] | train | https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/identification/AddOnInformationManager.java#L93-L107 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/MutableBigInteger.java | MutableBigInteger.compareShifted | private int compareShifted(MutableBigInteger b, int ints) {
"""
Returns a value equal to what {@code b.leftShift(32*ints); return compare(b);}
would return, but doesn't change the value of {@code b}.
"""
int blen = b.intLen;
int alen = intLen - ints;
if (alen < blen)
return... | java | private int compareShifted(MutableBigInteger b, int ints) {
int blen = b.intLen;
int alen = intLen - ints;
if (alen < blen)
return -1;
if (alen > blen)
return 1;
// Add Integer.MIN_VALUE to make the comparison act as unsigned integer
// comparison.... | [
"private",
"int",
"compareShifted",
"(",
"MutableBigInteger",
"b",
",",
"int",
"ints",
")",
"{",
"int",
"blen",
"=",
"b",
".",
"intLen",
";",
"int",
"alen",
"=",
"intLen",
"-",
"ints",
";",
"if",
"(",
"alen",
"<",
"blen",
")",
"return",
"-",
"1",
"... | Returns a value equal to what {@code b.leftShift(32*ints); return compare(b);}
would return, but doesn't change the value of {@code b}. | [
"Returns",
"a",
"value",
"equal",
"to",
"what",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/MutableBigInteger.java#L284-L304 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShipmentPersistenceImpl.java | CommerceShipmentPersistenceImpl.findAll | @Override
public List<CommerceShipment> findAll() {
"""
Returns all the commerce shipments.
@return the commerce shipments
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceShipment> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceShipment",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce shipments.
@return the commerce shipments | [
"Returns",
"all",
"the",
"commerce",
"shipments",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShipmentPersistenceImpl.java#L1666-L1669 |
att/AAF | authz/authz-cass/src/main/java/com/att/dao/aaf/cass/ApprovalDAO.java | ApprovalDAO.wasModified | @Override
protected void wasModified(AuthzTrans trans, CRUD modified, Data data, String ... override) {
"""
Log Modification statements to History
@param modified which CRUD action was done
@param data entity data that needs a log entry
@param overrideMessage if this is specified, we use... | java | @Override
protected void wasModified(AuthzTrans trans, CRUD modified, Data data, String ... override) {
boolean memo = override.length>0 && override[0]!=null;
boolean subject = override.length>1 && override[1]!=null;
HistoryDAO.Data hd = HistoryDAO.newInitedData();
hd.user = trans.user();... | [
"@",
"Override",
"protected",
"void",
"wasModified",
"(",
"AuthzTrans",
"trans",
",",
"CRUD",
"modified",
",",
"Data",
"data",
",",
"String",
"...",
"override",
")",
"{",
"boolean",
"memo",
"=",
"override",
".",
"length",
">",
"0",
"&&",
"override",
"[",
... | Log Modification statements to History
@param modified which CRUD action was done
@param data entity data that needs a log entry
@param overrideMessage if this is specified, we use it rather than crafting a history message based on data | [
"Log",
"Modification",
"statements",
"to",
"History"
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-cass/src/main/java/com/att/dao/aaf/cass/ApprovalDAO.java#L166-L184 |
alkacon/opencms-core | src/org/opencms/xml/types/CmsXmlVfsImageValue.java | CmsXmlVfsImageValue.setScaleOptions | public void setScaleOptions(CmsObject cms, String scaleOptions) {
"""
Sets the scale options of the image.<p>
@param cms the current users context
@param scaleOptions the scale options of the image
"""
if (CmsStringUtil.isEmptyOrWhitespaceOnly(scaleOptions)) {
m_scaleOptions = "";
... | java | public void setScaleOptions(CmsObject cms, String scaleOptions) {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(scaleOptions)) {
m_scaleOptions = "";
if (m_element.element(NODE_SCALE) != null) {
m_element.remove(m_element.element(NODE_SCALE));
}
} else {
... | [
"public",
"void",
"setScaleOptions",
"(",
"CmsObject",
"cms",
",",
"String",
"scaleOptions",
")",
"{",
"if",
"(",
"CmsStringUtil",
".",
"isEmptyOrWhitespaceOnly",
"(",
"scaleOptions",
")",
")",
"{",
"m_scaleOptions",
"=",
"\"\"",
";",
"if",
"(",
"m_element",
"... | Sets the scale options of the image.<p>
@param cms the current users context
@param scaleOptions the scale options of the image | [
"Sets",
"the",
"scale",
"options",
"of",
"the",
"image",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/types/CmsXmlVfsImageValue.java#L267-L278 |
ldapchai/ldapchai | src/main/java/com/novell/ldapchai/cr/ChaiCrFactory.java | ChaiCrFactory.newChaiResponseSet | public static ChaiResponseSet newChaiResponseSet(
final Map<Challenge, String> challengeResponseMap,
final Locale locale,
final int minimumRandomRequired,
final ChaiConfiguration chaiConfiguration,
final String csIdentifier
)
throws ChaiValidat... | java | public static ChaiResponseSet newChaiResponseSet(
final Map<Challenge, String> challengeResponseMap,
final Locale locale,
final int minimumRandomRequired,
final ChaiConfiguration chaiConfiguration,
final String csIdentifier
)
throws ChaiValidat... | [
"public",
"static",
"ChaiResponseSet",
"newChaiResponseSet",
"(",
"final",
"Map",
"<",
"Challenge",
",",
"String",
">",
"challengeResponseMap",
",",
"final",
"Locale",
"locale",
",",
"final",
"int",
"minimumRandomRequired",
",",
"final",
"ChaiConfiguration",
"chaiConf... | Create a new ResponseSet. The generated ResponseSet will be suitable for writing to the directory.
@param challengeResponseMap A map containing Challenges as the key, and string responses for values
@param locale The locale the response set is stored in
@param minimumRandomRequired Minimum random resp... | [
"Create",
"a",
"new",
"ResponseSet",
".",
"The",
"generated",
"ResponseSet",
"will",
"be",
"suitable",
"for",
"writing",
"to",
"the",
"directory",
"."
] | train | https://github.com/ldapchai/ldapchai/blob/a6d4b5dbfa4e270db0ce70892512cbe39e64b874/src/main/java/com/novell/ldapchai/cr/ChaiCrFactory.java#L70-L80 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.isBetween | public static boolean isBetween(Number value, Number min, Number max) {
"""
检查给定的数字是否在指定范围内
@param value 值
@param min 最小值(包含)
@param max 最大值(包含)
@return 是否满足
@since 4.1.10
"""
Assert.notNull(value);
Assert.notNull(min);
Assert.notNull(max);
final double doubleValue = value.doubleValue();
... | java | public static boolean isBetween(Number value, Number min, Number max) {
Assert.notNull(value);
Assert.notNull(min);
Assert.notNull(max);
final double doubleValue = value.doubleValue();
return (doubleValue >= min.doubleValue()) && (doubleValue <= max.doubleValue());
} | [
"public",
"static",
"boolean",
"isBetween",
"(",
"Number",
"value",
",",
"Number",
"min",
",",
"Number",
"max",
")",
"{",
"Assert",
".",
"notNull",
"(",
"value",
")",
";",
"Assert",
".",
"notNull",
"(",
"min",
")",
";",
"Assert",
".",
"notNull",
"(",
... | 检查给定的数字是否在指定范围内
@param value 值
@param min 最小值(包含)
@param max 最大值(包含)
@return 是否满足
@since 4.1.10 | [
"检查给定的数字是否在指定范围内"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L1046-L1052 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java | BaseProfile.generateAntIvyXml | void generateAntIvyXml(Definition def, String outputDir) {
"""
generate ant + ivy build.xml and ivy files
@param def Definition
@param outputDir output directory
"""
try
{
FileWriter antfw = Utils.createFile("build.xml", outputDir);
BuildIvyXmlGen bxGen = new BuildIvyXml... | java | void generateAntIvyXml(Definition def, String outputDir)
{
try
{
FileWriter antfw = Utils.createFile("build.xml", outputDir);
BuildIvyXmlGen bxGen = new BuildIvyXmlGen();
bxGen.generate(def, antfw);
antfw.close();
FileWriter ivyfw = Utils.createFile("ivy.xml"... | [
"void",
"generateAntIvyXml",
"(",
"Definition",
"def",
",",
"String",
"outputDir",
")",
"{",
"try",
"{",
"FileWriter",
"antfw",
"=",
"Utils",
".",
"createFile",
"(",
"\"build.xml\"",
",",
"outputDir",
")",
";",
"BuildIvyXmlGen",
"bxGen",
"=",
"new",
"BuildIvyX... | generate ant + ivy build.xml and ivy files
@param def Definition
@param outputDir output directory | [
"generate",
"ant",
"+",
"ivy",
"build",
".",
"xml",
"and",
"ivy",
"files"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java#L358-L381 |
intellimate/Izou | src/main/java/org/intellimate/izou/threadpool/ThreadPoolManager.java | ThreadPoolManager.handleThrowable | public void handleThrowable(Throwable e, Object target) {
"""
tries everything to log the exception
@param e the Throwable
@param target an instance of the thing which has thrown the Exception
"""
try {
ExceptionCallback exceptionCallback = (ExceptionCallback) target;
if (e in... | java | public void handleThrowable(Throwable e, Object target) {
try {
ExceptionCallback exceptionCallback = (ExceptionCallback) target;
if (e instanceof Exception) {
exceptionCallback.exceptionThrown((Exception) e);
} else {
exceptionCallback.excepti... | [
"public",
"void",
"handleThrowable",
"(",
"Throwable",
"e",
",",
"Object",
"target",
")",
"{",
"try",
"{",
"ExceptionCallback",
"exceptionCallback",
"=",
"(",
"ExceptionCallback",
")",
"target",
";",
"if",
"(",
"e",
"instanceof",
"Exception",
")",
"{",
"except... | tries everything to log the exception
@param e the Throwable
@param target an instance of the thing which has thrown the Exception | [
"tries",
"everything",
"to",
"log",
"the",
"exception"
] | train | https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/threadpool/ThreadPoolManager.java#L50-L61 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java | ParseUtils.unexpectedElement | public static XMLStreamException unexpectedElement(final XMLExtendedStreamReader reader, Set<String> possible) {
"""
Get an exception reporting an unexpected XML element.
@param reader the stream reader
@return the exception
"""
final XMLStreamException ex = ControllerLogger.ROOT_LOGGER.unexpectedEle... | java | public static XMLStreamException unexpectedElement(final XMLExtendedStreamReader reader, Set<String> possible) {
final XMLStreamException ex = ControllerLogger.ROOT_LOGGER.unexpectedElement(reader.getName(), asStringList(possible), reader.getLocation());
return new XMLStreamValidationException(ex.getMe... | [
"public",
"static",
"XMLStreamException",
"unexpectedElement",
"(",
"final",
"XMLExtendedStreamReader",
"reader",
",",
"Set",
"<",
"String",
">",
"possible",
")",
"{",
"final",
"XMLStreamException",
"ex",
"=",
"ControllerLogger",
".",
"ROOT_LOGGER",
".",
"unexpectedEl... | Get an exception reporting an unexpected XML element.
@param reader the stream reader
@return the exception | [
"Get",
"an",
"exception",
"reporting",
"an",
"unexpected",
"XML",
"element",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java#L109-L117 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/resourcestore/locationdb/RemoteResourceFileLocationDB.java | RemoteResourceFileLocationDB.removeNameUrl | public void removeNameUrl(final String name, final String url)
throws IOException {
"""
remove a single url location for a name, if it exists
@param name
@param url
@throws IOException
"""
doPostMethod(ResourceFileLocationDBServlet.REMOVE_OPERATION, name, url);
} | java | public void removeNameUrl(final String name, final String url)
throws IOException {
doPostMethod(ResourceFileLocationDBServlet.REMOVE_OPERATION, name, url);
} | [
"public",
"void",
"removeNameUrl",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"url",
")",
"throws",
"IOException",
"{",
"doPostMethod",
"(",
"ResourceFileLocationDBServlet",
".",
"REMOVE_OPERATION",
",",
"name",
",",
"url",
")",
";",
"}"
] | remove a single url location for a name, if it exists
@param name
@param url
@throws IOException | [
"remove",
"a",
"single",
"url",
"location",
"for",
"a",
"name",
"if",
"it",
"exists"
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/resourcestore/locationdb/RemoteResourceFileLocationDB.java#L148-L151 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.getAward | public GitlabAward getAward(GitlabMergeRequest mergeRequest, Integer awardId) throws IOException {
"""
Get a specific award for a merge request
@param mergeRequest
@param awardId
@throws IOException on gitlab api call error
"""
String tailUrl = GitlabProject.URL + "/" + mergeRequest.getProjectId()... | java | public GitlabAward getAward(GitlabMergeRequest mergeRequest, Integer awardId) throws IOException {
String tailUrl = GitlabProject.URL + "/" + mergeRequest.getProjectId() + GitlabMergeRequest.URL + "/"
+ mergeRequest.getIid() + GitlabAward.URL + "/" + awardId;
return retrieve().to(tailUr... | [
"public",
"GitlabAward",
"getAward",
"(",
"GitlabMergeRequest",
"mergeRequest",
",",
"Integer",
"awardId",
")",
"throws",
"IOException",
"{",
"String",
"tailUrl",
"=",
"GitlabProject",
".",
"URL",
"+",
"\"/\"",
"+",
"mergeRequest",
".",
"getProjectId",
"(",
")",
... | Get a specific award for a merge request
@param mergeRequest
@param awardId
@throws IOException on gitlab api call error | [
"Get",
"a",
"specific",
"award",
"for",
"a",
"merge",
"request"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L3463-L3468 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java | Utils.readUrlContentQuietly | public static String readUrlContentQuietly( String url, Logger logger ) {
"""
Reads the content of an URL (assumed to be text content).
@param url an URL
@return a non-null string
@throws IOException
@throws URISyntaxException
"""
String result = "";
try {
result = readUrlContent( url );
} catch... | java | public static String readUrlContentQuietly( String url, Logger logger ) {
String result = "";
try {
result = readUrlContent( url );
} catch( Exception e ) {
logger.severe( "Content of URL " + url + " could not be read." );
logException( logger, e );
}
return result;
} | [
"public",
"static",
"String",
"readUrlContentQuietly",
"(",
"String",
"url",
",",
"Logger",
"logger",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"try",
"{",
"result",
"=",
"readUrlContent",
"(",
"url",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
... | Reads the content of an URL (assumed to be text content).
@param url an URL
@return a non-null string
@throws IOException
@throws URISyntaxException | [
"Reads",
"the",
"content",
"of",
"an",
"URL",
"(",
"assumed",
"to",
"be",
"text",
"content",
")",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java#L512-L524 |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/EntityGroupImpl.java | EntityGroupImpl.addChild | @Override
public void addChild(IGroupMember gm) throws GroupsException {
"""
Adds <code>IGroupMember</code> gm to our member <code>Map</code> and conversely, adds <code>
this</code> to gm's group <code>Map</code>, after checking that the addition does not violate
group rules. Remember that we have added it s... | java | @Override
public void addChild(IGroupMember gm) throws GroupsException {
try {
checkProspectiveMember(gm);
} catch (GroupsException ge) {
throw new GroupsException("Could not add IGroupMember", ge);
}
if (!this.contains(gm)) {
String cacheKey = g... | [
"@",
"Override",
"public",
"void",
"addChild",
"(",
"IGroupMember",
"gm",
")",
"throws",
"GroupsException",
"{",
"try",
"{",
"checkProspectiveMember",
"(",
"gm",
")",
";",
"}",
"catch",
"(",
"GroupsException",
"ge",
")",
"{",
"throw",
"new",
"GroupsException",... | Adds <code>IGroupMember</code> gm to our member <code>Map</code> and conversely, adds <code>
this</code> to gm's group <code>Map</code>, after checking that the addition does not violate
group rules. Remember that we have added it so we can update the database if necessary.
@param gm org.apereo.portal.groups.IGroupMem... | [
"Adds",
"<code",
">",
"IGroupMember<",
"/",
"code",
">",
"gm",
"to",
"our",
"member",
"<code",
">",
"Map<",
"/",
"code",
">",
"and",
"conversely",
"adds",
"<code",
">",
"this<",
"/",
"code",
">",
"to",
"gm",
"s",
"group",
"<code",
">",
"Map<",
"/",
... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/EntityGroupImpl.java#L90-L109 |
logic-ng/LogicNG | src/main/java/org/logicng/io/readers/FormulaReader.java | FormulaReader.readPseudoBooleanFormula | public static Formula readPseudoBooleanFormula(final File file, final FormulaFactory f) throws IOException, ParserException {
"""
Reads a given file and returns the contained pseudo-Boolean formula.
@param file the file
@param f the formula factory
@return the parsed formula
@throws IOException if there... | java | public static Formula readPseudoBooleanFormula(final File file, final FormulaFactory f) throws IOException, ParserException {
return read(file, new PseudoBooleanParser(f));
} | [
"public",
"static",
"Formula",
"readPseudoBooleanFormula",
"(",
"final",
"File",
"file",
",",
"final",
"FormulaFactory",
"f",
")",
"throws",
"IOException",
",",
"ParserException",
"{",
"return",
"read",
"(",
"file",
",",
"new",
"PseudoBooleanParser",
"(",
"f",
"... | Reads a given file and returns the contained pseudo-Boolean formula.
@param file the file
@param f the formula factory
@return the parsed formula
@throws IOException if there was a problem reading the file
@throws ParserException if there was a problem parsing the formula | [
"Reads",
"a",
"given",
"file",
"and",
"returns",
"the",
"contained",
"pseudo",
"-",
"Boolean",
"formula",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/io/readers/FormulaReader.java#L104-L106 |
opencb/biodata | biodata-tools/src/main/java/org/opencb/biodata/tools/variant/metadata/VariantMetadataUtils.java | VariantMetadataUtils.readVariantFileMetadata | public static VariantFileMetadata readVariantFileMetadata(VariantReader reader, VariantFileMetadata metadata) throws IOException {
"""
Reads the VariantSource from a Variant file given an initialized VariantReader
@param reader Initialized variant reader
@param metadata Optional metadata to fill up
@ret... | java | public static VariantFileMetadata readVariantFileMetadata(VariantReader reader, VariantFileMetadata metadata) throws IOException {
Objects.requireNonNull(reader);
if (metadata == null) {
metadata = new VariantFileMetadata("", "");
}
try {
reader.open();
... | [
"public",
"static",
"VariantFileMetadata",
"readVariantFileMetadata",
"(",
"VariantReader",
"reader",
",",
"VariantFileMetadata",
"metadata",
")",
"throws",
"IOException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"reader",
")",
";",
"if",
"(",
"metadata",
"==",
"... | Reads the VariantSource from a Variant file given an initialized VariantReader
@param reader Initialized variant reader
@param metadata Optional metadata to fill up
@return The read variant metadata
@throws IOException if an I/O error occurs | [
"Reads",
"the",
"VariantSource",
"from",
"a",
"Variant",
"file",
"given",
"an",
"initialized",
"VariantReader"
] | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/metadata/VariantMetadataUtils.java#L76-L95 |
JDBDT/jdbdt | src/main/java/org/jdbdt/DBSetup.java | DBSetup.deleteAll | static int deleteAll(CallInfo callInfo, Table table) {
"""
Delete all data from table.
@param callInfo Call info.
@param table Table.
@return Number of deleted rows.
"""
table.setDirtyStatus(true);
return doDeleteAll(callInfo, table);
} | java | static int deleteAll(CallInfo callInfo, Table table) {
table.setDirtyStatus(true);
return doDeleteAll(callInfo, table);
} | [
"static",
"int",
"deleteAll",
"(",
"CallInfo",
"callInfo",
",",
"Table",
"table",
")",
"{",
"table",
".",
"setDirtyStatus",
"(",
"true",
")",
";",
"return",
"doDeleteAll",
"(",
"callInfo",
",",
"table",
")",
";",
"}"
] | Delete all data from table.
@param callInfo Call info.
@param table Table.
@return Number of deleted rows. | [
"Delete",
"all",
"data",
"from",
"table",
"."
] | train | https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/DBSetup.java#L293-L296 |
mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/collection/WeakFastHashMap.java | WeakFastHashMap.putAll | @Override
public void putAll(Map<? extends K, ? extends V> in) {
"""
Copy all of the mappings from the specified map to this one, replacing
any mappings with the same keys.
@param in the map whose mappings are to be copied
"""
if (fast) {
synchronized (this) {
Ma... | java | @Override
public void putAll(Map<? extends K, ? extends V> in) {
if (fast) {
synchronized (this) {
Map<K, V> temp = cloneMap(map);
temp.putAll(in);
map = temp;
}
} else {
synchronized (map) {
... | [
"@",
"Override",
"public",
"void",
"putAll",
"(",
"Map",
"<",
"?",
"extends",
"K",
",",
"?",
"extends",
"V",
">",
"in",
")",
"{",
"if",
"(",
"fast",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"Map",
"<",
"K",
",",
"V",
">",
"temp",
"=",
... | Copy all of the mappings from the specified map to this one, replacing
any mappings with the same keys.
@param in the map whose mappings are to be copied | [
"Copy",
"all",
"of",
"the",
"mappings",
"from",
"the",
"specified",
"map",
"to",
"this",
"one",
"replacing",
"any",
"mappings",
"with",
"the",
"same",
"keys",
"."
] | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/collection/WeakFastHashMap.java#L382-L395 |
census-instrumentation/opencensus-java | api/src/main/java/io/opencensus/internal/Utils.java | Utils.format | private static String format(String template, @javax.annotation.Nullable Object... args) {
"""
Note that this is somewhat-improperly used from Verify.java as well.
"""
// If no arguments return the template.
if (args == null) {
return template;
}
// start substituting the arguments into ... | java | private static String format(String template, @javax.annotation.Nullable Object... args) {
// If no arguments return the template.
if (args == null) {
return template;
}
// start substituting the arguments into the '%s' placeholders
StringBuilder builder = new StringBuilder(template.length() ... | [
"private",
"static",
"String",
"format",
"(",
"String",
"template",
",",
"@",
"javax",
".",
"annotation",
".",
"Nullable",
"Object",
"...",
"args",
")",
"{",
"// If no arguments return the template.",
"if",
"(",
"args",
"==",
"null",
")",
"{",
"return",
"templ... | Note that this is somewhat-improperly used from Verify.java as well. | [
"Note",
"that",
"this",
"is",
"somewhat",
"-",
"improperly",
"used",
"from",
"Verify",
".",
"java",
"as",
"well",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/internal/Utils.java#L174-L207 |
google/closure-compiler | src/com/google/javascript/jscomp/PureFunctionIdentifier.java | PureFunctionIdentifier.collectCallableLeavesInternal | private static boolean collectCallableLeavesInternal(Node expr, ArrayList<Node> results) {
"""
Traverses an {@code expr} to collect nodes representing potential callables that it may resolve
to well known callables.
<p>For example:
<pre>
`a.c || b` => [a.c, b]
`x ? a.c : b` => [a.c, b]
`(function f() { }... | java | private static boolean collectCallableLeavesInternal(Node expr, ArrayList<Node> results) {
switch (expr.getToken()) {
case FUNCTION:
case GETPROP:
case NAME:
results.add(expr);
return true;
case SUPER:
{
// Pretend that `super` is an alias for the superclas... | [
"private",
"static",
"boolean",
"collectCallableLeavesInternal",
"(",
"Node",
"expr",
",",
"ArrayList",
"<",
"Node",
">",
"results",
")",
"{",
"switch",
"(",
"expr",
".",
"getToken",
"(",
")",
")",
"{",
"case",
"FUNCTION",
":",
"case",
"GETPROP",
":",
"cas... | Traverses an {@code expr} to collect nodes representing potential callables that it may resolve
to well known callables.
<p>For example:
<pre>
`a.c || b` => [a.c, b]
`x ? a.c : b` => [a.c, b]
`(function f() { }) && x || class Foo { constructor() { } }` => [function, x, constructor]`
</pre>
<p>This function is applic... | [
"Traverses",
"an",
"{",
"@code",
"expr",
"}",
"to",
"collect",
"nodes",
"representing",
"potential",
"callables",
"that",
"it",
"may",
"resolve",
"to",
"well",
"known",
"callables",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/PureFunctionIdentifier.java#L206-L259 |
vladmihalcea/flexy-pool | flexy-pool-core/src/main/java/com/vladmihalcea/flexypool/util/ReflectionUtils.java | ReflectionUtils.getMethod | public static Method getMethod(Object target, String methodName, Class... parameterTypes) {
"""
Get target method
@param target target object
@param methodName method name
@param parameterTypes method parameter types
@return return value
"""
try {
return target.getClass().... | java | public static Method getMethod(Object target, String methodName, Class... parameterTypes) {
try {
return target.getClass().getMethod(methodName, parameterTypes);
} catch (NoSuchMethodException e) {
throw handleException(methodName, e);
}
} | [
"public",
"static",
"Method",
"getMethod",
"(",
"Object",
"target",
",",
"String",
"methodName",
",",
"Class",
"...",
"parameterTypes",
")",
"{",
"try",
"{",
"return",
"target",
".",
"getClass",
"(",
")",
".",
"getMethod",
"(",
"methodName",
",",
"parameterT... | Get target method
@param target target object
@param methodName method name
@param parameterTypes method parameter types
@return return value | [
"Get",
"target",
"method"
] | train | https://github.com/vladmihalcea/flexy-pool/blob/d763d359e68299c2b4e28e4b67770581ae083431/flexy-pool-core/src/main/java/com/vladmihalcea/flexypool/util/ReflectionUtils.java#L76-L82 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobInfo.java | BlobInfo.newBuilder | public static Builder newBuilder(String bucket, String name, Long generation) {
"""
Returns a {@code BlobInfo} builder where blob identity is set using the provided values.
"""
return newBuilder(BlobId.of(bucket, name, generation));
} | java | public static Builder newBuilder(String bucket, String name, Long generation) {
return newBuilder(BlobId.of(bucket, name, generation));
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"String",
"bucket",
",",
"String",
"name",
",",
"Long",
"generation",
")",
"{",
"return",
"newBuilder",
"(",
"BlobId",
".",
"of",
"(",
"bucket",
",",
"name",
",",
"generation",
")",
")",
";",
"}"
] | Returns a {@code BlobInfo} builder where blob identity is set using the provided values. | [
"Returns",
"a",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobInfo.java#L1019-L1021 |
aol/cyclops | cyclops/src/main/java/cyclops/control/Future.java | Future.visitAsync | @Deprecated //use foldAsync
public <R> Future<R> visitAsync(Function<? super T,? extends R> success, Function<? super Throwable,? extends R> failure) {
"""
Non-blocking visit on the state of this Future
<pre>
{@code
Future.ofResult(10)
.visitAsync(i->i*2, e->-1);
Future[20]
Future.<Integer>ofError(ne... | java | @Deprecated //use foldAsync
public <R> Future<R> visitAsync(Function<? super T,? extends R> success, Function<? super Throwable,? extends R> failure){
return foldAsync(success,failure);
} | [
"@",
"Deprecated",
"//use foldAsync",
"public",
"<",
"R",
">",
"Future",
"<",
"R",
">",
"visitAsync",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"R",
">",
"success",
",",
"Function",
"<",
"?",
"super",
"Throwable",
",",
"?",
"extends... | Non-blocking visit on the state of this Future
<pre>
{@code
Future.ofResult(10)
.visitAsync(i->i*2, e->-1);
Future[20]
Future.<Integer>ofError(new RuntimeException())
.visitAsync(i->i*2, e->-1)
Future[-1]
}
</pre>
@param success Function to execute if the previous stage completes successfully
@param failure Functio... | [
"Non",
"-",
"blocking",
"visit",
"on",
"the",
"state",
"of",
"this",
"Future"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/control/Future.java#L761-L764 |
Red5/red5-server-common | src/main/java/org/red5/server/stream/RecordingListener.java | RecordingListener.getRecordFile | public static File getRecordFile(IScope scope, String name) {
"""
Get the file we'd be recording to based on scope and given name.
@param scope
scope
@param name
name
@return file
"""
// get stream filename generator
IStreamFilenameGenerator generator = (IStreamFilenameGenerator) Scope... | java | public static File getRecordFile(IScope scope, String name) {
// get stream filename generator
IStreamFilenameGenerator generator = (IStreamFilenameGenerator) ScopeUtils.getScopeService(scope, IStreamFilenameGenerator.class, DefaultStreamFilenameGenerator.class);
// generate filename
... | [
"public",
"static",
"File",
"getRecordFile",
"(",
"IScope",
"scope",
",",
"String",
"name",
")",
"{",
"// get stream filename generator\r",
"IStreamFilenameGenerator",
"generator",
"=",
"(",
"IStreamFilenameGenerator",
")",
"ScopeUtils",
".",
"getScopeService",
"(",
"sc... | Get the file we'd be recording to based on scope and given name.
@param scope
scope
@param name
name
@return file | [
"Get",
"the",
"file",
"we",
"d",
"be",
"recording",
"to",
"based",
"on",
"scope",
"and",
"given",
"name",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/RecordingListener.java#L110-L133 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/declarative/utils/DeclarativePipelineUtils.java | DeclarativePipelineUtils.saveBuildInfo | public static void saveBuildInfo(BuildInfo buildInfo, FilePath ws, Run build, Log logger) throws Exception {
"""
Save build info in @tmp/artifactory-pipeline-cache/build-number folder.
@param buildInfo - The build info object to save.
@param ws - Step's workspace.
@param build - Step's build.
"... | java | public static void saveBuildInfo(BuildInfo buildInfo, FilePath ws, Run build, Log logger) throws Exception {
String jobBuildNumber = BuildUniqueIdentifierHelper.getBuildNumber(build);
String buildInfoId = createBuildInfoId(build, buildInfo.getName(), buildInfo.getNumber());
BuildDataFile buildD... | [
"public",
"static",
"void",
"saveBuildInfo",
"(",
"BuildInfo",
"buildInfo",
",",
"FilePath",
"ws",
",",
"Run",
"build",
",",
"Log",
"logger",
")",
"throws",
"Exception",
"{",
"String",
"jobBuildNumber",
"=",
"BuildUniqueIdentifierHelper",
".",
"getBuildNumber",
"(... | Save build info in @tmp/artifactory-pipeline-cache/build-number folder.
@param buildInfo - The build info object to save.
@param ws - Step's workspace.
@param build - Step's build. | [
"Save",
"build",
"info",
"in",
"@tmp",
"/",
"artifactory",
"-",
"pipeline",
"-",
"cache",
"/",
"build",
"-",
"number",
"folder",
"."
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/declarative/utils/DeclarativePipelineUtils.java#L140-L147 |
skyscreamer/JSONassert | src/main/java/org/skyscreamer/jsonassert/comparator/AbstractComparator.java | AbstractComparator.compareJSON | @Override
public final JSONCompareResult compareJSON(JSONObject expected, JSONObject actual) throws JSONException {
"""
Compares JSONObject provided to the expected JSONObject, and returns the results of the comparison.
@param expected Expected JSONObject
@param actual JSONObject to compare
@throws JSON... | java | @Override
public final JSONCompareResult compareJSON(JSONObject expected, JSONObject actual) throws JSONException {
JSONCompareResult result = new JSONCompareResult();
compareJSON("", expected, actual, result);
return result;
} | [
"@",
"Override",
"public",
"final",
"JSONCompareResult",
"compareJSON",
"(",
"JSONObject",
"expected",
",",
"JSONObject",
"actual",
")",
"throws",
"JSONException",
"{",
"JSONCompareResult",
"result",
"=",
"new",
"JSONCompareResult",
"(",
")",
";",
"compareJSON",
"("... | Compares JSONObject provided to the expected JSONObject, and returns the results of the comparison.
@param expected Expected JSONObject
@param actual JSONObject to compare
@throws JSONException JSON parsing error | [
"Compares",
"JSONObject",
"provided",
"to",
"the",
"expected",
"JSONObject",
"and",
"returns",
"the",
"results",
"of",
"the",
"comparison",
"."
] | train | https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/comparator/AbstractComparator.java#L39-L44 |
alkacon/opencms-core | src/org/opencms/ui/apps/CmsFileExplorer.java | CmsFileExplorer.addTreeItem | private void addTreeItem(
CmsObject cms,
CmsResource resource,
CmsUUID parentId,
boolean disabled,
HierarchicalContainer container) {
"""
Adds an item to the folder tree.<p>
@param cms the cms context
@param resource the folder resource
@param parentId the parent folder... | java | private void addTreeItem(
CmsObject cms,
CmsResource resource,
CmsUUID parentId,
boolean disabled,
HierarchicalContainer container) {
CmsResourceUtil resUtil = new CmsResourceUtil(cms, resource);
Item resourceItem = container.getItem(resource.getStructureId());
... | [
"private",
"void",
"addTreeItem",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
",",
"CmsUUID",
"parentId",
",",
"boolean",
"disabled",
",",
"HierarchicalContainer",
"container",
")",
"{",
"CmsResourceUtil",
"resUtil",
"=",
"new",
"CmsResourceUtil",
"(",
... | Adds an item to the folder tree.<p>
@param cms the cms context
@param resource the folder resource
@param parentId the parent folder id
@param disabled in case the item is disabled, used for non visible parent folders
@param container the data container | [
"Adds",
"an",
"item",
"to",
"the",
"folder",
"tree",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/CmsFileExplorer.java#L1689-L1721 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Flowable.java | Flowable.toMap | @CheckReturnValue
@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
@SchedulerSupport(SchedulerSupport.NONE)
public final <K, V> Single<Map<K, V>> toMap(final Function<? super T, ? extends K> keySelector, final Function<? super T, ? extends V> valueSelector) {
"""
Returns a Single that emits a single... | java | @CheckReturnValue
@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
@SchedulerSupport(SchedulerSupport.NONE)
public final <K, V> Single<Map<K, V>> toMap(final Function<? super T, ? extends K> keySelector, final Function<? super T, ? extends V> valueSelector) {
ObjectHelper.requireNonNull(keySelect... | [
"@",
"CheckReturnValue",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"UNBOUNDED_IN",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"<",
"K",
",",
"V",
">",
"Single",
"<",
"Map",
"<",
"K",
",",
"V",
... | Returns a Single that emits a single HashMap containing values corresponding to items emitted by the
finite source Publisher, mapped by the keys returned by a specified {@code keySelector} function.
<p>
<img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toMap.png" alt=""... | [
"Returns",
"a",
"Single",
"that",
"emits",
"a",
"single",
"HashMap",
"containing",
"values",
"corresponding",
"to",
"items",
"emitted",
"by",
"the",
"finite",
"source",
"Publisher",
"mapped",
"by",
"the",
"keys",
"returned",
"by",
"a",
"specified",
"{",
"@code... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Flowable.java#L16610-L16617 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/servlet/job/impl/hibernate/PrintJobDao.java | PrintJobDao.getValue | public final Object getValue(final String id, final String property) {
"""
get specific property value of job.
@param id the id
@param property the property name/path
@return the property value
"""
final CriteriaBuilder builder = getSession().getCriteriaBuilder();
final CriteriaQuery<Objec... | java | public final Object getValue(final String id, final String property) {
final CriteriaBuilder builder = getSession().getCriteriaBuilder();
final CriteriaQuery<Object> criteria = builder.createQuery(Object.class);
final Root<PrintJobStatusExtImpl> root = criteria.from(PrintJobStatusExtImpl.class);... | [
"public",
"final",
"Object",
"getValue",
"(",
"final",
"String",
"id",
",",
"final",
"String",
"property",
")",
"{",
"final",
"CriteriaBuilder",
"builder",
"=",
"getSession",
"(",
")",
".",
"getCriteriaBuilder",
"(",
")",
";",
"final",
"CriteriaQuery",
"<",
... | get specific property value of job.
@param id the id
@param property the property name/path
@return the property value | [
"get",
"specific",
"property",
"value",
"of",
"job",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/servlet/job/impl/hibernate/PrintJobDao.java#L104-L111 |
codelibs/jcifs | src/main/java/jcifs/smb1/smb1/NtlmAuthenticator.java | NtlmAuthenticator.requestNtlmPasswordAuthentication | public static NtlmPasswordAuthentication
requestNtlmPasswordAuthentication( String url, SmbAuthException sae ) {
"""
Used internally by jCIFS when an <tt>SmbAuthException</tt> is trapped to retrieve new user credentials.
"""
if( auth == null ) {
return null;
}
... | java | public static NtlmPasswordAuthentication
requestNtlmPasswordAuthentication( String url, SmbAuthException sae ) {
if( auth == null ) {
return null;
}
synchronized( auth ) {
auth.url = url;
auth.sae = sae;
return auth.getNtlmPasswordA... | [
"public",
"static",
"NtlmPasswordAuthentication",
"requestNtlmPasswordAuthentication",
"(",
"String",
"url",
",",
"SmbAuthException",
"sae",
")",
"{",
"if",
"(",
"auth",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"synchronized",
"(",
"auth",
")",
"{",
... | Used internally by jCIFS when an <tt>SmbAuthException</tt> is trapped to retrieve new user credentials. | [
"Used",
"internally",
"by",
"jCIFS",
"when",
"an",
"<tt",
">",
"SmbAuthException<",
"/",
"tt",
">",
"is",
"trapped",
"to",
"retrieve",
"new",
"user",
"credentials",
"."
] | train | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/smb1/NtlmAuthenticator.java#L59-L69 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/media/MediaClient.java | MediaClient.getMediaInfoOfFile | public GetMediaInfoOfFileResponse getMediaInfoOfFile(String bucket, String key) {
"""
Retrieve the media information of an object in Bos bucket.
@param bucket The bucket name of Bos object which you want to read.
@param key The key name of Bos object which your want to read.
@return The media informati... | java | public GetMediaInfoOfFileResponse getMediaInfoOfFile(String bucket, String key) {
GetMediaInfoOfFileRequest request = new GetMediaInfoOfFileRequest();
request.setBucket(bucket);
request.setKey(key);
return getMediaInfoOfFile(request);
} | [
"public",
"GetMediaInfoOfFileResponse",
"getMediaInfoOfFile",
"(",
"String",
"bucket",
",",
"String",
"key",
")",
"{",
"GetMediaInfoOfFileRequest",
"request",
"=",
"new",
"GetMediaInfoOfFileRequest",
"(",
")",
";",
"request",
".",
"setBucket",
"(",
"bucket",
")",
";... | Retrieve the media information of an object in Bos bucket.
@param bucket The bucket name of Bos object which you want to read.
@param key The key name of Bos object which your want to read.
@return The media information of an object in Bos bucket. | [
"Retrieve",
"the",
"media",
"information",
"of",
"an",
"object",
"in",
"Bos",
"bucket",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/media/MediaClient.java#L1001-L1006 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/feature/Feature.java | Feature.setShortAttribute | public void setShortAttribute(String name, Short value) {
"""
Set attribute value of given type.
@param name attribute name
@param value attribute value
"""
Attribute attribute = getAttributes().get(name);
if (!(attribute instanceof ShortAttribute)) {
throw new IllegalStateException("Cannot set shor... | java | public void setShortAttribute(String name, Short value) {
Attribute attribute = getAttributes().get(name);
if (!(attribute instanceof ShortAttribute)) {
throw new IllegalStateException("Cannot set short value on attribute with different type, " +
attribute.getClass().getName() + " setting value " + value);
... | [
"public",
"void",
"setShortAttribute",
"(",
"String",
"name",
",",
"Short",
"value",
")",
"{",
"Attribute",
"attribute",
"=",
"getAttributes",
"(",
")",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"!",
"(",
"attribute",
"instanceof",
"ShortAttribute",
")... | Set attribute value of given type.
@param name attribute name
@param value attribute value | [
"Set",
"attribute",
"value",
"of",
"given",
"type",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/feature/Feature.java#L335-L342 |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/ds/DsParser.java | DsParser.storeRecovery | @Override
protected void storeRecovery(Recovery r, XMLStreamWriter writer) throws Exception {
"""
Store recovery
@param r The recovery
@param writer The writer
@exception Exception Thrown if an error occurs
"""
writer.writeStartElement(XML.ELEMENT_RECOVERY);
if (r.isNoRecovery() != null)
... | java | @Override
protected void storeRecovery(Recovery r, XMLStreamWriter writer) throws Exception
{
writer.writeStartElement(XML.ELEMENT_RECOVERY);
if (r.isNoRecovery() != null)
writer.writeAttribute(XML.ATTRIBUTE_NO_RECOVERY,
r.getValue(XML.ATTRIBUTE_NO_RECOVERY, r.... | [
"@",
"Override",
"protected",
"void",
"storeRecovery",
"(",
"Recovery",
"r",
",",
"XMLStreamWriter",
"writer",
")",
"throws",
"Exception",
"{",
"writer",
".",
"writeStartElement",
"(",
"XML",
".",
"ELEMENT_RECOVERY",
")",
";",
"if",
"(",
"r",
".",
"isNoRecover... | Store recovery
@param r The recovery
@param writer The writer
@exception Exception Thrown if an error occurs | [
"Store",
"recovery"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/ds/DsParser.java#L2129-L2171 |
azkaban/azkaban | az-core/src/main/java/azkaban/utils/PropsUtils.java | PropsUtils.loadPropsInDirs | public static Props loadPropsInDirs(final List<File> dirs, final String... suffixes) {
"""
Load job schedules from the given directories
@param dirs The directories to check for properties
@param suffixes The suffixes to load
@return The properties
"""
final Props props = new Props();
for (final F... | java | public static Props loadPropsInDirs(final List<File> dirs, final String... suffixes) {
final Props props = new Props();
for (final File dir : dirs) {
props.putLocal(loadPropsInDir(dir, suffixes));
}
return props;
} | [
"public",
"static",
"Props",
"loadPropsInDirs",
"(",
"final",
"List",
"<",
"File",
">",
"dirs",
",",
"final",
"String",
"...",
"suffixes",
")",
"{",
"final",
"Props",
"props",
"=",
"new",
"Props",
"(",
")",
";",
"for",
"(",
"final",
"File",
"dir",
":",... | Load job schedules from the given directories
@param dirs The directories to check for properties
@param suffixes The suffixes to load
@return The properties | [
"Load",
"job",
"schedules",
"from",
"the",
"given",
"directories"
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/PropsUtils.java#L160-L166 |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/util/ObjectUtils.java | ObjectUtils.toObject | @SafeVarargs
private static <T> Object toObject( T value, Function<T,Object>... converters) {
"""
Returns the first non-null object produced by the given converters.
Returns null if no such object found.
"""
return
Stream.of( converters)
.map( converter -> converter.apply( value))
.fil... | java | @SafeVarargs
private static <T> Object toObject( T value, Function<T,Object>... converters)
{
return
Stream.of( converters)
.map( converter -> converter.apply( value))
.filter( Objects::nonNull)
.findFirst()
.orElse( null);
} | [
"@",
"SafeVarargs",
"private",
"static",
"<",
"T",
">",
"Object",
"toObject",
"(",
"T",
"value",
",",
"Function",
"<",
"T",
",",
"Object",
">",
"...",
"converters",
")",
"{",
"return",
"Stream",
".",
"of",
"(",
"converters",
")",
".",
"map",
"(",
"co... | Returns the first non-null object produced by the given converters.
Returns null if no such object found. | [
"Returns",
"the",
"first",
"non",
"-",
"null",
"object",
"produced",
"by",
"the",
"given",
"converters",
".",
"Returns",
"null",
"if",
"no",
"such",
"object",
"found",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/util/ObjectUtils.java#L56-L65 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java | UCharacter.toTitleCase | public static String toTitleCase(String str, BreakIterator breakiter) {
"""
<p>Returns the titlecase version of the argument string.
<p>Position for titlecasing is determined by the argument break
iterator, hence the user can customize his break iterator for
a specialized titlecasing. In this case only the forw... | java | public static String toTitleCase(String str, BreakIterator breakiter)
{
return toTitleCase(Locale.getDefault(), str, breakiter, 0);
} | [
"public",
"static",
"String",
"toTitleCase",
"(",
"String",
"str",
",",
"BreakIterator",
"breakiter",
")",
"{",
"return",
"toTitleCase",
"(",
"Locale",
".",
"getDefault",
"(",
")",
",",
"str",
",",
"breakiter",
",",
"0",
")",
";",
"}"
] | <p>Returns the titlecase version of the argument string.
<p>Position for titlecasing is determined by the argument break
iterator, hence the user can customize his break iterator for
a specialized titlecasing. In this case only the forward iteration
needs to be implemented.
If the break iterator passed in is null, the ... | [
"<p",
">",
"Returns",
"the",
"titlecase",
"version",
"of",
"the",
"argument",
"string",
".",
"<p",
">",
"Position",
"for",
"titlecasing",
"is",
"determined",
"by",
"the",
"argument",
"break",
"iterator",
"hence",
"the",
"user",
"can",
"customize",
"his",
"br... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java#L4310-L4313 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/MapTileApproximater.java | MapTileApproximater.approximateTileFromLowerZoom | public Bitmap approximateTileFromLowerZoom(final long pMapTileIndex, final int pZoomDiff) {
"""
Approximate a tile from a lower zoom level
@since 6.0.0
@param pMapTileIndex Destination tile, for the same place on the planet as the source, but on a higher zoom
@param pZoomDiff Zoom level difference between the... | java | public Bitmap approximateTileFromLowerZoom(final long pMapTileIndex, final int pZoomDiff) {
for (final MapTileModuleProviderBase provider : mProviders) {
final Bitmap bitmap = approximateTileFromLowerZoom(provider, pMapTileIndex, pZoomDiff);
if (bitmap != null) {
return b... | [
"public",
"Bitmap",
"approximateTileFromLowerZoom",
"(",
"final",
"long",
"pMapTileIndex",
",",
"final",
"int",
"pZoomDiff",
")",
"{",
"for",
"(",
"final",
"MapTileModuleProviderBase",
"provider",
":",
"mProviders",
")",
"{",
"final",
"Bitmap",
"bitmap",
"=",
"app... | Approximate a tile from a lower zoom level
@since 6.0.0
@param pMapTileIndex Destination tile, for the same place on the planet as the source, but on a higher zoom
@param pZoomDiff Zoom level difference between the destination and the source; strictly positive
@return | [
"Approximate",
"a",
"tile",
"from",
"a",
"lower",
"zoom",
"level"
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/MapTileApproximater.java#L147-L155 |
alkacon/opencms-core | src/org/opencms/jsp/search/result/CmsSearchResultWrapper.java | CmsSearchResultWrapper.convertSearchResults | protected void convertSearchResults(final Collection<CmsSearchResource> searchResults) {
"""
Converts the search results from CmsSearchResource to CmsSearchResourceBean.
@param searchResults The collection of search results to transform.
"""
m_foundResources = new ArrayList<I_CmsSearchResourceBean>()... | java | protected void convertSearchResults(final Collection<CmsSearchResource> searchResults) {
m_foundResources = new ArrayList<I_CmsSearchResourceBean>();
for (final CmsSearchResource searchResult : searchResults) {
m_foundResources.add(new CmsSearchResourceBean(searchResult, m_cmsObject));
... | [
"protected",
"void",
"convertSearchResults",
"(",
"final",
"Collection",
"<",
"CmsSearchResource",
">",
"searchResults",
")",
"{",
"m_foundResources",
"=",
"new",
"ArrayList",
"<",
"I_CmsSearchResourceBean",
">",
"(",
")",
";",
"for",
"(",
"final",
"CmsSearchResourc... | Converts the search results from CmsSearchResource to CmsSearchResourceBean.
@param searchResults The collection of search results to transform. | [
"Converts",
"the",
"search",
"results",
"from",
"CmsSearchResource",
"to",
"CmsSearchResourceBean",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/result/CmsSearchResultWrapper.java#L487-L493 |
selenide/selenide | src/main/java/com/codeborne/selenide/proxy/SelenideProxyServer.java | SelenideProxyServer.addResponseFilter | public void addResponseFilter(String name, ResponseFilter responseFilter) {
"""
Add a custom response filter which allows to track/modify all server responses to browser
@param name unique name of filter
@param responseFilter the filter
"""
if (responseFilters.containsKey(name)) {
throw new Illeg... | java | public void addResponseFilter(String name, ResponseFilter responseFilter) {
if (responseFilters.containsKey(name)) {
throw new IllegalArgumentException("Duplicate response filter: " + name);
}
proxy.addResponseFilter(responseFilter);
responseFilters.put(name, responseFilter);
} | [
"public",
"void",
"addResponseFilter",
"(",
"String",
"name",
",",
"ResponseFilter",
"responseFilter",
")",
"{",
"if",
"(",
"responseFilters",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Duplicate response filt... | Add a custom response filter which allows to track/modify all server responses to browser
@param name unique name of filter
@param responseFilter the filter | [
"Add",
"a",
"custom",
"response",
"filter",
"which",
"allows",
"to",
"track",
"/",
"modify",
"all",
"server",
"responses",
"to",
"browser"
] | train | https://github.com/selenide/selenide/blob/b867baf171942cf07725d83a985237428569883f/src/main/java/com/codeborne/selenide/proxy/SelenideProxyServer.java#L96-L102 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java | EmbeddedGobblin.distributeJarWithPriority | public synchronized EmbeddedGobblin distributeJarWithPriority(String jarPath, int priority) {
"""
Specify that the input jar should be added to workers' classpath on distributed mode. Jars with lower priority value
will appear first in the classpath. Default priority is 0.
"""
if (this.distributedJars.con... | java | public synchronized EmbeddedGobblin distributeJarWithPriority(String jarPath, int priority) {
if (this.distributedJars.containsKey(jarPath)) {
this.distributedJars.put(jarPath, Math.min(priority, this.distributedJars.get(jarPath)));
} else {
this.distributedJars.put(jarPath, priority);
}
ret... | [
"public",
"synchronized",
"EmbeddedGobblin",
"distributeJarWithPriority",
"(",
"String",
"jarPath",
",",
"int",
"priority",
")",
"{",
"if",
"(",
"this",
".",
"distributedJars",
".",
"containsKey",
"(",
"jarPath",
")",
")",
"{",
"this",
".",
"distributedJars",
".... | Specify that the input jar should be added to workers' classpath on distributed mode. Jars with lower priority value
will appear first in the classpath. Default priority is 0. | [
"Specify",
"that",
"the",
"input",
"jar",
"should",
"be",
"added",
"to",
"workers",
"classpath",
"on",
"distributed",
"mode",
".",
"Jars",
"with",
"lower",
"priority",
"value",
"will",
"appear",
"first",
"in",
"the",
"classpath",
".",
"Default",
"priority",
... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java#L215-L222 |
SG-O/miIO | src/main/java/de/sg_o/app/miio/vacuum/Vacuum.java | Vacuum.cleanArea | public boolean cleanArea(float x0, float y0, float x1, float y1, int passes) throws CommandExecutionException {
"""
Clean the specified area on the map.
@param x0 The x position of the first point defining the area in meters. 25.6 meters is the center of the map.
@param y0 The y position of the first point defin... | java | public boolean cleanArea(float x0, float y0, float x1, float y1, int passes) throws CommandExecutionException {
float t;
if (x0 > x1) {
t = x0;
x0 = x1;
x1 = t;
}
if (y0 > y1) {
t = y0;
y0 = y1;
y1 = t;
}
... | [
"public",
"boolean",
"cleanArea",
"(",
"float",
"x0",
",",
"float",
"y0",
",",
"float",
"x1",
",",
"float",
"y1",
",",
"int",
"passes",
")",
"throws",
"CommandExecutionException",
"{",
"float",
"t",
";",
"if",
"(",
"x0",
">",
"x1",
")",
"{",
"t",
"="... | Clean the specified area on the map.
@param x0 The x position of the first point defining the area in meters. 25.6 meters is the center of the map.
@param y0 The y position of the first point defining the area in meters. 25.6 meters is the center of the map.
@param x1 The x position of the second point defining the are... | [
"Clean",
"the",
"specified",
"area",
"on",
"the",
"map",
"."
] | train | https://github.com/SG-O/miIO/blob/f352dbd2a699d2cdb1b412ca5e6cbb0c38ca779b/src/main/java/de/sg_o/app/miio/vacuum/Vacuum.java#L336-L353 |
VoltDB/voltdb | examples/voter/client/voter/JDBCBenchmark.java | JDBCBenchmark.runBenchmark | public void runBenchmark() throws Exception {
"""
Core benchmark code. Connect. Initialize. Run the loop. Cleanup. Print
Results.
@throws Exception
if anything unexpected happens.
"""
System.out.print(HORIZONTAL_RULE);
System.out.println(" Setup & Initialization");
System.out.print... | java | public void runBenchmark() throws Exception {
System.out.print(HORIZONTAL_RULE);
System.out.println(" Setup & Initialization");
System.out.println(HORIZONTAL_RULE);
// connect to one or more servers, loop until success
connect(config.servers);
// initialize using synchr... | [
"public",
"void",
"runBenchmark",
"(",
")",
"throws",
"Exception",
"{",
"System",
".",
"out",
".",
"print",
"(",
"HORIZONTAL_RULE",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\" Setup & Initialization\"",
")",
";",
"System",
".",
"out",
".",
"pr... | Core benchmark code. Connect. Initialize. Run the loop. Cleanup. Print
Results.
@throws Exception
if anything unexpected happens. | [
"Core",
"benchmark",
"code",
".",
"Connect",
".",
"Initialize",
".",
"Run",
"the",
"loop",
".",
"Cleanup",
".",
"Print",
"Results",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/examples/voter/client/voter/JDBCBenchmark.java#L391-L457 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jpa.container/src/com/ibm/ws/jpa/container/osgi/internal/JPAComponentImpl.java | JPAComponentImpl.processEJBModulePersistenceXml | private void processEJBModulePersistenceXml(JPAApplInfo applInfo, ContainerInfo module, ClassLoader appClassloader) {
"""
Locates and processes persistence.xml file in an EJB module. <p>
@param applInfo the application archive information
@param module the EJB module archive information
"""
final... | java | private void processEJBModulePersistenceXml(JPAApplInfo applInfo, ContainerInfo module, ClassLoader appClassloader) {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "processEJBModulePersistenceXml : " + applInfo.getApplName(... | [
"private",
"void",
"processEJBModulePersistenceXml",
"(",
"JPAApplInfo",
"applInfo",
",",
"ContainerInfo",
"module",
",",
"ClassLoader",
"appClassloader",
")",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if"... | Locates and processes persistence.xml file in an EJB module. <p>
@param applInfo the application archive information
@param module the EJB module archive information | [
"Locates",
"and",
"processes",
"persistence",
".",
"xml",
"file",
"in",
"an",
"EJB",
"module",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container/src/com/ibm/ws/jpa/container/osgi/internal/JPAComponentImpl.java#L540-L572 |
ironjacamar/ironjacamar | web/src/main/java/org/ironjacamar/web/SecurityActions.java | SecurityActions.setSystemProperty | static void setSystemProperty(final String name, final String value) {
"""
Set a system property
@param name The property name
@param value The property value
"""
AccessController.doPrivileged(new PrivilegedAction<Boolean>()
{
public Boolean run()
{
System.setProper... | java | static void setSystemProperty(final String name, final String value)
{
AccessController.doPrivileged(new PrivilegedAction<Boolean>()
{
public Boolean run()
{
System.setProperty(name, value);
return Boolean.TRUE;
}
});
} | [
"static",
"void",
"setSystemProperty",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"{",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"Boolean",
">",
"(",
")",
"{",
"public",
"Boolean",
"run",
"(",
")... | Set a system property
@param name The property name
@param value The property value | [
"Set",
"a",
"system",
"property"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/web/src/main/java/org/ironjacamar/web/SecurityActions.java#L100-L110 |
kiegroup/drools | drools-beliefs/src/main/java/org/drools/beliefs/bayes/JunctionTreeBuilder.java | JunctionTreeBuilder.mapVarNodeToCliques | public void mapVarNodeToCliques(OpenBitSet[] nodeToCliques, int id, OpenBitSet clique) {
"""
Maps each Bayes node to cliques it's in.
It uses a BitSet to map the ID of the cliques
@param nodeToCliques
@param id
@param clique
"""
for ( int i = clique.nextSetBit(0); i >= 0; i = clique.nextSetBit( i +... | java | public void mapVarNodeToCliques(OpenBitSet[] nodeToCliques, int id, OpenBitSet clique) {
for ( int i = clique.nextSetBit(0); i >= 0; i = clique.nextSetBit( i + 1 ) ) {
OpenBitSet cliques = nodeToCliques[i];
if ( cliques == null ) {
cliques = new OpenBitSet();
... | [
"public",
"void",
"mapVarNodeToCliques",
"(",
"OpenBitSet",
"[",
"]",
"nodeToCliques",
",",
"int",
"id",
",",
"OpenBitSet",
"clique",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"clique",
".",
"nextSetBit",
"(",
"0",
")",
";",
"i",
">=",
"0",
";",
"i",
"=... | Maps each Bayes node to cliques it's in.
It uses a BitSet to map the ID of the cliques
@param nodeToCliques
@param id
@param clique | [
"Maps",
"each",
"Bayes",
"node",
"to",
"cliques",
"it",
"s",
"in",
".",
"It",
"uses",
"a",
"BitSet",
"to",
"map",
"the",
"ID",
"of",
"the",
"cliques"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-beliefs/src/main/java/org/drools/beliefs/bayes/JunctionTreeBuilder.java#L381-L390 |
google/closure-compiler | src/com/google/javascript/jscomp/CreateSyntheticBlocks.java | CreateSyntheticBlocks.moveSiblingExclusive | private void moveSiblingExclusive(Node dest, Node start, Node end) {
"""
Move the Nodes between start and end from the source block to the
destination block. If start is null, move the first child of the block.
If end is null, move the last child of the block.
"""
checkNotNull(start);
checkNotNull(en... | java | private void moveSiblingExclusive(Node dest, Node start, Node end) {
checkNotNull(start);
checkNotNull(end);
while (start.getNext() != end) {
Node child = start.getNext().detach();
dest.addChildToBack(child);
}
} | [
"private",
"void",
"moveSiblingExclusive",
"(",
"Node",
"dest",
",",
"Node",
"start",
",",
"Node",
"end",
")",
"{",
"checkNotNull",
"(",
"start",
")",
";",
"checkNotNull",
"(",
"end",
")",
";",
"while",
"(",
"start",
".",
"getNext",
"(",
")",
"!=",
"en... | Move the Nodes between start and end from the source block to the
destination block. If start is null, move the first child of the block.
If end is null, move the last child of the block. | [
"Move",
"the",
"Nodes",
"between",
"start",
"and",
"end",
"from",
"the",
"source",
"block",
"to",
"the",
"destination",
"block",
".",
"If",
"start",
"is",
"null",
"move",
"the",
"first",
"child",
"of",
"the",
"block",
".",
"If",
"end",
"is",
"null",
"m... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CreateSyntheticBlocks.java#L133-L140 |
logic-ng/LogicNG | src/main/java/org/logicng/solvers/MaxSATSolver.java | MaxSATSolver.addCNF | private void addCNF(final Formula formula, int weight) {
"""
Adds a formula which is already in CNF to the solver.
@param formula the formula in CNF
@param weight the weight of this CNF (or -1 for a hard constraint)
"""
switch (formula.type()) {
case TRUE:
break;
case FALSE:
ca... | java | private void addCNF(final Formula formula, int weight) {
switch (formula.type()) {
case TRUE:
break;
case FALSE:
case LITERAL:
case OR:
this.addClause(formula, weight);
break;
case AND:
for (Formula op : formula)
this.addClause(op, weight);
... | [
"private",
"void",
"addCNF",
"(",
"final",
"Formula",
"formula",
",",
"int",
"weight",
")",
"{",
"switch",
"(",
"formula",
".",
"type",
"(",
")",
")",
"{",
"case",
"TRUE",
":",
"break",
";",
"case",
"FALSE",
":",
"case",
"LITERAL",
":",
"case",
"OR",... | Adds a formula which is already in CNF to the solver.
@param formula the formula in CNF
@param weight the weight of this CNF (or -1 for a hard constraint) | [
"Adds",
"a",
"formula",
"which",
"is",
"already",
"in",
"CNF",
"to",
"the",
"solver",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/MaxSATSolver.java#L247-L263 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/MetadataFinder.java | MetadataFinder.deliverCacheUpdate | private void deliverCacheUpdate(SlotReference slot, MetadataCache cache) {
"""
Send a metadata cache update announcement to all registered listeners.
@param slot the media slot whose cache status has changed
@param cache the cache which has been attached, or, if {@code null}, the previous cache has been detach... | java | private void deliverCacheUpdate(SlotReference slot, MetadataCache cache) {
for (final MetadataCacheListener listener : getCacheListeners()) {
try {
if (cache == null) {
listener.cacheDetached(slot);
} else {
listener.cacheAttach... | [
"private",
"void",
"deliverCacheUpdate",
"(",
"SlotReference",
"slot",
",",
"MetadataCache",
"cache",
")",
"{",
"for",
"(",
"final",
"MetadataCacheListener",
"listener",
":",
"getCacheListeners",
"(",
")",
")",
"{",
"try",
"{",
"if",
"(",
"cache",
"==",
"null"... | Send a metadata cache update announcement to all registered listeners.
@param slot the media slot whose cache status has changed
@param cache the cache which has been attached, or, if {@code null}, the previous cache has been detached | [
"Send",
"a",
"metadata",
"cache",
"update",
"announcement",
"to",
"all",
"registered",
"listeners",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/MetadataFinder.java#L952-L964 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java | PropertyInfo.getPropertyValue | public Object getPropertyValue(Object instance, boolean forceDirect) {
"""
Returns the property value for a specified object instance.
@param instance The object instance.
@param forceDirect If true, a forces a direct read on the instance even if it implements
IPropertyAccessor
@return The object's property ... | java | public Object getPropertyValue(Object instance, boolean forceDirect) {
try {
if (instance == null) {
return dflt == null || !isSerializable() ? null : getPropertyType().getSerializer().deserialize(dflt);
}
if (!forceDirect && instance instanceof I... | [
"public",
"Object",
"getPropertyValue",
"(",
"Object",
"instance",
",",
"boolean",
"forceDirect",
")",
"{",
"try",
"{",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"return",
"dflt",
"==",
"null",
"||",
"!",
"isSerializable",
"(",
")",
"?",
"null",
":"... | Returns the property value for a specified object instance.
@param instance The object instance.
@param forceDirect If true, a forces a direct read on the instance even if it implements
IPropertyAccessor
@return The object's property value. | [
"Returns",
"the",
"property",
"value",
"for",
"a",
"specified",
"object",
"instance",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java#L188-L203 |
finmath/finmath-lib | src/main/java6/net/finmath/montecarlo/interestrate/modelplugins/AbstractLIBORCovarianceModel.java | AbstractLIBORCovarianceModel.getCovariance | public RandomVariableInterface getCovariance(int timeIndex, int component1, int component2, RandomVariableInterface[] realizationAtTimeIndex) {
"""
Returns the instantaneous covariance calculated from factor loadings.
@param timeIndex The time index at which covariance is requested.
@param component1 Index of ... | java | public RandomVariableInterface getCovariance(int timeIndex, int component1, int component2, RandomVariableInterface[] realizationAtTimeIndex) {
RandomVariableInterface[] factorLoadingOfComponent1 = getFactorLoading(timeIndex, component1, realizationAtTimeIndex);
RandomVariableInterface[] factorLoadingOfComponent2 ... | [
"public",
"RandomVariableInterface",
"getCovariance",
"(",
"int",
"timeIndex",
",",
"int",
"component1",
",",
"int",
"component2",
",",
"RandomVariableInterface",
"[",
"]",
"realizationAtTimeIndex",
")",
"{",
"RandomVariableInterface",
"[",
"]",
"factorLoadingOfComponent1... | Returns the instantaneous covariance calculated from factor loadings.
@param timeIndex The time index at which covariance is requested.
@param component1 Index of component <i>i</i>.
@param component2 Index of component <i>j</i>.
@param realizationAtTimeIndex The realization of the stochastic process.
@return The ins... | [
"Returns",
"the",
"instantaneous",
"covariance",
"calculated",
"from",
"factor",
"loadings",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/montecarlo/interestrate/modelplugins/AbstractLIBORCovarianceModel.java#L145-L159 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.loadClusterConfiguration | private static AlluxioConfiguration loadClusterConfiguration(GetConfigurationPResponse response,
AlluxioConfiguration conf) {
"""
Loads the cluster level configuration from the get configuration response, and merges it with
the existing configuration.
@param response the get configuration RPC response
@... | java | private static AlluxioConfiguration loadClusterConfiguration(GetConfigurationPResponse response,
AlluxioConfiguration conf) {
String clientVersion = conf.get(PropertyKey.VERSION);
LOG.info("Alluxio client (version {}) is trying to load cluster level configurations",
clientVersion);
List<alluxi... | [
"private",
"static",
"AlluxioConfiguration",
"loadClusterConfiguration",
"(",
"GetConfigurationPResponse",
"response",
",",
"AlluxioConfiguration",
"conf",
")",
"{",
"String",
"clientVersion",
"=",
"conf",
".",
"get",
"(",
"PropertyKey",
".",
"VERSION",
")",
";",
"LOG... | Loads the cluster level configuration from the get configuration response, and merges it with
the existing configuration.
@param response the get configuration RPC response
@param conf the existing configuration
@return the merged configuration | [
"Loads",
"the",
"cluster",
"level",
"configuration",
"from",
"the",
"get",
"configuration",
"response",
"and",
"merges",
"it",
"with",
"the",
"existing",
"configuration",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L535-L558 |
lucee/Lucee | core/src/main/java/lucee/runtime/schedule/StorageUtil.java | StorageUtil.toCredentials | public Credentials toCredentials(Element el, String attributeUser, String attributePassword, Credentials defaultCredentials) {
"""
reads 2 XML Element Attribute ans cast it to a Credential
@param el XML Element to read Attribute from it
@param attributeUser Name of the user Attribute to read
@param attributeP... | java | public Credentials toCredentials(Element el, String attributeUser, String attributePassword, Credentials defaultCredentials) {
String user = el.getAttribute(attributeUser);
String pass = el.getAttribute(attributePassword);
if (user == null) return defaultCredentials;
if (pass == null) pass = "";
return Credentials... | [
"public",
"Credentials",
"toCredentials",
"(",
"Element",
"el",
",",
"String",
"attributeUser",
",",
"String",
"attributePassword",
",",
"Credentials",
"defaultCredentials",
")",
"{",
"String",
"user",
"=",
"el",
".",
"getAttribute",
"(",
"attributeUser",
")",
";"... | reads 2 XML Element Attribute ans cast it to a Credential
@param el XML Element to read Attribute from it
@param attributeUser Name of the user Attribute to read
@param attributePassword Name of the password Attribute to read
@param defaultCredentials
@return Attribute Value | [
"reads",
"2",
"XML",
"Element",
"Attribute",
"ans",
"cast",
"it",
"to",
"a",
"Credential"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/schedule/StorageUtil.java#L342-L348 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManagerServiceImpl.java | ConnectionManagerServiceImpl.getCMConfigData | private final CMConfigData getCMConfigData(AbstractConnectionFactoryService cfSvc, ResourceInfo refInfo) {
"""
Construct the CMConfigData, including properties from the resource reference, if applicable.
@param cfSvc connection factory service
@param ref resource reference.
@return com.ibm.ejs.j2c.CMConfigDat... | java | private final CMConfigData getCMConfigData(AbstractConnectionFactoryService cfSvc, ResourceInfo refInfo) {
final boolean trace = TraceComponent.isAnyTracingEnabled();
if (trace && tc.isEntryEnabled())
Tr.entry(this, tc, "getCMConfigData");
// Defaults for direct lookup
int a... | [
"private",
"final",
"CMConfigData",
"getCMConfigData",
"(",
"AbstractConnectionFactoryService",
"cfSvc",
",",
"ResourceInfo",
"refInfo",
")",
"{",
"final",
"boolean",
"trace",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"trace",
"&&"... | Construct the CMConfigData, including properties from the resource reference, if applicable.
@param cfSvc connection factory service
@param ref resource reference.
@return com.ibm.ejs.j2c.CMConfigData | [
"Construct",
"the",
"CMConfigData",
"including",
"properties",
"from",
"the",
"resource",
"reference",
"if",
"applicable",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManagerServiceImpl.java#L288-L330 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/EnvelopesApi.java | EnvelopesApi.getConsumerDisclosureDefault | public ConsumerDisclosure getConsumerDisclosureDefault(String accountId, String envelopeId, String recipientId) throws ApiException {
"""
Gets the Electronic Record and Signature Disclosure associated with the account.
Retrieves the Electronic Record and Signature Disclosure, with html formatting, associated with... | java | public ConsumerDisclosure getConsumerDisclosureDefault(String accountId, String envelopeId, String recipientId) throws ApiException {
return getConsumerDisclosureDefault(accountId, envelopeId, recipientId, null);
} | [
"public",
"ConsumerDisclosure",
"getConsumerDisclosureDefault",
"(",
"String",
"accountId",
",",
"String",
"envelopeId",
",",
"String",
"recipientId",
")",
"throws",
"ApiException",
"{",
"return",
"getConsumerDisclosureDefault",
"(",
"accountId",
",",
"envelopeId",
",",
... | Gets the Electronic Record and Signature Disclosure associated with the account.
Retrieves the Electronic Record and Signature Disclosure, with html formatting, associated with the account. You can use an optional query string to set the language for the disclosure.
@param accountId The external account number (int) or... | [
"Gets",
"the",
"Electronic",
"Record",
"and",
"Signature",
"Disclosure",
"associated",
"with",
"the",
"account",
".",
"Retrieves",
"the",
"Electronic",
"Record",
"and",
"Signature",
"Disclosure",
"with",
"html",
"formatting",
"associated",
"with",
"the",
"account",
... | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/EnvelopesApi.java#L2062-L2064 |
Samsung/GearVRf | GVRf/Extensions/gvrf-physics/src/main/java/org/gearvrf/physics/GVRRigidBody.java | GVRRigidBody.setLinearVelocity | public void setLinearVelocity(float x, float y, float z) {
"""
Sets a linear velocity [X, Y, Z] on this {@linkplain GVRRigidBody rigid body}
@param x factor on the 'X' axis.
@param y factor on the 'Y' axis.
@param z factor on the 'Z' axis.
"""
Native3DRigidBody.setLinearVelocity(getNative(), x, y,... | java | public void setLinearVelocity(float x, float y, float z) {
Native3DRigidBody.setLinearVelocity(getNative(), x, y, z);
} | [
"public",
"void",
"setLinearVelocity",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"Native3DRigidBody",
".",
"setLinearVelocity",
"(",
"getNative",
"(",
")",
",",
"x",
",",
"y",
",",
"z",
")",
";",
"}"
] | Sets a linear velocity [X, Y, Z] on this {@linkplain GVRRigidBody rigid body}
@param x factor on the 'X' axis.
@param y factor on the 'Y' axis.
@param z factor on the 'Z' axis. | [
"Sets",
"a",
"linear",
"velocity",
"[",
"X",
"Y",
"Z",
"]",
"on",
"this",
"{",
"@linkplain",
"GVRRigidBody",
"rigid",
"body",
"}"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/gvrf-physics/src/main/java/org/gearvrf/physics/GVRRigidBody.java#L308-L310 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/RSAUtils.java | RSAUtils.signMessageWithPrivateKey | public static byte[] signMessageWithPrivateKey(byte[] keyData, byte[] message, String signAlgo)
throws NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException,
SignatureException {
"""
Sign a message with RSA private key.
@param keyData
RSA private key data (value of {@li... | java | public static byte[] signMessageWithPrivateKey(byte[] keyData, byte[] message, String signAlgo)
throws NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException,
SignatureException {
RSAPrivateKey key = buildPrivateKey(keyData);
return signMessage(key, message, signA... | [
"public",
"static",
"byte",
"[",
"]",
"signMessageWithPrivateKey",
"(",
"byte",
"[",
"]",
"keyData",
",",
"byte",
"[",
"]",
"message",
",",
"String",
"signAlgo",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeySpecException",
",",
"InvalidKeyException",
... | Sign a message with RSA private key.
@param keyData
RSA private key data (value of {@link RSAPrivateKey#getEncoded()})
@param message
@param signAlgo
signature algorithm to use. If empty, {@link #DEFAULT_SIGNATURE_ALGORITHM} will be
used.
@return
@throws NoSuchAlgorithmException
@throws InvalidKeySpecException
@throws... | [
"Sign",
"a",
"message",
"with",
"RSA",
"private",
"key",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/RSAUtils.java#L203-L208 |
Sciss/abc4j | abc/src/main/java/abc/ui/swing/ScoreTemplate.java | ScoreTemplate.setAttributeSize | public void setAttributeSize(ScoreAttribute sa, float size, SizeUnit unit) {
"""
Sets the size associated to an attribute
@param unit {@link SizeUnit#PX}, {@link SizeUnit#STAFF_HEIGHT}...
@throws RuntimeException if attribute doesn't accept size value
"""
if (!(sa.getDefaultValue() instanceof ScoreAttri... | java | public void setAttributeSize(ScoreAttribute sa, float size, SizeUnit unit) {
if (!(sa.getDefaultValue() instanceof ScoreAttribute.Size))
throw new RuntimeException(sa.toString()
+ " is not a size attribute");
m_attributes.put(sa.getName(), new ScoreAttribute.Size(size, unit));
notifyListeners();
} | [
"public",
"void",
"setAttributeSize",
"(",
"ScoreAttribute",
"sa",
",",
"float",
"size",
",",
"SizeUnit",
"unit",
")",
"{",
"if",
"(",
"!",
"(",
"sa",
".",
"getDefaultValue",
"(",
")",
"instanceof",
"ScoreAttribute",
".",
"Size",
")",
")",
"throw",
"new",
... | Sets the size associated to an attribute
@param unit {@link SizeUnit#PX}, {@link SizeUnit#STAFF_HEIGHT}...
@throws RuntimeException if attribute doesn't accept size value | [
"Sets",
"the",
"size",
"associated",
"to",
"an",
"attribute"
] | train | https://github.com/Sciss/abc4j/blob/117b405642c84a7bfca4e3e13668838258b90ca7/abc/src/main/java/abc/ui/swing/ScoreTemplate.java#L740-L746 |
dwdyer/watchmaker | framework/src/java/main/org/uncommons/watchmaker/framework/operators/StringMutation.java | StringMutation.mutateString | private String mutateString(String s, Random rng) {
"""
Mutate a single string. Zero or more characters may be modified. The
probability of any given character being modified is governed by the
probability generator configured for this mutation operator.
@param s The string to mutate.
@param rng A source of ... | java | private String mutateString(String s, Random rng)
{
StringBuilder buffer = new StringBuilder(s);
for (int i = 0; i < buffer.length(); i++)
{
if (mutationProbability.nextValue().nextEvent(rng))
{
buffer.setCharAt(i, alphabet[rng.nextInt(alphabet.length)... | [
"private",
"String",
"mutateString",
"(",
"String",
"s",
",",
"Random",
"rng",
")",
"{",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"(",
"s",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"buffer",
".",
"length",
"(",
")",
... | Mutate a single string. Zero or more characters may be modified. The
probability of any given character being modified is governed by the
probability generator configured for this mutation operator.
@param s The string to mutate.
@param rng A source of randomness.
@return The mutated string. | [
"Mutate",
"a",
"single",
"string",
".",
"Zero",
"or",
"more",
"characters",
"may",
"be",
"modified",
".",
"The",
"probability",
"of",
"any",
"given",
"character",
"being",
"modified",
"is",
"governed",
"by",
"the",
"probability",
"generator",
"configured",
"fo... | train | https://github.com/dwdyer/watchmaker/blob/33d942350e6bf7d9a17b9262a4f898158530247e/framework/src/java/main/org/uncommons/watchmaker/framework/operators/StringMutation.java#L83-L94 |
apache/incubator-druid | processing/src/main/java/org/apache/druid/query/QueryToolChest.java | QueryToolChest.makePostComputeManipulatorFn | public Function<ResultType, ResultType> makePostComputeManipulatorFn(QueryType query, MetricManipulationFn fn) {
"""
Generally speaking this is the exact same thing as makePreComputeManipulatorFn. It is leveraged in
order to compute PostAggregators on results after they have been completely merged together, whic... | java | public Function<ResultType, ResultType> makePostComputeManipulatorFn(QueryType query, MetricManipulationFn fn)
{
return makePreComputeManipulatorFn(query, fn);
} | [
"public",
"Function",
"<",
"ResultType",
",",
"ResultType",
">",
"makePostComputeManipulatorFn",
"(",
"QueryType",
"query",
",",
"MetricManipulationFn",
"fn",
")",
"{",
"return",
"makePreComputeManipulatorFn",
"(",
"query",
",",
"fn",
")",
";",
"}"
] | Generally speaking this is the exact same thing as makePreComputeManipulatorFn. It is leveraged in
order to compute PostAggregators on results after they have been completely merged together, which
should actually be done in the mergeResults() call instead of here.
<p>
This should never actually be overridden and it s... | [
"Generally",
"speaking",
"this",
"is",
"the",
"exact",
"same",
"thing",
"as",
"makePreComputeManipulatorFn",
".",
"It",
"is",
"leveraged",
"in",
"order",
"to",
"compute",
"PostAggregators",
"on",
"results",
"after",
"they",
"have",
"been",
"completely",
"merged",
... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/processing/src/main/java/org/apache/druid/query/QueryToolChest.java#L141-L144 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/chess/DetectChessboardCorners.java | DetectChessboardCorners.process | public void process( GrayF32 input ) {
"""
Computes chessboard corners inside the image
@param input Gray image. Not modified.
"""
// System.out.println("ENTER CHESSBOARD CORNER "+input.width+" x "+input.height);
borderImg.setImage(input);
gradient.process(input,derivX,derivY);
interpX.setImage(derivX... | java | public void process( GrayF32 input ) {
// System.out.println("ENTER CHESSBOARD CORNER "+input.width+" x "+input.height);
borderImg.setImage(input);
gradient.process(input,derivX,derivY);
interpX.setImage(derivX);
interpY.setImage(derivY);
cornerIntensity.process(derivX,derivY,intensity);
intensityInterp.... | [
"public",
"void",
"process",
"(",
"GrayF32",
"input",
")",
"{",
"//\t\tSystem.out.println(\"ENTER CHESSBOARD CORNER \"+input.width+\" x \"+input.height);",
"borderImg",
".",
"setImage",
"(",
"input",
")",
";",
"gradient",
".",
"process",
"(",
"input",
",",
"derivX",
","... | Computes chessboard corners inside the image
@param input Gray image. Not modified. | [
"Computes",
"chessboard",
"corners",
"inside",
"the",
"image"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/chess/DetectChessboardCorners.java#L144-L199 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/BasePrefetcher.java | BasePrefetcher.buildPrefetchCriteriaMultipleKeys | private Criteria buildPrefetchCriteriaMultipleKeys(Collection ids, FieldDescriptor fields[]) {
"""
Build the Criteria using multiple ORs
@param ids collection of identities
@param fields
@return Criteria
"""
Criteria crit = new Criteria();
Iterator iter = ids.iterator();
Object[] ... | java | private Criteria buildPrefetchCriteriaMultipleKeys(Collection ids, FieldDescriptor fields[])
{
Criteria crit = new Criteria();
Iterator iter = ids.iterator();
Object[] val;
Identity id;
while (iter.hasNext())
{
Criteria c = new Criteria();
... | [
"private",
"Criteria",
"buildPrefetchCriteriaMultipleKeys",
"(",
"Collection",
"ids",
",",
"FieldDescriptor",
"fields",
"[",
"]",
")",
"{",
"Criteria",
"crit",
"=",
"new",
"Criteria",
"(",
")",
";",
"Iterator",
"iter",
"=",
"ids",
".",
"iterator",
"(",
")",
... | Build the Criteria using multiple ORs
@param ids collection of identities
@param fields
@return Criteria | [
"Build",
"the",
"Criteria",
"using",
"multiple",
"ORs"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/BasePrefetcher.java#L203-L230 |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java | AmqpClient.closeConnection | AmqpClient closeConnection(int replyCode, String replyText, int classId, int methodId1, Continuation callback, ErrorHandler error) {
"""
Closes the Amqp Server connection.
@param replyCode
@param replyText
@param classId
@param methodId1
@param callback
@param error
@return AmqpClient
"""
Obje... | java | AmqpClient closeConnection(int replyCode, String replyText, int classId, int methodId1, Continuation callback, ErrorHandler error) {
Object[] args = {replyCode, replyText, classId, methodId1};
AmqpBuffer bodyArg = null;
String methodName = "closeConnection";
String methodId = "10" + "50... | [
"AmqpClient",
"closeConnection",
"(",
"int",
"replyCode",
",",
"String",
"replyText",
",",
"int",
"classId",
",",
"int",
"methodId1",
",",
"Continuation",
"callback",
",",
"ErrorHandler",
"error",
")",
"{",
"Object",
"[",
"]",
"args",
"=",
"{",
"replyCode",
... | Closes the Amqp Server connection.
@param replyCode
@param replyText
@param classId
@param methodId1
@param callback
@param error
@return AmqpClient | [
"Closes",
"the",
"Amqp",
"Server",
"connection",
"."
] | train | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java#L898-L908 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/net/HostAndPort.java | HostAndPort.withDefaultPort | public HostAndPort withDefaultPort(int defaultPort) {
"""
Provide a default port if the parsed string contained only a host.
You can chain this after {@link #fromString(String)} to include a port in case the port was
omitted from the input string. If a port was already provided, then this method is a no-op.
... | java | public HostAndPort withDefaultPort(int defaultPort) {
checkArgument(isValidPort(defaultPort));
if (hasPort() || port == defaultPort) {
return this;
}
return new HostAndPort(host, defaultPort, hasBracketlessColons);
} | [
"public",
"HostAndPort",
"withDefaultPort",
"(",
"int",
"defaultPort",
")",
"{",
"checkArgument",
"(",
"isValidPort",
"(",
"defaultPort",
")",
")",
";",
"if",
"(",
"hasPort",
"(",
")",
"||",
"port",
"==",
"defaultPort",
")",
"{",
"return",
"this",
";",
"}"... | Provide a default port if the parsed string contained only a host.
You can chain this after {@link #fromString(String)} to include a port in case the port was
omitted from the input string. If a port was already provided, then this method is a no-op.
@param defaultPort a port number, from [0..65535]
@return a HostAnd... | [
"Provide",
"a",
"default",
"port",
"if",
"the",
"parsed",
"string",
"contained",
"only",
"a",
"host",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/net/HostAndPort.java#L263-L269 |
spockframework/spock | spock-core/src/main/java/spock/mock/MockingApi.java | MockingApi.Mock | @Beta
public <T> T Mock(Map<String, Object> options, Closure interactions) {
"""
Creates a mock with the specified options and interactions whose type and name are inferred
from the left-hand side of the enclosing assignment.
Example:
<pre>
// type is Person.class, name is "myPerson", returns hard-coded ... | java | @Beta
public <T> T Mock(Map<String, Object> options, Closure interactions) {
invalidMockCreation();
return null;
} | [
"@",
"Beta",
"public",
"<",
"T",
">",
"T",
"Mock",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"options",
",",
"Closure",
"interactions",
")",
"{",
"invalidMockCreation",
"(",
")",
";",
"return",
"null",
";",
"}"
] | Creates a mock with the specified options and interactions whose type and name are inferred
from the left-hand side of the enclosing assignment.
Example:
<pre>
// type is Person.class, name is "myPerson", returns hard-coded value for {@code name}, expects one call to {@code sing()}
Person person = Mock(name: "myPerso... | [
"Creates",
"a",
"mock",
"with",
"the",
"specified",
"options",
"and",
"interactions",
"whose",
"type",
"and",
"name",
"are",
"inferred",
"from",
"the",
"left",
"-",
"hand",
"side",
"of",
"the",
"enclosing",
"assignment",
"."
] | train | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/spock/mock/MockingApi.java#L278-L282 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.pressText | public static BufferedImage pressText(Image srcImage, String pressText, Color color, Font font, int x, int y, float alpha) {
"""
给图片添加文字水印<br>
此方法并不关闭流
@param srcImage 源图像
@param pressText 水印文字
@param color 水印的字体颜色
@param font {@link Font} 字体相关信息,如果默认则为{@code null}
@param x 修正值。 默认在中间,偏移量相对于中间偏移
@param y ... | java | public static BufferedImage pressText(Image srcImage, String pressText, Color color, Font font, int x, int y, float alpha) {
return Img.from(srcImage).pressText(pressText, color, font, x, y, alpha).getImg();
} | [
"public",
"static",
"BufferedImage",
"pressText",
"(",
"Image",
"srcImage",
",",
"String",
"pressText",
",",
"Color",
"color",
",",
"Font",
"font",
",",
"int",
"x",
",",
"int",
"y",
",",
"float",
"alpha",
")",
"{",
"return",
"Img",
".",
"from",
"(",
"s... | 给图片添加文字水印<br>
此方法并不关闭流
@param srcImage 源图像
@param pressText 水印文字
@param color 水印的字体颜色
@param font {@link Font} 字体相关信息,如果默认则为{@code null}
@param x 修正值。 默认在中间,偏移量相对于中间偏移
@param y 修正值。 默认在中间,偏移量相对于中间偏移
@param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字
@return 处理后的图像
@since 3.2.2 | [
"给图片添加文字水印<br",
">",
"此方法并不关闭流"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L862-L864 |
kevinherron/opc-ua-stack | stack-core/src/main/java/com/digitalpetri/opcua/stack/core/util/CertificateValidationUtil.java | CertificateValidationUtil.validateApplicationUri | public static void validateApplicationUri(X509Certificate certificate, String applicationUri) throws UaException {
"""
Validate that the application URI matches the SubjectAltName URI in the given certificate.
@param certificate the certificate to validate against.
@param applicationUri the URI to validate.... | java | public static void validateApplicationUri(X509Certificate certificate, String applicationUri) throws UaException {
if (!validateSubjectAltNameField(certificate, SUBJECT_ALT_NAME_URI, applicationUri::equals)) {
throw new UaException(StatusCodes.Bad_CertificateUriInvalid);
}
} | [
"public",
"static",
"void",
"validateApplicationUri",
"(",
"X509Certificate",
"certificate",
",",
"String",
"applicationUri",
")",
"throws",
"UaException",
"{",
"if",
"(",
"!",
"validateSubjectAltNameField",
"(",
"certificate",
",",
"SUBJECT_ALT_NAME_URI",
",",
"applica... | Validate that the application URI matches the SubjectAltName URI in the given certificate.
@param certificate the certificate to validate against.
@param applicationUri the URI to validate.
@throws UaException if the certificate is invalid, does not contain a uri, or contains a uri that does not match. | [
"Validate",
"that",
"the",
"application",
"URI",
"matches",
"the",
"SubjectAltName",
"URI",
"in",
"the",
"given",
"certificate",
"."
] | train | https://github.com/kevinherron/opc-ua-stack/blob/007f4e5c4ff102814bec17bb7c41f27e2e52f2fd/stack-core/src/main/java/com/digitalpetri/opcua/stack/core/util/CertificateValidationUtil.java#L130-L134 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/pipeline/LabeledChunkIdentifier.java | LabeledChunkIdentifier.getAnnotatedChunks | @SuppressWarnings("unchecked")
public List<CoreMap> getAnnotatedChunks(List<CoreLabel> tokens, int totalTokensOffset, Class textKey, Class labelKey) {
"""
Find and annotate chunks. Returns list of CoreMap (Annotation) objects.
@param tokens - List of tokens to look for chunks
@param totalTokensOffset - Index... | java | @SuppressWarnings("unchecked")
public List<CoreMap> getAnnotatedChunks(List<CoreLabel> tokens, int totalTokensOffset, Class textKey, Class labelKey)
{
return getAnnotatedChunks(tokens, totalTokensOffset, textKey, labelKey, null, null);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"List",
"<",
"CoreMap",
">",
"getAnnotatedChunks",
"(",
"List",
"<",
"CoreLabel",
">",
"tokens",
",",
"int",
"totalTokensOffset",
",",
"Class",
"textKey",
",",
"Class",
"labelKey",
")",
"{",
"return... | Find and annotate chunks. Returns list of CoreMap (Annotation) objects.
@param tokens - List of tokens to look for chunks
@param totalTokensOffset - Index of tokens to offset by
@param textKey - Key to use to find the token text
@param labelKey - Key to use to find the token label (to determine if inside chunk or not)... | [
"Find",
"and",
"annotate",
"chunks",
".",
"Returns",
"list",
"of",
"CoreMap",
"(",
"Annotation",
")",
"objects",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/pipeline/LabeledChunkIdentifier.java#L60-L64 |
qubole/qds-sdk-java | examples/src/main/java/com/qubole/qds/sdk/java/examples/SparkCommandExample.java | SparkCommandExample.submitScalaProgram | private static void submitScalaProgram(QdsClient client) throws Exception {
"""
An Example of submitting Spark Command as a Scala program.
Similarly, we can submit Spark Command as a SQL query, R program
and Java program.
"""
String sampleProgram = "println(\"hello world\")";
SparkCommandBui... | java | private static void submitScalaProgram(QdsClient client) throws Exception {
String sampleProgram = "println(\"hello world\")";
SparkCommandBuilder sparkBuilder = client.command().spark();
// Give a name to the command. (Optional)
sparkBuilder.name("spark-scala-test");
//Settin... | [
"private",
"static",
"void",
"submitScalaProgram",
"(",
"QdsClient",
"client",
")",
"throws",
"Exception",
"{",
"String",
"sampleProgram",
"=",
"\"println(\\\"hello world\\\")\"",
";",
"SparkCommandBuilder",
"sparkBuilder",
"=",
"client",
".",
"command",
"(",
")",
"."... | An Example of submitting Spark Command as a Scala program.
Similarly, we can submit Spark Command as a SQL query, R program
and Java program. | [
"An",
"Example",
"of",
"submitting",
"Spark",
"Command",
"as",
"a",
"Scala",
"program",
".",
"Similarly",
"we",
"can",
"submit",
"Spark",
"Command",
"as",
"a",
"SQL",
"query",
"R",
"program",
"and",
"Java",
"program",
"."
] | train | https://github.com/qubole/qds-sdk-java/blob/c652374075c7b72071f73db960f5f3a43f922afd/examples/src/main/java/com/qubole/qds/sdk/java/examples/SparkCommandExample.java#L51-L72 |
samskivert/pythagoras | src/main/java/pythagoras/d/Matrix4.java | Matrix4.setToOrtho | public Matrix4 setToOrtho (
double left, double right, double bottom, double top,
double near, double far, IVector3 nearFarNormal) {
"""
Sets this to an orthographic projection matrix.
@return a reference to this matrix, for chaining.
"""
double rlr = 1f / (left - right);
dou... | java | public Matrix4 setToOrtho (
double left, double right, double bottom, double top,
double near, double far, IVector3 nearFarNormal) {
double rlr = 1f / (left - right);
double rbt = 1f / (bottom - top);
double rnf = 1f / (near - far);
double s = 2f / (near*nearFarNormal.z()... | [
"public",
"Matrix4",
"setToOrtho",
"(",
"double",
"left",
",",
"double",
"right",
",",
"double",
"bottom",
",",
"double",
"top",
",",
"double",
"near",
",",
"double",
"far",
",",
"IVector3",
"nearFarNormal",
")",
"{",
"double",
"rlr",
"=",
"1f",
"/",
"("... | Sets this to an orthographic projection matrix.
@return a reference to this matrix, for chaining. | [
"Sets",
"this",
"to",
"an",
"orthographic",
"projection",
"matrix",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Matrix4.java#L427-L438 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindM2MBuilder.java | BindM2MBuilder.generateDeletes | private void generateDeletes(M2MEntity entity, String packageName) {
"""
Generate deletes.
@param entity
the entity
@param generatedEntity
@param packageName
the package name
"""
String idPart = CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, entity.idName);
String methodName = "";
String workI... | java | private void generateDeletes(M2MEntity entity, String packageName) {
String idPart = CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, entity.idName);
String methodName = "";
String workId = "";
methodName = "deleteBy" + idPart;
if (!isMethodAlreadyDefined(entity, methodName)) {
// @formatter:off
Meth... | [
"private",
"void",
"generateDeletes",
"(",
"M2MEntity",
"entity",
",",
"String",
"packageName",
")",
"{",
"String",
"idPart",
"=",
"CaseFormat",
".",
"LOWER_CAMEL",
".",
"to",
"(",
"CaseFormat",
".",
"UPPER_CAMEL",
",",
"entity",
".",
"idName",
")",
";",
"St... | Generate deletes.
@param entity
the entity
@param generatedEntity
@param packageName
the package name | [
"Generate",
"deletes",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindM2MBuilder.java#L339-L404 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.createTag | public Tag createTag(UUID projectId, String name, CreateTagOptionalParameter createTagOptionalParameter) {
"""
Create a tag for the project.
@param projectId The project id
@param name The tag name
@param createTagOptionalParameter the object representing the optional parameters to be set before calling this ... | java | public Tag createTag(UUID projectId, String name, CreateTagOptionalParameter createTagOptionalParameter) {
return createTagWithServiceResponseAsync(projectId, name, createTagOptionalParameter).toBlocking().single().body();
} | [
"public",
"Tag",
"createTag",
"(",
"UUID",
"projectId",
",",
"String",
"name",
",",
"CreateTagOptionalParameter",
"createTagOptionalParameter",
")",
"{",
"return",
"createTagWithServiceResponseAsync",
"(",
"projectId",
",",
"name",
",",
"createTagOptionalParameter",
")",
... | Create a tag for the project.
@param projectId The project id
@param name The tag name
@param createTagOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the reque... | [
"Create",
"a",
"tag",
"for",
"the",
"project",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L286-L288 |
pressgang-ccms/PressGangCCMSQuery | src/main/java/org/jboss/pressgang/ccms/filter/base/BaseFilterQueryBuilder.java | BaseFilterQueryBuilder.addNotLikeCondition | protected void addNotLikeCondition(final String propertyName, final String value) {
"""
Add a Field Search Condition that will search a field for values that aren't like a specified value using the following
SQL logic: {@code field NOT LIKE '%value%'}
@param propertyName The name of the field as defined in the... | java | protected void addNotLikeCondition(final String propertyName, final String value) {
final Expression<String> propertyNameField = getRootPath().get(propertyName).as(String.class);
fieldConditions.add(getCriteriaBuilder().notLike(propertyNameField, "%" + cleanLikeCondition(value) + "%"));
} | [
"protected",
"void",
"addNotLikeCondition",
"(",
"final",
"String",
"propertyName",
",",
"final",
"String",
"value",
")",
"{",
"final",
"Expression",
"<",
"String",
">",
"propertyNameField",
"=",
"getRootPath",
"(",
")",
".",
"get",
"(",
"propertyName",
")",
"... | Add a Field Search Condition that will search a field for values that aren't like a specified value using the following
SQL logic: {@code field NOT LIKE '%value%'}
@param propertyName The name of the field as defined in the Entity mapping class.
@param value The value to search against. | [
"Add",
"a",
"Field",
"Search",
"Condition",
"that",
"will",
"search",
"a",
"field",
"for",
"values",
"that",
"aren",
"t",
"like",
"a",
"specified",
"value",
"using",
"the",
"following",
"SQL",
"logic",
":",
"{",
"@code",
"field",
"NOT",
"LIKE",
"%value%",
... | train | https://github.com/pressgang-ccms/PressGangCCMSQuery/blob/2bb23430adab956737d0301cd2ea933f986dd85b/src/main/java/org/jboss/pressgang/ccms/filter/base/BaseFilterQueryBuilder.java#L211-L214 |
libgdx/box2dlights | src/box2dLight/ChainLight.java | ChainLight.attachToBody | public void attachToBody(Body body, float degrees) {
"""
Attaches light to specified body with relative direction offset
@param body
that will be automatically followed, note that the body
rotation angle is taken into account for the light offset
and direction calculations
@param degrees
directional relati... | java | public void attachToBody(Body body, float degrees) {
this.body = body;
this.bodyPosition.set(body.getPosition());
bodyAngleOffset = MathUtils.degreesToRadians * degrees;
bodyAngle = body.getAngle();
applyAttachment();
if (staticLight) dirty = true;
} | [
"public",
"void",
"attachToBody",
"(",
"Body",
"body",
",",
"float",
"degrees",
")",
"{",
"this",
".",
"body",
"=",
"body",
";",
"this",
".",
"bodyPosition",
".",
"set",
"(",
"body",
".",
"getPosition",
"(",
")",
")",
";",
"bodyAngleOffset",
"=",
"Math... | Attaches light to specified body with relative direction offset
@param body
that will be automatically followed, note that the body
rotation angle is taken into account for the light offset
and direction calculations
@param degrees
directional relative offset in degrees | [
"Attaches",
"light",
"to",
"specified",
"body",
"with",
"relative",
"direction",
"offset"
] | train | https://github.com/libgdx/box2dlights/blob/08cf93a41464f71d32475aaa2fe280dc6af78ff3/src/box2dLight/ChainLight.java#L194-L201 |
apereo/cas | support/cas-server-support-saml-mdui-core/src/main/java/org/apereo/cas/support/saml/mdui/AbstractMetadataResolverAdapter.java | AbstractMetadataResolverAdapter.getResourceInputStream | protected InputStream getResourceInputStream(final Resource resource, final String entityId) throws IOException {
"""
Retrieve the remote source's input stream to parse data.
@param resource the resource
@param entityId the entity id
@return the input stream
@throws IOException if stream cannot be read
"... | java | protected InputStream getResourceInputStream(final Resource resource, final String entityId) throws IOException {
LOGGER.debug("Locating metadata resource from input stream.");
if (!resource.exists() || !resource.isReadable()) {
throw new FileNotFoundException("Resource does not exist or is ... | [
"protected",
"InputStream",
"getResourceInputStream",
"(",
"final",
"Resource",
"resource",
",",
"final",
"String",
"entityId",
")",
"throws",
"IOException",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Locating metadata resource from input stream.\"",
")",
";",
"if",
"(",
"!... | Retrieve the remote source's input stream to parse data.
@param resource the resource
@param entityId the entity id
@return the input stream
@throws IOException if stream cannot be read | [
"Retrieve",
"the",
"remote",
"source",
"s",
"input",
"stream",
"to",
"parse",
"data",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-mdui-core/src/main/java/org/apereo/cas/support/saml/mdui/AbstractMetadataResolverAdapter.java#L81-L87 |
line/armeria | examples/grpc-service/src/main/java/example/armeria/grpc/HelloServiceImpl.java | HelloServiceImpl.lotsOfReplies | @Override
public void lotsOfReplies(HelloRequest request, StreamObserver<HelloReply> responseObserver) {
"""
Sends 5 {@link HelloReply} responses when receiving a request.
@see #lazyHello(HelloRequest, StreamObserver)
"""
// You can also write this code without Reactor like 'lazyHello' example.
... | java | @Override
public void lotsOfReplies(HelloRequest request, StreamObserver<HelloReply> responseObserver) {
// You can also write this code without Reactor like 'lazyHello' example.
Flux.interval(Duration.ofSeconds(1))
.take(5)
.map(index -> "Hello, " + request.getName() + "! (s... | [
"@",
"Override",
"public",
"void",
"lotsOfReplies",
"(",
"HelloRequest",
"request",
",",
"StreamObserver",
"<",
"HelloReply",
">",
"responseObserver",
")",
"{",
"// You can also write this code without Reactor like 'lazyHello' example.",
"Flux",
".",
"interval",
"(",
"Durat... | Sends 5 {@link HelloReply} responses when receiving a request.
@see #lazyHello(HelloRequest, StreamObserver) | [
"Sends",
"5",
"{",
"@link",
"HelloReply",
"}",
"responses",
"when",
"receiving",
"a",
"request",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/examples/grpc-service/src/main/java/example/armeria/grpc/HelloServiceImpl.java#L75-L98 |
duracloud/duracloud | common/src/main/java/org/duracloud/common/util/SerializationUtil.java | SerializationUtil.serializeMap | public static String serializeMap(Map<String, String> map) {
"""
Serializes a Map to XML. If the map is either empty or null
the XML will indicate an empty map.
@param map
@return
"""
if (map == null) {
map = new HashMap<String, String>();
}
XStream xstream = new XStrea... | java | public static String serializeMap(Map<String, String> map) {
if (map == null) {
map = new HashMap<String, String>();
}
XStream xstream = new XStream(new DomDriver());
return xstream.toXML(map);
} | [
"public",
"static",
"String",
"serializeMap",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"map",
")",
"{",
"if",
"(",
"map",
"==",
"null",
")",
"{",
"map",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"}",
"XStream",
... | Serializes a Map to XML. If the map is either empty or null
the XML will indicate an empty map.
@param map
@return | [
"Serializes",
"a",
"Map",
"to",
"XML",
".",
"If",
"the",
"map",
"is",
"either",
"empty",
"or",
"null",
"the",
"XML",
"will",
"indicate",
"an",
"empty",
"map",
"."
] | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/common/src/main/java/org/duracloud/common/util/SerializationUtil.java#L38-L44 |
alibaba/jstorm | jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/appmaster/JstormMaster.java | JstormMaster.setupContainerAskForRM | public ContainerRequest setupContainerAskForRM(int containerMemory, int containerVirtualCores, int priority, String[] racks, String[] hosts) {
"""
Setup the request that will be sent to the RM for the container ask.
@return the setup ResourceRequest to be sent to RM
"""
Priority pri = Priority.newIn... | java | public ContainerRequest setupContainerAskForRM(int containerMemory, int containerVirtualCores, int priority, String[] racks, String[] hosts) {
Priority pri = Priority.newInstance(priority);
Resource capability = Resource.newInstance(containerMemory,
containerVirtualCores);
Contai... | [
"public",
"ContainerRequest",
"setupContainerAskForRM",
"(",
"int",
"containerMemory",
",",
"int",
"containerVirtualCores",
",",
"int",
"priority",
",",
"String",
"[",
"]",
"racks",
",",
"String",
"[",
"]",
"hosts",
")",
"{",
"Priority",
"pri",
"=",
"Priority",
... | Setup the request that will be sent to the RM for the container ask.
@return the setup ResourceRequest to be sent to RM | [
"Setup",
"the",
"request",
"that",
"will",
"be",
"sent",
"to",
"the",
"RM",
"for",
"the",
"container",
"ask",
"."
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/appmaster/JstormMaster.java#L1091-L1099 |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/management/MBeanProxyFactory.java | MBeanProxyFactory.createStorageManagerProxy | public StorageManagerMXBean createStorageManagerProxy() throws IOException {
"""
Makes the proxy for StorageManagerMXBean.
@return A StorageManagerMXBean object.
@throws IOException
"""
String beanName = StorageManagerMXBean.JMX_DOMAIN_NAME + ":type=" + StorageManagerMXBean.JMX_TYPE_NAME;
r... | java | public StorageManagerMXBean createStorageManagerProxy() throws IOException {
String beanName = StorageManagerMXBean.JMX_DOMAIN_NAME + ":type=" + StorageManagerMXBean.JMX_TYPE_NAME;
return createMXBeanProxy(beanName, StorageManagerMXBean.class);
} | [
"public",
"StorageManagerMXBean",
"createStorageManagerProxy",
"(",
")",
"throws",
"IOException",
"{",
"String",
"beanName",
"=",
"StorageManagerMXBean",
".",
"JMX_DOMAIN_NAME",
"+",
"\":type=\"",
"+",
"StorageManagerMXBean",
".",
"JMX_TYPE_NAME",
";",
"return",
"createMX... | Makes the proxy for StorageManagerMXBean.
@return A StorageManagerMXBean object.
@throws IOException | [
"Makes",
"the",
"proxy",
"for",
"StorageManagerMXBean",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/management/MBeanProxyFactory.java#L89-L92 |
liferay/com-liferay-commerce | commerce-user-segment-service/src/main/java/com/liferay/commerce/user/segment/service/persistence/impl/CommerceUserSegmentEntryPersistenceImpl.java | CommerceUserSegmentEntryPersistenceImpl.findByGroupId | @Override
public List<CommerceUserSegmentEntry> findByGroupId(long groupId) {
"""
Returns all the commerce user segment entries where groupId = ?.
@param groupId the group ID
@return the matching commerce user segment entries
"""
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, nu... | java | @Override
public List<CommerceUserSegmentEntry> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceUserSegmentEntry",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
... | Returns all the commerce user segment entries where groupId = ?.
@param groupId the group ID
@return the matching commerce user segment entries | [
"Returns",
"all",
"the",
"commerce",
"user",
"segment",
"entries",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-user-segment-service/src/main/java/com/liferay/commerce/user/segment/service/persistence/impl/CommerceUserSegmentEntryPersistenceImpl.java#L127-L130 |
lucee/Lucee | core/src/main/java/lucee/commons/i18n/FormatUtil.java | FormatUtil.getCFMLFormats | public static DateFormat[] getCFMLFormats(TimeZone tz, boolean lenient) {
"""
CFML Supported LS Formats
@param locale
@param tz
@param lenient
@return
"""
String id = "cfml-" + Locale.ENGLISH.toString() + "-" + tz.getID() + "-" + lenient;
DateFormat[] df = formats.get(id);
if (df == null) {
df = ... | java | public static DateFormat[] getCFMLFormats(TimeZone tz, boolean lenient) {
String id = "cfml-" + Locale.ENGLISH.toString() + "-" + tz.getID() + "-" + lenient;
DateFormat[] df = formats.get(id);
if (df == null) {
df = new SimpleDateFormat[] { new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH), new... | [
"public",
"static",
"DateFormat",
"[",
"]",
"getCFMLFormats",
"(",
"TimeZone",
"tz",
",",
"boolean",
"lenient",
")",
"{",
"String",
"id",
"=",
"\"cfml-\"",
"+",
"Locale",
".",
"ENGLISH",
".",
"toString",
"(",
")",
"+",
"\"-\"",
"+",
"tz",
".",
"getID",
... | CFML Supported LS Formats
@param locale
@param tz
@param lenient
@return | [
"CFML",
"Supported",
"LS",
"Formats"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/i18n/FormatUtil.java#L246-L271 |
vlingo/vlingo-actors | src/main/java/io/vlingo/actors/World.java | World.start | public static World start(final String name, final java.util.Properties properties) {
"""
Answers a new {@code World} with the given {@code name} and that is configured with
the contents of the properties.
@param name the String name to assign to the new {@code World} instance
@param properties the java.util.Pr... | java | public static World start(final String name, final java.util.Properties properties) {
return start(name, Configuration.defineWith(properties));
} | [
"public",
"static",
"World",
"start",
"(",
"final",
"String",
"name",
",",
"final",
"java",
".",
"util",
".",
"Properties",
"properties",
")",
"{",
"return",
"start",
"(",
"name",
",",
"Configuration",
".",
"defineWith",
"(",
"properties",
")",
")",
";",
... | Answers a new {@code World} with the given {@code name} and that is configured with
the contents of the properties.
@param name the String name to assign to the new {@code World} instance
@param properties the java.util.Properties used for configuration
@return {@code World} | [
"Answers",
"a",
"new",
"{"
] | train | https://github.com/vlingo/vlingo-actors/blob/c7d046fd139c0490cf0fd2588d7dc2f792f13493/src/main/java/io/vlingo/actors/World.java#L67-L69 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisClusterStorage.java | RedisClusterStorage.getTriggerState | @Override
public Trigger.TriggerState getTriggerState(TriggerKey triggerKey, JedisCluster jedis) {
"""
Get the current state of the identified <code>{@link Trigger}</code>.
@param triggerKey the key of the desired trigger
@param jedis a thread-safe Redis connection
@return the state of the trigger
... | java | @Override
public Trigger.TriggerState getTriggerState(TriggerKey triggerKey, JedisCluster jedis) {
final String triggerHashKey = redisSchema.triggerHashKey(triggerKey);
Map<RedisTriggerState, Double> scores = new HashMap<>(RedisTriggerState.values().length);
for (RedisTriggerState redisTrigg... | [
"@",
"Override",
"public",
"Trigger",
".",
"TriggerState",
"getTriggerState",
"(",
"TriggerKey",
"triggerKey",
",",
"JedisCluster",
"jedis",
")",
"{",
"final",
"String",
"triggerHashKey",
"=",
"redisSchema",
".",
"triggerHashKey",
"(",
"triggerKey",
")",
";",
"Map... | Get the current state of the identified <code>{@link Trigger}</code>.
@param triggerKey the key of the desired trigger
@param jedis a thread-safe Redis connection
@return the state of the trigger | [
"Get",
"the",
"current",
"state",
"of",
"the",
"identified",
"<code",
">",
"{",
"@link",
"Trigger",
"}",
"<",
"/",
"code",
">",
"."
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisClusterStorage.java#L399-L412 |
jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/ParameterUtil.java | ParameterUtil.parseQueryParams | public static IQueryParameterAnd<?> parseQueryParams(FhirContext theContext, RuntimeSearchParam theParamDef,
String theUnqualifiedParamName, List<QualifiedParamList> theParameters) {
"""
This is a utility method intended provided to help the JPA module.
"""
RestSearchParameterTypeEnum paramType = theParam... | java | public static IQueryParameterAnd<?> parseQueryParams(FhirContext theContext, RuntimeSearchParam theParamDef,
String theUnqualifiedParamName, List<QualifiedParamList> theParameters) {
RestSearchParameterTypeEnum paramType = theParamDef.getParamType();
return parseQueryParams(theContext, paramType, theUnqualifiedP... | [
"public",
"static",
"IQueryParameterAnd",
"<",
"?",
">",
"parseQueryParams",
"(",
"FhirContext",
"theContext",
",",
"RuntimeSearchParam",
"theParamDef",
",",
"String",
"theUnqualifiedParamName",
",",
"List",
"<",
"QualifiedParamList",
">",
"theParameters",
")",
"{",
"... | This is a utility method intended provided to help the JPA module. | [
"This",
"is",
"a",
"utility",
"method",
"intended",
"provided",
"to",
"help",
"the",
"JPA",
"module",
"."
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/ParameterUtil.java#L110-L114 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/org/lightcouch/CouchDatabaseBase.java | CouchDatabaseBase.getAttachment | public InputStream getAttachment(String docId, String attachmentName, String revId) {
"""
Reads an attachment from the database.
The stream must be closed after usage, otherwise http connection leaks will occur.
@param docId the document id
@param attachmentName the attachment name
@param revId the documen... | java | public InputStream getAttachment(String docId, String attachmentName, String revId) {
final URI uri = new DatabaseURIHelper(dbUri).attachmentUri(docId, revId, attachmentName);
return getAttachment(uri);
} | [
"public",
"InputStream",
"getAttachment",
"(",
"String",
"docId",
",",
"String",
"attachmentName",
",",
"String",
"revId",
")",
"{",
"final",
"URI",
"uri",
"=",
"new",
"DatabaseURIHelper",
"(",
"dbUri",
")",
".",
"attachmentUri",
"(",
"docId",
",",
"revId",
... | Reads an attachment from the database.
The stream must be closed after usage, otherwise http connection leaks will occur.
@param docId the document id
@param attachmentName the attachment name
@param revId the document revision id or {@code null}
@return the attachment in the form of an {@code InputStream}. | [
"Reads",
"an",
"attachment",
"from",
"the",
"database",
"."
] | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/org/lightcouch/CouchDatabaseBase.java#L310-L313 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.addObject | public JSONObject addObject(JSONObject obj, String objectID, RequestOptions requestOptions) throws AlgoliaException {
"""
Add an object in this index with a uniq identifier
@param obj the object to add
@param objectID the objectID associated to this object
(if this objectID already exist the ... | java | public JSONObject addObject(JSONObject obj, String objectID, RequestOptions requestOptions) throws AlgoliaException {
try {
return client.putRequest("/1/indexes/" + encodedIndexName + "/" + URLEncoder.encode(objectID, "UTF-8"), obj.toString(), requestOptions);
} catch (UnsupportedEncodingException e) {
... | [
"public",
"JSONObject",
"addObject",
"(",
"JSONObject",
"obj",
",",
"String",
"objectID",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"try",
"{",
"return",
"client",
".",
"putRequest",
"(",
"\"/1/indexes/\"",
"+",
"encodedIndexNa... | Add an object in this index with a uniq identifier
@param obj the object to add
@param objectID the objectID associated to this object
(if this objectID already exist the old object will be overriden)
@param requestOptions Options to pass to this request | [
"Add",
"an",
"object",
"in",
"this",
"index",
"with",
"a",
"uniq",
"identifier"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L106-L112 |
pravega/pravega | shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java | StreamSegmentNameUtils.getSegmentChunkName | public static String getSegmentChunkName(String segmentName, long offset) {
"""
Gets the name of the SegmentChunk for the given Segment and Offset.
@param segmentName The name of the Segment to get the SegmentChunk name for.
@param offset The starting offset of the SegmentChunk.
@return The SegmentChunk ... | java | public static String getSegmentChunkName(String segmentName, long offset) {
Preconditions.checkArgument(!segmentName.contains(OFFSET_SUFFIX), "segmentName is already a SegmentChunk name");
return segmentName + OFFSET_SUFFIX + Long.toString(offset);
} | [
"public",
"static",
"String",
"getSegmentChunkName",
"(",
"String",
"segmentName",
",",
"long",
"offset",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"!",
"segmentName",
".",
"contains",
"(",
"OFFSET_SUFFIX",
")",
",",
"\"segmentName is already a SegmentChun... | Gets the name of the SegmentChunk for the given Segment and Offset.
@param segmentName The name of the Segment to get the SegmentChunk name for.
@param offset The starting offset of the SegmentChunk.
@return The SegmentChunk name. | [
"Gets",
"the",
"name",
"of",
"the",
"SegmentChunk",
"for",
"the",
"given",
"Segment",
"and",
"Offset",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java#L185-L188 |
wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/file/MixedFileUpload.java | MixedFileUpload.checkSize | private void checkSize(long newSize, long maxSize, HttpServerFileUpload upload) {
"""
Checks whether we exceed the max allowed file size.
@param newSize the expected size once the current chunk is consumed
@param maxSize the max allowed size.
@param upload the upload
"""
if (maxSize >= 0 && newSi... | java | private void checkSize(long newSize, long maxSize, HttpServerFileUpload upload) {
if (maxSize >= 0 && newSize > maxSize) {
upload.handler(null);
report(new IllegalStateException("Size exceed allowed maximum capacity"));
}
} | [
"private",
"void",
"checkSize",
"(",
"long",
"newSize",
",",
"long",
"maxSize",
",",
"HttpServerFileUpload",
"upload",
")",
"{",
"if",
"(",
"maxSize",
">=",
"0",
"&&",
"newSize",
">",
"maxSize",
")",
"{",
"upload",
".",
"handler",
"(",
"null",
")",
";",
... | Checks whether we exceed the max allowed file size.
@param newSize the expected size once the current chunk is consumed
@param maxSize the max allowed size.
@param upload the upload | [
"Checks",
"whether",
"we",
"exceed",
"the",
"max",
"allowed",
"file",
"size",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/file/MixedFileUpload.java#L98-L103 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/ModeUtils.java | ModeUtils.applyDirectoryUMask | public static Mode applyDirectoryUMask(Mode mode, String authUmask) {
"""
Applies the default umask for newly created directories to this mode.
@param mode the mode to update
@param authUmask the umask to apply on the directory
@return the updated object
"""
return applyUMask(mode, getUMask(authUmask)... | java | public static Mode applyDirectoryUMask(Mode mode, String authUmask) {
return applyUMask(mode, getUMask(authUmask));
} | [
"public",
"static",
"Mode",
"applyDirectoryUMask",
"(",
"Mode",
"mode",
",",
"String",
"authUmask",
")",
"{",
"return",
"applyUMask",
"(",
"mode",
",",
"getUMask",
"(",
"authUmask",
")",
")",
";",
"}"
] | Applies the default umask for newly created directories to this mode.
@param mode the mode to update
@param authUmask the umask to apply on the directory
@return the updated object | [
"Applies",
"the",
"default",
"umask",
"for",
"newly",
"created",
"directories",
"to",
"this",
"mode",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ModeUtils.java#L52-L54 |
jbundle/jbundle | base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/html/HAppletHtmlScreen.java | HAppletHtmlScreen.printHtmlMenubar | public void printHtmlMenubar(PrintWriter out, ResourceBundle reg)
throws DBException {
"""
Print the top nav menu.
@param out The html out stream.
@param reg The resources object.
@exception DBException File exception.
"""
char chMenubar = ScreenFieldViewAdapter.getFirstToUpper(this.getPrope... | java | public void printHtmlMenubar(PrintWriter out, ResourceBundle reg)
throws DBException
{
char chMenubar = ScreenFieldViewAdapter.getFirstToUpper(this.getProperty(DBParams.MENUBARS), 'Y');
if (chMenubar == 'Y')
{
String strUserName = this.getProperty(DBParams.USER_NAME);
... | [
"public",
"void",
"printHtmlMenubar",
"(",
"PrintWriter",
"out",
",",
"ResourceBundle",
"reg",
")",
"throws",
"DBException",
"{",
"char",
"chMenubar",
"=",
"ScreenFieldViewAdapter",
".",
"getFirstToUpper",
"(",
"this",
".",
"getProperty",
"(",
"DBParams",
".",
"ME... | Print the top nav menu.
@param out The html out stream.
@param reg The resources object.
@exception DBException File exception. | [
"Print",
"the",
"top",
"nav",
"menu",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/html/HAppletHtmlScreen.java#L135-L157 |
samskivert/samskivert | src/main/java/com/samskivert/jdbc/SimpleRepository.java | SimpleRepository.executeUpdate | protected <V> V executeUpdate (Operation<V> op)
throws PersistenceException {
"""
Executes the supplied read-write operation. In the event of a transient failure, the
repository will attempt to reestablish the database connection and try the operation again.
@return whatever value is returned by the in... | java | protected <V> V executeUpdate (Operation<V> op)
throws PersistenceException
{
return execute(op, true, false);
} | [
"protected",
"<",
"V",
">",
"V",
"executeUpdate",
"(",
"Operation",
"<",
"V",
">",
"op",
")",
"throws",
"PersistenceException",
"{",
"return",
"execute",
"(",
"op",
",",
"true",
",",
"false",
")",
";",
"}"
] | Executes the supplied read-write operation. In the event of a transient failure, the
repository will attempt to reestablish the database connection and try the operation again.
@return whatever value is returned by the invoked operation. | [
"Executes",
"the",
"supplied",
"read",
"-",
"write",
"operation",
".",
"In",
"the",
"event",
"of",
"a",
"transient",
"failure",
"the",
"repository",
"will",
"attempt",
"to",
"reestablish",
"the",
"database",
"connection",
"and",
"try",
"the",
"operation",
"aga... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/SimpleRepository.java#L101-L105 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ContainerServicesInner.java | ContainerServicesInner.createOrUpdate | public ContainerServiceInner createOrUpdate(String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) {
"""
Creates or updates a container service.
Creates or updates a container service with the specified configuration of orchestrator, masters, and agents.
@param resourceGroupNa... | java | public ContainerServiceInner createOrUpdate(String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerServiceName, parameters).toBlocking().last().body();
} | [
"public",
"ContainerServiceInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"containerServiceName",
",",
"ContainerServiceInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"containerSer... | Creates or updates a container service.
Creates or updates a container service with the specified configuration of orchestrator, masters, and agents.
@param resourceGroupName The name of the resource group.
@param containerServiceName The name of the container service in the specified subscription and resource group.
... | [
"Creates",
"or",
"updates",
"a",
"container",
"service",
".",
"Creates",
"or",
"updates",
"a",
"container",
"service",
"with",
"the",
"specified",
"configuration",
"of",
"orchestrator",
"masters",
"and",
"agents",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ContainerServicesInner.java#L231-L233 |
amzn/ion-java | src/com/amazon/ion/impl/IonUTF8.java | IonUTF8.getScalarReadLengthFromBytes | public final static int getScalarReadLengthFromBytes(byte[] bytes, int offset, int maxLength) {
"""
this helper calculates the number of bytes it will consume from the
supplied byte array (bytes) if getScalarFromBytes is called with
the same parameters. This is in place of having getScalarFromBytes
return an o... | java | public final static int getScalarReadLengthFromBytes(byte[] bytes, int offset, int maxLength)
{
int src = offset;
int end = offset + maxLength;
if (src >= end) throw new ArrayIndexOutOfBoundsException();
int c = bytes[src++] & 0xff;
int utf8length = getUTF8LengthFromFirstByt... | [
"public",
"final",
"static",
"int",
"getScalarReadLengthFromBytes",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"int",
"maxLength",
")",
"{",
"int",
"src",
"=",
"offset",
";",
"int",
"end",
"=",
"offset",
"+",
"maxLength",
";",
"if",
"(",
... | this helper calculates the number of bytes it will consume from the
supplied byte array (bytes) if getScalarFromBytes is called with
the same parameters. This is in place of having getScalarFromBytes
return an object with the bytes consumed and the resultant scalar.
This will throw ArrayIndexOutOfBoundsException if th... | [
"this",
"helper",
"calculates",
"the",
"number",
"of",
"bytes",
"it",
"will",
"consume",
"from",
"the",
"supplied",
"byte",
"array",
"(",
"bytes",
")",
"if",
"getScalarFromBytes",
"is",
"called",
"with",
"the",
"same",
"parameters",
".",
"This",
"is",
"in",
... | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonUTF8.java#L319-L330 |
bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/writer/TemporaryFileScanWriter.java | TemporaryFileScanWriter.blockUntilOpenShardsAtMost | private void blockUntilOpenShardsAtMost(int maxOpenShards, @Nullable TransferKey permittedKey)
throws IOException, InterruptedException {
"""
Blocks until the number of open shards is equal to or less than the provided threshold.
"""
blockUntilOpenShardsAtMost(maxOpenShards, permittedKey, I... | java | private void blockUntilOpenShardsAtMost(int maxOpenShards, @Nullable TransferKey permittedKey)
throws IOException, InterruptedException {
blockUntilOpenShardsAtMost(maxOpenShards, permittedKey, Instant.MAX);
} | [
"private",
"void",
"blockUntilOpenShardsAtMost",
"(",
"int",
"maxOpenShards",
",",
"@",
"Nullable",
"TransferKey",
"permittedKey",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"blockUntilOpenShardsAtMost",
"(",
"maxOpenShards",
",",
"permittedKey",
",",... | Blocks until the number of open shards is equal to or less than the provided threshold. | [
"Blocks",
"until",
"the",
"number",
"of",
"open",
"shards",
"is",
"equal",
"to",
"or",
"less",
"than",
"the",
"provided",
"threshold",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/writer/TemporaryFileScanWriter.java#L223-L226 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardAtomGenerator.java | StandardAtomGenerator.positionSubscript | TextOutline positionSubscript(TextOutline label, TextOutline subscript) {
"""
Positions an outline in the subscript position relative to another 'primary' label.
@param label a label outline
@param subscript the label outline to position as subscript
@return positioned subscript outline
"""
fi... | java | TextOutline positionSubscript(TextOutline label, TextOutline subscript) {
final Rectangle2D hydrogenBounds = label.getBounds();
final Rectangle2D hydrogenCountBounds = subscript.getBounds();
subscript = subscript.translate((hydrogenBounds.getMaxX() + padding) - hydrogenCountBounds.getMinX(),
... | [
"TextOutline",
"positionSubscript",
"(",
"TextOutline",
"label",
",",
"TextOutline",
"subscript",
")",
"{",
"final",
"Rectangle2D",
"hydrogenBounds",
"=",
"label",
".",
"getBounds",
"(",
")",
";",
"final",
"Rectangle2D",
"hydrogenCountBounds",
"=",
"subscript",
".",... | Positions an outline in the subscript position relative to another 'primary' label.
@param label a label outline
@param subscript the label outline to position as subscript
@return positioned subscript outline | [
"Positions",
"an",
"outline",
"in",
"the",
"subscript",
"position",
"relative",
"to",
"another",
"primary",
"label",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardAtomGenerator.java#L443-L449 |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/HELM2NotationUtils.java | HELM2NotationUtils.section1 | private static void section1(List<PolymerNotation> polymers, Map<String, String> mapIds) throws NotationException {
"""
method to add PolymerNotations to the existent
@param polymers PolymerNotation
@param mapIds Map of old and new Ids
@throws NotationException if notation is not valid
"""
for (Polym... | java | private static void section1(List<PolymerNotation> polymers, Map<String, String> mapIds) throws NotationException {
for (PolymerNotation polymer : polymers) {
if (mapIds.containsKey(polymer.getPolymerID().getId())) {
/* change id */
PolymerNotation newpolymer = new PolymerNotation(mapIds.g... | [
"private",
"static",
"void",
"section1",
"(",
"List",
"<",
"PolymerNotation",
">",
"polymers",
",",
"Map",
"<",
"String",
",",
"String",
">",
"mapIds",
")",
"throws",
"NotationException",
"{",
"for",
"(",
"PolymerNotation",
"polymer",
":",
"polymers",
")",
"... | method to add PolymerNotations to the existent
@param polymers PolymerNotation
@param mapIds Map of old and new Ids
@throws NotationException if notation is not valid | [
"method",
"to",
"add",
"PolymerNotations",
"to",
"the",
"existent"
] | train | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/HELM2NotationUtils.java#L251-L264 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_udp_farm_farmId_server_serverId_GET | public OvhBackendUDPServer serviceName_udp_farm_farmId_server_serverId_GET(String serviceName, Long farmId, Long serverId) throws IOException {
"""
Get this object properties
REST: GET /ipLoadbalancing/{serviceName}/udp/farm/{farmId}/server/{serverId}
@param serviceName [required] The internal name of your IP ... | java | public OvhBackendUDPServer serviceName_udp_farm_farmId_server_serverId_GET(String serviceName, Long farmId, Long serverId) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/udp/farm/{farmId}/server/{serverId}";
StringBuilder sb = path(qPath, serviceName, farmId, serverId);
String resp = exec(qPa... | [
"public",
"OvhBackendUDPServer",
"serviceName_udp_farm_farmId_server_serverId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"farmId",
",",
"Long",
"serverId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/udp/farm/{farmId}/serve... | Get this object properties
REST: GET /ipLoadbalancing/{serviceName}/udp/farm/{farmId}/server/{serverId}
@param serviceName [required] The internal name of your IP load balancing
@param farmId [required] Id of your farm
@param serverId [required] Id of your server
API beta | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L943-L948 |
tango-controls/JTango | client/src/main/java/fr/soleil/tango/clientapi/util/TypeConversionUtil.java | TypeConversionUtil.extractReadOrWrite | public static Object extractReadOrWrite(final Part part, final DeviceAttribute da, final Object readWrite)
throws DevFailed {
"""
Extract read or write part of a Tango attribute. For spectrum and image
@param part
@param da
@param readWrite
@return
@throws DevFailed
"""
// separate read and writte... | java | public static Object extractReadOrWrite(final Part part, final DeviceAttribute da, final Object readWrite)
throws DevFailed {
// separate read and written values
final Object result;
final int dimRead;
if (da.getDimY() != 0) {
dimRead = da.getDimX() * da.getDimY();
} else {
dimRead = da.getDimX();
... | [
"public",
"static",
"Object",
"extractReadOrWrite",
"(",
"final",
"Part",
"part",
",",
"final",
"DeviceAttribute",
"da",
",",
"final",
"Object",
"readWrite",
")",
"throws",
"DevFailed",
"{",
"// separate read and written values",
"final",
"Object",
"result",
";",
"f... | Extract read or write part of a Tango attribute. For spectrum and image
@param part
@param da
@param readWrite
@return
@throws DevFailed | [
"Extract",
"read",
"or",
"write",
"part",
"of",
"a",
"Tango",
"attribute",
".",
"For",
"spectrum",
"and",
"image"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/client/src/main/java/fr/soleil/tango/clientapi/util/TypeConversionUtil.java#L143-L165 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.