query stringlengths 8 1.54M | document stringlengths 9 312k | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
fork Make the thread execute runObj.run() | public void fork(Runnable runObj) {
Debug.print('t', "Forking thread: " + getName() + "\n");
Debug.ASSERT((status == JUST_CREATED),
"Attempt to fork a thread that's already been forked");
runnableObject = runObj;
start();
int oldLevel = Interrupt.setLevel(Interrupt.IntOff);
Schedule... | [
"C forked();",
"Fork createFork();",
"public void start() throws ForkException {\r\n \t\tif (wasStarted) {\r\n \t\t\tthrow new IllegalStateException(\"The fork has already been started. A fork can only be started once!\");\r\n \t\t}\r\n \r\n\t\tString tempFullyQualifiedForkName = IntegrityDSLUtil.getQualifiedFo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test of set/getResourceId method, of class TextRegion. | @Test
public void testSetAndGetResourceId() {
System.out.println("getResourceId");
TextRegion instance = new TextRegion();
assertNull(instance.getResourceId());
String expResult = "resourceId";
instance.setResourceId(expResult);
String result = instance.getResourceId();
assertEquals(expRes... | [
"@Test\n public void testSetAndGetRegion() {\n System.out.println(\"getRegion\");\n TextRegion instance = new TextRegion();\n assertNull(instance.getRegion());\n String expResult = \"region\";\n instance.setRegion(expResult);\n String result = instance.getRegion();\n assertEquals(expResult, re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "rulemul_op_mul" $ANTLR start "entryRulemul_op_div" ../org.openmodelica.modelicaml.editor.xtext.modeleditor.ui/srcgen/org/openmodelica/modelicaml/editor/xtext/model/ui/contentassist/antlr/internal/InternalModeleditor.g:874:1: entryRulemul_op_div : rulemul_op_div EOF ; | public final void entryRulemul_op_div() throws RecognitionException {
try {
// ../org.openmodelica.modelicaml.editor.xtext.modeleditor.ui/src-gen/org/openmodelica/modelicaml/editor/xtext/model/ui/contentassist/antlr/internal/InternalModeleditor.g:875:1: ( rulemul_op_div EOF )
// ../or... | [
"public final void entryRulemul_op_dotdiv() throws RecognitionException {\r\n try {\r\n // ../org.openmodelica.modelicaml.editor.xtext.modeleditor.ui/src-gen/org/openmodelica/modelicaml/editor/xtext/model/ui/contentassist/antlr/internal/InternalModeleditor.g:935:1: ( rulemul_op_dotdiv EOF )\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete the civilite by id. | public void delete(Long id) {
log.debug("Request to delete Civilite : {}", id);
civiliteRepository.deleteById(id);
} | [
"public void delete(Long id) {\n log.debug(\"Request to delete Ivision : {}\", id);\n ivisionRepository.deleteById(id);\n }",
"@Override\n public void delete(Long id) {\n log.debug(\"Request to delete Cities : {}\", id);\n citiesRepository.deleteById(id);\n }",
"void deleteT... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(String) number of millis since 1970 that this group was certified for deprovisioning. i.e. the group managers indicate that the deprovisioned users are ok being in the group and do not send email reminders about it anymore until there are newly deprovisioned entities | public String getCertifiedMillisString() {
return this.certifiedMillisString;
} | [
"public void setCertifiedMillis(Long deprovisioningCertifiedMillis) {\r\n this.certifiedMillisString = GrouperUtil.stringValue(deprovisioningCertifiedMillis);\r\n }",
"public void setCertifiedMillisString(String deprovisioningCertifiedMillisString1) {\r\n this.certifiedMillisString = deprovisioningCertifie... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "rule__Array_subscripts__Group__3__Impl" $ANTLR start "rule__Array_subscripts__Group_2__0" ../org.openmodelica.modelicaml.editor.xtext.modeleditor.ui/srcgen/org/openmodelica/modelicaml/editor/xtext/model/ui/contentassist/antlr/internal/InternalModeleditor.g:4549:1: rule__Array_subscripts__Group_2__0 : rule__... | public final void rule__Array_subscripts__Group_2__0() throws RecognitionException {
int stackSize = keepStackSize();
try {
// ../org.openmodelica.modelicaml.editor.xtext.modeleditor.ui/src-gen/org/openmodelica/modelicaml/editor/xtext/model/ui/contentassist/antlr/interna... | [
"public final void rule__Array_subscripts__Group__2__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.openmodelica.modelicaml.editor.xtext.modeleditor.ui/src-gen/org/openmodelica/modelicaml/editor/xtext/model/ui/conten... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the montoPropinaReversoAnulacion value for this ITarjetasCierre_400RespuestaConsultarCierreIDatosProductoMonedaPlanDecretosAnulaciones. | public void setMontoPropinaReversoAnulacion(java.lang.Double montoPropinaReversoAnulacion) {
this.montoPropinaReversoAnulacion = montoPropinaReversoAnulacion;
} | [
"public void setMontoReversoAnulacion(java.lang.Double montoReversoAnulacion) {\r\n this.montoReversoAnulacion = montoReversoAnulacion;\r\n }",
"public void setMontoPropinaAnulacion(java.lang.Double montoPropinaAnulacion) {\r\n this.montoPropinaAnulacion = montoPropinaAnulacion;\r\n }",
"pub... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test of getCarAt method, of class Board. | @Test
public void testGetCarAtVertical() {
Position pos1 = new Position(0, 0);
Position pos2 = new Position(1, 0);
Position pos3 = new Position(2, 0);
Car car = new Car('A', 3, Orientation.VERTICAL, pos1);
Board instance = new Board();
instance.put(car);
... | [
"@Test\r\n public void testGetCarAtHorizontal() {\r\n Position pos1 = new Position(2, 1);\r\n Position pos2 = new Position(2, 2);\r\n Position pos3 = new Position(2, 3);\r\n Car car = new Car('A', 3, Orientation.HORIZONTAL, pos1);\r\n Board instance = new Board();\r\n in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a the list of rates from the JSON file | List<R> getRatesList(Context context, String path) throws CustomException; | [
"ResponseEntity<List<TOURates>> getTouRates();",
"@ApiModelProperty(value = \"Rates that will be applied during the duration of the car rental requested. These rates are generally not inclusive of tax and are used by the car rental company to compute the total cost at the end of the rental period.\")\n public Li... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check lengths of int[][] | protected void checkLengths(int[][] scores){
int n0 = scores.length;
int n1 = scores[0].length;
for(int i=1; i<n0; i++){
if(scores[i].length!=n1){
throw new IllegalArgumentException("The length of each item and of each person's responses must be identical (missing res... | [
"public static boolean checkValidSize(int size,int[][] arr,int length) \r\n {\r\n for(int i=0;i<=length-size;i++){\r\n for(int j=0; j<=length-size;j++){\r\n if(checkNoTree(i,j,size,arr))\r\n return true;\r\n }\r\n\r\n }\r\n retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks to see if the given point is of color black. | private boolean isBlack(final Point p) {
return isBlack(p.x, p.y);
} | [
"private boolean isBlack(Color color){\r\n return color == Color.black;\r\n }",
"private boolean isBlack(Node node) {\n Circle temp = (Circle) node;\n return temp.getFill() == Paint.valueOf(\"black\");\n }",
"private boolean isBlack(int x, int y, BufferedImage image) {\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Whenever the page needs to be updated call this and it will update the survey data displayed | public void updateSurveyItems() {
WellbeingDatabaseModule.databaseExecutor.execute(() -> {
List<RawSurveyData> rawSurveyDataList = this.db.wellbeingRecordDao().getDataBySurvey(surveyId);
if(rawSurveyDataList == null || rawSurveyDataList.size() == 0) {
// This converts a ... | [
"private void updateSurveyCompleted() {\n\t\tSharedPreferences settings = getSharedPreferences(\"app_survey\", 0);\n\t\tSharedPreferences.Editor editor = settings.edit();\n\t\teditor.putBoolean(\"survey\", true);\n\t\teditor.commit();\n\t}",
"public void surveyUpdated (SurveyMetaData survey)\n {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Runs tests on generic AStack and LStack classes with Integer and String. | public static void main(String args[]) throws IOException {
// Create a useFile to record errors if necessary
record = new ErrorRec(useFile, "StackTest");
// Test Integer
AStack as = new AStack();
LStack ls = new LStack();
testInt(as);
testInt(ls);
// Test String
AStack as1 = new A... | [
"@Test\n public void testStackInteger() {\n DatastructureTest.INTSTACK.push(3);\n DatastructureTest.INTSTACK.push(7);\n Assert.assertTrue(DatastructureTest.INTSTACK.peek() == 7);\n Assert.assertTrue(DatastructureTest.INTSTACK.pop() == 7);\n Assert.assertTrue(DatastructureTest.I... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send a Buffer as a message | <T> Promise<Message<T>> send(String address, Buffer message); | [
"private void send(Message outgoing, ByteBuffer buffer, SocketChannel channel, boolean debug) throws IOException {\n\t\tif (debug)\n\t\t\tSystem.out.println(\"Worker Thread \" + threadID + \" sending new message: \" + outgoing.toString());\n\t\tbuffer = ByteBuffer.wrap(Serializer.serialize(outgoing));\n\t\tchannel.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change the Reporter for this action | public void setActionReport(ActionReport newReport); | [
"public void setReporter( Reporter reporter ) {\n reporter_ = reporter;\n }",
"void setReporter(Reporter processor);",
"public void setReporter(ReporterStrategy reporter) {\n this.reporter = reporter;\n }",
"public void setReporterName(String reporterName) {\r\n this.reporterName = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an input photo stored in a uri, save it to a destination uri | public static boolean savePhotoFromUriToUri(Context context, Uri inputUri, Uri outputUri,
boolean deleteAfterSave) {
FileOutputStream outputStream = null;
InputStream inputStream = null;
try {
outputStream = context.getContentResolver()... | [
"public void saveImage(){\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n\n // Ensure that there's a camera activity to handle the intent\n if (takePictureIntent.resolveActivity(activity.getPackageManager()) != null) {\n // Create the File where the photo ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts a JSON InputStream into a StreamMessage object using the provided ObjectMapper. | public static StreamMessage fromJson(final InputStream json, final ObjectMapper objectMapper) {
// Convert all checked exceptions to Runtime
try {
return objectMapper.readValue(json, StreamMessage.class);
} catch (final JsonMappingException | JsonParseException e) {
throw... | [
"public static StreamMessage fromJson(final String json, final ObjectMapper objectMapper) {\n // Convert all checked exceptions to Runtime\n try {\n return objectMapper.readValue(json, StreamMessage.class);\n } catch (final JsonMappingException | JsonParseException e) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates a puzzle by removing random positions within the array that only have one number for each empty cell, this is checked by using checkOneChoice(). | public void generateEasyPuzzle(){
Random r = new Random();
int low = 0;
int high = 80;
//System.out.println("Positions that was changed to 0");
for(int i = 0; i < 50; i++){ //iterates through 40 times
int R = r.nextInt(high-low)+low; //generates ... | [
"private void reduceSolutionToPuzzle(SudokuState state, Level level)\n {\n Random r = new Random(System.currentTimeMillis());\n state.getBoard().getCells().stream().filter(cell -> r.nextInt(81) > level.initialFill).forEach(cell -> cell.removeNumber());\n state.setInitial();\n }",
"priva... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the upgradeDescription property: The policy to use when upgrading the cluster. | ClusterUpgradePolicy upgradeDescription(); | [
"public ClusterUpgradePolicy upgradeDescription() {\n return this.upgradeDescription;\n }",
"Update withUpgradeDescription(ClusterUpgradePolicy upgradeDescription);",
"interface WithUpgradeDescription {\n /**\n * Specifies the upgradeDescription property: The policy to use when ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the static definition of an entity of the given Type and hash identifier. Examine the API Documentation for the Type Names of entities that have their own definitions. Note that the return type will always inherit from DestinyDefinition, but the specific type returned will be the requested entity type if it can... | @Test
public void destiny2GetDestinyEntityDefinitionTest() {
String entityType = null;
Long hashIdentifier = null;
InlineResponse20034 response = api.destiny2GetDestinyEntityDefinition(entityType, hashIdentifier);
// TODO: test validations
} | [
"public org.apache.xmlbeans.XmlString xgetDefinitionType()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(DEFINITIONTYPE$18, 0);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getter for property totalSimSukarela. | public double getTotalSimSukarela() {
return this.totalSimSukarela;
} | [
"public double getTotalSimPokok() {\n return this.totalSimPokok;\n }",
"public double getTotalSimWajib() {\n return this.totalSimWajib;\n }",
"public void setTotalSimSukarela(double totalSimSukarela) {\n this.totalSimSukarela = totalSimSukarela;\n }",
"public double getTotalKoper... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
repeated .assistant.api.params.DialogStateParams.DialogSnapshot dialog_snapshots = 1; | com.google.assistant.api.params.proto.DialogStateParamsProto.DialogStateParams.DialogSnapshot getDialogSnapshots(int index); | [
"java.util.List<com.google.assistant.api.params.proto.DialogStateParamsProto.DialogStateParams.DialogSnapshot> \n getDialogSnapshotsList();",
"public com.google.assistant.api.params.proto.DialogStateParamsProto.DialogStateParams.DialogSnapshot.Builder addDialogSnapshotsBuilder() {\n return getDialog... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generated method Getter of the TermVersion.termsVersionIdentifier attribute. | public String getTermsVersionIdentifier()
{
return getTermsVersionIdentifier( getSession().getSessionContext() );
} | [
"public String getTermsVersionIdentifier(final SessionContext ctx)\n\t{\n\t\treturn (String)getProperty( ctx, TERMSVERSIONIDENTIFIER);\n\t}",
"public String getTermsVersionId(final SessionContext ctx)\n\t{\n\t\treturn (String)getProperty( ctx, TERMSVERSIONID);\n\t}",
"public String getTermsVersionId()\n\t{\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add the created action message for the key 'constraints.Past.message' with parameters. message: PAST | @Override
public HangarMessages addConstraintsPastMessage(String property) {
assertPropertyNotNull(property);
add(property, new UserMessage(CONSTRAINTS_Past_MESSAGE));
return this;
} | [
"public void setPlayerPast(String playerPast) {\n this.playerPast = playerPast;\n }",
"public Action getPasteAction() {\n return pasteAction;\n }",
"public Action getPasteAction () {\n\t\treturn pasteAction;\n\t}",
"public void paste(){\n JEditorPane editorPane = this.writeMessageP... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enable writing to everything that is allowed by default The WriteMask defines the writable attributes, except for Value, which is controlled by UserAccessLevel (above) The following would deny write access for anonymous users: if (serviceContext.getSession().getUserIdentity().getType().equals( UserTokenType.Anonymous))... | @Override
public EnumSet<WriteAccess> onGetUserWriteMask(ServiceContext serviceContext, NodeId nodeId, UaNode node) {
return EnumSet.allOf(WriteAccess.class);
} | [
"boolean isWriteOnly();",
"public boolean getWriteOnly() {\n return _writeOnly;\n }",
"boolean isWriteAccess();",
"public Boolean getWriteOnly() {\n\t\treturn writeOnly;\n\t}",
"private boolean hasWritePermission() {\n return true;\n\n }",
"@ApiModelProperty(value = \"True, if the priv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether given function is allowed in given state or not. | private static void _VerifyAllowedFunction(short function, short state){
switch (function){
case FUNC_blockCard: {
if (state == STATE_INSTALLED) break;
if (state == STATE_SELECTED) break;
throw new RuntimeException("Function is not allowed in current state");}
case FUNC_install: {
if (s... | [
"boolean isAble(CostFunction function);",
"public boolean validateState(States state);",
"public boolean isInFunction(Address addr);",
"private boolean checkFunction( String func){\n\t\tboolean ret = false;\n\t\t\n\t\tif(functionmap.containsKey(func)){\n\t\t\t//System.out.print(\"testing '\" + func + \"' : \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); | public static native void AnnouncementSignatures_set_channel_id(long this_ptr, byte[] val); | [
"public static native void CommitmentSigned_set_channel_id(long this_ptr, byte[] val);",
"public static native void FundingSigned_set_channel_id(long this_ptr, byte[] val);",
"public static native void ChannelDetails_set_channel_id(long this_ptr, byte[] val);",
"public static native void ClosingSigned_set_cha... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the base shape that this animatedObject is associated with. | Shape getBaseShape(); | [
"IShape getCurrentShape();",
"Shape getShape();",
"public IShape getShape() {\n return this.shape.copy();\n }",
"public Shape getCurrentShape() {\r\n\t\treturn currentShape;\r\n\t}",
"EasyObject getInitialShape();",
"public FireShapes getShape() {\r\n\t\treturn shape;\r\n\t}",
"public Shape getShape... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Set's the counter's totalRows to passed num and sets the passed progress bar's max num to totalRows. Sets the progress. | public void setProgressBarMax(int num) {
this.totalRows = num;
this.progressBar.setMax(this.totalRows);
setProgress();
} | [
"public void setProgress() {\n if (this.progressBar != null && this.totalRows > 0) {\n this.progressBar.setProgress(this.counterNumber);\n String formattedProgressNumber = String.format(this.strResProgress, this.findPercent());\n this.textProgress.setText(formattedProgressNum... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method for the zoo shut down, iterates through the array of animals and applies the sleep method on each one. | public void shutDown() {
System.out.println("Shutting down the zoo for the day...\n");
for (int i = 0; i < zoo.length; i++){
zoo[i].sleep();
}
System.out.println();
System.out.println("That's all, thanks for coming!");
} | [
"public void wakeAnimals() {\n System.out.println(\"Waking the animals up...\\n\");\n for (int i = 0; i < zoo.length; i++){\n zoo[i].wake();\n }\n System.out.println();\n }",
"public void sleepAnimals(ArrayList<Animal> animalList){\n\n AnimalTask sleepAnimals = new... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the LPG measurements between timestamps for room name. | @RequestMapping(value = "/lpg", method = RequestMethod.GET)
public ResponseEntity<List<LiquefiedPetroleumGasMeasurement>> getLiquefiedPetroleumGasMeasurementBetweenTimestamps(
@PathVariable String username, @RequestParam("from") long from,
@RequestParam("to") long to, @RequestParam(value = "room", required = fal... | [
"public List<LiquefiedPetroleumGasMeasurement> getLiquefiedPetroleumGasMeasurementBetweenTimestamps(\n\t\t\tString username, long fromtimestamp, long totimestamp,\n\t\t\tString room_name) {\n\t\tlog.debug(\"getLiquefiedPetroleumGasMeasurementBetweenTimestamps\");\n\n\t\t// get sensing environment to which user belo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
testUpdate(ec + " entityClassChanged", signal); | public void entityClassChanged(EntityClass ec, int signal)
{
switch (signal) {
case TaListener.EC_ANGLE_SIGNAL:
case TaListener.STYLE_SIGNAL:
{
EntityInstance root = getRootInstance();
ec.adjustEdgePoints();
if (root != null) {
root.shapeChanges(ec);
}
m_flags |= RE... | [
"public void testNodeNameChanged() {\n\n\t}",
"public void testObservers() {\r\n\r\n }",
"@Test\n public void testUpdateEventForwarder() {\n // TODO: test UpdateEventForwarder\n }",
"@Test\n public void stateChangedAtTest() {\n // TODO: test stateChangedAt\n }",
"@Test\n public... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Action active photom 2. | @FXML
public void actionActivePhotom2() {
try {
moveActivephotoNumTo(-2);
refreshAllPhoto();
} catch (IOException | SQLException e) {
Context.popupalertException(e);
Context.excptlog(e, LOGGER);
}
} | [
"@FXML\n public void actionActivePhotop2() {\n try {\n moveActivephotoNumTo(+2);\n refreshAllPhoto();\n } catch (IOException | SQLException e) {\n Context.popupalertException(e);\n Context.excptlog(e, LOGGER);\n }\n }",
"@FXML\n public void... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the name of an image output by this algorithm, the image returned depends on the parameter label given (which can be used to retrieve the image object from the image registry). | public String getOutputImageName(final String imageParamName) {
if (imageParamName.equals(AlgorithmParameters.RESULT_IMAGE)) {
if (getResultImage() != null) {
// algo produced a new result image
return getResultImage().getImageName();
} else {
... | [
"String getOutputName();",
"java.lang.String getOutputName();",
"java.lang.String getImage();",
"private String getImageName() {\n return \"img/wall_\" + type.name().toLowerCase() + \".png\";\n }",
"private String getImageName() {\n Date date = new Date();\n String name = new... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extracts the Camera.Face data from the given Bitmap. | private Bitmap extractFace(FaceRecognitionRequest recognitionInputData) {
Bitmap bitmap = recognitionInputData.getBitmap();
Camera.Face face = recognitionInputData.getFace();
int rotation = recognitionInputData.getRotation();
return Util.extract(bitmap, face, rotation);
} | [
"private native int applyFaceDetection2(byte[] data,int len,int width,int height);",
"protected Result decode(BinaryBitmap bitmap) {\n possibleResultPoints.clear();\n try {\n if (reader instanceof MultiFormatReader) {\n // Optimization - MultiFormatReader's normal decode() ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets current ligands. updated every time atoms or bonds are added or removed | public List<CMLAtom> getLigandAtoms() {
if (ligandAtoms == null) {
ligandAtoms = new ArrayList<CMLAtom>();
}
return ligandAtoms;
} | [
"public List<CMLBond> getLigandBonds() {\r\n if (ligandBonds == null) {\r\n ligandBonds = new ArrayList<CMLBond>();\r\n }\r\n return ligandBonds;\r\n }",
"void clearLigandInfo() {\r\n int nlig = ligandAtoms.size();\r\n for (int i = nlig - 1; i >= 0; i--) {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getter method for property omcId. | public String getOmcId() {
return omcId;
} | [
"java.lang.String getClisSmoId();",
"public long getMcId() {\r\n\t\treturn mcId;\r\n\t}",
"public void setOmcId(String omcId) {\n\t\tthis.omcId = omcId;\n\t}",
"java.lang.String getCoId();",
"public int getOc_id() {\n return oc_id;\n }",
"public java.lang.Integer getOmimId() {\n return om... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Failure message: Tax on $82,000 is $1,210 | @Test
public void test82000() {
double tax = Main.calcTax(82_000.);
assertEquals(1_210., tax, .01);
} | [
"@Test\n\tpublic void test250000() {\n\n\tdouble tax = Main.calcTax(250_000.);\n\tassertEquals(7750., tax, .01);\n\n\t}",
"@Test\n\tpublic void test70000() {\n\n\tdouble tax = Main.calcTax(70_000.);\n\tassertEquals(900., tax, .01);\n\n\t}",
"@Test\n\tpublic void test110000() {\n\n\tdouble tax = Main.calcTax(110... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ function debug_ps Tom F. October 1992 This function outputs the values and states of internal variables | void debugPs() {
fprintf(System.err, "PS - variables:\n");
fprintf(System.err, "WIDTH = %f\n", width);
fprintf(System.err, "HEIGHT = %f\n", height);
fprintf(System.err, "PWIDTH = %f\n", pWidth);
fprintf(System.err, "PHEIGHT = %f\n", pHeight);
fprintf(System.er... | [
"public void printState()\n {\n System.out.println(\"Final State:\");\n for (String test:variables.keySet())\n {\n System.out.println(test + \" = \" + variables.get(test));\n }\n\n }",
"private static void logVariables() {\n\t\twriteLogBuffer(\"Instruction Pointer: \"+... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Select link on sub nav | public void selectLinkOnSubNav(String linkName)
{
WebElement subNav = driver.findElement(By.cssSelector(".tb-megamenu-subnav.mega-nav.level-1"));
List<WebElement> links = subNav.findElements(By.cssSelector(".tb-megamenu-item.level-2"));
for (WebElement link : links)
{
if (link.findElement... | [
"public Sources selectlinkundersource(String sublink) {\n\t\tWebElement selectedsource = commonLibrary.isExist(UIMAP_Sources.selectedsource, 20);\n\t\tWebElement actionlist = commonLibrary.isExist(selectedsource, UIMAP_Sources.actionList, 20);\n\t\tList<WebElement> lstTagListItems2 = commonLibrary.isExistList(actio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the text of this dialog message. | @Override
public java.lang.String getText() {
return _dialogMessage.getText();
} | [
"public String getText() {\n return msgText;\n }",
"public String getMessageText() {\r\n\t\treturn txtAreaWriteMessage.getText();\r\n\t}",
"String getMsgText();",
"public String getMessageText();",
"private String getMessageTxtPopUP() {\n return noticeMessage.getText();\n }",
"public String ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates all the items and adds them to the items ArrayList. | private void createItems()
{
Item belt, nappies, phone, money, cigarretes,
jacket, cereal, shoes, keys, comics, bra,
bread, bowl, computer;
belt = new Item(2,"Keeps something from falling","Belt");
nappies = new Item(7,"Holds the unspeakable","Nappies");
phone = ne... | [
"private void addItems() {\r\n\t\titems.add(new ItemDTO (10, \"te\", 0.12, \"TE\")); \r\n\t\titems.add(new ItemDTO (15, \"kanelbulle\", 0.12, \"KB\")); \r\n\t\titems.add(new ItemDTO (20, \"pepsi\", 0.12, \"PS\")); \r\n\t}",
"public void addAllItems ()\r\n\t{\t\t\r\n\t\t//Adding All Items to List\r\n\t\tcarKeys ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create an aliased activity_favorite table reference | public ActivityFavorite(String alias) {
this(DSL.name(alias), ACTIVITY_FAVORITE);
} | [
"private static TableRef createAliasedTableRef( final TableMeta table,\n final String alias ) {\n return new TableRef() {\n public String getColumnName( String rawName ) {\n return alias + \".\" + rawName;\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ We have created an interface Order which is acting as a command. | public interface Order {
void execute();
} | [
"public ShowOrderCommand() {\n\n }",
"public interface OrderProcessor {\n \n\n /**\n * Auto generated method signature\n * \n * @param getOrders0\n \n */\n\n \n public org.wso2.carbon.order.process.data.xsd.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pre: elem != null, xMin, xMax, yMin, and yMax are a quadrant in the quadtree. Recursive helper that returns reference to an element x within the tree such that elem.equals(x)is true, provided such a matching element occurs within the tree; returns null otherwise. | private T findHelper(T elem, prQuadNode node, double xMin, double xMax, double yMin, double yMax){
if(node == null){
return null;
}
if(node.getClass().equals( new prQuadInternal().getClass() )){
// If it is still an internal node we must keep searching.
prQuadInternal internalHandle = (prQuadInternal) n... | [
"private prQuadNode insertHelper(T elem, prQuadNode node, double xMin, double xMax, double yMin, double yMax){\n\t\t\n\t\tif(node == null){\n\t\t\t// There was an empty leaf we can put the element into\n\t\t\tinsertFlag = true;\n\t\t\treturn new prQuadLeaf(elem);\n\t\t}\n\n\n\t\tif( node.getClass().equals( new prQu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an input file of "a b c d" values representing points of each line segment, generate all intersections and produce a report. | public boolean executeFile (File f) {
LineSweep dba = new LineSweep();
ArrayList<ILineSegment> als = new ArrayList<ILineSegment>();
try {
Scanner sc = new Scanner (f);
while (sc.hasNext()) {
double[]vals = new double[4];
for(int i = 0; i < vals.length;i++) {
vals[i] = sc.nextDouble();
... | [
"public static void readFile(String in, String out) throws IOException {\n File inputFile = new File(in);\n File outputFile = new File(out);\n\n if (inputFile.isDirectory()) {\n System.out.println(\"ERROR: Wrong input fie path\");\n return;\n } else if (!inputFile.e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create an Image Pattern from a source Image and a repeat style. Possible Styles are repeat, repeatx, repeaty, or norepeat. defaults to repeat | @Override
public Pattern createPattern(Image image, String repeat) {
return new Pattern(image, repeat);
} | [
"public static synchronized void createPatternImage(String... args) {\n if(args.length < 1) {\n return;\n }\n\n reset();\n currentPattern = PatternReader.readPattern(args);\n createPatternImage(currentPattern, null);\n }",
"public ImagePattern getImagePattern() {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
send given image to the server | public void SendInfoToServer(File image) {
try {
FileInputStream fis = new FileInputStream(image);
Bitmap bm = BitmapFactory.decodeStream(fis);
byte[] imageBytes = getBytesFromBitmap(bm);
//send the number of bytes of the given image and it's name
Stri... | [
"private void sendImage(MessageReceivedEvent event, BufferedImage image) throws IOException {\n File tmpFile = TmpFiles.create(\"png\");\n ImageIO.write(image, \"png\", tmpFile);\n FileUpload fileUpload = FileUpload.fromData(tmpFile, \"carl.png\");\n event.getChannel().sendFiles(fileUplo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ This test checks the functionality of the readInputStream method. It should read input stream of strings with the format (size,number), discard invalid strings and call LCD.print method with valid input lines. | @Test
public void canReadInputLinesAndCallLcdPrintMethod() throws Exception {
String testCases = "2,2\n" + ",1\n" + "1,3\n" // Test cases, some valid, some invalid.
+ "e,2\n" + "3,\n" + "0,0";
InputStream inputStream = new ByteArrayInputStream(testCases.getBytes());
String correctMessage = "Call LCD.print()... | [
"@Test\n public void testRead() throws Exception {\n System.out.println(\"read\");\n final String unit = \"TEST_STRING\";\n List<String> strings = new ArrayList<>(1000);\n for (int i = 0; i < strings.size(); i++) {\n strings.set(i, unit);\n }\n IteratorInputSt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts the counter value to its SnmpOid form. | public SnmpOid toOid() {
return new SnmpOid(value) ;
} | [
"com.google.protobuf.Int64Value getId();",
"public void setOid(long value) {\r\n this.oid = value;\r\n }",
"long getToUid();",
"public String getConvertToId();",
"public synchronized String generateObjectId() {\n if (objectIdCounter == 10) {\n objectIdCounter = 1;\n }\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scenario: adding and removing functions. 1. New function is created. 2. The function is added to the container. 3. The container should contain the function. 4. Function should be able to access properties from the container. 5. Function is removed from the container. 6. The container shouldn't contain the function. | @Test
public void testAddingAndRemovingFunctions() throws Exception {
AdvancedExampleComponent component = new AdvancedExampleComponent();
XMLBasedPropertyContainer container = new XMLBasedPropertyContainer(XMLBasedPropertyProvider.getInstance()
.getMetaPropertiesSet(component.getClass()), component);
C... | [
"public interface FunctionLibraryManagementService {\n\n /**\n * Create a function library.\n *\n * @param functionLibrary Function library\n * @param tenantDomain Tenant domain\n * @throws FunctionLibraryManagementException\n */\n void createFunctionLibrary(FunctionLibrary function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new instance of Partage | public Partage() {
} | [
"public Part createPart();",
"private void createNewPart() {\n\t\tint newX, newY;\n\t\tDirection newDir;\n\t\tif (!parts.isEmpty()) {\n\t\t\tint lastPart = parts.size() - 1;\n\t\t\tRectangle lastPartsBounds = parts.get(lastPart).getLastBounds();\n\t\t\tnewX = (int) lastPartsBounds.getX();\n\t\t\tnewY = (int) last... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DAO for the AmigoUsers. | public interface AmigoUserDao {
List<AmigoUser> getAllAmigosInSystem();
/**
* Gets all amigos that the user can see.
* @param user The user to get amigos for.
* @return A list of Amigo Users for the auth user.
*/
List<AmigoUser> getAmigosForAuthUser(AuthUser user);
/**
* Gets... | [
"public interface UsersDAO {\n\n\tpublic List<Users> getAllUsers();\n\tpublic List<Users> retrieveUser(String uname, String upass);\n\tpublic Users getUserByName(String userName);\n\tpublic void addUser(Users user);\n\tpublic void updateUser(Users user);\n\tpublic void deleteUser (String userName);\n\t\n}",
"publ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds an event that refreshes the list of messages every 5 seconds. | private void AddRefreshEvent()
{
refreshTimer = new Timer();
final Handler refreshHandler = new Handler();
TimerTask refreshEvent = new TimerTask()
{
@Override
public void run() {
Runnable refreshThread = new Runnable()
{
... | [
"public void setInstantMessageRefreshEvent() {\r\n\r\n analyticsManager.sendEvent(\r\n AnalyticsConstants.COMLOG_REFRESH_EVENT, false,\r\n AnalyticsConstants.ACTION_CATEGORY);\r\n }",
"private void sendRefreshEvent()\n {\n ServerRefreshEvent event = new ServerRefr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
obtener las notificaciones del artista y convertirlos en ArrayList | @Override
public ArrayList<NotificacionArtista> listarNotificacionesArtista(String idArtista) {
Artista f = (Artista) this.obtenerDatosUsuario(idArtista);
if (f == null) {
throw new RuntimeException(MensajesExcepciones.artistaNoExiste);
}
ArrayList<NotificacionArtista> ret = new ArrayList<NotificacionArtist... | [
"public abstract ArrayList<Proiettile> getProiettili();",
"public ArrayList<String> getNotificaciones(){\n return notificaciones;\n }",
"public ArrayList<NodoArticulo> articulosMasVendidos() {\n ArrayList<NodoArticulo> aux = new ArrayList<NodoArticulo>();\n for (int i = 0; i < this.getListaArt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the maximum width of glyphs in the font. The default value is zero. | public float getMaxWidth() {
Object value = library.getObject(entries, MAX_WIDTH);
if (value instanceof Number) {
return ((Number) value).floatValue();
}
return 0.0f;
} | [
"public\tint\t\t\tgetMaximumWidth();",
"private float calculateTextMaxWidth() {\r\n\t\tfloat maxWidth = 0;\r\n\t\tfor (Element e : c_elems) {\r\n\t\t\tfloat w = 0;\r\n\t\t\tif (e instanceof Phrase)\r\n\t\t\t\tw = getPhraseWidth((Phrase) e);\r\n\t\t\telse if (e instanceof Chunk)\r\n\t\t\t\tw = getChunkWidth((Chunk... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end of onDoor method This method is to see if the player is at the stairs. | public boolean onStairs(){
int yp = 0; int xp = 0;
int ys = 1; int xs = 1;
for(int i = 0; i < this.position.length; i ++){//looks though arrays to gather position
for(int p = 0 ; p < this.position.length; p++){
if(this.position[i][p] == 1 && this.Stairs[i][p] == 1){
yp=i; xp=p;
ys=i; xs=p;
} ... | [
"private void playerOnStairs() {\n int playerX = (int) (player.getX() / TILEWIDTH);\n int playerY = (int) (player.getY() / TILEHEIGHT);\n\n if(map.getStairX() == playerY && map.getStairY() == playerX){\n onStair = true;\n\n if(keyManager.isKey(\"SPA\")) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test both pen and fill color of the shape whe reading the file | @Test
void TestPenFill() throws ShapeException {
vecReader = new VecReader("TestFiles/VecTest.vec");
ArrayList<AbstractShape> shapes = vecReader.GetData();
assertEquals(Color.decode("#FF0000"), shapes.get(shapes.size()-1).getPenColor());
assertEquals(Color.decode("#FFFF00"), shapes.g... | [
"@Test\n void TestPen() throws ShapeException {\n vecReader = new VecReader(\"TestFiles/VecTest.vec\");\n ArrayList<AbstractShape> shapes = vecReader.GetData();\n assertEquals(Color.decode(\"#0000FF\"), shapes.get(2).getPenColor());\n }",
"abstract public void readShape();",
"void rea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
string provenance = 1; | public Builder setProvenance(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
idCase_ = 1;
id_ = value;
onChanged();
return this;
} | [
"java.lang.String getProvenance();",
"public Builder setProvenance(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n provenance_ = value;\n onChanged();\n return this;\n }",
"public java.lang.String getProvenance() {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
print a list of applicants the interviewer must interview from each job posting. | void applicantsToInterview(CompanyManager cmane, JobPostingManager jmane, ApplicantManager appmane) {
Company mycomp = cmane.getCompanybyID(this.Company);
for (Integer i : mycomp.getArchives().getJobPostings()) {
JobPosting jobpost = jmane.getJobPosting(i);
System.out.println("... | [
"public void printApplicantTable() {\n\n System.out.printf(\"%-30s%-18s%-10s%-20s%-15s\", \"Company Name\",\"Applicant\", \"GPA\", \"College\", \"Skills\");\n System.out.println();\n\n System.out.println(\"-------------------------------------------\" +\n \"--------------... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get attribute value. Attempts to get attribute value from AttributeValuesCollection. If not found or the AttributeValuesCollection is null will return new AttributeValue. | private AttributeValue getAttributeValue(final DynamicAttribute dynamicAttribute, AttributeValuesCollection dynamicAttributeValues) {
AttributeValue attributeValue = null;
if (dynamicAttributeValues != null) {
attributeValue = dynamicAttributeValues.get(dynamicAttribute);
}
... | [
"public ConstantValue_attribute findConstantValue_attribute() {\n int i;\n for (i = 0; i < attributes_count; i++) {\n if ((attributes[i]) instanceof ConstantValue_attribute) {\n return (ConstantValue_attribute) (attributes[i]);\n }\n }\n return null;\n }",
"private java.lang.Object g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an IValue from the given data Tensor, the allowed conversion to Tensor supported are UINT8, INT8, INT32, FLOAT32, INT64, FLOAT64 The data is first converted to the Tensor type defined, and then this Tensor is converted to IValue, since the forward function in Module expects IValue(s) only | @NotNull
private IValue iValueFromTensorValue(Object data, long[] shape, String toType) throws Exception {
@NotNull IValue result;
switch (toType) {
case "UINT8":
case "INT8": {
byte[] _data;
if (data instanceof byte[]) {
by... | [
"@NotNull\n private IValue iValueFromImageTensor(Object data, double[] mean, double[] std) throws Exception {\n @NotNull IValue result;\n float[] mean_ = Floats.toArray(Doubles.asList(mean));\n float[] std_ = Floats.toArray(Doubles.asList(std));\n if (data instanceof byte[]) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get action for starting the service process viewer. | public Action getProcessViewAction() {
return processViewAction;
} | [
"public String getProcessAction() {\n\t\treturn processAction;\n\t}",
"private PDFLaunch getLaunchAction(final String file) {\n getDocument().getProfile().verifyActionAllowed();\n\n PDFFileSpec fileSpec = new PDFFileSpec(file);\n final PDFFileSpec oldSpec = getDocument().findFileSpec(fileSpec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inserts a value to the set. Returns true if the set did not already contain the specified element. | public boolean insert(int val) {
if (!set.contains(val)) {
set.add(val);
return true;
} else return false;
} | [
"public boolean insert(int val) {\n if (!set.contains(val)) {\n set.add(val);\n return true;\n } else {\n return false;\n }\n }",
"public boolean insert(int val) {\r\n return set.add(val);\r\n }",
"public boolean insert(int val) {\n\t\tboolean r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end of findMaxofColumn find minimum value in a 2D matrix column | public static int findMinOfColumn(int[][] matrix, int column){
int lowestValue = 2147483647; //set variable to lowest non negative value
for(int i = 0; i < ROWS; i++){ //loop through the 2D array column
if(matrix[i][column] < lowestValue){ //if element > highestValue, save value
... | [
"public static int findMin(int[][] matrix){\n int lowestValue = 2147483647; //set variable to highest signed integer value\n for(int i = 0; i < ROWS; i++){ //loop through the 2D array\n for(int j = 0; j < COLUMNS; j++){\n if(matrix[i][j] < lowestValue){ //if element > highest... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the cells occupied by pieces if a certain color. | public long piecesCells(Color color) {
long res = 0;
for (Piece p : this.pieces)
if (p.getAlive() && p.getColor() == color)
res |= p.getPosition();
return res;
} | [
"public long getProtectedCells(Color color) {\n long res = 0;\n for (Piece p : this.pieces)\n if (p.getColor() == color && p.getAlive())\n res |= p.threatenedCells(0, this.getOccupiedCells());\n return res;\n\n }",
"public long getThreatenedCells(Color color) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a document id for a given token in the posting list. | public void addToken(int documentId, List<String> tokens, Object value) {
// Use inverted index for fulltext search purposes
// TODO-03-d For each token, add it to posting list
tokens.forEach(token -> addTokenToPostingList(documentId, token));
if (withColumnarStorage) {
//TO... | [
"public void insert( String token, int docID, int offset ) {\r\n\t//\r\n\t// YOUR CODE HERE\r\n\t// \r\n PostingsList postList = index.get(token);\r\n if(postList == null){\r\n postList = new PostingsList();\r\n index.put(token, postList);\r\n }\r\n postList.add(d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempts to find a version after the latest one we have, or times out. If it times out, it simply leaves the object unchanged. | public boolean update(long timeout) throws XMLStreamException, IOException {
if (null == _baseName) {
throw new IllegalStateException("Cannot retrieve an object without giving a name!");
}
// Look for first segment of version after ours, or first version if we have none.
ContentObject firstSegment =
... | [
"private org.eclipse.aether.version.Version getLastVersion()\n\t\t\tthrows MojoExecutionException {\n\n\t\t// build the artifact description with version range from 0 up to (non\n\t\t// inclusive) current version\n\n\t\tString artifactDescription = ARTIFACT_DESCRIPTION.replace(\"groupId\",\n\t\t\t\tgroupId);\n\t\ta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method was generated by MyBatis Generator. This method returns the value of the database column ecs_takegoods_order.paisong_name | public String getPaisongName() {
return paisongName;
} | [
"public void setPaisongName(String paisongName) {\n this.paisongName = paisongName == null ? null : paisongName.trim();\n }",
"public String productOrderName() {\n return this.innerProperties() == null ? null : this.innerProperties().productOrderName();\n }",
"public String getOrdername() {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Give the DAO Factory. | public DaoFactory getDaoFactory() {
return this.daoFactory;
} | [
"public static synchronized DAOFactory getDAOFactory() {\r\n if (daof == null) {\r\n daoType = JDBCDAO;\r\n switch (daoType) {\r\n case JDBCDAO:\r\n daof = new JDBCDAOFactory();\r\n break;\r\n case DUMMY_DAO:\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is this thread actively tracing at this moment. | public boolean isWithinTrace() {
return isWithinTrace;
} | [
"public boolean isTracing();",
"public boolean isTraceTarget() {\n\t\treturn delegateId_ == watchedCpp;\n\t}",
"public static boolean isTracing() {\n return Trace.isTracing();\n }",
"public boolean isAlive()\r\n\t{\r\n\t\treturn internalThread.isAlive();\r\n\t}",
"boolean isActive() {\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Queries which plugins are installed at the moment. | Map<GAVCoordinate, PluginMetadata> getInstalledPlugins(); | [
"public static List<Map.Entry<String, String>> getInstalledPlugins() {\n final List<Element> plugins = toList(getPluginConfiguration().getElementsByTagName(\"plugin\"));\n return plugins\n .stream()\n .map((Element elem) ->\n new AbstractMap.SimpleImmutableEntry<>(\n Optional.ofNulla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "rule__XOrExpression__Group_1_0_0__1" $ANTLR start "rule__XOrExpression__Group_1_0_0__1__Impl" ../org.xtext.mongobeans.ui/srcgen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4739:1: rule__XOrExpression__Group_1_0_0__1__Impl : ( ( rule__XOrExpression__FeatureAssignment_1_0_0_1 ) )... | public final void rule__XOrExpression__Group_1_0_0__1__Impl() throws RecognitionException {
int stackSize = keepStackSize();
try {
// ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4743:1: ( ( ( rule__XOrExpression... | [
"public final void rule__XOrExpression__Group_1__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:4622:1: ( ( ( rule__XOrEx... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "ruleAutenticacionUsuario" $ANTLR start "entryRuleMecanismoSeguridad" InternalCeffective.g:103:1: entryRuleMecanismoSeguridad : ruleMecanismoSeguridad EOF ; | public final void entryRuleMecanismoSeguridad() throws RecognitionException {
try {
// InternalCeffective.g:104:1: ( ruleMecanismoSeguridad EOF )
// InternalCeffective.g:105:1: ruleMecanismoSeguridad EOF
{
before(grammarAccess.getMecanismoSeguridadRule());
... | [
"public final void entryRuleGrupoSeguridad() throws RecognitionException {\n try {\n // InternalCeffective.g:454:1: ( ruleGrupoSeguridad EOF )\n // InternalCeffective.g:455:1: ruleGrupoSeguridad EOF\n {\n before(grammarAccess.getGrupoSeguridadRule()); \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the user avatar bitmap from the post | public Bitmap getAvatar() {
return avatar;
} | [
"com.google.protobuf.ByteString getAvatar();",
"java.lang.String getAvatar();",
"public String getUserAvatar() {\n return userAvatar;\n }",
"byte[] getProfileImage();",
"int getAvatar();",
"com.google.protobuf.ByteString getUserImage();",
"String avatarImage();",
"java.lang.String getProfile... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the result of interpreting the object as an instance of 'Incoherent Helper Return Type'. This implementation returns null; returning a nonnull result will terminate the switch. | public T caseIncoherentHelperReturnType(IncoherentHelperReturnType object) {
return null;
} | [
"public T caseTypeOutcome(TypeOutcome object)\n {\n return null;\n }",
"public T caseIncoherentVariableDeclaration(IncoherentVariableDeclaration object) {\n\t\treturn null;\n\t}",
"public T caseReturnTypeUserDefined(ReturnTypeUserDefined object) {\n\t\treturn null;\n\t}",
"public T caseReturnTypeFromLibL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get Selected button from group of RadioButton | private String getSelected_RadioGroup(final ButtonGroup BG) {
for (final Enumeration<AbstractButton> buttons = BG.getElements(); buttons.hasMoreElements();) {
final AbstractButton button = buttons.nextElement();
if (button.isSelected()) {
return button.getText();
}
}
return "";
} | [
"private static JRadioButton getSelectedButton(ButtonGroup group) {\r\n for (Enumeration<AbstractButton> e = group.getElements(); e.hasMoreElements(); ) {\r\n JRadioButton b = (JRadioButton)e.nextElement();\r\n if (b.getModel() == group.getSelection()) {\r\n return b;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Runs method Populate in Cache. Description: Creates up to count instances an object and stores them in the database. If verbose is true, then details are echoed to the console. If DeferIndices is true, then indices are sorted at the end of the operation. If objects is true, then each object that is created is returned ... | public static java.lang.Integer Populate (com.intersys.objects.Database db, java.lang.Integer count, java.lang.Integer verbose, java.lang.Integer DeferIndices) throws com.intersys.objects.CacheException {
com.intersys.cache.Dataholder[] args = new com.intersys.cache.Dataholder[3];
args[0] = new com.in... | [
"public static java.lang.Integer Populate (com.intersys.objects.Database db, java.lang.Integer count, java.lang.Integer verbose, java.lang.Integer DeferIndices, com.intersys.objects.IntegerHolder objects, java.lang.Integer tune) throws com.intersys.objects.CacheException {\r\n com.intersys.cache.Dataholder[]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Writes all DVDs in to a DVD_FILE. See loadDVDLibrary for file format. | private void writeDVDLibrary() throws DVDLibraryDaoPersistenceException{
// NOTE FOR APPRENTICES: We are not handling the IOException - but
// we are translating it to an application specific exception and
// then simple throwing it (i.e. 'reporting' it) to the code that
// called us. It is the re... | [
"private void writeDVDLibrary() throws DVDLibraryDaoException {\n \n // NOTE FOR APPRENTICES: We are not handling the IOException - but\n // we are translating it to an application specific exception and \n // then simple throwing it (i.e. 'reporting' it) to the code that\n // cal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds 1 match for the matches count for Team B when clicking the button. | public void matchForTeamB(View v) {
teamBMatches += 1;
displayMatchForTeamB(teamBMatches);
resetGoals(v);
} | [
"public void matchForTeamA(View v) {\r\n teamAMatches += 1;\r\n displayMatchForTeamA(teamAMatches);\r\n resetGoals(v);\r\n }",
"public void addMatch() {\n totalMatches ++;\n }",
"public void add1ToTeamB(View view){\n scoreTeamB = scoreTeamB+1;\n displayForTeamB(s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
\ metodo que devuelve el discriminante | public double getDiscriminante() {
// tiene la siguiente formula, (b^2) 4*a*c
return (Math.pow(this.b, 2) - 4 * this.a * this.c);
} | [
"public int getDiscriminator() {\r\n return discriminator;\r\n }",
"@Test\n public void testDiscriminate() {\n System.out.println(\"discriminate\");\n double discriminante = 0.0;\n Ecuacion2g instance = new Ecuacion2g();\n instance.discriminate(discriminante);\n \n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method checks if the puzzle content is valid meaning if it has 9 elements, all digits from 0 to 8 appearing only once each. | private boolean checkValidity(int[] polje) {
if (polje.length != 9) {
return false;
}
int[] counter = new int[9];
for (int i : polje) {
if (i < 0 || i > 8) {
return false;
}
counter[i]++;
if (counter[i] >= 2) {
return false;
}
}
return true;
} | [
"public boolean isLegal() {\n\t\tfor(int i = 0; i < puzzle.length; i++) {\n\t\t\tint[] h_digits = new int[puzzle.length]; // digits on the horizontal (this row)\n\t\t\tfor(int j = 0; j < puzzle[i].length; j++) {\n\t\t\t\tif(puzzle[i][j] > 0) {\n\t\t\t\t\tif(h_digits[puzzle[i][j]-1] > 0) {\n\t\t\t\t\t\treturn false;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the index of the given delegate in the list. | public int indexOf(Delegate delegate) {
return list.indexOf(delegate);
} | [
"private int getIndex(ArrayList<Employee> list, Employee e) {\n if(list == null) {\n System.out.println(\"list is null\");\n }\n for(int i = 0; i< list.size(); i++) {\n if(list.get(i) != null) {\n if (e.getEmpid() == list.get(i).getEmpid()) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get population difference between current & last gen | private int getPopulationDifference() {
if(population.size() > 2)
return population.get(population.size()-1) - population.get(population.size()-2);
else if(population.size() == 1)
return population.get(population.size()-1);
else
return 0;
} | [
"public GeneticPopulation getPopulation() {\n return population;\n }",
"int getPopulation();",
"private long[][] projectPopulation(){\r\n for(int i=0; i<sample; i++){\r\n population *= (1 + growthRate);\r\n populationProj[0][i] = population;\r\n\r\n populationProj[1][... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove a service from cache with its description and operation name | public boolean remove(ServiceDescription service, String opName){
return this.remove(service.getServiceType(), opName,service);
} | [
"public boolean remove(String serviceType,String opName,ServiceDescription service){\n \tDescription description=new Description(serviceType,opName);\n \tif(caches.containsKey(description)){\n \t\tList<ServiceDescription> services=caches.get(description);\n \t\tfor(ServiceDescription s:services){\n \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the fixture for this Out Message Port test case. | @Override
protected OutMessagePort getFixture() {
return (OutMessagePort)fixture;
} | [
"@Override\n\tprotected OutputPort getFixture() {\n\t\treturn (OutputPort)fixture;\n\t}",
"protected OpcDevice getFixture()\n {\n return fixture;\n }",
"protected PayMachine getFixture() {\n\t\treturn fixture;\n\t}",
"protected OutputRepresentation getFixture() {\n\t\treturn fixture;\n\t}",
"pr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
To determine the end date based on startDate and duration | public Date determineEndDate(String startDate, String duration) {
if ("hourly".equalsIgnoreCase(duration)) {
return datePlusHours(startDate, 1);
} else if ("daily".equalsIgnoreCase(duration)) {
return datePlusHours(startDate, 24);
}
return null;
} | [
"public static Date getEndDate(String startDate, String duration) {\r\n if (startDate == null || duration == null) {\r\n return null;\r\n }\r\n\r\n Date endDate = null;\r\n if (duration.equals(Durations.SEVEN_DAYS.getDurationType())) {\r\n endDate = DateUtil.addDays... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the item can be removed from the container. | public abstract boolean canRemoveItem(Player player, Item item, int slot); | [
"@Override\n public boolean canRemoveItem() {\n return true;\n }",
"@Override\n public boolean canRemoveItems() {\n return true;\n }",
"boolean canRemove(ItemState itemState) throws ItemNotFoundException, RepositoryException;",
"public boolean canRemove() {\n\t\tif (parent != null) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Testcase : Navigate to Resource page Steps : 1. Go to Resource 2. Verify navigation path "Home > Manage > Resources" | @Test( description = "Navigate to Resource",
groups = { "sanity" })
public void NavigateResource_01() throws HarnessException {
/*
* Verify navigation path -- "Home --> Manage Accounts --> Resources"
*/
ZAssert.assertTrue(app.zPageManageResources.zVerifyHeader(PageManageResources.Locators.HOME), "Ver... | [
"@Test\n public void clickResourceLink() {\n aboutPage.clickResourceLink();\n }",
"@Test\n public void verifyCreateResourcePageIsDisplayed() {\n \t\n \tLoginPage login = new LoginPage(driver);\n \t\n\t\tHomePage home = login\n\t\t\t\t.setCredentials()\n\t\t\t\t.clickSignInButton();\n\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
.bolg.UpdateWeaponRequest update_weapon_req = 11; | boolean hasUpdateWeaponReq(); | [
"org.bolg_developers.bolg.UpdateWeaponRequest getUpdateWeaponReq();",
"org.bolg_developers.bolg.UpdateWeaponResponse getUpdateWeaponResp();",
"org.bolg_developers.bolg.UpdateWeaponRequestOrBuilder getUpdateWeaponReqOrBuilder();",
"org.bolg_developers.bolg.UpdateWeaponResponseOrBuilder getUpdateWeaponRespOrBui... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the given role id is undefined | public static boolean isUndefined(long roleId) {
return roleId <= 0 || getById(roleId) == null;
} | [
"public boolean isSetRoleId() {\n return this.roleId != null;\n }",
"public void setRoleid(Integer roleid) {\r\n this.roleid = roleid;\r\n }",
"boolean isRolePermissionExists(String roleId);",
"public boolean hasRole(UserRole role) {\n return role != null && roles.contains(role);\n }",
"pu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check that our batv parsing is strict along the lines of the RFC | @Test
public void testBATVBad() {
SplitEmailAddress email = SplitEmailAddress.parse("prvs=aaaaaaaaaa=me@example.com");
assertEquals("prvs=aaaaaaaaaa=me", email.getLocal());
assertEquals("example.com", email.getDomain());
} | [
"@Test\n\tpublic void testBVPattern() {\n\t\t/*\n\t\t * white space match with BV\n\t\t */\n\t\tString content = \"This is a valid content which has BV and let us see\";\n\t\tboolean validContent = BVUtilty.validateBVContent(content);\n\t\tAssert.assertTrue(validContent);\n\t\t\n\t\tcontent = \"This content has bV ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Does whatever you want, when the back key is pressed | public void keyBackIsPressed(){} | [
"@Override public void onBackPressed() { }",
"public void onBackPressed();",
"void onBackButtonPressed();",
"public void goBack() {\r\n currentScreen.goBack();\r\n }",
"public void goBack() {\n MainController.display(AppScreen.HOME);\n }",
"void onBackButtonClicked();",
"public void backPr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests SectionsetTitle(String) for accuracy. Verify : the SectionsetTitle(String) is correct. | public void testSetTitle() throws Exception {
assertEquals("The section's title should be empty string.", "", section.getTitle());
section.setTitle("title");
assertEquals("The section's title should be \"title\".", "title", section.getTitle());
} | [
"public void testGetTitle() throws Exception {\n assertEquals(\"The section's title should be empty string.\", \"\", section.getTitle());\n section.setTitle(\"title\");\n assertEquals(\"The section's title should be \\\"title\\\".\", \"title\", section.getTitle());\n }",
"@Test\n public... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ordentliche Ausdruck Ausdrucken der unsortierten Array | public static void ausdrucken() {
int[] arr = array.clone();
for (int j = 0; j < arr.length; j++) {
System.out.print(arr[j] + " ");
}
System.out.println();
// Sortierung
insertionSort(array);
if (!isSorted(array)) {
System.out.println("FEHL... | [
"public void ordenaArray(){\t\t\n\t\tCollections.sort(anos, new Comparator<Integer>(){\n\t\t\t@Override\n\t\t\tpublic int compare(Integer ano1, Integer ano2) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn ano1.compareTo(ano2);\n\t\t\t}\n\t\t});\n\t}",
"private void sortData() {\n for (int i ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sort the translation list to get the newest event on the top. | void orderTranslationEventsByTimestamp(List<Translation> translations) {
translations.sort((t1, t2) -> {
if (t1.getTimestamp().isAfter(t2.getTimestamp())) {
return -1;
}
if (t1.getTimestamp().isBefore(t2.getTimestamp())) {
return 1;
... | [
"private void sortEvents() {\n //sort the event list when we add a new event. Pass a comparator to handle what defines\n //greater than for Java objects\n Collections.sort(eventsList, new Comparator<Event_withID>() {\n @Override\n public int compare(Event_withID event_with... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Use QueryVehicleTrack.newBuilder() to construct. | private QueryVehicleTrack(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
} | [
"public static com.datawhisperers.restfulexample.avromodel.VehicleInfoAvro.Builder newBuilder() {\n return new com.datawhisperers.restfulexample.avromodel.VehicleInfoAvro.Builder();\n }",
"List<TrackDTO> searchTrack(String queryString);",
"public Track() {\r\n }",
"private Vehicle(com.google.protobuf.G... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the boolean operator for multiple filters (including the column range). | Get<K, C> setFilterOp(BooleanOp op); | [
"@VTID(213)\r\n void setCalculatedMembersInFilters(\r\n boolean rhs);",
"public void setAndOr (String AndOr);",
"private void setFilter(){\n\t\tplainSelect.setWhere(null);\n\t\t\n\t\t// add joins as filters\n\t\tSet<Expression> filtersToAdd = new HashSet<Expression>(this.filters); \n//\t\t\t\tfor(TermMap le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method sets the game lantern card count for the purple color. | public void setGamePurpleLanternCardCount(int gamePurpleLanternCardCount) {
this.gamePurpleLanternCardCount = gamePurpleLanternCardCount;
} | [
"public void setGameRedLanternCardCount(int gameRedLanternCardCount) {\n\t\tthis.gameRedLanternCardCount = gameRedLanternCardCount;\n\t}",
"private void assignLanternCards() {\n\t\tPlayers[] totalPlayers = playersList;\n\t\t\n\t\tfor (int i = 0; i < totalPlayers.length; i++) {\n\t\t\tPlayers player = totalPlayer... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wait for a FutureCallback to complete. If it succeeds, return the parsed response. If it fails, try to forward the request to the leader. | private <T, U> T completeOrForwardRequest(FutureCallback<T> cb,
String path,
String method,
HttpHeaders headers,
Map<String, String> que... | [
"private JsonNode processCallbackResponse(final JsonNode resp) {\n if (this.callbackHandler == null) {\n throw new JsiiException(\"Cannot process callback since callbackHandler was not set\");\n }\n\n Callback callback = JsiiObjectMapper.treeToValue(resp.get(\"callback\"), NativeType... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |