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
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public static CompoundIntegerDataset createFromObject(final Object obj) { IntegerDataset result = IntegerDataset.createFromObject(obj); // CLASS_TYPE return (CompoundIntegerDataset) DatasetUtils.createCompoundDatasetFromLastAxis(result, true); }
static CompoundIntegerDataset function(final Object obj) { IntegerDataset result = IntegerDataset.createFromObject(obj); return (CompoundIntegerDataset) DatasetUtils.createCompoundDatasetFromLastAxis(result, true); }
/** * Create a dataset from an object which could be a Java list, array (of arrays...) or Number. Ragged * sequences or arrays are padded with zeros. * * @param obj * @return dataset with contents given by input */
Create a dataset from an object which could be a Java list, array (of arrays...) or Number. Ragged sequences or arrays are padded with zeros
createFromObject
{ "repo_name": "PeterC-DLS/org.eclipse.dataset", "path": "org.eclipse.dataset/src/org/eclipse/dataset/internal/dense/CompoundIntegerDataset.java", "license": "epl-1.0", "size": 55378 }
[ "org.eclipse.dataset.dense.DatasetUtils" ]
import org.eclipse.dataset.dense.DatasetUtils;
import org.eclipse.dataset.dense.*;
[ "org.eclipse.dataset" ]
org.eclipse.dataset;
28,083
public FirewallPolicyInner withThreatIntelMode(AzureFirewallThreatIntelMode threatIntelMode) { this.threatIntelMode = threatIntelMode; return this; }
FirewallPolicyInner function(AzureFirewallThreatIntelMode threatIntelMode) { this.threatIntelMode = threatIntelMode; return this; }
/** * Set the operation mode for Threat Intelligence. Possible values include: 'Alert', 'Deny', 'Off'. * * @param threatIntelMode the threatIntelMode value to set * @return the FirewallPolicyInner object itself. */
Set the operation mode for Threat Intelligence. Possible values include: 'Alert', 'Deny', 'Off'
withThreatIntelMode
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/network/v2019_09_01/implementation/FirewallPolicyInner.java", "license": "mit", "size": 5267 }
[ "com.microsoft.azure.management.network.v2019_09_01.AzureFirewallThreatIntelMode" ]
import com.microsoft.azure.management.network.v2019_09_01.AzureFirewallThreatIntelMode;
import com.microsoft.azure.management.network.v2019_09_01.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
1,324,030
public static void submitTopology(String name, Map stormConf, StormTopology topology) throws AlreadyAliveException, InvalidTopologyException { submitTopology(name, stormConf, topology, null); }
static void function(String name, Map stormConf, StormTopology topology) throws AlreadyAliveException, InvalidTopologyException { submitTopology(name, stormConf, topology, null); }
/** * Submits a topology to run on the cluster. A topology runs forever or until * explicitly killed. * * * @param name the name of the storm. * @param stormConf the topology-specific configuration. See {@link Config}. * @param topology the processing to execute. * @throws AlreadyAliveException if a topology with this name is already running * @throws InvalidTopologyException if an invalid topology was submitted */
Submits a topology to run on the cluster. A topology runs forever or until explicitly killed
submitTopology
{ "repo_name": "metamx/incubator-storm", "path": "storm-core/src/jvm/backtype/storm/StormSubmitter.java", "license": "apache-2.0", "size": 7726 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,414,617
public Value getValueForAttribute(String attName){ int ind = obClass.attributeIndex(attName); return values.get(ind); }
Value function(String attName){ int ind = obClass.attributeIndex(attName); return values.get(ind); }
/** * Returns the Value object assignment for the attribute named attName * @param attName the name of the attribute whose value should be returned * @return the Value object assignment for the attribute named attName */
Returns the Value object assignment for the attribute named attName
getValueForAttribute
{ "repo_name": "gauravpuri/MDP_Repp", "path": "src/burlap/oomdp/core/objects/ImmutableObjectInstance.java", "license": "lgpl-3.0", "size": 20171 }
[ "burlap.oomdp.core.values.Value" ]
import burlap.oomdp.core.values.Value;
import burlap.oomdp.core.values.*;
[ "burlap.oomdp.core" ]
burlap.oomdp.core;
588,804
private boolean checkQuit(final MouseEvent e) { boolean clicked = false; final int x = frame.getWidth() - Constants.SMALL_SIDE_PNL_SIZE; final int y = 0; final int ex = frame.getWidth(); final int ey = Constants.SMALL_SIDE_PNL_SIZE; final Point clickedAt = e.getPoint(); if (isInside(clickedAt, x, y, ex, ey)) { clicked = true; PrefDialogFrame.close(); frame.dispose(); } return clicked; }
boolean function(final MouseEvent e) { boolean clicked = false; final int x = frame.getWidth() - Constants.SMALL_SIDE_PNL_SIZE; final int y = 0; final int ex = frame.getWidth(); final int ey = Constants.SMALL_SIDE_PNL_SIZE; final Point clickedAt = e.getPoint(); if (isInside(clickedAt, x, y, ex, ey)) { clicked = true; PrefDialogFrame.close(); frame.dispose(); } return clicked; }
/** * Check whether the quit button was clicked. It will close the frame. * * @param e * The MouseEvent that occurred. * @return Whether the quit button was clicked. */
Check whether the quit button was clicked. It will close the frame
checkQuit
{ "repo_name": "Kazeheki/Alotoc", "path": "src/alotoc/logic/PrefMouseListener.java", "license": "mit", "size": 5551 }
[ "java.awt.Point", "java.awt.event.MouseEvent" ]
import java.awt.Point; import java.awt.event.MouseEvent;
import java.awt.*; import java.awt.event.*;
[ "java.awt" ]
java.awt;
1,759,152
EClass getUiXbaseVisibilityRule();
EClass getUiXbaseVisibilityRule();
/** * Returns the meta object for class '{@link org.lunifera.ecview.semantic.uimodel.UiXbaseVisibilityRule <em>Ui Xbase Visibility Rule</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Ui Xbase Visibility Rule</em>'. * @see org.lunifera.ecview.semantic.uimodel.UiXbaseVisibilityRule * @generated */
Returns the meta object for class '<code>org.lunifera.ecview.semantic.uimodel.UiXbaseVisibilityRule Ui Xbase Visibility Rule</code>'.
getUiXbaseVisibilityRule
{ "repo_name": "lunifera/lunifera-ecview-addons", "path": "org.lunifera.ecview.semantic.uimodel/src/org/lunifera/ecview/semantic/uimodel/UiModelPackage.java", "license": "epl-1.0", "size": 498897 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,419,549
private static boolean isXLargeTablet(Context context) { return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE; }
static boolean function(Context context) { return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE; }
/** * Helper method to determine if the device has an extra-large screen. For * example, 10" tablets are extra-large. */
Helper method to determine if the device has an extra-large screen. For example, 10" tablets are extra-large
isXLargeTablet
{ "repo_name": "ezet/bar-tracker", "path": "app/src/main/java/ezet/bartracker/activities/SettingsActivity.java", "license": "gpl-3.0", "size": 10540 }
[ "android.content.Context", "android.content.res.Configuration" ]
import android.content.Context; import android.content.res.Configuration;
import android.content.*; import android.content.res.*;
[ "android.content" ]
android.content;
2,743,032
public Map<String, CmsClientProperty> getDefaultFileProperties() { return m_defaultFileProperties; }
Map<String, CmsClientProperty> function() { return m_defaultFileProperties; }
/** * Returns the properties for the default file.<p> * * @return the properties for the default file */
Returns the properties for the default file
getDefaultFileProperties
{ "repo_name": "it-tavis/opencms-core", "path": "src/org/opencms/ade/sitemap/shared/CmsClientSitemapEntry.java", "license": "lgpl-2.1", "size": 28821 }
[ "java.util.Map", "org.opencms.gwt.shared.property.CmsClientProperty" ]
import java.util.Map; import org.opencms.gwt.shared.property.CmsClientProperty;
import java.util.*; import org.opencms.gwt.shared.property.*;
[ "java.util", "org.opencms.gwt" ]
java.util; org.opencms.gwt;
1,993,371
public void testIsDebit_errorCorrection_target_income_negativeAmount() throws Exception { AccountingDocument accountingDocument = IsDebitTestUtils.getErrorCorrectionDocument(SpringContext.getBean(DocumentService.class), InternalBillingDocument.class); AccountingLine accountingLine = IsDebitTestUtils.getIncomeLine(accountingDocument, TargetAccountingLine.class, NEGATIVE); assertFalse(IsDebitTestUtils.isDebit(SpringContext.getBean(DataDictionaryService.class), SpringContext.getBean(DataDictionaryService.class), accountingDocument, accountingLine)); }
void function() throws Exception { AccountingDocument accountingDocument = IsDebitTestUtils.getErrorCorrectionDocument(SpringContext.getBean(DocumentService.class), InternalBillingDocument.class); AccountingLine accountingLine = IsDebitTestUtils.getIncomeLine(accountingDocument, TargetAccountingLine.class, NEGATIVE); assertFalse(IsDebitTestUtils.isDebit(SpringContext.getBean(DataDictionaryService.class), SpringContext.getBean(DataDictionaryService.class), accountingDocument, accountingLine)); }
/** * tests false is returned for a negative income * * @throws Exception */
tests false is returned for a negative income
testIsDebit_errorCorrection_target_income_negativeAmount
{ "repo_name": "ua-eas/ua-kfs-5.3", "path": "test/unit/src/org/kuali/kfs/fp/document/validation/impl/InternalBillingDocumentRuleTest.java", "license": "agpl-3.0", "size": 67511 }
[ "org.kuali.kfs.fp.document.InternalBillingDocument", "org.kuali.kfs.sys.businessobject.AccountingLine", "org.kuali.kfs.sys.businessobject.TargetAccountingLine", "org.kuali.kfs.sys.context.SpringContext", "org.kuali.kfs.sys.document.AccountingDocument", "org.kuali.kfs.sys.service.IsDebitTestUtils", "org....
import org.kuali.kfs.fp.document.InternalBillingDocument; import org.kuali.kfs.sys.businessobject.AccountingLine; import org.kuali.kfs.sys.businessobject.TargetAccountingLine; import org.kuali.kfs.sys.context.SpringContext; import org.kuali.kfs.sys.document.AccountingDocument; import org.kuali.kfs.sys.service.IsDebitTestUtils; import org.kuali.rice.kns.service.DataDictionaryService; import org.kuali.rice.krad.service.DocumentService;
import org.kuali.kfs.fp.document.*; import org.kuali.kfs.sys.businessobject.*; import org.kuali.kfs.sys.context.*; import org.kuali.kfs.sys.document.*; import org.kuali.kfs.sys.service.*; import org.kuali.rice.kns.service.*; import org.kuali.rice.krad.service.*;
[ "org.kuali.kfs", "org.kuali.rice" ]
org.kuali.kfs; org.kuali.rice;
1,944,111
@VisibleForTesting ReducedClasspath getReducedClasspath( ActionExecutionContext actionExecutionContext, JavaCompileActionContext context) throws IOException { HashSet<String> direct = new HashSet<>(); for (Artifact directJar : directJars.toList()) { direct.add(directJar.getExecPathString()); } for (Artifact depArtifact : dependencyArtifacts.toList()) { for (Deps.Dependency dep : context.getDependencies(depArtifact, actionExecutionContext).getDependencyList()) { direct.add(dep.getPath()); } } ImmutableList<Artifact> transitiveCollection = transitiveInputs.toList(); ImmutableList<Artifact> reducedJars = ImmutableList.copyOf( Iterables.filter( transitiveCollection, input -> direct.contains(input.getExecPathString()))); return new ReducedClasspath(reducedJars, transitiveCollection.size()); }
ReducedClasspath getReducedClasspath( ActionExecutionContext actionExecutionContext, JavaCompileActionContext context) throws IOException { HashSet<String> direct = new HashSet<>(); for (Artifact directJar : directJars.toList()) { direct.add(directJar.getExecPathString()); } for (Artifact depArtifact : dependencyArtifacts.toList()) { for (Deps.Dependency dep : context.getDependencies(depArtifact, actionExecutionContext).getDependencyList()) { direct.add(dep.getPath()); } } ImmutableList<Artifact> transitiveCollection = transitiveInputs.toList(); ImmutableList<Artifact> reducedJars = ImmutableList.copyOf( Iterables.filter( transitiveCollection, input -> direct.contains(input.getExecPathString()))); return new ReducedClasspath(reducedJars, transitiveCollection.size()); }
/** * Compute a reduced classpath that is comprised of the header jars of all the direct dependencies * and the jars needed to build those (read from the produced .jdeps file). This duplicates the * logic from {@link * com.google.devtools.build.buildjar.javac.plugins.dependency.DependencyModule#computeStrictClasspath}. */
Compute a reduced classpath that is comprised of the header jars of all the direct dependencies and the jars needed to build those (read from the produced .jdeps file). This duplicates the logic from <code>com.google.devtools.build.buildjar.javac.plugins.dependency.DependencyModule#computeStrictClasspath</code>
getReducedClasspath
{ "repo_name": "dslomov/bazel-windows", "path": "src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java", "license": "apache-2.0", "size": 26728 }
[ "com.google.common.collect.ImmutableList", "com.google.common.collect.Iterables", "com.google.devtools.build.lib.actions.ActionExecutionContext", "com.google.devtools.build.lib.actions.Artifact", "com.google.devtools.build.lib.view.proto.Deps", "java.io.IOException", "java.util.HashSet" ]
import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; import com.google.devtools.build.lib.actions.ActionExecutionContext; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.view.proto.Deps; import java.io.IOException; import java.util.HashSet;
import com.google.common.collect.*; import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.view.proto.*; import java.io.*; import java.util.*;
[ "com.google.common", "com.google.devtools", "java.io", "java.util" ]
com.google.common; com.google.devtools; java.io; java.util;
625,309
@Test public void testBuildIndexWithoutSetGrid() throws Exception { RectangleRDD spatialRDD = new RectangleRDD(sc, InputLocation, offset, splitter, true, numPartitions); spatialRDD.buildIndex(IndexType.RTREE, false); }
void function() throws Exception { RectangleRDD spatialRDD = new RectangleRDD(sc, InputLocation, offset, splitter, true, numPartitions); spatialRDD.buildIndex(IndexType.RTREE, false); }
/** * Test build index without set grid. * * @throws Exception the exception */
Test build index without set grid
testBuildIndexWithoutSetGrid
{ "repo_name": "Sarwat/GeoSpark", "path": "core/src/test/java/org/datasyslab/geospark/spatialRDD/RectangleRDDTest.java", "license": "mit", "size": 6988 }
[ "org.datasyslab.geospark.enums.IndexType" ]
import org.datasyslab.geospark.enums.IndexType;
import org.datasyslab.geospark.enums.*;
[ "org.datasyslab.geospark" ]
org.datasyslab.geospark;
1,838,005
public boolean isEmpty(String stackName) { boolean result = true; Stack<Object> namedStack = stacksByName.get(stackName); if (namedStack != null ) { result = namedStack.isEmpty(); } return result; }
boolean function(String stackName) { boolean result = true; Stack<Object> namedStack = stacksByName.get(stackName); if (namedStack != null ) { result = namedStack.isEmpty(); } return result; }
/** * <p>Is the stack with the given name empty?</p> * <p><strong>Note:</strong> a stack is considered empty * if no objects have been pushed onto it yet.</p> * @param stackName the name of the stack whose emptiness * should be evaluated * @return true if the given stack if empty * * @since 1.6 */
Is the stack with the given name empty? Note: a stack is considered empty if no objects have been pushed onto it yet
isEmpty
{ "repo_name": "lamsfoundation/lams", "path": "3rdParty_sources/commons-digester/org/apache/commons/digester/Digester.java", "license": "gpl-2.0", "size": 106013 }
[ "java.util.Stack" ]
import java.util.Stack;
import java.util.*;
[ "java.util" ]
java.util;
940,196
@Override public Panel getPanel() { return (index >= 0 && index < panels.size()) ? panels.get(index) : null; }
Panel function() { return (index >= 0 && index < panels.size()) ? panels.get(index) : null; }
/** * Returns the current panel. * * @return the current panel, or {@code null} if there is no current panel */
Returns the current panel
getPanel
{ "repo_name": "mtjandra/izpack", "path": "izpack-installer/src/main/java/com/izforge/izpack/installer/panel/AbstractPanels.java", "license": "apache-2.0", "size": 17270 }
[ "com.izforge.izpack.api.data.Panel" ]
import com.izforge.izpack.api.data.Panel;
import com.izforge.izpack.api.data.*;
[ "com.izforge.izpack" ]
com.izforge.izpack;
1,719,047
public String[] getDefaults() { return Arrays.copyOf(this.defaultValues, this.defaultValues.length); }
String[] function() { return Arrays.copyOf(this.defaultValues, this.defaultValues.length); }
/** * Gets the raw String[] default values of this Property. Check for isList() == true first. * * @return the default values String[] */
Gets the raw String[] default values of this Property. Check for isList() == true first
getDefaults
{ "repo_name": "Merlijnv/MFM", "path": "build/tmp/recompileMc/sources/net/minecraftforge/common/config/Property.java", "license": "gpl-3.0", "size": 33721 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
1,435,199
public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ENTER) { handleEnterKeyPressed(e.getSource()); } } }; if (list != null) list.addKeyListener(ka); if (list == null) { JTable t = (JTable) UIUtilities .findComponent(chooser, JTable.class); if (t != null) t.addKeyListener(ka); } try { File f = UIUtilities.getDefaultFolder(); if (f != null) chooser.setCurrentDirectory(f); } catch (Exception e) { // Ignore: could not set the default container } chooser.addPropertyChangeListener(this); chooser.setMultiSelectionEnabled(true); chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); chooser.setControlButtonsAreShown(false); chooser.setApproveButtonText(TEXT_IMPORT); chooser.setApproveButtonToolTipText(TOOLTIP_IMPORT); bioFormatsFileFilters = new ArrayList<FileFilter>(); if (filters != null) { chooser.setAcceptAllFileFilterUsed(false); for (FileFilter fileFilter : filters) { if (fileFilter instanceof ComboFileFilter) { bioFormatsFileFiltersCombined = fileFilter; ComboFileFilter comboFilter = (ComboFileFilter) fileFilter; FileFilter[] extensionFilters = comboFilter.getFilters(); for (FileFilter combinedFilter : extensionFilters) { bioFormatsFileFilters.add(combinedFilter); } break; } } chooser.addChoosableFileFilter(bioFormatsFileFiltersCombined); for (FileFilter fileFilter : bioFormatsFileFilters) { chooser.addChoosableFileFilter(fileFilter); } chooser.setFileFilter(bioFormatsFileFiltersCombined); } else { chooser.setAcceptAllFileFilterUsed(true); } closeButton = new JButton(TEXT_CLOSE); closeButton.setToolTipText(TOOLTIP_CLOSE); closeButton.setActionCommand("" + CMD_CLOSE); closeButton.addActionListener(this); cancelImportButton = new JButton(importerAction); importerAction.setEnabled(false); importButton = new JButton(TEXT_IMPORT); importButton.setToolTipText(TOOLTIP_IMPORT); importButton.setActionCommand("" + CMD_IMPORT); importButton.addActionListener(this); importButton.setEnabled(false); pixelsSize = new ArrayList<NumericalTextField>(); NumericalTextField field; for (int i = 0; i < 3; i++) { field = new NumericalTextField(); field.setNumberType(Double.class); field.setColumns(2); pixelsSize.add(field); } List<Component> boxes = UIUtilities.findComponents(chooser, JComboBox.class); if (boxes != null) { JComboBox box; JComboBox filterBox = null; Iterator<Component> i = boxes.iterator(); while (i.hasNext()) { box = (JComboBox) i.next(); Object o = box.getItemAt(0); if (o instanceof FileFilter) { filterBox = box; break; } } if (filterBox != null) { filterBox.addKeyListener(new KeyAdapter() {
void function(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ENTER) { handleEnterKeyPressed(e.getSource()); } } }; if (list != null) list.addKeyListener(ka); if (list == null) { JTable t = (JTable) UIUtilities .findComponent(chooser, JTable.class); if (t != null) t.addKeyListener(ka); } try { File f = UIUtilities.getDefaultFolder(); if (f != null) chooser.setCurrentDirectory(f); } catch (Exception e) { } chooser.addPropertyChangeListener(this); chooser.setMultiSelectionEnabled(true); chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); chooser.setControlButtonsAreShown(false); chooser.setApproveButtonText(TEXT_IMPORT); chooser.setApproveButtonToolTipText(TOOLTIP_IMPORT); bioFormatsFileFilters = new ArrayList<FileFilter>(); if (filters != null) { chooser.setAcceptAllFileFilterUsed(false); for (FileFilter fileFilter : filters) { if (fileFilter instanceof ComboFileFilter) { bioFormatsFileFiltersCombined = fileFilter; ComboFileFilter comboFilter = (ComboFileFilter) fileFilter; FileFilter[] extensionFilters = comboFilter.getFilters(); for (FileFilter combinedFilter : extensionFilters) { bioFormatsFileFilters.add(combinedFilter); } break; } } chooser.addChoosableFileFilter(bioFormatsFileFiltersCombined); for (FileFilter fileFilter : bioFormatsFileFilters) { chooser.addChoosableFileFilter(fileFilter); } chooser.setFileFilter(bioFormatsFileFiltersCombined); } else { chooser.setAcceptAllFileFilterUsed(true); } closeButton = new JButton(TEXT_CLOSE); closeButton.setToolTipText(TOOLTIP_CLOSE); closeButton.setActionCommand(STR" + CMD_IMPORT); importButton.addActionListener(this); importButton.setEnabled(false); pixelsSize = new ArrayList<NumericalTextField>(); NumericalTextField field; for (int i = 0; i < 3; i++) { field = new NumericalTextField(); field.setNumberType(Double.class); field.setColumns(2); pixelsSize.add(field); } List<Component> boxes = UIUtilities.findComponents(chooser, JComboBox.class); if (boxes != null) { JComboBox box; JComboBox filterBox = null; Iterator<Component> i = boxes.iterator(); while (i.hasNext()) { box = (JComboBox) i.next(); Object o = box.getItemAt(0); if (o instanceof FileFilter) { filterBox = box; break; } } if (filterBox != null) { filterBox.addKeyListener(new KeyAdapter() {
/** * Adds the files to the import queue. * * @see KeyListener#keyPressed(KeyEvent) */
Adds the files to the import queue
keyPressed
{ "repo_name": "emilroz/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/chooser/ImportDialog.java", "license": "gpl-2.0", "size": 46691 }
[ "java.awt.Component", "java.awt.event.KeyAdapter", "java.awt.event.KeyEvent", "java.io.File", "java.util.ArrayList", "java.util.Iterator", "java.util.List", "javax.swing.JButton", "javax.swing.JComboBox", "javax.swing.JFileChooser", "javax.swing.JTable", "javax.swing.filechooser.FileFilter", ...
import java.awt.Component; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JFileChooser; import javax.swing.JTable; import javax.swing.filechooser.FileFilter; import org.openmicroscopy.shoola.util.ui.NumericalTextField; import org.openmicroscopy.shoola.util.ui.UIUtilities;
import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.*; import javax.swing.*; import javax.swing.filechooser.*; import org.openmicroscopy.shoola.util.ui.*;
[ "java.awt", "java.io", "java.util", "javax.swing", "org.openmicroscopy.shoola" ]
java.awt; java.io; java.util; javax.swing; org.openmicroscopy.shoola;
217,966
public void commit() throws SQLException { if (this.getOpenTransactionId() > 0) { HttpPost request = new HttpPost(currentTransactionUrl + "/commit"); Neo4jResponse response = this.executeHttpRequest(request); if (response.hasErrors()) { throw new SQLException(response.displayErrors()); } this.currentTransactionUrl = this.transactionUrl; } }
void function() throws SQLException { if (this.getOpenTransactionId() > 0) { HttpPost request = new HttpPost(currentTransactionUrl + STR); Neo4jResponse response = this.executeHttpRequest(request); if (response.hasErrors()) { throw new SQLException(response.displayErrors()); } this.currentTransactionUrl = this.transactionUrl; } }
/** * Commit the current transaction. * * @throws SQLException sqlexception */
Commit the current transaction
commit
{ "repo_name": "neo4j-contrib/neo4j-jdbc", "path": "neo4j-jdbc-http/src/main/java/org/neo4j/jdbc/http/driver/CypherExecutor.java", "license": "apache-2.0", "size": 15024 }
[ "java.sql.SQLException", "org.apache.http.client.methods.HttpPost" ]
import java.sql.SQLException; import org.apache.http.client.methods.HttpPost;
import java.sql.*; import org.apache.http.client.methods.*;
[ "java.sql", "org.apache.http" ]
java.sql; org.apache.http;
1,588,898
@Override public OperationResponse beginDeleting(String ipName) throws IOException, ServiceException, ParserConfigurationException, SAXException { // Validate if (ipName == null) { throw new NullPointerException("ipName"); } // Tracing boolean shouldTrace = CloudTracing.getIsEnabled(); String invocationId = null; if (shouldTrace) { invocationId = Long.toString(CloudTracing.getNextInvocationId()); HashMap<String, Object> tracingParameters = new HashMap<String, Object>(); tracingParameters.put("ipName", ipName); CloudTracing.enter(invocationId, this, "beginDeletingAsync", tracingParameters); } // Construct URL String url = ""; url = url + "/"; if (this.getClient().getCredentials().getSubscriptionId() != null) { url = url + URLEncoder.encode(this.getClient().getCredentials().getSubscriptionId(), "UTF-8"); } url = url + "/services/networking/reservedips/"; url = url + URLEncoder.encode(ipName, "UTF-8"); String baseUrl = this.getClient().getBaseUri().toString(); // Trim '/' character from the end of baseUrl and beginning of url. if (baseUrl.charAt(baseUrl.length() - 1) == '/') { baseUrl = baseUrl.substring(0, (baseUrl.length() - 1) + 0); } if (url.charAt(0) == '/') { url = url.substring(1); } url = baseUrl + "/" + url; url = url.replace(" ", "%20"); // Create HTTP transport objects CustomHttpDelete httpRequest = new CustomHttpDelete(url); // Set Headers httpRequest.setHeader("Content-Type", "application/xml"); httpRequest.setHeader("x-ms-version", "2015-04-01"); // Send Request HttpResponse httpResponse = null; try { if (shouldTrace) { CloudTracing.sendRequest(invocationId, httpRequest); } httpResponse = this.getClient().getHttpClient().execute(httpRequest); if (shouldTrace) { CloudTracing.receiveResponse(invocationId, httpResponse); } int statusCode = httpResponse.getStatusLine().getStatusCode(); if (statusCode != HttpStatus.SC_ACCEPTED) { ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { CloudTracing.error(invocationId, ex); } throw ex; } // Create Result OperationResponse result = null; // Deserialize Response result = new OperationResponse(); result.setStatusCode(statusCode); if (httpResponse.getHeaders("x-ms-request-id").length > 0) { result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } if (shouldTrace) { CloudTracing.exit(invocationId, result); } return result; } finally { if (httpResponse != null && httpResponse.getEntity() != null) { httpResponse.getEntity().getContent().close(); } } }
OperationResponse function(String ipName) throws IOException, ServiceException, ParserConfigurationException, SAXException { if (ipName == null) { throw new NullPointerException(STR); } boolean shouldTrace = CloudTracing.getIsEnabled(); String invocationId = null; if (shouldTrace) { invocationId = Long.toString(CloudTracing.getNextInvocationId()); HashMap<String, Object> tracingParameters = new HashMap<String, Object>(); tracingParameters.put(STR, ipName); CloudTracing.enter(invocationId, this, STR, tracingParameters); } String url = STR/STRUTF-8STR/services/networking/reservedips/STRUTF-8STR/STR STR%20STRContent-TypeSTRapplication/xmlSTRx-ms-versionSTR2015-04-01STRx-ms-request-idSTRx-ms-request-id").getValue()); } if (shouldTrace) { CloudTracing.exit(invocationId, result); } return result; } finally { if (httpResponse != null && httpResponse.getEntity() != null) { httpResponse.getEntity().getContent().close(); } } }
/** * The Begin Deleting Reserved IP operation removes a reserved IP from your * the subscription. * * @param ipName Required. The name of the reserved IP. * @throws IOException Signals that an I/O exception of some sort has * occurred. This class is the general class of exceptions produced by * failed or interrupted I/O operations. * @throws ServiceException Thrown if an unexpected response is found. * @throws ParserConfigurationException Thrown if there was a serious * configuration error with the document parser. * @throws SAXException Thrown if there was an error parsing the XML * response. * @return A standard service response including an HTTP status code and * request ID. */
The Begin Deleting Reserved IP operation removes a reserved IP from your the subscription
beginDeleting
{ "repo_name": "southworkscom/azure-sdk-for-java", "path": "service-management/azure-svc-mgmt-network/src/main/java/com/microsoft/windowsazure/management/network/ReservedIPOperationsImpl.java", "license": "apache-2.0", "size": 80859 }
[ "com.microsoft.windowsazure.core.OperationResponse", "com.microsoft.windowsazure.exception.ServiceException", "com.microsoft.windowsazure.tracing.CloudTracing", "java.io.IOException", "java.util.HashMap", "javax.xml.parsers.ParserConfigurationException", "org.xml.sax.SAXException" ]
import com.microsoft.windowsazure.core.OperationResponse; import com.microsoft.windowsazure.exception.ServiceException; import com.microsoft.windowsazure.tracing.CloudTracing; import java.io.IOException; import java.util.HashMap; import javax.xml.parsers.ParserConfigurationException; import org.xml.sax.SAXException;
import com.microsoft.windowsazure.core.*; import com.microsoft.windowsazure.exception.*; import com.microsoft.windowsazure.tracing.*; import java.io.*; import java.util.*; import javax.xml.parsers.*; import org.xml.sax.*;
[ "com.microsoft.windowsazure", "java.io", "java.util", "javax.xml", "org.xml.sax" ]
com.microsoft.windowsazure; java.io; java.util; javax.xml; org.xml.sax;
1,014,100
public Stream<Tuple2io<int[][]>> read(String in) throws FileNotFoundException { return read(new FileInputStream(in)); }
Stream<Tuple2io<int[][]>> function(String in) throws FileNotFoundException { return read(new FileInputStream(in)); }
/** * Reads a file that complies with this format. * * @param in path to file * @return stream of user/item to preferences * @throws FileNotFoundException when file does not exist */
Reads a file that complies with this format
read
{ "repo_name": "jacekwasilewski/RankSys", "path": "RankSys-formats/src/main/java/org/ranksys/formats/preference/CompressibleRatingPreferencesFormat.java", "license": "gpl-3.0", "size": 4923 }
[ "java.io.FileInputStream", "java.io.FileNotFoundException", "java.util.stream.Stream", "org.ranksys.core.util.tuples.Tuple2io" ]
import java.io.FileInputStream; import java.io.FileNotFoundException; import java.util.stream.Stream; import org.ranksys.core.util.tuples.Tuple2io;
import java.io.*; import java.util.stream.*; import org.ranksys.core.util.tuples.*;
[ "java.io", "java.util", "org.ranksys.core" ]
java.io; java.util; org.ranksys.core;
1,927,004
public void printXml(WriteStream os) throws IOException { String prefix = printXmlOpen(os, JSTL_CORE_NS, "when"); os.print(" test=\""); printXmlText(os, _test); os.print("\">"); printXmlChildren(os); os.print("</" + prefix + ":when>"); }
void function(WriteStream os) throws IOException { String prefix = printXmlOpen(os, JSTL_CORE_NS, "when"); os.print(STRSTR\">"); printXmlChildren(os); os.print("</" + prefix + STR); }
/** * Generates the XML text representation for the tag validation. * * @param os write stream to the generated XML. */
Generates the XML text representation for the tag validation
printXml
{ "repo_name": "mdaniel/svn-caucho-com-resin", "path": "modules/resin/src/com/caucho/jsp/java/JstlCoreWhen.java", "license": "gpl-2.0", "size": 3766 }
[ "com.caucho.vfs.WriteStream", "java.io.IOException" ]
import com.caucho.vfs.WriteStream; import java.io.IOException;
import com.caucho.vfs.*; import java.io.*;
[ "com.caucho.vfs", "java.io" ]
com.caucho.vfs; java.io;
2,851,053
public void setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { if (auth instanceof ApiKeyAuth) { ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); return; } } throw new RuntimeException("No API key authentication configured!"); }
void function(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { if (auth instanceof ApiKeyAuth) { ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); return; } } throw new RuntimeException(STR); }
/** * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix */
Helper method to set API key prefix for the first API key authentication
setApiKeyPrefix
{ "repo_name": "jaadds/product-apim", "path": "sample-scenarios/clients/admin/src/main/java/org/wso2/carbon/apimgt/samples/utils/admin/rest/client/ApiClient.java", "license": "apache-2.0", "size": 58088 }
[ "org.wso2.carbon.apimgt.samples.utils.admin.rest.client.auth.ApiKeyAuth", "org.wso2.carbon.apimgt.samples.utils.admin.rest.client.auth.Authentication" ]
import org.wso2.carbon.apimgt.samples.utils.admin.rest.client.auth.ApiKeyAuth; import org.wso2.carbon.apimgt.samples.utils.admin.rest.client.auth.Authentication;
import org.wso2.carbon.apimgt.samples.utils.admin.rest.client.auth.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
1,425,525
public void setLinkagetype3(LinkageType linkagetype) { this.linkagetype3 = linkagetype; }
void function(LinkageType linkagetype) { this.linkagetype3 = linkagetype; }
/** * Set the linkage type of the third attachment position * @param linkagetype3 the linkagetype3 to set */
Set the linkage type of the third attachment position
setLinkagetype3
{ "repo_name": "glycoinfo/ResourcesDB", "path": "src/main/java/org/eurocarbdb/resourcesdb/io/SubstituentExchangeObject.java", "license": "gpl-3.0", "size": 16704 }
[ "org.eurocarbdb.resourcesdb.glycoconjugate_derived.LinkageType" ]
import org.eurocarbdb.resourcesdb.glycoconjugate_derived.LinkageType;
import org.eurocarbdb.resourcesdb.glycoconjugate_derived.*;
[ "org.eurocarbdb.resourcesdb" ]
org.eurocarbdb.resourcesdb;
1,814,865
int getRevision(Reference reference);
int getRevision(Reference reference);
/** * Get the revision based on the referenece string, if there is no version, * then it is implementation specific what is returned (eg -1) * * @param reference * @return the revision number */
Get the revision based on the referenece string, if there is no version, then it is implementation specific what is returned (eg -1)
getRevision
{ "repo_name": "rodriguezdevera/sakai", "path": "rwiki/rwiki-api/api/src/java/uk/ac/cam/caret/sakai/rwiki/service/api/EntityHandler.java", "license": "apache-2.0", "size": 3510 }
[ "org.sakaiproject.entity.api.Reference" ]
import org.sakaiproject.entity.api.Reference;
import org.sakaiproject.entity.api.*;
[ "org.sakaiproject.entity" ]
org.sakaiproject.entity;
2,501,092
WolframTileProvider tp = getProvider(); Log.i(WolframUtils.LOG_TAG,"Changing rule to " + newRule); tp.setRule(newRule); moveToOriginTile(true); }
WolframTileProvider tp = getProvider(); Log.i(WolframUtils.LOG_TAG,STR + newRule); tp.setRule(newRule); moveToOriginTile(true); }
/** * Tell the registered {@link WolframTileProvider} to generate tiles for the specified rule * @param newRule The {@link net.nologin.meep.ca.model.WolframRuleTable rule number} */
Tell the registered <code>WolframTileProvider</code> to generate tiles for the specified rule
setupForRule
{ "repo_name": "barryoneill/WolframCA", "path": "src/net/nologin/meep/ca/view/WolframCAView.java", "license": "apache-2.0", "size": 4263 }
[ "android.util.Log", "net.nologin.meep.ca.WolframUtils", "net.nologin.meep.ca.model.WolframTileProvider" ]
import android.util.Log; import net.nologin.meep.ca.WolframUtils; import net.nologin.meep.ca.model.WolframTileProvider;
import android.util.*; import net.nologin.meep.ca.*; import net.nologin.meep.ca.model.*;
[ "android.util", "net.nologin.meep" ]
android.util; net.nologin.meep;
1,403,079
public static <PS> IntFunction<Node> get( GenericStyledArea<PS, ?, ?> area, IntFunction<String> format, Predicate<PS> isFolded, UnaryOperator<PS> removeFoldStyle ) { return new LineNumberFactory<>( area, format, isFolded, removeFoldStyle ); } private final Val<Integer> nParagraphs; private final IntFunction<String> format; private final GenericStyledArea<PS, ?, ?> area; private final UnaryOperator<PS> removeFoldStyle; private final Predicate<PS> isFoldedCheck; private LineNumberFactory( GenericStyledArea<PS, ?, ?> area, IntFunction<String> format, Predicate<PS> isFolded, UnaryOperator<PS> removeFoldStyle ) { nParagraphs = LiveList.sizeOf(area.getParagraphs()); this.removeFoldStyle = removeFoldStyle; this.isFoldedCheck = isFolded; this.format = format; this.area = area; if ( isFoldedCheck != null ) { area.getParagraphs().sizeProperty().addListener( (ob,ov,nv) -> { if ( nv <= ov ) Platform.runLater( () -> deleteParagraphCheck() ); else Platform.runLater( () -> insertParagraphCheck() ); }); } }
static <PS> IntFunction<Node> function( GenericStyledArea<PS, ?, ?> area, IntFunction<String> format, Predicate<PS> isFolded, UnaryOperator<PS> removeFoldStyle ) { return new LineNumberFactory<>( area, format, isFolded, removeFoldStyle ); } private final Val<Integer> nParagraphs; private final IntFunction<String> format; private final GenericStyledArea<PS, ?, ?> area; private final UnaryOperator<PS> removeFoldStyle; private final Predicate<PS> isFoldedCheck; private LineNumberFactory( GenericStyledArea<PS, ?, ?> area, IntFunction<String> format, Predicate<PS> isFolded, UnaryOperator<PS> removeFoldStyle ) { nParagraphs = LiveList.sizeOf(area.getParagraphs()); this.removeFoldStyle = removeFoldStyle; this.isFoldedCheck = isFolded; this.format = format; this.area = area; if ( isFoldedCheck != null ) { area.getParagraphs().sizeProperty().addListener( (ob,ov,nv) -> { if ( nv <= ov ) Platform.runLater( () -> deleteParagraphCheck() ); else Platform.runLater( () -> insertParagraphCheck() ); }); } }
/** * Use this if you extended GenericStyledArea for your own text area and you're using paragraph folding. * * @param <PS> The paragraph style type being used by the text area * @param format Given an int convert to a String for the line number. * @param isFolded Given a paragraph style PS check if it's folded. * @param removeFoldStyle Given a paragraph style PS, return a <b>new</b> PS that excludes fold styling. */
Use this if you extended GenericStyledArea for your own text area and you're using paragraph folding
get
{ "repo_name": "TomasMikula/RichTextFX", "path": "richtextfx/src/main/java/org/fxmisc/richtext/LineNumberFactory.java", "license": "bsd-2-clause", "size": 7602 }
[ "java.util.function.IntFunction", "java.util.function.Predicate", "java.util.function.UnaryOperator", "org.reactfx.collection.LiveList", "org.reactfx.value.Val" ]
import java.util.function.IntFunction; import java.util.function.Predicate; import java.util.function.UnaryOperator; import org.reactfx.collection.LiveList; import org.reactfx.value.Val;
import java.util.function.*; import org.reactfx.collection.*; import org.reactfx.value.*;
[ "java.util", "org.reactfx.collection", "org.reactfx.value" ]
java.util; org.reactfx.collection; org.reactfx.value;
1,003,035
String buildDnFromTemplate(String username, String template) { //this value must be escaped to avoid manipulation of the template DN. String escapedUsername = escapedRDNValue(username); return new MessageFormat(template, Locale.ROOT).format(new Object[] { escapedUsername }, new StringBuffer(), null).toString(); }
String buildDnFromTemplate(String username, String template) { String escapedUsername = escapedRDNValue(username); return new MessageFormat(template, Locale.ROOT).format(new Object[] { escapedUsername }, new StringBuffer(), null).toString(); }
/** * Securely escapes the username and inserts it into the template using MessageFormat * * @param username username to insert into the DN template. Any commas, equals or plus will be escaped. * @return DN (distinguished name) build from the template. */
Securely escapes the username and inserts it into the template using MessageFormat
buildDnFromTemplate
{ "repo_name": "coding0011/elasticsearch", "path": "x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ldap/LdapSessionFactory.java", "license": "apache-2.0", "size": 6081 }
[ "java.text.MessageFormat", "java.util.Locale", "org.elasticsearch.xpack.security.authc.ldap.support.LdapUtils" ]
import java.text.MessageFormat; import java.util.Locale; import org.elasticsearch.xpack.security.authc.ldap.support.LdapUtils;
import java.text.*; import java.util.*; import org.elasticsearch.xpack.security.authc.ldap.support.*;
[ "java.text", "java.util", "org.elasticsearch.xpack" ]
java.text; java.util; org.elasticsearch.xpack;
1,688,100
public final boolean unregister() { return Hudson.getInstance().getSCMListeners().remove(this); }
final boolean function() { return Hudson.getInstance().getSCMListeners().remove(this); }
/** * Unregisters this {@link SCMListener} so that it will never receive further events. * * <p> * Unless {@link SCMListener} is unregistered, it will never be a subject of GC. */
Unregisters this <code>SCMListener</code> so that it will never receive further events. Unless <code>SCMListener</code> is unregistered, it will never be a subject of GC
unregister
{ "repo_name": "sincere520/testGitRepo", "path": "hudson-core/src/main/java/hudson/model/listeners/SCMListener.java", "license": "mit", "size": 4329 }
[ "hudson.model.Hudson" ]
import hudson.model.Hudson;
import hudson.model.*;
[ "hudson.model" ]
hudson.model;
989,679
public Observable<ServiceResponse<Page<ExpressRoutePortInner>>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); }
Observable<ServiceResponse<Page<ExpressRoutePortInner>>> function(final String resourceGroupName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (resourceGroupName == null) { throw new IllegalArgumentException(STR); }
/** * List all the ExpressRoutePort resources in the specified resource group. * ServiceResponse<PageImpl<ExpressRoutePortInner>> * @param resourceGroupName The name of the resource group. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;ExpressRoutePortInner&gt; object wrapped in {@link ServiceResponse} if successful. */
List all the ExpressRoutePort resources in the specified resource group
listByResourceGroupSinglePageAsync
{ "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.azure.Page", "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse;
import com.microsoft.azure.*; import com.microsoft.rest.*;
[ "com.microsoft.azure", "com.microsoft.rest" ]
com.microsoft.azure; com.microsoft.rest;
1,732,633
public final Property<Double> rate() { return metaBean().rate().createProperty(this); }
final Property<Double> function() { return metaBean().rate().createProperty(this); }
/** * Gets the the {@code rate} property. * @return the property, not null */
Gets the the rate property
rate
{ "repo_name": "McLeodMoores/starling", "path": "projects/financial-types/src/main/java/com/opengamma/financial/security/swap/FixedInflationSwapLeg.java", "license": "apache-2.0", "size": 6914 }
[ "org.joda.beans.Property" ]
import org.joda.beans.Property;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
93,957
public T php(String text) { return expression(new PhpExpression(text)); }
T function(String text) { return expression(new PhpExpression(text)); }
/** * Evaluates a <a href="http://camel.apache.org/php.html">PHP * expression</a> * * @param text the expression to be evaluated * @return the builder to continue processing the DSL */
Evaluates a PHP expression
php
{ "repo_name": "cexbrayat/camel", "path": "camel-core/src/main/java/org/apache/camel/builder/ExpressionClauseSupport.java", "license": "apache-2.0", "size": 23576 }
[ "org.apache.camel.model.language.PhpExpression" ]
import org.apache.camel.model.language.PhpExpression;
import org.apache.camel.model.language.*;
[ "org.apache.camel" ]
org.apache.camel;
2,146,677
public void testOneAssociatedObjectNestedSearch1() throws ApplicationException { Computer searchObject = new Computer(); Ii ii=new Ii(); ii.setExtension("1"); searchObject.setId(ii); Collection results = getApplicationService().search("gov.nih.nci.cacoresdk.domain.onetomany.bidirectional.Computer",searchObject ); assertNotNull(results); assertEquals(1,results.size()); Iterator i = results.iterator(); Computer result = (Computer)i.next(); assertNotNull(result); assertNotNull(result.getId()); assertEquals(result.getId().getRoot(),II_ROOT_GLOBAL_CONSTANT_VALUE); assertNotNull(result.getType()); Collection hardDriveCollection = result.getHardDriveCollection(); Iterator j = hardDriveCollection.iterator(); HardDrive hardDrive = (HardDrive)j.next(); assertNotNull(hardDrive); assertNotNull(hardDrive.getId()); assertEquals(hardDrive.getId().getRoot(),II_ROOT_GLOBAL_CONSTANT_VALUE); assertNotNull(hardDrive.getSize()); assertEquals("1",hardDrive.getId().getExtension()); }
void function() throws ApplicationException { Computer searchObject = new Computer(); Ii ii=new Ii(); ii.setExtension("1"); searchObject.setId(ii); Collection results = getApplicationService().search(STR,searchObject ); assertNotNull(results); assertEquals(1,results.size()); Iterator i = results.iterator(); Computer result = (Computer)i.next(); assertNotNull(result); assertNotNull(result.getId()); assertEquals(result.getId().getRoot(),II_ROOT_GLOBAL_CONSTANT_VALUE); assertNotNull(result.getType()); Collection hardDriveCollection = result.getHardDriveCollection(); Iterator j = hardDriveCollection.iterator(); HardDrive hardDrive = (HardDrive)j.next(); assertNotNull(hardDrive); assertNotNull(hardDrive.getId()); assertEquals(hardDrive.getId().getRoot(),II_ROOT_GLOBAL_CONSTANT_VALUE); assertNotNull(hardDrive.getSize()); assertEquals("1",hardDrive.getId().getExtension()); }
/** * Uses Nested Search Criteria for search * Verifies that the results are returned * Verifies size of the result set * Verifies that none of the attribute is null * Verifies that the associated object has required Id * * @throws ApplicationException */
Uses Nested Search Criteria for search Verifies that the results are returned Verifies size of the result set Verifies that none of the attribute is null Verifies that the associated object has required Id
testOneAssociatedObjectNestedSearch1
{ "repo_name": "NCIP/cacore-sdk", "path": "sdk-toolkit/iso-example-project/junit/src/test/gov/nih/nci/cacoresdk/domain/onetomany/bidirectional/O2MBidirectionalTest.java", "license": "bsd-3-clause", "size": 10055 }
[ "gov.nih.nci.cacoresdk.domain.onetomany.bidirectional.Computer", "gov.nih.nci.cacoresdk.domain.onetomany.bidirectional.HardDrive", "gov.nih.nci.iso21090.Ii", "gov.nih.nci.system.applicationservice.ApplicationException", "java.util.Collection", "java.util.Iterator" ]
import gov.nih.nci.cacoresdk.domain.onetomany.bidirectional.Computer; import gov.nih.nci.cacoresdk.domain.onetomany.bidirectional.HardDrive; import gov.nih.nci.iso21090.Ii; import gov.nih.nci.system.applicationservice.ApplicationException; import java.util.Collection; import java.util.Iterator;
import gov.nih.nci.cacoresdk.domain.onetomany.bidirectional.*; import gov.nih.nci.iso21090.*; import gov.nih.nci.system.applicationservice.*; import java.util.*;
[ "gov.nih.nci", "java.util" ]
gov.nih.nci; java.util;
2,102,030
boolean updateStatus(Idea idea);
boolean updateStatus(Idea idea);
/** * Update the status of the idea. * * @param idea Idea object containing updated status and key. * @return boolean return true or false on the basis of successful update. */
Update the status of the idea
updateStatus
{ "repo_name": "dslam/thoughtsite", "path": "src/main/java/com/google/ie/business/dao/IdeaDao.java", "license": "apache-2.0", "size": 4221 }
[ "com.google.ie.business.domain.Idea" ]
import com.google.ie.business.domain.Idea;
import com.google.ie.business.domain.*;
[ "com.google.ie" ]
com.google.ie;
667,045
protected void addRange(TextPresentation presentation, int offset, int length, TextStyle textStyle) { if (textStyle != null) { if (textStyle.metrics != null && length >= 1) { for (int i = offset; i < offset + length; i++) { try { StyleRange styleRange = new StyleRange(textStyle); String placeHolder = fDocument.get(i, 1); InnerTag innerTag = TmxInnerTagUtils.getInnerTagControl(viewer.innerTagCacheList, placeHolder); if (innerTag != null) { Point rect = innerTag.computeSize(SWT.DEFAULT, SWT.DEFAULT); // int ascent = 4 * rect.height / 5 + SEGMENT_LINE_SPACING / 2; // int descent = rect.height - ascent + SEGMENT_LINE_SPACING; styleRange.metrics = new GlyphMetrics(rect.y, 0, rect.x + TmxEditorConstanst.SEGMENT_LINE_SPACING * 2); } styleRange.start = i; styleRange.length = 1; presentation.addStyleRange(styleRange); } catch (BadLocationException e) { e.printStackTrace(); } } } else { StyleRange styleRange = new StyleRange(textStyle); styleRange.start = offset; styleRange.length = length; presentation.addStyleRange(styleRange); } } }
void function(TextPresentation presentation, int offset, int length, TextStyle textStyle) { if (textStyle != null) { if (textStyle.metrics != null && length >= 1) { for (int i = offset; i < offset + length; i++) { try { StyleRange styleRange = new StyleRange(textStyle); String placeHolder = fDocument.get(i, 1); InnerTag innerTag = TmxInnerTagUtils.getInnerTagControl(viewer.innerTagCacheList, placeHolder); if (innerTag != null) { Point rect = innerTag.computeSize(SWT.DEFAULT, SWT.DEFAULT); styleRange.metrics = new GlyphMetrics(rect.y, 0, rect.x + TmxEditorConstanst.SEGMENT_LINE_SPACING * 2); } styleRange.start = i; styleRange.length = 1; presentation.addStyleRange(styleRange); } catch (BadLocationException e) { e.printStackTrace(); } } } else { StyleRange styleRange = new StyleRange(textStyle); styleRange.start = offset; styleRange.length = length; presentation.addStyleRange(styleRange); } } }
/** * Adds style information to the given text presentation. * @param presentation * the text presentation to be extended * @param offset * the offset of the range to be styled * @param length * the length of the range to be styled * @param textStyle * the style of the range to be styled */
Adds style information to the given text presentation
addRange
{ "repo_name": "heartsome/tmxeditor8", "path": "te/net.heartsome.cat.te.tmxeditor/src/net/heartsome/cat/te/tmxeditor/editor/nattable/celleditor/PresentationRepairer.java", "license": "gpl-2.0", "size": 4678 }
[ "net.heartsome.cat.common.ui.innertag.InnerTag", "net.heartsome.cat.te.tmxeditor.TmxEditorConstanst", "org.eclipse.jface.text.BadLocationException", "org.eclipse.jface.text.TextPresentation", "org.eclipse.swt.custom.StyleRange", "org.eclipse.swt.graphics.GlyphMetrics", "org.eclipse.swt.graphics.Point", ...
import net.heartsome.cat.common.ui.innertag.InnerTag; import net.heartsome.cat.te.tmxeditor.TmxEditorConstanst; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.TextPresentation; import org.eclipse.swt.custom.StyleRange; import org.eclipse.swt.graphics.GlyphMetrics; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.TextStyle;
import net.heartsome.cat.common.ui.innertag.*; import net.heartsome.cat.te.tmxeditor.*; import org.eclipse.jface.text.*; import org.eclipse.swt.custom.*; import org.eclipse.swt.graphics.*;
[ "net.heartsome.cat", "org.eclipse.jface", "org.eclipse.swt" ]
net.heartsome.cat; org.eclipse.jface; org.eclipse.swt;
2,782,796
@Test public void testExecute_2() throws Exception { TestPlanRunner testPlanRunner = new TestPlanRunner(new HDTestPlan(), 1, new TestHttpClient()); testPlanRunner.setHttpClient(null); TestStepContext testStepContext = new TestStepContext(new SleepTimeStep(), new Variables(), "", "", new TimerMap(), testPlanRunner); SleepTimeRunner fixture = new SleepTimeRunner(testStepContext); String result = fixture.execute(); // An unexpected exception was thrown in user code while executing this test: // java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.runner.TestPlanRunner assertNotNull(result); }
void function() throws Exception { TestPlanRunner testPlanRunner = new TestPlanRunner(new HDTestPlan(), 1, new TestHttpClient()); testPlanRunner.setHttpClient(null); TestStepContext testStepContext = new TestStepContext(new SleepTimeStep(), new Variables(), STR", new TimerMap(), testPlanRunner); SleepTimeRunner fixture = new SleepTimeRunner(testStepContext); String result = fixture.execute(); assertNotNull(result); }
/** * Run the String execute() method test. * * @throws Exception * * @generatedBy CodePro at 12/16/14 5:53 PM */
Run the String execute() method test
testExecute_2
{ "repo_name": "kevinmcgoldrick/Tank", "path": "agent/apiharness/src/test/java/com/intuit/tank/runner/method/SleepTimeRunnerTest.java", "license": "epl-1.0", "size": 4101 }
[ "com.intuit.tank.harness.data.HDTestPlan", "com.intuit.tank.harness.data.SleepTimeStep", "com.intuit.tank.harness.test.data.Variables", "com.intuit.tank.runner.TestHttpClient", "com.intuit.tank.runner.TestPlanRunner", "com.intuit.tank.runner.TestStepContext", "org.junit.Assert" ]
import com.intuit.tank.harness.data.HDTestPlan; import com.intuit.tank.harness.data.SleepTimeStep; import com.intuit.tank.harness.test.data.Variables; import com.intuit.tank.runner.TestHttpClient; import com.intuit.tank.runner.TestPlanRunner; import com.intuit.tank.runner.TestStepContext; import org.junit.Assert;
import com.intuit.tank.harness.data.*; import com.intuit.tank.harness.test.data.*; import com.intuit.tank.runner.*; import org.junit.*;
[ "com.intuit.tank", "org.junit" ]
com.intuit.tank; org.junit;
2,577,145
public static MetricWriter getMetricWriter(PrintStream ps) { // configure MetricWriter MetricWriter metricWriter = new XmlMetricWriter(ps); // check for metrics to ignore String ignoreMetric = EpaUtils.getProperty(IGNORE_METRICS, EMPTY_STRING); if (!EMPTY_STRING.equals(ignoreMetric)) { metricWriter = new MetricNameFilter(metricWriter, ignoreMetric.split(",")); } return metricWriter; }
static MetricWriter function(PrintStream ps) { MetricWriter metricWriter = new XmlMetricWriter(ps); String ignoreMetric = EpaUtils.getProperty(IGNORE_METRICS, EMPTY_STRING); if (!EMPTY_STRING.equals(ignoreMetric)) { metricWriter = new MetricNameFilter(metricWriter, ignoreMetric.split(",")); } return metricWriter; }
/** * Returns a {@link MetricWriter} object according to the configuration. * @param ps stream to write metrics to * @return the new metric writer */
Returns a <code>MetricWriter</code> object according to the configuration
getMetricWriter
{ "repo_name": "CA-APM/ca-apm-fieldpack-asm", "path": "asm-monitor/src/main/java/com/ca/apm/swat/epaplugins/asm/AsmReader.java", "license": "epl-1.0", "size": 31019 }
[ "com.ca.apm.swat.epaplugins.asm.reporting.MetricNameFilter", "com.ca.apm.swat.epaplugins.asm.reporting.MetricWriter", "com.ca.apm.swat.epaplugins.asm.reporting.XmlMetricWriter", "com.wily.introscope.epagent.EpaUtils", "java.io.PrintStream" ]
import com.ca.apm.swat.epaplugins.asm.reporting.MetricNameFilter; import com.ca.apm.swat.epaplugins.asm.reporting.MetricWriter; import com.ca.apm.swat.epaplugins.asm.reporting.XmlMetricWriter; import com.wily.introscope.epagent.EpaUtils; import java.io.PrintStream;
import com.ca.apm.swat.epaplugins.asm.reporting.*; import com.wily.introscope.epagent.*; import java.io.*;
[ "com.ca.apm", "com.wily.introscope", "java.io" ]
com.ca.apm; com.wily.introscope; java.io;
1,162,262
@Override public void enterFactor(@NotNull FilterParser.FactorContext ctx) { }
@Override public void enterFactor(@NotNull FilterParser.FactorContext ctx) { }
/** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */
The default implementation does nothing
exitValue
{ "repo_name": "agilemobiledev/alchemy", "path": "alchemy-core/src/main/java/io/rtr/alchemy/filtering/FilterBaseListener.java", "license": "mit", "size": 3100 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
811,626
@ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux<KpiResourceFormatInner> listByHubAsync( String resourceGroupName, String hubName, Context context) { return new PagedFlux<>( () -> listByHubSinglePageAsync(resourceGroupName, hubName, context), nextLink -> listByHubNextSinglePageAsync(nextLink, context)); }
@ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux<KpiResourceFormatInner> function( String resourceGroupName, String hubName, Context context) { return new PagedFlux<>( () -> listByHubSinglePageAsync(resourceGroupName, hubName, context), nextLink -> listByHubNextSinglePageAsync(nextLink, context)); }
/** * Gets all the KPIs in the specified hub. * * @param resourceGroupName The name of the resource group. * @param hubName The name of the hub. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all the KPIs in the specified hub. */
Gets all the KPIs in the specified hub
listByHubAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/customerinsights/azure-resourcemanager-customerinsights/src/main/java/com/azure/resourcemanager/customerinsights/implementation/KpisClientImpl.java", "license": "mit", "size": 58795 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.PagedFlux", "com.azure.core.util.Context", "com.azure.resourcemanager.customerinsights.fluent.models.KpiResourceFormatInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedFlux; import com.azure.core.util.Context; import com.azure.resourcemanager.customerinsights.fluent.models.KpiResourceFormatInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.customerinsights.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,542,956
@EventHandler (priority = EventPriority.MONITOR) public void onPlayerInteract(PlayerInteractEvent event) { if (event.isCancelled()) return; if (event.getAction()==Action.RIGHT_CLICK_BLOCK) { UserSession session = rc.getUserSession(event.getPlayer(), false); if (session!=null && session.useToolInHand(event.getClickedBlock())) event.setCancelled(true); // use session tool else if (session!=null && session.getMode()==UserSession.Mode.SELECTION) { // in chip selection mode Chip c = cm.getAllChips().getByStructureBlock(event.getClickedBlock().getLocation()); if (c!=null) { session.selectChip(c); event.setCancelled(true); } } else if (session!=null && session.getMode()==UserSession.Mode.CUBOID_DEFINE) { // in cuboid define mode if (!event.getPlayer().getItemInHand().getType().isBlock()) { session.addCuboidLocation(event.getClickedBlock().getLocation()); event.setCancelled(true); } } else { MaybeChip mChip = cm.maybeCreateAndActivateChip(event.getClickedBlock(), event.getPlayer(), -1); if (mChip!=MaybeChip.NotAChip) event.setCancelled(true); } } }
@EventHandler (priority = EventPriority.MONITOR) void function(PlayerInteractEvent event) { if (event.isCancelled()) return; if (event.getAction()==Action.RIGHT_CLICK_BLOCK) { UserSession session = rc.getUserSession(event.getPlayer(), false); if (session!=null && session.useToolInHand(event.getClickedBlock())) event.setCancelled(true); else if (session!=null && session.getMode()==UserSession.Mode.SELECTION) { Chip c = cm.getAllChips().getByStructureBlock(event.getClickedBlock().getLocation()); if (c!=null) { session.selectChip(c); event.setCancelled(true); } } else if (session!=null && session.getMode()==UserSession.Mode.CUBOID_DEFINE) { if (!event.getPlayer().getItemInHand().getType().isBlock()) { session.addCuboidLocation(event.getClickedBlock().getLocation()); event.setCancelled(true); } } else { MaybeChip mChip = cm.maybeCreateAndActivateChip(event.getClickedBlock(), event.getPlayer(), -1); if (mChip!=MaybeChip.NotAChip) event.setCancelled(true); } } }
/** * Handle right-click actions: chip activation, selection or defining cuboids. * @param event */
Handle right-click actions: chip activation, selection or defining cuboids
onPlayerInteract
{ "repo_name": "eisental/RedstoneChips", "path": "src/main/java/org/redstonechips/RCBukkitEventHandler.java", "license": "gpl-3.0", "size": 9349 }
[ "org.bukkit.event.EventHandler", "org.bukkit.event.EventPriority", "org.bukkit.event.block.Action", "org.bukkit.event.player.PlayerInteractEvent", "org.redstonechips.chip.Chip", "org.redstonechips.chip.ChipFactory", "org.redstonechips.user.UserSession" ]
import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; import org.redstonechips.chip.Chip; import org.redstonechips.chip.ChipFactory; import org.redstonechips.user.UserSession;
import org.bukkit.event.*; import org.bukkit.event.block.*; import org.bukkit.event.player.*; import org.redstonechips.chip.*; import org.redstonechips.user.*;
[ "org.bukkit.event", "org.redstonechips.chip", "org.redstonechips.user" ]
org.bukkit.event; org.redstonechips.chip; org.redstonechips.user;
642,325
public void configureForForeignSession(ForeignSession session, boolean isExpanded) { mDeviceIcon.setVisibility(View.VISIBLE); mDeviceLabel.setText(session.name); setTimeLabelVisibility(View.VISIBLE); mTimeLabel.setText(getTimeString(session)); switch (session.deviceType) { case ForeignSession.DEVICE_TYPE_PHONE: mDeviceIcon.setImageResource(R.drawable.recent_phone); break; case ForeignSession.DEVICE_TYPE_TABLET: mDeviceIcon.setImageResource(R.drawable.recent_tablet); break; default: mDeviceIcon.setImageResource(R.drawable.recent_laptop); break; } configureExpandedCollapsed(isExpanded); }
void function(ForeignSession session, boolean isExpanded) { mDeviceIcon.setVisibility(View.VISIBLE); mDeviceLabel.setText(session.name); setTimeLabelVisibility(View.VISIBLE); mTimeLabel.setText(getTimeString(session)); switch (session.deviceType) { case ForeignSession.DEVICE_TYPE_PHONE: mDeviceIcon.setImageResource(R.drawable.recent_phone); break; case ForeignSession.DEVICE_TYPE_TABLET: mDeviceIcon.setImageResource(R.drawable.recent_tablet); break; default: mDeviceIcon.setImageResource(R.drawable.recent_laptop); break; } configureExpandedCollapsed(isExpanded); }
/** * Configures the view for a foreign session. * * @param session The session to configure the view for. * @param isExpanded Whether the view is expanded or collapsed. */
Configures the view for a foreign session
configureForForeignSession
{ "repo_name": "js0701/chromium-crosswalk", "path": "chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsGroupView.java", "license": "bsd-3-clause", "size": 8967 }
[ "android.view.View", "org.chromium.chrome.browser.ntp.ForeignSessionHelper" ]
import android.view.View; import org.chromium.chrome.browser.ntp.ForeignSessionHelper;
import android.view.*; import org.chromium.chrome.browser.ntp.*;
[ "android.view", "org.chromium.chrome" ]
android.view; org.chromium.chrome;
1,807,669
@NotAuditable Rating removeRatingByCurrentUser(NodeRef targetNode, String ratingSchemeName);
Rating removeRatingByCurrentUser(NodeRef targetNode, String ratingSchemeName);
/** * This method removes any {@link Rating} applied by the current user to the specified node in the specified * {@link RatingScheme}. * * @param targetNode the node from which the rating is to be removed. * @param ratingSchemeName the rating scheme name to use. * * @return the deleted Rating object if there was one, else <code>null</code>. * @see RatingService#getRatingSchemes() * @see RatingScheme */
This method removes any <code>Rating</code> applied by the current user to the specified node in the specified <code>RatingScheme</code>
removeRatingByCurrentUser
{ "repo_name": "Kast0rTr0y/community-edition", "path": "projects/repository/source/java/org/alfresco/service/cmr/rating/RatingService.java", "license": "lgpl-3.0", "size": 8112 }
[ "org.alfresco.service.cmr.repository.NodeRef" ]
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.*;
[ "org.alfresco.service" ]
org.alfresco.service;
2,776,310
protected static int hashEnum(EnumLite e) { return e.getNumber(); }
static int function(EnumLite e) { return e.getNumber(); }
/** * Helper method for implementing {@link Message#hashCode()}. * <p> * This is needed because {@link java.lang.Enum#hashCode()} is final, but we * need to use the field number as the hash code to ensure compatibility * between statically and dynamically generated enum objects. */
Helper method for implementing <code>Message#hashCode()</code>. This is needed because <code>java.lang.Enum#hashCode()</code> is final, but we need to use the field number as the hash code to ensure compatibility between statically and dynamically generated enum objects
hashEnum
{ "repo_name": "os72/protobuf-java-shaded-250", "path": "java/src/main/java/com/github/os72/protobuf250/AbstractMessage.java", "license": "bsd-3-clause", "size": 33405 }
[ "com.github.os72.protobuf250.Internal" ]
import com.github.os72.protobuf250.Internal;
import com.github.os72.protobuf250.*;
[ "com.github.os72" ]
com.github.os72;
1,713,827
void send(Message msg, List<RoutingNode> recipients);
void send(Message msg, List<RoutingNode> recipients);
/** * Send a message to the given recipients. A {@link RoutingNode} contains all the necessary context for sending. * * @param msg the message to send * @param recipients a list of routing leaf nodes resolved for the message */
Send a message to the given recipients. A <code>RoutingNode</code> contains all the necessary context for sending
send
{ "repo_name": "vespa-engine/vespa", "path": "messagebus/src/main/java/com/yahoo/messagebus/network/Network.java", "license": "apache-2.0", "size": 3321 }
[ "com.yahoo.messagebus.Message", "com.yahoo.messagebus.routing.RoutingNode", "java.util.List" ]
import com.yahoo.messagebus.Message; import com.yahoo.messagebus.routing.RoutingNode; import java.util.List;
import com.yahoo.messagebus.*; import com.yahoo.messagebus.routing.*; import java.util.*;
[ "com.yahoo.messagebus", "java.util" ]
com.yahoo.messagebus; java.util;
69,936
private OutboundPacket createOutBoundLLDP(final Long port) { if (port == null) { return null; } this.lldpPacket.setPortId(port.intValue()); this.ethPacket.setSourceMACAddress("DE:AD:BE:EF:BA:11"); final byte[] lldp = this.ethPacket.serialize(); return new DefaultOutboundPacket(this.device.id(), builder().setOutput(portNumber(port)).build(), ByteBuffer.wrap(lldp)); }
OutboundPacket function(final Long port) { if (port == null) { return null; } this.lldpPacket.setPortId(port.intValue()); this.ethPacket.setSourceMACAddress(STR); final byte[] lldp = this.ethPacket.serialize(); return new DefaultOutboundPacket(this.device.id(), builder().setOutput(portNumber(port)).build(), ByteBuffer.wrap(lldp)); }
/** * Creates packet_out LLDP for specified output port. * * @param port the port * @return Packet_out message with LLDP data */
Creates packet_out LLDP for specified output port
createOutBoundLLDP
{ "repo_name": "CNlukai/onos-gerrit-test", "path": "providers/lldp/src/main/java/org/onosproject/provider/lldp/impl/LinkDiscovery.java", "license": "apache-2.0", "size": 13724 }
[ "java.nio.ByteBuffer", "org.onosproject.net.flow.DefaultTrafficTreatment", "org.onosproject.net.packet.DefaultOutboundPacket", "org.onosproject.net.packet.OutboundPacket" ]
import java.nio.ByteBuffer; import org.onosproject.net.flow.DefaultTrafficTreatment; import org.onosproject.net.packet.DefaultOutboundPacket; import org.onosproject.net.packet.OutboundPacket;
import java.nio.*; import org.onosproject.net.flow.*; import org.onosproject.net.packet.*;
[ "java.nio", "org.onosproject.net" ]
java.nio; org.onosproject.net;
1,861,364
public CardController getCardController() { return cardController; }
CardController function() { return cardController; }
/** * Get the system card controller * * @return The card controller */
Get the system card controller
getCardController
{ "repo_name": "codesqueak/Nascom", "path": "src/main/java/com/codingrodent/emulator/emulator/SystemContext.java", "license": "mit", "size": 4837 }
[ "com.codingrodent.emulator.nas80Bus.CardController" ]
import com.codingrodent.emulator.nas80Bus.CardController;
import com.codingrodent.emulator.*;
[ "com.codingrodent.emulator" ]
com.codingrodent.emulator;
726,434
public Comment findByPrimaryKey(long commentId) throws NoSuchCommentException, SystemException { Comment comment = fetchByPrimaryKey(commentId); if (comment == null) { if (_log.isWarnEnabled()) { _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + commentId); } throw new NoSuchCommentException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + commentId); } return comment; }
Comment function(long commentId) throws NoSuchCommentException, SystemException { Comment comment = fetchByPrimaryKey(commentId); if (comment == null) { if (_log.isWarnEnabled()) { _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + commentId); } throw new NoSuchCommentException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + commentId); } return comment; }
/** * Returns the Comment with the primary key or throws a {@link it.gebhard.qa.NoSuchCommentException} if it could not be found. * * @param commentId the primary key of the Comment * @return the Comment * @throws it.gebhard.qa.NoSuchCommentException if a Comment with the primary key could not be found * @throws SystemException if a system exception occurred */
Returns the Comment with the primary key or throws a <code>it.gebhard.qa.NoSuchCommentException</code> if it could not be found
findByPrimaryKey
{ "repo_name": "p-gebhard/QuickAnswer", "path": "docroot/WEB-INF/src/it/gebhard/qa/service/persistence/CommentPersistenceImpl.java", "license": "gpl-3.0", "size": 49083 }
[ "com.liferay.portal.kernel.exception.SystemException", "it.gebhard.qa.NoSuchCommentException", "it.gebhard.qa.model.Comment" ]
import com.liferay.portal.kernel.exception.SystemException; import it.gebhard.qa.NoSuchCommentException; import it.gebhard.qa.model.Comment;
import com.liferay.portal.kernel.exception.*; import it.gebhard.qa.*; import it.gebhard.qa.model.*;
[ "com.liferay.portal", "it.gebhard.qa" ]
com.liferay.portal; it.gebhard.qa;
2,477,912
@Test public void returnsDefaultHeader() throws IOException { final String type = "text/plain"; MatcherAssert.assertThat( new RqHeaders.Smart( new RqHeaders.Base( new RqFake( Arrays.asList( "GET /f", "Accept: text/json" ), "" ) ) ).single("Content-type", type), Matchers.equalTo(type) ); }
void function() throws IOException { final String type = STR; MatcherAssert.assertThat( new RqHeaders.Smart( new RqHeaders.Base( new RqFake( Arrays.asList( STR, STR ), STRContent-type", type), Matchers.equalTo(type) ); }
/** * RqHeaders.Smart can return a default header. * @throws IOException If some problem inside */
RqHeaders.Smart can return a default header
returnsDefaultHeader
{ "repo_name": "essobedo/takes", "path": "src/test/java/org/takes/rq/RqHeadersTest.java", "license": "mit", "size": 4049 }
[ "java.io.IOException", "java.util.Arrays", "org.hamcrest.MatcherAssert", "org.hamcrest.Matchers" ]
import java.io.IOException; import java.util.Arrays; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers;
import java.io.*; import java.util.*; import org.hamcrest.*;
[ "java.io", "java.util", "org.hamcrest" ]
java.io; java.util; org.hamcrest;
2,870,626
protected TextAttribute getAttributeFor(ITextRegion region) { TextAttribute result = null; if (region != null) { final String type = region.getType(); if (type == PHPRegionContext.PHP_OPEN) { result = getAttributeFor(PHPRegionTypes.PHP_OPENTAG); } else if (type == PHPRegionContext.PHP_CLOSE) { result = getAttributeFor(PHPRegionTypes.PHP_CLOSETAG); } else { result = getAttributeFor(region.getType()); } } // return the defalt attributes if there is not highlight color for the // region if (result == null) { result = (TextAttribute) getTextAttributes().get( PreferenceConstants.EDITOR_NORMAL_COLOR); } return result; }
TextAttribute function(ITextRegion region) { TextAttribute result = null; if (region != null) { final String type = region.getType(); if (type == PHPRegionContext.PHP_OPEN) { result = getAttributeFor(PHPRegionTypes.PHP_OPENTAG); } else if (type == PHPRegionContext.PHP_CLOSE) { result = getAttributeFor(PHPRegionTypes.PHP_CLOSETAG); } else { result = getAttributeFor(region.getType()); } } if (result == null) { result = (TextAttribute) getTextAttributes().get( PreferenceConstants.EDITOR_NORMAL_COLOR); } return result; }
/** * Returns the attribute for simple php regions (open /close) not * PHP_CONTENT regions * * @param region * @return the text attribute */
Returns the attribute for simple php regions (open /close) not PHP_CONTENT regions
getAttributeFor
{ "repo_name": "nwnpallewela/developer-studio", "path": "jaggery/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/highlighter/LineStyleProviderForPhp.java", "license": "apache-2.0", "size": 36244 }
[ "org.eclipse.jface.text.TextAttribute", "org.eclipse.php.internal.core.documentModel.parser.PHPRegionContext", "org.eclipse.php.internal.core.documentModel.parser.regions.PHPRegionTypes", "org.eclipse.php.internal.ui.preferences.PreferenceConstants", "org.eclipse.wst.sse.core.internal.provisional.text.IText...
import org.eclipse.jface.text.TextAttribute; import org.eclipse.php.internal.core.documentModel.parser.PHPRegionContext; import org.eclipse.php.internal.core.documentModel.parser.regions.PHPRegionTypes; import org.eclipse.php.internal.ui.preferences.PreferenceConstants; import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
import org.eclipse.jface.text.*; import org.eclipse.php.internal.core.*; import org.eclipse.php.internal.ui.preferences.*; import org.eclipse.wst.sse.core.internal.provisional.text.*;
[ "org.eclipse.jface", "org.eclipse.php", "org.eclipse.wst" ]
org.eclipse.jface; org.eclipse.php; org.eclipse.wst;
880,447
private int getTabStackIndex() { return getTabStackIndex(Tab.INVALID_TAB_ID); }
int function() { return getTabStackIndex(Tab.INVALID_TAB_ID); }
/** * Get the tab stack state. * @return The tab stack index for the given tab id. */
Get the tab stack state
getTabStackIndex
{ "repo_name": "mogoweb/365browser", "path": "app/src/main/java/org/chromium/chrome/browser/compositor/layouts/phone/StackLayout.java", "license": "apache-2.0", "size": 51520 }
[ "org.chromium.chrome.browser.tab.Tab" ]
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.*;
[ "org.chromium.chrome" ]
org.chromium.chrome;
641,394
public Connection getAnyConnection() throws SQLException { return getReadWriteConnectionFromServerGroup(this.globalGroup); }
Connection function() throws SQLException { return getReadWriteConnectionFromServerGroup(this.globalGroup); }
/** * Get a connection that be used to access data or metadata not specific to any shard/tenant. * The returned connection is a READ_WRITE connection to the global group of the shard mapping * for the database and table association with this connection provider. */
Get a connection that be used to access data or metadata not specific to any shard/tenant. The returned connection is a READ_WRITE connection to the global group of the shard mapping for the database and table association with this connection provider
getAnyConnection
{ "repo_name": "richardgutkowski/ansible-roles", "path": "stash/files/mysql-connector-java-5.1.35/src/com/mysql/fabric/hibernate/FabricMultiTenantConnectionProvider.java", "license": "mit", "size": 5710 }
[ "java.sql.Connection", "java.sql.SQLException" ]
import java.sql.Connection; import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,411,257
void closeWorkArea(FileWorkArea workArea);
void closeWorkArea(FileWorkArea workArea);
/** * Closes the passed in work area. This method will delete all items contained in the work area. Future calls * using this WorkArea will cause a RuntimeError * @param Work Area */
Closes the passed in work area. This method will delete all items contained in the work area. Future calls using this WorkArea will cause a RuntimeError
closeWorkArea
{ "repo_name": "cloudbearings/BroadleafCommerce", "path": "common/src/main/java/org/broadleafcommerce/common/file/service/BroadleafFileService.java", "license": "apache-2.0", "size": 7981 }
[ "org.broadleafcommerce.common.file.domain.FileWorkArea" ]
import org.broadleafcommerce.common.file.domain.FileWorkArea;
import org.broadleafcommerce.common.file.domain.*;
[ "org.broadleafcommerce.common" ]
org.broadleafcommerce.common;
746,389
public String next() { getPagination().nextPage(); recreateModel(); return "List"; }
String function() { getPagination().nextPage(); recreateModel(); return "List"; }
/** * function of the crud * @return next page list */
function of the crud
next
{ "repo_name": "EmanueleLM/BidWin", "path": "bidwin/src/java/main/managed/AuctionController.java", "license": "gpl-2.0", "size": 12413 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,056,776
void onAssemblyFinished(AssemblyResponse response);
void onAssemblyFinished(AssemblyResponse response);
/** * Callback to be executed when the Assembly execution is done executing. * This encompasses any kind of termination of the assembly. * Including when the assembly aborts due to failure. * * @param response {@link AssemblyResponse} response with the updated status of the assembly. */
Callback to be executed when the Assembly execution is done executing. This encompasses any kind of termination of the assembly. Including when the assembly aborts due to failure
onAssemblyFinished
{ "repo_name": "transloadit/java-sdk", "path": "src/main/java/com/transloadit/sdk/async/AssemblyProgressListener.java", "license": "mit", "size": 1509 }
[ "com.transloadit.sdk.response.AssemblyResponse" ]
import com.transloadit.sdk.response.AssemblyResponse;
import com.transloadit.sdk.response.*;
[ "com.transloadit.sdk" ]
com.transloadit.sdk;
2,842,383
public void cancelQueries() throws KettleDatabaseException;
void function() throws KettleDatabaseException;
/** * Call this to cancel trailing database queries (too long running, etc) */
Call this to cancel trailing database queries (too long running, etc)
cancelQueries
{ "repo_name": "apratkin/pentaho-kettle", "path": "engine/src/org/pentaho/di/trans/step/StepMetaInterface.java", "license": "apache-2.0", "size": 29826 }
[ "org.pentaho.di.core.exception.KettleDatabaseException" ]
import org.pentaho.di.core.exception.KettleDatabaseException;
import org.pentaho.di.core.exception.*;
[ "org.pentaho.di" ]
org.pentaho.di;
1,076,614
public final Exporter createExporter() { return new DocExporter(); }
final Exporter function() { return new DocExporter(); }
/** * Instantiates a org.hibernate.tool.hbm2x.DocExporter object. * * @return DocExporter */
Instantiates a org.hibernate.tool.hbm2x.DocExporter object
createExporter
{ "repo_name": "rpoznan/hibernate4maven", "path": "src/main/java/com/myjavadoc/hibernate4/exporter/Hbm2DocExporterMojo.java", "license": "apache-2.0", "size": 2135 }
[ "org.hibernate.tool.hbm2x.DocExporter", "org.hibernate.tool.hbm2x.Exporter" ]
import org.hibernate.tool.hbm2x.DocExporter; import org.hibernate.tool.hbm2x.Exporter;
import org.hibernate.tool.hbm2x.*;
[ "org.hibernate.tool" ]
org.hibernate.tool;
1,098,409
public final <C extends Collection<? super T>> Flux<C> bufferTimeout(int maxSize, Duration timespan, Scheduler timer, Supplier<C> bufferSupplier) { return onAssembly(new FluxBufferTimeout<>(this, maxSize, timespan.toMillis(), timer, bufferSupplier)); } /** * Collect incoming values into multiple {@link List} buffers that will be emitted by * the resulting {@link Flux} each time the given predicate returns true. Note that * the element that triggers the predicate to return true (and thus closes a buffer) * is included as last element in the emitted buffer. * <p> * <img class="marble" src="https://raw.githubusercontent.com/reactor/reactor-core/v3.1.3.RELEASE/src/docs/marble/buffersize.png" * alt=""> * <p> * On completion, if the latest buffer is non-empty and has not been closed it is * emitted. However, such a "partial" buffer isn't emitted in case of onError * termination. * * @param predicate a predicate that triggers the next buffer when it becomes true. * @return a microbatched {@link Flux} of {@link List}
final <C extends Collection<? super T>> Flux<C> function(int maxSize, Duration timespan, Scheduler timer, Supplier<C> bufferSupplier) { return onAssembly(new FluxBufferTimeout<>(this, maxSize, timespan.toMillis(), timer, bufferSupplier)); } /** * Collect incoming values into multiple {@link List} buffers that will be emitted by * the resulting {@link Flux} each time the given predicate returns true. Note that * the element that triggers the predicate to return true (and thus closes a buffer) * is included as last element in the emitted buffer. * <p> * <img class=STR src=STRSTRpartial" buffer isn't emitted in case of onError * termination. * * @param predicate a predicate that triggers the next buffer when it becomes true. * @return a microbatched {@link Flux} of {@link List}
/** * Collect incoming values into multiple user-defined {@link Collection} buffers that * will be emitted by the returned {@link Flux} each time the buffer reaches a maximum * size OR the timespan {@link Duration} elapses, as measured on the provided {@link Scheduler}. * <p> * <img class="marble" src="https://raw.githubusercontent.com/reactor/reactor-core/v3.1.3.RELEASE/src/docs/marble/buffertimespansize.png" * alt=""> * * @param maxSize the max collected size * @param timespan the timeout enforcing the release of a partial buffer * @param timer a time-capable {@link Scheduler} instance to run on * @param bufferSupplier a {@link Supplier} of the concrete {@link Collection} to use for each buffer * @param <C> the {@link Collection} buffer type * @return a microbatched {@link Flux} of {@link Collection} delimited by given size or a given period timeout */
Collect incoming values into multiple user-defined <code>Collection</code> buffers that will be emitted by the returned <code>Flux</code> each time the buffer reaches a maximum size OR the timespan <code>Duration</code> elapses, as measured on the provided <code>Scheduler</code>.
bufferTimeout
{ "repo_name": "sdeleuze/reactor-core", "path": "reactor-core/src/main/java/reactor/core/publisher/Flux.java", "license": "apache-2.0", "size": 363254 }
[ "java.time.Duration", "java.util.Collection", "java.util.List", "java.util.function.Supplier" ]
import java.time.Duration; import java.util.Collection; import java.util.List; import java.util.function.Supplier;
import java.time.*; import java.util.*; import java.util.function.*;
[ "java.time", "java.util" ]
java.time; java.util;
17,402
CoreExtension getEnvironmentExtension();
CoreExtension getEnvironmentExtension();
/** * Return the extension corresponding to the current environment if any. Generally used to get the current XWiki * distribution. * * @return the core extension associated to the environment */
Return the extension corresponding to the current environment if any. Generally used to get the current XWiki distribution
getEnvironmentExtension
{ "repo_name": "xwiki/xwiki-commons", "path": "xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/CoreExtensionRepository.java", "license": "lgpl-2.1", "size": 2751 }
[ "org.xwiki.extension.CoreExtension" ]
import org.xwiki.extension.CoreExtension;
import org.xwiki.extension.*;
[ "org.xwiki.extension" ]
org.xwiki.extension;
2,622,773
@Override public Object get(Object key) { try { return (getRegion().get(key)); } catch (IOException ex) { throw new RuntimeException("Exception while getting the object", ex); } }
Object function(Object key) { try { return (getRegion().get(key)); } catch (IOException ex) { throw new RuntimeException(STR, ex); } }
/** * Gets the value given the key. Note that it does NOT work with hash values * or list values * * @param key * @return The value. */
Gets the value given the key. Note that it does NOT work with hash values or list values
get
{ "repo_name": "siyuanh/apex-malhar", "path": "contrib/src/main/java/com/datatorrent/contrib/geode/GeodeStore.java", "license": "apache-2.0", "size": 7350 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
20,777
public Map<Rectangle, E> getElements();
Map<Rectangle, E> function();
/** * Returns all contiguous regions in the index. * * @return a {@code Map<Rectangle, E>} of elements */
Returns all contiguous regions in the index
getElements
{ "repo_name": "kosmonet/neon", "path": "src/neon/util/spatial/RegionSpatialIndex.java", "license": "gpl-3.0", "size": 2080 }
[ "java.awt.Rectangle", "java.util.Map" ]
import java.awt.Rectangle; import java.util.Map;
import java.awt.*; import java.util.*;
[ "java.awt", "java.util" ]
java.awt; java.util;
2,371,233
public static double sd(Collection<? extends Number> data, double mean) { double sum = 0.0; for (Number d : data) sum += Math.pow(d.doubleValue() - mean, 2); return Math.sqrt(sum / data.size()); }
static double function(Collection<? extends Number> data, double mean) { double sum = 0.0; for (Number d : data) sum += Math.pow(d.doubleValue() - mean, 2); return Math.sqrt(sum / data.size()); }
/** * calculate the standard deviation */
calculate the standard deviation
sd
{ "repo_name": "OlafLee/librec", "path": "librec/src/main/java/librec/util/Stats.java", "license": "gpl-3.0", "size": 6748 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,641,919
@Override protected void customizeDocumentCommand(DocumentCommand command) { if (pyAutoIndentStrategy == null) { pyAutoIndentStrategy = this.getEdit().getAutoEditStrategy(); } boolean blockSelection = false; try { blockSelection = this.getTextWidget().getBlockSelection(); } catch (Throwable e) { //that's OK (only available in eclipse 3.5) } pyAutoIndentStrategy.setBlockSelection(blockSelection); super.customizeDocumentCommand(command); }
void function(DocumentCommand command) { if (pyAutoIndentStrategy == null) { pyAutoIndentStrategy = this.getEdit().getAutoEditStrategy(); } boolean blockSelection = false; try { blockSelection = this.getTextWidget().getBlockSelection(); } catch (Throwable e) { } pyAutoIndentStrategy.setBlockSelection(blockSelection); super.customizeDocumentCommand(command); }
/** * Overridden because we want to do things differently in block selection mode. */
Overridden because we want to do things differently in block selection mode
customizeDocumentCommand
{ "repo_name": "bobwalker99/Pydev", "path": "plugins/org.python.pydev/src/org/python/pydev/editor/codefolding/PySourceViewer.java", "license": "epl-1.0", "size": 10221 }
[ "org.eclipse.jface.text.DocumentCommand" ]
import org.eclipse.jface.text.DocumentCommand;
import org.eclipse.jface.text.*;
[ "org.eclipse.jface" ]
org.eclipse.jface;
2,645,475
protected IUndoableOperation getPasteOperation(IStructureModifier modifier, ISelection selection, Event event) { return new ClipboardPasteOperation(selection, modifier); }
IUndoableOperation function(IStructureModifier modifier, ISelection selection, Event event) { return new ClipboardPasteOperation(selection, modifier); }
/** * Override if necessary * * @param modifier * @param selection * @return IUndoableOperation */
Override if necessary
getPasteOperation
{ "repo_name": "nasa/OpenSPIFe", "path": "gov.nasa.ensemble.common.ui/src/gov/nasa/ensemble/common/ui/editor/AbstractEnsembleEditorPart.java", "license": "apache-2.0", "size": 13514 }
[ "gov.nasa.ensemble.common.ui.IStructureModifier", "gov.nasa.ensemble.common.ui.operations.ClipboardPasteOperation", "org.eclipse.core.commands.operations.IUndoableOperation", "org.eclipse.jface.viewers.ISelection", "org.eclipse.swt.widgets.Event" ]
import gov.nasa.ensemble.common.ui.IStructureModifier; import gov.nasa.ensemble.common.ui.operations.ClipboardPasteOperation; import org.eclipse.core.commands.operations.IUndoableOperation; import org.eclipse.jface.viewers.ISelection; import org.eclipse.swt.widgets.Event;
import gov.nasa.ensemble.common.ui.*; import gov.nasa.ensemble.common.ui.operations.*; import org.eclipse.core.commands.operations.*; import org.eclipse.jface.viewers.*; import org.eclipse.swt.widgets.*;
[ "gov.nasa.ensemble", "org.eclipse.core", "org.eclipse.jface", "org.eclipse.swt" ]
gov.nasa.ensemble; org.eclipse.core; org.eclipse.jface; org.eclipse.swt;
1,567,875
public TaskStatus status() { return this.status; }
TaskStatus function() { return this.status; }
/** * Get the current status of task. Possible values include: 'Disabled', 'Enabled'. * * @return the status value */
Get the current status of task. Possible values include: 'Disabled', 'Enabled'
status
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/containerregistry/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/containerregistry/v2019_04_01/implementation/TaskInner.java", "license": "mit", "size": 7713 }
[ "com.microsoft.azure.management.containerregistry.v2019_04_01.TaskStatus" ]
import com.microsoft.azure.management.containerregistry.v2019_04_01.TaskStatus;
import com.microsoft.azure.management.containerregistry.v2019_04_01.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
639,461
private static void appendJSONPair(StringBuilder json, String key, String value) throws UnsupportedEncodingException { boolean isValueNumeric = false; try { if (value.equals("0") || !value.endsWith("0")) { Double.parseDouble(value); isValueNumeric = true; } } catch (NumberFormatException e) { isValueNumeric = false; } if (json.charAt(json.length() - 1) != '{') { json.append(','); } json.append(escapeJSON(key)); json.append(':'); if (isValueNumeric) { json.append(value); } else { json.append(escapeJSON(value)); } }
static void function(StringBuilder json, String key, String value) throws UnsupportedEncodingException { boolean isValueNumeric = false; try { if (value.equals("0") !value.endsWith("0")) { Double.parseDouble(value); isValueNumeric = true; } } catch (NumberFormatException e) { isValueNumeric = false; } if (json.charAt(json.length() - 1) != '{') { json.append(','); } json.append(escapeJSON(key)); json.append(':'); if (isValueNumeric) { json.append(value); } else { json.append(escapeJSON(value)); } }
/** * Appends a json encoded key/value pair to the given string builder. * * @param json * @param key * @param value * @throws UnsupportedEncodingException */
Appends a json encoded key/value pair to the given string builder
appendJSONPair
{ "repo_name": "BMatteusz/bEssentials", "path": "src/org/mcstats/Metrics.java", "license": "epl-1.0", "size": 24854 }
[ "java.io.UnsupportedEncodingException" ]
import java.io.UnsupportedEncodingException;
import java.io.*;
[ "java.io" ]
java.io;
876,398
Date getCreationDate();
Date getCreationDate();
/** * Get the creation date of the configuration. * * @return The creation date. */
Get the creation date of the configuration
getCreationDate
{ "repo_name": "kit-data-manager/base", "path": "MetaDataManagement/MDM-DataWorkflow/src/main/java/edu/kit/dama/mdm/dataworkflow/interfaces/IDefaultDataWorkflowConfiguration.java", "license": "apache-2.0", "size": 2640 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
1,832,645
@Test(expectedExceptions = { LDAPException.class }) public void testDecodeUnrecognizedBERType() throws Exception { final ASN1Sequence valueSequence = new ASN1Sequence( new ASN1OctetString("manager-id"), new ASN1OctetString("destination-id"), new ASN1Sequence( new ASN1OctetString("destination-details-1"), new ASN1OctetString("destination-details-2")), new ASN1Enumerated((byte) 0x8F, 0)); new SetNotificationDestinationExtendedRequest( new ExtendedRequest("1.3.6.1.4.1.30221.2.6.36", new ASN1OctetString(valueSequence.encode()))); }
@Test(expectedExceptions = { LDAPException.class }) void function() throws Exception { final ASN1Sequence valueSequence = new ASN1Sequence( new ASN1OctetString(STR), new ASN1OctetString(STR), new ASN1Sequence( new ASN1OctetString(STR), new ASN1OctetString(STR)), new ASN1Enumerated((byte) 0x8F, 0)); new SetNotificationDestinationExtendedRequest( new ExtendedRequest(STR, new ASN1OctetString(valueSequence.encode()))); }
/** * Tests the behavior when trying to decode an extended request whose value * sequence contains an element with an unrecognized BER type. * * @throws Exception If an unexpected problem occurs. */
Tests the behavior when trying to decode an extended request whose value sequence contains an element with an unrecognized BER type
testDecodeUnrecognizedBERType
{ "repo_name": "UnboundID/ldapsdk", "path": "tests/unit/src/com/unboundid/ldap/sdk/unboundidds/extensions/SetNotificationDestinationExtendedRequestTestCase.java", "license": "gpl-2.0", "size": 9967 }
[ "com.unboundid.asn1.ASN1Enumerated", "com.unboundid.asn1.ASN1OctetString", "com.unboundid.asn1.ASN1Sequence", "com.unboundid.ldap.sdk.ExtendedRequest", "com.unboundid.ldap.sdk.LDAPException", "org.testng.annotations.Test" ]
import com.unboundid.asn1.ASN1Enumerated; import com.unboundid.asn1.ASN1OctetString; import com.unboundid.asn1.ASN1Sequence; import com.unboundid.ldap.sdk.ExtendedRequest; import com.unboundid.ldap.sdk.LDAPException; import org.testng.annotations.Test;
import com.unboundid.asn1.*; import com.unboundid.ldap.sdk.*; import org.testng.annotations.*;
[ "com.unboundid.asn1", "com.unboundid.ldap", "org.testng.annotations" ]
com.unboundid.asn1; com.unboundid.ldap; org.testng.annotations;
413,870
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; }
void function(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; }
/** * This is a helper function from Tabula to set the rotation of model parts */
This is a helper function from Tabula to set the rotation of model parts
setRotateAngle
{ "repo_name": "Lomeli12/TurtleGun", "path": "src/main/java/net/lomeli/turtlegun/client/model/ModelGun.java", "license": "lgpl-3.0", "size": 7506 }
[ "net.minecraft.client.model.ModelRenderer" ]
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.model.*;
[ "net.minecraft.client" ]
net.minecraft.client;
412,073
public void setUseListener(String actionDisplayName, UseListener listener) { put("menu", actionDisplayName); this.useListener = listener; }
void function(String actionDisplayName, UseListener listener) { put("menu", actionDisplayName); this.useListener = listener; }
/** * adds a use listener causing the client to add an use action with the * specified name * * @param actionDisplayName * name of useaction visible in the client * @param listener * use event listener */
adds a use listener causing the client to add an use action with the specified name
setUseListener
{ "repo_name": "acsid/stendhal", "path": "src/games/stendhal/server/entity/player/Player.java", "license": "gpl-2.0", "size": 68122 }
[ "games.stendhal.server.core.events.UseListener" ]
import games.stendhal.server.core.events.UseListener;
import games.stendhal.server.core.events.*;
[ "games.stendhal.server" ]
games.stendhal.server;
776,146
public EntityList getDependencies(String type, String entityName) { try { Entity entityObj = EntityUtil.getEntity(type, entityName); return EntityUtil.getEntityDependencies(entityObj); } catch (Exception e) { LOG.error("Unable to get dependencies for entityName {} ({})", entityName, type, e); throw FalconWebException.newAPIException(e); } }
EntityList function(String type, String entityName) { try { Entity entityObj = EntityUtil.getEntity(type, entityName); return EntityUtil.getEntityDependencies(entityObj); } catch (Exception e) { LOG.error(STR, entityName, type, e); throw FalconWebException.newAPIException(e); } }
/** * Returns dependencies. * * @param type entity type * @param entityName entity name * @return EntityList */
Returns dependencies
getDependencies
{ "repo_name": "InMobi/falcon", "path": "prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java", "license": "apache-2.0", "size": 64241 }
[ "org.apache.falcon.FalconWebException", "org.apache.falcon.entity.EntityUtil", "org.apache.falcon.entity.v0.Entity" ]
import org.apache.falcon.FalconWebException; import org.apache.falcon.entity.EntityUtil; import org.apache.falcon.entity.v0.Entity;
import org.apache.falcon.*; import org.apache.falcon.entity.*; import org.apache.falcon.entity.v0.*;
[ "org.apache.falcon" ]
org.apache.falcon;
1,712,394
@JsonProperty public List<HttpHeaders> exampleHeaders() { return exampleHeaders; }
List<HttpHeaders> function() { return exampleHeaders; }
/** * Returns the example HTTP headers of the method. */
Returns the example HTTP headers of the method
exampleHeaders
{ "repo_name": "line/armeria", "path": "core/src/main/java/com/linecorp/armeria/server/docs/MethodInfo.java", "license": "apache-2.0", "size": 9244 }
[ "com.linecorp.armeria.common.HttpHeaders", "java.util.List" ]
import com.linecorp.armeria.common.HttpHeaders; import java.util.List;
import com.linecorp.armeria.common.*; import java.util.*;
[ "com.linecorp.armeria", "java.util" ]
com.linecorp.armeria; java.util;
303,222
// See also Lucene's ASCIIFoldingFilter (Lucene 2.9) that replaces accented characters by their unaccented equivalent (and uncommitted bug fix: https://issues.apache.org/jira/browse/LUCENE-1343?focusedCommentId=12858907&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_12858907). public static String stripAccents(String input) { if(input == null) { return null; } Pattern pattern = Pattern.compile("\\p{InCombiningDiacriticalMarks}+");//$NON-NLS-1$ String decomposed = Normalizer.normalize(input, Normalizer.Form.NFD); // Note that this doesn't correctly remove ligatures... return pattern.matcher(decomposed).replaceAll("");//$NON-NLS-1$ } // Equals //----------------------------------------------------------------------- /** * <p>Compares two CharSequences, returning {@code true} if they represent * equal sequences of characters.</p> * * <p>{@code null}s are handled without exceptions. Two {@code null} * references are considered to be equal. The comparison is case sensitive.</p> * * <pre> * StringUtils.equals(null, null) = true * StringUtils.equals(null, "abc") = false * StringUtils.equals("abc", null) = false * StringUtils.equals("abc", "abc") = true * StringUtils.equals("abc", "ABC") = false * </pre> * * @see Object#equals(Object) * @param cs1 the first CharSequence, may be {@code null} * @param cs2 the second CharSequence, may be {@code null} * @return {@code true} if the CharSequences are equal (case-sensitive), or both {@code null}
static String function(String input) { if(input == null) { return null; } Pattern pattern = Pattern.compile(STR); String decomposed = Normalizer.normalize(input, Normalizer.Form.NFD); return pattern.matcher(decomposed).replaceAll(STRabcSTRabcSTRabcSTRabcSTRabcSTRABC") = false * </pre> * * @see Object#equals(Object) * @param cs1 the first CharSequence, may be {@code null} * @param cs2 the second CharSequence, may be {@code null} * @return {@code true} if the CharSequences are equal (case-sensitive), or both {@code null}
/** * <p>Removes diacritics (~= accents) from a string. The case will not be altered.</p> * <p>For instance, '&agrave;' will be replaced by 'a'.</p> * <p>Note that ligatures will be left as is.</p> * * <pre> * StringUtils.stripAccents(null) = null * StringUtils.stripAccents("") = "" * StringUtils.stripAccents("control") = "control" * StringUtils.stripAccents("&eacute;clair") = "eclair" * </pre> * * @param input String to be stripped * @return input text with diacritics removed * * @since 3.0 */
Removes diacritics (~= accents) from a string. The case will not be altered. For instance, '&agrave;' will be replaced by 'a'. Note that ligatures will be left as is. <code> StringUtils.stripAccents(null) = null StringUtils.stripAccents("") = "" StringUtils.stripAccents("control") = "control" StringUtils.stripAccents("&eacute;clair") = "eclair" </code>
stripAccents
{ "repo_name": "martingwhite/astor", "path": "examples/lang_7/src/main/java/org/apache/commons/lang3/StringUtils.java", "license": "gpl-2.0", "size": 283344 }
[ "java.text.Normalizer", "java.util.regex.Pattern" ]
import java.text.Normalizer; import java.util.regex.Pattern;
import java.text.*; import java.util.regex.*;
[ "java.text", "java.util" ]
java.text; java.util;
1,333,359
void setOriginalFile(File file) { metadataLoaded = true; try { BufferedReader input = new BufferedReader(new FileReader(file)); Map<String, List<String>> components = new LinkedHashMap<String, List<String>>(); try { String line = null; List<String> l; String key = null; int start = 0; while ((line = input.readLine()) != null) { if (line.contains("=")) { if (key != null && key.trim().length() > 0) { l = components.get(key); if (l != null) l.add(line); } } else { line = line.trim(); if (line.length() > 0) { start = getStart(line); key = line.substring(start, line.length()-1); if (key != null && key.trim().length() > 0) components.put(key, new ArrayList<String>()); } } } buildGUI(components); } finally { input.close(); } } catch (IOException e) { file.delete(); JLabel l = new JLabel("Loading metadata"); l.setBackground(UIUtilities.BACKGROUND_COLOR); statusBar = UIUtilities.buildComponentPanel(l); removeAll(); add(statusBar, BorderLayout.NORTH); Logger logger = MetadataViewerAgent.getRegistry().getLogger(); LogMessage msg = new LogMessage(); msg.print("An error occurred while reading metadata file."); msg.print(e); logger.error(this, msg); } }
void setOriginalFile(File file) { metadataLoaded = true; try { BufferedReader input = new BufferedReader(new FileReader(file)); Map<String, List<String>> components = new LinkedHashMap<String, List<String>>(); try { String line = null; List<String> l; String key = null; int start = 0; while ((line = input.readLine()) != null) { if (line.contains("=")) { if (key != null && key.trim().length() > 0) { l = components.get(key); if (l != null) l.add(line); } } else { line = line.trim(); if (line.length() > 0) { start = getStart(line); key = line.substring(start, line.length()-1); if (key != null && key.trim().length() > 0) components.put(key, new ArrayList<String>()); } } } buildGUI(components); } finally { input.close(); } } catch (IOException e) { file.delete(); JLabel l = new JLabel(STR); l.setBackground(UIUtilities.BACKGROUND_COLOR); statusBar = UIUtilities.buildComponentPanel(l); removeAll(); add(statusBar, BorderLayout.NORTH); Logger logger = MetadataViewerAgent.getRegistry().getLogger(); LogMessage msg = new LogMessage(); msg.print(STR); msg.print(e); logger.error(this, msg); } }
/** * Reads the file and displays the result in a table. * * @param file The file to read. */
Reads the file and displays the result in a table
setOriginalFile
{ "repo_name": "joshmoore/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/OriginalMetadataComponent.java", "license": "gpl-2.0", "size": 13271 }
[ "java.awt.BorderLayout", "java.io.BufferedReader", "java.io.File", "java.io.FileReader", "java.io.IOException", "java.util.ArrayList", "java.util.LinkedHashMap", "java.util.List", "java.util.Map", "javax.swing.JLabel", "org.openmicroscopy.shoola.agents.metadata.MetadataViewerAgent", "org.openm...
import java.awt.BorderLayout; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import javax.swing.JLabel; import org.openmicroscopy.shoola.agents.metadata.MetadataViewerAgent; import org.openmicroscopy.shoola.env.log.LogMessage; import org.openmicroscopy.shoola.env.log.Logger; import org.openmicroscopy.shoola.util.ui.UIUtilities;
import java.awt.*; import java.io.*; import java.util.*; import javax.swing.*; import org.openmicroscopy.shoola.agents.metadata.*; import org.openmicroscopy.shoola.env.log.*; import org.openmicroscopy.shoola.util.ui.*;
[ "java.awt", "java.io", "java.util", "javax.swing", "org.openmicroscopy.shoola" ]
java.awt; java.io; java.util; javax.swing; org.openmicroscopy.shoola;
2,230,543
private String fixFileName(String name) { if(normalizeNames) { name = StringUtil.replaceAll(name, "/", "_"); name = StringUtil.replaceAll(name, "\\", "_"); name = StringUtil.replaceAll(name, "%", "_"); name = StringUtil.replaceAll(name, "?", "_"); name = StringUtil.replaceAll(name, "*", "_"); name = StringUtil.replaceAll(name, ":", "_"); name = StringUtil.replaceAll(name, "=", "_"); } return name; }
String function(String name) { if(normalizeNames) { name = StringUtil.replaceAll(name, "/", "_"); name = StringUtil.replaceAll(name, "\\", "_"); name = StringUtil.replaceAll(name, "%", "_"); name = StringUtil.replaceAll(name, "?", "_"); name = StringUtil.replaceAll(name, "*", "_"); name = StringUtil.replaceAll(name, ":", "_"); name = StringUtil.replaceAll(name, "=", "_"); } return name; }
/** * If a file name contains slashes replace them with underscores, same goes for *, %, ? etc. * @param name the file name * @return the fixed filename */
If a file name contains slashes replace them with underscores, same goes for *, %, ? etc
fixFileName
{ "repo_name": "sdwolf/CodenameOne", "path": "CodenameOne/src/com/codename1/io/Storage.java", "license": "gpl-2.0", "size": 8303 }
[ "com.codename1.util.StringUtil" ]
import com.codename1.util.StringUtil;
import com.codename1.util.*;
[ "com.codename1.util" ]
com.codename1.util;
2,867,041
int m = aMatrix.getNumberOfRows(); int n = aMatrix.getNumberOfColumns(); double[] data = aMatrix.getData(); if (m == 1 && n == 1) { // quick return return new SingularValueDecompositionFullUSV(new double[] {1 }, aMatrix.getData(), new double[] {1 }); } if (m == 1) { // short cut, we have a row vector // u is 1 by definition // s is the 2 norm of the vector // v is computed by householder return svdVector(data); } if (n == 1) { // short cut, we have a column vector // u is computed by householder // s is the 2 norm of the vector // v is 1 by definition // so we need to swap/mangle u&v SingularValueDecompositionFullUSV tmp = svdVector(data); return new SingularValueDecompositionFullUSV(tmp.getMatrixV(), tmp.getMatrixS(), tmp.getMatrixV()); } // Main SVD code. Decide if we need to transpose A and make a memcpy that we can destroy double[] matrixAnew; double[] matrixU = new double[m * m]; double[] matrixVT = new double[n * n]; boolean transposed = false; if (m < n) { matrixAnew = new double[data.length]; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { matrixAnew[i * n + j] = data[j * m + i]; } } transposed = true; int tmp = m; m = n; n = tmp; } else { matrixAnew = new double[data.length]; System.arraycopy(data, 0, matrixAnew, 0, data.length); transposed = false; } double[] d = new double[n]; double[] dp1 = new double[n - 1]; if (m >= 5 * n / 3) { // we have a system that is ripe for QR first // TODO: implement QR variant, we have 1/2 of it below in fn reduceColSpace() DGEBRD.fullGolubReinsch(matrixAnew, m, n, matrixU, d, dp1, matrixVT); } else { // hit standard bi-diag DGEBRD.fullGolubReinsch(matrixAnew, m, n, matrixU, d, dp1, matrixVT); } // TODO: Sort and swap and stick in struct for return if (transposed) { return null; } else { return null; } }
int m = aMatrix.getNumberOfRows(); int n = aMatrix.getNumberOfColumns(); double[] data = aMatrix.getData(); if (m == 1 && n == 1) { return new SingularValueDecompositionFullUSV(new double[] {1 }, aMatrix.getData(), new double[] {1 }); } if (m == 1) { return svdVector(data); } if (n == 1) { SingularValueDecompositionFullUSV tmp = svdVector(data); return new SingularValueDecompositionFullUSV(tmp.getMatrixV(), tmp.getMatrixS(), tmp.getMatrixV()); } double[] matrixAnew; double[] matrixU = new double[m * m]; double[] matrixVT = new double[n * n]; boolean transposed = false; if (m < n) { matrixAnew = new double[data.length]; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { matrixAnew[i * n + j] = data[j * m + i]; } } transposed = true; int tmp = m; m = n; n = tmp; } else { matrixAnew = new double[data.length]; System.arraycopy(data, 0, matrixAnew, 0, data.length); transposed = false; } double[] d = new double[n]; double[] dp1 = new double[n - 1]; if (m >= 5 * n / 3) { DGEBRD.fullGolubReinsch(matrixAnew, m, n, matrixU, d, dp1, matrixVT); } else { DGEBRD.fullGolubReinsch(matrixAnew, m, n, matrixU, d, dp1, matrixVT); } if (transposed) { return null; } else { return null; } }
/** * Alg ideas * @param aMatrix a matrix * @return U,S,V */
Alg ideas
full
{ "repo_name": "charles-cooper/idylfin", "path": "src/com/opengamma/maths/lowlevelapi/linearalgebra/lapack/general/routines/DGESVD.java", "license": "apache-2.0", "size": 7282 }
[ "com.opengamma.maths.lowlevelapi.linearalgebra.lapack.general.types.SingularValueDecomposition" ]
import com.opengamma.maths.lowlevelapi.linearalgebra.lapack.general.types.SingularValueDecomposition;
import com.opengamma.maths.lowlevelapi.linearalgebra.lapack.general.types.*;
[ "com.opengamma.maths" ]
com.opengamma.maths;
1,633,981
public static void deleteCrcFilesFromLocalFileSystem(FileSystem fs, Path path) throws IOException { if (fs instanceof LocalFileSystem) { Path fnameCrc = new Path(path.getParent(), "." + path.getName() + ".crc"); fs.delete(fnameCrc, false); Path fnameMtdCrc = new Path(path.getParent(), "." + path.getName() + ".mtd.crc"); fs.delete(fnameMtdCrc, false); } }
static void function(FileSystem fs, Path path) throws IOException { if (fs instanceof LocalFileSystem) { Path fnameCrc = new Path(path.getParent(), "." + path.getName() + ".crc"); fs.delete(fnameCrc, false); Path fnameMtdCrc = new Path(path.getParent(), "." + path.getName() + STR); fs.delete(fnameMtdCrc, false); } }
/** * Delete the CRC files from the local file system associated with a * particular file and its metadata file. * * @param fs * the file system * @param path * the path to a file * @throws IOException * thrown if error occurred attempting to delete crc files */
Delete the CRC files from the local file system associated with a particular file and its metadata file
deleteCrcFilesFromLocalFileSystem
{ "repo_name": "akchinSTC/systemml", "path": "src/main/java/org/apache/sysml/runtime/io/IOUtilFunctions.java", "license": "apache-2.0", "size": 14522 }
[ "java.io.IOException", "org.apache.hadoop.fs.FileSystem", "org.apache.hadoop.fs.LocalFileSystem", "org.apache.hadoop.fs.Path" ]
import java.io.IOException; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path;
import java.io.*; import org.apache.hadoop.fs.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
2,555,382
public Color getMonthStringForeground() { return monthStringForeground; }
Color function() { return monthStringForeground; }
/** * Returns the color used to paint the month string foreground. * * @return Color Color. */
Returns the color used to paint the month string foreground
getMonthStringForeground
{ "repo_name": "syncer/swingx", "path": "swingx-core/src/main/java/org/jdesktop/swingx/JXMonthView.java", "license": "lgpl-2.1", "size": 62756 }
[ "java.awt.Color" ]
import java.awt.Color;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,664,224
EReference getEvent_InteractionFlowExpression();
EReference getEvent_InteractionFlowExpression();
/** * Returns the meta object for the containment reference '{@link IFML.Core.Event#getInteractionFlowExpression <em>Interaction Flow Expression</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference '<em>Interaction Flow Expression</em>'. * @see IFML.Core.Event#getInteractionFlowExpression() * @see #getEvent() * @generated */
Returns the meta object for the containment reference '<code>IFML.Core.Event#getInteractionFlowExpression Interaction Flow Expression</code>'.
getEvent_InteractionFlowExpression
{ "repo_name": "ifml/ifml-editor", "path": "plugins/IFMLEditor/src/IFML/Core/CorePackage.java", "license": "mit", "size": 245317 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,546,763
@JsonValue public byte[] toBytes() { ByteBuffer buf = ByteBuffer.allocate(getMinStorageSize()); toBytes(buf); return buf.array(); }
byte[] function() { ByteBuffer buf = ByteBuffer.allocate(getMinStorageSize()); toBytes(buf); return buf.array(); }
/** * Returns a byte-array representation of this ApproximateHistogram object * * @return byte array representation */
Returns a byte-array representation of this ApproximateHistogram object
toBytes
{ "repo_name": "nishantmonu51/druid", "path": "extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java", "license": "apache-2.0", "size": 50558 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
623,115
public static float mapToRange(float t, float fromMin, float fromMax, float toMin, float toMax, Interpolator interpolator) { if (fromMin == fromMax || toMin == toMax) { Log.e(TAG, "mapToRange: range has 0 length"); return toMin; } float progress = getProgress(t, fromMin, fromMax); return mapRange(interpolator.getInterpolation(progress), toMin, toMax); }
static float function(float t, float fromMin, float fromMax, float toMin, float toMax, Interpolator interpolator) { if (fromMin == fromMax toMin == toMax) { Log.e(TAG, STR); return toMin; } float progress = getProgress(t, fromMin, fromMax); return mapRange(interpolator.getInterpolation(progress), toMin, toMax); }
/** * Maps t from one range to another range. * @param t The value to map. * @param fromMin The lower bound of the range that t is being mapped from. * @param fromMax The upper bound of the range that t is being mapped from. * @param toMin The lower bound of the range that t is being mapped to. * @param toMax The upper bound of the range that t is being mapped to. * @return The mapped value of t. */
Maps t from one range to another range
mapToRange
{ "repo_name": "Deletescape-Media/Lawnchair", "path": "src/com/android/launcher3/Utilities.java", "license": "gpl-3.0", "size": 28193 }
[ "android.util.Log", "android.view.animation.Interpolator" ]
import android.util.Log; import android.view.animation.Interpolator;
import android.util.*; import android.view.animation.*;
[ "android.util", "android.view" ]
android.util; android.view;
2,614,717
public static BufferedImage loadCompatibleImage(InputStream in) throws IOException { BufferedImage image = ImageIO.read(in); if(image == null) return null; return toCompatibleImage(image); }
static BufferedImage function(InputStream in) throws IOException { BufferedImage image = ImageIO.read(in); if(image == null) return null; return toCompatibleImage(image); }
/** * <p> * Returns a new compatible image from a stream. The image is loaded from * the specified stream and then turned, if necessary into a compatible * image. * </p> * * @see #createCompatibleImage(java.awt.image.BufferedImage) * @see #createCompatibleImage(java.awt.image.BufferedImage, int, int) * @see #createCompatibleImage(int, int) * @see #createCompatibleTranslucentImage(int, int) * @see #toCompatibleImage(java.awt.image.BufferedImage) * @param in * the stream of the picture to load as a compatible image * @return a new translucent compatible <code>BufferedImage</code> of the * specified width and height * @throws java.io.IOException * if the image cannot be read or loaded */
Returns a new compatible image from a stream. The image is loaded from the specified stream and then turned, if necessary into a compatible image.
loadCompatibleImage
{ "repo_name": "syncer/swingx", "path": "swingx-common/src/main/java/org/jdesktop/swingx/util/GraphicsUtilities.java", "license": "lgpl-2.1", "size": 35070 }
[ "java.awt.image.BufferedImage", "java.io.IOException", "java.io.InputStream", "javax.imageio.ImageIO" ]
import java.awt.image.BufferedImage; import java.io.IOException; import java.io.InputStream; import javax.imageio.ImageIO;
import java.awt.image.*; import java.io.*; import javax.imageio.*;
[ "java.awt", "java.io", "javax.imageio" ]
java.awt; java.io; javax.imageio;
917,330
EReference getResponseBusinessObject_XmlContentFields();
EReference getResponseBusinessObject_XmlContentFields();
/** * Returns the meta object for the containment reference list '{@link fr.eyal.lib.datalib.genmodel.android.datalib.model.ResponseBusinessObject#getXmlContentFields <em>Xml Content Fields</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference list '<em>Xml Content Fields</em>'. * @see fr.eyal.lib.datalib.genmodel.android.datalib.model.ResponseBusinessObject#getXmlContentFields() * @see #getResponseBusinessObject() * @generated */
Returns the meta object for the containment reference list '<code>fr.eyal.lib.datalib.genmodel.android.datalib.model.ResponseBusinessObject#getXmlContentFields Xml Content Fields</code>'.
getResponseBusinessObject_XmlContentFields
{ "repo_name": "eyal-lezmy/Android-DataLib", "path": "Android-DataLib-Generator/fr.eyal.datalib.generator/src/fr/eyal/lib/datalib/genmodel/android/datalib/model/ModelPackage.java", "license": "apache-2.0", "size": 53826 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,165,469
private Color getColor (boolean primary) { String add = primary ? "" : "_1"; // is either BD or Int Integer Red = (Integer)m_mTab.getValue("Red" + add); Integer Green = (Integer)m_mTab.getValue("Green" + add); Integer Blue = (Integer)m_mTab.getValue("Blue" + add); // int red = Red == null ? 0 : Red.intValue(); int green = Green == null ? 0 : Green.intValue(); int blue = Blue == null ? 0 : Blue.intValue(); // return new Color (red, green, blue); } // getColor
Color function (boolean primary) { String add = primary ? STR_1STRRedSTRGreenSTRBlue" + add); int red = Red == null ? 0 : Red.intValue(); int green = Green == null ? 0 : Green.intValue(); int blue = Blue == null ? 0 : Blue.intValue(); return new Color (red, green, blue); }
/** * Get Color from Tab * @param primary true if primary false if secondary * @return Color */
Get Color from Tab
getColor
{ "repo_name": "arthurmelo88/palmetalADP", "path": "adempiere_360/client/src/org/compiere/grid/ed/VColor.java", "license": "gpl-2.0", "size": 9985 }
[ "java.awt.Color" ]
import java.awt.Color;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,456,149
void resetElementAttributes( K name, IElementAttributes attributes ) throws CacheException;
void resetElementAttributes( K name, IElementAttributes attributes ) throws CacheException;
/** * Reset the attributes on the object matching this key name. * <p> * @param name * @param attributes * @throws CacheException */
Reset the attributes on the object matching this key name.
resetElementAttributes
{ "repo_name": "mohanaraosv/commons-jcs", "path": "commons-jcs-core/src/main/java/org/apache/commons/jcs/access/behavior/ICacheAccess.java", "license": "apache-2.0", "size": 5492 }
[ "org.apache.commons.jcs.access.exception.CacheException", "org.apache.commons.jcs.engine.behavior.IElementAttributes" ]
import org.apache.commons.jcs.access.exception.CacheException; import org.apache.commons.jcs.engine.behavior.IElementAttributes;
import org.apache.commons.jcs.access.exception.*; import org.apache.commons.jcs.engine.behavior.*;
[ "org.apache.commons" ]
org.apache.commons;
1,521,350
protected BeanWrapper instantiateUsingFactoryMethod( String beanName, RootBeanDefinition mbd, Object[] explicitArgs) { return new ConstructorResolver(this).instantiateUsingFactoryMethod(beanName, mbd, explicitArgs); }
BeanWrapper function( String beanName, RootBeanDefinition mbd, Object[] explicitArgs) { return new ConstructorResolver(this).instantiateUsingFactoryMethod(beanName, mbd, explicitArgs); }
/** * Instantiate the bean using a named factory method. The method may be static, if the * mbd parameter specifies a class, rather than a factoryBean, or an instance variable * on a factory object itself configured using Dependency Injection. * @param beanName the name of the bean * @param mbd the bean definition for the bean * @param explicitArgs argument values passed in programmatically via the getBean method, * or {@code null} if none (-> use constructor argument values from bean definition) * @return BeanWrapper for the new instance * @see #getBean(String, Object[]) */
Instantiate the bean using a named factory method. The method may be static, if the mbd parameter specifies a class, rather than a factoryBean, or an instance variable on a factory object itself configured using Dependency Injection
instantiateUsingFactoryMethod
{ "repo_name": "kingtang/spring-learn", "path": "spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java", "license": "gpl-3.0", "size": 70458 }
[ "org.springframework.beans.BeanWrapper" ]
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.*;
[ "org.springframework.beans" ]
org.springframework.beans;
679,931
private void runIPAScalarVariablePropagationTest(String testname, boolean IPA_SECOND_CHANCE) { // Save old settings int oldIPANumRep = OptimizerUtils.IPA_NUM_REPETITIONS; boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; ExecMode platformOld = rtplatform; try { // Setup test TestConfiguration config = getTestConfiguration(testname); loadTestConfiguration(config); String HOME = SCRIPT_DIR + TEST_DIR; fullDMLScriptName = HOME + testname + ".dml"; programArgs = new String[]{"-stats"}; OptimizerUtils.IPA_NUM_REPETITIONS = IPA_SECOND_CHANCE ? 2 : 1; DMLScript.USE_LOCAL_SPARK_CONFIG = true; rtplatform = ExecMode.HYBRID; // Run test runTest(true, false, null, -1); // Check for correct number of compiled & executed Spark jobs // (MB: originally, this required a second chance, but not anymore) checkNumCompiledSparkInst(0); checkNumExecutedSparkInst(0); } finally { // Reset OptimizerUtils.IPA_NUM_REPETITIONS = oldIPANumRep; DMLScript.USE_LOCAL_SPARK_CONFIG = sparkConfigOld; rtplatform = platformOld; } }
void function(String testname, boolean IPA_SECOND_CHANCE) { int oldIPANumRep = OptimizerUtils.IPA_NUM_REPETITIONS; boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; ExecMode platformOld = rtplatform; try { TestConfiguration config = getTestConfiguration(testname); loadTestConfiguration(config); String HOME = SCRIPT_DIR + TEST_DIR; fullDMLScriptName = HOME + testname + ".dml"; programArgs = new String[]{STR}; OptimizerUtils.IPA_NUM_REPETITIONS = IPA_SECOND_CHANCE ? 2 : 1; DMLScript.USE_LOCAL_SPARK_CONFIG = true; rtplatform = ExecMode.HYBRID; runTest(true, false, null, -1); checkNumCompiledSparkInst(0); checkNumExecutedSparkInst(0); } finally { OptimizerUtils.IPA_NUM_REPETITIONS = oldIPANumRep; DMLScript.USE_LOCAL_SPARK_CONFIG = sparkConfigOld; rtplatform = platformOld; } }
/** * Test for static rewrites + IPA second chance compilation to allow * for scalar propagation (IPA) of constant-folded DAG of literals * (static rewrites) made possible by an initial scalar propagation * (IPA). * * @param testname The name of the test. * @param IPA_SECOND_CHANCE Whether or not to use IPA second chance. */
Test for static rewrites + IPA second chance compilation to allow for scalar propagation (IPA) of constant-folded DAG of literals (static rewrites) made possible by an initial scalar propagation (IPA)
runIPAScalarVariablePropagationTest
{ "repo_name": "apache/incubator-systemml", "path": "src/test/java/org/apache/sysds/test/functions/misc/IPAConstantFoldingScalarVariablePropagationTest.java", "license": "apache-2.0", "size": 5077 }
[ "org.apache.sysds.api.DMLScript", "org.apache.sysds.common.Types", "org.apache.sysds.hops.OptimizerUtils", "org.apache.sysds.test.TestConfiguration" ]
import org.apache.sysds.api.DMLScript; import org.apache.sysds.common.Types; import org.apache.sysds.hops.OptimizerUtils; import org.apache.sysds.test.TestConfiguration;
import org.apache.sysds.api.*; import org.apache.sysds.common.*; import org.apache.sysds.hops.*; import org.apache.sysds.test.*;
[ "org.apache.sysds" ]
org.apache.sysds;
1,129,114
@Test public void setterFileReadTest() { try { List<?> setters = xmlSetterConfig.configurationsAt("setter"); for (Iterator<?> it = setters.iterator(); it.hasNext();) { HierarchicalConfiguration sub = (HierarchicalConfiguration) it.next(); // sub contains now all data about a single field String className = sub.getString("[@class]"); System.out.println(className); List<String> fieldNames = configUtil.toStringList(sub.getList("field.field-name")); assertNotNull(fieldNames); assertFalse(fieldNames.isEmpty()); for (String fieldName : fieldNames) { System.out.println(fieldName); assertNotNull(fieldName); } } } catch (Exception e) { e.printStackTrace(); fail(); } }
void function() { try { List<?> setters = xmlSetterConfig.configurationsAt(STR); for (Iterator<?> it = setters.iterator(); it.hasNext();) { HierarchicalConfiguration sub = (HierarchicalConfiguration) it.next(); String className = sub.getString(STR); System.out.println(className); List<String> fieldNames = configUtil.toStringList(sub.getList(STR)); assertNotNull(fieldNames); assertFalse(fieldNames.isEmpty()); for (String fieldName : fieldNames) { System.out.println(fieldName); assertNotNull(fieldName); } } } catch (Exception e) { e.printStackTrace(); fail(); } }
/** * Test for getting setter method config from the Configuration. * */
Test for getting setter method config from the Configuration
setterFileReadTest
{ "repo_name": "davidwong/TestDataCaptureJ", "path": "test/au/com/dw/testdatacapturej/config/ConfigurationFileTest.java", "license": "agpl-3.0", "size": 6109 }
[ "java.util.Iterator", "java.util.List", "org.apache.commons.configuration.HierarchicalConfiguration", "org.junit.Assert" ]
import java.util.Iterator; import java.util.List; import org.apache.commons.configuration.HierarchicalConfiguration; import org.junit.Assert;
import java.util.*; import org.apache.commons.configuration.*; import org.junit.*;
[ "java.util", "org.apache.commons", "org.junit" ]
java.util; org.apache.commons; org.junit;
1,308,854
public void setTextAppearanceResource(@StyleRes int id) { this.setTextAppearance(getContext(), id); }
void function(@StyleRes int id) { this.setTextAppearance(getContext(), id); }
/** * Sets this chip's text appearance using a resource id. * * @param id The resource id of this chip's text appearance. * @attr ref com.google.android.material.R.styleable#Chip_android_textAppearance */
Sets this chip's text appearance using a resource id
setTextAppearanceResource
{ "repo_name": "material-components/material-components-android", "path": "lib/java/com/google/android/material/chip/Chip.java", "license": "apache-2.0", "size": 75539 }
[ "androidx.annotation.StyleRes" ]
import androidx.annotation.StyleRes;
import androidx.annotation.*;
[ "androidx.annotation" ]
androidx.annotation;
1,734,830
protected Element createContent(WebSession s) { ElementContainer ec = new ElementContainer(); StringBuffer person = null; try { ec.addElement(new StringElement("Enter your name: ")); person = new StringBuffer(s.getParser().getStringParameter(PERSON, "")); person.reverse(); Input input = new Input(Input.TEXT, PERSON, person.toString()); ec.addElement(input); Element b = ECSFactory.makeButton("Go!"); ec.addElement(b); } catch (Exception e) { s.setMessage("Error generating " + this.getClass().getName()); e.printStackTrace(); } if (!person.toString().equals("") && getLessonTracker(s).getNumVisits() > 3) { makeSuccess(s); } return (ec); }
Element function(WebSession s) { ElementContainer ec = new ElementContainer(); StringBuffer person = null; try { ec.addElement(new StringElement(STR)); person = new StringBuffer(s.getParser().getStringParameter(PERSON, STRGo!STRError generating STR") && getLessonTracker(s).getNumVisits() > 3) { makeSuccess(s); } return (ec); }
/** * Description of the Method * * @param s * Description of the Parameter * @return Description of the Return Value */
Description of the Method
createContent
{ "repo_name": "paulnguyen/cmpe279", "path": "eclipse/Webgoat/src/org/owasp/webgoat/lessons/HttpBasics.java", "license": "apache-2.0", "size": 3672 }
[ "org.apache.ecs.Element", "org.apache.ecs.ElementContainer", "org.apache.ecs.StringElement", "org.owasp.webgoat.session.WebSession" ]
import org.apache.ecs.Element; import org.apache.ecs.ElementContainer; import org.apache.ecs.StringElement; import org.owasp.webgoat.session.WebSession;
import org.apache.ecs.*; import org.owasp.webgoat.session.*;
[ "org.apache.ecs", "org.owasp.webgoat" ]
org.apache.ecs; org.owasp.webgoat;
2,199,820
public void loadMilestones() { // Update main pane: this.mainContent.getChildren().remove(1, this.mainContent.getChildren().size()); this.topBox.getChildren().clear(); this.title.setText("Milestones"); // Columns: TableColumn<Milestone, String> nameColumn = new TableColumn<>("Milestone"); nameColumn.setCellValueFactory(new PropertyValueFactory<>("name")); TableColumn<Milestone, String> deadlineColumn = new TableColumn<>("Deadline"); deadlineColumn.setCellValueFactory(new PropertyValueFactory<>("deadline")); deadlineColumn.setStyle("-fx-alignment: CENTER-RIGHT;"); TableColumn<Milestone, String> completedColumn = new TableColumn<>("Tasks completed"); completedColumn.setCellValueFactory(new PropertyValueFactory<>("taskCompletedAsString")); completedColumn.setStyle("-fx-alignment: CENTER-RIGHT;"); TableColumn<Milestone, Integer> progressColumn = new TableColumn<>("Progress"); progressColumn.setCellValueFactory(new PropertyValueFactory<>("progressPercentage")); progressColumn.setStyle("-fx-alignment: CENTER-RIGHT;"); ArrayList<TableColumn<Milestone, ?>> colList = new ArrayList<>(Arrays.asList( nameColumn, deadlineColumn, completedColumn, progressColumn)); ObservableList<Milestone> list = FXCollections.observableArrayList( MainController.getSpc().getPlanner().getCurrentStudyProfile().getMilestones()); // Create a table: TableView<Milestone> table = new TableView<>(); table.setItems(list); table.getColumns().addAll(colList); table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); GridPane.setHgrow(table, Priority.ALWAYS); GridPane.setVgrow(table, Priority.ALWAYS); // =================
void function() { this.mainContent.getChildren().remove(1, this.mainContent.getChildren().size()); this.topBox.getChildren().clear(); this.title.setText(STR); TableColumn<Milestone, String> nameColumn = new TableColumn<>(STR); nameColumn.setCellValueFactory(new PropertyValueFactory<>("name")); TableColumn<Milestone, String> deadlineColumn = new TableColumn<>(STR); deadlineColumn.setCellValueFactory(new PropertyValueFactory<>(STR)); deadlineColumn.setStyle(STR); TableColumn<Milestone, String> completedColumn = new TableColumn<>(STR); completedColumn.setCellValueFactory(new PropertyValueFactory<>(STR)); completedColumn.setStyle(STR); TableColumn<Milestone, Integer> progressColumn = new TableColumn<>(STR); progressColumn.setCellValueFactory(new PropertyValueFactory<>(STR)); progressColumn.setStyle(STR); ArrayList<TableColumn<Milestone, ?>> colList = new ArrayList<>(Arrays.asList( nameColumn, deadlineColumn, completedColumn, progressColumn)); ObservableList<Milestone> list = FXCollections.observableArrayList( MainController.getSpc().getPlanner().getCurrentStudyProfile().getMilestones()); TableView<Milestone> table = new TableView<>(); table.setItems(list); table.getColumns().addAll(colList); table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); GridPane.setHgrow(table, Priority.ALWAYS); GridPane.setVgrow(table, Priority.ALWAYS);
/** * Display the Milestones pane. */
Display the Milestones pane
loadMilestones
{ "repo_name": "cameronroudebush/RaiderPlanner", "path": "src/Controller/MenuController.java", "license": "gpl-3.0", "size": 55505 }
[ "java.util.ArrayList", "java.util.Arrays" ]
import java.util.ArrayList; import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
2,254,301
@ApiModelProperty(value = "Used in Backup") public Long getUsedBackup() { return usedBackup; }
@ApiModelProperty(value = STR) Long function() { return usedBackup; }
/** * Used in Backup * @return usedBackup **/
Used in Backup
getUsedBackup
{ "repo_name": "iterate-ch/cyberduck", "path": "storegate/src/main/java/ch/cyberduck/core/storegate/io/swagger/client/model/MultiAccountStorage.java", "license": "gpl-3.0", "size": 9827 }
[ "io.swagger.annotations.ApiModelProperty" ]
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*;
[ "io.swagger.annotations" ]
io.swagger.annotations;
1,511,496
protected static boolean validPlaceAgainst(BlockLocation target) { return (!target.checkTypes(Material.AIR, Material.WATER, Material.STATIONARY_WATER, Material.LONG_GRASS, Material.SNOW)); }
static boolean function(BlockLocation target) { return (!target.checkTypes(Material.AIR, Material.WATER, Material.STATIONARY_WATER, Material.LONG_GRASS, Material.SNOW)); }
/** * Returns true if the given target location is valid to place a block * against. * * @param target * @return True if this location is valid to place against */
Returns true if the given target location is valid to place a block against
validPlaceAgainst
{ "repo_name": "bulshavik/Toolworx", "path": "MachinaBuilder/src/me/lyneira/MachinaBuilder/Builder.java", "license": "gpl-3.0", "size": 16325 }
[ "me.lyneira.MachinaCore", "org.bukkit.Material" ]
import me.lyneira.MachinaCore; import org.bukkit.Material;
import me.lyneira.*; import org.bukkit.*;
[ "me.lyneira", "org.bukkit" ]
me.lyneira; org.bukkit;
165,966
public static Iterator<RecordReader> getJsonReadersFromBatchString(List<String> jsonBatches, FragmentContext fragContext, List<SchemaPath> columnsToRead) { ObjectMapper mapper = new ObjectMapper(); List<RecordReader> readers = new ArrayList<>(); for (String batchJason : jsonBatches) { JsonNode records; try { records = mapper.readTree(batchJason); } catch (IOException e) { throw new RuntimeException(e); } readers.add(new JSONRecordReader(fragContext, records, null, columnsToRead)); } return readers.iterator(); }
static Iterator<RecordReader> function(List<String> jsonBatches, FragmentContext fragContext, List<SchemaPath> columnsToRead) { ObjectMapper mapper = new ObjectMapper(); List<RecordReader> readers = new ArrayList<>(); for (String batchJason : jsonBatches) { JsonNode records; try { records = mapper.readTree(batchJason); } catch (IOException e) { throw new RuntimeException(e); } readers.add(new JSONRecordReader(fragContext, records, null, columnsToRead)); } return readers.iterator(); }
/** * Create JSONRecordReader from input strings. * @param jsonBatches : list of input strings, each element represent a batch. Each string could either * be in the form of "[{...}, {...}, ..., {...}]", or in the form of "{...}". * @param fragContext : fragment context * @param columnsToRead : list of schema paths to read from JSON reader. * @return */
Create JSONRecordReader from input strings
getJsonReadersFromBatchString
{ "repo_name": "parthchandra/incubator-drill", "path": "exec/java-exec/src/test/java/org/apache/drill/exec/physical/unit/PhysicalOpUnitTestBase.java", "license": "apache-2.0", "size": 19153 }
[ "com.fasterxml.jackson.databind.JsonNode", "com.fasterxml.jackson.databind.ObjectMapper", "java.io.IOException", "java.util.ArrayList", "java.util.Iterator", "java.util.List", "org.apache.drill.common.expression.SchemaPath", "org.apache.drill.exec.ops.FragmentContext", "org.apache.drill.exec.store.R...
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.drill.common.expression.SchemaPath; import org.apache.drill.exec.ops.FragmentContext; import org.apache.drill.exec.store.RecordReader; import org.apache.drill.exec.store.easy.json.JSONRecordReader;
import com.fasterxml.jackson.databind.*; import java.io.*; import java.util.*; import org.apache.drill.common.expression.*; import org.apache.drill.exec.ops.*; import org.apache.drill.exec.store.*; import org.apache.drill.exec.store.easy.json.*;
[ "com.fasterxml.jackson", "java.io", "java.util", "org.apache.drill" ]
com.fasterxml.jackson; java.io; java.util; org.apache.drill;
2,062,875
public void deleteAnnotation(final Annotation note) { if (search != null) { search.deleteAnnotation(note).addErrback(new PluginError()); } }
void function(final Annotation note) { if (search != null) { search.deleteAnnotation(note).addErrback(new PluginError()); } }
/** * Delete the annotation object from the search index * @param note The annotation object to delete * @since 2.0 */
Delete the annotation object from the search index
deleteAnnotation
{ "repo_name": "pepperdata/opentsdb", "path": "opentsdb-core/src/main/java/net/opentsdb/core/TSDB.java", "license": "lgpl-2.1", "size": 55721 }
[ "net.opentsdb.meta.Annotation" ]
import net.opentsdb.meta.Annotation;
import net.opentsdb.meta.*;
[ "net.opentsdb.meta" ]
net.opentsdb.meta;
1,417,261
public static WebElement waitForFind(WebElement webElement, By selector) { return new FluentWait<WebElement>(webElement) .ignoring(NoSuchElementException.class) .until((WebElement w) -> w.findElement(selector)); }
static WebElement function(WebElement webElement, By selector) { return new FluentWait<WebElement>(webElement) .ignoring(NoSuchElementException.class) .until((WebElement w) -> w.findElement(selector)); }
/** * Waits for a web element to be found in the scope of another element. * <p> * Throws TimeoutException if element is not found. * * @param webElement web element to scope find * @param selector web selector * @return {@link WebElement} found web element */
Waits for a web element to be found in the scope of another element. Throws TimeoutException if element is not found
waitForFind
{ "repo_name": "dnacreative/records-management", "path": "rm-automation/src/main/java/org/alfresco/po/common/util/Utils.java", "license": "lgpl-3.0", "size": 15519 }
[ "org.openqa.selenium.By", "org.openqa.selenium.NoSuchElementException", "org.openqa.selenium.WebElement", "org.openqa.selenium.support.ui.FluentWait" ]
import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.FluentWait;
import org.openqa.selenium.*; import org.openqa.selenium.support.ui.*;
[ "org.openqa.selenium" ]
org.openqa.selenium;
601,443
EReference getIfConditionStart_EndIf();
EReference getIfConditionStart_EndIf();
/** * Returns the meta object for the reference '{@link org.lunifera.doc.dsl.doccompiler.IfConditionStart#getEndIf <em>End If</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the reference '<em>End If</em>'. * @see org.lunifera.doc.dsl.doccompiler.IfConditionStart#getEndIf() * @see #getIfConditionStart() * @generated */
Returns the meta object for the reference '<code>org.lunifera.doc.dsl.doccompiler.IfConditionStart#getEndIf End If</code>'.
getIfConditionStart_EndIf
{ "repo_name": "lunifera/lunifera-doc", "path": "org.lunifera.doc.dsl.semantic/src/org/lunifera/doc/dsl/doccompiler/DocCompilerPackage.java", "license": "epl-1.0", "size": 267430 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
427,970
public void setBounds(LatLngBounds bounds) { mBounds = bounds; }
void function(LatLngBounds bounds) { mBounds = bounds; }
/** * Sets the bounds for all subsequent queries. */
Sets the bounds for all subsequent queries
setBounds
{ "repo_name": "treejames/BuildingBlocks", "path": "app/src/main/java/me/itangqi/buildingblocks/view/adapter/GooglePlacesAdapter.java", "license": "gpl-3.0", "size": 7115 }
[ "com.google.android.gms.maps.model.LatLngBounds" ]
import com.google.android.gms.maps.model.LatLngBounds;
import com.google.android.gms.maps.model.*;
[ "com.google.android" ]
com.google.android;
2,020,583
void createSubscription(String topic, String subscriptionName, MessageId messageId) throws PulsarAdminException;
void createSubscription(String topic, String subscriptionName, MessageId messageId) throws PulsarAdminException;
/** * Create a new subscription on a topic * * @param topic * topic name * @param subscriptionName * Subscription name * @param messageId * The {@link MessageId} on where to initialize the subscription. It could be {@link MessageId#latest}, * {@link MessageId#earliest} or a specific message id. * * @throws NotAuthorizedException * Don't have admin permission * @throws ConflictException * Subscription already exists * @throws NotAllowedException * Command disallowed for requested resource * @throws PulsarAdminException * Unexpected error */
Create a new subscription on a topic
createSubscription
{ "repo_name": "jai1/pulsar", "path": "pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Topics.java", "license": "apache-2.0", "size": 37663 }
[ "org.apache.pulsar.client.api.MessageId" ]
import org.apache.pulsar.client.api.MessageId;
import org.apache.pulsar.client.api.*;
[ "org.apache.pulsar" ]
org.apache.pulsar;
2,468,914
public int refresh(T data) throws SQLException;
int function(T data) throws SQLException;
/** * Does a query for the data parameter's id and copies in each of the field values from the database to refresh the * data parameter. Any local object changes to persisted fields will be overwritten. If the database has been * updated this brings your local object up to date. * * @param data * The data item that we are refreshing with fields from the database. * @return The number of rows found in the database that correspond to the data id. This should be 1. * @throws SQLException * on any SQL problems or if the data item is not found in the table or if more than 1 item is found * with data's id. */
Does a query for the data parameter's id and copies in each of the field values from the database to refresh the data parameter. Any local object changes to persisted fields will be overwritten. If the database has been updated this brings your local object up to date
refresh
{ "repo_name": "dankito/ormlite-jpa-core", "path": "src/main/java/com/j256/ormlite/dao/Dao.java", "license": "isc", "size": 36726 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
863,547
@UML(identifier = "extent", obligation = MANDATORY, specification = ISO_19108) TemporalPrimitive getExtent();
@UML(identifier = STR, obligation = MANDATORY, specification = ISO_19108) TemporalPrimitive getExtent();
/** * Returns the date and time for the content of the dataset. * * @return The date and time for the content. */
Returns the date and time for the content of the dataset
getExtent
{ "repo_name": "geotools/geotools", "path": "modules/library/opengis/src/main/java/org/opengis/metadata/extent/TemporalExtent.java", "license": "lgpl-2.1", "size": 1129 }
[ "org.opengis.temporal.TemporalPrimitive" ]
import org.opengis.temporal.TemporalPrimitive;
import org.opengis.temporal.*;
[ "org.opengis.temporal" ]
org.opengis.temporal;
1,449,759
private void registerContentObservers() { ContentResolver resolver = getContentResolver(); resolver.registerContentObserver(LauncherProvider.CONTENT_APPWIDGET_RESET_URI, true, mWidgetObserver); }
void function() { ContentResolver resolver = getContentResolver(); resolver.registerContentObserver(LauncherProvider.CONTENT_APPWIDGET_RESET_URI, true, mWidgetObserver); }
/** * Registers various content observers. The current implementation registers * only a favorites observer to keep track of the favorites applications. */
Registers various content observers. The current implementation registers only a favorites observer to keep track of the favorites applications
registerContentObservers
{ "repo_name": "rex-xxx/mt6572_x201", "path": "packages/apps/Launcher2/src/com/android/launcher2/Launcher.java", "license": "gpl-2.0", "size": 191174 }
[ "android.content.ContentResolver" ]
import android.content.ContentResolver;
import android.content.*;
[ "android.content" ]
android.content;
1,887,403
public Map<String, String> properties();
Map<String, String> function();
/** * Get properties of the file. * * @return Properties of the file. */
Get properties of the file
properties
{ "repo_name": "andrey-kuznetsov/ignite", "path": "modules/core/src/main/java/org/apache/ignite/igfs/IgfsFile.java", "license": "apache-2.0", "size": 3530 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,946,321
public synchronized List<JobInProgress> getRunningJobs() { synchronized (jobs) { return runningJobs(); } }
synchronized List<JobInProgress> function() { synchronized (jobs) { return runningJobs(); } }
/** * Version that is called from a timer thread, and therefore needs to be * careful to synchronize. */
Version that is called from a timer thread, and therefore needs to be careful to synchronize
getRunningJobs
{ "repo_name": "ZhangXFeng/hadoop", "path": "src/hadoop-mapreduce1-project/src/mapred/org/apache/hadoop/mapred/JobTracker.java", "license": "apache-2.0", "size": 179440 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,632,603