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
protected String getDirectory(Job job) { String execSiteWorkDir = mSiteStore.getInternalWorkDirectory(job); String workdir = (String) job.globusRSL.removeKey("directory"); // returns old value workdir = (workdir == null) ? execSiteWorkDir : workdir; return workdir; }
String function(Job job) { String execSiteWorkDir = mSiteStore.getInternalWorkDirectory(job); String workdir = (String) job.globusRSL.removeKey(STR); workdir = (workdir == null) ? execSiteWorkDir : workdir; return workdir; }
/** * Returns the directory in which the job should run. * * @param job the job in which the directory has to run. * @return */
Returns the directory in which the job should run
getDirectory
{ "repo_name": "pegasus-isi/pegasus", "path": "src/edu/isi/pegasus/planner/code/gridstart/NoGridStart.java", "license": "apache-2.0", "size": 27559 }
[ "edu.isi.pegasus.planner.classes.Job" ]
import edu.isi.pegasus.planner.classes.Job;
import edu.isi.pegasus.planner.classes.*;
[ "edu.isi.pegasus" ]
edu.isi.pegasus;
1,999,350
@CoGroup public void withParameter( @Key(group = "string", order = "value asc") List<Ex1> a1, Result<Ex1> r1, Result<Ex1> r2, int parameter) { boolean over = false; for (Ex1 e : a1) { over |= (e.getValue() > parameter); if (over) { r2.add(e); } else { r1.add(e); } } }
void function( @Key(group = STR, order = STR) List<Ex1> a1, Result<Ex1> r1, Result<Ex1> r2, int parameter) { boolean over = false; for (Ex1 e : a1) { over = (e.getValue() > parameter); if (over) { r2.add(e); } else { r1.add(e); } } }
/** * Switches output target whether if the value is less than or equal to the parameter. * @param a1 group * @param r1 a1 where value of input is less than or equal to the parameter * @param r2 a1 where value of input is greater than the parameter * @param parameter the parameter for switching output target */
Switches output target whether if the value is less than or equal to the parameter
withParameter
{ "repo_name": "asakusafw/asakusafw-mapreduce", "path": "compiler/core/src/test/java/com/asakusafw/compiler/flow/processor/operator/GroupSortFlow.java", "license": "apache-2.0", "size": 2438 }
[ "com.asakusafw.compiler.flow.testing.model.Ex1", "com.asakusafw.runtime.core.Result", "com.asakusafw.vocabulary.model.Key", "java.util.List" ]
import com.asakusafw.compiler.flow.testing.model.Ex1; import com.asakusafw.runtime.core.Result; import com.asakusafw.vocabulary.model.Key; import java.util.List;
import com.asakusafw.compiler.flow.testing.model.*; import com.asakusafw.runtime.core.*; import com.asakusafw.vocabulary.model.*; import java.util.*;
[ "com.asakusafw.compiler", "com.asakusafw.runtime", "com.asakusafw.vocabulary", "java.util" ]
com.asakusafw.compiler; com.asakusafw.runtime; com.asakusafw.vocabulary; java.util;
2,483,241
public static void unregister(String uri) { PropertyFunctionRegistry.get().remove(uri); map.remove(uri); }
static void function(String uri) { PropertyFunctionRegistry.get().remove(uri); map.remove(uri); }
/** * Removes a MultiFunction and the corresponding property function. * @param uri the URI of the multi-function to remove */
Removes a MultiFunction and the corresponding property function
unregister
{ "repo_name": "TopQuadrant/shacl", "path": "src/main/java/org/topbraid/shacl/multifunctions/MultiFunctions.java", "license": "apache-2.0", "size": 4952 }
[ "org.apache.jena.sparql.pfunction.PropertyFunctionRegistry" ]
import org.apache.jena.sparql.pfunction.PropertyFunctionRegistry;
import org.apache.jena.sparql.pfunction.*;
[ "org.apache.jena" ]
org.apache.jena;
2,167,801
public static boolean validateAssessmentSectionProcNoteCode(AssessmentSectionProcNote assessmentSectionProcNote, DiagnosticChain diagnostics, Map<Object, Object> context) { if (VALIDATE_ASSESSMENT_SECTION_PROC_NOTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setContext(CDTPackage.Literals.ASSESSMENT_SECTION_PROC_NOTE); try { VALIDATE_ASSESSMENT_SECTION_PROC_NOTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(VALIDATE_ASSESSMENT_SECTION_PROC_NOTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } if (!EOCL_ENV.createQuery(VALIDATE_ASSESSMENT_SECTION_PROC_NOTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(assessmentSectionProcNote)) { if (diagnostics != null) { diagnostics.add (new BasicDiagnostic (Diagnostic.ERROR, CDTValidator.DIAGNOSTIC_SOURCE, CDTValidator.ASSESSMENT_SECTION_PROC_NOTE__ASSESSMENT_SECTION_PROC_NOTE_CODE, CDTPlugin.INSTANCE.getString("AssessmentSectionProcNoteCode"), new Object [] { assessmentSectionProcNote })); } return false; } return true; }
static boolean function(AssessmentSectionProcNote assessmentSectionProcNote, DiagnosticChain diagnostics, Map<Object, Object> context) { if (VALIDATE_ASSESSMENT_SECTION_PROC_NOTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setContext(CDTPackage.Literals.ASSESSMENT_SECTION_PROC_NOTE); try { VALIDATE_ASSESSMENT_SECTION_PROC_NOTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(VALIDATE_ASSESSMENT_SECTION_PROC_NOTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } if (!EOCL_ENV.createQuery(VALIDATE_ASSESSMENT_SECTION_PROC_NOTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(assessmentSectionProcNote)) { if (diagnostics != null) { diagnostics.add (new BasicDiagnostic (Diagnostic.ERROR, CDTValidator.DIAGNOSTIC_SOURCE, CDTValidator.ASSESSMENT_SECTION_PROC_NOTE__ASSESSMENT_SECTION_PROC_NOTE_CODE, CDTPlugin.INSTANCE.getString(STR), new Object [] { assessmentSectionProcNote })); } return false; } return true; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * <!-- begin-model-doc --> * not self.code.oclIsUndefined() and self.code.oclIsKindOf(datatypes::CE) and * let value : datatypes::CE = self.code.oclAsType(datatypes::CE) in ( * value.code = '51848-0' and value.codeSystem = '2.16.840.1.113883.6.1') * @param assessmentSectionProcNote The receiving '<em><b>Assessment Section Proc Note</b></em>' model object. * @param diagnostics The chain of diagnostics to which problems are to be appended. * @param context The cache of context-specific information. * <!-- end-model-doc --> * @generated */
not self.code.oclIsUndefined() and self.code.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = self.code.oclAsType(datatypes::CE) in ( value.code = '51848-0' and value.codeSystem = '2.16.840.1.113883.6.1')
validateAssessmentSectionProcNoteCode
{ "repo_name": "drbgfc/mdht", "path": "cda/deprecated/org.openhealthtools.mdht.uml.cda.cdt/src/org/openhealthtools/mdht/uml/cda/cdt/operations/AssessmentSectionProcNoteOperations.java", "license": "epl-1.0", "size": 8207 }
[ "java.util.Map", "org.eclipse.emf.common.util.BasicDiagnostic", "org.eclipse.emf.common.util.Diagnostic", "org.eclipse.emf.common.util.DiagnosticChain", "org.eclipse.ocl.ParserException", "org.openhealthtools.mdht.uml.cda.cdt.AssessmentSectionProcNote", "org.openhealthtools.mdht.uml.cda.cdt.CDTPackage", "org.openhealthtools.mdht.uml.cda.cdt.CDTPlugin", "org.openhealthtools.mdht.uml.cda.cdt.util.CDTValidator" ]
import java.util.Map; import org.eclipse.emf.common.util.BasicDiagnostic; import org.eclipse.emf.common.util.Diagnostic; import org.eclipse.emf.common.util.DiagnosticChain; import org.eclipse.ocl.ParserException; import org.openhealthtools.mdht.uml.cda.cdt.AssessmentSectionProcNote; import org.openhealthtools.mdht.uml.cda.cdt.CDTPackage; import org.openhealthtools.mdht.uml.cda.cdt.CDTPlugin; import org.openhealthtools.mdht.uml.cda.cdt.util.CDTValidator;
import java.util.*; import org.eclipse.emf.common.util.*; import org.eclipse.ocl.*; import org.openhealthtools.mdht.uml.cda.cdt.*; import org.openhealthtools.mdht.uml.cda.cdt.util.*;
[ "java.util", "org.eclipse.emf", "org.eclipse.ocl", "org.openhealthtools.mdht" ]
java.util; org.eclipse.emf; org.eclipse.ocl; org.openhealthtools.mdht;
2,357,939
public static <T> Set<Set<T>> powerSet(Set<T> originalSet) { Set<Set<T>> sets = new HashSet<Set<T>>(); if (originalSet.isEmpty()) { sets.add(new HashSet<T>()); return sets; } List<T> list = new ArrayList<T>(originalSet); T head = list.get(0); Set<T> rest = new HashSet<T>(list.subList(1, list.size())); for (Set<T> set : powerSet(rest)) { Set<T> newSet = new HashSet<T>(); newSet.add(head); newSet.addAll(set); sets.add(newSet); sets.add(set); } return sets; }
static <T> Set<Set<T>> function(Set<T> originalSet) { Set<Set<T>> sets = new HashSet<Set<T>>(); if (originalSet.isEmpty()) { sets.add(new HashSet<T>()); return sets; } List<T> list = new ArrayList<T>(originalSet); T head = list.get(0); Set<T> rest = new HashSet<T>(list.subList(1, list.size())); for (Set<T> set : powerSet(rest)) { Set<T> newSet = new HashSet<T>(); newSet.add(head); newSet.addAll(set); sets.add(newSet); sets.add(set); } return sets; }
/** * Return the powerset of a set. * @param originalSet The original set. * @return The powerset of the original set. * * Code taken from Joao Silva's Stackoverflow answer: * http://stackoverflow.com/questions/1670862/obtaining-a-powerset-of-a-set-in-java */
Return the powerset of a set
powerSet
{ "repo_name": "Simon-Will/vilperg-senti", "path": "experimenting/MyClassifier/PermuteAndClassify.java", "license": "gpl-3.0", "size": 17108 }
[ "java.util.ArrayList", "java.util.HashSet", "java.util.List", "java.util.Set" ]
import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,908,294
public static ApprovalDialog getConfirmationDialog(Dialog owner, ModalityType modal) { ApprovalDialog result; result = new ApprovalDialog(owner, modal); result.setApproveCaption("Yes"); result.setApproveMnemonic(KeyEvent.VK_Y); result.setDiscardCaption("No"); result.setDiscardMnemonic(KeyEvent.VK_N); result.setDiscardVisible(true); return result; }
static ApprovalDialog function(Dialog owner, ModalityType modal) { ApprovalDialog result; result = new ApprovalDialog(owner, modal); result.setApproveCaption("Yes"); result.setApproveMnemonic(KeyEvent.VK_Y); result.setDiscardCaption("No"); result.setDiscardMnemonic(KeyEvent.VK_N); result.setDiscardVisible(true); return result; }
/** * Returns a basic confirmation dialog (yes/no/cancel). * * @param owner the owner of the dialog * @param modal the modality of the dialog */
Returns a basic confirmation dialog (yes/no/cancel)
getConfirmationDialog
{ "repo_name": "automenta/adams-core", "path": "src/main/java/adams/gui/dialog/ApprovalDialog.java", "license": "gpl-3.0", "size": 14297 }
[ "java.awt.Dialog", "java.awt.event.KeyEvent" ]
import java.awt.Dialog; import java.awt.event.KeyEvent;
import java.awt.*; import java.awt.event.*;
[ "java.awt" ]
java.awt;
1,980,694
void setActuate(ActuateType value);
void setActuate(ActuateType value);
/** * Sets the value of the '{@link net.opengis.gml.OperationMethodRefType#getActuate <em>Actuate</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Actuate</em>' attribute. * @see org.w3._1999.xlink.ActuateType * @see #isSetActuate() * @see #unsetActuate() * @see #getActuate() * @generated */
Sets the value of the '<code>net.opengis.gml.OperationMethodRefType#getActuate Actuate</code>' attribute.
setActuate
{ "repo_name": "markus1978/citygml4emf", "path": "de.hub.citygml.emf.ecore/src/net/opengis/gml/OperationMethodRefType.java", "license": "apache-2.0", "size": 14216 }
[ "org.w3._1999.xlink.ActuateType" ]
import org.w3._1999.xlink.ActuateType;
import org.w3.*;
[ "org.w3" ]
org.w3;
2,336,032
@Test public final void testGetJobStatus_JobDNE() { final int jobId = 123; final VEGLJob mockJob = context.mock(VEGLJob.class); context.checking(new Expectations() {{ oneOf(mockJobManager).getJobById(jobId);will(returnValue(null)); oneOf(mockJob).getId();will(returnValue(jobId)); }}); String status = jobStatLogReader.getJobStatus(mockJob); Assert.assertNull(status); }
final void function() { final int jobId = 123; final VEGLJob mockJob = context.mock(VEGLJob.class); context.checking(new Expectations() {{ oneOf(mockJobManager).getJobById(jobId);will(returnValue(null)); oneOf(mockJob).getId();will(returnValue(jobId)); }}); String status = jobStatLogReader.getJobStatus(mockJob); Assert.assertNull(status); }
/** * Tests that the get job status returns null * when the job cannot be found in database. */
Tests that the get job status returns null when the job cannot be found in database
testGetJobStatus_JobDNE
{ "repo_name": "AuScope/VHIRL-Portal", "path": "src/test/java/org/auscope/portal/server/vegl/TestVGLJobStatusAndLogReader.java", "license": "gpl-3.0", "size": 14420 }
[ "junit.framework.Assert", "org.jmock.Expectations" ]
import junit.framework.Assert; import org.jmock.Expectations;
import junit.framework.*; import org.jmock.*;
[ "junit.framework", "org.jmock" ]
junit.framework; org.jmock;
859,087
@ObjectiveCName("trackAuthCountryPickedWithCountry:") public void trackAuthCountryPicked(String country) { modules.getAnalytics().trackAuthCountryPicked(country); }
@ObjectiveCName(STR) void function(String country) { modules.getAnalytics().trackAuthCountryPicked(country); }
/** * Track country picked */
Track country picked
trackAuthCountryPicked
{ "repo_name": "boneyao/actor-platform", "path": "actor-apps/core/src/main/java/im/actor/model/Messenger.java", "license": "mit", "size": 50580 }
[ "com.google.j2objc.annotations.ObjectiveCName" ]
import com.google.j2objc.annotations.ObjectiveCName;
import com.google.j2objc.annotations.*;
[ "com.google.j2objc" ]
com.google.j2objc;
851,480
public Rating addRating( Rating r ) { ratings.add(r); Set<Rating> userRatings = ratingsPerUser.get(r.user); if (userRatings == null) { userRatings = new HashSet<Rating>(); } ratingsPerUser.put(r.user, userRatings); userRatings.add(r); users.add(r.user); items.add(r.item); averagesDirty = true; return r; }
Rating function( Rating r ) { ratings.add(r); Set<Rating> userRatings = ratingsPerUser.get(r.user); if (userRatings == null) { userRatings = new HashSet<Rating>(); } ratingsPerUser.put(r.user, userRatings); userRatings.add(r); users.add(r.user); items.add(r.item); averagesDirty = true; return r; }
/** * Stores a rating in the data model * @param user the user * @param item the rated item * @param value the value. No decimals allowed. * @return the newly added rating */
Stores a rating in the data model
addRating
{ "repo_name": "valegrajales/recommendation_systems_lab1", "path": "recommender101/src/org/recommender101/data/DataModel.java", "license": "mit", "size": 15648 }
[ "java.util.HashSet", "java.util.Set" ]
import java.util.HashSet; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,554,041
public Object getPropertyExceptRomDefault( Module module, DesignElement element, ElementPropertyDefn prop ) { if ( prop.isIntrinsic( ) ) { // This is an intrinsic system-defined property. return element.getIntrinsicProperty( prop.getName( ) ); } // Repeat the search up the inheritance or style // hierarchy, starting with this element. DesignElement e = element; Object value = null; while ( e != null ) { PropertySearchStrategy tmpStrategy = e.getStrategy( ); // Check if this element or parent provides the value value = tmpStrategy.getNonIntrinsicPropertyFromElement( module, e, prop ); if ( value != null ) return value; if ( !prop.isStyleProperty( ) || e.isStyle( ) || !tmpStrategy.isInheritableProperty( e, prop ) ) break; // Try to get the value of this property from container // hierarchy. e = getStyleContainer( e ); } // Still not found. Use the default. return getSessionDefaultValue( module, prop ); }
Object function( Module module, DesignElement element, ElementPropertyDefn prop ) { if ( prop.isIntrinsic( ) ) { return element.getIntrinsicProperty( prop.getName( ) ); } DesignElement e = element; Object value = null; while ( e != null ) { PropertySearchStrategy tmpStrategy = e.getStrategy( ); value = tmpStrategy.getNonIntrinsicPropertyFromElement( module, e, prop ); if ( value != null ) return value; if ( !prop.isStyleProperty( ) e.isStyle( ) !tmpStrategy.isInheritableProperty( e, prop ) ) break; e = getStyleContainer( e ); } return getSessionDefaultValue( module, prop ); }
/** * Gets a property value given its definition. This version does the * property search with style reference, extends reference and containment. * The default value style property defined in session is also searched, but * the default value defined in ROM will not be returned. * * @param module * the module * @param element * the element to start search * @param prop * definition of the property to get * @return The property value, or null if no value is set. */
Gets a property value given its definition. This version does the property search with style reference, extends reference and containment. The default value style property defined in session is also searched, but the default value defined in ROM will not be returned
getPropertyExceptRomDefault
{ "repo_name": "Charling-Huang/birt", "path": "model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/core/PropertySearchStrategy.java", "license": "epl-1.0", "size": 18817 }
[ "org.eclipse.birt.report.model.metadata.ElementPropertyDefn" ]
import org.eclipse.birt.report.model.metadata.ElementPropertyDefn;
import org.eclipse.birt.report.model.metadata.*;
[ "org.eclipse.birt" ]
org.eclipse.birt;
381,515
protected void findReferencedClassInfo(final Map<String, ClassInfo> classNameToClassInfo, final Set<ClassInfo> refdClassInfo, final LogNode log) { final ClassInfo ci = getClassInfo(); if (ci != null) { refdClassInfo.add(ci); } } // -------------------------------------------------------------------------------------------------------------
void function(final Map<String, ClassInfo> classNameToClassInfo, final Set<ClassInfo> refdClassInfo, final LogNode log) { final ClassInfo ci = getClassInfo(); if (ci != null) { refdClassInfo.add(ci); } }
/** * Get {@link ClassInfo} objects for any classes referenced by this object. * * @param classNameToClassInfo * the map from class name to {@link ClassInfo}. * @param refdClassInfo * the referenced class info * @param log * the log */
Get <code>ClassInfo</code> objects for any classes referenced by this object
findReferencedClassInfo
{ "repo_name": "classgraph/classgraph", "path": "src/main/java/io/github/classgraph/ScanResultObject.java", "license": "mit", "size": 11604 }
[ "java.util.Map", "java.util.Set" ]
import java.util.Map; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
778,601
@javax.annotation.Nullable @ApiModelProperty(value = "grantable_roles_at_base array") public List<GrantableRolesAtBaseEnum> getGrantableRolesAtBase() { if (grantableRolesAtBaseEnum == null) { grantableRolesAtBaseEnum = new ArrayList<>(); for (String value : grantableRolesAtBase) { grantableRolesAtBaseEnum.add(GrantableRolesAtBaseEnum.fromValue(value)); } } return grantableRolesAtBaseEnum; }
@javax.annotation.Nullable @ApiModelProperty(value = STR) List<GrantableRolesAtBaseEnum> function() { if (grantableRolesAtBaseEnum == null) { grantableRolesAtBaseEnum = new ArrayList<>(); for (String value : grantableRolesAtBase) { grantableRolesAtBaseEnum.add(GrantableRolesAtBaseEnum.fromValue(value)); } } return grantableRolesAtBaseEnum; }
/** * grantable_roles_at_base array * * @return grantableRolesAtBase **/
grantable_roles_at_base array
getGrantableRolesAtBase
{ "repo_name": "burberius/eve-esi", "path": "src/main/java/net/troja/eve/esi/model/CorporationRolesResponse.java", "license": "apache-2.0", "size": 45563 }
[ "io.swagger.annotations.ApiModelProperty", "java.util.ArrayList", "java.util.List" ]
import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List;
import io.swagger.annotations.*; import java.util.*;
[ "io.swagger.annotations", "java.util" ]
io.swagger.annotations; java.util;
1,774,865
public void addButtonActionListener(ActionListener actionListener) { jBCancel.addActionListener(actionListener); jBAdd.addActionListener(actionListener); jBEdit.addActionListener(actionListener); jBCapabilities.addActionListener(actionListener); }
void function(ActionListener actionListener) { jBCancel.addActionListener(actionListener); jBAdd.addActionListener(actionListener); jBEdit.addActionListener(actionListener); jBCapabilities.addActionListener(actionListener); }
/** * Add the listener recived as parameter to the buttons of the panel * @param actionListener the listener of the action */
Add the listener recived as parameter to the buttons of the panel
addButtonActionListener
{ "repo_name": "accesstest3/cfunambol", "path": "admin-suite/admin/src/com/funambol/admin/device/panels/ButtonResultSearchDevicePanel.java", "license": "agpl-3.0", "size": 5888 }
[ "java.awt.event.ActionListener" ]
import java.awt.event.ActionListener;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
1,161,156
public void setBus(Bus bus) { this.bus = bus; if (defaultBus) { BusFactory.setDefaultBus(bus); LOG.debug("Set bus {} as thread default bus", bus); } }
void function(Bus bus) { this.bus = bus; if (defaultBus) { BusFactory.setDefaultBus(bus); LOG.debug(STR, bus); } }
/** * To use a custom configured CXF Bus. */
To use a custom configured CXF Bus
setBus
{ "repo_name": "Fabryprog/camel", "path": "components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java", "license": "apache-2.0", "size": 30065 }
[ "org.apache.cxf.Bus", "org.apache.cxf.BusFactory" ]
import org.apache.cxf.Bus; import org.apache.cxf.BusFactory;
import org.apache.cxf.*;
[ "org.apache.cxf" ]
org.apache.cxf;
2,302,695
public CategoryLocalService getCategoryLocalService() { return categoryLocalService; }
CategoryLocalService function() { return categoryLocalService; }
/** * Returns the category local service. * * @return the category local service */
Returns the category local service
getCategoryLocalService
{ "repo_name": "fraunhoferfokus/govapps", "path": "data-portlet/src/main/java/de/fraunhofer/fokus/movepla/service/base/MultiMediaServiceBaseImpl.java", "license": "bsd-3-clause", "size": 32769 }
[ "de.fraunhofer.fokus.movepla.service.CategoryLocalService" ]
import de.fraunhofer.fokus.movepla.service.CategoryLocalService;
import de.fraunhofer.fokus.movepla.service.*;
[ "de.fraunhofer.fokus" ]
de.fraunhofer.fokus;
119,606
@Ignore @Test public void writeSnapshot() throws Exception { final File outDir = tempFolder.newFolder(); BucketingSink<String> sink = new BucketingSink<String>(outDir.getAbsolutePath()) .setWriter(new StringWriter<String>()) .setBatchSize(5) .setPartPrefix(PART_PREFIX) .setInProgressPrefix("") .setPendingPrefix("") .setValidLengthPrefix("") .setInProgressSuffix(IN_PROGRESS_SUFFIX) .setPendingSuffix(PENDING_SUFFIX) .setValidLengthSuffix(VALID_LENGTH_SUFFIX); OneInputStreamOperatorTestHarness<String, Object> testHarness = new OneInputStreamOperatorTestHarness<>(new StreamSink<>(sink)); testHarness.setup(); testHarness.open(); testHarness.processElement(new StreamRecord<>("test1", 0L)); testHarness.processElement(new StreamRecord<>("test2", 0L)); checkFs(outDir, 1, 1, 0, 0); testHarness.processElement(new StreamRecord<>("test3", 0L)); testHarness.processElement(new StreamRecord<>("test4", 0L)); testHarness.processElement(new StreamRecord<>("test5", 0L)); checkFs(outDir, 1, 4, 0, 0); OperatorStateHandles snapshot = testHarness.snapshot(0L, 0L); OperatorSnapshotUtil.writeStateHandle(snapshot, "src/test/resources/bucketing-sink-migration-test-flink1.2-snapshot"); testHarness.close(); }
void function() throws Exception { final File outDir = tempFolder.newFolder(); BucketingSink<String> sink = new BucketingSink<String>(outDir.getAbsolutePath()) .setWriter(new StringWriter<String>()) .setBatchSize(5) .setPartPrefix(PART_PREFIX) .setInProgressPrefix(STRSTRSTRtest1STRtest2STRtest3STRtest4STRtest5STRsrc/test/resources/bucketing-sink-migration-test-flink1.2-snapshot"); testHarness.close(); }
/** * Manually run this to write binary snapshot data. Remove @Ignore to run. */
Manually run this to write binary snapshot data. Remove @Ignore to run
writeSnapshot
{ "repo_name": "Xpray/flink", "path": "flink-connectors/flink-connector-filesystem/src/test/java/org/apache/flink/streaming/connectors/fs/bucketing/BucketingSinkFrom12MigrationTest.java", "license": "apache-2.0", "size": 7726 }
[ "java.io.File", "org.apache.flink.streaming.connectors.fs.StringWriter" ]
import java.io.File; import org.apache.flink.streaming.connectors.fs.StringWriter;
import java.io.*; import org.apache.flink.streaming.connectors.fs.*;
[ "java.io", "org.apache.flink" ]
java.io; org.apache.flink;
433,656
public static ParameterType makeFileParameterType(ParameterHandler parameterHandler, String parameterName, PortProvider portProvider, String... fileExtension) { final ParameterTypeFile fileParam = new ParameterTypeFile(parameterName, "Name of the file to write the data in.", true, fileExtension); fileParam.setExpert(false); fileParam.registerDependencyCondition(new PortConnectedCondition(parameterHandler, portProvider, true, false)); return fileParam; }
static ParameterType function(ParameterHandler parameterHandler, String parameterName, PortProvider portProvider, String... fileExtension) { final ParameterTypeFile fileParam = new ParameterTypeFile(parameterName, STR, true, fileExtension); fileParam.setExpert(false); fileParam.registerDependencyCondition(new PortConnectedCondition(parameterHandler, portProvider, true, false)); return fileParam; }
/** * Creates the file parameter named by fileParameterName that depends on whether or not the port * returned by the given PortProvider is connected. */
Creates the file parameter named by fileParameterName that depends on whether or not the port returned by the given PortProvider is connected
makeFileParameterType
{ "repo_name": "rapidminer/rapidminer-studio", "path": "src/main/java/com/rapidminer/operator/nio/file/FileOutputPortHandler.java", "license": "agpl-3.0", "size": 7079 }
[ "com.rapidminer.parameter.ParameterHandler", "com.rapidminer.parameter.ParameterType", "com.rapidminer.parameter.ParameterTypeFile", "com.rapidminer.parameter.PortProvider", "com.rapidminer.parameter.conditions.PortConnectedCondition" ]
import com.rapidminer.parameter.ParameterHandler; import com.rapidminer.parameter.ParameterType; import com.rapidminer.parameter.ParameterTypeFile; import com.rapidminer.parameter.PortProvider; import com.rapidminer.parameter.conditions.PortConnectedCondition;
import com.rapidminer.parameter.*; import com.rapidminer.parameter.conditions.*;
[ "com.rapidminer.parameter" ]
com.rapidminer.parameter;
872,432
EAttribute getUIHints_ID();
EAttribute getUIHints_ID();
/** * Returns the meta object for the attribute '{@link com.sofrecom.codegen.UIHints#getID <em>ID</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>ID</em>'. * @see com.sofrecom.codegen.UIHints#getID() * @see #getUIHints() * @generated */
Returns the meta object for the attribute '<code>com.sofrecom.codegen.UIHints#getID ID</code>'.
getUIHints_ID
{ "repo_name": "BenRhouma/AcceleoStandAlone", "path": "src/com/sofrecom/codegen/CodegenPackage.java", "license": "lgpl-3.0", "size": 14496 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,629,282
private void collectExchangeNodes(PlanNode node, List<ExchangeNode> result) { if (node instanceof ExchangeNode) { result.add((ExchangeNode)node); return; } for (PlanNode child: node.getChildren()) collectExchangeNodes(child, result); }
void function(PlanNode node, List<ExchangeNode> result) { if (node instanceof ExchangeNode) { result.add((ExchangeNode)node); return; } for (PlanNode child: node.getChildren()) collectExchangeNodes(child, result); }
/** * Collect all ExchangeNodes in this fragment. */
Collect all ExchangeNodes in this fragment
collectExchangeNodes
{ "repo_name": "michaelhkw/incubator-impala", "path": "fe/src/main/java/org/apache/impala/planner/ParallelPlanner.java", "license": "apache-2.0", "size": 8407 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,467,136
public JSType getJSTypeBeforeCast() { return (JSType) getProp(TYPE_BEFORE_CAST); }
JSType function() { return (JSType) getProp(TYPE_BEFORE_CAST); }
/** * Returns the type of this node before casting. This annotation will only exist on the first * child of a CAST node after type checking. */
Returns the type of this node before casting. This annotation will only exist on the first child of a CAST node after type checking
getJSTypeBeforeCast
{ "repo_name": "weiwl/closure-compiler", "path": "src/com/google/javascript/rhino/Node.java", "license": "apache-2.0", "size": 79806 }
[ "com.google.javascript.rhino.jstype.JSType" ]
import com.google.javascript.rhino.jstype.JSType;
import com.google.javascript.rhino.jstype.*;
[ "com.google.javascript" ]
com.google.javascript;
817,105
public boolean similar(Object other) { try { if (!(other instanceof JSONObject)) { return false; } Set<String> set = this.keySet(); if (!set.equals(((JSONObject)other).keySet())) { return false; } Iterator<String> iterator = set.iterator(); while (iterator.hasNext()) { String name = iterator.next(); Object valueThis = this.get(name); Object valueOther = ((JSONObject)other).get(name); if (valueThis instanceof JSONObject) { if (!((JSONObject)valueThis).similar(valueOther)) { return false; } } else if (valueThis instanceof JSONArray) { if (!((JSONArray)valueThis).similar(valueOther)) { return false; } } else if (!valueThis.equals(valueOther)) { return false; } } return true; } catch (Throwable exception) { return false; } }
boolean function(Object other) { try { if (!(other instanceof JSONObject)) { return false; } Set<String> set = this.keySet(); if (!set.equals(((JSONObject)other).keySet())) { return false; } Iterator<String> iterator = set.iterator(); while (iterator.hasNext()) { String name = iterator.next(); Object valueThis = this.get(name); Object valueOther = ((JSONObject)other).get(name); if (valueThis instanceof JSONObject) { if (!((JSONObject)valueThis).similar(valueOther)) { return false; } } else if (valueThis instanceof JSONArray) { if (!((JSONArray)valueThis).similar(valueOther)) { return false; } } else if (!valueThis.equals(valueOther)) { return false; } } return true; } catch (Throwable exception) { return false; } }
/** * Determine if two JSONObjects are similar. * They must contain the same set of names which must be associated with * similar values. * * @param other The other JSONObject * @return true if they are equal */
Determine if two JSONObjects are similar. They must contain the same set of names which must be associated with similar values
similar
{ "repo_name": "thislooksfun/ForgeUpdater", "path": "ForgeUpdater/src/com/tlf/forgeupdater/JSON/JSONObject.java", "license": "gpl-2.0", "size": 57543 }
[ "java.util.Iterator", "java.util.Set" ]
import java.util.Iterator; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
172,793
boolean hasSettingsInScope(IScopeContext context);
boolean hasSettingsInScope(IScopeContext context);
/** * Called when the property page is opened to check whether this has enabled settings * in the given context. * * @param context the context to check * @return true if this has settings in context */
Called when the property page is opened to check whether this has enabled settings in the given context
hasSettingsInScope
{ "repo_name": "brunyuriy/quick-fix-scout", "path": "org.eclipse.jdt.ui_3.7.1.r371_v20110824-0800/src/org/eclipse/jdt/internal/ui/javaeditor/saveparticipant/ISaveParticipantPreferenceConfiguration.java", "license": "mit", "size": 3398 }
[ "org.eclipse.core.runtime.preferences.IScopeContext" ]
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.core.runtime.preferences.*;
[ "org.eclipse.core" ]
org.eclipse.core;
415,559
private String[] annotatedParameterNames(Method method) { Annotation[][] parameterAnnotations = method.getParameterAnnotations(); String[] names = new String[parameterAnnotations.length]; for (int i = 0; i < parameterAnnotations.length; i++) { for (Annotation annotation : parameterAnnotations[i]) { names[i] = annotationName(annotation); } } return names; }
String[] function(Method method) { Annotation[][] parameterAnnotations = method.getParameterAnnotations(); String[] names = new String[parameterAnnotations.length]; for (int i = 0; i < parameterAnnotations.length; i++) { for (Annotation annotation : parameterAnnotations[i]) { names[i] = annotationName(annotation); } } return names; }
/** * Extract parameter names using {@link Named}-annotated parameters * * @param method the Method with {@link Named}-annotated parameters * @return An array of annotated parameter names, which <b>may</b> include * <code>null</code> values for parameters that are not annotated */
Extract parameter names using <code>Named</code>-annotated parameters
annotatedParameterNames
{ "repo_name": "skundrik/jbehave-core", "path": "jbehave-core/src/main/java/org/jbehave/core/steps/StepCreator.java", "license": "bsd-3-clause", "size": 40745 }
[ "java.lang.annotation.Annotation", "java.lang.reflect.Method" ]
import java.lang.annotation.Annotation; import java.lang.reflect.Method;
import java.lang.annotation.*; import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
2,678,261
public void marshal(java.io.Writer out) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, out); } //-- void marshal(java.io.Writer)
void function(java.io.Writer out) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, out); }
/** * Method marshal * * * * @param out */
Method marshal
marshal
{ "repo_name": "idega/platform2", "path": "src/is/idega/block/finance/business/li/claims_delete/LI_IK_eyda_krofu_type.java", "license": "gpl-3.0", "size": 6599 }
[ "org.exolab.castor.xml.Marshaller" ]
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.*;
[ "org.exolab.castor" ]
org.exolab.castor;
181,454
public List<CharacterAssetsResponse> getCharactersCharacterIdAssets(Integer characterId, String datasource, String ifNoneMatch, Integer page, String token) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'characterId' is set if (characterId == null) { throw new ApiException(400, "Missing the required parameter 'characterId' when calling getCharactersCharacterIdAssets"); } // create path and map variables String localVarPath = "/v3/characters/{character_id}/assets/".replaceAll("\\{format\\}", "json").replaceAll( "\\{" + "character_id" + "\\}", apiClient.escapeString(characterId.toString())); // query params List<Pair> localVarQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); localVarQueryParams.addAll(apiClient.parameterToPairs("", "datasource", datasource)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "token", token)); if (ifNoneMatch != null) localVarHeaderParams.put("If-None-Match", apiClient.parameterToString(ifNoneMatch)); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { "evesso" }; GenericType<List<CharacterAssetsResponse>> localVarReturnType = new GenericType<List<CharacterAssetsResponse>>() { }; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); }
List<CharacterAssetsResponse> function(Integer characterId, String datasource, String ifNoneMatch, Integer page, String token) throws ApiException { Object localVarPostBody = null; if (characterId == null) { throw new ApiException(400, STR); } String localVarPath = STR.replaceAll(STR, "json").replaceAll( "\\{" + STR + "\\}", apiClient.escapeString(characterId.toString())); List<Pair> localVarQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); localVarQueryParams.addAll(apiClient.parameterToPairs(STRdatasource", datasource)); localVarQueryParams.addAll(apiClient.parameterToPairs(STRpage", page)); localVarQueryParams.addAll(apiClient.parameterToPairs(STRtokenSTRIf-None-MatchSTRapplication/jsonSTRapplication/jsonSTRevessoSTRGET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); }
/** * Get character assets Return a list of the characters assets --- This * route is cached for up to 3600 seconds SSO Scope: * esi-assets.read_assets.v1 * * @param characterId * An EVE character ID (required) * @param datasource * The server name you would like data from (optional, default to * tranquility) * @param ifNoneMatch * ETag from a previous request. A 304 will be returned if this * matches the current ETag (optional) * @param page * Which page of results to return (optional, default to 1) * @param token * Access token to use if unable to set a header (optional) * @return List&lt;CharacterAssetsResponse&gt; * @throws ApiException * if fails to make API call */
Get character assets Return a list of the characters assets --- This route is cached for up to 3600 seconds SSO Scope: esi-assets.read_assets.v1
getCharactersCharacterIdAssets
{ "repo_name": "GoldenGnu/eve-esi", "path": "src/main/java/net/troja/eve/esi/api/AssetsApi.java", "license": "apache-2.0", "size": 19591 }
[ "java.util.ArrayList", "java.util.HashMap", "java.util.List", "java.util.Map", "net.troja.eve.esi.ApiException", "net.troja.eve.esi.Pair", "net.troja.eve.esi.model.CharacterAssetsResponse" ]
import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import net.troja.eve.esi.ApiException; import net.troja.eve.esi.Pair; import net.troja.eve.esi.model.CharacterAssetsResponse;
import java.util.*; import net.troja.eve.esi.*; import net.troja.eve.esi.model.*;
[ "java.util", "net.troja.eve" ]
java.util; net.troja.eve;
466,440
public static IChatMessage formatPluginInfo(Plugin plugin, @Nullable TextFormatterSettings settings, CharSequence msg, Object... args) { PreCon.notNull(plugin); PreCon.notNull(msg); PreCon.notNull(args); TextFormatterSettings formatters; if (settings == null) { formatters = _pluginFormatters.get(plugin); if (formatters == null) { formatters = getPluginFormatters(plugin, null); _pluginFormatters.put(plugin, formatters); } } else { formatters = getPluginFormatters(plugin, settings); } return TEXT_FORMATTER.format(formatters, msg, args); }
static IChatMessage function(Plugin plugin, @Nullable TextFormatterSettings settings, CharSequence msg, Object... args) { PreCon.notNull(plugin); PreCon.notNull(msg); PreCon.notNull(args); TextFormatterSettings formatters; if (settings == null) { formatters = _pluginFormatters.get(plugin); if (formatters == null) { formatters = getPluginFormatters(plugin, null); _pluginFormatters.put(plugin, formatters); } } else { formatters = getPluginFormatters(plugin, settings); } return TEXT_FORMATTER.format(formatters, msg, args); }
/** * Format text string by replacing placeholders with the information about the * specified plugin. * * <p>Placeholders: {plugin-version}, {plugin-name}, {plugin-full-name}, * {plugin-author}, {plugin-command}</p> * * @param plugin The plugin. * @param settings The settings to use. * @param msg The message to format plugin info into. * @param args Optional message format arguments. */
Format text string by replacing placeholders with the information about the specified plugin. Placeholders: {plugin-version}, {plugin-name}, {plugin-full-name}, {plugin-author}, {plugin-command}
formatPluginInfo
{ "repo_name": "JCThePants/NucleusFramework", "path": "src/com/jcwhatever/nucleus/utils/text/TextUtils.java", "license": "mit", "size": 44562 }
[ "com.jcwhatever.nucleus.utils.PreCon", "com.jcwhatever.nucleus.utils.text.components.IChatMessage", "com.jcwhatever.nucleus.utils.text.format.TextFormatterSettings", "javax.annotation.Nullable", "org.bukkit.plugin.Plugin" ]
import com.jcwhatever.nucleus.utils.PreCon; import com.jcwhatever.nucleus.utils.text.components.IChatMessage; import com.jcwhatever.nucleus.utils.text.format.TextFormatterSettings; import javax.annotation.Nullable; import org.bukkit.plugin.Plugin;
import com.jcwhatever.nucleus.utils.*; import com.jcwhatever.nucleus.utils.text.components.*; import com.jcwhatever.nucleus.utils.text.format.*; import javax.annotation.*; import org.bukkit.plugin.*;
[ "com.jcwhatever.nucleus", "javax.annotation", "org.bukkit.plugin" ]
com.jcwhatever.nucleus; javax.annotation; org.bukkit.plugin;
553,546
EList<Association> getAssociations();
EList<Association> getAssociations();
/** * Returns the value of the '<em><b>Associations</b></em>' containment reference list. * The list contents are of type {@link domainmetamodel.Association}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Associations</em>' containment reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Associations</em>' containment reference list. * @see domainmetamodel.DomainmetamodelPackage#getBusinessEntity_Associations() * @model containment="true" * @generated */
Returns the value of the 'Associations' containment reference list. The list contents are of type <code>domainmetamodel.Association</code>. If the meaning of the 'Associations' containment reference list isn't clear, there really should be more of a description here...
getAssociations
{ "repo_name": "unicesi/QD-SPL", "path": "ToolSupport/co.edu.icesi.shift.domainmodel/src/domainmetamodel/BusinessEntity.java", "license": "lgpl-3.0", "size": 4475 }
[ "org.eclipse.emf.common.util.EList" ]
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,542,243
public ServiceFuture<AuthorizationServerContractInner> createOrUpdateAsync(String resourceGroupName, String serviceName, String authsid, AuthorizationServerContractInner parameters, final ServiceCallback<AuthorizationServerContractInner> serviceCallback) { return ServiceFuture.fromHeaderResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, authsid, parameters), serviceCallback); }
ServiceFuture<AuthorizationServerContractInner> function(String resourceGroupName, String serviceName, String authsid, AuthorizationServerContractInner parameters, final ServiceCallback<AuthorizationServerContractInner> serviceCallback) { return ServiceFuture.fromHeaderResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, authsid, parameters), serviceCallback); }
/** * Creates new authorization server or updates an existing authorization server. * * @param resourceGroupName The name of the resource group. * @param serviceName The name of the API Management service. * @param authsid Identifier of the authorization server. * @param parameters Create or update parameters. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
Creates new authorization server or updates an existing authorization server
createOrUpdateAsync
{ "repo_name": "navalev/azure-sdk-for-java", "path": "sdk/apimanagement/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/apimanagement/v2018_06_01_preview/implementation/AuthorizationServersInner.java", "license": "mit", "size": 68711 }
[ "com.microsoft.rest.ServiceCallback", "com.microsoft.rest.ServiceFuture" ]
import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
2,031,482
private void updateStatus1() { if (gameUserOp != null){ try { gameUserOp.playGame(username, MainUI.getCurrentPlayers()); } catch (Exception e){ JOptionPane.showMessageDialog(null, "Leader board error", "Error", JOptionPane.ERROR_MESSAGE); System.err.println("Leader board: "+e); System.exit(1); } } } private class NewGamePanel extends JPanel { private static final long serialVersionUID = -3347842112036698322L; private JButton jb; public NewGamePanel(){ jb = new JButton("New Game"); jb.setPreferredSize(new Dimension(800, 550)); jb.addActionListener(new JbListener()); add(jb, BorderLayout.CENTER); } } private class JbListener implements ActionListener {
void function() { if (gameUserOp != null){ try { gameUserOp.playGame(username, MainUI.getCurrentPlayers()); } catch (Exception e){ JOptionPane.showMessageDialog(null, STR, "Error", JOptionPane.ERROR_MESSAGE); System.err.println(STR+e); System.exit(1); } } } private class NewGamePanel extends JPanel { private static final long serialVersionUID = -3347842112036698322L; private JButton jb; public NewGamePanel(){ jb = new JButton(STR); jb.setPreferredSize(new Dimension(800, 550)); jb.addActionListener(new JbListener()); add(jb, BorderLayout.CENTER); } } private class JbListener implements ActionListener {
/** * module responsible for RMI login */
module responsible for RMI login
updateStatus1
{ "repo_name": "manchunw/Poker24", "path": "src/PlayGamePanel.java", "license": "mit", "size": 13226 }
[ "java.awt.BorderLayout", "java.awt.Dimension", "java.awt.event.ActionListener", "javax.swing.JButton", "javax.swing.JOptionPane", "javax.swing.JPanel" ]
import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JOptionPane; import javax.swing.JPanel;
import java.awt.*; import java.awt.event.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
2,536,027
@Test(timeout=300000) @JUnitTemporaryDatabase // Relies on records created in @Before so we need a fresh database @Transactional public void testImportUtf8() throws Exception { m_provisioner.importModelFromResource(new ClassPathResource("/utf-8.xml"), true); assertEquals(1, getNodeDao().countAll()); // \u00f1 is unicode for n~ final OnmsNode onmsNode = getNodeDao().get(1); LogUtils.debugf(this, "node = %s", onmsNode); assertEquals("\u00f1ode2", onmsNode.getLabel()); }
@Test(timeout=300000) @JUnitTemporaryDatabase void function() throws Exception { m_provisioner.importModelFromResource(new ClassPathResource(STR), true); assertEquals(1, getNodeDao().countAll()); final OnmsNode onmsNode = getNodeDao().get(1); LogUtils.debugf(this, STR, onmsNode); assertEquals(STR, onmsNode.getLabel()); }
/** * This test first bulk imports 10 nodes then runs update with 1 node missing * from the import file. * * @throws ModelImportException */
This test first bulk imports 10 nodes then runs update with 1 node missing from the import file
testImportUtf8
{ "repo_name": "qoswork/opennmszh", "path": "opennms-provision/opennms-provisiond/src/test/java/org/opennms/netmgt/provision/service/ProvisionerTest.java", "license": "gpl-2.0", "size": 66820 }
[ "org.junit.Assert", "org.junit.Test", "org.opennms.core.test.db.annotations.JUnitTemporaryDatabase", "org.opennms.core.utils.LogUtils", "org.opennms.netmgt.model.OnmsNode", "org.springframework.core.io.ClassPathResource" ]
import org.junit.Assert; import org.junit.Test; import org.opennms.core.test.db.annotations.JUnitTemporaryDatabase; import org.opennms.core.utils.LogUtils; import org.opennms.netmgt.model.OnmsNode; import org.springframework.core.io.ClassPathResource;
import org.junit.*; import org.opennms.core.test.db.annotations.*; import org.opennms.core.utils.*; import org.opennms.netmgt.model.*; import org.springframework.core.io.*;
[ "org.junit", "org.opennms.core", "org.opennms.netmgt", "org.springframework.core" ]
org.junit; org.opennms.core; org.opennms.netmgt; org.springframework.core;
717,557
@Deprecated public static <T> Set<T> createLinkedSetIfPossible(int initialCapacity) { return new LinkedHashSet<T>(initialCapacity); }
static <T> Set<T> function(int initialCapacity) { return new LinkedHashSet<T>(initialCapacity); }
/** * Create a linked Set if possible: This implementation always * creates a {@link java.util.LinkedHashSet}, since Spring 2.5 * requires JDK 1.4 anyway. * @param initialCapacity the initial capacity of the Set * @return the new Set instance * @deprecated as of Spring 2.5, for usage on JDK 1.4 or higher */
Create a linked Set if possible: This implementation always creates a <code>java.util.LinkedHashSet</code>, since Spring 2.5 requires JDK 1.4 anyway
createLinkedSetIfPossible
{ "repo_name": "TinyGroup/tiny", "path": "framework/org.tinygroup.commons/src/main/java/org/tinygroup/commons/tools/CollectionFactory.java", "license": "gpl-3.0", "size": 11126 }
[ "java.util.LinkedHashSet", "java.util.Set" ]
import java.util.LinkedHashSet; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,042,396
public void testPressEscKeyOnNonModalNonTransientDialog() throws Exception { open(APP); verifyOverlayNotActive(); openOverlay(PANELDIALOG_NONTRANSIENT_NONMODAL_BUTTON); verifyOverlayActive(); pressEscapeOnActiveElement(); waitForElementAbsent(getDriver().findElement(By.cssSelector(PANELDIALOG_MODAL_CMP))); verifyOverlayNotActive(); }
void function() throws Exception { open(APP); verifyOverlayNotActive(); openOverlay(PANELDIALOG_NONTRANSIENT_NONMODAL_BUTTON); verifyOverlayActive(); pressEscapeOnActiveElement(); waitForElementAbsent(getDriver().findElement(By.cssSelector(PANELDIALOG_MODAL_CMP))); verifyOverlayNotActive(); }
/** * [Accessibility] non-modal overlay dialog with transient set to false should be closing on Esc key. Test case for * W-2396326 */
[Accessibility] non-modal overlay dialog with transient set to false should be closing on Esc key. Test case for W-2396326
testPressEscKeyOnNonModalNonTransientDialog
{ "repo_name": "DebalinaDey/AuraDevelopDeb", "path": "aura-components/src/test/java/org/auraframework/components/ui/modalOverlay/PanelModalOverlayUITest.java", "license": "apache-2.0", "size": 14080 }
[ "org.openqa.selenium.By" ]
import org.openqa.selenium.By;
import org.openqa.selenium.*;
[ "org.openqa.selenium" ]
org.openqa.selenium;
2,857,093
private void checkMethodCall(DetailAST methodCall) { DetailAST objCalledOn = methodCall.getFirstChild().getFirstChild(); if (objCalledOn.getType() == TokenTypes.DOT) { objCalledOn = objCalledOn.getLastChild(); } final DetailAST expr = methodCall.findFirstToken(TokenTypes.ELIST).getFirstChild(); if (isObjectValid(objCalledOn) && containsOneArgument(methodCall) && containsAllSafeTokens(expr) && isCalledOnStringField(objCalledOn)) { final String methodName = methodCall.getFirstChild().getLastChild().getText(); if (EQUALS.equals(methodName)) { log(methodCall.getLineNo(), methodCall.getColumnNo(), MSG_EQUALS_AVOID_NULL); } else { log(methodCall.getLineNo(), methodCall.getColumnNo(), MSG_EQUALS_IGNORE_CASE_AVOID_NULL); } } }
void function(DetailAST methodCall) { DetailAST objCalledOn = methodCall.getFirstChild().getFirstChild(); if (objCalledOn.getType() == TokenTypes.DOT) { objCalledOn = objCalledOn.getLastChild(); } final DetailAST expr = methodCall.findFirstToken(TokenTypes.ELIST).getFirstChild(); if (isObjectValid(objCalledOn) && containsOneArgument(methodCall) && containsAllSafeTokens(expr) && isCalledOnStringField(objCalledOn)) { final String methodName = methodCall.getFirstChild().getLastChild().getText(); if (EQUALS.equals(methodName)) { log(methodCall.getLineNo(), methodCall.getColumnNo(), MSG_EQUALS_AVOID_NULL); } else { log(methodCall.getLineNo(), methodCall.getColumnNo(), MSG_EQUALS_IGNORE_CASE_AVOID_NULL); } } }
/** * Check whether the method call should be violated. * @param methodCall method call to check. */
Check whether the method call should be violated
checkMethodCall
{ "repo_name": "rmswimkktt/checkstyle", "path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheck.java", "license": "lgpl-2.1", "size": 20148 }
[ "com.puppycrawl.tools.checkstyle.api.DetailAST", "com.puppycrawl.tools.checkstyle.api.TokenTypes" ]
import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import com.puppycrawl.tools.checkstyle.api.*;
[ "com.puppycrawl.tools" ]
com.puppycrawl.tools;
506,253
public void run(IAction action) { // get the selected node ContextEditPart contextEditPart = (ContextEditPart) DcaseEditorUtil.getFirstCurrentSelectedPart(); BasicNode basicNode = (BasicNode) DcaseEditorUtil.getSelectedObject(); if (basicNode != null) { RequirementDialog dialog = new RequirementDialog(getShell(), contextEditPart); if (Dialog.OK == dialog.open()) { // gets the Argument edit part ArgumentEditPart argumentEditPart = DcaseEditorUtil .getCurrentArgumentEditPart(); // creates a map for updating the property. Map<AttributeType, Object> attributeMap = new HashMap<AttributeType, Object>(); // sets the updating value to the map. attributeMap.put(AttributeType.REQUIREMENTS, dialog.getRequirements()); // creates a command to updating the property. ICommand changeCommand = new ChangeBasicNodePropertyTransactionCommand( argumentEditPart.getEditingDomain(), Messages.ConfigureRequirementAction_CommandLabel, null, basicNode, attributeMap); // executes the command. argumentEditPart.getDiagramEditDomain() .getDiagramCommandStack() .execute(new ICommandProxy(changeCommand)); } } }
void function(IAction action) { ContextEditPart contextEditPart = (ContextEditPart) DcaseEditorUtil.getFirstCurrentSelectedPart(); BasicNode basicNode = (BasicNode) DcaseEditorUtil.getSelectedObject(); if (basicNode != null) { RequirementDialog dialog = new RequirementDialog(getShell(), contextEditPart); if (Dialog.OK == dialog.open()) { ArgumentEditPart argumentEditPart = DcaseEditorUtil .getCurrentArgumentEditPart(); Map<AttributeType, Object> attributeMap = new HashMap<AttributeType, Object>(); attributeMap.put(AttributeType.REQUIREMENTS, dialog.getRequirements()); ICommand changeCommand = new ChangeBasicNodePropertyTransactionCommand( argumentEditPart.getEditingDomain(), Messages.ConfigureRequirementAction_CommandLabel, null, basicNode, attributeMap); argumentEditPart.getDiagramEditDomain() .getDiagramCommandStack() .execute(new ICommandProxy(changeCommand)); } } }
/** * The function that execute when menu item is clicked. * * @param action action */
The function that execute when menu item is clicked
run
{ "repo_name": "kuriking/testdc2", "path": "net.dependableos.dcase.diagram.editor/src/net/dependableos/dcase/diagram/editor/requirement/ConfigureRequirementAction.java", "license": "epl-1.0", "size": 3988 }
[ "java.util.HashMap", "java.util.Map", "net.dependableos.dcase.BasicNode", "net.dependableos.dcase.diagram.common.command.ChangeBasicNodePropertyTransactionCommand", "net.dependableos.dcase.diagram.common.model.AttributeType", "net.dependableos.dcase.diagram.edit.parts.ArgumentEditPart", "net.dependableos.dcase.diagram.edit.parts.ContextEditPart", "net.dependableos.dcase.diagram.editor.common.util.DcaseEditorUtil", "net.dependableos.dcase.diagram.editor.message.Messages", "org.eclipse.gmf.runtime.common.core.command.ICommand", "org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy", "org.eclipse.jface.action.IAction", "org.eclipse.jface.dialogs.Dialog" ]
import java.util.HashMap; import java.util.Map; import net.dependableos.dcase.BasicNode; import net.dependableos.dcase.diagram.common.command.ChangeBasicNodePropertyTransactionCommand; import net.dependableos.dcase.diagram.common.model.AttributeType; import net.dependableos.dcase.diagram.edit.parts.ArgumentEditPart; import net.dependableos.dcase.diagram.edit.parts.ContextEditPart; import net.dependableos.dcase.diagram.editor.common.util.DcaseEditorUtil; import net.dependableos.dcase.diagram.editor.message.Messages; import org.eclipse.gmf.runtime.common.core.command.ICommand; import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; import org.eclipse.jface.action.IAction; import org.eclipse.jface.dialogs.Dialog;
import java.util.*; import net.dependableos.dcase.*; import net.dependableos.dcase.diagram.common.command.*; import net.dependableos.dcase.diagram.common.model.*; import net.dependableos.dcase.diagram.edit.parts.*; import net.dependableos.dcase.diagram.editor.common.util.*; import net.dependableos.dcase.diagram.editor.message.*; import org.eclipse.gmf.runtime.common.core.command.*; import org.eclipse.gmf.runtime.diagram.ui.commands.*; import org.eclipse.jface.action.*; import org.eclipse.jface.dialogs.*;
[ "java.util", "net.dependableos.dcase", "org.eclipse.gmf", "org.eclipse.jface" ]
java.util; net.dependableos.dcase; org.eclipse.gmf; org.eclipse.jface;
896,488
public RequestFuture<ClientResponse> sendMetadataRequest() { final Node node = client.leastLoadedNode(); return node == null ? null : client.send( node, ApiKeys.METADATA, new MetadataRequest(Collections.<String>emptyList())); }
RequestFuture<ClientResponse> function() { final Node node = client.leastLoadedNode(); return node == null ? null : client.send( node, ApiKeys.METADATA, new MetadataRequest(Collections.<String>emptyList())); }
/** * Send Metadata Request to least loaded node in Kafka cluster asynchronously * @return A future that indicates result of sent metadata request */
Send Metadata Request to least loaded node in Kafka cluster asynchronously
sendMetadataRequest
{ "repo_name": "vkroz/kafka", "path": "clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java", "license": "apache-2.0", "size": 31842 }
[ "java.util.Collections", "org.apache.kafka.clients.ClientResponse", "org.apache.kafka.common.Node", "org.apache.kafka.common.protocol.ApiKeys", "org.apache.kafka.common.requests.MetadataRequest" ]
import java.util.Collections; import org.apache.kafka.clients.ClientResponse; import org.apache.kafka.common.Node; import org.apache.kafka.common.protocol.ApiKeys; import org.apache.kafka.common.requests.MetadataRequest;
import java.util.*; import org.apache.kafka.clients.*; import org.apache.kafka.common.*; import org.apache.kafka.common.protocol.*; import org.apache.kafka.common.requests.*;
[ "java.util", "org.apache.kafka" ]
java.util; org.apache.kafka;
2,818,539
public final static double[] toJavaDoubleArray(Object array) { Object[] objArray = ((List<?>) array).toArray(); double[] result = new double[objArray.length]; for (int i = 0; i < objArray.length; i++) { if (objArray[i] instanceof Number) { result[i] = ((Number) objArray[i]).doubleValue(); } else { result[i] = 0; } } return result; }
final static double[] function(Object array) { Object[] objArray = ((List<?>) array).toArray(); double[] result = new double[objArray.length]; for (int i = 0; i < objArray.length; i++) { if (objArray[i] instanceof Number) { result[i] = ((Number) objArray[i]).doubleValue(); } else { result[i] = 0; } } return result; }
/** * Convert JavaScript array to Java double array. * * @param jsArray * JavaScript array * @return java array. */
Convert JavaScript array to Java double array
toJavaDoubleArray
{ "repo_name": "fqqb/yamcs-studio", "path": "bundles/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/DataUtil.java", "license": "epl-1.0", "size": 3518 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
633,105
public static void updateWidget(Context context, AppWidgetManager manager, Song song, int state) { if (!sEnabled) return; SharedPreferences settings = PlaybackService.getSettings(context); boolean doubleTap = settings.getBoolean(PrefKeys.DOUBLE_TAP, false); RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.one_cell_widget); boolean playing = (state & PlaybackService.FLAG_PLAYING) != 0; views.setImageViewResource(R.id.play_pause, playing ? R.drawable.hidden_pause : R.drawable.hidden_play); ComponentName service = new ComponentName(context, PlaybackService.class); Intent playPause = new Intent(doubleTap ? PlaybackService.ACTION_TOGGLE_PLAYBACK_DELAYED : PlaybackService.ACTION_TOGGLE_PLAYBACK); playPause.setComponent(service); views.setOnClickPendingIntent(R.id.play_pause, PendingIntent.getService(context, 0, playPause, 0)); Intent next = new Intent(doubleTap ? PlaybackService.ACTION_NEXT_SONG_DELAYED : PlaybackService.ACTION_NEXT_SONG); next.setComponent(service); views.setOnClickPendingIntent(R.id.next, PendingIntent.getService(context, 0, next, 0)); Bitmap cover = null; if ((state & PlaybackService.FLAG_NO_MEDIA) != 0) { views.setInt(R.id.title, "setText", R.string.no_songs); } else if (song == null) { views.setInt(R.id.title, "setText", R.string.app_name); } else { views.setTextViewText(R.id.title, song.title); cover = song.getCover(context); } if (cover == null) { views.setImageViewResource(R.id.cover, R.drawable.fallback_cover); } else { views.setImageViewBitmap(R.id.cover, cover); } manager.updateAppWidget(new ComponentName(context, OneCellWidget.class), views); }
static void function(Context context, AppWidgetManager manager, Song song, int state) { if (!sEnabled) return; SharedPreferences settings = PlaybackService.getSettings(context); boolean doubleTap = settings.getBoolean(PrefKeys.DOUBLE_TAP, false); RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.one_cell_widget); boolean playing = (state & PlaybackService.FLAG_PLAYING) != 0; views.setImageViewResource(R.id.play_pause, playing ? R.drawable.hidden_pause : R.drawable.hidden_play); ComponentName service = new ComponentName(context, PlaybackService.class); Intent playPause = new Intent(doubleTap ? PlaybackService.ACTION_TOGGLE_PLAYBACK_DELAYED : PlaybackService.ACTION_TOGGLE_PLAYBACK); playPause.setComponent(service); views.setOnClickPendingIntent(R.id.play_pause, PendingIntent.getService(context, 0, playPause, 0)); Intent next = new Intent(doubleTap ? PlaybackService.ACTION_NEXT_SONG_DELAYED : PlaybackService.ACTION_NEXT_SONG); next.setComponent(service); views.setOnClickPendingIntent(R.id.next, PendingIntent.getService(context, 0, next, 0)); Bitmap cover = null; if ((state & PlaybackService.FLAG_NO_MEDIA) != 0) { views.setInt(R.id.title, STR, R.string.no_songs); } else if (song == null) { views.setInt(R.id.title, STR, R.string.app_name); } else { views.setTextViewText(R.id.title, song.title); cover = song.getCover(context); } if (cover == null) { views.setImageViewResource(R.id.cover, R.drawable.fallback_cover); } else { views.setImageViewBitmap(R.id.cover, cover); } manager.updateAppWidget(new ComponentName(context, OneCellWidget.class), views); }
/** * Populate the widgets with the given ids with the given info. * * @param context A Context to use. * @param manager The AppWidgetManager that will be used to update the * widget. * @param song The current Song in PlaybackService. * @param state The current PlaybackService state. */
Populate the widgets with the given ids with the given info
updateWidget
{ "repo_name": "NachiketNamjoshi/titan-source", "path": "src/com/nachiket/titan/OneCellWidget.java", "license": "gpl-2.0", "size": 4460 }
[ "android.app.PendingIntent", "android.appwidget.AppWidgetManager", "android.content.ComponentName", "android.content.Context", "android.content.Intent", "android.content.SharedPreferences", "android.graphics.Bitmap", "android.widget.RemoteViews" ]
import android.app.PendingIntent; import android.appwidget.AppWidgetManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Bitmap; import android.widget.RemoteViews;
import android.app.*; import android.appwidget.*; import android.content.*; import android.graphics.*; import android.widget.*;
[ "android.app", "android.appwidget", "android.content", "android.graphics", "android.widget" ]
android.app; android.appwidget; android.content; android.graphics; android.widget;
2,379,590
private static Set<ResourceBundle> groupFilesIntoBundles(Set<File> files, Pattern baseNameRegexp) { final Set<ResourceBundle> resourceBundles = new HashSet<>(); for (File currentFile : files) { final String fileName = currentFile.getName(); final String baseName = extractBaseName(fileName); final Matcher baseNameMatcher = baseNameRegexp.matcher(baseName); if (baseNameMatcher.matches()) { final String extension = CommonUtils.getFileExtension(fileName); final String path = getPath(currentFile.getAbsolutePath()); final ResourceBundle newBundle = new ResourceBundle(baseName, path, extension); final Optional<ResourceBundle> bundle = findBundle(resourceBundles, newBundle); if (bundle.isPresent()) { bundle.get().addFile(currentFile); } else { newBundle.addFile(currentFile); resourceBundles.add(newBundle); } } } return resourceBundles; }
static Set<ResourceBundle> function(Set<File> files, Pattern baseNameRegexp) { final Set<ResourceBundle> resourceBundles = new HashSet<>(); for (File currentFile : files) { final String fileName = currentFile.getName(); final String baseName = extractBaseName(fileName); final Matcher baseNameMatcher = baseNameRegexp.matcher(baseName); if (baseNameMatcher.matches()) { final String extension = CommonUtils.getFileExtension(fileName); final String path = getPath(currentFile.getAbsolutePath()); final ResourceBundle newBundle = new ResourceBundle(baseName, path, extension); final Optional<ResourceBundle> bundle = findBundle(resourceBundles, newBundle); if (bundle.isPresent()) { bundle.get().addFile(currentFile); } else { newBundle.addFile(currentFile); resourceBundles.add(newBundle); } } } return resourceBundles; }
/** * Groups a set of files into bundles. * Only files, which names match base name regexp pattern will be grouped. * @param files set of files. * @param baseNameRegexp base name regexp pattern. * @return set of ResourceBundles. */
Groups a set of files into bundles. Only files, which names match base name regexp pattern will be grouped
groupFilesIntoBundles
{ "repo_name": "sabaka/checkstyle", "path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheck.java", "license": "lgpl-2.1", "size": 24408 }
[ "com.puppycrawl.tools.checkstyle.utils.CommonUtils", "java.io.File", "java.util.HashSet", "java.util.Optional", "java.util.Set", "java.util.regex.Matcher", "java.util.regex.Pattern" ]
import com.puppycrawl.tools.checkstyle.utils.CommonUtils; import java.io.File; import java.util.HashSet; import java.util.Optional; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern;
import com.puppycrawl.tools.checkstyle.utils.*; import java.io.*; import java.util.*; import java.util.regex.*;
[ "com.puppycrawl.tools", "java.io", "java.util" ]
com.puppycrawl.tools; java.io; java.util;
175,810
@Test(expectedExceptions = { IndexOutOfBoundsException.class }) public void testInsertCharacterArrayPortionLengthLargerThanArray() throws Exception { ByteStringBuffer buffer = new ByteStringBuffer(); buffer.insert(0, new char[0], 0, 1); }
@Test(expectedExceptions = { IndexOutOfBoundsException.class }) void function() throws Exception { ByteStringBuffer buffer = new ByteStringBuffer(); buffer.insert(0, new char[0], 0, 1); }
/** * Provides test coverage for the {@code insert} method variant that takes a * portion of a character array with length that is longer than the array. * * @throws Exception If an unexpected problem occurs. */
Provides test coverage for the insert method variant that takes a portion of a character array with length that is longer than the array
testInsertCharacterArrayPortionLengthLargerThanArray
{ "repo_name": "UnboundID/ldapsdk", "path": "tests/unit/src/com/unboundid/util/ByteStringBufferTestCase.java", "license": "gpl-2.0", "size": 141047 }
[ "org.testng.annotations.Test" ]
import org.testng.annotations.Test;
import org.testng.annotations.*;
[ "org.testng.annotations" ]
org.testng.annotations;
2,813,194
public ServiceFuture<Void> deleteAsync(String resourceGroupName, String expressRoutePortName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, expressRoutePortName), serviceCallback); }
ServiceFuture<Void> function(String resourceGroupName, String expressRoutePortName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, expressRoutePortName), serviceCallback); }
/** * Deletes the specified ExpressRoutePort resource. * * @param resourceGroupName The name of the resource group. * @param expressRoutePortName The name of the ExpressRoutePort resource. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
Deletes the specified ExpressRoutePort resource
deleteAsync
{ "repo_name": "navalev/azure-sdk-for-java", "path": "sdk/network/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/network/v2019_09_01/implementation/ExpressRoutePortsInner.java", "license": "mit", "size": 66205 }
[ "com.microsoft.rest.ServiceCallback", "com.microsoft.rest.ServiceFuture" ]
import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
1,732,618
public static CompressedSizeInfoColGroup addConstGroup(int[] columns, CompressedSizeInfoColGroup oneSide, Set<CompressionType> validCompressionTypes) { EstimationFactors fact = new EstimationFactors(columns.length, oneSide._facts); CompressedSizeInfoColGroup ret = new CompressedSizeInfoColGroup(columns, fact, validCompressionTypes, oneSide._map); return ret; }
static CompressedSizeInfoColGroup function(int[] columns, CompressedSizeInfoColGroup oneSide, Set<CompressionType> validCompressionTypes) { EstimationFactors fact = new EstimationFactors(columns.length, oneSide._facts); CompressedSizeInfoColGroup ret = new CompressedSizeInfoColGroup(columns, fact, validCompressionTypes, oneSide._map); return ret; }
/** * This method adds a column group without having to analyze. This is because the columns added are constant groups. * * NOTE THIS IS ONLY VALID IF THE COLUMN ADDED IS EMPTY OR CONSTANT! * * @param columns The columns of the colgroups together * @param oneSide One of the sides, this may contain something, but the other side (not part of the * argument) should not. * @param validCompressionTypes The List of valid compression techniques to use * @return A Combined estimate of the column group. */
This method adds a column group without having to analyze. This is because the columns added are constant groups. NOTE THIS IS ONLY VALID IF THE COLUMN ADDED IS EMPTY OR CONSTANT
addConstGroup
{ "repo_name": "apache/incubator-systemml", "path": "src/main/java/org/apache/sysds/runtime/compress/estim/CompressedSizeInfoColGroup.java", "license": "apache-2.0", "size": 10331 }
[ "java.util.Set", "org.apache.sysds.runtime.compress.colgroup.AColGroup" ]
import java.util.Set; import org.apache.sysds.runtime.compress.colgroup.AColGroup;
import java.util.*; import org.apache.sysds.runtime.compress.colgroup.*;
[ "java.util", "org.apache.sysds" ]
java.util; org.apache.sysds;
2,334,663
public List<String> process() throws IOException, OpenXML4JException, ParserConfigurationException, SAXException { ReadOnlySharedStringsTable strings = new ReadOnlySharedStringsTable(this.xlsxPackage); XSSFReader xssfReader = new XSSFReader(this.xlsxPackage); StylesTable styles = xssfReader.getStylesTable(); XSSFReader.SheetIterator iter = (XSSFReader.SheetIterator) xssfReader.getSheetsData(); int index = 0; while (iter.hasNext()) { if(blankRowNum == 10)break; InputStream stream = iter.next(); String sheetName = iter.getSheetName(); results.add(ExcelValidator.SHEET_NAME_PREFIX + sheetName); processSheet(styles, strings, new SheetToCSV(), stream); stream.close(); ++index; } return results; }
List<String> function() throws IOException, OpenXML4JException, ParserConfigurationException, SAXException { ReadOnlySharedStringsTable strings = new ReadOnlySharedStringsTable(this.xlsxPackage); XSSFReader xssfReader = new XSSFReader(this.xlsxPackage); StylesTable styles = xssfReader.getStylesTable(); XSSFReader.SheetIterator iter = (XSSFReader.SheetIterator) xssfReader.getSheetsData(); int index = 0; while (iter.hasNext()) { if(blankRowNum == 10)break; InputStream stream = iter.next(); String sheetName = iter.getSheetName(); results.add(ExcelValidator.SHEET_NAME_PREFIX + sheetName); processSheet(styles, strings, new SheetToCSV(), stream); stream.close(); ++index; } return results; }
/** * Initiates the processing of the XLS workbook file to CSV. * * @throws IOException * @throws OpenXML4JException * @throws ParserConfigurationException * @throws SAXException */
Initiates the processing of the XLS workbook file to CSV
process
{ "repo_name": "vakinge/jeesuite-libs", "path": "jeesuite-common2/src/main/java/com/jeesuite/common2/excel/convert/XLSX2CSV.java", "license": "apache-2.0", "size": 6906 }
[ "com.jeesuite.common2.excel.helper.ExcelValidator", "java.io.IOException", "java.io.InputStream", "java.util.List", "javax.xml.parsers.ParserConfigurationException", "org.apache.poi.openxml4j.exceptions.OpenXML4JException", "org.apache.poi.xssf.eventusermodel.ReadOnlySharedStringsTable", "org.apache.poi.xssf.eventusermodel.XSSFReader", "org.apache.poi.xssf.model.StylesTable", "org.xml.sax.SAXException" ]
import com.jeesuite.common2.excel.helper.ExcelValidator; import java.io.IOException; import java.io.InputStream; import java.util.List; import javax.xml.parsers.ParserConfigurationException; import org.apache.poi.openxml4j.exceptions.OpenXML4JException; import org.apache.poi.xssf.eventusermodel.ReadOnlySharedStringsTable; import org.apache.poi.xssf.eventusermodel.XSSFReader; import org.apache.poi.xssf.model.StylesTable; import org.xml.sax.SAXException;
import com.jeesuite.common2.excel.helper.*; import java.io.*; import java.util.*; import javax.xml.parsers.*; import org.apache.poi.openxml4j.exceptions.*; import org.apache.poi.xssf.eventusermodel.*; import org.apache.poi.xssf.model.*; import org.xml.sax.*;
[ "com.jeesuite.common2", "java.io", "java.util", "javax.xml", "org.apache.poi", "org.xml.sax" ]
com.jeesuite.common2; java.io; java.util; javax.xml; org.apache.poi; org.xml.sax;
2,147,987
private static void printMappedStatistics() throws Exception { System.out.format("Number of mmaps %d number of mmap memory %d%n", UnsafeMemoryHelper.getMappedSegments(), UnsafeMemoryHelper.getMappedBytes()); final boolean unmapperState = UnsafeMemoryHelper.isDirectMemoryUnmapperAvailable(); System.out.println("The memory mapped unmapper is available: " + unmapperState); }
static void function() throws Exception { System.out.format(STR, UnsafeMemoryHelper.getMappedSegments(), UnsafeMemoryHelper.getMappedBytes()); final boolean unmapperState = UnsafeMemoryHelper.isDirectMemoryUnmapperAvailable(); System.out.println(STR + unmapperState); }
/** * Print the memory mapped MBean data * * @param args * @throws Exception */
Print the memory mapped MBean data
printMappedStatistics
{ "repo_name": "jnidzwetzki/bboxdb", "path": "bboxdb-experiments/src/main/java/org/bboxdb/experiments/misc/MemoryMappedFiles.java", "license": "apache-2.0", "size": 6069 }
[ "org.bboxdb.commons.io.UnsafeMemoryHelper" ]
import org.bboxdb.commons.io.UnsafeMemoryHelper;
import org.bboxdb.commons.io.*;
[ "org.bboxdb.commons" ]
org.bboxdb.commons;
762,138
public CurrencyAmount presentValue(final SwaptionPhysicalFixedIbor swaption, final AnnuityPaymentFixed cfe, final HullWhiteOneFactorPiecewiseConstantDataBundle hwData) { Validate.notNull(swaption); Validate.notNull(hwData); double expiryTime = swaption.getTimeToExpiry(); double[] alpha = new double[cfe.getNumberOfPayments()]; double[] df = new double[cfe.getNumberOfPayments()]; double[] discountedCashFlow = new double[cfe.getNumberOfPayments()]; for (int loopcf = 0; loopcf < cfe.getNumberOfPayments(); loopcf++) { alpha[loopcf] = MODEL.alpha(hwData.getHullWhiteParameter(), 0.0, expiryTime, expiryTime, cfe.getNthPayment(loopcf).getPaymentTime()); df[loopcf] = hwData.getCurve(cfe.getDiscountCurve()).getDiscountFactor(cfe.getNthPayment(loopcf).getPaymentTime()); discountedCashFlow[loopcf] = df[loopcf] * cfe.getNthPayment(loopcf).getAmount(); } double kappa = MODEL.kappa(discountedCashFlow, alpha); double omega = (swaption.getUnderlyingSwap().getFixedLeg().isPayer() ? -1.0 : 1.0); double pv = 0.0; for (int loopcf = 0; loopcf < cfe.getNumberOfPayments(); loopcf++) { pv += discountedCashFlow[loopcf] * NORMAL.getCDF(omega * (kappa + alpha[loopcf])); } return CurrencyAmount.of(swaption.getUnderlyingSwap().getFirstLeg().getCurrency(), pv * (swaption.isLong() ? 1.0 : -1.0)); }
CurrencyAmount function(final SwaptionPhysicalFixedIbor swaption, final AnnuityPaymentFixed cfe, final HullWhiteOneFactorPiecewiseConstantDataBundle hwData) { Validate.notNull(swaption); Validate.notNull(hwData); double expiryTime = swaption.getTimeToExpiry(); double[] alpha = new double[cfe.getNumberOfPayments()]; double[] df = new double[cfe.getNumberOfPayments()]; double[] discountedCashFlow = new double[cfe.getNumberOfPayments()]; for (int loopcf = 0; loopcf < cfe.getNumberOfPayments(); loopcf++) { alpha[loopcf] = MODEL.alpha(hwData.getHullWhiteParameter(), 0.0, expiryTime, expiryTime, cfe.getNthPayment(loopcf).getPaymentTime()); df[loopcf] = hwData.getCurve(cfe.getDiscountCurve()).getDiscountFactor(cfe.getNthPayment(loopcf).getPaymentTime()); discountedCashFlow[loopcf] = df[loopcf] * cfe.getNthPayment(loopcf).getAmount(); } double kappa = MODEL.kappa(discountedCashFlow, alpha); double omega = (swaption.getUnderlyingSwap().getFixedLeg().isPayer() ? -1.0 : 1.0); double pv = 0.0; for (int loopcf = 0; loopcf < cfe.getNumberOfPayments(); loopcf++) { pv += discountedCashFlow[loopcf] * NORMAL.getCDF(omega * (kappa + alpha[loopcf])); } return CurrencyAmount.of(swaption.getUnderlyingSwap().getFirstLeg().getCurrency(), pv * (swaption.isLong() ? 1.0 : -1.0)); }
/** * Computes the present value of the Physical delivery swaption. * @param swaption The swaption. * @param cfe The swaption cash flow equivalent. * @param hwData The Hull-White parameters and the curves. * @return The present value. */
Computes the present value of the Physical delivery swaption
presentValue
{ "repo_name": "charles-cooper/idylfin", "path": "src/com/opengamma/analytics/financial/interestrate/swaption/method/SwaptionPhysicalFixedIborHullWhiteMethod.java", "license": "apache-2.0", "size": 11053 }
[ "com.opengamma.analytics.financial.interestrate.annuity.derivative.AnnuityPaymentFixed", "com.opengamma.analytics.financial.interestrate.swaption.derivative.SwaptionPhysicalFixedIbor", "com.opengamma.analytics.financial.model.interestrate.definition.HullWhiteOneFactorPiecewiseConstantDataBundle", "com.opengamma.util.money.CurrencyAmount", "org.apache.commons.lang.Validate" ]
import com.opengamma.analytics.financial.interestrate.annuity.derivative.AnnuityPaymentFixed; import com.opengamma.analytics.financial.interestrate.swaption.derivative.SwaptionPhysicalFixedIbor; import com.opengamma.analytics.financial.model.interestrate.definition.HullWhiteOneFactorPiecewiseConstantDataBundle; import com.opengamma.util.money.CurrencyAmount; import org.apache.commons.lang.Validate;
import com.opengamma.analytics.financial.interestrate.annuity.derivative.*; import com.opengamma.analytics.financial.interestrate.swaption.derivative.*; import com.opengamma.analytics.financial.model.interestrate.definition.*; import com.opengamma.util.money.*; import org.apache.commons.lang.*;
[ "com.opengamma.analytics", "com.opengamma.util", "org.apache.commons" ]
com.opengamma.analytics; com.opengamma.util; org.apache.commons;
1,976,451
private byte[] pbkdf2(char[] password, byte[] salt) { try { PBEKeySpec spec = new PBEKeySpec(password, salt, PBKDF2_ITERATIONS, HASH_BYTE_SIZE * 8); SecretKeyFactory skf = SecretKeyFactory.getInstance(PBKDF2_ALGORITHM); return skf.generateSecret(spec).getEncoded(); } catch (NoSuchAlgorithmException e) { throw SeedException.wrap(e, CryptoErrorCodes.UNEXPECTED_EXCEPTION); } catch (InvalidKeySpecException e) { throw SeedException.wrap(e, CryptoErrorCodes.UNEXPECTED_EXCEPTION); } }
byte[] function(char[] password, byte[] salt) { try { PBEKeySpec spec = new PBEKeySpec(password, salt, PBKDF2_ITERATIONS, HASH_BYTE_SIZE * 8); SecretKeyFactory skf = SecretKeyFactory.getInstance(PBKDF2_ALGORITHM); return skf.generateSecret(spec).getEncoded(); } catch (NoSuchAlgorithmException e) { throw SeedException.wrap(e, CryptoErrorCodes.UNEXPECTED_EXCEPTION); } catch (InvalidKeySpecException e) { throw SeedException.wrap(e, CryptoErrorCodes.UNEXPECTED_EXCEPTION); } }
/** * Computes the PBKDF2 hash of a password. * * @param password the password to hash. * @param salt the salt * @return the PBDKF2 hash of the password */
Computes the PBKDF2 hash of a password
pbkdf2
{ "repo_name": "kavi87/seed", "path": "crypto/src/main/java/org/seedstack/seed/crypto/internal/PBKDF2HashingService.java", "license": "mpl-2.0", "size": 2765 }
[ "java.security.NoSuchAlgorithmException", "java.security.spec.InvalidKeySpecException", "javax.crypto.SecretKeyFactory", "javax.crypto.spec.PBEKeySpec", "org.seedstack.seed.SeedException" ]
import java.security.NoSuchAlgorithmException; import java.security.spec.InvalidKeySpecException; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; import org.seedstack.seed.SeedException;
import java.security.*; import java.security.spec.*; import javax.crypto.*; import javax.crypto.spec.*; import org.seedstack.seed.*;
[ "java.security", "javax.crypto", "org.seedstack.seed" ]
java.security; javax.crypto; org.seedstack.seed;
960,173
public List nextRow() throws TeiidComponentException, TeiidProcessingException;
List function() throws TeiidComponentException, TeiidProcessingException;
/** * Advance the resultset cursor to next row and retun the row values * @return values of the row */
Advance the resultset cursor to next row and retun the row values
nextRow
{ "repo_name": "jagazee/teiid-8.7", "path": "engine/src/main/java/org/teiid/query/processor/xml/PlanExecutor.java", "license": "lgpl-2.1", "size": 2378 }
[ "java.util.List", "org.teiid.core.TeiidComponentException", "org.teiid.core.TeiidProcessingException" ]
import java.util.List; import org.teiid.core.TeiidComponentException; import org.teiid.core.TeiidProcessingException;
import java.util.*; import org.teiid.core.*;
[ "java.util", "org.teiid.core" ]
java.util; org.teiid.core;
959,352
private void updateEndpoints(APIProduct product, Map<String, String> hostsWithSchemes, OpenAPI openAPI) { String basePath = product.getContext(); String transports = product.getTransports(); updateEndpoints(openAPI, basePath, transports, hostsWithSchemes); }
void function(APIProduct product, Map<String, String> hostsWithSchemes, OpenAPI openAPI) { String basePath = product.getContext(); String transports = product.getTransports(); updateEndpoints(openAPI, basePath, transports, hostsWithSchemes); }
/** * Update OAS definition with GW endpoints * * @param product APIProduct * @param hostsWithSchemes GW hosts with protocol mapping * @param openAPI OpenAPI */
Update OAS definition with GW endpoints
updateEndpoints
{ "repo_name": "nuwand/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OAS3Parser.java", "license": "apache-2.0", "size": 75509 }
[ "io.swagger.v3.oas.models.OpenAPI", "java.util.Map", "org.wso2.carbon.apimgt.api.model.APIProduct" ]
import io.swagger.v3.oas.models.OpenAPI; import java.util.Map; import org.wso2.carbon.apimgt.api.model.APIProduct;
import io.swagger.v3.oas.models.*; import java.util.*; import org.wso2.carbon.apimgt.api.model.*;
[ "io.swagger.v3", "java.util", "org.wso2.carbon" ]
io.swagger.v3; java.util; org.wso2.carbon;
2,570,733
private List<String> generateNoiseCandidates(String sparqlQuery, NoiseMethod noiseMethod, List<String> examples, int limit) { List<String> noiseCandidates = new ArrayList<>(); switch(noiseMethod) { case RANDOM: noiseCandidates = generateNoiseCandidatesRandom(examples, limit); break; case SIMILAR:noiseCandidates = generateNoiseCandidatesSimilar(examples, sparqlQuery, limit); break; case SIMILARITY_PARAMETERIZED://TODO implement configurable noise method break; default:noiseCandidates = generateNoiseCandidatesRandom(examples, limit); break; } return noiseCandidates; }
List<String> function(String sparqlQuery, NoiseMethod noiseMethod, List<String> examples, int limit) { List<String> noiseCandidates = new ArrayList<>(); switch(noiseMethod) { case RANDOM: noiseCandidates = generateNoiseCandidatesRandom(examples, limit); break; case SIMILAR:noiseCandidates = generateNoiseCandidatesSimilar(examples, sparqlQuery, limit); break; case SIMILARITY_PARAMETERIZED: break; default:noiseCandidates = generateNoiseCandidatesRandom(examples, limit); break; } return noiseCandidates; }
/** * Generates a list of candidates that are not contained in the given set of examples. * @param sparqlQuery * @param posExamples * @param negExamples * @return */
Generates a list of candidates that are not contained in the given set of examples
generateNoiseCandidates
{ "repo_name": "xlcupid/DL-Learner", "path": "components-core/src/test/java/org/dllearner/algorithms/qtl/experiments/QTLEvaluation.java", "license": "gpl-3.0", "size": 87819 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,353,255
public java.math.BigDecimal getPrivatedisabilityamount() { return this.privatedisabilityamount; }
java.math.BigDecimal function() { return this.privatedisabilityamount; }
/** * Return the value associated with the column: privatedisabilityamount. * @return A java.math.BigDecimal object (this.privatedisabilityamount) */
Return the value associated with the column: privatedisabilityamount
getPrivatedisabilityamount
{ "repo_name": "servinglynk/hmis-lynk-open-source", "path": "hmis-model-v2015/src/main/java/com/servinglynk/hmis/warehouse/model/v2015/Incomeandsources.java", "license": "mpl-2.0", "size": 42167 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
1,256,983
@Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(SetType.class)) { case LanguagePackage.SET_TYPE__ALT: case LanguagePackage.SET_TYPE__BEGIN: case LanguagePackage.SET_TYPE__CLASS: case LanguagePackage.SET_TYPE__DUR: case LanguagePackage.SET_TYPE__END: case LanguagePackage.SET_TYPE__FILL: case LanguagePackage.SET_TYPE__FILL_DEFAULT: case LanguagePackage.SET_TYPE__ID: case LanguagePackage.SET_TYPE__LANG: case LanguagePackage.SET_TYPE__LONGDESC: case LanguagePackage.SET_TYPE__MAX: case LanguagePackage.SET_TYPE__MIN: case LanguagePackage.SET_TYPE__REPEAT: case LanguagePackage.SET_TYPE__REPEAT_COUNT: case LanguagePackage.SET_TYPE__REPEAT_DUR: case LanguagePackage.SET_TYPE__RESTART: case LanguagePackage.SET_TYPE__RESTART_DEFAULT: case LanguagePackage.SET_TYPE__SKIP_CONTENT: case LanguagePackage.SET_TYPE__SYNC_BEHAVIOR: case LanguagePackage.SET_TYPE__SYNC_BEHAVIOR_DEFAULT: case LanguagePackage.SET_TYPE__SYNC_TOLERANCE: case LanguagePackage.SET_TYPE__SYNC_TOLERANCE_DEFAULT: case LanguagePackage.SET_TYPE__TARGET_ELEMENT: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case LanguagePackage.SET_TYPE__GROUP: case LanguagePackage.SET_TYPE__ANY_ATTRIBUTE: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); }
void function(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(SetType.class)) { case LanguagePackage.SET_TYPE__ALT: case LanguagePackage.SET_TYPE__BEGIN: case LanguagePackage.SET_TYPE__CLASS: case LanguagePackage.SET_TYPE__DUR: case LanguagePackage.SET_TYPE__END: case LanguagePackage.SET_TYPE__FILL: case LanguagePackage.SET_TYPE__FILL_DEFAULT: case LanguagePackage.SET_TYPE__ID: case LanguagePackage.SET_TYPE__LANG: case LanguagePackage.SET_TYPE__LONGDESC: case LanguagePackage.SET_TYPE__MAX: case LanguagePackage.SET_TYPE__MIN: case LanguagePackage.SET_TYPE__REPEAT: case LanguagePackage.SET_TYPE__REPEAT_COUNT: case LanguagePackage.SET_TYPE__REPEAT_DUR: case LanguagePackage.SET_TYPE__RESTART: case LanguagePackage.SET_TYPE__RESTART_DEFAULT: case LanguagePackage.SET_TYPE__SKIP_CONTENT: case LanguagePackage.SET_TYPE__SYNC_BEHAVIOR: case LanguagePackage.SET_TYPE__SYNC_BEHAVIOR_DEFAULT: case LanguagePackage.SET_TYPE__SYNC_TOLERANCE: case LanguagePackage.SET_TYPE__SYNC_TOLERANCE_DEFAULT: case LanguagePackage.SET_TYPE__TARGET_ELEMENT: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case LanguagePackage.SET_TYPE__GROUP: case LanguagePackage.SET_TYPE__ANY_ATTRIBUTE: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); }
/** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This handles model notifications by calling <code>#updateChildren</code> to update any cached children and by creating a viewer notification, which it passes to <code>#fireNotifyChanged</code>.
notifyChanged
{ "repo_name": "markus1978/citygml4emf", "path": "de.hub.citygml.emf.ecore.edit/src/org/w3/_2001/smil20/language/provider/SetTypeItemProvider.java", "license": "apache-2.0", "size": 255549 }
[ "org.eclipse.emf.common.notify.Notification", "org.eclipse.emf.edit.provider.ViewerNotification", "org.w3._2001.smil20.language.LanguagePackage", "org.w3._2001.smil20.language.SetType" ]
import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.ViewerNotification; import org.w3._2001.smil20.language.LanguagePackage; import org.w3._2001.smil20.language.SetType;
import org.eclipse.emf.common.notify.*; import org.eclipse.emf.edit.provider.*; import org.w3.*;
[ "org.eclipse.emf", "org.w3" ]
org.eclipse.emf; org.w3;
2,134,451
public IterableStream<ExtractSummaryActionResult> getExtractSummaryResults() { return extractSummaryResults; }
IterableStream<ExtractSummaryActionResult> function() { return extractSummaryResults; }
/** * Gets the {@code extractSummaryResults} property: the extractive summarization actions results property. * * @return the extractSummaryResults value. */
Gets the extractSummaryResults property: the extractive summarization actions results property
getExtractSummaryResults
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/AnalyzeActionsResult.java", "license": "mit", "size": 9531 }
[ "com.azure.core.util.IterableStream" ]
import com.azure.core.util.IterableStream;
import com.azure.core.util.*;
[ "com.azure.core" ]
com.azure.core;
2,773,325
public void setTimes(String src, long mtime, long atime) throws IOException { checkOpen(); try { namenode.setTimes(src, mtime, atime); } catch(RemoteException re) { throw re.unwrapRemoteException(AccessControlException.class, FileNotFoundException.class, UnresolvedPathException.class, SnapshotAccessControlException.class); } } @Deprecated public static class DFSDataInputStream extends HdfsDataInputStream { public DFSDataInputStream(DFSInputStream in) throws IOException { super(in); } }
void function(String src, long mtime, long atime) throws IOException { checkOpen(); try { namenode.setTimes(src, mtime, atime); } catch(RemoteException re) { throw re.unwrapRemoteException(AccessControlException.class, FileNotFoundException.class, UnresolvedPathException.class, SnapshotAccessControlException.class); } } public static class DFSDataInputStream extends HdfsDataInputStream { public DFSDataInputStream(DFSInputStream in) throws IOException { super(in); } }
/** * set the modification and access time of a file * * @see ClientProtocol#setTimes(String, long, long) */
set the modification and access time of a file
setTimes
{ "repo_name": "yelshater/hadoop-2.3.0", "path": "hadoop-hdfs-2.3.0-cdh5.1.0/src/main/java/org/apache/hadoop/hdfs/DFSClient.java", "license": "apache-2.0", "size": 108346 }
[ "java.io.FileNotFoundException", "java.io.IOException", "org.apache.hadoop.hdfs.client.HdfsDataInputStream", "org.apache.hadoop.hdfs.protocol.SnapshotAccessControlException", "org.apache.hadoop.hdfs.protocol.UnresolvedPathException", "org.apache.hadoop.ipc.RemoteException", "org.apache.hadoop.security.AccessControlException" ]
import java.io.FileNotFoundException; import java.io.IOException; import org.apache.hadoop.hdfs.client.HdfsDataInputStream; import org.apache.hadoop.hdfs.protocol.SnapshotAccessControlException; import org.apache.hadoop.hdfs.protocol.UnresolvedPathException; import org.apache.hadoop.ipc.RemoteException; import org.apache.hadoop.security.AccessControlException;
import java.io.*; import org.apache.hadoop.hdfs.client.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.ipc.*; import org.apache.hadoop.security.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
2,161,358
private void notifyUIRefreshComplete(boolean ignoreHook) { if (mPtrIndicator.hasLeftStartPosition() && !ignoreHook && mRefreshCompleteHook != null) { if (DEBUG) { PtrCLog.d(LOG_TAG, "notifyUIRefreshComplete mRefreshCompleteHook run."); } mRefreshCompleteHook.takeOver(); return; } if (mPtrUIHandlerHolder.hasHandler()) { if (DEBUG) { PtrCLog.i(LOG_TAG, "PtrUIHandler: onUIRefreshComplete"); } mPtrUIHandlerHolder.onUIRefreshComplete(this); } mPtrIndicator.onUIRefreshComplete(); tryScrollBackToTopAfterComplete(); tryToNotifyReset(); }
void function(boolean ignoreHook) { if (mPtrIndicator.hasLeftStartPosition() && !ignoreHook && mRefreshCompleteHook != null) { if (DEBUG) { PtrCLog.d(LOG_TAG, STR); } mRefreshCompleteHook.takeOver(); return; } if (mPtrUIHandlerHolder.hasHandler()) { if (DEBUG) { PtrCLog.i(LOG_TAG, STR); } mPtrUIHandlerHolder.onUIRefreshComplete(this); } mPtrIndicator.onUIRefreshComplete(); tryScrollBackToTopAfterComplete(); tryToNotifyReset(); }
/** * Do real refresh work. If there is a hook, execute the hook first. * * @param ignoreHook */
Do real refresh work. If there is a hook, execute the hook first
notifyUIRefreshComplete
{ "repo_name": "chenzj-king/RvHelper", "path": "library/src/main/java/com/dreamliner/ptrlib/PtrFrameLayout.java", "license": "apache-2.0", "size": 36809 }
[ "com.dreamliner.ptrlib.util.PtrCLog" ]
import com.dreamliner.ptrlib.util.PtrCLog;
import com.dreamliner.ptrlib.util.*;
[ "com.dreamliner.ptrlib" ]
com.dreamliner.ptrlib;
1,384,343
public PokerHandType determineHandType(FiveCardPokerHand hand) { if (hand.getNumberOfCards() != 5) { throw new IllegalArgumentException("The hand must have exactly five cards"); } List<Card> cards = hand.getCards(); Collections.sort(cards); // Check straight flush, flush and straight boolean isFlush = isFlush(cards); boolean isStraight = isStraight(cards); if (isFlush && isStraight) { return PokerHandType.STRAIGHT_FLUSH; } if (isFlush) { return PokerHandType.FLUSH; } if (isStraight) { return PokerHandType.STRAIGHT; } List<Integer> cardsOfSameRankList = cardsOfSameRankList(cards); // Four of a kind if (cardsOfSameRankList.get(0) == 4) { return PokerHandType.FOUR_OF_A_KIND; } // Full house and three of a kind if (cardsOfSameRankList.get(0) == 3) { if (cardsOfSameRankList.get(1) == 2) { return PokerHandType.FULL_HOUSE; } return PokerHandType.THREE_OF_A_KIND; } // Two pair and pair if (cardsOfSameRankList.get(0) == 2) { if (cardsOfSameRankList.get(1) == 2) { return PokerHandType.TWO_PAIR; } return PokerHandType.PAIR; } // If none of the above are true, the hand is a high card hand. return PokerHandType.HIGH_CARD; }
PokerHandType function(FiveCardPokerHand hand) { if (hand.getNumberOfCards() != 5) { throw new IllegalArgumentException(STR); } List<Card> cards = hand.getCards(); Collections.sort(cards); boolean isFlush = isFlush(cards); boolean isStraight = isStraight(cards); if (isFlush && isStraight) { return PokerHandType.STRAIGHT_FLUSH; } if (isFlush) { return PokerHandType.FLUSH; } if (isStraight) { return PokerHandType.STRAIGHT; } List<Integer> cardsOfSameRankList = cardsOfSameRankList(cards); if (cardsOfSameRankList.get(0) == 4) { return PokerHandType.FOUR_OF_A_KIND; } if (cardsOfSameRankList.get(0) == 3) { if (cardsOfSameRankList.get(1) == 2) { return PokerHandType.FULL_HOUSE; } return PokerHandType.THREE_OF_A_KIND; } if (cardsOfSameRankList.get(0) == 2) { if (cardsOfSameRankList.get(1) == 2) { return PokerHandType.TWO_PAIR; } return PokerHandType.PAIR; } return PokerHandType.HIGH_CARD; }
/** * Determines the hand type of a five card poker hand. * * All hand types have a value representing their strength. A higher value * means a better hand, so using this method we can immediately determine * which of two hands is better if they aren't of the same type. * * @param hand FiveCardPokerHand * @return The type of the hand * @throws IllegalArgumentException if the hand doesn't have five cards in * it. */
Determines the hand type of a five card poker hand. All hand types have a value representing their strength. A higher value means a better hand, so using this method we can immediately determine which of two hands is better if they aren't of the same type
determineHandType
{ "repo_name": "ousou/Javalabra-2013", "path": "Poker hand simulator/src/poker/comparators/PokerHandTypeComparator.java", "license": "lgpl-3.0", "size": 7000 }
[ "java.util.Collections", "java.util.List" ]
import java.util.Collections; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
784,196
public String getCertFactoryType() throws IOException;
String function() throws IOException;
/** * Get the CertificateFactory type. * * @return CertificateFactory type or null. * @throws IOException if a connection problem occurs. * @see CertificateFactory#getInstance(java.lang.String) */
Get the CertificateFactory type
getCertFactoryType
{ "repo_name": "pfirmstone/JGDMS", "path": "JGDMS/jgdms-platform/src/main/java/net/jini/export/CodebaseAccessor.java", "license": "apache-2.0", "size": 3394 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
886,279
public static void addHAConfiguration(Configuration conf, final String logicalName) { String nsIds = conf.get(DFSConfigKeys.DFS_NAMESERVICES); if (nsIds == null) { conf.set(DFSConfigKeys.DFS_NAMESERVICES, logicalName); } else { // append the nsid conf.set(DFSConfigKeys.DFS_NAMESERVICES, nsIds + "," + logicalName); } conf.set(DFSUtil.addKeySuffixes(HdfsClientConfigKeys.DFS_HA_NAMENODES_KEY_PREFIX, logicalName), "nn1,nn2"); conf.set(HdfsClientConfigKeys.Failover.PROXY_PROVIDER_KEY_PREFIX + "." + logicalName, ConfiguredFailoverProxyProvider.class.getName()); conf.setInt(DFSConfigKeys.DFS_REPLICATION_KEY, 1); }
static void function(Configuration conf, final String logicalName) { String nsIds = conf.get(DFSConfigKeys.DFS_NAMESERVICES); if (nsIds == null) { conf.set(DFSConfigKeys.DFS_NAMESERVICES, logicalName); } else { conf.set(DFSConfigKeys.DFS_NAMESERVICES, nsIds + "," + logicalName); } conf.set(DFSUtil.addKeySuffixes(HdfsClientConfigKeys.DFS_HA_NAMENODES_KEY_PREFIX, logicalName), STR); conf.set(HdfsClientConfigKeys.Failover.PROXY_PROVIDER_KEY_PREFIX + "." + logicalName, ConfiguredFailoverProxyProvider.class.getName()); conf.setInt(DFSConfigKeys.DFS_REPLICATION_KEY, 1); }
/** * Add a new HA configuration. */
Add a new HA configuration
addHAConfiguration
{ "repo_name": "xujianhai/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java", "license": "apache-2.0", "size": 67452 }
[ "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.hdfs.client.HdfsClientConfigKeys", "org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider" ]
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hdfs.client.HdfsClientConfigKeys; import org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider;
import org.apache.hadoop.conf.*; import org.apache.hadoop.hdfs.client.*; import org.apache.hadoop.hdfs.server.namenode.ha.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,639,563
PermissionDelegate addPermission(int requestCode, @StringRes int rationaleTextId, String... permissions);
PermissionDelegate addPermission(int requestCode, @StringRes int rationaleTextId, String... permissions);
/** * helper method to collect all permissions required that the #ensurePermissions() should check * * @param requestCode * the permission request code * @param rationaleTextId * the text id of the rationale to show * @param permissions * the required permission * @return the delegate itself for chaining multiple permissions together */
helper method to collect all permissions required that the #ensurePermissions() should check
addPermission
{ "repo_name": "tuxbox/sniggle-android-utils", "path": "utils/src/main/java/me/sniggle/android/utils/permission/PermissionDelegate.java", "license": "bsd-3-clause", "size": 965 }
[ "android.support.annotation.StringRes" ]
import android.support.annotation.StringRes;
import android.support.annotation.*;
[ "android.support" ]
android.support;
144,413
public ValueAxis getRangeAxis() { return this.rangeAxis; }
ValueAxis function() { return this.rangeAxis; }
/** * Returns the range axis for the plot. * * @return The range axis (never <code>null</code>). * * @see #setRangeAxis(ValueAxis) */
Returns the range axis for the plot
getRangeAxis
{ "repo_name": "martingwhite/astor", "path": "examples/chart_11/source/org/jfree/chart/plot/FastScatterPlot.java", "license": "gpl-2.0", "size": 34448 }
[ "org.jfree.chart.axis.ValueAxis" ]
import org.jfree.chart.axis.ValueAxis;
import org.jfree.chart.axis.*;
[ "org.jfree.chart" ]
org.jfree.chart;
829,923
public void setDefaultSortColumn(@Nullable String sort) { if(null == sort) { m_sortColumn = null; } else { for(final ColumnDef< T, ? > scd : m_columnList) { if(DomUtil.isEqual(scd.getPropertyName(), sort)) { SortableType sortable = scd.getSortable(); if(sortable == SortableType.SORTABLE_ASC) { // Is the default? if(m_metaModel.getDefaultSortDirection() == SortableType.SORTABLE_DESC) sortable = SortableType.SORTABLE_DESC; } setSortColumn(scd, sortable); break; } } } }
void function(@Nullable String sort) { if(null == sort) { m_sortColumn = null; } else { for(final ColumnDef< T, ? > scd : m_columnList) { if(DomUtil.isEqual(scd.getPropertyName(), sort)) { SortableType sortable = scd.getSortable(); if(sortable == SortableType.SORTABLE_ASC) { if(m_metaModel.getDefaultSortDirection() == SortableType.SORTABLE_DESC) sortable = SortableType.SORTABLE_DESC; } setSortColumn(scd, sortable); break; } } } }
/** * Set the default sort column by property name. If it is null the default sort is undone. * @param sort */
Set the default sort column by property name. If it is null the default sort is undone
setDefaultSortColumn
{ "repo_name": "fjalvingh/domui", "path": "to.etc.domui/src/main/java/to/etc/domui/component/tbl/ColumnList.java", "license": "lgpl-2.1", "size": 9951 }
[ "org.eclipse.jdt.annotation.Nullable", "to.etc.domui.component.meta.SortableType", "to.etc.domui.util.DomUtil" ]
import org.eclipse.jdt.annotation.Nullable; import to.etc.domui.component.meta.SortableType; import to.etc.domui.util.DomUtil;
import org.eclipse.jdt.annotation.*; import to.etc.domui.component.meta.*; import to.etc.domui.util.*;
[ "org.eclipse.jdt", "to.etc.domui" ]
org.eclipse.jdt; to.etc.domui;
2,858,732
public static void deleteCapturePattern(SemGui semGui) { int positions[] = semGui.getCapturePatternTable().getSelectedRows(); boolean confirm = false; if (positions.length > 1) { confirm = GuiUtils.showConfirmDialog("Sei sicuro di voler cancellare tutte le righe selezionate?", "Confermi cancellazione?"); } for (int i = 0; i < positions.length; i++) { int position = semGui.getCapturePatternTable().convertRowIndexToModel(positions[i] - i); String id = (String) semGui.getCapturePatternTable().getValueAt(position, 0); if (id.length() > 0) { if (!confirm) { confirm = GuiUtils.showConfirmDialog("Sei sicuro di voler cancellare la cattura selezionata?", "Confermi cancellazione?"); } if (confirm) { CaptureTreeNode node = (CaptureTreeNode) semGui.getModelEditor().getCurrentNode(); if (node != null) { node.removePattern(id); populateCaptureSplit(node, semGui); } } } } }
static void function(SemGui semGui) { int positions[] = semGui.getCapturePatternTable().getSelectedRows(); boolean confirm = false; if (positions.length > 1) { confirm = GuiUtils.showConfirmDialog(STR, STR); } for (int i = 0; i < positions.length; i++) { int position = semGui.getCapturePatternTable().convertRowIndexToModel(positions[i] - i); String id = (String) semGui.getCapturePatternTable().getValueAt(position, 0); if (id.length() > 0) { if (!confirm) { confirm = GuiUtils.showConfirmDialog(STR, STR); } if (confirm) { CaptureTreeNode node = (CaptureTreeNode) semGui.getModelEditor().getCurrentNode(); if (node != null) { node.removePattern(id); populateCaptureSplit(node, semGui); } } } } }
/** * Gestisce la cancellazione del pattern * * @param semGui frame */
Gestisce la cancellazione del pattern
deleteCapturePattern
{ "repo_name": "fiohol/theSemProject", "path": "openSem/src/main/java/org/thesemproject/opensem/gui/utils/CapturesUtils.java", "license": "apache-2.0", "size": 13645 }
[ "org.thesemproject.opensem.gui.SemGui", "org.thesemproject.opensem.gui.modelEditor.CaptureTreeNode" ]
import org.thesemproject.opensem.gui.SemGui; import org.thesemproject.opensem.gui.modelEditor.CaptureTreeNode;
import org.thesemproject.opensem.gui.*;
[ "org.thesemproject.opensem" ]
org.thesemproject.opensem;
1,259,945
@Retained EntryEventImpl createListenerEvent(EntryEventImpl sourceEvent, PartitionedRegion r, InternalDistributedMember member) { final EntryEventImpl e2; if (this.notificationOnly && this.bridgeContext == null) { e2 = sourceEvent; } else { e2 = new EntryEventImpl(sourceEvent); if (this.bridgeContext != null) { e2.setContext(this.bridgeContext); } } e2.setRegion(r); e2.setOriginRemote(true); e2.setInvokePRCallbacks(!notificationOnly); if (!sourceEvent.hasOldValue()) { e2.oldValueNotAvailable(); } if (this.filterInfo != null) { e2.setLocalFilterInfo(this.filterInfo.getFilterInfo(member)); } if (this.versionTag != null) { this.versionTag.replaceNullIDs(getSender()); e2.setVersionTag(this.versionTag); } return e2; }
EntryEventImpl createListenerEvent(EntryEventImpl sourceEvent, PartitionedRegion r, InternalDistributedMember member) { final EntryEventImpl e2; if (this.notificationOnly && this.bridgeContext == null) { e2 = sourceEvent; } else { e2 = new EntryEventImpl(sourceEvent); if (this.bridgeContext != null) { e2.setContext(this.bridgeContext); } } e2.setRegion(r); e2.setOriginRemote(true); e2.setInvokePRCallbacks(!notificationOnly); if (!sourceEvent.hasOldValue()) { e2.oldValueNotAvailable(); } if (this.filterInfo != null) { e2.setLocalFilterInfo(this.filterInfo.getFilterInfo(member)); } if (this.versionTag != null) { this.versionTag.replaceNullIDs(getSender()); e2.setVersionTag(this.versionTag); } return e2; }
/** * create a new EntryEvent to be used in notifying listeners, bridge servers, etc. Caller must * release result if it is != to sourceEvent */
create a new EntryEvent to be used in notifying listeners, bridge servers, etc. Caller must release result if it is != to sourceEvent
createListenerEvent
{ "repo_name": "deepakddixit/incubator-geode", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutMessage.java", "license": "apache-2.0", "size": 41897 }
[ "org.apache.geode.distributed.internal.membership.InternalDistributedMember", "org.apache.geode.internal.cache.EntryEventImpl", "org.apache.geode.internal.cache.PartitionedRegion" ]
import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.internal.cache.EntryEventImpl; import org.apache.geode.internal.cache.PartitionedRegion;
import org.apache.geode.distributed.internal.membership.*; import org.apache.geode.internal.cache.*;
[ "org.apache.geode" ]
org.apache.geode;
729,627
public boolean start (final OutputStream os) { if (os == null) { return false; } boolean ok = true; this.out = os; try { this.writeString("GIF89a"); // header } catch (final IOException e) { ok = false; } return this.started = ok; }
boolean function (final OutputStream os) { if (os == null) { return false; } boolean ok = true; this.out = os; try { this.writeString(STR); } catch (final IOException e) { ok = false; } return this.started = ok; }
/** Initiates GIF file creation on the given stream. The stream is not closed automatically. * * @param os OutputStream on which GIF images are written. * @return false if initial write failed. */
Initiates GIF file creation on the given stream. The stream is not closed automatically
start
{ "repo_name": "Scarabei/Scarabei", "path": "scarabei-red-desktop/src/com/jfixby/scarabei/red/desktop/image/AnimatedGifEncoder.java", "license": "apache-2.0", "size": 35627 }
[ "java.io.IOException", "java.io.OutputStream" ]
import java.io.IOException; import java.io.OutputStream;
import java.io.*;
[ "java.io" ]
java.io;
961,084
private final ImmutableList<Artifact> getExtdirInputs() { return ImmutableList.copyOf(javaToolchain.getExtclasspath()); }
final ImmutableList<Artifact> function() { return ImmutableList.copyOf(javaToolchain.getExtclasspath()); }
/** * Returns the extdir artifacts. */
Returns the extdir artifacts
getExtdirInputs
{ "repo_name": "snnn/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/java/JavaCompilationHelper.java", "license": "apache-2.0", "size": 34730 }
[ "com.google.common.collect.ImmutableList", "com.google.devtools.build.lib.actions.Artifact" ]
import com.google.common.collect.ImmutableList; import com.google.devtools.build.lib.actions.Artifact;
import com.google.common.collect.*; import com.google.devtools.build.lib.actions.*;
[ "com.google.common", "com.google.devtools" ]
com.google.common; com.google.devtools;
2,128,264
@Override public String toString() { if (this == registry.getNativeType(JSTypeNative.FUNCTION_INSTANCE_TYPE)) { return "Function"; } StringBuilder b = new StringBuilder(32); b.append("function ("); int paramNum = call.parameters.getChildCount(); boolean hasKnownTypeOfThis = !typeOfThis.isUnknownType(); if (hasKnownTypeOfThis) { if (isConstructor()) { b.append("new:"); } else { b.append("this:"); } b.append(typeOfThis.toString()); } if (paramNum > 0) { if (hasKnownTypeOfThis) { b.append(", "); } Node p = call.parameters.getFirstChild(); if (p.isVarArgs()) { appendVarArgsString(b, p.getJSType()); } else { b.append(p.getJSType().toString()); } p = p.getNext(); while (p != null) { b.append(", "); if (p.isVarArgs()) { appendVarArgsString(b, p.getJSType()); } else { b.append(p.getJSType().toString()); } p = p.getNext(); } } b.append("): "); b.append(call.returnType); return b.toString(); }
String function() { if (this == registry.getNativeType(JSTypeNative.FUNCTION_INSTANCE_TYPE)) { return STR; } StringBuilder b = new StringBuilder(32); b.append(STR); int paramNum = call.parameters.getChildCount(); boolean hasKnownTypeOfThis = !typeOfThis.isUnknownType(); if (hasKnownTypeOfThis) { if (isConstructor()) { b.append("new:"); } else { b.append("this:"); } b.append(typeOfThis.toString()); } if (paramNum > 0) { if (hasKnownTypeOfThis) { b.append(STR); } Node p = call.parameters.getFirstChild(); if (p.isVarArgs()) { appendVarArgsString(b, p.getJSType()); } else { b.append(p.getJSType().toString()); } p = p.getNext(); while (p != null) { b.append(STR); if (p.isVarArgs()) { appendVarArgsString(b, p.getJSType()); } else { b.append(p.getJSType().toString()); } p = p.getNext(); } } b.append(STR); b.append(call.returnType); return b.toString(); }
/** * Informally, a function is represented by * {@code function (params): returnType} where the {@code params} is a comma * separated list of types, the first one being a special * {@code this:T} if the function expects a known type for {@code this}. */
Informally, a function is represented by function (params): returnType where the params is a comma separated list of types, the first one being a special this:T if the function expects a known type for this
toString
{ "repo_name": "Dandandan/wikiprogramming", "path": "jsrepl/tools/closure-compiler/trunk/src/com/google/javascript/rhino/jstype/FunctionType.java", "license": "mit", "size": 36092 }
[ "com.google.javascript.rhino.Node" ]
import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.*;
[ "com.google.javascript" ]
com.google.javascript;
1,205,560
public void setNotePostedTimestamp(Timestamp notePostedTimestamp) { this.notePostedTimestamp = notePostedTimestamp; }
void function(Timestamp notePostedTimestamp) { this.notePostedTimestamp = notePostedTimestamp; }
/** * Sets the notePostedTimestamp attribute. * * @param notePostedTimestamp The notePostedTimestamp to set. */
Sets the notePostedTimestamp attribute
setNotePostedTimestamp
{ "repo_name": "sbower/kuali-rice-1", "path": "krad/krad-app-framework/src/main/java/org/kuali/rice/krad/bo/Note.java", "license": "apache-2.0", "size": 10615 }
[ "java.sql.Timestamp" ]
import java.sql.Timestamp;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,008,625
return new Iterator<Integer>() { private Iterator<Integer> currentIterator; { if (it != null && it.hasNext()) { this.currentIterator = it.next(); } else { throw new IteratorException("Iterator<Iterator<Integer>> must be not null!"); } }
return new Iterator<Integer>() { private Iterator<Integer> currentIterator; { if (it != null && it.hasNext()) { this.currentIterator = it.next(); } else { throw new IteratorException(STR); } }
/** * This method transforms Iterator<Iterator<Integer>> into Iterator<Integer>. * * @param it Iterator<Iterator<Integer>>. * @return Iterator<Integer>>. * @throws IteratorException exception. */
This method transforms Iterator> into Iterator
convert
{ "repo_name": "amezgin/amezgin", "path": "chapter_005/iterator/src/main/java/ru/job4j/ConvertIterator.java", "license": "apache-2.0", "size": 3102 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
2,292,323
public void setAssetEntryPersistence( AssetEntryPersistence assetEntryPersistence) { this.assetEntryPersistence = assetEntryPersistence; }
void function( AssetEntryPersistence assetEntryPersistence) { this.assetEntryPersistence = assetEntryPersistence; }
/** * Sets the asset entry persistence. * * @param assetEntryPersistence the asset entry persistence */
Sets the asset entry persistence
setAssetEntryPersistence
{ "repo_name": "juliocamarero/jukebox-portlet", "path": "docroot/WEB-INF/src/org/liferay/jukebox/service/base/AlbumServiceBaseImpl.java", "license": "gpl-2.0", "size": 30416 }
[ "com.liferay.portlet.asset.service.persistence.AssetEntryPersistence" ]
import com.liferay.portlet.asset.service.persistence.AssetEntryPersistence;
import com.liferay.portlet.asset.service.persistence.*;
[ "com.liferay.portlet" ]
com.liferay.portlet;
11,755
ServiceDirectory directory();
ServiceDirectory directory();
/** * Returns the service directory which can be used to obtain references * to various supporting services. * * @return service directory */
Returns the service directory which can be used to obtain references to various supporting services
directory
{ "repo_name": "maxkondr/onos-porta", "path": "core/api/src/main/java/org/onosproject/net/behaviour/PipelinerContext.java", "license": "apache-2.0", "size": 1299 }
[ "org.onlab.osgi.ServiceDirectory" ]
import org.onlab.osgi.ServiceDirectory;
import org.onlab.osgi.*;
[ "org.onlab.osgi" ]
org.onlab.osgi;
1,180,582
@ServiceMethod(returns = ReturnType.SINGLE) Response<Void> validatePropertiesWithResponse(ApplicationsValidatePropertiesRequestBody body, Context context);
@ServiceMethod(returns = ReturnType.SINGLE) Response<Void> validatePropertiesWithResponse(ApplicationsValidatePropertiesRequestBody body, Context context);
/** * Invoke action validateProperties. * * @param body Action parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */
Invoke action validateProperties
validatePropertiesWithResponse
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ApplicationsClient.java", "license": "mit", "size": 113060 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.Context", "com.azure.resourcemanager.authorization.fluent.models.ApplicationsValidatePropertiesRequestBody" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.authorization.fluent.models.ApplicationsValidatePropertiesRequestBody;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.authorization.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,756,650
public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { convertView = mInflater.inflate(R.layout.simple_list_item_single_choice, null); holder = new ViewHolder(); holder.text = (TextView) convertView.findViewById(android.R.id.text1); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } Network network = mNetworks.get(position); holder.text.setText(network.getCity() + " - " + network.getName()); return convertView; } static class ViewHolder { TextView text; }
View function(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { convertView = mInflater.inflate(R.layout.simple_list_item_single_choice, null); holder = new ViewHolder(); holder.text = (TextView) convertView.findViewById(android.R.id.text1); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } Network network = mNetworks.get(position); holder.text.setText(network.getCity() + STR + network.getName()); return convertView; } static class ViewHolder { TextView text; }
/** * Make a view to hold each row. * * @see android.widget.ListAdapter#getView(int, android.view.View, * android.view.ViewGroup) */
Make a view to hold each row
getView
{ "repo_name": "glutamatt/OpenBike", "path": "src/fr/openbike/android/ui/NetworkAdapter.java", "license": "gpl-3.0", "size": 2828 }
[ "android.view.View", "android.view.ViewGroup", "android.widget.TextView", "fr.openbike.android.model.Network" ]
import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import fr.openbike.android.model.Network;
import android.view.*; import android.widget.*; import fr.openbike.android.model.*;
[ "android.view", "android.widget", "fr.openbike.android" ]
android.view; android.widget; fr.openbike.android;
2,357,645
Observable<ServiceResponseWithHeaders<Void, HeaderResponseStringHeaders>> responseStringWithServiceResponseAsync(String scenario);
Observable<ServiceResponseWithHeaders<Void, HeaderResponseStringHeaders>> responseStringWithServiceResponseAsync(String scenario);
/** * Get a response with header values "The quick brown fox jumps over the lazy dog" or null or "". * * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" * @return the {@link ServiceResponseWithHeaders} object if successful. */
Get a response with header values "The quick brown fox jumps over the lazy dog" or null or ""
responseStringWithServiceResponseAsync
{ "repo_name": "anudeepsharma/autorest", "path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/header/Headers.java", "license": "mit", "size": 53377 }
[ "com.microsoft.rest.ServiceResponseWithHeaders" ]
import com.microsoft.rest.ServiceResponseWithHeaders;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
1,768,932
public boolean setContentFromSelectedBoxes(BoxInfoServer[] selectedBoxesInformation) { // at this moment, only implement managing for a single box switch (selectedBoxesInformation.length) { case 0: // nothing is selected currentView.setBoxIdentification("none"); currentView.setEnabled(false); return false; case 1: // a single specific box type is selected currentView.setEnabled(true); if (getCurrentBoxDataSource() != selectedBoxesInformation[0]) { currentBoxDataSource = selectedBoxesInformation[0]; this.overview.setContentFrom(currentBoxDataSource); resetView(); } currentView.refreshBoxIdentification(); return true; default: // multiple specific box types are selected currentView.setBoxIdentification("multiple"); currentView.setEnabled(false); return false; } }
boolean function(BoxInfoServer[] selectedBoxesInformation) { switch (selectedBoxesInformation.length) { case 0: currentView.setBoxIdentification("none"); currentView.setEnabled(false); return false; case 1: currentView.setEnabled(true); if (getCurrentBoxDataSource() != selectedBoxesInformation[0]) { currentBoxDataSource = selectedBoxesInformation[0]; this.overview.setContentFrom(currentBoxDataSource); resetView(); } currentView.refreshBoxIdentification(); return true; default: currentView.setBoxIdentification(STR); currentView.setEnabled(false); return false; } }
/** * Resets the content of this toolbox according to the given resources. * @return whether the new content needs to be displayed */
Resets the content of this toolbox according to the given resources
setContentFromSelectedBoxes
{ "repo_name": "SkyCrawl/pikater-vaadin", "path": "src/org/pikater/web/vaadin/gui/server/ui_expeditor/expeditor/boxmanager/BoxManagerToolbox.java", "license": "apache-2.0", "size": 4509 }
[ "org.pikater.web.experiment.server.BoxInfoServer" ]
import org.pikater.web.experiment.server.BoxInfoServer;
import org.pikater.web.experiment.server.*;
[ "org.pikater.web" ]
org.pikater.web;
2,412,297
EReference getPackageDeclaration_Elements();
EReference getPackageDeclaration_Elements();
/** * Returns the meta object for the containment reference list '{@link org.example.domainmodel.domainmodel.PackageDeclaration#getElements <em>Elements</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference list '<em>Elements</em>'. * @see org.example.domainmodel.domainmodel.PackageDeclaration#getElements() * @see #getPackageDeclaration() * @generated */
Returns the meta object for the containment reference list '<code>org.example.domainmodel.domainmodel.PackageDeclaration#getElements Elements</code>'.
getPackageDeclaration_Elements
{ "repo_name": "adrian-herscu/experiments", "path": "language-workbenches/xtext/org.example.domainmodel/src-gen/org/example/domainmodel/domainmodel/DomainmodelPackage.java", "license": "apache-2.0", "size": 22388 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
306,957
public NodeList getXblScopedChildNodes() { return xblManager.getXblScopedChildNodes(this); }
NodeList function() { return xblManager.getXblScopedChildNodes(this); }
/** * Get the list of child nodes of this node in the fully flattened tree * that are within the same shadow scope. */
Get the list of child nodes of this node in the fully flattened tree that are within the same shadow scope
getXblScopedChildNodes
{ "repo_name": "adufilie/flex-sdk", "path": "modules/thirdparty/batik/sources/org/apache/flex/forks/batik/dom/AbstractDocument.java", "license": "apache-2.0", "size": 95805 }
[ "org.w3c.dom.NodeList" ]
import org.w3c.dom.NodeList;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
1,088,600
@Api public void setDefaultCursorString(String cursor) { try { defaultCursor = cursor.toUpperCase(); Cursor.valueOf(cursor.toUpperCase()); } catch (Exception e) { // NOSONAR // Let us assume the cursor points to an image: defaultCursor = cursor; if (!cursor.contains("url")) { defaultCursor = "url('" + cursor + "'),auto"; } } setCursorString(defaultCursor); }
void function(String cursor) { try { defaultCursor = cursor.toUpperCase(); Cursor.valueOf(cursor.toUpperCase()); } catch (Exception e) { defaultCursor = cursor; if (!cursor.contains("url")) { defaultCursor = "url('" + cursor + STR; } } setCursorString(defaultCursor); }
/** * Apply a new default cursor on the map. This cursor will be set on deactivation of a controller. * * @param cursor The new default cursor to be used when the mouse hovers over the map. * @since 1.12.0 */
Apply a new default cursor on the map. This cursor will be set on deactivation of a controller
setDefaultCursorString
{ "repo_name": "geomajas/geomajas-project-client-gwt", "path": "client/src/main/java/org/geomajas/gwt/client/widget/MapWidget.java", "license": "agpl-3.0", "size": 47664 }
[ "com.smartgwt.client.types.Cursor" ]
import com.smartgwt.client.types.Cursor;
import com.smartgwt.client.types.*;
[ "com.smartgwt.client" ]
com.smartgwt.client;
1,209,420
@Test void sendSingleMessageNullTransaction() { // Arrange final ServiceBusTransactionContext nullTransaction = null; final ServiceBusMessage testData = new ServiceBusMessage(TEST_CONTENTS_BINARY); when(asyncSender.sendMessage(testData, transactionContext)).thenReturn(Mono.empty()); // Act & Assert try { sender.sendMessage(testData, nullTransaction); Assertions.fail("This should have failed with NullPointerException."); } catch (Exception ex) { Assertions.assertTrue(ex instanceof NullPointerException); } verify(asyncSender).sendMessage(testData, nullTransaction); }
void sendSingleMessageNullTransaction() { final ServiceBusTransactionContext nullTransaction = null; final ServiceBusMessage testData = new ServiceBusMessage(TEST_CONTENTS_BINARY); when(asyncSender.sendMessage(testData, transactionContext)).thenReturn(Mono.empty()); try { sender.sendMessage(testData, nullTransaction); Assertions.fail(STR); } catch (Exception ex) { Assertions.assertTrue(ex instanceof NullPointerException); } verify(asyncSender).sendMessage(testData, nullTransaction); }
/** * Verifies that sending a single message will result in calling sender.send(Message, transaction). */
Verifies that sending a single message will result in calling sender.send(Message, transaction)
sendSingleMessageNullTransaction
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSenderClientTest.java", "license": "mit", "size": 14319 }
[ "org.junit.jupiter.api.Assertions", "org.mockito.Mockito" ]
import org.junit.jupiter.api.Assertions; import org.mockito.Mockito;
import org.junit.jupiter.api.*; import org.mockito.*;
[ "org.junit.jupiter", "org.mockito" ]
org.junit.jupiter; org.mockito;
2,005,563
public static Drawable createFromXml(Resources r, XmlPullParser parser, Theme theme) throws XmlPullParserException, IOException { AttributeSet attrs = Xml.asAttributeSet(parser); int type; while ((type=parser.next()) != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT) { // Empty loop } if (type != XmlPullParser.START_TAG) { throw new XmlPullParserException("No start tag found"); } Drawable drawable = createFromXmlInner(r, parser, attrs, theme); if (drawable == null) { throw new RuntimeException("Unknown initial tag: " + parser.getName()); } return drawable; }
static Drawable function(Resources r, XmlPullParser parser, Theme theme) throws XmlPullParserException, IOException { AttributeSet attrs = Xml.asAttributeSet(parser); int type; while ((type=parser.next()) != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT) { } if (type != XmlPullParser.START_TAG) { throw new XmlPullParserException(STR); } Drawable drawable = createFromXmlInner(r, parser, attrs, theme); if (drawable == null) { throw new RuntimeException(STR + parser.getName()); } return drawable; }
/** * Create a drawable from an XML document using an optional {@link Theme}. * For more information on how to create resources in XML, see * <a href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>. */
Create a drawable from an XML document using an optional <code>Theme</code>. For more information on how to create resources in XML, see Drawable Resources
createFromXml
{ "repo_name": "Ant-Droid/android_frameworks_base_OLD", "path": "graphics/java/android/graphics/drawable/Drawable.java", "license": "apache-2.0", "size": 53063 }
[ "android.content.res.Resources", "android.util.AttributeSet", "android.util.Xml", "java.io.IOException", "org.xmlpull.v1.XmlPullParser", "org.xmlpull.v1.XmlPullParserException" ]
import android.content.res.Resources; import android.util.AttributeSet; import android.util.Xml; import java.io.IOException; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException;
import android.content.res.*; import android.util.*; import java.io.*; import org.xmlpull.v1.*;
[ "android.content", "android.util", "java.io", "org.xmlpull.v1" ]
android.content; android.util; java.io; org.xmlpull.v1;
2,738,524
mainframe = new JFrame("BBoxDB - GUI Client"); setupMenu(); mainPanel = buildSplitPane(); updateMainPanel(); tableModel = getTableModel(); final JTable table = new JTable(tableModel); table.getColumnModel().getColumn(0).setMaxWidth(40); table.getColumnModel().getColumn(2).setMinWidth(100); table.getColumnModel().getColumn(2).setMaxWidth(100); table.setDefaultRenderer(Object.class, new InstanceTableRenderer()); final JScrollPane tableScrollPane = new JScrollPane(table); final Dimension dimension = table.getPreferredSize(); if(dimension != null) { tableScrollPane.setPreferredSize( new Dimension(dimension.width, table.getRowHeight() * 7)); } mainframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); mainframe.setLayout(new BorderLayout()); mainframe.add(mainPanel, BorderLayout.CENTER); final JPanel southPanel = new JPanel(); southPanel.setLayout(new BorderLayout()); southPanel.add(tableScrollPane, BorderLayout.CENTER); final JPanel statusPanel = new JPanel(); statusPanel.setBorder(new BevelBorder(BevelBorder.LOWERED)); statusPanel.setPreferredSize(new Dimension(southPanel.getWidth(), 20)); statusPanel.setLayout(new BoxLayout(statusPanel, BoxLayout.X_AXIS)); statusLabel = new JLabel(""); statusLabel.setHorizontalAlignment(SwingConstants.LEFT); statusPanel.add(statusLabel); southPanel.add(statusPanel, BorderLayout.SOUTH); mainframe.add(southPanel, BorderLayout.SOUTH); mainframe.pack(); mainframe.setLocationRelativeTo(null); mainframe.setVisible(true); }
mainframe = new JFrame(STR); setupMenu(); mainPanel = buildSplitPane(); updateMainPanel(); tableModel = getTableModel(); final JTable table = new JTable(tableModel); table.getColumnModel().getColumn(0).setMaxWidth(40); table.getColumnModel().getColumn(2).setMinWidth(100); table.getColumnModel().getColumn(2).setMaxWidth(100); table.setDefaultRenderer(Object.class, new InstanceTableRenderer()); final JScrollPane tableScrollPane = new JScrollPane(table); final Dimension dimension = table.getPreferredSize(); if(dimension != null) { tableScrollPane.setPreferredSize( new Dimension(dimension.width, table.getRowHeight() * 7)); } mainframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); mainframe.setLayout(new BorderLayout()); mainframe.add(mainPanel, BorderLayout.CENTER); final JPanel southPanel = new JPanel(); southPanel.setLayout(new BorderLayout()); southPanel.add(tableScrollPane, BorderLayout.CENTER); final JPanel statusPanel = new JPanel(); statusPanel.setBorder(new BevelBorder(BevelBorder.LOWERED)); statusPanel.setPreferredSize(new Dimension(southPanel.getWidth(), 20)); statusPanel.setLayout(new BoxLayout(statusPanel, BoxLayout.X_AXIS)); statusLabel = new JLabel(""); statusLabel.setHorizontalAlignment(SwingConstants.LEFT); statusPanel.add(statusLabel); southPanel.add(statusPanel, BorderLayout.SOUTH); mainframe.add(southPanel, BorderLayout.SOUTH); mainframe.pack(); mainframe.setLocationRelativeTo(null); mainframe.setVisible(true); }
/** * Build the BBoxDB dialog, init GUI components * and assemble the dialog */
Build the BBoxDB dialog, init GUI components and assemble the dialog
run
{ "repo_name": "jnidzwetzki/bboxdb", "path": "bboxdb-tools/src/main/java/org/bboxdb/tools/gui/BBoxDBGui.java", "license": "apache-2.0", "size": 9869 }
[ "java.awt.BorderLayout", "java.awt.Dimension", "javax.swing.BoxLayout", "javax.swing.JFrame", "javax.swing.JLabel", "javax.swing.JPanel", "javax.swing.JScrollPane", "javax.swing.JTable", "javax.swing.SwingConstants", "javax.swing.border.BevelBorder" ]
import java.awt.BorderLayout; import java.awt.Dimension; import javax.swing.BoxLayout; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.SwingConstants; import javax.swing.border.BevelBorder;
import java.awt.*; import javax.swing.*; import javax.swing.border.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
1,439,285
public ValidatedTemplate validate(String template) throws CodeSyntaxException { CodeList sink = new CodeList(); CodeStats stats = new CodeStats(); // Validate the template at the syntax level. Tokenizer tokenizer = new Tokenizer(template, sink, formatterTable, predicateTable); tokenizer.setValidate(); tokenizer.consume(); // Pass the parsed instructions to the CodeMachine for structural validation, and // collect some stats. CodeMachine machine = new CodeMachine(); machine.setValidate(); for (Instruction inst : sink.getInstructions()) { machine.accept(inst); stats.accept(inst); } machine.complete(); stats.complete(); List<ErrorInfo> errors = joinErrors(tokenizer.getErrors(), machine.getErrors()); return new ValidatedTemplate(sink, stats, errors); }
ValidatedTemplate function(String template) throws CodeSyntaxException { CodeList sink = new CodeList(); CodeStats stats = new CodeStats(); Tokenizer tokenizer = new Tokenizer(template, sink, formatterTable, predicateTable); tokenizer.setValidate(); tokenizer.consume(); CodeMachine machine = new CodeMachine(); machine.setValidate(); for (Instruction inst : sink.getInstructions()) { machine.accept(inst); stats.accept(inst); } machine.complete(); stats.complete(); List<ErrorInfo> errors = joinErrors(tokenizer.getErrors(), machine.getErrors()); return new ValidatedTemplate(sink, stats, errors); }
/** * Compiles the template in validation mode, capturing all errors. */
Compiles the template in validation mode, capturing all errors
validate
{ "repo_name": "Squarespace/template-compiler", "path": "core/src/main/java/com/squarespace/template/Compiler.java", "license": "apache-2.0", "size": 3976 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
999,185
private void _testError(String errorType, String externalStatus, String signalValue) throws Exception { Reader reader = IOUtils.getResourceAsReader("wf-ext-schema-valid.xml", -1); Writer writer = new FileWriter(getTestCaseDir() + "/workflow.xml"); IOUtils.copyCharStream(reader, writer); final DagEngine engine = new DagEngine("u", "a"); Configuration conf = new XConfiguration(); conf.set(OozieClient.APP_PATH, getTestCaseDir() + File.separator + "workflow.xml"); conf.set(OozieClient.USER_NAME, getTestUser()); conf.set(OozieClient.GROUP_NAME, getTestGroup()); injectKerberosInfo(conf); conf.set(OozieClient.LOG_TOKEN, "t"); conf.set("error", errorType); conf.set("external-status", externalStatus); conf.set("signal-value", signalValue); final String jobId = engine.submitJob(conf, true);
void function(String errorType, String externalStatus, String signalValue) throws Exception { Reader reader = IOUtils.getResourceAsReader(STR, -1); Writer writer = new FileWriter(getTestCaseDir() + STR); IOUtils.copyCharStream(reader, writer); final DagEngine engine = new DagEngine("u", "a"); Configuration conf = new XConfiguration(); conf.set(OozieClient.APP_PATH, getTestCaseDir() + File.separator + STR); conf.set(OozieClient.USER_NAME, getTestUser()); conf.set(OozieClient.GROUP_NAME, getTestGroup()); injectKerberosInfo(conf); conf.set(OozieClient.LOG_TOKEN, "t"); conf.set("error", errorType); conf.set(STR, externalStatus); conf.set(STR, signalValue); final String jobId = engine.submitJob(conf, true);
/** * Provides functionality to test errors * * @param errorType the error type. (start.non-transient, end.non-transient) * @param externalStatus the external status to set. * @param signalValue the signal value to set. * @throws Exception */
Provides functionality to test errors
_testError
{ "repo_name": "cloudera/oozie", "path": "core/src/test/java/org/apache/oozie/command/wf/TestActionErrors.java", "license": "apache-2.0", "size": 19132 }
[ "java.io.File", "java.io.FileWriter", "java.io.Reader", "java.io.Writer", "org.apache.hadoop.conf.Configuration", "org.apache.oozie.DagEngine", "org.apache.oozie.client.OozieClient", "org.apache.oozie.util.IOUtils", "org.apache.oozie.util.XConfiguration" ]
import java.io.File; import java.io.FileWriter; import java.io.Reader; import java.io.Writer; import org.apache.hadoop.conf.Configuration; import org.apache.oozie.DagEngine; import org.apache.oozie.client.OozieClient; import org.apache.oozie.util.IOUtils; import org.apache.oozie.util.XConfiguration;
import java.io.*; import org.apache.hadoop.conf.*; import org.apache.oozie.*; import org.apache.oozie.client.*; import org.apache.oozie.util.*;
[ "java.io", "org.apache.hadoop", "org.apache.oozie" ]
java.io; org.apache.hadoop; org.apache.oozie;
747,318
public MessageProto.TrustChainBlock getLatestBlock(byte[] pubkey) { return getBlock(pubkey, getMaxSeqNum(pubkey)); }
MessageProto.TrustChainBlock function(byte[] pubkey) { return getBlock(pubkey, getMaxSeqNum(pubkey)); }
/** * Returns the latest block in the database associated with the given public key. * * @param pubkey - public key for which to search for blocks * @return the latest block in the database associated with the given public key */
Returns the latest block in the database associated with the given public key
getLatestBlock
{ "repo_name": "wkmeijer/CS4160-trustchain-android", "path": "app/src/main/java/nl/tudelft/cs4160/trustchain_android/database/TrustChainDBHelper.java", "license": "lgpl-3.0", "size": 22118 }
[ "nl.tudelft.cs4160.trustchain_android.message.MessageProto" ]
import nl.tudelft.cs4160.trustchain_android.message.MessageProto;
import nl.tudelft.cs4160.trustchain_android.message.*;
[ "nl.tudelft.cs4160" ]
nl.tudelft.cs4160;
564,123
public RegionServerServices createMockRegionServerService(ServerName name) throws IOException { final MockRegionServerServices rss = new MockRegionServerServices(getZooKeeperWatcher(), name); rss.setFileSystem(getTestFileSystem()); return rss; }
RegionServerServices function(ServerName name) throws IOException { final MockRegionServerServices rss = new MockRegionServerServices(getZooKeeperWatcher(), name); rss.setFileSystem(getTestFileSystem()); return rss; }
/** * Create a stubbed out RegionServerService, mainly for getting FS. * This version is used by TestOpenRegionHandler */
Create a stubbed out RegionServerService, mainly for getting FS. This version is used by TestOpenRegionHandler
createMockRegionServerService
{ "repo_name": "SeekerResource/hbase", "path": "hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java", "license": "apache-2.0", "size": 145665 }
[ "java.io.IOException", "org.apache.hadoop.hbase.regionserver.RegionServerServices" ]
import java.io.IOException; import org.apache.hadoop.hbase.regionserver.RegionServerServices;
import java.io.*; import org.apache.hadoop.hbase.regionserver.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
16,776
public boolean validateBillingFrequency(ContractsAndGrantsBillingAward award, ContractsAndGrantsBillingAwardAccount awardAccount);
boolean function(ContractsAndGrantsBillingAward award, ContractsAndGrantsBillingAwardAccount awardAccount);
/** * This method checks if the award account is within the grace period. * * @param award ContractsAndGrantsBillingAward to validate billing frequency for * @param award ContractsAndGrantsBillingAwardAccount to validate billing frequency for * @return true if valid else false. */
This method checks if the award account is within the grace period
validateBillingFrequency
{ "repo_name": "quikkian-ua-devops/will-financials", "path": "kfs-ar/src/main/java/org/kuali/kfs/module/ar/batch/service/VerifyBillingFrequencyService.java", "license": "agpl-3.0", "size": 2526 }
[ "org.kuali.kfs.integration.cg.ContractsAndGrantsBillingAward", "org.kuali.kfs.integration.cg.ContractsAndGrantsBillingAwardAccount" ]
import org.kuali.kfs.integration.cg.ContractsAndGrantsBillingAward; import org.kuali.kfs.integration.cg.ContractsAndGrantsBillingAwardAccount;
import org.kuali.kfs.integration.cg.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
161,771
private void plugRemoteControlDisplaysIntoClient_syncRcStack(IRemoteControlClient rcc) { final Iterator<DisplayInfoForServer> displayIterator = mRcDisplays.iterator(); while (displayIterator.hasNext()) { final DisplayInfoForServer di = (DisplayInfoForServer) displayIterator.next(); try { rcc.plugRemoteControlDisplay(di.mRcDisplay, di.mArtworkExpectedWidth, di.mArtworkExpectedHeight); if (di.mWantsPositionSync) { rcc.setWantsSyncForDisplay(di.mRcDisplay, true); } } catch (RemoteException e) { Log.e(TAG, "Error connecting RCD to RCC in RCC registration",e); } } }
void function(IRemoteControlClient rcc) { final Iterator<DisplayInfoForServer> displayIterator = mRcDisplays.iterator(); while (displayIterator.hasNext()) { final DisplayInfoForServer di = (DisplayInfoForServer) displayIterator.next(); try { rcc.plugRemoteControlDisplay(di.mRcDisplay, di.mArtworkExpectedWidth, di.mArtworkExpectedHeight); if (di.mWantsPositionSync) { rcc.setWantsSyncForDisplay(di.mRcDisplay, true); } } catch (RemoteException e) { Log.e(TAG, STR,e); } } }
/** * Plug each registered display into the specified client * @param rcc, guaranteed non null */
Plug each registered display into the specified client
plugRemoteControlDisplaysIntoClient_syncRcStack
{ "repo_name": "JSDemos/android-sdk-20", "path": "src/android/media/MediaFocusControl.java", "license": "apache-2.0", "size": 122705 }
[ "android.os.RemoteException", "android.util.Log", "java.util.Iterator" ]
import android.os.RemoteException; import android.util.Log; import java.util.Iterator;
import android.os.*; import android.util.*; import java.util.*;
[ "android.os", "android.util", "java.util" ]
android.os; android.util; java.util;
2,420,379
Socket newSocket(URI uri) throws IOException, NoAnswerException;
Socket newSocket(URI uri) throws IOException, NoAnswerException;
/** * Creates a new socket. * * @param uri The URI to generate a socket from. * @return The socket. * @throws IOException If there's an error connecting. * @throws NoAnswerException If there's no response from the answerer. */
Creates a new socket
newSocket
{ "repo_name": "adamfisk/littleshoot-client", "path": "common/p2p/src/main/java/org/lastbamboo/common/p2p/SocketFactory.java", "license": "gpl-2.0", "size": 595 }
[ "java.io.IOException", "java.net.Socket", "org.lastbamboo.common.offer.answer.NoAnswerException" ]
import java.io.IOException; import java.net.Socket; import org.lastbamboo.common.offer.answer.NoAnswerException;
import java.io.*; import java.net.*; import org.lastbamboo.common.offer.answer.*;
[ "java.io", "java.net", "org.lastbamboo.common" ]
java.io; java.net; org.lastbamboo.common;
2,380,752
public Iterator<Database> iterator() { return this.getDatabases().iterator(); }
Iterator<Database> function() { return this.getDatabases().iterator(); }
/** * Gets the sequence of Databases. * */
Gets the sequence of Databases
iterator
{ "repo_name": "flydream2046/azure-sdk-for-java", "path": "resource-management/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/models/DatabaseListResponse.java", "license": "apache-2.0", "size": 2102 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
2,080,050
public Builder addPlugin(Class<? extends Plugin> pluginClass) { pluginClasses.add(pluginClass); return this; }
Builder function(Class<? extends Plugin> pluginClass) { pluginClasses.add(pluginClass); return this; }
/** * Add the given plugin to the client when it is created. */
Add the given plugin to the client when it is created
addPlugin
{ "repo_name": "martinstuga/elasticsearch", "path": "core/src/main/java/org/elasticsearch/client/transport/TransportClient.java", "license": "apache-2.0", "size": 11337 }
[ "org.elasticsearch.plugins.Plugin" ]
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.plugins.*;
[ "org.elasticsearch.plugins" ]
org.elasticsearch.plugins;
251,743
public Map<String, T> getAsMap(Settings settings) { Map<String, T> map = new HashMap<>(); matchStream(settings).distinct().forEach(key -> { Setting<T> concreteSetting = getConcreteSetting(key); map.put(getNamespace(concreteSetting), concreteSetting.get(settings)); }); return Collections.unmodifiableMap(map); } } @FunctionalInterface public interface Validator<T> {
Map<String, T> function(Settings settings) { Map<String, T> map = new HashMap<>(); matchStream(settings).distinct().forEach(key -> { Setting<T> concreteSetting = getConcreteSetting(key); map.put(getNamespace(concreteSetting), concreteSetting.get(settings)); }); return Collections.unmodifiableMap(map); } } public interface Validator<T> {
/** * Returns a map of all namespaces to it's values give the provided settings */
Returns a map of all namespaces to it's values give the provided settings
getAsMap
{ "repo_name": "qwerty4030/elasticsearch", "path": "server/src/main/java/org/elasticsearch/common/settings/Setting.java", "license": "apache-2.0", "size": 61376 }
[ "java.util.Collections", "java.util.HashMap", "java.util.Map" ]
import java.util.Collections; import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
911,541
public static final void show(Window owner, World world) { EditWorldDialog ewd = new EditWorldDialog(owner, world); ewd.setLocationRelativeTo(owner); ewd.setVisible(true); if (!ewd.canceled) { synchronized (world) { // set the properties ewd.pnlWorld.setWorld(world); } } }
static final void function(Window owner, World world) { EditWorldDialog ewd = new EditWorldDialog(owner, world); ewd.setLocationRelativeTo(owner); ewd.setVisible(true); if (!ewd.canceled) { synchronized (world) { ewd.pnlWorld.setWorld(world); } } }
/** * Shows an edit world dialog and sets the properties if the user clicks apply. * @param owner the dialog owner * @param world the current world */
Shows an edit world dialog and sets the properties if the user clicks apply
show
{ "repo_name": "satishbabusee/dyn4j", "path": "sandbox/org/dyn4j/sandbox/dialogs/EditWorldDialog.java", "license": "bsd-3-clause", "size": 4691 }
[ "java.awt.Window", "org.dyn4j.dynamics.World" ]
import java.awt.Window; import org.dyn4j.dynamics.World;
import java.awt.*; import org.dyn4j.dynamics.*;
[ "java.awt", "org.dyn4j.dynamics" ]
java.awt; org.dyn4j.dynamics;
681,574
public void testListHour() { String[] dtStrs = { "1999-02-01T10:00:00", "1999-02-01T23:00:00", "1999-02-01T01:00:00", "1999-02-01T15:00:00", "1999-02-01T05:00:00", "1999-02-01T20:00:00", "1999-02-01T17:00:00" }; // List sl = loadAList( dtStrs ); boolean isSorted1 = isListSorted( sl ); Collections.sort( sl, cHour ); boolean isSorted2 = isListSorted( sl ); assertEquals("ListHour", !isSorted1, isSorted2); } // end of testListHour
void function() { String[] dtStrs = { STR, STR, STR, STR, STR, STR, STR }; boolean isSorted1 = isListSorted( sl ); Collections.sort( sl, cHour ); boolean isSorted2 = isListSorted( sl ); assertEquals(STR, !isSorted1, isSorted2); }
/** * Test sorting with hour comparator. */
Test sorting with hour comparator
testListHour
{ "repo_name": "SpoonLabs/astor", "path": "examples/time_2/src/test/java/org/joda/time/TestDateTimeComparator.java", "license": "gpl-2.0", "size": 37715 }
[ "java.util.Collections" ]
import java.util.Collections;
import java.util.*;
[ "java.util" ]
java.util;
350,354
private SortedSet<WeekOfMonth> readWeeksOfMonth(JSONValue json) { JSONArray array = null == json ? null : json.isArray(); if (null != array) { SortedSet<WeekOfMonth> result = new TreeSet<>(); for (int i = 0; i < array.size(); i++) { String weekStr = readOptionalString(array.get(i)); try { WeekOfMonth week = WeekOfMonth.valueOf(weekStr); result.add(week); } catch (@SuppressWarnings("unused") IllegalArgumentException | NullPointerException e) { // Just skip } } return result; } return new TreeSet<>(); }
SortedSet<WeekOfMonth> function(JSONValue json) { JSONArray array = null == json ? null : json.isArray(); if (null != array) { SortedSet<WeekOfMonth> result = new TreeSet<>(); for (int i = 0; i < array.size(); i++) { String weekStr = readOptionalString(array.get(i)); try { WeekOfMonth week = WeekOfMonth.valueOf(weekStr); result.add(week); } catch (@SuppressWarnings(STR) IllegalArgumentException NullPointerException e) { } } return result; } return new TreeSet<>(); }
/** * Read "weeks of month" information from JSON. * @param json the JSON where information is read from. * @return the list of weeks read, defaults to the empty list. */
Read "weeks of month" information from JSON
readWeeksOfMonth
{ "repo_name": "alkacon/opencms-core", "path": "src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java", "license": "lgpl-2.1", "size": 18205 }
[ "com.google.gwt.json.client.JSONArray", "com.google.gwt.json.client.JSONValue", "java.util.SortedSet", "java.util.TreeSet" ]
import com.google.gwt.json.client.JSONArray; import com.google.gwt.json.client.JSONValue; import java.util.SortedSet; import java.util.TreeSet;
import com.google.gwt.json.client.*; import java.util.*;
[ "com.google.gwt", "java.util" ]
com.google.gwt; java.util;
2,550,475
public String getPropsAsString() { Iterator iterator = getKeys(); StringBuilder builder = new StringBuilder(); boolean appendNewline = false; while (iterator.hasNext()) { Object key = iterator.next(); if (key instanceof String) { if (appendNewline) { builder.append("\n"); } Object value = getProperty((String)key); builder.append(key).append("=").append(value); appendNewline = true; } } return builder.toString(); }
String function() { Iterator iterator = getKeys(); StringBuilder builder = new StringBuilder(); boolean appendNewline = false; while (iterator.hasNext()) { Object key = iterator.next(); if (key instanceof String) { if (appendNewline) { builder.append("\n"); } Object value = getProperty((String)key); builder.append(key).append("=").append(value); appendNewline = true; } } return builder.toString(); }
/** * Get all properties as a string. */
Get all properties as a string
getPropsAsString
{ "repo_name": "twitter/distributedlog", "path": "distributedlog-core/src/main/java/com/twitter/distributedlog/DistributedLogConfiguration.java", "license": "apache-2.0", "size": 131921 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
260,352
public boolean canPerformWrap(Class<? extends Parent> wrappingClass) { if (getClassesSupportingWrapping().contains(wrappingClass) == false) { return false; } final AbstractWrapInJob job = AbstractWrapInJob.getWrapInJob(this, wrappingClass); return job.isExecutable(); } private static List<Class<? extends Parent>> classesSupportingWrapping;
boolean function(Class<? extends Parent> wrappingClass) { if (getClassesSupportingWrapping().contains(wrappingClass) == false) { return false; } final AbstractWrapInJob job = AbstractWrapInJob.getWrapInJob(this, wrappingClass); return job.isExecutable(); } private static List<Class<? extends Parent>> classesSupportingWrapping;
/** * Returns true if the 'wrap' action is permitted with the specified class. * * @param wrappingClass the wrapping class. * @return true if the 'wrap' action is permitted. */
Returns true if the 'wrap' action is permitted with the specified class
canPerformWrap
{ "repo_name": "maiklos-mirrors/jfx78", "path": "apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/EditorController.java", "license": "gpl-2.0", "size": 68314 }
[ "com.oracle.javafx.scenebuilder.kit.editor.job.wrap.AbstractWrapInJob", "java.util.List" ]
import com.oracle.javafx.scenebuilder.kit.editor.job.wrap.AbstractWrapInJob; import java.util.List;
import com.oracle.javafx.scenebuilder.kit.editor.job.wrap.*; import java.util.*;
[ "com.oracle.javafx", "java.util" ]
com.oracle.javafx; java.util;
1,693,828
private void setConfigurationsOnCluster(List<BlueprintServiceConfigRequest> configurationRequests, String tag, Set<String> updatedConfigTypes) { String clusterName = null; try { clusterName = ambariContext.getClusterName(clusterTopology.getClusterId()); } catch (AmbariException e) { LOG.error("Cannot get cluster name for clusterId = " + clusterTopology.getClusterId(), e); throw new RuntimeException(e); } // iterate over services to deploy for (BlueprintServiceConfigRequest blueprintConfigRequest : configurationRequests) { ClusterRequest clusterRequest = null; // iterate over the config types associated with this service List<ConfigurationRequest> requestsPerService = new LinkedList<ConfigurationRequest>(); for (BlueprintServiceConfigElement blueprintElement : blueprintConfigRequest.getConfigElements()) { Map<String, Object> clusterProperties = new HashMap<String, Object>(); clusterProperties.put(ClusterResourceProvider.CLUSTER_NAME_PROPERTY_ID, clusterName); clusterProperties.put(ClusterResourceProvider.CLUSTER_DESIRED_CONFIGS_PROPERTY_ID + "/type", blueprintElement.getTypeName()); clusterProperties.put(ClusterResourceProvider.CLUSTER_DESIRED_CONFIGS_PROPERTY_ID + "/tag", tag); for (Map.Entry<String, String> entry : blueprintElement.getConfiguration().entrySet()) { clusterProperties.put(ClusterResourceProvider.CLUSTER_DESIRED_CONFIGS_PROPERTY_ID + "/properties/" + entry.getKey(), entry.getValue()); } if (blueprintElement.getAttributes() != null) { for (Map.Entry<String, Map<String, String>> attribute : blueprintElement.getAttributes().entrySet()) { String attributeName = attribute.getKey(); for (Map.Entry<String, String> attributeOccurrence : attribute.getValue().entrySet()) { clusterProperties.put(ClusterResourceProvider.CLUSTER_DESIRED_CONFIGS_PROPERTY_ID + "/properties_attributes/" + attributeName + "/" + attributeOccurrence.getKey(), attributeOccurrence.getValue()); } } } // only create one cluster request per service, which includes // all the configuration types for that service if (clusterRequest == null) { SecurityType securityType; String requestedSecurityType = (String) clusterProperties.get( ClusterResourceProvider.CLUSTER_SECURITY_TYPE_PROPERTY_ID); if(requestedSecurityType == null) securityType = null; else { try { securityType = SecurityType.valueOf(requestedSecurityType.toUpperCase()); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(String.format( "Cannot set cluster security type to invalid value: %s", requestedSecurityType)); } } clusterRequest = new ClusterRequest( (Long) clusterProperties.get(ClusterResourceProvider.CLUSTER_ID_PROPERTY_ID), (String) clusterProperties.get(ClusterResourceProvider.CLUSTER_NAME_PROPERTY_ID), (String) clusterProperties.get(ClusterResourceProvider.CLUSTER_PROVISIONING_STATE_PROPERTY_ID), securityType, (String) clusterProperties.get(ClusterResourceProvider.CLUSTER_VERSION_PROPERTY_ID), null); } List<ConfigurationRequest> listOfRequests = ambariContext.createConfigurationRequests(clusterProperties); requestsPerService.addAll(listOfRequests); } // set total list of config requests, including all config types for this service if (clusterRequest != null) { clusterRequest.setDesiredConfig(requestsPerService); LOG.info("Sending cluster config update request for service = " + blueprintConfigRequest.getServiceName()); ambariContext.setConfigurationOnCluster(clusterRequest); } else { LOG.error("ClusterRequest should not be null for service = " + blueprintConfigRequest.getServiceName()); } } if (tag.equals(TopologyManager.TOPOLOGY_RESOLVED_TAG)) { // if this is a request to resolve config, then wait until resolution is completed try { // wait until the cluster topology configuration is set/resolved ambariContext.waitForConfigurationResolution(clusterName, updatedConfigTypes); } catch (AmbariException e) { LOG.error("Error while attempting to wait for the cluster configuration to reach TOPOLOGY_RESOLVED state.", e); } } } private static class BlueprintServiceConfigRequest { private final String serviceName; private List<BlueprintServiceConfigElement> configElements = new LinkedList<BlueprintServiceConfigElement>(); BlueprintServiceConfigRequest(String serviceName) { this.serviceName = serviceName; }
void function(List<BlueprintServiceConfigRequest> configurationRequests, String tag, Set<String> updatedConfigTypes) { String clusterName = null; try { clusterName = ambariContext.getClusterName(clusterTopology.getClusterId()); } catch (AmbariException e) { LOG.error(STR + clusterTopology.getClusterId(), e); throw new RuntimeException(e); } for (BlueprintServiceConfigRequest blueprintConfigRequest : configurationRequests) { ClusterRequest clusterRequest = null; List<ConfigurationRequest> requestsPerService = new LinkedList<ConfigurationRequest>(); for (BlueprintServiceConfigElement blueprintElement : blueprintConfigRequest.getConfigElements()) { Map<String, Object> clusterProperties = new HashMap<String, Object>(); clusterProperties.put(ClusterResourceProvider.CLUSTER_NAME_PROPERTY_ID, clusterName); clusterProperties.put(ClusterResourceProvider.CLUSTER_DESIRED_CONFIGS_PROPERTY_ID + "/type", blueprintElement.getTypeName()); clusterProperties.put(ClusterResourceProvider.CLUSTER_DESIRED_CONFIGS_PROPERTY_ID + "/tag", tag); for (Map.Entry<String, String> entry : blueprintElement.getConfiguration().entrySet()) { clusterProperties.put(ClusterResourceProvider.CLUSTER_DESIRED_CONFIGS_PROPERTY_ID + STR + entry.getKey(), entry.getValue()); } if (blueprintElement.getAttributes() != null) { for (Map.Entry<String, Map<String, String>> attribute : blueprintElement.getAttributes().entrySet()) { String attributeName = attribute.getKey(); for (Map.Entry<String, String> attributeOccurrence : attribute.getValue().entrySet()) { clusterProperties.put(ClusterResourceProvider.CLUSTER_DESIRED_CONFIGS_PROPERTY_ID + STR + attributeName + "/" + attributeOccurrence.getKey(), attributeOccurrence.getValue()); } } } if (clusterRequest == null) { SecurityType securityType; String requestedSecurityType = (String) clusterProperties.get( ClusterResourceProvider.CLUSTER_SECURITY_TYPE_PROPERTY_ID); if(requestedSecurityType == null) securityType = null; else { try { securityType = SecurityType.valueOf(requestedSecurityType.toUpperCase()); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(String.format( STR, requestedSecurityType)); } } clusterRequest = new ClusterRequest( (Long) clusterProperties.get(ClusterResourceProvider.CLUSTER_ID_PROPERTY_ID), (String) clusterProperties.get(ClusterResourceProvider.CLUSTER_NAME_PROPERTY_ID), (String) clusterProperties.get(ClusterResourceProvider.CLUSTER_PROVISIONING_STATE_PROPERTY_ID), securityType, (String) clusterProperties.get(ClusterResourceProvider.CLUSTER_VERSION_PROPERTY_ID), null); } List<ConfigurationRequest> listOfRequests = ambariContext.createConfigurationRequests(clusterProperties); requestsPerService.addAll(listOfRequests); } if (clusterRequest != null) { clusterRequest.setDesiredConfig(requestsPerService); LOG.info(STR + blueprintConfigRequest.getServiceName()); ambariContext.setConfigurationOnCluster(clusterRequest); } else { LOG.error(STR + blueprintConfigRequest.getServiceName()); } } if (tag.equals(TopologyManager.TOPOLOGY_RESOLVED_TAG)) { try { ambariContext.waitForConfigurationResolution(clusterName, updatedConfigTypes); } catch (AmbariException e) { LOG.error(STR, e); } } } private static class BlueprintServiceConfigRequest { private final String serviceName; private List<BlueprintServiceConfigElement> configElements = new LinkedList<BlueprintServiceConfigElement>(); BlueprintServiceConfigRequest(String serviceName) { this.serviceName = serviceName; }
/** * Creates a ClusterRequest for each service that * includes any associated config types and configuration. The Blueprints * implementation will now create one ClusterRequest per service, in order * to comply with the ServiceConfigVersioning framework in Ambari. * * This method will also send these requests to the management controller. * * @param configurationRequests a list of requests to send to the AmbariManagementController. */
Creates a ClusterRequest for each service that includes any associated config types and configuration. The Blueprints implementation will now create one ClusterRequest per service, in order to comply with the ServiceConfigVersioning framework in Ambari. This method will also send these requests to the management controller
setConfigurationsOnCluster
{ "repo_name": "arenadata/ambari", "path": "ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterConfigurationRequest.java", "license": "apache-2.0", "size": 25429 }
[ "java.util.HashMap", "java.util.LinkedList", "java.util.List", "java.util.Map", "java.util.Set", "org.apache.ambari.server.AmbariException", "org.apache.ambari.server.controller.ClusterRequest", "org.apache.ambari.server.controller.ConfigurationRequest", "org.apache.ambari.server.controller.internal.ClusterResourceProvider", "org.apache.ambari.server.state.SecurityType" ]
import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.ambari.server.AmbariException; import org.apache.ambari.server.controller.ClusterRequest; import org.apache.ambari.server.controller.ConfigurationRequest; import org.apache.ambari.server.controller.internal.ClusterResourceProvider; import org.apache.ambari.server.state.SecurityType;
import java.util.*; import org.apache.ambari.server.*; import org.apache.ambari.server.controller.*; import org.apache.ambari.server.controller.internal.*; import org.apache.ambari.server.state.*;
[ "java.util", "org.apache.ambari" ]
java.util; org.apache.ambari;
127,423
public DecodedJWT verify(String token) throws JWTVerificationException { DecodedJWT jwt = JWT.decode(token); Algorithm algorithm = getAlgorithm(jwt); algorithm.verify(jwt); verifyClaims(jwt, claims); return jwt; }
DecodedJWT function(String token) throws JWTVerificationException { DecodedJWT jwt = JWT.decode(token); Algorithm algorithm = getAlgorithm(jwt); algorithm.verify(jwt); verifyClaims(jwt, claims); return jwt; }
/** * Perform the verification against the given Token, using any previous * configured options. * * @param token * to verify. * @return a verified and decoded JWT. * @throws AlgorithmMismatchException * if the algorithm stated in the token's header it's not equal to * the one defined in the {@link JWTVerifier}. * @throws SignatureVerificationException * if the signature is invalid. * @throws TokenExpiredException * if the token has expired. * @throws InvalidClaimException * if a claim contained a different value than the expected one. */
Perform the verification against the given Token, using any previous configured options
verify
{ "repo_name": "Mercateo/spring-security-jwt", "path": "src/main/java/com/mercateo/spring/security/jwt/token/verifier/JWTVerifier.java", "license": "apache-2.0", "size": 11599 }
[ "com.auth0.jwt.JWT", "com.auth0.jwt.algorithms.Algorithm", "com.auth0.jwt.exceptions.JWTVerificationException", "com.auth0.jwt.interfaces.DecodedJWT" ]
import com.auth0.jwt.JWT; import com.auth0.jwt.algorithms.Algorithm; import com.auth0.jwt.exceptions.JWTVerificationException; import com.auth0.jwt.interfaces.DecodedJWT;
import com.auth0.jwt.*; import com.auth0.jwt.algorithms.*; import com.auth0.jwt.exceptions.*; import com.auth0.jwt.interfaces.*;
[ "com.auth0.jwt" ]
com.auth0.jwt;
406,057
public static InstructionBuilder createOutputPortInstructions(InstructionBuilder ib, Node openFlowNode, NodeConnector outputPort) { logger.debug("createOutputPortInstructions() Node Connector ID is - Type=openflow: Node {} outPort {} ", openFlowNode, outputPort); List<Action> actionList = new ArrayList<Action>(); ActionBuilder ab = new ActionBuilder(); OutputActionBuilder oab = new OutputActionBuilder(); oab.setOutputNodeConnector(outputPort.getId()); ab.setAction(new OutputActionCaseBuilder().setOutputAction(oab.build()).build()); ab.setOrder(0); ab.setKey(new ActionKey(0)); actionList.add(ab.build()); // Create an Apply Action ApplyActionsBuilder aab = new ApplyActionsBuilder(); aab.setAction(actionList); ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build()); return ib; }
static InstructionBuilder function(InstructionBuilder ib, Node openFlowNode, NodeConnector outputPort) { logger.debug(STR, openFlowNode, outputPort); List<Action> actionList = new ArrayList<Action>(); ActionBuilder ab = new ActionBuilder(); OutputActionBuilder oab = new OutputActionBuilder(); oab.setOutputNodeConnector(outputPort.getId()); ab.setAction(new OutputActionCaseBuilder().setOutputAction(oab.build()).build()); ab.setOrder(0); ab.setKey(new ActionKey(0)); actionList.add(ab.build()); ApplyActionsBuilder aab = new ApplyActionsBuilder(); aab.setAction(actionList); ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build()); return ib; }
/** * Create Output Port Instruction * * @param ib Map InstructionBuilder without any instructions * @param dpidLong Long the datapath ID of a switch/node * @param port Long representing a port on a switch/node * @return ib InstructionBuilder Map with instructions */
Create Output Port Instruction
createOutputPortInstructions
{ "repo_name": "aryantaheri/controller", "path": "opendaylight/samples/differentiatedforwarding/src/main/java/org/opendaylight/controller/samples/differentiatedforwarding/OpenFlowUtils.java", "license": "epl-1.0", "size": 31248 }
[ "java.util.ArrayList", "java.util.List", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCaseBuilder", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey", "org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder", "org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder", "org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder", "org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector", "org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node" ]
import java.util.ArrayList; import java.util.List; import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action; import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCaseBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action; import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import java.util.*; import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.*; import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.*; import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.*; import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.*; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.*; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.*; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.*; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.*; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.*;
[ "java.util", "org.opendaylight.yang" ]
java.util; org.opendaylight.yang;
2,189,261
void visit(Annotation node);
void visit(Annotation node);
/** * Visits an AST node of type Annotation. * * @param node * The AST node to visit */
Visits an AST node of type Annotation
visit
{ "repo_name": "team-worthwhile/worthwhile", "path": "implementierung/src/worthwhile.model/src/edu/kit/iti/formal/pse/worthwhile/model/ast/visitor/IASTNodeVisitor.java", "license": "bsd-3-clause", "size": 13590 }
[ "edu.kit.iti.formal.pse.worthwhile.model.ast.Annotation" ]
import edu.kit.iti.formal.pse.worthwhile.model.ast.Annotation;
import edu.kit.iti.formal.pse.worthwhile.model.ast.*;
[ "edu.kit.iti" ]
edu.kit.iti;
494,700
public static boolean containsProperty(Set<String> propertyIds, String propertyId) { if (propertyIds.contains(propertyId)){ return true; } String category = PropertyHelper.getPropertyCategory(propertyId); while (category != null) { if ( propertyIds.contains(category)) { return true; } category = PropertyHelper.getPropertyCategory(category); } return false; }
static boolean function(Set<String> propertyIds, String propertyId) { if (propertyIds.contains(propertyId)){ return true; } String category = PropertyHelper.getPropertyCategory(propertyId); while (category != null) { if ( propertyIds.contains(category)) { return true; } category = PropertyHelper.getPropertyCategory(category); } return false; }
/** * Check if the given property id or one of its parent category ids is contained * in the given set of property ids. * * @param propertyIds the set of property ids * @param propertyId the property id * * @return true if the given property id of one of its parent category ids is * contained in the given set of property ids */
Check if the given property id or one of its parent category ids is contained in the given set of property ids
containsProperty
{ "repo_name": "radicalbit/ambari", "path": "ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PropertyHelper.java", "license": "apache-2.0", "size": 26945 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,300,410
@Test public void testInStreamTimeOut3() throws Exception { final Logger log = Logger.getLogger("TestDatabusHttpClient.testInStreamTimeout3"); Level debugLevel = Level.DEBUG; log.setLevel(debugLevel); //Logger.getRootLogger().setLevel(Level.DEBUG); MockServerChannelHandler.LOG.setLevel(debugLevel); final int eventsNum = 20; DbusEventInfo[] eventInfos = createSampleSchema1Events(eventsNum); //simulate relay buffers DbusEventBuffer relayBuffer = new DbusEventBuffer(_bufCfg); relayBuffer.start(0); writeEventsToBuffer(relayBuffer, eventInfos, 4); //prepare stream response ??????????????// Checkpoint cp = Checkpoint.createFlexibleCheckpoint(); final DbusEventsStatisticsCollector stats = new DbusEventsStatisticsCollector(1, "test1", true, false, null); // create ChunnelBuffer and fill it with events from relayBuffer ChannelBuffer streamResPrefix = NettyTestUtils.streamToChannelBuffer(relayBuffer, cp, 20000, stats); //create client _stdClientCfgBuilder.getContainer().setReadTimeoutMs(DEFAULT_READ_TIMEOUT_MS); final DatabusHttpClientImpl client = new DatabusHttpClientImpl(_stdClientCfgBuilder.build()); final TestConsumer consumer = new TestConsumer(); client.registerDatabusStreamListener(consumer, null, SOURCE1_NAME); client.start(); // connect to a relay created in SetupClass (one out of three)
void function() throws Exception { final Logger log = Logger.getLogger(STR); Level debugLevel = Level.DEBUG; log.setLevel(debugLevel); MockServerChannelHandler.LOG.setLevel(debugLevel); final int eventsNum = 20; DbusEventInfo[] eventInfos = createSampleSchema1Events(eventsNum); DbusEventBuffer relayBuffer = new DbusEventBuffer(_bufCfg); relayBuffer.start(0); writeEventsToBuffer(relayBuffer, eventInfos, 4); Checkpoint cp = Checkpoint.createFlexibleCheckpoint(); final DbusEventsStatisticsCollector stats = new DbusEventsStatisticsCollector(1, "test1", true, false, null); ChannelBuffer streamResPrefix = NettyTestUtils.streamToChannelBuffer(relayBuffer, cp, 20000, stats); _stdClientCfgBuilder.getContainer().setReadTimeoutMs(DEFAULT_READ_TIMEOUT_MS); final DatabusHttpClientImpl client = new DatabusHttpClientImpl(_stdClientCfgBuilder.build()); final TestConsumer consumer = new TestConsumer(); client.registerDatabusStreamListener(consumer, null, SOURCE1_NAME); client.start();
/** * same as above, but server doesn't send any data, and WriteComplete comes between WriteTimeout * and channel close * @throws Exception */
same as above, but server doesn't send any data, and WriteComplete comes between WriteTimeout and channel close
testInStreamTimeOut3
{ "repo_name": "rahuljoshi123/databus", "path": "databus-client/databus-client-http/src/test/java/com/linkedin/databus/client/TestDatabusHttpClient.java", "license": "apache-2.0", "size": 142071 }
[ "com.linkedin.databus.client.netty.NettyTestUtils", "com.linkedin.databus.core.Checkpoint", "com.linkedin.databus.core.DbusEventBuffer", "com.linkedin.databus.core.DbusEventInfo", "com.linkedin.databus.core.monitoring.mbean.DbusEventsStatisticsCollector", "com.linkedin.databus2.test.container.MockServerChannelHandler", "org.apache.log4j.Level", "org.apache.log4j.Logger", "org.jboss.netty.buffer.ChannelBuffer" ]
import com.linkedin.databus.client.netty.NettyTestUtils; import com.linkedin.databus.core.Checkpoint; import com.linkedin.databus.core.DbusEventBuffer; import com.linkedin.databus.core.DbusEventInfo; import com.linkedin.databus.core.monitoring.mbean.DbusEventsStatisticsCollector; import com.linkedin.databus2.test.container.MockServerChannelHandler; import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.jboss.netty.buffer.ChannelBuffer;
import com.linkedin.databus.client.netty.*; import com.linkedin.databus.core.*; import com.linkedin.databus.core.monitoring.mbean.*; import com.linkedin.databus2.test.container.*; import org.apache.log4j.*; import org.jboss.netty.buffer.*;
[ "com.linkedin.databus", "com.linkedin.databus2", "org.apache.log4j", "org.jboss.netty" ]
com.linkedin.databus; com.linkedin.databus2; org.apache.log4j; org.jboss.netty;
287,654