method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public static Game play(IPacManController pacMan, IGhostsController ghosts) { SimulatorConfig config = new SimulatorConfig(); config.pacManController = pacMan; config.ghostsController = ghosts; config.replay = true; config.replayFile = new File("./replay.log"); return play(config); }
static Game function(IPacManController pacMan, IGhostsController ghosts) { SimulatorConfig config = new SimulatorConfig(); config.pacManController = pacMan; config.ghostsController = ghosts; config.replay = true; config.replayFile = new File(STR); return play(config); }
/** * Run simulation visualized with ghosts. * @param pacMan * @param ghosts * @return */
Run simulation visualized with ghosts
play
{ "repo_name": "kefik/MsPacMan-vs-Ghosts-AI", "path": "PacMan-vs-Ghosts/src/game/PacManSimulator.java", "license": "bsd-3-clause", "size": 11688 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,321,156
public LatLon getCenter() { return getState().center; }
LatLon function() { return getState().center; }
/** * Returns the current position of the center of the map. * * @return Coordinates of the center. */
Returns the current position of the center of the map
getCenter
{ "repo_name": "gpedro/GoogleMapsVaadin7", "path": "googlemaps/src/main/java/com/vaadin/tapio/googlemaps/GoogleMap.java", "license": "apache-2.0", "size": 23137 }
[ "com.vaadin.tapio.googlemaps.client.LatLon" ]
import com.vaadin.tapio.googlemaps.client.LatLon;
import com.vaadin.tapio.googlemaps.client.*;
[ "com.vaadin.tapio" ]
com.vaadin.tapio;
1,238,665
void setRolePermissionsFromTemplate(Group group, GroupPermissionTemplate template);
void setRolePermissionsFromTemplate(Group group, GroupPermissionTemplate template);
/** * Sets the role permissions for a group from one of the permission templates available * @param group The group for which the roles' permissions are being reset * @param template The template from which to draw the permissions */
Sets the role permissions for a group from one of the permission templates available
setRolePermissionsFromTemplate
{ "repo_name": "mokoka/grassroot-platform", "path": "grassroot-services/src/main/java/za/org/grassroot/services/PermissionBroker.java", "license": "bsd-3-clause", "size": 3686 }
[ "za.org.grassroot.core.domain.Group", "za.org.grassroot.services.group.GroupPermissionTemplate" ]
import za.org.grassroot.core.domain.Group; import za.org.grassroot.services.group.GroupPermissionTemplate;
import za.org.grassroot.core.domain.*; import za.org.grassroot.services.group.*;
[ "za.org.grassroot" ]
za.org.grassroot;
680,874
public boolean removeFromPlaylist(INotifiableManager manager, int position) { return false; //mConnection.getBoolean(manager, "RemoveFromPlaylist", PLAYLIST_ID + ";" + position); }
boolean function(INotifiableManager manager, int position) { return false; }
/** * Removes media from the current playlist. It is not possible to remove the media if it is currently being played. * @param position Position to remove, starting with 0. * @return True on success, false otherwise. */
Removes media from the current playlist. It is not possible to remove the media if it is currently being played
removeFromPlaylist
{ "repo_name": "r00li/RHome", "path": "Android/RHome/lib-src/org/xbmc/jsonrpc/client/MusicClient.java", "license": "gpl-3.0", "size": 37620 }
[ "org.xbmc.api.business.INotifiableManager" ]
import org.xbmc.api.business.INotifiableManager;
import org.xbmc.api.business.*;
[ "org.xbmc.api" ]
org.xbmc.api;
383,792
public void addToolTipSeries(List toolTips) { this.toolTipSeries.add(toolTips); }
void function(List toolTips) { this.toolTipSeries.add(toolTips); }
/** * Adds a list of tooltips for a series. * * @param toolTips the list of tool tips. */
Adds a list of tooltips for a series
addToolTipSeries
{ "repo_name": "fluidware/Eastwood-Charts", "path": "source/org/jfree/chart/labels/CustomXYToolTipGenerator.java", "license": "lgpl-2.1", "size": 6252 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,070,617
T visit(YamlOrderedMapNode node);
T visit(YamlOrderedMapNode node);
/** * Visit a {@link YamlOrderedMapNode}. * * @param node the node to visit * * @return the returned value */
Visit a <code>YamlOrderedMapNode</code>
visit
{ "repo_name": "autermann/yaml", "path": "src/main/java/com/github/autermann/yaml/ReturningYamlNodeVisitor.java", "license": "apache-2.0", "size": 3588 }
[ "com.github.autermann.yaml.nodes.YamlOrderedMapNode" ]
import com.github.autermann.yaml.nodes.YamlOrderedMapNode;
import com.github.autermann.yaml.nodes.*;
[ "com.github.autermann" ]
com.github.autermann;
601,563
private MethodSymbol firstUndef(ClassSymbol impl, ClassSymbol c) { MethodSymbol undef = null; if (c == impl || (c.flags() & (ABSTRACT | INTERFACE)) != 0) { Scope s = c.members(); for (Scope.Entry e = s.elems; undef == null && e != null; e = e.sibling) { if (e.sym.kind == MTH && (e.sym.flags() & (...
MethodSymbol function(ClassSymbol impl, ClassSymbol c) { MethodSymbol undef = null; if (c == impl (c.flags() & (ABSTRACT INTERFACE)) != 0) { Scope s = c.members(); for (Scope.Entry e = s.elems; undef == null && e != null; e = e.sibling) { if (e.sym.kind == MTH && (e.sym.flags() & (ABSTRACT IPROXY)) == ABSTRACT) { Metho...
/** * Return first abstract member of class `c' that is not defined in `impl', * null if there is none. */
Return first abstract member of class `c' that is not defined in `impl', null if there is none
firstUndef
{ "repo_name": "nileshpatelksy/hello-pod-cast", "path": "archive/FILE/Compiler/java_GJC1.42_src/src/com/sun/tools/javac/v8/comp/Check.java", "license": "apache-2.0", "size": 33653 }
[ "com.sun.tools.javac.v8.code.Scope", "com.sun.tools.javac.v8.code.Symbol", "com.sun.tools.javac.v8.code.Type", "com.sun.tools.javac.v8.util.List" ]
import com.sun.tools.javac.v8.code.Scope; 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.code.*; import com.sun.tools.javac.v8.util.*;
[ "com.sun.tools" ]
com.sun.tools;
373,759
public void setUnresponsiveContacts(List<Node> contacts);
void function(List<Node> contacts);
/** * Method used by operations to notify the routing table of any contacts that have been unresponsive. * * @param contacts The set of unresponsive contacts */
Method used by operations to notify the routing table of any contacts that have been unresponsive
setUnresponsiveContacts
{ "repo_name": "JoshuaKissoon/Kademlia", "path": "src/kademlia/routing/KademliaRoutingTable.java", "license": "mit", "size": 2422 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
758,569
public IndexReaderContext getTopReaderContext() { return readerContext; } private static final class SearcherCallableNoSort implements Callable<TopDocs> { private final Lock lock; private final IndexSearcher searcher; private final Weight weight; private final ScoreDoc after; priva...
IndexReaderContext function() { return readerContext; } private static final class SearcherCallableNoSort implements Callable<TopDocs> { private final Lock lock; private final IndexSearcher searcher; private final Weight weight; private final ScoreDoc after; private final int nDocs; private final HitQueue hq; private f...
/** * Returns this searchers the top-level {@link IndexReaderContext}. * @see IndexReader#getContext() */
Returns this searchers the top-level <code>IndexReaderContext</code>
getTopReaderContext
{ "repo_name": "pengzong1111/solr4", "path": "lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java", "license": "apache-2.0", "size": 37398 }
[ "java.util.concurrent.Callable", "java.util.concurrent.locks.Lock", "org.apache.lucene.index.IndexReaderContext" ]
import java.util.concurrent.Callable; import java.util.concurrent.locks.Lock; import org.apache.lucene.index.IndexReaderContext;
import java.util.concurrent.*; import java.util.concurrent.locks.*; import org.apache.lucene.index.*;
[ "java.util", "org.apache.lucene" ]
java.util; org.apache.lucene;
862,095
public DocFileVersionPersistence getDocFileVersionPersistence() { return docFileVersionPersistence; }
DocFileVersionPersistence function() { return docFileVersionPersistence; }
/** * Returns the doc file version persistence. * * @return the doc file version persistence */
Returns the doc file version persistence
getDocFileVersionPersistence
{ "repo_name": "thongdv/OEPv2", "path": "portlets/oep-core-dossiermgt-portlet/docroot/WEB-INF/src/org/oep/core/dossiermgt/service/base/DossierFolder2RoleServiceBaseImpl.java", "license": "apache-2.0", "size": 36759 }
[ "org.oep.core.dossiermgt.service.persistence.DocFileVersionPersistence" ]
import org.oep.core.dossiermgt.service.persistence.DocFileVersionPersistence;
import org.oep.core.dossiermgt.service.persistence.*;
[ "org.oep.core" ]
org.oep.core;
1,984,053
public static HTableInterface newMetaTable( KijiURI kijiURI, Configuration conf, HTableInterfaceFactory factory) throws IOException { return factory.create( conf, KijiManagedHBaseTableName.getMetaTableName(kijiURI.getInstance()).toString()); } public HBaseMetaTable(...
static HTableInterface function( KijiURI kijiURI, Configuration conf, HTableInterfaceFactory factory) throws IOException { return factory.create( conf, KijiManagedHBaseTableName.getMetaTableName(kijiURI.getInstance()).toString()); } public HBaseMetaTable( KijiURI kijiURI, Configuration conf, KijiSchemaTable schemaTable...
/** * Creates an HTableInterface for the specified table. * * @param kijiURI the KijiURI. * @param conf Hadoop configuration. * @param factory HTableInterface factory to use. * @return a new HTableInterface for the specified table. * @throws IOException on I/O error. */
Creates an HTableInterface for the specified table
newMetaTable
{ "repo_name": "zenoss/kiji-schema", "path": "kiji-schema/src/main/java/org/kiji/schema/impl/HBaseMetaTable.java", "license": "apache-2.0", "size": 13233 }
[ "java.io.IOException", "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.hbase.client.HTableInterface", "org.kiji.schema.KijiSchemaTable", "org.kiji.schema.KijiTableKeyValueDatabase", "org.kiji.schema.KijiURI", "org.kiji.schema.hbase.KijiManagedHBaseTableName", "org.kiji.schema.layout.KijiTab...
import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.client.HTableInterface; import org.kiji.schema.KijiSchemaTable; import org.kiji.schema.KijiTableKeyValueDatabase; import org.kiji.schema.KijiURI; import org.kiji.schema.hbase.KijiManagedHBaseTableName; import org.kij...
import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.hbase.client.*; import org.kiji.schema.*; import org.kiji.schema.hbase.*; import org.kiji.schema.layout.*; import org.kiji.schema.layout.impl.*;
[ "java.io", "org.apache.hadoop", "org.kiji.schema" ]
java.io; org.apache.hadoop; org.kiji.schema;
1,623,208
public int setBalancerBandwidth(String[] argv, int idx) throws IOException { long bandwidth; int exitCode = -1; try { bandwidth = StringUtils.TraditionalBinaryPrefix.string2long(argv[idx]); } catch (NumberFormatException nfe) { System.err.println("NumberFormatException: " + nfe.getMessage...
int function(String[] argv, int idx) throws IOException { long bandwidth; int exitCode = -1; try { bandwidth = StringUtils.TraditionalBinaryPrefix.string2long(argv[idx]); } catch (NumberFormatException nfe) { System.err.println(STR + nfe.getMessage()); System.err.println(STR + STR); return exitCode; } if (bandwidth < 0...
/** * Command to ask the active namenode to set the balancer bandwidth. * Usage: hdfs dfsadmin -setBalancerBandwidth bandwidth * @param argv List of of command line parameters. * @param idx The index of the command that is being processed. * @exception IOException */
Command to ask the active namenode to set the balancer bandwidth. Usage: hdfs dfsadmin -setBalancerBandwidth bandwidth
setBalancerBandwidth
{ "repo_name": "steveloughran/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java", "license": "apache-2.0", "size": 99688 }
[ "java.io.IOException", "org.apache.hadoop.fs.shell.Command", "org.apache.hadoop.hdfs.DistributedFileSystem", "org.apache.hadoop.util.StringUtils" ]
import java.io.IOException; import org.apache.hadoop.fs.shell.Command; import org.apache.hadoop.hdfs.DistributedFileSystem; import org.apache.hadoop.util.StringUtils;
import java.io.*; import org.apache.hadoop.fs.shell.*; import org.apache.hadoop.hdfs.*; import org.apache.hadoop.util.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
239,165
public static void setCause(Throwable onObject, Throwable cause) { if (causesAllowed) { try { Method method = onObject.getClass().getMethod("initCause", new Class[]{Throwable.class}); method.invoke(onObject, new Object[]{cause}); ...
static void function(Throwable onObject, Throwable cause) { if (causesAllowed) { try { Method method = onObject.getClass().getMethod(STR, new Class[]{Throwable.class}); method.invoke(onObject, new Object[]{cause}); } catch (RuntimeException e) { throw e; } catch (Exception e) { causesAllowed = false; } } }
/** * Set the cause of the Exception. Will detect if this is not allowed. * @param onObject * @param cause */
Set the cause of the Exception. Will detect if this is not allowed
setCause
{ "repo_name": "1CharlesStern/Web-XMLVerifier", "path": "src/main/java/org/apache/velocity/util/ExceptionUtils.java", "license": "apache-2.0", "size": 3919 }
[ "java.lang.reflect.Method" ]
import java.lang.reflect.Method;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
2,084,309
public void bindTo(String fileName, BufferedPositionedInputStream is, long offset, long end) throws IOException { this.istream = is; this.in = new LineReader(istream); if (this.deserializer instanceof PigStreamingBase) { this.newDeserializer = (PigStreamin...
void function(String fileName, BufferedPositionedInputStream is, long offset, long end) throws IOException { this.istream = is; this.in = new LineReader(istream); if (this.deserializer instanceof PigStreamingBase) { this.newDeserializer = (PigStreamingBase) deserializer; } }
/** * Bind the <code>OutputHandler</code> to the <code>InputStream</code> * from which to read the output data of the managed process. * * @param is <code>InputStream</code> from which to read the output data * of the managed process * @throws IOException */
Bind the <code>OutputHandler</code> to the <code>InputStream</code> from which to read the output data of the managed process
bindTo
{ "repo_name": "kexianda/pig", "path": "src/org/apache/pig/impl/streaming/OutputHandler.java", "license": "apache-2.0", "size": 6049 }
[ "java.io.IOException", "org.apache.hadoop.util.LineReader", "org.apache.pig.PigStreamingBase", "org.apache.pig.impl.io.BufferedPositionedInputStream" ]
import java.io.IOException; import org.apache.hadoop.util.LineReader; import org.apache.pig.PigStreamingBase; import org.apache.pig.impl.io.BufferedPositionedInputStream;
import java.io.*; import org.apache.hadoop.util.*; import org.apache.pig.*; import org.apache.pig.impl.io.*;
[ "java.io", "org.apache.hadoop", "org.apache.pig" ]
java.io; org.apache.hadoop; org.apache.pig;
699,647
public Observable<ServiceResponse<ServerInner>> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String serverName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); ...
Observable<ServiceResponse<ServerInner>> function(String resourceGroupName, String serverName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (serverName == null) { throw new IllegalArgumentException...
/** * Gets information about a server. * * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if pa...
Gets information about a server
getByResourceGroupWithServiceResponseAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/postgresql/mgmt-v2017_12_01/src/main/java/com/microsoft/azure/management/postgresql/v2017_12_01/implementation/ServersInner.java", "license": "mit", "size": 61570 }
[ "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
2,886,032
public static boolean isOnboarding(Context context) { return PrivacyPreferencesManager.getInstance(context).isPhysicalWebOnboarding(); }
static boolean function(Context context) { return PrivacyPreferencesManager.getInstance(context).isPhysicalWebOnboarding(); }
/** * Checks whether the Physical Web onboard flow is active and the user has * not yet elected to either enable or decline the feature. * * @param context An instance of android.content.Context * @return boolean {@code true} if onboarding is complete. */
Checks whether the Physical Web onboard flow is active and the user has not yet elected to either enable or decline the feature
isOnboarding
{ "repo_name": "joone/chromium-crosswalk", "path": "chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java", "license": "bsd-3-clause", "size": 5250 }
[ "android.content.Context", "org.chromium.chrome.browser.preferences.privacy.PrivacyPreferencesManager" ]
import android.content.Context; import org.chromium.chrome.browser.preferences.privacy.PrivacyPreferencesManager;
import android.content.*; import org.chromium.chrome.browser.preferences.privacy.*;
[ "android.content", "org.chromium.chrome" ]
android.content; org.chromium.chrome;
2,158,200
@Override public void initApplicationContext() throws ApplicationContextException { super.initApplicationContext(); detectHandlers(); }
void function() throws ApplicationContextException { super.initApplicationContext(); detectHandlers(); }
/** * Calls the {@link #detectHandlers()} method in addition to the * superclass's initialization. */
Calls the <code>#detectHandlers()</code> method in addition to the superclass's initialization
initApplicationContext
{ "repo_name": "leogoing/spring_jeesite", "path": "spring-webmvc-4.0/org/springframework/web/servlet/handler/AbstractDetectingUrlHandlerMapping.java", "license": "apache-2.0", "size": 3979 }
[ "org.springframework.context.ApplicationContextException" ]
import org.springframework.context.ApplicationContextException;
import org.springframework.context.*;
[ "org.springframework.context" ]
org.springframework.context;
2,856,944
protected String pos(Transcript tr, int start, int end) { // Only one position needed? String posStart = pos(tr, start); if (posStart == null) return null; if (start == end) return posStart; // Both position needed String posEnd = pos(tr, end); if (posEnd == null) return null; return posStart + "_" ...
String function(Transcript tr, int start, int end) { String posStart = pos(tr, start); if (posStart == null) return null; if (start == end) return posStart; String posEnd = pos(tr, end); if (posEnd == null) return null; return posStart + "_" + posEnd; }
/** * Position string given two coordinates */
Position string given two coordinates
pos
{ "repo_name": "BGI-flexlab/SOAPgaeaDevelopment4.0", "path": "src/main/java/org/bgi/flexlab/gaea/tools/annotator/effect/HgvsProtein.java", "license": "gpl-3.0", "size": 24641 }
[ "org.bgi.flexlab.gaea.tools.annotator.interval.Transcript" ]
import org.bgi.flexlab.gaea.tools.annotator.interval.Transcript;
import org.bgi.flexlab.gaea.tools.annotator.interval.*;
[ "org.bgi.flexlab" ]
org.bgi.flexlab;
2,504,126
public Zendesk getZendesk() { return zendesk; }
Zendesk function() { return zendesk; }
/** * To use a shared {@link Zendesk} instance. * * @return the shared Zendesk instance */
To use a shared <code>Zendesk</code> instance
getZendesk
{ "repo_name": "Fabryprog/camel", "path": "components/camel-zendesk/src/main/java/org/apache/camel/component/zendesk/ZendeskComponent.java", "license": "apache-2.0", "size": 3511 }
[ "org.zendesk.client.v2.Zendesk" ]
import org.zendesk.client.v2.Zendesk;
import org.zendesk.client.v2.*;
[ "org.zendesk.client" ]
org.zendesk.client;
2,781,870
public static InputStream toInputStream(File file, String charset) throws IOException { if (charset != null) { return new EncodingInputStream(file, charset); } else { return toInputStream(file); } }
static InputStream function(File file, String charset) throws IOException { if (charset != null) { return new EncodingInputStream(file, charset); } else { return toInputStream(file); } }
/** * Converts the given {@link File} with the given charset to {@link InputStream} with the JVM default charset * * @param file the file to be converted * @param charset the charset the file is read with * @return the input stream with the JVM default charset */
Converts the given <code>File</code> with the given charset to <code>InputStream</code> with the JVM default charset
toInputStream
{ "repo_name": "onders86/camel", "path": "camel-core/src/main/java/org/apache/camel/converter/IOConverter.java", "license": "apache-2.0", "size": 19353 }
[ "java.io.File", "java.io.IOException", "java.io.InputStream" ]
import java.io.File; import java.io.IOException; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
830,474
protected Operation getWithAnyKey(Region aRegion) { int randInt = TestConfig.tab().getRandGen().nextInt(1, 100); if (randInt <= 33) { // try an existing key Object key = TxUtil.txUtilInstance.getRandomKey(aRegion); if (key != null) { return TxUtil.txUtilInstance.getEntry(aRegion, key, Operati...
Operation function(Region aRegion) { int randInt = TestConfig.tab().getRandGen().nextInt(1, 100); if (randInt <= 33) { Object key = TxUtil.txUtilInstance.getRandomKey(aRegion); if (key != null) { return TxUtil.txUtilInstance.getEntry(aRegion, key, Operation.ENTRY_GET_EXIST_KEY); } } if (TestConfig.tab().getRandGen().ne...
/** Do a get with any key (existing, previous or new). * * @param aRegion The region to do the get on. * * @returns An operation describing the get. */
Do a get with any key (existing, previous or new)
getWithAnyKey
{ "repo_name": "SnappyDataInc/snappy-store", "path": "tests/core/src/main/java/tx/BridgeConflictTest.java", "license": "apache-2.0", "size": 69742 }
[ "com.gemstone.gemfire.cache.Region" ]
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.*;
[ "com.gemstone.gemfire" ]
com.gemstone.gemfire;
689,771
private PathPoint getSafePoint(Entity p_75858_1_, int p_75858_2_, int p_75858_3_, int p_75858_4_, PathPoint p_75858_5_, int p_75858_6_) { PathPoint var7 = null; int var8 = this.getVerticalOffset(p_75858_1_, p_75858_2_, p_75858_3_, p_75858_4_, p_75858_5_); if (var8 == 2) { ...
PathPoint function(Entity p_75858_1_, int p_75858_2_, int p_75858_3_, int p_75858_4_, PathPoint p_75858_5_, int p_75858_6_) { PathPoint var7 = null; int var8 = this.getVerticalOffset(p_75858_1_, p_75858_2_, p_75858_3_, p_75858_4_, p_75858_5_); if (var8 == 2) { return this.openPoint(p_75858_2_, p_75858_3_, p_75858_4_); ...
/** * Returns a point that the entity can safely move to */
Returns a point that the entity can safely move to
getSafePoint
{ "repo_name": "TheHecticByte/BananaJ1.7.10Beta", "path": "src/net/minecraft/Server1_7_10/pathfinding/PathFinder.java", "license": "gpl-3.0", "size": 14888 }
[ "net.minecraft.Server1_7_10" ]
import net.minecraft.Server1_7_10;
import net.minecraft.*;
[ "net.minecraft" ]
net.minecraft;
807,298
EList<Transition> getOutgoingTransitions();
EList<Transition> getOutgoingTransitions();
/** * Returns the value of the '<em><b>Outgoing Transitions</b></em>' reference list. * The list contents are of type {@link org.obeonetwork.dsl.east_adl.behavior.Transition}. * It is bidirectional and its opposite is '{@link org.obeonetwork.dsl.east_adl.behavior.Transition#getSource <em>Source</em>}'. * <!-- b...
Returns the value of the 'Outgoing Transitions' reference list. The list contents are of type <code>org.obeonetwork.dsl.east_adl.behavior.Transition</code>. It is bidirectional and its opposite is '<code>org.obeonetwork.dsl.east_adl.behavior.Transition#getSource Source</code>'. If the meaning of the 'Outgoing Transitio...
getOutgoingTransitions
{ "repo_name": "ObeoNetwork/EAST-ADL-Designer", "path": "plugins/org.obeonetwork.dsl.eastadl/src/org/obeonetwork/dsl/east_adl/behavior/State.java", "license": "epl-1.0", "size": 3365 }
[ "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;
594,373
protected Criterion unsupported(Filter<?> filter) { LOG.warn("Unsupported filter: {}", filter); return isUnsupportedIsTrue() ? MoreRestrictions.alwaysTrue() : MoreRestrictions.alwaysFalse(); }
Criterion function(Filter<?> filter) { LOG.warn(STR, filter); return isUnsupportedIsTrue() ? MoreRestrictions.alwaysTrue() : MoreRestrictions.alwaysFalse(); }
/** * Creates a criterion for an unsupported filter. * * @param filter the filter * * @return the restriction */
Creates a criterion for an unsupported filter
unsupported
{ "repo_name": "SpeckiJ/dao-series-api", "path": "dao/src/main/java/org/n52/series/db/dao/FESCriterionGenerator.java", "license": "gpl-3.0", "size": 49796 }
[ "org.hibernate.criterion.Criterion", "org.hibernate.criterion.MoreRestrictions", "org.n52.shetland.ogc.filter.Filter" ]
import org.hibernate.criterion.Criterion; import org.hibernate.criterion.MoreRestrictions; import org.n52.shetland.ogc.filter.Filter;
import org.hibernate.criterion.*; import org.n52.shetland.ogc.filter.*;
[ "org.hibernate.criterion", "org.n52.shetland" ]
org.hibernate.criterion; org.n52.shetland;
1,332,310
private static void configureClearText(SocketChannel ch) { final ChannelPipeline p = ch.pipeline(); final HttpServerCodec sourceCodec = new HttpServerCodec();
static void function(SocketChannel ch) { final ChannelPipeline p = ch.pipeline(); final HttpServerCodec sourceCodec = new HttpServerCodec();
/** * Configure the pipeline for a cleartext upgrade from HTTP to HTTP/2. */
Configure the pipeline for a cleartext upgrade from HTTP to HTTP/2
configureClearText
{ "repo_name": "nayato/netty", "path": "example/src/main/java/io/netty/example/http2/helloworld/server/Http2ServerInitializer.java", "license": "apache-2.0", "size": 4120 }
[ "io.netty.channel.ChannelPipeline", "io.netty.channel.socket.SocketChannel", "io.netty.handler.codec.http.HttpServerCodec" ]
import io.netty.channel.ChannelPipeline; import io.netty.channel.socket.SocketChannel; import io.netty.handler.codec.http.HttpServerCodec;
import io.netty.channel.*; import io.netty.channel.socket.*; import io.netty.handler.codec.http.*;
[ "io.netty.channel", "io.netty.handler" ]
io.netty.channel; io.netty.handler;
1,546,444
public boolean fullScroll(int direction) { boolean down = direction == View.FOCUS_DOWN; boolean right = direction == View.FOCUS_RIGHT; int width = getWidth(); int height = getHeight(); mTempRect.left = 0; mTempRect.top = 0; mTempRect.right = width; mTempRect.bottom = height; if (right) { int c...
boolean function(int direction) { boolean down = direction == View.FOCUS_DOWN; boolean right = direction == View.FOCUS_RIGHT; int width = getWidth(); int height = getHeight(); mTempRect.left = 0; mTempRect.top = 0; mTempRect.right = width; mTempRect.bottom = height; if (right) { int count = getChildCount(); if (count >...
/** * <p> * Handles scrolling in response to a "home/end" shortcut press. This method * will scroll the view to the top or bottom and give the focus to the * topmost/bottommost component in the new visible area. If no component is * a good candidate for focus, this scrollview reclaims the focus. * </p> * ...
Handles scrolling in response to a "home/end" shortcut press. This method will scroll the view to the top or bottom and give the focus to the topmost/bottommost component in the new visible area. If no component is a good candidate for focus, this scrollview reclaims the focus.
fullScroll
{ "repo_name": "pfalcon/PhotoTvViewer", "path": "src/net/kervala/comicsreader/FullScrollView.java", "license": "gpl-3.0", "size": 47267 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
1,312,090
protected void playSounds(boolean doAudioReplay) { boolean replayQuestion = getConfigForCurrentCard().optBoolean("replayq", true); if (getConfigForCurrentCard().optBoolean("autoplay", false) || doAudioReplay) { // Use TTS if TTS preference enabled and no other sound source b...
void function(boolean doAudioReplay) { boolean replayQuestion = getConfigForCurrentCard().optBoolean(STR, true); if (getConfigForCurrentCard().optBoolean(STR, false) doAudioReplay) { boolean useTTS = mSpeakText && !(sDisplayAnswer && mSoundPlayer.hasAnswer()) && !(!sDisplayAnswer && mSoundPlayer.hasQuestion()); if (!us...
/** * Plays sounds (or TTS, if configured) for currently shown side of card. * * @param doAudioReplay indicates an anki desktop-like replay call is desired, whose behavior is identical to * pressing the keyboard shortcut R on the desktop */
Plays sounds (or TTS, if configured) for currently shown side of card
playSounds
{ "repo_name": "StKotok/Anki-Android", "path": "AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.java", "license": "gpl-3.0", "size": 111480 }
[ "com.ichi2.libanki.Sound" ]
import com.ichi2.libanki.Sound;
import com.ichi2.libanki.*;
[ "com.ichi2.libanki" ]
com.ichi2.libanki;
1,937,457
public void notifySuccess(ClientRequest req, ObjectContainer container);
void function(ClientRequest req, ObjectContainer container);
/** * Callback called when a request succeeds. */
Callback called when a request succeeds
notifySuccess
{ "repo_name": "saces/fred", "path": "src/freenet/node/fcp/RequestCompletionCallback.java", "license": "gpl-2.0", "size": 487 }
[ "com.db4o.ObjectContainer" ]
import com.db4o.ObjectContainer;
import com.db4o.*;
[ "com.db4o" ]
com.db4o;
2,100,496
private ZWaveDbProductFile LoadProductFile() { // If the file is already loaded, then just return the class if (productFile != null) { return productFile; } // Have we selected a product? if (selProduct == null) { return null; } String cfgFile = selProduct.getConfigFile(productVersion); if(cf...
ZWaveDbProductFile function() { if (productFile != null) { return productFile; } if (selProduct == null) { return null; } String cfgFile = selProduct.getConfigFile(productVersion); if(cfgFile == null cfgFile.isEmpty()) { return null; } URL entry = FrameworkUtil.getBundle(ZWaveProductDatabase.class).getEntry(STR + cfgFi...
/** * Loads the product file relating to the requested version. * @param version the required device version * @return filename of the product file */
Loads the product file relating to the requested version
LoadProductFile
{ "repo_name": "kbialek/openhab", "path": "bundles/binding/org.openhab.binding.zwave/src/main/java/org/openhab/binding/zwave/internal/config/ZWaveProductDatabase.java", "license": "epl-1.0", "size": 10775 }
[ "com.thoughtworks.xstream.XStream", "com.thoughtworks.xstream.io.xml.StaxDriver", "java.io.IOException", "java.io.InputStream", "org.osgi.framework.FrameworkUtil" ]
import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.io.xml.StaxDriver; import java.io.IOException; import java.io.InputStream; import org.osgi.framework.FrameworkUtil;
import com.thoughtworks.xstream.*; import com.thoughtworks.xstream.io.xml.*; import java.io.*; import org.osgi.framework.*;
[ "com.thoughtworks.xstream", "java.io", "org.osgi.framework" ]
com.thoughtworks.xstream; java.io; org.osgi.framework;
2,747,551
public java.util.List<fr.lip6.move.pnml.hlpn.finiteEnumerations.hlapi.FiniteEnumerationHLAPI> getInput_finiteEnumerations_FiniteEnumerationHLAPI(){ java.util.List<fr.lip6.move.pnml.hlpn.finiteEnumerations.hlapi.FiniteEnumerationHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.finiteEnumerations.hlapi.Finite...
java.util.List<fr.lip6.move.pnml.hlpn.finiteEnumerations.hlapi.FiniteEnumerationHLAPI> function(){ java.util.List<fr.lip6.move.pnml.hlpn.finiteEnumerations.hlapi.FiniteEnumerationHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.finiteEnumerations.hlapi.FiniteEnumerationHLAPI>(); for (Sort elemnt : getInput()) { if(...
/** * This accessor return a list of encapsulated subelement, only of FiniteEnumerationHLAPI kind. * WARNING : this method can creates a lot of new object in memory. */
This accessor return a list of encapsulated subelement, only of FiniteEnumerationHLAPI kind. WARNING : this method can creates a lot of new object in memory
getInput_finiteEnumerations_FiniteEnumerationHLAPI
{ "repo_name": "lhillah/pnmlframework", "path": "pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/finiteIntRanges/hlapi/GreaterThanHLAPI.java", "license": "epl-1.0", "size": 108747 }
[ "fr.lip6.move.pnml.hlpn.terms.Sort", "java.util.ArrayList", "java.util.List" ]
import fr.lip6.move.pnml.hlpn.terms.Sort; import java.util.ArrayList; import java.util.List;
import fr.lip6.move.pnml.hlpn.terms.*; import java.util.*;
[ "fr.lip6.move", "java.util" ]
fr.lip6.move; java.util;
1,531,750
public void groupAlignmentTracks(AlignmentTrack.GroupOption option, String tag, Range pos) { final IGVPreferences prefMgr = PreferencesManager.getPreferences(); prefMgr.put(SAM_GROUP_OPTION, option.toString()); if (option == AlignmentTrack.GroupOption.TAG && tag != null) { prefMgr.put(SAM_GROUP_BY_TAG, tag)...
void function(AlignmentTrack.GroupOption option, String tag, Range pos) { final IGVPreferences prefMgr = PreferencesManager.getPreferences(); prefMgr.put(SAM_GROUP_OPTION, option.toString()); if (option == AlignmentTrack.GroupOption.TAG && tag != null) { prefMgr.put(SAM_GROUP_BY_TAG, tag); } if (option == AlignmentTrac...
/** * Group all alignment tracks by the specified option. * * @param option * @api */
Group all alignment tracks by the specified option
groupAlignmentTracks
{ "repo_name": "popitsch/varan-gie", "path": "src/org/broad/igv/ui/IGV.java", "license": "mit", "size": 83654 }
[ "org.broad.igv.feature.Range", "org.broad.igv.prefs.IGVPreferences", "org.broad.igv.prefs.PreferencesManager", "org.broad.igv.sam.AlignmentTrack", "org.broad.igv.track.Track" ]
import org.broad.igv.feature.Range; import org.broad.igv.prefs.IGVPreferences; import org.broad.igv.prefs.PreferencesManager; import org.broad.igv.sam.AlignmentTrack; import org.broad.igv.track.Track;
import org.broad.igv.feature.*; import org.broad.igv.prefs.*; import org.broad.igv.sam.*; import org.broad.igv.track.*;
[ "org.broad.igv" ]
org.broad.igv;
61,665
public int getValueU8AsInt() { try { final Element fsApiResult = (Element) xmlDoc.getElementsByTagName("fsapiResponse").item(0); final Element valueNode = (Element) fsApiResult.getElementsByTagName("value").item(0); final Element u8Node = (Element) valueNode.getElementsBy...
int function() { try { final Element fsApiResult = (Element) xmlDoc.getElementsByTagName(STR).item(0); final Element valueNode = (Element) fsApiResult.getElementsByTagName("value").item(0); final Element u8Node = (Element) valueNode.getElementsByTagName("u8").item(0); final String value = getCharacterDataFromElement(u8...
/** * read the &lt;value&gt;&lt;u8&gt; field as int * * @return value.u8 field as int */
read the &lt;value&gt;&lt;u8&gt; field as int
getValueU8AsInt
{ "repo_name": "idserda/openhab", "path": "bundles/binding/org.openhab.binding.frontiersiliconradio/src/main/java/org/openhab/binding/frontiersiliconradio/internal/FrontierSiliconRadioApiResult.java", "license": "epl-1.0", "size": 7691 }
[ "org.w3c.dom.Element" ]
import org.w3c.dom.Element;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
1,642,100
public PackedInts.Reader getFirstOrdinals() { return ordinals.firstOrdinals; }
PackedInts.Reader function() { return ordinals.firstOrdinals; }
/** * Return a {@link org.apache.lucene.util.packed.PackedInts.Reader} instance mapping every doc ID to its first ordinal + 1 if it exists and 0 otherwise. */
Return a <code>org.apache.lucene.util.packed.PackedInts.Reader</code> instance mapping every doc ID to its first ordinal + 1 if it exists and 0 otherwise
getFirstOrdinals
{ "repo_name": "jchampion/elasticsearch", "path": "core/src/main/java/org/elasticsearch/index/fielddata/ordinals/OrdinalsBuilder.java", "license": "apache-2.0", "size": 20503 }
[ "org.apache.lucene.util.packed.PackedInts" ]
import org.apache.lucene.util.packed.PackedInts;
import org.apache.lucene.util.packed.*;
[ "org.apache.lucene" ]
org.apache.lucene;
2,108,678
public static List<String> loadLines(String file){ ArrayList<String> rows = new ArrayList<>(); try( BufferedReader reader = new BufferedReader(new FileReader(file))){ String line; while( ( line = reader.readLine() ) != null ){ rows.add(line); } }catch(IOException e){ System.err.println("Detec...
static List<String> function(String file){ ArrayList<String> rows = new ArrayList<>(); try( BufferedReader reader = new BufferedReader(new FileReader(file))){ String line; while( ( line = reader.readLine() ) != null ){ rows.add(line); } }catch(IOException e){ System.err.println(STR + file); return null; } return rows; ...
/** * Load the lines from a local text file into a list of strings. * * @param file path of the file whose line must be loaded * @return the list of lines */
Load the lines from a local text file into a list of strings
loadLines
{ "repo_name": "neskov7/OOP4Schools", "path": "src/it/polito/utility/LineUtils.java", "license": "mit", "size": 2618 }
[ "java.io.BufferedReader", "java.io.FileReader", "java.io.IOException", "java.util.ArrayList", "java.util.List" ]
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.List;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,925,267
public void setPrefixLength(short prefixLength) { this.prefixLength = prefixLength; } // setPrefixLength @XmlType(name = "NextHopIPRouteAddressTypeEnum") public enum AddressType { UNKNOWN, IPV4, IPV6 } private AddressType addressType;
void function(short prefixLength) { this.prefixLength = prefixLength; } @XmlType(name = STR) public enum AddressType { UNKNOWN, IPV4, IPV6 } private AddressType addressType;
/** * This method sets the NextHopIPRoute.prefixLength property value. This property is described as follows: * * The prefix length for the IPv6 destination address. * * @param short new prefixLength property value * @exception Exception */
This method sets the NextHopIPRoute.prefixLength property value. This property is described as follows: The prefix length for the IPv6 destination address
setPrefixLength
{ "repo_name": "dana-i2cat/opennaas", "path": "extensions/bundles/router.model/src/main/java/org/opennaas/extensions/router/model/NextHopIPRoute.java", "license": "lgpl-3.0", "size": 6807 }
[ "javax.xml.bind.annotation.XmlType" ]
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.*;
[ "javax.xml" ]
javax.xml;
250,347
private static long days(long numDays) { return Utilities.convertTime("days", numDays); }
static long function(long numDays) { return Utilities.convertTime("days", numDays); }
/** * Readability helper for the above test case. Turn days into time. * @param numDays Number of days * @return Amount to add to timestamp */
Readability helper for the above test case. Turn days into time
days
{ "repo_name": "cjduffett/synthea", "path": "src/test/java/org/mitre/synthea/engine/StateTest.java", "license": "apache-2.0", "size": 48471 }
[ "org.mitre.synthea.helpers.Utilities" ]
import org.mitre.synthea.helpers.Utilities;
import org.mitre.synthea.helpers.*;
[ "org.mitre.synthea" ]
org.mitre.synthea;
28,922
public Account getAccount() { return account; }
Account function() { return account; }
/** * Returns account object associated with this connection * * @return account object associated with this connection */
Returns account object associated with this connection
getAccount
{ "repo_name": "Estada1401/anuwhscript", "path": "GameServer/src/com/aionemu/gameserver/network/aion/AionConnection.java", "license": "gpl-3.0", "size": 15220 }
[ "com.aionemu.gameserver.model.account.Account" ]
import com.aionemu.gameserver.model.account.Account;
import com.aionemu.gameserver.model.account.*;
[ "com.aionemu.gameserver" ]
com.aionemu.gameserver;
971,997
@Override public List<T> items() { return items; }
List<T> function() { return items; }
/** * Gets the list of items. * * @return the list of items in {@link List}. */
Gets the list of items
items
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/recoveryservices.siterecovery/mgmt-v2018_01_10/src/main/java/com/microsoft/azure/management/recoveryservices/siterecovery/v2018_01_10/implementation/PageImpl.java", "license": "mit", "size": 1779 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,094,632
EAttribute getDonation_Beneficiary1();
EAttribute getDonation_Beneficiary1();
/** * Returns the meta object for the attribute '{@link TaxationWithRoot.Donation#getBeneficiary1 <em>Beneficiary1</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Beneficiary1</em>'. * @see TaxationWithRoot.Donation#getBeneficiary1() * @see #g...
Returns the meta object for the attribute '<code>TaxationWithRoot.Donation#getBeneficiary1 Beneficiary1</code>'.
getDonation_Beneficiary1
{ "repo_name": "viatra/VIATRA-Generator", "path": "Tests/MODELS2020-CaseStudies/case.study.pledge.model/src/TaxationWithRoot/TaxationPackage.java", "license": "epl-1.0", "size": 295635 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,233,187
public Cursor getPreviousCursor() { return previousCursor; }
Cursor function() { return previousCursor; }
/** * Returns the previousCursor. * * @return Cursor */
Returns the previousCursor
getPreviousCursor
{ "repo_name": "raedle/univis", "path": "lib/jgraph/src/org/jgraph/graph/BasicMarqueeHandler.java", "license": "lgpl-2.1", "size": 7271 }
[ "java.awt.Cursor" ]
import java.awt.Cursor;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,349,679
public long countWithoutDuplicates() { List collectedResult = this.rawSpatialRDD.collect(); HashSet resultWithoutDuplicates = new HashSet(); for (int i = 0; i < collectedResult.size(); i++) { resultWithoutDuplicates.add(collectedResult.get(i)); } return resul...
long function() { List collectedResult = this.rawSpatialRDD.collect(); HashSet resultWithoutDuplicates = new HashSet(); for (int i = 0; i < collectedResult.size(); i++) { resultWithoutDuplicates.add(collectedResult.get(i)); } return resultWithoutDuplicates.size(); }
/** * Count without duplicates. * * @return the long */
Count without duplicates
countWithoutDuplicates
{ "repo_name": "Sarwat/GeoSpark", "path": "core/src/main/java/org/datasyslab/geospark/spatialRDD/SpatialRDD.java", "license": "mit", "size": 20880 }
[ "java.util.HashSet", "java.util.List" ]
import java.util.HashSet; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
677,574
public static void setActionProperties(int action, String name, Integer mnemonic, KeyStroke accelerator) { Action tempAction = null; switch (action) { case CUT_ACTION: tempAction = cutAction; break; case COPY_ACTION: tempAction = copy...
static void function(int action, String name, Integer mnemonic, KeyStroke accelerator) { Action tempAction = null; switch (action) { case CUT_ACTION: tempAction = cutAction; break; case COPY_ACTION: tempAction = copyAction; break; case PASTE_ACTION: tempAction = pasteAction; break; case DELETE_ACTION: tempAction = dele...
/** * Sets the properties of one of the actions this text area owns. * * @param action * The action to modify; for example, {@link #CUT_ACTION}. * @param name * The new name for the action. * @param mnemonic * The new mnemonic for the action. ...
Sets the properties of one of the actions this text area owns
setActionProperties
{ "repo_name": "kevinmcgoldrick/Tank", "path": "tools/agent_debugger/src/main/java/org/fife/ui/rtextarea/RTextArea.java", "license": "epl-1.0", "size": 54300 }
[ "javax.swing.Action", "javax.swing.KeyStroke" ]
import javax.swing.Action; import javax.swing.KeyStroke;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
2,121,254
@Nullable public static <T> T getFirst(Iterable<? extends T> iterable, @Nullable T defaultValue) { return Iterators.getNext(iterable.iterator(), defaultValue); } /** * Returns the last element of {@code iterable}. * * @return the last element of {@code iterable}
static <T> T function(Iterable<? extends T> iterable, @Nullable T defaultValue) { return Iterators.getNext(iterable.iterator(), defaultValue); } /** * Returns the last element of {@code iterable}. * * @return the last element of {@code iterable}
/** * Returns the first element in {@code iterable} or {@code defaultValue} if * the iterable is empty. The {@link Iterators} analog to this method is * {@link Iterators#getNext}. * * <p>If no default value is desired (and the caller instead wants a * {@link NoSuchElementException} to be thrown), it ...
Returns the first element in iterable or defaultValue if the iterable is empty. The <code>Iterators</code> analog to this method is <code>Iterators#getNext</code>. If no default value is desired (and the caller instead wants a <code>NoSuchElementException</code> to be thrown), it is recommended that iterable.iterator()...
getFirst
{ "repo_name": "ben-manes/guava", "path": "guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/Iterables.java", "license": "apache-2.0", "size": 36304 }
[ "javax.annotation.Nullable" ]
import javax.annotation.Nullable;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
505,300
public static FileContext getFileContext() throws UnsupportedFileSystemException { return getFileContext(new Configuration()); }
static FileContext function() throws UnsupportedFileSystemException { return getFileContext(new Configuration()); }
/** * Create a FileContext using the default config read from the * $HADOOP_CONFIG/core.xml, Unspecified key-values for config are defaulted * from core-defaults.xml in the release jar. * * @throws UnsupportedFileSystemException If the file system from the default * configuration is not sup...
Create a FileContext using the default config read from the $HADOOP_CONFIG/core.xml, Unspecified key-values for config are defaulted from core-defaults.xml in the release jar
getFileContext
{ "repo_name": "zhe-thoughts/hadoop", "path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileContext.java", "license": "apache-2.0", "size": 99793 }
[ "org.apache.hadoop.conf.Configuration" ]
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,069,966
private void add(Node node, XMLWriter<org.w3c.dom.Node> writer) { if (node.hasChildren()) { writer.add(node.getName()); writeNodes(writer, node.getChildrens()); } else { writer.add(node.getName(), node.getText()); } if (node.hasAttribute...
void function(Node node, XMLWriter<org.w3c.dom.Node> writer) { if (node.hasChildren()) { writer.add(node.getName()); writeNodes(writer, node.getChildrens()); } else { writer.add(node.getName(), node.getText()); } if (node.hasAttribute()) { for (NodeAttribute attribute : node.getAttributes()) { writer.addAttribute(attri...
/** * Add the node state to the writer. * * @param node The node state to add to the writer. * @param writer The XML writer. */
Add the node state to the writer
add
{ "repo_name": "wichtounet/jtheque-xml-utils", "path": "src/main/java/org/jtheque/xml/utils/javax/JavaxNodeSaver.java", "license": "apache-2.0", "size": 1892 }
[ "org.jtheque.xml.utils.Node", "org.jtheque.xml.utils.NodeAttribute", "org.jtheque.xml.utils.XMLWriter" ]
import org.jtheque.xml.utils.Node; import org.jtheque.xml.utils.NodeAttribute; import org.jtheque.xml.utils.XMLWriter;
import org.jtheque.xml.utils.*;
[ "org.jtheque.xml" ]
org.jtheque.xml;
1,990,365
public DateTime getExpirationDate(Ticket ticket) { return getExpirationDate(ticket.getCreatedDate(), ticket.isRemembered()); } // // Event handling //
DateTime function(Ticket ticket) { return getExpirationDate(ticket.getCreatedDate(), ticket.isRemembered()); } //
/** * Compute expiration date using configured timeouts. * * @param ticket * @return */
Compute expiration date using configured timeouts
getExpirationDate
{ "repo_name": "kazoompa/agate", "path": "agate-core/src/main/java/org/obiba/agate/service/TicketService.java", "license": "gpl-3.0", "size": 7763 }
[ "org.joda.time.DateTime", "org.obiba.agate.domain.Ticket" ]
import org.joda.time.DateTime; import org.obiba.agate.domain.Ticket;
import org.joda.time.*; import org.obiba.agate.domain.*;
[ "org.joda.time", "org.obiba.agate" ]
org.joda.time; org.obiba.agate;
1,945,828
public void testWillDecode() throws Exception { String[] data = new String[1]; String[] result = new String[1]; data[0] = "A:B:C"; //server side encoder switches 1st and 3rd entry. result[0] = "C:B:A"; wsocTest.runEchoTest(new AnnotatedClientEP.TextTest(data), "/basic...
void function() throws Exception { String[] data = new String[1]; String[] result = new String[1]; data[0] = "A:B:C"; result[0] = "C:B:A"; wsocTest.runEchoTest(new AnnotatedClientEP.TextTest(data), STR, result); }
/** * This test show cases MessageHandler used in inheritance scenario * * ServerEndpoint - @see WillDecodeTextServerEP */
This test show cases MessageHandler used in inheritance scenario ServerEndpoint - @see WillDecodeTextServerEP
testWillDecode
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/io.openliberty.wsoc.internal_fat/fat/src/io/openliberty/wsoc/tests/all/AnnotatedTest.java", "license": "epl-1.0", "size": 24139 }
[ "io.openliberty.wsoc.endpoints.client.basic.AnnotatedClientEP" ]
import io.openliberty.wsoc.endpoints.client.basic.AnnotatedClientEP;
import io.openliberty.wsoc.endpoints.client.basic.*;
[ "io.openliberty.wsoc" ]
io.openliberty.wsoc;
1,986,403
public List<T> toMutableList() { return new ArrayList<>(this); }
List<T> function() { return new ArrayList<>(this); }
/** * Returns a mutable copy of this list. */
Returns a mutable copy of this list
toMutableList
{ "repo_name": "rschmitt/collider", "path": "src/main/java/com/github/rschmitt/collider/ClojureList.java", "license": "cc0-1.0", "size": 7937 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,310,647
@Test public void testGetCurrencyLocale() { Set<CurrencyUnit> cur = Monetary.getCurrencies(Locale.US); assertNotNull(cur); assertEquals(cur.size(), 1); Currency jdkCurrency = Currency.getInstance(Locale.US); CurrencyUnit unit = cur.iterator().next(); assertEquals(jdkCur...
void function() { Set<CurrencyUnit> cur = Monetary.getCurrencies(Locale.US); assertNotNull(cur); assertEquals(cur.size(), 1); Currency jdkCurrency = Currency.getInstance(Locale.US); CurrencyUnit unit = cur.iterator().next(); assertEquals(jdkCurrency.getCurrencyCode(), unit.getCurrencyCode()); assertEquals(jdkCurrency.g...
/** * Test method for * {@link javax.money.Monetary#getCurrencies(java.util.Locale, String...)}. */
Test method for <code>javax.money.Monetary#getCurrencies(java.util.Locale, String...)</code>
testGetCurrencyLocale
{ "repo_name": "JavaMoney/jsr354-ri", "path": "moneta-core/src/test/java/org/javamoney/moneta/CurrenciesTest.java", "license": "apache-2.0", "size": 5418 }
[ "java.util.Currency", "java.util.Locale", "java.util.Set", "javax.money.CurrencyUnit", "javax.money.Monetary", "org.testng.Assert" ]
import java.util.Currency; import java.util.Locale; import java.util.Set; import javax.money.CurrencyUnit; import javax.money.Monetary; import org.testng.Assert;
import java.util.*; import javax.money.*; import org.testng.*;
[ "java.util", "javax.money", "org.testng" ]
java.util; javax.money; org.testng;
1,552,268
@org.junit.Test public void testUntrustedSignature() throws Exception { WSSecSignature builder = new WSSecSignature(); builder.setUserInfo("wss40", "security"); Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG); WSSecHeader secHeader = new WSSecHeader(); secHea...
@org.junit.Test void function() throws Exception { WSSecSignature builder = new WSSecSignature(); builder.setUserInfo("wss40", STR); Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG); WSSecHeader secHeader = new WSSecHeader(); secHeader.insertSecurityHeader(doc); Crypto wss40Crypto = CryptoFactory.getInstanc...
/** * Test for when a Signature is received with a certificate that is not trusted */
Test for when a Signature is received with a certificate that is not trusted
testUntrustedSignature
{ "repo_name": "fatfredyy/wss4j-ecc", "path": "src/test/java/org/apache/ws/security/message/ModifiedRequestTest.java", "license": "apache-2.0", "size": 23670 }
[ "org.apache.ws.security.WSSecurityException", "org.apache.ws.security.common.SOAPUtil", "org.apache.ws.security.components.crypto.Crypto", "org.apache.ws.security.components.crypto.CryptoFactory", "org.w3c.dom.Document" ]
import org.apache.ws.security.WSSecurityException; import org.apache.ws.security.common.SOAPUtil; import org.apache.ws.security.components.crypto.Crypto; import org.apache.ws.security.components.crypto.CryptoFactory; import org.w3c.dom.Document;
import org.apache.ws.security.*; import org.apache.ws.security.common.*; import org.apache.ws.security.components.crypto.*; import org.w3c.dom.*;
[ "org.apache.ws", "org.w3c.dom" ]
org.apache.ws; org.w3c.dom;
2,371,945
public String getTextBoxText(String TextFieldName) throws java.lang.Exception { String TextFieldText = null; try{ XAccessibleContext xTextField =AccessibilityTools.getAccessibleObjectForRole(mXRoot, AccessibleRole.SCROLL_PANE, TextFieldN...
String function(String TextFieldName) throws java.lang.Exception { String TextFieldText = null; try{ XAccessibleContext xTextField =AccessibilityTools.getAccessibleObjectForRole(mXRoot, AccessibleRole.SCROLL_PANE, TextFieldName); XAccessible xTextFieldAccess = UnoRuntime.queryInterface(XAccessible.class, xTextField); X...
/** * returns the content of a TextBox * @param TextFieldName the name of the textbox * @return the value of the text box * @throws java.lang.Exception if something fail */
returns the content of a TextBox
getTextBoxText
{ "repo_name": "qt-haiku/LibreOffice", "path": "qadevOOo/runner/util/UITools.java", "license": "gpl-3.0", "size": 31391 }
[ "com.sun.star.accessibility.AccessibleRole", "com.sun.star.accessibility.XAccessible", "com.sun.star.accessibility.XAccessibleContext", "com.sun.star.uno.UnoRuntime", "com.sun.star.uno.XInterface" ]
import com.sun.star.accessibility.AccessibleRole; import com.sun.star.accessibility.XAccessible; import com.sun.star.accessibility.XAccessibleContext; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XInterface;
import com.sun.star.accessibility.*; import com.sun.star.uno.*;
[ "com.sun.star" ]
com.sun.star;
2,480,199
private Node createDeclarationNode() { if (namespace.indexOf('.') == -1) { return makeVarDeclNode(); } else { return makeAssignmentExprNode(); } }
Node function() { if (namespace.indexOf('.') == -1) { return makeVarDeclNode(); } else { return makeAssignmentExprNode(); } }
/** * Create the declaration node for this name, without inserting it * into the AST. */
Create the declaration node for this name, without inserting it into the AST
createDeclarationNode
{ "repo_name": "Medium/closure-compiler", "path": "src/com/google/javascript/jscomp/ProcessClosurePrimitives.java", "license": "apache-2.0", "size": 54948 }
[ "com.google.javascript.rhino.Node" ]
import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.*;
[ "com.google.javascript" ]
com.google.javascript;
328,101
public void setCheckpointStatsTracker(@Nullable CheckpointStatsTracker statsTracker) { this.statsTracker = statsTracker; } // -------------------------------------------------------------------------------------------- // Clean shutdown // ---------------------------------------------------------------------...
void function(@Nullable CheckpointStatsTracker statsTracker) { this.statsTracker = statsTracker; }
/** * Sets the checkpoint stats tracker. * * @param statsTracker The checkpoint stats tracker. */
Sets the checkpoint stats tracker
setCheckpointStatsTracker
{ "repo_name": "haohui/flink", "path": "flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java", "license": "apache-2.0", "size": 48600 }
[ "javax.annotation.Nullable" ]
import javax.annotation.Nullable;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
1,515,509
static int readProtoBufVarint(final ChannelBuffer buf) { int result = buf.readByte(); if (result >= 0) { return result; } result &= 0x7F; result |= buf.readByte() << 7; if (result >= 0) { return result; } result &= 0x3FFF; result |= buf.readByte() << 14; if (result ...
static int readProtoBufVarint(final ChannelBuffer buf) { int result = buf.readByte(); if (result >= 0) { return result; } result &= 0x7F; result = buf.readByte() << 7; if (result >= 0) { return result; } result &= 0x3FFF; result = buf.readByte() << 14; if (result >= 0) { return result; } result &= 0x1FFFFF; result = bu...
/** * Reads a 32-bit variable-length integer value as used in Protocol Buffers. * @param buf The buffer to read from. * @return The integer read. */
Reads a 32-bit variable-length integer value as used in Protocol Buffers
readProtoBufVarint
{ "repo_name": "OpenTSDB/asynccassandra", "path": "src/org/hbase/async/HBaseRpc.java", "license": "bsd-3-clause", "size": 42603 }
[ "org.jboss.netty.buffer.ChannelBuffer" ]
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.*;
[ "org.jboss.netty" ]
org.jboss.netty;
2,483,615
public static List<LocatedBlock> corruptBlocksInFile( DistributedFileSystem dfs, String path, long offset, long length) throws IOException { List<LocatedBlock> corrupt = new LinkedList<LocatedBlock>(); LocatedBlocks locatedBlocks = getBlockLocations(dfs, path, offset, length); for (LocatedBloc...
static List<LocatedBlock> function( DistributedFileSystem dfs, String path, long offset, long length) throws IOException { List<LocatedBlock> corrupt = new LinkedList<LocatedBlock>(); LocatedBlocks locatedBlocks = getBlockLocations(dfs, path, offset, length); for (LocatedBlock b: locatedBlocks.getLocatedBlocks()) { if ...
/** * Returns the corrupt blocks in a file. */
Returns the corrupt blocks in a file
corruptBlocksInFile
{ "repo_name": "shakamunyi/hadoop-20", "path": "src/hdfs/org/apache/hadoop/hdfs/RaidDFSUtil.java", "license": "apache-2.0", "size": 4551 }
[ "java.io.IOException", "java.util.LinkedList", "java.util.List", "org.apache.hadoop.hdfs.protocol.LocatedBlock", "org.apache.hadoop.hdfs.protocol.LocatedBlocks" ]
import java.io.IOException; import java.util.LinkedList; import java.util.List; import org.apache.hadoop.hdfs.protocol.LocatedBlock; import org.apache.hadoop.hdfs.protocol.LocatedBlocks;
import java.io.*; import java.util.*; import org.apache.hadoop.hdfs.protocol.*;
[ "java.io", "java.util", "org.apache.hadoop" ]
java.io; java.util; org.apache.hadoop;
2,730,825
public void addSnapshot(Guid snapshotId, String description, SnapshotType snapshotType, VM vm, final CompensationContext compensationContext) { addSnapshot(snapshotId, description, SnapshotStatus.LOCKED, snapshotType, vm, true, compensationContext); }
void function(Guid snapshotId, String description, SnapshotType snapshotType, VM vm, final CompensationContext compensationContext) { addSnapshot(snapshotId, description, SnapshotStatus.LOCKED, snapshotType, vm, true, compensationContext); }
/** * Add a new snapshot, saving it to the DB (with compensation). The VM's current configuration (including Disks & * NICs) will be saved in the snapshot.<br> * The snapshot is created in status {@link SnapshotStatus#LOCKED} by default. * * @param snapshotId * The ID for the sn...
Add a new snapshot, saving it to the DB (with compensation). The VM's current configuration (including Disks & NICs) will be saved in the snapshot. The snapshot is created in status <code>SnapshotStatus#LOCKED</code> by default
addSnapshot
{ "repo_name": "derekhiggins/ovirt-engine", "path": "backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/snapshots/SnapshotsManager.java", "license": "apache-2.0", "size": 17639 }
[ "org.ovirt.engine.core.bll.context.CompensationContext", "org.ovirt.engine.core.common.businessentities.Snapshot", "org.ovirt.engine.core.compat.Guid" ]
import org.ovirt.engine.core.bll.context.CompensationContext; import org.ovirt.engine.core.common.businessentities.Snapshot; import org.ovirt.engine.core.compat.Guid;
import org.ovirt.engine.core.bll.context.*; import org.ovirt.engine.core.common.businessentities.*; import org.ovirt.engine.core.compat.*;
[ "org.ovirt.engine" ]
org.ovirt.engine;
143,934
private boolean inlineGlobalAliasIfPossible(Name name, Ref alias, GlobalNamespace namespace) { // Ensure that the alias is assigned to global name at that the // declaration. Node aliasParent = alias.node.getParent(); if ((aliasParent.isAssign() || aliasParent.isName()) && NodeUtil.isExecu...
boolean function(Name name, Ref alias, GlobalNamespace namespace) { Node aliasParent = alias.node.getParent(); if ((aliasParent.isAssign() aliasParent.isName()) && NodeUtil.isExecutedExactlyOnce(aliasParent) aliasParent.isName() && name.isConstructor()) { Node lvalue = aliasParent.isName() ? aliasParent : aliasParent.g...
/** * Attempt to inline an global alias of a global name. This requires that the name is well * defined: assigned unconditionally, assigned exactly once. It is assumed that, the name for * which it is an alias must already meet these same requirements. * * @param alias The alias to inline * @return Wh...
Attempt to inline an global alias of a global name. This requires that the name is well defined: assigned unconditionally, assigned exactly once. It is assumed that, the name for which it is an alias must already meet these same requirements
inlineGlobalAliasIfPossible
{ "repo_name": "brad4d/closure-compiler", "path": "src/com/google/javascript/jscomp/AggressiveInlineAliases.java", "license": "apache-2.0", "size": 12884 }
[ "com.google.javascript.jscomp.GlobalNamespace", "com.google.javascript.rhino.IR", "com.google.javascript.rhino.Node", "java.util.ArrayList", "java.util.LinkedHashSet", "java.util.List", "java.util.Set" ]
import com.google.javascript.jscomp.GlobalNamespace; import com.google.javascript.rhino.IR; import com.google.javascript.rhino.Node; import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.List; import java.util.Set;
import com.google.javascript.jscomp.*; import com.google.javascript.rhino.*; import java.util.*;
[ "com.google.javascript", "java.util" ]
com.google.javascript; java.util;
1,673,494
public void initForTask(CeTask task) { LogFileRef ref = LogFileRef.from(task); // Logback SiftingAppender requires to use a String, so // the path is put but not the object LogFileRef MDC.put(MDC_LOG_PATH, ref.getRelativePath()); }
void function(CeTask task) { LogFileRef ref = LogFileRef.from(task); MDC.put(MDC_LOG_PATH, ref.getRelativePath()); }
/** * Initialize logging of a Compute Engine task. Must be called * before first writing of log. * <p>After this method is executed, then Compute Engine logs are * written to a dedicated appender and are removed from sonar.log.</p> */
Initialize logging of a Compute Engine task. Must be called before first writing of log. After this method is executed, then Compute Engine logs are written to a dedicated appender and are removed from sonar.log
initForTask
{ "repo_name": "joansmith/sonarqube", "path": "server/sonar-server/src/main/java/org/sonar/server/computation/log/CeLogging.java", "license": "lgpl-3.0", "size": 6361 }
[ "com.google.common.collect.FluentIterable", "org.apache.log4j.MDC", "org.sonar.server.computation.queue.CeTask" ]
import com.google.common.collect.FluentIterable; import org.apache.log4j.MDC; import org.sonar.server.computation.queue.CeTask;
import com.google.common.collect.*; import org.apache.log4j.*; import org.sonar.server.computation.queue.*;
[ "com.google.common", "org.apache.log4j", "org.sonar.server" ]
com.google.common; org.apache.log4j; org.sonar.server;
412,054
public boolean isIntersecting(int gridX, int gridY) { for (Component component: this.components) { if(component.isIntersecting(gridX, gridY)) { return true; } } return false; }
boolean function(int gridX, int gridY) { for (Component component: this.components) { if(component.isIntersecting(gridX, gridY)) { return true; } } return false; }
/** * If gridX/gridY is intersecting with another component. * * @param gridX GridX. * @param gridY GridX. * @return If intersecting. */
If gridX/gridY is intersecting with another component
isIntersecting
{ "repo_name": "BleedObsidian/LogicBuilder", "path": "core/src/com/gmail/bleedobsidian/logicbuilder/screens/builder/managers/ComponentManager.java", "license": "gpl-3.0", "size": 4288 }
[ "com.gmail.bleedobsidian.logicbuilder.screens.builder.managers.components.Component" ]
import com.gmail.bleedobsidian.logicbuilder.screens.builder.managers.components.Component;
import com.gmail.bleedobsidian.logicbuilder.screens.builder.managers.components.*;
[ "com.gmail.bleedobsidian" ]
com.gmail.bleedobsidian;
1,325,418
public UniqueID getParentUID();
UniqueID function();
/** * Get the parent UniqueID of the body * * @return the parent UniqueID * @see org.objectweb.proactive.core.body.proxy.SendingQueueProxy */
Get the parent UniqueID of the body
getParentUID
{ "repo_name": "moliva/proactive", "path": "src/Core/org/objectweb/proactive/Body.java", "license": "agpl-3.0", "size": 11674 }
[ "org.objectweb.proactive.core.UniqueID" ]
import org.objectweb.proactive.core.UniqueID;
import org.objectweb.proactive.core.*;
[ "org.objectweb.proactive" ]
org.objectweb.proactive;
737,459
public static String getFolderContainingFile(String carbonFilePath) { return carbonFilePath.substring(0, carbonFilePath.lastIndexOf(File.separator)); }
static String function(String carbonFilePath) { return carbonFilePath.substring(0, carbonFilePath.lastIndexOf(File.separator)); }
/** * The method returns the folder path containing the carbon file. * * @param carbonFilePath */
The method returns the folder path containing the carbon file
getFolderContainingFile
{ "repo_name": "JihongMA/incubator-carbondata", "path": "core/src/main/java/org/apache/carbondata/core/util/path/CarbonTablePath.java", "license": "apache-2.0", "size": 22208 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,804,610
protected final boolean markObsolete0(GridCacheVersion ver, boolean clear, GridCacheObsoleteEntryExtras extras) { assert Thread.holdsLock(this); if (evictionDisabled()) { assert !obsolete() : this; return false; } GridCacheVersion obsoleteVer = obsoleteVers...
final boolean function(GridCacheVersion ver, boolean clear, GridCacheObsoleteEntryExtras extras) { assert Thread.holdsLock(this); if (evictionDisabled()) { assert !obsolete() : this; return false; } GridCacheVersion obsoleteVer = obsoleteVersionExtras(); if (ver != null) { if (obsoleteVer != null) return true; GridCach...
/** * <p> * Note that {@link #onMarkedObsolete()} should always be called after this method * returns {@code true}. * * @param ver Version. * @param clear {@code True} to clear. * @param extras Predefined extras. * @return {@code True} if entry is obsolete, {@code false} if entry...
Note that <code>#onMarkedObsolete()</code> should always be called after this method returns true
markObsolete0
{ "repo_name": "pperalta/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java", "license": "apache-2.0", "size": 154311 }
[ "org.apache.ignite.internal.processors.cache.extras.GridCacheObsoleteEntryExtras", "org.apache.ignite.internal.processors.cache.version.GridCacheVersion" ]
import org.apache.ignite.internal.processors.cache.extras.GridCacheObsoleteEntryExtras; import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
import org.apache.ignite.internal.processors.cache.extras.*; import org.apache.ignite.internal.processors.cache.version.*;
[ "org.apache.ignite" ]
org.apache.ignite;
1,413,120
@Override public void notifyChanged(Notification notification) { updateChildren(notification); super.notifyChanged(notification); }
void function(Notification notification) { updateChildren(notification); super.notifyChanged(notification); }
/** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This handles model notifications by calling <code>#updateChildren</code> to update any cached children and by creating a viewer notification, which it passes to <code>#fireNotifyChanged</code>.
notifyChanged
{ "repo_name": "gemoc/activitydiagram", "path": "dev/gemoc_concurrent/language_workbench/org.gemoc.activitydiagram.concurrent.xactivitydiagram.edit/src/org/gemoc/activitydiagram/concurrent/xactivitydiagram/activitydiagram/provider/DecisionNodeItemProvider.java", "license": "epl-1.0", "size": 2744 }
[ "org.eclipse.emf.common.notify.Notification" ]
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,738,389
static int getEstimatedNumSplits(Datastore datastore, Query query, @Nullable String namespace) { int numSplits; try { long estimatedSizeBytes = getEstimatedSizeBytes(datastore, query, namespace); LOG.info("Estimated size bytes for the query is: {}", estimatedSizeBytes); numSplits...
static int getEstimatedNumSplits(Datastore datastore, Query query, @Nullable String namespace) { int numSplits; try { long estimatedSizeBytes = getEstimatedSizeBytes(datastore, query, namespace); LOG.info(STR, estimatedSizeBytes); numSplits = (int) Math.min(NUM_QUERY_SPLITS_MAX, Math.round(((double) estimatedSizeBytes)...
/** * Computes the number of splits to be performed on the given query by querying the estimated * size from Cloud Datastore. */
Computes the number of splits to be performed on the given query by querying the estimated size from Cloud Datastore
getEstimatedNumSplits
{ "repo_name": "jbonofre/beam", "path": "sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/datastore/DatastoreV1.java", "license": "apache-2.0", "size": 61086 }
[ "com.google.datastore.v1.Query", "com.google.datastore.v1.client.Datastore", "javax.annotation.Nullable" ]
import com.google.datastore.v1.Query; import com.google.datastore.v1.client.Datastore; import javax.annotation.Nullable;
import com.google.datastore.v1.*; import com.google.datastore.v1.client.*; import javax.annotation.*;
[ "com.google.datastore", "javax.annotation" ]
com.google.datastore; javax.annotation;
1,568,724
private Vector2f createIdealPoint(Vector2f previousIdealPoint, Vector2f currentIdealPoint) { // difference in x- and y-coordinates between previous and current ideal point float diffX = currentIdealPoint.x - previousIdealPoint.x; float diffY = currentIdealPoint.y - previousIdealPoint.y; // square d...
Vector2f function(Vector2f previousIdealPoint, Vector2f currentIdealPoint) { float diffX = currentIdealPoint.x - previousIdealPoint.x; float diffY = currentIdealPoint.y - previousIdealPoint.y; float distanceSquare = FastMath.sqr(MAX_DISTANCE_BETWEEN_TWO_IDEAL_POINTS); float diffXSquare = FastMath.sqr(diffX); float diff...
/** * Computes a point on the ideal line between previous and current * ideal point with distance "MAX_DISTANCE_BETWEEN_TWO_IDEAL_POINTS" * from previous ideal point towards current ideal point. * * @param previousIdealPoint * Previous ideal point. The new point will have the distance * spe...
Computes a point on the ideal line between previous and current ideal point with distance "MAX_DISTANCE_BETWEEN_TWO_IDEAL_POINTS" from previous ideal point towards current ideal point
createIdealPoint
{ "repo_name": "Karasion/Capstone2015-PurpleOcean2", "path": "OpenDS3.0/src/eu/opends/drivingTask/scenario/ScenarioLoader.java", "license": "gpl-3.0", "size": 30430 }
[ "com.jme3.math.FastMath", "com.jme3.math.Vector2f" ]
import com.jme3.math.FastMath; import com.jme3.math.Vector2f;
import com.jme3.math.*;
[ "com.jme3.math" ]
com.jme3.math;
2,502,678
Force f = new Force(); f = new Force(0.3, 2.0); TestCase.assertEquals(0.3, f.force.x); TestCase.assertEquals(2.0, f.force.y); Force f2 = new Force(f); TestCase.assertEquals(0.3, f.force.x); TestCase.assertEquals(2.0, f.force.y); TestCase.assertNotSame(f.force, f2.force); f = new Force(new Vector...
Force f = new Force(); f = new Force(0.3, 2.0); TestCase.assertEquals(0.3, f.force.x); TestCase.assertEquals(2.0, f.force.y); Force f2 = new Force(f); TestCase.assertEquals(0.3, f.force.x); TestCase.assertEquals(2.0, f.force.y); TestCase.assertNotSame(f.force, f2.force); f = new Force(new Vector2(2.0, 1.0)); TestCase.a...
/** * Tests successful creation. */
Tests successful creation
createSuccess
{ "repo_name": "dmitrykolesnikovich/dyn4j", "path": "junit/org/dyn4j/dynamics/ForceTest.java", "license": "bsd-3-clause", "size": 4323 }
[ "junit.framework.TestCase", "org.dyn4j.geometry.Vector2" ]
import junit.framework.TestCase; import org.dyn4j.geometry.Vector2;
import junit.framework.*; import org.dyn4j.geometry.*;
[ "junit.framework", "org.dyn4j.geometry" ]
junit.framework; org.dyn4j.geometry;
2,544,257
@Override public void shutdown(final String taskId) { if (!started) { log.info("This TaskRunner is stopped. Ignoring shutdown command for task: %s", taskId); } else if (pendingTasks.remove(taskId) != null) { pendingTaskPayloads.remove(taskId); log.info("Removed task from pending queue: %...
void function(final String taskId) { if (!started) { log.info(STR, taskId); } else if (pendingTasks.remove(taskId) != null) { pendingTaskPayloads.remove(taskId); log.info(STR, taskId); } else if (completeTasks.containsKey(taskId)) { cleanup(taskId); } else { final ZkWorker zkWorker = findWorkerRunningTask(taskId); if (...
/** * Finds the worker running the task and forwards the shutdown signal to the worker. * * @param taskId - task id to shutdown */
Finds the worker running the task and forwards the shutdown signal to the worker
shutdown
{ "repo_name": "lcp0578/druid", "path": "indexing-service/src/main/java/io/druid/indexing/overlord/RemoteTaskRunner.java", "license": "apache-2.0", "size": 39088 }
[ "com.google.common.base.Throwables", "com.metamx.http.client.Request", "com.metamx.http.client.response.StatusResponseHolder", "org.jboss.netty.handler.codec.http.HttpMethod", "org.jboss.netty.handler.codec.http.HttpResponseStatus" ]
import com.google.common.base.Throwables; import com.metamx.http.client.Request; import com.metamx.http.client.response.StatusResponseHolder; import org.jboss.netty.handler.codec.http.HttpMethod; import org.jboss.netty.handler.codec.http.HttpResponseStatus;
import com.google.common.base.*; import com.metamx.http.client.*; import com.metamx.http.client.response.*; import org.jboss.netty.handler.codec.http.*;
[ "com.google.common", "com.metamx.http", "org.jboss.netty" ]
com.google.common; com.metamx.http; org.jboss.netty;
1,577,979
@ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable<ComputeOperationValueInner> list(Context context);
@ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable<ComputeOperationValueInner> list(Context context);
/** * Gets a list of compute operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server...
Gets a list of compute operations
list
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/OperationsClient.java", "license": "mit", "size": 2271 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.PagedIterable", "com.azure.core.util.Context", "com.azure.resourcemanager.compute.fluent.models.ComputeOperationValueInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.resourcemanager.compute.fluent.models.ComputeOperationValueInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.compute.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,251,617
public static void endTag(PrintWriter out, String tag) { out.print(new StringBuffer().append(LB).append(END).append(tag).append(RB).toString()); }
static void function(PrintWriter out, String tag) { out.print(new StringBuffer().append(LB).append(END).append(tag).append(RB).toString()); }
/** Output an end tag. * @param out The destination writer * @param tag The tag name */
Output an end tag
endTag
{ "repo_name": "rickli/Java", "path": "Day2/com/darwinsys/html/Tag.java", "license": "gpl-2.0", "size": 1381 }
[ "java.io.PrintWriter" ]
import java.io.PrintWriter;
import java.io.*;
[ "java.io" ]
java.io;
2,645,619
@Override public void innerStart() throws IOException { startDataNode(getConf(), dataDirs); }
void function() throws IOException { startDataNode(getConf(), dataDirs); }
/** * Start any work (in separate threads) * * @throws IOException for any startup failure */
Start any work (in separate threads)
innerStart
{ "repo_name": "apache/hadoop-common", "path": "src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java", "license": "apache-2.0", "size": 62166 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,394,864
public Builder addAllShippingOption(List<ShippingOption> elements) { if (this.shippingOptions == null) { this.shippingOptions = new ArrayList<>(); } this.shippingOptions.addAll(elements); return this; }
Builder function(List<ShippingOption> elements) { if (this.shippingOptions == null) { this.shippingOptions = new ArrayList<>(); } this.shippingOptions.addAll(elements); return this; }
/** * Add all elements to `shippingOptions` list. A list is initialized for the first `add/addAll` * call, and subsequent calls adds additional elements to the original list. See {@link * SessionCreateParams#shippingOptions} for the field documentation. */
Add all elements to `shippingOptions` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. See <code>SessionCreateParams#shippingOptions</code> for the field documentation
addAllShippingOption
{ "repo_name": "stripe/stripe-java", "path": "src/main/java/com/stripe/param/checkout/SessionCreateParams.java", "license": "mit", "size": 222478 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,385,397
protected Type processAssignment(boolean init, String op, Node n, Type t1, Type t2) { if (t1.hasError() || t2.hasError()) return ErrorT.TYPE; final Type r1 = t1.resolve(); final Type r2 = c().pointerize(t2); Type result = null; if (r2.isVoid()) { runtim...
Type function(boolean init, String op, Node n, Type t1, Type t2) { if (t1.hasError() t2.hasError()) return ErrorT.TYPE; final Type r1 = t1.resolve(); final Type r2 = c().pointerize(t2); Type result = null; if (r2.isVoid()) { runtime.error(STR, n); return ErrorT.TYPE; } switch (r1.tag()) { case BOOLEAN: { if (c().isScal...
/** * Process the assignment. This method determines the resulting * type when assigning a value of the specified right-hand type to * an object with the specified left-hand type. It does not check * that the left-hand side represents a modifiable lvalue. * * @param init The flag for whether the ass...
Process the assignment. This method determines the resulting type when assigning a value of the specified right-hand type to an object with the specified left-hand type. It does not check that the left-hand side represents a modifiable lvalue
processAssignment
{ "repo_name": "wandoulabs/xtc-rats", "path": "xtc-core/src/main/java/xtc/lang/CAnalyzer.java", "license": "lgpl-2.1", "size": 231201 }
[ "xtc.tree.Node", "xtc.type.ErrorT", "xtc.type.NumberT", "xtc.type.Type" ]
import xtc.tree.Node; import xtc.type.ErrorT; import xtc.type.NumberT; import xtc.type.Type;
import xtc.tree.*; import xtc.type.*;
[ "xtc.tree", "xtc.type" ]
xtc.tree; xtc.type;
148,275
public boolean getUseBuiltInZoomMapControls() { return useBuiltInZoomMapControls; } /** * Non-Android accessor. * * @return whether {@link #preLoad()} has been called on this {@code MapView}
boolean function() { return useBuiltInZoomMapControls; } /** * Non-Android accessor. * * @return whether {@link #preLoad()} has been called on this {@code MapView}
/** * Non-Android accessor. * * @return whether to use built in zoom map controls */
Non-Android accessor
getUseBuiltInZoomMapControls
{ "repo_name": "dierksen/robolectric", "path": "src/main/java/org/robolectric/shadows/ShadowMapView.java", "license": "mit", "size": 8733 }
[ "com.google.android.maps.MapView" ]
import com.google.android.maps.MapView;
import com.google.android.maps.*;
[ "com.google.android" ]
com.google.android;
2,365,415
public String setLedOn(OnOffType onOff) { SetLedOff sLOff = new SetLedOff(); sLOff.setLed(onOff); return gsonWithExpose.toJson(sLOff); }
String function(OnOffType onOff) { SetLedOff sLOff = new SetLedOff(); sLOff.setLed(onOff); return gsonWithExpose.toJson(sLOff); }
/** * Returns the json for the set_led_off command to switch the led of the device on or off. * * @param onOff the led state to set * @return The json string of the command to send to the device */
Returns the json for the set_led_off command to switch the led of the device on or off
setLedOn
{ "repo_name": "johannrichard/openhab2-addons", "path": "addons/binding/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/Commands.java", "license": "epl-1.0", "size": 9532 }
[ "org.eclipse.smarthome.core.library.types.OnOffType", "org.openhab.binding.tplinksmarthome.internal.model.SetLedOff" ]
import org.eclipse.smarthome.core.library.types.OnOffType; import org.openhab.binding.tplinksmarthome.internal.model.SetLedOff;
import org.eclipse.smarthome.core.library.types.*; import org.openhab.binding.tplinksmarthome.internal.model.*;
[ "org.eclipse.smarthome", "org.openhab.binding" ]
org.eclipse.smarthome; org.openhab.binding;
2,346,714
public ProjectExpectedStudyLeverOutcome getStudyLeverOutcomeByStudyLeverOutcomeAndPhase(ProjectExpectedStudy study, AllianceLeverOutcome leverOutcome, Phase phase);
ProjectExpectedStudyLeverOutcome function(ProjectExpectedStudy study, AllianceLeverOutcome leverOutcome, Phase phase);
/** * Gets a ProjectExpectedStudyLeverOutcome by a study, a lever outcome and a phase * * @param study the ProjectExpectedStudy * @param leverOutcome the AllianceLeverOutcome * @param idPhase the Phase * @return a ProjectExpectedStudyLeverOutcome if found; else null */
Gets a ProjectExpectedStudyLeverOutcome by a study, a lever outcome and a phase
getStudyLeverOutcomeByStudyLeverOutcomeAndPhase
{ "repo_name": "CCAFS/MARLO", "path": "marlo-data/src/main/java/org/cgiar/ccafs/marlo/data/manager/ProjectExpectedStudyLeverOutcomeManager.java", "license": "gpl-3.0", "size": 4511 }
[ "org.cgiar.ccafs.marlo.data.model.AllianceLeverOutcome", "org.cgiar.ccafs.marlo.data.model.Phase", "org.cgiar.ccafs.marlo.data.model.ProjectExpectedStudy", "org.cgiar.ccafs.marlo.data.model.ProjectExpectedStudyLeverOutcome" ]
import org.cgiar.ccafs.marlo.data.model.AllianceLeverOutcome; import org.cgiar.ccafs.marlo.data.model.Phase; import org.cgiar.ccafs.marlo.data.model.ProjectExpectedStudy; import org.cgiar.ccafs.marlo.data.model.ProjectExpectedStudyLeverOutcome;
import org.cgiar.ccafs.marlo.data.model.*;
[ "org.cgiar.ccafs" ]
org.cgiar.ccafs;
87,742
public UserChallengesDTO getUserChallengeQuestion(String userName, String confirmation, String questionId) throws IdentityMgtServiceException { UserDTO userDTO = null; UserChallengesDTO userChallengesDTO = new UserChallengesDTO(); if (l...
UserChallengesDTO function(String userName, String confirmation, String questionId) throws IdentityMgtServiceException { UserDTO userDTO = null; UserChallengesDTO userChallengesDTO = new UserChallengesDTO(); if (log.isDebugEnabled()) { log.debug(STR + userName); } try { userDTO = Utils.processUserId(userName); } catch ...
/** * To get the challenge question for the user. * * @param userName * @param confirmation * @param questionId - Question id returned from the getUserChanllegneQuestionIds * method. * @return Populated question bean with the question details and the key. * ...
To get the challenge question for the user
getUserChallengeQuestion
{ "repo_name": "PasinduTennage/carbon-identity-framework", "path": "components/identity-mgt/org.wso2.carbon.identity.mgt/src/main/java/org/wso2/carbon/identity/mgt/services/UserInformationRecoveryService.java", "license": "apache-2.0", "size": 59577 }
[ "org.wso2.carbon.context.PrivilegedCarbonContext", "org.wso2.carbon.identity.base.IdentityException", "org.wso2.carbon.identity.mgt.IdentityMgtConfig", "org.wso2.carbon.identity.mgt.IdentityMgtServiceException", "org.wso2.carbon.identity.mgt.RecoveryProcessor", "org.wso2.carbon.identity.mgt.beans.Verifica...
import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.identity.base.IdentityException; import org.wso2.carbon.identity.mgt.IdentityMgtConfig; import org.wso2.carbon.identity.mgt.IdentityMgtServiceException; import org.wso2.carbon.identity.mgt.RecoveryProcessor; import org.wso2.carbon.identity.m...
import org.wso2.carbon.context.*; import org.wso2.carbon.identity.base.*; import org.wso2.carbon.identity.mgt.*; import org.wso2.carbon.identity.mgt.beans.*; import org.wso2.carbon.identity.mgt.dto.*; import org.wso2.carbon.identity.mgt.internal.*; import org.wso2.carbon.identity.mgt.util.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
1,270,575
public synchronized void startPreview() { Camera theCamera = camera; if (theCamera != null && !previewing) { theCamera.startPreview(); previewing = true; autoFocusManager = new AutoFocusManager(context, camera); } }
synchronized void function() { Camera theCamera = camera; if (theCamera != null && !previewing) { theCamera.startPreview(); previewing = true; autoFocusManager = new AutoFocusManager(context, camera); } }
/** * Asks the camera hardware to begin drawing preview frames to the screen. */
Asks the camera hardware to begin drawing preview frames to the screen
startPreview
{ "repo_name": "paulpv/BarcodeEye", "path": "src/com/google/zxing/client/android/camera/CameraManager.java", "license": "apache-2.0", "size": 12359 }
[ "android.hardware.Camera" ]
import android.hardware.Camera;
import android.hardware.*;
[ "android.hardware" ]
android.hardware;
1,800,373
@NonNull public static String getFilenameFromPath(@NonNull final String path) { final int posSegment = path.lastIndexOf('/'); return (posSegment >= 0) ? path.substring(posSegment + 1) : path; }
static String function(@NonNull final String path) { final int posSegment = path.lastIndexOf('/'); return (posSegment >= 0) ? path.substring(posSegment + 1) : path; }
/** * Get the guessed filename from a path * * @param path * filename, optionally including path * @return the filename without path */
Get the guessed filename from a path
getFilenameFromPath
{ "repo_name": "tobiasge/cgeo", "path": "main/src/cgeo/geocaching/utils/FileUtils.java", "license": "apache-2.0", "size": 21432 }
[ "androidx.annotation.NonNull" ]
import androidx.annotation.NonNull;
import androidx.annotation.*;
[ "androidx.annotation" ]
androidx.annotation;
2,295,543
protected String getPublicHostname(NodeMetadata node, Optional<HostAndPort> sshHostAndPort, ConfigBag setup) { String provider = (setup != null) ? setup.get(CLOUD_PROVIDER) : null; if (provider == null) provider= getProvider(); if ("aws-ec2".equals(provider)) { HostAndPo...
String function(NodeMetadata node, Optional<HostAndPort> sshHostAndPort, ConfigBag setup) { String provider = (setup != null) ? setup.get(CLOUD_PROVIDER) : null; if (provider == null) provider= getProvider(); if (STR.equals(provider)) { HostAndPort inferredHostAndPort = null; if (!sshHostAndPort.isPresent()) { try { St...
/** * Attempts to obtain the hostname or IP of the node, as advertised by the cloud provider. * Prefers public, reachable IPs. * For some clouds (e.g. aws-ec2), it will attempt to find the public hostname. */
Attempts to obtain the hostname or IP of the node, as advertised by the cloud provider. Prefers public, reachable IPs. For some clouds (e.g. aws-ec2), it will attempt to find the public hostname
getPublicHostname
{ "repo_name": "neykov/incubator-brooklyn", "path": "locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java", "license": "apache-2.0", "size": 106087 }
[ "com.google.common.base.Optional", "com.google.common.net.HostAndPort", "org.jclouds.compute.domain.NodeMetadata" ]
import com.google.common.base.Optional; import com.google.common.net.HostAndPort; import org.jclouds.compute.domain.NodeMetadata;
import com.google.common.base.*; import com.google.common.net.*; import org.jclouds.compute.domain.*;
[ "com.google.common", "org.jclouds.compute" ]
com.google.common; org.jclouds.compute;
1,765,384
public void disconnectFromNodesExcept(DiscoveryNodes discoveryNodes) { final List<Runnable> runnables = new ArrayList<>(); synchronized (mutex) { final Set<DiscoveryNode> nodesToDisconnect = new HashSet<>(targetsByNode.keySet()); for (final DiscoveryNode discoveryNode : disco...
void function(DiscoveryNodes discoveryNodes) { final List<Runnable> runnables = new ArrayList<>(); synchronized (mutex) { final Set<DiscoveryNode> nodesToDisconnect = new HashSet<>(targetsByNode.keySet()); for (final DiscoveryNode discoveryNode : discoveryNodes) { nodesToDisconnect.remove(discoveryNode); } for (final D...
/** * Disconnect from any nodes to which we are currently connected which do not appear in the given nodes. Does not wait for the * disconnections to complete, because they might have to wait for ongoing connection attempts first. */
Disconnect from any nodes to which we are currently connected which do not appear in the given nodes. Does not wait for the disconnections to complete, because they might have to wait for ongoing connection attempts first
disconnectFromNodesExcept
{ "repo_name": "nknize/elasticsearch", "path": "server/src/main/java/org/elasticsearch/cluster/NodeConnectionsService.java", "license": "apache-2.0", "size": 23502 }
[ "java.util.ArrayList", "java.util.HashSet", "java.util.List", "java.util.Set", "org.elasticsearch.cluster.node.DiscoveryNode", "org.elasticsearch.cluster.node.DiscoveryNodes" ]
import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodes;
import java.util.*; import org.elasticsearch.cluster.node.*;
[ "java.util", "org.elasticsearch.cluster" ]
java.util; org.elasticsearch.cluster;
2,823,890
public static boolean isUserStoreInUsernameCaseSensitive(String username) { boolean isUsernameCaseSensitive = true; try { String tenantDomain = MultitenantUtils.getTenantDomain(username); int tenantId = IdentityTenantUtil.getRealmService().getTenantManager().getTenantId(tena...
static boolean function(String username) { boolean isUsernameCaseSensitive = true; try { String tenantDomain = MultitenantUtils.getTenantDomain(username); int tenantId = IdentityTenantUtil.getRealmService().getTenantManager().getTenantId(tenantDomain); return isUserStoreInUsernameCaseSensitive(username, tenantId); } ca...
/** * Check the case sensitivity of the user store in which the user is in. * * @param username Full qualified username * @return */
Check the case sensitivity of the user store in which the user is in
isUserStoreInUsernameCaseSensitive
{ "repo_name": "omindu/carbon-identity-framework", "path": "components/identity-core/org.wso2.carbon.identity.core/src/main/java/org/wso2/carbon/identity/core/util/IdentityUtil.java", "license": "apache-2.0", "size": 66257 }
[ "org.wso2.carbon.user.api.UserStoreException", "org.wso2.carbon.utils.multitenancy.MultitenantUtils" ]
import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
import org.wso2.carbon.user.api.*; import org.wso2.carbon.utils.multitenancy.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
93,162
public File restorePortablePath(File file) { if (file == null || file.exists()) { return file; } File absolute = null; absolute = restoreContikiRelativePath(file); if (absolute != null) { return absolute; } absolute = restoreConfigRelativePath(file); if (abs...
File function(File file) { if (file == null file.exists()) { return file; } File absolute = null; absolute = restoreContikiRelativePath(file); if (absolute != null) { return absolute; } absolute = restoreConfigRelativePath(file); if (absolute != null) { return absolute; } return file; } private final static String[][] ...
/** * Tries to restore a previously "portable" file to be "absolute". * If the given file already exists, no conversion is performed. * * @see #createPortablePath(File) * @param file Portable file * @return Absolute file */
Tries to restore a previously "portable" file to be "absolute". If the given file already exists, no conversion is performed
restorePortablePath
{ "repo_name": "andreaazzara/pyot", "path": "contiki-tres/tools/cooja/java/org/contikios/cooja/Cooja.java", "license": "gpl-3.0", "size": 159349 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
528,783
public void goToFile(Ldtp ldtp) { logger.info("Go to file"); ldtp.click(abstractUtil.getFileMenu()); ldtp.waitTillGuiExist(fileMenuPage, waitInSeconds); }
void function(Ldtp ldtp) { logger.info(STR); ldtp.click(abstractUtil.getFileMenu()); ldtp.waitTillGuiExist(fileMenuPage, waitInSeconds); }
/** * Click in File * * @param ldtp */
Click in File
goToFile
{ "repo_name": "Alfresco/community-edition", "path": "projects/office-application/src/main/java/org/alfresco/office/application/MicorsoftOffice2010.java", "license": "lgpl-3.0", "size": 24894 }
[ "com.cobra.ldtp.Ldtp" ]
import com.cobra.ldtp.Ldtp;
import com.cobra.ldtp.*;
[ "com.cobra.ldtp" ]
com.cobra.ldtp;
2,272,288
@Test public void testBuilder_noApplicationName() throws Exception { Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()); try { new DfpSession.Builder() .withEndpoint("https://ads.google.com") .withNetworkCode("networkCode") .withOAuth2C...
void function() throws Exception { Credential credential = new Credential(BearerToken.authorizationHeaderAccessMethod()); try { new DfpSession.Builder() .withEndpoint(STRnetworkCodeSTRValidation exception expected.STRApplication name must be set and not be the default [INSERT_APPLICATION_NAME_HERE]", e.getMessage()); }...
/** * Tests that the builder does not build with no application name. */
Tests that the builder does not build with no application name
testBuilder_noApplicationName
{ "repo_name": "nafae/developer", "path": "modules/ads_lib/src/test/java/com/google/api/ads/dfp/lib/client/DfpSessionTest.java", "license": "apache-2.0", "size": 14335 }
[ "com.google.api.client.auth.oauth2.BearerToken", "com.google.api.client.auth.oauth2.Credential" ]
import com.google.api.client.auth.oauth2.BearerToken; import com.google.api.client.auth.oauth2.Credential;
import com.google.api.client.auth.oauth2.*;
[ "com.google.api" ]
com.google.api;
291,750
public static boolean checkExtensionsDependencies(JarFile jar) { if (providers == null) { // no need to bother, nobody is registered to install missing // extensions return true; } try { ExtensionDependency extDep = new ExtensionDependency...
static boolean function(JarFile jar) { if (providers == null) { return true; } try { ExtensionDependency extDep = new ExtensionDependency(); return extDep.checkExtensions(jar); } catch (ExtensionInstallationException e) { debug(e.getMessage()); } return false; }
/** * <p> * Checks the dependencies of the jar file on installed extension. * </p> * @param jarFile containing the attriutes declaring the dependencies */
Checks the dependencies of the jar file on installed extension.
checkExtensionsDependencies
{ "repo_name": "rokn/Count_Words_2015", "path": "testing/openjdk/jdk/src/share/classes/sun/misc/ExtensionDependency.java", "license": "mit", "size": 20628 }
[ "java.util.jar.JarFile" ]
import java.util.jar.JarFile;
import java.util.jar.*;
[ "java.util" ]
java.util;
2,184,345
private void updatePoints(final Player player) { final DeathmatchState deathmatchState = DeathmatchState.createFromQuestString(player.getQuest("deathmatch")); DBCommandQueue.get().enqueue(new WriteHallOfFamePointsCommand(player.getName(), "D", deathmatchState.getPoints(), true)); }
void function(final Player player) { final DeathmatchState deathmatchState = DeathmatchState.createFromQuestString(player.getQuest(STR)); DBCommandQueue.get().enqueue(new WriteHallOfFamePointsCommand(player.getName(), "D", deathmatchState.getPoints(), true)); }
/** * Updates the player's points in the hall of fame for deathmatch. * * @param player Player */
Updates the player's points in the hall of fame for deathmatch
updatePoints
{ "repo_name": "markuskeunecke/stendhal", "path": "src/games/stendhal/server/maps/deathmatch/DoneAction.java", "license": "gpl-2.0", "size": 4705 }
[ "games.stendhal.server.core.engine.dbcommand.WriteHallOfFamePointsCommand", "games.stendhal.server.entity.player.Player" ]
import games.stendhal.server.core.engine.dbcommand.WriteHallOfFamePointsCommand; import games.stendhal.server.entity.player.Player;
import games.stendhal.server.core.engine.dbcommand.*; import games.stendhal.server.entity.player.*;
[ "games.stendhal.server" ]
games.stendhal.server;
2,268,198
@JsonIgnore public boolean isFailure() { return status == TaskState.FAILED; }
boolean function() { return status == TaskState.FAILED; }
/** * Returned by tasks when they complete unsuccessfully. Exactly one of isRunnable, isSuccess, or * isFailure will be true at any one time. * * @return whether the task failed */
Returned by tasks when they complete unsuccessfully. Exactly one of isRunnable, isSuccess, or isFailure will be true at any one time
isFailure
{ "repo_name": "b-slim/druid", "path": "indexing-service/src/main/java/io/druid/indexing/common/TaskStatus.java", "license": "apache-2.0", "size": 5614 }
[ "io.druid.indexer.TaskState" ]
import io.druid.indexer.TaskState;
import io.druid.indexer.*;
[ "io.druid.indexer" ]
io.druid.indexer;
838,915
@Test public void testMinValMaxVal() { try { LogEncoder.builder() .n(100) .minVal(0.0) .maxVal(-100.) .forced(true) .build(); fail("IllegalStateException not thrown"); } catch (IllegalStateException expectedException) { } try { LogEncoder...
void function() { try { LogEncoder.builder() .n(100) .minVal(0.0) .maxVal(-100.) .forced(true) .build(); fail(STR); } catch (IllegalStateException expectedException) { } try { LogEncoder.builder() .n(100) .minVal(0.0) .maxVal(1e-07) .forced(true) .build(); fail(STR); } catch (IllegalStateException expectedException) { ...
/** * Verifies unusual instances of minval and maxval are handled properly */
Verifies unusual instances of minval and maxval are handled properly
testMinValMaxVal
{ "repo_name": "user405/test", "path": "src/test/java/org/numenta/nupic/encoders/LogEncoderTest.java", "license": "agpl-3.0", "size": 9299 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,383,070
private boolean toGlobalMotionEvent(View view, MotionEvent event) { final int[] loc = mTmpLocation; view.getLocationOnScreen(loc); event.offsetLocation(loc[0], loc[1]); return true; }
boolean function(View view, MotionEvent event) { final int[] loc = mTmpLocation; view.getLocationOnScreen(loc); event.offsetLocation(loc[0], loc[1]); return true; }
/** * Emulates View.toGlobalMotionEvent(). This implementation does not handle transformations * (scaleX, scaleY, etc). */
Emulates View.toGlobalMotionEvent(). This implementation does not handle transformations (scaleX, scaleY, etc)
toGlobalMotionEvent
{ "repo_name": "syslover33/ctank", "path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/android/support/v7/widget/ListPopupWindow.java", "license": "gpl-3.0", "size": 66867 }
[ "android.view.MotionEvent", "android.view.View" ]
import android.view.MotionEvent; import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
2,493,193
public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException { if (_declHandler != null) { _declHandler.externalEntityDecl(name, publicId, systemId); } }
void function(String name, String publicId, String systemId) throws SAXException { if (_declHandler != null) { _declHandler.externalEntityDecl(name, publicId, systemId); } }
/** * Implements org.xml.sax.ext.DeclHandler.externalEntityDecl() */
Implements org.xml.sax.ext.DeclHandler.externalEntityDecl()
externalEntityDecl
{ "repo_name": "srnsw/xena", "path": "xena/ext/src/xalan-j_2_7_1/src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java", "license": "gpl-3.0", "size": 14708 }
[ "org.xml.sax.SAXException" ]
import org.xml.sax.SAXException;
import org.xml.sax.*;
[ "org.xml.sax" ]
org.xml.sax;
2,915,615
public AsymmetricKeyParameter decodePublicKey(final byte[] publicKeyData) throws IOException { final AsymmetricKeyParameter asymmetricKeyParameter = PublicKeyFactory.createKey(publicKeyData); return asymmetricKeyParameter; }
AsymmetricKeyParameter function(final byte[] publicKeyData) throws IOException { final AsymmetricKeyParameter asymmetricKeyParameter = PublicKeyFactory.createKey(publicKeyData); return asymmetricKeyParameter; }
/** * Decode (deserialise) a public key, that was previously encoded (serialised) by {@link #encodePublicKey(CipherParameters)}. * @param publicKeyData the serialised public key. * @return the public key (as previously passed to {@link #encodePublicKey(CipherParameters)}). * @throws IOException if parsing the s...
Decode (deserialise) a public key, that was previously encoded (serialised) by <code>#encodePublicKey(CipherParameters)</code>
decodePublicKey
{ "repo_name": "subshare/subshare", "path": "org.subshare/org.subshare.crypto/src/main/java/org/subshare/crypto/CryptoRegistry.java", "license": "agpl-3.0", "size": 68206 }
[ "java.io.IOException", "org.bouncycastle.crypto.params.AsymmetricKeyParameter", "org.bouncycastle.crypto.util.PublicKeyFactory" ]
import java.io.IOException; import org.bouncycastle.crypto.params.AsymmetricKeyParameter; import org.bouncycastle.crypto.util.PublicKeyFactory;
import java.io.*; import org.bouncycastle.crypto.params.*; import org.bouncycastle.crypto.util.*;
[ "java.io", "org.bouncycastle.crypto" ]
java.io; org.bouncycastle.crypto;
1,652,114
public Dimension getMinimumSize(JComponent a) { Dimension returnValue = uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { uis.elementAt(i).getMinimumSize(a); } return returnValue; }
Dimension function(JComponent a) { Dimension returnValue = uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { uis.elementAt(i).getMinimumSize(a); } return returnValue; }
/** * Invokes the <code>getMinimumSize</code> method on each UI handled by this object. * * @return the value obtained from the first UI, which is * the UI obtained from the default <code>LookAndFeel</code> */
Invokes the <code>getMinimumSize</code> method on each UI handled by this object
getMinimumSize
{ "repo_name": "mirkosertic/Bytecoder", "path": "classlib/java.desktop/src/main/resources/META-INF/modules/java.desktop/classes/javax/swing/plaf/multi/MultiRootPaneUI.java", "license": "apache-2.0", "size": 7313 }
[ "java.awt.Dimension", "javax.swing.JComponent" ]
import java.awt.Dimension; import javax.swing.JComponent;
import java.awt.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
1,277,083
protected Tile getPreviousTile() { return level.getTile(((int) x >> 5) - dir.dx(), ((int) y >> 5) + dir.dy()); }
Tile function() { return level.getTile(((int) x >> 5) - dir.dx(), ((int) y >> 5) + dir.dy()); }
/** * Get previous tile according to current movement direction. * * @return tile */
Get previous tile according to current movement direction
getPreviousTile
{ "repo_name": "Korriban/DuskMoon", "path": "src/main/java/de/cirrus/dusk/entities/Mob.java", "license": "gpl-3.0", "size": 3826 }
[ "de.cirrus.dusk.level.tile.Tile" ]
import de.cirrus.dusk.level.tile.Tile;
import de.cirrus.dusk.level.tile.*;
[ "de.cirrus.dusk" ]
de.cirrus.dusk;
771,171
AmazonS3Client createS3Client() { AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(), configuration.getSecretKey()); AmazonS3Client client = new AmazonS3Client(credentials); if (configuration.getAmazonS3Endpoint() != null) { client.setEndpoint(confi...
AmazonS3Client createS3Client() { AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(), configuration.getSecretKey()); AmazonS3Client client = new AmazonS3Client(credentials); if (configuration.getAmazonS3Endpoint() != null) { client.setEndpoint(configuration.getAmazonS3Endpoint()); } retur...
/** * Provide the possibility to override this method for an mock implementation * * @return AmazonS3Client */
Provide the possibility to override this method for an mock implementation
createS3Client
{ "repo_name": "aaronwalker/camel", "path": "components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Endpoint.java", "license": "apache-2.0", "size": 7390 }
[ "com.amazonaws.auth.AWSCredentials", "com.amazonaws.auth.BasicAWSCredentials", "com.amazonaws.services.s3.AmazonS3Client" ]
import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.BasicAWSCredentials; import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.auth.*; import com.amazonaws.services.s3.*;
[ "com.amazonaws.auth", "com.amazonaws.services" ]
com.amazonaws.auth; com.amazonaws.services;
723,106
public final void testChildCommentModelContext() { model = new ChildCommentModel(getInstrumentation().getContext()); assertNotNull(model); }
final void function() { model = new ChildCommentModel(getInstrumentation().getContext()); assertNotNull(model); }
/** * Test whether we can instantiate a ChildCommentModel */
Test whether we can instantiate a ChildCommentModel
testChildCommentModelContext
{ "repo_name": "CMPUT301W14T01/localpost", "path": "LocalpostTestingTest/src/ca/cs/ualberta/localpost/test/ChildCommentModelTest.java", "license": "mit", "size": 1961 }
[ "ca.cs.ualberta.localpost.model.ChildCommentModel" ]
import ca.cs.ualberta.localpost.model.ChildCommentModel;
import ca.cs.ualberta.localpost.model.*;
[ "ca.cs.ualberta" ]
ca.cs.ualberta;
52,888
public List<CmsCategory> readResourceCategories(CmsObject cms, String resourceName) throws CmsException { return internalReadResourceCategories(cms, cms.readResource(resourceName), false); }
List<CmsCategory> function(CmsObject cms, String resourceName) throws CmsException { return internalReadResourceCategories(cms, cms.readResource(resourceName), false); }
/** * Reads the categories for a resource identified by the given resource name.<p> * * @param cms the current cms context * @param resourceName the path of the resource to get the categories for * * @return the categories list * * @throws CmsException if something goes wrong ...
Reads the categories for a resource identified by the given resource name
readResourceCategories
{ "repo_name": "ggiudetti/opencms-core", "path": "src/org/opencms/relations/CmsCategoryService.java", "license": "lgpl-2.1", "size": 30886 }
[ "java.util.List", "org.opencms.file.CmsObject", "org.opencms.main.CmsException" ]
import java.util.List; import org.opencms.file.CmsObject; import org.opencms.main.CmsException;
import java.util.*; import org.opencms.file.*; import org.opencms.main.*;
[ "java.util", "org.opencms.file", "org.opencms.main" ]
java.util; org.opencms.file; org.opencms.main;
1,786,368
@Override public void addView(View child, int index, LayoutParams params) { throw new UnsupportedOperationException( "addView(View, int, LayoutParams) " + "is not supported in CarouselAdapter"); }
void function(View child, int index, LayoutParams params) { throw new UnsupportedOperationException( STR + STR); }
/** * This method is not supported and throws an UnsupportedOperationException * when called. * * @param child * Ignored. * @param index * Ignored. * @param params * Ignored. * * @throws UnsupportedOperationException * Every time this me...
This method is not supported and throws an UnsupportedOperationException when called
addView
{ "repo_name": "Git-tl/appcan-plugin-timemachine-android", "path": "uexTimeMachine/src/org/zywx/wbpalmstar/plugin/uextimemachine/CarouselAdapter.java", "license": "lgpl-3.0", "size": 33927 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
214,295
public void delete(final Key key) throws DurabilityException, RequestTimeoutException, FaultException { delete(key, null, null, 0, null); }
void function(final Key key) throws DurabilityException, RequestTimeoutException, FaultException { delete(key, null, null, 0, null); }
/** * Calls {@link KVStore#delete(Key) KVStore.delete} and performs retries * if a FaultException is thrown. * <p> * This method is equivalent to {@link #delete(Key, ReturnValueVersion, * Durability, long, TimeUnit)} except that the prevValue, durability, * timeout and timeoutUnit paramete...
Calls <code>KVStore#delete(Key) KVStore.delete</code> and performs retries if a FaultException is thrown. This method is equivalent to <code>#delete(Key, ReturnValueVersion, Durability, long, TimeUnit)</code> except that the prevValue, durability, timeout and timeoutUnit parameters are not specified and take on default...
delete
{ "repo_name": "p4datasystems/CarnotDE", "path": "WDB/examples/schema/WriteOperations.java", "license": "apache-2.0", "size": 55421 }
[ "oracle.kv.DurabilityException", "oracle.kv.FaultException", "oracle.kv.Key", "oracle.kv.RequestTimeoutException" ]
import oracle.kv.DurabilityException; import oracle.kv.FaultException; import oracle.kv.Key; import oracle.kv.RequestTimeoutException;
import oracle.kv.*;
[ "oracle.kv" ]
oracle.kv;
1,386,959
public TreeNode getChildAt(int pos) { loadChildren(); return super.getChildAt(pos); }
TreeNode function(int pos) { loadChildren(); return super.getChildAt(pos); }
/** * Returns the child node at position <code>pos</code>. Subclassed * here to load the children if necessary. * * @param pos the position of the child node to fetch * * @return the childnode at the specified position */
Returns the child node at position <code>pos</code>. Subclassed here to load the children if necessary
getChildAt
{ "repo_name": "SanDisk-Open-Source/SSD_Dashboard", "path": "uefi/gcc/gcc-4.6.3/libjava/classpath/javax/swing/JTree.java", "license": "gpl-2.0", "size": 83318 }
[ "javax.swing.tree.TreeNode" ]
import javax.swing.tree.TreeNode;
import javax.swing.tree.*;
[ "javax.swing" ]
javax.swing;
2,075,640
@Test public void testDataRefEncryptedKeyProcessor() throws Exception { Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG); WSSecHeader secHeader = new WSSecHeader(doc); secHeader.insertSecurityHeader(); WSSecEncrypt builder = new WSSecEncrypt(secHeader); build...
void function() throws Exception { Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG); WSSecHeader secHeader = new WSSecHeader(doc); secHeader.insertSecurityHeader(); WSSecEncrypt builder = new WSSecEncrypt(secHeader); builder.setUserInfo("wss40"); builder.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE...
/** * Test that check for correct WSDataRef object from EncryptedKey Processor * * * @throws Exception * Thrown when there is an error in encryption or decryption */
Test that check for correct WSDataRef object from EncryptedKey Processor
testDataRefEncryptedKeyProcessor
{ "repo_name": "apache/wss4j", "path": "ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/EncryptedKeyDataRefTest.java", "license": "apache-2.0", "size": 7646 }
[ "javax.crypto.KeyGenerator", "javax.crypto.SecretKey", "org.apache.wss4j.common.WSEncryptionPart", "org.apache.wss4j.common.util.KeyUtils", "org.apache.wss4j.dom.WSConstants", "org.apache.wss4j.dom.common.SOAPUtil", "org.apache.wss4j.dom.message.WSSecEncrypt", "org.apache.wss4j.dom.message.WSSecHeader...
import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import org.apache.wss4j.common.WSEncryptionPart; import org.apache.wss4j.common.util.KeyUtils; import org.apache.wss4j.dom.WSConstants; import org.apache.wss4j.dom.common.SOAPUtil; import org.apache.wss4j.dom.message.WSSecEncrypt; import org.apache.wss4j....
import javax.crypto.*; import org.apache.wss4j.common.*; import org.apache.wss4j.common.util.*; import org.apache.wss4j.dom.*; import org.apache.wss4j.dom.common.*; import org.apache.wss4j.dom.message.*; import org.w3c.dom.*;
[ "javax.crypto", "org.apache.wss4j", "org.w3c.dom" ]
javax.crypto; org.apache.wss4j; org.w3c.dom;
2,753,245