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
public static void rollBack(Connection dbConnection) { IdentityDatabaseUtil.rollBack(dbConnection); }
static void function(Connection dbConnection) { IdentityDatabaseUtil.rollBack(dbConnection); }
/** * Utility method to rollback a database connection * * @param dbConnection Database <code>Connection</code> object */
Utility method to rollback a database connection
rollBack
{ "repo_name": "johannnallathamby/carbon-identity", "path": "components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/util/IdentityApplicationManagementUtil.java", "license": "apache-2.0", "size": 31791 }
[ "java.sql.Connection", "org.wso2.carbon.identity.core.util.IdentityDatabaseUtil" ]
import java.sql.Connection; import org.wso2.carbon.identity.core.util.IdentityDatabaseUtil;
import java.sql.*; import org.wso2.carbon.identity.core.util.*;
[ "java.sql", "org.wso2.carbon" ]
java.sql; org.wso2.carbon;
433,660
private void dumpProcedures(Element parent, DatabaseMetaData metaData) throws SQLException { ResultSet result = null; try { result = metaData.getProcedures(_catalogPattern, _schemaPattern, _procedurePattern); } catch (SQLException ex) { log("Could not determine the procedures: "+ex.getMessage(), Project.MSG_ERR); return; } Element proceduresElem = parent.addElement("procedures"); Set columns = getColumnsInResultSet(result); try { while (result.next()) { String procedureName = getString(result, "PROCEDURE_NAME"); if ((procedureName == null) || (procedureName.length() == 0)) { continue; } Element procedureElem = proceduresElem.addElement("procedure"); String catalog = getString(result, "PROCEDURE_CAT"); String schema = getString(result, "PROCEDURE_SCHEM"); log("Reading procedure " + ((schema != null) && (schema.length() > 0) ? schema + "." : "") + procedureName, Project.MSG_INFO); procedureElem.addAttribute("name", procedureName); if (catalog != null) { procedureElem.addAttribute("catalog", catalog); } if (schema != null) { procedureElem.addAttribute("schema", schema); } addStringAttribute(result, columns, "REMARKS", procedureElem, "remarks"); if (columns.contains("PROCEDURE_TYPE")) { switch (result.getShort("PROCEDURE_TYPE")) { case DatabaseMetaData.procedureReturnsResult: procedureElem.addAttribute("type", "returns result"); break; case DatabaseMetaData.procedureNoResult: procedureElem.addAttribute("type", "doesn't return result"); break; case DatabaseMetaData.procedureResultUnknown: procedureElem.addAttribute("type", "may return result"); break; default: procedureElem.addAttribute("type", "unknown"); break; } } dumpProcedure(procedureElem, metaData, "%", "%", procedureName); } } finally { if (result != null) { result.close(); } } }
void function(Element parent, DatabaseMetaData metaData) throws SQLException { ResultSet result = null; try { result = metaData.getProcedures(_catalogPattern, _schemaPattern, _procedurePattern); } catch (SQLException ex) { log(STR+ex.getMessage(), Project.MSG_ERR); return; } Element proceduresElem = parent.addElement(STR); Set columns = getColumnsInResultSet(result); try { while (result.next()) { String procedureName = getString(result, STR); if ((procedureName == null) (procedureName.length() == 0)) { continue; } Element procedureElem = proceduresElem.addElement(STR); String catalog = getString(result, STR); String schema = getString(result, STR); log(STR + ((schema != null) && (schema.length() > 0) ? schema + "." : STRnameSTRcatalogSTRschemaSTRREMARKSSTRremarksSTRPROCEDURE_TYPESTRPROCEDURE_TYPESTRtypeSTRreturns resultSTRtypeSTRdoesn't return resultSTRtypeSTRmay return resultSTRtypeSTRunknownSTR%STR%", procedureName); } } finally { if (result != null) { result.close(); } } }
/** * Dumps all procedures. * * @param parent The parent element * @param metaData The database metadata */
Dumps all procedures
dumpProcedures
{ "repo_name": "etiago/apache-ddlutils", "path": "src/java/org/apache/ddlutils/task/DumpMetadataTask.java", "license": "apache-2.0", "size": 51605 }
[ "java.sql.DatabaseMetaData", "java.sql.ResultSet", "java.sql.SQLException", "java.util.Set", "org.apache.tools.ant.Project", "org.dom4j.Element" ]
import java.sql.DatabaseMetaData; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Set; import org.apache.tools.ant.Project; import org.dom4j.Element;
import java.sql.*; import java.util.*; import org.apache.tools.ant.*; import org.dom4j.*;
[ "java.sql", "java.util", "org.apache.tools", "org.dom4j" ]
java.sql; java.util; org.apache.tools; org.dom4j;
1,661,834
static ResultOrException generateException(final String class_name, final String msg, final int i) { return ResultOrException.newBuilder() .setException(buildException(class_name, msg)).setIndex(i).build(); }
static ResultOrException generateException(final String class_name, final String msg, final int i) { return ResultOrException.newBuilder() .setException(buildException(class_name, msg)).setIndex(i).build(); }
/** * Override that returns an exception with the proper HBase class name for a * multi action response. * @param class_name The name of the remote class * @param msg The message to encode * @param i The index of the parent RPC in the batch * @return The exception */
Override that returns an exception with the proper HBase class name for a multi action response
generateException
{ "repo_name": "manolama/asynchbase", "path": "test/PBufResponses.java", "license": "bsd-3-clause", "size": 12492 }
[ "org.hbase.async.generated.ClientPB" ]
import org.hbase.async.generated.ClientPB;
import org.hbase.async.generated.*;
[ "org.hbase.async" ]
org.hbase.async;
2,281,472
EClass getImport();
EClass getImport();
/** * Returns the meta object for class '{@link org.eclipse.bpmn2.Import <em>Import</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Import</em>'. * @see org.eclipse.bpmn2.Import * @generated */
Returns the meta object for class '<code>org.eclipse.bpmn2.Import Import</code>'.
getImport
{ "repo_name": "Rikkola/kie-wb-common", "path": "kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Bpmn2Package.java", "license": "apache-2.0", "size": 929298 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,124,311
public MotionEvent getMotionEvent() { return this.mMotionEvent; } // =========================================================== // Methods for/from SuperClass/Interfaces // =========================================================== // =========================================================== // Methods // =========================================================== // =========================================================== // Inner and Anonymous Classes // =========================================================== private static final class TouchEventPool extends GenericPool<TouchEvent> { // =========================================================== // Methods for/from SuperClass/Interfaces // ===========================================================
MotionEvent function() { return this.mMotionEvent; } private static final class TouchEventPool extends GenericPool<TouchEvent> {
/** * Provides the raw {@link MotionEvent} that originally caused this {@link TouchEvent}. * The coordinates of this {@link MotionEvent} are in surface-coordinates! * @return */
Provides the raw <code>MotionEvent</code> that originally caused this <code>TouchEvent</code>. The coordinates of this <code>MotionEvent</code> are in surface-coordinates
getMotionEvent
{ "repo_name": "Munazza/AndEngine", "path": "src/org/andengine/input/touch/TouchEvent.java", "license": "apache-2.0", "size": 4083 }
[ "android.view.MotionEvent", "org.andengine.util.adt.pool.GenericPool" ]
import android.view.MotionEvent; import org.andengine.util.adt.pool.GenericPool;
import android.view.*; import org.andengine.util.adt.pool.*;
[ "android.view", "org.andengine.util" ]
android.view; org.andengine.util;
2,032,232
public void setAuthenticationInfo(List<String> clientIds, List<String> audiences) { Entity config = getEndpointEntity(EndpointV1.class); config.setProperty(CLIENT_IDS, clientIds); config.setProperty(AUDIENCES, audiences); datastoreService.put(config); // Google Cloud Endpoints infrastructure caches the configuration in Memcache. // In order for the changes to be applied without restart/redeployment // they need to be updated not only in Datastore, but also in Memcache. memcacheService.put(ENDPOINT_CONFIGURATION_KIND + "." + EndpointV1.class.getName(), config); }
void function(List<String> clientIds, List<String> audiences) { Entity config = getEndpointEntity(EndpointV1.class); config.setProperty(CLIENT_IDS, clientIds); config.setProperty(AUDIENCES, audiences); datastoreService.put(config); memcacheService.put(ENDPOINT_CONFIGURATION_KIND + "." + EndpointV1.class.getName(), config); }
/** * Configures the Cloud Endpoints exposed from this backend. Specifically, it * configures {@link EndpointV1} endpoints. This call overwrites any * previously specified settings. * * @param clientIds * list of clientIds that will be allowed to make authenticated calls * to this backend. * @param audiences * list of audiences that will be allowed to make authenticated calls * to this backend. */
Configures the Cloud Endpoints exposed from this backend. Specifically, it configures <code>EndpointV1</code> endpoints. This call overwrites any previously specified settings
setAuthenticationInfo
{ "repo_name": "alexismp/mobile-backend-starter-mavenized", "path": "src/main/java/com/google/cloud/backend/config/CloudEndpointsConfigManager.java", "license": "apache-2.0", "size": 3664 }
[ "com.google.appengine.api.datastore.Entity", "com.google.cloud.backend.spi.EndpointV1", "java.util.List" ]
import com.google.appengine.api.datastore.Entity; import com.google.cloud.backend.spi.EndpointV1; import java.util.List;
import com.google.appengine.api.datastore.*; import com.google.cloud.backend.spi.*; import java.util.*;
[ "com.google.appengine", "com.google.cloud", "java.util" ]
com.google.appengine; com.google.cloud; java.util;
723,878
public void checkpointDatabase() throws HandleException { // Not implemented if (log.isInfoEnabled()) { log.info("Called checkpointDatabase (not implemented)"); } }
void function() throws HandleException { if (log.isInfoEnabled()) { log.info(STR); } }
/** * HandleStorage interface method - not implemented. */
HandleStorage interface method - not implemented
checkpointDatabase
{ "repo_name": "mdiggory/dryad-repo", "path": "dspace-api/src/main/java/org/dspace/handle/HandlePlugin.java", "license": "bsd-3-clause", "size": 11905 }
[ "net.handle.hdllib.HandleException" ]
import net.handle.hdllib.HandleException;
import net.handle.hdllib.*;
[ "net.handle.hdllib" ]
net.handle.hdllib;
837,748
private PlanWithProperties pickPlan(List<PlanWithProperties> possiblePlans, Context context) { checkArgument(!possiblePlans.isEmpty()); if (preferStreamingOperators) { possiblePlans = new ArrayList<>(possiblePlans); Collections.sort(possiblePlans, Comparator.comparing(PlanWithProperties::getProperties, streamingExecutionPreference(context.getPreferredProperties()))); // stable sort; is Collections.min() guaranteed to be stable? } return possiblePlans.get(0); }
PlanWithProperties function(List<PlanWithProperties> possiblePlans, Context context) { checkArgument(!possiblePlans.isEmpty()); if (preferStreamingOperators) { possiblePlans = new ArrayList<>(possiblePlans); Collections.sort(possiblePlans, Comparator.comparing(PlanWithProperties::getProperties, streamingExecutionPreference(context.getPreferredProperties()))); } return possiblePlans.get(0); }
/** * possiblePlans should be provided in layout preference order */
possiblePlans should be provided in layout preference order
pickPlan
{ "repo_name": "cberner/presto", "path": "presto-main/src/main/java/com/facebook/presto/sql/planner/optimizations/AddExchanges.java", "license": "apache-2.0", "size": 69667 }
[ "com.google.common.base.Preconditions", "java.util.ArrayList", "java.util.Collections", "java.util.Comparator", "java.util.List" ]
import com.google.common.base.Preconditions; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List;
import com.google.common.base.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
471,513
public static void writeDocument(Document document, OutputStream os) throws Exception { TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); DOMSource source = new DOMSource(document); StreamResult result = new StreamResult(os); transformer.transform(source, result); }
static void function(Document document, OutputStream os) throws Exception { TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); DOMSource source = new DOMSource(document); StreamResult result = new StreamResult(os); transformer.transform(source, result); }
/** * writeDocument streams out given document to given output stream * * @param document * @param os * @throws Exception */
writeDocument streams out given document to given output stream
writeDocument
{ "repo_name": "cherryhill/collectionspace-services", "path": "services/common/src/main/java/org/collectionspace/services/common/document/DocumentUtils.java", "license": "apache-2.0", "size": 49678 }
[ "java.io.OutputStream", "javax.xml.transform.OutputKeys", "javax.xml.transform.Transformer", "javax.xml.transform.TransformerFactory", "javax.xml.transform.dom.DOMSource", "javax.xml.transform.stream.StreamResult", "org.dom4j.Document", "org.w3c.dom.Document" ]
import java.io.OutputStream; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.dom4j.Document; import org.w3c.dom.Document;
import java.io.*; import javax.xml.transform.*; import javax.xml.transform.dom.*; import javax.xml.transform.stream.*; import org.dom4j.*; import org.w3c.dom.*;
[ "java.io", "javax.xml", "org.dom4j", "org.w3c.dom" ]
java.io; javax.xml; org.dom4j; org.w3c.dom;
1,130,680
public ScoreboardHelper setUpdateInterval(int tickDelay, final Runnable onUpdate) { stopUpdating(); timer = new BukkitRunnable() {
ScoreboardHelper function(int tickDelay, final Runnable onUpdate) { stopUpdating(); timer = new BukkitRunnable() {
/** * Start a repeating task * * @param tickDelay The time to wait in between executions * @param onUpdate What to execute * * @return The helper instance */
Start a repeating task
setUpdateInterval
{ "repo_name": "DonkeyCore/MinigameManager", "path": "src/main/java/minigamemanager/api/scoreboard/ScoreboardHelper.java", "license": "mit", "size": 3654 }
[ "org.bukkit.scheduler.BukkitRunnable" ]
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scheduler.*;
[ "org.bukkit.scheduler" ]
org.bukkit.scheduler;
2,242,467
@Timed Stream<DataSetMetadata> list(String filter, Sort sortField, Order sortDirection);
Stream<DataSetMetadata> list(String filter, Sort sortField, Order sortDirection);
/** * Returns an {@link Iterable} of all {@link DataSetMetadata} that match given filter. * * @param filter A TQL filter (i.e. storage-agnostic) * @param sortField An optional field to be used to sort results (may be <code>null</code> to indicate no sort). * @param sortDirection An optional field to be used how to sort results (may be <code>null</code> to indicate no sort). Valid * values are "ASC" or "DESC". * @return A {@link Iterable} of {@link DataSetMetadata} that matches <code>filter</code>. */
Returns an <code>Iterable</code> of all <code>DataSetMetadata</code> that match given filter
list
{ "repo_name": "Talend/data-prep", "path": "dataprep-dataset/src/main/java/org/talend/dataprep/dataset/store/metadata/DataSetMetadataRepository.java", "license": "apache-2.0", "size": 4861 }
[ "java.util.stream.Stream", "org.talend.dataprep.api.dataset.DataSetMetadata", "org.talend.dataprep.util.SortAndOrderHelper" ]
import java.util.stream.Stream; import org.talend.dataprep.api.dataset.DataSetMetadata; import org.talend.dataprep.util.SortAndOrderHelper;
import java.util.stream.*; import org.talend.dataprep.api.dataset.*; import org.talend.dataprep.util.*;
[ "java.util", "org.talend.dataprep" ]
java.util; org.talend.dataprep;
2,176,263
Collection<NodeDescriptor> getNodes();
Collection<NodeDescriptor> getNodes();
/** * The global list of resources. * * @return a list of all the static resources available. This is an upper * bound. */
The global list of resources
getNodes
{ "repo_name": "apache/reef", "path": "lang/java/reef-common/src/main/java/org/apache/reef/driver/catalog/ResourceCatalog.java", "license": "apache-2.0", "size": 1923 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
458,270
private void addAllCountsOfProduct(HashMap<Long, Double> counts, Long product) { for (Set<OrderItemSet> set : getUserItemSets().values()) { // ignore which user bought which set for (OrderItemSet orderset : set) { // look through all orders bought if (orderset.getOrderset().keySet().contains(product)) { for (Long o : orderset.getOrderset().keySet()) { // we count all order of the set (including the product we are currently looking // at) if (counts.containsKey(o)) { // we do not count the NUMBER of items, just if the item occurred in the order counts.put(o, counts.get(o) + 1); } else { counts.put(o, 1.0); } } } } } }
void function(HashMap<Long, Double> counts, Long product) { for (Set<OrderItemSet> set : getUserItemSets().values()) { for (OrderItemSet orderset : set) { if (orderset.getOrderset().keySet().contains(product)) { for (Long o : orderset.getOrderset().keySet()) { if (counts.containsKey(o)) { counts.put(o, counts.get(o) + 1); } else { counts.put(o, 1.0); } } } } } }
/** * Adds the counts of the given product to the given count list. * * @param counts * The count list, assinging each product id, how often it was bought * with the given product. * @param product * The product id of the specific product. */
Adds the counts of the given product to the given count list
addAllCountsOfProduct
{ "repo_name": "DescartesResearch/Pet-Supply-Store", "path": "services/tools.descartes.teastore.recommender/src/main/java/tools/descartes/teastore/recommender/algorithm/impl/orderbased/OrderBasedRecommender.java", "license": "apache-2.0", "size": 3135 }
[ "java.util.HashMap", "java.util.Set", "tools.descartes.teastore.recommender.algorithm.OrderItemSet" ]
import java.util.HashMap; import java.util.Set; import tools.descartes.teastore.recommender.algorithm.OrderItemSet;
import java.util.*; import tools.descartes.teastore.recommender.algorithm.*;
[ "java.util", "tools.descartes.teastore" ]
java.util; tools.descartes.teastore;
771,466
protected static ResourceInformation newDefaultInformation(String name, String unit, long value) { ResourceInformation ri = new ResourceInformation(); ri.setName(name); ri.setValue(value); ri.setResourceType(ResourceTypes.COUNTABLE); ri.setUnitsWithoutValidation(unit); ri.setMinimumAllocation(0); ri.setMaximumAllocation(Long.MAX_VALUE); return ri; }
static ResourceInformation function(String name, String unit, long value) { ResourceInformation ri = new ResourceInformation(); ri.setName(name); ri.setValue(value); ri.setResourceType(ResourceTypes.COUNTABLE); ri.setUnitsWithoutValidation(unit); ri.setMinimumAllocation(0); ri.setMaximumAllocation(Long.MAX_VALUE); return ri; }
/** * Create ResourceInformation with basic fields. * @param name Resource Type Name * @param unit Default unit of provided resource type * @param value Value associated with giveb resource * @return ResourceInformation object */
Create ResourceInformation with basic fields
newDefaultInformation
{ "repo_name": "szegedim/hadoop", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Resource.java", "license": "apache-2.0", "size": 17970 }
[ "org.apache.hadoop.yarn.api.protocolrecords.ResourceTypes" ]
import org.apache.hadoop.yarn.api.protocolrecords.ResourceTypes;
import org.apache.hadoop.yarn.api.protocolrecords.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,691,954
public Vector<LiteralOrONodeID> next() { if(!hasNext()) { throw new GateOntologyException("No more query results but next was called"); } Vector<LiteralOrONodeID> result = new Vector<LiteralOrONodeID>(); try { BindingSet bindingSet = mResult.next(); for (String bindingName : mVarnames) { Value value = bindingSet.getValue(bindingName); if(value instanceof BNode) { result.add(new LiteralOrONodeIDImpl(new OBNodeIDImpl(value.stringValue()))); } else if(value instanceof org.openrdf.model.Literal) { result.add(new LiteralOrONodeIDImpl( mSesameManager.convertSesameLiteral2Literal((org.openrdf.model.Literal)value))); } else if(value instanceof org.openrdf.model.URI) { URI u = (URI)value; result.add(new LiteralOrONodeIDImpl(new OURIImpl(u.stringValue()))); } else { // none of the above, this MUST be null, representing an anbound // projection variable if(value != null) { throw new GateOntologyException("Odd result from SPARQL query: "+value+ " Query was: "+mQuery); } result.add(null); } } } catch (QueryEvaluationException e) { throw new GateOntologyException("Could not get next query result", e); } logger.debug("Qvec: " + result); return result; }
Vector<LiteralOrONodeID> function() { if(!hasNext()) { throw new GateOntologyException(STR); } Vector<LiteralOrONodeID> result = new Vector<LiteralOrONodeID>(); try { BindingSet bindingSet = mResult.next(); for (String bindingName : mVarnames) { Value value = bindingSet.getValue(bindingName); if(value instanceof BNode) { result.add(new LiteralOrONodeIDImpl(new OBNodeIDImpl(value.stringValue()))); } else if(value instanceof org.openrdf.model.Literal) { result.add(new LiteralOrONodeIDImpl( mSesameManager.convertSesameLiteral2Literal((org.openrdf.model.Literal)value))); } else if(value instanceof org.openrdf.model.URI) { URI u = (URI)value; result.add(new LiteralOrONodeIDImpl(new OURIImpl(u.stringValue()))); } else { if(value != null) { throw new GateOntologyException(STR+value+ STR+mQuery); } result.add(null); } } } catch (QueryEvaluationException e) { throw new GateOntologyException(STR, e); } logger.debug(STR + result); return result; }
/** * Returns a vector of LiterOrONodeID object that represent a result row * from the query. If a variable cannot be bound, the corresponding element * in the vector is null. * * @return */
Returns a vector of LiterOrONodeID object that represent a result row from the query. If a variable cannot be bound, the corresponding element in the vector is null
next
{ "repo_name": "avlachid/Multilingual-NLP-for-Archaeological-Reports-Ariadne-Infrastructure", "path": "SE NER/plugins/Ontology/src/gate/creole/ontology/impl/sesame/UtilTupleQueryIterator.java", "license": "gpl-3.0", "size": 12078 }
[ "java.util.Vector", "org.openrdf.model.BNode", "org.openrdf.model.Value", "org.openrdf.query.BindingSet", "org.openrdf.query.QueryEvaluationException" ]
import java.util.Vector; import org.openrdf.model.BNode; import org.openrdf.model.Value; import org.openrdf.query.BindingSet; import org.openrdf.query.QueryEvaluationException;
import java.util.*; import org.openrdf.model.*; import org.openrdf.query.*;
[ "java.util", "org.openrdf.model", "org.openrdf.query" ]
java.util; org.openrdf.model; org.openrdf.query;
1,254,041
@Nullable public HadoopCounters jobCounters(HadoopJobId jobId) throws IgniteCheckedException { if (!busyLock.tryReadLock()) return null; try { final HadoopJobMetadata meta = jobMetaCache().get(jobId); return meta != null ? meta.counters() : null; } finally { busyLock.readUnlock(); } }
@Nullable HadoopCounters function(HadoopJobId jobId) throws IgniteCheckedException { if (!busyLock.tryReadLock()) return null; try { final HadoopJobMetadata meta = jobMetaCache().get(jobId); return meta != null ? meta.counters() : null; } finally { busyLock.readUnlock(); } }
/** * Returns job counters. * * @param jobId Job identifier. * @return Job counters or {@code null} if job cannot be found. * @throws IgniteCheckedException If failed. */
Returns job counters
jobCounters
{ "repo_name": "dlnufox/ignite", "path": "modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobTracker.java", "license": "apache-2.0", "size": 57382 }
[ "org.apache.ignite.IgniteCheckedException", "org.apache.ignite.internal.processors.hadoop.HadoopJobId", "org.apache.ignite.internal.processors.hadoop.counter.HadoopCounters", "org.jetbrains.annotations.Nullable" ]
import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.processors.hadoop.HadoopJobId; import org.apache.ignite.internal.processors.hadoop.counter.HadoopCounters; import org.jetbrains.annotations.Nullable;
import org.apache.ignite.*; import org.apache.ignite.internal.processors.hadoop.*; import org.apache.ignite.internal.processors.hadoop.counter.*; import org.jetbrains.annotations.*;
[ "org.apache.ignite", "org.jetbrains.annotations" ]
org.apache.ignite; org.jetbrains.annotations;
501,945
default GooglePubsubEndpointBuilder googlePubsub(String path) { class GooglePubsubEndpointBuilderImpl extends AbstractEndpointBuilder implements GooglePubsubEndpointBuilder, AdvancedGooglePubsubEndpointBuilder { public GooglePubsubEndpointBuilderImpl(String path) { super("google-pubsub", path); } } return new GooglePubsubEndpointBuilderImpl(path); }
default GooglePubsubEndpointBuilder googlePubsub(String path) { class GooglePubsubEndpointBuilderImpl extends AbstractEndpointBuilder implements GooglePubsubEndpointBuilder, AdvancedGooglePubsubEndpointBuilder { public GooglePubsubEndpointBuilderImpl(String path) { super(STR, path); } } return new GooglePubsubEndpointBuilderImpl(path); }
/** * Google Pubsub (camel-google-pubsub) * Messaging client for Google Cloud Platform PubSub Service * * Category: messaging * Available as of version: 2.19 * Maven coordinates: org.apache.camel:camel-google-pubsub * * Syntax: <code>google-pubsub:projectId:destinationName</code> * * Path parameter: projectId (required) * Project Id * * Path parameter: destinationName (required) * Destination Name */
Google Pubsub (camel-google-pubsub) Messaging client for Google Cloud Platform PubSub Service Category: messaging Available as of version: 2.19 Maven coordinates: org.apache.camel:camel-google-pubsub Syntax: <code>google-pubsub:projectId:destinationName</code> Path parameter: projectId (required) Project Id Path parameter: destinationName (required) Destination Name
googlePubsub
{ "repo_name": "Fabryprog/camel", "path": "core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/GooglePubsubEndpointBuilderFactory.java", "license": "apache-2.0", "size": 29673 }
[ "org.apache.camel.builder.endpoint.AbstractEndpointBuilder" ]
import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
import org.apache.camel.builder.endpoint.*;
[ "org.apache.camel" ]
org.apache.camel;
943,357
public Term gci(Term subClass, Term superClass) { Objects.requireNonNull(subClass); Objects.requireNonNull(superClass); return fun(GCI, subClass, superClass); }
Term function(Term subClass, Term superClass) { Objects.requireNonNull(subClass); Objects.requireNonNull(superClass); return fun(GCI, subClass, superClass); }
/** * Returns the axiom denoting a subsumption declared in the ontology. * * @param subClass * sub class * @param superClass * super class * @return the axiom denoting a subsumption declared in the ontology */
Returns the axiom denoting a subsumption declared in the ontology
gci
{ "repo_name": "julianmendez/born", "path": "born-owlapi/src/main/java/de/tudresden/inf/lat/born/core/rule/FormulaConstructor.java", "license": "apache-2.0", "size": 9298 }
[ "de.tudresden.inf.lat.born.core.term.Term", "java.util.Objects" ]
import de.tudresden.inf.lat.born.core.term.Term; import java.util.Objects;
import de.tudresden.inf.lat.born.core.term.*; import java.util.*;
[ "de.tudresden.inf", "java.util" ]
de.tudresden.inf; java.util;
2,181,129
@SuppressWarnings("deprecation") public void setRuntimeServices(RuntimeServices rs) { rsvc = rs; log = rsvc.getLog("introspection"); Object conversionHandlerInstance = rs.getProperty(RuntimeConstants.CONVERSION_HANDLER_INSTANCE); if (conversionHandlerInstance == null) { String conversionHandlerClass = rs.getString(RuntimeConstants.CONVERSION_HANDLER_CLASS); if (conversionHandlerClass != null && !conversionHandlerClass.equals("none")) { try { conversionHandlerInstance = ClassUtils.getNewInstance(conversionHandlerClass); } catch (ClassNotFoundException cnfe ) { String err = "The specified class for ConversionHandler (" + conversionHandlerClass + ") does not exist or is not accessible to the current classloader."; log.error(err); throw new VelocityException(err, cnfe); } catch (InstantiationException ie) { throw new VelocityException("Could not instantiate class '" + conversionHandlerClass + "'", ie); } catch (IllegalAccessException ae) { throw new VelocityException("Cannot access class '" + conversionHandlerClass + "'", ae); } } }
@SuppressWarnings(STR) void function(RuntimeServices rs) { rsvc = rs; log = rsvc.getLog(STR); Object conversionHandlerInstance = rs.getProperty(RuntimeConstants.CONVERSION_HANDLER_INSTANCE); if (conversionHandlerInstance == null) { String conversionHandlerClass = rs.getString(RuntimeConstants.CONVERSION_HANDLER_CLASS); if (conversionHandlerClass != null && !conversionHandlerClass.equals("none")) { try { conversionHandlerInstance = ClassUtils.getNewInstance(conversionHandlerClass); } catch (ClassNotFoundException cnfe ) { String err = STR + conversionHandlerClass + STR; log.error(err); throw new VelocityException(err, cnfe); } catch (InstantiationException ie) { throw new VelocityException(STR + conversionHandlerClass + "'", ie); } catch (IllegalAccessException ae) { throw new VelocityException(STR + conversionHandlerClass + "'", ae); } } }
/** * sets the runtime services * @param rs runtime services */
sets the runtime services
setRuntimeServices
{ "repo_name": "apache/velocity-engine", "path": "velocity-engine-core/src/main/java/org/apache/velocity/util/introspection/UberspectImpl.java", "license": "apache-2.0", "size": 25749 }
[ "org.apache.velocity.exception.VelocityException", "org.apache.velocity.runtime.RuntimeConstants", "org.apache.velocity.runtime.RuntimeServices", "org.apache.velocity.util.ClassUtils" ]
import org.apache.velocity.exception.VelocityException; import org.apache.velocity.runtime.RuntimeConstants; import org.apache.velocity.runtime.RuntimeServices; import org.apache.velocity.util.ClassUtils;
import org.apache.velocity.exception.*; import org.apache.velocity.runtime.*; import org.apache.velocity.util.*;
[ "org.apache.velocity" ]
org.apache.velocity;
362,145
@SuppressWarnings("unchecked") public void sendEmail(MailMessage message) throws MessagingException { // Construct a simple mail message from the Mail Message SimpleMailMessage smm = new SimpleMailMessage(); smm.setTo( (String[])message.getToAddresses().toArray(new String[message.getToAddresses().size()]) ); smm.setBcc( (String[])message.getBccAddresses().toArray(new String[message.getBccAddresses().size()]) ); smm.setCc( (String[])message.getCcAddresses().toArray(new String[message.getCcAddresses().size()]) ); smm.setSubject(message.getSubject()); smm.setText(message.getMessage()); smm.setFrom(message.getFromAddress()); try { if ( LOG.isDebugEnabled() ) { LOG.debug( "sendEmail() - Sending message: " + smm.toString() ); } mailSender.send(smm); } catch (Exception e) { LOG.error("sendEmail() - Error sending email.", e); throw new RuntimeException(e); } }
@SuppressWarnings(STR) void function(MailMessage message) throws MessagingException { SimpleMailMessage smm = new SimpleMailMessage(); smm.setTo( (String[])message.getToAddresses().toArray(new String[message.getToAddresses().size()]) ); smm.setBcc( (String[])message.getBccAddresses().toArray(new String[message.getBccAddresses().size()]) ); smm.setCc( (String[])message.getCcAddresses().toArray(new String[message.getCcAddresses().size()]) ); smm.setSubject(message.getSubject()); smm.setText(message.getMessage()); smm.setFrom(message.getFromAddress()); try { if ( LOG.isDebugEnabled() ) { LOG.debug( STR + smm.toString() ); } mailSender.send(smm); } catch (Exception e) { LOG.error(STR, e); throw new RuntimeException(e); } }
/** * Construct and a send simple email message from a Mail Message. * * @param message * the Mail Message * @throws MessagingException */
Construct and a send simple email message from a Mail Message
sendEmail
{ "repo_name": "sbower/kuali-rice-1", "path": "core/impl/src/main/java/org/kuali/rice/core/mail/Mailer.java", "license": "apache-2.0", "size": 7815 }
[ "javax.mail.MessagingException", "org.springframework.mail.SimpleMailMessage" ]
import javax.mail.MessagingException; import org.springframework.mail.SimpleMailMessage;
import javax.mail.*; import org.springframework.mail.*;
[ "javax.mail", "org.springframework.mail" ]
javax.mail; org.springframework.mail;
293,801
public SavedPosition noPosition() { SavedPosition saved = new SavedPosition(make.pos); _at(Position.NOPOS); return saved; }
SavedPosition function() { SavedPosition saved = new SavedPosition(make.pos); _at(Position.NOPOS); return saved; }
/** * Returns an AutoCloseable whose {@link SavedPosition#close()} will * restore the current position, and sets the position to Position.NOPOS * (i.e. useful for compiler book-keeping code). */
Returns an AutoCloseable whose <code>SavedPosition#close()</code> will restore the current position, and sets the position to Position.NOPOS (i.e. useful for compiler book-keeping code)
noPosition
{ "repo_name": "ceylon/ceylon", "path": "compiler-java/src/org/eclipse/ceylon/compiler/java/codegen/AbstractTransformer.java", "license": "apache-2.0", "size": 290110 }
[ "org.eclipse.ceylon.langtools.tools.javac.util.Position" ]
import org.eclipse.ceylon.langtools.tools.javac.util.Position;
import org.eclipse.ceylon.langtools.tools.javac.util.*;
[ "org.eclipse.ceylon" ]
org.eclipse.ceylon;
1,372,735
public static String systemId(ExpressionContext context) { Node contextNode = context.getContextNode(); int nodeHandler = ((DTMNodeProxy)contextNode).getDTMNodeNumber(); SourceLocator locator = ((DTMNodeProxy)contextNode).getDTM() .getSourceLocatorFor(nodeHandler); if (locator != null) return locator.getSystemId(); else return null; }
static String function(ExpressionContext context) { Node contextNode = context.getContextNode(); int nodeHandler = ((DTMNodeProxy)contextNode).getDTMNodeNumber(); SourceLocator locator = ((DTMNodeProxy)contextNode).getDTM() .getSourceLocatorFor(nodeHandler); if (locator != null) return locator.getSystemId(); else return null; }
/** * <code>systemId</code> returns the system id of the current * context node. * * @param context an <code>ExpressionContext</code> value * @return a <code>String</code> value */
<code>systemId</code> returns the system id of the current context node
systemId
{ "repo_name": "rokn/Count_Words_2015", "path": "testing/openjdk2/jaxp/src/com/sun/org/apache/xalan/internal/lib/NodeInfo.java", "license": "mit", "size": 8404 }
[ "com.sun.org.apache.xalan.internal.extensions.ExpressionContext", "com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy", "javax.xml.transform.SourceLocator", "org.w3c.dom.Node" ]
import com.sun.org.apache.xalan.internal.extensions.ExpressionContext; import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy; import javax.xml.transform.SourceLocator; import org.w3c.dom.Node;
import com.sun.org.apache.xalan.internal.extensions.*; import com.sun.org.apache.xml.internal.dtm.ref.*; import javax.xml.transform.*; import org.w3c.dom.*;
[ "com.sun.org", "javax.xml", "org.w3c.dom" ]
com.sun.org; javax.xml; org.w3c.dom;
2,831,217
@Test public void testPermittedTopology_polygon_point() { DimensionInfo sourceDimensionInfo = DimensionInfo.XY_POLYGON; DimensionInfo targetDimensionInfo = DimensionInfo.XY_POINT; SfEqualsFF instance = new SfEqualsFF(); boolean expResult = true; boolean result = instance.permittedTopology(sourceDimensionInfo, targetDimensionInfo); assertEquals(expResult, result); }
void function() { DimensionInfo sourceDimensionInfo = DimensionInfo.XY_POLYGON; DimensionInfo targetDimensionInfo = DimensionInfo.XY_POINT; SfEqualsFF instance = new SfEqualsFF(); boolean expResult = true; boolean result = instance.permittedTopology(sourceDimensionInfo, targetDimensionInfo); assertEquals(expResult, result); }
/** * Test of permittedTopology method, of class SfEqualsFF. */
Test of permittedTopology method, of class SfEqualsFF
testPermittedTopology_polygon_point
{ "repo_name": "apache/jena", "path": "jena-geosparql/src/test/java/org/apache/jena/geosparql/geof/topological/filter_functions/simple_features/SfEqualsFFTest.java", "license": "apache-2.0", "size": 13465 }
[ "org.apache.jena.geosparql.implementation.DimensionInfo", "org.junit.Assert" ]
import org.apache.jena.geosparql.implementation.DimensionInfo; import org.junit.Assert;
import org.apache.jena.geosparql.implementation.*; import org.junit.*;
[ "org.apache.jena", "org.junit" ]
org.apache.jena; org.junit;
552,790
public static <T> T matchPredicate( final String dimension, final BitmapIndexSelector selector, BitmapResultFactory<T> bitmapResultFactory, final Predicate<String> predicate ) { return bitmapResultFactory.unionDimensionValueBitmaps(matchPredicateNoUnion(dimension, selector, predicate)); } /** * Return an iterable of bitmaps for all values matching a particular predicate. Unioning these bitmaps * yields the same result that {@link #matchPredicate(String, BitmapIndexSelector, BitmapResultFactory, Predicate)}
static <T> T function( final String dimension, final BitmapIndexSelector selector, BitmapResultFactory<T> bitmapResultFactory, final Predicate<String> predicate ) { return bitmapResultFactory.unionDimensionValueBitmaps(matchPredicateNoUnion(dimension, selector, predicate)); } /** * Return an iterable of bitmaps for all values matching a particular predicate. Unioning these bitmaps * yields the same result that {@link #matchPredicate(String, BitmapIndexSelector, BitmapResultFactory, Predicate)}
/** * Return the union of bitmaps for all values matching a particular predicate. * * @param dimension dimension to look at * @param selector bitmap selector * @param bitmapResultFactory * @param predicate predicate to use * * @return bitmap of matching rows * * @see #estimateSelectivity(String, BitmapIndexSelector, Predicate) */
Return the union of bitmaps for all values matching a particular predicate
matchPredicate
{ "repo_name": "druid-io/druid", "path": "processing/src/main/java/org/apache/druid/segment/filter/Filters.java", "license": "apache-2.0", "size": 22573 }
[ "com.google.common.base.Predicate", "org.apache.druid.query.BitmapResultFactory", "org.apache.druid.query.filter.BitmapIndexSelector" ]
import com.google.common.base.Predicate; import org.apache.druid.query.BitmapResultFactory; import org.apache.druid.query.filter.BitmapIndexSelector;
import com.google.common.base.*; import org.apache.druid.query.*; import org.apache.druid.query.filter.*;
[ "com.google.common", "org.apache.druid" ]
com.google.common; org.apache.druid;
1,289,733
public void setCurrencyRate (BigDecimal CurrencyRate) { set_Value (COLUMNNAME_CurrencyRate, CurrencyRate); }
void function (BigDecimal CurrencyRate) { set_Value (COLUMNNAME_CurrencyRate, CurrencyRate); }
/** Set Rate. @param CurrencyRate Currency Conversion Rate */
Set Rate
setCurrencyRate
{ "repo_name": "arthurmelo88/palmetalADP", "path": "adempiere_360/base/src/org/compiere/model/X_I_FAJournal.java", "license": "gpl-2.0", "size": 36114 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
2,070,112
@Override public void configure(TestElement el) { super.configure(el); XMLSchemaAssertion assertion = (XMLSchemaAssertion) el; xmlSchema.setText(assertion.getXsdFileName()); }
void function(TestElement el) { super.configure(el); XMLSchemaAssertion assertion = (XMLSchemaAssertion) el; xmlSchema.setText(assertion.getXsdFileName()); }
/** * Configures the GUI from the associated test element. * * @param el - * the test element (should be XMLSchemaAssertion) */
Configures the GUI from the associated test element
configure
{ "repo_name": "saketh7/Jmeter", "path": "src/components/org/apache/jmeter/assertions/gui/XMLSchemaAssertionGUI.java", "license": "apache-2.0", "size": 4503 }
[ "org.apache.jmeter.assertions.XMLSchemaAssertion", "org.apache.jmeter.testelement.TestElement" ]
import org.apache.jmeter.assertions.XMLSchemaAssertion; import org.apache.jmeter.testelement.TestElement;
import org.apache.jmeter.assertions.*; import org.apache.jmeter.testelement.*;
[ "org.apache.jmeter" ]
org.apache.jmeter;
1,094,881
@Operation(desc = "Closes all the connections for sessions with the given user name", impact = MBeanOperationInfo.INFO) boolean closeConnectionsForUser(@Parameter(desc = "a user name", name = "userName") String address) throws Exception;
@Operation(desc = STR, impact = MBeanOperationInfo.INFO) boolean closeConnectionsForUser(@Parameter(desc = STR, name = STR) String address) throws Exception;
/** * Closes all the connections of sessions with a matching user name. */
Closes all the connections of sessions with a matching user name
closeConnectionsForUser
{ "repo_name": "graben/activemq-artemis", "path": "artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java", "license": "apache-2.0", "size": 137910 }
[ "javax.management.MBeanOperationInfo" ]
import javax.management.MBeanOperationInfo;
import javax.management.*;
[ "javax.management" ]
javax.management;
2,219,073
private Object runJUnit3Test(Class<?> scriptClass) { try { Object testSuite = InvokerHelper.invokeConstructorOf("junit.framework.TestSuite", new Object[]{scriptClass}); return InvokerHelper.invokeStaticMethod("junit.textui.TestRunner", "run", new Object[]{testSuite}); } catch (ClassNotFoundException e) { throw new GroovyRuntimeException("Failed to run the unit test. JUnit is not on the Classpath.", e); } }
Object function(Class<?> scriptClass) { try { Object testSuite = InvokerHelper.invokeConstructorOf(STR, new Object[]{scriptClass}); return InvokerHelper.invokeStaticMethod(STR, "run", new Object[]{testSuite}); } catch (ClassNotFoundException e) { throw new GroovyRuntimeException(STR, e); } }
/** * Run the specified class extending TestCase as a unit test. * This is done through reflection, to avoid adding a dependency to the JUnit framework. * Otherwise, developers embedding Groovy and using GroovyShell to load/parse/compile * groovy scripts and classes would have to add another dependency on their classpath. * * @param scriptClass the class to be run as a unit test */
Run the specified class extending TestCase as a unit test. This is done through reflection, to avoid adding a dependency to the JUnit framework. Otherwise, developers embedding Groovy and using GroovyShell to load/parse/compile groovy scripts and classes would have to add another dependency on their classpath
runJUnit3Test
{ "repo_name": "uchoice/exf", "path": "exf-core/src/main/java/net/uchoice/exf/core/expression/groovy/GroovyShell.java", "license": "apache-2.0", "size": 30485 }
[ "groovy.lang.GroovyRuntimeException", "org.codehaus.groovy.runtime.InvokerHelper" ]
import groovy.lang.GroovyRuntimeException; import org.codehaus.groovy.runtime.InvokerHelper;
import groovy.lang.*; import org.codehaus.groovy.runtime.*;
[ "groovy.lang", "org.codehaus.groovy" ]
groovy.lang; org.codehaus.groovy;
2,743,270
List<IdmFormDefinitionDto> getDefinitions(Class<? extends Identifiable> ownerType, BasePermission... permission); /** * Finds definition by given type and code (optional) * * @see {@link #getDefaultDefinitionType(Class)}
List<IdmFormDefinitionDto> getDefinitions(Class<? extends Identifiable> ownerType, BasePermission... permission); /** * Finds definition by given type and code (optional) * * @see {@link #getDefaultDefinitionType(Class)}
/** * Returns all definitions for given type * * @param ownerType * @param permission base permissions to evaluate (AND) * @return */
Returns all definitions for given type
getDefinitions
{ "repo_name": "bcvsolutions/CzechIdMng", "path": "Realization/backend/core/core-api/src/main/java/eu/bcvsolutions/idm/core/eav/api/service/FormService.java", "license": "mit", "size": 39367 }
[ "eu.bcvsolutions.idm.core.api.domain.Identifiable", "eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto", "eu.bcvsolutions.idm.core.security.api.domain.BasePermission", "java.util.List" ]
import eu.bcvsolutions.idm.core.api.domain.Identifiable; import eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto; import eu.bcvsolutions.idm.core.security.api.domain.BasePermission; import java.util.List;
import eu.bcvsolutions.idm.core.api.domain.*; import eu.bcvsolutions.idm.core.eav.api.dto.*; import eu.bcvsolutions.idm.core.security.api.domain.*; import java.util.*;
[ "eu.bcvsolutions.idm", "java.util" ]
eu.bcvsolutions.idm; java.util;
1,081,535
public static DeleteIndexRequest deleteIndexRequest(String index) { return new DeleteIndexRequest(index); }
static DeleteIndexRequest function(String index) { return new DeleteIndexRequest(index); }
/** * Creates a delete index request. * * @param index The index to delete * @return The delete index request * @see org.elasticsearch.client.IndicesAdminClient#delete(org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest) */
Creates a delete index request
deleteIndexRequest
{ "repo_name": "nknize/elasticsearch", "path": "server/src/main/java/org/elasticsearch/client/Requests.java", "license": "apache-2.0", "size": 19767 }
[ "org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest" ]
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
import org.elasticsearch.action.admin.indices.delete.*;
[ "org.elasticsearch.action" ]
org.elasticsearch.action;
2,267,355
@Deprecated public Duration getEvictorShutdownTimeout() { return evictorShutdownTimeoutDuration; }
Duration function() { return evictorShutdownTimeoutDuration; }
/** * Gets the value for the {@code evictorShutdownTimeout} configuration * attribute for pools created with this configuration instance. * * @return The current setting of {@code evictorShutdownTimeout} for * this configuration instance * * @see GenericObjectPool#getEvictorShutdownTimeoutDuration() * @see GenericKeyedObjectPool#getEvictorShutdownTimeoutDuration() * @since 2.10.0 * @deprecated Use {@link #getEvictorShutdownTimeoutDuration()}. */
Gets the value for the evictorShutdownTimeout configuration attribute for pools created with this configuration instance
getEvictorShutdownTimeout
{ "repo_name": "apache/tomcat", "path": "java/org/apache/tomcat/dbcp/pool2/impl/BaseObjectPoolConfig.java", "license": "apache-2.0", "size": 40283 }
[ "java.time.Duration" ]
import java.time.Duration;
import java.time.*;
[ "java.time" ]
java.time;
462,652
@Deprecated List<T> findFullText(String pattern);
List<T> findFullText(String pattern);
/** * Search on the T item by the given text value * * @param pattern * @return found T item */
Search on the T item by the given text value
findFullText
{ "repo_name": "alessandro-vincelli/youeat", "path": "src/main/java/it/av/youeat/service/ApplicationService.java", "license": "apache-2.0", "size": 2024 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,611,514
@ServiceMethod(returns = ReturnType.SINGLE) JobInner get(String deviceName, String name, String resourceGroupName);
@ServiceMethod(returns = ReturnType.SINGLE) JobInner get(String deviceName, String name, String resourceGroupName);
/** * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * * @param deviceName The device name. * @param name The job name. * @param resourceGroupName The resource group name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. */
Gets the details of a specified job on a Data Box Edge/Data Box Gateway device
get
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/JobsClient.java", "license": "mit", "size": 2199 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.databoxedge.fluent.models.JobInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.databoxedge.fluent.models.JobInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.databoxedge.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,211,341
FlightIdentifier flightIdent = new FlightIdentifier(airportFrom.getIata_code(), airportTo.getIata_code()); if (flightCache.containsKey(flightIdent)) { if (added) { FlightData oldFlightData = flightCache.get(flightIdent); // JAVA 8 Feature :) List<FlightUser> userList = oldFlightData.getUsersRecentlyAdded().stream() .filter((flightUser) -> flightUser.getUsername().equals((username))) .collect(Collectors.toList()); if (userList == null || userList.size() == 0) { oldFlightData.getUsersRecentlyAdded().add(new FlightUser(username, mail, FlightDateFormatter.formatDate(new Date()))); flightCache.replace(flightIdent, oldFlightData); ArrayList<String> sendNotificationList = new ArrayList<String>(); for (FlightUser flightUserInCache : oldFlightData.getUsersRecentlyAdded()) { sendNotificationList.add(flightUserInCache.getMail()); } sendNotificationToOthers(sendNotificationList, mail, airportFrom.getIata_code(), airportTo.getIata_code(), username); } } return flightCache.get(flightIdent); } else { ArrayList<FlightUser> users = new ArrayList<FlightUser>(); users.add(new FlightUser(username, mail, FlightDateFormatter.formatDate(new Date()))); FlightData flightData = new FlightData(FlightDataCalculator.calculateDistance(airportFrom.getLatitude(), airportFrom.getLongitude(), airportTo.getLatitude(), airportFrom.getLongitude()), users, airportFrom.getLatitude(), airportFrom.getLongitude(), airportTo.getLatitude(), airportTo.getLongitude()); flightCache.put(flightIdent, flightData); return flightData; } }
FlightIdentifier flightIdent = new FlightIdentifier(airportFrom.getIata_code(), airportTo.getIata_code()); if (flightCache.containsKey(flightIdent)) { if (added) { FlightData oldFlightData = flightCache.get(flightIdent); List<FlightUser> userList = oldFlightData.getUsersRecentlyAdded().stream() .filter((flightUser) -> flightUser.getUsername().equals((username))) .collect(Collectors.toList()); if (userList == null userList.size() == 0) { oldFlightData.getUsersRecentlyAdded().add(new FlightUser(username, mail, FlightDateFormatter.formatDate(new Date()))); flightCache.replace(flightIdent, oldFlightData); ArrayList<String> sendNotificationList = new ArrayList<String>(); for (FlightUser flightUserInCache : oldFlightData.getUsersRecentlyAdded()) { sendNotificationList.add(flightUserInCache.getMail()); } sendNotificationToOthers(sendNotificationList, mail, airportFrom.getIata_code(), airportTo.getIata_code(), username); } } return flightCache.get(flightIdent); } else { ArrayList<FlightUser> users = new ArrayList<FlightUser>(); users.add(new FlightUser(username, mail, FlightDateFormatter.formatDate(new Date()))); FlightData flightData = new FlightData(FlightDataCalculator.calculateDistance(airportFrom.getLatitude(), airportFrom.getLongitude(), airportTo.getLatitude(), airportFrom.getLongitude()), users, airportFrom.getLatitude(), airportFrom.getLongitude(), airportTo.getLatitude(), airportTo.getLongitude()); flightCache.put(flightIdent, flightData); return flightData; } }
/** * * If Flight data for certain route exists, return it, if not create a cache entry * * @param airportFrom - IATA code of departure airport * @param airportTo - IATA code of arrival airport * @param username - username of user who adds a flight * @param mail - mail of user who adds a flight * @param added - if this function is called on creating a flight * @return FlightData object from models package */
If Flight data for certain route exists, return it, if not create a cache entry
getFlightDataOrCreate
{ "repo_name": "sasa-radovanovic/ff-flight-diary", "path": "src/main/java/frequentFlyer/flight_diary/ApplicationCacheManager.java", "license": "mit", "size": 5138 }
[ "java.util.ArrayList", "java.util.Date", "java.util.List", "java.util.stream.Collectors" ]
import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.stream.Collectors;
import java.util.*; import java.util.stream.*;
[ "java.util" ]
java.util;
1,649,350
@NotNull public static DefaultSegmentWriterBuilder defaultSegmentWriterBuilder(@NotNull String name) { return new DefaultSegmentWriterBuilder(name); }
static DefaultSegmentWriterBuilder function(@NotNull String name) { return new DefaultSegmentWriterBuilder(name); }
/** * Set the {@code name} of this builder. This name will appear in the segment's * meta data. */
Set the name of this builder. This name will appear in the segment's meta data
defaultSegmentWriterBuilder
{ "repo_name": "mreutegg/jackrabbit-oak", "path": "oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/DefaultSegmentWriterBuilder.java", "license": "apache-2.0", "size": 8506 }
[ "org.jetbrains.annotations.NotNull" ]
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.*;
[ "org.jetbrains.annotations" ]
org.jetbrains.annotations;
875,655
public Map<String, NXbeam_stop> getAllBeam_stop();
Map<String, NXbeam_stop> function();
/** * Get all NXbeam_stop nodes: * <ul> * <li></li> * </ul> * * @return a map from node names to the NXbeam_stop for that node. */
Get all NXbeam_stop nodes:
getAllBeam_stop
{ "repo_name": "willrogers/dawnsci", "path": "org.eclipse.dawnsci.nexus/src/org/eclipse/dawnsci/nexus/NXinstrument.java", "license": "epl-1.0", "size": 15199 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,698,451
private void createFolders() throws Exception { dataFolder=new File(I_Constants.REPO_FOLDER); if (!dataFolder.exists()){ dataFolder.mkdirs(); } sortFolderTmp=CurrentFile.get().getTempSortingFolder(); sortedFolderTmp=CurrentFile.get().getTempSortedFinalfolder(); }
void function() throws Exception { dataFolder=new File(I_Constants.REPO_FOLDER); if (!dataFolder.exists()){ dataFolder.mkdirs(); } sortFolderTmp=CurrentFile.get().getTempSortingFolder(); sortedFolderTmp=CurrentFile.get().getTempSortedFinalfolder(); }
/** * Creates the folders. * * @throws Exception the exception */
Creates the folders
createFolders
{ "repo_name": "termMed/sct-descriptive-statistics-generator", "path": "src/main/java/com/termmed/statistics/db/importer/ImportManager.java", "license": "apache-2.0", "size": 27271 }
[ "com.termmed.fileprovider.CurrentFile", "java.io.File" ]
import com.termmed.fileprovider.CurrentFile; import java.io.File;
import com.termmed.fileprovider.*; import java.io.*;
[ "com.termmed.fileprovider", "java.io" ]
com.termmed.fileprovider; java.io;
2,820,208
public ISnapshotRecord getOldestSnapshot() { return snapshotIndex.getOldestEntry(); }
ISnapshotRecord function() { return snapshotIndex.getOldestEntry(); }
/** * Find the {@link ISnapshotRecord} for the most oldest snapshot (if any). * * @return That {@link ISnapshotRecord} -or- <code>null</code> if there are no * snapshots. */
Find the <code>ISnapshotRecord</code> for the most oldest snapshot (if any)
getOldestSnapshot
{ "repo_name": "rac021/blazegraph_1_5_3_cluster_2_nodes", "path": "bigdata-jini/src/main/java/com/bigdata/journal/jini/ha/SnapshotManager.java", "license": "gpl-2.0", "size": 57112 }
[ "com.bigdata.journal.jini.ha.SnapshotIndex" ]
import com.bigdata.journal.jini.ha.SnapshotIndex;
import com.bigdata.journal.jini.ha.*;
[ "com.bigdata.journal" ]
com.bigdata.journal;
1,615,638
public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) { if (this.isEntityInvulnerable()) { return false; } else { Entity entity = par1DamageSource.getEntity(); this.aiSit.setSitting(false); if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) { par2 = (par2 + 1) / 2; } return super.attackEntityFrom(par1DamageSource, par2); } }
boolean function(DamageSource par1DamageSource, int par2) { if (this.isEntityInvulnerable()) { return false; } else { Entity entity = par1DamageSource.getEntity(); this.aiSit.setSitting(false); if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) { par2 = (par2 + 1) / 2; } return super.attackEntityFrom(par1DamageSource, par2); } }
/** * Called when the entity is attacked. */
Called when the entity is attacked
attackEntityFrom
{ "repo_name": "TheBasedRebel/ZoneSeek", "path": "ZoneSeek/common/entities/Orthrus.java", "license": "gpl-3.0", "size": 19262 }
[ "net.minecraft.entity.Entity", "net.minecraft.entity.player.EntityPlayer", "net.minecraft.entity.projectile.EntityArrow", "net.minecraft.util.DamageSource" ]
import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.util.DamageSource;
import net.minecraft.entity.*; import net.minecraft.entity.player.*; import net.minecraft.entity.projectile.*; import net.minecraft.util.*;
[ "net.minecraft.entity", "net.minecraft.util" ]
net.minecraft.entity; net.minecraft.util;
2,331,944
public static boolean dumpFrameLatency(String windowName, boolean ignorePendingFenceTime) { Process p = null; BufferedReader resultReader = null; String command = FRAME_LATENCY_CMD; if (windowName != null) { command = String.format("%s %s", FRAME_LATENCY_CMD, windowName); } log("dump frame latency command: " + command); try { p = Runtime.getRuntime().exec(command); int status = p.waitFor(); if (status != 0) { Log.e(TAG, String.format("Run shell command: %s, status: %s",command, status)); } resultReader = new BufferedReader(new InputStreamReader(p.getInputStream())); String line = resultReader.readLine(); mRefreshPeriod = Long.parseLong(line.trim()); log("reading refresh period: " + mRefreshPeriod); if (mRefreshPeriod < 0) { return false; } boolean dataInvalidFlag = false; while((line = resultReader.readLine()) != null) { // remove lines which are empty if (line.trim().isEmpty()) { break; } String[] bufferValues = line.split("\\s+"); if (bufferValues[0].trim().compareTo("0") == 0) { continue; } else if (bufferValues[1].trim().compareTo(PENDING_FENCE_TIME) == 0 ) { if (ignorePendingFenceTime) { log("ignore pending fence time"); dataInvalidFlag = true; } else { log("the data contains unfinished frame time, please allow the animation" + " to finish in the test before calling dumpFrameLatency."); return false; } } // store raw data which could have both valid and invalid data List<String> delayArray = Arrays.asList(bufferValues); mFrameBufferData.add(delayArray); if (!dataInvalidFlag) { // only count frames which have valid time ++mFrameLatencySampleSize; } } log("frame latency sample size: " + mFrameLatencySampleSize); } catch (InterruptedException e) { Log.e(TAG, "// Exception from command " + command + ":", e); } catch (IOException e) { Log.e(TAG, "Open file error: ", e); return false; } finally { try { if (resultReader != null) { resultReader.close(); } if (p != null) { p.destroy(); } } catch (IOException e) { Log.e(TAG, "io exception: ", e); } } return true; }
static boolean function(String windowName, boolean ignorePendingFenceTime) { Process p = null; BufferedReader resultReader = null; String command = FRAME_LATENCY_CMD; if (windowName != null) { command = String.format(STR, FRAME_LATENCY_CMD, windowName); } log(STR + command); try { p = Runtime.getRuntime().exec(command); int status = p.waitFor(); if (status != 0) { Log.e(TAG, String.format(STR,command, status)); } resultReader = new BufferedReader(new InputStreamReader(p.getInputStream())); String line = resultReader.readLine(); mRefreshPeriod = Long.parseLong(line.trim()); log(STR + mRefreshPeriod); if (mRefreshPeriod < 0) { return false; } boolean dataInvalidFlag = false; while((line = resultReader.readLine()) != null) { if (line.trim().isEmpty()) { break; } String[] bufferValues = line.split("\\s+"); if (bufferValues[0].trim().compareTo("0") == 0) { continue; } else if (bufferValues[1].trim().compareTo(PENDING_FENCE_TIME) == 0 ) { if (ignorePendingFenceTime) { log(STR); dataInvalidFlag = true; } else { log(STR + STR); return false; } } List<String> delayArray = Arrays.asList(bufferValues); mFrameBufferData.add(delayArray); if (!dataInvalidFlag) { ++mFrameLatencySampleSize; } } log(STR + mFrameLatencySampleSize); } catch (InterruptedException e) { Log.e(TAG, STROpen file error: STRio exception: ", e); } } return true; }
/** * Run frame latency command to get frame time * * @param windowName the window name which SurfaceFlinger will get frame time for * @param ignorePendingFenceTime flag to process frames with pending fence time * set true to ignore pending fence time * set false to fail the test if pending fence time is not allowed */
Run frame latency command to get frame time
dumpFrameLatency
{ "repo_name": "JSDemos/android-sdk-20", "path": "src/com/android/uiautomator/platform/SurfaceFlingerHelper.java", "license": "apache-2.0", "size": 15920 }
[ "android.util.Log", "java.io.BufferedReader", "java.io.InputStreamReader", "java.util.Arrays", "java.util.List" ]
import android.util.Log; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.List;
import android.util.*; import java.io.*; import java.util.*;
[ "android.util", "java.io", "java.util" ]
android.util; java.io; java.util;
1,898,362
private ByteBuf decodeLine(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception { final int eol = findEndOfLine(buffer); if (!discarding) { if (eol >= 0) { final int length = eol - buffer.readerIndex(); if (length > V1_MAX_LENGTH) { buffer.readerIndex(eol + DELIMITER_LENGTH); failOverLimit(ctx, length); return null; } ByteBuf frame = buffer.readSlice(length); buffer.skipBytes(DELIMITER_LENGTH); return frame; } else { final int length = buffer.readableBytes(); if (length > V1_MAX_LENGTH) { discardedBytes = length; buffer.skipBytes(length); discarding = true; failOverLimit(ctx, "over " + discardedBytes); } return null; } } else { if (eol >= 0) { final int delimLength = buffer.getByte(eol) == '\r' ? 2 : 1; buffer.readerIndex(eol + delimLength); discardedBytes = 0; discarding = false; } else { discardedBytes = buffer.readableBytes(); buffer.skipBytes(discardedBytes); } return null; } }
ByteBuf function(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception { final int eol = findEndOfLine(buffer); if (!discarding) { if (eol >= 0) { final int length = eol - buffer.readerIndex(); if (length > V1_MAX_LENGTH) { buffer.readerIndex(eol + DELIMITER_LENGTH); failOverLimit(ctx, length); return null; } ByteBuf frame = buffer.readSlice(length); buffer.skipBytes(DELIMITER_LENGTH); return frame; } else { final int length = buffer.readableBytes(); if (length > V1_MAX_LENGTH) { discardedBytes = length; buffer.skipBytes(length); discarding = true; failOverLimit(ctx, STR + discardedBytes); } return null; } } else { if (eol >= 0) { final int delimLength = buffer.getByte(eol) == '\r' ? 2 : 1; buffer.readerIndex(eol + delimLength); discardedBytes = 0; discarding = false; } else { discardedBytes = buffer.readableBytes(); buffer.skipBytes(discardedBytes); } return null; } }
/** * Create a frame out of the {@link ByteBuf} and return it. * Based on code from {@link LineBasedFrameDecoder#decode(ChannelHandlerContext, ByteBuf)}. * * @param ctx the {@link ChannelHandlerContext} which this {@link HAProxyMessageDecoder} belongs to * @param buffer the {@link ByteBuf} from which to read data * @return frame the {@link ByteBuf} which represent the frame or {@code null} if no frame could * be created */
Create a frame out of the <code>ByteBuf</code> and return it. Based on code from <code>LineBasedFrameDecoder#decode(ChannelHandlerContext, ByteBuf)</code>
decodeLine
{ "repo_name": "wangcy6/storm_app", "path": "frame/java/netty-4.1/codec-haproxy/src/main/java/io/netty/handler/codec/haproxy/HAProxyMessageDecoder.java", "license": "apache-2.0", "size": 13975 }
[ "io.netty.buffer.ByteBuf", "io.netty.channel.ChannelHandlerContext" ]
import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext;
import io.netty.buffer.*; import io.netty.channel.*;
[ "io.netty.buffer", "io.netty.channel" ]
io.netty.buffer; io.netty.channel;
2,305,793
public Archive getArchive(String consolFun, int steps) throws IOException { try { return getArchive(getArcIndex(consolFun, steps)); } catch (RrdException e) { return null; } }
Archive function(String consolFun, int steps) throws IOException { try { return getArchive(getArcIndex(consolFun, steps)); } catch (RrdException e) { return null; } }
/** * Returns Archive object with the given consolidation function and the number * of steps. * * @param consolFun Consolidation function * @param steps Number of archive steps * @return Requested Archive object or null if no such archive could be found * @throws IOException Thrown in case of I/O error */
Returns Archive object with the given consolidation function and the number of steps
getArchive
{ "repo_name": "roskens/jrobin", "path": "src/main/java/org/jrobin/core/RrdDb.java", "license": "lgpl-2.1", "size": 41996 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,282,817
public CreateIssueParams multipleListCustomField(CustomFiledItems customFiledItems) { for (Object id : customFiledItems.getCustomFieldItemIds()) { parameters.add(new NameValuePair("customField_" + customFiledItems.getCustomFieldId(), id.toString())); } return this; }
CreateIssueParams function(CustomFiledItems customFiledItems) { for (Object id : customFiledItems.getCustomFieldItemIds()) { parameters.add(new NameValuePair(STR + customFiledItems.getCustomFieldId(), id.toString())); } return this; }
/** * Sets the multiple list type custom field. * * @param customFiledItems the custom field identifiers and custom field item identifiers * @return CreateIssueParams instance */
Sets the multiple list type custom field
multipleListCustomField
{ "repo_name": "nulab/backlog4j", "path": "src/main/java/com/nulabinc/backlog4j/api/option/CreateIssueParams.java", "license": "mit", "size": 23690 }
[ "com.nulabinc.backlog4j.http.NameValuePair" ]
import com.nulabinc.backlog4j.http.NameValuePair;
import com.nulabinc.backlog4j.http.*;
[ "com.nulabinc.backlog4j" ]
com.nulabinc.backlog4j;
2,063,749
private void initParameters(final boolean fromScratch) { if (parametersJSON == null && !parametersInitialized) { if (parametersString == null) { Function.LOG.debug("parameters JSON is null for '" + getUuid() + "'"); if (fromScratch) { parametersJSON = new ArrayNode(DMPPersistenceUtil.getJSONFactory()); parameters = Lists.newLinkedList(); } parametersInitialized = true; return; } try { parameters = Lists.newLinkedList(); // parse parameters string parametersJSON = DMPPersistenceUtil.getJSONArray(StringUtils.toEncodedString(parametersString, Charsets.UTF_8)); if (null != parametersJSON) { for (final JsonNode parameterNode : parametersJSON) { final String parameter = parameterNode.asText(); if (null != parameter) { parameters.add(parameter); } } } } catch (final DMPException e) { Function.LOG.debug("couldn't parse parameters JSON for function '" + getUuid() + "'"); } parametersInitialized = true; } }
void function(final boolean fromScratch) { if (parametersJSON == null && !parametersInitialized) { if (parametersString == null) { Function.LOG.debug(STR + getUuid() + "'"); if (fromScratch) { parametersJSON = new ArrayNode(DMPPersistenceUtil.getJSONFactory()); parameters = Lists.newLinkedList(); } parametersInitialized = true; return; } try { parameters = Lists.newLinkedList(); parametersJSON = DMPPersistenceUtil.getJSONArray(StringUtils.toEncodedString(parametersString, Charsets.UTF_8)); if (null != parametersJSON) { for (final JsonNode parameterNode : parametersJSON) { final String parameter = parameterNode.asText(); if (null != parameter) { parameters.add(parameter); } } } } catch (final DMPException e) { Function.LOG.debug(STR + getUuid() + "'"); } parametersInitialized = true; } }
/** * Initialises the parameters list and JSON object from the string that holds the serialised JSON object of the parameters * list. * * @param fromScratch flag that indicates, whether the parameters should be initialised from scratch or not */
Initialises the parameters list and JSON object from the string that holds the serialised JSON object of the parameters list
initParameters
{ "repo_name": "janpolowinski/dswarm", "path": "persistence/src/main/java/org/dswarm/persistence/model/job/Function.java", "license": "apache-2.0", "size": 11170 }
[ "com.fasterxml.jackson.databind.JsonNode", "com.fasterxml.jackson.databind.node.ArrayNode", "com.google.common.base.Charsets", "com.google.common.collect.Lists", "org.apache.commons.lang3.StringUtils", "org.dswarm.init.DMPException", "org.dswarm.persistence.util.DMPPersistenceUtil" ]
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.google.common.base.Charsets; import com.google.common.collect.Lists; import org.apache.commons.lang3.StringUtils; import org.dswarm.init.DMPException; import org.dswarm.persistence.util.DMPPersistenceUtil;
import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.node.*; import com.google.common.base.*; import com.google.common.collect.*; import org.apache.commons.lang3.*; import org.dswarm.init.*; import org.dswarm.persistence.util.*;
[ "com.fasterxml.jackson", "com.google.common", "org.apache.commons", "org.dswarm.init", "org.dswarm.persistence" ]
com.fasterxml.jackson; com.google.common; org.apache.commons; org.dswarm.init; org.dswarm.persistence;
337,731
public void deleteApp(final long galleryId) { //the commenting code is for deleting app, instead, we are going to deactivate app /* try { // first job deletes the UserProjectData in the user's entity group runJobWithRetries(new JobRetryHelper() { @Override public void run(Objectify datastore) { // delete the GalleryApp datastore.delete(galleryKey(galleryId)); } }); // second job deletes the comments from this app runJobWithRetries(new JobRetryHelper() { @Override public void run(Objectify datastore) { Key<GalleryAppData> galleryKey = galleryKey(galleryId); for (GalleryCommentData commentData : datastore.query(GalleryCommentData.class).ancestor(galleryKey).order("-dateCreated")) { datastore.delete(commentData); } } }); //note that in the gallery service we'll change the associated project's gallery id back to 0 // and we'll remove the aia and image file } catch (ObjectifyException e) { throw CrashReport.createAndLogError(LOG, null,"gallery remove error", e); }
void function(final long galleryId) { /* try { runJobWithRetries(new JobRetryHelper() { public void run(Objectify datastore) { datastore.delete(galleryKey(galleryId)); } }); runJobWithRetries(new JobRetryHelper() { public void run(Objectify datastore) { Key<GalleryAppData> galleryKey = galleryKey(galleryId); for (GalleryCommentData commentData : datastore.query(GalleryCommentData.class).ancestor(galleryKey).order(STR)) { datastore.delete(commentData); } } }); } catch (ObjectifyException e) { throw CrashReport.createAndLogError(LOG, null,STR, e); }
/** * deletes an app * @param galleryId the id of gallery app to be deleted */
deletes an app
deleteApp
{ "repo_name": "syhsu/appinventor-shelves", "path": "appinventor/appengine/src/com/google/appinventor/server/storage/ObjectifyGalleryStorageIo.java", "license": "apache-2.0", "size": 58104 }
[ "com.google.appinventor.server.CrashReport", "com.googlecode.objectify.Key", "com.googlecode.objectify.Objectify" ]
import com.google.appinventor.server.CrashReport; import com.googlecode.objectify.Key; import com.googlecode.objectify.Objectify;
import com.google.appinventor.server.*; import com.googlecode.objectify.*;
[ "com.google.appinventor", "com.googlecode.objectify" ]
com.google.appinventor; com.googlecode.objectify;
293,725
public static List<String> readLines(final InputStream input, final String encoding) throws IOException { return readLines(input, Charsets.toCharset(encoding)); }
static List<String> function(final InputStream input, final String encoding) throws IOException { return readLines(input, Charsets.toCharset(encoding)); }
/** * Gets the contents of an <code>InputStream</code> as a list of Strings, * one entry per line, using the specified character encoding. * <p> * Character encoding names can be found at * <a href="http://www.iana.org/assignments/character-sets">IANA</a>. * <p> * This method buffers the input internally, so there is no need to use a * <code>BufferedInputStream</code>. * * @param input the <code>InputStream</code> to read from, not null * @param encoding the encoding to use, null means platform default * @return the list of Strings, never null * @throws NullPointerException if the input is null * @throws IOException if an I/O error occurs * @throws java.nio.charset.UnsupportedCharsetException thrown instead of {@link java.io * .UnsupportedEncodingException} in version 2.2 if the * encoding is not supported. * @since 1.1 */
Gets the contents of an <code>InputStream</code> as a list of Strings, one entry per line, using the specified character encoding. Character encoding names can be found at IANA. This method buffers the input internally, so there is no need to use a <code>BufferedInputStream</code>
readLines
{ "repo_name": "krosenvold/commons-io", "path": "src/main/java/org/apache/commons/io/IOUtils.java", "license": "apache-2.0", "size": 125142 }
[ "java.io.IOException", "java.io.InputStream", "java.util.List" ]
import java.io.IOException; import java.io.InputStream; import java.util.List;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,548,570
INDArray rand(int[] shape, float min, float max, org.nd4j.linalg.api.rng.Random rng);
INDArray rand(int[] shape, float min, float max, org.nd4j.linalg.api.rng.Random rng);
/** * Generates a random matrix between min and max * * @param shape the number of rows of the matrix * @param min the minimum number * @param max the maximum number * @param rng the rng to use * @return a drandom matrix of the specified shape and range */
Generates a random matrix between min and max
rand
{ "repo_name": "drlebedev/nd4j", "path": "nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/NDArrayFactory.java", "license": "apache-2.0", "size": 43801 }
[ "org.nd4j.linalg.api.ndarray.INDArray" ]
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.api.ndarray.*;
[ "org.nd4j.linalg" ]
org.nd4j.linalg;
2,762,836
public void setUp() { version0 = new Cookie("Version 0 Name", "Version 0 Value"); version0.setComment("Version 0 Comment"); version0.setDomain("localhost"); version0.setPath("/version0"); version0.setVersion(0); version1 = new Cookie("Version 1 Name", "Version 1 Value"); version1.setComment("Version 1 Comment"); version1.setDomain("localhost"); version1.setPath("/version1"); version1.setVersion(1); }
void function() { version0 = new Cookie(STR, STR); version0.setComment(STR); version0.setDomain(STR); version0.setPath(STR); version0.setVersion(0); version1 = new Cookie(STR, STR); version1.setComment(STR); version1.setDomain(STR); version1.setPath(STR); version1.setVersion(1); }
/** * Set up instance variables required by this test case. */
Set up instance variables required by this test case
setUp
{ "repo_name": "devjin24/howtomcatworks", "path": "bookrefer/jakarta-tomcat-4.1.12-src/catalina/src/test/org/apache/catalina/util/CookieToolsTestCase.java", "license": "apache-2.0", "size": 6190 }
[ "javax.servlet.http.Cookie" ]
import javax.servlet.http.Cookie;
import javax.servlet.http.*;
[ "javax.servlet" ]
javax.servlet;
2,630,100
@Deprecated public static String resolveTooltip(String key, String defaultValue) { // define configuration path in .TOML file String tomlPath = key + ".tooltip"; // get optional value from forge config UnmodifiableConfig config = getBassebombeCraft().getTomlConfiguration(); if (config.contains(tomlPath)) { ConfigValue<String> configValue = config.get(tomlPath); return configValue.get(); } // return default value if path is undefined return defaultValue; }
@Deprecated static String function(String key, String defaultValue) { String tomlPath = key + STR; UnmodifiableConfig config = getBassebombeCraft().getTomlConfiguration(); if (config.contains(tomlPath)) { ConfigValue<String> configValue = config.get(tomlPath); return configValue.get(); } return defaultValue; }
/** * Resolve entity tooltip from configuration. If no key is defined then the * default value is returned. * * @param key configuration key. * @param defaultValue default cooldown value. * * @return resolve cooldown value from configuration. */
Resolve entity tooltip from configuration. If no key is defined then the default value is returned
resolveTooltip
{ "repo_name": "athrane/bassebombecraft", "path": "src/main/java/bassebombecraft/config/ConfigUtils.java", "license": "gpl-3.0", "size": 3537 }
[ "com.electronwill.nightconfig.core.UnmodifiableConfig", "net.minecraftforge.common.ForgeConfigSpec" ]
import com.electronwill.nightconfig.core.UnmodifiableConfig; import net.minecraftforge.common.ForgeConfigSpec;
import com.electronwill.nightconfig.core.*; import net.minecraftforge.common.*;
[ "com.electronwill.nightconfig", "net.minecraftforge.common" ]
com.electronwill.nightconfig; net.minecraftforge.common;
2,787,887
protected boolean isCreationEvent(IRI eventId, Rdf4jTriplestore ts){ RMapEventType et = this.getEventType(eventId, ts); return et.equals(RMapEventType.CREATION); }
boolean function(IRI eventId, Rdf4jTriplestore ts){ RMapEventType et = this.getEventType(eventId, ts); return et.equals(RMapEventType.CREATION); }
/** * Checks if an Event has the type CREATION. * * @param eventId the Event IRI * @param ts the triplestore instance * @return true, if is CREATION event */
Checks if an Event has the type CREATION
isCreationEvent
{ "repo_name": "rmap-project/rmap", "path": "core/src/main/java/info/rmapproject/core/rmapservice/impl/rdf4j/ORMapEventMgr.java", "license": "apache-2.0", "size": 33412 }
[ "info.rmapproject.core.model.event.RMapEventType", "info.rmapproject.core.rmapservice.impl.rdf4j.triplestore.Rdf4jTriplestore" ]
import info.rmapproject.core.model.event.RMapEventType; import info.rmapproject.core.rmapservice.impl.rdf4j.triplestore.Rdf4jTriplestore;
import info.rmapproject.core.model.event.*; import info.rmapproject.core.rmapservice.impl.rdf4j.triplestore.*;
[ "info.rmapproject.core" ]
info.rmapproject.core;
2,607,998
public void unsubscribe(String jid) throws NoResponseException, XMPPErrorException, NotConnectedException { unsubscribe(jid, null); }
void function(String jid) throws NoResponseException, XMPPErrorException, NotConnectedException { unsubscribe(jid, null); }
/** * Remove the subscription related to the specified JID. This will only * work if there is only 1 subscription. If there are multiple subscriptions, * use {@link #unsubscribe(String, String)}. * * @param jid The JID used to subscribe to the node * @throws XMPPErrorException * @throws NoResponseException * @throws NotConnectedException * */
Remove the subscription related to the specified JID. This will only work if there is only 1 subscription. If there are multiple subscriptions, use <code>#unsubscribe(String, String)</code>
unsubscribe
{ "repo_name": "vito-c/Smack", "path": "smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java", "license": "apache-2.0", "size": 23823 }
[ "org.jivesoftware.smack.SmackException", "org.jivesoftware.smack.XMPPException" ]
import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.*;
[ "org.jivesoftware.smack" ]
org.jivesoftware.smack;
2,592,275
@MXBeanDescription("Current size of data in all blocks.") public long getCurrentSize();
@MXBeanDescription(STR) long function();
/** * Gets current size of data in all blocks. * * @return Current size of data in all blocks. */
Gets current size of data in all blocks
getCurrentSize
{ "repo_name": "psadusumilli/ignite", "path": "modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/IgfsPerBlockLruEvictionPolicyMXBean.java", "license": "apache-2.0", "size": 3248 }
[ "org.apache.ignite.mxbean.MXBeanDescription" ]
import org.apache.ignite.mxbean.MXBeanDescription;
import org.apache.ignite.mxbean.*;
[ "org.apache.ignite" ]
org.apache.ignite;
30,106
@Override public void setClob(String parameterName, Reader x, long length) throws SQLException { setClob(getIndexForName(parameterName), x, length); }
void function(String parameterName, Reader x, long length) throws SQLException { setClob(getIndexForName(parameterName), x, length); }
/** * Sets the value of a parameter as a Clob. * This method does not close the reader. * The reader may be closed after executing the statement. * * @param parameterName the parameter name * @param x the value * @param length the maximum number of characters * @throws SQLException if this object is closed */
Sets the value of a parameter as a Clob. This method does not close the reader. The reader may be closed after executing the statement
setClob
{ "repo_name": "paulnguyen/data", "path": "sqldbs/h2java/src/main/org/h2/jdbc/JdbcCallableStatement.java", "license": "apache-2.0", "size": 53148 }
[ "java.io.Reader", "java.sql.SQLException" ]
import java.io.Reader; import java.sql.SQLException;
import java.io.*; import java.sql.*;
[ "java.io", "java.sql" ]
java.io; java.sql;
2,506,750
if (arguments.length != 1) { throw new SyntaxGraphException("Could not initialize ExistsFeature: number of arguments are not correct. "); } // Checks that the two arguments are address functions if (!(arguments[0] instanceof AddressFunction)) { throw new SyntaxGraphException("Could not initialize ExistsFeature: the first argument is not an address function. "); } setAddressFunction((AddressFunction)arguments[0]); // Creates a symbol table called "EXISTS" using one null value // setSymbolTable(tableHandler.addSymbolTable("EXISTS", ColumnDescription.INPUT, "one")); // // table.addSymbol("TRUE"); // The address exists // table.addSymbol("FALSE"); // The address don't exists }
if (arguments.length != 1) { throw new SyntaxGraphException(STR); } if (!(arguments[0] instanceof AddressFunction)) { throw new SyntaxGraphException(STR); } setAddressFunction((AddressFunction)arguments[0]); }
/** * Initialize the exists feature function * * @param arguments an array of arguments with the type returned by getParameterTypes() * @throws MaltChainedException */
Initialize the exists feature function
initialize
{ "repo_name": "michaelcapizzi/processors", "path": "src/main/java/org/maltparserx/core/syntaxgraph/feature/ExistsFeature.java", "license": "apache-2.0", "size": 5904 }
[ "org.maltparserx.core.feature.function.AddressFunction", "org.maltparserx.core.syntaxgraph.SyntaxGraphException" ]
import org.maltparserx.core.feature.function.AddressFunction; import org.maltparserx.core.syntaxgraph.SyntaxGraphException;
import org.maltparserx.core.feature.function.*; import org.maltparserx.core.syntaxgraph.*;
[ "org.maltparserx.core" ]
org.maltparserx.core;
429,779
private TranslatableString invalidatedReasonTranslatable; public TranslatableString getInvalidityReasonTranslatable() { return invalidatedReasonTranslatable; }
TranslatableString invalidatedReasonTranslatable; public TranslatableString function() { return invalidatedReasonTranslatable; }
/** * If {@link #isInvalid() invalid}, then either this method returns non-null or {@link #getInvalidityReason()} will. */
If <code>#isInvalid() invalid</code>, then either this method returns non-null or <code>#getInvalidityReason()</code> will
getInvalidityReasonTranslatable
{ "repo_name": "incodehq/isis", "path": "core/applib/src/main/java/org/apache/isis/applib/services/eventbus/AbstractDomainEvent.java", "license": "apache-2.0", "size": 10826 }
[ "org.apache.isis.applib.services.i18n.TranslatableString" ]
import org.apache.isis.applib.services.i18n.TranslatableString;
import org.apache.isis.applib.services.i18n.*;
[ "org.apache.isis" ]
org.apache.isis;
1,007,881
@Test public void testConstructorTypeLabel() { String label = "TestLabel"; StackDouble stack = new StackDouble(StackDouble.PLATE_384WELL, label); assertNotNull(stack); assertEquals(stack.rows(), StackDouble.ROWS_384WELL); assertEquals(stack.columns(), StackDouble.COLUMNS_384WELL); assertEquals(stack.type(), StackDouble.PLATE_384WELL); assertEquals(stack.dataType(), WellDouble.DOUBLE); assertEquals(stack.descriptor(), "384-Well"); assertEquals(stack.label(), label); assertEquals(stack.size(), 0); assertTrue(stack.getAll().isEmpty()); }
void function() { String label = STR; StackDouble stack = new StackDouble(StackDouble.PLATE_384WELL, label); assertNotNull(stack); assertEquals(stack.rows(), StackDouble.ROWS_384WELL); assertEquals(stack.columns(), StackDouble.COLUMNS_384WELL); assertEquals(stack.type(), StackDouble.PLATE_384WELL); assertEquals(stack.dataType(), WellDouble.DOUBLE); assertEquals(stack.descriptor(), STR); assertEquals(stack.label(), label); assertEquals(stack.size(), 0); assertTrue(stack.getAll().isEmpty()); }
/** * Tests the constructor using a type constant and label. */
Tests the constructor using a type constant and label
testConstructorTypeLabel
{ "repo_name": "jessemull/MicroFlex", "path": "src/test/java/com/github/jessemull/microflex/plate/StackDoubleTest.java", "license": "apache-2.0", "size": 56531 }
[ "com.github.jessemull.microflex.doubleflex.plate.StackDouble", "com.github.jessemull.microflex.doubleflex.plate.WellDouble", "org.junit.Assert" ]
import com.github.jessemull.microflex.doubleflex.plate.StackDouble; import com.github.jessemull.microflex.doubleflex.plate.WellDouble; import org.junit.Assert;
import com.github.jessemull.microflex.doubleflex.plate.*; import org.junit.*;
[ "com.github.jessemull", "org.junit" ]
com.github.jessemull; org.junit;
255,116
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // set response type to JS and allow programs from other servers to send and receive response.setContentType("application/json;charset=UTF-8"); response.setHeader("Access-Control-Allow-Origin", "*"); boolean error = false; // has an error been detected? String solrResult = ""; // JSON doc sent back to UI // create URL for SOLR query String queryURL = url; boolean first = true; Map<String, String[]> params = request.getParameterMap(); // get map of parameters and their values Enumeration<String> allParams = request.getParameterNames(); // get a list of parameter names while (allParams.hasMoreElements()) { String param = allParams.nextElement(); if (param.equalsIgnoreCase("imageId")) { // ID of channel if (!first) { // at the moment it will always be the first (and only) param queryURL += "&"; } queryURL += "imageId=" + URLEncoder.encode(params.get("imageId")[0], "UTF-8"); // extend stem with parameter first = false; // next time you need a separator // pagination } else if (param.equalsIgnoreCase("start")) { // number of initial result if (!first) { queryURL += "&"; } queryURL += "start=" + URLEncoder.encode(params.get("start")[0], "UTF-8"); first = false; } else if (param.equalsIgnoreCase("num")) { // number of results to return if (!first) { queryURL += "&"; } // ensure a number is supplied by GUI Integer temp = 1; try { temp = new Integer(params.get("num")[0]); } catch (NumberFormatException nfe) { error = true; solrResult = "{\"invalid_num_specified\": \"" + params.get("num")[0] + "\"}"; break; } queryURL += "resultNo=" + URLEncoder.encode(params.get("num")[0], "UTF-8"); } else if (param.equalsIgnoreCase("version")) { // do nothing // error handling } else { // parameter was not recognised, send error error = true; // error has been detected logger.log(Level.WARNING, "Client sent invalid parameter: {0}", param); solrResult = "{\"invalid_paramater\": \"" + param + "\"}"; break; } } // run query against SOLR API if (!error) { // if no error detected CommunicateWithSolr cws = new CommunicateWithSolr(); solrResult = cws.talk(queryURL); } else { logger.log(Level.SEVERE, "[BAD QUERY] {0}", queryURL); } try ( // send result to client (UI) PrintWriter out = response.getWriter()) { out.println(solrResult); // may be error or genuine result } }
void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(STR); response.setHeader(STR, "*"); boolean error = false; String solrResult = STRimageIdSTR&STRimageId=STRimageIdSTRUTF-8STRstartSTR&STRstart=STRstartSTRUTF-8STRnumSTR&STRnumSTR{\STR: \STRnumSTR\"}"; break; } queryURL += "resultNo=STRnumSTRUTF-8"); } else if (param.equalsIgnoreCase(STR)) { } else { error = true; logger.log(Level.WARNING, STR, param); solrResult = "{\"invalid_paramater\STRSTR\"}"; break; } } if (!error) { CommunicateWithSolr cws = new CommunicateWithSolr(); solrResult = cws.talk(queryURL); } else { logger.log(Level.SEVERE, STR, queryURL); } try ( PrintWriter out = response.getWriter()) { out.println(solrResult); } }
/** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */
Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods
processRequest
{ "repo_name": "PhenoImageShare/PhenoImageShare", "path": "HWU/iqs/src/main/java/uk/ac/hw/macs/bisel/phis/iqs/v1/v100GCs.java", "license": "apache-2.0", "size": 6507 }
[ "java.io.IOException", "java.io.PrintWriter", "java.util.logging.Level", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "uk.ac.hw.macs.bisel.phis.iqs.CommunicateWithSolr" ]
import java.io.IOException; import java.io.PrintWriter; import java.util.logging.Level; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import uk.ac.hw.macs.bisel.phis.iqs.CommunicateWithSolr;
import java.io.*; import java.util.logging.*; import javax.servlet.*; import javax.servlet.http.*; import uk.ac.hw.macs.bisel.phis.iqs.*;
[ "java.io", "java.util", "javax.servlet", "uk.ac.hw" ]
java.io; java.util; javax.servlet; uk.ac.hw;
731,600
public void reindexContent( JcrWorkspace workspace, Path path, int depth ) { if (getIndexWriter().canBeSkipped()) { // There's no indexes that require updating ... return; } CheckArg.isPositive(depth, "depth"); JcrSession session = workspace.getSession(); NodeCache cache = session.cache().getWorkspace(); String workspaceName = workspace.getName(); // Look for the node ... CachedNode node = cache.getNode(cache.getRootKey()); for (Segment segment : path) { // Look for the child by name ... ChildReference ref = node.getChildReferences(cache).getChild(segment); if (ref == null) return; node = cache.getNode(ref); } // If the node is in the system workspace ... String systemWorkspaceKey = runningState.repositoryCache().getSystemWorkspaceKey(); if (node.getKey().getWorkspaceKey().equals(systemWorkspaceKey)) { reindexSystemContent(node, depth, getIndexWriter()); } else { // It's just a regular node in the workspace ... reindexContent(workspaceName, cache, node, depth, path.isRoot(), getIndexWriter()); } }
void function( JcrWorkspace workspace, Path path, int depth ) { if (getIndexWriter().canBeSkipped()) { return; } CheckArg.isPositive(depth, "depth"); JcrSession session = workspace.getSession(); NodeCache cache = session.cache().getWorkspace(); String workspaceName = workspace.getName(); CachedNode node = cache.getNode(cache.getRootKey()); for (Segment segment : path) { ChildReference ref = node.getChildReferences(cache).getChild(segment); if (ref == null) return; node = cache.getNode(ref); } String systemWorkspaceKey = runningState.repositoryCache().getSystemWorkspaceKey(); if (node.getKey().getWorkspaceKey().equals(systemWorkspaceKey)) { reindexSystemContent(node, depth, getIndexWriter()); } else { reindexContent(workspaceName, cache, node, depth, path.isRoot(), getIndexWriter()); } }
/** * Crawl and index the content starting at the supplied path in the named workspace, to the designated depth. * * @param workspace the workspace * @param path the path of the content to be indexed * @param depth the depth of the content to be indexed * @throws IllegalArgumentException if the workspace or path are null, or if the depth is less than 1 */
Crawl and index the content starting at the supplied path in the named workspace, to the designated depth
reindexContent
{ "repo_name": "phantomjinx/modeshape", "path": "modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryQueryManager.java", "license": "apache-2.0", "size": 26457 }
[ "org.modeshape.common.util.CheckArg", "org.modeshape.jcr.cache.CachedNode", "org.modeshape.jcr.cache.ChildReference", "org.modeshape.jcr.cache.NodeCache", "org.modeshape.jcr.value.Path" ]
import org.modeshape.common.util.CheckArg; import org.modeshape.jcr.cache.CachedNode; import org.modeshape.jcr.cache.ChildReference; import org.modeshape.jcr.cache.NodeCache; import org.modeshape.jcr.value.Path;
import org.modeshape.common.util.*; import org.modeshape.jcr.cache.*; import org.modeshape.jcr.value.*;
[ "org.modeshape.common", "org.modeshape.jcr" ]
org.modeshape.common; org.modeshape.jcr;
2,070,776
@ServiceMethod(returns = ReturnType.SINGLE) SyncPoller<PollResult<Void>, Void> beginPowerOff(String resourceGroupName, String vmName, Boolean skipShutdown);
@ServiceMethod(returns = ReturnType.SINGLE) SyncPoller<PollResult<Void>, Void> beginPowerOff(String resourceGroupName, String vmName, Boolean skipShutdown);
/** * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same * provisioned resources. You are still charged for this virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not * specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */
The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine
beginPowerOff
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachinesClient.java", "license": "mit", "size": 119505 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.management.polling.PollResult", "com.azure.core.util.polling.SyncPoller" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.polling.SyncPoller;
import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.polling.*;
[ "com.azure.core" ]
com.azure.core;
1,953,856
@RequestMapping(value = "/user/clogin", method = RequestMethod.POST) public @ResponseBody Map<String, String> userLoginWithCaptcha( @RequestBody Map<String, String> userInput, HttpServletRequest request, HttpServletResponse response) { String username = userInput.get("username"); String password = userInput.get("password"); String challenge = userInput.get("recaptcha_challenge_field"); String uresponse = userInput.get("recaptcha_response_field"); ReCaptchaResponse reCaptchaResponse = reCaptcha.checkAnswer( request.getRemoteAddr(), challenge, uresponse); if (reCaptchaResponse.isValid()) { response.setStatus(HttpServletResponse.SC_PRECONDITION_FAILED); return null; } UserEntity userEntityTmp = userService.getUserByName( username); if (userEntityTmp == null || BCrypt.checkpw(password, userEntityTmp.getPassword())) { response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); return null; } // TODO merge with normal login Map<String, String> responseMap = new HashMap<String, String>(); String token = userEntityTmp.getToken(); responseMap.put("token", token); responseMap.put("userId", String.valueOf(userEntityTmp.getUserId())); responseMap.put("role", userEntityTmp.getRole()); ContactEntity contactEntity = userService.getContact(token); if (contactEntity != null) { responseMap.put("firstName", contactEntity.getFirstName()); responseMap.put("lastName", contactEntity.getLastName()); } return responseMap; }
@RequestMapping(value = STR, method = RequestMethod.POST) @ResponseBody Map<String, String> function( @RequestBody Map<String, String> userInput, HttpServletRequest request, HttpServletResponse response) { String username = userInput.get(STR); String password = userInput.get(STR); String challenge = userInput.get(STR); String uresponse = userInput.get(STR); ReCaptchaResponse reCaptchaResponse = reCaptcha.checkAnswer( request.getRemoteAddr(), challenge, uresponse); if (reCaptchaResponse.isValid()) { response.setStatus(HttpServletResponse.SC_PRECONDITION_FAILED); return null; } UserEntity userEntityTmp = userService.getUserByName( username); if (userEntityTmp == null BCrypt.checkpw(password, userEntityTmp.getPassword())) { response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); return null; } Map<String, String> responseMap = new HashMap<String, String>(); String token = userEntityTmp.getToken(); responseMap.put("token", token); responseMap.put(STR, String.valueOf(userEntityTmp.getUserId())); responseMap.put("role", userEntityTmp.getRole()); ContactEntity contactEntity = userService.getContact(token); if (contactEntity != null) { responseMap.put(STR, contactEntity.getFirstName()); responseMap.put(STR, contactEntity.getLastName()); } return responseMap; }
/** * user login with captcha verification * needs configured heroku connector add on * returns specific error if auth failed or config not don * * @param userInput * @param request * @param response * @return */
user login with captcha verification needs configured heroku connector add on returns specific error if auth failed or config not don
userLoginWithCaptcha
{ "repo_name": "logiclinegmbh/splash-extended", "path": "src/main/java/de/logicline/splash/controller/UserController.java", "license": "mit", "size": 8342 }
[ "de.logicline.splash.model.ContactEntity", "de.logicline.splash.model.UserEntity", "java.util.HashMap", "java.util.Map", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "net.tanesha.recaptcha.ReCaptchaResponse", "org.mindrot.jbcrypt.BCrypt", "org.springframework.web.bind.annotation.RequestBody", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestMethod", "org.springframework.web.bind.annotation.ResponseBody" ]
import de.logicline.splash.model.ContactEntity; import de.logicline.splash.model.UserEntity; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.tanesha.recaptcha.ReCaptchaResponse; import org.mindrot.jbcrypt.BCrypt; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody;
import de.logicline.splash.model.*; import java.util.*; import javax.servlet.http.*; import net.tanesha.recaptcha.*; import org.mindrot.jbcrypt.*; import org.springframework.web.bind.annotation.*;
[ "de.logicline.splash", "java.util", "javax.servlet", "net.tanesha.recaptcha", "org.mindrot.jbcrypt", "org.springframework.web" ]
de.logicline.splash; java.util; javax.servlet; net.tanesha.recaptcha; org.mindrot.jbcrypt; org.springframework.web;
624,826
protected void sequence_Atom_Parens(ISerializationContext context, Atom semanticObject) { genericSequencer.createSequence(context, semanticObject); }
void function(ISerializationContext context, Atom semanticObject) { genericSequencer.createSequence(context, semanticObject); }
/** * Contexts: * Root returns Atom * Op returns Atom * Op.Add_1_0_0 returns Atom * Op.Minus_1_1_0 returns Atom * Term returns Atom * Parens returns Atom * * Constraint: * (name=ID em='!'*) */
Contexts: Root returns Atom Op returns Atom Op.Add_1_0_0 returns Atom Op.Minus_1_1_0 returns Atom Term returns Atom Parens returns Atom Constraint: (name=ID em='!'*)
sequence_Atom_Parens
{ "repo_name": "miklossy/xtext-core", "path": "org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializer/ComplexReconstrTestLanguageSemanticSequencer.java", "license": "epl-1.0", "size": 12455 }
[ "org.eclipse.xtext.parsetree.reconstr.complexrewritetest.Atom", "org.eclipse.xtext.serializer.ISerializationContext" ]
import org.eclipse.xtext.parsetree.reconstr.complexrewritetest.Atom; import org.eclipse.xtext.serializer.ISerializationContext;
import org.eclipse.xtext.parsetree.reconstr.complexrewritetest.*; import org.eclipse.xtext.serializer.*;
[ "org.eclipse.xtext" ]
org.eclipse.xtext;
1,766,995
public final String getString(int index) { Utf8 utf8 = (Utf8) getConstantInfo(index); return utf8.getString(); }
final String function(int index) { Utf8 utf8 = (Utf8) getConstantInfo(index); return utf8.getString(); }
/** * Return a constant string at index. * @param index * @return */
Return a constant string at index
getString
{ "repo_name": "tvesalainen/bcc", "path": "src/main/java/org/vesalainen/bcc/ClassFile.java", "license": "gpl-3.0", "size": 26742 }
[ "org.vesalainen.bcc.ConstantInfo" ]
import org.vesalainen.bcc.ConstantInfo;
import org.vesalainen.bcc.*;
[ "org.vesalainen.bcc" ]
org.vesalainen.bcc;
1,841,998
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.location_view); prepareComponents(); GPSTracker.trackActivity(this); openOptionsMenu(); showUserLocations(); } // components private TextView header; private LinearLayout locations;
void function(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.location_view); prepareComponents(); GPSTracker.trackActivity(this); openOptionsMenu(); showUserLocations(); } private TextView header; private LinearLayout locations;
/** * method onCreate * @param savedInstanceState */
method onCreate
onCreate
{ "repo_name": "Hikari9/mapbook", "path": "android/src/com/mapbook/ui/LocationList.java", "license": "epl-1.0", "size": 3590 }
[ "android.os.Bundle", "android.widget.LinearLayout", "android.widget.TextView", "com.mapbook.GPSTracker" ]
import android.os.Bundle; import android.widget.LinearLayout; import android.widget.TextView; import com.mapbook.GPSTracker;
import android.os.*; import android.widget.*; import com.mapbook.*;
[ "android.os", "android.widget", "com.mapbook" ]
android.os; android.widget; com.mapbook;
1,941,970
public @Nullable Double getMinVal() { return this.minVal; }
@Nullable Double function() { return this.minVal; }
/** * Getter for minimum value * * @return minimum value */
Getter for minimum value
getMinVal
{ "repo_name": "MikeJMajor/openhab2-addons-dlinksmarthome", "path": "bundles/org.openhab.binding.modbus.helioseasycontrols/src/main/java/org/openhab/binding/modbus/helioseasycontrols/internal/HeliosVariable.java", "license": "epl-1.0", "size": 17436 }
[ "org.eclipse.jdt.annotation.Nullable" ]
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jdt.annotation.*;
[ "org.eclipse.jdt" ]
org.eclipse.jdt;
478,051
void setAll(Collection<? extends Request> requests);
void setAll(Collection<? extends Request> requests);
/** * Sets all requests in the store. * * @param requests the requests */
Sets all requests in the store
setAll
{ "repo_name": "CMPUT301F16T12/CloudyCar", "path": "CloudyCar/app/src/main/java/com/cloudycrew/cloudycar/requeststorage/IRequestStore.java", "license": "mit", "size": 1927 }
[ "com.cloudycrew.cloudycar.models.requests.Request", "java.util.Collection" ]
import com.cloudycrew.cloudycar.models.requests.Request; import java.util.Collection;
import com.cloudycrew.cloudycar.models.requests.*; import java.util.*;
[ "com.cloudycrew.cloudycar", "java.util" ]
com.cloudycrew.cloudycar; java.util;
1,145,384
@Deprecated // TODO: Remove in Smack 4.5. public void sendMessage(Message message) throws NotConnectedException, InterruptedException { sendMessage(message.asBuilder()); }
void function(Message message) throws NotConnectedException, InterruptedException { sendMessage(message.asBuilder()); }
/** * Sends a Message to the chat room. * * @param message TODO javadoc me please * the message. * @throws NotConnectedException if the XMPP connection is not connected. * @throws InterruptedException if the calling thread was interrupted. * @deprecated use {@link #sendMessage(MessageBuilder)} instead. */
Sends a Message to the chat room
sendMessage
{ "repo_name": "igniterealtime/Smack", "path": "smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLight.java", "license": "apache-2.0", "size": 22262 }
[ "org.jivesoftware.smack.SmackException", "org.jivesoftware.smack.packet.Message" ]
import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.*; import org.jivesoftware.smack.packet.*;
[ "org.jivesoftware.smack" ]
org.jivesoftware.smack;
368,827
@SuppressWarnings("unchecked") public static <T extends View> T findTag(final View v, int tagId) { if (null == v) { return null; } Object tag = v.getTag(tagId); if (null != tag) { return (T) v; } ViewParent vp = v.getParent(); View vFound = null; while (null == tag && null != vp) { if (vp instanceof View) { vFound = (View) vp; tag = vFound.getTag(tagId); } vp = vp.getParent(); } if (null != tag) { return (T) vFound; } return null; }
@SuppressWarnings(STR) static <T extends View> T function(final View v, int tagId) { if (null == v) { return null; } Object tag = v.getTag(tagId); if (null != tag) { return (T) v; } ViewParent vp = v.getParent(); View vFound = null; while (null == tag && null != vp) { if (vp instanceof View) { vFound = (View) vp; tag = vFound.getTag(tagId); } vp = vp.getParent(); } if (null != tag) { return (T) vFound; } return null; }
/** * Try to find tag with specified id in current view or it parents hierarchy. Method return view * that contains tag. * * @param v start point of views hierarchy * @param tagId unique tag identifier * @return found tag instance or null. */
Try to find tag with specified id in current view or it parents hierarchy. Method return view that contains tag
findTag
{ "repo_name": "OleksandrKucherenko/spacefish", "path": "_libs/artfulbits-sdk/src/main/com/artfulbits/utils/Use.java", "license": "mit", "size": 46048 }
[ "android.view.View", "android.view.ViewParent" ]
import android.view.View; import android.view.ViewParent;
import android.view.*;
[ "android.view" ]
android.view;
154,585
public List<String> getQueries() { return queries; }
List<String> function() { return queries; }
/** * Returns the list of queries which were generated by the planner. init() must be called prior to * retrieving the queries, otherwise this could return an empty list. * * @return The generated query plan */
Returns the list of queries which were generated by the planner. init() must be called prior to retrieving the queries, otherwise this could return an empty list
getQueries
{ "repo_name": "cdapio/sql-pipelines", "path": "sql-data-pipeline/src/main/java/io/cdap/pipeline/sql/app/core/AbstractSQLExecutor.java", "license": "apache-2.0", "size": 16837 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
784,737
public void update() { if (this.field_147670_k.isDead) { this.field_147668_j = true; } else { this.field_147660_d = (float)this.field_147670_k.posX; this.field_147661_e = (float)this.field_147670_k.posY; this.field_147658_f = (float)this.field_147670_k.posZ; float var1 = MathHelper.sqrt_double(this.field_147670_k.motionX * this.field_147670_k.motionX + this.field_147670_k.motionZ * this.field_147670_k.motionZ); if ((double)var1 >= 0.01D) { this.field_147669_l = MathHelper.clamp_float(this.field_147669_l + 0.0025F, 0.0F, 1.0F); this.field_147662_b = 0.0F + MathHelper.clamp_float(var1, 0.0F, 0.5F) * 0.7F; } else { this.field_147669_l = 0.0F; this.field_147662_b = 0.0F; } } }
void function() { if (this.field_147670_k.isDead) { this.field_147668_j = true; } else { this.field_147660_d = (float)this.field_147670_k.posX; this.field_147661_e = (float)this.field_147670_k.posY; this.field_147658_f = (float)this.field_147670_k.posZ; float var1 = MathHelper.sqrt_double(this.field_147670_k.motionX * this.field_147670_k.motionX + this.field_147670_k.motionZ * this.field_147670_k.motionZ); if ((double)var1 >= 0.01D) { this.field_147669_l = MathHelper.clamp_float(this.field_147669_l + 0.0025F, 0.0F, 1.0F); this.field_147662_b = 0.0F + MathHelper.clamp_float(var1, 0.0F, 0.5F) * 0.7F; } else { this.field_147669_l = 0.0F; this.field_147662_b = 0.0F; } } }
/** * Updates the JList with a new model. */
Updates the JList with a new model
update
{ "repo_name": "mviitanen/marsmod", "path": "mcp/src/minecraft/net/minecraft/client/audio/MovingSoundMinecart.java", "license": "gpl-2.0", "size": 1620 }
[ "net.minecraft.util.MathHelper" ]
import net.minecraft.util.MathHelper;
import net.minecraft.util.*;
[ "net.minecraft.util" ]
net.minecraft.util;
893,059
public static Object readRequestBodyFromInputStream(InputStream is, Exchange exchange) throws IOException { if (is == null) { return null; } boolean disableStreamCaching = false; // Just take the consideration of the setting of Camel Context StreamCaching if (exchange.getContext() instanceof DefaultCamelContext) { DefaultCamelContext context = (DefaultCamelContext) exchange.getContext(); disableStreamCaching = !context.isStreamCaching(); } // convert the input stream to StreamCache if the stream cache is not disabled if (exchange.getProperty(Exchange.DISABLE_HTTP_STREAM_CACHE, disableStreamCaching, Boolean.class)) { return is; } else { CachedOutputStream cos = new CachedOutputStream(exchange); IOHelper.copyAndCloseInput(is, cos); return cos.newStreamCache(); } }
static Object function(InputStream is, Exchange exchange) throws IOException { if (is == null) { return null; } boolean disableStreamCaching = false; if (exchange.getContext() instanceof DefaultCamelContext) { DefaultCamelContext context = (DefaultCamelContext) exchange.getContext(); disableStreamCaching = !context.isStreamCaching(); } if (exchange.getProperty(Exchange.DISABLE_HTTP_STREAM_CACHE, disableStreamCaching, Boolean.class)) { return is; } else { CachedOutputStream cos = new CachedOutputStream(exchange); IOHelper.copyAndCloseInput(is, cos); return cos.newStreamCache(); } }
/** * Reads the response body from the given input stream. * * @param is the input stream * @param exchange the exchange * @return the response body, can be <tt>null</tt> if no body * @throws IOException is thrown if error reading response body */
Reads the response body from the given input stream
readRequestBodyFromInputStream
{ "repo_name": "stalet/camel", "path": "components/camel-http/src/main/java/org/apache/camel/component/http/helper/HttpHelper.java", "license": "apache-2.0", "size": 18257 }
[ "java.io.IOException", "java.io.InputStream", "org.apache.camel.Exchange", "org.apache.camel.converter.stream.CachedOutputStream", "org.apache.camel.impl.DefaultCamelContext", "org.apache.camel.util.IOHelper" ]
import java.io.IOException; import java.io.InputStream; import org.apache.camel.Exchange; import org.apache.camel.converter.stream.CachedOutputStream; import org.apache.camel.impl.DefaultCamelContext; import org.apache.camel.util.IOHelper;
import java.io.*; import org.apache.camel.*; import org.apache.camel.converter.stream.*; import org.apache.camel.impl.*; import org.apache.camel.util.*;
[ "java.io", "org.apache.camel" ]
java.io; org.apache.camel;
836,262
@Override public Adapter createInspectionAdapter() { return provider.getAdapter(WSILInspectionAdapter.class); }
Adapter function() { return provider.getAdapter(WSILInspectionAdapter.class); }
/** * Create the inspection adapter. * * @see org.eclipse.bpel.wsil.model.inspection.util.InspectionAdapterFactory#createInspectionAdapter() */
Create the inspection adapter
createInspectionAdapter
{ "repo_name": "Drifftr/devstudio-tooling-bps", "path": "plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/BPELUIWSILAdapterFactory.java", "license": "apache-2.0", "size": 3206 }
[ "org.eclipse.emf.common.notify.Adapter" ]
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,802,400
@SuppressWarnings("unchecked") public static List<Expression> arguments(final SuperMethodInvocation node) { return node.arguments(); }
@SuppressWarnings(STR) static List<Expression> function(final SuperMethodInvocation node) { return node.arguments(); }
/** * Generecized version of the equivalent JDT method. * * @param node the node on which to call the equivalent JDT method * @return a List of expressions * @see SuperMethodInvocation#arguments() */
Generecized version of the equivalent JDT method
arguments
{ "repo_name": "rpau/AutoRefactor", "path": "plugin/src/main/java/org/autorefactor/jdt/internal/corext/dom/ASTNodes.java", "license": "epl-1.0", "size": 104241 }
[ "java.util.List", "org.eclipse.jdt.core.dom.Expression", "org.eclipse.jdt.core.dom.SuperMethodInvocation" ]
import java.util.List; import org.eclipse.jdt.core.dom.Expression; import org.eclipse.jdt.core.dom.SuperMethodInvocation;
import java.util.*; import org.eclipse.jdt.core.dom.*;
[ "java.util", "org.eclipse.jdt" ]
java.util; org.eclipse.jdt;
2,516,263
public Set<String> getAcademicAreas() { return iAcadAreas; }
Set<String> function() { return iAcadAreas; }
/** * Academic area */
Academic area
getAcademicAreas
{ "repo_name": "UniTime/unitime", "path": "JavaSource/org/unitime/timetable/onlinesectioning/model/XCurriculumReservation.java", "license": "apache-2.0", "size": 11391 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,876,346
Observable<List<LocalDate>> getDateInvalidCharsAsync();
Observable<List<LocalDate>> getDateInvalidCharsAsync();
/** * Get date array value ['2011-03-22', 'date']. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List&lt;LocalDate&gt; object */
Get date array value ['2011-03-22', 'date']
getDateInvalidCharsAsync
{ "repo_name": "balajikris/autorest", "path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodyarray/Arrays.java", "license": "mit", "size": 104816 }
[ "java.util.List", "org.joda.time.LocalDate" ]
import java.util.List; import org.joda.time.LocalDate;
import java.util.*; import org.joda.time.*;
[ "java.util", "org.joda.time" ]
java.util; org.joda.time;
120,553
@Override protected File getConfigTemplateFile() { return getCodegenConfigFile(SCRIPT_DIR + TEST_DIR, currentTestType); }
File function() { return getCodegenConfigFile(SCRIPT_DIR + TEST_DIR, currentTestType); }
/** * Override default configuration with custom test configuration to ensure * scratch space and local temporary directory locations are also updated. */
Override default configuration with custom test configuration to ensure scratch space and local temporary directory locations are also updated
getConfigTemplateFile
{ "repo_name": "apache/incubator-systemml", "path": "src/test/java/org/apache/sysds/test/functions/codegenalg/partone/AlgorithmMSVM.java", "license": "apache-2.0", "size": 8033 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,732,910
public void setPersistenceServiceOjb(PersistenceService persistenceServiceOjb) { this.persistenceServiceOjb = persistenceServiceOjb; }
void function(PersistenceService persistenceServiceOjb) { this.persistenceServiceOjb = persistenceServiceOjb; }
/** * Sets the persistenceServiceOjb attribute. * * @param persistenceServiceOjb The persistenceServiceOjb to set. */
Sets the persistenceServiceOjb attribute
setPersistenceServiceOjb
{ "repo_name": "Ariah-Group/Finance", "path": "af_webapp/src/main/java/org/kuali/kfs/module/bc/document/service/impl/BudgetConstructionSalaryStatisticsReportServiceImpl.java", "license": "apache-2.0", "size": 12070 }
[ "org.kuali.rice.krad.service.PersistenceService" ]
import org.kuali.rice.krad.service.PersistenceService;
import org.kuali.rice.krad.service.*;
[ "org.kuali.rice" ]
org.kuali.rice;
2,914,485
private void processRequireCall(NodeTraversal t, Node n, Node parent) { Node left = n.getFirstChild(); Node arg = left.getNext(); if (verifyLastArgumentIsString(t, left, arg)) { String ns = arg.getString(); ProvidedName provided = providedNames.get(ns); if (provided == null || !provided.isExplicitlyProvided()) { unrecognizedRequires.add(new UnrecognizedRequire(n, ns)); } else { JSModule providedModule = provided.explicitModule; // This must be non-null, because there was an explicit provide. Preconditions.checkNotNull(providedModule); JSModule module = t.getModule(); if (moduleGraph != null && module != providedModule && !moduleGraph.dependsOn(module, providedModule)) { compiler.report( t.makeError(n, XMODULE_REQUIRE_ERROR, ns, providedModule.getName(), module.getName())); } } maybeAddToSymbolTable(left); maybeAddStringNodeToSymbolTable(arg); // Requires should be removed before further processing. // Some clients run closure pass multiple times, first with // the checks for broken requires turned off. In these cases, we // allow broken requires to be preserved by the first run to // let them be caught in the subsequent run. if (!preserveGoogRequires && (provided != null || requiresLevel.isOn())) { parent.detachFromParent(); compiler.reportCodeChange(); } } }
void function(NodeTraversal t, Node n, Node parent) { Node left = n.getFirstChild(); Node arg = left.getNext(); if (verifyLastArgumentIsString(t, left, arg)) { String ns = arg.getString(); ProvidedName provided = providedNames.get(ns); if (provided == null !provided.isExplicitlyProvided()) { unrecognizedRequires.add(new UnrecognizedRequire(n, ns)); } else { JSModule providedModule = provided.explicitModule; Preconditions.checkNotNull(providedModule); JSModule module = t.getModule(); if (moduleGraph != null && module != providedModule && !moduleGraph.dependsOn(module, providedModule)) { compiler.report( t.makeError(n, XMODULE_REQUIRE_ERROR, ns, providedModule.getName(), module.getName())); } } maybeAddToSymbolTable(left); maybeAddStringNodeToSymbolTable(arg); if (!preserveGoogRequires && (provided != null requiresLevel.isOn())) { parent.detachFromParent(); compiler.reportCodeChange(); } } }
/** * Handles a goog.require call. */
Handles a goog.require call
processRequireCall
{ "repo_name": "jimmytuc/closure-compiler", "path": "src/com/google/javascript/jscomp/ProcessClosurePrimitives.java", "license": "apache-2.0", "size": 54595 }
[ "com.google.common.base.Preconditions", "com.google.javascript.rhino.Node" ]
import com.google.common.base.Preconditions; import com.google.javascript.rhino.Node;
import com.google.common.base.*; import com.google.javascript.rhino.*;
[ "com.google.common", "com.google.javascript" ]
com.google.common; com.google.javascript;
226,964
public void setStatuses(List<Status> statuses) { this.statuses = statuses; }
void function(List<Status> statuses) { this.statuses = statuses; }
/** * <p>Setter for the field <code>statuses</code>.</p> * * @param statuses a {@link java.util.List} object. */
Setter for the field <code>statuses</code>
setStatuses
{ "repo_name": "rfdrake/opennms", "path": "opennms-webapp/src/main/java/org/opennms/web/map/view/VProperties.java", "license": "gpl-2.0", "size": 14337 }
[ "java.util.List", "org.opennms.web.map.config.Status" ]
import java.util.List; import org.opennms.web.map.config.Status;
import java.util.*; import org.opennms.web.map.config.*;
[ "java.util", "org.opennms.web" ]
java.util; org.opennms.web;
1,001,504
@Override public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { int rc = super.tightMarshal1(wireFormat, o, bs); return rc + 0; }
int function(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { int rc = super.tightMarshal1(wireFormat, o, bs); return rc + 0; }
/** * Write the booleans that this object uses to a BooleanStream */
Write the booleans that this object uses to a BooleanStream
tightMarshal1
{ "repo_name": "apache/activemq-openwire", "path": "openwire-legacy/src/main/java/org/apache/activemq/openwire/codec/v9/OpenWireTempQueueMarshaller.java", "license": "apache-2.0", "size": 3566 }
[ "java.io.IOException", "org.apache.activemq.openwire.codec.BooleanStream", "org.apache.activemq.openwire.codec.OpenWireFormat" ]
import java.io.IOException; import org.apache.activemq.openwire.codec.BooleanStream; import org.apache.activemq.openwire.codec.OpenWireFormat;
import java.io.*; import org.apache.activemq.openwire.codec.*;
[ "java.io", "org.apache.activemq" ]
java.io; org.apache.activemq;
2,796,263
public IdentityProvider getEnabledIdPByRealmId(String realmId, String tenantDomain) throws IdentityApplicationManagementException { IdentityProvider idp = getIdPByRealmId(realmId, tenantDomain); if(idp != null && idp.isEnable()) { return idp; } return null; }
IdentityProvider function(String realmId, String tenantDomain) throws IdentityApplicationManagementException { IdentityProvider idp = getIdPByRealmId(realmId, tenantDomain); if(idp != null && idp.isEnable()) { return idp; } return null; }
/** * Retrieves Enabled Identity provider information about a given tenant by realm identifier * * @param realmId Unique realm identifier of the Identity provider of whose information is * requested * @param tenantDomain Tenant domain whose information is requested * @throws IdentityApplicationManagementException Error when getting Identity Provider * information by IdP home realm identifier */
Retrieves Enabled Identity provider information about a given tenant by realm identifier
getEnabledIdPByRealmId
{ "repo_name": "manoramahp/carbon-identity", "path": "components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/IdentityProviderManager.java", "license": "apache-2.0", "size": 56966 }
[ "org.wso2.carbon.identity.application.common.IdentityApplicationManagementException", "org.wso2.carbon.identity.application.common.model.IdentityProvider" ]
import org.wso2.carbon.identity.application.common.IdentityApplicationManagementException; import org.wso2.carbon.identity.application.common.model.IdentityProvider;
import org.wso2.carbon.identity.application.common.*; import org.wso2.carbon.identity.application.common.model.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
588,231
public int DsEnumerateDomainTrusts(String serverName, NativeLong Flags, PDS_DOMAIN_TRUSTS.ByReference Domains, NativeLongByReference DomainCount);
int function(String serverName, NativeLong Flags, PDS_DOMAIN_TRUSTS.ByReference Domains, NativeLongByReference DomainCount);
/** * The DsEnumerateDomainTrusts function obtains domain trust data for a specified domain. * @param serverName * Pointer to a null-terminated string that specifies the name of a computer in the domain to * obtain the trust information for. This computer must be running the Windows 2000 or later * operating system. If this parameter is NULL, the name of the local computer is used. * The caller must be an authenticated user in this domain. * @param Flags * Contains a set of flags that determines which domain trusts to enumerate. * @param Domains * Pointer to a PDS_DOMAIN_TRUSTS value that receives an array of DS_DOMAIN_TRUSTS structures. * Each structure in this array contains trust data about a domain. The caller must free this * memory when it is no longer required by calling NetApiBufferFree. * @param DomainCount * Pointer to a ULONG value that receives the number of elements returned in the Domains array. * @return * Returns ERROR_SUCCESS if successful or a Win32 error code otherwise. */
The DsEnumerateDomainTrusts function obtains domain trust data for a specified domain
DsEnumerateDomainTrusts
{ "repo_name": "neo4j/windows-wrapper", "path": "src/main/java/com/sun/jna/platform/win32/Netapi32.java", "license": "gpl-3.0", "size": 20611 }
[ "com.sun.jna.NativeLong", "com.sun.jna.ptr.NativeLongByReference" ]
import com.sun.jna.NativeLong; import com.sun.jna.ptr.NativeLongByReference;
import com.sun.jna.*; import com.sun.jna.ptr.*;
[ "com.sun.jna" ]
com.sun.jna;
78,281
public static Map<Integer, Set<Pair<Integer, Integer>>> getNodeIdToAllPartitions(final Cluster cluster, final StoreDefinition storeDef, boolean includePrimary) { final RoutingStrategy routingStrategy = new RoutingStrategyFactory().updateRoutingStrategy(storeDef, cluster); final Map<Integer, Set<Pair<Integer, Integer>>> nodeIdToReplicas = new HashMap<Integer, Set<Pair<Integer, Integer>>>(); final Map<Integer, Integer> partitionToNodeIdMap = ClusterUtils.getCurrentPartitionMapping(cluster); // Map initialization. for(Node node: cluster.getNodes()) { nodeIdToReplicas.put(node.getId(), new HashSet<Pair<Integer, Integer>>()); } // Track how many zones actually have partitions (and so replica types) // in them. int zonesWithPartitions = 0; for(Integer zoneId: cluster.getZoneIds()) { if(cluster.getNumberOfPartitionsInZone(zoneId) > 0) { zonesWithPartitions++; } } // Loops through all nodes for(Node node: cluster.getNodes()) { // Gets the partitions that this node was configured with. for(Integer primary: node.getPartitionIds()) { // Gets the list of replicating partitions. List<Integer> replicaPartitionList = routingStrategy.getReplicatingPartitionList(primary); if((replicaPartitionList.size() % zonesWithPartitions != 0) || ((replicaPartitionList.size() / zonesWithPartitions) != (storeDef.getReplicationFactor() / cluster.getNumberOfZones()))) { // For zone expansion & shrinking, this warning is expected // in some cases. For other use cases (shuffling, cluster // expansion), this warning indicates that something // is wrong between the clusters and store defs. logger.warn("Number of replicas returned (" + replicaPartitionList.size() + ") does not make sense given the replication factor (" + storeDef.getReplicationFactor() + ") and that there are " + cluster.getNumberOfZones() + " zones of which " + zonesWithPartitions + " have partitions (and of which " + (cluster.getNumberOfZones() - zonesWithPartitions) + " are empty)."); } int replicaType = 0; if(!includePrimary) { replicaPartitionList.remove(primary); replicaType = 1; } // Get the node that this replicating partition belongs to. for(Integer replicaPartition: replicaPartitionList) { Integer replicaNodeId = partitionToNodeIdMap.get(replicaPartition); // The replicating node will have a copy of primary. nodeIdToReplicas.get(replicaNodeId).add(Pair.create(replicaType, primary)); replicaType++; } } } return nodeIdToReplicas; }
static Map<Integer, Set<Pair<Integer, Integer>>> function(final Cluster cluster, final StoreDefinition storeDef, boolean includePrimary) { final RoutingStrategy routingStrategy = new RoutingStrategyFactory().updateRoutingStrategy(storeDef, cluster); final Map<Integer, Set<Pair<Integer, Integer>>> nodeIdToReplicas = new HashMap<Integer, Set<Pair<Integer, Integer>>>(); final Map<Integer, Integer> partitionToNodeIdMap = ClusterUtils.getCurrentPartitionMapping(cluster); for(Node node: cluster.getNodes()) { nodeIdToReplicas.put(node.getId(), new HashSet<Pair<Integer, Integer>>()); } int zonesWithPartitions = 0; for(Integer zoneId: cluster.getZoneIds()) { if(cluster.getNumberOfPartitionsInZone(zoneId) > 0) { zonesWithPartitions++; } } for(Node node: cluster.getNodes()) { for(Integer primary: node.getPartitionIds()) { List<Integer> replicaPartitionList = routingStrategy.getReplicatingPartitionList(primary); if((replicaPartitionList.size() % zonesWithPartitions != 0) ((replicaPartitionList.size() / zonesWithPartitions) != (storeDef.getReplicationFactor() / cluster.getNumberOfZones()))) { logger.warn(STR + replicaPartitionList.size() + STR + storeDef.getReplicationFactor() + STR + cluster.getNumberOfZones() + STR + zonesWithPartitions + STR + (cluster.getNumberOfZones() - zonesWithPartitions) + STR); } int replicaType = 0; if(!includePrimary) { replicaPartitionList.remove(primary); replicaType = 1; } for(Integer replicaPartition: replicaPartitionList) { Integer replicaNodeId = partitionToNodeIdMap.get(replicaPartition); nodeIdToReplicas.get(replicaNodeId).add(Pair.create(replicaType, primary)); replicaType++; } } } return nodeIdToReplicas; }
/** * For a particular cluster creates a mapping of node id to their * corresponding list of [ replicaType, partition ] tuple * * @param cluster The cluster metadata * @param storeDef The store definition * @param includePrimary Include the primary partition? * @return Map of node id to set of [ replicaType, partition ] tuple */
For a particular cluster creates a mapping of node id to their corresponding list of [ replicaType, partition ] tuple
getNodeIdToAllPartitions
{ "repo_name": "medallia/voldemort", "path": "src/java/voldemort/utils/RebalanceUtils.java", "license": "apache-2.0", "size": 54507 }
[ "java.util.HashMap", "java.util.HashSet", "java.util.List", "java.util.Map", "java.util.Set" ]
import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,599,028
@Test public void shouldHaveOneManagerForEveryConnection() { // mock two connections XMPPConnection connection1 = mock(XMPPConnection.class); XMPPConnection connection2 = mock(XMPPConnection.class); // get bytestream manager for the first connection twice InBandBytestreamManager conn1ByteStreamManager1 = InBandBytestreamManager.getByteStreamManager(connection1); InBandBytestreamManager conn1ByteStreamManager2 = InBandBytestreamManager.getByteStreamManager(connection1); // get bytestream manager for second connection InBandBytestreamManager conn2ByteStreamManager1 = InBandBytestreamManager.getByteStreamManager(connection2); // assertions assertEquals(conn1ByteStreamManager1, conn1ByteStreamManager2); assertNotSame(conn1ByteStreamManager1, conn2ByteStreamManager1); }
void function() { XMPPConnection connection1 = mock(XMPPConnection.class); XMPPConnection connection2 = mock(XMPPConnection.class); InBandBytestreamManager conn1ByteStreamManager1 = InBandBytestreamManager.getByteStreamManager(connection1); InBandBytestreamManager conn1ByteStreamManager2 = InBandBytestreamManager.getByteStreamManager(connection1); InBandBytestreamManager conn2ByteStreamManager1 = InBandBytestreamManager.getByteStreamManager(connection2); assertEquals(conn1ByteStreamManager1, conn1ByteStreamManager2); assertNotSame(conn1ByteStreamManager1, conn2ByteStreamManager1); }
/** * Test that * {@link InBandBytestreamManager#getByteStreamManager(XMPPConnection)} returns * one bytestream manager for every connection. */
Test that <code>InBandBytestreamManager#getByteStreamManager(XMPPConnection)</code> returns one bytestream manager for every connection
shouldHaveOneManagerForEveryConnection
{ "repo_name": "ayne/Smack", "path": "smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManagerTest.java", "license": "apache-2.0", "size": 7449 }
[ "org.jivesoftware.smack.XMPPConnection", "org.junit.Assert", "org.mockito.Mockito" ]
import org.jivesoftware.smack.XMPPConnection; import org.junit.Assert; import org.mockito.Mockito;
import org.jivesoftware.smack.*; import org.junit.*; import org.mockito.*;
[ "org.jivesoftware.smack", "org.junit", "org.mockito" ]
org.jivesoftware.smack; org.junit; org.mockito;
2,684,319
protected void addDockable(JComponent c, String dockableConfigKey, int x, int y, int width, int height, DockableProperty dockableProperty) { String dockableTitle = LocalText.getText(dockableConfigKey); DefaultSingleCDockable d = new DefaultSingleCDockable( dockableTitle, dockableTitle ); d.add( c, BorderLayout.CENTER ); d.setTitleIcon(RailsIcon.getByConfigKey(dockableConfigKey).smallIcon); d.setCloseable( ( dockableProperty == DockableProperty.closeable || dockableProperty == DockableProperty.initially_hidden ) ); gridLayout.add( x, y, width, height, d ); dockables.add(d); if (dockableProperty == DockableProperty.initially_hidden) { dockables_initiallyHidden.add(d); } }
void function(JComponent c, String dockableConfigKey, int x, int y, int width, int height, DockableProperty dockableProperty) { String dockableTitle = LocalText.getText(dockableConfigKey); DefaultSingleCDockable d = new DefaultSingleCDockable( dockableTitle, dockableTitle ); d.add( c, BorderLayout.CENTER ); d.setTitleIcon(RailsIcon.getByConfigKey(dockableConfigKey).smallIcon); d.setCloseable( ( dockableProperty == DockableProperty.closeable dockableProperty == DockableProperty.initially_hidden ) ); gridLayout.add( x, y, width, height, d ); dockables.add(d); if (dockableProperty == DockableProperty.initially_hidden) { dockables_initiallyHidden.add(d); } }
/** * Registers a component that is to become a dockable. * The dockable is only deployed to the frame if deployDockables is called. */
Registers a component that is to become a dockable. The dockable is only deployed to the frame if deployDockables is called
addDockable
{ "repo_name": "freystef/Rails", "path": "src/main/java/net/sf/rails/ui/swing/elements/DockingFrame.java", "license": "gpl-2.0", "size": 15953 }
[ "java.awt.BorderLayout", "javax.swing.JComponent", "net.sf.rails.common.LocalText" ]
import java.awt.BorderLayout; import javax.swing.JComponent; import net.sf.rails.common.LocalText;
import java.awt.*; import javax.swing.*; import net.sf.rails.common.*;
[ "java.awt", "javax.swing", "net.sf.rails" ]
java.awt; javax.swing; net.sf.rails;
1,944,500
private boolean canEvict(QueueConsumerConfig consumerConfig, List<Cell> result) { // If no consumer group, this queue is dead, should be ok to evict. if (consumerConfig.getNumGroups() == 0) { return true; } // If unknown consumer config (due to error), keep the queue. if (consumerConfig.getNumGroups() < 0) { return false; } // TODO (terence): Right now we can only evict if we see all the data columns. // It's because it's possible that in some previous flush, only the data columns are flush, // then consumer writes the state columns. In the next flush, it'll only see the state columns and those // should not be evicted otherwise the entry might get reprocessed, depending on the consumer start row state. // This logic is not perfect as if flush happens after enqueue and before dequeue, that entry may never get // evicted (depends on when the next compaction happens, whether the queue configuration has been change or not). // There are two data columns, "d" and "m". // If the size == 2, it should not be evicted as well, // as state columns (dequeue) always happen after data columns (enqueue). if (result.size() <= 2) { skippedIncomplete++; return false; } // "d" and "m" columns always comes before the state columns, prefixed with "s". Iterator<Cell> iterator = result.iterator(); Cell cell = iterator.next(); if (!QueueEntryRow.isDataColumn(cell.getQualifierArray(), cell.getQualifierOffset())) { skippedIncomplete++; return false; } cell = iterator.next(); if (!QueueEntryRow.isMetaColumn(cell.getQualifierArray(), cell.getQualifierOffset())) { skippedIncomplete++; return false; } // Need to determine if this row can be evicted iff all consumer groups have committed process this row. int consumedGroups = 0; // Inspect each state column while (iterator.hasNext()) { cell = iterator.next(); if (!QueueEntryRow.isStateColumn(cell.getQualifierArray(), cell.getQualifierOffset())) { continue; } // If any consumer has a state != PROCESSED, it should not be evicted if (!isProcessed(cell, consumerInstance)) { break; } // If it is PROCESSED, check if this row is smaller than the consumer instance startRow. // Essentially a loose check of committed PROCESSED. byte[] startRow = consumerConfig.getStartRow(consumerInstance); if (startRow != null && compareRowKey(cell, startRow) < 0) { consumedGroups++; } } // It can be evicted if from the state columns, it's been processed by all consumer groups // Otherwise, this row has to be less than smallest among all current consumers. // The second condition is for handling consumer being removed after it consumed some entries. // However, the second condition alone is not good enough as it's possible that in hash partitioning, // only one consumer is keep consuming when the other consumer never proceed. return consumedGroups == consumerConfig.getNumGroups() || compareRowKey(result.get(0), consumerConfig.getSmallestStartRow()) < 0; }
boolean function(QueueConsumerConfig consumerConfig, List<Cell> result) { if (consumerConfig.getNumGroups() == 0) { return true; } if (consumerConfig.getNumGroups() < 0) { return false; } if (result.size() <= 2) { skippedIncomplete++; return false; } Iterator<Cell> iterator = result.iterator(); Cell cell = iterator.next(); if (!QueueEntryRow.isDataColumn(cell.getQualifierArray(), cell.getQualifierOffset())) { skippedIncomplete++; return false; } cell = iterator.next(); if (!QueueEntryRow.isMetaColumn(cell.getQualifierArray(), cell.getQualifierOffset())) { skippedIncomplete++; return false; } int consumedGroups = 0; while (iterator.hasNext()) { cell = iterator.next(); if (!QueueEntryRow.isStateColumn(cell.getQualifierArray(), cell.getQualifierOffset())) { continue; } if (!isProcessed(cell, consumerInstance)) { break; } byte[] startRow = consumerConfig.getStartRow(consumerInstance); if (startRow != null && compareRowKey(cell, startRow) < 0) { consumedGroups++; } } return consumedGroups == consumerConfig.getNumGroups() compareRowKey(result.get(0), consumerConfig.getSmallestStartRow()) < 0; }
/** * Determines the given queue entry row can be evicted. * @param result All KeyValues of a queue entry row. * @return true if it can be evicted, false otherwise. */
Determines the given queue entry row can be evicted
canEvict
{ "repo_name": "caskdata/cdap", "path": "cdap-hbase-compat-1.2-cdh5.7.0/src/main/java/co/cask/cdap/data2/transaction/queue/coprocessor/hbase12cdh570/HBaseQueueRegionObserver.java", "license": "apache-2.0", "size": 15791 }
[ "co.cask.cdap.data2.transaction.queue.QueueEntryRow", "co.cask.cdap.data2.transaction.queue.hbase.coprocessor.QueueConsumerConfig", "java.util.Iterator", "java.util.List", "org.apache.hadoop.hbase.Cell" ]
import co.cask.cdap.data2.transaction.queue.QueueEntryRow; import co.cask.cdap.data2.transaction.queue.hbase.coprocessor.QueueConsumerConfig; import java.util.Iterator; import java.util.List; import org.apache.hadoop.hbase.Cell;
import co.cask.cdap.data2.transaction.queue.*; import co.cask.cdap.data2.transaction.queue.hbase.coprocessor.*; import java.util.*; import org.apache.hadoop.hbase.*;
[ "co.cask.cdap", "java.util", "org.apache.hadoop" ]
co.cask.cdap; java.util; org.apache.hadoop;
1,473,006
public File getAdvisorFile() { return advisorFile; }
File function() { return advisorFile; }
/** * Obtain the advisor file. * * @return advisor file */
Obtain the advisor file
getAdvisorFile
{ "repo_name": "radicalbit/ambari", "path": "ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceDirectory.java", "license": "apache-2.0", "size": 11703 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,099,072
@Override public RpcResult<Void> finish() throws IllegalStateException { RpcResult<Void> rpcStatus = commitToPlugin(this); // We return true if internal transaction is successful. // return Rpcs.getRpcResult(true, null, Collections.emptySet()); return rpcStatus; }
RpcResult<Void> function() throws IllegalStateException { RpcResult<Void> rpcStatus = commitToPlugin(this); return rpcStatus; }
/** * We are OK to go with execution of plan * */
We are OK to go with execution of plan
finish
{ "repo_name": "xiaohanz/softcontroller", "path": "opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/forwardingrulesmanager/consumer/impl/GroupConsumerImpl.java", "license": "epl-1.0", "size": 20542 }
[ "org.opendaylight.yangtools.yang.common.RpcResult" ]
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.*;
[ "org.opendaylight.yangtools" ]
org.opendaylight.yangtools;
1,358,051
public int lookupByUsername (String username) throws IOException;
int function (String username) throws IOException;
/** * Fetches the ID of the user with the specified username.<br /> * Returns -1 if no user exists with the specified name. <br /> * This search should be case-insensitive, so "TEST" should return the same result as "test". * @param username The username used as the lookup key * @return The ID of the user who has the specified name, or -1 if no user exists. * @throws IOException If an error occurs while looking up the user. */
Fetches the ID of the user with the specified username. Returns -1 if no user exists with the specified name. This search should be case-insensitive, so "TEST" should return the same result as "test"
lookupByUsername
{ "repo_name": "FrancisG-Massey/ChatServer", "path": "src/main/java/com/sundays/chat/io/UserDataIO.java", "license": "gpl-2.0", "size": 2812 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,187,364
@Override public void onStart() { super.onStart(); AlertDialog alertDialog = (AlertDialog) getDialog(); final Button positiveButton = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE); // Get the Captcha Image getImg();
void function() { super.onStart(); AlertDialog alertDialog = (AlertDialog) getDialog(); final Button positiveButton = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE); getImg();
/** * Called when the DialogView is started. Used to setup the onClick listeners. */
Called when the DialogView is started. Used to setup the onClick listeners
onStart
{ "repo_name": "dakshit/upes-academics-1", "path": "attendance/src/main/java/com/shalzz/attendance/fragment/CaptchaDialogFragment.java", "license": "gpl-2.0", "size": 7542 }
[ "android.app.AlertDialog", "android.widget.Button" ]
import android.app.AlertDialog; import android.widget.Button;
import android.app.*; import android.widget.*;
[ "android.app", "android.widget" ]
android.app; android.widget;
2,247,177
public Index createIndex(boolean remotelyOriginated, IndexType indexType, String indexName, String indexedExpression, String fromClause, String imports, boolean loadEntries) throws ForceReattemptException, IndexCreationException, IndexNameConflictException, IndexExistsException { return createIndex(remotelyOriginated, indexType, indexName, indexedExpression, fromClause, imports, loadEntries, true); }
Index function(boolean remotelyOriginated, IndexType indexType, String indexName, String indexedExpression, String fromClause, String imports, boolean loadEntries) throws ForceReattemptException, IndexCreationException, IndexNameConflictException, IndexExistsException { return createIndex(remotelyOriginated, indexType, indexName, indexedExpression, fromClause, imports, loadEntries, true); }
/** * Creates the actual index on this partitioned regions. * * @param remotelyOriginated true if the index is created because of a remote index creation call * @param indexType the type of index created. * @param indexName the name for the index to be created * @param indexedExpression expression for index creation. * @param fromClause the from clause for index creation * @param imports class to be imported for fromClause. * * @return Index an index created on this region. * @throws ForceReattemptException indicating the operation failed to create a remote index * @throws IndexCreationException if the index is not created properly * @throws IndexNameConflictException if an index exists with this name on this region * @throws IndexExistsException if and index already exists with the same properties as the one * created */
Creates the actual index on this partitioned regions
createIndex
{ "repo_name": "PurelyApplied/geode", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java", "license": "apache-2.0", "size": 379321 }
[ "org.apache.geode.cache.query.Index", "org.apache.geode.cache.query.IndexCreationException", "org.apache.geode.cache.query.IndexExistsException", "org.apache.geode.cache.query.IndexNameConflictException", "org.apache.geode.cache.query.IndexType" ]
import org.apache.geode.cache.query.Index; import org.apache.geode.cache.query.IndexCreationException; import org.apache.geode.cache.query.IndexExistsException; import org.apache.geode.cache.query.IndexNameConflictException; import org.apache.geode.cache.query.IndexType;
import org.apache.geode.cache.query.*;
[ "org.apache.geode" ]
org.apache.geode;
762,288
public String getDb() { Preconditions.checkNotNull(dbName_); return dbName_; }
String function() { Preconditions.checkNotNull(dbName_); return dbName_; }
/** * Can only be called after analysis, returns the name of the database the table will * be created within. */
Can only be called after analysis, returns the name of the database the table will be created within
getDb
{ "repo_name": "mapr/impala", "path": "fe/src/main/java/com/cloudera/impala/analysis/CreateTableStmt.java", "license": "apache-2.0", "size": 10639 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
994,762
protected void setupDatabase() { database = new TestDatabase(getContext()); database.clear(); dao = new DatabaseDao(database); }
void function() { database = new TestDatabase(getContext()); database.clear(); dao = new DatabaseDao(database); }
/** * Called during {@link #setUp()} to initialize the database and DAO. The base implementation creates a new * {@link TestDatabase} and a {@link DatabaseDao} for it. Subclasses that want to insert test data should * override and call super, then perform its operations. */
Called during <code>#setUp()</code> to initialize the database and DAO. The base implementation creates a new <code>TestDatabase</code> and a <code>DatabaseDao</code> for it. Subclasses that want to insert test data should override and call super, then perform its operations
setupDatabase
{ "repo_name": "wangkang0627/squidb", "path": "squidb-tests/src/com/yahoo/squidb/test/DatabaseTestCase.java", "license": "apache-2.0", "size": 2177 }
[ "com.yahoo.squidb.data.DatabaseDao" ]
import com.yahoo.squidb.data.DatabaseDao;
import com.yahoo.squidb.data.*;
[ "com.yahoo.squidb" ]
com.yahoo.squidb;
2,782,050
@Override public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { // check to OpenCms runlevel int runlevel = OpenCmsCore.getInstance().getRunLevel(); // write OpenCms server identification in the response header res.setHeader(CmsRequestUtil.HEADER_SERVER, OpenCmsCore.getInstance().getSystemInfo().getVersion()); if (runlevel != OpenCms.RUNLEVEL_4_SERVLET_ACCESS) { // not the "normal" servlet runlevel if (runlevel == OpenCms.RUNLEVEL_3_SHELL_ACCESS) { // we have shell runlevel only, upgrade to servlet runlevel (required after setup wizard) init(getServletConfig()); } else { // illegal runlevel, we can't process requests // sending status code 403, indicating the server understood the request but refused to fulfill it res.sendError(HttpServletResponse.SC_FORBIDDEN); // goodbye return; } } String path = OpenCmsCore.getInstance().getPathInfo(req); if (path.startsWith(HANDLE_PATH)) { // this is a request to an OpenCms handler URI invokeHandler(req, res); } else if (path.endsWith(HANDLE_GWT)) { // handle GWT rpc services String serviceName = CmsResource.getName(path); serviceName = serviceName.substring(0, serviceName.length() - HANDLE_GWT.length()); OpenCmsCore.getInstance().invokeGwtService(serviceName, req, res, getServletConfig()); } else { // standard request to a URI in the OpenCms VFS OpenCmsCore.getInstance().showResource(req, res); } }
void function(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { int runlevel = OpenCmsCore.getInstance().getRunLevel(); res.setHeader(CmsRequestUtil.HEADER_SERVER, OpenCmsCore.getInstance().getSystemInfo().getVersion()); if (runlevel != OpenCms.RUNLEVEL_4_SERVLET_ACCESS) { if (runlevel == OpenCms.RUNLEVEL_3_SHELL_ACCESS) { init(getServletConfig()); } else { res.sendError(HttpServletResponse.SC_FORBIDDEN); return; } } String path = OpenCmsCore.getInstance().getPathInfo(req); if (path.startsWith(HANDLE_PATH)) { invokeHandler(req, res); } else if (path.endsWith(HANDLE_GWT)) { String serviceName = CmsResource.getName(path); serviceName = serviceName.substring(0, serviceName.length() - HANDLE_GWT.length()); OpenCmsCore.getInstance().invokeGwtService(serviceName, req, res, getServletConfig()); } else { OpenCmsCore.getInstance().showResource(req, res); } }
/** * OpenCms servlet main request handling method.<p> * * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */
OpenCms servlet main request handling method
doGet
{ "repo_name": "it-tavis/opencms-core", "path": "src/org/opencms/main/OpenCmsServlet.java", "license": "lgpl-2.1", "size": 14925 }
[ "java.io.IOException", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.opencms.file.CmsResource", "org.opencms.util.CmsRequestUtil" ]
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.opencms.file.CmsResource; import org.opencms.util.CmsRequestUtil;
import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import org.opencms.file.*; import org.opencms.util.*;
[ "java.io", "javax.servlet", "org.opencms.file", "org.opencms.util" ]
java.io; javax.servlet; org.opencms.file; org.opencms.util;
2,745,231
public Context<?> getContext() { return context; }
Context<?> function() { return context; }
/** * Returns the context which has just been started up * @return the context */
Returns the context which has just been started up
getContext
{ "repo_name": "agileapes/couteau", "path": "couteau-context/src/main/java/com/mmnaseri/couteau/context/event/ContextStartupEvent.java", "license": "mit", "size": 1898 }
[ "com.mmnaseri.couteau.context.contract.Context" ]
import com.mmnaseri.couteau.context.contract.Context;
import com.mmnaseri.couteau.context.contract.*;
[ "com.mmnaseri.couteau" ]
com.mmnaseri.couteau;
511,224
public final static ObjectMapper getMapper() { return jsonMapper; }
final static ObjectMapper function() { return jsonMapper; }
/** * Returns a reference to the static ObjectMapper * @return The ObjectMapper */
Returns a reference to the static ObjectMapper
getMapper
{ "repo_name": "nickman/PL-TSDB", "path": "pltsdb-core/src/main/java/com/heliosapm/pltsdb/json/JSONOps.java", "license": "apache-2.0", "size": 33309 }
[ "com.fasterxml.jackson.databind.ObjectMapper" ]
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.*;
[ "com.fasterxml.jackson" ]
com.fasterxml.jackson;
659,596
@Override public boolean canAlias(FlowExpressions.Receiver a, FlowExpressions.Receiver b) { TypeMirror tb = b.getType(); TypeMirror ta = a.getType(); Types types = analysis.getTypes(); return types.isSubtype(ta, tb) || types.isSubtype(tb, ta); }
boolean function(FlowExpressions.Receiver a, FlowExpressions.Receiver b) { TypeMirror tb = b.getType(); TypeMirror ta = a.getType(); Types types = analysis.getTypes(); return types.isSubtype(ta, tb) types.isSubtype(tb, ta); }
/** * Can the objects {@code a} and {@code b} be aliases? Returns a * conservative answer (i.e., returns {@code true} if not enough information * is available to determine aliasing). */
Can the objects a and b be aliases? Returns a conservative answer (i.e., returns true if not enough information is available to determine aliasing)
canAlias
{ "repo_name": "pbsf/checker-framework", "path": "framework/src/org/checkerframework/framework/flow/CFAbstractStore.java", "license": "gpl-2.0", "size": 43819 }
[ "javax.lang.model.type.TypeMirror", "javax.lang.model.util.Types", "org.checkerframework.dataflow.analysis.FlowExpressions" ]
import javax.lang.model.type.TypeMirror; import javax.lang.model.util.Types; import org.checkerframework.dataflow.analysis.FlowExpressions;
import javax.lang.model.type.*; import javax.lang.model.util.*; import org.checkerframework.dataflow.analysis.*;
[ "javax.lang", "org.checkerframework.dataflow" ]
javax.lang; org.checkerframework.dataflow;
270,324
public static final ConnectionServiceClient create(ConnectionServiceSettings settings) throws IOException { return new ConnectionServiceClient(settings); }
static final ConnectionServiceClient function(ConnectionServiceSettings settings) throws IOException { return new ConnectionServiceClient(settings); }
/** * Constructs an instance of ConnectionServiceClient, using the given settings. The channels are * created based on the settings passed in, or defaults for any settings that are not set. */
Constructs an instance of ConnectionServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set
create
{ "repo_name": "googleapis/java-bigqueryconnection", "path": "google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceClient.java", "license": "apache-2.0", "size": 48094 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,379,088
public void onNavMessageReported(byte prn, byte type, short id, byte[] rawData) { Preconditions.checkArgument(type == 1, "Unsupported NavigationMessage Type: " + type); Preconditions.checkArgument( rawData != null && rawData.length == L1_CA_MESSAGE_LENGTH_BYTES, "Invalid length of rawData for L1 C/A"); synchronized (fullyDecodedIntermediateEphemerides) { switch (id) { case 1: handleFirstSubframe(prn, rawData); break; case 2: handleSecondSubframe(prn, rawData); break; case 3: handleThirdSubframe(prn, rawData); break; case 4: handleFourthSubframe(rawData); break; case 5: break; default: // invalid message id throw new IllegalArgumentException("Invalid Subframe ID: " + id); } } }
void function(byte prn, byte type, short id, byte[] rawData) { Preconditions.checkArgument(type == 1, STR + type); Preconditions.checkArgument( rawData != null && rawData.length == L1_CA_MESSAGE_LENGTH_BYTES, STR); synchronized (fullyDecodedIntermediateEphemerides) { switch (id) { case 1: handleFirstSubframe(prn, rawData); break; case 2: handleSecondSubframe(prn, rawData); break; case 3: handleThirdSubframe(prn, rawData); break; case 4: handleFourthSubframe(rawData); break; case 5: break; default: throw new IllegalArgumentException(STR + id); } } }
/** * Handles a fresh Navigation Message. The message is in its raw format. */
Handles a fresh Navigation Message. The message is in its raw format
onNavMessageReported
{ "repo_name": "google/gps-measurement-tools", "path": "GNSSLogger/pseudorange/src/main/java/com/google/location/lbs/gnss/gps/pseudorange/GpsNavigationMessageStore.java", "license": "apache-2.0", "size": 29026 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
2,078,731
@Override public DvTime assignedValue() { if (list == null || list.size() != 1) { return null; } return list.get(0); }
DvTime function() { if (list == null list.size() != 1) { return null; } return list.get(0); }
/** * Return assigned value as data value instance * * @return DvTime or null if not assigned */
Return assigned value as data value instance
assignedValue
{ "repo_name": "klaus7/a2s", "path": "a2s-converter/src/main/java/org/openehr/am/archetype/constraintmodel/primitive/CTime.java", "license": "mit", "size": 6868 }
[ "org.openehr.rm.datatypes.quantity.datetime.DvTime" ]
import org.openehr.rm.datatypes.quantity.datetime.DvTime;
import org.openehr.rm.datatypes.quantity.datetime.*;
[ "org.openehr.rm" ]
org.openehr.rm;
1,674,496
MaterializedGraphOWLResultSet materialize() throws OWLException;
MaterializedGraphOWLResultSet materialize() throws OWLException;
/** * Materializes the saturated RDF graph */
Materializes the saturated RDF graph
materialize
{ "repo_name": "ontop/ontop", "path": "binding/owlapi/src/main/java/it/unibz/inf/ontop/owlapi/OntopOWLAPIMaterializer.java", "license": "apache-2.0", "size": 1638 }
[ "it.unibz.inf.ontop.owlapi.resultset.MaterializedGraphOWLResultSet", "org.semanticweb.owlapi.model.OWLException" ]
import it.unibz.inf.ontop.owlapi.resultset.MaterializedGraphOWLResultSet; import org.semanticweb.owlapi.model.OWLException;
import it.unibz.inf.ontop.owlapi.resultset.*; import org.semanticweb.owlapi.model.*;
[ "it.unibz.inf", "org.semanticweb.owlapi" ]
it.unibz.inf; org.semanticweb.owlapi;
972,888