<commit_before>app.defaultUserPrefs =
  useWebRtc:        true
  autoLogout:       60
  hideForeignCalls: false


app.getUserPrefs = (uid) ->
  json = window.localStorage[uid] || JSON.stringify(app.defaultUserPrefs)
  $.extend app.defaultUserPrefs, JSON.parse(json)


app.putUserPrefs = (uid, obj) ->
  window.localStorage[uid] = JSON.stringify(obj)


app.storeLocalKey = (key, value) ->
  uid = Voice.get('currentUser.id')
  return unless uid
  prefs = app.getUserPrefs(uid)
  prefs[key] = value
  app.putUserPrefs(uid, prefs)


app.loadLocalKey = (key) ->
  uid = Voice.get('currentUser.id')
  return unless uid
  app.getUserPrefs(uid)[key]
<commit_msg>add guard for emtpy uid<commit_after>app.defaultUserPrefs =
  useWebRtc:        true
  autoLogout:       60
  hideForeignCalls: false


app.getUserPrefs = (uid) ->
  return unless uid
  json = window.localStorage[uid] || JSON.stringify(app.defaultUserPrefs)
  $.extend app.defaultUserPrefs, JSON.parse(json)


app.putUserPrefs = (uid, obj) ->
  window.localStorage[uid] = JSON.stringify(obj)


app.storeLocalKey = (key, value) ->
  uid = Voice.get('currentUser.id')
  return unless uid
  prefs = app.getUserPrefs(uid)
  prefs[key] = value
  app.putUserPrefs(uid, prefs)


app.loadLocalKey = (key) ->
  uid = Voice.get('currentUser.id')
  return unless uid
  app.getUserPrefs(uid)[key]

{'fraction_non_alphanumeric': 0.13134328358208955, 'fraction_numerical': 0.0029850746268656717, 'mean_word_length': 3.9301470588235294, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4622374', 'n_tokens_mistral': 496, 'n_tokens_neox': 485, 'n_words': 91}