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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/resources/AdjacencyGraphUtil.java | AdjacencyGraphUtil.getShifts | public static int getShifts(final AdjacencyGraph adjacencyGraph, final String part)
{
int current_shift = -1;
int shifts = 0;
char[] parts = part.toCharArray();
for (int i1 = 0; i1 < parts.length; i1++)
{
Character character = parts[i1];
if (i1 + 1 >=... | java | public static int getShifts(final AdjacencyGraph adjacencyGraph, final String part)
{
int current_shift = -1;
int shifts = 0;
char[] parts = part.toCharArray();
for (int i1 = 0; i1 < parts.length; i1++)
{
Character character = parts[i1];
if (i1 + 1 >=... | [
"public",
"static",
"int",
"getShifts",
"(",
"final",
"AdjacencyGraph",
"adjacencyGraph",
",",
"final",
"String",
"part",
")",
"{",
"int",
"current_shift",
"=",
"-",
"1",
";",
"int",
"shifts",
"=",
"0",
";",
"char",
"[",
"]",
"parts",
"=",
"part",
".",
... | Returns the number of shifts in case in the part passed in.
@param adjacencyGraph the graph you are using to get the neighbors
@param part the string you are getting shifts for.
@return the number of shifts in this string for the {@code AdjacencyGraph} | [
"Returns",
"the",
"number",
"of",
"shifts",
"in",
"case",
"in",
"the",
"part",
"passed",
"in",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/resources/AdjacencyGraphUtil.java#L399-L445 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/resources/Generator.java | Generator.generatePassphrase | public static String generatePassphrase(final String delimiter, final int words)
{
return generatePassphrase(delimiter, words, new Dictionary("eff_large", DictionaryUtil.loadUnrankedDictionary(DictionaryUtil.eff_large), false));
} | java | public static String generatePassphrase(final String delimiter, final int words)
{
return generatePassphrase(delimiter, words, new Dictionary("eff_large", DictionaryUtil.loadUnrankedDictionary(DictionaryUtil.eff_large), false));
} | [
"public",
"static",
"String",
"generatePassphrase",
"(",
"final",
"String",
"delimiter",
",",
"final",
"int",
"words",
")",
"{",
"return",
"generatePassphrase",
"(",
"delimiter",
",",
"words",
",",
"new",
"Dictionary",
"(",
"\"eff_large\"",
",",
"DictionaryUtil",
... | Generates a passphrase from the eff_large standard dictionary with the requested word count.
@param delimiter delimiter to place between words
@param words the count of words you want in your passphrase
@return the passphrase | [
"Generates",
"a",
"passphrase",
"from",
"the",
"eff_large",
"standard",
"dictionary",
"with",
"the",
"requested",
"word",
"count",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/resources/Generator.java#L19-L22 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/resources/Generator.java | Generator.generatePassphrase | public static String generatePassphrase(final String delimiter, final int words, final Dictionary dictionary)
{
String result = "";
final SecureRandom rnd = new SecureRandom();
final int high = dictionary.getSortedDictionary().size();
for (int i = 1; i <= words; i++)
{
... | java | public static String generatePassphrase(final String delimiter, final int words, final Dictionary dictionary)
{
String result = "";
final SecureRandom rnd = new SecureRandom();
final int high = dictionary.getSortedDictionary().size();
for (int i = 1; i <= words; i++)
{
... | [
"public",
"static",
"String",
"generatePassphrase",
"(",
"final",
"String",
"delimiter",
",",
"final",
"int",
"words",
",",
"final",
"Dictionary",
"dictionary",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"final",
"SecureRandom",
"rnd",
"=",
"new",
"Secure... | Generates a passphrase from the supplied dictionary with the requested word count.
@param delimiter delimiter to place between words
@param words the count of words you want in your passphrase
@param dictionary the dictionary to use for generating this passphrase
@return the passphrase | [
"Generates",
"a",
"passphrase",
"from",
"the",
"supplied",
"dictionary",
"with",
"the",
"requested",
"word",
"count",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/resources/Generator.java#L32-L46 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/resources/Generator.java | Generator.generateRandomPassword | public static String generateRandomPassword(final CharacterTypes characterTypes, final int length)
{
final StringBuffer buffer = new StringBuffer();
String characters = "";
switch (characterTypes)
{
case ALPHA:
characters = "abcdefghijklmnopqrstuvwxyzABC... | java | public static String generateRandomPassword(final CharacterTypes characterTypes, final int length)
{
final StringBuffer buffer = new StringBuffer();
String characters = "";
switch (characterTypes)
{
case ALPHA:
characters = "abcdefghijklmnopqrstuvwxyzABC... | [
"public",
"static",
"String",
"generateRandomPassword",
"(",
"final",
"CharacterTypes",
"characterTypes",
",",
"final",
"int",
"length",
")",
"{",
"final",
"StringBuffer",
"buffer",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"String",
"characters",
"=",
"\"\"",
... | Generates a random password of the specified length with the specified characters.
@param characterTypes the types of characters to include in the password
@param length the length of the password
@return the password | [
"Generates",
"a",
"random",
"password",
"of",
"the",
"specified",
"length",
"with",
"the",
"specified",
"characters",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/resources/Generator.java#L55-L89 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/Nbvcxz.java | Nbvcxz.createBruteForceMatch | private static Match createBruteForceMatch(final String password, final Configuration configuration, final int index)
{
return new BruteForceMatch(password.charAt(index), configuration, index);
} | java | private static Match createBruteForceMatch(final String password, final Configuration configuration, final int index)
{
return new BruteForceMatch(password.charAt(index), configuration, index);
} | [
"private",
"static",
"Match",
"createBruteForceMatch",
"(",
"final",
"String",
"password",
",",
"final",
"Configuration",
"configuration",
",",
"final",
"int",
"index",
")",
"{",
"return",
"new",
"BruteForceMatch",
"(",
"password",
".",
"charAt",
"(",
"index",
"... | Creates a brute force match for a portion of the password.
@param password the password to create brute match for
@param configuration the configuration
@param index the index of the password part that needs a {@code BruteForceMatch}
@return a {@code Match} object | [
"Creates",
"a",
"brute",
"force",
"match",
"for",
"a",
"portion",
"of",
"the",
"password",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/Nbvcxz.java#L54-L57 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/Nbvcxz.java | Nbvcxz.getEntropyFromGuesses | public static Double getEntropyFromGuesses(final BigDecimal guesses)
{
Double guesses_tmp = guesses.doubleValue();
guesses_tmp = guesses_tmp.isInfinite() ? Double.MAX_VALUE : guesses_tmp;
return Math.log(guesses_tmp) / Math.log(2);
} | java | public static Double getEntropyFromGuesses(final BigDecimal guesses)
{
Double guesses_tmp = guesses.doubleValue();
guesses_tmp = guesses_tmp.isInfinite() ? Double.MAX_VALUE : guesses_tmp;
return Math.log(guesses_tmp) / Math.log(2);
} | [
"public",
"static",
"Double",
"getEntropyFromGuesses",
"(",
"final",
"BigDecimal",
"guesses",
")",
"{",
"Double",
"guesses_tmp",
"=",
"guesses",
".",
"doubleValue",
"(",
")",
";",
"guesses_tmp",
"=",
"guesses_tmp",
".",
"isInfinite",
"(",
")",
"?",
"Double",
"... | Gets the entropy from the number of guesses passed in.
@param guesses a {@code BigDecimal} representing the number of guesses.
@return entropy {@code Double} that is calculated based on the guesses. | [
"Gets",
"the",
"entropy",
"from",
"the",
"number",
"of",
"guesses",
"passed",
"in",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/Nbvcxz.java#L65-L70 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/Nbvcxz.java | Nbvcxz.getGuessesFromEntropy | public static BigDecimal getGuessesFromEntropy(final Double entropy)
{
final Double guesses_tmp = Math.pow(2, entropy);
return new BigDecimal(guesses_tmp.isInfinite() ? Double.MAX_VALUE : guesses_tmp).setScale(0, RoundingMode.HALF_UP);
} | java | public static BigDecimal getGuessesFromEntropy(final Double entropy)
{
final Double guesses_tmp = Math.pow(2, entropy);
return new BigDecimal(guesses_tmp.isInfinite() ? Double.MAX_VALUE : guesses_tmp).setScale(0, RoundingMode.HALF_UP);
} | [
"public",
"static",
"BigDecimal",
"getGuessesFromEntropy",
"(",
"final",
"Double",
"entropy",
")",
"{",
"final",
"Double",
"guesses_tmp",
"=",
"Math",
".",
"pow",
"(",
"2",
",",
"entropy",
")",
";",
"return",
"new",
"BigDecimal",
"(",
"guesses_tmp",
".",
"is... | Gets the number of guesses from the entropy passed in.
@param entropy a {@code Double} representing the number of guesses.
@return guesses {@code BigDecimal} that is calculated based on the entropy. | [
"Gets",
"the",
"number",
"of",
"guesses",
"from",
"the",
"entropy",
"passed",
"in",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/Nbvcxz.java#L78-L82 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/Nbvcxz.java | Nbvcxz.main | public static void main(String... args)
{
Configuration configuration = new ConfigurationBuilder().createConfiguration();
Nbvcxz nbvcxz = new Nbvcxz(configuration);
ResourceBundle resourceBundle = ResourceBundle.getBundle("main", nbvcxz.getConfiguration().getLocale());
Scanner scanne... | java | public static void main(String... args)
{
Configuration configuration = new ConfigurationBuilder().createConfiguration();
Nbvcxz nbvcxz = new Nbvcxz(configuration);
ResourceBundle resourceBundle = ResourceBundle.getBundle("main", nbvcxz.getConfiguration().getLocale());
Scanner scanne... | [
"public",
"static",
"void",
"main",
"(",
"String",
"...",
"args",
")",
"{",
"Configuration",
"configuration",
"=",
"new",
"ConfigurationBuilder",
"(",
")",
".",
"createConfiguration",
"(",
")",
";",
"Nbvcxz",
"nbvcxz",
"=",
"new",
"Nbvcxz",
"(",
"configuration... | Console application which will run with default configurations.
@param args arguments which are ignored! | [
"Console",
"application",
"which",
"will",
"run",
"with",
"default",
"configurations",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/Nbvcxz.java#L89-L168 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/Nbvcxz.java | Nbvcxz.findBestCombination | private List<Match> findBestCombination(final String password, final List<Match> all_matches, final Map<Integer, Match> brute_force_matches) throws TimeoutException
{
if (configuration.getCombinationAlgorithmTimeout() <= 0)
{
throw new TimeoutException("findBestCombination algorithm disa... | java | private List<Match> findBestCombination(final String password, final List<Match> all_matches, final Map<Integer, Match> brute_force_matches) throws TimeoutException
{
if (configuration.getCombinationAlgorithmTimeout() <= 0)
{
throw new TimeoutException("findBestCombination algorithm disa... | [
"private",
"List",
"<",
"Match",
">",
"findBestCombination",
"(",
"final",
"String",
"password",
",",
"final",
"List",
"<",
"Match",
">",
"all_matches",
",",
"final",
"Map",
"<",
"Integer",
",",
"Match",
">",
"brute_force_matches",
")",
"throws",
"TimeoutExcep... | Finds the most optimal matches by recursively building out every combination possible and returning the best.
@param password the password
@param all_matches all matches which have been found for this password
@param brute_force_matches map of index and brute force match to fit that index
@return th... | [
"Finds",
"the",
"most",
"optimal",
"matches",
"by",
"recursively",
"building",
"out",
"every",
"combination",
"possible",
"and",
"returning",
"the",
"best",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/Nbvcxz.java#L356-L429 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/Nbvcxz.java | Nbvcxz.generateMatches | private void generateMatches(final long start_time, final String password, final Match match, final Map<Match, List<Match>> non_intersecting_matches, final Map<Integer, Match> brute_force_matches, final List<Match> matches, int matches_length) throws TimeoutException
{
if (System.currentTimeMillis() - start... | java | private void generateMatches(final long start_time, final String password, final Match match, final Map<Match, List<Match>> non_intersecting_matches, final Map<Integer, Match> brute_force_matches, final List<Match> matches, int matches_length) throws TimeoutException
{
if (System.currentTimeMillis() - start... | [
"private",
"void",
"generateMatches",
"(",
"final",
"long",
"start_time",
",",
"final",
"String",
"password",
",",
"final",
"Match",
"match",
",",
"final",
"Map",
"<",
"Match",
",",
"List",
"<",
"Match",
">",
">",
"non_intersecting_matches",
",",
"final",
"M... | Recursive function to generate match combinations to get an optimal match.
@param start_time the time the function started to allow timeout
@param password the password
@param match a match to start with (or the next match in line)
@param non_intersecting_matches map of... | [
"Recursive",
"function",
"to",
"generate",
"match",
"combinations",
"to",
"get",
"an",
"optimal",
"match",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/Nbvcxz.java#L442-L483 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/Nbvcxz.java | Nbvcxz.calcEntropy | private double calcEntropy(final List<Match> matches, final boolean include_brute_force)
{
double entropy = 0;
for (Match match : matches)
{
if (include_brute_force || !(match instanceof BruteForceMatch))
{
entropy += match.calculateEntropy();
... | java | private double calcEntropy(final List<Match> matches, final boolean include_brute_force)
{
double entropy = 0;
for (Match match : matches)
{
if (include_brute_force || !(match instanceof BruteForceMatch))
{
entropy += match.calculateEntropy();
... | [
"private",
"double",
"calcEntropy",
"(",
"final",
"List",
"<",
"Match",
">",
"matches",
",",
"final",
"boolean",
"include_brute_force",
")",
"{",
"double",
"entropy",
"=",
"0",
";",
"for",
"(",
"Match",
"match",
":",
"matches",
")",
"{",
"if",
"(",
"incl... | Helper method to calculate entropy from a list of matches.
@param matches the list of matches
@return the sum of the entropy in the list passed in | [
"Helper",
"method",
"to",
"calculate",
"entropy",
"from",
"a",
"list",
"of",
"matches",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/Nbvcxz.java#L531-L542 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/Nbvcxz.java | Nbvcxz.getAllMatches | private List<Match> getAllMatches(final Configuration configuration, final String password)
{
List<Match> matches = new ArrayList<>();
for (PasswordMatcher passwordMatcher : configuration.getPasswordMatchers())
{
matches.addAll(passwordMatcher.match(configuration, password));
... | java | private List<Match> getAllMatches(final Configuration configuration, final String password)
{
List<Match> matches = new ArrayList<>();
for (PasswordMatcher passwordMatcher : configuration.getPasswordMatchers())
{
matches.addAll(passwordMatcher.match(configuration, password));
... | [
"private",
"List",
"<",
"Match",
">",
"getAllMatches",
"(",
"final",
"Configuration",
"configuration",
",",
"final",
"String",
"password",
")",
"{",
"List",
"<",
"Match",
">",
"matches",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"PasswordMa... | Gets all matches for a given password.
@param configuration the configuration file used to estimate entropy.
@param password the password to get matches for.
@return a {@code List} of {@code Match} objects for the supplied password. | [
"Gets",
"all",
"matches",
"for",
"a",
"given",
"password",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/Nbvcxz.java#L582-L592 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/scoring/Result.java | Result.isValid | private boolean isValid()
{
StringBuilder builder = new StringBuilder();
for (Match match : matches)
{
builder.append(match.getToken());
}
return password.equals(builder.toString());
} | java | private boolean isValid()
{
StringBuilder builder = new StringBuilder();
for (Match match : matches)
{
builder.append(match.getToken());
}
return password.equals(builder.toString());
} | [
"private",
"boolean",
"isValid",
"(",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Match",
"match",
":",
"matches",
")",
"{",
"builder",
".",
"append",
"(",
"match",
".",
"getToken",
"(",
")",
")",
";",... | Checks if the sum of the matches equals the original password.
@return {@code true} if valid; {@code false} if invalid. | [
"Checks",
"if",
"the",
"sum",
"of",
"the",
"matches",
"equals",
"the",
"original",
"password",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/scoring/Result.java#L47-L56 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/scoring/Result.java | Result.getGuesses | public BigDecimal getGuesses()
{
final Double guesses_tmp = Math.pow(2, getEntropy());
return new BigDecimal(guesses_tmp.isInfinite() ? Double.MAX_VALUE : guesses_tmp).setScale(0, RoundingMode.HALF_UP);
} | java | public BigDecimal getGuesses()
{
final Double guesses_tmp = Math.pow(2, getEntropy());
return new BigDecimal(guesses_tmp.isInfinite() ? Double.MAX_VALUE : guesses_tmp).setScale(0, RoundingMode.HALF_UP);
} | [
"public",
"BigDecimal",
"getGuesses",
"(",
")",
"{",
"final",
"Double",
"guesses_tmp",
"=",
"Math",
".",
"pow",
"(",
"2",
",",
"getEntropy",
"(",
")",
")",
";",
"return",
"new",
"BigDecimal",
"(",
"guesses_tmp",
".",
"isInfinite",
"(",
")",
"?",
"Double"... | The estimated number of tries required to crack this password
@return the estimated number of guesses as a {@code BigDecimal} | [
"The",
"estimated",
"number",
"of",
"tries",
"required",
"to",
"crack",
"this",
"password"
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/scoring/Result.java#L78-L82 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/scoring/Result.java | Result.isRandom | public boolean isRandom()
{
boolean is_random = true;
for (Match match : matches)
{
if (!(match instanceof BruteForceMatch))
{
is_random = false;
break;
}
}
return is_random;
} | java | public boolean isRandom()
{
boolean is_random = true;
for (Match match : matches)
{
if (!(match instanceof BruteForceMatch))
{
is_random = false;
break;
}
}
return is_random;
} | [
"public",
"boolean",
"isRandom",
"(",
")",
"{",
"boolean",
"is_random",
"=",
"true",
";",
"for",
"(",
"Match",
"match",
":",
"matches",
")",
"{",
"if",
"(",
"!",
"(",
"match",
"instanceof",
"BruteForceMatch",
")",
")",
"{",
"is_random",
"=",
"false",
"... | Returns whether the password is considered to be random.
@return true if the password is considered random, false otherwise. | [
"Returns",
"whether",
"the",
"password",
"is",
"considered",
"to",
"be",
"random",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/scoring/Result.java#L119-L131 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/scoring/Result.java | Result.getBasicScore | public int getBasicScore()
{
final BigDecimal guesses = getGuesses();
if (guesses.compareTo(BigDecimal.valueOf( 1e3)) == -1)
return 0;
else if (guesses.compareTo(BigDecimal.valueOf( 1e6)) == -1)
return 1;
else if (guesses.compareTo(BigDecimal.valueOf(1e8)) == ... | java | public int getBasicScore()
{
final BigDecimal guesses = getGuesses();
if (guesses.compareTo(BigDecimal.valueOf( 1e3)) == -1)
return 0;
else if (guesses.compareTo(BigDecimal.valueOf( 1e6)) == -1)
return 1;
else if (guesses.compareTo(BigDecimal.valueOf(1e8)) == ... | [
"public",
"int",
"getBasicScore",
"(",
")",
"{",
"final",
"BigDecimal",
"guesses",
"=",
"getGuesses",
"(",
")",
";",
"if",
"(",
"guesses",
".",
"compareTo",
"(",
"BigDecimal",
".",
"valueOf",
"(",
"1e3",
")",
")",
"==",
"-",
"1",
")",
"return",
"0",
... | This scoring function returns an int from 0-4 to indicate the score of this password
using the same semantics as zxcvbn.
@return Score
<br>0: risky password: "too guessable"
<br>1: modest protection from throttled online attacks: "very guessable"
<br>2: modest protection from unthrottled online attacks: "somewhat gues... | [
"This",
"scoring",
"function",
"returns",
"an",
"int",
"from",
"0",
"-",
"4",
"to",
"indicate",
"the",
"score",
"of",
"this",
"password",
"using",
"the",
"same",
"semantics",
"as",
"zxcvbn",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/scoring/Result.java#L164-L177 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/matching/DictionaryMatcher.java | DictionaryMatcher.translateLeet | private static List<String> translateLeet(final Configuration configuration, final String password)
{
final List<String> translations = new ArrayList();
final TreeMap<Integer, Character[]> replacements = new TreeMap<>();
for (int i = 0; i < password.length(); i++)
{
fina... | java | private static List<String> translateLeet(final Configuration configuration, final String password)
{
final List<String> translations = new ArrayList();
final TreeMap<Integer, Character[]> replacements = new TreeMap<>();
for (int i = 0; i < password.length(); i++)
{
fina... | [
"private",
"static",
"List",
"<",
"String",
">",
"translateLeet",
"(",
"final",
"Configuration",
"configuration",
",",
"final",
"String",
"password",
")",
"{",
"final",
"List",
"<",
"String",
">",
"translations",
"=",
"new",
"ArrayList",
"(",
")",
";",
"fina... | Removes all leet substitutions from the password and returns a list of plain text versions.
@param configuration the configuration file used to estimate entropy.
@param password the password to translate from leet.
@return a list of all combinations of possible leet translations for the password with all leet rem... | [
"Removes",
"all",
"leet",
"substitutions",
"from",
"the",
"password",
"and",
"returns",
"a",
"list",
"of",
"plain",
"text",
"versions",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/matching/DictionaryMatcher.java#L27-L56 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/matching/DictionaryMatcher.java | DictionaryMatcher.replaceAtIndex | private static void replaceAtIndex(final TreeMap<Integer, Character[]> replacements, Integer current_index, final char[] password, final List<String> final_passwords)
{
for (final char replacement : replacements.get(current_index))
{
password[current_index] = replacement;
if ... | java | private static void replaceAtIndex(final TreeMap<Integer, Character[]> replacements, Integer current_index, final char[] password, final List<String> final_passwords)
{
for (final char replacement : replacements.get(current_index))
{
password[current_index] = replacement;
if ... | [
"private",
"static",
"void",
"replaceAtIndex",
"(",
"final",
"TreeMap",
"<",
"Integer",
",",
"Character",
"[",
"]",
">",
"replacements",
",",
"Integer",
"current_index",
",",
"final",
"char",
"[",
"]",
"password",
",",
"final",
"List",
"<",
"String",
">",
... | Internal function to recursively build the list of un-leet possibilities.
@param replacements TreeMap of replacement index, and the possible characters at that index to be replaced
@param current_index internal use for the function
@param password a Character array of the original password
@param final_pas... | [
"Internal",
"function",
"to",
"recursively",
"build",
"the",
"list",
"of",
"un",
"-",
"leet",
"possibilities",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/matching/DictionaryMatcher.java#L66-L85 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/matching/DictionaryMatcher.java | DictionaryMatcher.getLeetSub | private static List<Character[]> getLeetSub(final String password, final String unleet_password)
{
List<Character[]> leet_subs = new ArrayList<>();
for (int i = 0; i < unleet_password.length(); i++)
{
if (password.charAt(i) != unleet_password.charAt(i))
{
... | java | private static List<Character[]> getLeetSub(final String password, final String unleet_password)
{
List<Character[]> leet_subs = new ArrayList<>();
for (int i = 0; i < unleet_password.length(); i++)
{
if (password.charAt(i) != unleet_password.charAt(i))
{
... | [
"private",
"static",
"List",
"<",
"Character",
"[",
"]",
">",
"getLeetSub",
"(",
"final",
"String",
"password",
",",
"final",
"String",
"unleet_password",
")",
"{",
"List",
"<",
"Character",
"[",
"]",
">",
"leet_subs",
"=",
"new",
"ArrayList",
"<>",
"(",
... | Gets the substitutions for the password.
@param password the password to get leet substitutions for.
@param unleet_password the password to get leet substitutions for.
@return a {@code List} of {@code Character[]} that are the leet substitutions for the password. | [
"Gets",
"the",
"substitutions",
"for",
"the",
"password",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/matching/DictionaryMatcher.java#L95-L106 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/matching/DateMatcher.java | DateMatcher.isDateValid | private static ValidDateSplit isDateValid(String day, String month, String year)
{
try
{
int dayInt = Integer.parseInt(day);
int monthInt = Integer.parseInt(month);
int yearInt = Integer.parseInt(year);
if (
dayInt <= 0 || dayInt > ... | java | private static ValidDateSplit isDateValid(String day, String month, String year)
{
try
{
int dayInt = Integer.parseInt(day);
int monthInt = Integer.parseInt(month);
int yearInt = Integer.parseInt(year);
if (
dayInt <= 0 || dayInt > ... | [
"private",
"static",
"ValidDateSplit",
"isDateValid",
"(",
"String",
"day",
",",
"String",
"month",
",",
"String",
"year",
")",
"{",
"try",
"{",
"int",
"dayInt",
"=",
"Integer",
".",
"parseInt",
"(",
"day",
")",
";",
"int",
"monthInt",
"=",
"Integer",
".... | Verify that a date is valid. Year must be
two digit or four digit and between 1900 and 2029.
@param day the day of the date
@param month the moth of the date
@param year the year of the date
@return a valid date split object containing the date information if the
date is valid and {@code null} if the date is not va... | [
"Verify",
"that",
"a",
"date",
"is",
"valid",
".",
"Year",
"must",
"be",
"two",
"digit",
"or",
"four",
"digit",
"and",
"between",
"1900",
"and",
"2029",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/matching/DateMatcher.java#L206-L227 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/resources/CharacterCaseUtil.java | CharacterCaseUtil.fractionOfStringUppercase | public static double fractionOfStringUppercase(String input)
{
if (input == null)
{
return 0;
}
double upperCasableCharacters = 0;
double upperCount = 0;
for (int i = 0; i < input.length(); i++)
{
char c = input.charAt(i);
... | java | public static double fractionOfStringUppercase(String input)
{
if (input == null)
{
return 0;
}
double upperCasableCharacters = 0;
double upperCount = 0;
for (int i = 0; i < input.length(); i++)
{
char c = input.charAt(i);
... | [
"public",
"static",
"double",
"fractionOfStringUppercase",
"(",
"String",
"input",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"double",
"upperCasableCharacters",
"=",
"0",
";",
"double",
"upperCount",
"=",
"0",
";",
"for... | Of the characters in the string that have an uppercase form, how many are uppercased?
@param input Input string.
@return The fraction of uppercased characters, with {@code 0.0d} meaning that all uppercasable characters are in
lowercase and {@code 1.0d} that all of them are in uppercase. | [
"Of",
"the",
"characters",
"in",
"the",
"string",
"that",
"have",
"an",
"uppercase",
"form",
"how",
"many",
"are",
"uppercased?"
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/resources/CharacterCaseUtil.java#L12-L41 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/scoring/TimeEstimate.java | TimeEstimate.getTimeToCrack | public static BigDecimal getTimeToCrack(final Result result, final String guess_type)
{
BigDecimal guess_per_second = BigDecimal.valueOf(result.getConfiguration().getGuessTypes().get(guess_type));
return result.getGuesses().divide(guess_per_second, 0, BigDecimal.ROUND_FLOOR);
} | java | public static BigDecimal getTimeToCrack(final Result result, final String guess_type)
{
BigDecimal guess_per_second = BigDecimal.valueOf(result.getConfiguration().getGuessTypes().get(guess_type));
return result.getGuesses().divide(guess_per_second, 0, BigDecimal.ROUND_FLOOR);
} | [
"public",
"static",
"BigDecimal",
"getTimeToCrack",
"(",
"final",
"Result",
"result",
",",
"final",
"String",
"guess_type",
")",
"{",
"BigDecimal",
"guess_per_second",
"=",
"BigDecimal",
".",
"valueOf",
"(",
"result",
".",
"getConfiguration",
"(",
")",
".",
"get... | Gets the estimated time to crack in seconds.
@param result a {@code Result} object to estimate time to crack for.
@param guess_type a {@code String} representing the estimate type to get time to crack for (defined in {@code Configuration}.
@return time in seconds estimated to crack as a {@code BigDecimal}. | [
"Gets",
"the",
"estimated",
"time",
"to",
"crack",
"in",
"seconds",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/scoring/TimeEstimate.java#L19-L24 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/scoring/TimeEstimate.java | TimeEstimate.getTimeToCrackFormatted | public static String getTimeToCrackFormatted(final Result result, final String guess_type)
{
ResourceBundle mainResource = result.getConfiguration().getMainResource();
BigDecimal seconds = getTimeToCrack(result, guess_type);
BigDecimal minutes = new BigDecimal(60);
BigDecimal hours =... | java | public static String getTimeToCrackFormatted(final Result result, final String guess_type)
{
ResourceBundle mainResource = result.getConfiguration().getMainResource();
BigDecimal seconds = getTimeToCrack(result, guess_type);
BigDecimal minutes = new BigDecimal(60);
BigDecimal hours =... | [
"public",
"static",
"String",
"getTimeToCrackFormatted",
"(",
"final",
"Result",
"result",
",",
"final",
"String",
"guess_type",
")",
"{",
"ResourceBundle",
"mainResource",
"=",
"result",
".",
"getConfiguration",
"(",
")",
".",
"getMainResource",
"(",
")",
";",
... | Gets the estimated time to crack formatted as a string.
@param result a {@code Result} object to estimate time to crack for.
@param guess_type a {@code String} representing the estimate type to get time to crack for (defined in {@code Configuration}.
@return time estimated to crack as a {@code String} (instant, se... | [
"Gets",
"the",
"estimated",
"time",
"to",
"crack",
"formatted",
"as",
"a",
"string",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/scoring/TimeEstimate.java#L33-L81 | train |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/resources/DictionaryBuilder.java | DictionaryBuilder.addWord | public DictionaryBuilder addWord(final String word, final int rank)
{
this.dictonary.put(word.toLowerCase(), rank);
return this;
} | java | public DictionaryBuilder addWord(final String word, final int rank)
{
this.dictonary.put(word.toLowerCase(), rank);
return this;
} | [
"public",
"DictionaryBuilder",
"addWord",
"(",
"final",
"String",
"word",
",",
"final",
"int",
"rank",
")",
"{",
"this",
".",
"dictonary",
".",
"put",
"(",
"word",
".",
"toLowerCase",
"(",
")",
",",
"rank",
")",
";",
"return",
"this",
";",
"}"
] | Add word to dictionary.
@param word key to add to the dictionary, will be lowercased.
@param rank the rank of the word in the dictionary.
Should increment from most common to least common if ranked.
If unranked, an example would be if there were 500 values in the dictionary, every word should have a rank of 250.
If ex... | [
"Add",
"word",
"to",
"dictionary",
"."
] | a86fb24680e646efdf78d6fda9d68a5410145f56 | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/resources/DictionaryBuilder.java#L49-L53 | train |
pwittchen/ReactiveBeacons | library/src/main/java/com/github/pwittchen/reactivebeacons/library/rx2/ReactiveBeacons.java | ReactiveBeacons.observe | @SuppressLint("MissingPermission")
@RequiresPermission(anyOf = {
ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION
})
public Observable<Beacon> observe() {
if (!isBleSupported()) {
return Observable.empty();
}
if (isAtLeastAndroidLollipop()) {
scanStrategy = new LollipopScanStrategy(blue... | java | @SuppressLint("MissingPermission")
@RequiresPermission(anyOf = {
ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION
})
public Observable<Beacon> observe() {
if (!isBleSupported()) {
return Observable.empty();
}
if (isAtLeastAndroidLollipop()) {
scanStrategy = new LollipopScanStrategy(blue... | [
"@",
"SuppressLint",
"(",
"\"MissingPermission\"",
")",
"@",
"RequiresPermission",
"(",
"anyOf",
"=",
"{",
"ACCESS_COARSE_LOCATION",
",",
"ACCESS_FINE_LOCATION",
"}",
")",
"public",
"Observable",
"<",
"Beacon",
">",
"observe",
"(",
")",
"{",
"if",
"(",
"!",
"i... | Creates an observable stream of BLE beacons, which can be subscribed with RxJava
Uses appropriate BLE scan strategy according to Android version installed on a device
@return Observable stream of beacons | [
"Creates",
"an",
"observable",
"stream",
"of",
"BLE",
"beacons",
"which",
"can",
"be",
"subscribed",
"with",
"RxJava",
"Uses",
"appropriate",
"BLE",
"scan",
"strategy",
"according",
"to",
"Android",
"version",
"installed",
"on",
"a",
"device"
] | 40bace36b5c6c19ff25d11ef7205743681bd9b36 | https://github.com/pwittchen/ReactiveBeacons/blob/40bace36b5c6c19ff25d11ef7205743681bd9b36/library/src/main/java/com/github/pwittchen/reactivebeacons/library/rx2/ReactiveBeacons.java#L105-L125 | train |
LearnLib/learnlib | commons/counterexamples/src/main/java/de/learnlib/counterexamples/GlobalSuffixFinders.java | GlobalSuffixFinders.findMalerPnueli | public static <I, D> List<Word<I>> findMalerPnueli(Query<I, D> ceQuery) {
return ceQuery.getInput().suffixes(false);
} | java | public static <I, D> List<Word<I>> findMalerPnueli(Query<I, D> ceQuery) {
return ceQuery.getInput().suffixes(false);
} | [
"public",
"static",
"<",
"I",
",",
"D",
">",
"List",
"<",
"Word",
"<",
"I",
">",
">",
"findMalerPnueli",
"(",
"Query",
"<",
"I",
",",
"D",
">",
"ceQuery",
")",
"{",
"return",
"ceQuery",
".",
"getInput",
"(",
")",
".",
"suffixes",
"(",
"false",
")... | Returns all suffixes of the counterexample word as distinguishing suffixes, as suggested by Maler & Pnueli.
@param ceQuery
the counterexample query
@return all suffixes of the counterexample input | [
"Returns",
"all",
"suffixes",
"of",
"the",
"counterexample",
"word",
"as",
"distinguishing",
"suffixes",
"as",
"suggested",
"by",
"Maler",
"&",
";",
"Pnueli",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/commons/counterexamples/src/main/java/de/learnlib/counterexamples/GlobalSuffixFinders.java#L222-L224 | train |
LearnLib/learnlib | commons/counterexamples/src/main/java/de/learnlib/counterexamples/GlobalSuffixFinders.java | GlobalSuffixFinders.findShahbaz | public static <I, D> List<Word<I>> findShahbaz(Query<I, D> ceQuery, AccessSequenceTransformer<I> asTransformer) {
Word<I> queryWord = ceQuery.getInput();
int queryLen = queryWord.length();
Word<I> prefix = ceQuery.getPrefix();
int i = prefix.length();
while (i <= queryLen) {
... | java | public static <I, D> List<Word<I>> findShahbaz(Query<I, D> ceQuery, AccessSequenceTransformer<I> asTransformer) {
Word<I> queryWord = ceQuery.getInput();
int queryLen = queryWord.length();
Word<I> prefix = ceQuery.getPrefix();
int i = prefix.length();
while (i <= queryLen) {
... | [
"public",
"static",
"<",
"I",
",",
"D",
">",
"List",
"<",
"Word",
"<",
"I",
">",
">",
"findShahbaz",
"(",
"Query",
"<",
"I",
",",
"D",
">",
"ceQuery",
",",
"AccessSequenceTransformer",
"<",
"I",
">",
"asTransformer",
")",
"{",
"Word",
"<",
"I",
">"... | Returns all suffixes of the counterexample word as distinguishing suffixes, after stripping a maximal one-letter
extension of an access sequence, as suggested by Shahbaz.
@param ceQuery
the counterexample query
@param asTransformer
the access sequence transformer
@return all suffixes from the counterexample after str... | [
"Returns",
"all",
"suffixes",
"of",
"the",
"counterexample",
"word",
"as",
"distinguishing",
"suffixes",
"after",
"stripping",
"a",
"maximal",
"one",
"-",
"letter",
"extension",
"of",
"an",
"access",
"sequence",
"as",
"suggested",
"by",
"Shahbaz",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/commons/counterexamples/src/main/java/de/learnlib/counterexamples/GlobalSuffixFinders.java#L238-L255 | train |
LearnLib/learnlib | algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/config/model/replacer/SingleReplacer.java | SingleReplacer.computeParentExtension | @Nullable
static <S, I, O> ReplacementResult<S, I, O> computeParentExtension(final MealyMachine<S, I, ?, O> hypothesis,
final Alphabet<I> inputs,
final AD... | java | @Nullable
static <S, I, O> ReplacementResult<S, I, O> computeParentExtension(final MealyMachine<S, I, ?, O> hypothesis,
final Alphabet<I> inputs,
final AD... | [
"@",
"Nullable",
"static",
"<",
"S",
",",
"I",
",",
"O",
">",
"ReplacementResult",
"<",
"S",
",",
"I",
",",
"O",
">",
"computeParentExtension",
"(",
"final",
"MealyMachine",
"<",
"S",
",",
"I",
",",
"?",
",",
"O",
">",
"hypothesis",
",",
"final",
"... | Try to compute a replacement for a ADT sub-tree that extends the parent ADS.
@param hypothesis
the hypothesis for determining the system behavior
@param inputs
the input symbols to consider
@param node
the root node of the sub-ADT
@param targetStates
the set of hypothesis states covered by the given ADT node
@param ad... | [
"Try",
"to",
"compute",
"a",
"replacement",
"for",
"a",
"ADT",
"sub",
"-",
"tree",
"that",
"extends",
"the",
"parent",
"ADS",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/config/model/replacer/SingleReplacer.java#L121-L167 | train |
LearnLib/learnlib | examples/src/main/java/de/learnlib/examples/Example1.java | Example1.constructSUL | private static CompactDFA<Character> constructSUL() {
// input alphabet contains characters 'a'..'b'
Alphabet<Character> sigma = Alphabets.characters('a', 'b');
// @formatter:off
// create automaton
return AutomatonBuilders.newDFA(sigma)
.withInitial("q0")
... | java | private static CompactDFA<Character> constructSUL() {
// input alphabet contains characters 'a'..'b'
Alphabet<Character> sigma = Alphabets.characters('a', 'b');
// @formatter:off
// create automaton
return AutomatonBuilders.newDFA(sigma)
.withInitial("q0")
... | [
"private",
"static",
"CompactDFA",
"<",
"Character",
">",
"constructSUL",
"(",
")",
"{",
"// input alphabet contains characters 'a'..'b'",
"Alphabet",
"<",
"Character",
">",
"sigma",
"=",
"Alphabets",
".",
"characters",
"(",
"'",
"'",
",",
"'",
"'",
")",
";",
... | creates example from Angluin's seminal paper.
@return example dfa | [
"creates",
"example",
"from",
"Angluin",
"s",
"seminal",
"paper",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/examples/src/main/java/de/learnlib/examples/Example1.java#L128-L151 | train |
LearnLib/learnlib | oracles/filters/cache/src/main/java/de/learnlib/filter/cache/dfa/DFACacheOracle.java | DFACacheOracle.createDAGCacheOracle | public static <I> DFACacheOracle<I> createDAGCacheOracle(Alphabet<I> alphabet,
MembershipOracle<I, Boolean> delegate) {
return new DFACacheOracle<>(new IncrementalDFADAGBuilder<>(alphabet), delegate);
} | java | public static <I> DFACacheOracle<I> createDAGCacheOracle(Alphabet<I> alphabet,
MembershipOracle<I, Boolean> delegate) {
return new DFACacheOracle<>(new IncrementalDFADAGBuilder<>(alphabet), delegate);
} | [
"public",
"static",
"<",
"I",
">",
"DFACacheOracle",
"<",
"I",
">",
"createDAGCacheOracle",
"(",
"Alphabet",
"<",
"I",
">",
"alphabet",
",",
"MembershipOracle",
"<",
"I",
",",
"Boolean",
">",
"delegate",
")",
"{",
"return",
"new",
"DFACacheOracle",
"<>",
"... | Creates a cache oracle for a DFA learning setup, using a DAG for internal cache organization.
@param alphabet
the alphabet containing the symbols of possible queries
@param delegate
the oracle to delegate queries to, in case of a cache-miss.
@param <I>
input symbol type
@return the cached {@link DFACacheOracle}.
@se... | [
"Creates",
"a",
"cache",
"oracle",
"for",
"a",
"DFA",
"learning",
"setup",
"using",
"a",
"DAG",
"for",
"internal",
"cache",
"organization",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/oracles/filters/cache/src/main/java/de/learnlib/filter/cache/dfa/DFACacheOracle.java#L127-L130 | train |
LearnLib/learnlib | algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/util/ADTUtil.java | ADTUtil.computeEffectiveResets | public static <S, I, O> int computeEffectiveResets(final ADTNode<S, I, O> adt) {
return computeEffectiveResetsInternal(adt, 0);
} | java | public static <S, I, O> int computeEffectiveResets(final ADTNode<S, I, O> adt) {
return computeEffectiveResetsInternal(adt, 0);
} | [
"public",
"static",
"<",
"S",
",",
"I",
",",
"O",
">",
"int",
"computeEffectiveResets",
"(",
"final",
"ADTNode",
"<",
"S",
",",
"I",
",",
"O",
">",
"adt",
")",
"{",
"return",
"computeEffectiveResetsInternal",
"(",
"adt",
",",
"0",
")",
";",
"}"
] | Computes how often reset nodes are encountered when traversing from the given node to the leaves of the induced
subtree of the given node.
@param adt
the node whose subtree should be analyzed
@param <S>
(hypothesis) state type
@param <I>
input alphabet type
@param <O>
output alphabet type
@return the number of encoun... | [
"Computes",
"how",
"often",
"reset",
"nodes",
"are",
"encountered",
"when",
"traversing",
"from",
"the",
"given",
"node",
"to",
"the",
"leaves",
"of",
"the",
"induced",
"subtree",
"of",
"the",
"given",
"node",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/util/ADTUtil.java#L218-L220 | train |
LearnLib/learnlib | algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/util/ADTUtil.java | ADTUtil.buildADSFromObservation | public static <S, I, O> ADTNode<S, I, O> buildADSFromObservation(final Word<I> input,
final Word<O> output,
final S finalState) {
if (input.size() != output.size()) {
... | java | public static <S, I, O> ADTNode<S, I, O> buildADSFromObservation(final Word<I> input,
final Word<O> output,
final S finalState) {
if (input.size() != output.size()) {
... | [
"public",
"static",
"<",
"S",
",",
"I",
",",
"O",
">",
"ADTNode",
"<",
"S",
",",
"I",
",",
"O",
">",
"buildADSFromObservation",
"(",
"final",
"Word",
"<",
"I",
">",
"input",
",",
"final",
"Word",
"<",
"O",
">",
"output",
",",
"final",
"S",
"final... | Build a single trace ADS from the given information.
@param input
the input sequence of the trace
@param output
the output sequence of the trace
@param finalState
the hypothesis state that should be referenced in the leaf of the ADS
@param <S>
(hypothesis) state type
@param <I>
input alphabet type
@param <O>
output al... | [
"Build",
"a",
"single",
"trace",
"ADS",
"from",
"the",
"given",
"information",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/util/ADTUtil.java#L278-L303 | train |
LearnLib/learnlib | datastructures/pta/src/main/java/de/learnlib/datastructure/pta/pta/BasePTA.java | BasePTA.bfsStates | @Nonnull
public List<S> bfsStates() {
List<S> stateList = new ArrayList<>();
Set<S> visited = new HashSet<>();
int ptr = 0;
stateList.add(root);
visited.add(root);
int numStates = 1;
while (ptr < numStates) {
S curr = stateList.get(ptr++);
... | java | @Nonnull
public List<S> bfsStates() {
List<S> stateList = new ArrayList<>();
Set<S> visited = new HashSet<>();
int ptr = 0;
stateList.add(root);
visited.add(root);
int numStates = 1;
while (ptr < numStates) {
S curr = stateList.get(ptr++);
... | [
"@",
"Nonnull",
"public",
"List",
"<",
"S",
">",
"bfsStates",
"(",
")",
"{",
"List",
"<",
"S",
">",
"stateList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Set",
"<",
"S",
">",
"visited",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"int",
"... | Retrieves a list of all states in this PTA that are reachable from the root state. The states will be returned in
breadth-first order.
@return a breadth-first ordered list of all states in this PTA | [
"Retrieves",
"a",
"list",
"of",
"all",
"states",
"in",
"this",
"PTA",
"that",
"are",
"reachable",
"from",
"the",
"root",
"state",
".",
"The",
"states",
"will",
"be",
"returned",
"in",
"breadth",
"-",
"first",
"order",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/pta/BasePTA.java#L299-L321 | train |
LearnLib/learnlib | datastructures/pta/src/main/java/de/learnlib/datastructure/pta/pta/BasePTA.java | BasePTA.bfsIterator | @Nonnull
public Iterator<S> bfsIterator() {
Set<S> visited = new HashSet<>();
final Deque<S> bfsQueue = new ArrayDeque<>();
bfsQueue.add(root);
visited.add(root);
return new AbstractIterator<S>() {
@Override
protected S computeNext() {
... | java | @Nonnull
public Iterator<S> bfsIterator() {
Set<S> visited = new HashSet<>();
final Deque<S> bfsQueue = new ArrayDeque<>();
bfsQueue.add(root);
visited.add(root);
return new AbstractIterator<S>() {
@Override
protected S computeNext() {
... | [
"@",
"Nonnull",
"public",
"Iterator",
"<",
"S",
">",
"bfsIterator",
"(",
")",
"{",
"Set",
"<",
"S",
">",
"visited",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"final",
"Deque",
"<",
"S",
">",
"bfsQueue",
"=",
"new",
"ArrayDeque",
"<>",
"(",
")",
... | Retrieves an iterator that can be used for iterating over all states in this PTA that are reachable from the root
state in a breadth-first order.
@return an iterator for iterating over all states in this PTA | [
"Retrieves",
"an",
"iterator",
"that",
"can",
"be",
"used",
"for",
"iterating",
"over",
"all",
"states",
"in",
"this",
"PTA",
"that",
"are",
"reachable",
"from",
"the",
"root",
"state",
"in",
"a",
"breadth",
"-",
"first",
"order",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/pta/BasePTA.java#L329-L353 | train |
LearnLib/learnlib | algorithms/active/lstar/src/main/java/de/learnlib/algorithms/lstar/AbstractLStar.java | AbstractLStar.incorporateCounterExample | protected List<List<Row<I>>> incorporateCounterExample(DefaultQuery<I, D> ce) {
return ObservationTableCEXHandlers.handleClassicLStar(ce, table, oracle);
} | java | protected List<List<Row<I>>> incorporateCounterExample(DefaultQuery<I, D> ce) {
return ObservationTableCEXHandlers.handleClassicLStar(ce, table, oracle);
} | [
"protected",
"List",
"<",
"List",
"<",
"Row",
"<",
"I",
">",
">",
">",
"incorporateCounterExample",
"(",
"DefaultQuery",
"<",
"I",
",",
"D",
">",
"ce",
")",
"{",
"return",
"ObservationTableCEXHandlers",
".",
"handleClassicLStar",
"(",
"ce",
",",
"table",
"... | Incorporates the information provided by a counterexample into the observation data structure.
@param ce
the query which contradicts the hypothesis
@return the rows (equivalence classes) which became unclosed by adding the information. | [
"Incorporates",
"the",
"information",
"provided",
"by",
"a",
"counterexample",
"into",
"the",
"observation",
"data",
"structure",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/lstar/src/main/java/de/learnlib/algorithms/lstar/AbstractLStar.java#L114-L116 | train |
LearnLib/learnlib | algorithms/active/lstar/src/main/java/de/learnlib/algorithms/lstar/AbstractLStar.java | AbstractLStar.completeConsistentTable | protected boolean completeConsistentTable(List<List<Row<I>>> unclosed, boolean checkConsistency) {
boolean refined = false;
List<List<Row<I>>> unclosedIter = unclosed;
do {
while (!unclosedIter.isEmpty()) {
List<Row<I>> closingRows = selectClosingRows(unclosedIter);
... | java | protected boolean completeConsistentTable(List<List<Row<I>>> unclosed, boolean checkConsistency) {
boolean refined = false;
List<List<Row<I>>> unclosedIter = unclosed;
do {
while (!unclosedIter.isEmpty()) {
List<Row<I>> closingRows = selectClosingRows(unclosedIter);
... | [
"protected",
"boolean",
"completeConsistentTable",
"(",
"List",
"<",
"List",
"<",
"Row",
"<",
"I",
">",
">",
">",
"unclosed",
",",
"boolean",
"checkConsistency",
")",
"{",
"boolean",
"refined",
"=",
"false",
";",
"List",
"<",
"List",
"<",
"Row",
"<",
"I"... | Iteratedly checks for unclosedness and inconsistencies in the table, and fixes any occurrences thereof. This
process is repeated until the observation table is both closed and consistent.
@param unclosed
the unclosed rows (equivalence classes) to start with. | [
"Iteratedly",
"checks",
"for",
"unclosedness",
"and",
"inconsistencies",
"in",
"the",
"table",
"and",
"fixes",
"any",
"occurrences",
"thereof",
".",
"This",
"process",
"is",
"repeated",
"until",
"the",
"observation",
"table",
"is",
"both",
"closed",
"and",
"cons... | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/lstar/src/main/java/de/learnlib/algorithms/lstar/AbstractLStar.java#L136-L160 | train |
LearnLib/learnlib | algorithms/active/lstar/src/main/java/de/learnlib/algorithms/lstar/AbstractLStar.java | AbstractLStar.analyzeInconsistency | protected Word<I> analyzeInconsistency(Inconsistency<I> incons) {
int inputIdx = alphabet.getSymbolIndex(incons.getSymbol());
Row<I> succRow1 = incons.getFirstRow().getSuccessor(inputIdx);
Row<I> succRow2 = incons.getSecondRow().getSuccessor(inputIdx);
int numSuffixes = table.getSuffix... | java | protected Word<I> analyzeInconsistency(Inconsistency<I> incons) {
int inputIdx = alphabet.getSymbolIndex(incons.getSymbol());
Row<I> succRow1 = incons.getFirstRow().getSuccessor(inputIdx);
Row<I> succRow2 = incons.getSecondRow().getSuccessor(inputIdx);
int numSuffixes = table.getSuffix... | [
"protected",
"Word",
"<",
"I",
">",
"analyzeInconsistency",
"(",
"Inconsistency",
"<",
"I",
">",
"incons",
")",
"{",
"int",
"inputIdx",
"=",
"alphabet",
".",
"getSymbolIndex",
"(",
"incons",
".",
"getSymbol",
"(",
")",
")",
";",
"Row",
"<",
"I",
">",
"... | Analyzes an inconsistency. This analysis consists in determining the column in which the two successor rows
differ.
@param incons
the inconsistency description
@return the suffix to add in order to fix the inconsistency | [
"Analyzes",
"an",
"inconsistency",
".",
"This",
"analysis",
"consists",
"in",
"determining",
"the",
"column",
"in",
"which",
"the",
"two",
"successor",
"rows",
"differ",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/lstar/src/main/java/de/learnlib/algorithms/lstar/AbstractLStar.java#L191-L209 | train |
LearnLib/learnlib | datastructures/discrimination-tree/src/main/java/de/learnlib/datastructure/discriminationtree/iterators/DiscriminationTreeIterators.java | DiscriminationTreeIterators.nodeIterator | public static <N extends AbstractDTNode<?, ?, ?, N>> Iterator<N> nodeIterator(N root) {
return new NodeIterator<>(root);
} | java | public static <N extends AbstractDTNode<?, ?, ?, N>> Iterator<N> nodeIterator(N root) {
return new NodeIterator<>(root);
} | [
"public",
"static",
"<",
"N",
"extends",
"AbstractDTNode",
"<",
"?",
",",
"?",
",",
"?",
",",
"N",
">",
">",
"Iterator",
"<",
"N",
">",
"nodeIterator",
"(",
"N",
"root",
")",
"{",
"return",
"new",
"NodeIterator",
"<>",
"(",
"root",
")",
";",
"}"
] | Iterator that traverses all nodes of a subtree of a given discrimination tree node.
@param root
the root node, from which traversal should start
@param <N>
node type | [
"Iterator",
"that",
"traverses",
"all",
"nodes",
"of",
"a",
"subtree",
"of",
"a",
"given",
"discrimination",
"tree",
"node",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/datastructures/discrimination-tree/src/main/java/de/learnlib/datastructure/discriminationtree/iterators/DiscriminationTreeIterators.java#L43-L45 | train |
LearnLib/learnlib | api/src/main/java/de/learnlib/api/logging/LoggingPropertyOracle.java | LoggingPropertyOracle.disprove | @Nullable
@Override
public DefaultQuery<I, D> disprove(A hypothesis, Collection<? extends I> inputs) throws ModelCheckingException {
final DefaultQuery<I, D> result = propertyOracle.disprove(hypothesis, inputs);
if (result != null) {
LOGGER.logEvent("Property violated: '" + toString(... | java | @Nullable
@Override
public DefaultQuery<I, D> disprove(A hypothesis, Collection<? extends I> inputs) throws ModelCheckingException {
final DefaultQuery<I, D> result = propertyOracle.disprove(hypothesis, inputs);
if (result != null) {
LOGGER.logEvent("Property violated: '" + toString(... | [
"@",
"Nullable",
"@",
"Override",
"public",
"DefaultQuery",
"<",
"I",
",",
"D",
">",
"disprove",
"(",
"A",
"hypothesis",
",",
"Collection",
"<",
"?",
"extends",
"I",
">",
"inputs",
")",
"throws",
"ModelCheckingException",
"{",
"final",
"DefaultQuery",
"<",
... | Try to disprove this propertyOracle, and log whenever it is disproved.
@see PropertyOracle#disprove(Output, Collection) | [
"Try",
"to",
"disprove",
"this",
"propertyOracle",
"and",
"log",
"whenever",
"it",
"is",
"disproved",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/api/src/main/java/de/learnlib/api/logging/LoggingPropertyOracle.java#L87-L97 | train |
LearnLib/learnlib | api/src/main/java/de/learnlib/api/logging/LoggingPropertyOracle.java | LoggingPropertyOracle.doFindCounterExample | @Nullable
@Override
public DefaultQuery<I, D> doFindCounterExample(A hypothesis, Collection<? extends I> inputs) throws
ModelCheckingException {
final DefaultQuery<I, D> result = propertyOracle.findCounterExam... | java | @Nullable
@Override
public DefaultQuery<I, D> doFindCounterExample(A hypothesis, Collection<? extends I> inputs) throws
ModelCheckingException {
final DefaultQuery<I, D> result = propertyOracle.findCounterExam... | [
"@",
"Nullable",
"@",
"Override",
"public",
"DefaultQuery",
"<",
"I",
",",
"D",
">",
"doFindCounterExample",
"(",
"A",
"hypothesis",
",",
"Collection",
"<",
"?",
"extends",
"I",
">",
"inputs",
")",
"throws",
"ModelCheckingException",
"{",
"final",
"DefaultQuer... | Try to find a counterexample to the given hypothesis, and log whenever such a spurious counterexample is found.
@see PropertyOracle#findCounterExample(Object, Collection) | [
"Try",
"to",
"find",
"a",
"counterexample",
"to",
"the",
"given",
"hypothesis",
"and",
"log",
"whenever",
"such",
"a",
"spurious",
"counterexample",
"is",
"found",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/api/src/main/java/de/learnlib/api/logging/LoggingPropertyOracle.java#L104-L114 | train |
LearnLib/learnlib | algorithms/passive/rpni/src/main/java/de/learnlib/algorithms/rpni/AbstractBlueFringeRPNI.java | AbstractBlueFringeRPNI.tryMerge | protected RedBlueMerge<SP, TP, BlueFringePTAState<SP, TP>> tryMerge(BlueFringePTA<SP, TP> pta,
BlueFringePTAState<SP, TP> qr,
BlueFringePTAState<SP, TP> qb) {
return pt... | java | protected RedBlueMerge<SP, TP, BlueFringePTAState<SP, TP>> tryMerge(BlueFringePTA<SP, TP> pta,
BlueFringePTAState<SP, TP> qr,
BlueFringePTAState<SP, TP> qb) {
return pt... | [
"protected",
"RedBlueMerge",
"<",
"SP",
",",
"TP",
",",
"BlueFringePTAState",
"<",
"SP",
",",
"TP",
">",
">",
"tryMerge",
"(",
"BlueFringePTA",
"<",
"SP",
",",
"TP",
">",
"pta",
",",
"BlueFringePTAState",
"<",
"SP",
",",
"TP",
">",
"qr",
",",
"BlueFrin... | Attempts to merge a blue state into a red state.
@param pta
the blue fringe PTA
@param qr
the red state (i.e., the merge target)
@param qb
the blue state (i.e., the merge source)
@return a valid {@link RedBlueMerge} object representing a possible merge of {@code qb} into {@code qr}, or
{@code null} if the merge is im... | [
"Attempts",
"to",
"merge",
"a",
"blue",
"state",
"into",
"a",
"red",
"state",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/passive/rpni/src/main/java/de/learnlib/algorithms/rpni/AbstractBlueFringeRPNI.java#L164-L168 | train |
LearnLib/learnlib | oracles/equivalence-oracles/src/main/java/de/learnlib/oracle/equivalence/SampleSetEQOracle.java | SampleSetEQOracle.add | public SampleSetEQOracle<I, D> add(Word<I> input, D expectedOutput) {
testQueries.add(new DefaultQuery<>(input, expectedOutput));
return this;
} | java | public SampleSetEQOracle<I, D> add(Word<I> input, D expectedOutput) {
testQueries.add(new DefaultQuery<>(input, expectedOutput));
return this;
} | [
"public",
"SampleSetEQOracle",
"<",
"I",
",",
"D",
">",
"add",
"(",
"Word",
"<",
"I",
">",
"input",
",",
"D",
"expectedOutput",
")",
"{",
"testQueries",
".",
"add",
"(",
"new",
"DefaultQuery",
"<>",
"(",
"input",
",",
"expectedOutput",
")",
")",
";",
... | Adds a query word along with its expected output to the sample set.
@param input
the input word
@param expectedOutput
the expected output for this word
@return {@code this}, to enable chained {@code add} or {@code addAll} calls | [
"Adds",
"a",
"query",
"word",
"along",
"with",
"its",
"expected",
"output",
"to",
"the",
"sample",
"set",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/oracles/equivalence-oracles/src/main/java/de/learnlib/oracle/equivalence/SampleSetEQOracle.java#L84-L87 | train |
LearnLib/learnlib | oracles/equivalence-oracles/src/main/java/de/learnlib/oracle/equivalence/SampleSetEQOracle.java | SampleSetEQOracle.addAll | @SafeVarargs
public final SampleSetEQOracle<I, D> addAll(MembershipOracle<I, D> oracle, Word<I>... words) {
return addAll(oracle, Arrays.asList(words));
} | java | @SafeVarargs
public final SampleSetEQOracle<I, D> addAll(MembershipOracle<I, D> oracle, Word<I>... words) {
return addAll(oracle, Arrays.asList(words));
} | [
"@",
"SafeVarargs",
"public",
"final",
"SampleSetEQOracle",
"<",
"I",
",",
"D",
">",
"addAll",
"(",
"MembershipOracle",
"<",
"I",
",",
"D",
">",
"oracle",
",",
"Word",
"<",
"I",
">",
"...",
"words",
")",
"{",
"return",
"addAll",
"(",
"oracle",
",",
"... | Adds several query words to the sample set. The expected output is determined by means of the specified
membership oracle.
@param oracle
the membership oracle used to determine expected outputs
@param words
the words to be added to the sample set
@return {@code this}, to enable chained {@code add} or {@code addAll} c... | [
"Adds",
"several",
"query",
"words",
"to",
"the",
"sample",
"set",
".",
"The",
"expected",
"output",
"is",
"determined",
"by",
"means",
"of",
"the",
"specified",
"membership",
"oracle",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/oracles/equivalence-oracles/src/main/java/de/learnlib/oracle/equivalence/SampleSetEQOracle.java#L100-L103 | train |
LearnLib/learnlib | oracles/equivalence-oracles/src/main/java/de/learnlib/oracle/equivalence/SampleSetEQOracle.java | SampleSetEQOracle.addAll | public SampleSetEQOracle<I, D> addAll(MembershipOracle<I, D> oracle, Collection<? extends Word<I>> words) {
if (words.isEmpty()) {
return this;
}
List<DefaultQuery<I, D>> newQueries = new ArrayList<>(words.size());
for (Word<I> w : words) {
newQueries.add(new Defa... | java | public SampleSetEQOracle<I, D> addAll(MembershipOracle<I, D> oracle, Collection<? extends Word<I>> words) {
if (words.isEmpty()) {
return this;
}
List<DefaultQuery<I, D>> newQueries = new ArrayList<>(words.size());
for (Word<I> w : words) {
newQueries.add(new Defa... | [
"public",
"SampleSetEQOracle",
"<",
"I",
",",
"D",
">",
"addAll",
"(",
"MembershipOracle",
"<",
"I",
",",
"D",
">",
"oracle",
",",
"Collection",
"<",
"?",
"extends",
"Word",
"<",
"I",
">",
">",
"words",
")",
"{",
"if",
"(",
"words",
".",
"isEmpty",
... | Adds words to the sample set. The expected output is determined by means of the specified membership oracle.
@param oracle
the membership oracle used to determine the expected output
@param words
the words to add
@return {@code this}, to enable chained {@code add} or {@code addAll} calls | [
"Adds",
"words",
"to",
"the",
"sample",
"set",
".",
"The",
"expected",
"output",
"is",
"determined",
"by",
"means",
"of",
"the",
"specified",
"membership",
"oracle",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/oracles/equivalence-oracles/src/main/java/de/learnlib/oracle/equivalence/SampleSetEQOracle.java#L115-L127 | train |
LearnLib/learnlib | datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/AbstractObservationTable.java | AbstractObservationTable.fetchResults | protected static <I, D> void fetchResults(Iterator<DefaultQuery<I, D>> queryIt, List<D> output, int numSuffixes) {
for (int j = 0; j < numSuffixes; j++) {
DefaultQuery<I, D> qry = queryIt.next();
output.add(qry.getOutput());
}
} | java | protected static <I, D> void fetchResults(Iterator<DefaultQuery<I, D>> queryIt, List<D> output, int numSuffixes) {
for (int j = 0; j < numSuffixes; j++) {
DefaultQuery<I, D> qry = queryIt.next();
output.add(qry.getOutput());
}
} | [
"protected",
"static",
"<",
"I",
",",
"D",
">",
"void",
"fetchResults",
"(",
"Iterator",
"<",
"DefaultQuery",
"<",
"I",
",",
"D",
">",
">",
"queryIt",
",",
"List",
"<",
"D",
">",
"output",
",",
"int",
"numSuffixes",
")",
"{",
"for",
"(",
"int",
"j"... | Fetches the given number of query responses and adds them to the specified output list. Also, the query iterator
is advanced accordingly.
@param queryIt
the query iterator
@param output
the output list to write to
@param numSuffixes
the number of suffixes (queries) | [
"Fetches",
"the",
"given",
"number",
"of",
"query",
"responses",
"and",
"adds",
"them",
"to",
"the",
"specified",
"output",
"list",
".",
"Also",
"the",
"query",
"iterator",
"is",
"advanced",
"accordingly",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/AbstractObservationTable.java#L171-L176 | train |
LearnLib/learnlib | oracles/filters/reuse/src/main/java/de/learnlib/filter/reuse/ReuseOracle.java | ReuseOracle.filterAndProcessQuery | private QueryResult<S, O> filterAndProcessQuery(Word<I> query,
Word<O> partialOutput,
Function<Word<I>, QueryResult<S, O>> processQuery) {
final LinkedList<I> filteredQueryList = new LinkedList<>(query.asList... | java | private QueryResult<S, O> filterAndProcessQuery(Word<I> query,
Word<O> partialOutput,
Function<Word<I>, QueryResult<S, O>> processQuery) {
final LinkedList<I> filteredQueryList = new LinkedList<>(query.asList... | [
"private",
"QueryResult",
"<",
"S",
",",
"O",
">",
"filterAndProcessQuery",
"(",
"Word",
"<",
"I",
">",
"query",
",",
"Word",
"<",
"O",
">",
"partialOutput",
",",
"Function",
"<",
"Word",
"<",
"I",
">",
",",
"QueryResult",
"<",
"S",
",",
"O",
">",
... | Filters all the query elements corresponding to "reflexive" edges in the reuse tree, executes the shorter query,
and fills the filtered outputs into the resulting output word.
@param query
the input query with "reflexive" symbols (may be a suffix of the original query, if a system state is
reused).
@param partialOutpu... | [
"Filters",
"all",
"the",
"query",
"elements",
"corresponding",
"to",
"reflexive",
"edges",
"in",
"the",
"reuse",
"tree",
"executes",
"the",
"shorter",
"query",
"and",
"fills",
"the",
"filtered",
"outputs",
"into",
"the",
"resulting",
"output",
"word",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/oracles/filters/reuse/src/main/java/de/learnlib/filter/reuse/ReuseOracle.java#L167-L197 | train |
LearnLib/learnlib | commons/counterexamples/src/main/java/de/learnlib/counterexamples/LocalSuffixFinders.java | LocalSuffixFinders.findLinear | public static <S, I, D> int findLinear(Query<I, D> ceQuery,
AccessSequenceTransformer<I> asTransformer,
SuffixOutput<I, D> hypOutput,
MembershipOracle<I, D> oracle) {
return AcexLoca... | java | public static <S, I, D> int findLinear(Query<I, D> ceQuery,
AccessSequenceTransformer<I> asTransformer,
SuffixOutput<I, D> hypOutput,
MembershipOracle<I, D> oracle) {
return AcexLoca... | [
"public",
"static",
"<",
"S",
",",
"I",
",",
"D",
">",
"int",
"findLinear",
"(",
"Query",
"<",
"I",
",",
"D",
">",
"ceQuery",
",",
"AccessSequenceTransformer",
"<",
"I",
">",
"asTransformer",
",",
"SuffixOutput",
"<",
"I",
",",
"D",
">",
"hypOutput",
... | Searches for a distinguishing suffixes by checking for counterexample yielding access sequence transformations in
linear ascending order.
@param ceQuery
the initial counterexample query
@param asTransformer
the access sequence transformer
@param hypOutput
interface to the hypothesis output, for checking whether the or... | [
"Searches",
"for",
"a",
"distinguishing",
"suffixes",
"by",
"checking",
"for",
"counterexample",
"yielding",
"access",
"sequence",
"transformations",
"in",
"linear",
"ascending",
"order",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/commons/counterexamples/src/main/java/de/learnlib/counterexamples/LocalSuffixFinders.java#L80-L91 | train |
LearnLib/learnlib | commons/counterexamples/src/main/java/de/learnlib/counterexamples/LocalSuffixFinders.java | LocalSuffixFinders.findLinearReverse | public static <I, D> int findLinearReverse(Query<I, D> ceQuery,
AccessSequenceTransformer<I> asTransformer,
SuffixOutput<I, D> hypOutput,
MembershipOracle<I, D> oracle) {
... | java | public static <I, D> int findLinearReverse(Query<I, D> ceQuery,
AccessSequenceTransformer<I> asTransformer,
SuffixOutput<I, D> hypOutput,
MembershipOracle<I, D> oracle) {
... | [
"public",
"static",
"<",
"I",
",",
"D",
">",
"int",
"findLinearReverse",
"(",
"Query",
"<",
"I",
",",
"D",
">",
"ceQuery",
",",
"AccessSequenceTransformer",
"<",
"I",
">",
"asTransformer",
",",
"SuffixOutput",
"<",
"I",
",",
"D",
">",
"hypOutput",
",",
... | Searches for a distinguishing suffixes by checking for counterexample yielding access sequence transformations in
linear descending order.
@param ceQuery
the initial counterexample query
@param asTransformer
the access sequence transformer
@param hypOutput
interface to the hypothesis output, for checking whether the o... | [
"Searches",
"for",
"a",
"distinguishing",
"suffixes",
"by",
"checking",
"for",
"counterexample",
"yielding",
"access",
"sequence",
"transformations",
"in",
"linear",
"descending",
"order",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/commons/counterexamples/src/main/java/de/learnlib/counterexamples/LocalSuffixFinders.java#L110-L121 | train |
LearnLib/learnlib | commons/counterexamples/src/main/java/de/learnlib/counterexamples/LocalSuffixFinders.java | LocalSuffixFinders.findRivestSchapire | public static <I, D> int findRivestSchapire(Query<I, D> ceQuery,
AccessSequenceTransformer<I> asTransformer,
SuffixOutput<I, D> hypOutput,
MembershipOracle<I, D> oracle) {
... | java | public static <I, D> int findRivestSchapire(Query<I, D> ceQuery,
AccessSequenceTransformer<I> asTransformer,
SuffixOutput<I, D> hypOutput,
MembershipOracle<I, D> oracle) {
... | [
"public",
"static",
"<",
"I",
",",
"D",
">",
"int",
"findRivestSchapire",
"(",
"Query",
"<",
"I",
",",
"D",
">",
"ceQuery",
",",
"AccessSequenceTransformer",
"<",
"I",
">",
"asTransformer",
",",
"SuffixOutput",
"<",
"I",
",",
"D",
">",
"hypOutput",
",",
... | Searches for a distinguishing suffixes by checking for counterexample yielding access sequence transformations
using a binary search, as proposed by Rivest & Schapire.
@param ceQuery
the initial counterexample query
@param asTransformer
the access sequence transformer
@param hypOutput
interface to the hypothesis o... | [
"Searches",
"for",
"a",
"distinguishing",
"suffixes",
"by",
"checking",
"for",
"counterexample",
"yielding",
"access",
"sequence",
"transformations",
"using",
"a",
"binary",
"search",
"as",
"proposed",
"by",
"Rivest",
"&",
";",
"Schapire",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/commons/counterexamples/src/main/java/de/learnlib/counterexamples/LocalSuffixFinders.java#L140-L151 | train |
LearnLib/learnlib | algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/learner/ADTLearner.java | ADTLearner.closeTransition | private void closeTransition(final ADTTransition<I, O> transition) {
if (!transition.needsSifting()) {
return;
}
final Word<I> accessSequence = transition.getSource().getAccessSequence();
final I symbol = transition.getInput();
this.oracle.reset();
for (fin... | java | private void closeTransition(final ADTTransition<I, O> transition) {
if (!transition.needsSifting()) {
return;
}
final Word<I> accessSequence = transition.getSource().getAccessSequence();
final I symbol = transition.getInput();
this.oracle.reset();
for (fin... | [
"private",
"void",
"closeTransition",
"(",
"final",
"ADTTransition",
"<",
"I",
",",
"O",
">",
"transition",
")",
"{",
"if",
"(",
"!",
"transition",
".",
"needsSifting",
"(",
")",
")",
"{",
"return",
";",
"}",
"final",
"Word",
"<",
"I",
">",
"accessSequ... | Close the given transitions by means of sifting the associated long prefix through the ADT.
@param transition
the transition to close | [
"Close",
"the",
"given",
"transitions",
"by",
"means",
"of",
"sifting",
"the",
"associated",
"long",
"prefix",
"through",
"the",
"ADT",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/learner/ADTLearner.java#L309-L351 | train |
LearnLib/learnlib | algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/learner/ADTLearner.java | ADTLearner.ensureConsistency | private void ensureConsistency(final ADTNode<ADTState<I, O>, I, O> leaf) {
final ADTState<I, O> state = leaf.getHypothesisState();
final Word<I> as = state.getAccessSequence();
final Word<O> asOut = this.hypothesis.computeOutput(as);
ADTNode<ADTState<I, O>, I, O> iter = leaf;
... | java | private void ensureConsistency(final ADTNode<ADTState<I, O>, I, O> leaf) {
final ADTState<I, O> state = leaf.getHypothesisState();
final Word<I> as = state.getAccessSequence();
final Word<O> asOut = this.hypothesis.computeOutput(as);
ADTNode<ADTState<I, O>, I, O> iter = leaf;
... | [
"private",
"void",
"ensureConsistency",
"(",
"final",
"ADTNode",
"<",
"ADTState",
"<",
"I",
",",
"O",
">",
",",
"I",
",",
"O",
">",
"leaf",
")",
"{",
"final",
"ADTState",
"<",
"I",
",",
"O",
">",
"state",
"=",
"leaf",
".",
"getHypothesisState",
"(",
... | Ensure that the output behavior of a hypothesis state matches the observed output behavior recorded in the ADT.
Any differences in output behavior yields new counterexamples.
@param leaf
the leaf whose hypothesis state should be checked | [
"Ensure",
"that",
"the",
"output",
"behavior",
"of",
"a",
"hypothesis",
"state",
"matches",
"the",
"observed",
"output",
"behavior",
"recorded",
"in",
"the",
"ADT",
".",
"Any",
"differences",
"in",
"output",
"behavior",
"yields",
"new",
"counterexamples",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/learner/ADTLearner.java#L427-L449 | train |
LearnLib/learnlib | algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/learner/ADTLearner.java | ADTLearner.validateADS | private boolean validateADS(final ADTNode<ADTState<I, O>, I, O> oldADS,
final ADTNode<ADTState<I, O>, I, O> newADS,
final Set<ADTState<I, O>> cutout) {
final Set<ADTNode<ADTState<I, O>, I, O>> oldNodes;
if (ADTUtil.isResetNode(oldADS)) {
... | java | private boolean validateADS(final ADTNode<ADTState<I, O>, I, O> oldADS,
final ADTNode<ADTState<I, O>, I, O> newADS,
final Set<ADTState<I, O>> cutout) {
final Set<ADTNode<ADTState<I, O>, I, O>> oldNodes;
if (ADTUtil.isResetNode(oldADS)) {
... | [
"private",
"boolean",
"validateADS",
"(",
"final",
"ADTNode",
"<",
"ADTState",
"<",
"I",
",",
"O",
">",
",",
"I",
",",
"O",
">",
"oldADS",
",",
"final",
"ADTNode",
"<",
"ADTState",
"<",
"I",
",",
"O",
">",
",",
"I",
",",
"O",
">",
"newADS",
",",
... | Validate the well-definedness of an ADT replacement, i.e. both ADTs cover the same set of hypothesis states and
the output behavior described in the replacement matches the hypothesis output.
@param oldADS
the old ADT (subtree) to be replaced
@param newADS
the new ADT (subtree)
@param cutout
the set of states not cove... | [
"Validate",
"the",
"well",
"-",
"definedness",
"of",
"an",
"ADT",
"replacement",
"i",
".",
"e",
".",
"both",
"ADTs",
"cover",
"the",
"same",
"set",
"of",
"hypothesis",
"states",
"and",
"the",
"output",
"behavior",
"described",
"in",
"the",
"replacement",
"... | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/learner/ADTLearner.java#L564-L610 | train |
LearnLib/learnlib | algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/model/ObservationTree.java | ObservationTree.initialize | public void initialize(final Collection<S> states,
final Function<S, Word<I>> asFunction,
final Function<Word<I>, Word<O>> outputFunction) {
final FastMealyState<O> init = this.observationTree.addInitialState();
for (final S s : states) {
... | java | public void initialize(final Collection<S> states,
final Function<S, Word<I>> asFunction,
final Function<Word<I>, Word<O>> outputFunction) {
final FastMealyState<O> init = this.observationTree.addInitialState();
for (final S s : states) {
... | [
"public",
"void",
"initialize",
"(",
"final",
"Collection",
"<",
"S",
">",
"states",
",",
"final",
"Function",
"<",
"S",
",",
"Word",
"<",
"I",
">",
">",
"asFunction",
",",
"final",
"Function",
"<",
"Word",
"<",
"I",
">",
",",
"Word",
"<",
"O",
">"... | Extended initialization method, that allows to initialize the observation tree with several hypothesis states.
@param states
The hypothesis states to initialize the observation tree with
@param asFunction
Function to compute the access sequence of a node
@param outputFunction
Function to compute the output of the acce... | [
"Extended",
"initialization",
"method",
"that",
"allows",
"to",
"initialize",
"the",
"observation",
"tree",
"with",
"several",
"hypothesis",
"states",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/model/ObservationTree.java#L92-L102 | train |
LearnLib/learnlib | algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/model/ObservationTree.java | ObservationTree.addState | public void addState(final S newState, final Word<I> accessSequence, final O output) {
final Word<I> prefix = accessSequence.prefix(accessSequence.length() - 1);
final I sym = accessSequence.lastSymbol();
final FastMealyState<O> pred =
this.observationTree.getSuccessor(this.obse... | java | public void addState(final S newState, final Word<I> accessSequence, final O output) {
final Word<I> prefix = accessSequence.prefix(accessSequence.length() - 1);
final I sym = accessSequence.lastSymbol();
final FastMealyState<O> pred =
this.observationTree.getSuccessor(this.obse... | [
"public",
"void",
"addState",
"(",
"final",
"S",
"newState",
",",
"final",
"Word",
"<",
"I",
">",
"accessSequence",
",",
"final",
"O",
"output",
")",
"{",
"final",
"Word",
"<",
"I",
">",
"prefix",
"=",
"accessSequence",
".",
"prefix",
"(",
"accessSequenc... | Registers a new hypothesis state at the observation tree. It is expected to register states in the order of their
discovery, meaning whenever a new state is added, information about all prefixes of its access sequence are
already stored. Therefore providing only the output of the last symbol of its access sequence is s... | [
"Registers",
"a",
"new",
"hypothesis",
"state",
"at",
"the",
"observation",
"tree",
".",
"It",
"is",
"expected",
"to",
"register",
"states",
"in",
"the",
"order",
"of",
"their",
"discovery",
"meaning",
"whenever",
"a",
"new",
"state",
"is",
"added",
"informa... | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/model/ObservationTree.java#L181-L197 | train |
LearnLib/learnlib | algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/model/ObservationTree.java | ObservationTree.findSeparatingWord | public Optional<Word<I>> findSeparatingWord(final S s1, final S s2, final Word<I> prefix) {
final FastMealyState<O> n1 = this.nodeToObservationMap.get(s1);
final FastMealyState<O> n2 = this.nodeToObservationMap.get(s2);
final FastMealyState<O> s1Succ = this.observationTree.getSuccessor(n1, pre... | java | public Optional<Word<I>> findSeparatingWord(final S s1, final S s2, final Word<I> prefix) {
final FastMealyState<O> n1 = this.nodeToObservationMap.get(s1);
final FastMealyState<O> n2 = this.nodeToObservationMap.get(s2);
final FastMealyState<O> s1Succ = this.observationTree.getSuccessor(n1, pre... | [
"public",
"Optional",
"<",
"Word",
"<",
"I",
">",
">",
"findSeparatingWord",
"(",
"final",
"S",
"s1",
",",
"final",
"S",
"s2",
",",
"final",
"Word",
"<",
"I",
">",
"prefix",
")",
"{",
"final",
"FastMealyState",
"<",
"O",
">",
"n1",
"=",
"this",
"."... | Find a separating word for two hypothesis states, after applying given input sequence first.
@param s1
first state
@param s2
second state
@param prefix
input sequence
@return A {@link Word} separating the two states reached after applying the prefix to s1 and s2. {@code
Optional.empty()} if not separating word exists... | [
"Find",
"a",
"separating",
"word",
"for",
"two",
"hypothesis",
"states",
"after",
"applying",
"given",
"input",
"sequence",
"first",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/model/ObservationTree.java#L212-L230 | train |
LearnLib/learnlib | algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/model/ObservationTree.java | ObservationTree.findSeparatingWord | public Word<I> findSeparatingWord(final S s1, final S s2) {
final FastMealyState<O> n1 = this.nodeToObservationMap.get(s1);
final FastMealyState<O> n2 = this.nodeToObservationMap.get(s2);
return NearLinearEquivalenceTest.findSeparatingWord(this.observationTree, n1, n2, this.alphabet, true);
... | java | public Word<I> findSeparatingWord(final S s1, final S s2) {
final FastMealyState<O> n1 = this.nodeToObservationMap.get(s1);
final FastMealyState<O> n2 = this.nodeToObservationMap.get(s2);
return NearLinearEquivalenceTest.findSeparatingWord(this.observationTree, n1, n2, this.alphabet, true);
... | [
"public",
"Word",
"<",
"I",
">",
"findSeparatingWord",
"(",
"final",
"S",
"s1",
",",
"final",
"S",
"s2",
")",
"{",
"final",
"FastMealyState",
"<",
"O",
">",
"n1",
"=",
"this",
".",
"nodeToObservationMap",
".",
"get",
"(",
"s1",
")",
";",
"final",
"Fa... | Find a separating word for two hypothesis states.
@param s1
first state
@param s2
second state
@return A {@link Word} separating the two words. {@code null} if no such word is found. | [
"Find",
"a",
"separating",
"word",
"for",
"two",
"hypothesis",
"states",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/model/ObservationTree.java#L242-L248 | train |
LearnLib/learnlib | algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java | AbstractTTTLearner.link | protected static <I, D> void link(AbstractBaseDTNode<I, D> dtNode, TTTState<I, D> state) {
assert dtNode.isLeaf();
dtNode.setData(state);
state.dtLeaf = dtNode;
} | java | protected static <I, D> void link(AbstractBaseDTNode<I, D> dtNode, TTTState<I, D> state) {
assert dtNode.isLeaf();
dtNode.setData(state);
state.dtLeaf = dtNode;
} | [
"protected",
"static",
"<",
"I",
",",
"D",
">",
"void",
"link",
"(",
"AbstractBaseDTNode",
"<",
"I",
",",
"D",
">",
"dtNode",
",",
"TTTState",
"<",
"I",
",",
"D",
">",
"state",
")",
"{",
"assert",
"dtNode",
".",
"isLeaf",
"(",
")",
";",
"dtNode",
... | Establish the connection between a node in the discrimination tree and a state of the hypothesis.
@param dtNode
the node in the discrimination tree
@param state
the state in the hypothesis | [
"Establish",
"the",
"connection",
"between",
"a",
"node",
"in",
"the",
"discrimination",
"tree",
"and",
"a",
"state",
"of",
"the",
"hypothesis",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java#L135-L140 | train |
LearnLib/learnlib | algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java | AbstractTTTLearner.initializeState | protected void initializeState(TTTState<I, D> state) {
for (int i = 0; i < alphabet.size(); i++) {
I sym = alphabet.getSymbol(i);
TTTTransition<I, D> trans = createTransition(state, sym);
trans.setNonTreeTarget(dtree.getRoot());
state.setTransition(i, trans);
... | java | protected void initializeState(TTTState<I, D> state) {
for (int i = 0; i < alphabet.size(); i++) {
I sym = alphabet.getSymbol(i);
TTTTransition<I, D> trans = createTransition(state, sym);
trans.setNonTreeTarget(dtree.getRoot());
state.setTransition(i, trans);
... | [
"protected",
"void",
"initializeState",
"(",
"TTTState",
"<",
"I",
",",
"D",
">",
"state",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"alphabet",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"I",
"sym",
"=",
"alphabet",
".",... | Initializes a state. Creates its outgoing transition objects, and adds them to the "open" list.
@param state
the state to initialize | [
"Initializes",
"a",
"state",
".",
"Creates",
"its",
"outgoing",
"transition",
"objects",
"and",
"adds",
"them",
"to",
"the",
"open",
"list",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java#L177-L185 | train |
LearnLib/learnlib | algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java | AbstractTTTLearner.splitState | private void splitState(TTTTransition<I, D> transition, Word<I> tempDiscriminator, D oldOut, D newOut) {
assert !transition.isTree();
notifyPreSplit(transition, tempDiscriminator);
AbstractBaseDTNode<I, D> dtNode = transition.getNonTreeTarget();
assert dtNode.isLeaf();
TTTState... | java | private void splitState(TTTTransition<I, D> transition, Word<I> tempDiscriminator, D oldOut, D newOut) {
assert !transition.isTree();
notifyPreSplit(transition, tempDiscriminator);
AbstractBaseDTNode<I, D> dtNode = transition.getNonTreeTarget();
assert dtNode.isLeaf();
TTTState... | [
"private",
"void",
"splitState",
"(",
"TTTTransition",
"<",
"I",
",",
"D",
">",
"transition",
",",
"Word",
"<",
"I",
">",
"tempDiscriminator",
",",
"D",
"oldOut",
",",
"D",
"newOut",
")",
"{",
"assert",
"!",
"transition",
".",
"isTree",
"(",
")",
";",
... | Splits a state in the hypothesis, using a temporary discriminator. The state to be split is identified by an
incoming non-tree transition. This transition is subsequently turned into a spanning tree transition.
@param transition
the transition
@param tempDiscriminator
the temporary discriminator | [
"Splits",
"a",
"state",
"in",
"the",
"hypothesis",
"using",
"a",
"temporary",
"discriminator",
".",
"The",
"state",
"to",
"be",
"split",
"is",
"identified",
"by",
"an",
"incoming",
"non",
"-",
"tree",
"transition",
".",
"This",
"transition",
"is",
"subsequen... | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java#L234-L257 | train |
LearnLib/learnlib | algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java | AbstractTTTLearner.finalizeAny | protected boolean finalizeAny() {
GlobalSplitter<I, D> splitter = findSplitterGlobal();
if (splitter != null) {
finalizeDiscriminator(splitter.blockRoot, splitter.localSplitter);
return true;
}
return false;
} | java | protected boolean finalizeAny() {
GlobalSplitter<I, D> splitter = findSplitterGlobal();
if (splitter != null) {
finalizeDiscriminator(splitter.blockRoot, splitter.localSplitter);
return true;
}
return false;
} | [
"protected",
"boolean",
"finalizeAny",
"(",
")",
"{",
"GlobalSplitter",
"<",
"I",
",",
"D",
">",
"splitter",
"=",
"findSplitterGlobal",
"(",
")",
";",
"if",
"(",
"splitter",
"!=",
"null",
")",
"{",
"finalizeDiscriminator",
"(",
"splitter",
".",
"blockRoot",
... | Chooses a block root, and finalizes the corresponding discriminator.
@return {@code true} if a splittable block root was found, {@code false} otherwise. | [
"Chooses",
"a",
"block",
"root",
"and",
"finalizes",
"the",
"corresponding",
"discriminator",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java#L304-L311 | train |
LearnLib/learnlib | algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java | AbstractTTTLearner.getAnyTarget | protected TTTState<I, D> getAnyTarget(TTTTransition<I, D> trans) {
if (trans.isTree()) {
return trans.getTreeTarget();
}
return trans.getNonTreeTarget().anySubtreeState();
} | java | protected TTTState<I, D> getAnyTarget(TTTTransition<I, D> trans) {
if (trans.isTree()) {
return trans.getTreeTarget();
}
return trans.getNonTreeTarget().anySubtreeState();
} | [
"protected",
"TTTState",
"<",
"I",
",",
"D",
">",
"getAnyTarget",
"(",
"TTTTransition",
"<",
"I",
",",
"D",
">",
"trans",
")",
"{",
"if",
"(",
"trans",
".",
"isTree",
"(",
")",
")",
"{",
"return",
"trans",
".",
"getTreeTarget",
"(",
")",
";",
"}",
... | Retrieves the target state of a given transition. This method works for both tree and non-tree transitions. If a
non-tree transition points to a non-leaf node, it is updated accordingly before a result is obtained.
@param trans
the transition
@return the target state of this transition (possibly after it having been ... | [
"Retrieves",
"the",
"target",
"state",
"of",
"a",
"given",
"transition",
".",
"This",
"method",
"works",
"for",
"both",
"tree",
"and",
"non",
"-",
"tree",
"transitions",
".",
"If",
"a",
"non",
"-",
"tree",
"transition",
"points",
"to",
"a",
"non",
"-",
... | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java#L507-L512 | train |
LearnLib/learnlib | algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java | AbstractTTTLearner.getAnyState | private TTTState<I, D> getAnyState(Iterable<? extends I> suffix) {
return getAnySuccessor(hypothesis.getInitialState(), suffix);
} | java | private TTTState<I, D> getAnyState(Iterable<? extends I> suffix) {
return getAnySuccessor(hypothesis.getInitialState(), suffix);
} | [
"private",
"TTTState",
"<",
"I",
",",
"D",
">",
"getAnyState",
"(",
"Iterable",
"<",
"?",
"extends",
"I",
">",
"suffix",
")",
"{",
"return",
"getAnySuccessor",
"(",
"hypothesis",
".",
"getInitialState",
"(",
")",
",",
"suffix",
")",
";",
"}"
] | Retrieves the state reached by the given sequence of symbols, starting from the initial state.
@param suffix
the sequence of symbols to process
@return the state reached after processing the specified symbols | [
"Retrieves",
"the",
"state",
"reached",
"by",
"the",
"given",
"sequence",
"of",
"symbols",
"starting",
"from",
"the",
"initial",
"state",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java#L522-L524 | train |
LearnLib/learnlib | algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java | AbstractTTTLearner.query | protected D query(Word<I> prefix, Word<I> suffix) {
return oracle.answerQuery(prefix, suffix);
} | java | protected D query(Word<I> prefix, Word<I> suffix) {
return oracle.answerQuery(prefix, suffix);
} | [
"protected",
"D",
"query",
"(",
"Word",
"<",
"I",
">",
"prefix",
",",
"Word",
"<",
"I",
">",
"suffix",
")",
"{",
"return",
"oracle",
".",
"answerQuery",
"(",
"prefix",
",",
"suffix",
")",
";",
"}"
] | Performs a membership query.
@param prefix
the prefix part of the query
@param suffix
the suffix part of the query
@return the output | [
"Performs",
"a",
"membership",
"query",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java#L917-L919 | train |
LearnLib/learnlib | algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java | AbstractTTTLearner.query | protected D query(AccessSequenceProvider<I> accessSeqProvider, Word<I> suffix) {
return query(accessSeqProvider.getAccessSequence(), suffix);
} | java | protected D query(AccessSequenceProvider<I> accessSeqProvider, Word<I> suffix) {
return query(accessSeqProvider.getAccessSequence(), suffix);
} | [
"protected",
"D",
"query",
"(",
"AccessSequenceProvider",
"<",
"I",
">",
"accessSeqProvider",
",",
"Word",
"<",
"I",
">",
"suffix",
")",
"{",
"return",
"query",
"(",
"accessSeqProvider",
".",
"getAccessSequence",
"(",
")",
",",
"suffix",
")",
";",
"}"
] | Performs a membership query, using an access sequence as its prefix.
@param accessSeqProvider
the object from which to obtain the access sequence
@param suffix
the suffix part of the query
@return the output | [
"Performs",
"a",
"membership",
"query",
"using",
"an",
"access",
"sequence",
"as",
"its",
"prefix",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java#L931-L933 | train |
LearnLib/learnlib | commons/acex/src/main/java/de/learnlib/acex/analyzers/AcexAnalysisAlgorithms.java | AcexAnalysisAlgorithms.linearSearchFwd | public static <E> int linearSearchFwd(AbstractCounterexample<E> acex, int low, int high) {
assert !acex.testEffects(low, high);
E effPrev = acex.effect(low);
for (int i = low + 1; i <= high; i++) {
E eff = acex.effect(i);
if (!acex.checkEffects(effPrev, eff)) {
... | java | public static <E> int linearSearchFwd(AbstractCounterexample<E> acex, int low, int high) {
assert !acex.testEffects(low, high);
E effPrev = acex.effect(low);
for (int i = low + 1; i <= high; i++) {
E eff = acex.effect(i);
if (!acex.checkEffects(effPrev, eff)) {
... | [
"public",
"static",
"<",
"E",
">",
"int",
"linearSearchFwd",
"(",
"AbstractCounterexample",
"<",
"E",
">",
"acex",
",",
"int",
"low",
",",
"int",
"high",
")",
"{",
"assert",
"!",
"acex",
".",
"testEffects",
"(",
"low",
",",
"high",
")",
";",
"E",
"ef... | Scan linearly through the counterexample in ascending order.
@param acex
the abstract counterexample
@param low
the lower bound of the search range
@param high
the upper bound of the search range
@return an index <code>i</code> such that <code>acex.testEffect(i) != acex.testEffect(i+1)</code> | [
"Scan",
"linearly",
"through",
"the",
"counterexample",
"in",
"ascending",
"order",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/commons/acex/src/main/java/de/learnlib/acex/analyzers/AcexAnalysisAlgorithms.java#L38-L50 | train |
LearnLib/learnlib | commons/acex/src/main/java/de/learnlib/acex/analyzers/AcexAnalysisAlgorithms.java | AcexAnalysisAlgorithms.exponentialSearchBwd | public static <E> int exponentialSearchBwd(AbstractCounterexample<E> acex, int low, int high) {
assert !acex.testEffects(low, high);
int ofs = 1;
E effHigh = acex.effect(high);
int highIter = high;
int lowIter = low;
while (highIter - ofs > lowIter) {
int n... | java | public static <E> int exponentialSearchBwd(AbstractCounterexample<E> acex, int low, int high) {
assert !acex.testEffects(low, high);
int ofs = 1;
E effHigh = acex.effect(high);
int highIter = high;
int lowIter = low;
while (highIter - ofs > lowIter) {
int n... | [
"public",
"static",
"<",
"E",
">",
"int",
"exponentialSearchBwd",
"(",
"AbstractCounterexample",
"<",
"E",
">",
"acex",
",",
"int",
"low",
",",
"int",
"high",
")",
"{",
"assert",
"!",
"acex",
".",
"testEffects",
"(",
"low",
",",
"high",
")",
";",
"int"... | Search for a suffix index using an exponential search.
@param acex
the abstract counterexample
@param low
the lower bound of the search range
@param high
the upper bound of the search range
@return an index <code>i</code> such that <code>acex.testEffect(i) != acex.testEffect(i+1)</code> | [
"Search",
"for",
"a",
"suffix",
"index",
"using",
"an",
"exponential",
"search",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/commons/acex/src/main/java/de/learnlib/acex/analyzers/AcexAnalysisAlgorithms.java#L90-L111 | train |
LearnLib/learnlib | oracles/filters/reuse/src/main/java/de/learnlib/filter/reuse/tree/BoundedDeque.java | BoundedDeque.insert | public E insert(E element) {
E evicted = null;
if (size() >= capacity) {
if (evictPolicy == EvictPolicy.REJECT_NEW) {
// reject the new element
return element;
}
// Evict first, so we do not need to resize
evicted = evict();... | java | public E insert(E element) {
E evicted = null;
if (size() >= capacity) {
if (evictPolicy == EvictPolicy.REJECT_NEW) {
// reject the new element
return element;
}
// Evict first, so we do not need to resize
evicted = evict();... | [
"public",
"E",
"insert",
"(",
"E",
"element",
")",
"{",
"E",
"evicted",
"=",
"null",
";",
"if",
"(",
"size",
"(",
")",
">=",
"capacity",
")",
"{",
"if",
"(",
"evictPolicy",
"==",
"EvictPolicy",
".",
"REJECT_NEW",
")",
"{",
"// reject the new element",
... | Inserts an element into the deque, and returns the one that had to be evicted in case of a capacity violation.
@param element
the element to insert
@return the evicted element, {@code null} if the maximum capacity has not been reached | [
"Inserts",
"an",
"element",
"into",
"the",
"deque",
"and",
"returns",
"the",
"one",
"that",
"had",
"to",
"be",
"evicted",
"in",
"case",
"of",
"a",
"capacity",
"violation",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/oracles/filters/reuse/src/main/java/de/learnlib/filter/reuse/tree/BoundedDeque.java#L85-L97 | train |
LearnLib/learnlib | algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/adt/ADT.java | ADT.sift | public ADTNode<S, I, O> sift(final SymbolQueryOracle<I, O> oracle,
final Word<I> word,
final ADTNode<S, I, O> subtree) {
ADTNode<S, I, O> current = subtree;
while (!ADTUtil.isLeafNode(current)) {
current = current.sift(oracl... | java | public ADTNode<S, I, O> sift(final SymbolQueryOracle<I, O> oracle,
final Word<I> word,
final ADTNode<S, I, O> subtree) {
ADTNode<S, I, O> current = subtree;
while (!ADTUtil.isLeafNode(current)) {
current = current.sift(oracl... | [
"public",
"ADTNode",
"<",
"S",
",",
"I",
",",
"O",
">",
"sift",
"(",
"final",
"SymbolQueryOracle",
"<",
"I",
",",
"O",
">",
"oracle",
",",
"final",
"Word",
"<",
"I",
">",
"word",
",",
"final",
"ADTNode",
"<",
"S",
",",
"I",
",",
"O",
">",
"subt... | Successively sifts a word through the ADT induced by the given node. Stops when reaching a leaf.
@param word
the word to sift
@param subtree
the node whose subtree is considered
@return the leaf (see {@link ADTNode#sift(SymbolQueryOracle, Word)}) | [
"Successively",
"sifts",
"a",
"word",
"through",
"the",
"ADT",
"induced",
"by",
"the",
"given",
"node",
".",
"Stops",
"when",
"reaching",
"a",
"leaf",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/adt/ADT.java#L118-L129 | train |
LearnLib/learnlib | algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/adt/ADT.java | ADT.extendLeaf | public ADTNode<S, I, O> extendLeaf(final ADTNode<S, I, O> nodeToSplit,
final Word<I> distinguishingSuffix,
final Word<O> oldOutput,
final Word<O> newOutput) {
if (!ADTUtil.isLeafNode(nodeToSplit... | java | public ADTNode<S, I, O> extendLeaf(final ADTNode<S, I, O> nodeToSplit,
final Word<I> distinguishingSuffix,
final Word<O> oldOutput,
final Word<O> newOutput) {
if (!ADTUtil.isLeafNode(nodeToSplit... | [
"public",
"ADTNode",
"<",
"S",
",",
"I",
",",
"O",
">",
"extendLeaf",
"(",
"final",
"ADTNode",
"<",
"S",
",",
"I",
",",
"O",
">",
"nodeToSplit",
",",
"final",
"Word",
"<",
"I",
">",
"distinguishingSuffix",
",",
"final",
"Word",
"<",
"O",
">",
"oldO... | Splitting a leaf node by extending the trace leading into the node to split.
@param nodeToSplit
the leaf node to extends
@param distinguishingSuffix
the input sequence that splits the hypothesis state of the leaf to split and the new node. The current
trace leading into the node to split must be a prefix of this word.... | [
"Splitting",
"a",
"leaf",
"node",
"by",
"extending",
"the",
"trace",
"leading",
"into",
"the",
"node",
"to",
"split",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/adt/ADT.java#L146-L166 | train |
LearnLib/learnlib | algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/adt/ADT.java | ADT.findLCA | public LCAInfo<S, I, O> findLCA(final ADTNode<S, I, O> s1, final ADTNode<S, I, O> s2) {
final Map<ADTNode<S, I, O>, ADTNode<S, I, O>> s1ParentsToS1 = new HashMap<>();
ADTNode<S, I, O> s1Iter = s1;
ADTNode<S, I, O> s2Iter = s2;
while (s1Iter.getParent() != null) {
s1Parents... | java | public LCAInfo<S, I, O> findLCA(final ADTNode<S, I, O> s1, final ADTNode<S, I, O> s2) {
final Map<ADTNode<S, I, O>, ADTNode<S, I, O>> s1ParentsToS1 = new HashMap<>();
ADTNode<S, I, O> s1Iter = s1;
ADTNode<S, I, O> s2Iter = s2;
while (s1Iter.getParent() != null) {
s1Parents... | [
"public",
"LCAInfo",
"<",
"S",
",",
"I",
",",
"O",
">",
"findLCA",
"(",
"final",
"ADTNode",
"<",
"S",
",",
"I",
",",
"O",
">",
"s1",
",",
"final",
"ADTNode",
"<",
"S",
",",
"I",
",",
"O",
">",
"s2",
")",
"{",
"final",
"Map",
"<",
"ADTNode",
... | Return the lowest common ancestor for the given two nodes.
@param s1
first node
@param s2
second node
@return A {@link LCAInfo} containing the lowest common {@link ADTNode}, the output determining the subtree of the
first node and the output determining the subtree of the second node | [
"Return",
"the",
"lowest",
"common",
"ancestor",
"for",
"the",
"given",
"two",
"nodes",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/adt/ADT.java#L220-L252 | train |
LearnLib/learnlib | commons/util/src/main/java/de/learnlib/util/statistics/SimpleProfiler.java | SimpleProfiler.getResults | @Nonnull
public static String getResults() {
StringBuilder sb = new StringBuilder();
for (Entry<String, Counter> e : CUMULATED.entrySet()) {
sb.append(e.getValue().getSummary())
.append(", (")
.append(e.getValue().getCount() / MILLISECONDS_PER_SECOND)
... | java | @Nonnull
public static String getResults() {
StringBuilder sb = new StringBuilder();
for (Entry<String, Counter> e : CUMULATED.entrySet()) {
sb.append(e.getValue().getSummary())
.append(", (")
.append(e.getValue().getCount() / MILLISECONDS_PER_SECOND)
... | [
"@",
"Nonnull",
"public",
"static",
"String",
"getResults",
"(",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Entry",
"<",
"String",
",",
"Counter",
">",
"e",
":",
"CUMULATED",
".",
"entrySet",
"(",
")",
")"... | Get profiling results as string. | [
"Get",
"profiling",
"results",
"as",
"string",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/commons/util/src/main/java/de/learnlib/util/statistics/SimpleProfiler.java#L93-L104 | train |
LearnLib/learnlib | commons/util/src/main/java/de/learnlib/util/statistics/SimpleProfiler.java | SimpleProfiler.logResults | public static void logResults() {
for (Entry<String, Counter> e : CUMULATED.entrySet()) {
LOGGER.logProfilingInfo(e.getValue());
}
} | java | public static void logResults() {
for (Entry<String, Counter> e : CUMULATED.entrySet()) {
LOGGER.logProfilingInfo(e.getValue());
}
} | [
"public",
"static",
"void",
"logResults",
"(",
")",
"{",
"for",
"(",
"Entry",
"<",
"String",
",",
"Counter",
">",
"e",
":",
"CUMULATED",
".",
"entrySet",
"(",
")",
")",
"{",
"LOGGER",
".",
"logProfilingInfo",
"(",
"e",
".",
"getValue",
"(",
")",
")",... | Log results in category PROFILING. | [
"Log",
"results",
"in",
"category",
"PROFILING",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/commons/util/src/main/java/de/learnlib/util/statistics/SimpleProfiler.java#L109-L113 | train |
LearnLib/learnlib | oracles/filters/cache/src/main/java/de/learnlib/filter/cache/mealy/MealyCaches.java | MealyCaches.createDAGCache | public static <I, O> MealyCacheOracle<I, O> createDAGCache(Alphabet<I> alphabet,
MembershipOracle<I, Word<O>> mqOracle) {
return MealyCacheOracle.createDAGCacheOracle(alphabet, mqOracle);
} | java | public static <I, O> MealyCacheOracle<I, O> createDAGCache(Alphabet<I> alphabet,
MembershipOracle<I, Word<O>> mqOracle) {
return MealyCacheOracle.createDAGCacheOracle(alphabet, mqOracle);
} | [
"public",
"static",
"<",
"I",
",",
"O",
">",
"MealyCacheOracle",
"<",
"I",
",",
"O",
">",
"createDAGCache",
"(",
"Alphabet",
"<",
"I",
">",
"alphabet",
",",
"MembershipOracle",
"<",
"I",
",",
"Word",
"<",
"O",
">",
">",
"mqOracle",
")",
"{",
"return"... | Creates a cache oracle for a Mealy machine learning setup, using a DAG for internal cache organization.
@param alphabet
the input alphabet
@param mqOracle
the membership oracle
@return a Mealy learning cache with a DAG-based implementation | [
"Creates",
"a",
"cache",
"oracle",
"for",
"a",
"Mealy",
"machine",
"learning",
"setup",
"using",
"a",
"DAG",
"for",
"internal",
"cache",
"organization",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/oracles/filters/cache/src/main/java/de/learnlib/filter/cache/mealy/MealyCaches.java#L44-L47 | train |
LearnLib/learnlib | oracles/filters/cache/src/main/java/de/learnlib/filter/cache/mealy/MealyCaches.java | MealyCaches.createTreeCache | public static <I, O> MealyCacheOracle<I, O> createTreeCache(Alphabet<I> alphabet,
MembershipOracle<I, Word<O>> mqOracle) {
return MealyCacheOracle.createTreeCacheOracle(alphabet, mqOracle);
} | java | public static <I, O> MealyCacheOracle<I, O> createTreeCache(Alphabet<I> alphabet,
MembershipOracle<I, Word<O>> mqOracle) {
return MealyCacheOracle.createTreeCacheOracle(alphabet, mqOracle);
} | [
"public",
"static",
"<",
"I",
",",
"O",
">",
"MealyCacheOracle",
"<",
"I",
",",
"O",
">",
"createTreeCache",
"(",
"Alphabet",
"<",
"I",
">",
"alphabet",
",",
"MembershipOracle",
"<",
"I",
",",
"Word",
"<",
"O",
">",
">",
"mqOracle",
")",
"{",
"return... | Creates a cache oracle for a Mealy machine learning setup, using a tree for internal cache organization.
@param alphabet
the input alphabet
@param mqOracle
the membership oracle
@return a Mealy learning cache with a tree-based implementation | [
"Creates",
"a",
"cache",
"oracle",
"for",
"a",
"Mealy",
"machine",
"learning",
"setup",
"using",
"a",
"tree",
"for",
"internal",
"cache",
"organization",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/oracles/filters/cache/src/main/java/de/learnlib/filter/cache/mealy/MealyCaches.java#L77-L80 | train |
LearnLib/learnlib | oracles/filters/cache/src/main/java/de/learnlib/filter/cache/mealy/MealyCaches.java | MealyCaches.createStateLocalInputTreeCache | public static <I, O> MealyCacheOracle<I, OutputAndLocalInputs<I, O>> createStateLocalInputTreeCache(Collection<I> initialLocalInputs,
MembershipOracle<I, Word<OutputAndLocalInputs<I, O>>> mqOracle) {
return M... | java | public static <I, O> MealyCacheOracle<I, OutputAndLocalInputs<I, O>> createStateLocalInputTreeCache(Collection<I> initialLocalInputs,
MembershipOracle<I, Word<OutputAndLocalInputs<I, O>>> mqOracle) {
return M... | [
"public",
"static",
"<",
"I",
",",
"O",
">",
"MealyCacheOracle",
"<",
"I",
",",
"OutputAndLocalInputs",
"<",
"I",
",",
"O",
">",
">",
"createStateLocalInputTreeCache",
"(",
"Collection",
"<",
"I",
">",
"initialLocalInputs",
",",
"MembershipOracle",
"<",
"I",
... | Creates a cache oracle for a Mealy machine learning setup with observable state local inputs for every state of
the system under learning.
@param initialLocalInputs
a collection of input symbols that can be executed in the initial state of the system under learning
@param mqOracle
the membership oracle
@return a Meal... | [
"Creates",
"a",
"cache",
"oracle",
"for",
"a",
"Mealy",
"machine",
"learning",
"setup",
"with",
"observable",
"state",
"local",
"inputs",
"for",
"every",
"state",
"of",
"the",
"system",
"under",
"learning",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/oracles/filters/cache/src/main/java/de/learnlib/filter/cache/mealy/MealyCaches.java#L148-L151 | train |
LearnLib/learnlib | algorithms/active/nlstar/src/main/java/de/learnlib/algorithms/nlstar/NLStarLearner.java | NLStarLearner.asDFALearner | public DFALearner<I> asDFALearner() {
return new DFALearner<I>() {
@Override
public String toString() {
return NLStarLearner.this.toString();
}
@Override
public void startLearning() {
NLStarLearner.this.startLearning()... | java | public DFALearner<I> asDFALearner() {
return new DFALearner<I>() {
@Override
public String toString() {
return NLStarLearner.this.toString();
}
@Override
public void startLearning() {
NLStarLearner.this.startLearning()... | [
"public",
"DFALearner",
"<",
"I",
">",
"asDFALearner",
"(",
")",
"{",
"return",
"new",
"DFALearner",
"<",
"I",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"String",
"toString",
"(",
")",
"{",
"return",
"NLStarLearner",
".",
"this",
".",
"toString",
... | Retrieves a view of this learner as a DFA learner. The DFA is obtained by determinizing and minimizing the NFA
hypothesis.
@return a DFA learner view of this learner
@see #getDeterminizedHypothesis() | [
"Retrieves",
"a",
"view",
"of",
"this",
"learner",
"as",
"a",
"DFA",
"learner",
".",
"The",
"DFA",
"is",
"obtained",
"by",
"determinizing",
"and",
"minimizing",
"the",
"NFA",
"hypothesis",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/nlstar/src/main/java/de/learnlib/algorithms/nlstar/NLStarLearner.java#L83-L107 | train |
LearnLib/learnlib | algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/BlockList.java | BlockList.insertBlock | public void insertBlock(AbstractBaseDTNode<I, D> blockRoot) {
blockRoot.removeFromBlockList();
blockRoot.setNextElement(next);
if (getNextElement() != null) {
next.setPrevElement(blockRoot);
}
blockRoot.setPrevElement(this);
next = blockRoot;
} | java | public void insertBlock(AbstractBaseDTNode<I, D> blockRoot) {
blockRoot.removeFromBlockList();
blockRoot.setNextElement(next);
if (getNextElement() != null) {
next.setPrevElement(blockRoot);
}
blockRoot.setPrevElement(this);
next = blockRoot;
} | [
"public",
"void",
"insertBlock",
"(",
"AbstractBaseDTNode",
"<",
"I",
",",
"D",
">",
"blockRoot",
")",
"{",
"blockRoot",
".",
"removeFromBlockList",
"(",
")",
";",
"blockRoot",
".",
"setNextElement",
"(",
"next",
")",
";",
"if",
"(",
"getNextElement",
"(",
... | Inserts a block into the list. Currently, the block is inserted at the head of the list. However, callers should
not rely on this.
@param blockRoot
the root node of the block to be inserted | [
"Inserts",
"a",
"block",
"into",
"the",
"list",
".",
"Currently",
"the",
"block",
"is",
"inserted",
"at",
"the",
"head",
"of",
"the",
"list",
".",
"However",
"callers",
"should",
"not",
"rely",
"on",
"this",
"."
] | fa38a14adcc0664099f180d671ffa42480318d7b | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/BlockList.java#L38-L47 | train |
ulisesbocchio/spring-boot-security-saml | spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/bean/override/DSLSAMLAuthenticationProvider.java | DSLSAMLAuthenticationProvider.setSamlLogger | @Override
@Autowired(required = false)
public void setSamlLogger(SAMLLogger samlLogger) {
Assert.notNull(samlLogger, "SAMLLogger can't be null");
this.samlLogger = samlLogger;
} | java | @Override
@Autowired(required = false)
public void setSamlLogger(SAMLLogger samlLogger) {
Assert.notNull(samlLogger, "SAMLLogger can't be null");
this.samlLogger = samlLogger;
} | [
"@",
"Override",
"@",
"Autowired",
"(",
"required",
"=",
"false",
")",
"public",
"void",
"setSamlLogger",
"(",
"SAMLLogger",
"samlLogger",
")",
"{",
"Assert",
".",
"notNull",
"(",
"samlLogger",
",",
"\"SAMLLogger can't be null\"",
")",
";",
"this",
".",
"samlL... | Logger for SAML events, cannot be null, must be set.
@param samlLogger logger | [
"Logger",
"for",
"SAML",
"events",
"cannot",
"be",
"null",
"must",
"be",
"set",
"."
] | 63596fe9b4b5504053392b9ee9a925b9a77644d4 | https://github.com/ulisesbocchio/spring-boot-security-saml/blob/63596fe9b4b5504053392b9ee9a925b9a77644d4/spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/bean/override/DSLSAMLAuthenticationProvider.java#L22-L27 | train |
ulisesbocchio/spring-boot-security-saml | spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/bean/override/DSLSAMLAuthenticationProvider.java | DSLSAMLAuthenticationProvider.setConsumer | @Override
@Autowired(required = false)
@Qualifier("webSSOprofileConsumer")
public void setConsumer(WebSSOProfileConsumer consumer) {
Assert.notNull(consumer, "WebSSO Profile Consumer can't be null");
this.consumer = consumer;
} | java | @Override
@Autowired(required = false)
@Qualifier("webSSOprofileConsumer")
public void setConsumer(WebSSOProfileConsumer consumer) {
Assert.notNull(consumer, "WebSSO Profile Consumer can't be null");
this.consumer = consumer;
} | [
"@",
"Override",
"@",
"Autowired",
"(",
"required",
"=",
"false",
")",
"@",
"Qualifier",
"(",
"\"webSSOprofileConsumer\"",
")",
"public",
"void",
"setConsumer",
"(",
"WebSSOProfileConsumer",
"consumer",
")",
"{",
"Assert",
".",
"notNull",
"(",
"consumer",
",",
... | Profile for consumption of processed messages, must be set.
@param consumer consumer | [
"Profile",
"for",
"consumption",
"of",
"processed",
"messages",
"must",
"be",
"set",
"."
] | 63596fe9b4b5504053392b9ee9a925b9a77644d4 | https://github.com/ulisesbocchio/spring-boot-security-saml/blob/63596fe9b4b5504053392b9ee9a925b9a77644d4/spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/bean/override/DSLSAMLAuthenticationProvider.java#L34-L40 | train |
ulisesbocchio/spring-boot-security-saml | spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/bean/override/DSLSAMLAuthenticationProvider.java | DSLSAMLAuthenticationProvider.setHokConsumer | @Override
@Autowired(required = false)
@Qualifier("hokWebSSOprofileConsumer")
public void setHokConsumer(WebSSOProfileConsumer hokConsumer) {
this.hokConsumer = hokConsumer;
} | java | @Override
@Autowired(required = false)
@Qualifier("hokWebSSOprofileConsumer")
public void setHokConsumer(WebSSOProfileConsumer hokConsumer) {
this.hokConsumer = hokConsumer;
} | [
"@",
"Override",
"@",
"Autowired",
"(",
"required",
"=",
"false",
")",
"@",
"Qualifier",
"(",
"\"hokWebSSOprofileConsumer\"",
")",
"public",
"void",
"setHokConsumer",
"(",
"WebSSOProfileConsumer",
"hokConsumer",
")",
"{",
"this",
".",
"hokConsumer",
"=",
"hokConsu... | Profile for consumption of processed messages using the Holder-of-Key profile, must be set.
@param hokConsumer holder-of-key consumer | [
"Profile",
"for",
"consumption",
"of",
"processed",
"messages",
"using",
"the",
"Holder",
"-",
"of",
"-",
"Key",
"profile",
"must",
"be",
"set",
"."
] | 63596fe9b4b5504053392b9ee9a925b9a77644d4 | https://github.com/ulisesbocchio/spring-boot-security-saml/blob/63596fe9b4b5504053392b9ee9a925b9a77644d4/spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/bean/override/DSLSAMLAuthenticationProvider.java#L47-L52 | train |
ulisesbocchio/spring-boot-security-saml | spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/resource/KeystoreFactory.java | KeystoreFactory.loadKeystore | @SneakyThrows
public KeyStore loadKeystore(String certResourceLocation, String privateKeyResourceLocation, String alias, String keyPassword) {
KeyStore keystore = createEmptyKeystore();
X509Certificate cert = loadCert(certResourceLocation);
RSAPrivateKey privateKey = loadPrivateKey(privateKe... | java | @SneakyThrows
public KeyStore loadKeystore(String certResourceLocation, String privateKeyResourceLocation, String alias, String keyPassword) {
KeyStore keystore = createEmptyKeystore();
X509Certificate cert = loadCert(certResourceLocation);
RSAPrivateKey privateKey = loadPrivateKey(privateKe... | [
"@",
"SneakyThrows",
"public",
"KeyStore",
"loadKeystore",
"(",
"String",
"certResourceLocation",
",",
"String",
"privateKeyResourceLocation",
",",
"String",
"alias",
",",
"String",
"keyPassword",
")",
"{",
"KeyStore",
"keystore",
"=",
"createEmptyKeystore",
"(",
")",... | Based on a public certificate, private key, alias and password, this method will load the certificate and
private key as an entry into a newly created keystore, and it will set the provided alias and password to the
keystore entry.
@param certResourceLocation
@param privateKeyResourceLocation
@param alias
@param keyPa... | [
"Based",
"on",
"a",
"public",
"certificate",
"private",
"key",
"alias",
"and",
"password",
"this",
"method",
"will",
"load",
"the",
"certificate",
"and",
"private",
"key",
"as",
"an",
"entry",
"into",
"a",
"newly",
"created",
"keystore",
"and",
"it",
"will",... | 63596fe9b4b5504053392b9ee9a925b9a77644d4 | https://github.com/ulisesbocchio/spring-boot-security-saml/blob/63596fe9b4b5504053392b9ee9a925b9a77644d4/spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/resource/KeystoreFactory.java#L46-L53 | train |
ulisesbocchio/spring-boot-security-saml | spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/resource/KeystoreFactory.java | KeystoreFactory.addKeyToKeystore | @SneakyThrows
public void addKeyToKeystore(KeyStore keyStore, X509Certificate cert, RSAPrivateKey privateKey, String alias, String password) {
KeyStore.PasswordProtection pass = new KeyStore.PasswordProtection(password.toCharArray());
Certificate[] certificateChain = {cert};
keyStore.setEntr... | java | @SneakyThrows
public void addKeyToKeystore(KeyStore keyStore, X509Certificate cert, RSAPrivateKey privateKey, String alias, String password) {
KeyStore.PasswordProtection pass = new KeyStore.PasswordProtection(password.toCharArray());
Certificate[] certificateChain = {cert};
keyStore.setEntr... | [
"@",
"SneakyThrows",
"public",
"void",
"addKeyToKeystore",
"(",
"KeyStore",
"keyStore",
",",
"X509Certificate",
"cert",
",",
"RSAPrivateKey",
"privateKey",
",",
"String",
"alias",
",",
"String",
"password",
")",
"{",
"KeyStore",
".",
"PasswordProtection",
"pass",
... | Based on a public certificate, private key, alias and password, this method will load the certificate and
private key as an entry into the keystore, and it will set the provided alias and password to the keystore entry.
@param keyStore
@param cert
@param privateKey
@param alias
@param password | [
"Based",
"on",
"a",
"public",
"certificate",
"private",
"key",
"alias",
"and",
"password",
"this",
"method",
"will",
"load",
"the",
"certificate",
"and",
"private",
"key",
"as",
"an",
"entry",
"into",
"the",
"keystore",
"and",
"it",
"will",
"set",
"the",
"... | 63596fe9b4b5504053392b9ee9a925b9a77644d4 | https://github.com/ulisesbocchio/spring-boot-security-saml/blob/63596fe9b4b5504053392b9ee9a925b9a77644d4/spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/resource/KeystoreFactory.java#L65-L70 | train |
ulisesbocchio/spring-boot-security-saml | spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/resource/KeystoreFactory.java | KeystoreFactory.createEmptyKeystore | @SneakyThrows
public KeyStore createEmptyKeystore() {
KeyStore keyStore = KeyStore.getInstance("JKS");
keyStore.load(null, "".toCharArray());
return keyStore;
} | java | @SneakyThrows
public KeyStore createEmptyKeystore() {
KeyStore keyStore = KeyStore.getInstance("JKS");
keyStore.load(null, "".toCharArray());
return keyStore;
} | [
"@",
"SneakyThrows",
"public",
"KeyStore",
"createEmptyKeystore",
"(",
")",
"{",
"KeyStore",
"keyStore",
"=",
"KeyStore",
".",
"getInstance",
"(",
"\"JKS\"",
")",
";",
"keyStore",
".",
"load",
"(",
"null",
",",
"\"\"",
".",
"toCharArray",
"(",
")",
")",
";... | Returns an empty KeyStore object.
@return | [
"Returns",
"an",
"empty",
"KeyStore",
"object",
"."
] | 63596fe9b4b5504053392b9ee9a925b9a77644d4 | https://github.com/ulisesbocchio/spring-boot-security-saml/blob/63596fe9b4b5504053392b9ee9a925b9a77644d4/spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/resource/KeystoreFactory.java#L77-L82 | train |
ulisesbocchio/spring-boot-security-saml | spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/resource/KeystoreFactory.java | KeystoreFactory.loadCert | @SneakyThrows
public X509Certificate loadCert(String certLocation) {
CertificateFactory cf = CertificateFactory.getInstance("X509");
Resource certRes = resourceLoader.getResource(certLocation);
X509Certificate cert = (X509Certificate) cf.generateCertificate(certRes.getInputStream());
... | java | @SneakyThrows
public X509Certificate loadCert(String certLocation) {
CertificateFactory cf = CertificateFactory.getInstance("X509");
Resource certRes = resourceLoader.getResource(certLocation);
X509Certificate cert = (X509Certificate) cf.generateCertificate(certRes.getInputStream());
... | [
"@",
"SneakyThrows",
"public",
"X509Certificate",
"loadCert",
"(",
"String",
"certLocation",
")",
"{",
"CertificateFactory",
"cf",
"=",
"CertificateFactory",
".",
"getInstance",
"(",
"\"X509\"",
")",
";",
"Resource",
"certRes",
"=",
"resourceLoader",
".",
"getResour... | Given a resource location it loads a PEM X509 certificate.
@param certLocation
@return | [
"Given",
"a",
"resource",
"location",
"it",
"loads",
"a",
"PEM",
"X509",
"certificate",
"."
] | 63596fe9b4b5504053392b9ee9a925b9a77644d4 | https://github.com/ulisesbocchio/spring-boot-security-saml/blob/63596fe9b4b5504053392b9ee9a925b9a77644d4/spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/resource/KeystoreFactory.java#L90-L96 | train |
ulisesbocchio/spring-boot-security-saml | spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/resource/KeystoreFactory.java | KeystoreFactory.loadPrivateKey | @SneakyThrows
public RSAPrivateKey loadPrivateKey(String privateKeyLocation) {
Resource keyRes = resourceLoader.getResource(privateKeyLocation);
byte[] keyBytes = StreamUtils.copyToByteArray(keyRes.getInputStream());
PKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(keyBytes);
... | java | @SneakyThrows
public RSAPrivateKey loadPrivateKey(String privateKeyLocation) {
Resource keyRes = resourceLoader.getResource(privateKeyLocation);
byte[] keyBytes = StreamUtils.copyToByteArray(keyRes.getInputStream());
PKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(keyBytes);
... | [
"@",
"SneakyThrows",
"public",
"RSAPrivateKey",
"loadPrivateKey",
"(",
"String",
"privateKeyLocation",
")",
"{",
"Resource",
"keyRes",
"=",
"resourceLoader",
".",
"getResource",
"(",
"privateKeyLocation",
")",
";",
"byte",
"[",
"]",
"keyBytes",
"=",
"StreamUtils",
... | Given a resource location it loads a DER RSA private Key.
@param privateKeyLocation
@return | [
"Given",
"a",
"resource",
"location",
"it",
"loads",
"a",
"DER",
"RSA",
"private",
"Key",
"."
] | 63596fe9b4b5504053392b9ee9a925b9a77644d4 | https://github.com/ulisesbocchio/spring-boot-security-saml/blob/63596fe9b4b5504053392b9ee9a925b9a77644d4/spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/resource/KeystoreFactory.java#L104-L112 | train |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/swift/ConfigurationHandler.java | ConfigurationHandler.initialize | public static Properties initialize(URI uri, Configuration conf) throws IOException,
ConfigurationParseException {
String host = Utils.getHost(uri);
Properties props = new Properties();
if (!Utils.validSchema(uri)) {
props.setProperty(SWIFT_AUTH_METHOD_PROPERTY, PUBLIC_ACCESS);
} else {
... | java | public static Properties initialize(URI uri, Configuration conf) throws IOException,
ConfigurationParseException {
String host = Utils.getHost(uri);
Properties props = new Properties();
if (!Utils.validSchema(uri)) {
props.setProperty(SWIFT_AUTH_METHOD_PROPERTY, PUBLIC_ACCESS);
} else {
... | [
"public",
"static",
"Properties",
"initialize",
"(",
"URI",
"uri",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
",",
"ConfigurationParseException",
"{",
"String",
"host",
"=",
"Utils",
".",
"getHost",
"(",
"uri",
")",
";",
"Properties",
"props",
... | Parse configuration properties from the core-site.xml and initialize
Swift configuration
@param uri uri of the file system
@param conf configuration
@return parsed configuration for the Swift driver
@throws ConfigurationParseException is failed to parse configuration | [
"Parse",
"configuration",
"properties",
"from",
"the",
"core",
"-",
"site",
".",
"xml",
"and",
"initialize",
"Swift",
"configuration"
] | 35969cadd2e8faa6fdac45e8bec1799fdd3d8299 | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/swift/ConfigurationHandler.java#L72-L114 | train |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/swift/SwiftObjectCache.java | SwiftObjectCache.get | public SwiftCachedObject get(final String objName) throws IOException {
LOG.trace("Get from cache: {}", objName);
SwiftCachedObject res = cache.get(objName);
if (res == null) {
LOG.trace("Cache get: {} is not in the cache. Access Swift to get content length", objName);
StoredObject rawObj = cont... | java | public SwiftCachedObject get(final String objName) throws IOException {
LOG.trace("Get from cache: {}", objName);
SwiftCachedObject res = cache.get(objName);
if (res == null) {
LOG.trace("Cache get: {} is not in the cache. Access Swift to get content length", objName);
StoredObject rawObj = cont... | [
"public",
"SwiftCachedObject",
"get",
"(",
"final",
"String",
"objName",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"trace",
"(",
"\"Get from cache: {}\"",
",",
"objName",
")",
";",
"SwiftCachedObject",
"res",
"=",
"cache",
".",
"get",
"(",
"objName",
")",... | The get function will first search for the object in the cache.
If not found will issue a HEAD request for the object metadata
and add the object to the cache.
@param objName object name
@return cached entry of the object
@throws IOException if failed to parse time stamp | [
"The",
"get",
"function",
"will",
"first",
"search",
"for",
"the",
"object",
"in",
"the",
"cache",
".",
"If",
"not",
"found",
"will",
"issue",
"a",
"HEAD",
"request",
"for",
"the",
"object",
"metadata",
"and",
"add",
"the",
"object",
"to",
"the",
"cache"... | 35969cadd2e8faa6fdac45e8bec1799fdd3d8299 | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/swift/SwiftObjectCache.java#L57-L72 | train |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/common/StocatorPath.java | StocatorPath.isTemporaryPath | public boolean isTemporaryPath(String path) {
for (String tempPath : tempIdentifiers) {
String[] tempPathComponents = tempPath.split("/");
if (tempPathComponents.length > 0
&& path != null && path.contains(tempPathComponents[0].replace("ID", ""))) {
return true;
}
}
retur... | java | public boolean isTemporaryPath(String path) {
for (String tempPath : tempIdentifiers) {
String[] tempPathComponents = tempPath.split("/");
if (tempPathComponents.length > 0
&& path != null && path.contains(tempPathComponents[0].replace("ID", ""))) {
return true;
}
}
retur... | [
"public",
"boolean",
"isTemporaryPath",
"(",
"String",
"path",
")",
"{",
"for",
"(",
"String",
"tempPath",
":",
"tempIdentifiers",
")",
"{",
"String",
"[",
"]",
"tempPathComponents",
"=",
"tempPath",
".",
"split",
"(",
"\"/\"",
")",
";",
"if",
"(",
"tempPa... | Inspect the path and return true if path contains reserved "_temporary" or
the first entry from "fs.stocator.temp.identifier" if provided
@param path to inspect
@return true if path contains temporary identifier | [
"Inspect",
"the",
"path",
"and",
"return",
"true",
"if",
"path",
"contains",
"reserved",
"_temporary",
"or",
"the",
"first",
"entry",
"from",
"fs",
".",
"stocator",
".",
"temp",
".",
"identifier",
"if",
"provided"
] | 35969cadd2e8faa6fdac45e8bec1799fdd3d8299 | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/common/StocatorPath.java#L87-L96 | train |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/common/StocatorPath.java | StocatorPath.modifyPathToFinalDestination | public Path modifyPathToFinalDestination(Path path) throws IOException {
String res;
if (tempFileOriginator.equals(DEFAULT_FOUTPUTCOMMITTER_V1)) {
res = parseHadoopOutputCommitter(path, true, hostNameScheme);
} else {
res = extractNameFromTempPath(path, true, hostNameScheme);
}
return ne... | java | public Path modifyPathToFinalDestination(Path path) throws IOException {
String res;
if (tempFileOriginator.equals(DEFAULT_FOUTPUTCOMMITTER_V1)) {
res = parseHadoopOutputCommitter(path, true, hostNameScheme);
} else {
res = extractNameFromTempPath(path, true, hostNameScheme);
}
return ne... | [
"public",
"Path",
"modifyPathToFinalDestination",
"(",
"Path",
"path",
")",
"throws",
"IOException",
"{",
"String",
"res",
";",
"if",
"(",
"tempFileOriginator",
".",
"equals",
"(",
"DEFAULT_FOUTPUTCOMMITTER_V1",
")",
")",
"{",
"res",
"=",
"parseHadoopOutputCommitter... | Accept temporary path and return a final destination path
@param path path name to modify
@return modified path name
@throws IOException if error | [
"Accept",
"temporary",
"path",
"and",
"return",
"a",
"final",
"destination",
"path"
] | 35969cadd2e8faa6fdac45e8bec1799fdd3d8299 | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/common/StocatorPath.java#L188-L197 | train |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/common/StocatorPath.java | StocatorPath.parseHadoopOutputCommitter | private String parseHadoopOutputCommitter(Path fullPath,
boolean addTaskIdCompositeName, String hostNameScheme) throws IOException {
String path = fullPath.toString();
String noPrefix = path;
if (path.startsWith(hostNameScheme)) {
noPrefix = path.substring(hostNameScheme.length());
}
int... | java | private String parseHadoopOutputCommitter(Path fullPath,
boolean addTaskIdCompositeName, String hostNameScheme) throws IOException {
String path = fullPath.toString();
String noPrefix = path;
if (path.startsWith(hostNameScheme)) {
noPrefix = path.substring(hostNameScheme.length());
}
int... | [
"private",
"String",
"parseHadoopOutputCommitter",
"(",
"Path",
"fullPath",
",",
"boolean",
"addTaskIdCompositeName",
",",
"String",
"hostNameScheme",
")",
"throws",
"IOException",
"{",
"String",
"path",
"=",
"fullPath",
".",
"toString",
"(",
")",
";",
"String",
"... | Main method to parse Hadoop OutputCommitter V1 or V2 as used by Hadoop M-R or Apache Spark
Method transforms object name from the temporary path.
The input of the form
schema://mydata.service/a/b/c/data.parquet/_temporary/0/_temporary/
attempt_201610052038_0001_m_000007_15/part-00001
If addTaskIdCompositeName=true t... | [
"Main",
"method",
"to",
"parse",
"Hadoop",
"OutputCommitter",
"V1",
"or",
"V2",
"as",
"used",
"by",
"Hadoop",
"M",
"-",
"R",
"or",
"Apache",
"Spark",
"Method",
"transforms",
"object",
"name",
"from",
"the",
"temporary",
"path",
"."
] | 35969cadd2e8faa6fdac45e8bec1799fdd3d8299 | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/common/StocatorPath.java#L272-L319 | train |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/common/StocatorPath.java | StocatorPath.extractExtension | private String extractExtension(String filename) {
int startExtension = filename.indexOf('.');
if (startExtension > 0) {
return filename.substring(startExtension + 1);
}
return "";
} | java | private String extractExtension(String filename) {
int startExtension = filename.indexOf('.');
if (startExtension > 0) {
return filename.substring(startExtension + 1);
}
return "";
} | [
"private",
"String",
"extractExtension",
"(",
"String",
"filename",
")",
"{",
"int",
"startExtension",
"=",
"filename",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"startExtension",
">",
"0",
")",
"{",
"return",
"filename",
".",
"substring",
"(",
... | A filename, for example, one3-attempt-01.txt.gz will return txt.gz
@param filename The path of filename to extract the extension from
@return The extension of the filename | [
"A",
"filename",
"for",
"example",
"one3",
"-",
"attempt",
"-",
"01",
".",
"txt",
".",
"gz",
"will",
"return",
"txt",
".",
"gz"
] | 35969cadd2e8faa6fdac45e8bec1799fdd3d8299 | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/common/StocatorPath.java#L327-L333 | train |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java | COSAPIClient.getObjectMetadata | protected ObjectMetadata getObjectMetadata(String key) {
try {
ObjectMetadata meta = mClient.getObjectMetadata(mBucket, key);
return meta;
} catch (AmazonClientException e) {
LOG.debug(e.getMessage());
return null;
}
} | java | protected ObjectMetadata getObjectMetadata(String key) {
try {
ObjectMetadata meta = mClient.getObjectMetadata(mBucket, key);
return meta;
} catch (AmazonClientException e) {
LOG.debug(e.getMessage());
return null;
}
} | [
"protected",
"ObjectMetadata",
"getObjectMetadata",
"(",
"String",
"key",
")",
"{",
"try",
"{",
"ObjectMetadata",
"meta",
"=",
"mClient",
".",
"getObjectMetadata",
"(",
"mBucket",
",",
"key",
")",
";",
"return",
"meta",
";",
"}",
"catch",
"(",
"AmazonClientExc... | Request object metadata, Used to call _SUCCESS object or identify if objects
were generated by Stocator
@param key key
@return the metadata | [
"Request",
"object",
"metadata",
"Used",
"to",
"call",
"_SUCCESS",
"object",
"or",
"identify",
"if",
"objects",
"were",
"generated",
"by",
"Stocator"
] | 35969cadd2e8faa6fdac45e8bec1799fdd3d8299 | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java#L468-L476 | train |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java | COSAPIClient.newPutObjectRequest | public PutObjectRequest newPutObjectRequest(String key,
ObjectMetadata metadata, File srcfile) {
PutObjectRequest putObjectRequest = new PutObjectRequest(mBucket, key,
srcfile);
putObjectRequest.setMetadata(metadata);
return putObjectRequest;
} | java | public PutObjectRequest newPutObjectRequest(String key,
ObjectMetadata metadata, File srcfile) {
PutObjectRequest putObjectRequest = new PutObjectRequest(mBucket, key,
srcfile);
putObjectRequest.setMetadata(metadata);
return putObjectRequest;
} | [
"public",
"PutObjectRequest",
"newPutObjectRequest",
"(",
"String",
"key",
",",
"ObjectMetadata",
"metadata",
",",
"File",
"srcfile",
")",
"{",
"PutObjectRequest",
"putObjectRequest",
"=",
"new",
"PutObjectRequest",
"(",
"mBucket",
",",
"key",
",",
"srcfile",
")",
... | Create a putObject request.
Adds the ACL and metadata
@param key key of object
@param metadata metadata header
@param srcfile source file
@return the request | [
"Create",
"a",
"putObject",
"request",
".",
"Adds",
"the",
"ACL",
"and",
"metadata"
] | 35969cadd2e8faa6fdac45e8bec1799fdd3d8299 | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java#L771-L777 | train |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java | COSAPIClient.initConnectionSettings | private void initConnectionSettings(Configuration conf,
ClientConfiguration clientConf) throws IOException {
clientConf.setMaxConnections(Utils.getInt(conf, FS_COS, FS_ALT_KEYS,
MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS));
clientConf.setClientExecutionTimeout(Utils.getInt(conf, FS_COS, FS_A... | java | private void initConnectionSettings(Configuration conf,
ClientConfiguration clientConf) throws IOException {
clientConf.setMaxConnections(Utils.getInt(conf, FS_COS, FS_ALT_KEYS,
MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS));
clientConf.setClientExecutionTimeout(Utils.getInt(conf, FS_COS, FS_A... | [
"private",
"void",
"initConnectionSettings",
"(",
"Configuration",
"conf",
",",
"ClientConfiguration",
"clientConf",
")",
"throws",
"IOException",
"{",
"clientConf",
".",
"setMaxConnections",
"(",
"Utils",
".",
"getInt",
"(",
"conf",
",",
"FS_COS",
",",
"FS_ALT_KEYS... | Initializes connection management
@param conf Hadoop configuration
@param clientConf client SDK configuration | [
"Initializes",
"connection",
"management"
] | 35969cadd2e8faa6fdac45e8bec1799fdd3d8299 | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java#L1153-L1186 | train |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java | COSAPIClient.correctPlusSign | private String correctPlusSign(String origin, String stringToCorrect) {
if (origin.contains("+")) {
LOG.debug("Adapt plus sign in {} to avoid SDK bug on {}", origin, stringToCorrect);
StringBuilder tmpStringToCorrect = new StringBuilder(stringToCorrect);
boolean hasSign = true;
int fromIndex... | java | private String correctPlusSign(String origin, String stringToCorrect) {
if (origin.contains("+")) {
LOG.debug("Adapt plus sign in {} to avoid SDK bug on {}", origin, stringToCorrect);
StringBuilder tmpStringToCorrect = new StringBuilder(stringToCorrect);
boolean hasSign = true;
int fromIndex... | [
"private",
"String",
"correctPlusSign",
"(",
"String",
"origin",
",",
"String",
"stringToCorrect",
")",
"{",
"if",
"(",
"origin",
".",
"contains",
"(",
"\"+\"",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Adapt plus sign in {} to avoid SDK bug on {}\"",
",",
"or... | Due to SDK bug, list operations may return strings that has spaces instead of +
This method will try to fix names for known patterns
@param origin original string that may contain
@param stringToCorrect string that may contain original string with spaces instead of +
@return corrected string | [
"Due",
"to",
"SDK",
"bug",
"list",
"operations",
"may",
"return",
"strings",
"that",
"has",
"spaces",
"instead",
"of",
"+",
"This",
"method",
"will",
"try",
"to",
"fix",
"names",
"for",
"known",
"patterns"
] | 35969cadd2e8faa6fdac45e8bec1799fdd3d8299 | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java#L1567-L1593 | train |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java | COSAPIClient.copyFile | private void copyFile(String srcKey, String dstKey, long size)
throws IOException, InterruptedIOException, AmazonClientException {
LOG.debug("copyFile {} -> {} ", srcKey, dstKey);
CopyObjectRequest copyObjectRequest =
new CopyObjectRequest(mBucket, srcKey, mBucket, dstKey);
try {
ObjectM... | java | private void copyFile(String srcKey, String dstKey, long size)
throws IOException, InterruptedIOException, AmazonClientException {
LOG.debug("copyFile {} -> {} ", srcKey, dstKey);
CopyObjectRequest copyObjectRequest =
new CopyObjectRequest(mBucket, srcKey, mBucket, dstKey);
try {
ObjectM... | [
"private",
"void",
"copyFile",
"(",
"String",
"srcKey",
",",
"String",
"dstKey",
",",
"long",
"size",
")",
"throws",
"IOException",
",",
"InterruptedIOException",
",",
"AmazonClientException",
"{",
"LOG",
".",
"debug",
"(",
"\"copyFile {} -> {} \"",
",",
"srcKey",... | Copy a single object in the bucket via a COPY operation.
@param srcKey source object path
@param dstKey destination object path
@param size object size
@throws AmazonClientException on failures inside the AWS SDK
@throws InterruptedIOException the operation was interrupted
@throws IOException Other IO problems | [
"Copy",
"a",
"single",
"object",
"in",
"the",
"bucket",
"via",
"a",
"COPY",
"operation",
"."
] | 35969cadd2e8faa6fdac45e8bec1799fdd3d8299 | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java#L1604-L1637 | train |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/cos/COSDataBlocks.java | COSDataBlocks.createFactory | static BlockFactory createFactory(COSAPIClient owner,
String name) {
switch (name) {
case COSConstants.FAST_UPLOAD_BUFFER_ARRAY:
return new ArrayBlockFactory(owner);
case COSConstants.FAST_UPLOAD_BUFFER_DISK:
return new DiskBlockFactory(owner);
default:
throw new Ille... | java | static BlockFactory createFactory(COSAPIClient owner,
String name) {
switch (name) {
case COSConstants.FAST_UPLOAD_BUFFER_ARRAY:
return new ArrayBlockFactory(owner);
case COSConstants.FAST_UPLOAD_BUFFER_DISK:
return new DiskBlockFactory(owner);
default:
throw new Ille... | [
"static",
"BlockFactory",
"createFactory",
"(",
"COSAPIClient",
"owner",
",",
"String",
"name",
")",
"{",
"switch",
"(",
"name",
")",
"{",
"case",
"COSConstants",
".",
"FAST_UPLOAD_BUFFER_ARRAY",
":",
"return",
"new",
"ArrayBlockFactory",
"(",
"owner",
")",
";",... | Create a factory.
@param owner factory owner
@param name factory name -the option from {@link Constants}
@return the factory, ready to be initialized
@throws IllegalArgumentException if the name is unknown | [
"Create",
"a",
"factory",
"."
] | 35969cadd2e8faa6fdac45e8bec1799fdd3d8299 | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/cos/COSDataBlocks.java#L77-L88 | train |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/swift/SwiftInputStream.java | SwiftInputStream.reopen | private synchronized void reopen(String msg, long targetPos, long length) throws IOException {
if (wrappedStream != null) {
closeStream("reopen(" + msg + ")", contentRangeFinish);
}
contentRangeStart = targetPos;
contentRangeFinish = targetPos + Math.max(readahead, length) + threasholdRead;
if... | java | private synchronized void reopen(String msg, long targetPos, long length) throws IOException {
if (wrappedStream != null) {
closeStream("reopen(" + msg + ")", contentRangeFinish);
}
contentRangeStart = targetPos;
contentRangeFinish = targetPos + Math.max(readahead, length) + threasholdRead;
if... | [
"private",
"synchronized",
"void",
"reopen",
"(",
"String",
"msg",
",",
"long",
"targetPos",
",",
"long",
"length",
")",
"throws",
"IOException",
"{",
"if",
"(",
"wrappedStream",
"!=",
"null",
")",
"{",
"closeStream",
"(",
"\"reopen(\"",
"+",
"msg",
"+",
"... | Reopen stream if closed
@param msg Details of reopen stream
@param targetPos target position
@param length length
@throws IOException if error | [
"Reopen",
"stream",
"if",
"closed"
] | 35969cadd2e8faa6fdac45e8bec1799fdd3d8299 | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/swift/SwiftInputStream.java#L128-L153 | train |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/swift/SwiftInputStream.java | SwiftInputStream.closeStream | private void closeStream(String msg, long length) {
if (wrappedStream != null) {
long remaining = remainingInCurrentRequest();
boolean shouldAbort = remaining > readahead;
if (!shouldAbort) {
try {
wrappedStream.close();
} catch (IOException e) {
LOG.debug("When... | java | private void closeStream(String msg, long length) {
if (wrappedStream != null) {
long remaining = remainingInCurrentRequest();
boolean shouldAbort = remaining > readahead;
if (!shouldAbort) {
try {
wrappedStream.close();
} catch (IOException e) {
LOG.debug("When... | [
"private",
"void",
"closeStream",
"(",
"String",
"msg",
",",
"long",
"length",
")",
"{",
"if",
"(",
"wrappedStream",
"!=",
"null",
")",
"{",
"long",
"remaining",
"=",
"remainingInCurrentRequest",
"(",
")",
";",
"boolean",
"shouldAbort",
"=",
"remaining",
">"... | close the stream
@param msg close message
@param length length | [
"close",
"the",
"stream"
] | 35969cadd2e8faa6fdac45e8bec1799fdd3d8299 | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/swift/SwiftInputStream.java#L332-L352 | train |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/swift/SwiftInputStream.java | SwiftInputStream.remainingInFile | @InterfaceAudience.Private
@InterfaceStability.Unstable
public synchronized long remainingInFile() throws IOException {
return objectCache.get(objName).getContentLength() - pos;
} | java | @InterfaceAudience.Private
@InterfaceStability.Unstable
public synchronized long remainingInFile() throws IOException {
return objectCache.get(objName).getContentLength() - pos;
} | [
"@",
"InterfaceAudience",
".",
"Private",
"@",
"InterfaceStability",
".",
"Unstable",
"public",
"synchronized",
"long",
"remainingInFile",
"(",
")",
"throws",
"IOException",
"{",
"return",
"objectCache",
".",
"get",
"(",
"objName",
")",
".",
"getContentLength",
"(... | Bytes left in stream.
@return how many bytes are left to read
@throws IOException if error | [
"Bytes",
"left",
"in",
"stream",
"."
] | 35969cadd2e8faa6fdac45e8bec1799fdd3d8299 | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/swift/SwiftInputStream.java#L371-L375 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.