method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
@Pure public IScriptBuilder createScript(String packageName, ResourceSet resourceSet) { return createScript(packageName, createResource(resourceSet), null); }
IScriptBuilder function(String packageName, ResourceSet resourceSet) { return createScript(packageName, createResource(resourceSet), null); }
/** Create the factory for a Sarl script. * @param packageName the name of the package of the script. * @param resourceSet the resource set in which the script is created. * @return the factory. */
Create the factory for a Sarl script
createScript
{ "repo_name": "sarl/sarl", "path": "main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/CodeBuilderFactory.java", "license": "apache-2.0", "size": 50509 }
[ "io.sarl.lang.codebuilder.builders.IScriptBuilder", "org.eclipse.emf.ecore.resource.ResourceSet" ]
import io.sarl.lang.codebuilder.builders.IScriptBuilder; import org.eclipse.emf.ecore.resource.ResourceSet;
import io.sarl.lang.codebuilder.builders.*; import org.eclipse.emf.ecore.resource.*;
[ "io.sarl.lang", "org.eclipse.emf" ]
io.sarl.lang; org.eclipse.emf;
2,625,214
public Map<Var,Set<Triple>> extractTriplePatternsForProjectionVars(Query query){ Map<Var,Set<Triple>> var2TriplePatterns = new HashMap<>(); for (Var var : query.getProjectVars()) { Set<Triple> triplePatterns = new HashSet<>(); triplePatterns.addAll(extractIngoingTriplePatterns(query, var)); triplePatterns.addAll(extractOutgoingTriplePatterns(query, var)); var2TriplePatterns.put(var, triplePatterns); } return var2TriplePatterns; }
Map<Var,Set<Triple>> function(Query query){ Map<Var,Set<Triple>> var2TriplePatterns = new HashMap<>(); for (Var var : query.getProjectVars()) { Set<Triple> triplePatterns = new HashSet<>(); triplePatterns.addAll(extractIngoingTriplePatterns(query, var)); triplePatterns.addAll(extractOutgoingTriplePatterns(query, var)); var2TriplePatterns.put(var, triplePatterns); } return var2TriplePatterns; }
/** * Returns triple patterns for each projection variable v such that v is either in subject or object position. * @param query The SPARQL query. * @param node * @return */
Returns triple patterns for each projection variable v such that v is either in subject or object position
extractTriplePatternsForProjectionVars
{ "repo_name": "AKSW/SemWeb2NL", "path": "SPARQL2NL/src/main/java/org/aksw/sparql2nl/queryprocessing/TriplePatternExtractor.java", "license": "gpl-3.0", "size": 10612 }
[ "com.hp.hpl.jena.graph.Triple", "com.hp.hpl.jena.query.Query", "com.hp.hpl.jena.sparql.core.Var", "java.util.HashMap", "java.util.HashSet", "java.util.Map", "java.util.Set" ]
import com.hp.hpl.jena.graph.Triple; import com.hp.hpl.jena.query.Query; import com.hp.hpl.jena.sparql.core.Var; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set;
import com.hp.hpl.jena.graph.*; import com.hp.hpl.jena.query.*; import com.hp.hpl.jena.sparql.core.*; import java.util.*;
[ "com.hp.hpl", "java.util" ]
com.hp.hpl; java.util;
2,645,737
private void createInvokeSignature(ServiceLinkResolver resolver, MethodDeclaration invoke) throws JavaModelException { JavaAstModelProducer producer = JavaAstModelProducer.getInstance(); JavaAstElementFactory javaFactory = JavaAstElementFactory.getInstance(); TypeReference rqMsg, rsMsg; { String message = resolver.getRequestMessage(); message = message.substring(message.lastIndexOf(PKG_SEPARATOR) + 1); rqMsg = producer.createTypeReference(message, false); } { String message = resolver.getResponseMessage(); message = message.substring(message.lastIndexOf(PKG_SEPARATOR) + 1); rsMsg = producer.createTypeReference(message, false); } String methodName = INVOKE + NabuccoTransformationUtility.firstToUpper(resolver.getServiceOperation()); javaFactory.getJavaAstMethod().setMethodName(invoke, methodName); javaFactory.getJavaAstMethod().setReturnType(invoke, rsMsg); List<Argument> arguments = javaFactory.getJavaAstMethod().getAllArguments(invoke); if (arguments.size() != 1) { throw new IllegalStateException("Connector Callback Template is not valid."); } javaFactory.getJavaAstArgument().setType(arguments.get(0), rqMsg); }
void function(ServiceLinkResolver resolver, MethodDeclaration invoke) throws JavaModelException { JavaAstModelProducer producer = JavaAstModelProducer.getInstance(); JavaAstElementFactory javaFactory = JavaAstElementFactory.getInstance(); TypeReference rqMsg, rsMsg; { String message = resolver.getRequestMessage(); message = message.substring(message.lastIndexOf(PKG_SEPARATOR) + 1); rqMsg = producer.createTypeReference(message, false); } { String message = resolver.getResponseMessage(); message = message.substring(message.lastIndexOf(PKG_SEPARATOR) + 1); rsMsg = producer.createTypeReference(message, false); } String methodName = INVOKE + NabuccoTransformationUtility.firstToUpper(resolver.getServiceOperation()); javaFactory.getJavaAstMethod().setMethodName(invoke, methodName); javaFactory.getJavaAstMethod().setReturnType(invoke, rsMsg); List<Argument> arguments = javaFactory.getJavaAstMethod().getAllArguments(invoke); if (arguments.size() != 1) { throw new IllegalStateException(STR); } javaFactory.getJavaAstArgument().setType(arguments.get(0), rqMsg); }
/** * Create the method signature. * * @param resolver * the service link resolver * @param invoke * the invoke method * * @throws JavaModelException */
Create the method signature
createInvokeSignature
{ "repo_name": "NABUCCO/org.nabucco.framework.generator", "path": "org.nabucco.framework.generator.compiler/src/main/org/nabucco/framework/generator/compiler/transformation/java/application/connector/NabuccoToJavaDatatypeTargetServiceLinkVisitor.java", "license": "epl-1.0", "size": 23132 }
[ "java.util.List", "org.eclipse.jdt.internal.compiler.ast.Argument", "org.eclipse.jdt.internal.compiler.ast.MethodDeclaration", "org.eclipse.jdt.internal.compiler.ast.TypeReference", "org.nabucco.framework.generator.compiler.transformation.java.application.connector.util.ServiceLinkResolver", "org.nabucco.framework.generator.compiler.transformation.util.NabuccoTransformationUtility", "org.nabucco.framework.mda.model.java.JavaModelException", "org.nabucco.framework.mda.model.java.ast.element.JavaAstElementFactory", "org.nabucco.framework.mda.model.java.ast.produce.JavaAstModelProducer" ]
import java.util.List; import org.eclipse.jdt.internal.compiler.ast.Argument; import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.TypeReference; import org.nabucco.framework.generator.compiler.transformation.java.application.connector.util.ServiceLinkResolver; import org.nabucco.framework.generator.compiler.transformation.util.NabuccoTransformationUtility; import org.nabucco.framework.mda.model.java.JavaModelException; import org.nabucco.framework.mda.model.java.ast.element.JavaAstElementFactory; import org.nabucco.framework.mda.model.java.ast.produce.JavaAstModelProducer;
import java.util.*; import org.eclipse.jdt.internal.compiler.ast.*; import org.nabucco.framework.generator.compiler.transformation.java.application.connector.util.*; import org.nabucco.framework.generator.compiler.transformation.util.*; import org.nabucco.framework.mda.model.java.*; import org.nabucco.framework.mda.model.java.ast.element.*; import org.nabucco.framework.mda.model.java.ast.produce.*;
[ "java.util", "org.eclipse.jdt", "org.nabucco.framework" ]
java.util; org.eclipse.jdt; org.nabucco.framework;
867,992
protected void setBooleans(short s, DataInput in) throws IOException, ClassNotFoundException { if ((s & HAS_PROCESSOR_ID) != 0) { this.processorId = in.readInt(); ReplyProcessor21.setMessageRPId(this.processorId); } if ((s & NOTIFICATION_ONLY) != 0) this.notificationOnly = true; if ((s & HAS_TX_ID) != 0) this.txUniqId = in.readInt(); if ((s & HAS_TX_MEMBERID) != 0) { this.txMemberId = (InternalDistributedMember)DataSerializer.readObject(in); } }
void function(short s, DataInput in) throws IOException, ClassNotFoundException { if ((s & HAS_PROCESSOR_ID) != 0) { this.processorId = in.readInt(); ReplyProcessor21.setMessageRPId(this.processorId); } if ((s & NOTIFICATION_ONLY) != 0) this.notificationOnly = true; if ((s & HAS_TX_ID) != 0) this.txUniqId = in.readInt(); if ((s & HAS_TX_MEMBERID) != 0) { this.txMemberId = (InternalDistributedMember)DataSerializer.readObject(in); } }
/** * Re-construct the booleans using the compressed short. A subclass must override * this method if it is using bits in the compressed short. */
Re-construct the booleans using the compressed short. A subclass must override this method if it is using bits in the compressed short
setBooleans
{ "repo_name": "robertgeiger/incubator-geode", "path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionMessage.java", "license": "apache-2.0", "size": 31662 }
[ "com.gemstone.gemfire.DataSerializer", "com.gemstone.gemfire.distributed.internal.ReplyProcessor21", "com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember", "java.io.DataInput", "java.io.IOException" ]
import com.gemstone.gemfire.DataSerializer; import com.gemstone.gemfire.distributed.internal.ReplyProcessor21; import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember; import java.io.DataInput; import java.io.IOException;
import com.gemstone.gemfire.*; import com.gemstone.gemfire.distributed.internal.*; import com.gemstone.gemfire.distributed.internal.membership.*; import java.io.*;
[ "com.gemstone.gemfire", "java.io" ]
com.gemstone.gemfire; java.io;
219,531
public Cookie[] getCookies() { if (!cookiesParsed) parseCookies(); return cookies; }
Cookie[] function() { if (!cookiesParsed) parseCookies(); return cookies; }
/** * Return the set of Cookies received with this Request. */
Return the set of Cookies received with this Request
getCookies
{ "repo_name": "johnaoahra80/JBOSSWEB_7_5_0_FINAL", "path": "src/main/java/org/apache/catalina/connector/Request.java", "license": "apache-2.0", "size": 102726 }
[ "javax.servlet.http.Cookie" ]
import javax.servlet.http.Cookie;
import javax.servlet.http.*;
[ "javax.servlet" ]
javax.servlet;
260,211
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); m_qnameID = sroot.getComposeState().getQNameID(m_qname); int parentToken = m_parentNode.getXSLToken(); if (parentToken == Constants.ELEMNAME_TEMPLATE || parentToken == Constants.EXSLT_ELEMNAME_FUNCTION) ((ElemTemplate)m_parentNode).m_inArgsSize++; }
void function(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); m_qnameID = sroot.getComposeState().getQNameID(m_qname); int parentToken = m_parentNode.getXSLToken(); if (parentToken == Constants.ELEMNAME_TEMPLATE parentToken == Constants.EXSLT_ELEMNAME_FUNCTION) ((ElemTemplate)m_parentNode).m_inArgsSize++; }
/** * This function is called after everything else has been * recomposed, and allows the template to set remaining * values that may be based on some other property that * depends on recomposition. */
This function is called after everything else has been recomposed, and allows the template to set remaining values that may be based on some other property that depends on recomposition
compose
{ "repo_name": "mirego/j2objc", "path": "xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemParam.java", "license": "apache-2.0", "size": 3610 }
[ "javax.xml.transform.TransformerException" ]
import javax.xml.transform.TransformerException;
import javax.xml.transform.*;
[ "javax.xml" ]
javax.xml;
2,551,900
@Override public void checkAttributeSemantics(PerunSessionImpl sess, User user, Attribute attribute) throws WrongAttributeAssignmentException, WrongReferenceAttributeValueException { // check is the same as VŠUP login try { Attribute a = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, user, VSUP_NAMESPACE); if (!Objects.equals(attribute.getValue(),a.getValue())) { throw new WrongReferenceAttributeValueException(attribute, a, user, null, user, null, "Eduroam login must match VŠUP login "+a.getValue()); } } catch (AttributeNotExistsException ex) { throw new ConsistencyErrorException("Login namespace attribute for VŠUP must exists.", ex); } // check uniqueness super.checkAttributeSemantics(sess, user, attribute); }
void function(PerunSessionImpl sess, User user, Attribute attribute) throws WrongAttributeAssignmentException, WrongReferenceAttributeValueException { try { Attribute a = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, user, VSUP_NAMESPACE); if (!Objects.equals(attribute.getValue(),a.getValue())) { throw new WrongReferenceAttributeValueException(attribute, a, user, null, user, null, STR+a.getValue()); } } catch (AttributeNotExistsException ex) { throw new ConsistencyErrorException(STR, ex); } super.checkAttributeSemantics(sess, user, attribute); }
/** * Checks if the user's login is unique in the namespace organization. * Check if eduroam login is the same as institutional login * * @param sess PerunSession * @param user User to check attribute for * @param attribute Attribute to check value to * @throws InternalErrorException * @throws WrongAttributeAssignmentException */
Checks if the user's login is unique in the namespace organization. Check if eduroam login is the same as institutional login
checkAttributeSemantics
{ "repo_name": "zlamalp/perun", "path": "perun-core/src/main/java/cz/metacentrum/perun/core/impl/modules/attributes/urn_perun_user_attribute_def_def_login_namespace_eduroam_vsup.java", "license": "bsd-2-clause", "size": 4966 }
[ "cz.metacentrum.perun.core.api.Attribute", "cz.metacentrum.perun.core.api.User", "cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException", "cz.metacentrum.perun.core.api.exceptions.ConsistencyErrorException", "cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException", "cz.metacentrum.perun.core.api.exceptions.WrongReferenceAttributeValueException", "cz.metacentrum.perun.core.impl.PerunSessionImpl", "java.util.Objects" ]
import cz.metacentrum.perun.core.api.Attribute; import cz.metacentrum.perun.core.api.User; import cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException; import cz.metacentrum.perun.core.api.exceptions.ConsistencyErrorException; import cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException; import cz.metacentrum.perun.core.api.exceptions.WrongReferenceAttributeValueException; import cz.metacentrum.perun.core.impl.PerunSessionImpl; import java.util.Objects;
import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*; import cz.metacentrum.perun.core.impl.*; import java.util.*;
[ "cz.metacentrum.perun", "java.util" ]
cz.metacentrum.perun; java.util;
1,528,248
@Basic @Column(name = "TOTAL_BALLOTS", precision = 20) public long getTotalBallots() { return totalBallots; }
@Column(name = STR, precision = 20) long function() { return totalBallots; }
/** * Gets the value of the totalBallots property. * */
Gets the value of the totalBallots property
getTotalBallots
{ "repo_name": "Hack23/cia", "path": "model.internal.application.user.impl/src/main/java/com/hack23/cia/model/internal/application/data/party/impl/ViewRiksdagenPartyBallotSupportAnnualSummary.java", "license": "apache-2.0", "size": 6957 }
[ "javax.persistence.Column" ]
import javax.persistence.Column;
import javax.persistence.*;
[ "javax.persistence" ]
javax.persistence;
176,077
protected int getOption(User user, Notification notification, Event event) { return getOption(user, notification.getId(), notification.getResourceFilter(), event .getPriority(), event); }
int function(User user, Notification notification, Event event) { return getOption(user, notification.getId(), notification.getResourceFilter(), event .getPriority(), event); }
/** * Get the user's notification option for this... one of the NotificationService's PREF_ settings */
Get the user's notification option for this... one of the NotificationService's PREF_ settings
getOption
{ "repo_name": "OpenCollabZA/sakai", "path": "kernel/kernel-util/src/main/java/org/sakaiproject/util/EmailNotification.java", "license": "apache-2.0", "size": 25108 }
[ "org.sakaiproject.event.api.Event", "org.sakaiproject.event.api.Notification", "org.sakaiproject.user.api.User" ]
import org.sakaiproject.event.api.Event; import org.sakaiproject.event.api.Notification; import org.sakaiproject.user.api.User;
import org.sakaiproject.event.api.*; import org.sakaiproject.user.api.*;
[ "org.sakaiproject.event", "org.sakaiproject.user" ]
org.sakaiproject.event; org.sakaiproject.user;
2,819,677
InstanceIdentifierBuilder node(QName nodeType); /** * Adds {@link NodeIdentifierWithPredicates} with supplied QName and key values to path arguments of resulting instance identifier. * * @param nodeType QName of {@link NodeIdentifierWithPredicates} which will be added * @param keyValues Map of key components and their respective values for {@link NodeIdentifierWithPredicates}
InstanceIdentifierBuilder node(QName nodeType); /** * Adds {@link NodeIdentifierWithPredicates} with supplied QName and key values to path arguments of resulting instance identifier. * * @param nodeType QName of {@link NodeIdentifierWithPredicates} which will be added * @param keyValues Map of key components and their respective values for {@link NodeIdentifierWithPredicates}
/** * Adds {@link NodeIdentifier} with supplied QName to path arguments of resulting instance identifier. * * @param nodeType QName of {@link NodeIdentifier} which will be added * @return this builder */
Adds <code>NodeIdentifier</code> with supplied QName to path arguments of resulting instance identifier
node
{ "repo_name": "NovusTheory/yangtools", "path": "yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/YangInstanceIdentifier.java", "license": "epl-1.0", "size": 27193 }
[ "java.util.Map", "org.opendaylight.yangtools.yang.common.QName" ]
import java.util.Map; import org.opendaylight.yangtools.yang.common.QName;
import java.util.*; import org.opendaylight.yangtools.yang.common.*;
[ "java.util", "org.opendaylight.yangtools" ]
java.util; org.opendaylight.yangtools;
227,519
public RDFNode nextNode() throws NoSuchElementException;
RDFNode function() throws NoSuchElementException;
/** Return the next RDFNode of the iteration. * @throws NoSuchElementException if there are no more nodes to be returned. * @return The next RDFNode from the iteration. */
Return the next RDFNode of the iteration
nextNode
{ "repo_name": "jianglili007/jena", "path": "jena-core/src/main/java/org/apache/jena/rdf/model/NodeIterator.java", "license": "apache-2.0", "size": 2696 }
[ "java.util.NoSuchElementException" ]
import java.util.NoSuchElementException;
import java.util.*;
[ "java.util" ]
java.util;
1,161,858
public void setSiteService(SiteService siteService) { this.siteService = siteService; }
void function(SiteService siteService) { this.siteService = siteService; }
/** * Set the site service * @param siteService site service */
Set the site service
setSiteService
{ "repo_name": "dnacreative/records-management", "path": "rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java", "license": "lgpl-3.0", "size": 11143 }
[ "org.alfresco.service.cmr.site.SiteService" ]
import org.alfresco.service.cmr.site.SiteService;
import org.alfresco.service.cmr.site.*;
[ "org.alfresco.service" ]
org.alfresco.service;
2,673,215
public static final LocaleData getInstance(ULocale locale) { LocaleData ld = new LocaleData(); ld.bundle = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, locale); ld.langBundle = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_LANG_BASE_NAME, locale); ld.noSubstitute = false; return ld; }
static final LocaleData function(ULocale locale) { LocaleData ld = new LocaleData(); ld.bundle = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, locale); ld.langBundle = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_LANG_BASE_NAME, locale); ld.noSubstitute = false; return ld; }
/** * Gets the LocaleData object associated with the ULocale specified in locale * * @param locale Locale with thich the locale data object is associated. * @return A locale data object. */
Gets the LocaleData object associated with the ULocale specified in locale
getInstance
{ "repo_name": "mirego/j2objc", "path": "jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/LocaleData.java", "license": "apache-2.0", "size": 17579 }
[ "android.icu.impl.ICUData", "android.icu.impl.ICUResourceBundle" ]
import android.icu.impl.ICUData; import android.icu.impl.ICUResourceBundle;
import android.icu.impl.*;
[ "android.icu" ]
android.icu;
1,054,944
@Test public void testIterator() throws InvalidParametersException { String guid = UUID.randomUUID().toString(); GuidPrimaryKey key1 = new GuidPrimaryKey("col", guid); int i = 0; for (IColumnValue colValue : key1) { i++; assertTrue(colValue.hasValue()); } assertTrue(i == 1); } /** * Test method for * {@link com.poesys.db.pk.AbstractSingleValuedPrimaryKey#getSqlColumnList(java.lang.String)}
void function() throws InvalidParametersException { String guid = UUID.randomUUID().toString(); GuidPrimaryKey key1 = new GuidPrimaryKey("col", guid); int i = 0; for (IColumnValue colValue : key1) { i++; assertTrue(colValue.hasValue()); } assertTrue(i == 1); } /** * Test method for * {@link com.poesys.db.pk.AbstractSingleValuedPrimaryKey#getSqlColumnList(java.lang.String)}
/** * Test method for * {@link com.poesys.db.pk.AbstractSingleValuedPrimaryKey#iterator()}. * * @throws InvalidParametersException when there is a null parameter */
Test method for <code>com.poesys.db.pk.AbstractSingleValuedPrimaryKey#iterator()</code>
testIterator
{ "repo_name": "Poesys-Associates/poesys-db", "path": "poesys-db/test/com/poesys/db/pk/GuidPrimaryKeyTest.java", "license": "lgpl-3.0", "size": 8443 }
[ "com.poesys.db.InvalidParametersException", "com.poesys.db.col.IColumnValue", "java.util.UUID", "junit.framework.TestCase", "org.junit.Test" ]
import com.poesys.db.InvalidParametersException; import com.poesys.db.col.IColumnValue; import java.util.UUID; import junit.framework.TestCase; import org.junit.Test;
import com.poesys.db.*; import com.poesys.db.col.*; import java.util.*; import junit.framework.*; import org.junit.*;
[ "com.poesys.db", "java.util", "junit.framework", "org.junit" ]
com.poesys.db; java.util; junit.framework; org.junit;
1,440,855
IPageMapEntry getEntry(final int id);
IPageMapEntry getEntry(final int id);
/** * Retrieves entry with given id. * * @param id * The page identifier * @return Any entry having the given id */
Retrieves entry with given id
getEntry
{ "repo_name": "Servoy/wicket", "path": "wicket/src/main/java/org/apache/wicket/IPageMap.java", "license": "apache-2.0", "size": 4136 }
[ "org.apache.wicket.session.pagemap.IPageMapEntry" ]
import org.apache.wicket.session.pagemap.IPageMapEntry;
import org.apache.wicket.session.pagemap.*;
[ "org.apache.wicket" ]
org.apache.wicket;
2,165,613
protected void handleSpeechRequest(final String inputString) { Utility.toastShort(LandingPageActivity.this, inputString, false); if (inputString.contains(Utility.COMMAND_HELP) || inputString.contains(Utility.COMMAND_DONE) || inputString.contains(Utility.COMMAND_CANCEL) || inputString.contains(Utility.COMMAND_SEND) || inputString.contains(Utility.COMMAND_REQUEST)) { if (inputString.contains(Utility.COMMAND_HELP)) { playMediaPlayer(R.raw.help_send_request); } else if (inputString.contains(Utility.COMMAND_SEND)) { Intent intent = new Intent(LandingPageActivity.this, SendMoneyActivity.class); Utility.handleSendCommand(intent, inputString, name, contactDetailsMap); startActivity(intent); } else if (inputString.contains(Utility.COMMAND_REQUEST)) { Intent intent = new Intent(LandingPageActivity.this, RequestMoneyActivity.class); Utility.handleRequestCommand(intent, inputString, name, contactDetailsMap); startActivity(intent); } else if (inputString.contains(Utility.COMMAND_DONE) || inputString.contains(Utility.COMMAND_CANCEL)) { this.moveTaskToBack(true); } } else { playMediaPlayer(R.raw.help_send_request); } ImageButton speakImageButton = (ImageButton) findViewById(R.id.button); speakImageButton.setBackgroundResource(R.drawable.ic_microphone); }
void function(final String inputString) { Utility.toastShort(LandingPageActivity.this, inputString, false); if (inputString.contains(Utility.COMMAND_HELP) inputString.contains(Utility.COMMAND_DONE) inputString.contains(Utility.COMMAND_CANCEL) inputString.contains(Utility.COMMAND_SEND) inputString.contains(Utility.COMMAND_REQUEST)) { if (inputString.contains(Utility.COMMAND_HELP)) { playMediaPlayer(R.raw.help_send_request); } else if (inputString.contains(Utility.COMMAND_SEND)) { Intent intent = new Intent(LandingPageActivity.this, SendMoneyActivity.class); Utility.handleSendCommand(intent, inputString, name, contactDetailsMap); startActivity(intent); } else if (inputString.contains(Utility.COMMAND_REQUEST)) { Intent intent = new Intent(LandingPageActivity.this, RequestMoneyActivity.class); Utility.handleRequestCommand(intent, inputString, name, contactDetailsMap); startActivity(intent); } else if (inputString.contains(Utility.COMMAND_DONE) inputString.contains(Utility.COMMAND_CANCEL)) { this.moveTaskToBack(true); } } else { playMediaPlayer(R.raw.help_send_request); } ImageButton speakImageButton = (ImageButton) findViewById(R.id.button); speakImageButton.setBackgroundResource(R.drawable.ic_microphone); }
/** * Handle Speech Request for different commands * * @param inputString */
Handle Speech Request for different commands
handleSpeechRequest
{ "repo_name": "gosaliajigar/VAPP", "path": "src/com/rpg/brg/activity/LandingPageActivity.java", "license": "mit", "size": 10744 }
[ "android.content.Intent", "android.widget.ImageButton", "com.rpg.brg.library.utility.Utility" ]
import android.content.Intent; import android.widget.ImageButton; import com.rpg.brg.library.utility.Utility;
import android.content.*; import android.widget.*; import com.rpg.brg.library.utility.*;
[ "android.content", "android.widget", "com.rpg.brg" ]
android.content; android.widget; com.rpg.brg;
2,246,922
private String getHalDocsDomainPath(ZipFile jarFile) throws IOException { ZipEntry manifestEntry = jarFile.getEntry("META-INF/MANIFEST.MF"); if (manifestEntry != null) { try (InputStream is = jarFile.getInputStream(manifestEntry)) { Manifest manifest = new Manifest(is); return manifest.getMainAttributes().getValue(JsonSchemaBundleTracker.HEADER_DOMAIN_PATH); } } return null; }
String function(ZipFile jarFile) throws IOException { ZipEntry manifestEntry = jarFile.getEntry(STR); if (manifestEntry != null) { try (InputStream is = jarFile.getInputStream(manifestEntry)) { Manifest manifest = new Manifest(is); return manifest.getMainAttributes().getValue(JsonSchemaBundleTracker.HEADER_DOMAIN_PATH); } } return null; }
/** * Gets bundle header/mainfest entry Caravan-HalDocs-DomainPath from given JAR file. * @param jarFile JAR file * @return Header value or null * @throws IOException */
Gets bundle header/mainfest entry Caravan-HalDocs-DomainPath from given JAR file
getHalDocsDomainPath
{ "repo_name": "wcm-io-caravan/caravan-hal", "path": "docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java", "license": "apache-2.0", "size": 13987 }
[ "io.wcm.caravan.hal.docs.impl.JsonSchemaBundleTracker", "java.io.IOException", "java.io.InputStream", "java.util.jar.Manifest", "java.util.zip.ZipEntry", "java.util.zip.ZipFile" ]
import io.wcm.caravan.hal.docs.impl.JsonSchemaBundleTracker; import java.io.IOException; import java.io.InputStream; import java.util.jar.Manifest; import java.util.zip.ZipEntry; import java.util.zip.ZipFile;
import io.wcm.caravan.hal.docs.impl.*; import java.io.*; import java.util.jar.*; import java.util.zip.*;
[ "io.wcm.caravan", "java.io", "java.util" ]
io.wcm.caravan; java.io; java.util;
2,299,812
public void fillEncryptionData(ParsableByteArray source) { source.readBytes(sampleEncryptionData.data, 0, sampleEncryptionDataLength); sampleEncryptionData.setPosition(0); sampleEncryptionDataNeedsFill = false; }
void function(ParsableByteArray source) { source.readBytes(sampleEncryptionData.data, 0, sampleEncryptionDataLength); sampleEncryptionData.setPosition(0); sampleEncryptionDataNeedsFill = false; }
/** * Fills {@link #sampleEncryptionData} from the provided source. * * @param source A source from which to read the encryption data. */
Fills <code>#sampleEncryptionData</code> from the provided source
fillEncryptionData
{ "repo_name": "Puja-Mishra/Android_FreeChat", "path": "Telegram-master/TMessagesProj/src/main/java/org/telegram/messenger/exoplayer/extractor/mp4/TrackFragment.java", "license": "gpl-2.0", "size": 5946 }
[ "org.telegram.messenger.exoplayer.util.ParsableByteArray" ]
import org.telegram.messenger.exoplayer.util.ParsableByteArray;
import org.telegram.messenger.exoplayer.util.*;
[ "org.telegram.messenger" ]
org.telegram.messenger;
1,508,686
@Override() public java.lang.Class<?> getJavaClass( ) { return org.opennms.netmgt.xml.eventconf.Autoacknowledge.class; }
@Override() java.lang.Class<?> function( ) { return org.opennms.netmgt.xml.eventconf.Autoacknowledge.class; }
/** * Method getJavaClass. * * @return the Java class represented by this descriptor. */
Method getJavaClass
getJavaClass
{ "repo_name": "rfdrake/opennms", "path": "opennms-config-model/src/main/java/org/opennms/netmgt/xml/eventconf/descriptors/AutoacknowledgeDescriptor.java", "license": "gpl-2.0", "size": 8573 }
[ "org.opennms.netmgt.xml.eventconf.Autoacknowledge" ]
import org.opennms.netmgt.xml.eventconf.Autoacknowledge;
import org.opennms.netmgt.xml.eventconf.*;
[ "org.opennms.netmgt" ]
org.opennms.netmgt;
1,874,986
private FlowBreadcrumbDTO createBreadcrumbDto(final ProcessGroup group) { if (group == null) { return null; } final FlowBreadcrumbDTO dto = new FlowBreadcrumbDTO(); dto.setId(group.getIdentifier()); dto.setName(group.getName()); final VersionControlInformationDTO versionControlInformation = createVersionControlInformationDto(group); dto.setVersionControlInformation(versionControlInformation); return dto; }
FlowBreadcrumbDTO function(final ProcessGroup group) { if (group == null) { return null; } final FlowBreadcrumbDTO dto = new FlowBreadcrumbDTO(); dto.setId(group.getIdentifier()); dto.setName(group.getName()); final VersionControlInformationDTO versionControlInformation = createVersionControlInformationDto(group); dto.setVersionControlInformation(versionControlInformation); return dto; }
/** * Creates a FlowBreadcrumbDTO from the specified parent ProcessGroup. * * @param group group * @return dto */
Creates a FlowBreadcrumbDTO from the specified parent ProcessGroup
createBreadcrumbDto
{ "repo_name": "Xsixteen/nifi", "path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java", "license": "apache-2.0", "size": 202415 }
[ "org.apache.nifi.groups.ProcessGroup", "org.apache.nifi.web.api.dto.flow.FlowBreadcrumbDTO" ]
import org.apache.nifi.groups.ProcessGroup; import org.apache.nifi.web.api.dto.flow.FlowBreadcrumbDTO;
import org.apache.nifi.groups.*; import org.apache.nifi.web.api.dto.flow.*;
[ "org.apache.nifi" ]
org.apache.nifi;
65,174
@Test @BenchmarkOptions(benchmarkRounds = 1, warmupRounds = 0, concurrency = 1) // round: 0.00 [+- 0.00], round.block: 0.00 [+- 0.00], round.gc: 0.00 [+- // 0.00], GC.calls: 0, GC.time: 0.00, time.total: 0.73, time.warmup: 0.73, // time.bench: 0.01 public void trueFalse() { System.out.println(false & false & false);// false System.out.println(true & false & true);// false System.out.println(true & true & true);// true // System.out.println(false | false | false);// false System.out.println(true | false | true);// true System.out.println(true | true | true);// true }
@BenchmarkOptions(benchmarkRounds = 1, warmupRounds = 0, concurrency = 1) void function() { System.out.println(false & false & false); System.out.println(true & false & true); System.out.println(true & true & true); System.out.println(true false true); System.out.println(true true true); }
/** * True false. */
True false
trueFalse
{ "repo_name": "mixaceh/openyu-commons", "path": "openyu-commons-core/src/test/java/org/openyu/commons/lang/BooleanHelperTest.java", "license": "gpl-2.0", "size": 6303 }
[ "com.carrotsearch.junitbenchmarks.BenchmarkOptions" ]
import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
import com.carrotsearch.junitbenchmarks.*;
[ "com.carrotsearch.junitbenchmarks" ]
com.carrotsearch.junitbenchmarks;
2,562,600
public ObjectId getObjectId() { if ( transMeta == null ) { return null; } return transMeta.getObjectId(); }
ObjectId function() { if ( transMeta == null ) { return null; } return transMeta.getObjectId(); }
/** * Gets the object ID. * * @return the object ID * @see org.pentaho.di.core.logging.LoggingObjectInterface#getObjectId() */
Gets the object ID
getObjectId
{ "repo_name": "EcoleKeine/pentaho-kettle", "path": "engine/src/org/pentaho/di/trans/Trans.java", "license": "apache-2.0", "size": 194675 }
[ "org.pentaho.di.repository.ObjectId" ]
import org.pentaho.di.repository.ObjectId;
import org.pentaho.di.repository.*;
[ "org.pentaho.di" ]
org.pentaho.di;
2,891,915
String os = System.getProperty("os.name").toLowerCase(); if (! os.startsWith("mac os x")) { return; } ClassLoader cl = OSXApplication.class.getClassLoader(); if (cl == null) { cl = Thread.currentThread().getContextClassLoader(); } try { Class<?> appListener = cl.loadClass("net.sf.taverna.osx.OSXApplicationListener"); Method register = appListener.getMethod("register", OSXListener.class); register.invoke(null, new Object[] { listener }); //System.out.println("Registered!"); // Ignore all errors.. // TODO: log exceptions (which logger?) } catch (ClassNotFoundException e) { } catch (SecurityException e) { } catch (NoSuchMethodException e) { } catch (IllegalArgumentException e) { } catch (IllegalAccessException e) { } catch (NullPointerException e) { } catch (InvocationTargetException e) { } }
String os = System.getProperty(STR).toLowerCase(); if (! os.startsWith(STR)) { return; } ClassLoader cl = OSXApplication.class.getClassLoader(); if (cl == null) { cl = Thread.currentThread().getContextClassLoader(); } try { Class<?> appListener = cl.loadClass(STR); Method register = appListener.getMethod(STR, OSXListener.class); register.invoke(null, new Object[] { listener }); } catch (ClassNotFoundException e) { } catch (SecurityException e) { } catch (NoSuchMethodException e) { } catch (IllegalArgumentException e) { } catch (IllegalAccessException e) { } catch (NullPointerException e) { } catch (InvocationTargetException e) { } }
/** * Register the given listener with the OS X Java backend. If the current * operating system is not OS X, this method will not do anything. * <p> * The OSXApplicationListener class and its dependencies are loaded * dynamically to avoid compile- and linkage problems on non-OSX platforms. * * @param listener * Listener that will be callbacked from the OS X Java * implementation. */
Register the given listener with the OS X Java backend. If the current operating system is not OS X, this method will not do anything. The OSXApplicationListener class and its dependencies are loaded dynamically to avoid compile- and linkage problems on non-OSX platforms
setListener
{ "repo_name": "taverna/taverna2-osxapplication", "path": "src/main/java/net/sf/taverna/osx/OSXApplication.java", "license": "lgpl-2.1", "size": 2185 }
[ "java.lang.reflect.InvocationTargetException", "java.lang.reflect.Method" ]
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
2,094,969
EClass getInterest_Expense();
EClass getInterest_Expense();
/** * Returns the meta object for class '{@link TaxationWithRoot.Interest_Expense <em>Interest Expense</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Interest Expense</em>'. * @see TaxationWithRoot.Interest_Expense * @generated */
Returns the meta object for class '<code>TaxationWithRoot.Interest_Expense Interest Expense</code>'.
getInterest_Expense
{ "repo_name": "viatra/VIATRA-Generator", "path": "Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/TaxationWithRoot/TaxationPackage.java", "license": "epl-1.0", "size": 295635 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,233,179
@Test public void testOnMessage_withNullInput() throws Exception { Properties props = new Properties(); props.setProperty("field.1.path", "field.value"); props.setProperty("field.1.expression", "va..e"); props.setProperty("field.1.type", "STRING"); JsonContentFilter filter = new JsonContentFilter(); filter.initialize(props); StreamingDataMessage[] messages = filter.onMessage(null); Assert.assertNotNull("Result must not be null", messages); Assert.assertEquals("Result size must be 0", 0, messages.length); }
void function() throws Exception { Properties props = new Properties(); props.setProperty(STR, STR); props.setProperty(STR, "va..e"); props.setProperty(STR, STR); JsonContentFilter filter = new JsonContentFilter(); filter.initialize(props); StreamingDataMessage[] messages = filter.onMessage(null); Assert.assertNotNull(STR, messages); Assert.assertEquals(STR, 0, messages.length); }
/** * Test case for {@link JsonContentFilter#onMessage(StreamingDataMessage)} being provided null as input */
Test case for <code>JsonContentFilter#onMessage(StreamingDataMessage)</code> being provided null as input
testOnMessage_withNullInput
{ "repo_name": "ottogroup/SPQR", "path": "spqr-operators/spqr-json/src/test/java/com/ottogroup/bi/spqr/operator/json/filter/JsonContentFilterTest.java", "license": "apache-2.0", "size": 9244 }
[ "com.ottogroup.bi.spqr.pipeline.message.StreamingDataMessage", "java.util.Properties", "org.junit.Assert" ]
import com.ottogroup.bi.spqr.pipeline.message.StreamingDataMessage; import java.util.Properties; import org.junit.Assert;
import com.ottogroup.bi.spqr.pipeline.message.*; import java.util.*; import org.junit.*;
[ "com.ottogroup.bi", "java.util", "org.junit" ]
com.ottogroup.bi; java.util; org.junit;
1,523,420
@SuppressLint("NewApi") @SuppressWarnings("deprecation") public long getBlockCountLong() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { return mStatFs.getBlockCountLong(); } else { return mStatFs.getBlockCount(); } }
@SuppressLint(STR) @SuppressWarnings(STR) long function() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { return mStatFs.getBlockCountLong(); } else { return mStatFs.getBlockCount(); } }
/** * The total number of blocks on the file system. This corresponds to the * Unix {@code statvfs.f_blocks} field. */
The total number of blocks on the file system. This corresponds to the Unix statvfs.f_blocks field
getBlockCountLong
{ "repo_name": "BharathKoneti/FileExplor", "path": "explorer/src/main/java/com/bkoneti/fileManager/utils/StatFsCompat.java", "license": "gpl-3.0", "size": 4019 }
[ "android.annotation.SuppressLint", "android.os.Build" ]
import android.annotation.SuppressLint; import android.os.Build;
import android.annotation.*; import android.os.*;
[ "android.annotation", "android.os" ]
android.annotation; android.os;
1,419,825
private static void setOption(Configuration conf, String key, Object value) { if (value instanceof Boolean) { conf.getBoolean(key, (Boolean) value); } else if (value instanceof Byte || value instanceof Short || value instanceof Integer) { conf.setInt(key, ((Number) value).intValue()); } else if (value instanceof Long) { conf.setLong(key, (Long) value); } else if (value instanceof Float || value instanceof Double) { conf.setFloat(key, ((Number) value).floatValue()); } else if (value instanceof String) { conf.set(key, value.toString()); } else if (value instanceof Class) { conf.set(key, ((Class) value).getName()); } else { throw new IllegalArgumentException( "Don't know how to handle option key: " + key + ", value: " + value + ", value type: " + value.getClass()); } }
static void function(Configuration conf, String key, Object value) { if (value instanceof Boolean) { conf.getBoolean(key, (Boolean) value); } else if (value instanceof Byte value instanceof Short value instanceof Integer) { conf.setInt(key, ((Number) value).intValue()); } else if (value instanceof Long) { conf.setLong(key, (Long) value); } else if (value instanceof Float value instanceof Double) { conf.setFloat(key, ((Number) value).floatValue()); } else if (value instanceof String) { conf.set(key, value.toString()); } else if (value instanceof Class) { conf.set(key, ((Class) value).getName()); } else { throw new IllegalArgumentException( STR + key + STR + value + STR + value.getClass()); } }
/** * Set arbitrary option of unknown type in Configuration * * @param conf Configuration * @param key String key * @param value Object to set */
Set arbitrary option of unknown type in Configuration
setOption
{ "repo_name": "dcrankshaw/giraph", "path": "giraph-hive/src/main/java/org/apache/giraph/hive/jython/HiveJythonUtils.java", "license": "apache-2.0", "size": 34257 }
[ "org.apache.hadoop.conf.Configuration" ]
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,909,401
void generateImplicitJobsForExplicitJobs(JobRecord job);
void generateImplicitJobsForExplicitJobs(JobRecord job);
/** * Generate all the implicit sub jobs for the job * * @param job */
Generate all the implicit sub jobs for the job
generateImplicitJobsForExplicitJobs
{ "repo_name": "ChiralBehaviors/Ultrastructure", "path": "animations/src/main/java/com/chiralbehaviors/CoRE/meta/JobModel.java", "license": "agpl-3.0", "size": 14497 }
[ "com.chiralbehaviors.CoRE" ]
import com.chiralbehaviors.CoRE;
import com.chiralbehaviors.*;
[ "com.chiralbehaviors" ]
com.chiralbehaviors;
1,636,188
@Test public void test51678And51524() throws IOException { // YK: the test will run only if the poi.test.remote system property is // set. // TODO: refactor into something nicer! if (System.getProperty("poi.test.remote" ) != null ) { String href = "http://domex.nps.edu/corp/files/govdocs1/007/007488.doc"; HWPFDocument hwpfDocument = HWPFTestDataSamples .openRemoteFile(href); WordExtractor wordExtractor = new WordExtractor(hwpfDocument); try { wordExtractor.getText(); } finally { wordExtractor.close(); } } }
void function() throws IOException { if (System.getProperty(STR ) != null ) { String href = "http: HWPFDocument hwpfDocument = HWPFTestDataSamples .openRemoteFile(href); WordExtractor wordExtractor = new WordExtractor(hwpfDocument); try { wordExtractor.getText(); } finally { wordExtractor.close(); } } }
/** * Bug 51678 - Extracting text from Bug51524.zip is slow Bug 51524 - * PapBinTable constructor is slow */
Bug 51678 - Extracting text from Bug51524.zip is slow Bug 51524 - PapBinTable constructor is slow
test51678And51524
{ "repo_name": "lvweiwolf/poi-3.16", "path": "src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java", "license": "apache-2.0", "size": 32764 }
[ "java.io.IOException", "org.apache.poi.hwpf.HWPFDocument", "org.apache.poi.hwpf.HWPFTestDataSamples", "org.apache.poi.hwpf.extractor.WordExtractor" ]
import java.io.IOException; import org.apache.poi.hwpf.HWPFDocument; import org.apache.poi.hwpf.HWPFTestDataSamples; import org.apache.poi.hwpf.extractor.WordExtractor;
import java.io.*; import org.apache.poi.hwpf.*; import org.apache.poi.hwpf.extractor.*;
[ "java.io", "org.apache.poi" ]
java.io; org.apache.poi;
2,532,042
public boolean deleteUser(User user){ DeleteUserTask deleteUserTask = new DeleteUserTask(); deleteUserTask.execute(user); return true; } public static class AddUserTask extends AsyncTask<User, Void, Boolean> {
boolean function(User user){ DeleteUserTask deleteUserTask = new DeleteUserTask(); deleteUserTask.execute(user); return true; } public static class AddUserTask extends AsyncTask<User, Void, Boolean> {
/** * delete user from db * @param user * @return boolean */
delete user from db
deleteUser
{ "repo_name": "bfleyshe/ProjectAttitude", "path": "ProjectAttitude/app/src/main/java/com/projectattitude/projectattitude/Controllers/ElasticSearchUserController.java", "license": "mit", "size": 16146 }
[ "android.os.AsyncTask", "com.projectattitude.projectattitude.Objects" ]
import android.os.AsyncTask; import com.projectattitude.projectattitude.Objects;
import android.os.*; import com.projectattitude.projectattitude.*;
[ "android.os", "com.projectattitude.projectattitude" ]
android.os; com.projectattitude.projectattitude;
1,383,308
public void calculate() { // Don't do it more than once if ( doneCalculation ) { return; } doneCalculation = true; // For all nodes... for ( Node startNode : nodeSet ) { // Prepare the singleSourceShortestPath singleSourceShortestPath.reset(); singleSourceShortestPath.setStartNode( startNode ); // Process processShortestPaths( startNode, singleSourceShortestPath ); } }
void function() { if ( doneCalculation ) { return; } doneCalculation = true; for ( Node startNode : nodeSet ) { singleSourceShortestPath.reset(); singleSourceShortestPath.setStartNode( startNode ); processShortestPaths( startNode, singleSourceShortestPath ); } }
/** * Runs the calculation. This should not need to be called explicitly, since * all attempts to retrieve any kind of result should automatically call * this. */
Runs the calculation. This should not need to be called explicitly, since all attempts to retrieve any kind of result should automatically call this
calculate
{ "repo_name": "dksaputra/community", "path": "graph-algo/src/main/java/org/neo4j/graphalgo/impl/centrality/ShortestPathBasedCentrality.java", "license": "gpl-3.0", "size": 6329 }
[ "org.neo4j.graphdb.Node" ]
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.*;
[ "org.neo4j.graphdb" ]
org.neo4j.graphdb;
1,093,627
public static void main(String[] arguments) throws Exception { DistributedMigrationInformation info = new DistributedMigrationInformation(); String migrationName = System.getProperty("migration.systemname"); String migrationSettings = ConfigurationUtil.getOptionalParam("migration.settings", System.getProperties(), arguments, 1); if (migrationName == null) { if ((arguments != null) && (arguments.length > 0)) { migrationName = arguments[0].trim(); } else { throw new IllegalArgumentException("The migration.systemname " + "system property is required"); } } // info.getMigrationInformation(migrationName); info.getMigrationInformation(migrationName, migrationSettings); }
static void function(String[] arguments) throws Exception { DistributedMigrationInformation info = new DistributedMigrationInformation(); String migrationName = System.getProperty(STR); String migrationSettings = ConfigurationUtil.getOptionalParam(STR, System.getProperties(), arguments, 1); if (migrationName == null) { if ((arguments != null) && (arguments.length > 0)) { migrationName = arguments[0].trim(); } else { throw new IllegalArgumentException(STR + STR); } } info.getMigrationInformation(migrationName, migrationSettings); }
/** * Get the migration level information for the given system name * * @param arguments the command line arguments, if any (none are used) * @throws Exception if anything goes wrong */
Get the migration level information for the given system name
main
{ "repo_name": "lamsfoundation/lams", "path": "3rdParty_sources/tacitknowledge/autopatch/src/main/java/com/tacitknowledge/util/migration/jdbc/DistributedMigrationInformation.java", "license": "gpl-2.0", "size": 5868 }
[ "com.tacitknowledge.util.migration.jdbc.util.ConfigurationUtil" ]
import com.tacitknowledge.util.migration.jdbc.util.ConfigurationUtil;
import com.tacitknowledge.util.migration.jdbc.util.*;
[ "com.tacitknowledge.util" ]
com.tacitknowledge.util;
816,222
public void downloadImageToStorage(String storageFile, SuccessCallback<Image> onSuccess, boolean useCache) { downloadImageToStorage(storageFile, onSuccess, new CallbackAdapter<Image>(), useCache); }
void function(String storageFile, SuccessCallback<Image> onSuccess, boolean useCache) { downloadImageToStorage(storageFile, onSuccess, new CallbackAdapter<Image>(), useCache); }
/** * Downloads an image to a specified storage file asynchronously and calls the onSuccessCallback with the resulting image. * If useCache is true, then this will first try to load the image from Storage if it exists. * * @param storageFile The storage file where the file should be saved. * @param onSuccess Callback called if the image is successfully loaded. * @param useCache If true, then this will first check the storage to see if the image is already downloaded. * @since 3.4 */
Downloads an image to a specified storage file asynchronously and calls the onSuccessCallback with the resulting image. If useCache is true, then this will first try to load the image from Storage if it exists
downloadImageToStorage
{ "repo_name": "Firethunder/CodenameOne", "path": "CodenameOne/src/com/codename1/io/ConnectionRequest.java", "license": "gpl-2.0", "size": 90869 }
[ "com.codename1.ui.Image", "com.codename1.util.CallbackAdapter", "com.codename1.util.SuccessCallback" ]
import com.codename1.ui.Image; import com.codename1.util.CallbackAdapter; import com.codename1.util.SuccessCallback;
import com.codename1.ui.*; import com.codename1.util.*;
[ "com.codename1.ui", "com.codename1.util" ]
com.codename1.ui; com.codename1.util;
1,422,062
@Test public void testRemoteExecuteVeryLargeQuery() throws Exception { ConnectionSpec.getDatabaseLock().lock(); try { // Before the bug was fixed, a value over 7998 caused an HTTP 413. // 16K bytes, I guess. checkLargeQuery(8); checkLargeQuery(240); checkLargeQuery(8000); checkLargeQuery(240000); } finally { ConnectionSpec.getDatabaseLock().unlock(); } }
@Test void function() throws Exception { ConnectionSpec.getDatabaseLock().lock(); try { checkLargeQuery(8); checkLargeQuery(240); checkLargeQuery(8000); checkLargeQuery(240000); } finally { ConnectionSpec.getDatabaseLock().unlock(); } }
/** Test case for * <a href="https://issues.apache.org/jira/browse/CALCITE-780">[CALCITE-780] * HTTP error 413 when sending a long string to the Avatica server</a>. */
Test case for [CALCITE-780]
testRemoteExecuteVeryLargeQuery
{ "repo_name": "apache/calcite-avatica", "path": "server/src/test/java/org/apache/calcite/avatica/remote/AlternatingRemoteMetaTest.java", "license": "apache-2.0", "size": 14540 }
[ "org.apache.calcite.avatica.ConnectionSpec", "org.junit.Test" ]
import org.apache.calcite.avatica.ConnectionSpec; import org.junit.Test;
import org.apache.calcite.avatica.*; import org.junit.*;
[ "org.apache.calcite", "org.junit" ]
org.apache.calcite; org.junit;
2,816,844
public EntityResolver getEntityResolver() { return null; }
EntityResolver function() { return null; }
/** * Not supported. * * @see org.xml.sax.XMLReader#getEntityResolver() */
Not supported
getEntityResolver
{ "repo_name": "NCIP/cadsr-cgmdr-nci-uk", "path": "src/org/exist/cocoon/XMLReaderWrapper.java", "license": "bsd-3-clause", "size": 4868 }
[ "org.xml.sax.EntityResolver" ]
import org.xml.sax.EntityResolver;
import org.xml.sax.*;
[ "org.xml.sax" ]
org.xml.sax;
798,987
public long execute() { if (mPreparedStatement == null) { throw new IllegalStateException("you must prepare this inserter before calling " + "execute"); } try { if (DEBUG) Log.v(TAG, "--- doing insert or replace in table " + mTableName); return mPreparedStatement.executeInsert(); } catch (SQLException e) { Log.e(TAG, "Error executing InsertHelper with table " + mTableName, e); return -1; } finally { // you can only call this once per prepare mPreparedStatement = null; } }
long function() { if (mPreparedStatement == null) { throw new IllegalStateException(STR + STR); } try { if (DEBUG) Log.v(TAG, STR + mTableName); return mPreparedStatement.executeInsert(); } catch (SQLException e) { Log.e(TAG, STR + mTableName, e); return -1; } finally { mPreparedStatement = null; } }
/** * Execute the previously prepared insert or replace using the bound values * since the last call to prepareForInsert or prepareForReplace. * * <p>Note that calling bind() and then execute() is not thread-safe. The only thread-safe * way to use this class is to call insert() or replace(). * * @return the row ID of the newly inserted row, or -1 if an * error occurred */
Execute the previously prepared insert or replace using the bound values since the last call to prepareForInsert or prepareForReplace. Note that calling bind() and then execute() is not thread-safe. The only thread-safe way to use this class is to call insert() or replace()
execute
{ "repo_name": "JuudeDemos/android-sdk-20", "path": "src/android/database/DatabaseUtils.java", "license": "apache-2.0", "size": 54432 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
889,993
InetAddress getLocalAddress();
InetAddress getLocalAddress();
/** * Returns the local address of the underlying socket connection. * * @return the local address of the underlying socket connection. * @since 1.0.0 */
Returns the local address of the underlying socket connection
getLocalAddress
{ "repo_name": "asterisk-java/asterisk-java", "path": "src/main/java/org/asteriskjava/manager/ManagerConnection.java", "license": "apache-2.0", "size": 19320 }
[ "java.net.InetAddress" ]
import java.net.InetAddress;
import java.net.*;
[ "java.net" ]
java.net;
1,257,267
static final String getKeyWords(Map<byte[], byte[]> map) { return getString(map.get(KEYWORDS), null); }
static final String getKeyWords(Map<byte[], byte[]> map) { return getString(map.get(KEYWORDS), null); }
/** * get the KEYWORD from the map * @param map * @return */
get the KEYWORD from the map
getKeyWords
{ "repo_name": "beeldengeluid/zieook", "path": "backend/zieook-api/zieook-api-data/src/main/java/nl/gridline/zieook/model/ModelConstants.java", "license": "apache-2.0", "size": 18942 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,965,937
private List findUnwantedElements(Collection fromList, Collection controlList, OjbCollectionAware template, int depth) { List toRemove = new ArrayList(); Iterator iter = fromList.iterator(); while (iter.hasNext()) { PersistableBusinessObject copyLine = (PersistableBusinessObject) iter.next(); PersistableBusinessObject line = (PersistableBusinessObject) PurApObjectUtils.retrieveObjectWithIdentitcalKey(controlList, copyLine); if (ObjectUtils.isNull(line)) { toRemove.add(copyLine); } else { // since we're not deleting try to recurse on this element processCollectionsRecurse(template, line, copyLine, depth); } } return toRemove; }
List function(Collection fromList, Collection controlList, OjbCollectionAware template, int depth) { List toRemove = new ArrayList(); Iterator iter = fromList.iterator(); while (iter.hasNext()) { PersistableBusinessObject copyLine = (PersistableBusinessObject) iter.next(); PersistableBusinessObject line = (PersistableBusinessObject) PurApObjectUtils.retrieveObjectWithIdentitcalKey(controlList, copyLine); if (ObjectUtils.isNull(line)) { toRemove.add(copyLine); } else { processCollectionsRecurse(template, line, copyLine, depth); } } return toRemove; }
/** * This method identifies items in the first List that are not contained in the second List. It is similar to the (optional) * java.util.List retainAll method. * * @param fromList list from the database * @param controlList list from the object * @return true iff one or more items were removed */
This method identifies items in the first List that are not contained in the second List. It is similar to the (optional) java.util.List retainAll method
findUnwantedElements
{ "repo_name": "Ariah-Group/Finance", "path": "af_webapp/src/main/java/org/kuali/kfs/module/purap/util/PurApOjbCollectionHelper.java", "license": "apache-2.0", "size": 7100 }
[ "java.util.ArrayList", "java.util.Collection", "java.util.Iterator", "java.util.List", "org.kuali.rice.krad.bo.PersistableBusinessObject", "org.kuali.rice.krad.util.ObjectUtils", "org.kuali.rice.krad.util.OjbCollectionAware" ]
import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import org.kuali.rice.krad.bo.PersistableBusinessObject; import org.kuali.rice.krad.util.ObjectUtils; import org.kuali.rice.krad.util.OjbCollectionAware;
import java.util.*; import org.kuali.rice.krad.bo.*; import org.kuali.rice.krad.util.*;
[ "java.util", "org.kuali.rice" ]
java.util; org.kuali.rice;
1,609,318
public static String getManifestInformation(Class<?> target) throws ManipulationException { String result = ""; if (target == null) { throw new ManipulationException( "No target specified." ); } try { final CodeSource cs = target.getProtectionDomain().getCodeSource(); if ( cs == null ) { logger.debug( "Unable to retrieve manifest for {} as CodeSource was null for the protection domain ({})", target, target.getProtectionDomain() ); } else { final URL jarUrl = cs.getLocation(); if ( new File( jarUrl.getPath() ).isDirectory() ) { logger.debug( "Unable to retrieve manifest for {} as location is a directory not a jar ({})", target, jarUrl.getPath() ); } else { try (JarInputStream jarStream = new JarInputStream( jarUrl.openStream() )) { final Manifest manifest = jarStream.getManifest(); if (manifest != null) { result = manifest.getMainAttributes().getValue( "Implementation-Version" ); result += " ( SHA: " + manifest.getMainAttributes().getValue( "Scm-Revision" ) + " )"; } } } } } catch ( final IOException e ) { throw new ManipulationException( "Error retrieving information from manifest", e ); } return result; }
static String function(Class<?> target) throws ManipulationException { String result = STRNo target specified.STRUnable to retrieve manifest for {} as CodeSource was null for the protection domain ({})STRUnable to retrieve manifest for {} as location is a directory not a jar ({})STRImplementation-VersionSTR ( SHA: STRScm-RevisionSTR )STRError retrieving information from manifest", e ); } return result; }
/** * Retrieves the SHA this was built with. * * @param target the Class within the jar to find and locate. * @return the GIT sha of this codebase. * @throws ManipulationException if an error occurs. */
Retrieves the SHA this was built with
getManifestInformation
{ "repo_name": "release-engineering/pom-manipulation-ext", "path": "common/src/main/java/org/commonjava/maven/ext/common/util/ManifestUtils.java", "license": "apache-2.0", "size": 3155 }
[ "java.security.CodeSource", "org.commonjava.maven.ext.common.ManipulationException" ]
import java.security.CodeSource; import org.commonjava.maven.ext.common.ManipulationException;
import java.security.*; import org.commonjava.maven.ext.common.*;
[ "java.security", "org.commonjava.maven" ]
java.security; org.commonjava.maven;
2,305,213
@FIXVersion(introduced = "4.4") @TagNumRef(tagNum = TagNum.DlvyInstType) public void setDlvyInstType(DlvyInstType dlvyInstType) { this.dlvyInstType = dlvyInstType; }
@FIXVersion(introduced = "4.4") @TagNumRef(tagNum = TagNum.DlvyInstType) void function(DlvyInstType dlvyInstType) { this.dlvyInstType = dlvyInstType; }
/** * Message field setter. * @param dlvyInstType field value */
Message field setter
setDlvyInstType
{ "repo_name": "marvisan/HadesFIX", "path": "Model/src/main/java/net/hades/fix/message/group/DeliveryInstructionGroup.java", "license": "gpl-3.0", "size": 11975 }
[ "net.hades.fix.message.anno.FIXVersion", "net.hades.fix.message.anno.TagNumRef", "net.hades.fix.message.type.DlvyInstType", "net.hades.fix.message.type.TagNum" ]
import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.DlvyInstType; import net.hades.fix.message.type.TagNum;
import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*;
[ "net.hades.fix" ]
net.hades.fix;
44,008
default Version getVersion() { return getNode().getVersion(); }
default Version getVersion() { return getNode().getVersion(); }
/** * Returns the version of the node this connection was established with. */
Returns the version of the node this connection was established with
getVersion
{ "repo_name": "GlenRSmith/elasticsearch", "path": "server/src/main/java/org/elasticsearch/transport/Transport.java", "license": "apache-2.0", "size": 10777 }
[ "org.elasticsearch.Version" ]
import org.elasticsearch.Version;
import org.elasticsearch.*;
[ "org.elasticsearch" ]
org.elasticsearch;
438,841
public static void sendIndividualToMaster(Chromosome individual) throws IllegalArgumentException{ if(individual == null){ throw new IllegalArgumentException("No defined individual to send"); } if(!Properties.NEW_STATISTICS) return; ClientServices.getInstance().getClientNode().updateStatistics(individual); }
static void function(Chromosome individual) throws IllegalArgumentException{ if(individual == null){ throw new IllegalArgumentException(STR); } if(!Properties.NEW_STATISTICS) return; ClientServices.getInstance().getClientNode().updateStatistics(individual); }
/** * Send the given individual to the Client, plus any other needed info * * @param individual */
Send the given individual to the Client, plus any other needed info
sendIndividualToMaster
{ "repo_name": "sefaakca/EvoSuite-Sefa", "path": "client/src/main/java/org/evosuite/statistics/StatisticsSender.java", "license": "lgpl-3.0", "size": 7604 }
[ "org.evosuite.Properties", "org.evosuite.ga.Chromosome", "org.evosuite.rmi.ClientServices" ]
import org.evosuite.Properties; import org.evosuite.ga.Chromosome; import org.evosuite.rmi.ClientServices;
import org.evosuite.*; import org.evosuite.ga.*; import org.evosuite.rmi.*;
[ "org.evosuite", "org.evosuite.ga", "org.evosuite.rmi" ]
org.evosuite; org.evosuite.ga; org.evosuite.rmi;
1,734,370
private static BufferedReader getBufferedReader(Context context, Uri uri) throws IOException { AssetFileDescriptor descriptor = context.getContentResolver() .openTypedAssetFileDescriptor(uri, "text/*", null); if (descriptor == null) { Log.e("error", "descriptor is null"); } FileInputStream inputStream = descriptor.createInputStream(); InputStreamReader isReader = new InputStreamReader(inputStream, "UTF-8"); return new BufferedReader(isReader); }
static BufferedReader function(Context context, Uri uri) throws IOException { AssetFileDescriptor descriptor = context.getContentResolver() .openTypedAssetFileDescriptor(uri, STR, null); if (descriptor == null) { Log.e("error", STR); } FileInputStream inputStream = descriptor.createInputStream(); InputStreamReader isReader = new InputStreamReader(inputStream, "UTF-8"); return new BufferedReader(isReader); }
/** * Returns a BufferedReader to read the contents of the CSV line by line. * * @param context * @param uri * @return * @throws IOException */
Returns a BufferedReader to read the contents of the CSV line by line
getBufferedReader
{ "repo_name": "grelon/project", "path": "Bunqer/app/src/main/java/com/example/sander/bunqer/Helpers/CsvImportHelper.java", "license": "mit", "size": 5669 }
[ "android.content.Context", "android.content.res.AssetFileDescriptor", "android.net.Uri", "android.util.Log", "java.io.BufferedReader", "java.io.FileInputStream", "java.io.IOException", "java.io.InputStreamReader" ]
import android.content.Context; import android.content.res.AssetFileDescriptor; import android.net.Uri; import android.util.Log; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader;
import android.content.*; import android.content.res.*; import android.net.*; import android.util.*; import java.io.*;
[ "android.content", "android.net", "android.util", "java.io" ]
android.content; android.net; android.util; java.io;
860,923
public void putBigFloat(double numberBody) throws ServiceException { try { Call<ResponseBody> call = service.putBigFloat(numberBody); ServiceResponse<Void> response = putBigFloatDelegate(call.execute(), null); response.getBody(); } catch (ServiceException ex) { throw ex; } catch (Exception ex) { throw new ServiceException(ex); } }
void function(double numberBody) throws ServiceException { try { Call<ResponseBody> call = service.putBigFloat(numberBody); ServiceResponse<Void> response = putBigFloatDelegate(call.execute(), null); response.getBody(); } catch (ServiceException ex) { throw ex; } catch (Exception ex) { throw new ServiceException(ex); } }
/** * Put big float value 3.402823e+20 * * @param numberBody the double value * @throws ServiceException the exception wrapped in ServiceException if failed. */
Put big float value 3.402823e+20
putBigFloat
{ "repo_name": "BretJohnson/autorest", "path": "AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodynumber/NumberImpl.java", "license": "mit", "size": 47604 }
[ "com.microsoft.rest.ServiceException", "com.microsoft.rest.ServiceResponse", "com.squareup.okhttp.ResponseBody" ]
import com.microsoft.rest.ServiceException; import com.microsoft.rest.ServiceResponse; import com.squareup.okhttp.ResponseBody;
import com.microsoft.rest.*; import com.squareup.okhttp.*;
[ "com.microsoft.rest", "com.squareup.okhttp" ]
com.microsoft.rest; com.squareup.okhttp;
1,312,858
private static void makeLocalHistoryFolder() { File f; f = new File(SiHistoryFiles.localEventFolderPath); if (!f.exists()) f.mkdirs(); } private int NotPort; static JFrame login; private JWindow connecting; public static final String DEFAULT_HOST = "xmpp.org.uk"; public static final String DEFAULT_PORT = "5222"; public static final String DEFAULT_SERVICE_NAME = "xmpp.org.uk"; // Login box fields JTextField txtUsername; JPasswordField txtPassword; JTextField txtServiceName; JTextField txtHost; JTextField txtPort; MainWindow program; JCheckBox chkRemember; String errmsg; private Thread mainWindowThread; private Thread connectBoxThread; CiderApplication ciderApplication; public LoginUI(CiderApplication ciderApplication) { this.ciderApplication = ciderApplication; }
static void function() { File f; f = new File(SiHistoryFiles.localEventFolderPath); if (!f.exists()) f.mkdirs(); } private int NotPort; static JFrame login; private JWindow connecting; public static final String DEFAULT_HOST = STR; public static final String DEFAULT_PORT = "5222"; public static final String DEFAULT_SERVICE_NAME = STR; JTextField txtUsername; JPasswordField txtPassword; JTextField txtServiceName; JTextField txtHost; JTextField txtPort; MainWindow program; JCheckBox chkRemember; String errmsg; private Thread mainWindowThread; private Thread connectBoxThread; CiderApplication ciderApplication; public LoginUI(CiderApplication ciderApplication) { this.ciderApplication = ciderApplication; }
/** * Creates a folder dedicated to holding the chat history */
Creates a folder dedicated to holding the chat history
makeLocalHistoryFolder
{ "repo_name": "inversion/ciderspe", "path": "src/cider/client/gui/LoginUI.java", "license": "gpl-3.0", "size": 21538 }
[ "java.io.File", "javax.swing.JCheckBox", "javax.swing.JFrame", "javax.swing.JPasswordField", "javax.swing.JTextField", "javax.swing.JWindow" ]
import java.io.File; import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.swing.JPasswordField; import javax.swing.JTextField; import javax.swing.JWindow;
import java.io.*; import javax.swing.*;
[ "java.io", "javax.swing" ]
java.io; javax.swing;
2,470,700
public void setOption(SystemOptions option) { this.option = option; }
void function(SystemOptions option) { this.option = option; }
/** * Sets the option attribute value. * * @param option The option to set. */
Sets the option attribute value
setOption
{ "repo_name": "quikkian-ua-devops/will-financials", "path": "kfs-ld/src/main/java/org/kuali/kfs/module/ld/businessobject/LedgerBalanceForYearEndBalanceForward.java", "license": "agpl-3.0", "size": 11119 }
[ "org.kuali.kfs.sys.businessobject.SystemOptions" ]
import org.kuali.kfs.sys.businessobject.SystemOptions;
import org.kuali.kfs.sys.businessobject.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
2,366,754
@Test public void testFilter() { invoiceFilter.setInvoiceId("1"); assertEquals("Asserting filter invoices", invoiceOne, invoiceFilter.filter(invoices).get(0)); invoiceFilter.setInvoiceId("2"); assertNotEquals("Asserting filter invoices", invoiceOne, invoiceFilter.filter(invoices).get(0)); assertEquals("Asserting filter invoices", invoiceTwo, invoiceFilter.filter(invoices).get(0)); }
void function() { invoiceFilter.setInvoiceId("1"); assertEquals(STR, invoiceOne, invoiceFilter.filter(invoices).get(0)); invoiceFilter.setInvoiceId("2"); assertNotEquals(STR, invoiceOne, invoiceFilter.filter(invoices).get(0)); assertEquals(STR, invoiceTwo, invoiceFilter.filter(invoices).get(0)); }
/** * Test of the filter method */
Test of the filter method
testFilter
{ "repo_name": "Limmen/chinook", "path": "java_backend/chinook_rest/src/test/java/limmen/business/services/filters/InvoiceFilterTest.java", "license": "mit", "size": 2557 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
667,859
private void processFoundLaadprocess(Afgifte afgifte, LaadProces lp) throws SQLException{ List<Bericht> berichten = staging.getBerichtByLaadProces(lp); Map<Bericht.STATUS, Integer> counts = afgifte.getStatussen(); berichten.stream().map((bericht) -> { if(!counts.containsKey(bericht.getStatus())){ counts.put(bericht.getStatus(), 0); } return bericht; }).forEachOrdered((bericht) -> { counts.put(bericht.getStatus(), counts.get(bericht.getStatus()) + 1); }); }
void function(Afgifte afgifte, LaadProces lp) throws SQLException{ List<Bericht> berichten = staging.getBerichtByLaadProces(lp); Map<Bericht.STATUS, Integer> counts = afgifte.getStatussen(); berichten.stream().map((bericht) -> { if(!counts.containsKey(bericht.getStatus())){ counts.put(bericht.getStatus(), 0); } return bericht; }).forEachOrdered((bericht) -> { counts.put(bericht.getStatus(), counts.get(bericht.getStatus()) + 1); }); }
/** * zoek de status van alle bijbehorende berichten op en leg die vast in de * afgifte. * * @param afgifte de te controleren afgifte * @param lp het laadproces waar de berichten bij zoeken * @throws SQLException if any */
zoek de status van alle bijbehorende berichten op en leg die vast in de afgifte
processFoundLaadprocess
{ "repo_name": "B3Partners/brmo", "path": "brmo-loader/src/main/java/nl/b3p/brmo/loader/checks/AfgifteChecker.java", "license": "gpl-3.0", "size": 3786 }
[ "java.sql.SQLException", "java.util.List", "java.util.Map", "nl.b3p.brmo.loader.entity.Bericht", "nl.b3p.brmo.loader.entity.LaadProces" ]
import java.sql.SQLException; import java.util.List; import java.util.Map; import nl.b3p.brmo.loader.entity.Bericht; import nl.b3p.brmo.loader.entity.LaadProces;
import java.sql.*; import java.util.*; import nl.b3p.brmo.loader.entity.*;
[ "java.sql", "java.util", "nl.b3p.brmo" ]
java.sql; java.util; nl.b3p.brmo;
566,459
ActionFuture<IndicesStatsResponse> stats(IndicesStatsRequest request);
ActionFuture<IndicesStatsResponse> stats(IndicesStatsRequest request);
/** * Indices stats. */
Indices stats
stats
{ "repo_name": "fernandozhu/elasticsearch", "path": "core/src/main/java/org/elasticsearch/client/IndicesAdminClient.java", "license": "apache-2.0", "size": 31752 }
[ "org.elasticsearch.action.ActionFuture", "org.elasticsearch.action.admin.indices.stats.IndicesStatsRequest", "org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse" ]
import org.elasticsearch.action.ActionFuture; import org.elasticsearch.action.admin.indices.stats.IndicesStatsRequest; import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse;
import org.elasticsearch.action.*; import org.elasticsearch.action.admin.indices.stats.*;
[ "org.elasticsearch.action" ]
org.elasticsearch.action;
1,821,894
boolean isValid() { if (this.uop == null) { return true; } if (this.operandType == Operand.FIELD) { return true; } if (this.uop == UnaryOperator.IsKnown || this.uop == UnaryOperator.IsUnknown) { return false; } if (this.operandType != Operand.CONSTANT) { return true; } ValueType type = this.value.getValueType(); try { if (this.uop == UnaryOperator.Minus) { if (type == ValueType.INTEGER) { this.value = Value.newIntegerValue(-this.value.toInteger()); this.uop = null; return true; } if (type == ValueType.DECIMAL) { this.value = Value.newDecimalValue(-this.value.toDecimal()); this.uop = null; return true; } } } catch (InvalidValueException e) { throw new ApplicationError(e, "Error while using an operand."); } return false; }
boolean isValid() { if (this.uop == null) { return true; } if (this.operandType == Operand.FIELD) { return true; } if (this.uop == UnaryOperator.IsKnown this.uop == UnaryOperator.IsUnknown) { return false; } if (this.operandType != Operand.CONSTANT) { return true; } ValueType type = this.value.getValueType(); try { if (this.uop == UnaryOperator.Minus) { if (type == ValueType.INTEGER) { this.value = Value.newIntegerValue(-this.value.toInteger()); this.uop = null; return true; } if (type == ValueType.DECIMAL) { this.value = Value.newDecimalValue(-this.value.toDecimal()); this.uop = null; return true; } } } catch (InvalidValueException e) { throw new ApplicationError(e, STR); } return false; }
/** * invalid if ~ ? are used on a non-field * * @return */
invalid if ~ ? are used on a non-field
isValid
{ "repo_name": "raghu-bhandi/simplity", "path": "java/org/simplity/kernel/expr/Operand.java", "license": "mit", "size": 5170 }
[ "org.simplity.kernel.ApplicationError", "org.simplity.kernel.value.InvalidValueException", "org.simplity.kernel.value.Value", "org.simplity.kernel.value.ValueType" ]
import org.simplity.kernel.ApplicationError; import org.simplity.kernel.value.InvalidValueException; import org.simplity.kernel.value.Value; import org.simplity.kernel.value.ValueType;
import org.simplity.kernel.*; import org.simplity.kernel.value.*;
[ "org.simplity.kernel" ]
org.simplity.kernel;
1,641,543
@Override public Cursor query(String query) { return rawQueryWithFactory(null, query, null, null, null); }
Cursor function(String query) { return rawQueryWithFactory(null, query, null, null, null); }
/** * Runs the provided SQL and returns a {@link Cursor} over the result set. * * @param query the SQL query. The SQL string must not be ; terminated * @return A {@link Cursor} object, which is positioned before the first entry. Note that * {@link Cursor}s are not synchronized, see the documentation for more details. */
Runs the provided SQL and returns a <code>Cursor</code> over the result set
query
{ "repo_name": "requery/sqlite-android", "path": "sqlite-android/src/main/java/io/requery/android/database/sqlite/SQLiteDatabase.java", "license": "apache-2.0", "size": 108328 }
[ "android.database.Cursor" ]
import android.database.Cursor;
import android.database.*;
[ "android.database" ]
android.database;
2,446,835
public static void purgeExpiredInterests( HashMap<String, DDSensorInterestManager> interestManagers) { // purge finished ones final ArrayList<DDSensorInterestManager> toDelete = new ArrayList<>(); for (final DDSensorInterestManager interest : interestManagers.values()) { if (interest.getSensorInterestRole().equals( DDSensorInterestManager.SensorInterestRole.Expired)) { toDelete.add(interest); } } // remove the expired interestManagers for (final DDSensorInterestManager interest : toDelete) { interestManagers.remove(interest.getInterest().getInterestType()); } }
static void function( HashMap<String, DDSensorInterestManager> interestManagers) { final ArrayList<DDSensorInterestManager> toDelete = new ArrayList<>(); for (final DDSensorInterestManager interest : interestManagers.values()) { if (interest.getSensorInterestRole().equals( DDSensorInterestManager.SensorInterestRole.Expired)) { toDelete.add(interest); } } for (final DDSensorInterestManager interest : toDelete) { interestManagers.remove(interest.getInterest().getInterestType()); } }
/** * Performs processing based on the passing of time, such us the expiration * of interestManagers and so on. */
Performs processing based on the passing of time, such us the expiration of interestManagers and so on
purgeExpiredInterests
{ "repo_name": "NetMoc/Yaes-SensorNetwork", "path": "src/main/java/yaes/sensornetwork/agents/directeddiffusion/InterestHelper.java", "license": "lgpl-2.1", "size": 1998 }
[ "java.util.ArrayList", "java.util.HashMap" ]
import java.util.ArrayList; import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
1,236,358
public Path getDirectory() { return _dir; }
Path function() { return _dir; }
/** * Returns the Path of the directory used as a DigestBlobStore. Only the * DigestBlobStore should make any changes to the contents of this directory * or its subdirectories. * @return the Path of the directory used as a DigestBlobStore. Only the * DigestBlobStore should make any changes to the contents of this directory * or its subdirectories. */
Returns the Path of the directory used as a DigestBlobStore. Only the DigestBlobStore should make any changes to the contents of this directory or its subdirectories
getDirectory
{ "repo_name": "martylamb/blobstore", "path": "src/main/java/com/martiansoftware/blobstore/DigestBlobStore.java", "license": "apache-2.0", "size": 24693 }
[ "java.nio.file.Path" ]
import java.nio.file.Path;
import java.nio.file.*;
[ "java.nio" ]
java.nio;
1,595,718
public static ChannelBuffer wrappedBuffer(ByteOrder endianness, byte[] array) { if (endianness == BIG_ENDIAN) { if (array.length == 0) { return EMPTY_BUFFER; } return new BigEndianHeapChannelBuffer(array); } else if (endianness == LITTLE_ENDIAN) { if (array.length == 0) { return EMPTY_BUFFER; } return new LittleEndianHeapChannelBuffer(array); } else { throw new NullPointerException("endianness"); } }
static ChannelBuffer function(ByteOrder endianness, byte[] array) { if (endianness == BIG_ENDIAN) { if (array.length == 0) { return EMPTY_BUFFER; } return new BigEndianHeapChannelBuffer(array); } else if (endianness == LITTLE_ENDIAN) { if (array.length == 0) { return EMPTY_BUFFER; } return new LittleEndianHeapChannelBuffer(array); } else { throw new NullPointerException(STR); } }
/** * Creates a new buffer which wraps the specified {@code array} with the * specified {@code endianness}. A modification on the specified array's * content will be visible to the returned buffer. */
Creates a new buffer which wraps the specified array with the specified endianness. A modification on the specified array's content will be visible to the returned buffer
wrappedBuffer
{ "repo_name": "codewhy/Netty-3.3.1-Final", "path": "src/main/java/org/jboss/netty/buffer/ChannelBuffers.java", "license": "apache-2.0", "size": 41901 }
[ "java.nio.ByteOrder" ]
import java.nio.ByteOrder;
import java.nio.*;
[ "java.nio" ]
java.nio;
339,489
public List<ExerciseTag> getExerciseTags();
List<ExerciseTag> function();
/** * Lists all {@link ExerciseTag}s * * @return All {@link ExerciseTag}s */
Lists all <code>ExerciseTag</code>s
getExerciseTags
{ "repo_name": "massimolavermicocca/OpenTraining", "path": "app/src/de/skubware/opentraining/db/IDataProvider.java", "license": "gpl-3.0", "size": 6758 }
[ "de.skubware.opentraining.basic.ExerciseTag", "java.util.List" ]
import de.skubware.opentraining.basic.ExerciseTag; import java.util.List;
import de.skubware.opentraining.basic.*; import java.util.*;
[ "de.skubware.opentraining", "java.util" ]
de.skubware.opentraining; java.util;
2,490,519
public String getCombatMusic(int sector) { String result = ""; switch (sector) { case 0: result = MusicPlayer.MUSIC_FILES[seSector1.getCombatMusic()]; break; case 1: result = MusicPlayer.MUSIC_FILES[seSector2.getCombatMusic()]; break; case 2: result = MusicPlayer.MUSIC_FILES[seSector3.getCombatMusic()]; break; case 3: result = MusicPlayer.MUSIC_FILES[seSector4.getCombatMusic()]; break; } return result; }
String function(int sector) { String result = ""; switch (sector) { case 0: result = MusicPlayer.MUSIC_FILES[seSector1.getCombatMusic()]; break; case 1: result = MusicPlayer.MUSIC_FILES[seSector2.getCombatMusic()]; break; case 2: result = MusicPlayer.MUSIC_FILES[seSector3.getCombatMusic()]; break; case 3: result = MusicPlayer.MUSIC_FILES[seSector4.getCombatMusic()]; break; } return result; }
/** * Get Combat music for sector * @param sector 1-4 * @return String */
Get Combat music for sector
getCombatMusic
{ "repo_name": "tuomount/JHeroes", "path": "src/org/jheroes/mapeditor/MapSettings.java", "license": "gpl-2.0", "size": 10546 }
[ "org.jheroes.musicplayer.MusicPlayer" ]
import org.jheroes.musicplayer.MusicPlayer;
import org.jheroes.musicplayer.*;
[ "org.jheroes.musicplayer" ]
org.jheroes.musicplayer;
1,656,472
public static CdsIsdaCreditCurveNode ofPointsUpfront( CdsTemplate template, ObservableId observableId, StandardId legalEntityId, Double fixedRate) { return builder() .template(template) .observableId(observableId) .legalEntityId(legalEntityId) .quoteConvention(CdsQuoteConvention.POINTS_UPFRONT) .fixedRate(fixedRate) .build(); }
static CdsIsdaCreditCurveNode function( CdsTemplate template, ObservableId observableId, StandardId legalEntityId, Double fixedRate) { return builder() .template(template) .observableId(observableId) .legalEntityId(legalEntityId) .quoteConvention(CdsQuoteConvention.POINTS_UPFRONT) .fixedRate(fixedRate) .build(); }
/** * Returns a curve node with points upfront convention. * * @param template the template * @param observableId the observable ID * @param legalEntityId the legal entity ID * @param fixedRate the fixed rate * @return the curve node */
Returns a curve node with points upfront convention
ofPointsUpfront
{ "repo_name": "OpenGamma/Strata", "path": "modules/market/src/main/java/com/opengamma/strata/market/curve/node/CdsIsdaCreditCurveNode.java", "license": "apache-2.0", "size": 26279 }
[ "com.opengamma.strata.basics.StandardId", "com.opengamma.strata.data.ObservableId", "com.opengamma.strata.product.credit.type.CdsQuoteConvention", "com.opengamma.strata.product.credit.type.CdsTemplate" ]
import com.opengamma.strata.basics.StandardId; import com.opengamma.strata.data.ObservableId; import com.opengamma.strata.product.credit.type.CdsQuoteConvention; import com.opengamma.strata.product.credit.type.CdsTemplate;
import com.opengamma.strata.basics.*; import com.opengamma.strata.data.*; import com.opengamma.strata.product.credit.type.*;
[ "com.opengamma.strata" ]
com.opengamma.strata;
2,024,136
@NotNull public Callable<FileCreator> getConstructor() { return notNull(constructor); }
Callable<FileCreator> function() { return notNull(constructor); }
/** * Gets constructor. * * @return the constructor of a file creator. */
Gets constructor
getConstructor
{ "repo_name": "JavaSaBr/jME3-SpaceShift-Editor", "path": "src/main/java/com/ss/editor/ui/component/creator/FileCreatorDescription.java", "license": "apache-2.0", "size": 2055 }
[ "com.ss.rlib.common.util.ObjectUtils", "java.util.concurrent.Callable" ]
import com.ss.rlib.common.util.ObjectUtils; import java.util.concurrent.Callable;
import com.ss.rlib.common.util.*; import java.util.concurrent.*;
[ "com.ss.rlib", "java.util" ]
com.ss.rlib; java.util;
2,143,428
public void locatorEvent() { if(recMode == ModeConstants.MEL_QUANTIZED) { if(status == MonomeUp.CUEDSTOP) { //System.out.println("Quantized Sequence " + index + " is STOPPED"); endAllRecording(); status = MonomeUp.STOPPED; //Immediately begin playback play(); } if(status == MonomeUp.CUED) { status = MonomeUp.RECORDING; counter = 1; if(!events.containsKey(counter)) events.put(counter, new ArrayList<Note>()); //System.out.println("Quantized Sequence " + index + "is STARTED"); } } }
void function() { if(recMode == ModeConstants.MEL_QUANTIZED) { if(status == MonomeUp.CUEDSTOP) { endAllRecording(); status = MonomeUp.STOPPED; play(); } if(status == MonomeUp.CUED) { status = MonomeUp.RECORDING; counter = 1; if(!events.containsKey(counter)) events.put(counter, new ArrayList<Note>()); } } }
/*** * When the melodizer is in quantized recording mode, locator events tell it * when to actually start or stop recording after being cued to do so */
When the melodizer is in quantized recording mode, locator events tell it when to actually start or stop recording after being cued to do so
locatorEvent
{ "repo_name": "adamribaudo/sevenuplive", "path": "src/mtn/sevenuplive/modes/NoteSequence.java", "license": "lgpl-3.0", "size": 18233 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,492,011
private void createWalkExteriorStep(LocalPosition destLoc) { WalkStep walkExterior = new WalkStep(WalkStep.EXTERIOR_WALK); walkExterior.loc = destLoc; walkingStepList.add(walkExterior); }
void function(LocalPosition destLoc) { WalkStep walkExterior = new WalkStep(WalkStep.EXTERIOR_WALK); walkExterior.loc = destLoc; walkingStepList.add(walkExterior); }
/** * Create an exterior walking step. * @param destLoc the destination. */
Create an exterior walking step
createWalkExteriorStep
{ "repo_name": "mars-sim/mars-sim", "path": "mars-sim-core/src/main/java/org/mars_sim/msp/core/person/ai/task/WalkingSteps.java", "license": "gpl-3.0", "size": 67843 }
[ "org.mars_sim.msp.core.LocalPosition" ]
import org.mars_sim.msp.core.LocalPosition;
import org.mars_sim.msp.core.*;
[ "org.mars_sim.msp" ]
org.mars_sim.msp;
353,189
@Override public void addComponent(String componentTypeName) { if (simplePaletteItems.containsKey(componentTypeName)) { // We are upgrading removeComponent(componentTypeName); } int version = COMPONENT_DATABASE.getComponentVersion(componentTypeName); String versionName = COMPONENT_DATABASE.getComponentVersionName(componentTypeName); String dateBuilt = COMPONENT_DATABASE.getComponentBuildDate(componentTypeName); String helpString = COMPONENT_DATABASE.getHelpString(componentTypeName); String helpUrl = COMPONENT_DATABASE.getHelpUrl(componentTypeName); String categoryDocUrlString = COMPONENT_DATABASE.getCategoryDocUrlString(componentTypeName); String categoryString = COMPONENT_DATABASE.getCategoryString(componentTypeName); Boolean showOnPalette = COMPONENT_DATABASE.getShowOnPalette(componentTypeName); Boolean nonVisible = COMPONENT_DATABASE.getNonVisible(componentTypeName); Boolean external = COMPONENT_DATABASE.getComponentExternal(componentTypeName); ComponentCategory category = ComponentCategory.valueOf(categoryString); if (showOnPalette && showCategory(category)) { SimplePaletteItem item = new SimplePaletteItem( new SimpleComponentDescriptor(componentTypeName, editor, version, versionName, dateBuilt, helpString, helpUrl, categoryDocUrlString, showOnPalette, nonVisible, external), dropTargetProvider); simplePaletteItems.put(componentTypeName, item); addPaletteItem(item, category); } }
void function(String componentTypeName) { if (simplePaletteItems.containsKey(componentTypeName)) { removeComponent(componentTypeName); } int version = COMPONENT_DATABASE.getComponentVersion(componentTypeName); String versionName = COMPONENT_DATABASE.getComponentVersionName(componentTypeName); String dateBuilt = COMPONENT_DATABASE.getComponentBuildDate(componentTypeName); String helpString = COMPONENT_DATABASE.getHelpString(componentTypeName); String helpUrl = COMPONENT_DATABASE.getHelpUrl(componentTypeName); String categoryDocUrlString = COMPONENT_DATABASE.getCategoryDocUrlString(componentTypeName); String categoryString = COMPONENT_DATABASE.getCategoryString(componentTypeName); Boolean showOnPalette = COMPONENT_DATABASE.getShowOnPalette(componentTypeName); Boolean nonVisible = COMPONENT_DATABASE.getNonVisible(componentTypeName); Boolean external = COMPONENT_DATABASE.getComponentExternal(componentTypeName); ComponentCategory category = ComponentCategory.valueOf(categoryString); if (showOnPalette && showCategory(category)) { SimplePaletteItem item = new SimplePaletteItem( new SimpleComponentDescriptor(componentTypeName, editor, version, versionName, dateBuilt, helpString, helpUrl, categoryDocUrlString, showOnPalette, nonVisible, external), dropTargetProvider); simplePaletteItems.put(componentTypeName, item); addPaletteItem(item, category); } }
/** * Loads a single Component to Palette. Used for adding Components. */
Loads a single Component to Palette. Used for adding Components
addComponent
{ "repo_name": "warren922/appinventor-sources", "path": "appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/palette/YoungAndroidPalettePanel.java", "license": "apache-2.0", "size": 9802 }
[ "com.google.appinventor.client.editor.simple.palette.SimpleComponentDescriptor", "com.google.appinventor.client.editor.simple.palette.SimplePaletteItem", "com.google.appinventor.components.common.ComponentCategory" ]
import com.google.appinventor.client.editor.simple.palette.SimpleComponentDescriptor; import com.google.appinventor.client.editor.simple.palette.SimplePaletteItem; import com.google.appinventor.components.common.ComponentCategory;
import com.google.appinventor.client.editor.simple.palette.*; import com.google.appinventor.components.common.*;
[ "com.google.appinventor" ]
com.google.appinventor;
2,751,013
@ApiModelProperty( value = "Default rate per unit (optional). Only applicable if RateType is RatePerUnit") public Double getRatePerUnit() { return ratePerUnit; }
@ApiModelProperty( value = STR) Double function() { return ratePerUnit; }
/** * Default rate per unit (optional). Only applicable if RateType is RatePerUnit * * @return ratePerUnit */
Default rate per unit (optional). Only applicable if RateType is RatePerUnit
getRatePerUnit
{ "repo_name": "XeroAPI/Xero-Java", "path": "src/main/java/com/xero/models/payrollnz/EarningsRate.java", "license": "mit", "size": 16152 }
[ "io.swagger.annotations.ApiModelProperty" ]
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*;
[ "io.swagger.annotations" ]
io.swagger.annotations;
1,213,525
public static BEDRecord makeBEDRecord(SequenceFeature lsf) { return makeBEDRecord(lsf, true); }
static BEDRecord function(SequenceFeature lsf) { return makeBEDRecord(lsf, true); }
/** * Create a BEDRecord from a LocatedSequenceFeature. * * @param lsf the LocatedSequenceFeature * @return the BEDRecord or null if this lsf has no Chromosome or no Chromosome location */
Create a BEDRecord from a LocatedSequenceFeature
makeBEDRecord
{ "repo_name": "joshkh/intermine", "path": "bio/tools/main/src/org/intermine/bio/web/export/BEDUtil.java", "license": "lgpl-2.1", "size": 3173 }
[ "org.intermine.bio.io.bed.BEDRecord", "org.intermine.model.bio.SequenceFeature" ]
import org.intermine.bio.io.bed.BEDRecord; import org.intermine.model.bio.SequenceFeature;
import org.intermine.bio.io.bed.*; import org.intermine.model.bio.*;
[ "org.intermine.bio", "org.intermine.model" ]
org.intermine.bio; org.intermine.model;
1,352,533
public void setCreateDate(Date value) { setValue(7, value); }
void function(Date value) { setValue(7, value); }
/** * Setter for <code>public.rewards_report.create_date</code>. */
Setter for <code>public.rewards_report.create_date</code>
setCreateDate
{ "repo_name": "mesan/fag-ark-persistering-test-jooq", "path": "fag-ark-persistering-test-jooq-spring/src/main/java/no/mesan/ark/persistering/generated/tables/records/RewardsReportRecord.java", "license": "unlicense", "size": 9696 }
[ "java.sql.Date" ]
import java.sql.Date;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,757,294
void removeAutoHidePartner(Element partner);
void removeAutoHidePartner(Element partner);
/** * Removes an auto-hide partner.<p> * * @param partner the auto-hide partner to remove * * @see com.google.gwt.user.client.ui.PopupPanel#removeAutoHidePartner(Element) */
Removes an auto-hide partner
removeAutoHidePartner
{ "repo_name": "PatidarWeb/opencms-core", "path": "src-gwt/org/opencms/gwt/client/ui/I_CmsAutoHider.java", "license": "lgpl-2.1", "size": 3331 }
[ "com.google.gwt.dom.client.Element" ]
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.*;
[ "com.google.gwt" ]
com.google.gwt;
2,554,417
@Override public int getShortInt(int rowId) { return ByteUtil.valueOf3Bytes(shortIntData, rowId * 3); }
int function(int rowId) { return ByteUtil.valueOf3Bytes(shortIntData, rowId * 3); }
/** * Get short int value at rowId */
Get short int value at rowId
getShortInt
{ "repo_name": "jatin9896/incubator-carbondata", "path": "core/src/main/java/org/apache/carbondata/core/datastore/page/SafeFixLengthColumnPage.java", "license": "apache-2.0", "size": 11073 }
[ "org.apache.carbondata.core.util.ByteUtil" ]
import org.apache.carbondata.core.util.ByteUtil;
import org.apache.carbondata.core.util.*;
[ "org.apache.carbondata" ]
org.apache.carbondata;
234,549
@Test public void testLazyBinarySerDe() throws Throwable { try { System.out.println("Beginning Test TestLazyBinarySerDe:"); // generate the data int num = 1000; Random r = new Random(1234); MyTestClass rows[] = new MyTestClass[num]; for (int i = 0; i < num; i++) { MyTestClass t = new MyTestClass(); ExtraTypeInfo extraTypeInfo = new ExtraTypeInfo(); t.randomFill(r, extraTypeInfo); rows[i] = t; } StructObjectInspector rowOI = (StructObjectInspector) ObjectInspectorFactory .getReflectionObjectInspector(MyTestClass.class, ObjectInspectorOptions.JAVA); String fieldNames = ObjectInspectorUtils.getFieldNames(rowOI); String fieldTypes = ObjectInspectorUtils.getFieldTypes(rowOI); // call the tests // 1/ test LazyBinarySerDe testLazyBinarySerDe(rows, rowOI, getSerDe(fieldNames, fieldTypes)); // 2/ test LazyBinaryMap testLazyBinaryMap(r); // 3/ test serialization and deserialization with different schemas testShorterSchemaDeserialization(r); // 4/ test serialization and deserialization with different schemas testLongerSchemaDeserialization(r); // 5/ test serialization and deserialization with different schemas testShorterSchemaDeserialization1(r); // 6/ test serialization and deserialization with different schemas testLongerSchemaDeserialization1(r); System.out.println("Test TestLazyBinarySerDe passed!"); } catch (Throwable e) { e.printStackTrace(); throw e; } }
void function() throws Throwable { try { System.out.println(STR); int num = 1000; Random r = new Random(1234); MyTestClass rows[] = new MyTestClass[num]; for (int i = 0; i < num; i++) { MyTestClass t = new MyTestClass(); ExtraTypeInfo extraTypeInfo = new ExtraTypeInfo(); t.randomFill(r, extraTypeInfo); rows[i] = t; } StructObjectInspector rowOI = (StructObjectInspector) ObjectInspectorFactory .getReflectionObjectInspector(MyTestClass.class, ObjectInspectorOptions.JAVA); String fieldNames = ObjectInspectorUtils.getFieldNames(rowOI); String fieldTypes = ObjectInspectorUtils.getFieldTypes(rowOI); testLazyBinarySerDe(rows, rowOI, getSerDe(fieldNames, fieldTypes)); testLazyBinaryMap(r); testShorterSchemaDeserialization(r); testLongerSchemaDeserialization(r); testShorterSchemaDeserialization1(r); testLongerSchemaDeserialization1(r); System.out.println(STR); } catch (Throwable e) { e.printStackTrace(); throw e; } }
/** * The test entrance function. * * @throws Throwable */
The test entrance function
testLazyBinarySerDe
{ "repo_name": "nishantmonu51/hive", "path": "serde/src/test/org/apache/hadoop/hive/serde2/lazybinary/TestLazyBinarySerDe.java", "license": "apache-2.0", "size": 22032 }
[ "java.util.Random", "org.apache.hadoop.hive.serde2.binarysortable.MyTestClass", "org.apache.hadoop.hive.serde2.binarysortable.MyTestPrimitiveClass", "org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory", "org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils", "org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector" ]
import java.util.Random; import org.apache.hadoop.hive.serde2.binarysortable.MyTestClass; import org.apache.hadoop.hive.serde2.binarysortable.MyTestPrimitiveClass; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils; import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
import java.util.*; import org.apache.hadoop.hive.serde2.binarysortable.*; import org.apache.hadoop.hive.serde2.objectinspector.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
167,575
public ArrayList<String> getIncludeCodaList() { return _includeCoda; }
ArrayList<String> function() { return _includeCoda; }
/** * Returns the coda inclusion. */
Returns the coda inclusion
getIncludeCodaList
{ "repo_name": "dlitz/resin", "path": "modules/resin/src/com/caucho/jsp/cfg/JspPropertyGroup.java", "license": "gpl-2.0", "size": 15336 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,552,280
@Column(name = "login_name") public String getLoginName() { return loginName; }
@Column(name = STR) String function() { return loginName; }
/** * Gets the login name. * * @return the login name */
Gets the login name
getLoginName
{ "repo_name": "NCIP/caaers", "path": "caAERS/software/core/src/main/java/gov/nih/nci/cabig/caaers/domain/User.java", "license": "bsd-3-clause", "size": 17695 }
[ "javax.persistence.Column" ]
import javax.persistence.Column;
import javax.persistence.*;
[ "javax.persistence" ]
javax.persistence;
1,728,285
private List<List<String>> getPartitionFilters(List<StorageUnitAvailabilityDto> storageUnitAvailabilityDtos, List<String> samplePartitionFilter) { List<List<String>> partitionFilters = new ArrayList<>(); for (StorageUnitAvailabilityDto storageUnitAvailabilityDto : storageUnitAvailabilityDtos) { partitionFilters.add(businessObjectDataHelper.getPartitionFilter(storageUnitAvailabilityDto.getBusinessObjectDataKey(), samplePartitionFilter)); } return partitionFilters; }
List<List<String>> function(List<StorageUnitAvailabilityDto> storageUnitAvailabilityDtos, List<String> samplePartitionFilter) { List<List<String>> partitionFilters = new ArrayList<>(); for (StorageUnitAvailabilityDto storageUnitAvailabilityDto : storageUnitAvailabilityDtos) { partitionFilters.add(businessObjectDataHelper.getPartitionFilter(storageUnitAvailabilityDto.getBusinessObjectDataKey(), samplePartitionFilter)); } return partitionFilters; }
/** * Gets a list of matched partition filters per specified list of storage unit entities and a sample partition filter. * * @param storageUnitAvailabilityDtos the list of storage unit availability DTOs * @param samplePartitionFilter the sample partition filter * * @return the list of partition filters */
Gets a list of matched partition filters per specified list of storage unit entities and a sample partition filter
getPartitionFilters
{ "repo_name": "FINRAOS/herd", "path": "herd-code/herd-service/src/main/java/org/finra/herd/service/impl/BusinessObjectDataServiceImpl.java", "license": "apache-2.0", "size": 106288 }
[ "java.util.ArrayList", "java.util.List", "org.finra.herd.model.dto.StorageUnitAvailabilityDto" ]
import java.util.ArrayList; import java.util.List; import org.finra.herd.model.dto.StorageUnitAvailabilityDto;
import java.util.*; import org.finra.herd.model.dto.*;
[ "java.util", "org.finra.herd" ]
java.util; org.finra.herd;
313,847
public static Aggregate<Map<String, Concept>, Map<Concept, List<Map<String, Concept>>>> group(String varName) { return group(varName, Aggregates.list()); }
static Aggregate<Map<String, Concept>, Map<Concept, List<Map<String, Concept>>>> function(String varName) { return group(varName, Aggregates.list()); }
/** * Create an aggregate that will group a query by a variable name. * @param varName the variable name to group results by */
Create an aggregate that will group a query by a variable name
group
{ "repo_name": "fppt/mindmapsdb", "path": "grakn-graql/src/main/java/ai/grakn/graql/Graql.java", "license": "gpl-3.0", "size": 13657 }
[ "ai.grakn.concept.Concept", "ai.grakn.graql.internal.query.aggregate.Aggregates", "java.util.List", "java.util.Map" ]
import ai.grakn.concept.Concept; import ai.grakn.graql.internal.query.aggregate.Aggregates; import java.util.List; import java.util.Map;
import ai.grakn.concept.*; import ai.grakn.graql.internal.query.aggregate.*; import java.util.*;
[ "ai.grakn.concept", "ai.grakn.graql", "java.util" ]
ai.grakn.concept; ai.grakn.graql; java.util;
1,419,910
public void performActions() { if (this.clientConfiguration.getActions().isEmpty()) { this.clientConfiguration.printHelp(); return; } this.dumpProcessingController.setOfflineMode(this.clientConfiguration .getOfflineMode()); if (this.clientConfiguration.getDumpDirectoryLocation() != null) { try { this.dumpProcessingController .setDownloadDirectory(this.clientConfiguration .getDumpDirectoryLocation()); } catch (IOException e) { logger.error("Could not set download directory to " + this.clientConfiguration.getDumpDirectoryLocation() + ": " + e.getMessage()); logger.error("Aborting"); return; } } dumpProcessingController.setLanguageFilter(this.clientConfiguration .getFilterLanguages()); dumpProcessingController.setSiteLinkFilter(this.clientConfiguration .getFilterSiteKeys()); dumpProcessingController.setPropertyFilter(this.clientConfiguration .getFilterProperties()); MwDumpFile dumpFile = this.clientConfiguration.getLocalDumpFile(); if (dumpFile == null) { dumpFile = dumpProcessingController .getMostRecentDump(DumpContentType.JSON); } else { if (!dumpFile.isAvailable()) { logger.error("Dump file not found or not readable: " + dumpFile.toString()); return; } } this.clientConfiguration.setProjectName(dumpFile.getProjectName()); this.clientConfiguration.setDateStamp(dumpFile.getDateStamp()); boolean hasReadyProcessor = false; for (DumpProcessingAction props : this.clientConfiguration.getActions()) { if (!props.isReady()) { continue; } if (props.needsSites()) { prepareSites(); if (this.sites == null) { // sites unavailable continue; } props.setSites(this.sites); } props.setDumpInformation(dumpFile.getProjectName(), dumpFile.getDateStamp()); this.dumpProcessingController.registerEntityDocumentProcessor( props, null, true); hasReadyProcessor = true; } if (!hasReadyProcessor) { return; // silent; non-ready action should report its problem // directly } if (!this.clientConfiguration.isQuiet()) { EntityTimerProcessor entityTimerProcessor = new EntityTimerProcessor( 0); this.dumpProcessingController.registerEntityDocumentProcessor( entityTimerProcessor, null, true); } openActions(); this.dumpProcessingController.processDump(dumpFile); closeActions(); try { writeReport(); } catch (IOException e) { logger.error("Could not print report file: " + e.getMessage()); } }
void function() { if (this.clientConfiguration.getActions().isEmpty()) { this.clientConfiguration.printHelp(); return; } this.dumpProcessingController.setOfflineMode(this.clientConfiguration .getOfflineMode()); if (this.clientConfiguration.getDumpDirectoryLocation() != null) { try { this.dumpProcessingController .setDownloadDirectory(this.clientConfiguration .getDumpDirectoryLocation()); } catch (IOException e) { logger.error(STR + this.clientConfiguration.getDumpDirectoryLocation() + STR + e.getMessage()); logger.error(STR); return; } } dumpProcessingController.setLanguageFilter(this.clientConfiguration .getFilterLanguages()); dumpProcessingController.setSiteLinkFilter(this.clientConfiguration .getFilterSiteKeys()); dumpProcessingController.setPropertyFilter(this.clientConfiguration .getFilterProperties()); MwDumpFile dumpFile = this.clientConfiguration.getLocalDumpFile(); if (dumpFile == null) { dumpFile = dumpProcessingController .getMostRecentDump(DumpContentType.JSON); } else { if (!dumpFile.isAvailable()) { logger.error(STR + dumpFile.toString()); return; } } this.clientConfiguration.setProjectName(dumpFile.getProjectName()); this.clientConfiguration.setDateStamp(dumpFile.getDateStamp()); boolean hasReadyProcessor = false; for (DumpProcessingAction props : this.clientConfiguration.getActions()) { if (!props.isReady()) { continue; } if (props.needsSites()) { prepareSites(); if (this.sites == null) { continue; } props.setSites(this.sites); } props.setDumpInformation(dumpFile.getProjectName(), dumpFile.getDateStamp()); this.dumpProcessingController.registerEntityDocumentProcessor( props, null, true); hasReadyProcessor = true; } if (!hasReadyProcessor) { return; } if (!this.clientConfiguration.isQuiet()) { EntityTimerProcessor entityTimerProcessor = new EntityTimerProcessor( 0); this.dumpProcessingController.registerEntityDocumentProcessor( entityTimerProcessor, null, true); } openActions(); this.dumpProcessingController.processDump(dumpFile); closeActions(); try { writeReport(); } catch (IOException e) { logger.error(STR + e.getMessage()); } }
/** * Performs all actions that have been configured. */
Performs all actions that have been configured
performActions
{ "repo_name": "Wikidata/WikidataClassBrowser", "path": "helpers/java/src/main/java/org/wikidata/sqid/helper/Client.java", "license": "apache-2.0", "size": 10284 }
[ "java.io.IOException", "org.wikidata.wdtk.dumpfiles.DumpContentType", "org.wikidata.wdtk.dumpfiles.EntityTimerProcessor", "org.wikidata.wdtk.dumpfiles.MwDumpFile" ]
import java.io.IOException; import org.wikidata.wdtk.dumpfiles.DumpContentType; import org.wikidata.wdtk.dumpfiles.EntityTimerProcessor; import org.wikidata.wdtk.dumpfiles.MwDumpFile;
import java.io.*; import org.wikidata.wdtk.dumpfiles.*;
[ "java.io", "org.wikidata.wdtk" ]
java.io; org.wikidata.wdtk;
320,954
Future<OperationStatusResponse> deleteAsync(ServiceCertificateDeleteParameters parameters);
Future<OperationStatusResponse> deleteAsync(ServiceCertificateDeleteParameters parameters);
/** * The Delete Service Certificate operation deletes a service certificate * from the certificate store of a hosted service. This operation is an * asynchronous operation. To determine whether the management service has * finished processing the request, call Get Operation Status. (see * http://msdn.microsoft.com/en-us/library/windowsazure/ee460803.aspx for * more information) * * @param parameters Required. Parameters supplied to the Delete Service * Certificate operation. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the * HTTP status code returned for the Get Operation Status operation itself. * If the asynchronous operation succeeded, the response body includes the * HTTP status code for the successful request. If the asynchronous * operation failed, the response body includes the HTTP status code for * the failed request and error information regarding the failure. */
The Delete Service Certificate operation deletes a service certificate from the certificate store of a hosted service. This operation is an asynchronous operation. To determine whether the management service has finished processing the request, call Get Operation Status. (see HREF for more information)
deleteAsync
{ "repo_name": "southworkscom/azure-sdk-for-java", "path": "service-management/azure-svc-mgmt-compute/src/main/java/com/microsoft/windowsazure/management/compute/ServiceCertificateOperations.java", "license": "apache-2.0", "size": 16857 }
[ "com.microsoft.windowsazure.core.OperationStatusResponse", "com.microsoft.windowsazure.management.compute.models.ServiceCertificateDeleteParameters", "java.util.concurrent.Future" ]
import com.microsoft.windowsazure.core.OperationStatusResponse; import com.microsoft.windowsazure.management.compute.models.ServiceCertificateDeleteParameters; import java.util.concurrent.Future;
import com.microsoft.windowsazure.core.*; import com.microsoft.windowsazure.management.compute.models.*; import java.util.concurrent.*;
[ "com.microsoft.windowsazure", "java.util" ]
com.microsoft.windowsazure; java.util;
2,323,668
public void annotateTo(AnnotatedOutput out, String prefix) { out.annotate(0, prefix + "visibility: " + annotation.getVisibility().toHuman()); out.annotate(0, prefix + "type: " + annotation.getType().toHuman()); for (NameValuePair pair : annotation.getNameValuePairs()) { CstUtf8 name = pair.getName(); Constant value = pair.getValue(); out.annotate(0, prefix + name.toHuman() + ": " + ValueEncoder.constantToHuman(value)); } }
void function(AnnotatedOutput out, String prefix) { out.annotate(0, prefix + STR + annotation.getVisibility().toHuman()); out.annotate(0, prefix + STR + annotation.getType().toHuman()); for (NameValuePair pair : annotation.getNameValuePairs()) { CstUtf8 name = pair.getName(); Constant value = pair.getValue(); out.annotate(0, prefix + name.toHuman() + STR + ValueEncoder.constantToHuman(value)); } }
/** * Write a (listing file) annotation for this instance to the given * output, that consumes no bytes of output. This is for annotating * a reference to this instance at the point of the reference. * * @param out {@code non-null;} where to output to * @param prefix {@code non-null;} prefix for each line of output */
Write a (listing file) annotation for this instance to the given output, that consumes no bytes of output. This is for annotating a reference to this instance at the point of the reference
annotateTo
{ "repo_name": "RyanTech/DexHunter", "path": "dalvik/dexgen/src/com/android/dexgen/dex/file/AnnotationItem.java", "license": "apache-2.0", "size": 7241 }
[ "com.android.dexgen.rop.annotation.NameValuePair", "com.android.dexgen.rop.cst.Constant", "com.android.dexgen.rop.cst.CstUtf8", "com.android.dexgen.util.AnnotatedOutput" ]
import com.android.dexgen.rop.annotation.NameValuePair; import com.android.dexgen.rop.cst.Constant; import com.android.dexgen.rop.cst.CstUtf8; import com.android.dexgen.util.AnnotatedOutput;
import com.android.dexgen.rop.annotation.*; import com.android.dexgen.rop.cst.*; import com.android.dexgen.util.*;
[ "com.android.dexgen" ]
com.android.dexgen;
2,063,490
@Authorized(PrivilegeConstants.GET_CONCEPTS) public ConceptNameTag getConceptNameTagByUuid(String uuid);
@Authorized(PrivilegeConstants.GET_CONCEPTS) ConceptNameTag function(String uuid);
/** * Get ConceptNameTag by its UUID * * @param uuid * @return the conceptNameTag with a matching uuid * @see Concept#setPreferredName(ConceptName) * @see Concept#setFullySpecifiedName(ConceptName) * @see Concept#setShortName(ConceptName) * @should find object given valid uuid * @should return null if no object found with given uuid */
Get ConceptNameTag by its UUID
getConceptNameTagByUuid
{ "repo_name": "michaelhofer/openmrs-core", "path": "api/src/main/java/org/openmrs/api/ConceptService.java", "license": "mpl-2.0", "size": 72165 }
[ "org.openmrs.ConceptNameTag", "org.openmrs.annotation.Authorized", "org.openmrs.util.PrivilegeConstants" ]
import org.openmrs.ConceptNameTag; import org.openmrs.annotation.Authorized; import org.openmrs.util.PrivilegeConstants;
import org.openmrs.*; import org.openmrs.annotation.*; import org.openmrs.util.*;
[ "org.openmrs", "org.openmrs.annotation", "org.openmrs.util" ]
org.openmrs; org.openmrs.annotation; org.openmrs.util;
513,185
@Override public Object post() { if (!autoKey && contains()) throw new IllegalArgumentException(String.format("Database " + "already contains an object where %s = %s", key.getEnum().name(), key.getValue())); try (Database database = WebApplication.getDatabase()) { database.connect(); StringBuilder names = new StringBuilder(); StringBuilder values = new StringBuilder(); if (!autoKey) { names.append(key.getEnum().name()); values.append("?"); } for (HashMap.Entry<E, Object> entry : data.entrySet()) { Object value = entry.getValue(); if (value == null) continue; if (entry.getKey().equals(key.getEnum())) continue; if (!names.toString().isEmpty()) { names.append(", "); values.append(", "); } names.append(entry.getKey().name()); values.append("?"); } String sql = String.format("INSERT INTO %s (%s) VALUES (%s)", getName(), names, values); PreparedStatement statement = database.prepareStatement(sql); if (!autoKey) statement.setObject(1, key.getValue()); int i = autoKey ? 1 : 2; for (HashMap.Entry<E, Object> entry : data.entrySet()) { Object value = entry.getValue(); if (value == null) continue; if (entry.getKey().equals(key.getEnum())) continue; if (children.containsKey(entry.getKey()) && value instanceof Base) statement.setObject(i, ((Base) value).getKey().getValue()); else statement.setObject(i, value); i++; } statement.execute(); if (autoKey) return getLastKey(); return key.getValue(); } catch (SQLException e) { e.printStackTrace(); return null; } }
Object function() { if (!autoKey && contains()) throw new IllegalArgumentException(String.format(STR + STR, key.getEnum().name(), key.getValue())); try (Database database = WebApplication.getDatabase()) { database.connect(); StringBuilder names = new StringBuilder(); StringBuilder values = new StringBuilder(); if (!autoKey) { names.append(key.getEnum().name()); values.append("?"); } for (HashMap.Entry<E, Object> entry : data.entrySet()) { Object value = entry.getValue(); if (value == null) continue; if (entry.getKey().equals(key.getEnum())) continue; if (!names.toString().isEmpty()) { names.append(STR); values.append(STR); } names.append(entry.getKey().name()); values.append("?"); } String sql = String.format(STR, getName(), names, values); PreparedStatement statement = database.prepareStatement(sql); if (!autoKey) statement.setObject(1, key.getValue()); int i = autoKey ? 1 : 2; for (HashMap.Entry<E, Object> entry : data.entrySet()) { Object value = entry.getValue(); if (value == null) continue; if (entry.getKey().equals(key.getEnum())) continue; if (children.containsKey(entry.getKey()) && value instanceof Base) statement.setObject(i, ((Base) value).getKey().getValue()); else statement.setObject(i, value); i++; } statement.execute(); if (autoKey) return getLastKey(); return key.getValue(); } catch (SQLException e) { e.printStackTrace(); return null; } }
/** * Post object. Add new object with current data to the database. * * @return The key of object in database. */
Post object. Add new object with current data to the database
post
{ "repo_name": "DrPrykhodko/Marro", "path": "src/com/weffle/object/BaseObject.java", "license": "gpl-3.0", "size": 15320 }
[ "com.weffle.Database", "com.weffle.WebApplication", "java.sql.PreparedStatement", "java.sql.SQLException", "java.util.HashMap" ]
import com.weffle.Database; import com.weffle.WebApplication; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.HashMap;
import com.weffle.*; import java.sql.*; import java.util.*;
[ "com.weffle", "java.sql", "java.util" ]
com.weffle; java.sql; java.util;
2,401,978
public CodeWriter writeSeq(Stream<String> sequence, String delimiter) { return append(sequence.collect(Collectors.joining(delimiter))); }
CodeWriter function(Stream<String> sequence, String delimiter) { return append(sequence.collect(Collectors.joining(delimiter))); }
/** * Write a {@code sequence} delimited by a {@code delimiter}. * * @return this object */
Write a sequence delimited by a delimiter
writeSeq
{ "repo_name": "vert-x3/vertx-codegen", "path": "src/main/java/io/vertx/codegen/writer/CodeWriter.java", "license": "apache-2.0", "size": 4341 }
[ "java.util.stream.Collectors", "java.util.stream.Stream" ]
import java.util.stream.Collectors; import java.util.stream.Stream;
import java.util.stream.*;
[ "java.util" ]
java.util;
241,435
private void resetStoreDefinitions(Set<String> storeNamesToDelete) { // Clear entries in the metadata cache for(String storeName: storeNamesToDelete) { this.metadataCache.remove(storeName); this.storeDefinitionsStorageEngine.delete(storeName, null); this.storeNames.remove(storeName); } }
void function(Set<String> storeNamesToDelete) { for(String storeName: storeNamesToDelete) { this.metadataCache.remove(storeName); this.storeDefinitionsStorageEngine.delete(storeName, null); this.storeNames.remove(storeName); } }
/** * Function to clear all the metadata related to the given store * definitions. This is needed when a put on 'stores.xml' is called, thus * replacing the existing state. * * This method is not thread safe. It is expected that the caller of this * method will handle concurrency related issues. * * @param storeNamesToDelete */
Function to clear all the metadata related to the given store definitions. This is needed when a put on 'stores.xml' is called, thus replacing the existing state. This method is not thread safe. It is expected that the caller of this method will handle concurrency related issues
resetStoreDefinitions
{ "repo_name": "bitti/voldemort", "path": "src/java/voldemort/store/metadata/MetadataStore.java", "license": "apache-2.0", "size": 61113 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
486,546
public RemoteIterator<FileStatus> listStatusIterator(final Path p) throws FileNotFoundException, IOException { return new RemoteIterator<FileStatus>() { private final FileStatus[] stats = listStatus(p); private int i = 0;
RemoteIterator<FileStatus> function(final Path p) throws FileNotFoundException, IOException { return new RemoteIterator<FileStatus>() { private final FileStatus[] stats = listStatus(p); private int i = 0;
/** * Returns a remote iterator so that followup calls are made on demand * while consuming the entries. Each file system implementation should * override this method and provide a more efficient implementation, if * possible. * * @param p target path * @return remote iterator */
Returns a remote iterator so that followup calls are made on demand while consuming the entries. Each file system implementation should override this method and provide a more efficient implementation, if possible
listStatusIterator
{ "repo_name": "jth/hadoop", "path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java", "license": "apache-2.0", "size": 112636 }
[ "java.io.FileNotFoundException", "java.io.IOException" ]
import java.io.FileNotFoundException; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,045,973
public OvhItem cart_cartId_privateCloudDC_options_POST(String cartId, String duration, Long itemId, String planCode, String pricingMode, Long quantity) throws IOException { String qPath = "/order/cart/{cartId}/privateCloudDC/options"; StringBuilder sb = path(qPath, cartId); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "duration", duration); addBody(o, "itemId", itemId); addBody(o, "planCode", planCode); addBody(o, "pricingMode", pricingMode); addBody(o, "quantity", quantity); String resp = execN(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhItem.class); }
OvhItem function(String cartId, String duration, Long itemId, String planCode, String pricingMode, Long quantity) throws IOException { String qPath = STR; StringBuilder sb = path(qPath, cartId); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, STR, duration); addBody(o, STR, itemId); addBody(o, STR, planCode); addBody(o, STR, pricingMode); addBody(o, STR, quantity); String resp = execN(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhItem.class); }
/** * Post a new Private Cloud Dedicated Cloud option in your cart * * REST: POST /order/cart/{cartId}/privateCloudDC/options * @param cartId [required] Cart identifier * @param itemId [required] Cart item to be linked * @param planCode [required] Identifier of a Private Cloud Dedicated Cloud option offer * @param duration [required] Duration selected for the purchase of the product * @param pricingMode [required] Pricing mode selected for the purchase of the product * @param quantity [required] Quantity of product desired */
Post a new Private Cloud Dedicated Cloud option in your cart
cart_cartId_privateCloudDC_options_POST
{ "repo_name": "UrielCh/ovh-java-sdk", "path": "ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java", "license": "bsd-3-clause", "size": 511080 }
[ "java.io.IOException", "java.util.HashMap", "net.minidev.ovh.api.order.cart.OvhItem" ]
import java.io.IOException; import java.util.HashMap; import net.minidev.ovh.api.order.cart.OvhItem;
import java.io.*; import java.util.*; import net.minidev.ovh.api.order.cart.*;
[ "java.io", "java.util", "net.minidev.ovh" ]
java.io; java.util; net.minidev.ovh;
1,423,207
public static String exportMeta(String name, String data) { String escName = CmsEncoder.escapeXml(name); String escData = CmsEncoder.escapeXml(data); return ("<meta name=\"" + escName + "\" content=\"" + escData + "\" />"); }
static String function(String name, String data) { String escName = CmsEncoder.escapeXml(name); String escData = CmsEncoder.escapeXml(data); return (STRSTR\STRSTR\STR); }
/** * Generates the HTML for a meta tag with given name and content.<p> * * @param name the name of the meta tag * @param data the content of the meta tag * * @return the HTML for the meta tag */
Generates the HTML for a meta tag with given name and content
exportMeta
{ "repo_name": "victos/opencms-core", "path": "src/org/opencms/gwt/CmsGwtActionElement.java", "license": "lgpl-2.1", "size": 10589 }
[ "org.opencms.i18n.CmsEncoder" ]
import org.opencms.i18n.CmsEncoder;
import org.opencms.i18n.*;
[ "org.opencms.i18n" ]
org.opencms.i18n;
314,618
@Test(timeout = 2000) public void testGetLabelsMappingEmptyXML() throws Exception { List<LabelsToNodesInfo> responses = performGetCalls( RM_WEB_SERVICE_PATH + LABEL_MAPPINGS, LabelsToNodesInfo.class, null, null); LabelsToNodesInfo routerResponse = responses.get(0); LabelsToNodesInfo rmResponse = responses.get(1); assertNotNull(routerResponse); assertNotNull(rmResponse); assertEquals( rmResponse.getLabelsToNodes().size(), routerResponse.getLabelsToNodes().size()); }
@Test(timeout = 2000) void function() throws Exception { List<LabelsToNodesInfo> responses = performGetCalls( RM_WEB_SERVICE_PATH + LABEL_MAPPINGS, LabelsToNodesInfo.class, null, null); LabelsToNodesInfo routerResponse = responses.get(0); LabelsToNodesInfo rmResponse = responses.get(1); assertNotNull(routerResponse); assertNotNull(rmResponse); assertEquals( rmResponse.getLabelsToNodes().size(), routerResponse.getLabelsToNodes().size()); }
/** * This test validates the correctness of * {@link RMWebServiceProtocol#getLabelsToNodes()} inside Router. */
This test validates the correctness of <code>RMWebServiceProtocol#getLabelsToNodes()</code> inside Router
testGetLabelsMappingEmptyXML
{ "repo_name": "apurtell/hadoop", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/webapp/TestRouterWebServicesREST.java", "license": "apache-2.0", "size": 51798 }
[ "java.util.List", "org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.LabelsToNodesInfo", "org.junit.Assert", "org.junit.Test" ]
import java.util.List; import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.LabelsToNodesInfo; import org.junit.Assert; import org.junit.Test;
import java.util.*; import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.*; import org.junit.*;
[ "java.util", "org.apache.hadoop", "org.junit" ]
java.util; org.apache.hadoop; org.junit;
501,544
public static List<Borrower.Borrow> findBorrowWaitingForAdministrator() { final List<Borrower.Borrow> borrows = new ArrayList<>(); for (final Borrower.Borrow borrow : Inventory.getInstance() .getBorrows()) { if (borrow.getState().equals(BorrowState.ASK_BORROW)) { borrows.add(borrow); } } return borrows; }
static List<Borrower.Borrow> function() { final List<Borrower.Borrow> borrows = new ArrayList<>(); for (final Borrower.Borrow borrow : Inventory.getInstance() .getBorrows()) { if (borrow.getState().equals(BorrowState.ASK_BORROW)) { borrows.add(borrow); } } return borrows; }
/** * Find borrow waiting for administrator. * * @return the list */
Find borrow waiting for administrator
findBorrowWaitingForAdministrator
{ "repo_name": "neowutran/projetFinalSI3", "path": "src/model/Inventory.java", "license": "mit", "size": 19125 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
623,499
@Override public void shutdown() { try { if (cxn != null) { cxn.close(); } repo.shutDown(); } catch (Exception e) { throw new RuntimeException(e); } } protected static final Features FEATURES = new Features();
void function() { try { if (cxn != null) { cxn.close(); } repo.shutDown(); } catch (Exception e) { throw new RuntimeException(e); } } protected static final Features FEATURES = new Features();
/** * Shutdown the connection and repository (client-side, not server-side). */
Shutdown the connection and repository (client-side, not server-side)
shutdown
{ "repo_name": "smalyshev/blazegraph", "path": "bigdata-blueprints/src/java/com/bigdata/blueprints/BigdataGraphClient.java", "license": "gpl-2.0", "size": 7092 }
[ "com.tinkerpop.blueprints.Features" ]
import com.tinkerpop.blueprints.Features;
import com.tinkerpop.blueprints.*;
[ "com.tinkerpop.blueprints" ]
com.tinkerpop.blueprints;
532,362
Set<YahooContact> getInvited();
Set<YahooContact> getInvited();
/** * Set of contacts that are invited to the conference. * @return contacts that are invited */
Set of contacts that are invited to the conference
getInvited
{ "repo_name": "OpenYMSG/openymsg", "path": "src/main/java/org/openymsg/conference/ConferenceMembership.java", "license": "gpl-2.0", "size": 734 }
[ "java.util.Set", "org.openymsg.YahooContact" ]
import java.util.Set; import org.openymsg.YahooContact;
import java.util.*; import org.openymsg.*;
[ "java.util", "org.openymsg" ]
java.util; org.openymsg;
1,640,245
protected Map<String, Pair<String, String>> getSharedLocks() { return null; }
Map<String, Pair<String, String>> function() { return null; }
/** * The following method should return a map which is represent shared lock */
The following method should return a map which is represent shared lock
getSharedLocks
{ "repo_name": "walteryang47/ovirt-engine", "path": "backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java", "license": "apache-2.0", "size": 103472 }
[ "java.util.Map", "org.ovirt.engine.core.common.utils.Pair" ]
import java.util.Map; import org.ovirt.engine.core.common.utils.Pair;
import java.util.*; import org.ovirt.engine.core.common.utils.*;
[ "java.util", "org.ovirt.engine" ]
java.util; org.ovirt.engine;
2,904,067
private void readNextGroup() { try { int header = readUnsignedVarInt(); this.mode = (header & 1) == 0 ? MODE.RLE : MODE.PACKED; switch (mode) { case RLE: this.currentCount = header >>> 1; this.currentValue = readIntLittleEndianPaddedOnBitWidth(); return; case PACKED: int numGroups = header >>> 1; this.currentCount = numGroups * 8; if (this.currentBuffer.length < this.currentCount) { this.currentBuffer = new int[this.currentCount]; } currentBufferIdx = 0; int valueIndex = 0; while (valueIndex < this.currentCount) { // values are bit packed 8 at a time, so reading bitWidth will always work ByteBuffer buffer = in.slice(bitWidth); this.packer.unpack8Values(buffer, buffer.position(), this.currentBuffer, valueIndex); valueIndex += 8; } return; default: throw new ParquetDecodingException("not a valid mode " + this.mode); } } catch (IOException e) { throw new ParquetDecodingException("Failed to read from input stream", e); } }
void function() { try { int header = readUnsignedVarInt(); this.mode = (header & 1) == 0 ? MODE.RLE : MODE.PACKED; switch (mode) { case RLE: this.currentCount = header >>> 1; this.currentValue = readIntLittleEndianPaddedOnBitWidth(); return; case PACKED: int numGroups = header >>> 1; this.currentCount = numGroups * 8; if (this.currentBuffer.length < this.currentCount) { this.currentBuffer = new int[this.currentCount]; } currentBufferIdx = 0; int valueIndex = 0; while (valueIndex < this.currentCount) { ByteBuffer buffer = in.slice(bitWidth); this.packer.unpack8Values(buffer, buffer.position(), this.currentBuffer, valueIndex); valueIndex += 8; } return; default: throw new ParquetDecodingException(STR + this.mode); } } catch (IOException e) { throw new ParquetDecodingException(STR, e); } }
/** * Reads the next group. */
Reads the next group
readNextGroup
{ "repo_name": "chuckchen/spark", "path": "sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java", "license": "apache-2.0", "size": 16365 }
[ "java.io.IOException", "java.nio.ByteBuffer", "org.apache.parquet.io.ParquetDecodingException" ]
import java.io.IOException; import java.nio.ByteBuffer; import org.apache.parquet.io.ParquetDecodingException;
import java.io.*; import java.nio.*; import org.apache.parquet.io.*;
[ "java.io", "java.nio", "org.apache.parquet" ]
java.io; java.nio; org.apache.parquet;
2,691,763
public QueryEvalResult evaluateQuery(QueryExpression expr, final Callback<T> callback) throws QueryException, InterruptedException { final AtomicBoolean empty = new AtomicBoolean(true); try (final AutoProfiler p = AutoProfiler.logged("evaluating query", LOG)) { // In the --nokeep_going case, errors are reported in the order in which the patterns are // specified; using a linked hash set here makes sure that the left-most error is reported. Set<String> targetPatternSet = new LinkedHashSet<>(); expr.collectTargetPatterns(targetPatternSet); try { preloadOrThrow(expr, targetPatternSet); } catch (TargetParsingException e) { // Unfortunately, by evaluating the patterns in parallel, we lose some location information. throw new QueryException(expr, e.getMessage()); }
QueryEvalResult function(QueryExpression expr, final Callback<T> callback) throws QueryException, InterruptedException { final AtomicBoolean empty = new AtomicBoolean(true); try (final AutoProfiler p = AutoProfiler.logged(STR, LOG)) { Set<String> targetPatternSet = new LinkedHashSet<>(); expr.collectTargetPatterns(targetPatternSet); try { preloadOrThrow(expr, targetPatternSet); } catch (TargetParsingException e) { throw new QueryException(expr, e.getMessage()); }
/** * Evaluate the specified query expression in this environment. * * @return a {@link QueryEvalResult} object that contains the resulting set of targets and a bit * to indicate whether errors occurred during evaluation; note that the * success status can only be false if {@code --keep_going} was in effect * @throws QueryException if the evaluation failed and {@code --nokeep_going} was in * effect */
Evaluate the specified query expression in this environment
evaluateQuery
{ "repo_name": "dinowernli/bazel", "path": "src/main/java/com/google/devtools/build/lib/query2/AbstractBlazeQueryEnvironment.java", "license": "apache-2.0", "size": 11294 }
[ "com.google.devtools.build.lib.cmdline.TargetParsingException", "com.google.devtools.build.lib.profiler.AutoProfiler", "com.google.devtools.build.lib.query2.engine.Callback", "com.google.devtools.build.lib.query2.engine.QueryEvalResult", "com.google.devtools.build.lib.query2.engine.QueryException", "com.google.devtools.build.lib.query2.engine.QueryExpression", "java.util.LinkedHashSet", "java.util.Set", "java.util.concurrent.atomic.AtomicBoolean" ]
import com.google.devtools.build.lib.cmdline.TargetParsingException; import com.google.devtools.build.lib.profiler.AutoProfiler; import com.google.devtools.build.lib.query2.engine.Callback; import com.google.devtools.build.lib.query2.engine.QueryEvalResult; import com.google.devtools.build.lib.query2.engine.QueryException; import com.google.devtools.build.lib.query2.engine.QueryExpression; import java.util.LinkedHashSet; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean;
import com.google.devtools.build.lib.cmdline.*; import com.google.devtools.build.lib.profiler.*; import com.google.devtools.build.lib.query2.engine.*; import java.util.*; import java.util.concurrent.atomic.*;
[ "com.google.devtools", "java.util" ]
com.google.devtools; java.util;
2,641,292
public static List<NHANESSample> loadSamples() { CsvMapper mapper = new CsvMapper(); List<NHANESSample> samples = new LinkedList<NHANESSample>(); CsvSchema schema = CsvSchema.emptySchema().withHeader(); String filename = "nhanes_two_year_olds_bmi.csv"; try { String rawCSV = Utilities.readResource(filename); MappingIterator<NHANESSample> it = mapper.readerFor(NHANESSample.class).with(schema).readValues(rawCSV); while (it.hasNextValue()) { samples.add(it.nextValue()); } } catch (Exception e) { System.err.println("ERROR: unable to load CSV: " + filename); e.printStackTrace(); throw new RuntimeException(e); } return samples; }
static List<NHANESSample> function() { CsvMapper mapper = new CsvMapper(); List<NHANESSample> samples = new LinkedList<NHANESSample>(); CsvSchema schema = CsvSchema.emptySchema().withHeader(); String filename = STR; try { String rawCSV = Utilities.readResource(filename); MappingIterator<NHANESSample> it = mapper.readerFor(NHANESSample.class).with(schema).readValues(rawCSV); while (it.hasNextValue()) { samples.add(it.nextValue()); } } catch (Exception e) { System.err.println(STR + filename); e.printStackTrace(); throw new RuntimeException(e); } return samples; }
/** * Load the NHANES samples from resources. * @return A list of samples. */
Load the NHANES samples from resources
loadSamples
{ "repo_name": "synthetichealth/synthea", "path": "src/main/java/org/mitre/synthea/world/concepts/NHANESSample.java", "license": "apache-2.0", "size": 2967 }
[ "com.fasterxml.jackson.databind.MappingIterator", "com.fasterxml.jackson.dataformat.csv.CsvMapper", "com.fasterxml.jackson.dataformat.csv.CsvSchema", "java.util.LinkedList", "java.util.List", "org.mitre.synthea.helpers.Utilities" ]
import com.fasterxml.jackson.databind.MappingIterator; import com.fasterxml.jackson.dataformat.csv.CsvMapper; import com.fasterxml.jackson.dataformat.csv.CsvSchema; import java.util.LinkedList; import java.util.List; import org.mitre.synthea.helpers.Utilities;
import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.dataformat.csv.*; import java.util.*; import org.mitre.synthea.helpers.*;
[ "com.fasterxml.jackson", "java.util", "org.mitre.synthea" ]
com.fasterxml.jackson; java.util; org.mitre.synthea;
2,361,798
protected boolean isReserved(String word) { SqlAbstractParserImpl.Metadata metadata = getSqlParser("").getMetadata(); return metadata.isReservedWord(word.toUpperCase(Locale.ROOT)); }
boolean function(String word) { SqlAbstractParserImpl.Metadata metadata = getSqlParser("").getMetadata(); return metadata.isReservedWord(word.toUpperCase(Locale.ROOT)); }
/** Returns whether a word is reserved in this parser. This method can be * used to disable tests that behave differently with different collections * of reserved words. */
Returns whether a word is reserved in this parser. This method can be used to disable tests that behave differently with different collections
isReserved
{ "repo_name": "jcamachor/calcite", "path": "core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java", "license": "apache-2.0", "size": 391238 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
2,476,390
protected static void batchWrite(Map<String, List<WriteRequest>> items, int backoff) { if (items == null || items.isEmpty()) { return; } try { logger.debug("batchWrite(): requests {}, backoff {}", items.values().iterator().next().size(), backoff); BatchWriteItemResponse result = getClient().batchWriteItem(b -> b. returnConsumedCapacity(ReturnConsumedCapacity.TOTAL).requestItems(items)); if (result == null) { return; } logger.debug("batchWrite(): success - consumed capacity {}", result.consumedCapacity()); if (result.unprocessedItems() != null && !result.unprocessedItems().isEmpty()) { Thread.sleep((long) backoff * 1000L); for (Map.Entry<String, List<WriteRequest>> entry : result.unprocessedItems().entrySet()) { logger.warn("UNPROCESSED DynamoDB write requests for keys {} in table {}!", entry.getValue().stream().map(r -> r.getValueForField(Config._KEY, String.class).orElse("")). collect(Collectors.joining(",")), entry.getKey()); } batchWrite(result.unprocessedItems(), backoff * 2); } } catch (ProvisionedThroughputExceededException ex) { logger.warn("Write capacity exceeded for table '{}'. Retrying request in {} seconds.", items.keySet().iterator().next(), backoff); try { Thread.sleep((long) backoff * 1000L); // retry forever batchWrite(items, backoff * 2); } catch (InterruptedException ie) { logger.error(null, ie); Thread.currentThread().interrupt(); } } catch (InterruptedException ie) { logger.error(null, ie); Thread.currentThread().interrupt(); } catch (Exception e) { logger.error("Failed to execute batch write operation on table '{}'", items.keySet().iterator().next(), e); throwIfNecessary(e); } } /** * Reads a page from a standard DynamoDB table. * @param <P> type of object * @param appid the app identifier (name) * @param p a {@link Pager}
static void function(Map<String, List<WriteRequest>> items, int backoff) { if (items == null items.isEmpty()) { return; } try { logger.debug(STR, items.values().iterator().next().size(), backoff); BatchWriteItemResponse result = getClient().batchWriteItem(b -> b. returnConsumedCapacity(ReturnConsumedCapacity.TOTAL).requestItems(items)); if (result == null) { return; } logger.debug(STR, result.consumedCapacity()); if (result.unprocessedItems() != null && !result.unprocessedItems().isEmpty()) { Thread.sleep((long) backoff * 1000L); for (Map.Entry<String, List<WriteRequest>> entry : result.unprocessedItems().entrySet()) { logger.warn(STR, entry.getValue().stream().map(r -> r.getValueForField(Config._KEY, String.class).orElse(STR,STRWrite capacity exceeded for table '{}'. Retrying request in {} seconds.STRFailed to execute batch write operation on table '{}'", items.keySet().iterator().next(), e); throwIfNecessary(e); } } /** * Reads a page from a standard DynamoDB table. * @param <P> type of object * @param appid the app identifier (name) * @param p a {@link Pager}
/** * Writes multiple items in batch. * @param items a map of tables->write requests * @param backoff backoff seconds */
Writes multiple items in batch
batchWrite
{ "repo_name": "Erudika/para", "path": "para-server/src/main/java/com/erudika/para/server/persistence/AWSDynamoUtils.java", "license": "apache-2.0", "size": 34182 }
[ "com.erudika.para.core.utils.Config", "com.erudika.para.core.utils.Pager", "java.util.List", "java.util.Map", "software.amazon.awssdk.services.dynamodb.model.BatchWriteItemResponse", "software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity", "software.amazon.awssdk.services.dynamodb.model.WriteRequest" ]
import com.erudika.para.core.utils.Config; import com.erudika.para.core.utils.Pager; import java.util.List; import java.util.Map; import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemResponse; import software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity; import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
import com.erudika.para.core.utils.*; import java.util.*; import software.amazon.awssdk.services.dynamodb.model.*;
[ "com.erudika.para", "java.util", "software.amazon.awssdk" ]
com.erudika.para; java.util; software.amazon.awssdk;
1,163,142
public GpgSignature getGpgSignature(Object projectIdOrPath, String sha) throws GitLabApiException { Response response = get(Response.Status.OK, getDefaultPerPageParam(), "projects", getProjectIdOrPath(projectIdOrPath), "repository", "commits", urlEncode(sha), "signature"); return (response.readEntity(GpgSignature.class)); }
GpgSignature function(Object projectIdOrPath, String sha) throws GitLabApiException { Response response = get(Response.Status.OK, getDefaultPerPageParam(), STR, getProjectIdOrPath(projectIdOrPath), STR, STR, urlEncode(sha), STR); return (response.readEntity(GpgSignature.class)); }
/** * Get the GPG signature from a commit, if it is signed. For unsigned commits, it results in a 404 response. * * <pre><code>GitLab Endpoint: GET /projects/:id/repository/commits/:sha/signature</code></pre> * * @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance * @param sha a commit hash or name of a branch or tag * @return the GpgSignature instance for the specified project ID/sha pair * @throws GitLabApiException GitLabApiException if any exception occurs during execution */
Get the GPG signature from a commit, if it is signed. For unsigned commits, it results in a 404 response. <code><code>GitLab Endpoint: GET /projects/:id/repository/commits/:sha/signature</code></code>
getGpgSignature
{ "repo_name": "gmessner/gitlab4j-api", "path": "src/main/java/org/gitlab4j/api/CommitsApi.java", "license": "mit", "size": 49798 }
[ "javax.ws.rs.core.Response", "org.gitlab4j.api.models.GpgSignature" ]
import javax.ws.rs.core.Response; import org.gitlab4j.api.models.GpgSignature;
import javax.ws.rs.core.*; import org.gitlab4j.api.models.*;
[ "javax.ws", "org.gitlab4j.api" ]
javax.ws; org.gitlab4j.api;
2,849,128
ListenableFuture<SegmentsAndCommitMetadata> dropInBackground(SegmentsAndCommitMetadata segmentsAndCommitMetadata) { log.debugSegments(segmentsAndCommitMetadata.getSegments(), "Dropping segments"); final ListenableFuture<?> dropFuture = Futures.allAsList( segmentsAndCommitMetadata .getSegments() .stream() .map(segment -> appenderator.drop(SegmentIdWithShardSpec.fromDataSegment(segment))) .collect(Collectors.toList()) ); return Futures.transform( dropFuture, (Function<Object, SegmentsAndCommitMetadata>) x -> { final Object metadata = segmentsAndCommitMetadata.getCommitMetadata(); return new SegmentsAndCommitMetadata( segmentsAndCommitMetadata.getSegments(), metadata == null ? null : ((AppenderatorDriverMetadata) metadata).getCallerMetadata() ); } ); }
ListenableFuture<SegmentsAndCommitMetadata> dropInBackground(SegmentsAndCommitMetadata segmentsAndCommitMetadata) { log.debugSegments(segmentsAndCommitMetadata.getSegments(), STR); final ListenableFuture<?> dropFuture = Futures.allAsList( segmentsAndCommitMetadata .getSegments() .stream() .map(segment -> appenderator.drop(SegmentIdWithShardSpec.fromDataSegment(segment))) .collect(Collectors.toList()) ); return Futures.transform( dropFuture, (Function<Object, SegmentsAndCommitMetadata>) x -> { final Object metadata = segmentsAndCommitMetadata.getCommitMetadata(); return new SegmentsAndCommitMetadata( segmentsAndCommitMetadata.getSegments(), metadata == null ? null : ((AppenderatorDriverMetadata) metadata).getCallerMetadata() ); } ); }
/** * Drop segments in background. The segments should be pushed (in batch ingestion) or published (in streaming * ingestion) before being dropped. * * @param segmentsAndCommitMetadata result of pushing or publishing * * @return a future for dropping segments */
Drop segments in background. The segments should be pushed (in batch ingestion) or published (in streaming ingestion) before being dropped
dropInBackground
{ "repo_name": "mghosh4/druid", "path": "server/src/main/java/org/apache/druid/segment/realtime/appenderator/BaseAppenderatorDriver.java", "license": "apache-2.0", "size": 29189 }
[ "com.google.common.base.Function", "com.google.common.util.concurrent.Futures", "com.google.common.util.concurrent.ListenableFuture", "java.util.stream.Collectors" ]
import com.google.common.base.Function; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import java.util.stream.Collectors;
import com.google.common.base.*; import com.google.common.util.concurrent.*; import java.util.stream.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
2,869,750
protected void searchSingleFolder(File aFolder) { if (aFolder!=null && !mTerms.isEmpty() && aFolder.exists() && aFolder.isDirectory()) { String theSysFolder = BitsFileUtils.getExternalSystemFolder().getPath(); if (aFolder.getPath().equals(theSysFolder)) { theSysFolder = ""; } //search file system using a queue instead of resursive function calls FifoQueue<File> theFileList = new FifoQueue<File>(aFolder.listFiles()); File subFile; while (!theFileList.isEmpty() && !Thread.interrupted()) { if (mMaxResults>0 && mSearchResultCounter>mMaxResults) break; try { subFile = theFileList.remove(); boolean bFileIsJumpPoint = BitsFileUtils.isFileJumpPoint(subFile); if (!bFileIsJumpPoint) { if (!subFile.isHidden() && subFile.canRead()) { if (matchFile(subFile)) { mSearchResults.add(subFile); mSearchResultCounter += 1; } if (subFile.isDirectory() && !subFile.getPath().equals(theSysFolder) && !bFileIsJumpPoint) { theFileList.addAll(subFile.listFiles()); } } } subFile = null; } catch (OutOfMemoryError oom) { System.gc(); try { Thread.sleep(1000L); } catch (InterruptedException e) { //exit, nothing to do } } Thread.yield(); }//while } }
void function(File aFolder) { if (aFolder!=null && !mTerms.isEmpty() && aFolder.exists() && aFolder.isDirectory()) { String theSysFolder = BitsFileUtils.getExternalSystemFolder().getPath(); if (aFolder.getPath().equals(theSysFolder)) { theSysFolder = ""; } FifoQueue<File> theFileList = new FifoQueue<File>(aFolder.listFiles()); File subFile; while (!theFileList.isEmpty() && !Thread.interrupted()) { if (mMaxResults>0 && mSearchResultCounter>mMaxResults) break; try { subFile = theFileList.remove(); boolean bFileIsJumpPoint = BitsFileUtils.isFileJumpPoint(subFile); if (!bFileIsJumpPoint) { if (!subFile.isHidden() && subFile.canRead()) { if (matchFile(subFile)) { mSearchResults.add(subFile); mSearchResultCounter += 1; } if (subFile.isDirectory() && !subFile.getPath().equals(theSysFolder) && !bFileIsJumpPoint) { theFileList.addAll(subFile.listFiles()); } } } subFile = null; } catch (OutOfMemoryError oom) { System.gc(); try { Thread.sleep(1000L); } catch (InterruptedException e) { } } Thread.yield(); } } }
/** * Search the folder and it's subfolders for files/folders matching the query. * Does not reset the search queue from scratch, nor set the finished searching flag. * * @param aFolder - root folder to start the search */
Search the folder and it's subfolders for files/folders matching the query. Does not reset the search queue from scratch, nor set the finished searching flag
searchSingleFolder
{ "repo_name": "baracudda/androidBits", "path": "lib_androidBits/src/main/java/com/blackmoonit/androidbits/filesystem/FileMatcher.java", "license": "apache-2.0", "size": 16020 }
[ "com.blackmoonit.androidbits.utils.FifoQueue", "java.io.File" ]
import com.blackmoonit.androidbits.utils.FifoQueue; import java.io.File;
import com.blackmoonit.androidbits.utils.*; import java.io.*;
[ "com.blackmoonit.androidbits", "java.io" ]
com.blackmoonit.androidbits; java.io;
1,588,491
// Define data DefaultData data = Data.create(); data.add("age", "gender", "zipcode"); data.add("34", "male", "81667"); data.add("45", "female", "81675"); data.add("66", "male", "81925"); data.add("70", "female", "81931"); data.add("34", "female", "81931"); data.add("70", "male", "81931"); data.add("45", "male", "81931"); // Define hierarchies DefaultHierarchy age = Hierarchy.create(); age.add("34", "<50", "*"); age.add("45", "<50", "*"); age.add("66", ">=50", "*"); age.add("70", ">=50", "*"); DefaultHierarchy gender = Hierarchy.create(); gender.add("male", "*"); gender.add("female", "*"); // Only excerpts for readability DefaultHierarchy zipcode = Hierarchy.create(); zipcode.add("81667", "8166*", "816**", "81***", "8****", "*****"); zipcode.add("81675", "8167*", "816**", "81***", "8****", "*****"); zipcode.add("81925", "8192*", "819**", "81***", "8****", "*****"); zipcode.add("81931", "8193*", "819**", "81***", "8****", "*****"); data.getDefinition().setAttributeType("age", age); data.getDefinition().setAttributeType("gender", gender); data.getDefinition().setAttributeType("zipcode", zipcode); // Create an instance of the anonymizer ARXAnonymizer anonymizer = new ARXAnonymizer(); // Create config ARXConfiguration config = ARXConfiguration.create(); config.addCriterion(new KAnonymity(2)); config.setMaxOutliers(0d); ARXResult result = anonymizer.anonymize(data, config); // Obtain results ARXLattice lattice = result.getLattice(); ARXNode topNode = lattice.getTop(); ARXNode bottomNode = lattice.getBottom(); // Obtain various data representations DataHandle optimal = result.getOutput(); DataHandle top = result.getOutput(topNode); DataHandle bottom = result.getOutput(bottomNode); // Print input System.out.println(" - Input data:"); printHandle(data.getHandle()); // Print results System.out.println(" - Top node data:"); printHandle(top); System.out.println(" - Bottom node data:"); printHandle(bottom); System.out.println(" - Optimal data:"); printHandle(optimal); }
DefaultData data = Data.create(); data.add("age", STR, STR); data.add("34", "male", "81667"); data.add("45", STR, "81675"); data.add("66", "male", "81925"); data.add("70", STR, "81931"); data.add("34", STR, "81931"); data.add("70", "male", "81931"); data.add("45", "male", "81931"); DefaultHierarchy age = Hierarchy.create(); age.add("34", "<50", "*"); age.add("45", "<50", "*"); age.add("66", ">=50", "*"); age.add("70", ">=50", "*"); DefaultHierarchy gender = Hierarchy.create(); gender.add("male", "*"); gender.add(STR, "*"); DefaultHierarchy zipcode = Hierarchy.create(); zipcode.add("81667", "8166*", "816**", "81***", "8****", "*****"); zipcode.add("81675", "8167*", "816**", "81***", "8****", "*****"); zipcode.add("81925", "8192*", "819**", "81***", "8****", "*****"); zipcode.add("81931", "8193*", "819**", "81***", "8****", "*****"); data.getDefinition().setAttributeType("age", age); data.getDefinition().setAttributeType(STR, gender); data.getDefinition().setAttributeType(STR, zipcode); ARXAnonymizer anonymizer = new ARXAnonymizer(); ARXConfiguration config = ARXConfiguration.create(); config.addCriterion(new KAnonymity(2)); config.setMaxOutliers(0d); ARXResult result = anonymizer.anonymize(data, config); ARXLattice lattice = result.getLattice(); ARXNode topNode = lattice.getTop(); ARXNode bottomNode = lattice.getBottom(); DataHandle optimal = result.getOutput(); DataHandle top = result.getOutput(topNode); DataHandle bottom = result.getOutput(bottomNode); System.out.println(STR); printHandle(data.getHandle()); System.out.println(STR); printHandle(top); System.out.println(STR); printHandle(bottom); System.out.println(STR); printHandle(optimal); }
/** * Entry point. * * @param args * the arguments */
Entry point
main
{ "repo_name": "fstahnke/arx", "path": "src/example/org/deidentifier/arx/examples/Example19.java", "license": "apache-2.0", "size": 4203 }
[ "org.deidentifier.arx.ARXAnonymizer", "org.deidentifier.arx.ARXConfiguration", "org.deidentifier.arx.ARXLattice", "org.deidentifier.arx.ARXResult", "org.deidentifier.arx.AttributeType", "org.deidentifier.arx.Data", "org.deidentifier.arx.DataHandle", "org.deidentifier.arx.criteria.KAnonymity" ]
import org.deidentifier.arx.ARXAnonymizer; import org.deidentifier.arx.ARXConfiguration; import org.deidentifier.arx.ARXLattice; import org.deidentifier.arx.ARXResult; import org.deidentifier.arx.AttributeType; import org.deidentifier.arx.Data; import org.deidentifier.arx.DataHandle; import org.deidentifier.arx.criteria.KAnonymity;
import org.deidentifier.arx.*; import org.deidentifier.arx.criteria.*;
[ "org.deidentifier.arx" ]
org.deidentifier.arx;
1,530,229
public static float[] getMaxAtackDamage(Collection<UnitDef> warUnits) { float[] maxDmg=null; for (UnitDef def:warUnits) { if (def.isAbleToAttack()) { float[] tmpDmg=TWarStrategy.getSumWeaponDamage(def); // TODO isParalyzed, isAbleToGround/air... if (tmpDmg!=null) { if (maxDmg==null) maxDmg=tmpDmg.clone(); else // TODO check tmpDmg.length and maxDmg.length for (int i=0; i<tmpDmg.length;i++) if (tmpDmg[i]>maxDmg[i]) maxDmg[i]=tmpDmg[i]; } } } return maxDmg; }
static float[] function(Collection<UnitDef> warUnits) { float[] maxDmg=null; for (UnitDef def:warUnits) { if (def.isAbleToAttack()) { float[] tmpDmg=TWarStrategy.getSumWeaponDamage(def); if (tmpDmg!=null) { if (maxDmg==null) maxDmg=tmpDmg.clone(); else for (int i=0; i<tmpDmg.length;i++) if (tmpDmg[i]>maxDmg[i]) maxDmg[i]=tmpDmg[i]; } } } return maxDmg; }
/** * Get max weapon damage by damage type. * @param warUnits * @return max damage of [unit weapon damage summ], or null if not weapon on this list, or all weapon is were specifed. */
Get max weapon damage by damage type
getMaxAtackDamage
{ "repo_name": "playerO1/FieldBOT", "path": "src/fieldbot/TTechLevel.java", "license": "gpl-2.0", "size": 27852 }
[ "com.springrts.ai.oo.clb.UnitDef", "java.util.Collection" ]
import com.springrts.ai.oo.clb.UnitDef; import java.util.Collection;
import com.springrts.ai.oo.clb.*; import java.util.*;
[ "com.springrts.ai", "java.util" ]
com.springrts.ai; java.util;
746,727
@Override public Request<PurchaseReservedInstancesOfferingRequest> getDryRunRequest() { Request<PurchaseReservedInstancesOfferingRequest> request = new PurchaseReservedInstancesOfferingRequestMarshaller() .marshall(this); request.addParameter("DryRun", Boolean.toString(true)); return request; }
Request<PurchaseReservedInstancesOfferingRequest> function() { Request<PurchaseReservedInstancesOfferingRequest> request = new PurchaseReservedInstancesOfferingRequestMarshaller() .marshall(this); request.addParameter(STR, Boolean.toString(true)); return request; }
/** * This method is intended for internal use only. Returns the marshaled * request configured with additional parameters to enable operation * dry-run. */
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run
getDryRunRequest
{ "repo_name": "flofreud/aws-sdk-java", "path": "aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/PurchaseReservedInstancesOfferingRequest.java", "license": "apache-2.0", "size": 10065 }
[ "com.amazonaws.Request", "com.amazonaws.services.ec2.model.transform.PurchaseReservedInstancesOfferingRequestMarshaller" ]
import com.amazonaws.Request; import com.amazonaws.services.ec2.model.transform.PurchaseReservedInstancesOfferingRequestMarshaller;
import com.amazonaws.*; import com.amazonaws.services.ec2.model.transform.*;
[ "com.amazonaws", "com.amazonaws.services" ]
com.amazonaws; com.amazonaws.services;
2,055,988
final ExecutorPlatform platform = ExecutorPlatform.determine(); if (platform == ExecutorPlatform.UNSUPPORTED) throw new UnsupportedOperationException(String.format("Operating system '%s' (%s, %s) is not supported.", ExecutorPlatform.OPERATING_SYSTEM_NAME, ExecutorPlatform.OPERATING_SYSTEM_VERSION, ExecutorPlatform.OPERATING_SYSTEM_ARCHITECTURE)); String host = "localhost"; int port = Executor.DEFAULT_SERVER_PORT; boolean test = false; boolean cleanUp = true; boolean useDocker = Configuration.DEFAULT_CONFIGURATION.shouldUseDocker(); for (int i = 0; i < args.length; i++) try { switch (args[i]) { case "-h": case "-host": host = args[++i]; break; case "-p": case "-port": try { port = Integer.parseInt(args[++i]); } catch (NumberFormatException ex) { throw new IllegalArgumentException(String.format("Value '%s' for command-line argument '%s' is invalid. Use integer number.", args[i], args[i - 1])); } if (port < 0 || 65535 < port) throw new IllegalArgumentException(String.format("Value '%s' for command-line argument '%s' is invalid. Use unsigned 16-bit integer (0 to 65535).", args[i], args[i - 1])); break; case "-t": case "-test": test = Executor.parseBoolean(args[i], args[++i]); break; case "-c": case "-cleanup": cleanUp = Executor.parseBoolean(args[i], args[++i]); break; case "-d": case "-docker": useDocker = Executor.parseBoolean(args[i], args[++i]); if (useDocker && !platform.hasDockerSupport()) throw new IllegalArgumentException(String.format("Cannot use Docker on %s platform.", platform)); break; default: throw new IllegalArgumentException(String.format("Command-line argument '%s' is invalid.", args[i])); } } catch (ArrayIndexOutOfBoundsException ex) { throw new IllegalArgumentException(String.format("You did not provide a value for the command-line argument '%s'.", args[i]), ex); } if (!test) Executor.run(port, new ConfigurationImpl(useDocker, cleanUp)); else Executor.test(host, port); }
final ExecutorPlatform platform = ExecutorPlatform.determine(); if (platform == ExecutorPlatform.UNSUPPORTED) throw new UnsupportedOperationException(String.format(STR, ExecutorPlatform.OPERATING_SYSTEM_NAME, ExecutorPlatform.OPERATING_SYSTEM_VERSION, ExecutorPlatform.OPERATING_SYSTEM_ARCHITECTURE)); String host = STR; int port = Executor.DEFAULT_SERVER_PORT; boolean test = false; boolean cleanUp = true; boolean useDocker = Configuration.DEFAULT_CONFIGURATION.shouldUseDocker(); for (int i = 0; i < args.length; i++) try { switch (args[i]) { case "-h": case "-host": host = args[++i]; break; case "-p": case "-port": try { port = Integer.parseInt(args[++i]); } catch (NumberFormatException ex) { throw new IllegalArgumentException(String.format(STR, args[i], args[i - 1])); } if (port < 0 65535 < port) throw new IllegalArgumentException(String.format(STR, args[i], args[i - 1])); break; case "-t": case "-test": test = Executor.parseBoolean(args[i], args[++i]); break; case "-c": case STR: cleanUp = Executor.parseBoolean(args[i], args[++i]); break; case "-d": case STR: useDocker = Executor.parseBoolean(args[i], args[++i]); if (useDocker && !platform.hasDockerSupport()) throw new IllegalArgumentException(String.format(STR, platform)); break; default: throw new IllegalArgumentException(String.format(STR, args[i])); } } catch (ArrayIndexOutOfBoundsException ex) { throw new IllegalArgumentException(String.format(STR, args[i]), ex); } if (!test) Executor.run(port, new ConfigurationImpl(useDocker, cleanUp)); else Executor.test(host, port); }
/** * Main method. * Starts the Executor service. * * @param args command-line arguments (none used) */
Main method. Starts the Executor service
main
{ "repo_name": "Progressor/ProgressorExecutor", "path": "src/main/java/ch/bfh/progressor/executor/Executor.java", "license": "mit", "size": 7138 }
[ "ch.bfh.progressor.executor.api.Configuration", "ch.bfh.progressor.executor.api.ExecutorPlatform", "ch.bfh.progressor.executor.impl.ConfigurationImpl" ]
import ch.bfh.progressor.executor.api.Configuration; import ch.bfh.progressor.executor.api.ExecutorPlatform; import ch.bfh.progressor.executor.impl.ConfigurationImpl;
import ch.bfh.progressor.executor.api.*; import ch.bfh.progressor.executor.impl.*;
[ "ch.bfh.progressor" ]
ch.bfh.progressor;
1,733,682
public static CandidateEntry fetchByU_P_Last(long userId, long wikiPageId, OrderByComparator<CandidateEntry> orderByComparator) { return getPersistence() .fetchByU_P_Last(userId, wikiPageId, orderByComparator); }
static CandidateEntry function(long userId, long wikiPageId, OrderByComparator<CandidateEntry> orderByComparator) { return getPersistence() .fetchByU_P_Last(userId, wikiPageId, orderByComparator); }
/** * Returns the last candidate entry in the ordered set where userId = &#63; and wikiPageId = &#63;. * * @param userId the user ID * @param wikiPageId the wiki page ID * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) * @return the last matching candidate entry, or <code>null</code> if a matching candidate entry could not be found */
Returns the last candidate entry in the ordered set where userId = &#63; and wikiPageId = &#63;
fetchByU_P_Last
{ "repo_name": "moltam89/OWXP", "path": "modules/micro-maintainance-candidate/micro-maintainance-candidate-api/src/main/java/com/liferay/micro/maintainance/candidate/service/persistence/CandidateEntryUtil.java", "license": "gpl-3.0", "size": 103522 }
[ "com.liferay.micro.maintainance.candidate.model.CandidateEntry", "com.liferay.portal.kernel.util.OrderByComparator" ]
import com.liferay.micro.maintainance.candidate.model.CandidateEntry; import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.micro.maintainance.candidate.model.*; import com.liferay.portal.kernel.util.*;
[ "com.liferay.micro", "com.liferay.portal" ]
com.liferay.micro; com.liferay.portal;
1,684,302