id stringlengths 34 124 | type stringclasses 4
values | prompt stringlengths 0 4.95k | response stringlengths 21 4.89k | source_lang stringclasses 3
values | target_lang stringclasses 2
values | repo stringclasses 75
values | path stringlengths 10 88 | license stringclasses 1
value | commit stringlengths 40 40 | stars int64 431 18.7k | source_url stringlengths 86 176 | line_start int64 1 214 | line_end int64 3 253 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dropbox/zxcvbn:init.coffee:1:completion | completion | Init = do ->
# on qwerty, 'g' has degree 6, being adjacent to 'ftyhbv'. '\' has degree 1.
# this calculates the average over all keys.
# TODO move this outside of init code.
calc_average_degree = (graph) ->
average = 0
for key, neighbors of graph
average += (n for n in neighbors when n).length
... | result = Scoring.minimum_entropy_match_sequence password, matches
result.calc_time = time() - start
result
dictionary_matchers = [
Matching.build_dict_matcher('passwords', Matching.build_ranked_dict(FrequencyLists.passwords)),
Matching.build_dict_matcher('english', Matching.build_ranked_dic... | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 5a7f58cd246323ef6aac0c41803fa8f98142b953 | 15,961 | https://github.com/dropbox/zxcvbn/blob/5a7f58cd246323ef6aac0c41803fa8f98142b953/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:2:raw_corpus | raw_corpus | else
# Add browser global
root.zxcvbn = factory()
root.zxcvbn_load_hook?() # DEPRICATED run load hook from user, if defined. TODO remove
# do module export
umd this, -> zxcvbn
# ------------------------------------------------------------------------------
# return value: graphs and matchers -... | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 5a7f58cd246323ef6aac0c41803fa8f98142b953 | 15,961 | https://github.com/dropbox/zxcvbn/blob/5a7f58cd246323ef6aac0c41803fa8f98142b953/init.coffee | 51 | 85 | ||
dropbox/zxcvbn:init.coffee:2:completion | completion | else
# Add browser global
root.zxcvbn = factory()
root.zxcvbn_load_hook?() # DEPRICATED run load hook from user, if defined. TODO remove
# do module export
umd this, -> zxcvbn
# ------------------------------------------------------------------------------
# return value: graphs and matchers -... | Matching.year_match,
Matching.date_match,
Matching.repeat_match,
Matching.sequence_match,
Matching.spatial_match
]
GRAPHS:
'qwerty': AdjacencyGraphs.qwerty
'dvorak': AdjacencyGraphs.dvorak
'keypad': AdjacencyGraphs.keypad
'mac_keypad': AdjacencyGraphs.mac_keypad
KEYBO... | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 5a7f58cd246323ef6aac0c41803fa8f98142b953 | 15,961 | https://github.com/dropbox/zxcvbn/blob/5a7f58cd246323ef6aac0c41803fa8f98142b953/init.coffee | 51 | 85 |
dropbox/zxcvbn:init.coffee:1:raw_corpus | raw_corpus | # initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_name... | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 758e9f190e6cef84b90412834682fa2fb2395081 | 15,961 | https://github.com/dropbox/zxcvbn/blob/758e9f190e6cef84b90412834682fa2fb2395081/init.coffee | 1 | 50 | ||
dropbox/zxcvbn:init.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_d... | // initialize matcher lists
var DICTIONARY_MATCHERS, GRAPHS, KEYBOARD_AVERAGE_DEGREE, KEYBOARD_STARTING_POSITIONS, KEYPAD_AVERAGE_DEGREE, KEYPAD_STARTING_POSITIONS, MATCHERS, calc_average_degree, k, time, v, zxcvbn;
DICTIONARY_MATCHERS = [build_dict_matcher('passwords', build_ranked_dict(passwords)), build_dict_matche... | CoffeeScript | JavaScript | dropbox/zxcvbn | init.coffee | MIT | 758e9f190e6cef84b90412834682fa2fb2395081 | 15,961 | https://github.com/dropbox/zxcvbn/blob/758e9f190e6cef84b90412834682fa2fb2395081/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// initialize matcher lists
var DICTIONARY_MATCHERS, GRAPHS, KEYBOARD_AVERAGE_DEGREE, KEYBOARD_STARTING_POSITIONS, KEYPAD_AVERAGE_DEGREE, KEYPAD_STARTING_POSITIONS, MATCHERS, calc_average_degree, k, time, v, zxcvbn;
DICTIONARY_MATCHERS = [build_dict_matcher('passw... | # initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_name... | JavaScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 758e9f190e6cef84b90412834682fa2fb2395081 | 15,961 | https://github.com/dropbox/zxcvbn/blob/758e9f190e6cef84b90412834682fa2fb2395081/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:1:completion | completion | # initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_name... | calc_average_degree = (graph) ->
average = 0
for key, neighbors of graph
average += (n for n in neighbors when n).length
average /= (k for k,v of graph).length
average
KEYBOARD_AVERAGE_DEGREE = calc_average_degree(qwerty)
KEYPAD_AVERAGE_DEGREE = calc_average_degree(keypad) # slightly different fo... | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 758e9f190e6cef84b90412834682fa2fb2395081 | 15,961 | https://github.com/dropbox/zxcvbn/blob/758e9f190e6cef84b90412834682fa2fb2395081/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:2:raw_corpus | raw_corpus | matches = omnimatch password, MATCHERS.concat(user_inputs_matcher)
result = minimum_entropy_match_sequence password, matches
result.calc_time = time() - start
result
# universal module definition based on:
# https://github.com/umdjs/umd/blob/master/returnExports.js
loader = (root, factory) ->
if typeof define... | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 758e9f190e6cef84b90412834682fa2fb2395081 | 15,961 | https://github.com/dropbox/zxcvbn/blob/758e9f190e6cef84b90412834682fa2fb2395081/init.coffee | 51 | 71 | ||
dropbox/zxcvbn:init.coffee:2:completion | completion | matches = omnimatch password, MATCHERS.concat(user_inputs_matcher)
result = minimum_entropy_match_sequence password, matches
result.calc_time = time() - start
result
# universal module definition based on:
# https://github.com/umdjs/umd/blob/master/returnExports.js
loader = (root, factory) ->
if typeof define... | # AMD. Register as an anonymous module
define [], factory
else if typeof module == 'object' and module.exports?
# works with CommonJS environments that support module.exports, like node
module.exports = factory()
else
# Add browser global
root.zxcvbn = factory()
root.zxcvbn_load_hook?() # run ... | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 758e9f190e6cef84b90412834682fa2fb2395081 | 15,961 | https://github.com/dropbox/zxcvbn/blob/758e9f190e6cef84b90412834682fa2fb2395081/init.coffee | 51 | 71 |
dropbox/zxcvbn:init.coffee:2:raw_corpus | raw_corpus | matches = omnimatch password, MATCHERS.concat(user_inputs_matcher)
result = minimum_entropy_match_sequence password, matches
result.calc_time = time() - start
result
# universal module definition based on:
# https://github.com/umdjs/umd/blob/master/commonjsStrict.js
loader = (root, factory) ->
if typeof defin... | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 4190f164e5fc3b1fc28cba1017e23506f95db771 | 15,961 | https://github.com/dropbox/zxcvbn/blob/4190f164e5fc3b1fc28cba1017e23506f95db771/init.coffee | 51 | 72 | ||
dropbox/zxcvbn:init.coffee:2:completion | completion | matches = omnimatch password, MATCHERS.concat(user_inputs_matcher)
result = minimum_entropy_match_sequence password, matches
result.calc_time = time() - start
result
# universal module definition based on:
# https://github.com/umdjs/umd/blob/master/commonjsStrict.js
loader = (root, factory) ->
if typeof defin... | define ['exports'], factory
else if typeof exports == 'object'
# CommonJS (including node support)
factory exports
else
# Add browser global
root.zxcvbn = zxcvbn
root.zxcvbn_load_hook?() # run load hook from user, if defined
loader this, (exports) ->
exports.zxcvbn = zxcvbn | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 4190f164e5fc3b1fc28cba1017e23506f95db771 | 15,961 | https://github.com/dropbox/zxcvbn/blob/4190f164e5fc3b1fc28cba1017e23506f95db771/init.coffee | 51 | 72 |
dropbox/zxcvbn:init.coffee:2:raw_corpus | raw_corpus | matches = omnimatch password, MATCHERS.concat(user_inputs_matcher)
result = minimum_entropy_match_sequence password, matches
result.calc_time = time() - start
result
# universal module definition based on:
# https://github.com/umdjs/umd/blob/master/commonjsStrict.js
loader = (root, factory) ->
if typeof defin... | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 5407bc2e5d387607c3b49e83aea4026563ec9494 | 15,961 | https://github.com/dropbox/zxcvbn/blob/5407bc2e5d387607c3b49e83aea4026563ec9494/init.coffee | 51 | 73 | ||
dropbox/zxcvbn:init.coffee:2:completion | completion | matches = omnimatch password, MATCHERS.concat(user_inputs_matcher)
result = minimum_entropy_match_sequence password, matches
result.calc_time = time() - start
result
# universal module definition based on:
# https://github.com/umdjs/umd/blob/master/commonjsStrict.js
loader = (root, factory) ->
if typeof defin... | define ['exports'], factory
else if typeof exports == 'object'
# CommonJS (including node support)
factory exports
else
# Add browser global
root.zxcvbn = {}
factory root.zxcvbn
root.zxcvbn_load_hook?() # run load hook from user, if defined
loader this, (exports) ->
exports.zxcvbn = zxcvbn | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 5407bc2e5d387607c3b49e83aea4026563ec9494 | 15,961 | https://github.com/dropbox/zxcvbn/blob/5407bc2e5d387607c3b49e83aea4026563ec9494/init.coffee | 51 | 73 |
dropbox/zxcvbn:init.coffee:2:raw_corpus | raw_corpus | matches = omnimatch password, MATCHERS.concat(user_inputs_matcher)
result = minimum_entropy_match_sequence password, matches
result.calc_time = time() - start
result
# make zxcvbn function globally available
# via window or exports object, depending on the environment
if window?
window.zxcvbn = zxcvbn
windo... | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 8653072d63bd8ad271186be905fb434412d6c67f | 15,961 | https://github.com/dropbox/zxcvbn/blob/8653072d63bd8ad271186be905fb434412d6c67f/init.coffee | 51 | 63 | ||
dropbox/zxcvbn:init.coffee:2:completion | completion | matches = omnimatch password, MATCHERS.concat(user_inputs_matcher)
result = minimum_entropy_match_sequence password, matches
result.calc_time = time() - start
result | # make zxcvbn function globally available
# via window or exports object, depending on the environment
if window?
window.zxcvbn = zxcvbn
window.zxcvbn_load_hook?() # run load hook from user, if defined
else if exports?
exports.zxcvbn = zxcvbn | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 8653072d63bd8ad271186be905fb434412d6c67f | 15,961 | https://github.com/dropbox/zxcvbn/blob/8653072d63bd8ad271186be905fb434412d6c67f/init.coffee | 51 | 63 |
dropbox/zxcvbn:init.coffee:1:raw_corpus | raw_corpus | # initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_name... | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 482ed03a10779ec125100721c2d828b97abf9ea6 | 15,961 | https://github.com/dropbox/zxcvbn/blob/482ed03a10779ec125100721c2d828b97abf9ea6/init.coffee | 1 | 50 | ||
dropbox/zxcvbn:init.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_d... | // initialize matcher lists
var DICTIONARY_MATCHERS, GRAPHS, KEYBOARD_AVERAGE_DEGREE, KEYBOARD_STARTING_POSITIONS, KEYPAD_AVERAGE_DEGREE, KEYPAD_STARTING_POSITIONS, MATCHERS, calc_average_degree, k, time, v, zxcvbn;
DICTIONARY_MATCHERS = [build_dict_matcher('passwords', build_ranked_dict(passwords)), build_dict_matche... | CoffeeScript | JavaScript | dropbox/zxcvbn | init.coffee | MIT | 482ed03a10779ec125100721c2d828b97abf9ea6 | 15,961 | https://github.com/dropbox/zxcvbn/blob/482ed03a10779ec125100721c2d828b97abf9ea6/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// initialize matcher lists
var DICTIONARY_MATCHERS, GRAPHS, KEYBOARD_AVERAGE_DEGREE, KEYBOARD_STARTING_POSITIONS, KEYPAD_AVERAGE_DEGREE, KEYPAD_STARTING_POSITIONS, MATCHERS, calc_average_degree, k, time, v, zxcvbn;
DICTIONARY_MATCHERS = [build_dict_matcher('passw... | # initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_name... | JavaScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 482ed03a10779ec125100721c2d828b97abf9ea6 | 15,961 | https://github.com/dropbox/zxcvbn/blob/482ed03a10779ec125100721c2d828b97abf9ea6/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:1:completion | completion | # initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_name... | average = 0
for key, neighbors of graph
average += (n for n in neighbors when n).length
average /= (k for k,v of graph).length
average
KEYBOARD_AVERAGE_DEGREE = calc_average_degree(qwerty)
KEYPAD_AVERAGE_DEGREE = calc_average_degree(keypad) # slightly different for keypad/mac keypad, but close enou... | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 482ed03a10779ec125100721c2d828b97abf9ea6 | 15,961 | https://github.com/dropbox/zxcvbn/blob/482ed03a10779ec125100721c2d828b97abf9ea6/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:2:raw_corpus | raw_corpus | result
# make zxcvbn function globally available
# via window or exports object, depending on the environment
if window?
window.zxcvbn = zxcvbn
window.zxcvbn_load_hook?() # run load hook from user, if defined
else if exports?
exports.zxcvbn = zxcvbn | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 482ed03a10779ec125100721c2d828b97abf9ea6 | 15,961 | https://github.com/dropbox/zxcvbn/blob/482ed03a10779ec125100721c2d828b97abf9ea6/init.coffee | 51 | 59 | ||
dropbox/zxcvbn:init.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
result
# make zxcvbn function globally available
# via window or exports object, depending on the environment
if window?
window.zxcvbn = zxcvbn
window.zxcvbn_load_hook?() # run load hook from user, if defined
else if exports?
exports.zxcvbn = zxcvbn
``` | result;
// make zxcvbn function globally available
// via window or exports object, depending on the environment
if (typeof window !== "undefined" && window !== null) {
window.zxcvbn = zxcvbn;
if (typeof window.zxcvbn_load_hook === "function") {
window.zxcvbn_load_hook();
}
} else if (typeof exports !== "unde... | CoffeeScript | JavaScript | dropbox/zxcvbn | init.coffee | MIT | 482ed03a10779ec125100721c2d828b97abf9ea6 | 15,961 | https://github.com/dropbox/zxcvbn/blob/482ed03a10779ec125100721c2d828b97abf9ea6/init.coffee | 51 | 59 |
dropbox/zxcvbn:init.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
result;
// make zxcvbn function globally available
// via window or exports object, depending on the environment
if (typeof window !== "undefined" && window !== null) {
window.zxcvbn = zxcvbn;
if (typeof window.zxcvbn_load_hook === "function") {
window.zxcv... | result
# make zxcvbn function globally available
# via window or exports object, depending on the environment
if window?
window.zxcvbn = zxcvbn
window.zxcvbn_load_hook?() # run load hook from user, if defined
else if exports?
exports.zxcvbn = zxcvbn | JavaScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 482ed03a10779ec125100721c2d828b97abf9ea6 | 15,961 | https://github.com/dropbox/zxcvbn/blob/482ed03a10779ec125100721c2d828b97abf9ea6/init.coffee | 51 | 59 |
dropbox/zxcvbn:init.coffee:2:completion | completion | result
# make zxcvbn function globally available
# via window or exports object, depending on the environment | if window?
window.zxcvbn = zxcvbn
window.zxcvbn_load_hook?() # run load hook from user, if defined
else if exports?
exports.zxcvbn = zxcvbn | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 482ed03a10779ec125100721c2d828b97abf9ea6 | 15,961 | https://github.com/dropbox/zxcvbn/blob/482ed03a10779ec125100721c2d828b97abf9ea6/init.coffee | 51 | 59 |
dropbox/zxcvbn:init.coffee:1:raw_corpus | raw_corpus | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names',... | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | a9fa79e62adcf171f5f981d2f64801df1ebdd990 | 15,961 | https://github.com/dropbox/zxcvbn/blob/a9fa79e62adcf171f5f981d2f64801df1ebdd990/init.coffee | 1 | 50 | ||
dropbox/zxcvbn:init.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranke... | var DICTIONARY_MATCHERS, GRAPHS, KEYBOARD_AVERAGE_DEGREE, KEYBOARD_STARTING_POSITIONS, KEYPAD_AVERAGE_DEGREE, KEYPAD_STARTING_POSITIONS, MATCHERS, calc_average_degree, k, ranked_user_inputs_dict, time, v, zxcvbn;
ranked_user_inputs_dict = {};
// initialize matcher lists
DICTIONARY_MATCHERS = [build_dict_matcher('pass... | CoffeeScript | JavaScript | dropbox/zxcvbn | init.coffee | MIT | a9fa79e62adcf171f5f981d2f64801df1ebdd990 | 15,961 | https://github.com/dropbox/zxcvbn/blob/a9fa79e62adcf171f5f981d2f64801df1ebdd990/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DICTIONARY_MATCHERS, GRAPHS, KEYBOARD_AVERAGE_DEGREE, KEYBOARD_STARTING_POSITIONS, KEYPAD_AVERAGE_DEGREE, KEYPAD_STARTING_POSITIONS, MATCHERS, calc_average_degree, k, ranked_user_inputs_dict, time, v, zxcvbn;
ranked_user_inputs_dict = {};
// initialize matche... | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names',... | JavaScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | a9fa79e62adcf171f5f981d2f64801df1ebdd990 | 15,961 | https://github.com/dropbox/zxcvbn/blob/a9fa79e62adcf171f5f981d2f64801df1ebdd990/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:1:completion | completion | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names',... | # on qwerty, 'g' has degree 6, being adjacent to 'ftyhbv'. '\' has degree 1.
# this calculates the average over all keys.
calc_average_degree = (graph) ->
average = 0
for key, neighbors of graph
average += (n for n in neighbors when n).length
average /= (k for k,v of graph).length
average
KEYBOARD_AVERAGE_... | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | a9fa79e62adcf171f5f981d2f64801df1ebdd990 | 15,961 | https://github.com/dropbox/zxcvbn/blob/a9fa79e62adcf171f5f981d2f64801df1ebdd990/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:2:raw_corpus | raw_corpus | matches = omnimatch password
result = minimum_entropy_match_sequence password, matches
result.calc_time = time() - start
result
# make zxcvbn function globally available
# via window or exports object, depending on the environment
if window?
window.zxcvbn = zxcvbn
window.zxcvbn_load_hook?() # run load hook f... | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | a9fa79e62adcf171f5f981d2f64801df1ebdd990 | 15,961 | https://github.com/dropbox/zxcvbn/blob/a9fa79e62adcf171f5f981d2f64801df1ebdd990/init.coffee | 51 | 62 | ||
dropbox/zxcvbn:init.coffee:2:completion | completion | matches = omnimatch password
result = minimum_entropy_match_sequence password, matches
result.calc_time = time() - start
result
# make zxcvbn function globally available | # via window or exports object, depending on the environment
if window?
window.zxcvbn = zxcvbn
window.zxcvbn_load_hook?() # run load hook from user, if defined
else if exports?
exports.zxcvbn = zxcvbn | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | a9fa79e62adcf171f5f981d2f64801df1ebdd990 | 15,961 | https://github.com/dropbox/zxcvbn/blob/a9fa79e62adcf171f5f981d2f64801df1ebdd990/init.coffee | 51 | 62 |
dropbox/zxcvbn:init.coffee:1:raw_corpus | raw_corpus | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names',... | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 6421ac52e28a0008824e71a272d2747d2cb99ae3 | 15,961 | https://github.com/dropbox/zxcvbn/blob/6421ac52e28a0008824e71a272d2747d2cb99ae3/init.coffee | 1 | 50 | ||
dropbox/zxcvbn:init.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranke... | var DICTIONARY_MATCHERS, GRAPHS, KEYBOARD_AVERAGE_DEGREE, KEYBOARD_STARTING_POSITIONS, KEYPAD_AVERAGE_DEGREE, KEYPAD_STARTING_POSITIONS, MATCHERS, calc_average_degree, k, ranked_user_inputs_dict, time, v, zxcvbn;
ranked_user_inputs_dict = {};
// initialize matcher lists
DICTIONARY_MATCHERS = [build_dict_matcher('pass... | CoffeeScript | JavaScript | dropbox/zxcvbn | init.coffee | MIT | 6421ac52e28a0008824e71a272d2747d2cb99ae3 | 15,961 | https://github.com/dropbox/zxcvbn/blob/6421ac52e28a0008824e71a272d2747d2cb99ae3/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DICTIONARY_MATCHERS, GRAPHS, KEYBOARD_AVERAGE_DEGREE, KEYBOARD_STARTING_POSITIONS, KEYPAD_AVERAGE_DEGREE, KEYPAD_STARTING_POSITIONS, MATCHERS, calc_average_degree, k, ranked_user_inputs_dict, time, v, zxcvbn;
ranked_user_inputs_dict = {};
// initialize matche... | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names',... | JavaScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 6421ac52e28a0008824e71a272d2747d2cb99ae3 | 15,961 | https://github.com/dropbox/zxcvbn/blob/6421ac52e28a0008824e71a272d2747d2cb99ae3/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:1:completion | completion | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names',... | # on qwerty, 'g' has degree 6, being adjacent to 'ftyhbv'. '\' has degree 1.
# this calculates the average over all keys.
calc_average_degree = (graph) ->
average = 0
for key, neighbors of graph
average += (n for n in neighbors when n).length
average /= (k for k,v of graph).length
average
KEYBOARD_AVERAGE_... | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 6421ac52e28a0008824e71a272d2747d2cb99ae3 | 15,961 | https://github.com/dropbox/zxcvbn/blob/6421ac52e28a0008824e71a272d2747d2cb99ae3/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:1:raw_corpus | raw_corpus | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names',... | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 3b5b5544bb92c44d4e96ca0fe0055268c708474c | 15,961 | https://github.com/dropbox/zxcvbn/blob/3b5b5544bb92c44d4e96ca0fe0055268c708474c/init.coffee | 1 | 50 | ||
dropbox/zxcvbn:init.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranke... | var DICTIONARY_MATCHERS, GRAPHS, KEYBOARD_AVERAGE_DEGREE, KEYBOARD_STARTING_POSITIONS, KEYPAD_AVERAGE_DEGREE, KEYPAD_STARTING_POSITIONS, MATCHERS, calc_average_degree, k, ranked_user_inputs_dict, time, v;
ranked_user_inputs_dict = {};
// initialize matcher lists
DICTIONARY_MATCHERS = [build_dict_matcher('passwords', ... | CoffeeScript | JavaScript | dropbox/zxcvbn | init.coffee | MIT | 3b5b5544bb92c44d4e96ca0fe0055268c708474c | 15,961 | https://github.com/dropbox/zxcvbn/blob/3b5b5544bb92c44d4e96ca0fe0055268c708474c/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DICTIONARY_MATCHERS, GRAPHS, KEYBOARD_AVERAGE_DEGREE, KEYBOARD_STARTING_POSITIONS, KEYPAD_AVERAGE_DEGREE, KEYPAD_STARTING_POSITIONS, MATCHERS, calc_average_degree, k, ranked_user_inputs_dict, time, v;
ranked_user_inputs_dict = {};
// initialize matcher lists
... | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names',... | JavaScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 3b5b5544bb92c44d4e96ca0fe0055268c708474c | 15,961 | https://github.com/dropbox/zxcvbn/blob/3b5b5544bb92c44d4e96ca0fe0055268c708474c/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:1:completion | completion | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('english', build_ranked_dict(english)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names',... | # on qwerty, 'g' has degree 6, being adjacent to 'ftyhbv'. '\' has degree 1.
# this calculates the average over all keys.
calc_average_degree = (graph) ->
average = 0
for key, neighbors of graph
average += (n for n in neighbors when n).length
average /= (k for k,v of graph).length
average
KEYBOARD_AVERAGE_... | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 3b5b5544bb92c44d4e96ca0fe0055268c708474c | 15,961 | https://github.com/dropbox/zxcvbn/blob/3b5b5544bb92c44d4e96ca0fe0055268c708474c/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:2:raw_corpus | raw_corpus | matches = omnimatch password
result = minimum_entropy_match_sequence password, matches
result.calc_time = time() - start
result
window.zxcvbn_load_hook?() # run load hook from user, if defined | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 3b5b5544bb92c44d4e96ca0fe0055268c708474c | 15,961 | https://github.com/dropbox/zxcvbn/blob/3b5b5544bb92c44d4e96ca0fe0055268c708474c/init.coffee | 51 | 56 | ||
dropbox/zxcvbn:init.coffee:2:completion | completion | matches = omnimatch password
result = minimum_entropy_match_sequence password, matches
result.calc_time = time() - start | result
window.zxcvbn_load_hook?() # run load hook from user, if defined | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 3b5b5544bb92c44d4e96ca0fe0055268c708474c | 15,961 | https://github.com/dropbox/zxcvbn/blob/3b5b5544bb92c44d4e96ca0fe0055268c708474c/init.coffee | 51 | 56 |
dropbox/zxcvbn:init.coffee:2:raw_corpus | raw_corpus | matches = omnimatch password
result = minimum_entropy_match_sequence password, matches
result.calc_time = time() - start
result
zxcvbn_load_hook?() # run load hook from user, if defined | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 14e051125466f5d74b5f868616ae192f6d074125 | 15,961 | https://github.com/dropbox/zxcvbn/blob/14e051125466f5d74b5f868616ae192f6d074125/init.coffee | 51 | 56 | ||
dropbox/zxcvbn:init.coffee:2:completion | completion | matches = omnimatch password
result = minimum_entropy_match_sequence password, matches
result.calc_time = time() - start | result
zxcvbn_load_hook?() # run load hook from user, if defined | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 14e051125466f5d74b5f868616ae192f6d074125 | 15,961 | https://github.com/dropbox/zxcvbn/blob/14e051125466f5d74b5f868616ae192f6d074125/init.coffee | 51 | 56 |
dropbox/zxcvbn:init.coffee:1:raw_corpus | raw_corpus | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_dict_matcher('surnames', bui... | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | e3ad0758da83ec457a804c5c98655934e66e6b0e | 15,961 | https://github.com/dropbox/zxcvbn/blob/e3ad0758da83ec457a804c5c98655934e66e6b0e/init.coffee | 1 | 50 | ||
dropbox/zxcvbn:init.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_... | var DICTIONARY_MATCHERS, GRAPHS, KEYBOARD_AVERAGE_DEGREE, KEYBOARD_STARTING_POSITIONS, KEYPAD_AVERAGE_DEGREE, KEYPAD_STARTING_POSITIONS, MATCHERS, calc_average_degree, k, ranked_user_inputs_dict, time, v;
ranked_user_inputs_dict = {};
// initialize matcher lists
DICTIONARY_MATCHERS = [build_dict_matcher('passwords', ... | CoffeeScript | JavaScript | dropbox/zxcvbn | init.coffee | MIT | e3ad0758da83ec457a804c5c98655934e66e6b0e | 15,961 | https://github.com/dropbox/zxcvbn/blob/e3ad0758da83ec457a804c5c98655934e66e6b0e/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DICTIONARY_MATCHERS, GRAPHS, KEYBOARD_AVERAGE_DEGREE, KEYBOARD_STARTING_POSITIONS, KEYPAD_AVERAGE_DEGREE, KEYPAD_STARTING_POSITIONS, MATCHERS, calc_average_degree, k, ranked_user_inputs_dict, time, v;
ranked_user_inputs_dict = {};
// initialize matcher lists
... | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_dict_matcher('surnames', bui... | JavaScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | e3ad0758da83ec457a804c5c98655934e66e6b0e | 15,961 | https://github.com/dropbox/zxcvbn/blob/e3ad0758da83ec457a804c5c98655934e66e6b0e/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:1:completion | completion | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_dict_matcher('surnames', bui... | # on qwerty, 'g' has degree 6, being adjacent to 'ftyhbv'. '\' has degree 1.
# this calculates the average over all keys.
calc_average_degree = (graph) ->
average = 0
for key, neighbors of graph
average += (n for n in neighbors when n).length
average /= (k for k,v of graph).length
average
KEYBOARD_AVERAGE_... | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | e3ad0758da83ec457a804c5c98655934e66e6b0e | 15,961 | https://github.com/dropbox/zxcvbn/blob/e3ad0758da83ec457a804c5c98655934e66e6b0e/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:1:raw_corpus | raw_corpus | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_dict_matcher('surnames', bui... | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 68e61c34d851ffd90d7ef103661ba51bca1d7e51 | 15,961 | https://github.com/dropbox/zxcvbn/blob/68e61c34d851ffd90d7ef103661ba51bca1d7e51/init.coffee | 1 | 50 | ||
dropbox/zxcvbn:init.coffee:1:completion | completion | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_dict_matcher('surnames', bui... | # on qwerty, 'g' has degree 6, being adjacent to 'ftyhbv'. '\' has degree 1.
# this calculates the average over all keys.
calc_average_degree = (graph) ->
average = 0
for key, neighbors of graph
average += (n for n in neighbors when n).length
average /= (k for k,v of graph).length
average
KEYBOARD_AVERAGE_... | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 68e61c34d851ffd90d7ef103661ba51bca1d7e51 | 15,961 | https://github.com/dropbox/zxcvbn/blob/68e61c34d851ffd90d7ef103661ba51bca1d7e51/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:2:raw_corpus | raw_corpus | # i+1 instead of i b/c rank starts at 1.
ranked_user_inputs_dict[user_inputs[i]] = i + 1
matches = omnimatch password
result = minimum_entropy_match_sequence password, matches
result.calc_time = time() - start
result
zxcvbn_load_hook?() # run load hook from user, if defined | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 68e61c34d851ffd90d7ef103661ba51bca1d7e51 | 15,961 | https://github.com/dropbox/zxcvbn/blob/68e61c34d851ffd90d7ef103661ba51bca1d7e51/init.coffee | 51 | 58 | ||
dropbox/zxcvbn:init.coffee:2:completion | completion | # i+1 instead of i b/c rank starts at 1.
ranked_user_inputs_dict[user_inputs[i]] = i + 1
matches = omnimatch password
result = minimum_entropy_match_sequence password, matches | result.calc_time = time() - start
result
zxcvbn_load_hook?() # run load hook from user, if defined | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 68e61c34d851ffd90d7ef103661ba51bca1d7e51 | 15,961 | https://github.com/dropbox/zxcvbn/blob/68e61c34d851ffd90d7ef103661ba51bca1d7e51/init.coffee | 51 | 58 |
dropbox/zxcvbn:init.coffee:1:raw_corpus | raw_corpus | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_dict_matcher('surnames', bui... | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 085f5b6bc9bbad0b99d7bc1ab36ed8f227148928 | 15,961 | https://github.com/dropbox/zxcvbn/blob/085f5b6bc9bbad0b99d7bc1ab36ed8f227148928/init.coffee | 1 | 50 | ||
dropbox/zxcvbn:init.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_... | var DICTIONARY_MATCHERS, GRAPHS, KEYBOARD_AVERAGE_DEGREE, KEYBOARD_STARTING_POSITIONS, KEYPAD_AVERAGE_DEGREE, KEYPAD_STARTING_POSITIONS, MATCHERS, calc_average_degree, k, ranked_user_inputs_dict, time, v;
ranked_user_inputs_dict = {};
// initialize matcher lists
DICTIONARY_MATCHERS = [build_dict_matcher('passwords', ... | CoffeeScript | JavaScript | dropbox/zxcvbn | init.coffee | MIT | 085f5b6bc9bbad0b99d7bc1ab36ed8f227148928 | 15,961 | https://github.com/dropbox/zxcvbn/blob/085f5b6bc9bbad0b99d7bc1ab36ed8f227148928/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DICTIONARY_MATCHERS, GRAPHS, KEYBOARD_AVERAGE_DEGREE, KEYBOARD_STARTING_POSITIONS, KEYPAD_AVERAGE_DEGREE, KEYPAD_STARTING_POSITIONS, MATCHERS, calc_average_degree, k, ranked_user_inputs_dict, time, v;
ranked_user_inputs_dict = {};
// initialize matcher lists
... | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_dict_matcher('surnames', bui... | JavaScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 085f5b6bc9bbad0b99d7bc1ab36ed8f227148928 | 15,961 | https://github.com/dropbox/zxcvbn/blob/085f5b6bc9bbad0b99d7bc1ab36ed8f227148928/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:1:completion | completion | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_dict_matcher('surnames', bui... | # on qwerty, 'g' has degree 6 being adjacent to 'ftyhbv', '\' has degree 1.
# this calculates the average over all keys.
calc_average_degree = (graph) ->
average = 0
for key, neighbors of graph
average += (n for n in neighbors when n).length
average /= (k for k,v of graph).length
average
KEYBOARD_AVERAGE_D... | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 085f5b6bc9bbad0b99d7bc1ab36ed8f227148928 | 15,961 | https://github.com/dropbox/zxcvbn/blob/085f5b6bc9bbad0b99d7bc1ab36ed8f227148928/init.coffee | 1 | 50 |
dropbox/zxcvbn:init.coffee:1:raw_corpus | raw_corpus | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_dict_matcher('surnames', bui... | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | a5bd3645ed59ea9e6047d15a7ba05689795e801c | 15,961 | https://github.com/dropbox/zxcvbn/blob/a5bd3645ed59ea9e6047d15a7ba05689795e801c/init.coffee | 1 | 41 | ||
dropbox/zxcvbn:init.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_... | var DICTIONARY_MATCHERS, GRAPHS, MATCHERS, ranked_user_inputs_dict, time;
ranked_user_inputs_dict = {};
// initialize matcher lists
DICTIONARY_MATCHERS = [build_dict_matcher('passwords', build_ranked_dict(passwords)), build_dict_matcher('male_names', build_ranked_dict(male_names)), build_dict_matcher('female_names', ... | CoffeeScript | JavaScript | dropbox/zxcvbn | init.coffee | MIT | a5bd3645ed59ea9e6047d15a7ba05689795e801c | 15,961 | https://github.com/dropbox/zxcvbn/blob/a5bd3645ed59ea9e6047d15a7ba05689795e801c/init.coffee | 1 | 41 |
dropbox/zxcvbn:init.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DICTIONARY_MATCHERS, GRAPHS, MATCHERS, ranked_user_inputs_dict, time;
ranked_user_inputs_dict = {};
// initialize matcher lists
DICTIONARY_MATCHERS = [build_dict_matcher('passwords', build_ranked_dict(passwords)), build_dict_matcher('male_names', build_ranked... | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_dict_matcher('surnames', bui... | JavaScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | a5bd3645ed59ea9e6047d15a7ba05689795e801c | 15,961 | https://github.com/dropbox/zxcvbn/blob/a5bd3645ed59ea9e6047d15a7ba05689795e801c/init.coffee | 1 | 41 |
dropbox/zxcvbn:init.coffee:1:completion | completion | ranked_user_inputs_dict = {}
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_dict_matcher('surnames', bui... | 'qwerty': qwerty
'dvorak': dvorak
'keypad': keypad
'mac_keypad': mac_keypad
time = -> (new Date()).getTime()
# now that frequency lists are loaded, replace zxcvbn stub function.
window.zxcvbn = (password, user_inputs) ->
start = time()
if user_inputs?
for i in [0...user_inputs.length]
# update ran... | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | a5bd3645ed59ea9e6047d15a7ba05689795e801c | 15,961 | https://github.com/dropbox/zxcvbn/blob/a5bd3645ed59ea9e6047d15a7ba05689795e801c/init.coffee | 1 | 41 |
dropbox/zxcvbn:init.coffee:1:raw_corpus | raw_corpus | # initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_dict_matcher('surnames', build_ranked_dict(surnames)),
b... | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | e93c16f7e49814aadfaec401f008732220f464ba | 15,961 | https://github.com/dropbox/zxcvbn/blob/e93c16f7e49814aadfaec401f008732220f464ba/init.coffee | 1 | 35 | ||
dropbox/zxcvbn:init.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_d... | // initialize matcher lists
var DICTIONARY_MATCHERS, GRAPHS, MATCHERS, time;
DICTIONARY_MATCHERS = [build_dict_matcher('passwords', build_ranked_dict(passwords)), build_dict_matcher('male_names', build_ranked_dict(male_names)), build_dict_matcher('female_names', build_ranked_dict(female_names)), build_dict_matcher('su... | CoffeeScript | JavaScript | dropbox/zxcvbn | init.coffee | MIT | e93c16f7e49814aadfaec401f008732220f464ba | 15,961 | https://github.com/dropbox/zxcvbn/blob/e93c16f7e49814aadfaec401f008732220f464ba/init.coffee | 1 | 35 |
dropbox/zxcvbn:init.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// initialize matcher lists
var DICTIONARY_MATCHERS, GRAPHS, MATCHERS, time;
DICTIONARY_MATCHERS = [build_dict_matcher('passwords', build_ranked_dict(passwords)), build_dict_matcher('male_names', build_ranked_dict(male_names)), build_dict_matcher('female_names', b... | # initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_dict_matcher('surnames', build_ranked_dict(surnames)),
b... | JavaScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | e93c16f7e49814aadfaec401f008732220f464ba | 15,961 | https://github.com/dropbox/zxcvbn/blob/e93c16f7e49814aadfaec401f008732220f464ba/init.coffee | 1 | 35 |
dropbox/zxcvbn:init.coffee:1:completion | completion | # initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_dict_matcher('surnames', build_ranked_dict(surnames)),
b... | 'qwerty': qwerty
'dvorak': dvorak
'keypad': keypad
'mac_keypad': mac_keypad
time = -> (new Date()).getTime()
# now that frequency lists are loaded, replace zxcvbn stub function.
window.zxcvbn = (password) ->
start = time()
matches = omnimatch password
result = minimum_entropy_match_sequence password, matc... | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | e93c16f7e49814aadfaec401f008732220f464ba | 15,961 | https://github.com/dropbox/zxcvbn/blob/e93c16f7e49814aadfaec401f008732220f464ba/init.coffee | 1 | 35 |
dropbox/zxcvbn:init.coffee:1:raw_corpus | raw_corpus | # initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_dict_matcher('surnames', build_ranked_dict(surnames)),
b... | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 9416d0fa68cffb9a175e75b4b3fb0431ed7a2441 | 15,961 | https://github.com/dropbox/zxcvbn/blob/9416d0fa68cffb9a175e75b4b3fb0431ed7a2441/init.coffee | 1 | 37 | ||
dropbox/zxcvbn:init.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_d... | // initialize matcher lists
var DICTIONARY_MATCHERS, GRAPHS, MATCHERS, time;
DICTIONARY_MATCHERS = [build_dict_matcher('passwords', build_ranked_dict(passwords)), build_dict_matcher('male_names', build_ranked_dict(male_names)), build_dict_matcher('female_names', build_ranked_dict(female_names)), build_dict_matcher('su... | CoffeeScript | JavaScript | dropbox/zxcvbn | init.coffee | MIT | 9416d0fa68cffb9a175e75b4b3fb0431ed7a2441 | 15,961 | https://github.com/dropbox/zxcvbn/blob/9416d0fa68cffb9a175e75b4b3fb0431ed7a2441/init.coffee | 1 | 37 |
dropbox/zxcvbn:init.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// initialize matcher lists
var DICTIONARY_MATCHERS, GRAPHS, MATCHERS, time;
DICTIONARY_MATCHERS = [build_dict_matcher('passwords', build_ranked_dict(passwords)), build_dict_matcher('male_names', build_ranked_dict(male_names)), build_dict_matcher('female_names', b... | # initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_dict_matcher('surnames', build_ranked_dict(surnames)),
b... | JavaScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 9416d0fa68cffb9a175e75b4b3fb0431ed7a2441 | 15,961 | https://github.com/dropbox/zxcvbn/blob/9416d0fa68cffb9a175e75b4b3fb0431ed7a2441/init.coffee | 1 | 37 |
dropbox/zxcvbn:init.coffee:1:completion | completion | # initialize matcher lists
DICTIONARY_MATCHERS = [
build_dict_matcher('passwords', build_ranked_dict(passwords)),
build_dict_matcher('male_names', build_ranked_dict(male_names)),
build_dict_matcher('female_names', build_ranked_dict(female_names)),
build_dict_matcher('surnames', build_ranked_dict(surnames)),
b... | 'dvorak': dvorak
'keypad': keypad
'mac_keypad': mac_keypad
time = -> (new Date()).getTime()
# now that frequency lists are loaded, replace zxcvbn stub function.
window.zxcvbn = (password) ->
console.log 'bam'
start = time()
matches = omnimatch password
result = minimum_entropy_match_sequence password, mat... | CoffeeScript | CoffeeScript | dropbox/zxcvbn | init.coffee | MIT | 9416d0fa68cffb9a175e75b4b3fb0431ed7a2441 | 15,961 | https://github.com/dropbox/zxcvbn/blob/9416d0fa68cffb9a175e75b4b3fb0431ed7a2441/init.coffee | 1 | 37 |
outsideris/popularconvention:src/parser/python-parser.coffee:1:raw_corpus | raw_corpus | # parsing Python code
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
_ = require 'underscore'
jsParser = module.exports =
lang: 'py'
parse: (line, convention, commitUrl) ->
... | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/python-parser.coffee | 1 | 43 | ||
outsideris/popularconvention:src/parser/python-parser.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# parsing Python code
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
_ = require 'underscore'
jsParser = module.exports =
... | // parsing Python code
// Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
// Licensed under the MIT license.
// <http://outsider.mit-license.org/>
var _, helpers, jsParser;
helpers = require('../helpers');
_ = require('underscore');
jsParser = module.exports = {
lang: 'py',
parse... | CoffeeScript | JavaScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/python-parser.coffee | 1 | 43 |
outsideris/popularconvention:src/parser/python-parser.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// parsing Python code
// Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
// Licensed under the MIT license.
// <http://outsider.mit-license.org/>
var _, helpers, jsParser;
helpers = require('../helpers');
_ = require('underscore'... | # parsing Python code
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
_ = require 'underscore'
jsParser = module.exports =
lang: 'py'
parse: (line, convention, commitUrl) ->
... | JavaScript | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/python-parser.coffee | 1 | 43 |
outsideris/popularconvention:src/parser/python-parser.coffee:1:completion | completion | # parsing Python code
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
_ = require 'underscore'
jsParser = module.exports =
lang: 'py'
parse: (line, convention, commitUrl) ->
... | title: "Space vs. Tab"
column: [
{
key: "tab", display: "Tab",
code: """
def long_function_name(var_one):
# use tab for indentation
print(var_one)
"""
}
{
key: "space", display: "S... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/python-parser.coffee | 1 | 43 |
outsideris/popularconvention:src/parser/python-parser.coffee:2:raw_corpus | raw_corpus | tab = /^\t+.*/
space = /^\s+.*/
convention.indent.tab = convention.indent.tab + 1 if tab.test line
convention.indent.space = convention.indent.space + 1 if space.test line
convention.indent.commits.push commitUrl if tab.test(line) or space.test(line)
convention.indent.commits = _.uniq convention.i... | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/python-parser.coffee | 45 | 89 | ||
outsideris/popularconvention:src/parser/python-parser.coffee:2:completion | completion | tab = /^\t+.*/
space = /^\s+.*/
convention.indent.tab = convention.indent.tab + 1 if tab.test line
convention.indent.space = convention.indent.space + 1 if space.test line
convention.indent.commits.push commitUrl if tab.test(line) or space.test(line)
convention.indent.commits = _.uniq convention.i... | }
{
key: "char150", display: "Line length is within 150 characters",
code: "# width is within 150 characters"
}
]
char80: 0
char120: 0
char150: 0
commits: []
) unless convention.linelength
width = line.length
tabcount = line.split('\t').leng... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/python-parser.coffee | 45 | 89 |
outsideris/popularconvention:src/parser/python-parser.coffee:3:raw_corpus | raw_corpus | convention.linelength.commits.push commitUrl
convention.linelength.commits = _.uniq convention.linelength.commits
convention
imports: (line, convention, commitUrl) ->
convention = {lang: this.lang} unless convention
(convention.imports =
title: "Imports on separate lines"
column: [
... | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/python-parser.coffee | 91 | 138 | ||
outsideris/popularconvention:src/parser/python-parser.coffee:3:completion | completion | convention.linelength.commits.push commitUrl
convention.linelength.commits = _.uniq convention.linelength.commits
convention
imports: (line, convention, commitUrl) ->
convention = {lang: this.lang} unless convention
(convention.imports =
title: "Imports on separate lines"
column: [
... | separated: 0
noseparated: 0
commits: []
) unless convention.imports
separated = /^\s*\t*import\s+[\w.]+([^,]\s*|\s*#.*)$/
noseparated = /^\s*\t*import\s+\w+\s*,\s+\w+/
convention.imports.separated = convention.imports.separated + 1 if separated.test line
convention.imports.noseparated ... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/python-parser.coffee | 91 | 138 |
outsideris/popularconvention:src/parser/python-parser.coffee:4:raw_corpus | raw_corpus | if x == 4: print x, y; x, y = y, x
spam(1)
dict['key'] = list[index]
x = 1
y = 2
long_variable = 3
"""
}
{
key: "extra", display: "Using extraneous whitespace",
code: """
... | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/python-parser.coffee | 140 | 178 | ||
outsideris/popularconvention:src/parser/python-parser.coffee:4:completion | completion | if x == 4: print x, y; x, y = y, x
spam(1)
dict['key'] = list[index]
x = 1
y = 2
long_variable = 3
"""
}
{
key: "extra", display: "Using extraneous whitespace",
code: """
... | spam (1)
dict ['key'] = list [index]
x = 1
y = 2
long_variable = 3
"""
}
]
noextra: 0
extra: 0
commits: []
) unless convention.whitespace
noextra = /\S+[\(\)\[\],]\S+|\S+:\s... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/python-parser.coffee | 140 | 178 |
outsideris/popularconvention:src/parser/python-parser.coffee:5:raw_corpus | raw_corpus | convention.whitespace.commits.push commitUrl
convention.whitespace.commits = _.uniq convention.whitespace .commits
else if noextra.test line
convention.whitespace.noextra = convention.whitespace.noextra + 1
convention.whitespace.commits.push commitUrl
convention.whitespace.commits = _.uniq ... | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/python-parser.coffee | 180 | 188 | ||
outsideris/popularconvention:src/parser/python-parser.coffee:5:completion | completion | convention.whitespace.commits.push commitUrl
convention.whitespace.commits = _.uniq convention.whitespace .commits
else if noextra.test line
convention.whitespace.noextra = convention.whitespace.noextra + 1 | convention.whitespace.commits.push commitUrl
convention.whitespace.commits = _.uniq convention.whitespace .commits
convention | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/src/parser/python-parser.coffee | 180 | 188 |
outsideris/popularconvention:src/parser/python-parser.coffee:4:raw_corpus | raw_corpus | if x == 4: print x, y; x, y = y, x
spam(1)
dict['key'] = list[index]
x = 1
y = 2
long_variable = 3
"""
}
{
key: "extra", display: "Using extraneous whitespace",
code: """
... | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | ad6cc292002b734a330dfcbf36d5490a01675980 | 730 | https://github.com/outsideris/popularconvention/blob/ad6cc292002b734a330dfcbf36d5490a01675980/src/parser/python-parser.coffee | 140 | 182 | ||
outsideris/popularconvention:src/parser/python-parser.coffee:4:completion | completion | if x == 4: print x, y; x, y = y, x
spam(1)
dict['key'] = list[index]
x = 1
y = 2
long_variable = 3
"""
}
{
key: "extra", display: "Using extraneous whitespace",
code: """
... | dict ['key'] = list [index]
x = 1
y = 2
"""
}
]
noextra: 0
extra: 0
commits: []
) unless convention.whitespace
noextra = /\S+[\(\)\[\],]\S+|\S+:\s|\S\s=\s/
extra = /\(\s+|\s+[\(\)\[\]]|\s+[:,]\s+|\s{2,}... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | ad6cc292002b734a330dfcbf36d5490a01675980 | 730 | https://github.com/outsideris/popularconvention/blob/ad6cc292002b734a330dfcbf36d5490a01675980/src/parser/python-parser.coffee | 140 | 182 |
outsideris/popularconvention:src/parser/python-parser.coffee:3:raw_corpus | raw_corpus | convention.linelength.commits.push commitUrl
convention.linelength.commits = _.uniq convention.linelength.commits
convention
imports: (line, convention, commitUrl) ->
convention = {lang: this.lang} unless convention
(convention.imports =
title: "Imports on separate lines"
column: [
... | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | a87385db40213aeb2a4246f2e7b241aa45614639 | 730 | https://github.com/outsideris/popularconvention/blob/a87385db40213aeb2a4246f2e7b241aa45614639/src/parser/python-parser.coffee | 91 | 138 | ||
outsideris/popularconvention:src/parser/python-parser.coffee:3:completion | completion | convention.linelength.commits.push commitUrl
convention.linelength.commits = _.uniq convention.linelength.commits
convention
imports: (line, convention, commitUrl) ->
convention = {lang: this.lang} unless convention
(convention.imports =
title: "Imports on separate lines"
column: [
... | separated: 0
noseparated: 0
commits: []
) unless convention.imports
separated = /^\s*\t*import\s+[\w.]+([^,]\s*|\s*#.*)$/
noseparated = /^\s*\t*import\s+\w+\s*,\s+\w+/
convention.imports.separated = convention.imports.separated + 1 if separated.test line
convention.imports.noseparated ... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | a87385db40213aeb2a4246f2e7b241aa45614639 | 730 | https://github.com/outsideris/popularconvention/blob/a87385db40213aeb2a4246f2e7b241aa45614639/src/parser/python-parser.coffee | 91 | 138 |
outsideris/popularconvention:src/parser/python-parser.coffee:3:raw_corpus | raw_corpus | convention.linelength.commits.push commitUrl
convention.linelength.commits = _.uniq convention.linelength.commits
convention
imports: (line, convention, commitUrl) ->
convention = {lang: this.lang} unless convention
(convention.imports =
title: "imports on separate lines"
column: [
... | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | b4008f49690aede200e6e229d9f1fcc64f1d441d | 730 | https://github.com/outsideris/popularconvention/blob/b4008f49690aede200e6e229d9f1fcc64f1d441d/src/parser/python-parser.coffee | 91 | 138 | ||
outsideris/popularconvention:src/parser/python-parser.coffee:3:completion | completion | convention.linelength.commits.push commitUrl
convention.linelength.commits = _.uniq convention.linelength.commits
convention
imports: (line, convention, commitUrl) ->
convention = {lang: this.lang} unless convention
(convention.imports =
title: "imports on separate lines"
column: [
... | separated: 0
noseparated: 0
commits: []
) unless convention.imports
separated = /^\s*\t*import\s+[\w.]+([^,]\s*|\s*#.*)$/
noseparated = /^\s*\t*import\s+\w+\s*,\s+\w+/
convention.imports.separated = convention.imports.separated + 1 if separated.test line
convention.imports.noseparated ... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | b4008f49690aede200e6e229d9f1fcc64f1d441d | 730 | https://github.com/outsideris/popularconvention/blob/b4008f49690aede200e6e229d9f1fcc64f1d441d/src/parser/python-parser.coffee | 91 | 138 |
outsideris/popularconvention:src/parser/python-parser.coffee:2:raw_corpus | raw_corpus | tab = /^\t+.*/
space = /^\s+.*/
convention.indent.tab = convention.indent.tab + 1 if tab.test line
convention.indent.space = convention.indent.space + 1 if space.test line
convention.indent.commits.push commitUrl if tab.test(line) or space.test(line)
convention.indent.commits = _.uniq convention.i... | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 13f9559cf4e61dac48c68bda284054d9df65c2e9 | 730 | https://github.com/outsideris/popularconvention/blob/13f9559cf4e61dac48c68bda284054d9df65c2e9/src/parser/python-parser.coffee | 45 | 89 | ||
outsideris/popularconvention:src/parser/python-parser.coffee:2:completion | completion | tab = /^\t+.*/
space = /^\s+.*/
convention.indent.tab = convention.indent.tab + 1 if tab.test line
convention.indent.space = convention.indent.space + 1 if space.test line
convention.indent.commits.push commitUrl if tab.test(line) or space.test(line)
convention.indent.commits = _.uniq convention.i... | }
{
key: "char150", display: "Line length is within 150 characters",
code: "/* width is within 150 characters */"
}
]
char80: 0
char120: 0
char150: 0
commits: []
) unless convention.linelength
width = line.length
tabcount = line.split('\t').... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 13f9559cf4e61dac48c68bda284054d9df65c2e9 | 730 | https://github.com/outsideris/popularconvention/blob/13f9559cf4e61dac48c68bda284054d9df65c2e9/src/parser/python-parser.coffee | 45 | 89 |
outsideris/popularconvention:src/parser/python-parser.coffee:3:raw_corpus | raw_corpus | convention.linelength.commits.push commitUrl
convention.linelength.commits = _.uniq convention.linelength.commits
convention
imports: (line, convention, commitUrl) ->
convention = {lang: this.lang} unless convention
(convention.imports =
title: "imports on separate lines"
column: [
... | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 13f9559cf4e61dac48c68bda284054d9df65c2e9 | 730 | https://github.com/outsideris/popularconvention/blob/13f9559cf4e61dac48c68bda284054d9df65c2e9/src/parser/python-parser.coffee | 91 | 140 | ||
outsideris/popularconvention:src/parser/python-parser.coffee:3:completion | completion | convention.linelength.commits.push commitUrl
convention.linelength.commits = _.uniq convention.linelength.commits
convention
imports: (line, convention, commitUrl) ->
convention = {lang: this.lang} unless convention
(convention.imports =
title: "imports on separate lines"
column: [
... | noseparated: 0
commits: []
) unless convention.imports
separated = /^\s*\t*import\s+[\w.]+([^,]\s*|\s*#.*)$/
noseparated = /^\s*\t*import\s+\w+\s*,\s+\w+/
convention.imports.separated = convention.imports.separated + 1 if separated.test line
convention.imports.noseparated = convention.import... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 13f9559cf4e61dac48c68bda284054d9df65c2e9 | 730 | https://github.com/outsideris/popularconvention/blob/13f9559cf4e61dac48c68bda284054d9df65c2e9/src/parser/python-parser.coffee | 91 | 140 |
outsideris/popularconvention:src/parser/python-parser.coffee:5:raw_corpus | raw_corpus | {
key: "extra", display: "Using extraneous whitespace",
code: """
spam( ham[ 1 ], { eggs: 2 } )
if x == 4 : print x , y ; x , y = y , x
spam (1)
dict ['key'] = list [index]
x = 1
y ... | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 13f9559cf4e61dac48c68bda284054d9df65c2e9 | 730 | https://github.com/outsideris/popularconvention/blob/13f9559cf4e61dac48c68bda284054d9df65c2e9/src/parser/python-parser.coffee | 148 | 179 | ||
outsideris/popularconvention:src/parser/python-parser.coffee:5:completion | completion | {
key: "extra", display: "Using extraneous whitespace",
code: """
spam( ham[ 1 ], { eggs: 2 } )
if x == 4 : print x , y ; x , y = y , x
spam (1)
dict ['key'] = list [index]
x = 1
y ... | noextra = /\S+[\(\)\[\],]\S+|\S+:\s|\S\s=\s/
extra = /\(\s+|\s+[\(\)\[\]]|\s+[:,]\s+|\s{2,}=|=\s{2,}/
if extra.test line
convention.whitespace.extra = convention.whitespace.extra + 1
convention.whitespace.commits.push commitUrl
convention.whitespace.commits = _.uniq convention.whitespace .co... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 13f9559cf4e61dac48c68bda284054d9df65c2e9 | 730 | https://github.com/outsideris/popularconvention/blob/13f9559cf4e61dac48c68bda284054d9df65c2e9/src/parser/python-parser.coffee | 148 | 179 |
outsideris/popularconvention:src/parser/python-parser.coffee:3:raw_corpus | raw_corpus | convention.linelength.commits.push commitUrl
convention.linelength.commits = _.uniq convention.linelength.commits
convention
imports: (line, convention, commitUrl) ->
convention = {lang: this.lang} unless convention
(convention.imports =
title: "imports on separate lines"
column: [
... | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | e912e57997b8c86410ed691addbfa465c0ec4467 | 730 | https://github.com/outsideris/popularconvention/blob/e912e57997b8c86410ed691addbfa465c0ec4467/src/parser/python-parser.coffee | 91 | 140 | ||
outsideris/popularconvention:src/parser/python-parser.coffee:3:completion | completion | convention.linelength.commits.push commitUrl
convention.linelength.commits = _.uniq convention.linelength.commits
convention
imports: (line, convention, commitUrl) ->
convention = {lang: this.lang} unless convention
(convention.imports =
title: "imports on separate lines"
column: [
... | noseparated: 0
commits: []
) unless convention.imports
separated = /^\s*\t*import\s+[\w.]+([^,]\s*|\s*#.*)$/
noseparated = /^\s*\t*import\s+\w+\s*,\s+\w+/
convention.imports.separated = convention.imports.separated + 1 if separated.test line
convention.imports.noseparated = convention.import... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | e912e57997b8c86410ed691addbfa465c0ec4467 | 730 | https://github.com/outsideris/popularconvention/blob/e912e57997b8c86410ed691addbfa465c0ec4467/src/parser/python-parser.coffee | 91 | 140 |
outsideris/popularconvention:src/parser/python-parser.coffee:5:raw_corpus | raw_corpus | {
key: "extra", display: "using extraneous whitespace",
code: """
spam( ham[ 1 ], { eggs: 2 } )
if x == 4 : print x , y ; x , y = y , x
spam (1)
dict ['key'] = list [index]
x = 1
y ... | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | e912e57997b8c86410ed691addbfa465c0ec4467 | 730 | https://github.com/outsideris/popularconvention/blob/e912e57997b8c86410ed691addbfa465c0ec4467/src/parser/python-parser.coffee | 148 | 179 | ||
outsideris/popularconvention:src/parser/python-parser.coffee:5:completion | completion | {
key: "extra", display: "using extraneous whitespace",
code: """
spam( ham[ 1 ], { eggs: 2 } )
if x == 4 : print x , y ; x , y = y , x
spam (1)
dict ['key'] = list [index]
x = 1
y ... | noextra = /\S+[\(\)\[\],]\S+|\S+:\s|\S\s=\s/
extra = /\(\s+|\s+[\(\)\[\]]|\s+[:,]\s+|\s{2,}=|=\s{2,}/
if extra.test line
convention.whitespace.extra = convention.whitespace.extra + 1
convention.whitespace.commits.push commitUrl
convention.whitespace.commits = _.uniq convention.whitespace .co... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | e912e57997b8c86410ed691addbfa465c0ec4467 | 730 | https://github.com/outsideris/popularconvention/blob/e912e57997b8c86410ed691addbfa465c0ec4467/src/parser/python-parser.coffee | 148 | 179 |
outsideris/popularconvention:src/parser/python-parser.coffee:1:raw_corpus | raw_corpus | # parsing Python code
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
_ = require 'underscore'
jsParser = module.exports =
lang: 'py'
parse: (line, convention, commitUrl) ->
... | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 6cda5bc66b67b8d18b96b7ff634f065d9086bffa | 730 | https://github.com/outsideris/popularconvention/blob/6cda5bc66b67b8d18b96b7ff634f065d9086bffa/src/parser/python-parser.coffee | 1 | 44 | ||
outsideris/popularconvention:src/parser/python-parser.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# parsing Python code
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
_ = require 'underscore'
jsParser = module.exports =
... | // parsing Python code
// Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
// Licensed under the MIT license.
// <http://outsider.mit-license.org/>
var _, helpers, jsParser;
helpers = require('../helpers');
_ = require('underscore');
jsParser = module.exports = {
lang: 'py',
parse... | CoffeeScript | JavaScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 6cda5bc66b67b8d18b96b7ff634f065d9086bffa | 730 | https://github.com/outsideris/popularconvention/blob/6cda5bc66b67b8d18b96b7ff634f065d9086bffa/src/parser/python-parser.coffee | 1 | 44 |
outsideris/popularconvention:src/parser/python-parser.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// parsing Python code
// Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
// Licensed under the MIT license.
// <http://outsider.mit-license.org/>
var _, helpers, jsParser;
helpers = require('../helpers');
_ = require('underscore'... | # parsing Python code
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
_ = require 'underscore'
jsParser = module.exports =
lang: 'py'
parse: (line, convention, commitUrl) ->
... | JavaScript | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 6cda5bc66b67b8d18b96b7ff634f065d9086bffa | 730 | https://github.com/outsideris/popularconvention/blob/6cda5bc66b67b8d18b96b7ff634f065d9086bffa/src/parser/python-parser.coffee | 1 | 44 |
outsideris/popularconvention:src/parser/python-parser.coffee:1:completion | completion | # parsing Python code
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
helpers = require '../helpers'
_ = require 'underscore'
jsParser = module.exports =
lang: 'py'
parse: (line, convention, commitUrl) ->
... | column: [
{
key: "tab", display: "Tab",
code: """
def long_function_name(var_one):
print(var_one)
"""
}
{
key: "space", display: "Space",
code: """
def long_function_name(var_one):
... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/parser/python-parser.coffee | MIT | 6cda5bc66b67b8d18b96b7ff634f065d9086bffa | 730 | https://github.com/outsideris/popularconvention/blob/6cda5bc66b67b8d18b96b7ff634f065d9086bffa/src/parser/python-parser.coffee | 1 | 44 |
soulwire/Coffee-Physics:source/base.coffee:1:raw_corpus | raw_corpus | ### Allows safe, dyamic creation of namespaces. ###
namespace = (id) ->
root = self
root = root[path] ?= {} for path in id.split '.'
### RequestAnimationFrame shim. ###
do ->
time = 0
vendors = ['ms', 'moz', 'webkit', 'o']
for vendor in vendors when not window.requestAnimationFrame
window.requ... | CoffeeScript | soulwire/Coffee-Physics | source/base.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/base.coffee | 1 | 28 | ||
soulwire/Coffee-Physics:source/base.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
### Allows safe, dyamic creation of namespaces. ###
namespace = (id) ->
root = self
root = root[path] ?= {} for path in id.split '.'
### RequestAnimationFrame shim. ###
do ->
time = 0
vendors = ['ms', 'moz', 'webkit', 'o']
for vendor in vendors ... | /* Allows safe, dyamic creation of namespaces. */
var namespace;
namespace = function(id) {
var i, len, path, ref, results, root;
root = self;
ref = id.split('.');
results = [];
for (i = 0, len = ref.length; i < len; i++) {
path = ref[i];
results.push(root = root[path] != null ? root[path] : root[pat... | CoffeeScript | JavaScript | soulwire/Coffee-Physics | source/base.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/base.coffee | 1 | 28 |
soulwire/Coffee-Physics:source/base.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/* Allows safe, dyamic creation of namespaces. */
var namespace;
namespace = function(id) {
var i, len, path, ref, results, root;
root = self;
ref = id.split('.');
results = [];
for (i = 0, len = ref.length; i < len; i++) {
path = ref[i];
results... | ### Allows safe, dyamic creation of namespaces. ###
namespace = (id) ->
root = self
root = root[path] ?= {} for path in id.split '.'
### RequestAnimationFrame shim. ###
do ->
time = 0
vendors = ['ms', 'moz', 'webkit', 'o']
for vendor in vendors when not window.requestAnimationFrame
window.requ... | JavaScript | CoffeeScript | soulwire/Coffee-Physics | source/base.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/base.coffee | 1 | 28 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.