<commit_before><?php

class RegisterHandler extends BaseHttpHandler {

  public function get($params) {
    $this->response->display('register');
  }

  public function post($params) {
    $username = $this->request->get('username');
    $password = $this->request->get('password');
    if($username != ""
      && $password != ""
      && $password == $this->request->get('password_repeat')) {
        if(!$this->userExists($username)) {
          $doc = array('metadata' => array(), 'data' => array());
          $doc['metadata']['password'] = <PASSWORD>1($this->config->get('passwordSalt') . $password);
          S3::putObject(json_encode($doc), $this->config->get('AWSS3Bucket'), $this->createUserFilename($username), S3::ACL_PRIVATE);
          $this->response->set('created', true);<commit_msg>write better initial user object<commit_after><?php

class RegisterHandler extends BaseHttpHandler {

  public function get($params) {
    $this->response->display('register');
  }

  public function post($params) {
    $username = $this->request->get('username');
    $password = $this->request->get('password');
    if($username != ""
      && $password != ""
      && $password == $this->request->get('password_repeat')) {
        if(!$this->userExists($username)) {
          $doc = array('metadata' => array(), 'data' => '');
          $doc['metadata']['version'] = '';
          $doc['metadata']['password'] = <PASSWORD>($this->config->get('passwordSalt') . $password);
          S3::putObject(json_encode($doc), $this->config->get('AWSS3Bucket'), $this->createUserFilename($username), S3::ACL_PRIVATE);
          $this->response->set('created', true);
{'fraction_non_alphanumeric': 0.21398432790837854, 'fraction_numerical': 0.004219409282700422, 'mean_word_length': 4.03030303030303, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 41, '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': '1659905', 'n_tokens_mistral': 477, 'n_tokens_neox': 472, 'n_words': 73}