<commit_before><?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

class Users extends MY_Model
{
    public function __construct()
    {
        parent::__construct('users', 'user_id');
    }
    
    /** Searches the table by username **/
    public function get_by_username($username)
    {
        $this->db->where('username',$username);       
         $query = $this->db->get($this->_tableName);
          return $query->result()[0];
    }
    
    /** Returns max length for parameter **/
    public function max_length($column)
    {
        return $this->db->query('select MAX(LENGTH('.$column.')) from '.$this->_tableName);
    }
}
<commit_msg>added a function some_like($what, $which) which is just the original some function but it uses "like" instead of "where" so when you search for a username you get all of the user's that have similar usernames instead of a 1-1 matching Signed-off-by:thunduaga <<EMAIL>><commit_after><?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

class Users extends MY_Model
{
    public function __construct()
    {
        parent::__construct('users', 'user_id');
    }
    
    /** Searches the table by username **/
    public function get_by_username($username)
    {
        $this->db->where('username',$username);       
         $query = $this->db->get($this->_tableName);
          return $query->result()[0];
    }
    
    /** Returns max length for parameter **/
    public function max_length($column)
    {
        return $this->db->query('select MAX(LENGTH('.$column.')) from '.$this->_tableName);
    }
    // Return filtered records as an array of records
    function some_like($what, $which) {
        $this->db->order_by($this->_keyField, 'asc');
        if (($what == 'period') && ($which < 9)) {
            $this->db->like($what, $which); // special treatment for period
        } else
            $this->db->like($what, $which);
        $query = $this->db->get($this->_tableName);
        return $query->result();
    }
}

{'fraction_non_alphanumeric': 0.14216549295774647, 'fraction_numerical': 0.0022007042253521128, 'mean_word_length': 2.7757475083056478, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 34, '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': '6410091', 'n_tokens_mistral': 645, 'n_tokens_neox': 640, 'n_words': 197}