method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
public static Buffer read( Server server, String path, long startFrame )
throws IOException
{
return Buffer.read( server, path, startFrame, -1 );
} | static Buffer function( Server server, String path, long startFrame ) throws IOException { return Buffer.read( server, path, startFrame, -1 ); } | /**
* Reads a whole file into memory for PlayBuf etc., starting at a given frame.
* adds a query as a completion message.
*
* @param server the server on which the buffer is allocated
* @param path the path to the sound file
* @param startFrame the frame index in the sound file to start reading from
*
* @return the newly created Buffer or <code>null</code> if the server's buffer allocator
* is exhausted
*
* @throws IOException if an error occurs while sending the OSC message
*
* @warning <code>long startFrame</code> is truncated to 32bit by <code>OSCMessage</code> for now
*/ | Reads a whole file into memory for PlayBuf etc., starting at a given frame. adds a query as a completion message | read | {
"repo_name": "acm-uiuc/Tacchi",
"path": "libs/JCollider/src/de/sciss/jcollider/Buffer.java",
"license": "gpl-2.0",
"size": 89231
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,190,325 |
EAttribute getPurchasedMessage_UserID(); | EAttribute getPurchasedMessage_UserID(); | /**
* Returns the meta object for the attribute '{@link MessagesModel.PurchasedMessage#getUserID <em>User ID</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>User ID</em>'.
* @see MessagesModel.PurchasedMessage#getUserID()
* @see #getPurchasedMessage()
* @generated
*/ | Returns the meta object for the attribute '<code>MessagesModel.PurchasedMessage#getUserID User ID</code>'. | getPurchasedMessage_UserID | {
"repo_name": "Hu3bl/statsbot",
"path": "statsbot-parent/statsbot-module.messages.model/src/main/java/MessagesModel/ModelPackage.java",
"license": "mit",
"size": 147130
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 773,102 |
public void onSuccess();
/**
* Called when a request to Connect has failed.
* @param e A ConnectException outlining the error that occurred.
* Will be {@link InvalidEventException}, {@Link ServerException} | void function(); /** * Called when a request to Connect has failed. * @param e A ConnectException outlining the error that occurred. * Will be {@link InvalidEventException}, {@Link ServerException} | /**
* Called when a request to Connect has been successful.
*/ | Called when a request to Connect has been successful | onSuccess | {
"repo_name": "getconnect/connect-java",
"path": "core/src/main/java/io/getconnect/client/ConnectCallback.java",
"license": "mit",
"size": 638
} | [
"io.getconnect.client.exceptions.ConnectException",
"io.getconnect.client.exceptions.InvalidEventException"
] | import io.getconnect.client.exceptions.ConnectException; import io.getconnect.client.exceptions.InvalidEventException; | import io.getconnect.client.exceptions.*; | [
"io.getconnect.client"
] | io.getconnect.client; | 2,887,006 |
public ServerSocket createServerSocket(int port)
throws IOException
{
return init((SSLServerSocket) ssf.createServerSocket(port));
} | ServerSocket function(int port) throws IOException { return init((SSLServerSocket) ssf.createServerSocket(port)); } | /**
* Description of the Method
*
* @param port Description of the Parameter
* @return Description of the Return Value
* @exception IOException Description of the Exception
*/ | Description of the Method | createServerSocket | {
"repo_name": "medicayun/medicayundicom",
"path": "dcm4che14/tags/DCM4CHE_1_4_5/src/java/org/dcm4cheri/util/SSLContextAdapterImpl.java",
"license": "apache-2.0",
"size": 25753
} | [
"java.io.IOException",
"java.net.ServerSocket",
"javax.net.ssl.SSLServerSocket"
] | import java.io.IOException; import java.net.ServerSocket; import javax.net.ssl.SSLServerSocket; | import java.io.*; import java.net.*; import javax.net.ssl.*; | [
"java.io",
"java.net",
"javax.net"
] | java.io; java.net; javax.net; | 1,991,499 |
@Test
public void testConflictingFilesystem() throws IOException {
FrameworkUploader uploader = new FrameworkUploader();
Configuration conf = new Configuration();
conf.set(FS_DEFAULT_NAME_KEY, "hdfs://namenode:555");
uploader.setConf(conf);
boolean success = uploader.parseArguments(new String[]{
"-target",
"file:///usr/lib/mr-framework.tar.gz#mr-framework"
});
Assert.assertTrue("Expected to parse arguments", success);
Assert.assertEquals(
"Expected",
"file:///usr/lib/mr-framework.tar.gz#mr-framework",
uploader.target);
} | void function() throws IOException { FrameworkUploader uploader = new FrameworkUploader(); Configuration conf = new Configuration(); conf.set(FS_DEFAULT_NAME_KEY, STR-targetSTRfile: }); Assert.assertTrue(STR, success); Assert.assertEquals( "ExpectedSTRfile: uploader.target); } | /**
* Test the conflicting filesystem specification.
*/ | Test the conflicting filesystem specification | testConflictingFilesystem | {
"repo_name": "xiao-chen/hadoop",
"path": "hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-uploader/src/test/java/org/apache/hadoop/mapred/uploader/TestFrameworkUploader.java",
"license": "apache-2.0",
"size": 16420
} | [
"java.io.IOException",
"org.apache.hadoop.conf.Configuration",
"org.junit.Assert"
] | import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.junit.Assert; | import java.io.*; import org.apache.hadoop.conf.*; import org.junit.*; | [
"java.io",
"org.apache.hadoop",
"org.junit"
] | java.io; org.apache.hadoop; org.junit; | 2,209,377 |
EReference getsubrangeType_First(); | EReference getsubrangeType_First(); | /**
* Returns the meta object for the containment reference '{@link org.xtext.example.delphi.delphi.subrangeType#getFirst <em>First</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>First</em>'.
* @see org.xtext.example.delphi.delphi.subrangeType#getFirst()
* @see #getsubrangeType()
* @generated
*/ | Returns the meta object for the containment reference '<code>org.xtext.example.delphi.delphi.subrangeType#getFirst First</code>'. | getsubrangeType_First | {
"repo_name": "adolfosbh/cs2as",
"path": "org.xtext.example.delphi/src-gen/org/xtext/example/delphi/delphi/DelphiPackage.java",
"license": "epl-1.0",
"size": 434880
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 416,160 |
public boolean setChatOption(final ChatButton option, final ChatMode mode) {
if (option == null || !option.hasMode(mode)) {
return false;
}
if (mode == ChatMode.VIEW) {
return mouseChatButton(option, true);
}
final RSComponent chat = methods.interfaces.getComponent(CHAT_OPTION, option.textIdx());
if (chat != null) {
String setting = chat.getText();
setting = setting.substring(setting.indexOf(">") + 1);
if (setting.toUpperCase().equals(mode.toString())) {
return false;
}
}
mouseChatButton(option, false);
return methods.menu.doAction(mode.toString());
} | boolean function(final ChatButton option, final ChatMode mode) { if (option == null !option.hasMode(mode)) { return false; } if (mode == ChatMode.VIEW) { return mouseChatButton(option, true); } final RSComponent chat = methods.interfaces.getComponent(CHAT_OPTION, option.textIdx()); if (chat != null) { String setting = chat.getText(); setting = setting.substring(setting.indexOf(">") + 1); if (setting.toUpperCase().equals(mode.toString())) { return false; } } mouseChatButton(option, false); return methods.menu.doAction(mode.toString()); } | /**
* Sets the specified chat mode
*
* @param option one of ChatButton
* @param mode one of ChatMode
* @return <tt>true</tt> if item was clicked correctly; otherwise <tt>false</tt>.
*/ | Sets the specified chat mode | setChatOption | {
"repo_name": "Latency/UtopianBot",
"path": "src/org/rsbot/script/methods/Game.java",
"license": "lgpl-3.0",
"size": 18783
} | [
"org.rsbot.script.wrappers.RSComponent"
] | import org.rsbot.script.wrappers.RSComponent; | import org.rsbot.script.wrappers.*; | [
"org.rsbot.script"
] | org.rsbot.script; | 1,249,905 |
void logError(String error) {
logStream.println(dateFormat.format(new Date()) + "\t Error: " + error);
myNode.observerNotice(Event.HTTP_CONNECTOR_ERROR, myNode.getNodeId(), error);
} | void logError(String error) { logStream.println(dateFormat.format(new Date()) + STR + error); myNode.observerNotice(Event.HTTP_CONNECTOR_ERROR, myNode.getNodeId(), error); } | /**
* Logs an error.
*
* @param error
*/ | Logs an error | logError | {
"repo_name": "rwth-acis/LAS2peer-HttpConnector",
"path": "src/main/java/i5/las2peer/httpConnector/HttpConnector.java",
"license": "bsd-3-clause",
"size": 11589
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 2,396,223 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<ServerUsageInner>> listSinglePageAsync(String resourceGroupName, String workspaceName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (workspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
}
final String apiVersion = "2021-06-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.list(
this.client.getEndpoint(),
apiVersion,
this.client.getSubscriptionId(),
resourceGroupName,
workspaceName,
accept,
context))
.<PagedResponse<ServerUsageInner>>map(
res ->
new PagedResponseBase<>(
res.getRequest(),
res.getStatusCode(),
res.getHeaders(),
res.getValue().value(),
res.getValue().nextLink(),
null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
} | @ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<ServerUsageInner>> function(String resourceGroupName, String workspaceName) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (workspaceName == null) { return Mono.error(new IllegalArgumentException(STR)); } final String apiVersion = STR; final String accept = STR; return FluxUtil .withContext( context -> service .list( this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .<PagedResponse<ServerUsageInner>>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } | /**
* Get list of server usages metric for workspace managed sql server.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param workspaceName The name of the workspace.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return list of server usages metric for workspace managed sql server along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/ | Get list of server usages metric for workspace managed sql server | listSinglePageAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerUsagesClientImpl.java",
"license": "mit",
"size": 16691
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedResponse",
"com.azure.core.http.rest.PagedResponseBase",
"com.azure.core.util.FluxUtil",
"com.azure.resourcemanager.synapse.fluent.models.ServerUsageInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.synapse.fluent.models.ServerUsageInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.synapse.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 2,256,305 |
@Override
public final PTType instantiateGenerics(Map<String, PTType> genericInstantiations,
FacilityEntry instantiatingFacility) {
return this;
} | final PTType function(Map<String, PTType> genericInstantiations, FacilityEntry instantiatingFacility) { return this; } | /**
* <p>
* This method converts a generic {@link PTType} to a program type that has all the generic types and variables
* replaced with actual values.
* </p>
*
* @param genericInstantiations
* Map containing all the instantiations.
* @param instantiatingFacility
* Facility that instantiated this type.
*
* @return A {@link PTType} that has been instantiated.
*/ | This method converts a generic <code>PTType</code> to a program type that has all the generic types and variables replaced with actual values. | instantiateGenerics | {
"repo_name": "ClemsonRSRG/RESOLVE",
"path": "src/java/edu/clemson/rsrg/typeandpopulate/programtypes/PTElement.java",
"license": "bsd-3-clause",
"size": 2270
} | [
"edu.clemson.rsrg.typeandpopulate.entry.FacilityEntry",
"java.util.Map"
] | import edu.clemson.rsrg.typeandpopulate.entry.FacilityEntry; import java.util.Map; | import edu.clemson.rsrg.typeandpopulate.entry.*; import java.util.*; | [
"edu.clemson.rsrg",
"java.util"
] | edu.clemson.rsrg; java.util; | 1,260,892 |
private static int extactLookupId(final HBaseClient client,
final byte[] table,
final short idwidth,
final String kind,
final byte[] id) {
final UniqueId uid = new UniqueId(client, table, kind, (int) idwidth);
try {
final String name = uid.getName(id);
System.out.println(kind + ' ' + name + ": " + Arrays.toString(id));
return 0;
} catch (NoSuchUniqueId e) {
LOG.error(e.getMessage());
return 1;
}
} | static int function(final HBaseClient client, final byte[] table, final short idwidth, final String kind, final byte[] id) { final UniqueId uid = new UniqueId(client, table, kind, (int) idwidth); try { final String name = uid.getName(id); System.out.println(kind + ' ' + name + STR + Arrays.toString(id)); return 0; } catch (NoSuchUniqueId e) { LOG.error(e.getMessage()); return 1; } } | /**
* Looks up an ID for a given kind, and prints it if found.
* @param client The HBase client to use.
* @param table The name of the HBase table to use.
* @param idwidth Number of bytes on which the UIDs should be.
* @param kind The 'kind' of the ID (must not be {@code null}).
* @param id The ID to look for.
* @return 0 if the ID for this kind was found, 1 otherwise.
*/ | Looks up an ID for a given kind, and prints it if found | extactLookupId | {
"repo_name": "pepperdata/opentsdb",
"path": "opentsdb-core/src/main/java/net/opentsdb/tools/UidManager.java",
"license": "lgpl-2.1",
"size": 48356
} | [
"java.util.Arrays",
"net.opentsdb.uid.NoSuchUniqueId",
"net.opentsdb.uid.UniqueId",
"org.hbase.async.HBaseClient"
] | import java.util.Arrays; import net.opentsdb.uid.NoSuchUniqueId; import net.opentsdb.uid.UniqueId; import org.hbase.async.HBaseClient; | import java.util.*; import net.opentsdb.uid.*; import org.hbase.async.*; | [
"java.util",
"net.opentsdb.uid",
"org.hbase.async"
] | java.util; net.opentsdb.uid; org.hbase.async; | 1,181,358 |
public static InputStream buildBufferedInputStream(final File inputFile) throws IOException {
return new BufferedInputStream(new FileInputStream(inputFile), FileUtils.BUFFER_SIZE);
}
| static InputStream function(final File inputFile) throws IOException { return new BufferedInputStream(new FileInputStream(inputFile), FileUtils.BUFFER_SIZE); } | /**
* Build a new file input stream, buffered.
*
* @param inputFile
* the input file
* @return the new input stream
* @throws IOException
* Exception when creating the file input stream
*/ | Build a new file input stream, buffered | buildBufferedInputStream | {
"repo_name": "Hartorn/mysql2postgresql",
"path": "XmlToSql/src/main/java/com/github/hartorn/mysql2pgsql/FileUtils.java",
"license": "apache-2.0",
"size": 3799
} | [
"java.io.BufferedInputStream",
"java.io.File",
"java.io.FileInputStream",
"java.io.IOException",
"java.io.InputStream"
] | import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,395,889 |
public CcLibraryHelper addPicStaticLibraries(Iterable<LibraryToLink> libraries) {
Iterables.addAll(picStaticLibraries, libraries);
return this;
} | CcLibraryHelper function(Iterable<LibraryToLink> libraries) { Iterables.addAll(picStaticLibraries, libraries); return this; } | /**
* Add the corresponding files as static libraries into the linker outputs (i.e., after the linker
* action) - this makes them available for linking to binary rules that depend on this rule.
*/ | Add the corresponding files as static libraries into the linker outputs (i.e., after the linker action) - this makes them available for linking to binary rules that depend on this rule | addPicStaticLibraries | {
"repo_name": "hermione521/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibraryHelper.java",
"license": "apache-2.0",
"size": 61939
} | [
"com.google.common.collect.Iterables",
"com.google.devtools.build.lib.rules.cpp.LinkerInputs"
] | import com.google.common.collect.Iterables; import com.google.devtools.build.lib.rules.cpp.LinkerInputs; | import com.google.common.collect.*; import com.google.devtools.build.lib.rules.cpp.*; | [
"com.google.common",
"com.google.devtools"
] | com.google.common; com.google.devtools; | 2,686,158 |
public static Path toFilePath(Path dir, String name) throws IOException {
boolean expectDirectory = name.endsWith("/");
if (expectDirectory) {
name = name.substring(0, name.length() - 1); // drop trailing "/"
}
Path path = toSafeFilePath(dir.getFileSystem(), name);
if (path != null) {
Path file = dir.resolve(path);
try {
BasicFileAttributes attrs;
attrs = Files.readAttributes(file, BasicFileAttributes.class);
if (attrs.isDirectory()
|| (!attrs.isDirectory() && !expectDirectory))
return file;
} catch (NoSuchFileException ignore) { }
}
return null;
} | static Path function(Path dir, String name) throws IOException { boolean expectDirectory = name.endsWith("/"); if (expectDirectory) { name = name.substring(0, name.length() - 1); } Path path = toSafeFilePath(dir.getFileSystem(), name); if (path != null) { Path file = dir.resolve(path); try { BasicFileAttributes attrs; attrs = Files.readAttributes(file, BasicFileAttributes.class); if (attrs.isDirectory() (!attrs.isDirectory() && !expectDirectory)) return file; } catch (NoSuchFileException ignore) { } } return null; } | /**
* Returns a file path to a resource in a file tree. If the resource
* name has a trailing "/" then the file path will locate a directory.
* Returns {@code null} if the resource does not map to a file in the
* tree file.
*/ | Returns a file path to a resource in a file tree. If the resource name has a trailing "/" then the file path will locate a directory. Returns null if the resource does not map to a file in the tree file | toFilePath | {
"repo_name": "mirkosertic/Bytecoder",
"path": "classlib/java.base/src/main/resources/META-INF/modules/java.base/classes/jdk/internal/module/Resources.java",
"license": "apache-2.0",
"size": 6187
} | [
"java.io.IOException",
"java.nio.file.Files",
"java.nio.file.NoSuchFileException",
"java.nio.file.Path",
"java.nio.file.attribute.BasicFileAttributes"
] | import java.io.IOException; import java.nio.file.Files; import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.nio.file.attribute.BasicFileAttributes; | import java.io.*; import java.nio.file.*; import java.nio.file.attribute.*; | [
"java.io",
"java.nio"
] | java.io; java.nio; | 455,668 |
@Idempotent
public void transitionToStandby(StateChangeRequestInfo reqInfo)
throws ServiceFailedException,
AccessControlException,
IOException;
/**
* Return the current status of the service. The status indicates
* the current <em>state</em> (e.g ACTIVE/STANDBY) as well as
* some additional information. {@see HAServiceStatus} | void function(StateChangeRequestInfo reqInfo) throws ServiceFailedException, AccessControlException, IOException; /** * Return the current status of the service. The status indicates * the current <em>state</em> (e.g ACTIVE/STANDBY) as well as * some additional information. {@see HAServiceStatus} | /**
* Request service to transition to standby state. No operation, if the
* service is already in standby state.
*
* @throws ServiceFailedException
* if transition from active to standby fails.
* @throws AccessControlException
* if access is denied.
* @throws IOException
* if other errors happen
*/ | Request service to transition to standby state. No operation, if the service is already in standby state | transitionToStandby | {
"repo_name": "ict-carch/hadoop-plus",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAServiceProtocol.java",
"license": "apache-2.0",
"size": 5399
} | [
"java.io.IOException",
"org.apache.hadoop.security.AccessControlException"
] | import java.io.IOException; import org.apache.hadoop.security.AccessControlException; | import java.io.*; import org.apache.hadoop.security.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 808,635 |
public java.util.List<fr.lip6.move.pnml.hlpn.lists.hlapi.HLPNListHLAPI> getInput_lists_HLPNListHLAPI(){
java.util.List<fr.lip6.move.pnml.hlpn.lists.hlapi.HLPNListHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.lists.hlapi.HLPNListHLAPI>();
for (Sort elemnt : getInput()) {
if(elemnt.getClass().equals(fr.lip6.move.pnml.hlpn.lists.impl.HLPNListImpl.class)){
retour.add(new fr.lip6.move.pnml.hlpn.lists.hlapi.HLPNListHLAPI(
(fr.lip6.move.pnml.hlpn.lists.HLPNList)elemnt
));
}
}
return retour;
}
| java.util.List<fr.lip6.move.pnml.hlpn.lists.hlapi.HLPNListHLAPI> function(){ java.util.List<fr.lip6.move.pnml.hlpn.lists.hlapi.HLPNListHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.lists.hlapi.HLPNListHLAPI>(); for (Sort elemnt : getInput()) { if(elemnt.getClass().equals(fr.lip6.move.pnml.hlpn.lists.impl.HLPNListImpl.class)){ retour.add(new fr.lip6.move.pnml.hlpn.lists.hlapi.HLPNListHLAPI( (fr.lip6.move.pnml.hlpn.lists.HLPNList)elemnt )); } } return retour; } | /**
* This accessor return a list of encapsulated subelement, only of HLPNListHLAPI kind.
* WARNING : this method can creates a lot of new object in memory.
*/ | This accessor return a list of encapsulated subelement, only of HLPNListHLAPI kind. WARNING : this method can creates a lot of new object in memory | getInput_lists_HLPNListHLAPI | {
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/strings/hlapi/GreaterThanHLAPI.java",
"license": "epl-1.0",
"size": 108533
} | [
"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,394,622 |
public void flushStorage() {
for (final ByteMap<ByteMap<ByteMap<TreeMap<Long, byte[]>>>> table :
storage.values()) {
for (final ByteMap<ByteMap<TreeMap<Long, byte[]>>> cf : table.values()) {
cf.clear();
}
}
} | void function() { for (final ByteMap<ByteMap<ByteMap<TreeMap<Long, byte[]>>>> table : storage.values()) { for (final ByteMap<ByteMap<TreeMap<Long, byte[]>>> cf : table.values()) { cf.clear(); } } } | /**
* Clears out all rows from storage but doesn't delete the tables or families.
*/ | Clears out all rows from storage but doesn't delete the tables or families | flushStorage | {
"repo_name": "manolama/opentsdb",
"path": "test/storage/MockBase.java",
"license": "lgpl-2.1",
"size": 67471
} | [
"java.util.TreeMap",
"org.hbase.async.Bytes"
] | import java.util.TreeMap; import org.hbase.async.Bytes; | import java.util.*; import org.hbase.async.*; | [
"java.util",
"org.hbase.async"
] | java.util; org.hbase.async; | 385,085 |
public static List getDefaultFileList(final String target) {
File path = new File(target);
File[] files = path.listFiles((dir, name) ->
name.toLowerCase().endsWith(".pdf"));
assert files != null;
List<String> listFiles = new ArrayList<>();
for (File f : files) {
listFiles.add(f.getAbsolutePath());
}
listFiles.sort(Comparator.comparingInt(String::length));
return listFiles;
} | static List function(final String target) { File path = new File(target); File[] files = path.listFiles((dir, name) -> name.toLowerCase().endsWith(".pdf")); assert files != null; List<String> listFiles = new ArrayList<>(); for (File f : files) { listFiles.add(f.getAbsolutePath()); } listFiles.sort(Comparator.comparingInt(String::length)); return listFiles; } | /**
* Get list files.
*
* @param target the String
* @return file list
*/ | Get list files | getDefaultFileList | {
"repo_name": "Veminal/PDFConfigurator",
"path": "src/main/java/net/veminal/pdf/utils/FilesUtil.java",
"license": "gpl-3.0",
"size": 2075
} | [
"java.io.File",
"java.util.ArrayList",
"java.util.Comparator",
"java.util.List"
] | import java.io.File; import java.util.ArrayList; import java.util.Comparator; import java.util.List; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 1,684,327 |
private void populateLunchSchedule(String classesFile) {
List<LsClass> lunchClasses = FileManager
.loadClassesFromFile(classesFile);
int lunchNumber = 0;
for (int i = 0; i < lunchClasses.size(); i++) {
LsClass lsc = lunchClasses.get(i);
if (rules.isClassPlacementLegal(lsc, lunchNumber)) {
lunchNumber++;
if (lunchNumber >= schedule.length) {
lunchNumber = 0;
}
LsBlock b = schedule[lunchNumber];
b.add(lsc);
} else {
boolean found = false;
for (int j = 0; j < schedule.length; j++) {
if (j == lunchNumber)
continue;
if (rules.isClassPlacementLegal(lsc, j)) {
LsBlock b = schedule[lunchNumber];
b.add(lsc);
found = true;
break;
}
}
assert (found);
}
}
} | void function(String classesFile) { List<LsClass> lunchClasses = FileManager .loadClassesFromFile(classesFile); int lunchNumber = 0; for (int i = 0; i < lunchClasses.size(); i++) { LsClass lsc = lunchClasses.get(i); if (rules.isClassPlacementLegal(lsc, lunchNumber)) { lunchNumber++; if (lunchNumber >= schedule.length) { lunchNumber = 0; } LsBlock b = schedule[lunchNumber]; b.add(lsc); } else { boolean found = false; for (int j = 0; j < schedule.length; j++) { if (j == lunchNumber) continue; if (rules.isClassPlacementLegal(lsc, j)) { LsBlock b = schedule[lunchNumber]; b.add(lsc); found = true; break; } } assert (found); } } } | /**
* Initially populates the lunch schedule by reading through the data files
* and sorting them into the blocks
**/ | Initially populates the lunch schedule by reading through the data files and sorting them into the blocks | populateLunchSchedule | {
"repo_name": "darcn/lunch-scheduler",
"path": "src/edu/danc/newEngine/LsChromosome.java",
"license": "mit",
"size": 3877
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,769,007 |
protected ObjectName createObjectName(StringBuilder buffer) throws MalformedObjectNameException {
String text = buffer.toString();
try {
return new ObjectName(text);
} catch (MalformedObjectNameException e) {
throw new MalformedObjectNameException("Could not create ObjectName from: " + text + ". Reason: " + e);
}
} | ObjectName function(StringBuilder buffer) throws MalformedObjectNameException { String text = buffer.toString(); try { return new ObjectName(text); } catch (MalformedObjectNameException e) { throw new MalformedObjectNameException(STR + text + STR + e); } } | /**
* Factory method to create an ObjectName escaping any required characters
*/ | Factory method to create an ObjectName escaping any required characters | createObjectName | {
"repo_name": "anton-k11/camel",
"path": "camel-core/src/main/java/org/apache/camel/management/DefaultManagementNamingStrategy.java",
"license": "apache-2.0",
"size": 19393
} | [
"javax.management.MalformedObjectNameException",
"javax.management.ObjectName"
] | import javax.management.MalformedObjectNameException; import javax.management.ObjectName; | import javax.management.*; | [
"javax.management"
] | javax.management; | 427,323 |
public static PreparedStatement preencherCampos(final PreparedStatement stm, final Object...params) throws Exception{
for (int i = 0; i < params.length; i++) {
if (params[i] instanceof String) {
stm.setString(i + 1, Utilidades.convertTo(params[i]));
} else if (params[i] instanceof Integer) {
stm.setInt(i + 1, Utilidades.convertTo(params[i]));
} else if (params[i] instanceof Boolean) {
stm.setBoolean(i + 1, Utilidades.convertTo(params[i]));
} else if (params[i] instanceof Date) {
stm.setDate(i + 1, Utilidades.convertTo(params[i]));
} else if (params[i] instanceof Double) {
stm.setDouble(i + 1, Utilidades.convertTo(params[i]));
} else if (params[i] instanceof Float) {
stm.setFloat(i + 1, Utilidades.convertTo(params[i]));
} else {
stm.setObject(i + 1, params[i]);
}
}
return stm;
}
/**
* Converte um dado recebido da consulta no banco de dados e o separa suas
* colunas em atributos de um objeto que representa a tabela do banco de dados,
* para que os dados da tabela seja atribuidos a seus atributos, cada método Set
* deverá possuir a anotação @Coluna e o Nome que representa sua coluna.
*
* Exemplo:
* @Coluna('ID')
* public void setId(Integer id){
* this.id = id;
* } | static PreparedStatement function(final PreparedStatement stm, final Object...params) throws Exception{ for (int i = 0; i < params.length; i++) { if (params[i] instanceof String) { stm.setString(i + 1, Utilidades.convertTo(params[i])); } else if (params[i] instanceof Integer) { stm.setInt(i + 1, Utilidades.convertTo(params[i])); } else if (params[i] instanceof Boolean) { stm.setBoolean(i + 1, Utilidades.convertTo(params[i])); } else if (params[i] instanceof Date) { stm.setDate(i + 1, Utilidades.convertTo(params[i])); } else if (params[i] instanceof Double) { stm.setDouble(i + 1, Utilidades.convertTo(params[i])); } else if (params[i] instanceof Float) { stm.setFloat(i + 1, Utilidades.convertTo(params[i])); } else { stm.setObject(i + 1, params[i]); } } return stm; } /** * Converte um dado recebido da consulta no banco de dados e o separa suas * colunas em atributos de um objeto que representa a tabela do banco de dados, * para que os dados da tabela seja atribuidos a seus atributos, cada método Set * deverá possuir a anotação @Coluna e o Nome que representa sua coluna. * * Exemplo: * @Coluna('ID') * public void setId(Integer id){ * this.id = id; * } | /**
* Preenche o PreparedStatemt por tipo
*
* @param stm
* @param params
* @return
* @throws Exception
*/ | Preenche o PreparedStatemt por tipo | preencherCampos | {
"repo_name": "Silva01/daniel-jdbc",
"path": "src/main/java/br/com/daniel/jdbc/util/Utilidades.java",
"license": "mit",
"size": 3020
} | [
"br.com.daniel.jdbc.mapeamento.Coluna",
"java.sql.PreparedStatement",
"java.util.Date"
] | import br.com.daniel.jdbc.mapeamento.Coluna; import java.sql.PreparedStatement; import java.util.Date; | import br.com.daniel.jdbc.mapeamento.*; import java.sql.*; import java.util.*; | [
"br.com.daniel",
"java.sql",
"java.util"
] | br.com.daniel; java.sql; java.util; | 101,757 |
public static PDFAction getAction(PDFObject obj, PDFObject root)
throws IOException
{
// figure out the action type
PDFObject typeObj = obj.getDictRef("S");
if (typeObj == null) {
throw new PDFParseException("No action type in object: " + obj);
}
// create the action based on the type
PDFAction action = null;
String type = typeObj.getStringValue();
switch (type) {
case "GoTo":
action = new GoToAction(obj, root);
break;
case "GoToE":
action = new GoToEAction(obj, root);
break;
case "GoToR":
action = new GoToRAction(obj, root);
break;
case "URI":
action = new UriAction(obj, root);
break;
case "Launch":
action = new LaunchAction(obj, root);
break;
default:
throw new PDFParseException("Unknown Action type: " + type);
}
// figure out if there is a next action
PDFObject nextObj = obj.getDictRef("Next");
if (nextObj != null) {
action.setNext(nextObj);
}
// return the action
return action;
} | static PDFAction function(PDFObject obj, PDFObject root) throws IOException { PDFObject typeObj = obj.getDictRef("S"); if (typeObj == null) { throw new PDFParseException(STR + obj); } PDFAction action = null; String type = typeObj.getStringValue(); switch (type) { case "GoTo": action = new GoToAction(obj, root); break; case "GoToE": action = new GoToEAction(obj, root); break; case "GoToR": action = new GoToRAction(obj, root); break; case "URI": action = new UriAction(obj, root); break; case STR: action = new LaunchAction(obj, root); break; default: throw new PDFParseException(STR + type); } PDFObject nextObj = obj.getDictRef("Next"); if (nextObj != null) { action.setNext(nextObj); } return action; } | /**
* Get an action of the appropriate type from a PDFObject
*
* @param obj the PDF object containing the action to parse
* @param root the root of the PDF object tree
* @return a {@link org.loboevolution.pdfview.action.PDFAction} object.
* @throws java.io.IOException if any.
*/ | Get an action of the appropriate type from a PDFObject | getAction | {
"repo_name": "oswetto/LoboEvolution",
"path": "LoboPDF/src/main/java/org/loboevolution/pdfview/action/PDFAction.java",
"license": "gpl-3.0",
"size": 3812
} | [
"java.io.IOException",
"org.loboevolution.pdfview.PDFObject",
"org.loboevolution.pdfview.PDFParseException"
] | import java.io.IOException; import org.loboevolution.pdfview.PDFObject; import org.loboevolution.pdfview.PDFParseException; | import java.io.*; import org.loboevolution.pdfview.*; | [
"java.io",
"org.loboevolution.pdfview"
] | java.io; org.loboevolution.pdfview; | 370,025 |
void setTabContentManager(TabContentManager cache); | void setTabContentManager(TabContentManager cache); | /**
* Sets the {@link TabContentManager} to use.
* @param cache The {@link TabContentManager} to use.
*/ | Sets the <code>TabContentManager</code> to use | setTabContentManager | {
"repo_name": "ric2b/Vivaldi-browser",
"path": "chromium/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistencePolicy.java",
"license": "bsd-3-clause",
"size": 4453
} | [
"org.chromium.chrome.browser.compositor.layouts.content.TabContentManager"
] | import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; | import org.chromium.chrome.browser.compositor.layouts.content.*; | [
"org.chromium.chrome"
] | org.chromium.chrome; | 1,173,635 |
public @Nullable Uri getImageUri() {
// getPrimaryClip() has been observed to throw unexpected exceptions for some devices (see
// crbug.com/654802).
try {
ClipData clipData = mClipboardManager.getPrimaryClip();
if (clipData == null || clipData.getItemCount() == 0
|| !hasImageMimeType(clipData.getDescription())) {
return null;
}
return clipData.getItemAt(0).getUri();
} catch (Exception e) {
return null;
}
} | @Nullable Uri function() { try { ClipData clipData = mClipboardManager.getPrimaryClip(); if (clipData == null clipData.getItemCount() == 0 !hasImageMimeType(clipData.getDescription())) { return null; } return clipData.getItemAt(0).getUri(); } catch (Exception e) { return null; } } | /**
* Gets the Uri of top item on the primary clip on the Android clipboard if the mime type is
* image.
*
* @return an Uri if mime type is image type, or null if there is no Uri or no entries on the
* primary clip.
*/ | Gets the Uri of top item on the primary clip on the Android clipboard if the mime type is image | getImageUri | {
"repo_name": "nwjs/chromium.src",
"path": "ui/android/java/src/org/chromium/ui/base/Clipboard.java",
"license": "bsd-3-clause",
"size": 31329
} | [
"android.content.ClipData",
"android.net.Uri",
"androidx.annotation.Nullable"
] | import android.content.ClipData; import android.net.Uri; import androidx.annotation.Nullable; | import android.content.*; import android.net.*; import androidx.annotation.*; | [
"android.content",
"android.net",
"androidx.annotation"
] | android.content; android.net; androidx.annotation; | 455,100 |
public final CompiledXSpec compileXSpecForXslt(final File sourceFile) {
return compileXSpec(sourceFile, xmlStuff.getXspec4xsltCompiler());
} | final CompiledXSpec function(final File sourceFile) { return compileXSpec(sourceFile, xmlStuff.getXspec4xsltCompiler()); } | /**
* Compiles a XSpec file that test a XSLT
* @param sourceFile The XSpec file to compile
* @return The compiled XSpec informations
*/ | Compiles a XSpec file that test a XSLT | compileXSpecForXslt | {
"repo_name": "xspec/xspec-maven-plugin-1",
"path": "src/main/java/io/xspec/maven/xspecMavenPlugin/utils/XSpecCompiler.java",
"license": "bsd-3-clause",
"size": 19331
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 650,223 |
public Component copy() throws ParseException, IOException, URISyntaxException {
final VToDo copy = (VToDo) super.copy();
copy.alarms = new ComponentList(alarms);
return copy;
} | Component function() throws ParseException, IOException, URISyntaxException { final VToDo copy = (VToDo) super.copy(); copy.alarms = new ComponentList(alarms); return copy; } | /**
* Overrides default copy method to add support for copying alarm sub-components.
* @return a copy of the instance
* @throws ParseException where an error occurs parsing data
* @throws IOException where an error occurs reading data
* @throws URISyntaxException where an invalid URI is encountered
* @see net.fortuna.ical4j.model.Component#copy()
*/ | Overrides default copy method to add support for copying alarm sub-components | copy | {
"repo_name": "benfortuna/ical4j",
"path": "src/main/java/net/fortuna/ical4j/model/component/VToDo.java",
"license": "bsd-3-clause",
"size": 57437
} | [
"java.io.IOException",
"java.net.URISyntaxException",
"java.text.ParseException",
"net.fortuna.ical4j.model.Component",
"net.fortuna.ical4j.model.ComponentList"
] | import java.io.IOException; import java.net.URISyntaxException; import java.text.ParseException; import net.fortuna.ical4j.model.Component; import net.fortuna.ical4j.model.ComponentList; | import java.io.*; import java.net.*; import java.text.*; import net.fortuna.ical4j.model.*; | [
"java.io",
"java.net",
"java.text",
"net.fortuna.ical4j"
] | java.io; java.net; java.text; net.fortuna.ical4j; | 389,236 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<NatGatewayInner>> listByResourceGroupSinglePageAsync(String resourceGroupName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2021-05-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.listByResourceGroup(
this.client.getEndpoint(),
resourceGroupName,
apiVersion,
this.client.getSubscriptionId(),
accept,
context))
.<PagedResponse<NatGatewayInner>>map(
res ->
new PagedResponseBase<>(
res.getRequest(),
res.getStatusCode(),
res.getHeaders(),
res.getValue().value(),
res.getValue().nextLink(),
null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
} | @ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<NatGatewayInner>> function(String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String apiVersion = STR; final String accept = STR; return FluxUtil .withContext( context -> service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), accept, context)) .<PagedResponse<NatGatewayInner>>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } | /**
* Gets all nat gateways in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return all nat gateways in a resource group along with {@link PagedResponse} on successful completion of {@link
* Mono}.
*/ | Gets all nat gateways in a resource group | listByResourceGroupSinglePageAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NatGatewaysClientImpl.java",
"license": "mit",
"size": 72291
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedResponse",
"com.azure.core.http.rest.PagedResponseBase",
"com.azure.core.util.FluxUtil",
"com.azure.resourcemanager.network.fluent.models.NatGatewayInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.network.fluent.models.NatGatewayInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.network.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,190,760 |
public synchronized void registerConnection(Socket socket)
{
openConnections.add(socket);
} | synchronized void function(Socket socket) { openConnections.add(socket); } | /**
* Registers that a new connection has been set up.
*
* @param socket
* the {@link Socket} for the connection.
*/ | Registers that a new connection has been set up | registerConnection | {
"repo_name": "meledin/trap",
"path": "trap-transports/http/http-impl-nanohttpd-nio/src/main/java/com/ericsson/research/trap/nhttpd/NanoHTTPD.java",
"license": "bsd-3-clause",
"size": 14367
} | [
"com.ericsson.research.trap.nio.Socket"
] | import com.ericsson.research.trap.nio.Socket; | import com.ericsson.research.trap.nio.*; | [
"com.ericsson.research"
] | com.ericsson.research; | 938,804 |
public boolean getBooleanEval(String javascript, Object... args) {
Object status;
status = getEval(javascript, args);
// Special case for weird behavior with ios-driver returning 'ok' instead of true or false. Appears to be an
// ios-driver bug. Return false so we can retry executing the js instead of erroring out.
if (status instanceof String && status.equals("ok")) {
return false;
}
if (status == null) {
Assert.fail("Got a null status for " + javascript + "(" + args + ")");
}
if (!(status instanceof Boolean)) {
Assert.fail("Got unexpected return value: for " + javascript + "(" + args + ") :\n" + status.toString());
}
return ((Boolean) status).booleanValue();
} | boolean function(String javascript, Object... args) { Object status; status = getEval(javascript, args); if (status instanceof String && status.equals("ok")) { return false; } if (status == null) { Assert.fail(STR + javascript + "(" + args + ")"); } if (!(status instanceof Boolean)) { Assert.fail(STR + javascript + "(" + args + STR + status.toString()); } return ((Boolean) status).booleanValue(); } | /**
* Execute the given javascript and args in the current window. Fail if the result is not a boolean. Otherwise,
* return the result.
*/ | Execute the given javascript and args in the current window. Fail if the result is not a boolean. Otherwise, return the result | getBooleanEval | {
"repo_name": "lhong375/aura",
"path": "aura/src/test/java/org/auraframework/util/AuraUITestingUtil.java",
"license": "apache-2.0",
"size": 29356
} | [
"junit.framework.Assert"
] | import junit.framework.Assert; | import junit.framework.*; | [
"junit.framework"
] | junit.framework; | 2,064,162 |
@Override
Optional<Number> execute(); | Optional<Number> execute(); | /**
* Execute the query.
*
* @return the min value if the given resource types have instances, otherwise an empty Optional instance
*/ | Execute the query | execute | {
"repo_name": "aelred/grakn",
"path": "grakn-core/src/main/java/ai/grakn/graql/analytics/MinQuery.java",
"license": "gpl-3.0",
"size": 2283
} | [
"java.util.Optional"
] | import java.util.Optional; | import java.util.*; | [
"java.util"
] | java.util; | 2,888,608 |
void setCallbackInfo(Map<String, String> callbackInfo); | void setCallbackInfo(Map<String, String> callbackInfo); | /**
* Sets a Map of callback info.
*
* @param callbackInfo a {@link Map} that contains the callback info
*/ | Sets a Map of callback info | setCallbackInfo | {
"repo_name": "BVier/Taskana",
"path": "lib/taskana-core/src/main/java/pro/taskana/Task.java",
"license": "apache-2.0",
"size": 9727
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,238,969 |
@VisibleForTesting
static ImmutableSet<Class<?>> flattenHierarchy(Class<?> concreteClass) {
try {
return flattenHierarchyCache.getUnchecked(concreteClass);
} catch (UncheckedExecutionException e) {
throw Throwables.propagate(e.getCause());
}
}
private static final class MethodIdentifier {
private final String name;
private final List<Class<?>> parameterTypes;
MethodIdentifier(Method method) {
this.name = method.getName();
this.parameterTypes = Arrays.asList(method.getParameterTypes());
} | static ImmutableSet<Class<?>> flattenHierarchy(Class<?> concreteClass) { try { return flattenHierarchyCache.getUnchecked(concreteClass); } catch (UncheckedExecutionException e) { throw Throwables.propagate(e.getCause()); } } private static final class MethodIdentifier { private final String name; private final List<Class<?>> parameterTypes; MethodIdentifier(Method method) { this.name = method.getName(); this.parameterTypes = Arrays.asList(method.getParameterTypes()); } | /**
* Flattens a class's type hierarchy into a set of {@code Class} objects including all
* superclasses (transitively) and all interfaces implemented by these superclasses.
*/ | Flattens a class's type hierarchy into a set of Class objects including all superclasses (transitively) and all interfaces implemented by these superclasses | flattenHierarchy | {
"repo_name": "g0alshhhit/guavaHelper",
"path": "guava/src/com/google/common/eventbus/SubscriberRegistry.java",
"license": "apache-2.0",
"size": 9985
} | [
"com.google.common.base.Throwables",
"com.google.common.collect.ImmutableSet",
"com.google.common.util.concurrent.UncheckedExecutionException",
"java.lang.reflect.Method",
"java.util.Arrays",
"java.util.List"
] | import com.google.common.base.Throwables; import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.UncheckedExecutionException; import java.lang.reflect.Method; import java.util.Arrays; import java.util.List; | import com.google.common.base.*; import com.google.common.collect.*; import com.google.common.util.concurrent.*; import java.lang.reflect.*; import java.util.*; | [
"com.google.common",
"java.lang",
"java.util"
] | com.google.common; java.lang; java.util; | 680,630 |
// look up the component factory
final IComponentFactory factory = lookup(IComponentFactory.class);
// create the session
final MavenSession session = createSimpleSession("core/pom-with-buildconfig-childoverwrite");
// lookup the sample
final Xpp3Dom dom = new Xpp3Dom("configuration");
final Xpp3Dom bar = new Xpp3Dom("bar");
bar.setValue("MyBarValue");
dom.addChild(bar);
final ISomeComponentWithChildren component = factory.lookup(ISomeComponentWithChildren.class, dom, session);
assertNotNull(component);
// test defaults
assertEquals(
new File(session.getCurrentProject().getBasedir().getAbsolutePath(), "SomeFooBar").getAbsolutePath(),
component.getFooBar().getAbsolutePath());
assertEquals("OtherFoo", component.getFoo());
assertEquals("MyBarValue", component.getBar());
assertNotNull(component.getDeep());
assertEquals("OtherFoo", component.getDeep().getFoo());
assertEquals("default-bar", component.getDeep().getBar());
assertEquals(new File(session.getCurrentProject().getBasedir(), "SomeFooBar"), component.getDeep().getFooBar());
} | final IComponentFactory factory = lookup(IComponentFactory.class); final MavenSession session = createSimpleSession(STR); final Xpp3Dom dom = new Xpp3Dom(STR); final Xpp3Dom bar = new Xpp3Dom("bar"); bar.setValue(STR); dom.addChild(bar); final ISomeComponentWithChildren component = factory.lookup(ISomeComponentWithChildren.class, dom, session); assertNotNull(component); assertEquals( new File(session.getCurrentProject().getBasedir().getAbsolutePath(), STR).getAbsolutePath(), component.getFooBar().getAbsolutePath()); assertEquals(STR, component.getFoo()); assertEquals(STR, component.getBar()); assertNotNull(component.getDeep()); assertEquals(STR, component.getDeep().getFoo()); assertEquals(STR, component.getDeep().getBar()); assertEquals(new File(session.getCurrentProject().getBasedir(), STR), component.getDeep().getFooBar()); } | /**
* Tests if the component lookup reads the project build config from parent poms
* and overwrites a single value.
*
* @throws Exception thrown on errors
*/ | Tests if the component lookup reads the project build config from parent poms and overwrites a single value | testComponentWithOverwrite | {
"repo_name": "Vaysman/maven-php-plugin",
"path": "maven-plugins/maven-php-core/src/test/java/org/phpmaven/core/test/LookupRequirementsWithConfigsTest.java",
"license": "apache-2.0",
"size": 2672
} | [
"java.io.File",
"org.apache.maven.execution.MavenSession",
"org.codehaus.plexus.util.xml.Xpp3Dom",
"org.phpmaven.core.IComponentFactory",
"org.phpmaven.core.test.comp.ISomeComponentWithChildren"
] | import java.io.File; import org.apache.maven.execution.MavenSession; import org.codehaus.plexus.util.xml.Xpp3Dom; import org.phpmaven.core.IComponentFactory; import org.phpmaven.core.test.comp.ISomeComponentWithChildren; | import java.io.*; import org.apache.maven.execution.*; import org.codehaus.plexus.util.xml.*; import org.phpmaven.core.*; import org.phpmaven.core.test.comp.*; | [
"java.io",
"org.apache.maven",
"org.codehaus.plexus",
"org.phpmaven.core"
] | java.io; org.apache.maven; org.codehaus.plexus; org.phpmaven.core; | 855,878 |
List<File> getJarJarRuleFiles(); | List<File> getJarJarRuleFiles(); | /**
* Returns the optional jarjar rule files, or empty if jarjar should be skipped.
* <p>
* <p>If more than one file is provided, the rule files will be merged in order with last one
* win in case of rule redefinition.
* <p>
* <p>Can only be used with Jack toolchain.
*
* @return the optional jarjar rule file.
*/ | Returns the optional jarjar rule files, or empty if jarjar should be skipped. If more than one file is provided, the rule files will be merged in order with last one win in case of rule redefinition. Can only be used with Jack toolchain | getJarJarRuleFiles | {
"repo_name": "tranleduy2000/javaide",
"path": "aosp/gradle/src/main/java/com/android/build/gradle/managed/BuildType.java",
"license": "gpl-3.0",
"size": 5210
} | [
"java.io.File",
"java.util.List"
] | import java.io.File; import java.util.List; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 1,409,398 |
private StringBuffer createReusingIndent(StringBuffer buffer, int additional) {
int refLength= computeVisualLength(buffer);
int addLength= fPrefs.prefIndentationSize * additional; // may be < 0
int totalLength= Math.max(0, refLength + addLength);
// copy the reference indentation for the indent up to the last tab
// stop within the maxCopy area
int minLength= Math.min(totalLength, refLength);
int tabSize= fPrefs.prefTabSize;
int maxCopyLength= tabSize > 0 ? minLength - minLength % tabSize : minLength; // maximum indent to copy
stripExceedingChars(buffer, maxCopyLength);
// add additional indent
int missing= totalLength - maxCopyLength;
final int tabs, spaces;
if (JavaCore.SPACE.equals(fPrefs.prefTabChar)) {
tabs= 0;
spaces= missing;
} else if (JavaCore.TAB.equals(fPrefs.prefTabChar)) {
tabs= tabSize > 0 ? missing / tabSize : 0;
spaces= tabSize > 0 ? missing % tabSize : missing;
} else if (DefaultCodeFormatterConstants.MIXED.equals(fPrefs.prefTabChar)) {
tabs= tabSize > 0 ? missing / tabSize : 0;
spaces= tabSize > 0 ? missing % tabSize : missing;
} else {
Assert.isTrue(false);
return null;
}
for(int i= 0; i < tabs; i++)
buffer.append('\t');
for(int i= 0; i < spaces; i++)
buffer.append(' ');
return buffer;
}
/**
* Returns the reference position regarding to indentation for <code>offset</code>,
* or <code>NOT_FOUND</code>. This method calls
* {@link #findReferencePosition(int, int) findReferencePosition(offset, nextChar)} where
* <code>nextChar</code> is the next character after <code>offset</code>.
*
* @param offset the offset for which the reference is computed
* @return the reference statement relative to which <code>offset</code>
* should be indented, or {@link JavaHeuristicScanner#NOT_FOUND} | StringBuffer function(StringBuffer buffer, int additional) { int refLength= computeVisualLength(buffer); int addLength= fPrefs.prefIndentationSize * additional; int totalLength= Math.max(0, refLength + addLength); int minLength= Math.min(totalLength, refLength); int tabSize= fPrefs.prefTabSize; int maxCopyLength= tabSize > 0 ? minLength - minLength % tabSize : minLength; stripExceedingChars(buffer, maxCopyLength); int missing= totalLength - maxCopyLength; final int tabs, spaces; if (JavaCore.SPACE.equals(fPrefs.prefTabChar)) { tabs= 0; spaces= missing; } else if (JavaCore.TAB.equals(fPrefs.prefTabChar)) { tabs= tabSize > 0 ? missing / tabSize : 0; spaces= tabSize > 0 ? missing % tabSize : missing; } else if (DefaultCodeFormatterConstants.MIXED.equals(fPrefs.prefTabChar)) { tabs= tabSize > 0 ? missing / tabSize : 0; spaces= tabSize > 0 ? missing % tabSize : missing; } else { Assert.isTrue(false); return null; } for(int i= 0; i < tabs; i++) buffer.append('\t'); for(int i= 0; i < spaces; i++) buffer.append(' '); return buffer; } /** * Returns the reference position regarding to indentation for <code>offset</code>, * or <code>NOT_FOUND</code>. This method calls * {@link #findReferencePosition(int, int) findReferencePosition(offset, nextChar)} where * <code>nextChar</code> is the next character after <code>offset</code>. * * @param offset the offset for which the reference is computed * @return the reference statement relative to which <code>offset</code> * should be indented, or {@link JavaHeuristicScanner#NOT_FOUND} | /**
* Creates a string with a visual length of the given
* <code>indentationSize</code>.
*
* @param buffer the original indent to reuse if possible
* @param additional the additional indentation units to add or subtract to
* reference
* @return the modified <code>buffer</code> reflecting the indentation
* adapted to <code>additional</code>
*/ | Creates a string with a visual length of the given <code>indentationSize</code> | createReusingIndent | {
"repo_name": "kumattau/JDTPatch",
"path": "org.eclipse.jdt.ui/src/org/eclipse/jdt/internal/ui/text/JavaIndenter.java",
"license": "epl-1.0",
"size": 71250
} | [
"org.eclipse.core.runtime.Assert",
"org.eclipse.jdt.core.JavaCore",
"org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants"
] | import org.eclipse.core.runtime.Assert; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants; | import org.eclipse.core.runtime.*; import org.eclipse.jdt.core.*; import org.eclipse.jdt.core.formatter.*; | [
"org.eclipse.core",
"org.eclipse.jdt"
] | org.eclipse.core; org.eclipse.jdt; | 2,037,154 |
MetaModel mm = getMetaModel();
// These are the WidgetType's of the CDM Generic Widget
WidgetType cwt = mm.findWidgetType(WidgetLibraryConstants.CDM_COMP, WidgetTypeConstants.CDM_GENERIC);
// Add all the PropertyTypes which exist for this Widget
Set<PropertyType> allowedTypes = new HashSet<PropertyType>();
allowedTypes.addAll(cwt.getAllPropertyTypes().values());
// Add intrinsic Attribute WidgetType's PropertyType's
allowedTypes.add(mm.findPropertyType(WidgetLibraryConstants.XGUI, PropertyTypeConstants.FIELD_TYPE));
allowedTypes.add(mm.findPropertyType(WidgetLibraryConstants.XGUI, PropertyTypeConstants.SHOW_LABEL));
List<Property> result = new ArrayList<Property>();
for (Property p : widget.getProperties()) {
if (allowedTypes.contains(p.getType())) {
result.add(p);
}
}
return result;
}
| MetaModel mm = getMetaModel(); WidgetType cwt = mm.findWidgetType(WidgetLibraryConstants.CDM_COMP, WidgetTypeConstants.CDM_GENERIC); Set<PropertyType> allowedTypes = new HashSet<PropertyType>(); allowedTypes.addAll(cwt.getAllPropertyTypes().values()); allowedTypes.add(mm.findPropertyType(WidgetLibraryConstants.XGUI, PropertyTypeConstants.FIELD_TYPE)); allowedTypes.add(mm.findPropertyType(WidgetLibraryConstants.XGUI, PropertyTypeConstants.SHOW_LABEL)); List<Property> result = new ArrayList<Property>(); for (Property p : widget.getProperties()) { if (allowedTypes.contains(p.getType())) { result.add(p); } } return result; } | /**
* Filters the widget returning a sub-group of the properties.
*
* @param widget The Widget to filter
* @return List The List of properties
*/ | Filters the widget returning a sub-group of the properties | filter | {
"repo_name": "debabratahazra/DS",
"path": "designstudio/components/page/core/com.odcgroup.page.model/src/main/java/com/odcgroup/page/model/filter/cdm/CdmGenericPropertyFilter.java",
"license": "epl-1.0",
"size": 2065
} | [
"com.odcgroup.page.metamodel.MetaModel",
"com.odcgroup.page.metamodel.PropertyType",
"com.odcgroup.page.metamodel.PropertyTypeConstants",
"com.odcgroup.page.metamodel.WidgetLibraryConstants",
"com.odcgroup.page.metamodel.WidgetType",
"com.odcgroup.page.metamodel.WidgetTypeConstants",
"com.odcgroup.page.model.Property",
"java.util.ArrayList",
"java.util.HashSet",
"java.util.List",
"java.util.Set"
] | import com.odcgroup.page.metamodel.MetaModel; import com.odcgroup.page.metamodel.PropertyType; import com.odcgroup.page.metamodel.PropertyTypeConstants; import com.odcgroup.page.metamodel.WidgetLibraryConstants; import com.odcgroup.page.metamodel.WidgetType; import com.odcgroup.page.metamodel.WidgetTypeConstants; import com.odcgroup.page.model.Property; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; | import com.odcgroup.page.metamodel.*; import com.odcgroup.page.model.*; import java.util.*; | [
"com.odcgroup.page",
"java.util"
] | com.odcgroup.page; java.util; | 1,115,035 |
@Nullable
public String getTableName(@Nullable String tableId) {
Table table = getTable(tableId);
return table == null ? null : table.getName();
} | String function(@Nullable String tableId) { Table table = getTable(tableId); return table == null ? null : table.getName(); } | /**
* Gracefully gets a {@link Table}'s name from this {@link TableMap} by table id.
*
* @param tableId id of the table to get the name for. If null or empty, null is returned.
*
* @return the name assigned to table {@code id}, nullable
*
* @see #getTable(String)
*/ | Gracefully gets a <code>Table</code>'s name from this <code>TableMap</code> by table id | getTableName | {
"repo_name": "SupaHam/SupaCommons",
"path": "commons-jdbc/src/main/java/com/supaham/commons/jdbc/sql/TableMap.java",
"license": "gpl-3.0",
"size": 6171
} | [
"javax.annotation.Nullable"
] | import javax.annotation.Nullable; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 2,103,595 |
protected void reDraw(int FlatID,Date firstDate,Date lastDate){
calendars.get(dbParser.getIndex(FlatID)).reDraw(firstDate,lastDate);
}
| void function(int FlatID,Date firstDate,Date lastDate){ calendars.get(dbParser.getIndex(FlatID)).reDraw(firstDate,lastDate); } | /**
* Redraws cells from firstDate to lastDate
* @param FlatID
* @param firstDate
* @param lastDate
*/ | Redraws cells from firstDate to lastDate | reDraw | {
"repo_name": "syrel/hut.by-Organizer",
"path": "app/OrganizerHut/app/src/main/java/by/hut/flat/calendar/flat/FlatCalendarPager.java",
"license": "mit",
"size": 11938
} | [
"by.hut.flat.calendar.utils.Date"
] | import by.hut.flat.calendar.utils.Date; | import by.hut.flat.calendar.utils.*; | [
"by.hut.flat"
] | by.hut.flat; | 2,119,989 |
public interface NodeImporterStrategy
{
public NodeRef importNode(ImportNode node);
}
private class NodeImporter
implements Importer
{
private NodeRef rootRef;
private QName rootAssocType;
private ImporterBinding binding;
private ImporterProgress progress;
private ImportPackageHandler streamHandler;
private NodeImporterStrategy importStrategy;
private UpdateExistingNodeImporterStrategy updateStrategy;
private QName[] excludedClasses;
// Import tracking
private List<ImportedNodeRef> nodeRefs = new ArrayList<ImportedNodeRef>();
private NodeImporter(NodeRef rootRef, QName rootAssocType, ImporterBinding binding, ImportPackageHandler streamHandler, ImporterProgress progress)
{
this.rootRef = rootRef;
this.rootAssocType = rootAssocType;
this.binding = binding;
this.progress = progress;
this.streamHandler = streamHandler;
this.importStrategy = createNodeImporterStrategy(binding == null ? null : binding.getUUIDBinding());
this.updateStrategy = new UpdateExistingNodeImporterStrategy();
// initialise list of content models to exclude from import
if (binding == null || binding.getExcludedClasses() == null)
{
this.excludedClasses = new QName[] { ContentModel.ASPECT_REFERENCEABLE };
}
else
{
this.excludedClasses = binding.getExcludedClasses();
}
}
| interface NodeImporterStrategy { public NodeRef function(ImportNode node); } private class NodeImporter implements Importer { private NodeRef rootRef; private QName rootAssocType; private ImporterBinding binding; private ImporterProgress progress; private ImportPackageHandler streamHandler; private NodeImporterStrategy importStrategy; private UpdateExistingNodeImporterStrategy updateStrategy; private QName[] excludedClasses; private List<ImportedNodeRef> nodeRefs = new ArrayList<ImportedNodeRef>(); private NodeImporter(NodeRef rootRef, QName rootAssocType, ImporterBinding binding, ImportPackageHandler streamHandler, ImporterProgress progress) { this.rootRef = rootRef; this.rootAssocType = rootAssocType; this.binding = binding; this.progress = progress; this.streamHandler = streamHandler; this.importStrategy = createNodeImporterStrategy(binding == null ? null : binding.getUUIDBinding()); this.updateStrategy = new UpdateExistingNodeImporterStrategy(); if (binding == null binding.getExcludedClasses() == null) { this.excludedClasses = new QName[] { ContentModel.ASPECT_REFERENCEABLE }; } else { this.excludedClasses = binding.getExcludedClasses(); } } | /**
* Import a node
*
* @param node to import
*/ | Import a node | importNode | {
"repo_name": "loftuxab/community-edition-old",
"path": "projects/repository/source/java/org/alfresco/repo/importer/ImporterComponent.java",
"license": "lgpl-3.0",
"size": 71461
} | [
"java.util.ArrayList",
"java.util.List",
"org.alfresco.model.ContentModel",
"org.alfresco.service.cmr.repository.NodeRef",
"org.alfresco.service.cmr.view.ImportPackageHandler",
"org.alfresco.service.cmr.view.ImporterBinding",
"org.alfresco.service.cmr.view.ImporterProgress",
"org.alfresco.service.namespace.QName"
] | import java.util.ArrayList; import java.util.List; import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.view.ImportPackageHandler; import org.alfresco.service.cmr.view.ImporterBinding; import org.alfresco.service.cmr.view.ImporterProgress; import org.alfresco.service.namespace.QName; | import java.util.*; import org.alfresco.model.*; import org.alfresco.service.cmr.repository.*; import org.alfresco.service.cmr.view.*; import org.alfresco.service.namespace.*; | [
"java.util",
"org.alfresco.model",
"org.alfresco.service"
] | java.util; org.alfresco.model; org.alfresco.service; | 92,614 |
private boolean initializeCollectionFromCache(
Serializable id,
CollectionPersister persister,
PersistentCollection collection,
SessionImplementor source) {
if ( !source.getLoadQueryInfluencers().getEnabledFilters().isEmpty()
&& persister.isAffectedByEnabledFilters( source ) ) {
LOG.trace( "Disregarding cached version (if any) of collection due to enabled filters" );
return false;
}
final boolean useCache = persister.hasCache() && source.getCacheMode().isGetEnabled();
if ( !useCache ) {
return false;
}
final SessionFactoryImplementor factory = source.getFactory();
final CollectionRegionAccessStrategy cacheAccessStrategy = persister.getCacheAccessStrategy();
final Object ck = cacheAccessStrategy.generateCacheKey( id, persister, factory, source.getTenantIdentifier() );
final Object ce = CacheHelper.fromSharedCache( source, ck, persister.getCacheAccessStrategy() );
if ( factory.getStatistics().isStatisticsEnabled() ) {
if ( ce == null ) {
factory.getStatisticsImplementor()
.secondLevelCacheMiss( cacheAccessStrategy.getRegion().getName() );
}
else {
factory.getStatisticsImplementor()
.secondLevelCacheHit( cacheAccessStrategy.getRegion().getName() );
}
}
if ( ce == null ) {
return false;
}
CollectionCacheEntry cacheEntry = (CollectionCacheEntry) persister.getCacheEntryStructure().destructure(
ce,
factory
);
final PersistenceContext persistenceContext = source.getPersistenceContext();
cacheEntry.assemble( collection, persister, persistenceContext.getCollectionOwner( id, persister ) );
persistenceContext.getCollectionEntry( collection ).postInitialize( collection );
// addInitializedCollection(collection, persister, id);
return true;
} | boolean function( Serializable id, CollectionPersister persister, PersistentCollection collection, SessionImplementor source) { if ( !source.getLoadQueryInfluencers().getEnabledFilters().isEmpty() && persister.isAffectedByEnabledFilters( source ) ) { LOG.trace( STR ); return false; } final boolean useCache = persister.hasCache() && source.getCacheMode().isGetEnabled(); if ( !useCache ) { return false; } final SessionFactoryImplementor factory = source.getFactory(); final CollectionRegionAccessStrategy cacheAccessStrategy = persister.getCacheAccessStrategy(); final Object ck = cacheAccessStrategy.generateCacheKey( id, persister, factory, source.getTenantIdentifier() ); final Object ce = CacheHelper.fromSharedCache( source, ck, persister.getCacheAccessStrategy() ); if ( factory.getStatistics().isStatisticsEnabled() ) { if ( ce == null ) { factory.getStatisticsImplementor() .secondLevelCacheMiss( cacheAccessStrategy.getRegion().getName() ); } else { factory.getStatisticsImplementor() .secondLevelCacheHit( cacheAccessStrategy.getRegion().getName() ); } } if ( ce == null ) { return false; } CollectionCacheEntry cacheEntry = (CollectionCacheEntry) persister.getCacheEntryStructure().destructure( ce, factory ); final PersistenceContext persistenceContext = source.getPersistenceContext(); cacheEntry.assemble( collection, persister, persistenceContext.getCollectionOwner( id, persister ) ); persistenceContext.getCollectionEntry( collection ).postInitialize( collection ); return true; } | /**
* Try to initialize a collection from the cache
*
* @param id The id of the collection of initialize
* @param persister The collection persister
* @param collection The collection to initialize
* @param source The originating session
*
* @return true if we were able to initialize the collection from the cache;
* false otherwise.
*/ | Try to initialize a collection from the cache | initializeCollectionFromCache | {
"repo_name": "1fechner/FeatureExtractor",
"path": "sources/FeatureExtractor/lib/hibernate-release-5.1.0.Final/project/hibernate-core/src/main/java/org/hibernate/event/internal/DefaultInitializeCollectionEventListener.java",
"license": "lgpl-2.1",
"size": 5056
} | [
"java.io.Serializable",
"org.hibernate.cache.spi.access.CollectionRegionAccessStrategy",
"org.hibernate.cache.spi.entry.CollectionCacheEntry",
"org.hibernate.collection.spi.PersistentCollection",
"org.hibernate.engine.internal.CacheHelper",
"org.hibernate.engine.spi.PersistenceContext",
"org.hibernate.engine.spi.SessionFactoryImplementor",
"org.hibernate.engine.spi.SessionImplementor",
"org.hibernate.persister.collection.CollectionPersister"
] | import java.io.Serializable; import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; import org.hibernate.cache.spi.entry.CollectionCacheEntry; import org.hibernate.collection.spi.PersistentCollection; import org.hibernate.engine.internal.CacheHelper; import org.hibernate.engine.spi.PersistenceContext; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.persister.collection.CollectionPersister; | import java.io.*; import org.hibernate.cache.spi.access.*; import org.hibernate.cache.spi.entry.*; import org.hibernate.collection.spi.*; import org.hibernate.engine.internal.*; import org.hibernate.engine.spi.*; import org.hibernate.persister.collection.*; | [
"java.io",
"org.hibernate.cache",
"org.hibernate.collection",
"org.hibernate.engine",
"org.hibernate.persister"
] | java.io; org.hibernate.cache; org.hibernate.collection; org.hibernate.engine; org.hibernate.persister; | 1,242,837 |
//-----------------------------------------------------------------------
public ZonedDateTime getSettlementDate() {
return _settlementDate;
} | ZonedDateTime function() { return _settlementDate; } | /**
* Gets the settlement date.
* @return the value of the property
*/ | Gets the settlement date | getSettlementDate | {
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-FinancialTypes/src/main/java/com/opengamma/financial/security/option/SwaptionSecurity.java",
"license": "apache-2.0",
"size": 25234
} | [
"org.threeten.bp.ZonedDateTime"
] | import org.threeten.bp.ZonedDateTime; | import org.threeten.bp.*; | [
"org.threeten.bp"
] | org.threeten.bp; | 1,354,963 |
super.loadConfiguration(config);
if ((this.ROAD_WIDTH & 1) == 0) {
this.PATH_WIDTH_LOWER = (short) (Math.floor(this.ROAD_WIDTH / 2) - 1);
} else {
this.PATH_WIDTH_LOWER = (short) (Math.floor(this.ROAD_WIDTH / 2));
}
this.PATH_WIDTH_UPPER = (short) (this.PATH_WIDTH_LOWER + this.PLOT_WIDTH + 1);
try {
setupSchematics();
} catch (final Exception e) {
PS.debug("&c - road schematics are disabled for this world.");
}
} | super.loadConfiguration(config); if ((this.ROAD_WIDTH & 1) == 0) { this.PATH_WIDTH_LOWER = (short) (Math.floor(this.ROAD_WIDTH / 2) - 1); } else { this.PATH_WIDTH_LOWER = (short) (Math.floor(this.ROAD_WIDTH / 2)); } this.PATH_WIDTH_UPPER = (short) (this.PATH_WIDTH_LOWER + this.PLOT_WIDTH + 1); try { setupSchematics(); } catch (final Exception e) { PS.debug(STR); } } | /**
* This method is called when a world loads. Make sure you set all your constants here. You are provided with the
* configuration section for that specific world.
*/ | This method is called when a world loads. Make sure you set all your constants here. You are provided with the configuration section for that specific world | loadConfiguration | {
"repo_name": "PiLogic/PlotSquared",
"path": "src/main/java/com/intellectualcrafters/plot/generator/HybridPlotWorld.java",
"license": "gpl-3.0",
"size": 12858
} | [
"com.intellectualcrafters.plot.PS"
] | import com.intellectualcrafters.plot.PS; | import com.intellectualcrafters.plot.*; | [
"com.intellectualcrafters.plot"
] | com.intellectualcrafters.plot; | 2,671,947 |
public SyncStatus attachDatabase(JournalContext journalContext, String udbType,
String udbConnectionUri, String udbDbName, String dbName, Map<String, String> map,
boolean ignoreSyncErrors)
throws IOException {
try (LockResource l = getDbLock(dbName)) {
if (mDBs.containsKey(dbName)) {
throw new IOException(String
.format("Unable to attach database. Database name %s (type: %s) already exists.",
dbName, udbType));
}
applyAndJournal(journalContext, Journal.JournalEntry.newBuilder().setAttachDb(
alluxio.proto.journal.Table.AttachDbEntry.newBuilder()
.setUdbType(udbType)
.setUdbConnectionUri(udbConnectionUri)
.setUdbDbName(udbDbName)
.setDbName(dbName)
.putAllConfig(map).build()).build());
boolean syncError = false;
try {
SyncStatus status = mDBs.get(dbName).sync(journalContext);
syncError = status.getTablesErrorsCount() > 0;
return status;
} catch (Exception e) {
// Failed to connect to and sync the udb.
syncError = true;
// log the error and stack
LOG.error(String.format("Sync (during attach) failed for db '%s'.", dbName), e);
throw new IOException(String
.format("Failed to connect underDb for Alluxio db '%s': %s", dbName,
e.getMessage()), e);
} finally {
if (syncError && !ignoreSyncErrors) {
applyAndJournal(journalContext, Journal.JournalEntry.newBuilder().setDetachDb(
alluxio.proto.journal.Table.DetachDbEntry.newBuilder().setDbName(dbName).build())
.build());
}
}
}
} | SyncStatus function(JournalContext journalContext, String udbType, String udbConnectionUri, String udbDbName, String dbName, Map<String, String> map, boolean ignoreSyncErrors) throws IOException { try (LockResource l = getDbLock(dbName)) { if (mDBs.containsKey(dbName)) { throw new IOException(String .format(STR, dbName, udbType)); } applyAndJournal(journalContext, Journal.JournalEntry.newBuilder().setAttachDb( alluxio.proto.journal.Table.AttachDbEntry.newBuilder() .setUdbType(udbType) .setUdbConnectionUri(udbConnectionUri) .setUdbDbName(udbDbName) .setDbName(dbName) .putAllConfig(map).build()).build()); boolean syncError = false; try { SyncStatus status = mDBs.get(dbName).sync(journalContext); syncError = status.getTablesErrorsCount() > 0; return status; } catch (Exception e) { syncError = true; LOG.error(String.format(STR, dbName), e); throw new IOException(String .format(STR, dbName, e.getMessage()), e); } finally { if (syncError && !ignoreSyncErrors) { applyAndJournal(journalContext, Journal.JournalEntry.newBuilder().setDetachDb( alluxio.proto.journal.Table.DetachDbEntry.newBuilder().setDbName(dbName).build()) .build()); } } } } | /**
* Attaches an udb database to Alluxio catalog.
*
* @param journalContext journal context
* @param udbType the database type
* @param udbConnectionUri the udb connection uri
* @param udbDbName the database name in the udb
* @param dbName the database name in Alluxio
* @param map the configuration
* @param ignoreSyncErrors if true, will ignore syncing errors during the attach
* @return the sync status for the attach
*/ | Attaches an udb database to Alluxio catalog | attachDatabase | {
"repo_name": "wwjiang007/alluxio",
"path": "table/server/master/src/main/java/alluxio/master/table/AlluxioCatalog.java",
"license": "apache-2.0",
"size": 17558
} | [
"java.io.IOException",
"java.util.Map"
] | import java.io.IOException; import java.util.Map; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 669,856 |
private void assertProjects(Collection<Project> usedProjects) {
Map<String, List<Project>> projectMap = new HashMap<String, List<Project>>();
for (Project project : usedProjects) {
List<Project> projects = projectMap.get(project.getName());
if (null == projects) {
projects = new ArrayList<Project>();
projectMap.put(project.getName(), projects);
}
projects.add(project);
}
for (Map.Entry<String, List<Project>> entry : projectMap.entrySet()) {
int nProjects = entry.getValue().size();
if (nProjects > 1) {
Assert.fail("Project \"" + entry.getKey() + "\" has " + nProjects
+ " different Project instances.");
}
}
} | void function(Collection<Project> usedProjects) { Map<String, List<Project>> projectMap = new HashMap<String, List<Project>>(); for (Project project : usedProjects) { List<Project> projects = projectMap.get(project.getName()); if (null == projects) { projects = new ArrayList<Project>(); projectMap.put(project.getName(), projects); } projects.add(project); } for (Map.Entry<String, List<Project>> entry : projectMap.entrySet()) { int nProjects = entry.getValue().size(); if (nProjects > 1) { Assert.fail(STRSTR\STR + nProjects + STR); } } } | /**
* Checks that for each project (unique by name) only one {@link Project} instance was created.
* @param usedProjects The result of the visitation, all found project instances.
*/ | Checks that for each project (unique by name) only one <code>Project</code> instance was created | assertProjects | {
"repo_name": "SSEHUB/EASyProducer",
"path": "Plugins/IVML/de.uni_hildesheim.sse.ivml.tests/src/test/de/uni_hildesheim/sse/cycletest/CyclingImportsTest.java",
"license": "apache-2.0",
"size": 3482
} | [
"java.util.ArrayList",
"java.util.Collection",
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"net.ssehub.easy.varModel.model.Project",
"org.junit.Assert"
] | import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import net.ssehub.easy.varModel.model.Project; import org.junit.Assert; | import java.util.*; import net.ssehub.easy.*; import org.junit.*; | [
"java.util",
"net.ssehub.easy",
"org.junit"
] | java.util; net.ssehub.easy; org.junit; | 2,589,544 |
protected AstNode parseCreateFunctionStatement( DdlTokenStream tokens,
AstNode parentNode ) throws ParsingException {
assert tokens != null;
assert parentNode != null;
markStartOfStatement(tokens);
boolean isReplace = tokens.canConsume(STMT_CREATE_OR_REPLACE_FUNCTION);
tokens.canConsume(STMT_CREATE_FUNCTION);
String name = parseName(tokens);
AstNode node = nodeFactory().node(name, parentNode, TYPE_CREATE_FUNCTION_STATEMENT);
if (isReplace) {
// TODO: SET isReplace = TRUE to node (possibly a cnd mixin of "replaceable"
}
boolean ok = parseParameters(tokens, node);
if (ok) {
if (tokens.canConsume("RETURN")) {
DataType dType = getDatatypeParser().parse(tokens);
if (dType != null) {
getDatatypeParser().setPropertiesOnNode(node, dType);
}
}
}
parseUntilFwdSlash(tokens, false);
tokens.canConsume("/");
markEndOfStatement(tokens, node);
return node;
} | AstNode function( DdlTokenStream tokens, AstNode parentNode ) throws ParsingException { assert tokens != null; assert parentNode != null; markStartOfStatement(tokens); boolean isReplace = tokens.canConsume(STMT_CREATE_OR_REPLACE_FUNCTION); tokens.canConsume(STMT_CREATE_FUNCTION); String name = parseName(tokens); AstNode node = nodeFactory().node(name, parentNode, TYPE_CREATE_FUNCTION_STATEMENT); if (isReplace) { } boolean ok = parseParameters(tokens, node); if (ok) { if (tokens.canConsume(STR)) { DataType dType = getDatatypeParser().parse(tokens); if (dType != null) { getDatatypeParser().setPropertiesOnNode(node, dType); } } } parseUntilFwdSlash(tokens, false); tokens.canConsume("/"); markEndOfStatement(tokens, node); return node; } | /**
* Parses DDL CREATE FUNCTION statement
*
* @param tokens the tokenized {@link DdlTokenStream} of the DDL input content; may not be null
* @param parentNode the parent {@link AstNode} node; may not be null
* @return the parsed CREATE FUNCTION statement node
* @throws ParsingException
*/ | Parses DDL CREATE FUNCTION statement | parseCreateFunctionStatement | {
"repo_name": "weebl2000/modeshape",
"path": "sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/dialect/oracle/OracleDdlParser.java",
"license": "apache-2.0",
"size": 112307
} | [
"org.modeshape.common.text.ParsingException",
"org.modeshape.sequencer.ddl.DdlTokenStream",
"org.modeshape.sequencer.ddl.datatype.DataType",
"org.modeshape.sequencer.ddl.node.AstNode"
] | import org.modeshape.common.text.ParsingException; import org.modeshape.sequencer.ddl.DdlTokenStream; import org.modeshape.sequencer.ddl.datatype.DataType; import org.modeshape.sequencer.ddl.node.AstNode; | import org.modeshape.common.text.*; import org.modeshape.sequencer.ddl.*; import org.modeshape.sequencer.ddl.datatype.*; import org.modeshape.sequencer.ddl.node.*; | [
"org.modeshape.common",
"org.modeshape.sequencer"
] | org.modeshape.common; org.modeshape.sequencer; | 1,038,620 |
public void run() {
System.out.println("[SendFileThread] :: started at port " + port);
int progress = 0;
try {
Socket socket = new Socket(InetAddress.getByName(otherIP), port);
//The InetAddress specification
InetAddress IA = InetAddress.getByName("localhost");
//Specify the file
File file = new File(filePath);
FileInputStream fis = new FileInputStream(file);
BufferedInputStream bis = new BufferedInputStream(fis);
//Get socket's output stream
OutputStream os = socket.getOutputStream();
//Read File Contents into contents array
byte[] contents;
long fileLength = file.length();
long current = 0;
//Frame to display the progress bar
JFrame progFrame = new JFrame("Progress frame");
progFrame.setBounds(500, 300, 350, 200);
JPanel panel = new JPanel();
panel.setLayout(new GridLayout(10, 1));
//Progress bar
JProgressBar progressbar = new JProgressBar(0, 100);
progressbar.setSize(new Dimension(100, 15));
progressbar.setBackground(Color.white);
progressbar.setForeground(Color.green);
//adding blank frames
for(int i = 0; i <= 2; i++){
panel.add(new JPanel());
}
JPanel progressPanel = new JPanel(new BorderLayout(5, 5));
JLabel progressLabel = new JLabel();
progressPanel.add(progressLabel);
panel.add(progressPanel, BorderLayout.EAST);
panel.add(progressbar);
progFrame.add(panel);
progFrame.setVisible(true);
long start = System.nanoTime();
//Going to receive data
while(current!=fileLength){
int size = 10000;
if(fileLength - current >= size)
current += size;
else{
size = (int)(fileLength - current);
current = fileLength;
}
contents = new byte[size];
bis.read(contents, 0, size);
os.write(contents);
System.out.print("Sending file ... "+ (progress = (int) ((current*100)/fileLength)) +"% complete!");
progressLabel.setText("Sending file...." + progress + "%");
progressbar.setValue(progress);
}
progFrame.setVisible(false);
os.flush();
//File transfer done. Close the socket connection!
socket.close();
//showing the success message
JOptionPane.showMessageDialog(null, "File sent successfully !");
System.out.println("[SendFileThread] :: File sent succesfully!");
}
catch(Exception e)
{
System.out.println("[SendFileThread] :: exception: " + e);
e.printStackTrace();
JOptionPane.showMessageDialog(null,"Failed to send file. Please send again");
System.out.println(" File not sent !");
}
} | void function() { System.out.println(STR + port); int progress = 0; try { Socket socket = new Socket(InetAddress.getByName(otherIP), port); InetAddress IA = InetAddress.getByName(STR); File file = new File(filePath); FileInputStream fis = new FileInputStream(file); BufferedInputStream bis = new BufferedInputStream(fis); OutputStream os = socket.getOutputStream(); byte[] contents; long fileLength = file.length(); long current = 0; JFrame progFrame = new JFrame(STR); progFrame.setBounds(500, 300, 350, 200); JPanel panel = new JPanel(); panel.setLayout(new GridLayout(10, 1)); JProgressBar progressbar = new JProgressBar(0, 100); progressbar.setSize(new Dimension(100, 15)); progressbar.setBackground(Color.white); progressbar.setForeground(Color.green); for(int i = 0; i <= 2; i++){ panel.add(new JPanel()); } JPanel progressPanel = new JPanel(new BorderLayout(5, 5)); JLabel progressLabel = new JLabel(); progressPanel.add(progressLabel); panel.add(progressPanel, BorderLayout.EAST); panel.add(progressbar); progFrame.add(panel); progFrame.setVisible(true); long start = System.nanoTime(); while(current!=fileLength){ int size = 10000; if(fileLength - current >= size) current += size; else{ size = (int)(fileLength - current); current = fileLength; } contents = new byte[size]; bis.read(contents, 0, size); os.write(contents); System.out.print(STR+ (progress = (int) ((current*100)/fileLength)) +STR); progressLabel.setText(STR + progress + "%"); progressbar.setValue(progress); } progFrame.setVisible(false); os.flush(); socket.close(); JOptionPane.showMessageDialog(null, STR); System.out.println(STR); } catch(Exception e) { System.out.println(STR + e); e.printStackTrace(); JOptionPane.showMessageDialog(null,STR); System.out.println(STR); } } | /**
* thread run method
*/ | thread run method | run | {
"repo_name": "angeldove/LanChatLite",
"path": "src/com/weavebytes/services/SendFileThread.java",
"license": "gpl-3.0",
"size": 4492
} | [
"java.awt.BorderLayout",
"java.awt.Color",
"java.awt.Dimension",
"java.awt.GridLayout",
"java.io.BufferedInputStream",
"java.io.File",
"java.io.FileInputStream",
"java.io.OutputStream",
"java.net.InetAddress",
"java.net.Socket",
"javax.swing.JFrame",
"javax.swing.JLabel",
"javax.swing.JOptionPane",
"javax.swing.JPanel",
"javax.swing.JProgressBar"
] | import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.GridLayout; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.OutputStream; import java.net.InetAddress; import java.net.Socket; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JProgressBar; | import java.awt.*; import java.io.*; import java.net.*; import javax.swing.*; | [
"java.awt",
"java.io",
"java.net",
"javax.swing"
] | java.awt; java.io; java.net; javax.swing; | 370,010 |
protected void appendLocalCheckConfigs(Element root) {
Optional.ofNullable(getSourceSets()).ifPresent(s -> {
for (String sourceSet : s) {
String configFile = getProject()
.relativePath(CheckstyleConfigPlugin.getCheckstyleConfigFile(sourceSet, this.files));
Element localCheckConfig = root.getOwnerDocument().createElement("local-check-config");
root.appendChild(localCheckConfig);
localCheckConfig.setAttribute("name", String.format("Checkstyle %s configuration", sourceSet));
localCheckConfig.setAttribute("location", configFile);
localCheckConfig.setAttribute("type", "project");
localCheckConfig.setAttribute("description", "");
Element additionalData = root.getOwnerDocument().createElement("additional-data");
localCheckConfig.appendChild(additionalData);
additionalData.setAttribute("name", "protect-config-file");
additionalData.setAttribute("value", "false");
}
});
} | void function(Element root) { Optional.ofNullable(getSourceSets()).ifPresent(s -> { for (String sourceSet : s) { String configFile = getProject() .relativePath(CheckstyleConfigPlugin.getCheckstyleConfigFile(sourceSet, this.files)); Element localCheckConfig = root.getOwnerDocument().createElement(STR); root.appendChild(localCheckConfig); localCheckConfig.setAttribute("name", String.format(STR, sourceSet)); localCheckConfig.setAttribute(STR, configFile); localCheckConfig.setAttribute("type", STR); localCheckConfig.setAttribute(STR, STRadditional-dataSTRnameSTRprotect-config-fileSTRvalueSTRfalse"); } }); } | /**
* Add the 'local-check-config' elements
*
* @param root Root element of configuration
*/ | Add the 'local-check-config' elements | appendLocalCheckConfigs | {
"repo_name": "jochenseeber/gradle-project-config",
"path": "src/main/java/me/seeber/gradle/validation/checkstyle/GenerateEclipseCheckstyle.java",
"license": "bsd-2-clause",
"size": 7851
} | [
"java.util.Optional",
"org.w3c.dom.Element"
] | import java.util.Optional; import org.w3c.dom.Element; | import java.util.*; import org.w3c.dom.*; | [
"java.util",
"org.w3c.dom"
] | java.util; org.w3c.dom; | 467,522 |
public List getKnownReceiverClasses() {
return Collections.unmodifiableList(receiverClassList);
} | List function() { return Collections.unmodifiableList(receiverClassList); } | /**
* Returns an unmodifiable list of Class objects which represent all the 'known'
* Receiver classes.
* @return known receiver classes
*/ | Returns an unmodifiable list of Class objects which represent all the 'known' Receiver classes | getKnownReceiverClasses | {
"repo_name": "apache/chainsaw",
"path": "src/main/java/org/apache/log4j/chainsaw/receivers/ReceiversHelper.java",
"license": "apache-2.0",
"size": 8285
} | [
"java.util.Collections",
"java.util.List"
] | import java.util.Collections; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,447,331 |
Color getSundayBackgroundColorTop(); | Color getSundayBackgroundColorTop(); | /**
* The top background gradient color used for drawing the Sunday column.
*
* @return Color
*/ | The top background gradient color used for drawing the Sunday column | getSundayBackgroundColorTop | {
"repo_name": "FranColmenero/Nebula",
"path": "src/org/eclipse/nebula/widgets/ganttchart/IFillBackgroundColors.java",
"license": "epl-1.0",
"size": 2218
} | [
"org.eclipse.swt.graphics.Color"
] | import org.eclipse.swt.graphics.Color; | import org.eclipse.swt.graphics.*; | [
"org.eclipse.swt"
] | org.eclipse.swt; | 1,599,305 |
protected File file() {
if ((pathname == null) || (pathname.length() == 0))
return (null);
File file = new File(pathname);
if (!file.isAbsolute()) {
if (container instanceof Context) {
ServletContext servletContext =
((Context) container).getServletContext();
File tempdir = (File)
servletContext.getAttribute(ServletContext.TEMPDIR);
if (tempdir != null)
file = new File(tempdir, pathname);
}
}
// if (!file.isAbsolute())
// return (null);
return (file);
} | File function() { if ((pathname == null) (pathname.length() == 0)) return (null); File file = new File(pathname); if (!file.isAbsolute()) { if (container instanceof Context) { ServletContext servletContext = ((Context) container).getServletContext(); File tempdir = (File) servletContext.getAttribute(ServletContext.TEMPDIR); if (tempdir != null) file = new File(tempdir, pathname); } } return (file); } | /**
* Return a File object representing the pathname to our
* persistence file, if any.
*/ | Return a File object representing the pathname to our persistence file, if any | file | {
"repo_name": "benothman/jboss-web-nio2",
"path": "java/org/apache/catalina/session/StandardManager.java",
"license": "lgpl-3.0",
"size": 23760
} | [
"java.io.File",
"javax.servlet.ServletContext",
"org.apache.catalina.Context"
] | import java.io.File; import javax.servlet.ServletContext; import org.apache.catalina.Context; | import java.io.*; import javax.servlet.*; import org.apache.catalina.*; | [
"java.io",
"javax.servlet",
"org.apache.catalina"
] | java.io; javax.servlet; org.apache.catalina; | 2,717,605 |
public static Range iterateRangeBounds(XYDataset dataset) {
return iterateRangeBounds(dataset, true);
}
| static Range function(XYDataset dataset) { return iterateRangeBounds(dataset, true); } | /**
* Iterates over the data item of the xy dataset to find
* the range bounds.
*
* @param dataset the dataset (<code>null</code> not permitted).
*
* @return The range (possibly <code>null</code>).
*
* @since 1.0.10
*/ | Iterates over the data item of the xy dataset to find the range bounds | iterateRangeBounds | {
"repo_name": "sebkur/JFreeChart",
"path": "src/main/java/org/jfree/data/general/DatasetUtilities.java",
"license": "lgpl-3.0",
"size": 97375
} | [
"org.jfree.data.Range",
"org.jfree.data.xy.XYDataset"
] | import org.jfree.data.Range; import org.jfree.data.xy.XYDataset; | import org.jfree.data.*; import org.jfree.data.xy.*; | [
"org.jfree.data"
] | org.jfree.data; | 2,137,953 |
private void broadcastWifiInfos(final ArrayList<WifiRecord> wifis) {
final WifiRecord recent = wifis.get(wifis.size() - 1);
EventBus.getDefault().post(new onWifiAdded(recent.getSsid(), recent.getLevel()));
} | void function(final ArrayList<WifiRecord> wifis) { final WifiRecord recent = wifis.get(wifis.size() - 1); EventBus.getDefault().post(new onWifiAdded(recent.getSsid(), recent.getLevel())); } | /**
* Broadcasts human-readable description of last wifi.
*/ | Broadcasts human-readable description of last wifi | broadcastWifiInfos | {
"repo_name": "wish7code/openbmap",
"path": "android/app/src/main/java/org/openbmap/services/wireless/WirelessLoggerService.java",
"license": "agpl-3.0",
"size": 64805
} | [
"java.util.ArrayList",
"org.greenrobot.eventbus.EventBus",
"org.openbmap.db.models.WifiRecord",
"org.openbmap.events.onWifiAdded"
] | import java.util.ArrayList; import org.greenrobot.eventbus.EventBus; import org.openbmap.db.models.WifiRecord; import org.openbmap.events.onWifiAdded; | import java.util.*; import org.greenrobot.eventbus.*; import org.openbmap.db.models.*; import org.openbmap.events.*; | [
"java.util",
"org.greenrobot.eventbus",
"org.openbmap.db",
"org.openbmap.events"
] | java.util; org.greenrobot.eventbus; org.openbmap.db; org.openbmap.events; | 2,418,291 |
ItemType next() throws XmlParseException, NoSuchElementException; | ItemType next() throws XmlParseException, NoSuchElementException; | /**
* Move to the next token
* @return The type of item we are at
* @throws XmlParseException if we encounter malformed xml
*/ | Move to the next token | next | {
"repo_name": "vega113/incubator-wave",
"path": "wave/src/main/java/org/waveprotocol/wave/model/document/parser/XmlPullParser.java",
"license": "apache-2.0",
"size": 2864
} | [
"java.util.NoSuchElementException"
] | import java.util.NoSuchElementException; | import java.util.*; | [
"java.util"
] | java.util; | 276,942 |
public static DataResult<SystemOverview> unentitledList(User user, PageControl pc) {
SelectMode m = ModeFactory.getMode("System_queries", "unentitled");
Map<String, Object> params = new HashMap<String, Object>();
params.put("org_id", user.getOrg().getId());
params.put("user_id", user.getId());
Map<String, Object> elabParams = new HashMap<String, Object>();
return makeDataResult(params, elabParams, pc, m, SystemOverview.class);
} | static DataResult<SystemOverview> function(User user, PageControl pc) { SelectMode m = ModeFactory.getMode(STR, STR); Map<String, Object> params = new HashMap<String, Object>(); params.put(STR, user.getOrg().getId()); params.put(STR, user.getId()); Map<String, Object> elabParams = new HashMap<String, Object>(); return makeDataResult(params, elabParams, pc, m, SystemOverview.class); } | /**
* Returns list of unentitled systems visible to user.
* @param user Currently logged in user.
* @param pc PageControl
* @return list of SystemOverviews.
*/ | Returns list of unentitled systems visible to user | unentitledList | {
"repo_name": "renner/spacewalk",
"path": "java/code/src/com/redhat/rhn/manager/system/SystemManager.java",
"license": "gpl-2.0",
"size": 132498
} | [
"com.redhat.rhn.common.db.datasource.DataResult",
"com.redhat.rhn.common.db.datasource.ModeFactory",
"com.redhat.rhn.common.db.datasource.SelectMode",
"com.redhat.rhn.domain.user.User",
"com.redhat.rhn.frontend.dto.SystemOverview",
"com.redhat.rhn.frontend.listview.PageControl",
"java.util.HashMap",
"java.util.Map"
] | import com.redhat.rhn.common.db.datasource.DataResult; import com.redhat.rhn.common.db.datasource.ModeFactory; import com.redhat.rhn.common.db.datasource.SelectMode; import com.redhat.rhn.domain.user.User; import com.redhat.rhn.frontend.dto.SystemOverview; import com.redhat.rhn.frontend.listview.PageControl; import java.util.HashMap; import java.util.Map; | import com.redhat.rhn.common.db.datasource.*; import com.redhat.rhn.domain.user.*; import com.redhat.rhn.frontend.dto.*; import com.redhat.rhn.frontend.listview.*; import java.util.*; | [
"com.redhat.rhn",
"java.util"
] | com.redhat.rhn; java.util; | 1,058,357 |
private void startAdditionalNodes(int cnt, String queueName) throws Exception {
IgniteQueue queue = ignite(0).queue(queueName, 0, null);
CacheConfiguration cCfg = getQueueCache(queue);
Collection<ClusterNode> aff1 = ignite(0).affinity(cCfg.getName()).mapKeyToPrimaryAndBackups(queueName);
for (int i = 0, id = GRID_CNT; i < cnt; i++) {
startGrid(id++);
awaitPartitionMapExchange();
Collection<ClusterNode> aff2 = ignite(0).affinity(cCfg.getName()).mapKeyToPrimaryAndBackups(queueName);
if (!aff1.iterator().next().equals(aff2.iterator().next())) {
info("Moved queue to new primary node [oldAff=" + aff1 + ", newAff=" + aff2 + ']');
return;
}
}
throw new IgniteCheckedException("Unable to move the queue to a new primary node");
} | void function(int cnt, String queueName) throws Exception { IgniteQueue queue = ignite(0).queue(queueName, 0, null); CacheConfiguration cCfg = getQueueCache(queue); Collection<ClusterNode> aff1 = ignite(0).affinity(cCfg.getName()).mapKeyToPrimaryAndBackups(queueName); for (int i = 0, id = GRID_CNT; i < cnt; i++) { startGrid(id++); awaitPartitionMapExchange(); Collection<ClusterNode> aff2 = ignite(0).affinity(cCfg.getName()).mapKeyToPrimaryAndBackups(queueName); if (!aff1.iterator().next().equals(aff2.iterator().next())) { info(STR + aff1 + STR + aff2 + ']'); return; } } throw new IgniteCheckedException(STR); } | /**
* Start additional nodes above {@link #GRID_CNT}.
*
* @param cnt Number of additional nodes.
* @param queueName Queue name.
* @throws Exception If failed.
*/ | Start additional nodes above <code>#GRID_CNT</code> | startAdditionalNodes | {
"repo_name": "dlnufox/ignite",
"path": "modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueEntryMoveSelfTest.java",
"license": "apache-2.0",
"size": 7516
} | [
"java.util.Collection",
"org.apache.ignite.IgniteCheckedException",
"org.apache.ignite.IgniteQueue",
"org.apache.ignite.cluster.ClusterNode",
"org.apache.ignite.configuration.CacheConfiguration"
] | import java.util.Collection; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteQueue; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.configuration.CacheConfiguration; | import java.util.*; import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.configuration.*; | [
"java.util",
"org.apache.ignite"
] | java.util; org.apache.ignite; | 2,300,945 |
private void connect() {
final PrgBridgeConfig config = getPrgBridgeConfig();
String response = "Server is offline - will try to reconnect later";
try {
logger.info("Attempting connection ...");
_session.connect();
response = _protocolHandler.login(config.getUserName());
if (response == null) {
if (config != null) {
updateStatus(ThingStatus.ONLINE);
return;
}
}
} catch (Exception e) {
logger.error("Exception during connection attempt", e);
}
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, response);
retryConnect();
} | void function() { final PrgBridgeConfig config = getPrgBridgeConfig(); String response = STR; try { logger.info(STR); _session.connect(); response = _protocolHandler.login(config.getUserName()); if (response == null) { if (config != null) { updateStatus(ThingStatus.ONLINE); return; } } } catch (Exception e) { logger.error(STR, e); } updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, response); retryConnect(); } | /**
* Attempts to connect to the PRG unit. If successfully connect, the {@link PrgProtocolHandler#login()} will be
* called to log into the unit. If a connection cannot be established (or login failed), the connection attempt will
* be retried later (via {@link #retryConnect()})
*/ | Attempts to connect to the PRG unit. If successfully connect, the <code>PrgProtocolHandler#login()</code> will be called to log into the unit. If a connection cannot be established (or login failed), the connection attempt will be retried later (via <code>#retryConnect()</code>) | connect | {
"repo_name": "georgeerhan/openhab2-addons",
"path": "addons/binding/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgBridgeHandler.java",
"license": "epl-1.0",
"size": 13000
} | [
"org.eclipse.smarthome.core.thing.ThingStatus",
"org.eclipse.smarthome.core.thing.ThingStatusDetail"
] | import org.eclipse.smarthome.core.thing.ThingStatus; import org.eclipse.smarthome.core.thing.ThingStatusDetail; | import org.eclipse.smarthome.core.thing.*; | [
"org.eclipse.smarthome"
] | org.eclipse.smarthome; | 2,733,480 |
@Override
protected void afterExecute(Runnable r, Throwable t) {
Future<?> result=(Future<?>)r;
try {
System.out.printf("*********************************\n");
System.out.printf("MyExecutor: A task is finishing.\n");
System.out.printf("MyExecutor: Result: %s\n",result.get());
Date startDate=startTimes.remove(String.valueOf(r.hashCode()));
Date finishDate=new Date();
long diff=finishDate.getTime()-startDate.getTime();
System.out.printf("MyExecutor: Duration: %d\n",diff);
System.out.printf("*********************************\n");
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
}
} | void function(Runnable r, Throwable t) { Future<?> result=(Future<?>)r; try { System.out.printf(STR); System.out.printf(STR); System.out.printf(STR,result.get()); Date startDate=startTimes.remove(String.valueOf(r.hashCode())); Date finishDate=new Date(); long diff=finishDate.getTime()-startDate.getTime(); System.out.printf(STR,diff); System.out.printf(STR); } catch (InterruptedException ExecutionException e) { e.printStackTrace(); } } | /**
* This method is executed after the execution of a task. We calculate the execution time of the task
*/ | This method is executed after the execution of a task. We calculate the execution time of the task | afterExecute | {
"repo_name": "xuelvming/Java7ConcurrencyCookbook",
"path": "7881_code/Chapter 7/ch7_recipe01/src/com/packtpub/java7/concurrency/chapter7/recipe01/executor/MyExecutor.java",
"license": "mit",
"size": 3712
} | [
"java.util.Date",
"java.util.concurrent.ExecutionException",
"java.util.concurrent.Future"
] | import java.util.Date; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; | import java.util.*; import java.util.concurrent.*; | [
"java.util"
] | java.util; | 617,063 |
public void testClosedIndices() throws Exception {
if (isRunningAgainstOldCluster()) {
createIndex(index, Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 1).build());
ensureGreen(index);
int numDocs = 0;
if (randomBoolean()) {
numDocs = between(1, 100);
for (int i = 0; i < numDocs; i++) {
final Request request = new Request("POST", "/" + index + "/_doc/" + i);
request.setJsonEntity(Strings.toString(JsonXContent.contentBuilder().startObject().field("field", "v1").endObject()));
assertOK(client().performRequest(request));
if (rarely()) {
refreshAllIndices();
}
}
refreshAllIndices();
}
assertTotalHits(numDocs, entityAsMap(client().performRequest(new Request("GET", "/" + index + "/_search"))));
saveInfoDocument(index + "_doc_count", Integer.toString(numDocs));
closeIndex(index);
}
if (getOldClusterVersion().onOrAfter(Version.V_7_2_0)) {
ensureGreenLongWait(index);
assertClosedIndex(index, true);
} else {
assertClosedIndex(index, false);
}
if (isRunningAgainstOldCluster() == false) {
openIndex(index);
ensureGreen(index);
final int expectedNumDocs = Integer.parseInt(loadInfoDocument(index + "_doc_count"));
assertTotalHits(expectedNumDocs, entityAsMap(client().performRequest(new Request("GET", "/" + index + "/_search"))));
}
} | void function() throws Exception { if (isRunningAgainstOldCluster()) { createIndex(index, Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 1).build()); ensureGreen(index); int numDocs = 0; if (randomBoolean()) { numDocs = between(1, 100); for (int i = 0; i < numDocs; i++) { final Request request = new Request("POST", "/" + index + STR + i); request.setJsonEntity(Strings.toString(JsonXContent.contentBuilder().startObject().field("field", "v1").endObject())); assertOK(client().performRequest(request)); if (rarely()) { refreshAllIndices(); } } refreshAllIndices(); } assertTotalHits(numDocs, entityAsMap(client().performRequest(new Request("GET", "/" + index + STR)))); saveInfoDocument(index + STR, Integer.toString(numDocs)); closeIndex(index); } if (getOldClusterVersion().onOrAfter(Version.V_7_2_0)) { ensureGreenLongWait(index); assertClosedIndex(index, true); } else { assertClosedIndex(index, false); } if (isRunningAgainstOldCluster() == false) { openIndex(index); ensureGreen(index); final int expectedNumDocs = Integer.parseInt(loadInfoDocument(index + STR)); assertTotalHits(expectedNumDocs, entityAsMap(client().performRequest(new Request("GET", "/" + index + STR)))); } } | /**
* This test creates an index in the old cluster and then closes it. When the cluster is fully restarted in a newer version,
* it verifies that the index exists and is replicated if the old version supports replication.
*/ | This test creates an index in the old cluster and then closes it. When the cluster is fully restarted in a newer version, it verifies that the index exists and is replicated if the old version supports replication | testClosedIndices | {
"repo_name": "jmluy/elasticsearch",
"path": "qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartIT.java",
"license": "apache-2.0",
"size": 90378
} | [
"org.elasticsearch.Version",
"org.elasticsearch.client.Request",
"org.elasticsearch.cluster.metadata.IndexMetadata",
"org.elasticsearch.common.Strings",
"org.elasticsearch.common.settings.Settings",
"org.elasticsearch.xcontent.json.JsonXContent"
] | import org.elasticsearch.Version; import org.elasticsearch.client.Request; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.xcontent.json.JsonXContent; | import org.elasticsearch.*; import org.elasticsearch.client.*; import org.elasticsearch.cluster.metadata.*; import org.elasticsearch.common.*; import org.elasticsearch.common.settings.*; import org.elasticsearch.xcontent.json.*; | [
"org.elasticsearch",
"org.elasticsearch.client",
"org.elasticsearch.cluster",
"org.elasticsearch.common",
"org.elasticsearch.xcontent"
] | org.elasticsearch; org.elasticsearch.client; org.elasticsearch.cluster; org.elasticsearch.common; org.elasticsearch.xcontent; | 2,295,369 |
@Override public void enterNonlocal_stmt(@NotNull Python3Parser.Nonlocal_stmtContext ctx) { } | @Override public void enterNonlocal_stmt(@NotNull Python3Parser.Nonlocal_stmtContext ctx) { } | /**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/ | The default implementation does nothing | exitComp_iter | {
"repo_name": "IsThisThePayneResidence/intellidots",
"path": "src/main/java/ua/edu/hneu/ast/parsers/Python3BaseListener.java",
"license": "gpl-3.0",
"size": 30027
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 985,929 |
public Optional<QualifiedName> generated() {
return ifAvailable(GENERATED);
} | Optional<QualifiedName> function() { return ifAvailable(GENERATED); } | /**
* Parameterized type for {@code java.util.function.Consumer<T>}, if available.
*/ | Parameterized type for java.util.function.Consumer, if available | generated | {
"repo_name": "inferred/FreeBuilder",
"path": "src/main/java/org/inferred/freebuilder/processor/source/feature/JavaxPackage.java",
"license": "apache-2.0",
"size": 1884
} | [
"java.util.Optional",
"org.inferred.freebuilder.processor.source.QualifiedName"
] | import java.util.Optional; import org.inferred.freebuilder.processor.source.QualifiedName; | import java.util.*; import org.inferred.freebuilder.processor.source.*; | [
"java.util",
"org.inferred.freebuilder"
] | java.util; org.inferred.freebuilder; | 771,914 |
public static double min(double[] values) {
return Arrays.stream(values).min().orElse(Double.NaN);
} | static double function(double[] values) { return Arrays.stream(values).min().orElse(Double.NaN); } | /**
* Find the minimum value in a window of values
* If all values are missing/null/NaN, the return value will be NaN
*/ | Find the minimum value in a window of values If all values are missing/null/NaN, the return value will be NaN | min | {
"repo_name": "coding0011/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MovingFunctions.java",
"license": "apache-2.0",
"size": 13064
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 584,899 |
private Place jsonObjectToPlace(JSONObject object) {
String name = object.optString("name");
double latitude = object.optDouble("latitude", Double.NaN);
double longitude = object.optDouble("longitude", Double.NaN);
if (!name.isEmpty() && !Double.isNaN(latitude) && !Double.isNaN(longitude)) {
return new Place(latitude, longitude, name);
} else {
return null;
}
} | Place function(JSONObject object) { String name = object.optString("name"); double latitude = object.optDouble(STR, Double.NaN); double longitude = object.optDouble(STR, Double.NaN); if (!name.isEmpty() && !Double.isNaN(latitude) && !Double.isNaN(longitude)) { return new Place(latitude, longitude, name); } else { return null; } } | /**
* Converts a JSON object that represents a place into a {@link Place} object.
*/ | Converts a JSON object that represents a place into a <code>Place</code> object | jsonObjectToPlace | {
"repo_name": "luisibanez/gdk-line-sample",
"path": "src/com/kitware/android/glass/sample/line/model/Landmarks.java",
"license": "apache-2.0",
"size": 5570
} | [
"org.json.JSONObject"
] | import org.json.JSONObject; | import org.json.*; | [
"org.json"
] | org.json; | 2,292,490 |
private static Map<String, String> createIdToResourceNameMap()
{
final Map<String, String> map = Maps.newHashMap();
map.put(DTD_PUBLIC_ID_1_0, DTD_RESOURCE_NAME_1_0);
map.put(DTD_PUBLIC_ID_1_1, DTD_RESOURCE_NAME_1_1);
return map;
} | static Map<String, String> function() { final Map<String, String> map = Maps.newHashMap(); map.put(DTD_PUBLIC_ID_1_0, DTD_RESOURCE_NAME_1_0); map.put(DTD_PUBLIC_ID_1_1, DTD_RESOURCE_NAME_1_1); return map; } | /**
* Creates mapping between local resources and dtd ids.
* @return map between local resources and dtd ids.
*/ | Creates mapping between local resources and dtd ids | createIdToResourceNameMap | {
"repo_name": "gkzhong/checkstyle",
"path": "src/checkstyle/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoader.java",
"license": "lgpl-2.1",
"size": 8145
} | [
"com.google.common.collect.Maps",
"java.util.Map"
] | import com.google.common.collect.Maps; import java.util.Map; | import com.google.common.collect.*; import java.util.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 2,870,430 |
public static Calendar toCalendar(DateTime dateTime) {
return dateTimesHelper.toCalendar(dateTime);
} | static Calendar function(DateTime dateTime) { return dateTimesHelper.toCalendar(dateTime); } | /**
* Gets a calendar for a {@code DateTime} using the default locale,
* i.e. Locale.getDefault().
*/ | Gets a calendar for a DateTime using the default locale, i.e. Locale.getDefault() | toCalendar | {
"repo_name": "stoksey69/googleads-java-lib",
"path": "modules/dfp_axis/src/main/java/com/google/api/ads/dfp/axis/utils/v201411/DateTimes.java",
"license": "apache-2.0",
"size": 5993
} | [
"com.google.api.ads.dfp.axis.v201411.DateTime",
"java.util.Calendar"
] | import com.google.api.ads.dfp.axis.v201411.DateTime; import java.util.Calendar; | import com.google.api.ads.dfp.axis.v201411.*; import java.util.*; | [
"com.google.api",
"java.util"
] | com.google.api; java.util; | 1,127,556 |
public static char[] getPattern(Context context) {
String pattern = p(context).getString(
context.getString(R.string.pkey_sys_pattern),
null);
return pattern == null ? null : pattern.toCharArray();
}// getPattern() | static char[] function(Context context) { String pattern = p(context).getString( context.getString(R.string.pkey_sys_pattern), null); return pattern == null ? null : pattern.toCharArray(); } | /**
* Gets the pattern.
*
* @param context the context.
* @return the pattern. Default is {@code null}.
*/ | Gets the pattern | getPattern | {
"repo_name": "xdtianyu/NeoAuthenticator",
"path": "AuthenticatorApp/src/main/java/org/xdty/authenticator/androidlockpattern/util/Settings.java",
"license": "apache-2.0",
"size": 16249
} | [
"android.content.Context"
] | import android.content.Context; | import android.content.*; | [
"android.content"
] | android.content; | 834,230 |
public static <T, PT extends Procedure<? super T>> void forEach(
Iterable<T> iterable,
PT procedure,
int minForkSize,
int taskCount)
{
FJIterate.forEach(iterable, procedure, minForkSize, taskCount, FJIterate.FORK_JOIN_POOL);
} | static <T, PT extends Procedure<? super T>> void function( Iterable<T> iterable, PT procedure, int minForkSize, int taskCount) { FJIterate.forEach(iterable, procedure, minForkSize, taskCount, FJIterate.FORK_JOIN_POOL); } | /**
* Iterate over the collection specified in parallel batches using the specified minimum fork and task count sizes.
* The {@code Procedure} used must be stateless, or use concurrent aware objects if they are to be shared.
*
* @param minForkSize Only run in parallel if input collection is longer than this.
* @param taskCount The number of parallel tasks to submit to the executor.
* @see #forEach(Iterable, Procedure)
*/ | Iterate over the collection specified in parallel batches using the specified minimum fork and task count sizes. The Procedure used must be stateless, or use concurrent aware objects if they are to be shared | forEach | {
"repo_name": "g-votte/eclipse-collections",
"path": "eclipse-collections-forkjoin/src/main/java/org/eclipse/collections/impl/forkjoin/FJIterate.java",
"license": "bsd-3-clause",
"size": 47347
} | [
"org.eclipse.collections.api.block.procedure.Procedure"
] | import org.eclipse.collections.api.block.procedure.Procedure; | import org.eclipse.collections.api.block.procedure.*; | [
"org.eclipse.collections"
] | org.eclipse.collections; | 775,336 |
IComplexNDArray concat(int dimension, IComplexNDArray... toConcat); | IComplexNDArray concat(int dimension, IComplexNDArray... toConcat); | /**
* Concatneate ndarrays along a dimension
*
* @param dimension the dimension to concatneate along
* @param toConcat the ndarrays to concateneate
* @return the concatneated ndarrays
*/ | Concatneate ndarrays along a dimension | concat | {
"repo_name": "drlebedev/nd4j",
"path": "nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/NDArrayFactory.java",
"license": "apache-2.0",
"size": 43801
} | [
"org.nd4j.linalg.api.complex.IComplexNDArray"
] | import org.nd4j.linalg.api.complex.IComplexNDArray; | import org.nd4j.linalg.api.complex.*; | [
"org.nd4j.linalg"
] | org.nd4j.linalg; | 2,762,843 |
public static RunDataStatistic parseFromString(final Repository repository,
String runDataStatistic) throws UnknownRunDataStatisticException {
Class<? extends RunDataStatistic> c = repository.getRegisteredClass(
RunDataStatistic.class, "de.clusteval.run.statistics."
+ runDataStatistic);
try {
RunDataStatistic statistic = c.getConstructor(Repository.class,
boolean.class, long.class, File.class).newInstance(
repository, false, System.currentTimeMillis(),
new File(runDataStatistic));
return statistic;
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (NullPointerException e) {
} catch (IllegalArgumentException e1) {
e1.printStackTrace();
} catch (SecurityException e1) {
e1.printStackTrace();
} catch (InvocationTargetException e1) {
e1.printStackTrace();
} catch (NoSuchMethodException e1) {
e1.printStackTrace();
}
throw new UnknownRunDataStatisticException("\"" + runDataStatistic
+ "\" is not a known RunDataStatistic.");
} | static RunDataStatistic function(final Repository repository, String runDataStatistic) throws UnknownRunDataStatisticException { Class<? extends RunDataStatistic> c = repository.getRegisteredClass( RunDataStatistic.class, STR + runDataStatistic); try { RunDataStatistic statistic = c.getConstructor(Repository.class, boolean.class, long.class, File.class).newInstance( repository, false, System.currentTimeMillis(), new File(runDataStatistic)); return statistic; } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (NullPointerException e) { } catch (IllegalArgumentException e1) { e1.printStackTrace(); } catch (SecurityException e1) { e1.printStackTrace(); } catch (InvocationTargetException e1) { e1.printStackTrace(); } catch (NoSuchMethodException e1) { e1.printStackTrace(); } throw new UnknownRunDataStatisticException("\"STR\STR); } | /**
* This method parses a string and maps it to a subclass of
* {@link RunDataStatistic} looking it up in the given repository.
*
* @param repository
* The repository to look for the classes.
* @param runDataStatistic
* The string representation of a run-data statistic subclass.
* @return A subclass of {@link RunDataStatistic}.
* @throws UnknownRunDataStatisticException
*/ | This method parses a string and maps it to a subclass of <code>RunDataStatistic</code> looking it up in the given repository | parseFromString | {
"repo_name": "deric/clusteval-parent",
"path": "clusteval-backend/src/main/java/de/clusteval/run/statistics/RunDataStatistic.java",
"license": "gpl-3.0",
"size": 7092
} | [
"de.clusteval.framework.repository.Repository",
"java.io.File",
"java.lang.reflect.InvocationTargetException"
] | import de.clusteval.framework.repository.Repository; import java.io.File; import java.lang.reflect.InvocationTargetException; | import de.clusteval.framework.repository.*; import java.io.*; import java.lang.reflect.*; | [
"de.clusteval.framework",
"java.io",
"java.lang"
] | de.clusteval.framework; java.io; java.lang; | 2,083,615 |
@IgniteSpiConfiguration(optional = true)
public JdbcCheckpointSpi setExpireDateFieldType(String expDateType) {
this.expDateType = expDateType;
return this;
} | @IgniteSpiConfiguration(optional = true) JdbcCheckpointSpi function(String expDateType) { this.expDateType = expDateType; return this; } | /**
* Sets checkpoint expiration date field type. By default
* {@link #DFLT_EXPIRE_DATE_FIELD_TYPE} is used. The field should have
* corresponding SQL {@code DATETIME} type.
*
* @param expDateType Checkpoint expiration date field type to set.
* @return {@code this} for chaining.
*/ | Sets checkpoint expiration date field type. By default <code>#DFLT_EXPIRE_DATE_FIELD_TYPE</code> is used. The field should have corresponding SQL DATETIME type | setExpireDateFieldType | {
"repo_name": "alexzaitzev/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/spi/checkpoint/jdbc/JdbcCheckpointSpi.java",
"license": "apache-2.0",
"size": 32338
} | [
"org.apache.ignite.spi.IgniteSpiConfiguration"
] | import org.apache.ignite.spi.IgniteSpiConfiguration; | import org.apache.ignite.spi.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 2,107,591 |
Map<String, List<GAVariant>> getIndividualsWithGene(String geneSymbol,
List<String> variantEffects,
Map<String, Double> alleleFrequencies); | Map<String, List<GAVariant>> getIndividualsWithGene(String geneSymbol, List<String> variantEffects, Map<String, Double> alleleFrequencies); | /**
* Get the individuals that have variants with the given gene symbol, exhibiting the given variant effects, and with
* the given allele frequencies. Sort the list of patients by descending variant harmfulness
*
* @param geneSymbol the gene symbol
* @param variantEffects the variant effects
* @param alleleFrequencies the allele frequencies
*
* @return a map of individuals and respective variants
*/ | Get the individuals that have variants with the given gene symbol, exhibiting the given variant effects, and with the given allele frequencies. Sort the list of patients by descending variant harmfulness | getIndividualsWithGene | {
"repo_name": "phenotips/variant-store",
"path": "variant-store/src/main/java/org/phenotips/variantstore/VariantStoreInterface.java",
"license": "agpl-3.0",
"size": 5208
} | [
"java.util.List",
"java.util.Map",
"org.ga4gh.GAVariant"
] | import java.util.List; import java.util.Map; import org.ga4gh.GAVariant; | import java.util.*; import org.ga4gh.*; | [
"java.util",
"org.ga4gh"
] | java.util; org.ga4gh; | 2,268,514 |
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<DenyAssignmentInner> listForScope(String scope); | @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable<DenyAssignmentInner> listForScope(String scope); | /**
* Gets deny assignments for a scope.
*
* @param scope The scope of the deny assignments.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return deny assignments for a scope.
*/ | Gets deny assignments for a scope | listForScope | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/DenyAssignmentsClient.java",
"license": "mit",
"size": 26696
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedIterable",
"com.azure.resourcemanager.authorization.fluent.models.DenyAssignmentInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.resourcemanager.authorization.fluent.models.DenyAssignmentInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.authorization.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 477,759 |
@SuppressWarnings("rawtypes")
Iterator iterator(); | @SuppressWarnings(STR) Iterator iterator(); | /**
* Returns a read-only iterator over the nodes contained in this
* <code>NodeSetData</code> in
* <a href="http://www.w3.org/TR/1999/REC-xpath-19991116#dt-document-order">
* document order</a>. Attempts to modify the returned iterator
* via the <code>remove</code> method throw
* <code>UnsupportedOperationException</code>.
*
* @return an <code>Iterator</code> over the nodes in this
* <code>NodeSetData</code> in document order
*/ | Returns a read-only iterator over the nodes contained in this <code>NodeSetData</code> in document order. Attempts to modify the returned iterator via the <code>remove</code> method throw <code>UnsupportedOperationException</code> | iterator | {
"repo_name": "rokn/Count_Words_2015",
"path": "testing/openjdk2/jdk/src/share/classes/javax/xml/crypto/NodeSetData.java",
"license": "mit",
"size": 2281
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 1,156,964 |
public void addUsers(ProposalDevelopmentDocument doc); | void function(ProposalDevelopmentDocument doc); | /**
* Adds users to the proposal giving them proposal roles based upon a set
* of templates. Administrators can assign users to proposal roles within
* a specific unit. When a proposal is created, those users are added to
* the proposal corresponding to the proposal's lead unit.
* @param doc
*/ | Adds users to the proposal giving them proposal roles based upon a set of templates. Administrators can assign users to proposal roles within a specific unit. When a proposal is created, those users are added to the proposal corresponding to the proposal's lead unit | addUsers | {
"repo_name": "vivantech/kc_fixes",
"path": "src/main/java/org/kuali/kra/proposaldevelopment/service/ProposalRoleTemplateService.java",
"license": "apache-2.0",
"size": 1238
} | [
"org.kuali.kra.proposaldevelopment.document.ProposalDevelopmentDocument"
] | import org.kuali.kra.proposaldevelopment.document.ProposalDevelopmentDocument; | import org.kuali.kra.proposaldevelopment.document.*; | [
"org.kuali.kra"
] | org.kuali.kra; | 419,478 |
@SuppressWarnings("unchecked")
public static void printLaborwerte(HashMap<String, HashMap<String, HashMap<String, List<LabResult>>>> labResults) {
Set<String> keys1 = labResults.keySet();
for (String sKey : keys1) {
HashMap<String, ?> hm2 = labResults.get(sKey);
Set<String> keys2 = hm2.keySet();
for (String sKey2 : keys2) {
if (sKey2.length() == 0 || hm2.get(sKey2) == null) {
continue;
}
HashMap<String, ?> hm3 = (HashMap<String, ?>) hm2.get(sKey2);
Set<String> keys3 = hm3.keySet();
for (String sKey3 : keys3) {
Object obj = hm3.get(sKey3);
List<LabResult> res = (List<LabResult>) obj;
for (LabResult labResult : res) {
//log.info("\t\t\t\tP: lab result: " + labResult, Log.INFOS);
log.info("\t\t\t\tP: lab result: " + labResult.getDate() + " Name: "
+ labResult.getItem().getName() + " Kuerzel: " + labResult.getItem().getKuerzel()
+ "\tResult: " + labResult.getResult(), Log.INFOS);
}
}
}
}
// loop end
} | @SuppressWarnings(STR) static void function(HashMap<String, HashMap<String, HashMap<String, List<LabResult>>>> labResults) { Set<String> keys1 = labResults.keySet(); for (String sKey : keys1) { HashMap<String, ?> hm2 = labResults.get(sKey); Set<String> keys2 = hm2.keySet(); for (String sKey2 : keys2) { if (sKey2.length() == 0 hm2.get(sKey2) == null) { continue; } HashMap<String, ?> hm3 = (HashMap<String, ?>) hm2.get(sKey2); Set<String> keys3 = hm3.keySet(); for (String sKey3 : keys3) { Object obj = hm3.get(sKey3); List<LabResult> res = (List<LabResult>) obj; for (LabResult labResult : res) { log.info(STR + labResult.getDate() + STR + labResult.getItem().getName() + STR + labResult.getItem().getKuerzel() + STR + labResult.getResult(), Log.INFOS); } } } } } | /**
* for testing and debugging purposes
* @param labResults
*/ | for testing and debugging purposes | printLaborwerte | {
"repo_name": "DavidGutknecht/elexis-3-base",
"path": "bundles/ch.gpb.elexis.cst/src/ch/gpb/elexis/cst/service/CstService.java",
"license": "epl-1.0",
"size": 25706
} | [
"ch.elexis.core.ui.util.Log",
"ch.elexis.data.LabResult",
"java.util.HashMap",
"java.util.List",
"java.util.Set"
] | import ch.elexis.core.ui.util.Log; import ch.elexis.data.LabResult; import java.util.HashMap; import java.util.List; import java.util.Set; | import ch.elexis.core.ui.util.*; import ch.elexis.data.*; import java.util.*; | [
"ch.elexis.core",
"ch.elexis.data",
"java.util"
] | ch.elexis.core; ch.elexis.data; java.util; | 2,805,310 |
private void incrementPolicyVersion(IPolicy policy) {
if (policy.getPolicyVersion() != null) {
String oldVersion = policy.getPolicyVersion().split("-")[1];
Integer newVersion = new Integer(oldVersion) + 1;
policy.setPolicyVersion(policy.getId() + "-" + newVersion);
logger.debug(
"Version of policy: " + policy.getId() + " is increased from " + oldVersion + " to " + newVersion);
}
} | void function(IPolicy policy) { if (policy.getPolicyVersion() != null) { String oldVersion = policy.getPolicyVersion().split("-")[1]; Integer newVersion = new Integer(oldVersion) + 1; policy.setPolicyVersion(policy.getId() + "-" + newVersion); logger.debug( STR + policy.getId() + STR + oldVersion + STR + newVersion); } } | /**
* Increments version number of a policy by one.
*
* @param policy
*/ | Increments version number of a policy by one | incrementPolicyVersion | {
"repo_name": "Pardus-LiderAhenk/lider",
"path": "lider-rest-impl/src/main/java/tr/org/liderahenk/lider/rest/PolicyRequestProcessorImpl.java",
"license": "lgpl-3.0",
"size": 21963
} | [
"tr.org.liderahenk.lider.core.api.persistence.entities.IPolicy"
] | import tr.org.liderahenk.lider.core.api.persistence.entities.IPolicy; | import tr.org.liderahenk.lider.core.api.persistence.entities.*; | [
"tr.org.liderahenk"
] | tr.org.liderahenk; | 2,257,039 |
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object)
{
super.collectNewChildDescriptors(newChildDescriptors, object);
} | void function(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); } | /**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This adds <code>org.eclipse.emf.edit.command.CommandParameter</code>s describing the children that can be created under this object. | collectNewChildDescriptors | {
"repo_name": "Yakindu/statecharts",
"path": "plugins/org.yakindu.sct.model.stext.edit/src/org/yakindu/sct/model/stext/stext/provider/GuardExpressionItemProvider.java",
"license": "epl-1.0",
"size": 3761
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 2,421,073 |
public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption)
{ // Read a valid record
int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption); // Initialize the record
if (iErrorCode != DBConstants.NORMAL_RETURN)
return iErrorCode;
if ((iChangeType == DBConstants.AFTER_UPDATE_TYPE)
|| (iChangeType == DBConstants.AFTER_ADD_TYPE))
return this.syncRecords();
return iErrorCode;
} | int function(FieldInfo field, int iChangeType, boolean bDisplayOption) { int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption); if (iErrorCode != DBConstants.NORMAL_RETURN) return iErrorCode; if ((iChangeType == DBConstants.AFTER_UPDATE_TYPE) (iChangeType == DBConstants.AFTER_ADD_TYPE)) return this.syncRecords(); return iErrorCode; } | /**
* Called when a change is the record status is about to happen/has happened.
* @param field If this file change is due to a field, this is the field.
* @param iChangeType The type of change that occurred.
* @param bDisplayOption If true, display any changes.
* @return an error code.
* Synchronize records after an update or add.
*/ | Called when a change is the record status is about to happen/has happened | doRecordChange | {
"repo_name": "jbundle/jbundle",
"path": "base/base/src/main/java/org/jbundle/base/db/event/RequeryOnUpdateHandler.java",
"license": "gpl-3.0",
"size": 3421
} | [
"org.jbundle.base.model.DBConstants",
"org.jbundle.thin.base.db.FieldInfo"
] | import org.jbundle.base.model.DBConstants; import org.jbundle.thin.base.db.FieldInfo; | import org.jbundle.base.model.*; import org.jbundle.thin.base.db.*; | [
"org.jbundle.base",
"org.jbundle.thin"
] | org.jbundle.base; org.jbundle.thin; | 2,759,720 |
public Vector toVector() {
return new Vector(x, y, z);
} | Vector function() { return new Vector(x, y, z); } | /**
* Constructs a new {@link Vector} based on this Location
*
* @return New Vector containing the coordinates represented by this Location
*/ | Constructs a new <code>Vector</code> based on this Location | toVector | {
"repo_name": "AlmuraDev/Almura-API",
"path": "src/main/java/org/bukkit/Location.java",
"license": "gpl-3.0",
"size": 13004
} | [
"org.bukkit.util.Vector"
] | import org.bukkit.util.Vector; | import org.bukkit.util.*; | [
"org.bukkit.util"
] | org.bukkit.util; | 2,590,007 |
public static Object replaceWComponent(final AbstractWComponent component) {
try {
return component.writeReplace();
} catch (ObjectStreamException ignored) {
// Will not occur, but writeReplace method signature must contain it
return component;
}
}
| static Object function(final AbstractWComponent component) { try { return component.writeReplace(); } catch (ObjectStreamException ignored) { return component; } } | /**
* A Utility method which returns the (replaced) serialized form of a WComponent. This method is only exposed for
* internal instrumentation (by UicStats).
*
* @param component the component to serialize.
* @return the serialized form of the component.
*/ | A Utility method which returns the (replaced) serialized form of a WComponent. This method is only exposed for internal instrumentation (by UicStats) | replaceWComponent | {
"repo_name": "Joshua-Barclay/wcomponents",
"path": "wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractWComponent.java",
"license": "gpl-3.0",
"size": 58008
} | [
"java.io.ObjectStreamException"
] | import java.io.ObjectStreamException; | import java.io.*; | [
"java.io"
] | java.io; | 89,928 |
private boolean isTokenNtlm(final ByteSource tokenSource) {
final byte[] token = consumeByteSourceOrNull(tokenSource);
if (token == null || token.length < NTLM_TOKEN_MAX_LENGTH) {
return false;
}
for (int i = 0; i < NTLM_TOKEN_MAX_LENGTH; i++) {
if (NTLMSSP_SIGNATURE[i].byteValue() != token[i]) {
return false;
}
}
return true;
} | boolean function(final ByteSource tokenSource) { final byte[] token = consumeByteSourceOrNull(tokenSource); if (token == null token.length < NTLM_TOKEN_MAX_LENGTH) { return false; } for (int i = 0; i < NTLM_TOKEN_MAX_LENGTH; i++) { if (NTLMSSP_SIGNATURE[i].byteValue() != token[i]) { return false; } } return true; } | /**
* Checks if is token ntlm.
*
* @param tokenSource the token
* @return true, if token ntlm
*/ | Checks if is token ntlm | isTokenNtlm | {
"repo_name": "yisiqi/cas",
"path": "cas-server-support-spnego/src/main/java/org/apereo/cas/support/spnego/authentication/principal/SpnegoCredential.java",
"license": "apache-2.0",
"size": 4684
} | [
"com.google.common.io.ByteSource"
] | import com.google.common.io.ByteSource; | import com.google.common.io.*; | [
"com.google.common"
] | com.google.common; | 1,010,488 |
public void registerAdditionalActions(@NotNull DefaultActionGroup leftToolbar, @NotNull DefaultActionGroup topToolbar, @NotNull DefaultActionGroup settings) {
} | void function(@NotNull DefaultActionGroup leftToolbar, @NotNull DefaultActionGroup topToolbar, @NotNull DefaultActionGroup settings) { } | /**
* Override this method to provide additional actions in 'Debug' tool window
*/ | Override this method to provide additional actions in 'Debug' tool window | registerAdditionalActions | {
"repo_name": "retomerz/intellij-community",
"path": "platform/xdebugger-api/src/com/intellij/xdebugger/XDebugProcess.java",
"license": "apache-2.0",
"size": 9703
} | [
"com.intellij.openapi.actionSystem.DefaultActionGroup",
"org.jetbrains.annotations.NotNull"
] | import com.intellij.openapi.actionSystem.DefaultActionGroup; import org.jetbrains.annotations.NotNull; | import com.intellij.openapi.*; import org.jetbrains.annotations.*; | [
"com.intellij.openapi",
"org.jetbrains.annotations"
] | com.intellij.openapi; org.jetbrains.annotations; | 34,089 |
public void removeImage(String image) throws IOException {
removeImage(RemoveImageParams.create(image));
} | void function(String image) throws IOException { removeImage(RemoveImageParams.create(image)); } | /**
* Removes docker image.
*
* @param image image identifier, either id or name
* @throws IOException when a problem occurs with docker api calls
*/ | Removes docker image | removeImage | {
"repo_name": "jonahkichwacoders/che",
"path": "plugins/plugin-docker/che-plugin-docker-client/src/main/java/org/eclipse/che/plugin/docker/client/DockerConnector.java",
"license": "epl-1.0",
"size": 60804
} | [
"java.io.IOException",
"org.eclipse.che.plugin.docker.client.params.RemoveImageParams"
] | import java.io.IOException; import org.eclipse.che.plugin.docker.client.params.RemoveImageParams; | import java.io.*; import org.eclipse.che.plugin.docker.client.params.*; | [
"java.io",
"org.eclipse.che"
] | java.io; org.eclipse.che; | 147,412 |
private void handleIntent(Intent intent) {
// obtain the wake lock
PowerManager pm = (PowerManager) getSystemService(POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
mWakeLock.acquire();
// check the global background data setting
ConnectivityManager cm = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
if (!cm.getBackgroundDataSetting()) {
stopSelf();
return;
}
// do the actual work, in a separate thread
//Bundle bb = intent.getExtras().getBundle("b");
//String s = bb.getString("store");
fireAlarm();
} | void function(Intent intent) { PowerManager pm = (PowerManager) getSystemService(POWER_SERVICE); mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG); mWakeLock.acquire(); ConnectivityManager cm = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); if (!cm.getBackgroundDataSetting()) { stopSelf(); return; } fireAlarm(); } | /**
* This is where we initialize. We call this when onStart/onStartCommand is
* called by the system. We won't do anything with the intent here, and you
* probably won't, either.
*/ | This is where we initialize. We call this when onStart/onStartCommand is called by the system. We won't do anything with the intent here, and you probably won't, either | handleIntent | {
"repo_name": "bottiger/SoundWaves",
"path": "app/src/main/java/org/bottiger/podcast/service/AbstractAlarmService.java",
"license": "gpl-3.0",
"size": 4430
} | [
"android.content.Intent",
"android.net.ConnectivityManager",
"android.os.PowerManager"
] | import android.content.Intent; import android.net.ConnectivityManager; import android.os.PowerManager; | import android.content.*; import android.net.*; import android.os.*; | [
"android.content",
"android.net",
"android.os"
] | android.content; android.net; android.os; | 152,542 |
void getCursors(String ledgerName, MetaStoreCallback<List<String>> callback); | void getCursors(String ledgerName, MetaStoreCallback<List<String>> callback); | /**
* Get the list of cursors registered on a ManagedLedger.
*
* @param ledgerName
* the name of the ManagedLedger
*/ | Get the list of cursors registered on a ManagedLedger | getCursors | {
"repo_name": "yahoo/pulsar",
"path": "managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/MetaStore.java",
"license": "apache-2.0",
"size": 4527
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,357,391 |
default void validate(T value, Map<Setting<?>, Object> settings) {
} | default void validate(T value, Map<Setting<?>, Object> settings) { } | /**
* Validate this setting against its dependencies, specified by {@link #settings()}. The default implementation does nothing,
* accepting any value as valid as long as it passes the validation in {@link #validate(Object)}.
*
* @param value the value of this setting
* @param settings a map from the settings specified by {@link #settings()}} to their values
*/ | Validate this setting against its dependencies, specified by <code>#settings()</code>. The default implementation does nothing, accepting any value as valid as long as it passes the validation in <code>#validate(Object)</code> | validate | {
"repo_name": "uschindler/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/common/settings/Setting.java",
"license": "apache-2.0",
"size": 82803
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 629,653 |
public T findByUuid(String uuid) throws NotImplementedYetException; | T function(String uuid) throws NotImplementedYetException; | /**
* Fetch for {@link Persistable} Entities with Id
*
* @param uuid
* Fetch for Entity by UUID Field
* @return Fetched Entity
* @throws NotImplementedYetException
* if Method is Not Implemented Yet
*/ | Fetch for <code>Persistable</code> Entities with Id | findByUuid | {
"repo_name": "frmichetti/workix",
"path": "src/main/java/br/com/codecode/workix/cdi/dao/Crud.java",
"license": "gpl-3.0",
"size": 1763
} | [
"br.com.codecode.workix.core.exceptions.NotImplementedYetException"
] | import br.com.codecode.workix.core.exceptions.NotImplementedYetException; | import br.com.codecode.workix.core.exceptions.*; | [
"br.com.codecode"
] | br.com.codecode; | 199,589 |
private void getLikelyFiles(IPath path, List<IFile> ret, IResource[] resources) throws CoreException {
String strPath = path.removeFileExtension().lastSegment().toLowerCase(); //this will return something as 'foo'
for (IResource resource : resources) {
if (resource instanceof IFile) {
IFile f = (IFile) resource;
if (PythonPathHelper.isValidSourceFile(f)) {
if (resource.getFullPath().removeFileExtension().lastSegment().toLowerCase().equals(strPath)) {
ret.add((IFile) resource);
}
}
} else if (resource instanceof IContainer) {
getLikelyFiles(path, ret, ((IContainer) resource).members());
}
}
} | void function(IPath path, List<IFile> ret, IResource[] resources) throws CoreException { String strPath = path.removeFileExtension().lastSegment().toLowerCase(); for (IResource resource : resources) { if (resource instanceof IFile) { IFile f = (IFile) resource; if (PythonPathHelper.isValidSourceFile(f)) { if (resource.getFullPath().removeFileExtension().lastSegment().toLowerCase().equals(strPath)) { ret.add((IFile) resource); } } } else if (resource instanceof IContainer) { getLikelyFiles(path, ret, ((IContainer) resource).members()); } } } | /**
* Used to recursively get the likely files given the first set of containers
*/ | Used to recursively get the likely files given the first set of containers | getLikelyFiles | {
"repo_name": "aptana/Pydev",
"path": "bundles/org.python.pydev/src/org/python/pydev/editorinput/PySourceLocatorBase.java",
"license": "epl-1.0",
"size": 20109
} | [
"java.util.List",
"org.eclipse.core.resources.IContainer",
"org.eclipse.core.resources.IFile",
"org.eclipse.core.resources.IResource",
"org.eclipse.core.runtime.CoreException",
"org.eclipse.core.runtime.IPath",
"org.python.pydev.editor.codecompletion.revisited.PythonPathHelper"
] | import java.util.List; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.python.pydev.editor.codecompletion.revisited.PythonPathHelper; | import java.util.*; import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*; import org.python.pydev.editor.codecompletion.revisited.*; | [
"java.util",
"org.eclipse.core",
"org.python.pydev"
] | java.util; org.eclipse.core; org.python.pydev; | 163,487 |
public String validaDatosPanel1(FacturaCompraEntity factura, Date fecha1, Date fecha2, ProveedoresEntity proveedor,
Integer idSede) {
String rta = "OK";
try {
if (fecha2 == null || fecha1 == null) {
rta = "ERROR, FECHAS NO VALIDAS";
} else if (factura.getNumeroFactura().isEmpty() || factura.getNumeroFactura() == "") {
rta = "ERROR, NUMERO DE FACTURA NO VALIDO";
} else if (proveedor == null || proveedor.getId() == null || proveedor.getId() == 0) {
rta = "ERROR, DEBE INGRESAR UN PROVEEDOR ";
} else if (idSede == null || idSede == -1 || idSede == 0) {
rta = "ERROR, DEBE INGRESAR UNA SEDE";
}
} catch (Exception e) {
e.printStackTrace();
rta = "ERROR, NO HA INGRESADO NINGUN DATO DE LA FACTURA";
}
return rta;
} | String function(FacturaCompraEntity factura, Date fecha1, Date fecha2, ProveedoresEntity proveedor, Integer idSede) { String rta = "OK"; try { if (fecha2 == null fecha1 == null) { rta = STR; } else if (factura.getNumeroFactura().isEmpty() factura.getNumeroFactura() == STRERROR, NUMERO DE FACTURA NO VALIDOSTRERROR, DEBE INGRESAR UN PROVEEDOR STRERROR, DEBE INGRESAR UNA SEDESTRERROR, NO HA INGRESADO NINGUN DATO DE LA FACTURA"; } return rta; } | /**
* funcion que verifica si los datos del panel 1 son correctos
*
* @param factura
* @param fecha1
* @param fecha2
* @param proveedor
* @return
*/ | funcion que verifica si los datos del panel 1 son correctos | validaDatosPanel1 | {
"repo_name": "codesoftware/NSIGEMCO",
"path": "src/main/java/co/com/codesoftware/logica/FacturaCompraLogica.java",
"license": "apache-2.0",
"size": 15512
} | [
"co.com.codesoftware.server.nsigemco.FacturaCompraEntity",
"co.com.codesoftware.server.nsigemco.ProveedoresEntity",
"java.util.Date"
] | import co.com.codesoftware.server.nsigemco.FacturaCompraEntity; import co.com.codesoftware.server.nsigemco.ProveedoresEntity; import java.util.Date; | import co.com.codesoftware.server.nsigemco.*; import java.util.*; | [
"co.com.codesoftware",
"java.util"
] | co.com.codesoftware; java.util; | 190,996 |
Set<TimelineMetric> getTimelineMetrics(); | Set<TimelineMetric> getTimelineMetrics(); | /**
* Counters or Metrics if any else return null.
*
* @return the set of timeline metrics
*/ | Counters or Metrics if any else return null | getTimelineMetrics | {
"repo_name": "dennishuo/hadoop",
"path": "hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/jobhistory/HistoryEvent.java",
"license": "apache-2.0",
"size": 1871
} | [
"java.util.Set",
"org.apache.hadoop.yarn.api.records.timelineservice.TimelineMetric"
] | import java.util.Set; import org.apache.hadoop.yarn.api.records.timelineservice.TimelineMetric; | import java.util.*; import org.apache.hadoop.yarn.api.records.timelineservice.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 315,100 |
public QueryTaskClientHelper<T> setUpdatedSince(long documentSinceUpdateTimeMicros) {
long nowMicrosUtc = Utils.getNowMicrosUtc();
if (nowMicrosUtc < documentSinceUpdateTimeMicros) {
throw new IllegalArgumentException(
"'documentSinceUpdateTimeMicros' must be in the past.");
}
Query query = Builder.create().addKindFieldClause(this.type)
.addClause(createUpdatedSinceTimeRange(documentSinceUpdateTimeMicros)).build();
QueryTask q = QueryTask.Builder.createDirectTask()
.addOption(QueryOption.EXPAND_CONTENT)
.addOption(QueryOption.INCLUDE_DELETED)
.setResultLimit(DEFAULT_QUERY_RESULT_LIMIT)
.setQuery(query).build();
setQueryTask(q);
return this;
} | QueryTaskClientHelper<T> function(long documentSinceUpdateTimeMicros) { long nowMicrosUtc = Utils.getNowMicrosUtc(); if (nowMicrosUtc < documentSinceUpdateTimeMicros) { throw new IllegalArgumentException( STR); } Query query = Builder.create().addKindFieldClause(this.type) .addClause(createUpdatedSinceTimeRange(documentSinceUpdateTimeMicros)).build(); QueryTask q = QueryTask.Builder.createDirectTask() .addOption(QueryOption.EXPAND_CONTENT) .addOption(QueryOption.INCLUDE_DELETED) .setResultLimit(DEFAULT_QUERY_RESULT_LIMIT) .setQuery(query).build(); setQueryTask(q); return this; } | /**
* Query for a list of expanded documents extending {@link ServiceDocument}s that
* are updated or deleted since given time in the past. The result will include
* both updated and deleted documents.
*
* @param documentSinceUpdateTimeMicros
* Indicating a time since the document was last updated matching the property
* {@link ServiceDocument#documentUpdateTimeMicros}.
*/ | Query for a list of expanded documents extending <code>ServiceDocument</code>s that are updated or deleted since given time in the past. The result will include both updated and deleted documents | setUpdatedSince | {
"repo_name": "toliaqat/xenon",
"path": "xenon-common/src/main/java/com/vmware/xenon/common/QueryTaskClientHelper.java",
"license": "apache-2.0",
"size": 19383
} | [
"com.vmware.xenon.services.common.QueryTask"
] | import com.vmware.xenon.services.common.QueryTask; | import com.vmware.xenon.services.common.*; | [
"com.vmware.xenon"
] | com.vmware.xenon; | 1,412,550 |
@Check
public void checkCyclesInDefinitionReferences(SubComponentDefinition subCompDef) {
// Get the parent
EObject container = subCompDef.eContainer();
while (!(container instanceof CompositeDefinition))
container = container.eContainer();
if (subCompDef.getType() instanceof CompositeDefinition) {
if (((CompositeDefinition) subCompDef.getType()).equals((CompositeDefinition) container))
error("Cycle in definition references", FractalPackage.Literals.SUB_COMPONENT_DEFINITION__TYPE);
}
}
| void function(SubComponentDefinition subCompDef) { EObject container = subCompDef.eContainer(); while (!(container instanceof CompositeDefinition)) container = container.eContainer(); if (subCompDef.getType() instanceof CompositeDefinition) { if (((CompositeDefinition) subCompDef.getType()).equals((CompositeDefinition) container)) error(STR, FractalPackage.Literals.SUB_COMPONENT_DEFINITION__TYPE); } } | /**
* Check Cycles in definition references
*/ | Check Cycles in definition references | checkCyclesInDefinitionReferences | {
"repo_name": "StephaneSeyvoz/mindEd",
"path": "org.ow2.mindEd.adl.textual/src/org/ow2/mindEd/adl/textual/validation/FractalJavaValidator.java",
"license": "lgpl-3.0",
"size": 14761
} | [
"org.eclipse.emf.ecore.EObject",
"org.ow2.mindEd.adl.textual.fractal.CompositeDefinition",
"org.ow2.mindEd.adl.textual.fractal.FractalPackage",
"org.ow2.mindEd.adl.textual.fractal.SubComponentDefinition"
] | import org.eclipse.emf.ecore.EObject; import org.ow2.mindEd.adl.textual.fractal.CompositeDefinition; import org.ow2.mindEd.adl.textual.fractal.FractalPackage; import org.ow2.mindEd.adl.textual.fractal.SubComponentDefinition; | import org.eclipse.emf.ecore.*; import org.ow2.*; | [
"org.eclipse.emf",
"org.ow2"
] | org.eclipse.emf; org.ow2; | 51,459 |
private void loadEquivalencingEngine() throws EquivalencerException {
if (paramEquivalencer == null) {
try {
paramEquivalencer = DefaultParameterEquivalencer.getInstance();
} catch (Exception e) {
throw new EquivalencerException(
"Unable to load equivalencing engine.", e);
}
}
} | void function() throws EquivalencerException { if (paramEquivalencer == null) { try { paramEquivalencer = DefaultParameterEquivalencer.getInstance(); } catch (Exception e) { throw new EquivalencerException( STR, e); } } } | /**
* Loads the {@link ParameterEquivalencer} if it has not already been
* loaded.
*
* @throws EquivalencerException Thrown if an error occurred loading the
* equivalencing engine.
*/ | Loads the <code>ParameterEquivalencer</code> if it has not already been loaded | loadEquivalencingEngine | {
"repo_name": "OpenBEL/openbel-framework",
"path": "org.openbel.framework.api/src/main/java/org/openbel/framework/api/Equivalencer.java",
"license": "apache-2.0",
"size": 12520
} | [
"org.openbel.framework.core.equivalence.DefaultParameterEquivalencer"
] | import org.openbel.framework.core.equivalence.DefaultParameterEquivalencer; | import org.openbel.framework.core.equivalence.*; | [
"org.openbel.framework"
] | org.openbel.framework; | 1,168,251 |
public void testJsonConstructor () {
JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
assertNotNull(Test.NOT_NULL, commandJson);
try {
Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
UpdateTurnList cmd = new UpdateTurnList(hash);
JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
assertNotNull(Test.NOT_NULL, body);
// Test everything in the json body.
assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, UpdateTurnList.KEY_SOFT_BUTTONS);
List<SoftButton> softButtonList = new ArrayList<SoftButton>();
for (int index = 0; index < softButtonArray.length(); index++) {
SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonArray.get(index)) );
softButtonList.add(chunk);
}
assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons()));
JSONArray turnArray = JsonUtils.readJsonArrayFromJsonObject(parameters, UpdateTurnList.KEY_TURN_LIST);
List<Turn> turnList = new ArrayList<Turn>();
for (int index = 0; index < turnArray.length(); index++) {
Turn chunk = new Turn(JsonRPCMarshaller.deserializeJSONObject((JSONObject) turnArray.get(index)));
if (chunk != null)
turnList.add(chunk);
}
assertTrue(Test.TRUE, Validator.validateTurnList(turnList, cmd.getTurnList()));
} catch (JSONException e) {
fail(Test.JSON_FAIL);
}
} | void function () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); assertNotNull(Test.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); UpdateTurnList cmd = new UpdateTurnList(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); assertNotNull(Test.NOT_NULL, body); assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, UpdateTurnList.KEY_SOFT_BUTTONS); List<SoftButton> softButtonList = new ArrayList<SoftButton>(); for (int index = 0; index < softButtonArray.length(); index++) { SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonArray.get(index)) ); softButtonList.add(chunk); } assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons())); JSONArray turnArray = JsonUtils.readJsonArrayFromJsonObject(parameters, UpdateTurnList.KEY_TURN_LIST); List<Turn> turnList = new ArrayList<Turn>(); for (int index = 0; index < turnArray.length(); index++) { Turn chunk = new Turn(JsonRPCMarshaller.deserializeJSONObject((JSONObject) turnArray.get(index))); if (chunk != null) turnList.add(chunk); } assertTrue(Test.TRUE, Validator.validateTurnList(turnList, cmd.getTurnList())); } catch (JSONException e) { fail(Test.JSON_FAIL); } } | /**
* Tests a valid JSON construction of this RPC message.
*/ | Tests a valid JSON construction of this RPC message | testJsonConstructor | {
"repo_name": "914802951/sdl_android",
"path": "sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UpdateTurnListTests.java",
"license": "bsd-3-clause",
"size": 4642
} | [
"com.smartdevicelink.marshal.JsonRPCMarshaller",
"com.smartdevicelink.proxy.RPCMessage",
"com.smartdevicelink.proxy.rpc.SoftButton",
"com.smartdevicelink.proxy.rpc.Turn",
"com.smartdevicelink.proxy.rpc.UpdateTurnList",
"com.smartdevicelink.test.JsonUtils",
"com.smartdevicelink.test.Test",
"com.smartdevicelink.test.Validator",
"com.smartdevicelink.test.json.rpc.JsonFileReader",
"java.util.ArrayList",
"java.util.Hashtable",
"java.util.List",
"org.json.JSONArray",
"org.json.JSONException",
"org.json.JSONObject"
] | import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.SoftButton; import com.smartdevicelink.proxy.rpc.Turn; import com.smartdevicelink.proxy.rpc.UpdateTurnList; import com.smartdevicelink.test.JsonUtils; import com.smartdevicelink.test.Test; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; | import com.smartdevicelink.marshal.*; import com.smartdevicelink.proxy.*; import com.smartdevicelink.proxy.rpc.*; import com.smartdevicelink.test.*; import com.smartdevicelink.test.json.rpc.*; import java.util.*; import org.json.*; | [
"com.smartdevicelink.marshal",
"com.smartdevicelink.proxy",
"com.smartdevicelink.test",
"java.util",
"org.json"
] | com.smartdevicelink.marshal; com.smartdevicelink.proxy; com.smartdevicelink.test; java.util; org.json; | 1,661,992 |
public Range getHeightRange() {
return this.heightRange;
}
| Range function() { return this.heightRange; } | /**
* Returns the width range.
*
* @return The range (possibly <code>null</code>).
*/ | Returns the width range | getHeightRange | {
"repo_name": "ilyessou/jfreechart",
"path": "source/org/jfree/chart/block/RectangleConstraint.java",
"license": "lgpl-2.1",
"size": 12216
} | [
"org.jfree.data.Range"
] | import org.jfree.data.Range; | import org.jfree.data.*; | [
"org.jfree.data"
] | org.jfree.data; | 106,723 |
private void setContentView(View view) {
mContentView = view;
} | void function(View view) { mContentView = view; } | /**
* Set up contentView which will be moved by user gesture
*
* @param view
*/ | Set up contentView which will be moved by user gesture | setContentView | {
"repo_name": "yanyongshan/SimplifyReader",
"path": "library/src/main/java/com/github/obsessive/library/swipeback/SwipeBackLayout.java",
"license": "apache-2.0",
"size": 17825
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 1,712,799 |
private boolean updateUiForKey(String configKey, int color) {
if (configKey.equals(DigitalWatchFaceUtil.KEY_BACKGROUND_COLOR)) {
setInteractiveBackgroundColor(color);
} else if (configKey.equals(DigitalWatchFaceUtil.KEY_HOURS_COLOR)) {
setInteractiveHourDigitsColor(color);
} else if (configKey.equals(DigitalWatchFaceUtil.KEY_MINUTES_COLOR)) {
setInteractiveMinuteDigitsColor(color);
} else if (configKey.equals(DigitalWatchFaceUtil.KEY_SECONDS_COLOR)) {
setInteractiveSecondDigitsColor(color);
} else {
Log.w(TAG, "Ignoring unknown config key: " + configKey);
return false;
}
return true;
} | boolean function(String configKey, int color) { if (configKey.equals(DigitalWatchFaceUtil.KEY_BACKGROUND_COLOR)) { setInteractiveBackgroundColor(color); } else if (configKey.equals(DigitalWatchFaceUtil.KEY_HOURS_COLOR)) { setInteractiveHourDigitsColor(color); } else if (configKey.equals(DigitalWatchFaceUtil.KEY_MINUTES_COLOR)) { setInteractiveMinuteDigitsColor(color); } else if (configKey.equals(DigitalWatchFaceUtil.KEY_SECONDS_COLOR)) { setInteractiveSecondDigitsColor(color); } else { Log.w(TAG, STR + configKey); return false; } return true; } | /**
* Updates the color of a UI item according to the given {@code configKey}. Does nothing if
* {@code configKey} isn't recognized.
*
* @return whether UI has been updated
*/ | Updates the color of a UI item according to the given configKey. Does nothing if configKey isn't recognized | updateUiForKey | {
"repo_name": "reichfrancois/android-watchface",
"path": "Wearable/src/main/java/com/cheetahtechnologies/android/wearable/watchface/DigitalWatchFaceService.java",
"license": "apache-2.0",
"size": 25113
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 2,212,608 |
public FileStatus[] listStatus(Path f, PathFilter filter)
throws AccessControlException, FileNotFoundException,
UnsupportedFileSystemException, IOException {
ArrayList<FileStatus> results = new ArrayList<FileStatus>();
listStatus(results, f, filter);
return results.toArray(new FileStatus[results.size()]);
} | FileStatus[] function(Path f, PathFilter filter) throws AccessControlException, FileNotFoundException, UnsupportedFileSystemException, IOException { ArrayList<FileStatus> results = new ArrayList<FileStatus>(); listStatus(results, f, filter); return results.toArray(new FileStatus[results.size()]); } | /**
* Filter files/directories in the given path using the user-supplied path
* filter.
*
* @param f is the path name
* @param filter is the user-supplied path filter
*
* @return an array of FileStatus objects for the files under the given path
* after applying the filter
*
* @throws AccessControlException If access is denied
* @throws FileNotFoundException If <code>f</code> does not exist
* @throws UnsupportedFileSystemException If file system for
* <code>pathPattern</code> is not supported
* @throws IOException If an I/O error occurred
*
* Exceptions applicable to file systems accessed over RPC:
* @throws RpcClientException If an exception occurred in the RPC client
* @throws RpcServerException If an exception occurred in the RPC server
* @throws UnexpectedServerException If server implementation throws
* undeclared exception to RPC server
*/ | Filter files/directories in the given path using the user-supplied path filter | listStatus | {
"repo_name": "dotunolafunmiloye/hadoop-common",
"path": "src/java/org/apache/hadoop/fs/FileContext.java",
"license": "apache-2.0",
"size": 90172
} | [
"java.io.FileNotFoundException",
"java.io.IOException",
"java.util.ArrayList",
"org.apache.hadoop.security.AccessControlException"
] | import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import org.apache.hadoop.security.AccessControlException; | import java.io.*; import java.util.*; import org.apache.hadoop.security.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 413,197 |
public CmsObject obtainCmsObject() {
return m_cms;
} | CmsObject function() { return m_cms; } | /**
* Returns the wrapped OpenCms user context.<p>
*
* Note that this will return <code>null</code> when {@link #getExists()} returns <code>false</code>.
*
* @return the wrapped OpenCms user context
*/ | Returns the wrapped OpenCms user context. Note that this will return <code>null</code> when <code>#getExists()</code> returns <code>false</code> | obtainCmsObject | {
"repo_name": "mediaworx/opencms-core",
"path": "src/org/opencms/jsp/util/CmsJspContentAccessValueWrapper.java",
"license": "lgpl-2.1",
"size": 31107
} | [
"org.opencms.file.CmsObject"
] | import org.opencms.file.CmsObject; | import org.opencms.file.*; | [
"org.opencms.file"
] | org.opencms.file; | 1,938,744 |
public void setDocument(Document document) {
this.document = document;
} | void function(Document document) { this.document = document; } | /**
* Set the source document of this event document
*
* @param document
* Source document of this event document
*/ | Set the source document of this event document | setDocument | {
"repo_name": "Novanoid/Tourney",
"path": "Application/src/usspg31/tourney/model/filemanagement/TournamentModuleDocument.java",
"license": "gpl-3.0",
"size": 13754
} | [
"org.w3c.dom.Document"
] | import org.w3c.dom.Document; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 2,514,071 |
@Override
public FloatVector getOutput(FloatVector instance) {
Preconditions.checkArgument((this.layerSizeList.get(0) - 1) * this.recurrentStepSize
== instance.getDimension(), String.format(
"The dimension of input instance should be %d.",
this.layerSizeList.get(0) - 1));
// transform the features to another space
FloatVector transformedInstance = this.featureTransformer
.transform(instance);
// add bias feature
FloatVector instanceWithBias = new DenseFloatVector(
transformedInstance.getDimension() + 1);
instanceWithBias.set(0, 0.99999f); // set bias to be a little bit less than
// 1.0
for (int i = 1; i < instanceWithBias.getDimension(); ++i) {
instanceWithBias.set(i, transformedInstance.get(i - 1));
}
// return the output of the last layer
return getOutputInternal(instanceWithBias);
} | FloatVector function(FloatVector instance) { Preconditions.checkArgument((this.layerSizeList.get(0) - 1) * this.recurrentStepSize == instance.getDimension(), String.format( STR, this.layerSizeList.get(0) - 1)); FloatVector transformedInstance = this.featureTransformer .transform(instance); FloatVector instanceWithBias = new DenseFloatVector( transformedInstance.getDimension() + 1); instanceWithBias.set(0, 0.99999f); for (int i = 1; i < instanceWithBias.getDimension(); ++i) { instanceWithBias.set(i, transformedInstance.get(i - 1)); } return getOutputInternal(instanceWithBias); } | /**
* Get the output of the model according to given feature instance.
*/ | Get the output of the model according to given feature instance | getOutput | {
"repo_name": "edwardyoon/incubator-horn",
"path": "src/main/java/org/apache/horn/core/RecurrentLayeredNeuralNetwork.java",
"license": "apache-2.0",
"size": 39066
} | [
"com.google.common.base.Preconditions",
"org.apache.hama.commons.math.DenseFloatVector",
"org.apache.hama.commons.math.FloatVector"
] | import com.google.common.base.Preconditions; import org.apache.hama.commons.math.DenseFloatVector; import org.apache.hama.commons.math.FloatVector; | import com.google.common.base.*; import org.apache.hama.commons.math.*; | [
"com.google.common",
"org.apache.hama"
] | com.google.common; org.apache.hama; | 177,485 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.