repository_name
stringlengths
7
54
func_path_in_repository
stringlengths
18
196
func_name
stringlengths
7
107
whole_func_string
stringlengths
76
3.82k
language
stringclasses
1 value
func_code_string
stringlengths
76
3.82k
func_code_tokens
listlengths
22
717
func_documentation_string
stringlengths
61
1.98k
func_documentation_tokens
listlengths
1
508
split_name
stringclasses
1 value
func_code_url
stringlengths
111
310
apache/groovy
src/main/groovy/groovy/lang/MetaMethod.java
MetaMethod.doMethodInvoke
public Object doMethodInvoke(Object object, Object[] argumentArray) { argumentArray = coerceArgumentsToClasses(argumentArray); try { return invoke(object, argumentArray); } catch (Exception e) { throw processDoMethodInvokeException(e, object, argumentArray); } }
java
public Object doMethodInvoke(Object object, Object[] argumentArray) { argumentArray = coerceArgumentsToClasses(argumentArray); try { return invoke(object, argumentArray); } catch (Exception e) { throw processDoMethodInvokeException(e, object, argumentArray); } }
[ "public", "Object", "doMethodInvoke", "(", "Object", "object", ",", "Object", "[", "]", "argumentArray", ")", "{", "argumentArray", "=", "coerceArgumentsToClasses", "(", "argumentArray", ")", ";", "try", "{", "return", "invoke", "(", "object", ",", "argumentArray", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "processDoMethodInvokeException", "(", "e", ",", "object", ",", "argumentArray", ")", ";", "}", "}" ]
Invokes the method this object represents. This method is not final but it should be overloaded very carefully and only by generated methods there is no guarantee that it will be called @param object The object the method is to be called at. @param argumentArray Arguments for the method invocation. @return The return value of the invoked method.
[ "Invokes", "the", "method", "this", "object", "represents", ".", "This", "method", "is", "not", "final", "but", "it", "should", "be", "overloaded", "very", "carefully", "and", "only", "by", "generated", "methods", "there", "is", "no", "guarantee", "that", "it", "will", "be", "called" ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/MetaMethod.java#L320-L327
SeaCloudsEU/SeaCloudsPlatform
sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/AgreementRestEntity.java
AgreementRestEntity.getAgreements
@GET public List<IAgreement> getAgreements( @QueryParam("consumerId") String consumerId, @QueryParam("providerId") String providerId, @QueryParam("templateId") String templateId, @QueryParam("active") BooleanParam active) { logger.debug("StartOf getAgreements - REQUEST for /agreements"); AgreementHelperE agreementRestHelper = getAgreementHelper(); List<IAgreement> agreements = agreementRestHelper.getAgreements( consumerId, providerId, templateId, BooleanParam.getValue(active)); return agreements; }
java
@GET public List<IAgreement> getAgreements( @QueryParam("consumerId") String consumerId, @QueryParam("providerId") String providerId, @QueryParam("templateId") String templateId, @QueryParam("active") BooleanParam active) { logger.debug("StartOf getAgreements - REQUEST for /agreements"); AgreementHelperE agreementRestHelper = getAgreementHelper(); List<IAgreement> agreements = agreementRestHelper.getAgreements( consumerId, providerId, templateId, BooleanParam.getValue(active)); return agreements; }
[ "@", "GET", "public", "List", "<", "IAgreement", ">", "getAgreements", "(", "@", "QueryParam", "(", "\"consumerId\"", ")", "String", "consumerId", ",", "@", "QueryParam", "(", "\"providerId\"", ")", "String", "providerId", ",", "@", "QueryParam", "(", "\"templateId\"", ")", "String", "templateId", ",", "@", "QueryParam", "(", "\"active\"", ")", "BooleanParam", "active", ")", "{", "logger", ".", "debug", "(", "\"StartOf getAgreements - REQUEST for /agreements\"", ")", ";", "AgreementHelperE", "agreementRestHelper", "=", "getAgreementHelper", "(", ")", ";", "List", "<", "IAgreement", ">", "agreements", "=", "agreementRestHelper", ".", "getAgreements", "(", "consumerId", ",", "providerId", ",", "templateId", ",", "BooleanParam", ".", "getValue", "(", "active", ")", ")", ";", "return", "agreements", ";", "}" ]
Gets a the list of available agreements from where we can get metrics, host information, etc. <pre> GET /agreements{?providerId,consumerId,active} Request: GET /agreements HTTP/1.1 Response: HTTP/1.1 200 OK Content-type: application/xml {@code <?xml version="1.0" encoding="UTF-8"?> <collection href="/agreements"> <items offset="0" total="1"> <wsag:Agreement xmlns:wsag="http://www.ggf.org/namespaces/ws-agreement" AgreementId="d25eea60-7cfe-11e3-baa7-0800200c9a66"> ... </wsag:Agreement> </items> </collection> } </pre> Example: <li>curl http://localhost:8080/sla-service/agreements</li> <li>curl http://localhost:8080/sla-service/agreements?consumerId=user-10343</li> @throws NotFoundException @throws JAXBException
[ "Gets", "a", "the", "list", "of", "available", "agreements", "from", "where", "we", "can", "get", "metrics", "host", "information", "etc", "." ]
train
https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/AgreementRestEntity.java#L145-L157
JakeWharton/NineOldAndroids
library/src/com/nineoldandroids/animation/ObjectAnimator.java
ObjectAnimator.ofFloat
public static ObjectAnimator ofFloat(Object target, String propertyName, float... values) { ObjectAnimator anim = new ObjectAnimator(target, propertyName); anim.setFloatValues(values); return anim; }
java
public static ObjectAnimator ofFloat(Object target, String propertyName, float... values) { ObjectAnimator anim = new ObjectAnimator(target, propertyName); anim.setFloatValues(values); return anim; }
[ "public", "static", "ObjectAnimator", "ofFloat", "(", "Object", "target", ",", "String", "propertyName", ",", "float", "...", "values", ")", "{", "ObjectAnimator", "anim", "=", "new", "ObjectAnimator", "(", "target", ",", "propertyName", ")", ";", "anim", ".", "setFloatValues", "(", "values", ")", ";", "return", "anim", ";", "}" ]
Constructs and returns an ObjectAnimator that animates between float values. A single value implies that that value is the one being animated to. Two values imply a starting and ending values. More than two values imply a starting value, values to animate through along the way, and an ending value (these values will be distributed evenly across the duration of the animation). @param target The object whose property is to be animated. This object should have a public method on it called <code>setName()</code>, where <code>name</code> is the value of the <code>propertyName</code> parameter. @param propertyName The name of the property being animated. @param values A set of values that the animation will animate between over time. @return An ObjectAnimator object that is set up to animate between the given values.
[ "Constructs", "and", "returns", "an", "ObjectAnimator", "that", "animates", "between", "float", "values", ".", "A", "single", "value", "implies", "that", "that", "value", "is", "the", "one", "being", "animated", "to", ".", "Two", "values", "imply", "a", "starting", "and", "ending", "values", ".", "More", "than", "two", "values", "imply", "a", "starting", "value", "values", "to", "animate", "through", "along", "the", "way", "and", "an", "ending", "value", "(", "these", "values", "will", "be", "distributed", "evenly", "across", "the", "duration", "of", "the", "animation", ")", "." ]
train
https://github.com/JakeWharton/NineOldAndroids/blob/d582f0ec8e79013e9fa96c07986160b52e662e63/library/src/com/nineoldandroids/animation/ObjectAnimator.java#L230-L234
aws/aws-sdk-java
aws-java-sdk-guardduty/src/main/java/com/amazonaws/services/guardduty/model/FindingStatistics.java
FindingStatistics.withCountBySeverity
public FindingStatistics withCountBySeverity(java.util.Map<String, Integer> countBySeverity) { setCountBySeverity(countBySeverity); return this; }
java
public FindingStatistics withCountBySeverity(java.util.Map<String, Integer> countBySeverity) { setCountBySeverity(countBySeverity); return this; }
[ "public", "FindingStatistics", "withCountBySeverity", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "Integer", ">", "countBySeverity", ")", "{", "setCountBySeverity", "(", "countBySeverity", ")", ";", "return", "this", ";", "}" ]
Represents a map of severity to count statistic for a set of findings @param countBySeverity Represents a map of severity to count statistic for a set of findings @return Returns a reference to this object so that method calls can be chained together.
[ "Represents", "a", "map", "of", "severity", "to", "count", "statistic", "for", "a", "set", "of", "findings" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-guardduty/src/main/java/com/amazonaws/services/guardduty/model/FindingStatistics.java#L61-L64
rhuss/jolokia
agent/jmx/src/main/java/org/jolokia/jmx/JolokiaMBeanServer.java
JolokiaMBeanServer.fromJson
Object fromJson(OpenType type, String json) { return converters.getToOpenTypeConverter().convertToObject(type,json); }
java
Object fromJson(OpenType type, String json) { return converters.getToOpenTypeConverter().convertToObject(type,json); }
[ "Object", "fromJson", "(", "OpenType", "type", ",", "String", "json", ")", "{", "return", "converters", ".", "getToOpenTypeConverter", "(", ")", ".", "convertToObject", "(", "type", ",", "json", ")", ";", "}" ]
Convert from JSON for OpenType objects. Throws an {@link IllegalArgumentException} if @param type open type @param json JSON representation to convert from @return the converted object
[ "Convert", "from", "JSON", "for", "OpenType", "objects", ".", "Throws", "an", "{", "@link", "IllegalArgumentException", "}", "if" ]
train
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jmx/src/main/java/org/jolokia/jmx/JolokiaMBeanServer.java#L178-L180
alkacon/opencms-core
src-modules/org/opencms/workplace/tools/searchindex/CmsEditFieldDialog.java
CmsEditFieldDialog.getTokenizedWidgetConfiguration
private List<CmsSelectWidgetOption> getTokenizedWidgetConfiguration() { List<CmsSelectWidgetOption> result = new ArrayList<CmsSelectWidgetOption>(); result.add(new CmsSelectWidgetOption("true", true)); result.add(new CmsSelectWidgetOption("false", false)); result.add(new CmsSelectWidgetOption("untokenized", false)); return result; }
java
private List<CmsSelectWidgetOption> getTokenizedWidgetConfiguration() { List<CmsSelectWidgetOption> result = new ArrayList<CmsSelectWidgetOption>(); result.add(new CmsSelectWidgetOption("true", true)); result.add(new CmsSelectWidgetOption("false", false)); result.add(new CmsSelectWidgetOption("untokenized", false)); return result; }
[ "private", "List", "<", "CmsSelectWidgetOption", ">", "getTokenizedWidgetConfiguration", "(", ")", "{", "List", "<", "CmsSelectWidgetOption", ">", "result", "=", "new", "ArrayList", "<", "CmsSelectWidgetOption", ">", "(", ")", ";", "result", ".", "add", "(", "new", "CmsSelectWidgetOption", "(", "\"true\"", ",", "true", ")", ")", ";", "result", ".", "add", "(", "new", "CmsSelectWidgetOption", "(", "\"false\"", ",", "false", ")", ")", ";", "result", ".", "add", "(", "new", "CmsSelectWidgetOption", "(", "\"untokenized\"", ",", "false", ")", ")", ";", "return", "result", ";", "}" ]
Returns a list for the indexed select box.<p> @return a list for the indexed select box
[ "Returns", "a", "list", "for", "the", "indexed", "select", "box", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/searchindex/CmsEditFieldDialog.java#L180-L187
JavaMoney/jsr354-ri-bp
src/main/java/org/javamoney/moneta/internal/ConfigurableCurrencyUnitProvider.java
ConfigurableCurrencyUnitProvider.registerCurrencyUnit
public static CurrencyUnit registerCurrencyUnit(CurrencyUnit currencyUnit, Locale locale) { Objects.requireNonNull(locale); Objects.requireNonNull(currencyUnit); return ConfigurableCurrencyUnitProvider.currencyUnitsByLocale.put(locale, currencyUnit); }
java
public static CurrencyUnit registerCurrencyUnit(CurrencyUnit currencyUnit, Locale locale) { Objects.requireNonNull(locale); Objects.requireNonNull(currencyUnit); return ConfigurableCurrencyUnitProvider.currencyUnitsByLocale.put(locale, currencyUnit); }
[ "public", "static", "CurrencyUnit", "registerCurrencyUnit", "(", "CurrencyUnit", "currencyUnit", ",", "Locale", "locale", ")", "{", "Objects", ".", "requireNonNull", "(", "locale", ")", ";", "Objects", ".", "requireNonNull", "(", "currencyUnit", ")", ";", "return", "ConfigurableCurrencyUnitProvider", ".", "currencyUnitsByLocale", ".", "put", "(", "locale", ",", "currencyUnit", ")", ";", "}" ]
Registers a bew currency unit under the given Locale. @param currencyUnit the new currency to be registered, not null. @param locale the Locale, not null. @return any unit instance registered previously by this instance, or null.
[ "Registers", "a", "bew", "currency", "unit", "under", "the", "given", "Locale", "." ]
train
https://github.com/JavaMoney/jsr354-ri-bp/blob/9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2/src/main/java/org/javamoney/moneta/internal/ConfigurableCurrencyUnitProvider.java#L90-L94