<commit_before><?php
class Photo_model extends CI_Model {

    public function __construct()
    {
        $this->load->database();
    }

    public function get_category($slug = FALSE)
    {
        if ($slug === FALSE)
        {
            $this->db->select('id, category');
            $this->db->group_by('category');
            $query = $this->db->get('swan_photo');
            return $query->result_array();
        }
        $query = $this->db->get_where('swan_photo', array('id' => $slug));
        return $query->row_array();
    }

    public function get_subcategory($slug = FALSE)
    {
        if ($slug === FALSE)
        {
            $this->db->group_by('subcategory');
            $query = $this->db->get('swan_photo');
            return $query->result_array();
        }
        $query = $this->db->get_where('swan_photo', array('id' => $slug));
        return $query->row_array();
    }

    public function get_photos($id = FALSE)
    {
        if ($id === FALSE)
        {
            $query = $this->db->get('swan_photo');
            return $query->result_array();
        }
        $query = $this->db->query("SELECT * FROM swan_photo WHERE subcategory=(select subcategory from swan_photo where id=$id)");
        return $query->result_array();
    }

    public function get_waterfall($page = FALSE)
    {
        //$page = json_encode($this->input->post('page'));
        $page = 0;
        $num = 10;
        $offset = $page * $num;

        if ($page === FALSE)
        {
            $query = $this->db->get('swan_photo');
            return $query->result_array();
        }
        $query = $this->db->query("SELECT * FROM swan_photo limit $offset, $num");
        return $query->result_array();
    }
}<commit_msg>initial import<commit_after><?php
class Photo_model extends CI_Model {

    public function __construct()
    {
        $this->load->database();
    }

    public function get_category($id = FALSE)
    {
        if ($id === FALSE)
        {
            $this->db->select('id, category');
            $this->db->group_by('category');
            $query = $this->db->get('swan_photo');
            return $query->result_array();
        }
        $query = $this->db->get_where('swan_photo', array('id' => $id));
        return $query->row_array();
    }

    public function get_subcategory($id = FALSE)
    {
        if ($id === FALSE)
        {
            $this->db->group_by('subcategory');
            $query = $this->db->get('swan_photo');
            return $query->result_array();
        }
        $query = $this->db->get_where('swan_photo', array('id' => $id));
        return $query->row_array();
    }

    public function get_photos($id = FALSE)
    {
        if ($id === FALSE)
        {
            $query = $this->db->get('swan_photo');
            return $query->result_array();
        }
        $query = $this->db->query("SELECT * FROM swan_photo WHERE subcategory=(select subcategory from swan_photo where id=$id)");
        return $query->result_array();
    }

    public function get_waterfall($page = FALSE)
    {
        //$page = json_encode($this->input->post('page'));
        $page = 0;
        $num = 10;
        $offset = $page * $num;

        if ($page === FALSE)
        {
            $query = $this->db->get('swan_photo');
            return $query->result_array();
        }
        //$query = $this->db->query("SELECT * FROM swan_photo limit $offset, $num");
        $this->db->limit($num, $offset);
        $query = $this->db->get('swan_photo');
        return $query->result_array();
    }
}
{'fraction_non_alphanumeric': 0.17696393625943527, 'fraction_numerical': 0.0016773832820799553, 'mean_word_length': 2.0194092827004217, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 79, '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': '5917220', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1082, 'n_words': 205}