id_within_dataset int64 0 69.7k | snippet stringlengths 10 23k | tokens listlengths 5 4.23k | nl stringlengths 15 2.45k | split_within_dataset stringclasses 1
value | is_duplicated bool 2
classes |
|---|---|---|---|---|---|
69,656 | public Map<String,Object> flattenAsMap(){
if (flattenedMap != null) return flattenedMap;
flattenedMap=newJsonifyLinkedHashMap();
reduce(source);
while (!elementIters.isEmpty()) {
IndexedPeekIterator<?> deepestIter=elementIters.getLast();
if (!deepestIter.hasNext()) {
elementIters.removeLast();
... | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"flattenAsMap",
"(",
")",
"{",
"if",
"(",
"flattenedMap",
"!=",
"null",
")",
"return",
"flattenedMap",
";",
"flattenedMap",
"=",
"newJsonifyLinkedHashMap",
"(",
")",
";",
"reduce",
"(",
"source",
")",
";"... | returns a flattened json as map .
| train | true |
69,658 | public Object readObject() throws IOException {
int tag=read();
switch (tag) {
case 'N':
return null;
case 'T':
return Boolean.valueOf(true);
case 'F':
return Boolean.valueOf(false);
case 'I':
return Integer.valueOf(parseInt());
case 'L':
return Long.valueOf(parseLong());
case 'D':
return Double.valueOf(parseDo... | [
"public",
"Object",
"readObject",
"(",
")",
"throws",
"IOException",
"{",
"int",
"tag",
"=",
"read",
"(",
")",
";",
"switch",
"(",
"tag",
")",
"{",
"case",
"'N'",
":",
"return",
"null",
";",
"case",
"'T'",
":",
"return",
"Boolean",
".",
"valueOf",
"(... | reads an arbitrary object from the input stream when the type is unknown .
| train | true |
69,661 | @Override public String toString(){
return "Dirichlet(" + Arrays.asList(alphas) + ")";
}
| [
"@",
"Override",
"public",
"String",
"toString",
"(",
")",
"{",
"return",
"\"Dirichlet(\"",
"+",
"Arrays",
".",
"asList",
"(",
"alphas",
")",
"+",
"\")\"",
";",
"}"
] | returns the name and hyper - parameters of the distribution
| train | false |
69,664 | public Epoch createEpoch(ServerViewController recManager){
epochsLock.lock();
Set<Integer> keys=epochs.keySet();
int max=-1;
for ( int k : keys) {
if (k > max) max=k;
}
max++;
Epoch epoch=new Epoch(recManager,this,max);
epochs.put(max,epoch);
epochsLock.unlock();
return epoch;
}
| [
"public",
"Epoch",
"createEpoch",
"(",
"ServerViewController",
"recManager",
")",
"{",
"epochsLock",
".",
"lock",
"(",
")",
";",
"Set",
"<",
"Integer",
">",
"keys",
"=",
"epochs",
".",
"keySet",
"(",
")",
";",
"int",
"max",
"=",
"-",
"1",
";",
"for",
... | creates a epoch associated with this consensus , supposedly the next
| train | false |
69,666 | public static String fileBuilderUrl(String baseUri,String seed,byte[] signatureSecret,long fileId,long fileAccessHash){
byte[] seedBytes=decodeHex(seed.toCharArray());
byte[] fileIdBytes=getBytes(fileId);
byte[] accessHashBytes=getBytes(fileAccessHash);
byte[] bytesToSign=ArrayUtils.addAll(ArrayUtils.addAll(see... | [
"public",
"static",
"String",
"fileBuilderUrl",
"(",
"String",
"baseUri",
",",
"String",
"seed",
",",
"byte",
"[",
"]",
"signatureSecret",
",",
"long",
"fileId",
",",
"long",
"fileAccessHash",
")",
"{",
"byte",
"[",
"]",
"seedBytes",
"=",
"decodeHex",
"(",
... | returns url with calculated signature for specific file with specific file builder parameters
| train | false |
69,668 | protected void addNonMatch(StringBuilder sb,String text){
sb.append(text);
}
| [
"protected",
"void",
"addNonMatch",
"(",
"StringBuilder",
"sb",
",",
"String",
"text",
")",
"{",
"sb",
".",
"append",
"(",
"text",
")",
";",
"}"
] | called while highlighting a single result , to append a non - matching chunk of text from the suggestion to the provided fragments list .
| train | false |
69,669 | public CertificateToken(X509Certificate x509Certificate){
if (x509Certificate == null) {
throw new NullPointerException("X509 certificate is missing");
}
this.x509Certificate=x509Certificate;
this.issuerX500Principal=x509Certificate.getIssuerX500Principal();
this.signatureAlgorithm=SignatureAlgorithm.forO... | [
"public",
"CertificateToken",
"(",
"X509Certificate",
"x509Certificate",
")",
"{",
"if",
"(",
"x509Certificate",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"X509 certificate is missing\"",
")",
";",
"}",
"this",
".",
"x509Certificate",
"=... | creates a certificatetoken wrapping the provided x509certificate .
| train | false |
69,670 | private PlatformTarget createPlatformCache(IgniteCacheProxy cache){
return new PlatformCache(platformCtx,cache,false,cacheExts);
}
| [
"private",
"PlatformTarget",
"createPlatformCache",
"(",
"IgniteCacheProxy",
"cache",
")",
"{",
"return",
"new",
"PlatformCache",
"(",
"platformCtx",
",",
"cache",
",",
"false",
",",
"cacheExts",
")",
";",
"}"
] | creates new platform cache .
| train | false |
69,671 | public List<Class<?>> findAvailableImplementations(Class<?> interfase) throws IOException {
_resourcesNotLoaded.clear();
List<Class<?>> implementations=new ArrayList<>();
List<String> strings=findAvailableStrings(interfase.getName());
for ( String className : strings) {
try {
Class<?> impl=_classLoad... | [
"public",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"findAvailableImplementations",
"(",
"Class",
"<",
"?",
">",
"interfase",
")",
"throws",
"IOException",
"{",
"_resourcesNotLoaded",
".",
"clear",
"(",
")",
";",
"List",
"<",
"Class",
"<",
"?",
">",
">",... | assumes the class specified points to a file in the classpath that contains the name of a class that implements or is a subclass of the specfied class . < p / > any class that cannot be loaded or are not assignable to the specified class will be skipped and placed in the ' resourcesnotloaded ' collection . < p / > exam... | train | true |
69,673 | public static void isCIDR(String network) throws IllegalArgumentException {
String[] hostMask=network.split("/");
if (hostMask.length != 2) {
throw new IllegalArgumentException("subnetAddress is not a CIDR");
}
isValidInetAddress(hostMask[0]);
if (Integer.parseUnsignedInt(hostMask[1]) > 32) {
throw ne... | [
"public",
"static",
"void",
"isCIDR",
"(",
"String",
"network",
")",
"throws",
"IllegalArgumentException",
"{",
"String",
"[",
"]",
"hostMask",
"=",
"network",
".",
"split",
"(",
"\"/\"",
")",
";",
"if",
"(",
"hostMask",
".",
"length",
"!=",
"2",
")",
"{... | verify if cidr string is a valid cidr address .
| train | false |
69,674 | private void synchronize(){
s_logger.log(Level.INFO,"");
s_logger.log(Level.INFO,"migrateSynchronize");
if (isUpgrade()) {
dropDBObjects(DBObject_Check.class);
dropDBObjects(DBObject_Unique.class);
dropDBObjects(DBObject_ForeignKey.class);
dropDBObjects(DBObject_View.class);
dropDBObjects(DBOb... | [
"private",
"void",
"synchronize",
"(",
")",
"{",
"s_logger",
".",
"log",
"(",
"Level",
".",
"INFO",
",",
"\"\"",
")",
";",
"s_logger",
".",
"log",
"(",
"Level",
".",
"INFO",
",",
"\"migrateSynchronize\"",
")",
";",
"if",
"(",
"isUpgrade",
"(",
")",
"... | synchronize target from source
| train | false |
69,676 | public static long[] shiftRightI(long[] v,int off){
if (off == 0) {
return v;
}
if (off < 0) {
return shiftLeftI(v,-off);
}
final int shiftWords=off >>> LONG_LOG2_SIZE;
final int shiftBits=off & LONG_LOG2_MASK;
if (shiftWords >= v.length) {
return zeroI(v);
}
if (shiftBits == 0) {
Syst... | [
"public",
"static",
"long",
"[",
"]",
"shiftRightI",
"(",
"long",
"[",
"]",
"v",
",",
"int",
"off",
")",
"{",
"if",
"(",
"off",
"==",
"0",
")",
"{",
"return",
"v",
";",
"}",
"if",
"(",
"off",
"<",
"0",
")",
"{",
"return",
"shiftLeftI",
"(",
"... | shift a long [ ] bitset inplace . low - endian layout for the array .
| train | true |
69,679 | @Override public Grammar loadGrammar(XMLInputSource source) throws IOException, XNIException {
reset(fLoaderConfig);
fSettingsChanged=false;
XSDDescription desc=new XSDDescription();
desc.fContextType=XSDDescription.CONTEXT_PREPARSE;
desc.setBaseSystemId(source.getBaseSystemId());
desc.setLiteralSystemId(so... | [
"@",
"Override",
"public",
"Grammar",
"loadGrammar",
"(",
"XMLInputSource",
"source",
")",
"throws",
"IOException",
",",
"XNIException",
"{",
"reset",
"(",
"fLoaderConfig",
")",
";",
"fSettingsChanged",
"=",
"false",
";",
"XSDDescription",
"desc",
"=",
"new",
"X... | returns a grammar object by parsing the contents of the entity pointed to by source .
| train | false |
69,680 | public void interrupt(){
if (m_pstmt != null) {
try {
m_pstmt.cancel();
close();
}
catch ( SQLException e) {
log.log(Level.SEVERE,"Cannot cancel SQL statement",e);
}
}
super.interrupt();
}
| [
"public",
"void",
"interrupt",
"(",
")",
"{",
"if",
"(",
"m_pstmt",
"!=",
"null",
")",
"{",
"try",
"{",
"m_pstmt",
".",
"cancel",
"(",
")",
";",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"SQLException",
"e",
")",
"{",
"log",
".",
"log",
"(",
"... | interrupt this thread - cancel the query if still in execution carlos ruiz - globalqss - [ 2826660 ] - info product performance big problem
| train | false |
69,681 | private boolean hasNextPostponed(){
return !postponedRoutes.isEmpty();
}
| [
"private",
"boolean",
"hasNextPostponed",
"(",
")",
"{",
"return",
"!",
"postponedRoutes",
".",
"isEmpty",
"(",
")",
";",
"}"
] | returns true if there is another postponed route to try .
| train | false |
69,683 | protected void cleanupSuspendState(DLockRequestMessage request){
postReleaseLock(request.getRemoteThread(),request.getObjectName());
}
| [
"protected",
"void",
"cleanupSuspendState",
"(",
"DLockRequestMessage",
"request",
")",
"{",
"postReleaseLock",
"(",
"request",
".",
"getRemoteThread",
"(",
")",
",",
"request",
".",
"getObjectName",
"(",
")",
")",
";",
"}"
] | departure or other codepath not specific to unlock requires that we cleanup suspend state that was already permitted to request . this needs to be invoked for both regular and suspend locks . < p > synchronizes on suspendlock .
| train | false |
69,684 | public void initDiskCache(){
synchronized (mDiskCacheLock) {
if (mDiskLruCache == null || mDiskLruCache.isClosed()) {
File diskCacheDir=mCacheParams.diskCacheDir;
if (mCacheParams.diskCacheEnabled && diskCacheDir != null) {
if (!diskCacheDir.exists()) {
diskCacheDir.mkdirs();
}... | [
"public",
"void",
"initDiskCache",
"(",
")",
"{",
"synchronized",
"(",
"mDiskCacheLock",
")",
"{",
"if",
"(",
"mDiskLruCache",
"==",
"null",
"||",
"mDiskLruCache",
".",
"isClosed",
"(",
")",
")",
"{",
"File",
"diskCacheDir",
"=",
"mCacheParams",
".",
"diskCa... | initializes the disk cache . note that this includes disk access so this should not be executed on the main / ui thread . by default an imagecache does not initialize the disk cache when it is created , instead you should call initdiskcache ( ) to initialize it on a background thread .
| train | false |
69,685 | public static void cassandraSetupComplete(){
lock.countDown();
}
| [
"public",
"static",
"void",
"cassandraSetupComplete",
"(",
")",
"{",
"lock",
".",
"countDown",
"(",
")",
";",
"}"
] | this method is supposed to be called from within the cassandradaemon advice to signal that cassandra setup process is completed .
| train | false |
69,686 | public int compareTo(Object other){
@SuppressWarnings("unchecked") Ranking<V> otherRanking=(Ranking<V>)other;
return Double.compare(otherRanking.rankScore,rankScore);
}
| [
"public",
"int",
"compareTo",
"(",
"Object",
"other",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"Ranking",
"<",
"V",
">",
"otherRanking",
"=",
"(",
"Ranking",
"<",
"V",
">",
")",
"other",
";",
"return",
"Double",
".",
"compare",
"(",
... | compares two ranking based on the rank score .
| train | false |
69,687 | public MecanumDrive(Motor leftFront,Motor leftRear,Motor rightFront,Motor rightRear,AngleSensor gyro){
this(leftFront,leftRear,rightFront,rightRear,gyro,null);
}
| [
"public",
"MecanumDrive",
"(",
"Motor",
"leftFront",
",",
"Motor",
"leftRear",
",",
"Motor",
"rightFront",
",",
"Motor",
"rightRear",
",",
"AngleSensor",
"gyro",
")",
"{",
"this",
"(",
"leftFront",
",",
"leftRear",
",",
"rightFront",
",",
"rightRear",
",",
"... | creates a new drivesystem subsystem that uses the supplied drive train and no shifter . the voltage send to the drive train is limited to [ - 1 . 0 , 1 . 0 ] .
| train | false |
69,688 | public ExampleSourceConfigurationWizard(ConfigurationListener listener){
super("Example Source Wizard",listener);
dataViewPane.setVisible(false);
addTitleStep();
addDataLoadingStep();
addColumnSeparatorStep();
addNameDefinitionStep();
addValueTypeDefinitionStep();
addAttributeTypeDefinitionStep();
add... | [
"public",
"ExampleSourceConfigurationWizard",
"(",
"ConfigurationListener",
"listener",
")",
"{",
"super",
"(",
"\"Example Source Wizard\"",
",",
"listener",
")",
";",
"dataViewPane",
".",
"setVisible",
"(",
"false",
")",
";",
"addTitleStep",
"(",
")",
";",
"addData... | creates a new wizard .
| train | false |
69,689 | int curveProgressToScreenY(float p){
if (p < 0 || p > 1) return mStackVisibleRect.top + (int)(p * mStackVisibleRect.height());
float pIndex=p * PrecisionSteps;
int pFloorIndex=(int)Math.floor(pIndex);
int pCeilIndex=(int)Math.ceil(pIndex);
float xFraction=0;
if (pFloorIndex < PrecisionSteps && (pCeilIndex... | [
"int",
"curveProgressToScreenY",
"(",
"float",
"p",
")",
"{",
"if",
"(",
"p",
"<",
"0",
"||",
"p",
">",
"1",
")",
"return",
"mStackVisibleRect",
".",
"top",
"+",
"(",
"int",
")",
"(",
"p",
"*",
"mStackVisibleRect",
".",
"height",
"(",
")",
")",
";"... | converts from the progress along the curve to a screen coordinate .
| train | false |
69,690 | static Profile decode(final String info){
String[] params;
Profile profile;
String s;
params=info.split("\n");
profile=new Profile();
if (params.length > 0) {
s=params[0];
for ( final String host : OLD_SERVER_HOSTS) {
if (s.equals(host)) {
s=NEW_SERVER_HOST;
break;
}
... | [
"static",
"Profile",
"decode",
"(",
"final",
"String",
"info",
")",
"{",
"String",
"[",
"]",
"params",
";",
"Profile",
"profile",
";",
"String",
"s",
";",
"params",
"=",
"info",
".",
"split",
"(",
"\"\\n\"",
")",
";",
"profile",
"=",
"new",
"Profile",
... | decode a login profile from a string .
| train | false |
69,691 | public static Map<String,Object> testSOAPService(DispatchContext dctx,Map<String,?> context){
Delegator delegator=dctx.getDelegator();
Map<String,Object> response=ServiceUtil.returnSuccess();
List<GenericValue> testingNodes=new LinkedList<GenericValue>();
for (int i=0; i < 3; i++) {
GenericValue testingNode... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"testSOAPService",
"(",
"DispatchContext",
"dctx",
",",
"Map",
"<",
"String",
",",
"?",
">",
"context",
")",
"{",
"Delegator",
"delegator",
"=",
"dctx",
".",
"getDelegator",
"(",
")",
";",
"Ma... | generic test soap service
| train | false |
69,692 | public void writeAll(ResultSet rs,boolean includeColumnNames) throws SQLException, IOException {
if (includeColumnNames) {
writeColumnNames(rs);
}
while (rs.next()) {
writeNext(resultService.getColumnValues(rs));
}
}
| [
"public",
"void",
"writeAll",
"(",
"ResultSet",
"rs",
",",
"boolean",
"includeColumnNames",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"if",
"(",
"includeColumnNames",
")",
"{",
"writeColumnNames",
"(",
"rs",
")",
";",
"}",
"while",
"(",
"rs",
"... | writes the entire resultset to a csv file . the caller is responsible for closing the resultset .
| train | true |
69,693 | public static void disableConnectionReuseIfNecessary(){
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) {
System.setProperty("http.keepAlive","false");
}
}
| [
"public",
"static",
"void",
"disableConnectionReuseIfNecessary",
"(",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
"<",
"Build",
".",
"VERSION_CODES",
".",
"FROYO",
")",
"{",
"System",
".",
"setProperty",
"(",
"\"http.keepAlive\"",
",",
"\"fal... | workaround for bug pre - froyo , see here for more info : http : / / android - developers . blogspot . com / 2011 / 09 / androids - http - clients . html
| train | false |
69,694 | private void updateRatingChoice(){
int current=m_chRating.getSelectedIndex();
m_chRating.removeAllItems();
FactionRecord fRec=(FactionRecord)m_chSubfaction.getSelectedItem();
if (fRec == null) {
fRec=(FactionRecord)m_chFaction.getSelectedItem();
}
ArrayList<String> ratingLevels=fRec.getRatingLevels();
... | [
"private",
"void",
"updateRatingChoice",
"(",
")",
"{",
"int",
"current",
"=",
"m_chRating",
".",
"getSelectedIndex",
"(",
")",
";",
"m_chRating",
".",
"removeAllItems",
"(",
")",
";",
"FactionRecord",
"fRec",
"=",
"(",
"FactionRecord",
")",
"m_chSubfaction",
... | when faction or subfaction is changed , refresh ratings combo box with appropriate values for selected faction .
| train | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.