<commit_before>__author__ = '<NAME>'

import caleydo_security_flask.flask_login

import hashlib

def hash_password(password, salt):
  return hashlib.sha512(password + salt).hexdigest()

class User(caleydo_security_flask.flask_login.User):
  def __init__(self, id, password, salt, roles):
    super(User, self).__init__(id)
    self.name = id
    self._password = password
    self._salt = salt
    self.roles = roles

  def is_authenticated(self):
    return True

  def is_active(self):
    return True

  def is_password(self, given):
    given_h = hash_password(given, self._salt)
    return given_h == self._password

class UserStore(object):
  def __init__(self):
    import caleydo_server.config

    self._users = [User(v['name'], v['password'], v['salt'], v['roles']) for v in
                   caleydo_server.config.get('caleydo_security_flask.users')]

  def load(self, id):<commit_msg>changes for flask_security version switch<commit_after>__author__ = '<NAME>'

import caleydo_security_flask.flask_login

import hashlib

def hash_password(password, salt):
  return hashlib.sha512(password + salt).hexdigest()

class User(caleydo_security_flask.flask_login.User):
  def __init__(self, id, password, salt, roles):
    super(User, self).__init__(id)
    self.name = id
    self._password = password
    self._salt = salt
    self.roles = roles

  @property
  def is_authenticated(self):
    return True

  @property
  def is_active(self):
    return True

  def is_password(self, given):
    given_h = hash_password(given, self._salt)
    return given_h == self._password

class UserStore(object):
  def __init__(self):
    import caleydo_server.config

    self._users = [User(v['name'], v['password'], v['salt'], v['roles']) for v in
                   caleydo_server.config.get('caleydo_security_flask.users')]

  def load(self, id):
{'fraction_non_alphanumeric': 0.11700975081256772, 'fraction_numerical': 0.0032502708559046588, 'mean_word_length': 4.06027397260274, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6763441', 'n_tokens_mistral': 642, 'n_tokens_neox': 602, 'n_words': 135}