repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
cpollet/jixture | core/src/main/java/net/cpollet/jixture/fixtures/capacities/cleaning/CleanableFixtureProxy.java | CleanableFixtureProxy.getClassesToDeleteIterator | @Override
public Iterator<Class> getClassesToDeleteIterator() {
if (fixture instanceof CleanableFixture) {
return cleanableFixture().getClassesToDeleteIterator();
}
return Collections.<Class>emptyList().iterator();
} | java | @Override
public Iterator<Class> getClassesToDeleteIterator() {
if (fixture instanceof CleanableFixture) {
return cleanableFixture().getClassesToDeleteIterator();
}
return Collections.<Class>emptyList().iterator();
} | [
"@",
"Override",
"public",
"Iterator",
"<",
"Class",
">",
"getClassesToDeleteIterator",
"(",
")",
"{",
"if",
"(",
"fixture",
"instanceof",
"CleanableFixture",
")",
"{",
"return",
"cleanableFixture",
"(",
")",
".",
"getClassesToDeleteIterator",
"(",
")",
";",
"}"... | Returns an ordered iterator of mapping classes to delete from database.
@return an ordered iterator of mapping classes to delete from database. | [
"Returns",
"an",
"ordered",
"iterator",
"of",
"mapping",
"classes",
"to",
"delete",
"from",
"database",
"."
] | faef0d4991f81c2cdb5be3ba24176636ef0cc433 | https://github.com/cpollet/jixture/blob/faef0d4991f81c2cdb5be3ba24176636ef0cc433/core/src/main/java/net/cpollet/jixture/fixtures/capacities/cleaning/CleanableFixtureProxy.java#L53-L60 | train |
GoodforGod/dummymaker | src/main/java/io/dummymaker/export/impl/CsvExporter.java | CsvExporter.buildCsvValue | private String buildCsvValue(final Field field,
final String fieldValue) {
return (areTextValuesWrapped && field.getType().equals(String.class)
|| isValueWrappable.test(fieldValue))
? wrapWithQuotes(fieldValue)
: fieldValue;
... | java | private String buildCsvValue(final Field field,
final String fieldValue) {
return (areTextValuesWrapped && field.getType().equals(String.class)
|| isValueWrappable.test(fieldValue))
? wrapWithQuotes(fieldValue)
: fieldValue;
... | [
"private",
"String",
"buildCsvValue",
"(",
"final",
"Field",
"field",
",",
"final",
"String",
"fieldValue",
")",
"{",
"return",
"(",
"areTextValuesWrapped",
"&&",
"field",
".",
"getType",
"(",
")",
".",
"equals",
"(",
"String",
".",
"class",
")",
"||",
"is... | Build correct final export field value in CSV format
Check for wrap option for field value
@param field export field
@param fieldValue export field value
@return final export field value | [
"Build",
"correct",
"final",
"export",
"field",
"value",
"in",
"CSV",
"format",
"Check",
"for",
"wrap",
"option",
"for",
"field",
"value"
] | a4809c0a8139ab9cdb42814a3e37772717a313b4 | https://github.com/GoodforGod/dummymaker/blob/a4809c0a8139ab9cdb42814a3e37772717a313b4/src/main/java/io/dummymaker/export/impl/CsvExporter.java#L127-L135 | train |
GoodforGod/dummymaker | src/main/java/io/dummymaker/export/impl/CsvExporter.java | CsvExporter.generateCsvHeader | private String generateCsvHeader(final IClassContainer container) {
final String separatorAsStr = String.valueOf(separator);
return container.getFormatSupported(Format.CSV).entrySet().stream()
.map(e -> e.getValue().getExportName())
.collect(Collectors.joining(separatorAs... | java | private String generateCsvHeader(final IClassContainer container) {
final String separatorAsStr = String.valueOf(separator);
return container.getFormatSupported(Format.CSV).entrySet().stream()
.map(e -> e.getValue().getExportName())
.collect(Collectors.joining(separatorAs... | [
"private",
"String",
"generateCsvHeader",
"(",
"final",
"IClassContainer",
"container",
")",
"{",
"final",
"String",
"separatorAsStr",
"=",
"String",
".",
"valueOf",
"(",
"separator",
")",
";",
"return",
"container",
".",
"getFormatSupported",
"(",
"Format",
".",
... | Generates header for CSV file
@return csv header | [
"Generates",
"header",
"for",
"CSV",
"file"
] | a4809c0a8139ab9cdb42814a3e37772717a313b4 | https://github.com/GoodforGod/dummymaker/blob/a4809c0a8139ab9cdb42814a3e37772717a313b4/src/main/java/io/dummymaker/export/impl/CsvExporter.java#L142-L147 | train |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/SyntacticCategory.java | SyntacticCategory.assignFeatures | public SyntacticCategory assignFeatures(Map<Integer, String> assignedFeatures,
Map<Integer, Integer> relabeledFeatures) {
String newFeatureValue = featureValue;
int newFeatureVariable = featureVariable;
if (assignedFeatures.containsKey(featureVariable)) {
newFeatureValue = assignedFeatures.get(f... | java | public SyntacticCategory assignFeatures(Map<Integer, String> assignedFeatures,
Map<Integer, Integer> relabeledFeatures) {
String newFeatureValue = featureValue;
int newFeatureVariable = featureVariable;
if (assignedFeatures.containsKey(featureVariable)) {
newFeatureValue = assignedFeatures.get(f... | [
"public",
"SyntacticCategory",
"assignFeatures",
"(",
"Map",
"<",
"Integer",
",",
"String",
">",
"assignedFeatures",
",",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"relabeledFeatures",
")",
"{",
"String",
"newFeatureValue",
"=",
"featureValue",
";",
"int",
"ne... | Assigns values to or relabels feature variables in this category.
@param assignedFeatures
@param relabeledFeatures
@return | [
"Assigns",
"values",
"to",
"or",
"relabels",
"feature",
"variables",
"in",
"this",
"category",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/SyntacticCategory.java#L273-L291 | train |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/SyntacticCategory.java | SyntacticCategory.assignAllFeatures | public SyntacticCategory assignAllFeatures(String value) {
Set<Integer> featureVars = Sets.newHashSet();
getAllFeatureVariables(featureVars);
Map<Integer, String> valueMap = Maps.newHashMap();
for (Integer var : featureVars) {
valueMap.put(var, value);
}
return assignFeatures(valueMap, Co... | java | public SyntacticCategory assignAllFeatures(String value) {
Set<Integer> featureVars = Sets.newHashSet();
getAllFeatureVariables(featureVars);
Map<Integer, String> valueMap = Maps.newHashMap();
for (Integer var : featureVars) {
valueMap.put(var, value);
}
return assignFeatures(valueMap, Co... | [
"public",
"SyntacticCategory",
"assignAllFeatures",
"(",
"String",
"value",
")",
"{",
"Set",
"<",
"Integer",
">",
"featureVars",
"=",
"Sets",
".",
"newHashSet",
"(",
")",
";",
"getAllFeatureVariables",
"(",
"featureVars",
")",
";",
"Map",
"<",
"Integer",
",",
... | Assigns value to all unfilled feature variables.
@param value
@return | [
"Assigns",
"value",
"to",
"all",
"unfilled",
"feature",
"variables",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/SyntacticCategory.java#L299-L308 | train |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/SyntacticCategory.java | SyntacticCategory.getWithoutFeatures | public SyntacticCategory getWithoutFeatures() {
if (isAtomic()) {
return createAtomic(value, DEFAULT_FEATURE_VALUE, -1);
} else {
return createFunctional(getDirection(), returnType.getWithoutFeatures(),
argumentType.getWithoutFeatures());
}
} | java | public SyntacticCategory getWithoutFeatures() {
if (isAtomic()) {
return createAtomic(value, DEFAULT_FEATURE_VALUE, -1);
} else {
return createFunctional(getDirection(), returnType.getWithoutFeatures(),
argumentType.getWithoutFeatures());
}
} | [
"public",
"SyntacticCategory",
"getWithoutFeatures",
"(",
")",
"{",
"if",
"(",
"isAtomic",
"(",
")",
")",
"{",
"return",
"createAtomic",
"(",
"value",
",",
"DEFAULT_FEATURE_VALUE",
",",
"-",
"1",
")",
";",
"}",
"else",
"{",
"return",
"createFunctional",
"(",... | Get a syntactic category identical to this one except with all
feature values replaced by the default value.
@return | [
"Get",
"a",
"syntactic",
"category",
"identical",
"to",
"this",
"one",
"except",
"with",
"all",
"feature",
"values",
"replaced",
"by",
"the",
"default",
"value",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/SyntacticCategory.java#L369-L376 | train |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/SyntacticCategory.java | SyntacticCategory.getArgumentList | public List<SyntacticCategory> getArgumentList() {
if (isAtomic()) {
return Lists.newArrayList();
} else {
List<SyntacticCategory> args = getReturn().getArgumentList();
args.add(getArgument());
return args;
}
} | java | public List<SyntacticCategory> getArgumentList() {
if (isAtomic()) {
return Lists.newArrayList();
} else {
List<SyntacticCategory> args = getReturn().getArgumentList();
args.add(getArgument());
return args;
}
} | [
"public",
"List",
"<",
"SyntacticCategory",
">",
"getArgumentList",
"(",
")",
"{",
"if",
"(",
"isAtomic",
"(",
")",
")",
"{",
"return",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"}",
"else",
"{",
"List",
"<",
"SyntacticCategory",
">",
"args",
"=",
"... | Gets the sequence of arguments that this category accepts. Note
that the returned arguments themselves may be functional types.
The sequence is returned with the first required argument at the
end of the list.
@return | [
"Gets",
"the",
"sequence",
"of",
"arguments",
"that",
"this",
"category",
"accepts",
".",
"Note",
"that",
"the",
"returned",
"arguments",
"themselves",
"may",
"be",
"functional",
"types",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/SyntacticCategory.java#L419-L427 | train |
jayantk/jklol | src/com/jayantkrish/jklol/inference/JunctionTree.java | JunctionTree.cliqueTreeToMaxMarginalSet | private static MaxMarginalSet cliqueTreeToMaxMarginalSet(CliqueTree cliqueTree,
FactorGraph originalFactorGraph) {
for (int i = 0; i < cliqueTree.numFactors(); i++) {
computeMarginal(cliqueTree, i, false);
}
return new FactorMaxMarginalSet(cliqueTree, originalFactorGraph.getConditionedValues());... | java | private static MaxMarginalSet cliqueTreeToMaxMarginalSet(CliqueTree cliqueTree,
FactorGraph originalFactorGraph) {
for (int i = 0; i < cliqueTree.numFactors(); i++) {
computeMarginal(cliqueTree, i, false);
}
return new FactorMaxMarginalSet(cliqueTree, originalFactorGraph.getConditionedValues());... | [
"private",
"static",
"MaxMarginalSet",
"cliqueTreeToMaxMarginalSet",
"(",
"CliqueTree",
"cliqueTree",
",",
"FactorGraph",
"originalFactorGraph",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"cliqueTree",
".",
"numFactors",
"(",
")",
";",
"i",
"++... | Retrieves max marginals from the given clique tree.
@param cliqueTree
@param rootFactorNum
@return | [
"Retrieves",
"max",
"marginals",
"from",
"the",
"given",
"clique",
"tree",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/inference/JunctionTree.java#L309-L315 | train |
davidcarboni/cryptolite-java | src/main/java/com/github/davidcarboni/cryptolite/DigitalSignature.java | DigitalSignature.sign | public String sign(String content, PrivateKey privateKey) {
if (content == null) {
return null;
}
byte[] bytes = content.getBytes(StandardCharsets.UTF_8);
InputStream input = new ByteArrayInputStream(bytes);
return sign(input, privateKey);
// ByteArrayInputS... | java | public String sign(String content, PrivateKey privateKey) {
if (content == null) {
return null;
}
byte[] bytes = content.getBytes(StandardCharsets.UTF_8);
InputStream input = new ByteArrayInputStream(bytes);
return sign(input, privateKey);
// ByteArrayInputS... | [
"public",
"String",
"sign",
"(",
"String",
"content",
",",
"PrivateKey",
"privateKey",
")",
"{",
"if",
"(",
"content",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"byte",
"[",
"]",
"bytes",
"=",
"content",
".",
"getBytes",
"(",
"StandardCharsets"... | Generates a digital signature for the given string.
@param content The string to be digitally signed.
@param privateKey The {@link PrivateKey} with which the string is to be signed. This can be obtained
via {@link Keys#newKeyPair()}.
@return The signature as a base64-encoded string. If the content is null, null is ... | [
"Generates",
"a",
"digital",
"signature",
"for",
"the",
"given",
"string",
"."
] | e67954181a04ffc9beb1d9abca1421195fcf9764 | https://github.com/davidcarboni/cryptolite-java/blob/e67954181a04ffc9beb1d9abca1421195fcf9764/src/main/java/com/github/davidcarboni/cryptolite/DigitalSignature.java#L50-L60 | train |
davidcarboni/cryptolite-java | src/main/java/com/github/davidcarboni/cryptolite/DigitalSignature.java | DigitalSignature.verify | public boolean verify(String content, PublicKey publicKey, String signature) {
byte[] bytes = content.getBytes(StandardCharsets.UTF_8);
InputStream input = new ByteArrayInputStream(bytes);
return verify(input, publicKey, signature);
// ByteArrayInputStream does not need to be closed.
... | java | public boolean verify(String content, PublicKey publicKey, String signature) {
byte[] bytes = content.getBytes(StandardCharsets.UTF_8);
InputStream input = new ByteArrayInputStream(bytes);
return verify(input, publicKey, signature);
// ByteArrayInputStream does not need to be closed.
... | [
"public",
"boolean",
"verify",
"(",
"String",
"content",
",",
"PublicKey",
"publicKey",
",",
"String",
"signature",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"content",
".",
"getBytes",
"(",
"StandardCharsets",
".",
"UTF_8",
")",
";",
"InputStream",
"input",... | Verifies whether the given content matches the given signature.
@param content The content to be verified.
@param publicKey The public key to use in the verification process.
@param signature The signature with which the content is to be verified. This can be obtained via
{@link Keys#newKeyPair()}.
@return If the co... | [
"Verifies",
"whether",
"the",
"given",
"content",
"matches",
"the",
"given",
"signature",
"."
] | e67954181a04ffc9beb1d9abca1421195fcf9764 | https://github.com/davidcarboni/cryptolite-java/blob/e67954181a04ffc9beb1d9abca1421195fcf9764/src/main/java/com/github/davidcarboni/cryptolite/DigitalSignature.java#L113-L120 | train |
jayantk/jklol | src/com/jayantkrish/jklol/util/Assignment.java | Assignment.union | public final Assignment union(Assignment other) {
Preconditions.checkNotNull(other);
if (other.size() == 0) {
return this;
} if (vars.length == 0) {
return other;
}
// Merge varnums / values
int[] otherNums = other.getVariableNumsArray();
int[] myNums = getVariableNumsArray();
... | java | public final Assignment union(Assignment other) {
Preconditions.checkNotNull(other);
if (other.size() == 0) {
return this;
} if (vars.length == 0) {
return other;
}
// Merge varnums / values
int[] otherNums = other.getVariableNumsArray();
int[] myNums = getVariableNumsArray();
... | [
"public",
"final",
"Assignment",
"union",
"(",
"Assignment",
"other",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"other",
")",
";",
"if",
"(",
"other",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"if",
"(",
"vars... | Combines two assignments into a single joint assignment to all of the
variables in each assignment. The two assignments must contain disjoint
sets of variables. | [
"Combines",
"two",
"assignments",
"into",
"a",
"single",
"joint",
"assignment",
"to",
"all",
"of",
"the",
"variables",
"in",
"each",
"assignment",
".",
"The",
"two",
"assignments",
"must",
"contain",
"disjoint",
"sets",
"of",
"variables",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/Assignment.java#L261-L311 | train |
jayantk/jklol | src/com/jayantkrish/jklol/util/Assignment.java | Assignment.removeAll | @Deprecated
public final Assignment removeAll(Collection<Integer> varNumsToRemove) {
return removeAll(Ints.toArray(varNumsToRemove));
} | java | @Deprecated
public final Assignment removeAll(Collection<Integer> varNumsToRemove) {
return removeAll(Ints.toArray(varNumsToRemove));
} | [
"@",
"Deprecated",
"public",
"final",
"Assignment",
"removeAll",
"(",
"Collection",
"<",
"Integer",
">",
"varNumsToRemove",
")",
"{",
"return",
"removeAll",
"(",
"Ints",
".",
"toArray",
"(",
"varNumsToRemove",
")",
")",
";",
"}"
] | Returns a copy of this assignment without any assignments to the variable
numbers in varNumsToRemove
@param varNumsToRemove
@return | [
"Returns",
"a",
"copy",
"of",
"this",
"assignment",
"without",
"any",
"assignments",
"to",
"the",
"variable",
"numbers",
"in",
"varNumsToRemove"
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/Assignment.java#L320-L323 | train |
jayantk/jklol | src/com/jayantkrish/jklol/util/Assignment.java | Assignment.mapVariables | public Assignment mapVariables(Map<Integer, Integer> varMap) {
int[] newVarNums = new int[vars.length];
Object[] newValues = new Object[vars.length];
int numFilled = 0;
for (int i = 0; i < vars.length; i++) {
if (varMap.containsKey(vars[i])) {
newVarNums[numFilled] = varMap.get(vars[i]);
... | java | public Assignment mapVariables(Map<Integer, Integer> varMap) {
int[] newVarNums = new int[vars.length];
Object[] newValues = new Object[vars.length];
int numFilled = 0;
for (int i = 0; i < vars.length; i++) {
if (varMap.containsKey(vars[i])) {
newVarNums[numFilled] = varMap.get(vars[i]);
... | [
"public",
"Assignment",
"mapVariables",
"(",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"varMap",
")",
"{",
"int",
"[",
"]",
"newVarNums",
"=",
"new",
"int",
"[",
"vars",
".",
"length",
"]",
";",
"Object",
"[",
"]",
"newValues",
"=",
"new",
"Object",
... | Return a new assignment where each var num has been replaced by its value
in varMap. | [
"Return",
"a",
"new",
"assignment",
"where",
"each",
"var",
"num",
"has",
"been",
"replaced",
"by",
"its",
"value",
"in",
"varMap",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/Assignment.java#L359-L377 | train |
ivanceras/orm | src/main/java/com/ivanceras/db/api/DB_Rdbms.java | DB_Rdbms.curateIgnoredColumns | private String[] curateIgnoredColumns(String[] ignoredColumns) {
if(ignoredColumns == null){
return null;
}else{
String[] curated = new String[ignoredColumns.length];
for(int i = 0; i < ignoredColumns.length; i++){
if(ignoredColumns[i] != null){
String[] splinters = ignoredColumns[i].split("\\.");... | java | private String[] curateIgnoredColumns(String[] ignoredColumns) {
if(ignoredColumns == null){
return null;
}else{
String[] curated = new String[ignoredColumns.length];
for(int i = 0; i < ignoredColumns.length; i++){
if(ignoredColumns[i] != null){
String[] splinters = ignoredColumns[i].split("\\.");... | [
"private",
"String",
"[",
"]",
"curateIgnoredColumns",
"(",
"String",
"[",
"]",
"ignoredColumns",
")",
"{",
"if",
"(",
"ignoredColumns",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"String",
"[",
"]",
"curated",
"=",
"new",
"String",... | while ignoring specific table | [
"while",
"ignoring",
"specific",
"table"
] | e63213cb8abefd11df0e2d34b1c95477788e600e | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/api/DB_Rdbms.java#L321-L337 | train |
HiddenStage/divide | Shared/src/main/java/io/divide/shared/file/XmlStorage.java | XmlStorage.hasFileChangedUnexpectedly | private boolean hasFileChangedUnexpectedly() {
synchronized (this) {
if (mDiskWritesInFlight > 0) {
// If we know we caused it, it's not unexpected.
if (DEBUG) System.out.println( "disk write in flight, not unexpected.");
return false;
}
... | java | private boolean hasFileChangedUnexpectedly() {
synchronized (this) {
if (mDiskWritesInFlight > 0) {
// If we know we caused it, it's not unexpected.
if (DEBUG) System.out.println( "disk write in flight, not unexpected.");
return false;
}
... | [
"private",
"boolean",
"hasFileChangedUnexpectedly",
"(",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"mDiskWritesInFlight",
">",
"0",
")",
"{",
"// If we know we caused it, it's not unexpected.",
"if",
"(",
"DEBUG",
")",
"System",
".",
"out",
".",
... | we didn't instigate. | [
"we",
"didn",
"t",
"instigate",
"."
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Shared/src/main/java/io/divide/shared/file/XmlStorage.java#L123-L137 | train |
HiddenStage/divide | Shared/src/main/java/io/divide/shared/file/XmlStorage.java | XmlStorage.enqueueDiskWrite | private void enqueueDiskWrite(final MemoryCommitResult mcr,
final Runnable postWriteRunnable) {
final Runnable writeToDiskRunnable = new Runnable() {
public void run() {
synchronized (mWritingToDiskLock) {
writeToFile(mcr);
... | java | private void enqueueDiskWrite(final MemoryCommitResult mcr,
final Runnable postWriteRunnable) {
final Runnable writeToDiskRunnable = new Runnable() {
public void run() {
synchronized (mWritingToDiskLock) {
writeToFile(mcr);
... | [
"private",
"void",
"enqueueDiskWrite",
"(",
"final",
"MemoryCommitResult",
"mcr",
",",
"final",
"Runnable",
"postWriteRunnable",
")",
"{",
"final",
"Runnable",
"writeToDiskRunnable",
"=",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"(",
")",
"{",
... | Enqueue an already-committed-to-memory result to be written
to disk.
They will be written to disk one-at-a-time in the order
that they're enqueued.
@param postWriteRunnable if non-null, we're being called
from apply() and this is the runnable to run after
the write proceeds. if null (from a regular commit()),
then w... | [
"Enqueue",
"an",
"already",
"-",
"committed",
"-",
"to",
"-",
"memory",
"result",
"to",
"be",
"written",
"to",
"disk",
"."
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Shared/src/main/java/io/divide/shared/file/XmlStorage.java#L409-L441 | train |
jayantk/jklol | src/com/jayantkrish/jklol/util/IoUtils.java | IoUtils.readLines | public static List<String> readLines(String filename) {
List<String> lines = Lists.newArrayList();
try {
BufferedReader in = new BufferedReader(new FileReader(filename));
String line;
while ((line = in.readLine()) != null) {
// Ignore blank lines.
if (line.trim().length() > 0) ... | java | public static List<String> readLines(String filename) {
List<String> lines = Lists.newArrayList();
try {
BufferedReader in = new BufferedReader(new FileReader(filename));
String line;
while ((line = in.readLine()) != null) {
// Ignore blank lines.
if (line.trim().length() > 0) ... | [
"public",
"static",
"List",
"<",
"String",
">",
"readLines",
"(",
"String",
"filename",
")",
"{",
"List",
"<",
"String",
">",
"lines",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"try",
"{",
"BufferedReader",
"in",
"=",
"new",
"BufferedReader",
"("... | Read the lines of a file into a list of strings, with each line represented
as its own string.
@param filename
@return | [
"Read",
"the",
"lines",
"of",
"a",
"file",
"into",
"a",
"list",
"of",
"strings",
"with",
"each",
"line",
"represented",
"as",
"its",
"own",
"string",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/IoUtils.java#L27-L43 | train |
jayantk/jklol | src/com/jayantkrish/jklol/sequence/TaggerUtils.java | TaggerUtils.reformatTrainingData | public static <I, O> List<Example<DynamicAssignment, DynamicAssignment>> reformatTrainingData(
List<? extends TaggedSequence<I, O>> sequences, FeatureVectorGenerator<LocalContext<I>> featureGen,
Function<? super LocalContext<I>, ? extends Object> inputGen, DynamicVariableSet modelVariables,
I startInp... | java | public static <I, O> List<Example<DynamicAssignment, DynamicAssignment>> reformatTrainingData(
List<? extends TaggedSequence<I, O>> sequences, FeatureVectorGenerator<LocalContext<I>> featureGen,
Function<? super LocalContext<I>, ? extends Object> inputGen, DynamicVariableSet modelVariables,
I startInp... | [
"public",
"static",
"<",
"I",
",",
"O",
">",
"List",
"<",
"Example",
"<",
"DynamicAssignment",
",",
"DynamicAssignment",
">",
">",
"reformatTrainingData",
"(",
"List",
"<",
"?",
"extends",
"TaggedSequence",
"<",
"I",
",",
"O",
">",
">",
"sequences",
",",
... | Converts training data as sequences into assignments that can be
used for parameter estimation.
@param sequences
@param featureGen
@param model
@return | [
"Converts",
"training",
"data",
"as",
"sequences",
"into",
"assignments",
"that",
"can",
"be",
"used",
"for",
"parameter",
"estimation",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/sequence/TaggerUtils.java#L121-L175 | train |
jayantk/jklol | src/com/jayantkrish/jklol/sequence/TaggerUtils.java | TaggerUtils.reformatTrainingDataPerItem | public static <I, O> List<Example<DynamicAssignment, DynamicAssignment>> reformatTrainingDataPerItem(
List<? extends TaggedSequence<I, O>> sequences, FeatureVectorGenerator<LocalContext<I>> featureGen,
Function<? super LocalContext<I>, ? extends Object> inputGen, DynamicVariableSet modelVariables,
I s... | java | public static <I, O> List<Example<DynamicAssignment, DynamicAssignment>> reformatTrainingDataPerItem(
List<? extends TaggedSequence<I, O>> sequences, FeatureVectorGenerator<LocalContext<I>> featureGen,
Function<? super LocalContext<I>, ? extends Object> inputGen, DynamicVariableSet modelVariables,
I s... | [
"public",
"static",
"<",
"I",
",",
"O",
">",
"List",
"<",
"Example",
"<",
"DynamicAssignment",
",",
"DynamicAssignment",
">",
">",
"reformatTrainingDataPerItem",
"(",
"List",
"<",
"?",
"extends",
"TaggedSequence",
"<",
"I",
",",
"O",
">",
">",
"sequences",
... | Creates training examples from sequential data where each example
involves predicting a single label given the current input and
previous label. Such examples are suitable for training
locally-normalized sequence models, such as HMMs and MEMMs.
@param sequences
@param featureGen
@param inputGen
@param modelVariables
@... | [
"Creates",
"training",
"examples",
"from",
"sequential",
"data",
"where",
"each",
"example",
"involves",
"predicting",
"a",
"single",
"label",
"given",
"the",
"current",
"input",
"and",
"previous",
"label",
".",
"Such",
"examples",
"are",
"suitable",
"for",
"tra... | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/sequence/TaggerUtils.java#L189-L208 | train |
jayantk/jklol | src/com/jayantkrish/jklol/sequence/TaggerUtils.java | TaggerUtils.trainSequenceModel | public static <I, O> FactorGraphSequenceTagger<I, O> trainSequenceModel(
ParametricFactorGraph sequenceModelFamily, List<Example<DynamicAssignment, DynamicAssignment>> examples,
Class<O> outputClass, FeatureVectorGenerator<LocalContext<I>> featureGen,
Function<? super LocalContext<I>, ? extends Objec... | java | public static <I, O> FactorGraphSequenceTagger<I, O> trainSequenceModel(
ParametricFactorGraph sequenceModelFamily, List<Example<DynamicAssignment, DynamicAssignment>> examples,
Class<O> outputClass, FeatureVectorGenerator<LocalContext<I>> featureGen,
Function<? super LocalContext<I>, ? extends Objec... | [
"public",
"static",
"<",
"I",
",",
"O",
">",
"FactorGraphSequenceTagger",
"<",
"I",
",",
"O",
">",
"trainSequenceModel",
"(",
"ParametricFactorGraph",
"sequenceModelFamily",
",",
"List",
"<",
"Example",
"<",
"DynamicAssignment",
",",
"DynamicAssignment",
">",
">",... | Trains a sequence model.
@param sequenceModelFamily
@param trainingData
@param outputClass
@param featureGen
@param inputGen
@param optimizer
@param useMaxMargin
@return | [
"Trains",
"a",
"sequence",
"model",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/sequence/TaggerUtils.java#L328-L342 | train |
HiddenStage/divide | Client/android-client/src/main/java/com/google/android/gcm/GCMRegistrar.java | GCMRegistrar.onDestroy | public static synchronized void onDestroy(Context context) {
if (sRetryReceiver != null) {
Log.v(TAG, "Unregistering receiver");
context.unregisterReceiver(sRetryReceiver);
sRetryReceiver = null;
}
} | java | public static synchronized void onDestroy(Context context) {
if (sRetryReceiver != null) {
Log.v(TAG, "Unregistering receiver");
context.unregisterReceiver(sRetryReceiver);
sRetryReceiver = null;
}
} | [
"public",
"static",
"synchronized",
"void",
"onDestroy",
"(",
"Context",
"context",
")",
"{",
"if",
"(",
"sRetryReceiver",
"!=",
"null",
")",
"{",
"Log",
".",
"v",
"(",
"TAG",
",",
"\"Unregistering receiver\"",
")",
";",
"context",
".",
"unregisterReceiver",
... | Clear internal resources.
<p>
This method should be called by the main activity's {@code onDestroy()}
method. | [
"Clear",
"internal",
"resources",
"."
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/android-client/src/main/java/com/google/android/gcm/GCMRegistrar.java#L258-L264 | train |
HiddenStage/divide | Client/android-client/src/main/java/com/google/android/gcm/GCMRegistrar.java | GCMRegistrar.setRegistrationId | static String setRegistrationId(Context context, String regId) {
final SharedPreferences prefs = getGCMPreferences(context);
String oldRegistrationId = prefs.getString(PROPERTY_REG_ID, "");
int appVersion = getAppVersion(context);
Log.v(TAG, "Saving regId on app version " + appVersion);
... | java | static String setRegistrationId(Context context, String regId) {
final SharedPreferences prefs = getGCMPreferences(context);
String oldRegistrationId = prefs.getString(PROPERTY_REG_ID, "");
int appVersion = getAppVersion(context);
Log.v(TAG, "Saving regId on app version " + appVersion);
... | [
"static",
"String",
"setRegistrationId",
"(",
"Context",
"context",
",",
"String",
"regId",
")",
"{",
"final",
"SharedPreferences",
"prefs",
"=",
"getGCMPreferences",
"(",
"context",
")",
";",
"String",
"oldRegistrationId",
"=",
"prefs",
".",
"getString",
"(",
"... | Sets the registration id in the persistence store.
@param context application's context.
@param regId registration id | [
"Sets",
"the",
"registration",
"id",
"in",
"the",
"persistence",
"store",
"."
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/android-client/src/main/java/com/google/android/gcm/GCMRegistrar.java#L364-L374 | train |
HiddenStage/divide | Client/android-client/src/main/java/com/google/android/gcm/GCMRegistrar.java | GCMRegistrar.setRegisteredOnServer | public static void setRegisteredOnServer(Context context, boolean flag) {
final SharedPreferences prefs = getGCMPreferences(context);
Editor editor = prefs.edit();
editor.putBoolean(PROPERTY_ON_SERVER, flag);
// set the flag's expiration date
long lifespan = getRegisterOnServerLi... | java | public static void setRegisteredOnServer(Context context, boolean flag) {
final SharedPreferences prefs = getGCMPreferences(context);
Editor editor = prefs.edit();
editor.putBoolean(PROPERTY_ON_SERVER, flag);
// set the flag's expiration date
long lifespan = getRegisterOnServerLi... | [
"public",
"static",
"void",
"setRegisteredOnServer",
"(",
"Context",
"context",
",",
"boolean",
"flag",
")",
"{",
"final",
"SharedPreferences",
"prefs",
"=",
"getGCMPreferences",
"(",
"context",
")",
";",
"Editor",
"editor",
"=",
"prefs",
".",
"edit",
"(",
")"... | Sets whether the device was successfully registered in the server side. | [
"Sets",
"whether",
"the",
"device",
"was",
"successfully",
"registered",
"in",
"the",
"server",
"side",
"."
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/android-client/src/main/java/com/google/android/gcm/GCMRegistrar.java#L379-L390 | train |
HiddenStage/divide | Client/android-client/src/main/java/com/google/android/gcm/GCMRegistrar.java | GCMRegistrar.getAppVersion | private static int getAppVersion(Context context) {
try {
PackageInfo packageInfo = context.getPackageManager()
.getPackageInfo(context.getPackageName(), 0);
return packageInfo.versionCode;
} catch (NameNotFoundException e) {
// should never happen... | java | private static int getAppVersion(Context context) {
try {
PackageInfo packageInfo = context.getPackageManager()
.getPackageInfo(context.getPackageName(), 0);
return packageInfo.versionCode;
} catch (NameNotFoundException e) {
// should never happen... | [
"private",
"static",
"int",
"getAppVersion",
"(",
"Context",
"context",
")",
"{",
"try",
"{",
"PackageInfo",
"packageInfo",
"=",
"context",
".",
"getPackageManager",
"(",
")",
".",
"getPackageInfo",
"(",
"context",
".",
"getPackageName",
"(",
")",
",",
"0",
... | Gets the application version. | [
"Gets",
"the",
"application",
"version",
"."
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/android-client/src/main/java/com/google/android/gcm/GCMRegistrar.java#L446-L455 | train |
HiddenStage/divide | Client/android-client/src/main/java/com/google/android/gcm/GCMRegistrar.java | GCMRegistrar.getBackoff | static int getBackoff(Context context) {
final SharedPreferences prefs = getGCMPreferences(context);
return prefs.getInt(BACKOFF_MS, DEFAULT_BACKOFF_MS);
} | java | static int getBackoff(Context context) {
final SharedPreferences prefs = getGCMPreferences(context);
return prefs.getInt(BACKOFF_MS, DEFAULT_BACKOFF_MS);
} | [
"static",
"int",
"getBackoff",
"(",
"Context",
"context",
")",
"{",
"final",
"SharedPreferences",
"prefs",
"=",
"getGCMPreferences",
"(",
"context",
")",
";",
"return",
"prefs",
".",
"getInt",
"(",
"BACKOFF_MS",
",",
"DEFAULT_BACKOFF_MS",
")",
";",
"}"
] | Gets the current backoff counter.
@param context application's context.
@return current backoff counter, in milliseconds. | [
"Gets",
"the",
"current",
"backoff",
"counter",
"."
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/android-client/src/main/java/com/google/android/gcm/GCMRegistrar.java#L475-L478 | train |
jayantk/jklol | src/com/jayantkrish/jklol/tensor/DenseTensor.java | DenseTensor.denseTensorInnerProduct | private double denseTensorInnerProduct(DenseTensor other) {
double[] otherValues = other.values;
int length = values.length;
Preconditions.checkArgument(otherValues.length == length);
double innerProduct = 0.0;
for (int i = 0; i < length; i++) {
innerProduct += values[i] * otherValues[i];... | java | private double denseTensorInnerProduct(DenseTensor other) {
double[] otherValues = other.values;
int length = values.length;
Preconditions.checkArgument(otherValues.length == length);
double innerProduct = 0.0;
for (int i = 0; i < length; i++) {
innerProduct += values[i] * otherValues[i];... | [
"private",
"double",
"denseTensorInnerProduct",
"(",
"DenseTensor",
"other",
")",
"{",
"double",
"[",
"]",
"otherValues",
"=",
"other",
".",
"values",
";",
"int",
"length",
"=",
"values",
".",
"length",
";",
"Preconditions",
".",
"checkArgument",
"(",
"otherVa... | Implementation of inner product where both tensors are dense and have
the same dimensionality. These properties enable the inner product to
be computed extremely quickly by iterating over both dense arrays of
values.
@param other
@return | [
"Implementation",
"of",
"inner",
"product",
"where",
"both",
"tensors",
"are",
"dense",
"and",
"have",
"the",
"same",
"dimensionality",
".",
"These",
"properties",
"enable",
"the",
"inner",
"product",
"to",
"be",
"computed",
"extremely",
"quickly",
"by",
"iterat... | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/tensor/DenseTensor.java#L234-L244 | train |
GoodforGod/dummymaker | src/main/java/io/dummymaker/scan/impl/BasicScanner.java | BasicScanner.buildDeclaredAnnotationList | private List<Annotation> buildDeclaredAnnotationList(final Annotation annotation) {
final List<Annotation> list = Arrays.stream(annotation.annotationType().getDeclaredAnnotations())
.collect(Collectors.toList());
list.add(annotation);
return list;
} | java | private List<Annotation> buildDeclaredAnnotationList(final Annotation annotation) {
final List<Annotation> list = Arrays.stream(annotation.annotationType().getDeclaredAnnotations())
.collect(Collectors.toList());
list.add(annotation);
return list;
} | [
"private",
"List",
"<",
"Annotation",
">",
"buildDeclaredAnnotationList",
"(",
"final",
"Annotation",
"annotation",
")",
"{",
"final",
"List",
"<",
"Annotation",
">",
"list",
"=",
"Arrays",
".",
"stream",
"(",
"annotation",
".",
"annotationType",
"(",
")",
"."... | Retrieve declared annotations from parent one and build set of them all
@param annotation parent annotation
@return parent annotation and its declared ones | [
"Retrieve",
"declared",
"annotations",
"from",
"parent",
"one",
"and",
"build",
"set",
"of",
"them",
"all"
] | a4809c0a8139ab9cdb42814a3e37772717a313b4 | https://github.com/GoodforGod/dummymaker/blob/a4809c0a8139ab9cdb42814a3e37772717a313b4/src/main/java/io/dummymaker/scan/impl/BasicScanner.java#L55-L60 | train |
jayantk/jklol | src/com/jayantkrish/jklol/evaluation/CrossValidationEvaluation.java | CrossValidationEvaluation.kFold | public static <I, O> CrossValidationEvaluation<I, O> kFold(
Collection<Example<I, O>> data, int k) {
Preconditions.checkNotNull(data);
Preconditions.checkArgument(k > 1);
int numTrainingPoints = data.size();
List<Collection<Example<I, O>>> folds = Lists.newArrayList();
for (List<Example<I, O>> fold : Iter... | java | public static <I, O> CrossValidationEvaluation<I, O> kFold(
Collection<Example<I, O>> data, int k) {
Preconditions.checkNotNull(data);
Preconditions.checkArgument(k > 1);
int numTrainingPoints = data.size();
List<Collection<Example<I, O>>> folds = Lists.newArrayList();
for (List<Example<I, O>> fold : Iter... | [
"public",
"static",
"<",
"I",
",",
"O",
">",
"CrossValidationEvaluation",
"<",
"I",
",",
"O",
">",
"kFold",
"(",
"Collection",
"<",
"Example",
"<",
"I",
",",
"O",
">",
">",
"data",
",",
"int",
"k",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",... | Construct a cross validation evaluation from a data set by partitioning it into k folds.
The elements in data should be in a random order. | [
"Construct",
"a",
"cross",
"validation",
"evaluation",
"from",
"a",
"data",
"set",
"by",
"partitioning",
"it",
"into",
"k",
"folds",
".",
"The",
"elements",
"in",
"data",
"should",
"be",
"in",
"a",
"random",
"order",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/evaluation/CrossValidationEvaluation.java#L50-L62 | train |
ivanceras/orm | src/main/java/com/ivanceras/db/api/ModelDef.java | ModelDef.getLocalColumns | public String[] getLocalColumns(String modelName) {
List<String> columnList = new ArrayList<String>();
for(int i = 0; i < this.hasOne.length; i++){
if(modelName.equalsIgnoreCase(this.hasOne[i])){
columnList.add(hasOneLocalColumn[i]);
}
}
for(int j = 0; j < this.hasMany.length; j++){
if(modelName.eq... | java | public String[] getLocalColumns(String modelName) {
List<String> columnList = new ArrayList<String>();
for(int i = 0; i < this.hasOne.length; i++){
if(modelName.equalsIgnoreCase(this.hasOne[i])){
columnList.add(hasOneLocalColumn[i]);
}
}
for(int j = 0; j < this.hasMany.length; j++){
if(modelName.eq... | [
"public",
"String",
"[",
"]",
"getLocalColumns",
"(",
"String",
"modelName",
")",
"{",
"List",
"<",
"String",
">",
"columnList",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".... | get the foreign key column of this table definition from this refered table | [
"get",
"the",
"foreign",
"key",
"column",
"of",
"this",
"table",
"definition",
"from",
"this",
"refered",
"table"
] | e63213cb8abefd11df0e2d34b1c95477788e600e | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/api/ModelDef.java#L239-L255 | train |
ivanceras/orm | src/main/java/com/ivanceras/db/api/ModelDef.java | ModelDef.getPlainProperties | public String[] getPlainProperties(){
String[] commonColumns = {"created", "createdby", "updated","updatedby", "isactive"};
String[] referencedProperties = getReferencedColumns();
List<String> plainProperties = new ArrayList<String>();
for(String att : attributes){
if(CStringUtils.indexOf(referencedPropertie... | java | public String[] getPlainProperties(){
String[] commonColumns = {"created", "createdby", "updated","updatedby", "isactive"};
String[] referencedProperties = getReferencedColumns();
List<String> plainProperties = new ArrayList<String>();
for(String att : attributes){
if(CStringUtils.indexOf(referencedPropertie... | [
"public",
"String",
"[",
"]",
"getPlainProperties",
"(",
")",
"{",
"String",
"[",
"]",
"commonColumns",
"=",
"{",
"\"created\"",
",",
"\"createdby\"",
",",
"\"updated\"",
",",
"\"updatedby\"",
",",
"\"isactive\"",
"}",
";",
"String",
"[",
"]",
"referencedPrope... | Get the properties that are pertaining to the model, this does not include linker columns
@return | [
"Get",
"the",
"properties",
"that",
"are",
"pertaining",
"to",
"the",
"model",
"this",
"does",
"not",
"include",
"linker",
"columns"
] | e63213cb8abefd11df0e2d34b1c95477788e600e | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/api/ModelDef.java#L342-L361 | train |
cpollet/jixture | core/src/main/java/net/cpollet/jixture/fixtures/capacities/extraction/ExtractionResult.java | ExtractionResult.add | public void add(Object entity, String name) {
Result result = new Result(entity, name);
results.add(result);
} | java | public void add(Object entity, String name) {
Result result = new Result(entity, name);
results.add(result);
} | [
"public",
"void",
"add",
"(",
"Object",
"entity",
",",
"String",
"name",
")",
"{",
"Result",
"result",
"=",
"new",
"Result",
"(",
"entity",
",",
"name",
")",
";",
"results",
".",
"add",
"(",
"result",
")",
";",
"}"
] | Add a new entity to an extraction collection.
@param entity the entity to add.
@param name the name of the collection where this entity should be put. | [
"Add",
"a",
"new",
"entity",
"to",
"an",
"extraction",
"collection",
"."
] | faef0d4991f81c2cdb5be3ba24176636ef0cc433 | https://github.com/cpollet/jixture/blob/faef0d4991f81c2cdb5be3ba24176636ef0cc433/core/src/main/java/net/cpollet/jixture/fixtures/capacities/extraction/ExtractionResult.java#L43-L46 | train |
cpollet/jixture | core/src/main/java/net/cpollet/jixture/fixtures/capacities/extraction/ExtractionResult.java | ExtractionResult.getEntities | public List<Object> getEntities(String name) {
List<Object> entitiesList = new LinkedList<Object>();
for (Result result : results) {
if (result.getResultName().equals(name)) {
entitiesList.add(result.getObject());
}
}
return entitiesList;
} | java | public List<Object> getEntities(String name) {
List<Object> entitiesList = new LinkedList<Object>();
for (Result result : results) {
if (result.getResultName().equals(name)) {
entitiesList.add(result.getObject());
}
}
return entitiesList;
} | [
"public",
"List",
"<",
"Object",
">",
"getEntities",
"(",
"String",
"name",
")",
"{",
"List",
"<",
"Object",
">",
"entitiesList",
"=",
"new",
"LinkedList",
"<",
"Object",
">",
"(",
")",
";",
"for",
"(",
"Result",
"result",
":",
"results",
")",
"{",
"... | Returns all entities stored in the given collection.
@param name the collection's name
@return all entities stored in the given collection. | [
"Returns",
"all",
"entities",
"stored",
"in",
"the",
"given",
"collection",
"."
] | faef0d4991f81c2cdb5be3ba24176636ef0cc433 | https://github.com/cpollet/jixture/blob/faef0d4991f81c2cdb5be3ba24176636ef0cc433/core/src/main/java/net/cpollet/jixture/fixtures/capacities/extraction/ExtractionResult.java#L54-L64 | train |
cpollet/jixture | core/src/main/java/net/cpollet/jixture/fixtures/capacities/extraction/ExtractionResult.java | ExtractionResult.getEntities | public List<Object> getEntities() {
List<Object> entitiesList = new LinkedList<Object>();
for (Result result : results) {
entitiesList.add(result.getObject());
}
return entitiesList;
} | java | public List<Object> getEntities() {
List<Object> entitiesList = new LinkedList<Object>();
for (Result result : results) {
entitiesList.add(result.getObject());
}
return entitiesList;
} | [
"public",
"List",
"<",
"Object",
">",
"getEntities",
"(",
")",
"{",
"List",
"<",
"Object",
">",
"entitiesList",
"=",
"new",
"LinkedList",
"<",
"Object",
">",
"(",
")",
";",
"for",
"(",
"Result",
"result",
":",
"results",
")",
"{",
"entitiesList",
".",
... | Returns all entities.
@return all entities. | [
"Returns",
"all",
"entities",
"."
] | faef0d4991f81c2cdb5be3ba24176636ef0cc433 | https://github.com/cpollet/jixture/blob/faef0d4991f81c2cdb5be3ba24176636ef0cc433/core/src/main/java/net/cpollet/jixture/fixtures/capacities/extraction/ExtractionResult.java#L108-L116 | train |
jayantk/jklol | src/com/jayantkrish/jklol/tensor/DenseTensorBuilder.java | DenseTensorBuilder.simpleIncrement | private void simpleIncrement(TensorBase other, double multiplier) {
Preconditions.checkArgument(Arrays.equals(other.getDimensionNumbers(), getDimensionNumbers()));
if (other instanceof DenseTensorBase) {
double[] otherTensorValues = ((DenseTensorBase) other).values;
Preconditions.checkArgument(other... | java | private void simpleIncrement(TensorBase other, double multiplier) {
Preconditions.checkArgument(Arrays.equals(other.getDimensionNumbers(), getDimensionNumbers()));
if (other instanceof DenseTensorBase) {
double[] otherTensorValues = ((DenseTensorBase) other).values;
Preconditions.checkArgument(other... | [
"private",
"void",
"simpleIncrement",
"(",
"TensorBase",
"other",
",",
"double",
"multiplier",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"Arrays",
".",
"equals",
"(",
"other",
".",
"getDimensionNumbers",
"(",
")",
",",
"getDimensionNumbers",
"(",
")"... | Increment algorithm for the case where both tensors have the same set of
dimensions.
@param other
@param multiplier | [
"Increment",
"algorithm",
"for",
"the",
"case",
"where",
"both",
"tensors",
"have",
"the",
"same",
"set",
"of",
"dimensions",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/tensor/DenseTensorBuilder.java#L197-L214 | train |
ivanceras/orm | src/main/java/com/ivanceras/db/server/util/DAOGenerator.java | DAOGenerator.getOverrideModel | private ModelDef getOverrideModel(ModelDef model,
ModelMetaData explicitMeta2) {
if(explicitMeta2 == null){
return model;
}
List<ModelDef> explicitList = explicitMeta2.getModelDefinitionList();
for(ModelDef explicitModel : explicitList){
if(explicitModel.getModelName().equals(model.getModelName())){
... | java | private ModelDef getOverrideModel(ModelDef model,
ModelMetaData explicitMeta2) {
if(explicitMeta2 == null){
return model;
}
List<ModelDef> explicitList = explicitMeta2.getModelDefinitionList();
for(ModelDef explicitModel : explicitList){
if(explicitModel.getModelName().equals(model.getModelName())){
... | [
"private",
"ModelDef",
"getOverrideModel",
"(",
"ModelDef",
"model",
",",
"ModelMetaData",
"explicitMeta2",
")",
"{",
"if",
"(",
"explicitMeta2",
"==",
"null",
")",
"{",
"return",
"model",
";",
"}",
"List",
"<",
"ModelDef",
">",
"explicitList",
"=",
"explicitM... | When the mode is in the explecit model, use it instead, else use what's the in database
@param model
@param explicitMeta2
@return | [
"When",
"the",
"mode",
"is",
"in",
"the",
"explecit",
"model",
"use",
"it",
"instead",
"else",
"use",
"what",
"s",
"the",
"in",
"database"
] | e63213cb8abefd11df0e2d34b1c95477788e600e | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/util/DAOGenerator.java#L133-L145 | train |
ivanceras/orm | src/main/java/com/ivanceras/db/server/util/DAOGenerator.java | DAOGenerator.chooseFirstOccurence | private String chooseFirstOccurence(String[] among_owners, String[] within_listgroup,
String prior_tableName) {
int index = CStringUtils.indexOf(within_listgroup, prior_tableName);
for(int i = index-1; i >= 0; i-- ){
String closest = within_listgroup[i];
if(CStringUtils.indexOf(among_owners, closest) >= 0)... | java | private String chooseFirstOccurence(String[] among_owners, String[] within_listgroup,
String prior_tableName) {
int index = CStringUtils.indexOf(within_listgroup, prior_tableName);
for(int i = index-1; i >= 0; i-- ){
String closest = within_listgroup[i];
if(CStringUtils.indexOf(among_owners, closest) >= 0)... | [
"private",
"String",
"chooseFirstOccurence",
"(",
"String",
"[",
"]",
"among_owners",
",",
"String",
"[",
"]",
"within_listgroup",
",",
"String",
"prior_tableName",
")",
"{",
"int",
"index",
"=",
"CStringUtils",
".",
"indexOf",
"(",
"within_listgroup",
",",
"pri... | Choose among the owners that are present within the list group that occurs before the tableName, and closest to it
@param owners
@param group
@param tableName | [
"Choose",
"among",
"the",
"owners",
"that",
"are",
"present",
"within",
"the",
"list",
"group",
"that",
"occurs",
"before",
"the",
"tableName",
"and",
"closest",
"to",
"it"
] | e63213cb8abefd11df0e2d34b1c95477788e600e | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/util/DAOGenerator.java#L279-L289 | train |
ivanceras/orm | src/main/java/com/ivanceras/db/server/util/DAOGenerator.java | DAOGenerator.transformGroup | private Map<String, Set<String[]>> transformGroup(List<String[]> tableGroups) {
Map<String, Set<String[]>> model_tableGroup = new LinkedHashMap<String, Set<String[]>>();
for(String[] list : tableGroups){
for(String table : list){
if(model_tableGroup.containsKey(table)){
Set<String[]> tableGroupSet = mod... | java | private Map<String, Set<String[]>> transformGroup(List<String[]> tableGroups) {
Map<String, Set<String[]>> model_tableGroup = new LinkedHashMap<String, Set<String[]>>();
for(String[] list : tableGroups){
for(String table : list){
if(model_tableGroup.containsKey(table)){
Set<String[]> tableGroupSet = mod... | [
"private",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
"[",
"]",
">",
">",
"transformGroup",
"(",
"List",
"<",
"String",
"[",
"]",
">",
"tableGroups",
")",
"{",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
"[",
"]",
">",
">",
"model_tableG... | transform the listing of table groups, according to table | [
"transform",
"the",
"listing",
"of",
"table",
"groups",
"according",
"to",
"table"
] | e63213cb8abefd11df0e2d34b1c95477788e600e | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/util/DAOGenerator.java#L322-L338 | train |
getlantern/kaleidoscope | src/main/java/org/kaleidoscope/BasicRandomRoutingTable.java | BasicRandomRoutingTable.getNextHop | @Override
public TrustGraphNodeId getNextHop(final TrustGraphAdvertisement message) {
final TrustGraphNodeId prev = message.getSender();
return getNextHop(prev);
} | java | @Override
public TrustGraphNodeId getNextHop(final TrustGraphAdvertisement message) {
final TrustGraphNodeId prev = message.getSender();
return getNextHop(prev);
} | [
"@",
"Override",
"public",
"TrustGraphNodeId",
"getNextHop",
"(",
"final",
"TrustGraphAdvertisement",
"message",
")",
"{",
"final",
"TrustGraphNodeId",
"prev",
"=",
"message",
".",
"getSender",
"(",
")",
";",
"return",
"getNextHop",
"(",
"prev",
")",
";",
"}"
] | Determine the next hop for a message.
@param message the message to determine the next hop for
@return the next TrustGraphNodeId to send the message to or null if
the next hop cannot be determined.
@see RandomRoutingTable.getNextHop(TrustGraphAdvertisement) | [
"Determine",
"the",
"next",
"hop",
"for",
"a",
"message",
"."
] | 7516f05724c8f54e5d535d23da9116817c08a09f | https://github.com/getlantern/kaleidoscope/blob/7516f05724c8f54e5d535d23da9116817c08a09f/src/main/java/org/kaleidoscope/BasicRandomRoutingTable.java#L149-L153 | train |
getlantern/kaleidoscope | src/main/java/org/kaleidoscope/BasicRandomRoutingTable.java | BasicRandomRoutingTable.getNextHop | @Override
public TrustGraphNodeId getNextHop(final TrustGraphNodeId priorNeighbor) {
if (priorNeighbor != null) {
return routingTable.get(priorNeighbor);
}
else {
return null;
}
} | java | @Override
public TrustGraphNodeId getNextHop(final TrustGraphNodeId priorNeighbor) {
if (priorNeighbor != null) {
return routingTable.get(priorNeighbor);
}
else {
return null;
}
} | [
"@",
"Override",
"public",
"TrustGraphNodeId",
"getNextHop",
"(",
"final",
"TrustGraphNodeId",
"priorNeighbor",
")",
"{",
"if",
"(",
"priorNeighbor",
"!=",
"null",
")",
"{",
"return",
"routingTable",
".",
"get",
"(",
"priorNeighbor",
")",
";",
"}",
"else",
"{"... | Determine the next TrustGraphNodeId in a route containing
a given neighbor as the prior node. The next hop is the
TrustGraphNodeId paired with the given neighbor in the table.
@param priorNeighbor the prior node on the route
@return the next TrustGraphNodeId to route a message to
or null if the next hop cannot be det... | [
"Determine",
"the",
"next",
"TrustGraphNodeId",
"in",
"a",
"route",
"containing",
"a",
"given",
"neighbor",
"as",
"the",
"prior",
"node",
".",
"The",
"next",
"hop",
"is",
"the",
"TrustGraphNodeId",
"paired",
"with",
"the",
"given",
"neighbor",
"in",
"the",
"... | 7516f05724c8f54e5d535d23da9116817c08a09f | https://github.com/getlantern/kaleidoscope/blob/7516f05724c8f54e5d535d23da9116817c08a09f/src/main/java/org/kaleidoscope/BasicRandomRoutingTable.java#L165-L173 | train |
getlantern/kaleidoscope | src/main/java/org/kaleidoscope/BasicRandomRoutingTable.java | BasicRandomRoutingTable.addNeighbor | @Override
public void addNeighbor(final TrustGraphNodeId neighbor) {
if (neighbor == null) {
return;
}
// all modification operations are serialized
synchronized(this) {
// do not add this neighbor if it is already present
if (contains(neighbor))... | java | @Override
public void addNeighbor(final TrustGraphNodeId neighbor) {
if (neighbor == null) {
return;
}
// all modification operations are serialized
synchronized(this) {
// do not add this neighbor if it is already present
if (contains(neighbor))... | [
"@",
"Override",
"public",
"void",
"addNeighbor",
"(",
"final",
"TrustGraphNodeId",
"neighbor",
")",
"{",
"if",
"(",
"neighbor",
"==",
"null",
")",
"{",
"return",
";",
"}",
"// all modification operations are serialized",
"synchronized",
"(",
"this",
")",
"{",
"... | Add a single TrustGraphNodeId to the routing table.
A random existing route X->Y is split into two routes,
X -> neighbor, neighbor -> Y to accommodate the new neighbor.
If there are no existing routes, the neighbor is mapped
to itself.
If there is an existing route of the form neighbor -> X in
the routing table, this... | [
"Add",
"a",
"single",
"TrustGraphNodeId",
"to",
"the",
"routing",
"table",
"."
] | 7516f05724c8f54e5d535d23da9116817c08a09f | https://github.com/getlantern/kaleidoscope/blob/7516f05724c8f54e5d535d23da9116817c08a09f/src/main/java/org/kaleidoscope/BasicRandomRoutingTable.java#L189-L233 | train |
getlantern/kaleidoscope | src/main/java/org/kaleidoscope/BasicRandomRoutingTable.java | BasicRandomRoutingTable.randomRoute | protected Map.Entry<TrustGraphNodeId,TrustGraphNodeId> randomRoute() {
final int routeNumber = rng.nextInt(routingTable.size());
final Iterator<Map.Entry<TrustGraphNodeId,TrustGraphNodeId>> routes =
routingTable.entrySet().iterator();
for (int i = 0; i < routeNumber; i++) { rout... | java | protected Map.Entry<TrustGraphNodeId,TrustGraphNodeId> randomRoute() {
final int routeNumber = rng.nextInt(routingTable.size());
final Iterator<Map.Entry<TrustGraphNodeId,TrustGraphNodeId>> routes =
routingTable.entrySet().iterator();
for (int i = 0; i < routeNumber; i++) { rout... | [
"protected",
"Map",
".",
"Entry",
"<",
"TrustGraphNodeId",
",",
"TrustGraphNodeId",
">",
"randomRoute",
"(",
")",
"{",
"final",
"int",
"routeNumber",
"=",
"rng",
".",
"nextInt",
"(",
"routingTable",
".",
"size",
"(",
")",
")",
";",
"final",
"Iterator",
"<"... | internal helper method to pick a random route from the table. | [
"internal",
"helper",
"method",
"to",
"pick",
"a",
"random",
"route",
"from",
"the",
"table",
"."
] | 7516f05724c8f54e5d535d23da9116817c08a09f | https://github.com/getlantern/kaleidoscope/blob/7516f05724c8f54e5d535d23da9116817c08a09f/src/main/java/org/kaleidoscope/BasicRandomRoutingTable.java#L238-L244 | train |
getlantern/kaleidoscope | src/main/java/org/kaleidoscope/BasicRandomRoutingTable.java | BasicRandomRoutingTable.addNeighbors | @Override
public void addNeighbors(final Collection<TrustGraphNodeId> neighborsIn) {
if (neighborsIn.isEmpty()) {
return;
}
// all modification operations are serialized
synchronized (this) {
/* filter out any neighbors that are already in the routing table
... | java | @Override
public void addNeighbors(final Collection<TrustGraphNodeId> neighborsIn) {
if (neighborsIn.isEmpty()) {
return;
}
// all modification operations are serialized
synchronized (this) {
/* filter out any neighbors that are already in the routing table
... | [
"@",
"Override",
"public",
"void",
"addNeighbors",
"(",
"final",
"Collection",
"<",
"TrustGraphNodeId",
">",
"neighborsIn",
")",
"{",
"if",
"(",
"neighborsIn",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"// all modification operations are serialized",... | Add a group of TrustGraphNeighbors to the routing table.
A maximum of one route is disrupted by this operation,
as many routes as possible are assigned within the group.
Any previously mapped neighbors will be ignored.
@param neighbor the set of TrustGraphNieghbors to add
@see addNeighbor
@see RandomRoutingTable.add... | [
"Add",
"a",
"group",
"of",
"TrustGraphNeighbors",
"to",
"the",
"routing",
"table",
"."
] | 7516f05724c8f54e5d535d23da9116817c08a09f | https://github.com/getlantern/kaleidoscope/blob/7516f05724c8f54e5d535d23da9116817c08a09f/src/main/java/org/kaleidoscope/BasicRandomRoutingTable.java#L258-L345 | train |
getlantern/kaleidoscope | src/main/java/org/kaleidoscope/BasicRandomRoutingTable.java | BasicRandomRoutingTable.removeNeighbor | @Override
public void removeNeighbor(final TrustGraphNodeId neighbor) {
// all modification operations are serialized
synchronized(this) {
// do nothing if there is no entry for the neighbor specified
if (!contains(neighbor)) {
return;
}
... | java | @Override
public void removeNeighbor(final TrustGraphNodeId neighbor) {
// all modification operations are serialized
synchronized(this) {
// do nothing if there is no entry for the neighbor specified
if (!contains(neighbor)) {
return;
}
... | [
"@",
"Override",
"public",
"void",
"removeNeighbor",
"(",
"final",
"TrustGraphNodeId",
"neighbor",
")",
"{",
"// all modification operations are serialized",
"synchronized",
"(",
"this",
")",
"{",
"// do nothing if there is no entry for the neighbor specified",
"if",
"(",
"!"... | Remove a single TrustGraphNodeId from the routing table
If the node is mapped to itself, the route is removed. Otherwise this
operation merges the two routes of the form X -> neighbor ,
neighbor -> Y into X -> Y.
If the table does not contain the referenced neighbor,
this operation has no effect.
@param neighbor the... | [
"Remove",
"a",
"single",
"TrustGraphNodeId",
"from",
"the",
"routing",
"table"
] | 7516f05724c8f54e5d535d23da9116817c08a09f | https://github.com/getlantern/kaleidoscope/blob/7516f05724c8f54e5d535d23da9116817c08a09f/src/main/java/org/kaleidoscope/BasicRandomRoutingTable.java#L414-L429 | train |
getlantern/kaleidoscope | src/main/java/org/kaleidoscope/BasicRandomRoutingTable.java | BasicRandomRoutingTable.removeNeighbors | @Override
public void removeNeighbors(final Collection<TrustGraphNodeId> neighbors) {
synchronized(this) {
// remove the neighbors from the ordering in bulk
removeNeighborsFromOrdering(neighbors);
// just loop over the neighbors and use the single removal operation.
... | java | @Override
public void removeNeighbors(final Collection<TrustGraphNodeId> neighbors) {
synchronized(this) {
// remove the neighbors from the ordering in bulk
removeNeighborsFromOrdering(neighbors);
// just loop over the neighbors and use the single removal operation.
... | [
"@",
"Override",
"public",
"void",
"removeNeighbors",
"(",
"final",
"Collection",
"<",
"TrustGraphNodeId",
">",
"neighbors",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"// remove the neighbors from the ordering in bulk",
"removeNeighborsFromOrdering",
"(",
"neighbor... | Remove a set of TrustGraphNeighbors from the routing table.
This operation does not occur atomically, each neighbor is removed in
turn equivalently to a series of calls to removeNeighbor.
@param neighbors the TrustGraphNeighbors to remove
@see RandomRoutingTable.removeNeighbors | [
"Remove",
"a",
"set",
"of",
"TrustGraphNeighbors",
"from",
"the",
"routing",
"table",
"."
] | 7516f05724c8f54e5d535d23da9116817c08a09f | https://github.com/getlantern/kaleidoscope/blob/7516f05724c8f54e5d535d23da9116817c08a09f/src/main/java/org/kaleidoscope/BasicRandomRoutingTable.java#L440-L449 | train |
getlantern/kaleidoscope | src/main/java/org/kaleidoscope/BasicRandomRoutingTable.java | BasicRandomRoutingTable.addNeighborToOrdering | protected void addNeighborToOrdering(TrustGraphNodeId neighbor) {
int position = rng.nextInt(orderedNeighbors.size()+1);
if (position == orderedNeighbors.size()) {
orderedNeighbors.add(neighbor);
}
else {
orderedNeighbors.add(position, neighbor);
... | java | protected void addNeighborToOrdering(TrustGraphNodeId neighbor) {
int position = rng.nextInt(orderedNeighbors.size()+1);
if (position == orderedNeighbors.size()) {
orderedNeighbors.add(neighbor);
}
else {
orderedNeighbors.add(position, neighbor);
... | [
"protected",
"void",
"addNeighborToOrdering",
"(",
"TrustGraphNodeId",
"neighbor",
")",
"{",
"int",
"position",
"=",
"rng",
".",
"nextInt",
"(",
"orderedNeighbors",
".",
"size",
"(",
")",
"+",
"1",
")",
";",
"if",
"(",
"position",
"==",
"orderedNeighbors",
"... | Internal policy method.
Implements the policy for updating the random ordering of
neighbors when a new neighbor is added. By default this
inserts at the back and then swaps with a random neighbor.
Note: When using this policy, adding neighbors may distrupt the
set of neighbors that are advertised to in the case that
... | [
"Internal",
"policy",
"method",
"."
] | 7516f05724c8f54e5d535d23da9116817c08a09f | https://github.com/getlantern/kaleidoscope/blob/7516f05724c8f54e5d535d23da9116817c08a09f/src/main/java/org/kaleidoscope/BasicRandomRoutingTable.java#L474-L484 | train |
getlantern/kaleidoscope | src/main/java/org/kaleidoscope/BasicRandomRoutingTable.java | BasicRandomRoutingTable.snapshot | @Override
public RandomRoutingTable.Snapshot snapshot() {
// block modification operations while creating the snapshot
synchronized (this) {
return new Snapshot(new HashMap<TrustGraphNodeId,TrustGraphNodeId>(routingTable),
new ArrayList<TrustGraph... | java | @Override
public RandomRoutingTable.Snapshot snapshot() {
// block modification operations while creating the snapshot
synchronized (this) {
return new Snapshot(new HashMap<TrustGraphNodeId,TrustGraphNodeId>(routingTable),
new ArrayList<TrustGraph... | [
"@",
"Override",
"public",
"RandomRoutingTable",
".",
"Snapshot",
"snapshot",
"(",
")",
"{",
"// block modification operations while creating the snapshot",
"synchronized",
"(",
"this",
")",
"{",
"return",
"new",
"Snapshot",
"(",
"new",
"HashMap",
"<",
"TrustGraphNodeId... | Creates a snapshot of the current state of the routing table.
A mapping X->Y between two TrustGraphNeighbors represents that
the next hop of a message received from the neighbor X is Y.
This snapshot will contain each neighbor exactly once as a key
and once as a value.
@return a snapshot of the current state of the r... | [
"Creates",
"a",
"snapshot",
"of",
"the",
"current",
"state",
"of",
"the",
"routing",
"table",
".",
"A",
"mapping",
"X",
"-",
">",
"Y",
"between",
"two",
"TrustGraphNeighbors",
"represents",
"that",
"the",
"next",
"hop",
"of",
"a",
"message",
"received",
"f... | 7516f05724c8f54e5d535d23da9116817c08a09f | https://github.com/getlantern/kaleidoscope/blob/7516f05724c8f54e5d535d23da9116817c08a09f/src/main/java/org/kaleidoscope/BasicRandomRoutingTable.java#L584-L592 | train |
jayantk/jklol | src/com/jayantkrish/jklol/p3/P3Parse.java | P3Parse.getStates | public List<IncEvalState> getStates() {
List<IncEvalState> states = Lists.newArrayList();
getStatesHelper(states);
return states;
} | java | public List<IncEvalState> getStates() {
List<IncEvalState> states = Lists.newArrayList();
getStatesHelper(states);
return states;
} | [
"public",
"List",
"<",
"IncEvalState",
">",
"getStates",
"(",
")",
"{",
"List",
"<",
"IncEvalState",
">",
"states",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"getStatesHelper",
"(",
"states",
")",
";",
"return",
"states",
";",
"}"
] | Gets the result of all evaluations anywhere in this tree.
@return | [
"Gets",
"the",
"result",
"of",
"all",
"evaluations",
"anywhere",
"in",
"this",
"tree",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/p3/P3Parse.java#L133-L137 | train |
lastaflute/lasta-job | src/main/java/org/lastaflute/job/cron4j/Cron4jTask.java | Cron4jTask.actuallyExecute | protected RunnerResult actuallyExecute(JobIdentityAttr identityProvider, String cronExp, VaryingCronOption cronOption,
TaskExecutionContext context, OptionalThing<LaunchNowOption> nowOption) { // in synchronized world
adjustThreadNameIfNeeds(cronOption);
return runJob(identityProvider, cronE... | java | protected RunnerResult actuallyExecute(JobIdentityAttr identityProvider, String cronExp, VaryingCronOption cronOption,
TaskExecutionContext context, OptionalThing<LaunchNowOption> nowOption) { // in synchronized world
adjustThreadNameIfNeeds(cronOption);
return runJob(identityProvider, cronE... | [
"protected",
"RunnerResult",
"actuallyExecute",
"(",
"JobIdentityAttr",
"identityProvider",
",",
"String",
"cronExp",
",",
"VaryingCronOption",
"cronOption",
",",
"TaskExecutionContext",
"context",
",",
"OptionalThing",
"<",
"LaunchNowOption",
">",
"nowOption",
")",
"{",
... | in execution lock, cannot use varingCron here | [
"in",
"execution",
"lock",
"cannot",
"use",
"varingCron",
"here"
] | 5fee7bb1e908463c56b4668de404fd8bce1c2710 | https://github.com/lastaflute/lasta-job/blob/5fee7bb1e908463c56b4668de404fd8bce1c2710/src/main/java/org/lastaflute/job/cron4j/Cron4jTask.java#L352-L356 | train |
getlantern/kaleidoscope | src/main/java/org/kaleidoscope/TrustGraphNode.java | TrustGraphNode.forwardAdvertisement | protected boolean forwardAdvertisement(TrustGraphAdvertisement message) {
// don't forward if the forwarding policy rejects
if (!shouldForward(message)) {
return false;
}
// determine the next hop to send to
TrustGraphNodeId nextHop = getRoutingTable().getNe... | java | protected boolean forwardAdvertisement(TrustGraphAdvertisement message) {
// don't forward if the forwarding policy rejects
if (!shouldForward(message)) {
return false;
}
// determine the next hop to send to
TrustGraphNodeId nextHop = getRoutingTable().getNe... | [
"protected",
"boolean",
"forwardAdvertisement",
"(",
"TrustGraphAdvertisement",
"message",
")",
"{",
"// don't forward if the forwarding policy rejects",
"if",
"(",
"!",
"shouldForward",
"(",
"message",
")",
")",
"{",
"return",
"false",
";",
"}",
"// determine the next ho... | This method performs the forwarding behavior for a received
message. The message is forwarded to the next hop on the
route according to the routing table, with ttl decreased by 1.
The message is dropped if it has an invalid hop count or
the sender of the message is not a known peer (ie is not
paired to another outbou... | [
"This",
"method",
"performs",
"the",
"forwarding",
"behavior",
"for",
"a",
"received",
"message",
".",
"The",
"message",
"is",
"forwarded",
"to",
"the",
"next",
"hop",
"on",
"the",
"route",
"according",
"to",
"the",
"routing",
"table",
"with",
"ttl",
"decrea... | 7516f05724c8f54e5d535d23da9116817c08a09f | https://github.com/getlantern/kaleidoscope/blob/7516f05724c8f54e5d535d23da9116817c08a09f/src/main/java/org/kaleidoscope/TrustGraphNode.java#L254-L273 | train |
HiddenStage/divide | Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java | AuthManager.getUserFromAuthToken | public Observable<BackendUser> getUserFromAuthToken(final String authToken){
return Observable.create(new Observable.OnSubscribe<BackendUser>() {
@Override
public void call(Subscriber<? super BackendUser> subscriber) {
try{
setLoginState(LOGGING_IN);
... | java | public Observable<BackendUser> getUserFromAuthToken(final String authToken){
return Observable.create(new Observable.OnSubscribe<BackendUser>() {
@Override
public void call(Subscriber<? super BackendUser> subscriber) {
try{
setLoginState(LOGGING_IN);
... | [
"public",
"Observable",
"<",
"BackendUser",
">",
"getUserFromAuthToken",
"(",
"final",
"String",
"authToken",
")",
"{",
"return",
"Observable",
".",
"create",
"(",
"new",
"Observable",
".",
"OnSubscribe",
"<",
"BackendUser",
">",
"(",
")",
"{",
"@",
"Override"... | Login using user authentication token
@param authToken authentication user for user.
@return Logged in user. | [
"Login",
"using",
"user",
"authentication",
"token"
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java#L108-L126 | train |
HiddenStage/divide | Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java | AuthManager.getUserFromRecoveryToken | public Observable<BackendUser> getUserFromRecoveryToken(final String recoveryToken){
return Observable.create(new Observable.OnSubscribe<BackendUser>() {
@Override
public void call(Subscriber<? super BackendUser> subscriber) {
try{
setLoginState(LOGGIN... | java | public Observable<BackendUser> getUserFromRecoveryToken(final String recoveryToken){
return Observable.create(new Observable.OnSubscribe<BackendUser>() {
@Override
public void call(Subscriber<? super BackendUser> subscriber) {
try{
setLoginState(LOGGIN... | [
"public",
"Observable",
"<",
"BackendUser",
">",
"getUserFromRecoveryToken",
"(",
"final",
"String",
"recoveryToken",
")",
"{",
"return",
"Observable",
".",
"create",
"(",
"new",
"Observable",
".",
"OnSubscribe",
"<",
"BackendUser",
">",
"(",
")",
"{",
"@",
"O... | Login using user recovery token
@param recoveryToken recovery token for user.
@return Logged in user. | [
"Login",
"using",
"user",
"recovery",
"token"
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java#L133-L150 | train |
HiddenStage/divide | Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java | AuthManager.logout | public void logout(){
List<LocalCredentials> accountList = accountStorage.getAccounts();
if(accountList.size() == 1){
String userName = accountList.get(0).getName();
logger.debug("logout: " + userName);
accountStorage.removeAccount(userName);
user = null;
... | java | public void logout(){
List<LocalCredentials> accountList = accountStorage.getAccounts();
if(accountList.size() == 1){
String userName = accountList.get(0).getName();
logger.debug("logout: " + userName);
accountStorage.removeAccount(userName);
user = null;
... | [
"public",
"void",
"logout",
"(",
")",
"{",
"List",
"<",
"LocalCredentials",
">",
"accountList",
"=",
"accountStorage",
".",
"getAccounts",
"(",
")",
";",
"if",
"(",
"accountList",
".",
"size",
"(",
")",
"==",
"1",
")",
"{",
"String",
"userName",
"=",
"... | Log out current user if logged in. | [
"Log",
"out",
"current",
"user",
"if",
"logged",
"in",
"."
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java#L163-L172 | train |
HiddenStage/divide | Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java | AuthManager.getServerKey | public PublicKey getServerKey(){
logger.debug("getServerKey()");
try {
if(serverPublicKey!=null) return serverPublicKey;
byte[] pubKey = getWebService().getPublicKey();
logger.debug("pubKey: " + String.valueOf(pubKey));
serverPublicKey = Crypto.pubKeyFrom... | java | public PublicKey getServerKey(){
logger.debug("getServerKey()");
try {
if(serverPublicKey!=null) return serverPublicKey;
byte[] pubKey = getWebService().getPublicKey();
logger.debug("pubKey: " + String.valueOf(pubKey));
serverPublicKey = Crypto.pubKeyFrom... | [
"public",
"PublicKey",
"getServerKey",
"(",
")",
"{",
"logger",
".",
"debug",
"(",
"\"getServerKey()\"",
")",
";",
"try",
"{",
"if",
"(",
"serverPublicKey",
"!=",
"null",
")",
"return",
"serverPublicKey",
";",
"byte",
"[",
"]",
"pubKey",
"=",
"getWebService"... | Returns server public key. Queries server or local copy.
@return Server public key. | [
"Returns",
"server",
"public",
"key",
".",
"Queries",
"server",
"or",
"local",
"copy",
"."
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java#L216-L230 | train |
HiddenStage/divide | Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java | AuthManager.signUp | public SignUpResponse signUp(SignUpCredentials loginCreds){
logger.debug("signUp(" + loginCreds + ")");
try {
setLoginState(LOGGING_IN);
PublicKey key = Crypto.pubKeyFromBytes(getWebService().getPublicKey());
loginCreds.encryptPassword(key);
logger.debug... | java | public SignUpResponse signUp(SignUpCredentials loginCreds){
logger.debug("signUp(" + loginCreds + ")");
try {
setLoginState(LOGGING_IN);
PublicKey key = Crypto.pubKeyFromBytes(getWebService().getPublicKey());
loginCreds.encryptPassword(key);
logger.debug... | [
"public",
"SignUpResponse",
"signUp",
"(",
"SignUpCredentials",
"loginCreds",
")",
"{",
"logger",
".",
"debug",
"(",
"\"signUp(\"",
"+",
"loginCreds",
"+",
"\")\"",
")",
";",
"try",
"{",
"setLoginState",
"(",
"LOGGING_IN",
")",
";",
"PublicKey",
"key",
"=",
... | Syncronously attempt to create user account
@param loginCreds Credentials used to create account.
@return Response of the operation | [
"Syncronously",
"attempt",
"to",
"create",
"user",
"account"
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java#L237-L261 | train |
HiddenStage/divide | Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java | AuthManager.signUpASync | public Observable<BackendUser> signUpASync(final SignUpCredentials signInCreds){
logger.debug("signUpASync("+signInCreds+")");
try {
setLoginState(LOGGING_IN);
return getWebService().getPublicKeyA().flatMap(new Func1<byte[], Observable<SignUpCredentials>>() {
@Ov... | java | public Observable<BackendUser> signUpASync(final SignUpCredentials signInCreds){
logger.debug("signUpASync("+signInCreds+")");
try {
setLoginState(LOGGING_IN);
return getWebService().getPublicKeyA().flatMap(new Func1<byte[], Observable<SignUpCredentials>>() {
@Ov... | [
"public",
"Observable",
"<",
"BackendUser",
">",
"signUpASync",
"(",
"final",
"SignUpCredentials",
"signInCreds",
")",
"{",
"logger",
".",
"debug",
"(",
"\"signUpASync(\"",
"+",
"signInCreds",
"+",
"\")\"",
")",
";",
"try",
"{",
"setLoginState",
"(",
"LOGGING_IN... | Asyncronously attempt to create user account
@param signInCreds Credentials used to create account.
@return Response of the operation | [
"Asyncronously",
"attempt",
"to",
"create",
"user",
"account"
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java#L268-L301 | train |
HiddenStage/divide | Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java | AuthManager.login | public SignInResponse login(final LoginCredentials loginCreds){
logger.debug("login("+loginCreds+")");
try{
setLoginState(LOGGING_IN);
if(!loginCreds.isEncrypted()){
PublicKey key = Crypto.pubKeyFromBytes(getWebService().getPublicKey());
loginCred... | java | public SignInResponse login(final LoginCredentials loginCreds){
logger.debug("login("+loginCreds+")");
try{
setLoginState(LOGGING_IN);
if(!loginCreds.isEncrypted()){
PublicKey key = Crypto.pubKeyFromBytes(getWebService().getPublicKey());
loginCred... | [
"public",
"SignInResponse",
"login",
"(",
"final",
"LoginCredentials",
"loginCreds",
")",
"{",
"logger",
".",
"debug",
"(",
"\"login(\"",
"+",
"loginCreds",
"+",
"\")\"",
")",
";",
"try",
"{",
"setLoginState",
"(",
"LOGGING_IN",
")",
";",
"if",
"(",
"!",
"... | Syncronously attempt to log into user account
@param loginCreds Credentials used to login.
@return Response of the operation | [
"Syncronously",
"attempt",
"to",
"log",
"into",
"user",
"account"
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java#L308-L336 | train |
HiddenStage/divide | Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java | AuthManager.loginASync | public Observable<BackendUser> loginASync(final LoginCredentials loginCreds){
logger.debug("loginASync("+loginCreds+")");
try{
setLoginState(LOGGING_IN);
return getWebService().getPublicKeyA().flatMap(new Func1<byte[], Observable<LoginCredentials>>() {
@Override
... | java | public Observable<BackendUser> loginASync(final LoginCredentials loginCreds){
logger.debug("loginASync("+loginCreds+")");
try{
setLoginState(LOGGING_IN);
return getWebService().getPublicKeyA().flatMap(new Func1<byte[], Observable<LoginCredentials>>() {
@Override
... | [
"public",
"Observable",
"<",
"BackendUser",
">",
"loginASync",
"(",
"final",
"LoginCredentials",
"loginCreds",
")",
"{",
"logger",
".",
"debug",
"(",
"\"loginASync(\"",
"+",
"loginCreds",
"+",
"\")\"",
")",
";",
"try",
"{",
"setLoginState",
"(",
"LOGGING_IN",
... | Asyncronously attempt to log into user account
@param loginCreds Credentials used to login.
@return Response of the operation | [
"Asyncronously",
"attempt",
"to",
"log",
"into",
"user",
"account"
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java#L343-L379 | train |
HiddenStage/divide | Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java | AuthManager.sendUserData | public Observable<Void> sendUserData(BackendUser backendUser){
return getWebService().sendUserData(isLoggedIn(),backendUser.getOwnerId()+"",backendUser.getUserData())
.subscribeOn(config.subscribeOn()).observeOn(config.observeOn());
} | java | public Observable<Void> sendUserData(BackendUser backendUser){
return getWebService().sendUserData(isLoggedIn(),backendUser.getOwnerId()+"",backendUser.getUserData())
.subscribeOn(config.subscribeOn()).observeOn(config.observeOn());
} | [
"public",
"Observable",
"<",
"Void",
">",
"sendUserData",
"(",
"BackendUser",
"backendUser",
")",
"{",
"return",
"getWebService",
"(",
")",
".",
"sendUserData",
"(",
"isLoggedIn",
"(",
")",
",",
"backendUser",
".",
"getOwnerId",
"(",
")",
"+",
"\"\"",
",",
... | Update remote server with new user data.
@return status of update. | [
"Update",
"remote",
"server",
"with",
"new",
"user",
"data",
"."
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java#L390-L393 | train |
HiddenStage/divide | Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java | AuthManager.getUserData | public Observable<Map<String,Object>> getUserData(BackendUser backendUser){
return getWebService().getUserData(isLoggedIn(), backendUser.getOwnerId() + "")
.subscribeOn(config.subscribeOn()).observeOn(config.observeOn());
} | java | public Observable<Map<String,Object>> getUserData(BackendUser backendUser){
return getWebService().getUserData(isLoggedIn(), backendUser.getOwnerId() + "")
.subscribeOn(config.subscribeOn()).observeOn(config.observeOn());
} | [
"public",
"Observable",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"getUserData",
"(",
"BackendUser",
"backendUser",
")",
"{",
"return",
"getWebService",
"(",
")",
".",
"getUserData",
"(",
"isLoggedIn",
"(",
")",
",",
"backendUser",
".",
"getOwnerId... | Query server to return user data for the logged in user
@return updated BackendUser. | [
"Query",
"server",
"to",
"return",
"user",
"data",
"for",
"the",
"logged",
"in",
"user"
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java#L399-L402 | train |
HiddenStage/divide | Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java | AuthManager.addLoginListener | public void addLoginListener(LoginListener listener){
logger.debug("addLoginListener");
Subscription subscription = loginEventPublisher
.subscribeOn(config.subscribeOn())
.observeOn(config.observeOn())
.subscribe(listener);
listener.setSubscription... | java | public void addLoginListener(LoginListener listener){
logger.debug("addLoginListener");
Subscription subscription = loginEventPublisher
.subscribeOn(config.subscribeOn())
.observeOn(config.observeOn())
.subscribe(listener);
listener.setSubscription... | [
"public",
"void",
"addLoginListener",
"(",
"LoginListener",
"listener",
")",
"{",
"logger",
".",
"debug",
"(",
"\"addLoginListener\"",
")",
";",
"Subscription",
"subscription",
"=",
"loginEventPublisher",
".",
"subscribeOn",
"(",
"config",
".",
"subscribeOn",
"(",
... | Add loginListener to listen to login events
@param listener LoginListener to receive events. | [
"Add",
"loginListener",
"to",
"listen",
"to",
"login",
"events"
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/java-client/src/main/java/io/divide/client/auth/AuthManager.java#L413-L420 | train |
jayantk/jklol | src/com/jayantkrish/jklol/cli/AbstractCli.java | AbstractCli.processOptions | private void processOptions(OptionSet options) {
Pseudorandom.get().setSeed(options.valueOf(randomSeed));
if (opts.contains(CommonOptions.MAP_REDUCE)) {
MapReduceConfiguration.setMapReduceExecutor(new LocalMapReduceExecutor(
options.valueOf(mrMaxThreads), options.valueOf(mrMaxBatchesPerThread))... | java | private void processOptions(OptionSet options) {
Pseudorandom.get().setSeed(options.valueOf(randomSeed));
if (opts.contains(CommonOptions.MAP_REDUCE)) {
MapReduceConfiguration.setMapReduceExecutor(new LocalMapReduceExecutor(
options.valueOf(mrMaxThreads), options.valueOf(mrMaxBatchesPerThread))... | [
"private",
"void",
"processOptions",
"(",
"OptionSet",
"options",
")",
"{",
"Pseudorandom",
".",
"get",
"(",
")",
".",
"setSeed",
"(",
"options",
".",
"valueOf",
"(",
"randomSeed",
")",
")",
";",
"if",
"(",
"opts",
".",
"contains",
"(",
"CommonOptions",
... | Initializes program state using any options processable by this
class.
@param options | [
"Initializes",
"program",
"state",
"using",
"any",
"options",
"processable",
"by",
"this",
"class",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/cli/AbstractCli.java#L349-L367 | train |
davidcarboni/cryptolite-java | src/main/java/com/github/davidcarboni/cryptolite/ByteArray.java | ByteArray.toBase64 | public static String toBase64(byte[] byteArray) {
String result = null;
if (byteArray != null) {
result = Base64.encodeBase64String(byteArray);
}
return result;
} | java | public static String toBase64(byte[] byteArray) {
String result = null;
if (byteArray != null) {
result = Base64.encodeBase64String(byteArray);
}
return result;
} | [
"public",
"static",
"String",
"toBase64",
"(",
"byte",
"[",
"]",
"byteArray",
")",
"{",
"String",
"result",
"=",
"null",
";",
"if",
"(",
"byteArray",
"!=",
"null",
")",
"{",
"result",
"=",
"Base64",
".",
"encodeBase64String",
"(",
"byteArray",
")",
";",
... | Encodes the given byte array as a base-64 String.
@param byteArray The byte array to be encoded.
@return The byte array encoded using base-64. | [
"Encodes",
"the",
"given",
"byte",
"array",
"as",
"a",
"base",
"-",
"64",
"String",
"."
] | e67954181a04ffc9beb1d9abca1421195fcf9764 | https://github.com/davidcarboni/cryptolite-java/blob/e67954181a04ffc9beb1d9abca1421195fcf9764/src/main/java/com/github/davidcarboni/cryptolite/ByteArray.java#L91-L98 | train |
davidcarboni/cryptolite-java | src/main/java/com/github/davidcarboni/cryptolite/ByteArray.java | ByteArray.fromBase64 | public static byte[] fromBase64(String base64String) {
byte[] result = null;
if (base64String != null) {
result = Base64.decodeBase64(base64String);
}
return result;
} | java | public static byte[] fromBase64(String base64String) {
byte[] result = null;
if (base64String != null) {
result = Base64.decodeBase64(base64String);
}
return result;
} | [
"public",
"static",
"byte",
"[",
"]",
"fromBase64",
"(",
"String",
"base64String",
")",
"{",
"byte",
"[",
"]",
"result",
"=",
"null",
";",
"if",
"(",
"base64String",
"!=",
"null",
")",
"{",
"result",
"=",
"Base64",
".",
"decodeBase64",
"(",
"base64String... | Decodes the given base-64 string to a byte array.
@param base64String A base-64 encoded string.
@return The decoded byte array. | [
"Decodes",
"the",
"given",
"base",
"-",
"64",
"string",
"to",
"a",
"byte",
"array",
"."
] | e67954181a04ffc9beb1d9abca1421195fcf9764 | https://github.com/davidcarboni/cryptolite-java/blob/e67954181a04ffc9beb1d9abca1421195fcf9764/src/main/java/com/github/davidcarboni/cryptolite/ByteArray.java#L106-L113 | train |
davidcarboni/cryptolite-java | src/main/java/com/github/davidcarboni/cryptolite/ByteArray.java | ByteArray.fromString | public static byte[] fromString(String unicodeString) {
byte[] result = null;
if (unicodeString != null) {
result = unicodeString.getBytes(StandardCharsets.UTF_8);
}
return result;
} | java | public static byte[] fromString(String unicodeString) {
byte[] result = null;
if (unicodeString != null) {
result = unicodeString.getBytes(StandardCharsets.UTF_8);
}
return result;
} | [
"public",
"static",
"byte",
"[",
"]",
"fromString",
"(",
"String",
"unicodeString",
")",
"{",
"byte",
"[",
"]",
"result",
"=",
"null",
";",
"if",
"(",
"unicodeString",
"!=",
"null",
")",
"{",
"result",
"=",
"unicodeString",
".",
"getBytes",
"(",
"Standar... | Converts the given String to a byte array.
@param unicodeString The String to be converted to a byte array.
@return A byte array representing the String. | [
"Converts",
"the",
"given",
"String",
"to",
"a",
"byte",
"array",
"."
] | e67954181a04ffc9beb1d9abca1421195fcf9764 | https://github.com/davidcarboni/cryptolite-java/blob/e67954181a04ffc9beb1d9abca1421195fcf9764/src/main/java/com/github/davidcarboni/cryptolite/ByteArray.java#L136-L143 | train |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/lambda2/TypeInference.java | TypeInference.infer | public void infer() {
scopes = StaticAnalysis.getScopes(expression);
expressionTypes = Maps.newHashMap();
constraints = ConstraintSet.empty();
for (Scope scope : scopes.getScopes()) {
for (String variable : scope.getBoundVariables()) {
int location = scope.getBindingIndex(variable);
... | java | public void infer() {
scopes = StaticAnalysis.getScopes(expression);
expressionTypes = Maps.newHashMap();
constraints = ConstraintSet.empty();
for (Scope scope : scopes.getScopes()) {
for (String variable : scope.getBoundVariables()) {
int location = scope.getBindingIndex(variable);
... | [
"public",
"void",
"infer",
"(",
")",
"{",
"scopes",
"=",
"StaticAnalysis",
".",
"getScopes",
"(",
"expression",
")",
";",
"expressionTypes",
"=",
"Maps",
".",
"newHashMap",
"(",
")",
";",
"constraints",
"=",
"ConstraintSet",
".",
"empty",
"(",
")",
";",
... | Run type inference. | [
"Run",
"type",
"inference",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/lambda2/TypeInference.java#L81-L101 | train |
HiddenStage/divide | Shared/src/main/java/io/divide/shared/util/Crypto.java | Crypto.concat | private static byte[] concat(byte[] a, byte[] b)
{
byte[] c = new byte[a.length + b.length];
System.arraycopy(a, 0, c, 0, a.length);
System.arraycopy(b, 0, c, a.length, b.length);
return c;
} | java | private static byte[] concat(byte[] a, byte[] b)
{
byte[] c = new byte[a.length + b.length];
System.arraycopy(a, 0, c, 0, a.length);
System.arraycopy(b, 0, c, a.length, b.length);
return c;
} | [
"private",
"static",
"byte",
"[",
"]",
"concat",
"(",
"byte",
"[",
"]",
"a",
",",
"byte",
"[",
"]",
"b",
")",
"{",
"byte",
"[",
"]",
"c",
"=",
"new",
"byte",
"[",
"a",
".",
"length",
"+",
"b",
".",
"length",
"]",
";",
"System",
".",
"arraycop... | Concatenates two byte arrays and returns the resulting byte array.
@param a first byte array
@param b second byte array
@return byte array containing first and second byte array | [
"Concatenates",
"two",
"byte",
"arrays",
"and",
"returns",
"the",
"resulting",
"byte",
"array",
"."
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Shared/src/main/java/io/divide/shared/util/Crypto.java#L225-L232 | train |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/CcgSyntaxTree.java | CcgSyntaxTree.getAllSpannedLexiconEntries | public List<SyntacticCategory> getAllSpannedLexiconEntries() {
List<SyntacticCategory> categories = Lists.newArrayList();
getAllSpannedLexiconEntriesHelper(categories);
return categories;
} | java | public List<SyntacticCategory> getAllSpannedLexiconEntries() {
List<SyntacticCategory> categories = Lists.newArrayList();
getAllSpannedLexiconEntriesHelper(categories);
return categories;
} | [
"public",
"List",
"<",
"SyntacticCategory",
">",
"getAllSpannedLexiconEntries",
"(",
")",
"{",
"List",
"<",
"SyntacticCategory",
">",
"categories",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"getAllSpannedLexiconEntriesHelper",
"(",
"categories",
")",
";",
... | Gets the syntactic categories assigned to the words in
this parse.
@return | [
"Gets",
"the",
"syntactic",
"categories",
"assigned",
"to",
"the",
"words",
"in",
"this",
"parse",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/CcgSyntaxTree.java#L174-L178 | train |
HiddenStage/divide | Shared/src/main/java/io/divide/shared/util/Base64.java | Base64.encodeEnternal | private static byte[] encodeEnternal(byte[] d)
{
if (d == null) return null;
byte data[] = new byte[d.length+2];
System.arraycopy(d, 0, data, 0, d.length);
byte dest[] = new byte[(data.length/3)*4];
// 3-byte to 4-byte conversion
for (int sidx = 0, didx=0; sidx < d.l... | java | private static byte[] encodeEnternal(byte[] d)
{
if (d == null) return null;
byte data[] = new byte[d.length+2];
System.arraycopy(d, 0, data, 0, d.length);
byte dest[] = new byte[(data.length/3)*4];
// 3-byte to 4-byte conversion
for (int sidx = 0, didx=0; sidx < d.l... | [
"private",
"static",
"byte",
"[",
"]",
"encodeEnternal",
"(",
"byte",
"[",
"]",
"d",
")",
"{",
"if",
"(",
"d",
"==",
"null",
")",
"return",
"null",
";",
"byte",
"data",
"[",
"]",
"=",
"new",
"byte",
"[",
"d",
".",
"length",
"+",
"2",
"]",
";",
... | Encode some data and return a String. | [
"Encode",
"some",
"data",
"and",
"return",
"a",
"String",
"."
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Shared/src/main/java/io/divide/shared/util/Base64.java#L55-L89 | train |
HiddenStage/divide | Shared/src/main/java/io/divide/shared/util/Base64.java | Base64.decodeInternal | private static byte[] decodeInternal(byte[] data)
{
int tail = data.length;
while (data[tail-1] == '=') tail--;
byte dest[] = new byte[tail - data.length/4];
// ascii printable to 0-63 conversion
for (int idx = 0; idx <data.length; idx++)
{
if (data[idx]... | java | private static byte[] decodeInternal(byte[] data)
{
int tail = data.length;
while (data[tail-1] == '=') tail--;
byte dest[] = new byte[tail - data.length/4];
// ascii printable to 0-63 conversion
for (int idx = 0; idx <data.length; idx++)
{
if (data[idx]... | [
"private",
"static",
"byte",
"[",
"]",
"decodeInternal",
"(",
"byte",
"[",
"]",
"data",
")",
"{",
"int",
"tail",
"=",
"data",
".",
"length",
";",
"while",
"(",
"data",
"[",
"tail",
"-",
"1",
"]",
"==",
"'",
"'",
")",
"tail",
"--",
";",
"byte",
... | Decode data and return bytes. Assumes that the data passed
in is ASCII text. | [
"Decode",
"data",
"and",
"return",
"bytes",
".",
"Assumes",
"that",
"the",
"data",
"passed",
"in",
"is",
"ASCII",
"text",
"."
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Shared/src/main/java/io/divide/shared/util/Base64.java#L95-L137 | train |
ivanceras/orm | src/main/java/com/ivanceras/db/server/core/DB_PostgreSQL.java | DB_PostgreSQL.jsonToObject | private Object jsonToObject(String recordValue) throws JsonParseException, JsonMappingException, IOException{
ObjectMapper mapper = new ObjectMapper();
Object json = mapper.readValue(recordValue, Object.class);
return json;
} | java | private Object jsonToObject(String recordValue) throws JsonParseException, JsonMappingException, IOException{
ObjectMapper mapper = new ObjectMapper();
Object json = mapper.readValue(recordValue, Object.class);
return json;
} | [
"private",
"Object",
"jsonToObject",
"(",
"String",
"recordValue",
")",
"throws",
"JsonParseException",
",",
"JsonMappingException",
",",
"IOException",
"{",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"Object",
"json",
"=",
"mapper",
".",... | Remapping json directly to object as opposed to traversing the tree
@param recordValue
@return
@throws JsonParseException
@throws JsonMappingException
@throws IOException | [
"Remapping",
"json",
"directly",
"to",
"object",
"as",
"opposed",
"to",
"traversing",
"the",
"tree"
] | e63213cb8abefd11df0e2d34b1c95477788e600e | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/core/DB_PostgreSQL.java#L789-L793 | train |
ivanceras/orm | src/main/java/com/ivanceras/db/server/core/DB_PostgreSQL.java | DB_PostgreSQL.correctDataTypes | @Override
public void correctDataTypes(DAO[] daoList, ModelDef model) {
for(DAO dao : daoList){
correctDataTypes(dao, model);
}
} | java | @Override
public void correctDataTypes(DAO[] daoList, ModelDef model) {
for(DAO dao : daoList){
correctDataTypes(dao, model);
}
} | [
"@",
"Override",
"public",
"void",
"correctDataTypes",
"(",
"DAO",
"[",
"]",
"daoList",
",",
"ModelDef",
"model",
")",
"{",
"for",
"(",
"DAO",
"dao",
":",
"daoList",
")",
"{",
"correctDataTypes",
"(",
"dao",
",",
"model",
")",
";",
"}",
"}"
] | Most of postgresql database datatype already mapped to the correct data type by the JDBC | [
"Most",
"of",
"postgresql",
"database",
"datatype",
"already",
"mapped",
"to",
"the",
"correct",
"data",
"type",
"by",
"the",
"JDBC"
] | e63213cb8abefd11df0e2d34b1c95477788e600e | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/core/DB_PostgreSQL.java#L856-L861 | train |
ivanceras/orm | src/main/java/com/ivanceras/db/server/core/DB_PostgreSQL.java | DB_PostgreSQL.correctDataType | private Object correctDataType(Object value, String dataType) {
if(value == null ){return null;}
return value;
} | java | private Object correctDataType(Object value, String dataType) {
if(value == null ){return null;}
return value;
} | [
"private",
"Object",
"correctDataType",
"(",
"Object",
"value",
",",
"String",
"dataType",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"value",
";",
"}"
] | add logic here if PostgreSQL JDBC didn't map DB data type to their correct Java Data type
@param value
@param dataType
@return | [
"add",
"logic",
"here",
"if",
"PostgreSQL",
"JDBC",
"didn",
"t",
"map",
"DB",
"data",
"type",
"to",
"their",
"correct",
"Java",
"Data",
"type"
] | e63213cb8abefd11df0e2d34b1c95477788e600e | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/core/DB_PostgreSQL.java#L881-L884 | train |
cpollet/jixture | core/src/main/java/net/cpollet/jixture/fixtures/capacities/filtering/FilterableFixtureProxy.java | FilterableFixtureProxy.filter | @Override
public boolean filter(Object entity) {
if (fixture instanceof FilterableFixture) {
return filterableFixture().filter(entity);
}
return true;
} | java | @Override
public boolean filter(Object entity) {
if (fixture instanceof FilterableFixture) {
return filterableFixture().filter(entity);
}
return true;
} | [
"@",
"Override",
"public",
"boolean",
"filter",
"(",
"Object",
"entity",
")",
"{",
"if",
"(",
"fixture",
"instanceof",
"FilterableFixture",
")",
"{",
"return",
"filterableFixture",
"(",
")",
".",
"filter",
"(",
"entity",
")",
";",
"}",
"return",
"true",
";... | Determines whether the entity must be inserted in database or not.
@param entity the entity to filter.
@return {@code true} if the entity must be inserted. | [
"Determines",
"whether",
"the",
"entity",
"must",
"be",
"inserted",
"in",
"database",
"or",
"not",
"."
] | faef0d4991f81c2cdb5be3ba24176636ef0cc433 | https://github.com/cpollet/jixture/blob/faef0d4991f81c2cdb5be3ba24176636ef0cc433/core/src/main/java/net/cpollet/jixture/fixtures/capacities/filtering/FilterableFixtureProxy.java#L51-L58 | train |
lite2073/email-validator | src/com/dominicsayers/isemail/intl/UniPunyCode.java | UniPunyCode.isUnicode | public static boolean isUnicode(String str) {
if (str == null) {
return false;
}
return (!IDN.toASCII(str).equals(str));
} | java | public static boolean isUnicode(String str) {
if (str == null) {
return false;
}
return (!IDN.toASCII(str).equals(str));
} | [
"public",
"static",
"boolean",
"isUnicode",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"!",
"IDN",
".",
"toASCII",
"(",
"str",
")",
".",
"equals",
"(",
"str",
")",
")",
";... | Determinates if a given string can be converted into Punycode.
@param str
The string which should be checked
@return Boolean which shows if the string is not yet punicoded. | [
"Determinates",
"if",
"a",
"given",
"string",
"can",
"be",
"converted",
"into",
"Punycode",
"."
] | cfdda77ed630854b44d62def0d5b7228d5c4e712 | https://github.com/lite2073/email-validator/blob/cfdda77ed630854b44d62def0d5b7228d5c4e712/src/com/dominicsayers/isemail/intl/UniPunyCode.java#L20-L25 | train |
lite2073/email-validator | src/com/dominicsayers/isemail/intl/UniPunyCode.java | UniPunyCode.isPunycode | public static boolean isPunycode(String str) {
if (str == null) {
return false;
}
return (!IDN.toUnicode(str).equals(str));
} | java | public static boolean isPunycode(String str) {
if (str == null) {
return false;
}
return (!IDN.toUnicode(str).equals(str));
} | [
"public",
"static",
"boolean",
"isPunycode",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"!",
"IDN",
".",
"toUnicode",
"(",
"str",
")",
".",
"equals",
"(",
"str",
")",
")",
... | Determinates if a given string is in Punycode format.
@param str
The string which should be checked
@return Boolean which shows if the string is punycoded or not. | [
"Determinates",
"if",
"a",
"given",
"string",
"is",
"in",
"Punycode",
"format",
"."
] | cfdda77ed630854b44d62def0d5b7228d5c4e712 | https://github.com/lite2073/email-validator/blob/cfdda77ed630854b44d62def0d5b7228d5c4e712/src/com/dominicsayers/isemail/intl/UniPunyCode.java#L34-L39 | train |
jayantk/jklol | src/com/jayantkrish/jklol/models/FactorGraph.java | FactorGraph.outcomeToAssignment | public Assignment outcomeToAssignment(List<String> factorVariables, List<? extends Object> outcome) {
assert factorVariables.size() == outcome.size();
int[] varNums = new int[factorVariables.size()];
Object[] values = new Object[factorVariables.size()];
for (int i = 0; i < factorVariables.size(); i++) ... | java | public Assignment outcomeToAssignment(List<String> factorVariables, List<? extends Object> outcome) {
assert factorVariables.size() == outcome.size();
int[] varNums = new int[factorVariables.size()];
Object[] values = new Object[factorVariables.size()];
for (int i = 0; i < factorVariables.size(); i++) ... | [
"public",
"Assignment",
"outcomeToAssignment",
"(",
"List",
"<",
"String",
">",
"factorVariables",
",",
"List",
"<",
"?",
"extends",
"Object",
">",
"outcome",
")",
"{",
"assert",
"factorVariables",
".",
"size",
"(",
")",
"==",
"outcome",
".",
"size",
"(",
... | Gets an assignment for the named set of variables. | [
"Gets",
"an",
"assignment",
"for",
"the",
"named",
"set",
"of",
"variables",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/models/FactorGraph.java#L331-L342 | train |
jayantk/jklol | src/com/jayantkrish/jklol/models/FactorGraph.java | FactorGraph.getSharedVariables | public Set<Integer> getSharedVariables(int factor1, int factor2) {
Set<Integer> varNums = new HashSet<Integer>(factorVariableMap.get(factor1));
varNums.retainAll(factorVariableMap.get(factor2));
return varNums;
} | java | public Set<Integer> getSharedVariables(int factor1, int factor2) {
Set<Integer> varNums = new HashSet<Integer>(factorVariableMap.get(factor1));
varNums.retainAll(factorVariableMap.get(factor2));
return varNums;
} | [
"public",
"Set",
"<",
"Integer",
">",
"getSharedVariables",
"(",
"int",
"factor1",
",",
"int",
"factor2",
")",
"{",
"Set",
"<",
"Integer",
">",
"varNums",
"=",
"new",
"HashSet",
"<",
"Integer",
">",
"(",
"factorVariableMap",
".",
"get",
"(",
"factor1",
"... | Get all of the variables that the two factors have in common. | [
"Get",
"all",
"of",
"the",
"variables",
"that",
"the",
"two",
"factors",
"have",
"in",
"common",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/models/FactorGraph.java#L377-L381 | train |
jayantk/jklol | src/com/jayantkrish/jklol/preprocessing/FeatureGenerators.java | FeatureGenerators.convertingFeatureGenerator | public static <A, B, C> FeatureGenerator<A, C> convertingFeatureGenerator(
FeatureGenerator<B, C> generator, Function<A, B> converter) {
return new ConvertingFeatureGenerator<A, B, C>(generator, converter);
} | java | public static <A, B, C> FeatureGenerator<A, C> convertingFeatureGenerator(
FeatureGenerator<B, C> generator, Function<A, B> converter) {
return new ConvertingFeatureGenerator<A, B, C>(generator, converter);
} | [
"public",
"static",
"<",
"A",
",",
"B",
",",
"C",
">",
"FeatureGenerator",
"<",
"A",
",",
"C",
">",
"convertingFeatureGenerator",
"(",
"FeatureGenerator",
"<",
"B",
",",
"C",
">",
"generator",
",",
"Function",
"<",
"A",
",",
"B",
">",
"converter",
")",... | Gets a feature generator that first converts the data,
then applies a given feature generator.
@param generator
@param converter
@return | [
"Gets",
"a",
"feature",
"generator",
"that",
"first",
"converts",
"the",
"data",
"then",
"applies",
"a",
"given",
"feature",
"generator",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/preprocessing/FeatureGenerators.java#L81-L84 | train |
jayantk/jklol | src/com/jayantkrish/jklol/preprocessing/FeatureGenerators.java | FeatureGenerators.postConvertingFeatureGenerator | public static <A, B, C> FeatureGenerator<A, C> postConvertingFeatureGenerator(
FeatureGenerator<A, B> generator, Function<B, C> converter) {
return new PostConvertingFeatureGenerator<A, B, C>(generator, converter);
} | java | public static <A, B, C> FeatureGenerator<A, C> postConvertingFeatureGenerator(
FeatureGenerator<A, B> generator, Function<B, C> converter) {
return new PostConvertingFeatureGenerator<A, B, C>(generator, converter);
} | [
"public",
"static",
"<",
"A",
",",
"B",
",",
"C",
">",
"FeatureGenerator",
"<",
"A",
",",
"C",
">",
"postConvertingFeatureGenerator",
"(",
"FeatureGenerator",
"<",
"A",
",",
"B",
">",
"generator",
",",
"Function",
"<",
"B",
",",
"C",
">",
"converter",
... | Gets a feature generator that applies a generator, then
applies a converter to the generated feature names.
@param generator
@param converter
@return | [
"Gets",
"a",
"feature",
"generator",
"that",
"applies",
"a",
"generator",
"then",
"applies",
"a",
"converter",
"to",
"the",
"generated",
"feature",
"names",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/preprocessing/FeatureGenerators.java#L94-L97 | train |
jayantk/jklol | src/com/jayantkrish/jklol/probdb/TableAssignment.java | TableAssignment.getTuples | public List<List<Object>> getTuples() {
Iterator<KeyValue> keyValueIter = indicators.keyValueIterator();
List<List<Object>> tuples = Lists.newArrayList();
while (keyValueIter.hasNext()) {
KeyValue keyValue = keyValueIter.next();
if (keyValue.getValue() != 0.0) {
tuples.add(vars.intArrayT... | java | public List<List<Object>> getTuples() {
Iterator<KeyValue> keyValueIter = indicators.keyValueIterator();
List<List<Object>> tuples = Lists.newArrayList();
while (keyValueIter.hasNext()) {
KeyValue keyValue = keyValueIter.next();
if (keyValue.getValue() != 0.0) {
tuples.add(vars.intArrayT... | [
"public",
"List",
"<",
"List",
"<",
"Object",
">",
">",
"getTuples",
"(",
")",
"{",
"Iterator",
"<",
"KeyValue",
">",
"keyValueIter",
"=",
"indicators",
".",
"keyValueIterator",
"(",
")",
";",
"List",
"<",
"List",
"<",
"Object",
">",
">",
"tuples",
"="... | Gets the tuples which are in this assignment.
@return | [
"Gets",
"the",
"tuples",
"which",
"are",
"in",
"this",
"assignment",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/probdb/TableAssignment.java#L60-L70 | train |
ivanceras/orm | src/main/java/com/ivanceras/db/server/core/DB_Jdbc.java | DB_Jdbc.executeSelect | public DAO[] executeSelect(String sql, Object[] parameters)
throws DatabaseException {
ResultSet rs = executeSelectSQL(sql, parameters, null, false);
return resultSetToDAO(rs, null);
} | java | public DAO[] executeSelect(String sql, Object[] parameters)
throws DatabaseException {
ResultSet rs = executeSelectSQL(sql, parameters, null, false);
return resultSetToDAO(rs, null);
} | [
"public",
"DAO",
"[",
"]",
"executeSelect",
"(",
"String",
"sql",
",",
"Object",
"[",
"]",
"parameters",
")",
"throws",
"DatabaseException",
"{",
"ResultSet",
"rs",
"=",
"executeSelectSQL",
"(",
"sql",
",",
"parameters",
",",
"null",
",",
"false",
")",
";"... | Execute generic SQL statement
@param sql
@param parameters
@return
@throws DatabaseException | [
"Execute",
"generic",
"SQL",
"statement"
] | e63213cb8abefd11df0e2d34b1c95477788e600e | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/core/DB_Jdbc.java#L330-L334 | train |
ivanceras/orm | src/main/java/com/ivanceras/db/server/core/DB_Jdbc.java | DB_Jdbc.getPreparedStatement | public Statement getPreparedStatement(String sql,
Object[] parameters, boolean returnValues) throws DatabaseException {
Statement stmt = null;
try {
if(supportPreparedStatement()){
if (appendReturningColumnClause() && returnValues) {
stmt = connection.prepareStatement(sql, PreparedStatement.RETURN_GE... | java | public Statement getPreparedStatement(String sql,
Object[] parameters, boolean returnValues) throws DatabaseException {
Statement stmt = null;
try {
if(supportPreparedStatement()){
if (appendReturningColumnClause() && returnValues) {
stmt = connection.prepareStatement(sql, PreparedStatement.RETURN_GE... | [
"public",
"Statement",
"getPreparedStatement",
"(",
"String",
"sql",
",",
"Object",
"[",
"]",
"parameters",
",",
"boolean",
"returnValues",
")",
"throws",
"DatabaseException",
"{",
"Statement",
"stmt",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"supportPreparedSta... | Get the SQL statements based on different cases
DB does not support PrepareStatement
DB does not allow returning of Generated Keys
@param sql
@param parameters
@return
@throws DatabaseException | [
"Get",
"the",
"SQL",
"statements",
"based",
"on",
"different",
"cases",
"DB",
"does",
"not",
"support",
"PrepareStatement",
"DB",
"does",
"not",
"allow",
"returning",
"of",
"Generated",
"Keys"
] | e63213cb8abefd11df0e2d34b1c95477788e600e | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/core/DB_Jdbc.java#L472-L497 | train |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java | HeadedSyntacticCategory.getCanonicalForm | public HeadedSyntacticCategory getCanonicalForm(Map<Integer, Integer> relabeling) {
Preconditions.checkArgument(relabeling.size() == 0);
int[] relabeledVariables = canonicalizeVariableArray(semanticVariables, relabeling);
return new HeadedSyntacticCategory(syntacticCategory.getCanonicalForm(), relabeledVari... | java | public HeadedSyntacticCategory getCanonicalForm(Map<Integer, Integer> relabeling) {
Preconditions.checkArgument(relabeling.size() == 0);
int[] relabeledVariables = canonicalizeVariableArray(semanticVariables, relabeling);
return new HeadedSyntacticCategory(syntacticCategory.getCanonicalForm(), relabeledVari... | [
"public",
"HeadedSyntacticCategory",
"getCanonicalForm",
"(",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"relabeling",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"relabeling",
".",
"size",
"(",
")",
"==",
"0",
")",
";",
"int",
"[",
"]",
"relabele... | Gets a canonical representation of this category that treats each
variable number as an equivalence class. The canonical form
relabels variables in the category such that all categories with
the same variable equivalence relations have the same canonical
form.
@param relabeling the relabeling applied to variables in t... | [
"Gets",
"a",
"canonical",
"representation",
"of",
"this",
"category",
"that",
"treats",
"each",
"variable",
"number",
"as",
"an",
"equivalence",
"class",
".",
"The",
"canonical",
"form",
"relabels",
"variables",
"in",
"the",
"category",
"such",
"that",
"all",
... | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java#L217-L221 | train |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java | HeadedSyntacticCategory.getArgumentType | public HeadedSyntacticCategory getArgumentType() {
SyntacticCategory argumentSyntax = syntacticCategory.getArgument();
int[] argumentSemantics = ArrayUtils.copyOfRange(semanticVariables, rootIndex + 1, semanticVariables.length);
int argumentRoot = argumentSyntax.getNumReturnSubcategories();
return new H... | java | public HeadedSyntacticCategory getArgumentType() {
SyntacticCategory argumentSyntax = syntacticCategory.getArgument();
int[] argumentSemantics = ArrayUtils.copyOfRange(semanticVariables, rootIndex + 1, semanticVariables.length);
int argumentRoot = argumentSyntax.getNumReturnSubcategories();
return new H... | [
"public",
"HeadedSyntacticCategory",
"getArgumentType",
"(",
")",
"{",
"SyntacticCategory",
"argumentSyntax",
"=",
"syntacticCategory",
".",
"getArgument",
"(",
")",
";",
"int",
"[",
"]",
"argumentSemantics",
"=",
"ArrayUtils",
".",
"copyOfRange",
"(",
"semanticVariab... | Gets the syntactic type and semantic variable assignments to the
argument type of this category.
@return | [
"Gets",
"the",
"syntactic",
"type",
"and",
"semantic",
"variable",
"assignments",
"to",
"the",
"argument",
"type",
"of",
"this",
"category",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java#L247-L252 | train |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java | HeadedSyntacticCategory.getArgumentTypes | public List<HeadedSyntacticCategory> getArgumentTypes() {
List<HeadedSyntacticCategory> arguments = Lists.newArrayList();
HeadedSyntacticCategory cat = this;
while (!cat.isAtomic()) {
arguments.add(cat.getArgumentType());
cat = cat.getReturnType();
}
return arguments;
} | java | public List<HeadedSyntacticCategory> getArgumentTypes() {
List<HeadedSyntacticCategory> arguments = Lists.newArrayList();
HeadedSyntacticCategory cat = this;
while (!cat.isAtomic()) {
arguments.add(cat.getArgumentType());
cat = cat.getReturnType();
}
return arguments;
} | [
"public",
"List",
"<",
"HeadedSyntacticCategory",
">",
"getArgumentTypes",
"(",
")",
"{",
"List",
"<",
"HeadedSyntacticCategory",
">",
"arguments",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"HeadedSyntacticCategory",
"cat",
"=",
"this",
";",
"while",
"("... | Returns a list of all arguments to this category until
an atomic return category is reached. The first element of
the returned list is the argument that must be given first, etc.
@return | [
"Returns",
"a",
"list",
"of",
"all",
"arguments",
"to",
"this",
"category",
"until",
"an",
"atomic",
"return",
"category",
"is",
"reached",
".",
"The",
"first",
"element",
"of",
"the",
"returned",
"list",
"is",
"the",
"argument",
"that",
"must",
"be",
"giv... | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java#L261-L269 | train |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java | HeadedSyntacticCategory.getReturnType | public HeadedSyntacticCategory getReturnType() {
SyntacticCategory returnSyntax = syntacticCategory.getReturn();
int[] returnSemantics = ArrayUtils.copyOf(semanticVariables, rootIndex);
int returnRoot = returnSyntax.getNumReturnSubcategories();
return new HeadedSyntacticCategory(returnSyntax, returnSema... | java | public HeadedSyntacticCategory getReturnType() {
SyntacticCategory returnSyntax = syntacticCategory.getReturn();
int[] returnSemantics = ArrayUtils.copyOf(semanticVariables, rootIndex);
int returnRoot = returnSyntax.getNumReturnSubcategories();
return new HeadedSyntacticCategory(returnSyntax, returnSema... | [
"public",
"HeadedSyntacticCategory",
"getReturnType",
"(",
")",
"{",
"SyntacticCategory",
"returnSyntax",
"=",
"syntacticCategory",
".",
"getReturn",
"(",
")",
";",
"int",
"[",
"]",
"returnSemantics",
"=",
"ArrayUtils",
".",
"copyOf",
"(",
"semanticVariables",
",",
... | Gets the syntactic type and semantic variable assignments to the
return type of this category.
@return | [
"Gets",
"the",
"syntactic",
"type",
"and",
"semantic",
"variable",
"assignments",
"to",
"the",
"return",
"type",
"of",
"this",
"category",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java#L277-L282 | train |
HiddenStage/divide | Shared/src/main/java/io/divide/shared/transitory/Credentials.java | Credentials.getSafe | public Credentials getSafe(){
Credentials safeCreds = new Credentials(this);
safeCreds.meta_remove(PASSWORD_KEY);
safeCreds.meta_remove(AUTH_TOKEN_KEY);
safeCreds.meta_remove(AUTH_TOKEN_EXPIRE_KEY);
safeCreds.meta_remove(VALIDATION_KEY);
safeCreds.meta_remove(PUSH_MESSAGI... | java | public Credentials getSafe(){
Credentials safeCreds = new Credentials(this);
safeCreds.meta_remove(PASSWORD_KEY);
safeCreds.meta_remove(AUTH_TOKEN_KEY);
safeCreds.meta_remove(AUTH_TOKEN_EXPIRE_KEY);
safeCreds.meta_remove(VALIDATION_KEY);
safeCreds.meta_remove(PUSH_MESSAGI... | [
"public",
"Credentials",
"getSafe",
"(",
")",
"{",
"Credentials",
"safeCreds",
"=",
"new",
"Credentials",
"(",
"this",
")",
";",
"safeCreds",
".",
"meta_remove",
"(",
"PASSWORD_KEY",
")",
";",
"safeCreds",
".",
"meta_remove",
"(",
"AUTH_TOKEN_KEY",
")",
";",
... | New Credentials object which contains no sensitive information, removing
Password
auth token
auth token expiration date
validation token
push messaging token
recovery token
@return save version of this Credentials object. | [
"New",
"Credentials",
"object",
"which",
"contains",
"no",
"sensitive",
"information",
"removing",
"Password",
"auth",
"token",
"auth",
"token",
"expiration",
"date",
"validation",
"token",
"push",
"messaging",
"token",
"recovery",
"token"
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Shared/src/main/java/io/divide/shared/transitory/Credentials.java#L156-L165 | train |
jayantk/jklol | src/com/jayantkrish/jklol/cfg/CfgParser.java | CfgParser.parseMarginal | public CfgParseChart parseMarginal(List<?> terminals, Object root, boolean useSumProduct) {
CfgParseChart chart = createParseChart(terminals, useSumProduct);
Factor rootFactor = TableFactor.pointDistribution(parentVar,
parentVar.outcomeArrayToAssignment(root));
return marginal(chart, terminals, root... | java | public CfgParseChart parseMarginal(List<?> terminals, Object root, boolean useSumProduct) {
CfgParseChart chart = createParseChart(terminals, useSumProduct);
Factor rootFactor = TableFactor.pointDistribution(parentVar,
parentVar.outcomeArrayToAssignment(root));
return marginal(chart, terminals, root... | [
"public",
"CfgParseChart",
"parseMarginal",
"(",
"List",
"<",
"?",
">",
"terminals",
",",
"Object",
"root",
",",
"boolean",
"useSumProduct",
")",
"{",
"CfgParseChart",
"chart",
"=",
"createParseChart",
"(",
"terminals",
",",
"useSumProduct",
")",
";",
"Factor",
... | Compute the marginal distribution over all grammar entries conditioned on
the given sequence of terminals. | [
"Compute",
"the",
"marginal",
"distribution",
"over",
"all",
"grammar",
"entries",
"conditioned",
"on",
"the",
"given",
"sequence",
"of",
"terminals",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/cfg/CfgParser.java#L133-L138 | train |
jayantk/jklol | src/com/jayantkrish/jklol/cfg/CfgParser.java | CfgParser.parseMarginal | public CfgParseChart parseMarginal(List<?> terminals, boolean useSumProduct) {
Factor rootDist = TableFactor.unity(parentVar);
return parseMarginal(terminals, rootDist, useSumProduct);
} | java | public CfgParseChart parseMarginal(List<?> terminals, boolean useSumProduct) {
Factor rootDist = TableFactor.unity(parentVar);
return parseMarginal(terminals, rootDist, useSumProduct);
} | [
"public",
"CfgParseChart",
"parseMarginal",
"(",
"List",
"<",
"?",
">",
"terminals",
",",
"boolean",
"useSumProduct",
")",
"{",
"Factor",
"rootDist",
"=",
"TableFactor",
".",
"unity",
"(",
"parentVar",
")",
";",
"return",
"parseMarginal",
"(",
"terminals",
","... | Computes the marginal distribution over CFG parses given terminals.
@param terminals
@param useSumProduct
@return | [
"Computes",
"the",
"marginal",
"distribution",
"over",
"CFG",
"parses",
"given",
"terminals",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/cfg/CfgParser.java#L147-L150 | train |
jayantk/jklol | src/com/jayantkrish/jklol/cfg/CfgParser.java | CfgParser.parseMarginal | public CfgParseChart parseMarginal(List<?> terminals, Factor rootDist, boolean useSumProduct) {
return marginal(createParseChart(terminals, useSumProduct), terminals, rootDist);
} | java | public CfgParseChart parseMarginal(List<?> terminals, Factor rootDist, boolean useSumProduct) {
return marginal(createParseChart(terminals, useSumProduct), terminals, rootDist);
} | [
"public",
"CfgParseChart",
"parseMarginal",
"(",
"List",
"<",
"?",
">",
"terminals",
",",
"Factor",
"rootDist",
",",
"boolean",
"useSumProduct",
")",
"{",
"return",
"marginal",
"(",
"createParseChart",
"(",
"terminals",
",",
"useSumProduct",
")",
",",
"terminals... | Compute the distribution over CFG entries, the parse root, and the
children, conditioned on the provided terminals and assuming the provided
distributions over the root node. | [
"Compute",
"the",
"distribution",
"over",
"CFG",
"entries",
"the",
"parse",
"root",
"and",
"the",
"children",
"conditioned",
"on",
"the",
"provided",
"terminals",
"and",
"assuming",
"the",
"provided",
"distributions",
"over",
"the",
"root",
"node",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/cfg/CfgParser.java#L157-L159 | train |
jayantk/jklol | src/com/jayantkrish/jklol/cfg/CfgParser.java | CfgParser.createParseChart | private CfgParseChart createParseChart(List<?> terminals, boolean useSumProduct) {
return new CfgParseChart(terminals, parentVar, leftVar, rightVar, terminalVar, ruleTypeVar,
binaryDistribution, useSumProduct);
} | java | private CfgParseChart createParseChart(List<?> terminals, boolean useSumProduct) {
return new CfgParseChart(terminals, parentVar, leftVar, rightVar, terminalVar, ruleTypeVar,
binaryDistribution, useSumProduct);
} | [
"private",
"CfgParseChart",
"createParseChart",
"(",
"List",
"<",
"?",
">",
"terminals",
",",
"boolean",
"useSumProduct",
")",
"{",
"return",
"new",
"CfgParseChart",
"(",
"terminals",
",",
"parentVar",
",",
"leftVar",
",",
"rightVar",
",",
"terminalVar",
",",
... | Initializes parse charts with the correct variable arguments.
@param terminals
@param useSumProduct
@return | [
"Initializes",
"parse",
"charts",
"with",
"the",
"correct",
"variable",
"arguments",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/cfg/CfgParser.java#L393-L396 | train |
jayantk/jklol | src/com/jayantkrish/jklol/cfg/CfgParser.java | CfgParser.initializeBeamSearchChart | private void initializeBeamSearchChart(List<Object> terminals, BeamSearchCfgParseChart chart,
long[] treeEncodingOffsets) {
Variable terminalListValue = terminalVar.getOnlyVariable();
// Adding this to a tree key indicates that the tree is a terminal.
long terminalSignal = ((long) chart.chartSize()) ... | java | private void initializeBeamSearchChart(List<Object> terminals, BeamSearchCfgParseChart chart,
long[] treeEncodingOffsets) {
Variable terminalListValue = terminalVar.getOnlyVariable();
// Adding this to a tree key indicates that the tree is a terminal.
long terminalSignal = ((long) chart.chartSize()) ... | [
"private",
"void",
"initializeBeamSearchChart",
"(",
"List",
"<",
"Object",
">",
"terminals",
",",
"BeamSearchCfgParseChart",
"chart",
",",
"long",
"[",
"]",
"treeEncodingOffsets",
")",
"{",
"Variable",
"terminalListValue",
"=",
"terminalVar",
".",
"getOnlyVariable",
... | Initializes a beam search chart using the terminal production distribution.
@param terminals
@param chart | [
"Initializes",
"a",
"beam",
"search",
"chart",
"using",
"the",
"terminal",
"production",
"distribution",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/cfg/CfgParser.java#L661-L687 | train |
GoodforGod/dummymaker | src/main/java/io/dummymaker/container/impl/ClassContainer.java | ClassContainer.isExportable | public boolean isExportable() {
return fieldContainerMap.entrySet().stream().anyMatch(e -> format.isTypeSupported(e.getValue().getType()));
} | java | public boolean isExportable() {
return fieldContainerMap.entrySet().stream().anyMatch(e -> format.isTypeSupported(e.getValue().getType()));
} | [
"public",
"boolean",
"isExportable",
"(",
")",
"{",
"return",
"fieldContainerMap",
".",
"entrySet",
"(",
")",
".",
"stream",
"(",
")",
".",
"anyMatch",
"(",
"e",
"->",
"format",
".",
"isTypeSupported",
"(",
"e",
".",
"getValue",
"(",
")",
".",
"getType",... | If empty then no export values are present and export is pointless | [
"If",
"empty",
"then",
"no",
"export",
"values",
"are",
"present",
"and",
"export",
"is",
"pointless"
] | a4809c0a8139ab9cdb42814a3e37772717a313b4 | https://github.com/GoodforGod/dummymaker/blob/a4809c0a8139ab9cdb42814a3e37772717a313b4/src/main/java/io/dummymaker/container/impl/ClassContainer.java#L55-L57 | train |
jayantk/jklol | src/com/jayantkrish/jklol/util/PairCountAccumulator.java | PairCountAccumulator.toTableString | public String toTableString(boolean probs) {
Set<B> key2s = Sets.newHashSet();
for (A key : counts.keySet()) {
key2s.addAll(counts.get(key).keySet());
}
List<B> key2List = Lists.newArrayList(key2s);
StringBuilder sb = new StringBuilder();
sb.append("\t");
for (B key2 : key2List) {
... | java | public String toTableString(boolean probs) {
Set<B> key2s = Sets.newHashSet();
for (A key : counts.keySet()) {
key2s.addAll(counts.get(key).keySet());
}
List<B> key2List = Lists.newArrayList(key2s);
StringBuilder sb = new StringBuilder();
sb.append("\t");
for (B key2 : key2List) {
... | [
"public",
"String",
"toTableString",
"(",
"boolean",
"probs",
")",
"{",
"Set",
"<",
"B",
">",
"key2s",
"=",
"Sets",
".",
"newHashSet",
"(",
")",
";",
"for",
"(",
"A",
"key",
":",
"counts",
".",
"keySet",
"(",
")",
")",
"{",
"key2s",
".",
"addAll",
... | Generates a 2D table displaying the contents of
this accumulator.
@param showProb if {@code true} print the joint
probability of each pair. Otherwise print the
raw count.
@return | [
"Generates",
"a",
"2D",
"table",
"displaying",
"the",
"contents",
"of",
"this",
"accumulator",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/PairCountAccumulator.java#L227-L257 | train |
jayantk/jklol | src/com/jayantkrish/jklol/util/IntMultimap.java | IntMultimap.reindexItems | public void reindexItems() {
if (numUnsortedItems > 0) {
int[] newSortedKeys = Arrays.copyOf(sortedKeys, sortedKeys.length + numUnsortedItems);
int[] newSortedValues = Arrays.copyOf(sortedValues, sortedValues.length + numUnsortedItems);
int oldLength = sortedKeys.length;
for (int i = 0; i <... | java | public void reindexItems() {
if (numUnsortedItems > 0) {
int[] newSortedKeys = Arrays.copyOf(sortedKeys, sortedKeys.length + numUnsortedItems);
int[] newSortedValues = Arrays.copyOf(sortedValues, sortedValues.length + numUnsortedItems);
int oldLength = sortedKeys.length;
for (int i = 0; i <... | [
"public",
"void",
"reindexItems",
"(",
")",
"{",
"if",
"(",
"numUnsortedItems",
">",
"0",
")",
"{",
"int",
"[",
"]",
"newSortedKeys",
"=",
"Arrays",
".",
"copyOf",
"(",
"sortedKeys",
",",
"sortedKeys",
".",
"length",
"+",
"numUnsortedItems",
")",
";",
"i... | Moves all elements from the unsorted portion of this map into the
sorted portion. | [
"Moves",
"all",
"elements",
"from",
"the",
"unsorted",
"portion",
"of",
"this",
"map",
"into",
"the",
"sorted",
"portion",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/IntMultimap.java#L162-L181 | train |
jayantk/jklol | src/com/jayantkrish/jklol/util/IntMultimap.java | IntMultimap.resizeMap | private void resizeMap() {
int[] newUnsortedKeys = Arrays.copyOf(unsortedKeys, unsortedKeys.length * 2);
int[] newUnsortedValues = Arrays.copyOf(unsortedValues, unsortedValues.length * 2);
unsortedKeys = newUnsortedKeys;
unsortedValues = newUnsortedValues;
} | java | private void resizeMap() {
int[] newUnsortedKeys = Arrays.copyOf(unsortedKeys, unsortedKeys.length * 2);
int[] newUnsortedValues = Arrays.copyOf(unsortedValues, unsortedValues.length * 2);
unsortedKeys = newUnsortedKeys;
unsortedValues = newUnsortedValues;
} | [
"private",
"void",
"resizeMap",
"(",
")",
"{",
"int",
"[",
"]",
"newUnsortedKeys",
"=",
"Arrays",
".",
"copyOf",
"(",
"unsortedKeys",
",",
"unsortedKeys",
".",
"length",
"*",
"2",
")",
";",
"int",
"[",
"]",
"newUnsortedValues",
"=",
"Arrays",
".",
"copyO... | Doubles the size of the unsorted portion of the map.
@return | [
"Doubles",
"the",
"size",
"of",
"the",
"unsorted",
"portion",
"of",
"the",
"map",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/IntMultimap.java#L188-L194 | train |
HiddenStage/divide | Client/java-client/src/main/java/io/divide/client/BackendUser.java | BackendUser.from | public static BackendUser from(ValidCredentials credentials){
BackendUser beu = new BackendUser();
beu.initFrom(credentials);
return beu;
} | java | public static BackendUser from(ValidCredentials credentials){
BackendUser beu = new BackendUser();
beu.initFrom(credentials);
return beu;
} | [
"public",
"static",
"BackendUser",
"from",
"(",
"ValidCredentials",
"credentials",
")",
"{",
"BackendUser",
"beu",
"=",
"new",
"BackendUser",
"(",
")",
";",
"beu",
".",
"initFrom",
"(",
"credentials",
")",
";",
"return",
"beu",
";",
"}"
] | Convience method to initialize BackendUser from ValidCredentials
@param credentials
@return | [
"Convience",
"method",
"to",
"initialize",
"BackendUser",
"from",
"ValidCredentials"
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/java-client/src/main/java/io/divide/client/BackendUser.java#L64-L68 | train |
HiddenStage/divide | Client/java-client/src/main/java/io/divide/client/BackendUser.java | BackendUser.signIn | public static SignInResponse signIn(String email, String password){
return signIn(new LoginCredentials(email,password));
} | java | public static SignInResponse signIn(String email, String password){
return signIn(new LoginCredentials(email,password));
} | [
"public",
"static",
"SignInResponse",
"signIn",
"(",
"String",
"email",
",",
"String",
"password",
")",
"{",
"return",
"signIn",
"(",
"new",
"LoginCredentials",
"(",
"email",
",",
"password",
")",
")",
";",
"}"
] | Perform syncronously login attempt.
@param email user email address
@param password user password
@return login results. | [
"Perform",
"syncronously",
"login",
"attempt",
"."
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/java-client/src/main/java/io/divide/client/BackendUser.java#L152-L154 | train |
HiddenStage/divide | Client/java-client/src/main/java/io/divide/client/BackendUser.java | BackendUser.signUp | public static SignUpResponse signUp(String username, String email, String password){
return signUp(new SignUpCredentials(username,email,password));
} | java | public static SignUpResponse signUp(String username, String email, String password){
return signUp(new SignUpCredentials(username,email,password));
} | [
"public",
"static",
"SignUpResponse",
"signUp",
"(",
"String",
"username",
",",
"String",
"email",
",",
"String",
"password",
")",
"{",
"return",
"signUp",
"(",
"new",
"SignUpCredentials",
"(",
"username",
",",
"email",
",",
"password",
")",
")",
";",
"}"
] | Perform syncronously sign up attempt.
@param username user name user will be identified by.
@param email user email address
@param password user password
@return login results. | [
"Perform",
"syncronously",
"sign",
"up",
"attempt",
"."
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/java-client/src/main/java/io/divide/client/BackendUser.java#L172-L174 | train |
HiddenStage/divide | Client/java-client/src/main/java/io/divide/client/BackendUser.java | BackendUser.signInInBackground | public static Observable<BackendUser> signInInBackground(String email, String password){
return getAM().loginASync(new LoginCredentials(email, password));
} | java | public static Observable<BackendUser> signInInBackground(String email, String password){
return getAM().loginASync(new LoginCredentials(email, password));
} | [
"public",
"static",
"Observable",
"<",
"BackendUser",
">",
"signInInBackground",
"(",
"String",
"email",
",",
"String",
"password",
")",
"{",
"return",
"getAM",
"(",
")",
".",
"loginASync",
"(",
"new",
"LoginCredentials",
"(",
"email",
",",
"password",
")",
... | Perform asyncronously login attempt.
@param email user email address
@param password user password
@return login results as observable. | [
"Perform",
"asyncronously",
"login",
"attempt",
"."
] | 14e36598c50d92b4393e6649915e32b86141c598 | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/java-client/src/main/java/io/divide/client/BackendUser.java#L182-L184 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.