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 RegionLocalService getRegionLocalService() { return regionLocalService; }
RegionLocalService function() { return regionLocalService; }
/** * Returns the region local service. * * @return the region local service */
Returns the region local service
getRegionLocalService
{ "repo_name": "fraunhoferfokus/govapps", "path": "data-portlet/src/main/java/de/fraunhofer/fokus/movepla/service/base/EntitlementServiceBaseImpl.java", "license": "bsd-3-clause", "size": 32782 }
[ "de.fraunhofer.fokus.movepla.service.RegionLocalService" ]
import de.fraunhofer.fokus.movepla.service.RegionLocalService;
import de.fraunhofer.fokus.movepla.service.*;
[ "de.fraunhofer.fokus" ]
de.fraunhofer.fokus;
882,141
public Container getContainer() { return CONTAINER; }
Container function() { return CONTAINER; }
/** * Implements the <tt>PaneItem</tt> interface. <p> * * Returns the <tt>Container</tt> for this set of options. * * @return the <tt>Container</tt> for this set of options */
Implements the PaneItem interface. Returns the Container for this set of options
getContainer
{ "repo_name": "alejandroarturom/frostwire-desktop", "path": "src/com/limegroup/gnutella/gui/options/panes/AbstractPaneItem.java", "license": "gpl-3.0", "size": 4560 }
[ "java.awt.Container" ]
import java.awt.Container;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,779,777
@Test public void testGLSEfficiency() { RandomGenerator rg = new JDKRandomGenerator(); rg.setSeed(200); // Seed has been selected to generate non-trivial covariance // Assume model has 16 observations (will use Longley data). Start by generating // non-constant variances for the 16 error terms. final int nObs = 16; double[] sigma = new double[nObs]; for (int i = 0; i < nObs; i++) { sigma[i] = 10 * rg.nextDouble(); } // Now generate 1000 error vectors to use to estimate the covariance matrix // Columns are draws on N(0, sigma[col]) final int numSeeds = 1000; RealMatrix errorSeeds = MatrixUtils.createRealMatrix(numSeeds, nObs); for (int i = 0; i < numSeeds; i++) { for (int j = 0; j < nObs; j++) { errorSeeds.setEntry(i, j, rg.nextGaussian() * sigma[j]); } } // Get covariance matrix for columns RealMatrix cov = (new Covariance(errorSeeds)).getCovarianceMatrix(); // Create a CorrelatedRandomVectorGenerator to use to generate correlated errors GaussianRandomGenerator rawGenerator = new GaussianRandomGenerator(rg); double[] errorMeans = new double[nObs]; // Counting on init to 0 here CorrelatedRandomVectorGenerator gen = new CorrelatedRandomVectorGenerator(errorMeans, cov, 1.0e-12 * cov.getNorm1(), rawGenerator); // Now start generating models. Use Longley X matrix on LHS // and Longley OLS beta vector as "true" beta. Generate // Y values by XB + u where u is a CorrelatedRandomVector generated // from cov. OLSMultipleLinearRegression ols = new OLSMultipleLinearRegression(); ols.newSampleData(longley, nObs, 6); final RealVector b = ols.calculateBeta().copy(); final RealMatrix x = ols.getX().copy(); // Create a GLS model to reuse GLSMultipleLinearRegression gls = new GLSMultipleLinearRegression(); gls.newSampleData(longley, nObs, 6); gls.newCovarianceData(cov.getData()); // Create aggregators for stats measuring model performance DescriptiveStatistics olsBetaStats = new DescriptiveStatistics(); DescriptiveStatistics glsBetaStats = new DescriptiveStatistics(); // Generate Y vectors for 10000 models, estimate GLS and OLS and // Verify that OLS estimates are better final int nModels = 10000; for (int i = 0; i < nModels; i++) { // Generate y = xb + u with u cov RealVector u = MatrixUtils.createRealVector(gen.nextVector()); double[] y = u.add(x.operate(b)).toArray(); // Estimate OLS parameters ols.newYSampleData(y); RealVector olsBeta = ols.calculateBeta(); // Estimate GLS parameters gls.newYSampleData(y); RealVector glsBeta = gls.calculateBeta(); // Record deviations from "true" beta double dist = olsBeta.getDistance(b); olsBetaStats.addValue(dist * dist); dist = glsBeta.getDistance(b); glsBetaStats.addValue(dist * dist); } // Verify that GLS is on average more efficient, lower variance assert(olsBetaStats.getMean() > 1.5 * glsBetaStats.getMean()); assert(olsBetaStats.getStandardDeviation() > glsBetaStats.getStandardDeviation()); }
void function() { RandomGenerator rg = new JDKRandomGenerator(); rg.setSeed(200); final int nObs = 16; double[] sigma = new double[nObs]; for (int i = 0; i < nObs; i++) { sigma[i] = 10 * rg.nextDouble(); } final int numSeeds = 1000; RealMatrix errorSeeds = MatrixUtils.createRealMatrix(numSeeds, nObs); for (int i = 0; i < numSeeds; i++) { for (int j = 0; j < nObs; j++) { errorSeeds.setEntry(i, j, rg.nextGaussian() * sigma[j]); } } RealMatrix cov = (new Covariance(errorSeeds)).getCovarianceMatrix(); GaussianRandomGenerator rawGenerator = new GaussianRandomGenerator(rg); double[] errorMeans = new double[nObs]; CorrelatedRandomVectorGenerator gen = new CorrelatedRandomVectorGenerator(errorMeans, cov, 1.0e-12 * cov.getNorm1(), rawGenerator); OLSMultipleLinearRegression ols = new OLSMultipleLinearRegression(); ols.newSampleData(longley, nObs, 6); final RealVector b = ols.calculateBeta().copy(); final RealMatrix x = ols.getX().copy(); GLSMultipleLinearRegression gls = new GLSMultipleLinearRegression(); gls.newSampleData(longley, nObs, 6); gls.newCovarianceData(cov.getData()); DescriptiveStatistics olsBetaStats = new DescriptiveStatistics(); DescriptiveStatistics glsBetaStats = new DescriptiveStatistics(); final int nModels = 10000; for (int i = 0; i < nModels; i++) { RealVector u = MatrixUtils.createRealVector(gen.nextVector()); double[] y = u.add(x.operate(b)).toArray(); ols.newYSampleData(y); RealVector olsBeta = ols.calculateBeta(); gls.newYSampleData(y); RealVector glsBeta = gls.calculateBeta(); double dist = olsBeta.getDistance(b); olsBetaStats.addValue(dist * dist); dist = glsBeta.getDistance(b); glsBetaStats.addValue(dist * dist); } assert(olsBetaStats.getMean() > 1.5 * glsBetaStats.getMean()); assert(olsBetaStats.getStandardDeviation() > glsBetaStats.getStandardDeviation()); }
/** * Generate an error covariance matrix and sample data representing models * with this error structure. Then verify that GLS estimated coefficients, * on average, perform better than OLS. */
Generate an error covariance matrix and sample data representing models with this error structure. Then verify that GLS estimated coefficients, on average, perform better than OLS
testGLSEfficiency
{ "repo_name": "sdinot/hipparchus", "path": "hipparchus-stat/src/test/java/org/hipparchus/stat/regression/GLSMultipleLinearRegressionTest.java", "license": "apache-2.0", "size": 12369 }
[ "org.hipparchus.linear.MatrixUtils", "org.hipparchus.linear.RealMatrix", "org.hipparchus.linear.RealVector", "org.hipparchus.random.CorrelatedRandomVectorGenerator", "org.hipparchus.random.GaussianRandomGenerator", "org.hipparchus.random.JDKRandomGenerator", "org.hipparchus.random.RandomGenerator", "org.hipparchus.stat.correlation.Covariance", "org.hipparchus.stat.descriptive.DescriptiveStatistics" ]
import org.hipparchus.linear.MatrixUtils; import org.hipparchus.linear.RealMatrix; import org.hipparchus.linear.RealVector; import org.hipparchus.random.CorrelatedRandomVectorGenerator; import org.hipparchus.random.GaussianRandomGenerator; import org.hipparchus.random.JDKRandomGenerator; import org.hipparchus.random.RandomGenerator; import org.hipparchus.stat.correlation.Covariance; import org.hipparchus.stat.descriptive.DescriptiveStatistics;
import org.hipparchus.linear.*; import org.hipparchus.random.*; import org.hipparchus.stat.correlation.*; import org.hipparchus.stat.descriptive.*;
[ "org.hipparchus.linear", "org.hipparchus.random", "org.hipparchus.stat" ]
org.hipparchus.linear; org.hipparchus.random; org.hipparchus.stat;
1,912,885
public ClusterControl connectToNode(TransportConfiguration transportConfiguration) throws Exception { ClientSessionFactoryInternal sessionFactory = (ClientSessionFactoryInternal) defaultLocator.createSessionFactory(transportConfiguration, 0, false); return connectToNodeInCluster(sessionFactory); }
ClusterControl function(TransportConfiguration transportConfiguration) throws Exception { ClientSessionFactoryInternal sessionFactory = (ClientSessionFactoryInternal) defaultLocator.createSessionFactory(transportConfiguration, 0, false); return connectToNodeInCluster(sessionFactory); }
/** * connect to a specific node in the cluster used for replication * * @param transportConfiguration the configuration of the node to connect to. * @return the Cluster Control * @throws Exception */
connect to a specific node in the cluster used for replication
connectToNode
{ "repo_name": "l-dobrev/activemq-artemis", "path": "artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterController.java", "license": "apache-2.0", "size": 17424 }
[ "org.apache.activemq.artemis.api.core.TransportConfiguration", "org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal" ]
import org.apache.activemq.artemis.api.core.TransportConfiguration; import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal;
import org.apache.activemq.artemis.api.core.*; import org.apache.activemq.artemis.core.client.impl.*;
[ "org.apache.activemq" ]
org.apache.activemq;
2,879,714
private float dpToPx(float dp) { return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, getContext().getResources().getDisplayMetrics()); }
float function(float dp) { return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, getContext().getResources().getDisplayMetrics()); }
/** * Convert a dp size to pixel. Useful for specifying view sizes in code. * * @param dp * The size in density-independent pixels. * @return {@code px} - The size in generic pixels (density-dependent). */
Convert a dp size to pixel. Useful for specifying view sizes in code
dpToPx
{ "repo_name": "k0shk0sh/Fast-Access-Floating-Toolbox-", "path": "color-picker/src/main/java/org/xdty/preference/AppCompatColorPreference.java", "license": "gpl-3.0", "size": 10954 }
[ "android.util.TypedValue" ]
import android.util.TypedValue;
import android.util.*;
[ "android.util" ]
android.util;
879,842
public IndexRequestBuilder setSource(XContentBuilder sourceBuilder) { request.source(sourceBuilder); return this; }
IndexRequestBuilder function(XContentBuilder sourceBuilder) { request.source(sourceBuilder); return this; }
/** * Sets the content source to index. */
Sets the content source to index
setSource
{ "repo_name": "ern/elasticsearch", "path": "server/src/main/java/org/elasticsearch/action/index/IndexRequestBuilder.java", "license": "apache-2.0", "size": 7323 }
[ "org.elasticsearch.common.xcontent.XContentBuilder" ]
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.*;
[ "org.elasticsearch.common" ]
org.elasticsearch.common;
1,003,728
public void surfaceChanged (SurfaceHolder holder, int format, int w, int h) { if (mGLThread != null) { mGLThread.onWindowResize(w, h); } mSurfaceWidth = w; mSurfaceHeight = h; }
void function (SurfaceHolder holder, int format, int w, int h) { if (mGLThread != null) { mGLThread.onWindowResize(w, h); } mSurfaceWidth = w; mSurfaceHeight = h; }
/** * This method is part of the SurfaceHolder.Callback interface, and is not normally called or subclassed by clients of * GLSurfaceView. */
This method is part of the SurfaceHolder.Callback interface, and is not normally called or subclassed by clients of GLSurfaceView
surfaceChanged
{ "repo_name": "aevum/libgdx-cpp", "path": "src/gdx-cpp/backends/android/android_support/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceViewCupcake.java", "license": "apache-2.0", "size": 31514 }
[ "android.view.SurfaceHolder" ]
import android.view.SurfaceHolder;
import android.view.*;
[ "android.view" ]
android.view;
2,201,296
void save(MouseOverStripes stripes);
void save(MouseOverStripes stripes);
/** * Save given mouseover stripes to persistent * storage. * @param stripes Mouseover stripes to persist. */
Save given mouseover stripes to persistent storage
save
{ "repo_name": "NCIP/webgenome", "path": "tags/WEBGENOME_R3.2_6MAR2009_BUILD1/java/core/src/org/rti/webgenome/service/dao/MouseOverStripesDao.java", "license": "bsd-3-clause", "size": 794 }
[ "org.rti.webgenome.graphics.event.MouseOverStripes" ]
import org.rti.webgenome.graphics.event.MouseOverStripes;
import org.rti.webgenome.graphics.event.*;
[ "org.rti.webgenome" ]
org.rti.webgenome;
2,070,417
public static final CDOAdapterPolicy ALL = new CDOAdapterPolicy() { public boolean isValid(EObject eObject, Adapter adapter) { return true; }
static final CDOAdapterPolicy ALL = new CDOAdapterPolicy() { public boolean function(EObject eObject, Adapter adapter) { return true; }
/** * Always returns <code>true</code>. */
Always returns <code>true</code>
isValid
{ "repo_name": "IHTSDO/snow-owl", "path": "dependencies/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOAdapterPolicy.java", "license": "apache-2.0", "size": 2771 }
[ "org.eclipse.emf.common.notify.Adapter", "org.eclipse.emf.ecore.EObject" ]
import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.common.notify.*; import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,527,965
@SuppressWarnings("unchecked") @Override public void writeValue(final Key key, final Object value) { assert UjoManager.assertDirectAssign(key, value, this); ((ValueAgent) key).writeValue(this, value); }
@SuppressWarnings(STR) void function(final Key key, final Object value) { assert UjoManager.assertDirectAssign(key, value, this); ((ValueAgent) key).writeValue(this, value); }
/** It is a <strong>common</strong> method for writing all object values, however there is strongly recomended to use a method * FieldProperty.setValue(Ujo,Object) * to an external access for a better type safe. * The method have got a <strong>strategy place</strong> for an implementation of several listeners and validators. * <br>NOTE: If the Key is an incorrect then method throws an IllegalArgumentException. * * @see FieldProperty#setValue(Ujo,Object) FieldProperty.setValue(Ujo,Object) */
It is a common method for writing all object values, however there is strongly recomended to use a method FieldProperty.setValue(Ujo,Object) to an external access for a better type safe. The method have got a strategy place for an implementation of several listeners and validators
writeValue
{ "repo_name": "pponec/ujorm", "path": "project-m2/ujo-core/src/main/java/org/ujorm/implementation/field/FieldUjo.java", "license": "apache-2.0", "size": 5313 }
[ "org.ujorm.Key", "org.ujorm.core.UjoManager", "org.ujorm.extensions.ValueAgent" ]
import org.ujorm.Key; import org.ujorm.core.UjoManager; import org.ujorm.extensions.ValueAgent;
import org.ujorm.*; import org.ujorm.core.*; import org.ujorm.extensions.*;
[ "org.ujorm", "org.ujorm.core", "org.ujorm.extensions" ]
org.ujorm; org.ujorm.core; org.ujorm.extensions;
485,390
void _registerSpyStream(OutputStream spystream) { spyStream = spystream; }
void _registerSpyStream(OutputStream spystream) { spyStream = spystream; }
/*** * Registers an OutputStream for spying what's going on in * the Telnet session. * * @param spystream - OutputStream on which session activity * will be echoed. ***/
Registers an OutputStream for spying what's going on in the Telnet session
_registerSpyStream
{ "repo_name": "mohanaraosv/commons-net", "path": "src/main/java/org/apache/commons/net/telnet/Telnet.java", "license": "apache-2.0", "size": 33850 }
[ "java.io.OutputStream" ]
import java.io.OutputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,070,470
return PhaseId.ANY_PHASE; }
return PhaseId.ANY_PHASE; }
/** * Return the identifier of the request processing phase during which this * listener is interested in processing PhaseEvent events. */
Return the identifier of the request processing phase during which this listener is interested in processing PhaseEvent events
getPhaseId
{ "repo_name": "RoyHarry/TesisProduccion", "path": "TesisProduccion2/src/java/Util/MultiPageMessagesSupport.java", "license": "gpl-2.0", "size": 5282 }
[ "javax.faces.event.PhaseId" ]
import javax.faces.event.PhaseId;
import javax.faces.event.*;
[ "javax.faces" ]
javax.faces;
1,592,489
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Color oldColor; oldColor = g.getColor(); y = y + height - 2; try { g.setColor(shadow); g.drawLine(x, y, x + width - 2, y); g.drawLine(x, y + 1, x, y + 1); g.drawLine(x + width - 2, y + 1, x + width - 2, y + 1); g.setColor(highlight); g.drawLine(x + 1, y + 1, x + width - 3, y + 1); g.drawLine(x + width - 1, y, x + width - 1, y + 1); } finally { g.setColor(oldColor); } }
void function(Component c, Graphics g, int x, int y, int width, int height) { Color oldColor; oldColor = g.getColor(); y = y + height - 2; try { g.setColor(shadow); g.drawLine(x, y, x + width - 2, y); g.drawLine(x, y + 1, x, y + 1); g.drawLine(x + width - 2, y + 1, x + width - 2, y + 1); g.setColor(highlight); g.drawLine(x + 1, y + 1, x + width - 3, y + 1); g.drawLine(x + width - 1, y, x + width - 1, y + 1); } finally { g.setColor(oldColor); } }
/** * Paints the MenuBarBorder around a given component. * * @param c the component whose border is to be painted, usually * an instance of {@link javax.swing.JMenuBar}. * * @param g the graphics for painting. * @param x the horizontal position for painting the border. * @param y the vertical position for painting the border. * @param width the width of the available area for painting the border. * @param height the height of the available area for painting the border. */
Paints the MenuBarBorder around a given component
paintBorder
{ "repo_name": "aosm/gcc_40", "path": "libjava/javax/swing/plaf/basic/BasicBorders.java", "license": "gpl-2.0", "size": 63951 }
[ "java.awt.Color", "java.awt.Component", "java.awt.Graphics" ]
import java.awt.Color; import java.awt.Component; import java.awt.Graphics;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,766,600
public Observable<ServiceResponse<Page<CertificateItem>>> getCertificatesSinglePageAsync(final String vaultBaseUrl) { if (vaultBaseUrl == null) { throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); } if (this.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); }
Observable<ServiceResponse<Page<CertificateItem>>> function(final String vaultBaseUrl) { if (vaultBaseUrl == null) { throw new IllegalArgumentException(STR); } if (this.apiVersion() == null) { throw new IllegalArgumentException(STR); }
/** * List certificates in a specified key vault. * * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @return the PagedList&lt;CertificateItem&gt; object wrapped in {@link ServiceResponse} if successful. */
List certificates in a specified key vault
getCertificatesSinglePageAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/keyvault/microsoft-azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientImpl.java", "license": "mit", "size": 398315 }
[ "com.microsoft.azure.Page", "com.microsoft.azure.keyvault.models.CertificateItem", "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.azure.Page; import com.microsoft.azure.keyvault.models.CertificateItem; import com.microsoft.rest.ServiceResponse;
import com.microsoft.azure.*; import com.microsoft.azure.keyvault.models.*; import com.microsoft.rest.*;
[ "com.microsoft.azure", "com.microsoft.rest" ]
com.microsoft.azure; com.microsoft.rest;
2,375,036
default Sha256Hash createManagedProperty(Address address, Ecosystem ecosystem, PropertyType type, String category, String subCategory, String label, String website, String info) throws JsonRpcException, IOException { String rawTxHex = omniRawTxBuilder.createManagedPropertyHex(ecosystem, type, 0L, category, subCategory, label, website, info); Sha256Hash txid = omniSendRawTx(address, rawTxHex); return txid; }
default Sha256Hash createManagedProperty(Address address, Ecosystem ecosystem, PropertyType type, String category, String subCategory, String label, String website, String info) throws JsonRpcException, IOException { String rawTxHex = omniRawTxBuilder.createManagedPropertyHex(ecosystem, type, 0L, category, subCategory, label, website, info); Sha256Hash txid = omniSendRawTx(address, rawTxHex); return txid; }
/** * Creates a managed property. * * @param address The issuance address * @param ecosystem The ecosystem to create the property in * @param type The property type * @param category The category * @param subCategory The subcategory * @param label The label or title of the property to create * @param website The website website * @param info Additional information * @return transaction hash/id * @throws JsonRpcException JSON RPC error * @throws IOException network error */
Creates a managed property
createManagedProperty
{ "repo_name": "OmniLayer/OmniJ", "path": "omnij-jsonrpc/src/main/java/foundation/omni/rpc/test/OmniTestClientMethods.java", "license": "apache-2.0", "size": 12900 }
[ "foundation.omni.Ecosystem", "foundation.omni.PropertyType", "java.io.IOException", "org.bitcoinj.core.Address", "org.bitcoinj.core.Sha256Hash", "org.consensusj.jsonrpc.JsonRpcException" ]
import foundation.omni.Ecosystem; import foundation.omni.PropertyType; import java.io.IOException; import org.bitcoinj.core.Address; import org.bitcoinj.core.Sha256Hash; import org.consensusj.jsonrpc.JsonRpcException;
import foundation.omni.*; import java.io.*; import org.bitcoinj.core.*; import org.consensusj.jsonrpc.*;
[ "foundation.omni", "java.io", "org.bitcoinj.core", "org.consensusj.jsonrpc" ]
foundation.omni; java.io; org.bitcoinj.core; org.consensusj.jsonrpc;
1,465,823
private static double[] getHistogram(BufferedImage image) { double[] histogram = new double[256]; long numPixels = image.getHeight() * image.getWidth(); // Calculates the total number of pixels at each grayscale value for (int r = 0; r < image.getWidth(); r++) { for (int c = 0; c < image.getHeight(); c++) { histogram[ImageUtils.grayscaleFromRgb(image.getRGB(c, r))]++; } } // Divides the number of each pixels at each grayscale value by the total number of pixels to find find the // probability. for (int i = 0; i < histogram.length; i++) { histogram[i] = (histogram[i] / numPixels); } return histogram; }
static double[] function(BufferedImage image) { double[] histogram = new double[256]; long numPixels = image.getHeight() * image.getWidth(); for (int r = 0; r < image.getWidth(); r++) { for (int c = 0; c < image.getHeight(); c++) { histogram[ImageUtils.grayscaleFromRgb(image.getRGB(c, r))]++; } } for (int i = 0; i < histogram.length; i++) { histogram[i] = (histogram[i] / numPixels); } return histogram; }
/** * Returns a histogram representing the probability of a grayscale value appearing in the image. * @param image The image to generate a histogram for. * @return A single dimensional array where each index value corresponds to grayscale value, and the value stored at * that index is the probability of that grayscale value appearing in the image. */
Returns a histogram representing the probability of a grayscale value appearing in the image
getHistogram
{ "repo_name": "anthonyjchriste/683f13", "path": "CountingBalls/src/edu/achriste/processing/Otsu.java", "license": "gpl-3.0", "size": 5085 }
[ "edu.achriste.utils.ImageUtils", "java.awt.image.BufferedImage" ]
import edu.achriste.utils.ImageUtils; import java.awt.image.BufferedImage;
import edu.achriste.utils.*; import java.awt.image.*;
[ "edu.achriste.utils", "java.awt" ]
edu.achriste.utils; java.awt;
1,356,122
@Override public void print(Object o) throws IOException { out.write(o.toString()); }
void function(Object o) throws IOException { out.write(o.toString()); }
/** * Print string, DO NOT replacing all non-ascii character with unicode * escapes. */
Print string, DO NOT replacing all non-ascii character with unicode escapes
print
{ "repo_name": "md-5/jdk10", "path": "src/jdk.jshell/share/classes/jdk/jshell/Eval.java", "license": "gpl-2.0", "size": 54771 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,765,664
public static byte[] fromBase85(String text) throws IllegalArgumentException { return Ascii85.decode(text); }
static byte[] function(String text) throws IllegalArgumentException { return Ascii85.decode(text); }
/** * Decode Base85 encoded String * * @param text Base85 encoded String * @return byte array * @throws IllegalArgumentException */
Decode Base85 encoded String
fromBase85
{ "repo_name": "koljaschleich/passwordGenerator", "path": "src/main/com/github/koljaschleich/passwordGenerator/utils/StringEncoder.java", "license": "gpl-3.0", "size": 8595 }
[ "com.github.fzakaria.ascii85.Ascii85" ]
import com.github.fzakaria.ascii85.Ascii85;
import com.github.fzakaria.ascii85.*;
[ "com.github.fzakaria" ]
com.github.fzakaria;
2,657,380
public LocalTime getStartingTime() { return stopTimes.get(0); }
LocalTime function() { return stopTimes.get(0); }
/** * Returns the starting time of this trip. * * @return Starting time of this trip */
Returns the starting time of this trip
getStartingTime
{ "repo_name": "poxrucker/collaborative-learning-simulation", "path": "Simulator/src/allow/simulator/mobility/data/Trip.java", "license": "apache-2.0", "size": 1572 }
[ "java.time.LocalTime" ]
import java.time.LocalTime;
import java.time.*;
[ "java.time" ]
java.time;
2,095,612
@ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux<TopicProperties> listTopics() { return new PagedFlux<>( () -> withContext(context -> listTopicsFirstPage(context)), token -> withContext(context -> listTopicsNextPage(token, context))); } /** * Updates a queue with the given {@link QueueProperties}. The {@link QueueProperties} must be fully populated as * all of the properties are replaced. If a property is not set the service default value is used. * * The suggested flow is: * <ol> * <li>{@link #getQueue(String) Get queue description.}</li> * <li>Update the required elements.</li> * <li>Pass the updated description into this method.</li> * </ol> * * <p> * There are a subset of properties that can be updated. More information can be found in the links below. They are: * <ul> * <li>{@link QueueProperties#setDefaultMessageTimeToLive(Duration) DefaultMessageTimeToLive}</li> * <li>{@link QueueProperties#setLockDuration(Duration) LockDuration}</li> * <li>{@link QueueProperties#setDuplicateDetectionHistoryTimeWindow(Duration) DuplicateDetectionHistoryTimeWindow}
@ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux<TopicProperties> function() { return new PagedFlux<>( () -> withContext(context -> listTopicsFirstPage(context)), token -> withContext(context -> listTopicsNextPage(token, context))); } /** * Updates a queue with the given {@link QueueProperties}. The {@link QueueProperties} must be fully populated as * all of the properties are replaced. If a property is not set the service default value is used. * * The suggested flow is: * <ol> * <li>{@link #getQueue(String) Get queue description.}</li> * <li>Update the required elements.</li> * <li>Pass the updated description into this method.</li> * </ol> * * <p> * There are a subset of properties that can be updated. More information can be found in the links below. They are: * <ul> * <li>{@link QueueProperties#setDefaultMessageTimeToLive(Duration) DefaultMessageTimeToLive}</li> * <li>{@link QueueProperties#setLockDuration(Duration) LockDuration}</li> * <li>{@link QueueProperties#setDuplicateDetectionHistoryTimeWindow(Duration) DuplicateDetectionHistoryTimeWindow}
/** * Fetches all the topics in the Service Bus namespace. * * @return A Flux of {@link TopicProperties topics} in the Service Bus namespace. * @throws ClientAuthenticationException if the client's credentials do not have access to modify the * namespace. * @see <a href="https://docs.microsoft.com/rest/api/servicebus/enumeration">List entities, subscriptions, or * authorization rules</a> */
Fetches all the topics in the Service Bus namespace
listTopics
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/administration/ServiceBusAdministrationAsyncClient.java", "license": "mit", "size": 144140 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.PagedFlux", "com.azure.core.util.FluxUtil", "com.azure.messaging.servicebus.administration.models.QueueProperties", "com.azure.messaging.servicebus.administration.models.TopicProperties", "java.time.Duration" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedFlux; import com.azure.core.util.FluxUtil; import com.azure.messaging.servicebus.administration.models.QueueProperties; import com.azure.messaging.servicebus.administration.models.TopicProperties; import java.time.Duration;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.messaging.servicebus.administration.models.*; import java.time.*;
[ "com.azure.core", "com.azure.messaging", "java.time" ]
com.azure.core; com.azure.messaging; java.time;
2,726,353
public PathIterator getPathIterator(AffineTransform at, double flatness) { return ((RectangleAreaAdapter) getBody()).getPathIterator(at, flatness); }
PathIterator function(AffineTransform at, double flatness) { return ((RectangleAreaAdapter) getBody()).getPathIterator(at, flatness); }
/** * Required by the {@link java.awt.Shape Shape} I/F. * @see java.awt.Shape#getPathIterator(AffineTransform, double) */
Required by the <code>java.awt.Shape Shape</code> I/F
getPathIterator
{ "repo_name": "simleo/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/util/math/geom2D/RectangleArea.java", "license": "gpl-2.0", "size": 6573 }
[ "java.awt.geom.AffineTransform", "java.awt.geom.PathIterator" ]
import java.awt.geom.AffineTransform; import java.awt.geom.PathIterator;
import java.awt.geom.*;
[ "java.awt" ]
java.awt;
477,715
private static Style mapFormatToStyle(String format) { if (format.contains("%s[]")) { return Style.STRING_ARRAY; } else if (format.contains("%s")) { return Style.STRING; } else if (format.contains("%b")) { return Style.BOOLEAN; } else if (format.contains("%d")) { return Style.INT_DEC; } else if (format.contains("%x")) { return Style.INT_HEX; } else if (format.contains("#ip4#")) { return Style.BYTE_ARRAY_IP4_ADDRESS; } else if (format.contains("#ip4[]#")) { return Style.BYTE_ARRAY_ARRAY_IP4_ADDRESS; } else if (format.contains("#ip6#")) { return Style.BYTE_ARRAY_IP6_ADDRESS; } else if (format.contains("#mac#")) { return Style.BYTE_ARRAY_COLON_ADDRESS; } else if (format.contains("#hexdump#")) { return Style.BYTE_ARRAY_HEX_DUMP; } else if (format.contains("#textdump#")) { return Style.STRING_TEXT_DUMP; } else if (format.contains("#bitfield#")) { return Style.INT_BITS; } else { return Style.STRING; } } private final Field annotation; private final Class<?> declaringClass; private final Method method; private final AnnotatedFieldRuntime runtime; private final List<AnnotatedField> subFields = new ArrayList<AnnotatedField>(); private String name; private AnnotatedField(Method method) { this.method = method; this.annotation = method.getAnnotation(Field.class); this.runtime = new AnnotatedFieldRuntime(this); this.declaringClass = method.getDeclaringClass(); } public AnnotatedField( String name, Field enumAnnotation, Map<Property, AnnotatedFieldMethod> methods, Class<?> declaringClass) { this.name = name; this.method = methods.get(Property.VALUE).method; this.annotation = enumAnnotation; this.runtime = new AnnotatedFieldRuntime(this); this.declaringClass = method.getDeclaringClass(); this.runtime.setFunction(methods); }
static Style function(String format) { if (format.contains("%s[]")) { return Style.STRING_ARRAY; } else if (format.contains("%s")) { return Style.STRING; } else if (format.contains("%b")) { return Style.BOOLEAN; } else if (format.contains("%d")) { return Style.INT_DEC; } else if (format.contains("%x")) { return Style.INT_HEX; } else if (format.contains("#ip4#")) { return Style.BYTE_ARRAY_IP4_ADDRESS; } else if (format.contains(STR)) { return Style.BYTE_ARRAY_ARRAY_IP4_ADDRESS; } else if (format.contains("#ip6#")) { return Style.BYTE_ARRAY_IP6_ADDRESS; } else if (format.contains("#mac#")) { return Style.BYTE_ARRAY_COLON_ADDRESS; } else if (format.contains(STR)) { return Style.BYTE_ARRAY_HEX_DUMP; } else if (format.contains(STR)) { return Style.STRING_TEXT_DUMP; } else if (format.contains(STR)) { return Style.INT_BITS; } else { return Style.STRING; } } private final Field annotation; private final Class<?> declaringClass; private final Method method; private final AnnotatedFieldRuntime runtime; private final List<AnnotatedField> subFields = new ArrayList<AnnotatedField>(); private String name; private AnnotatedField(Method method) { this.method = method; this.annotation = method.getAnnotation(Field.class); this.runtime = new AnnotatedFieldRuntime(this); this.declaringClass = method.getDeclaringClass(); } public AnnotatedField( String name, Field enumAnnotation, Map<Property, AnnotatedFieldMethod> methods, Class<?> declaringClass) { this.name = name; this.method = methods.get(Property.VALUE).method; this.annotation = enumAnnotation; this.runtime = new AnnotatedFieldRuntime(this); this.declaringClass = method.getDeclaringClass(); this.runtime.setFunction(methods); }
/** * Map format to style. * * @param format * the format * @return the style */
Map format to style
mapFormatToStyle
{ "repo_name": "universsky/diddler", "path": "src/org/jnetpcap/packet/structure/AnnotatedField.java", "license": "lgpl-3.0", "size": 8600 }
[ "java.lang.reflect.Method", "java.util.ArrayList", "java.util.List", "java.util.Map", "org.jnetpcap.packet.annotate.Field", "org.jnetpcap.packet.format.JFormatter" ]
import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.jnetpcap.packet.annotate.Field; import org.jnetpcap.packet.format.JFormatter;
import java.lang.reflect.*; import java.util.*; import org.jnetpcap.packet.annotate.*; import org.jnetpcap.packet.format.*;
[ "java.lang", "java.util", "org.jnetpcap.packet" ]
java.lang; java.util; org.jnetpcap.packet;
1,572,993
@Test public void testFindWithOutMinFinished() { JpaJobSpecs.getFindPredicate( this.root, this.cb, ID, JOB_NAME, USER_NAME, STATUSES, TAGS, CLUSTER_NAME, CLUSTER, COMMAND_NAME, COMMAND, MIN_STARTED, MAX_STARTED, null, MAX_FINISHED ); Mockito.verify(this.cb, Mockito.times(1)).equal(this.root.get(JobEntity_.id), ID); Mockito.verify(this.cb, Mockito.times(1)).equal(this.root.get(JobEntity_.name), JOB_NAME); Mockito.verify(this.cb, Mockito.times(1)).equal(this.root.get(JobEntity_.user), USER_NAME); for (final JobStatus status : STATUSES) { Mockito.verify(this.cb, Mockito.times(1)).equal(this.root.get(JobEntity_.status), status); } Mockito.verify(this.cb, Mockito.times(1)).equal(this.root.get(JobEntity_.clusterName), CLUSTER_NAME); Mockito.verify(this.cb, Mockito.times(1)).equal(this.root.get(JobEntity_.cluster), CLUSTER); Mockito.verify(this.cb, Mockito.times(1)).equal(this.root.get(JobEntity_.commandName), COMMAND_NAME); Mockito.verify(this.cb, Mockito.times(1)).equal(this.root.get(JobEntity_.command), COMMAND); Mockito.verify(this.cb, Mockito.times(1)).like(this.root.get(JobEntity_.tags), this.tagLikeStatement); Mockito.verify(this.cb, Mockito.times(1)).greaterThanOrEqualTo(this.root.get(JobEntity_.started), MIN_STARTED); Mockito.verify(this.cb, Mockito.times(1)).lessThan(this.root.get(JobEntity_.started), MAX_STARTED); Mockito .verify(this.cb, Mockito.never()) .greaterThanOrEqualTo(this.root.get(JobEntity_.finished), MIN_FINISHED); Mockito.verify(this.cb, Mockito.times(1)).lessThan(this.root.get(JobEntity_.finished), MAX_FINISHED); }
void function() { JpaJobSpecs.getFindPredicate( this.root, this.cb, ID, JOB_NAME, USER_NAME, STATUSES, TAGS, CLUSTER_NAME, CLUSTER, COMMAND_NAME, COMMAND, MIN_STARTED, MAX_STARTED, null, MAX_FINISHED ); Mockito.verify(this.cb, Mockito.times(1)).equal(this.root.get(JobEntity_.id), ID); Mockito.verify(this.cb, Mockito.times(1)).equal(this.root.get(JobEntity_.name), JOB_NAME); Mockito.verify(this.cb, Mockito.times(1)).equal(this.root.get(JobEntity_.user), USER_NAME); for (final JobStatus status : STATUSES) { Mockito.verify(this.cb, Mockito.times(1)).equal(this.root.get(JobEntity_.status), status); } Mockito.verify(this.cb, Mockito.times(1)).equal(this.root.get(JobEntity_.clusterName), CLUSTER_NAME); Mockito.verify(this.cb, Mockito.times(1)).equal(this.root.get(JobEntity_.cluster), CLUSTER); Mockito.verify(this.cb, Mockito.times(1)).equal(this.root.get(JobEntity_.commandName), COMMAND_NAME); Mockito.verify(this.cb, Mockito.times(1)).equal(this.root.get(JobEntity_.command), COMMAND); Mockito.verify(this.cb, Mockito.times(1)).like(this.root.get(JobEntity_.tags), this.tagLikeStatement); Mockito.verify(this.cb, Mockito.times(1)).greaterThanOrEqualTo(this.root.get(JobEntity_.started), MIN_STARTED); Mockito.verify(this.cb, Mockito.times(1)).lessThan(this.root.get(JobEntity_.started), MAX_STARTED); Mockito .verify(this.cb, Mockito.never()) .greaterThanOrEqualTo(this.root.get(JobEntity_.finished), MIN_FINISHED); Mockito.verify(this.cb, Mockito.times(1)).lessThan(this.root.get(JobEntity_.finished), MAX_FINISHED); }
/** * Test the find specification. */
Test the find specification
testFindWithOutMinFinished
{ "repo_name": "irontable/genie", "path": "genie-core/src/test/java/com/netflix/genie/core/jpa/specifications/JpaJobSpecsUnitTests.java", "license": "apache-2.0", "size": 42094 }
[ "com.netflix.genie.common.dto.JobStatus", "com.netflix.genie.core.jpa.entities.JobEntity", "org.mockito.Mockito" ]
import com.netflix.genie.common.dto.JobStatus; import com.netflix.genie.core.jpa.entities.JobEntity; import org.mockito.Mockito;
import com.netflix.genie.common.dto.*; import com.netflix.genie.core.jpa.entities.*; import org.mockito.*;
[ "com.netflix.genie", "org.mockito" ]
com.netflix.genie; org.mockito;
2,359,744
public static ims.ocrr.orderingresults.domain.objects.OrderResultHistory extractOrderResultHistory(ims.domain.ILightweightDomainFactory domainFactory, ims.ocrr.vo.OrderResultHistoryVo valueObject) { return extractOrderResultHistory(domainFactory, valueObject, new HashMap()); }
static ims.ocrr.orderingresults.domain.objects.OrderResultHistory function(ims.domain.ILightweightDomainFactory domainFactory, ims.ocrr.vo.OrderResultHistoryVo valueObject) { return extractOrderResultHistory(domainFactory, valueObject, new HashMap()); }
/** * Create the domain object from the value object. * @param domainFactory - used to create existing (persistent) domain objects. * @param valueObject - extract the domain object fields from this. */
Create the domain object from the value object
extractOrderResultHistory
{ "repo_name": "openhealthcare/openMAXIMS", "path": "openmaxims_workspace/ValueObjects/src/ims/ocrr/vo/domain/OrderResultHistoryVoAssembler.java", "license": "agpl-3.0", "size": 21974 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
1,347,576
public void setLegendLine(Shape line) { if (line == null) { throw new IllegalArgumentException("Null 'line' argument."); } this.legendLine = line; fireChangeEvent(); } // SHAPES VISIBLE
void function(Shape line) { if (line == null) { throw new IllegalArgumentException(STR); } this.legendLine = line; fireChangeEvent(); }
/** * Sets the shape used as a line in each legend item and sends a * {@link RendererChangeEvent} to all registered listeners. * * @param line the line (<code>null</code> not permitted). * * @see #getLegendLine() */
Sets the shape used as a line in each legend item and sends a <code>RendererChangeEvent</code> to all registered listeners
setLegendLine
{ "repo_name": "ilyessou/jfreechart", "path": "source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java", "license": "lgpl-2.1", "size": 43831 }
[ "java.awt.Shape" ]
import java.awt.Shape;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,137,780
protected String compress(File inFile, File outFile) { return LzfUtils.compress(inFile, m_BufferSize, outFile, m_RemoveInputFile); }
String function(File inFile, File outFile) { return LzfUtils.compress(inFile, m_BufferSize, outFile, m_RemoveInputFile); }
/** * Compresses the file. * * @param inFile the uncompressed input file * @param outFile the compressed output file * @return null if successfully compressed, otherwise error message */
Compresses the file
compress
{ "repo_name": "waikato-datamining/adams-base", "path": "adams-compress/src/main/java/adams/flow/transformer/Lzf.java", "license": "gpl-3.0", "size": 5646 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,093,563
void doImportCheckpoint() throws IOException { FSImage ckptImage = new FSImage(); FSNamesystem fsNamesys = FSNamesystem.getFSNamesystem(); // replace real image with the checkpoint image FSImage realImage = fsNamesys.getFSImage(); assert realImage == this; fsNamesys.dir.fsImage = ckptImage; // load from the checkpoint dirs try { ckptImage.recoverTransitionRead(checkpointDirs, checkpointEditsDirs, StartupOption.REGULAR); } finally { ckptImage.close(); } // return back the real image realImage.setStorageInfo(ckptImage); fsNamesys.dir.fsImage = realImage; // and save it saveNamespace(false); }
void doImportCheckpoint() throws IOException { FSImage ckptImage = new FSImage(); FSNamesystem fsNamesys = FSNamesystem.getFSNamesystem(); FSImage realImage = fsNamesys.getFSImage(); assert realImage == this; fsNamesys.dir.fsImage = ckptImage; try { ckptImage.recoverTransitionRead(checkpointDirs, checkpointEditsDirs, StartupOption.REGULAR); } finally { ckptImage.close(); } realImage.setStorageInfo(ckptImage); fsNamesys.dir.fsImage = realImage; saveNamespace(false); }
/** * Load image from a checkpoint directory and save it into the current one. * @throws IOException */
Load image from a checkpoint directory and save it into the current one
doImportCheckpoint
{ "repo_name": "rjpower/hadoop", "path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSImage.java", "license": "apache-2.0", "size": 66258 }
[ "java.io.IOException", "org.apache.hadoop.hdfs.server.common.HdfsConstants" ]
import java.io.IOException; import org.apache.hadoop.hdfs.server.common.HdfsConstants;
import java.io.*; import org.apache.hadoop.hdfs.server.common.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
2,038,003
public static void showParserResultWarningDialog(final ParserResult parserResult, final JabRefFrame jabRefFrame, final int dataBaseNumber) { Objects.requireNonNull(parserResult); Objects.requireNonNull(jabRefFrame); // Return if no warnings if (!(parserResult.hasWarnings())) { return; } // Switch tab if asked to do so if (dataBaseNumber >= 0) { jabRefFrame.showBasePanelAt(dataBaseNumber); } // Generate string with warning texts final List<String> warnings = parserResult.warnings(); final StringBuilder dialogContent = new StringBuilder(); int warningCount = 1; for (final String warning : warnings) { dialogContent.append(String.format("%d. %s%n", warningCount++, warning)); } dialogContent.deleteCharAt(dialogContent.length() - 1); // Generate dialog title String dialogTitle; if (dataBaseNumber < 0) { dialogTitle = Localization.lang("Warnings"); } else { dialogTitle = Localization.lang("Warnings") + " (" + parserResult.getFile().get().getName() + ")"; } // Create JTextArea with JScrollPane final JTextArea textArea = new JTextArea(dialogContent.toString()); final JScrollPane scrollPane = new JScrollPane(textArea) {
static void function(final ParserResult parserResult, final JabRefFrame jabRefFrame, final int dataBaseNumber) { Objects.requireNonNull(parserResult); Objects.requireNonNull(jabRefFrame); if (!(parserResult.hasWarnings())) { return; } if (dataBaseNumber >= 0) { jabRefFrame.showBasePanelAt(dataBaseNumber); } final List<String> warnings = parserResult.warnings(); final StringBuilder dialogContent = new StringBuilder(); int warningCount = 1; for (final String warning : warnings) { dialogContent.append(String.format(STR, warningCount++, warning)); } dialogContent.deleteCharAt(dialogContent.length() - 1); String dialogTitle; if (dataBaseNumber < 0) { dialogTitle = Localization.lang(STR); } else { dialogTitle = Localization.lang(STR) + STR + parserResult.getFile().get().getName() + ")"; } final JTextArea textArea = new JTextArea(dialogContent.toString()); final JScrollPane scrollPane = new JScrollPane(textArea) {
/** * Shows a dialog with the warnings from an import or open of a file * * @param parserResult - ParserResult for the current import/open * @param jabRefFrame - the JabRefFrame * @param dataBaseNumber - Database tab number to activate when showing the warning dialog */
Shows a dialog with the warnings from an import or open of a file
showParserResultWarningDialog
{ "repo_name": "shitikanth/jabref", "path": "src/main/java/org/jabref/gui/importer/ParserResultWarningDialog.java", "license": "mit", "size": 3074 }
[ "java.util.List", "java.util.Objects", "javax.swing.JScrollPane", "javax.swing.JTextArea", "org.jabref.gui.JabRefFrame", "org.jabref.logic.importer.ParserResult", "org.jabref.logic.l10n.Localization" ]
import java.util.List; import java.util.Objects; import javax.swing.JScrollPane; import javax.swing.JTextArea; import org.jabref.gui.JabRefFrame; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.l10n.Localization;
import java.util.*; import javax.swing.*; import org.jabref.gui.*; import org.jabref.logic.importer.*; import org.jabref.logic.l10n.*;
[ "java.util", "javax.swing", "org.jabref.gui", "org.jabref.logic" ]
java.util; javax.swing; org.jabref.gui; org.jabref.logic;
1,246,665
EAttribute getServiceReference_RemoteExport();
EAttribute getServiceReference_RemoteExport();
/** * Returns the meta object for the attribute '{@link org.asup.fw.core.QServiceReference#isRemoteExport <em>Remote Export</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Remote Export</em>'. * @see org.asup.fw.core.QServiceReference#isRemoteExport() * @see #getServiceReference() * @generated */
Returns the meta object for the attribute '<code>org.asup.fw.core.QServiceReference#isRemoteExport Remote Export</code>'.
getServiceReference_RemoteExport
{ "repo_name": "asupdev/asup", "path": "org.asup.fw.core/src/org/asup/fw/core/QFrameworkCorePackage.java", "license": "epl-1.0", "size": 58226 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
840,596
protected void setWatermarks(long nextLowWatermark, long nextHighWatermark) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "setWatermarks", new Object[] { new Long(nextLowWatermark), new Long(nextHighWatermark) }); try { setWatermarks(nextLowWatermark, nextHighWatermark, -1, -1); } catch (MessageStoreException e) { // MessageStoreException shouldn't occur so FFDC. FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.store.itemstreams.BaseMessageItemStream.setWatermarks", "1:702:1.24", this); SibTr.exception(tc, e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "setWatermarks"); }
void function(long nextLowWatermark, long nextHighWatermark) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, STR, new Object[] { new Long(nextLowWatermark), new Long(nextHighWatermark) }); try { setWatermarks(nextLowWatermark, nextHighWatermark, -1, -1); } catch (MessageStoreException e) { FFDCFilter.processException( e, STR, STR, this); SibTr.exception(tc, e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, STR); }
/** * Set the MsgStore watermarks so that we get informed the next time the message * depth crosses either of them (510343) * * @param currentDepth * @throws SevereMessageStoreException * @throws NotInMessageStore */
Set the MsgStore watermarks so that we get informed the next time the message depth crosses either of them (510343)
setWatermarks
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/itemstreams/BaseMessageItemStream.java", "license": "epl-1.0", "size": 30744 }
[ "com.ibm.websphere.ras.TraceComponent", "com.ibm.ws.ffdc.FFDCFilter", "com.ibm.ws.sib.msgstore.MessageStoreException", "com.ibm.ws.sib.utils.ras.SibTr" ]
import com.ibm.websphere.ras.TraceComponent; import com.ibm.ws.ffdc.FFDCFilter; import com.ibm.ws.sib.msgstore.MessageStoreException; import com.ibm.ws.sib.utils.ras.SibTr;
import com.ibm.websphere.ras.*; import com.ibm.ws.ffdc.*; import com.ibm.ws.sib.msgstore.*; import com.ibm.ws.sib.utils.ras.*;
[ "com.ibm.websphere", "com.ibm.ws" ]
com.ibm.websphere; com.ibm.ws;
664,664
public void setExceptions(final Collection<String> exceptions) { this.exceptions = new HashSet<String>(exceptions); }
void function(final Collection<String> exceptions) { this.exceptions = new HashSet<String>(exceptions); }
/** * Sets the exceptions from the blacklist. Exceptions can not be patterns. * TODO add support for patterns * @param exceptions */
Sets the exceptions from the blacklist. Exceptions can not be patterns. TODO add support for patterns
setExceptions
{ "repo_name": "vuzzan/openclinic", "path": "src/org/apache/http/impl/cookie/PublicSuffixFilter.java", "license": "apache-2.0", "size": 4615 }
[ "java.util.Collection", "java.util.HashSet" ]
import java.util.Collection; import java.util.HashSet;
import java.util.*;
[ "java.util" ]
java.util;
1,527,236
@Idempotent void removeAcl(String src) throws IOException;
void removeAcl(String src) throws IOException;
/** * Removes all but the base ACL entries of files and directories. The entries * for user, group, and others are retained for compatibility with permission * bits. */
Removes all but the base ACL entries of files and directories. The entries for user, group, and others are retained for compatibility with permission bits
removeAcl
{ "repo_name": "legend-hua/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/ClientProtocol.java", "license": "apache-2.0", "size": 61815 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,345,751
@Exported(inline=true) public Item[] getItems() { Snapshot s = this.snapshot; List<Item> r = new ArrayList<Item>(); for(WaitingItem p : s.waitingList) { r = checkPermissionsAndAddToList(r, p); } for (BlockedItem p : s.blockedProjects){ r = checkPermissionsAndAddToList(r, p); } for (BuildableItem p : reverse(s.buildables)) { r = checkPermissionsAndAddToList(r, p); } for (BuildableItem p : reverse(s.pendings)) { r= checkPermissionsAndAddToList(r, p); } Item[] items = new Item[r.size()]; r.toArray(items); return items; }
@Exported(inline=true) Item[] function() { Snapshot s = this.snapshot; List<Item> r = new ArrayList<Item>(); for(WaitingItem p : s.waitingList) { r = checkPermissionsAndAddToList(r, p); } for (BlockedItem p : s.blockedProjects){ r = checkPermissionsAndAddToList(r, p); } for (BuildableItem p : reverse(s.buildables)) { r = checkPermissionsAndAddToList(r, p); } for (BuildableItem p : reverse(s.pendings)) { r= checkPermissionsAndAddToList(r, p); } Item[] items = new Item[r.size()]; r.toArray(items); return items; }
/** * Gets a snapshot of items in the queue. * * Generally speaking the array is sorted such that the items that are most likely built sooner are * at the end. */
Gets a snapshot of items in the queue. Generally speaking the array is sorted such that the items that are most likely built sooner are at the end
getItems
{ "repo_name": "escoem/jenkins", "path": "core/src/main/java/hudson/model/Queue.java", "license": "mit", "size": 111723 }
[ "hudson.util.Iterators", "java.util.ArrayList", "java.util.List", "org.kohsuke.stapler.export.Exported" ]
import hudson.util.Iterators; import java.util.ArrayList; import java.util.List; import org.kohsuke.stapler.export.Exported;
import hudson.util.*; import java.util.*; import org.kohsuke.stapler.export.*;
[ "hudson.util", "java.util", "org.kohsuke.stapler" ]
hudson.util; java.util; org.kohsuke.stapler;
1,264,194
public Person getPerson(User user);
Person function(User user);
/** * Get a Person * @param user * @return */
Get a Person
getPerson
{ "repo_name": "OpenCollabZA/sakai", "path": "profile2/api/src/java/org/sakaiproject/profile2/logic/ProfileLogic.java", "license": "apache-2.0", "size": 6145 }
[ "org.sakaiproject.profile2.model.Person", "org.sakaiproject.user.api.User" ]
import org.sakaiproject.profile2.model.Person; import org.sakaiproject.user.api.User;
import org.sakaiproject.profile2.model.*; import org.sakaiproject.user.api.*;
[ "org.sakaiproject.profile2", "org.sakaiproject.user" ]
org.sakaiproject.profile2; org.sakaiproject.user;
511,141
@SuppressWarnings("unchecked") public Type to(Endpoint endpoint) { addOutput(new ToDefinition(endpoint)); return (Type) this; }
@SuppressWarnings(STR) Type function(Endpoint endpoint) { addOutput(new ToDefinition(endpoint)); return (Type) this; }
/** * Sends the exchange to the given endpoint * * @param endpoint the endpoint to send to * @return the builder */
Sends the exchange to the given endpoint
to
{ "repo_name": "logzio/camel", "path": "camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java", "license": "apache-2.0", "size": 139893 }
[ "org.apache.camel.Endpoint" ]
import org.apache.camel.Endpoint;
import org.apache.camel.*;
[ "org.apache.camel" ]
org.apache.camel;
841,206
private void processForumFile(File file){ // project_owner,project_name,outside_forum_id,unique_message_id,date,author_email,author_name, // title,body,response_to_message_id,thread_path,message_path logger.info("Processing "+file); try(InputStream in = new FileInputStream(file);) { CsvMapper mapper = new CsvMapper(); CsvSchema schema = mapper.schemaWithHeader().withNullValue("None"); MappingIterator<MailingListComment> it = mapper.readerFor(MailingListComment.class).with(schema).readValues(in); boolean first = true; while (it.hasNextValue()) { MailingListComment currentPost = it.next(); if (first) { converterService.mapForum(currentPost.getProjectOwner(), currentPost.getProjectName(), currentPost.getFullForumName(), true); first = false; } converterService.mapForumPost(currentPost, "GOOGLE_GROUPS"); } }catch(Exception e){ logger.error("Could not parse data file "+file, e); } }
void function(File file){ logger.info(STR+file); try(InputStream in = new FileInputStream(file);) { CsvMapper mapper = new CsvMapper(); CsvSchema schema = mapper.schemaWithHeader().withNullValue("None"); MappingIterator<MailingListComment> it = mapper.readerFor(MailingListComment.class).with(schema).readValues(in); boolean first = true; while (it.hasNextValue()) { MailingListComment currentPost = it.next(); if (first) { converterService.mapForum(currentPost.getProjectOwner(), currentPost.getProjectName(), currentPost.getFullForumName(), true); first = false; } converterService.mapForumPost(currentPost, STR); } }catch(Exception e){ logger.error(STR+file, e); } }
/** * Parses a dataset file, binds its contents to a POJO and passes it on to the DiscourseDB converter * * @param file an dataset file to process */
Parses a dataset file, binds its contents to a POJO and passes it on to the DiscourseDB converter
processForumFile
{ "repo_name": "DiscourseDB/discoursedb-core", "path": "discoursedb-io-github/src/main/java/edu/cmu/cs/lti/discoursedb/github/converter/GithubConverter.java", "license": "gpl-2.0", "size": 27683 }
[ "com.fasterxml.jackson.databind.MappingIterator", "com.fasterxml.jackson.dataformat.csv.CsvMapper", "com.fasterxml.jackson.dataformat.csv.CsvSchema", "edu.cmu.cs.lti.discoursedb.github.model.MailingListComment", "java.io.File", "java.io.FileInputStream", "java.io.InputStream" ]
import com.fasterxml.jackson.databind.MappingIterator; import com.fasterxml.jackson.dataformat.csv.CsvMapper; import com.fasterxml.jackson.dataformat.csv.CsvSchema; import edu.cmu.cs.lti.discoursedb.github.model.MailingListComment; import java.io.File; import java.io.FileInputStream; import java.io.InputStream;
import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.dataformat.csv.*; import edu.cmu.cs.lti.discoursedb.github.model.*; import java.io.*;
[ "com.fasterxml.jackson", "edu.cmu.cs", "java.io" ]
com.fasterxml.jackson; edu.cmu.cs; java.io;
785,964
void addConfig(IpAddress ipAddress, int asNumber);
void addConfig(IpAddress ipAddress, int asNumber);
/** * Adds entry in to local data store. * * @param ipAddress IP address * @param asNumber AS number */
Adds entry in to local data store
addConfig
{ "repo_name": "maheshraju-Huawei/actn", "path": "protocols/pcep/api/src/main/java/org/onosproject/pcep/controller/PcepCfg.java", "license": "apache-2.0", "size": 1929 }
[ "org.onlab.packet.IpAddress" ]
import org.onlab.packet.IpAddress;
import org.onlab.packet.*;
[ "org.onlab.packet" ]
org.onlab.packet;
1,156,028
protected ObjectAdapter targetForDefaultOrChoices(final ObjectAdapter adapter) { return adapter; }
ObjectAdapter function(final ObjectAdapter adapter) { return adapter; }
/** * Hook method; {@link ObjectActionParameterContributee contributed action parameter}s override. */
Hook method; <code>ObjectActionParameterContributee contributed action parameter</code>s override
targetForDefaultOrChoices
{ "repo_name": "incodehq/isis", "path": "core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstract.java", "license": "apache-2.0", "size": 20540 }
[ "org.apache.isis.core.metamodel.adapter.ObjectAdapter" ]
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.adapter.*;
[ "org.apache.isis" ]
org.apache.isis;
45,319
public synchronized void process(FailureContext failureCtx, FailureHandler hnd) { assert failureCtx != null; assert hnd != null; if (this.failureCtx != null) // Node already terminating, no reason to process more errors. return; U.error(ignite.log(), "Critical failure. Will be handled accordingly to configured handler [hnd=" + hnd.getClass() + ", failureCtx=" + failureCtx + ']', failureCtx.error()); boolean invalidated = hnd.onFailure(ignite, failureCtx); if (invalidated) { this.failureCtx = failureCtx; log.error("Ignite node is in invalid state due to a critical failure."); } }
synchronized void function(FailureContext failureCtx, FailureHandler hnd) { assert failureCtx != null; assert hnd != null; if (this.failureCtx != null) return; U.error(ignite.log(), STR + hnd.getClass() + STR + failureCtx + ']', failureCtx.error()); boolean invalidated = hnd.onFailure(ignite, failureCtx); if (invalidated) { this.failureCtx = failureCtx; log.error(STR); } }
/** * Processes failure accordingly to given failure handler. * * @param failureCtx Failure context. * @param hnd Failure handler. */
Processes failure accordingly to given failure handler
process
{ "repo_name": "vladisav/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/failure/FailureProcessor.java", "license": "apache-2.0", "size": 3637 }
[ "org.apache.ignite.failure.FailureContext", "org.apache.ignite.failure.FailureHandler", "org.apache.ignite.internal.util.typedef.internal.U" ]
import org.apache.ignite.failure.FailureContext; import org.apache.ignite.failure.FailureHandler; import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.failure.*; import org.apache.ignite.internal.util.typedef.internal.*;
[ "org.apache.ignite" ]
org.apache.ignite;
1,101,739
public void presenceUpdated(UpdatePresence updatePresence) { MUCRole occupantRole = occupants.get(updatePresence.getNickname().toLowerCase()); if (occupantRole != null) { occupantRole.setPresence(updatePresence.getPresence()); } else { Log.debug("LocalMUCRoom: Failed to update presence of room occupant. Occupant nickname: " + updatePresence.getNickname()); } }
void function(UpdatePresence updatePresence) { MUCRole occupantRole = occupants.get(updatePresence.getNickname().toLowerCase()); if (occupantRole != null) { occupantRole.setPresence(updatePresence.getPresence()); } else { Log.debug(STR + updatePresence.getNickname()); } }
/** * Updates the presence of an occupant with the new presence included in the request. * * @param updatePresence request to update an occupant's presence. */
Updates the presence of an occupant with the new presence included in the request
presenceUpdated
{ "repo_name": "derek-wang/ca.rides.openfire", "path": "src/java/org/jivesoftware/openfire/muc/spi/LocalMUCRoom.java", "license": "apache-2.0", "size": 100500 }
[ "org.jivesoftware.openfire.muc.MUCRole", "org.jivesoftware.openfire.muc.cluster.UpdatePresence" ]
import org.jivesoftware.openfire.muc.MUCRole; import org.jivesoftware.openfire.muc.cluster.UpdatePresence;
import org.jivesoftware.openfire.muc.*; import org.jivesoftware.openfire.muc.cluster.*;
[ "org.jivesoftware.openfire" ]
org.jivesoftware.openfire;
1,727,358
void commit() { blockUCState = BlockUCState.COMMITTED; }
void commit() { blockUCState = BlockUCState.COMMITTED; }
/** * Set {@link #blockUCState} to {@link BlockUCState#COMMITTED}. */
Set <code>#blockUCState</code> to <code>BlockUCState#COMMITTED</code>
commit
{ "repo_name": "aliyun-beta/aliyun-oss-hadoop-fs", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockUnderConstructionFeature.java", "license": "apache-2.0", "size": 9613 }
[ "org.apache.hadoop.hdfs.server.common.HdfsServerConstants" ]
import org.apache.hadoop.hdfs.server.common.HdfsServerConstants;
import org.apache.hadoop.hdfs.server.common.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,110,917
@RequestMapping(value = "/login", method = {RequestMethod.GET, RequestMethod.HEAD}) public String login(HttpServletRequest request, HttpServletResponse response) { setLdapStatus(request, false); response.addCookie(new Cookie("CONTEXTPATH", getServletContext().getContextPath())); final String s = "loginPage"; if (SecurityUtils.getSubject().isAuthenticated()) { return "redirect:/dashboard"; } return s; }
@RequestMapping(value = STR, method = {RequestMethod.GET, RequestMethod.HEAD}) String function(HttpServletRequest request, HttpServletResponse response) { setLdapStatus(request, false); response.addCookie(new Cookie(STR, getServletContext().getContextPath())); final String s = STR; if (SecurityUtils.getSubject().isAuthenticated()) { return STR; } return s; }
/** * Login action. * * @param request a HttpServletRequest object * @param response a HttpServletResponse object * @return a String */
Login action
login
{ "repo_name": "wjase/dependency-track", "path": "src/main/java/org/owasp/dependencytrack/controller/LoginController.java", "license": "gpl-3.0", "size": 4760 }
[ "javax.servlet.http.Cookie", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.apache.shiro.SecurityUtils", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestMethod" ]
import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.shiro.SecurityUtils; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.http.*; import org.apache.shiro.*; import org.springframework.web.bind.annotation.*;
[ "javax.servlet", "org.apache.shiro", "org.springframework.web" ]
javax.servlet; org.apache.shiro; org.springframework.web;
2,085,972
@SuppressWarnings("unchecked") @Test public void testFilterSingleFieldMisses() { pathParams.add("companyid", COMPANY_NAME); queryParams.add("$filter", "id eq 1112"); try { InteractionCommand.Result result = command.execute(ctx, entity1SolrServer); assertEquals(Result.SUCCESS, result); } catch (InteractionException e) { fail("InteractionException : " + e.getHttpStatus().toString() + " - " + e.getMessage()); } CollectionResource<Entity> cr = (CollectionResource<Entity>) ctx.getResource(); assertEquals(0, cr.getEntities().size()); }
@SuppressWarnings(STR) void function() { pathParams.add(STR, COMPANY_NAME); queryParams.add(STR, STR); try { InteractionCommand.Result result = command.execute(ctx, entity1SolrServer); assertEquals(Result.SUCCESS, result); } catch (InteractionException e) { fail(STR + e.getHttpStatus().toString() + STR + e.getMessage()); } CollectionResource<Entity> cr = (CollectionResource<Entity>) ctx.getResource(); assertEquals(0, cr.getEntities().size()); }
/** * Test for filtering on a single field with near miss. i.e term is close * but not exact. Since filtering is used in security, unlike the 'q=' * option only exact hits should be returned. */
Test for filtering on a single field with near miss. i.e term is close but not exact. Since filtering is used in security, unlike the 'q=' option only exact hits should be returned
testFilterSingleFieldMisses
{ "repo_name": "aphethean/IRIS", "path": "interaction-commands-solr/src/test/java/com/temenos/interaction/commands/solr/SolrSearchCommandFilterTest.java", "license": "agpl-3.0", "size": 11767 }
[ "com.temenos.interaction.core.command.InteractionCommand", "com.temenos.interaction.core.command.InteractionException", "com.temenos.interaction.core.entity.Entity", "com.temenos.interaction.core.resource.CollectionResource", "org.junit.Assert" ]
import com.temenos.interaction.core.command.InteractionCommand; import com.temenos.interaction.core.command.InteractionException; import com.temenos.interaction.core.entity.Entity; import com.temenos.interaction.core.resource.CollectionResource; import org.junit.Assert;
import com.temenos.interaction.core.command.*; import com.temenos.interaction.core.entity.*; import com.temenos.interaction.core.resource.*; import org.junit.*;
[ "com.temenos.interaction", "org.junit" ]
com.temenos.interaction; org.junit;
2,812,669
public void addAttribute(String name, String value) { List values = (List)attributes.get(name); if (values == null) { values = new ArrayList(); attributes.put(name, values); } values.add(value); }
void function(String name, String value) { List values = (List)attributes.get(name); if (values == null) { values = new ArrayList(); attributes.put(name, values); } values.add(value); }
/** * Adds an attribute to the item. * * @param name name of attribute. * @param value value. */
Adds an attribute to the item
addAttribute
{ "repo_name": "pitosalas/blogbridge", "path": "src/com/salas/bb/utils/amazon/AmazonItem.java", "license": "gpl-2.0", "size": 6192 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
353,039
public final static <A, B> List<Tuple<A, B>> zip(final Collection<A> collA, final Collection<B> collB) { final int todo = Math.min(collA.size(), collB.size()); final List<Tuple<A, B>> ret = list(todo); final Iterator<A> a = collA.iterator(); final Iterator<B> b = collB.iterator(); for (int i = 0; i < todo; i++) { ret.add(Tuple.of(a.next(), b.next())); } return ret; }
final static <A, B> List<Tuple<A, B>> function(final Collection<A> collA, final Collection<B> collB) { final int todo = Math.min(collA.size(), collB.size()); final List<Tuple<A, B>> ret = list(todo); final Iterator<A> a = collA.iterator(); final Iterator<B> b = collB.iterator(); for (int i = 0; i < todo; i++) { ret.add(Tuple.of(a.next(), b.next())); } return ret; }
/** * Zips the two given collections into a list of tuples. * * @param collA * First collection. * @param collB * Second collection. * @return The list of tuples. * @see Tuple */
Zips the two given collections into a list of tuples
zip
{ "repo_name": "rjeschke/neetutils-base", "path": "src/main/java/com/github/rjeschke/neetutils/collections/Colls.java", "license": "apache-2.0", "size": 28113 }
[ "java.util.Collection", "java.util.Iterator", "java.util.List" ]
import java.util.Collection; import java.util.Iterator; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,943,165
public void deallocatePathResources(PathId pathId, long unmaskedCookie, FlowEncapsulationType encapsulationType) { log.debug("Deallocate flow resources for path {}, cookie: {}.", pathId, unmaskedCookie); transactionManager.doInTransaction(() -> { cookiePool.deallocate(unmaskedCookie); meterPool.deallocate(pathId); EncapsulationResourcesProvider encapsulationResourcesProvider = getEncapsulationResourcesProvider(encapsulationType); encapsulationResourcesProvider.deallocate(pathId); }); }
void function(PathId pathId, long unmaskedCookie, FlowEncapsulationType encapsulationType) { log.debug(STR, pathId, unmaskedCookie); transactionManager.doInTransaction(() -> { cookiePool.deallocate(unmaskedCookie); meterPool.deallocate(pathId); EncapsulationResourcesProvider encapsulationResourcesProvider = getEncapsulationResourcesProvider(encapsulationType); encapsulationResourcesProvider.deallocate(pathId); }); }
/** * Deallocate the flow path resources. * <p/> * Shared resources are to be deallocated with no usage checks. */
Deallocate the flow path resources. Shared resources are to be deallocated with no usage checks
deallocatePathResources
{ "repo_name": "telstra/open-kilda", "path": "src-java/base-topology/base-storm-topology/src/main/java/org/openkilda/wfm/share/flow/resources/FlowResourcesManager.java", "license": "apache-2.0", "size": 11354 }
[ "org.openkilda.model.FlowEncapsulationType", "org.openkilda.model.PathId" ]
import org.openkilda.model.FlowEncapsulationType; import org.openkilda.model.PathId;
import org.openkilda.model.*;
[ "org.openkilda.model" ]
org.openkilda.model;
2,295,098
@SuppressWarnings("RedundantTypeArguments") private void recordEvent(int type, long topVer, ClusterNode node, Collection<ClusterNode> topSnapshot) { assert node != null; if (ctx.event().isRecordable(type)) { DiscoveryEvent evt = new DiscoveryEvent(); evt.node(ctx.discovery().localNode()); evt.eventNode(node); evt.type(type); evt.topologySnapshot(topVer, U.<ClusterNode, ClusterNode>arrayList(topSnapshot, FILTER_DAEMON)); if (type == EVT_NODE_METRICS_UPDATED) evt.message("Metrics were updated: " + node); else if (type == EVT_NODE_JOINED) evt.message("Node joined: " + node); else if (type == EVT_NODE_LEFT) evt.message("Node left: " + node); else if (type == EVT_NODE_FAILED) evt.message("Node failed: " + node); else if (type == EVT_NODE_SEGMENTED) evt.message("Node segmented: " + node); else if (type == EVT_CLIENT_NODE_DISCONNECTED) evt.message("Client node disconnected: " + node); else if (type == EVT_CLIENT_NODE_RECONNECTED) evt.message("Client node reconnected: " + node); else assert false; ctx.event().record(evt); } }
@SuppressWarnings(STR) void function(int type, long topVer, ClusterNode node, Collection<ClusterNode> topSnapshot) { assert node != null; if (ctx.event().isRecordable(type)) { DiscoveryEvent evt = new DiscoveryEvent(); evt.node(ctx.discovery().localNode()); evt.eventNode(node); evt.type(type); evt.topologySnapshot(topVer, U.<ClusterNode, ClusterNode>arrayList(topSnapshot, FILTER_DAEMON)); if (type == EVT_NODE_METRICS_UPDATED) evt.message(STR + node); else if (type == EVT_NODE_JOINED) evt.message(STR + node); else if (type == EVT_NODE_LEFT) evt.message(STR + node); else if (type == EVT_NODE_FAILED) evt.message(STR + node); else if (type == EVT_NODE_SEGMENTED) evt.message(STR + node); else if (type == EVT_CLIENT_NODE_DISCONNECTED) evt.message(STR + node); else if (type == EVT_CLIENT_NODE_RECONNECTED) evt.message(STR + node); else assert false; ctx.event().record(evt); } }
/** * Method is called when any discovery event occurs. * * @param type Discovery event type. See {@link DiscoveryEvent} for more details. * @param topVer Topology version. * @param node Remote node this event is connected with. * @param topSnapshot Topology snapshot. */
Method is called when any discovery event occurs
recordEvent
{ "repo_name": "ryanzz/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java", "license": "apache-2.0", "size": 107855 }
[ "java.util.Collection", "org.apache.ignite.cluster.ClusterNode", "org.apache.ignite.events.DiscoveryEvent" ]
import java.util.Collection; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.events.DiscoveryEvent;
import java.util.*; import org.apache.ignite.cluster.*; import org.apache.ignite.events.*;
[ "java.util", "org.apache.ignite" ]
java.util; org.apache.ignite;
2,004,783
@ServiceMethod(returns = ReturnType.SINGLE) private Mono<Response<Flux<ByteBuffer>>> reimageWithResponseAsync( String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (roleInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (cloudServiceName == null) { return Mono .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2021-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .reimage( this.client.getEndpoint(), roleInstanceName, resourceGroupName, cloudServiceName, this.client.getSubscriptionId(), apiVersion, accept, context); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<Flux<ByteBuffer>>> function( String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (roleInstanceName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (cloudServiceName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String apiVersion = STR; final String accept = STR; context = this.client.mergeContext(context); return service .reimage( this.client.getEndpoint(), roleInstanceName, resourceGroupName, cloudServiceName, this.client.getSubscriptionId(), apiVersion, accept, context); }
/** * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or * worker roles. * * @param roleInstanceName Name of the role instance. * @param resourceGroupName The resourceGroupName parameter. * @param cloudServiceName The cloudServiceName parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */
The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles
reimageWithResponseAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/CloudServiceRoleInstancesClientImpl.java", "license": "mit", "size": 109969 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.Context", "java.nio.ByteBuffer" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import java.nio.ByteBuffer;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import java.nio.*;
[ "com.azure.core", "java.nio" ]
com.azure.core; java.nio;
430,137
public static String unescape(String original) { Matcher mm = escaped.matcher(original); StringBuffer unescaped = new StringBuffer(); while (mm.find()) { mm.appendReplacement(unescaped, Character.toString( (char) Integer.parseInt(mm.group(1), 10))); } mm.appendTail(unescaped); return unescaped.toString(); }
static String function(String original) { Matcher mm = escaped.matcher(original); StringBuffer unescaped = new StringBuffer(); while (mm.find()) { mm.appendReplacement(unescaped, Character.toString( (char) Integer.parseInt(mm.group(1), 10))); } mm.appendTail(unescaped); return unescaped.toString(); }
/** * Unescape UTF-8 escaped characters to string. * @author pengjianq...@gmail.com * * @param original The string to be unescaped. * @return The unescaped string */
Unescape UTF-8 escaped characters to string
unescape
{ "repo_name": "jaguar-zc/icooding", "path": "icooding-cms/icooding-weibo/src/main/java/com/icooding/weibo/http/Response.java", "license": "apache-2.0", "size": 9986 }
[ "java.util.regex.Matcher" ]
import java.util.regex.Matcher;
import java.util.regex.*;
[ "java.util" ]
java.util;
1,335,360
public void testUpdateBlobFromForwardOnlyResultSetWithProjectUsingResultSetMethods() throws SQLException, IOException { final Statement stmt = createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); final ResultSet rs = stmt.executeQuery("SELECT data,val,length from " + BLOBDataModelSetup.getBlobTableName()); while (rs.next()) { println("Next"); final int val = rs.getInt("VAL"); if (val == BLOBDataModelSetup.bigVal) break; } final int newVal = rs.getInt("VAL") + 11; final int newSize = BLOBDataModelSetup.bigSize / 2; testUpdateBlobWithResultSetMethods(rs, newVal, newSize); rs.close(); stmt.close(); }
void function() throws SQLException, IOException { final Statement stmt = createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); final ResultSet rs = stmt.executeQuery(STR + BLOBDataModelSetup.getBlobTableName()); while (rs.next()) { println("Next"); final int val = rs.getInt("VAL"); if (val == BLOBDataModelSetup.bigVal) break; } final int newVal = rs.getInt("VAL") + 11; final int newSize = BLOBDataModelSetup.bigSize / 2; testUpdateBlobWithResultSetMethods(rs, newVal, newSize); rs.close(); stmt.close(); }
/** * Tests updating a Blob from a forward only resultset, produced by * a select query with projection. Updates are made using * result set update methods. * @exception SQLException causes test to fail with error * @exception IOException causes test to fail with error */
Tests updating a Blob from a forward only resultset, produced by a select query with projection. Updates are made using result set update methods
testUpdateBlobFromForwardOnlyResultSetWithProjectUsingResultSetMethods
{ "repo_name": "papicella/snappy-store", "path": "gemfirexd/tools/src/testing/java/org/apache/derbyTesting/functionTests/tests/jdbcapi/BLOBTest.java", "license": "apache-2.0", "size": 16479 }
[ "java.io.IOException", "java.sql.ResultSet", "java.sql.SQLException", "java.sql.Statement" ]
import java.io.IOException; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement;
import java.io.*; import java.sql.*;
[ "java.io", "java.sql" ]
java.io; java.sql;
151,747
public void save(OutputStream output) throws IOException { ObjectOutputStream stream = new ObjectOutputStream(output); stream.writeObject(registration); stream.flush(); }
void function(OutputStream output) throws IOException { ObjectOutputStream stream = new ObjectOutputStream(output); stream.writeObject(registration); stream.flush(); }
/** * Saves the registration into a stream. * * @param output * the {@link OutputStream} file. * * @throws IOException * if there was an error saving the file. * * @since 1.1 */
Saves the registration into a stream
save
{ "repo_name": "devent/registration", "path": "registration-core/src/main/java/com/anrisoftware/registration/data/RegisterKey.java", "license": "gpl-3.0", "size": 4192 }
[ "java.io.IOException", "java.io.ObjectOutputStream", "java.io.OutputStream" ]
import java.io.IOException; import java.io.ObjectOutputStream; import java.io.OutputStream;
import java.io.*;
[ "java.io" ]
java.io;
181,436
return new PkgCMRestoreTestSuite(); } public PkgCMRestoreTestSuite() { String testCaseName=System.getProperty("TestCaseName"); Method m; //Note only one try block from all block will be successfull try { m = getTestMethod(PkgCMRestoreCreateTest.class,testCaseName); if(m!=null)// testcase exists addTest(new PkgCMRestoreCreateTest(testCaseName)); } catch (Exception e) { e.printStackTrace(); } try { m = getTestMethod(PkgCMRestoreModifyContentsTest.class,testCaseName); if(m!=null)// testcase exists addTest(new PkgCMRestoreModifyContentsTest(testCaseName)); } catch (Exception e) { e.printStackTrace(); } try { m = getTestMethod(PkgCMRestoreModifyRelationTest.class,testCaseName); if(m!=null)// testcase exists addTest(new PkgCMRestoreModifyRelationTest(testCaseName)); } catch (Exception e) { e.printStackTrace(); } try { m = getTestMethod(PkgCMRestoreRenameTest.class,testCaseName); if(m!=null)// testcase exists addTest(new PkgCMRestoreRenameTest(testCaseName)); } catch (Exception e) { e.printStackTrace(); } try { m = getTestMethod(PkgCMRestoreDeleteTest.class,testCaseName); if(m!=null)// testcase exists addTest(new PkgCMRestoreDeleteTest(testCaseName)); } catch (Exception e) { e.printStackTrace(); } }
return new PkgCMRestoreTestSuite(); } public PkgCMRestoreTestSuite() { String testCaseName=System.getProperty(STR); Method m; try { m = getTestMethod(PkgCMRestoreCreateTest.class,testCaseName); if(m!=null) addTest(new PkgCMRestoreCreateTest(testCaseName)); } catch (Exception e) { e.printStackTrace(); } try { m = getTestMethod(PkgCMRestoreModifyContentsTest.class,testCaseName); if(m!=null) addTest(new PkgCMRestoreModifyContentsTest(testCaseName)); } catch (Exception e) { e.printStackTrace(); } try { m = getTestMethod(PkgCMRestoreModifyRelationTest.class,testCaseName); if(m!=null) addTest(new PkgCMRestoreModifyRelationTest(testCaseName)); } catch (Exception e) { e.printStackTrace(); } try { m = getTestMethod(PkgCMRestoreRenameTest.class,testCaseName); if(m!=null) addTest(new PkgCMRestoreRenameTest(testCaseName)); } catch (Exception e) { e.printStackTrace(); } try { m = getTestMethod(PkgCMRestoreDeleteTest.class,testCaseName); if(m!=null) addTest(new PkgCMRestoreDeleteTest(testCaseName)); } catch (Exception e) { e.printStackTrace(); } }
/** * Returns the suite. This is required to * use the JUnit Launcher. */
Returns the suite. This is required to use the JUnit Launcher
suite
{ "repo_name": "kirisma/bridgepoint", "path": "src/org.xtuml.bp.io.mdl.test/src/org/xtuml/bp/io/mdl/test/pkgcm/restore/PkgCMRestoreTestSuite.java", "license": "apache-2.0", "size": 3692 }
[ "java.lang.reflect.Method" ]
import java.lang.reflect.Method;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
2,398,815
public void addAndRemoveEventListenerTypedNullType() throws Exception { // Create a listener that just adds the events to a list TestFlowableEventListener newListener = new TestFlowableEventListener(); // Add event-listener to dispatcher dispatcher.addEventListener(newListener, (FlowableEngineEventType) null); ActivitiEntityEventImpl event1 = new ActivitiEntityEventImpl(new TaskEntity(), FlowableEngineEventType.ENTITY_CREATED); ActivitiEntityEventImpl event2 = new ActivitiEntityEventImpl(new TaskEntity(), FlowableEngineEventType.ENTITY_DELETED); // Dispatch events, all should have entered the listener dispatcher.dispatchEvent(event1); dispatcher.dispatchEvent(event2); assertTrue(newListener.getEventsReceived().isEmpty()); }
void function() throws Exception { TestFlowableEventListener newListener = new TestFlowableEventListener(); dispatcher.addEventListener(newListener, (FlowableEngineEventType) null); ActivitiEntityEventImpl event1 = new ActivitiEntityEventImpl(new TaskEntity(), FlowableEngineEventType.ENTITY_CREATED); ActivitiEntityEventImpl event2 = new ActivitiEntityEventImpl(new TaskEntity(), FlowableEngineEventType.ENTITY_DELETED); dispatcher.dispatchEvent(event1); dispatcher.dispatchEvent(event2); assertTrue(newListener.getEventsReceived().isEmpty()); }
/** * Test that adding a listener with a null-type is never called. */
Test that adding a listener with a null-type is never called
addAndRemoveEventListenerTypedNullType
{ "repo_name": "lsmall/flowable-engine", "path": "modules/flowable5-test/src/test/java/org/activiti/engine/test/api/event/FlowableEventDispatcherTest.java", "license": "apache-2.0", "size": 12212 }
[ "org.activiti.engine.delegate.event.impl.ActivitiEntityEventImpl", "org.activiti.engine.impl.persistence.entity.TaskEntity", "org.flowable.common.engine.api.delegate.event.FlowableEngineEventType" ]
import org.activiti.engine.delegate.event.impl.ActivitiEntityEventImpl; import org.activiti.engine.impl.persistence.entity.TaskEntity; import org.flowable.common.engine.api.delegate.event.FlowableEngineEventType;
import org.activiti.engine.delegate.event.impl.*; import org.activiti.engine.impl.persistence.entity.*; import org.flowable.common.engine.api.delegate.event.*;
[ "org.activiti.engine", "org.flowable.common" ]
org.activiti.engine; org.flowable.common;
1,393,682
private static void execute(final Method method, final Object targetObject, final Object[] targetArguments, Principal principal) throws java.lang.Exception{
static void function(final Method method, final Object targetObject, final Object[] targetArguments, Principal principal) throws java.lang.Exception{
/** * Perform work as a particular </code>Subject</code>. Here the work * will be granted to a <code>null</code> subject. * * @param methodName the method to apply the security restriction * @param targetObject the <code>Servlet</code> on which the method will * be called. * @param targetArguments <code>Object</code> array contains the * runtime parameters instance. * @param principal the <code>Principal</code> to which the security * privilege applies */
Perform work as a particular </code>Subject</code>. Here the work will be granted to a <code>null</code> subject
execute
{ "repo_name": "plumer/codana", "path": "tomcat_files/7.0.61/SecurityUtil.java", "license": "mit", "size": 16427 }
[ "java.lang.reflect.Method", "java.security.Principal" ]
import java.lang.reflect.Method; import java.security.Principal;
import java.lang.reflect.*; import java.security.*;
[ "java.lang", "java.security" ]
java.lang; java.security;
194,188
List<List<String>> getFieldOrigins();
List<List<String>> getFieldOrigins();
/** * Returns a list describing, for each result field, the origin of the * field as a 4-element list of (database, schema, table, column). */
Returns a list describing, for each result field, the origin of the field as a 4-element list of (database, schema, table, column)
getFieldOrigins
{ "repo_name": "yeongwei/incubator-calcite", "path": "core/src/main/java/org/apache/calcite/prepare/Prepare.java", "license": "apache-2.0", "size": 20156 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
141,552
public static Object castPigTypeToPhoenix(Object o, byte objectType, PDataType targetPhoenixType) { PDataType inferredPType = getType(o, objectType); if(inferredPType == null) { return null; } if(inferredPType == PDataType.VARBINARY && targetPhoenixType != PDataType.VARBINARY) { try { o = castBytes(o, targetPhoenixType); inferredPType = getType(o, DataType.findType(o)); } catch (IOException e) { throw new RuntimeException("Error while casting bytes for object " +o); } } if(inferredPType == PDataType.DATE) { int inferredSqlType = targetPhoenixType.getSqlType(); if(inferredSqlType == Types.DATE) { return new Date(((DateTime)o).getMillis()); } if(inferredSqlType == Types.TIME) { return new Time(((DateTime)o).getMillis()); } if(inferredSqlType == Types.TIMESTAMP) { return new Timestamp(((DateTime)o).getMillis()); } } if (targetPhoenixType == inferredPType || inferredPType.isCoercibleTo(targetPhoenixType)) { return inferredPType.toObject(o, targetPhoenixType); } throw new RuntimeException(o.getClass().getName() + " cannot be coerced to "+targetPhoenixType.toString()); }
static Object function(Object o, byte objectType, PDataType targetPhoenixType) { PDataType inferredPType = getType(o, objectType); if(inferredPType == null) { return null; } if(inferredPType == PDataType.VARBINARY && targetPhoenixType != PDataType.VARBINARY) { try { o = castBytes(o, targetPhoenixType); inferredPType = getType(o, DataType.findType(o)); } catch (IOException e) { throw new RuntimeException(STR +o); } } if(inferredPType == PDataType.DATE) { int inferredSqlType = targetPhoenixType.getSqlType(); if(inferredSqlType == Types.DATE) { return new Date(((DateTime)o).getMillis()); } if(inferredSqlType == Types.TIME) { return new Time(((DateTime)o).getMillis()); } if(inferredSqlType == Types.TIMESTAMP) { return new Timestamp(((DateTime)o).getMillis()); } } if (targetPhoenixType == inferredPType inferredPType.isCoercibleTo(targetPhoenixType)) { return inferredPType.toObject(o, targetPhoenixType); } throw new RuntimeException(o.getClass().getName() + STR+targetPhoenixType.toString()); }
/** * This method encodes a value with Phoenix data type. It begins * with checking whether an object is BINARY and makes a call to * {@link #castBytes(Object, PDataType)} to convery bytes to * targetPhoenixType * * @param o * @param targetPhoenixType * @return Object */
This method encodes a value with Phoenix data type. It begins with checking whether an object is BINARY and makes a call to <code>#castBytes(Object, PDataType)</code> to convery bytes to targetPhoenixType
castPigTypeToPhoenix
{ "repo_name": "jffnothing/phoenix-4.0.0-incubating", "path": "phoenix-pig/src/main/java/org/apache/phoenix/pig/TypeUtil.java", "license": "apache-2.0", "size": 5555 }
[ "java.io.IOException", "java.sql.Date", "java.sql.Time", "java.sql.Timestamp", "java.sql.Types", "org.apache.phoenix.schema.PDataType", "org.apache.pig.data.DataType", "org.joda.time.DateTime" ]
import java.io.IOException; import java.sql.Date; import java.sql.Time; import java.sql.Timestamp; import java.sql.Types; import org.apache.phoenix.schema.PDataType; import org.apache.pig.data.DataType; import org.joda.time.DateTime;
import java.io.*; import java.sql.*; import org.apache.phoenix.schema.*; import org.apache.pig.data.*; import org.joda.time.*;
[ "java.io", "java.sql", "org.apache.phoenix", "org.apache.pig", "org.joda.time" ]
java.io; java.sql; org.apache.phoenix; org.apache.pig; org.joda.time;
2,455,986
HibernateCallback hc = new HibernateCallback() {
HibernateCallback hc = new HibernateCallback() {
/** * Needed to get course offering eid in the output for an enrollment set. */
Needed to get course offering eid in the output for an enrollment set
getEnrollmentSetByEid
{ "repo_name": "ouit0408/sakai", "path": "cmprovider/src/java/org/sakaiproject/cmprovider/CmProviderHibernateService.java", "license": "apache-2.0", "size": 1565 }
[ "org.springframework.orm.hibernate3.HibernateCallback" ]
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.*;
[ "org.springframework.orm" ]
org.springframework.orm;
1,112,565
public void setBooleanAttribute(String name, Boolean value) { ensureAttributes(); Attribute attribute = new BooleanAttribute(value); attribute.setEditable(isEditable(name)); getAllAttributes().put(name, attribute); }
void function(String name, Boolean value) { ensureAttributes(); Attribute attribute = new BooleanAttribute(value); attribute.setEditable(isEditable(name)); getAllAttributes().put(name, attribute); }
/** * Sets the specified boolean attribute to the specified value. * * @param name name of the attribute * @param value value of the attribute * @since 1.9.0 */
Sets the specified boolean attribute to the specified value
setBooleanAttribute
{ "repo_name": "olivermay/geomajas", "path": "backend/api/src/main/java/org/geomajas/layer/feature/attribute/AssociationValue.java", "license": "agpl-3.0", "size": 12219 }
[ "org.geomajas.layer.feature.Attribute" ]
import org.geomajas.layer.feature.Attribute;
import org.geomajas.layer.feature.*;
[ "org.geomajas.layer" ]
org.geomajas.layer;
431,905
@Override public ILazyDataset next() { SliceND current = iterator.getCurrentSlice().clone(); ILazyDataset view; try { view = lazy.getSlice(current); } catch (DatasetException e) { logger.error("Could not get data from lazy dataset", e); return null; } view.clearMetadata(SliceFromSeriesMetadata.class); int count = iterator.getCount(); SliceInformation sl = new SliceInformation(current, current.clone(), new SliceND(lazy.getShape()), axes, last ? count : -1, count); SliceFromSeriesMetadata m = new SliceFromSeriesMetadata(source, sl); view.setMetadata(m); next = iterator.hasNext(); return view; }
ILazyDataset function() { SliceND current = iterator.getCurrentSlice().clone(); ILazyDataset view; try { view = lazy.getSlice(current); } catch (DatasetException e) { logger.error(STR, e); return null; } view.clearMetadata(SliceFromSeriesMetadata.class); int count = iterator.getCount(); SliceInformation sl = new SliceInformation(current, current.clone(), new SliceND(lazy.getShape()), axes, last ? count : -1, count); SliceFromSeriesMetadata m = new SliceFromSeriesMetadata(source, sl); view.setMetadata(m); next = iterator.hasNext(); return view; }
/** * Get the current view on the ILazyDataset * * @return lazyDataset */
Get the current view on the ILazyDataset
next
{ "repo_name": "belkassaby/dawnsci", "path": "org.eclipse.dawnsci.analysis.dataset/src/org/eclipse/dawnsci/analysis/dataset/slicer/DynamicSliceViewIterator.java", "license": "epl-1.0", "size": 5972 }
[ "org.eclipse.january.DatasetException", "org.eclipse.january.dataset.ILazyDataset", "org.eclipse.january.dataset.SliceND" ]
import org.eclipse.january.DatasetException; import org.eclipse.january.dataset.ILazyDataset; import org.eclipse.january.dataset.SliceND;
import org.eclipse.january.*; import org.eclipse.january.dataset.*;
[ "org.eclipse.january" ]
org.eclipse.january;
1,885,232
private void waitOnAllRegionsToClose(final boolean abort) { // Wait till all regions are closed before going out. int lastCount = -1; long previousLogTime = 0; Set<String> closedRegions = new HashSet<String>(); while (!isOnlineRegionsEmpty()) { int count = getNumberOfOnlineRegions(); // Only print a message if the count of regions has changed. if (count != lastCount) { // Log every second at most if (System.currentTimeMillis() > (previousLogTime + 1000)) { previousLogTime = System.currentTimeMillis(); lastCount = count; LOG.info("Waiting on " + count + " regions to close"); // Only print out regions still closing if a small number else will // swamp the log. if (count < 10 && LOG.isDebugEnabled()) { LOG.debug(this.onlineRegions); } } } // Ensure all user regions have been sent a close. Use this to // protect against the case where an open comes in after we start the // iterator of onlineRegions to close all user regions. for (Map.Entry<String, HRegion> e : this.onlineRegions.entrySet()) { HRegionInfo hri = e.getValue().getRegionInfo(); if (!this.regionsInTransitionInRS.containsKey(hri.getEncodedNameAsBytes()) && !closedRegions.contains(hri.getEncodedName())) { closedRegions.add(hri.getEncodedName()); // Don't update zk with this close transition; pass false. closeRegion(hri, abort, false); } } // No regions in RIT, we could stop waiting now. if (this.regionsInTransitionInRS.isEmpty()) { if (!isOnlineRegionsEmpty()) { LOG.info("We were exiting though online regions are not empty, because some regions failed closing"); } break; } Threads.sleep(200); } }
void function(final boolean abort) { int lastCount = -1; long previousLogTime = 0; Set<String> closedRegions = new HashSet<String>(); while (!isOnlineRegionsEmpty()) { int count = getNumberOfOnlineRegions(); if (count != lastCount) { if (System.currentTimeMillis() > (previousLogTime + 1000)) { previousLogTime = System.currentTimeMillis(); lastCount = count; LOG.info(STR + count + STR); if (count < 10 && LOG.isDebugEnabled()) { LOG.debug(this.onlineRegions); } } } for (Map.Entry<String, HRegion> e : this.onlineRegions.entrySet()) { HRegionInfo hri = e.getValue().getRegionInfo(); if (!this.regionsInTransitionInRS.containsKey(hri.getEncodedNameAsBytes()) && !closedRegions.contains(hri.getEncodedName())) { closedRegions.add(hri.getEncodedName()); closeRegion(hri, abort, false); } } if (this.regionsInTransitionInRS.isEmpty()) { if (!isOnlineRegionsEmpty()) { LOG.info(STR); } break; } Threads.sleep(200); } }
/** * Wait on regions close. */
Wait on regions close
waitOnAllRegionsToClose
{ "repo_name": "indi60/hbase-pmc", "path": "target/hbase-0.94.1/hbase-0.94.1/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java", "license": "apache-2.0", "size": 131335 }
[ "java.util.HashSet", "java.util.Map", "java.util.Set", "org.apache.hadoop.hbase.HRegionInfo", "org.apache.hadoop.hbase.util.Threads" ]
import java.util.HashSet; import java.util.Map; import java.util.Set; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.util.Threads;
import java.util.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.util.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
2,388,922
Future<BlobKey> requestTaskManagerLog(final Time timeout);
Future<BlobKey> requestTaskManagerLog(final Time timeout);
/** * Request the task manager log from the task manager. * * @param timeout for the request * @return Future blob key under which the task manager log has been stored */
Request the task manager log from the task manager
requestTaskManagerLog
{ "repo_name": "hongyuhong/flink", "path": "flink-runtime/src/main/java/org/apache/flink/runtime/jobmanager/slots/TaskManagerGateway.java", "license": "apache-2.0", "size": 6127 }
[ "org.apache.flink.api.common.time.Time", "org.apache.flink.runtime.blob.BlobKey", "org.apache.flink.runtime.concurrent.Future" ]
import org.apache.flink.api.common.time.Time; import org.apache.flink.runtime.blob.BlobKey; import org.apache.flink.runtime.concurrent.Future;
import org.apache.flink.api.common.time.*; import org.apache.flink.runtime.blob.*; import org.apache.flink.runtime.concurrent.*;
[ "org.apache.flink" ]
org.apache.flink;
1,076,538
public Collection<WorldGeneratorModifier> toModifiers(Collection<String> ids) { List<WorldGeneratorModifier> modifiers = Lists.newArrayList(); for (String id : ids) { WorldGeneratorModifier modifier = this.modifiers.get(id); if (modifier != null) { modifiers.add(modifier); } else { logger.error("World generator modifier with id " + id + " not found. Missing plugin?"); } } return modifiers; }
Collection<WorldGeneratorModifier> function(Collection<String> ids) { List<WorldGeneratorModifier> modifiers = Lists.newArrayList(); for (String id : ids) { WorldGeneratorModifier modifier = this.modifiers.get(id); if (modifier != null) { modifiers.add(modifier); } else { logger.error(STR + id + STR); } } return modifiers; }
/** * Gets the world generator modifiers with the given id. If no world * generator modifier can be found with a certain id, a message is logged * and the id is skipped. * * @param ids * The ids * @return The modifiers */
Gets the world generator modifiers with the given id. If no world generator modifier can be found with a certain id, a message is logged and the id is skipped
toModifiers
{ "repo_name": "gabizou/SpongeCommon", "path": "src/main/java/org/spongepowered/common/world/gen/WorldGeneratorRegistry.java", "license": "mit", "size": 5319 }
[ "com.google.common.collect.Lists", "java.util.Collection", "java.util.List", "org.spongepowered.api.world.gen.WorldGeneratorModifier" ]
import com.google.common.collect.Lists; import java.util.Collection; import java.util.List; import org.spongepowered.api.world.gen.WorldGeneratorModifier;
import com.google.common.collect.*; import java.util.*; import org.spongepowered.api.world.gen.*;
[ "com.google.common", "java.util", "org.spongepowered.api" ]
com.google.common; java.util; org.spongepowered.api;
1,910,029
StyledString getStyledDisplayString();
StyledString getStyledDisplayString();
/** * Returns the styled string used to display this proposal in the list of completion proposals. * This can for example be used to draw mixed colored labels. * <p> * <strong>Note:</strong> {@link ICompletionProposal#getDisplayString()} still needs to be * correctly implemented as this method might be ignored in case of uninstalled owner draw * support. * </p> * * @return the string builder used to display this proposal */
Returns the styled string used to display this proposal in the list of completion proposals. This can for example be used to draw mixed colored labels. Note: <code>ICompletionProposal#getDisplayString()</code> still needs to be correctly implemented as this method might be ignored in case of uninstalled owner draw support.
getStyledDisplayString
{ "repo_name": "dhuebner/che", "path": "plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jface-text/src/main/java/org/eclipse/che/jface/text/contentassist/ICompletionProposalExtension6.java", "license": "epl-1.0", "size": 1345 }
[ "org.eclipse.jface.viewers.StyledString" ]
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.viewers.*;
[ "org.eclipse.jface" ]
org.eclipse.jface;
637,261
public List<String> getInputProcessorIds(String processGroupId) throws NifiComponentNotFoundException { final Set<ConnectionDTO> connections = client.processGroups().getConnections(processGroupId); return NifiConnectionUtil.getInputProcessorIds(connections); }
List<String> function(String processGroupId) throws NifiComponentNotFoundException { final Set<ConnectionDTO> connections = client.processGroups().getConnections(processGroupId); return NifiConnectionUtil.getInputProcessorIds(connections); }
/** * returns a list of Processors in a group that dont have any connection destinations (1st in the flow) */
returns a list of Processors in a group that dont have any connection destinations (1st in the flow)
getInputProcessorIds
{ "repo_name": "claudiu-stanciu/kylo", "path": "integrations/nifi/nifi-rest/nifi-rest-client/nifi-rest-client-api/src/main/java/com/thinkbiganalytics/nifi/rest/client/LegacyNifiRestClient.java", "license": "apache-2.0", "size": 64865 }
[ "com.thinkbiganalytics.nifi.rest.support.NifiConnectionUtil", "java.util.List", "java.util.Set", "org.apache.nifi.web.api.dto.ConnectionDTO" ]
import com.thinkbiganalytics.nifi.rest.support.NifiConnectionUtil; import java.util.List; import java.util.Set; import org.apache.nifi.web.api.dto.ConnectionDTO;
import com.thinkbiganalytics.nifi.rest.support.*; import java.util.*; import org.apache.nifi.web.api.dto.*;
[ "com.thinkbiganalytics.nifi", "java.util", "org.apache.nifi" ]
com.thinkbiganalytics.nifi; java.util; org.apache.nifi;
967,549
public final Property<Integer> depth() { return metaBean().depth().createProperty(this); }
final Property<Integer> function() { return metaBean().depth().createProperty(this); }
/** * Gets the the {@code depth} property. * A value of zero returns the root node, one returns the root node with immediate children, and so on. * A negative value, such as -1, returns the full tree. * By default this is -1. * @return the property, not null */
Gets the the depth property. A value of zero returns the root node, one returns the root node with immediate children, and so on. A negative value, such as -1, returns the full tree. By default this is -1
depth
{ "repo_name": "jeorme/OG-Platform", "path": "projects/OG-Master/src/main/java/com/opengamma/master/portfolio/PortfolioHistoryRequest.java", "license": "apache-2.0", "size": 8777 }
[ "org.joda.beans.Property" ]
import org.joda.beans.Property;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
2,689,713
protected void setBaseAttributes(TypedArray a, int widthAttr, int heightAttr) { if (a.hasValue(widthAttr)) { width = a.getLayoutDimension(widthAttr, "layout_width"); } else { width = WRAP_CONTENT; } if (a.hasValue(heightAttr)) { height = a.getLayoutDimension(heightAttr, "layout_height"); } else { height = WRAP_CONTENT; } } }
void function(TypedArray a, int widthAttr, int heightAttr) { if (a.hasValue(widthAttr)) { width = a.getLayoutDimension(widthAttr, STR); } else { width = WRAP_CONTENT; } if (a.hasValue(heightAttr)) { height = a.getLayoutDimension(heightAttr, STR); } else { height = WRAP_CONTENT; } } }
/** * <p>Fixes the child's width to * {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT} and the child's * height to {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT} * when not specified in the XML file.</p> * * @param a the styled attributes set * @param widthAttr the width attribute to fetch * @param heightAttr the height attribute to fetch */
Fixes the child's width to <code>android.view.ViewGroup.LayoutParams#WRAP_CONTENT</code> and the child's height to <code>android.view.ViewGroup.LayoutParams#WRAP_CONTENT</code> when not specified in the XML file
setBaseAttributes
{ "repo_name": "jabelai/Neverland", "path": "MainActivity/src/com/example/ui/radiogroup/RadioGroup.java", "license": "apache-2.0", "size": 11026 }
[ "android.content.res.TypedArray" ]
import android.content.res.TypedArray;
import android.content.res.*;
[ "android.content" ]
android.content;
1,708,950
public boolean isValidTableName(String[] tableNames, MultiSilverpeasBundle resources) { String tableName = table.getName(); if (tableName == null || tableName.length() == 0) { errorLabel = resources.getString("ErrorTableNameRequired"); return false; } tableName = tableName.toUpperCase(); for (int i = 0, n = tableNames.length; i < n; i++) { if (tableName.equals(tableNames[i].toUpperCase())) { errorLabel = resources.getString("ErrorTableNameExisting"); return false; } } errorLabel = ""; return true; }
boolean function(String[] tableNames, MultiSilverpeasBundle resources) { String tableName = table.getName(); if (tableName == null tableName.length() == 0) { errorLabel = resources.getString(STR); return false; } tableName = tableName.toUpperCase(); for (int i = 0, n = tableNames.length; i < n; i++) { if (tableName.equals(tableNames[i].toUpperCase())) { errorLabel = resources.getString(STR); return false; } } errorLabel = ""; return true; }
/** * Checks if the current table's name is valid. Fills the error label if an error is detected. * * @param tableNames The other tables names. * @param resources The resources wrapper. * @return True if the current table's name is valid. */
Checks if the current table's name is valid. Fills the error label if an error is detected
isValidTableName
{ "repo_name": "auroreallibe/Silverpeas-Components", "path": "mydb/mydb-library/src/main/java/com/silverpeas/mydb/control/TableManager.java", "license": "agpl-3.0", "size": 18250 }
[ "org.silverpeas.core.util.MultiSilverpeasBundle" ]
import org.silverpeas.core.util.MultiSilverpeasBundle;
import org.silverpeas.core.util.*;
[ "org.silverpeas.core" ]
org.silverpeas.core;
1,282,603
public Array<Rectangle> getBoundingRectangle () { mBounds.clear(); for (Polygon p : Polygons) { mBounds.add(p.getBoundingRectangle()); } return mBounds; }
Array<Rectangle> function () { mBounds.clear(); for (Polygon p : Polygons) { mBounds.add(p.getBoundingRectangle()); } return mBounds; }
/** Returns an axis-aligned bounding box of this polygon. * * Note the returned Rectangle is cached in this polygon, and will be reused if this Polygon is changed. * * @return this polygon's bounding box {@link Rectangle} */
Returns an axis-aligned bounding box of this polygon. Note the returned Rectangle is cached in this polygon, and will be reused if this Polygon is changed
getBoundingRectangle
{ "repo_name": "trungnt13/fasta-game", "path": "TNTEngine/src/org/tntstudio/utils/math/PolygonList.java", "license": "mit", "size": 5852 }
[ "com.badlogic.gdx.math.Rectangle", "com.badlogic.gdx.utils.Array" ]
import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.math.*; import com.badlogic.gdx.utils.*;
[ "com.badlogic.gdx" ]
com.badlogic.gdx;
430,196
public List<Label> getTargetEnvironments() { return options.targetEnvironments; }
List<Label> function() { return options.targetEnvironments; }
/** * Returns the "top-level" environment space, i.e. the set of environments all top-level * targets must be compatible with. An empty value implies no restrictions. */
Returns the "top-level" environment space, i.e. the set of environments all top-level targets must be compatible with. An empty value implies no restrictions
getTargetEnvironments
{ "repo_name": "rohitsaboo/bazel", "path": "src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java", "license": "apache-2.0", "size": 95388 }
[ "com.google.devtools.build.lib.cmdline.Label", "java.util.List" ]
import com.google.devtools.build.lib.cmdline.Label; import java.util.List;
import com.google.devtools.build.lib.cmdline.*; import java.util.*;
[ "com.google.devtools", "java.util" ]
com.google.devtools; java.util;
1,940,469
public List<String> getContent() { return this.dtdContent; }
List<String> function() { return this.dtdContent; }
/** * Returns the content of the DTD. * @return List of Strings with the DTD content. */
Returns the content of the DTD
getContent
{ "repo_name": "SSEHUB/EASyProducer", "path": "Plugins/Instantiation/de.uni_hildesheim.sse.easy.instantiatorCore/src/net/ssehub/easy/instantiation/core/model/artifactModel/xml/Dtd.java", "license": "apache-2.0", "size": 1317 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
663,806
private void addZapCmdLine(List<String> list, ArrayList<ZAPCmdLine> cmdList) { for (ZAPCmdLine zapCmd : cmdList) { if (zapCmd.getCmdLineOption() != null && !zapCmd.getCmdLineOption().isEmpty()) list.add(zapCmd.getCmdLineOption()); if (zapCmd.getCmdLineValue() != null && !zapCmd.getCmdLineValue().isEmpty()) list.add(zapCmd.getCmdLineValue()); } }
void function(List<String> list, ArrayList<ZAPCmdLine> cmdList) { for (ZAPCmdLine zapCmd : cmdList) { if (zapCmd.getCmdLineOption() != null && !zapCmd.getCmdLineOption().isEmpty()) list.add(zapCmd.getCmdLineOption()); if (zapCmd.getCmdLineValue() != null && !zapCmd.getCmdLineValue().isEmpty()) list.add(zapCmd.getCmdLineValue()); } }
/** * Add list of command line to the list in param * * @param list * of type List<String>: the list to attach ZAP command line to. * @param cmdList * of type ArrayList<ZAPCmdLine>: the list of ZAP command line options and their values. */
Add list of command line to the list in param
addZapCmdLine
{ "repo_name": "tlenaic/zap-plugin", "path": "src/main/java/org/jenkinsci/plugins/zap/ZAPDriver.java", "license": "mit", "size": 157200 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,796,118
private BitSet generateRandomBitmask() { // TODO Auto-generated method stub LinesAlgorithmDataFactory factory = (LinesAlgorithmDataFactory)g.fac; BitSet mask = new BitSet(); float r; int k; Random rg = new Random(); if (g.crType == 0) { k = rg.nextInt(factory.lineNumber); for (int i = k * 30; i < (k + 1) * 30; i++) { r = (float) Math.random(); if (r < 0.5f) mask.set(i, false); else mask.set(i, true); } } else if (g.crType == 1) { k = rg.nextInt(factory.lineNumber); for (int i = k * 30; i < k * 30 + 10; i++) { r = (float) Math.random(); if (r < 0.5f) mask.set(i, false); else mask.set(i, true); } } else if (g.crType == 2) { k = rg.nextInt(factory.lineNumber); for (int i = k * 30 + 10; i < k * 30 + 20; i++) { r = (float) Math.random(); if (r < 0.5f) mask.set(i, false); else mask.set(i, true); } } else if (g.crType == 3) { k = rg.nextInt(factory.lineNumber); for (int i = k * 30 + 20; i < (k + 1) * 30; i++) { r = (float) Math.random(); if (r < 0.5f) mask.set(i, false); else mask.set(i, true); } } else if (g.crType == 4) { for (int i = 0; i < factory.lineNumber * 30; i++) { r = rg.nextFloat(); if (r < 0.5f) mask.set(i, false); else mask.set(i, true); } } return mask; }
BitSet function() { LinesAlgorithmDataFactory factory = (LinesAlgorithmDataFactory)g.fac; BitSet mask = new BitSet(); float r; int k; Random rg = new Random(); if (g.crType == 0) { k = rg.nextInt(factory.lineNumber); for (int i = k * 30; i < (k + 1) * 30; i++) { r = (float) Math.random(); if (r < 0.5f) mask.set(i, false); else mask.set(i, true); } } else if (g.crType == 1) { k = rg.nextInt(factory.lineNumber); for (int i = k * 30; i < k * 30 + 10; i++) { r = (float) Math.random(); if (r < 0.5f) mask.set(i, false); else mask.set(i, true); } } else if (g.crType == 2) { k = rg.nextInt(factory.lineNumber); for (int i = k * 30 + 10; i < k * 30 + 20; i++) { r = (float) Math.random(); if (r < 0.5f) mask.set(i, false); else mask.set(i, true); } } else if (g.crType == 3) { k = rg.nextInt(factory.lineNumber); for (int i = k * 30 + 20; i < (k + 1) * 30; i++) { r = (float) Math.random(); if (r < 0.5f) mask.set(i, false); else mask.set(i, true); } } else if (g.crType == 4) { for (int i = 0; i < factory.lineNumber * 30; i++) { r = rg.nextFloat(); if (r < 0.5f) mask.set(i, false); else mask.set(i, true); } } return mask; }
/*** * random bitmask is created, depending on crossover type crType. A whole * point, x coordinate of one point, y coordinate of one point, length of * one point or whole genom are the target of crossover. * * @return a new random bitmask */
random bitmask is created, depending on crossover type crType. A whole point, x coordinate of one point, y coordinate of one point, length of one point or whole genom are the target of crossover
generateRandomBitmask
{ "repo_name": "mmaas/AIAlgorithmTool", "path": "src/geneticalgorithm/CrossoverOperator.java", "license": "gpl-3.0", "size": 10421 }
[ "java.util.BitSet", "java.util.Random" ]
import java.util.BitSet; import java.util.Random;
import java.util.*;
[ "java.util" ]
java.util;
69,533
@Path("config") @POST @NoCache @Consumes(MediaType.APPLICATION_JSON) public Response createAuthenticatorConfig(AuthenticatorConfigRepresentation rep) { auth.requireManage(); AuthenticatorConfigModel config = realm.addAuthenticatorConfig(RepresentationToModel.toModel(rep)); adminEvent.operation(OperationType.CREATE).resource(ResourceType.AUTHENTICATOR_CONFIG).resourcePath(uriInfo, config.getId()).representation(rep).success(); return Response.created(uriInfo.getAbsolutePathBuilder().path(config.getId()).build()).build(); }
@Path(STR) @Consumes(MediaType.APPLICATION_JSON) Response function(AuthenticatorConfigRepresentation rep) { auth.requireManage(); AuthenticatorConfigModel config = realm.addAuthenticatorConfig(RepresentationToModel.toModel(rep)); adminEvent.operation(OperationType.CREATE).resource(ResourceType.AUTHENTICATOR_CONFIG).resourcePath(uriInfo, config.getId()).representation(rep).success(); return Response.created(uriInfo.getAbsolutePathBuilder().path(config.getId()).build()).build(); }
/** * Create new authenticator configuration * @param rep JSON describing new authenticator configuration * @deprecated Use {@link #newExecutionConfig(String, AuthenticatorConfigRepresentation)} instead */
Create new authenticator configuration
createAuthenticatorConfig
{ "repo_name": "almighty/keycloak", "path": "services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java", "license": "apache-2.0", "size": 42926 }
[ "javax.ws.rs.Consumes", "javax.ws.rs.Path", "javax.ws.rs.core.MediaType", "javax.ws.rs.core.Response", "org.keycloak.events.admin.OperationType", "org.keycloak.events.admin.ResourceType", "org.keycloak.models.AuthenticatorConfigModel", "org.keycloak.models.utils.RepresentationToModel", "org.keycloak.representations.idm.AuthenticatorConfigRepresentation" ]
import javax.ws.rs.Consumes; import javax.ws.rs.Path; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.keycloak.events.admin.OperationType; import org.keycloak.events.admin.ResourceType; import org.keycloak.models.AuthenticatorConfigModel; import org.keycloak.models.utils.RepresentationToModel; import org.keycloak.representations.idm.AuthenticatorConfigRepresentation;
import javax.ws.rs.*; import javax.ws.rs.core.*; import org.keycloak.events.admin.*; import org.keycloak.models.*; import org.keycloak.models.utils.*; import org.keycloak.representations.idm.*;
[ "javax.ws", "org.keycloak.events", "org.keycloak.models", "org.keycloak.representations" ]
javax.ws; org.keycloak.events; org.keycloak.models; org.keycloak.representations;
2,451,967
protected ObjectReferenceMapping initManyToOneMapping() { // Allow for different descriptor types (EIS) to create different mapping types. ObjectReferenceMapping mapping = getDescriptor().getClassDescriptor().newManyToOneMapping(); processRelationshipMapping(mapping); mapping.setIsOptional(isOptional()); mapping.setDerivesId(derivesId()); // Process the indirection. processIndirection(mapping); // Process a @ReturnInsert and @ReturnUpdate (to log a warning message) processReturnInsertAndUpdate(); return mapping; }
ObjectReferenceMapping function() { ObjectReferenceMapping mapping = getDescriptor().getClassDescriptor().newManyToOneMapping(); processRelationshipMapping(mapping); mapping.setIsOptional(isOptional()); mapping.setDerivesId(derivesId()); processIndirection(mapping); processReturnInsertAndUpdate(); return mapping; }
/** * INTERNAL: * Initialize a ManyToOneMapping. */
Initialize a ManyToOneMapping
initManyToOneMapping
{ "repo_name": "bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs", "path": "jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/mappings/ObjectAccessor.java", "license": "epl-1.0", "size": 34404 }
[ "org.eclipse.persistence.mappings.ObjectReferenceMapping" ]
import org.eclipse.persistence.mappings.ObjectReferenceMapping;
import org.eclipse.persistence.mappings.*;
[ "org.eclipse.persistence" ]
org.eclipse.persistence;
2,743,468
protected void addHost(MacAddress mac, VlanId vlan, HostLocation hloc, Set<IpAddress> ips) { HostId hid = HostId.hostId(mac, vlan); HostDescription desc = (ips != null) ? new DefaultHostDescription(mac, vlan, hloc, ips, true) : new DefaultHostDescription(mac, vlan, hloc, true); providerService.hostDetected(hid, desc, true); }
void function(MacAddress mac, VlanId vlan, HostLocation hloc, Set<IpAddress> ips) { HostId hid = HostId.hostId(mac, vlan); HostDescription desc = (ips != null) ? new DefaultHostDescription(mac, vlan, hloc, ips, true) : new DefaultHostDescription(mac, vlan, hloc, true); providerService.hostDetected(hid, desc, true); }
/** * Adds host information. * IP information will be appended if host exists. * * @param mac MAC address of the host * @param vlan VLAN ID of the host * @param hloc Location of the host * @param ips Set of IP addresses of the host */
Adds host information. IP information will be appended if host exists
addHost
{ "repo_name": "sdnwiselab/onos", "path": "providers/netcfghost/src/main/java/org/onosproject/provider/netcfghost/NetworkConfigHostProvider.java", "license": "apache-2.0", "size": 7606 }
[ "java.util.Set", "org.onlab.packet.IpAddress", "org.onlab.packet.MacAddress", "org.onlab.packet.VlanId", "org.onosproject.net.HostId", "org.onosproject.net.HostLocation", "org.onosproject.net.host.DefaultHostDescription", "org.onosproject.net.host.HostDescription" ]
import java.util.Set; import org.onlab.packet.IpAddress; import org.onlab.packet.MacAddress; import org.onlab.packet.VlanId; import org.onosproject.net.HostId; import org.onosproject.net.HostLocation; import org.onosproject.net.host.DefaultHostDescription; import org.onosproject.net.host.HostDescription;
import java.util.*; import org.onlab.packet.*; import org.onosproject.net.*; import org.onosproject.net.host.*;
[ "java.util", "org.onlab.packet", "org.onosproject.net" ]
java.util; org.onlab.packet; org.onosproject.net;
1,925,210
public List<Application> getApplications() { ApplicationCriteria criteria = new ApplicationCriteria(); return getApplications(criteria); }
List<Application> function() { ApplicationCriteria criteria = new ApplicationCriteria(); return getApplications(criteria); }
/** * Gets the list of all applications. * * @return the list of all applications. */
Gets the list of all applications
getApplications
{ "repo_name": "lorislab/tower", "path": "tower-store/src/main/java/org/lorislab/tower/store/ejb/ApplicationService.java", "license": "apache-2.0", "size": 9497 }
[ "java.util.List", "org.lorislab.tower.store.criteria.ApplicationCriteria", "org.lorislab.tower.store.model.Application" ]
import java.util.List; import org.lorislab.tower.store.criteria.ApplicationCriteria; import org.lorislab.tower.store.model.Application;
import java.util.*; import org.lorislab.tower.store.criteria.*; import org.lorislab.tower.store.model.*;
[ "java.util", "org.lorislab.tower" ]
java.util; org.lorislab.tower;
280,383
@Override public void injectPlayer(Player player, ConflictStrategy strategy) { // Inject using the player instance itself if (isInjectionNecessary(GamePhase.PLAYING)) { injectPlayer(player, player, strategy, GamePhase.PLAYING); } }
void function(Player player, ConflictStrategy strategy) { if (isInjectionNecessary(GamePhase.PLAYING)) { injectPlayer(player, player, strategy, GamePhase.PLAYING); } }
/** * Initialize a player hook, allowing us to read server packets. * <p> * This call will be ignored if there's no listener that can receive the given events. * @param player - player to hook. * @param strategy - how to handle previous player injections. */
Initialize a player hook, allowing us to read server packets. This call will be ignored if there's no listener that can receive the given events
injectPlayer
{ "repo_name": "HolodeckOne-Minecraft/ProtocolLib", "path": "modules/ProtocolLib/src/main/java/com/comphenix/protocol/injector/player/ProxyPlayerInjectionHandler.java", "license": "gpl-2.0", "size": 24628 }
[ "com.comphenix.protocol.injector.GamePhase", "org.bukkit.entity.Player" ]
import com.comphenix.protocol.injector.GamePhase; import org.bukkit.entity.Player;
import com.comphenix.protocol.injector.*; import org.bukkit.entity.*;
[ "com.comphenix.protocol", "org.bukkit.entity" ]
com.comphenix.protocol; org.bukkit.entity;
478,160
public Set<Topic> getTopics() { return this.topics; }
Set<Topic> function() { return this.topics; }
/** * * Message Threads in this NewsGroup. * * @return the topics */
Message Threads in this NewsGroup
getTopics
{ "repo_name": "eltonnuness/unison", "path": "src/main/java/uk/co/sleonard/unison/datahandling/DAO/NewsGroup.java", "license": "apache-2.0", "size": 7388 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,717,901
// TODO "custom" GridConfiguration values are discouraged by Selenium. Find another path. protected void mergeCustom(GridHubConfiguration gc) { if (nodeRecycleThreadWaitTimeout != null) { gc.custom.put(NODE_RECYCLE_THREAD_WAIT_TIMEOUT, String.valueOf(nodeRecycleThreadWaitTimeout)); } if (uniqueSessionCount != null) { gc.custom.put(UNIQUE_SESSION_COUNT, String.valueOf(uniqueSessionCount)); } }
void function(GridHubConfiguration gc) { if (nodeRecycleThreadWaitTimeout != null) { gc.custom.put(NODE_RECYCLE_THREAD_WAIT_TIMEOUT, String.valueOf(nodeRecycleThreadWaitTimeout)); } if (uniqueSessionCount != null) { gc.custom.put(UNIQUE_SESSION_COUNT, String.valueOf(uniqueSessionCount)); } }
/** * merges the "custom:" { ... } values for this configuration */
merges the "custom:" { ... } values for this configuration
mergeCustom
{ "repo_name": "paypal/SeLion", "path": "server/src/main/java/com/paypal/selion/grid/SeLionGridConfiguration.java", "license": "apache-2.0", "size": 5625 }
[ "org.openqa.grid.internal.utils.configuration.GridHubConfiguration" ]
import org.openqa.grid.internal.utils.configuration.GridHubConfiguration;
import org.openqa.grid.internal.utils.configuration.*;
[ "org.openqa.grid" ]
org.openqa.grid;
2,685,374
ServiceResponse<A> get200ModelA200None() throws ServiceException, IOException;
ServiceResponse<A> get200ModelA200None() throws ServiceException, IOException;
/** * Send a 200 response with no payload, when a payload is expected - client should return a null object of thde type for model A. * * @throws ServiceException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @return the A object wrapped in {@link ServiceResponse} if successful. */
Send a 200 response with no payload, when a payload is expected - client should return a null object of thde type for model A
get200ModelA200None
{ "repo_name": "brodyberg/autorest", "path": "AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/http/MultipleResponsesOperations.java", "license": "mit", "size": 29440 }
[ "com.microsoft.rest.ServiceException", "com.microsoft.rest.ServiceResponse", "java.io.IOException" ]
import com.microsoft.rest.ServiceException; import com.microsoft.rest.ServiceResponse; import java.io.IOException;
import com.microsoft.rest.*; import java.io.*;
[ "com.microsoft.rest", "java.io" ]
com.microsoft.rest; java.io;
2,102,793
void report(Log log, int pos, Type site, Name name, List argtypes) { String symstr = sym.kind == TYP & sym.type.tag == CLASS ? sym.type .toJava() : sym.toJava(); log .error(pos, "non-static.cant.be.ref", kindName(sym.kind), symstr); } } static class AmbiguityError extends ResolveError { Symbol sym1; Symbol sym2; AmbiguityError(Symbol sym1, Symbol sym2) { super(AMBIGUOUS, sym1, "ambiguity error"); this.sym1 = sym1; this.sym2 = sym2; }
void report(Log log, int pos, Type site, Name name, List argtypes) { String symstr = sym.kind == TYP & sym.type.tag == CLASS ? sym.type .toJava() : sym.toJava(); log .error(pos, STR, kindName(sym.kind), symstr); } } static class AmbiguityError extends ResolveError { Symbol sym1; Symbol sym2; AmbiguityError(Symbol sym1, Symbol sym2) { super(AMBIGUOUS, sym1, STR); this.sym1 = sym1; this.sym2 = sym2; }
/** * Report error. * * @param log * The error log to be used for error reporting. * @param pos * The position to be used for error reporting. * @param site * The original type from where the selection took place. * @param name * The name of the symbol to be resolved. * @param argtypes * The invocation's value parameters, if we looked for a * method. */
Report error
report
{ "repo_name": "nileshpatelksy/hello-pod-cast", "path": "archive/FILE/Compiler/java_GJC1.42_src/src/com/sun/tools/javac/v8/comp/Resolve.java", "license": "apache-2.0", "size": 42456 }
[ "com.sun.tools.javac.v8.code.Symbol", "com.sun.tools.javac.v8.code.Type", "com.sun.tools.javac.v8.util.List", "com.sun.tools.javac.v8.util.Log", "com.sun.tools.javac.v8.util.Name" ]
import com.sun.tools.javac.v8.code.Symbol; import com.sun.tools.javac.v8.code.Type; import com.sun.tools.javac.v8.util.List; import com.sun.tools.javac.v8.util.Log; import com.sun.tools.javac.v8.util.Name;
import com.sun.tools.javac.v8.code.*; import com.sun.tools.javac.v8.util.*;
[ "com.sun.tools" ]
com.sun.tools;
2,693,617
@Authorized( { PrivilegeConstants.EDIT_ENCOUNTERS }) public Encounter unvoidEncounter(Encounter encounter) throws APIException;
@Authorized( { PrivilegeConstants.EDIT_ENCOUNTERS }) Encounter function(Encounter encounter) throws APIException;
/** * Unvoid encounter record * * @param encounter Encounter to be revived * @should cascade unvoid to obs * @should cascade unvoid to orders * @should unvoid and unmark all attributes * @should fail if user is not supposed to edit encounters of type of given encounter */
Unvoid encounter record
unvoidEncounter
{ "repo_name": "sintjuri/openmrs-core", "path": "api/src/main/java/org/openmrs/api/EncounterService.java", "license": "mpl-2.0", "size": 37063 }
[ "org.openmrs.Encounter", "org.openmrs.annotation.Authorized", "org.openmrs.util.PrivilegeConstants" ]
import org.openmrs.Encounter; import org.openmrs.annotation.Authorized; import org.openmrs.util.PrivilegeConstants;
import org.openmrs.*; import org.openmrs.annotation.*; import org.openmrs.util.*;
[ "org.openmrs", "org.openmrs.annotation", "org.openmrs.util" ]
org.openmrs; org.openmrs.annotation; org.openmrs.util;
116,247
protected int readBlock() { blockSize = read(); int n = 0; if (blockSize > 0) { try { int count; while (n < blockSize) { count = blockSize - n; rawData.get(block, n, count); n += count; } } catch (final Exception e) { Log.w(TAG, "Error Reading Block", e); status = STATUS_FORMAT_ERROR; } } return n; }
int function() { blockSize = read(); int n = 0; if (blockSize > 0) { try { int count; while (n < blockSize) { count = blockSize - n; rawData.get(block, n, count); n += count; } } catch (final Exception e) { Log.w(TAG, STR, e); status = STATUS_FORMAT_ERROR; } } return n; }
/** * Reads next variable length block from input. * * @return number of bytes stored in "buffer" */
Reads next variable length block from input
readBlock
{ "repo_name": "markatithinkbest/android_sky2", "path": "app/src/main/java/com/mogujie/tt/ui/widget/GifDecoder.java", "license": "bsd-3-clause", "size": 26071 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
1,941,823
private static void throwVerificationFailure(String expected, String actual, File file, String algorithm) throws IOException { throw new IOException("Downloaded file " + file.getAbsolutePath() + " does not match expected " + algorithm + ", expected '" + expected + "', actual '" + actual + "'"); }
static void function(String expected, String actual, File file, String algorithm) throws IOException { throw new IOException(STR + file.getAbsolutePath() + STR + algorithm + STR + expected + STR + actual + "'"); }
/** * Throws an {@code IOException} with a message about {@code actual} not matching {@code expected} for {@code file} when using {@code algorithm}. */
Throws an IOException with a message about actual not matching expected for file when using algorithm
throwVerificationFailure
{ "repo_name": "batmat/jenkins", "path": "core/src/main/java/hudson/model/UpdateCenter.java", "license": "mit", "size": 88993 }
[ "java.io.File", "java.io.IOException" ]
import java.io.File; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
326,149
@Nonnull public static LocalDAOStorageConfig getStorageConfig(@Nonnull Class<? extends UnionTemplate> aspectUnionClass) { AspectValidator.validateAspectUnionSchema(aspectUnionClass); final Set<Class<? extends RecordTemplate>> aspects = ModelUtils.getValidAspectTypes(aspectUnionClass); return LocalDAOStorageConfig.builder().aspectStorageConfigMap(getDefaultMapForAspects(aspects)).build(); }
static LocalDAOStorageConfig function(@Nonnull Class<? extends UnionTemplate> aspectUnionClass) { AspectValidator.validateAspectUnionSchema(aspectUnionClass); final Set<Class<? extends RecordTemplate>> aspects = ModelUtils.getValidAspectTypes(aspectUnionClass); return LocalDAOStorageConfig.builder().aspectStorageConfigMap(getDefaultMapForAspects(aspects)).build(); }
/** * Gets {@link LocalDAOStorageConfig} containing aspects in aspect union. All aspects are populated with NULL * (default) config. * * @param aspectUnionClass class of the aspect union from where the set of aspects are retrieved * @return {@link LocalDAOStorageConfig} that contains set of aspects in the aspect union, each with NULL (default) config */
Gets <code>LocalDAOStorageConfig</code> containing aspects in aspect union. All aspects are populated with NULL (default) config
getStorageConfig
{ "repo_name": "mars-lan/WhereHows", "path": "gms/factories/src/main/java/com/linkedin/gms/factory/common/LocalDAOStorageConfigFactory.java", "license": "apache-2.0", "size": 6996 }
[ "com.linkedin.data.template.RecordTemplate", "com.linkedin.data.template.UnionTemplate", "com.linkedin.metadata.dao.storage.LocalDAOStorageConfig", "com.linkedin.metadata.dao.utils.ModelUtils", "com.linkedin.metadata.validator.AspectValidator", "java.util.Set", "javax.annotation.Nonnull" ]
import com.linkedin.data.template.RecordTemplate; import com.linkedin.data.template.UnionTemplate; import com.linkedin.metadata.dao.storage.LocalDAOStorageConfig; import com.linkedin.metadata.dao.utils.ModelUtils; import com.linkedin.metadata.validator.AspectValidator; import java.util.Set; import javax.annotation.Nonnull;
import com.linkedin.data.template.*; import com.linkedin.metadata.dao.storage.*; import com.linkedin.metadata.dao.utils.*; import com.linkedin.metadata.validator.*; import java.util.*; import javax.annotation.*;
[ "com.linkedin.data", "com.linkedin.metadata", "java.util", "javax.annotation" ]
com.linkedin.data; com.linkedin.metadata; java.util; javax.annotation;
1,427,842
return Response.ok().build(); }
return Response.ok().build(); }
/** * This is called by Appengine once the VM is initialized. * @return */
This is called by Appengine once the VM is initialized
start
{ "repo_name": "patrickianwilson/appengine-samples", "path": "Samples/ManagedVMsLogging/src/main/java/com/patrickwilson/examples/gae/mvm/controller/AppEngineInternalHandler.java", "license": "mit", "size": 1154 }
[ "javax.ws.rs.core.Response" ]
import javax.ws.rs.core.Response;
import javax.ws.rs.core.*;
[ "javax.ws" ]
javax.ws;
156,757
private NamespacePrefixResolver createLocalPrefixResolver(M2Model model, NamespaceDAO namespaceDAO) { // Retrieve set of existing URIs for validation purposes Collection<String> uris = namespaceDAO.getURIs(); // Create a namespace prefix resolver based on imported and defined // namespaces within the model DynamicNamespacePrefixResolver prefixResolver = new DynamicNamespacePrefixResolver(null); for (M2Namespace imported : model.getImports()) { String uri = imported.getUri(); if (!uris.contains(uri)) { throw new NamespaceException("URI " + uri + " cannot be imported as it is not defined (with prefix " + imported.getPrefix()); } if(model.getNamespace(uri) != null) { throw new NamespaceException("URI " + uri + " cannot be imported as it is already contained in the model's namespaces"); } prefixResolver.registerNamespace(imported.getPrefix(), uri); } for (M2Namespace defined : model.getNamespaces()) { prefixResolver.registerNamespace(defined.getPrefix(), defined.getUri()); } return prefixResolver; }
NamespacePrefixResolver function(M2Model model, NamespaceDAO namespaceDAO) { Collection<String> uris = namespaceDAO.getURIs(); DynamicNamespacePrefixResolver prefixResolver = new DynamicNamespacePrefixResolver(null); for (M2Namespace imported : model.getImports()) { String uri = imported.getUri(); if (!uris.contains(uri)) { throw new NamespaceException(STR + uri + STR + imported.getPrefix()); } if(model.getNamespace(uri) != null) { throw new NamespaceException(STR + uri + STR); } prefixResolver.registerNamespace(imported.getPrefix(), uri); } for (M2Namespace defined : model.getNamespaces()) { prefixResolver.registerNamespace(defined.getPrefix(), defined.getUri()); } return prefixResolver; }
/** * Create a local namespace prefix resolver containing the namespaces defined and imported * in the model * * @param model model definition * @param namespaceDAO namespace DAO * @return the local namespace prefix resolver */
Create a local namespace prefix resolver containing the namespaces defined and imported in the model
createLocalPrefixResolver
{ "repo_name": "Alfresco/community-edition", "path": "projects/data-model/source/java/org/alfresco/repo/dictionary/CompiledModel.java", "license": "lgpl-3.0", "size": 16283 }
[ "java.util.Collection", "org.alfresco.service.namespace.DynamicNamespacePrefixResolver", "org.alfresco.service.namespace.NamespaceException", "org.alfresco.service.namespace.NamespacePrefixResolver" ]
import java.util.Collection; import org.alfresco.service.namespace.DynamicNamespacePrefixResolver; import org.alfresco.service.namespace.NamespaceException; import org.alfresco.service.namespace.NamespacePrefixResolver;
import java.util.*; import org.alfresco.service.namespace.*;
[ "java.util", "org.alfresco.service" ]
java.util; org.alfresco.service;
521,855
@Override public void actionPerformed(ActionEvent e) { if (e.getSource() == sendToOpenBISButton) { // Make sure all models are ready if (!dataViewer.isReady() || !openBISViewer.isReady()) { outputPane.warn("Data is not ready to be sent to openBIS!"); return; } // Update the data model with the openBIS and user attributes if (!metadataEditor.updateDataModel()) { outputPane.warn("No new datasets ready for upload!"); return; } // Get the output directory String outputDirectory = globalSettingsManager.getUserDataRootDir(); // Save to XML (*_properties.oix) if (dataViewer.saveToXML(outputDirectory)) { outputPane.log("Annotations successfully written."); } else { outputPane.err("Could not write annotations! " + "Sending data to openBIS failed!"); return; } // Save the data structure file (data_structure.ois) if (dataViewer.saveDataStructureMap( outputDirectory + File.separator + openBISViewer.getUserName())) { outputPane.log("Data structure map successfully written."); } else { outputPane.err("Could not data structure map! " + "Sending data to openBIS failed!"); return; } // Now move the user folder to the datamover incoming folder new ATDataMover(globalSettingsManager, openBISViewer.getUserName()).move(); outputPane.log("Data transferred."); // Re-scan dataViewer.scan(); } }
void function(ActionEvent e) { if (e.getSource() == sendToOpenBISButton) { if (!dataViewer.isReady() !openBISViewer.isReady()) { outputPane.warn(STR); return; } if (!metadataEditor.updateDataModel()) { outputPane.warn(STR); return; } String outputDirectory = globalSettingsManager.getUserDataRootDir(); if (dataViewer.saveToXML(outputDirectory)) { outputPane.log(STR); } else { outputPane.err(STR + STR); return; } if (dataViewer.saveDataStructureMap( outputDirectory + File.separator + openBISViewer.getUserName())) { outputPane.log(STR); } else { outputPane.err(STR + STR); return; } new ATDataMover(globalSettingsManager, openBISViewer.getUserName()).move(); outputPane.log(STR); dataViewer.scan(); } }
/** * ActionPerformed method from the ActionListener interface * @param e The ActionEvent object */
ActionPerformed method from the ActionListener interface
actionPerformed
{ "repo_name": "aarpon/obit_annotation_tool", "path": "AnnotationTool/ch/ethz/scu/obit/at/gui/editors/data/EditorContainer.java", "license": "apache-2.0", "size": 6830 }
[ "ch.ethz.scu.obit.at.datamover.ATDataMover", "java.awt.event.ActionEvent", "java.io.File" ]
import ch.ethz.scu.obit.at.datamover.ATDataMover; import java.awt.event.ActionEvent; import java.io.File;
import ch.ethz.scu.obit.at.datamover.*; import java.awt.event.*; import java.io.*;
[ "ch.ethz.scu", "java.awt", "java.io" ]
ch.ethz.scu; java.awt; java.io;
2,417,754
public int convertToAbsoluteDirection(int flags, int layoutDirection) { int masked = flags & RELATIVE_DIR_FLAGS; if (masked == 0) { return flags; // does not have any relative flags, good. } flags &= ~masked; //remove start / end if (layoutDirection == ViewCompat.LAYOUT_DIRECTION_LTR) { // no change. just OR with 2 bits shifted mask and return flags |= masked >> 2; // START is 2 bits after LEFT, END is 2 bits after RIGHT. return flags; } else { // add START flag as RIGHT flags |= ((masked >> 1) & ~RELATIVE_DIR_FLAGS); // first clean start bit then add END flag as LEFT flags |= ((masked >> 1) & RELATIVE_DIR_FLAGS) >> 2; } return flags; }
int function(int flags, int layoutDirection) { int masked = flags & RELATIVE_DIR_FLAGS; if (masked == 0) { return flags; } flags &= ~masked; if (layoutDirection == ViewCompat.LAYOUT_DIRECTION_LTR) { flags = masked >> 2; return flags; } else { flags = ((masked >> 1) & ~RELATIVE_DIR_FLAGS); flags = ((masked >> 1) & RELATIVE_DIR_FLAGS) >> 2; } return flags; }
/** * Converts a given set of flags to absolution direction which means {@link #START} and * {@link #END} are replaced with {@link #LEFT} and {@link #RIGHT} depending on the layout * direction. * * @param flags The flag value that include any number of movement flags. * @param layoutDirection The layout direction of the RecyclerView. * @return Updated flags which includes only absolute direction values. */
Converts a given set of flags to absolution direction which means <code>#START</code> and <code>#END</code> are replaced with <code>#LEFT</code> and <code>#RIGHT</code> depending on the layout direction
convertToAbsoluteDirection
{ "repo_name": "slp/Telegram-FOSS", "path": "TMessagesProj/src/main/java/org/telegram/messenger/support/widget/helper/ItemTouchHelper.java", "license": "gpl-2.0", "size": 106711 }
[ "android.support.v4.view.ViewCompat" ]
import android.support.v4.view.ViewCompat;
import android.support.v4.view.*;
[ "android.support" ]
android.support;
2,651,720
@NotNull public static <DATA> InvocationFactory<DATA, DATA> append(@Nullable final DATA output) { return append(Channels.replay(JRoutineCore.io().of(output)).buildChannels()); }
static <DATA> InvocationFactory<DATA, DATA> function(@Nullable final DATA output) { return append(Channels.replay(JRoutineCore.io().of(output)).buildChannels()); }
/** * Returns a factory of invocations appending the specified output to the invocation ones. * * @param output the output. * @param <DATA> the data type. * @return the invocation factory instance. */
Returns a factory of invocations appending the specified output to the invocation ones
append
{ "repo_name": "davide-maestroni/jroutine", "path": "operator/src/main/java/com/github/dm/jrt/operator/Operators.java", "license": "apache-2.0", "size": 67942 }
[ "com.github.dm.jrt.channel.Channels", "com.github.dm.jrt.core.JRoutineCore", "com.github.dm.jrt.core.invocation.InvocationFactory", "org.jetbrains.annotations.Nullable" ]
import com.github.dm.jrt.channel.Channels; import com.github.dm.jrt.core.JRoutineCore; import com.github.dm.jrt.core.invocation.InvocationFactory; import org.jetbrains.annotations.Nullable;
import com.github.dm.jrt.channel.*; import com.github.dm.jrt.core.*; import com.github.dm.jrt.core.invocation.*; import org.jetbrains.annotations.*;
[ "com.github.dm", "org.jetbrains.annotations" ]
com.github.dm; org.jetbrains.annotations;
146,715
public void upload(final File file) { // Start by creating a new contents, and setting a callback. Log.i(TAG, "Creating new contents."); // final Bitmap image = mBitmapToSave; Drive.DriveApi.newDriveContents(mGoogleApiClient) .setResultCallback(new ResultCallback<DriveContentsResult>() {
void function(final File file) { Log.i(TAG, STR); Drive.DriveApi.newDriveContents(mGoogleApiClient) .setResultCallback(new ResultCallback<DriveContentsResult>() {
/** * Create a new file and save it to Drive. */
Create a new file and save it to Drive
upload
{ "repo_name": "zipzapdat/ZipZapDataSyncApp", "path": "app/src/main/java/com/zipzap/util/GoogleDriveStorage.java", "license": "mit", "size": 3830 }
[ "android.util.Log", "com.google.android.gms.common.api.ResultCallback", "com.google.android.gms.drive.Drive", "com.google.android.gms.drive.DriveApi", "java.io.File" ]
import android.util.Log; import com.google.android.gms.common.api.ResultCallback; import com.google.android.gms.drive.Drive; import com.google.android.gms.drive.DriveApi; import java.io.File;
import android.util.*; import com.google.android.gms.common.api.*; import com.google.android.gms.drive.*; import java.io.*;
[ "android.util", "com.google.android", "java.io" ]
android.util; com.google.android; java.io;
2,331,675
public List<Video> getAllVideosBySchool(School s) { List<Video> videos = new ArrayList<>(); if (s == null) { return videos; } List<Alumni> alumnis = Alumni.find.where().eq("school", s).eq("approved", true).findList(); for (Alumni a : alumnis) { List<Video> vids = Video.find.where().eq("user",a).findList(); videos.addAll(vids); } return videos; }
List<Video> function(School s) { List<Video> videos = new ArrayList<>(); if (s == null) { return videos; } List<Alumni> alumnis = Alumni.find.where().eq(STR, s).eq(STR, true).findList(); for (Alumni a : alumnis) { List<Video> vids = Video.find.where().eq("user",a).findList(); videos.addAll(vids); } return videos; }
/** * Gives a List of all of the Video objects associated to a School, approved and unapproved. * @param s School to find Video objects from. * @return A List of Video objects. */
Gives a List of all of the Video objects associated to a School, approved and unapproved
getAllVideosBySchool
{ "repo_name": "teamnovember/CareersFromHere", "path": "app/models/VideoDAO.java", "license": "mit", "size": 7008 }
[ "com.avaje.ebean.Expr", "java.util.ArrayList", "java.util.List" ]
import com.avaje.ebean.Expr; import java.util.ArrayList; import java.util.List;
import com.avaje.ebean.*; import java.util.*;
[ "com.avaje.ebean", "java.util" ]
com.avaje.ebean; java.util;
411,564
EList<CoordinateSystem> getCoordinateSystems();
EList<CoordinateSystem> getCoordinateSystems();
/** * Returns the value of the '<em><b>Coordinate Systems</b></em>' reference list. * The list contents are of type {@link gluemodel.CIM.IEC61968.Common.CoordinateSystem}. * It is bidirectional and its opposite is '{@link gluemodel.CIM.IEC61968.Common.CoordinateSystem#getLocation <em>Location</em>}'. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Coordinate Systems</em>' reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Coordinate Systems</em>' reference list. * @see gluemodel.CIM.IEC61968.Common.CommonPackage#getLocation_CoordinateSystems() * @see gluemodel.CIM.IEC61968.Common.CoordinateSystem#getLocation * @model opposite="Location" * annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='All coordinate systems used to describe position points of this location.'" * annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='All coordinate systems used to describe position points of this location.'" * @generated */
Returns the value of the 'Coordinate Systems' reference list. The list contents are of type <code>gluemodel.CIM.IEC61968.Common.CoordinateSystem</code>. It is bidirectional and its opposite is '<code>gluemodel.CIM.IEC61968.Common.CoordinateSystem#getLocation Location</code>'. If the meaning of the 'Coordinate Systems' reference list isn't clear, there really should be more of a description here...
getCoordinateSystems
{ "repo_name": "georghinkel/ttc2017smartGrids", "path": "solutions/eMoflon/rgse.ttc17.metamodels.src/src/gluemodel/CIM/IEC61968/Common/Location.java", "license": "mit", "size": 29557 }
[ "org.eclipse.emf.common.util.EList" ]
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,578,406
public static void drawCircle( Graphics g, int x, int y, int diameter ) { ((Graphics2D)g).addRenderingHints(hints); g.drawOval(x-diameter/2, y-diameter/2, diameter, diameter); }
static void function( Graphics g, int x, int y, int diameter ) { ((Graphics2D)g).addRenderingHints(hints); g.drawOval(x-diameter/2, y-diameter/2, diameter, diameter); }
/** * Draws a circle using the given graphics context, centered at <code>(x,y)</code>, * having the given diameter. * * @see #fillCircle(Graphics, int, int, int) * @param g the graphics context to draw in * @param x the x coordinate for the center of the circle * @param y the y coordinate for the center of the circle * @param diameter the diameter of the circle */
Draws a circle using the given graphics context, centered at <code>(x,y)</code>, having the given diameter
drawCircle
{ "repo_name": "specify/specify6", "path": "src/edu/ku/brc/ui/GraphicsUtils.java", "license": "gpl-2.0", "size": 25375 }
[ "java.awt.Graphics", "java.awt.Graphics2D" ]
import java.awt.Graphics; import java.awt.Graphics2D;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,441,413
public void init(ICommonContentExtensionSite aConfig, CommonViewer viewer) { //if it had something, dispose of its association! this.dispose(); try { extensionStateModel = viewer.getNavigatorContentService().findStateModel( WorkingSetsContentProvider.EXTENSION_ID); extensionStateModel.addPropertyChangeListener(rootModeListener); } catch (Exception e) { Log.log(e); } updateRootMode(); }
void function(ICommonContentExtensionSite aConfig, CommonViewer viewer) { this.dispose(); try { extensionStateModel = viewer.getNavigatorContentService().findStateModel( WorkingSetsContentProvider.EXTENSION_ID); extensionStateModel.addPropertyChangeListener(rootModeListener); } catch (Exception e) { Log.log(e); } updateRootMode(); }
/** * Starts listening to property changes related to which should be the top-level elements to be shown. */
Starts listening to property changes related to which should be the top-level elements to be shown
init
{ "repo_name": "smkr/pyclipse", "path": "plugins/org.python.pydev/src_navigator/org/python/pydev/navigator/TopLevelProjectsOrWorkingSetChoice.java", "license": "epl-1.0", "size": 6328 }
[ "org.eclipse.ui.internal.navigator.workingsets.WorkingSetsContentProvider", "org.eclipse.ui.navigator.CommonViewer", "org.eclipse.ui.navigator.ICommonContentExtensionSite", "org.python.pydev.core.log.Log" ]
import org.eclipse.ui.internal.navigator.workingsets.WorkingSetsContentProvider; import org.eclipse.ui.navigator.CommonViewer; import org.eclipse.ui.navigator.ICommonContentExtensionSite; import org.python.pydev.core.log.Log;
import org.eclipse.ui.internal.navigator.workingsets.*; import org.eclipse.ui.navigator.*; import org.python.pydev.core.log.*;
[ "org.eclipse.ui", "org.python.pydev" ]
org.eclipse.ui; org.python.pydev;
107,374
public void showBanner() { Log.d(TAG, "Show banner to the user"); mActivity.runOnUiThread(new Runnable() {
void function() { Log.d(TAG, STR); mActivity.runOnUiThread(new Runnable() {
/** * Shows the banner to the user. */
Shows the banner to the user
showBanner
{ "repo_name": "ya7lelkom/unity_admob_android", "path": "java/src/com/nabrozidhs/admob/AdMob.java", "license": "mit", "size": 11605 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
2,578,384
private static JobGraph createBlockingJobGraph() { JobGraph jobGraph = new JobGraph("Blocking program"); JobVertex jobVertex = new JobVertex("Blocking Vertex"); jobVertex.setInvokableClass(BlockingNoOpInvokable.class); jobGraph.addVertex(jobVertex); return jobGraph; }
static JobGraph function() { JobGraph jobGraph = new JobGraph(STR); JobVertex jobVertex = new JobVertex(STR); jobVertex.setInvokableClass(BlockingNoOpInvokable.class); jobGraph.addVertex(jobVertex); return jobGraph; }
/** * Creates a simple blocking JobGraph. */
Creates a simple blocking JobGraph
createBlockingJobGraph
{ "repo_name": "mylog00/flink", "path": "flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerHAJobGraphRecoveryITCase.java", "license": "apache-2.0", "size": 15031 }
[ "org.apache.flink.runtime.jobgraph.JobGraph", "org.apache.flink.runtime.jobgraph.JobVertex", "org.apache.flink.runtime.testtasks.BlockingNoOpInvokable" ]
import org.apache.flink.runtime.jobgraph.JobGraph; import org.apache.flink.runtime.jobgraph.JobVertex; import org.apache.flink.runtime.testtasks.BlockingNoOpInvokable;
import org.apache.flink.runtime.jobgraph.*; import org.apache.flink.runtime.testtasks.*;
[ "org.apache.flink" ]
org.apache.flink;
2,479,212
protected ServerResponseHandler getEditResponseHandler( HttpRequest request) throws WikiException { //DatabaseWiki wiki = get(wiki_name); DatabaseWiki wiki = this.getRequestWiki(request, ParameterName); ServerResponseHandler responseHandler = new ServerResponseHandler( request, _wikiTitle + " - Edit Database Wiki"); responseHandler.put(HtmlContentGenerator.ContentContent, new DatabaseWikiFormPrinter(new DatabaseWikiProperties(wiki), RequestParameterAction.ActionUpdate, "Edit Database Wiki")); return responseHandler; }
ServerResponseHandler function( HttpRequest request) throws WikiException { DatabaseWiki wiki = this.getRequestWiki(request, ParameterName); ServerResponseHandler responseHandler = new ServerResponseHandler( request, _wikiTitle + STR); responseHandler.put(HtmlContentGenerator.ContentContent, new DatabaseWikiFormPrinter(new DatabaseWikiProperties(wiki), RequestParameterAction.ActionUpdate, STR)); return responseHandler; }
/** * Creates appropriate response handler for database top-level setting page * */
Creates appropriate response handler for database top-level setting page
getEditResponseHandler
{ "repo_name": "jamescheney/database-wiki", "path": "src/org/dbwiki/web/server/WikiServer.java", "license": "gpl-3.0", "size": 56766 }
[ "org.dbwiki.exception.WikiException", "org.dbwiki.web.request.HttpRequest", "org.dbwiki.web.request.parameter.RequestParameterAction", "org.dbwiki.web.server.DatabaseWikiProperties", "org.dbwiki.web.ui.HtmlContentGenerator", "org.dbwiki.web.ui.ServerResponseHandler", "org.dbwiki.web.ui.printer.server.DatabaseWikiFormPrinter" ]
import org.dbwiki.exception.WikiException; import org.dbwiki.web.request.HttpRequest; import org.dbwiki.web.request.parameter.RequestParameterAction; import org.dbwiki.web.server.DatabaseWikiProperties; import org.dbwiki.web.ui.HtmlContentGenerator; import org.dbwiki.web.ui.ServerResponseHandler; import org.dbwiki.web.ui.printer.server.DatabaseWikiFormPrinter;
import org.dbwiki.exception.*; import org.dbwiki.web.request.*; import org.dbwiki.web.request.parameter.*; import org.dbwiki.web.server.*; import org.dbwiki.web.ui.*; import org.dbwiki.web.ui.printer.server.*;
[ "org.dbwiki.exception", "org.dbwiki.web" ]
org.dbwiki.exception; org.dbwiki.web;
359,767
LinkedPosition p1= (LinkedPosition)o1; LinkedPosition p2= (LinkedPosition)o2; int i= p1.getSequenceNumber() - p2.getSequenceNumber(); if (i != 0) return i; return p1.getOffset() - p2.getOffset(); } } private static final Comparator fComparator= new SequenceComparator(); private final ArrayList fList; private int fSize; private int fIndex; private boolean fIsCycling= false; TabStopIterator(List positionSequence) { Assert.isNotNull(positionSequence); fList= new ArrayList(positionSequence); Collections.sort(fList, fComparator); fSize= fList.size(); fIndex= -1; Assert.isTrue(fSize > 0); }
LinkedPosition p1= (LinkedPosition)o1; LinkedPosition p2= (LinkedPosition)o2; int i= p1.getSequenceNumber() - p2.getSequenceNumber(); if (i != 0) return i; return p1.getOffset() - p2.getOffset(); } } private static final Comparator fComparator= new SequenceComparator(); private final ArrayList fList; private int fSize; private int fIndex; private boolean fIsCycling= false; TabStopIterator(List positionSequence) { Assert.isNotNull(positionSequence); fList= new ArrayList(positionSequence); Collections.sort(fList, fComparator); fSize= fList.size(); fIndex= -1; Assert.isTrue(fSize > 0); }
/** * {@inheritDoc} * * <p><code>o1</code> and <code>o2</code> are required to be instances * of <code>LinkedPosition</code>.</p> */
<code>o1</code> and <code>o2</code> are required to be instances of <code>LinkedPosition</code>
compare
{ "repo_name": "curiosag/ftc", "path": "org.cg.eclipse.plugins.ftc/src/org/cg/eclipse/plugins/ftc/template/TabStopIterator.java", "license": "gpl-3.0", "size": 6047 }
[ "java.util.ArrayList", "java.util.Collections", "java.util.Comparator", "java.util.List", "org.eclipse.core.runtime.Assert", "org.eclipse.jface.text.link.LinkedPosition" ]
import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; import org.eclipse.core.runtime.Assert; import org.eclipse.jface.text.link.LinkedPosition;
import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.jface.text.link.*;
[ "java.util", "org.eclipse.core", "org.eclipse.jface" ]
java.util; org.eclipse.core; org.eclipse.jface;
2,504,111
private Target getImage(String feature, String image) { Target target = null; URL url = this.getImageURL(feature, image); if (url != null) { target = new ImageTarget(url); } return target; }
Target function(String feature, String image) { Target target = null; URL url = this.getImageURL(feature, image); if (url != null) { target = new ImageTarget(url); } return target; }
/** * Gets the image. * * @param feature the feature * @param image the image * @return the image */
Gets the image
getImage
{ "repo_name": "rohitghatol/cucumber-sikuli-selenium-framework", "path": "src/main/java/com/synerzip/testframework/content/impl/ContentManagerImpl.java", "license": "apache-2.0", "size": 1604 }
[ "org.sikuli.api.ImageTarget", "org.sikuli.api.Target" ]
import org.sikuli.api.ImageTarget; import org.sikuli.api.Target;
import org.sikuli.api.*;
[ "org.sikuli.api" ]
org.sikuli.api;
454,877