<commit_before><?php

namespace LaravelArab\DataSource;

use Illuminate\Config\Repository;
use LaravelArab\DataSource\Models\Country;
use LaravelArab\DataSource\Models\State;
use LaravelArab\DataSource\Models\City;

class DataSource
{
    /**
     * Config repository.
     *
     * @var \Illuminate\Config\Repository
     */
    protected $config;
    /**
     * Creates new instance.
     *
     * @throws UnsupportedLocaleException
     */
    public function __construct()
    {
        $this->app = app();
        $this->config = $this->app['config'];
    }
    // Countries
    public function countries(){
        return Country::All();
    }
    public function country($id){
        return Country::find($id);
    }
    public function countryByCode($code){
        return Country::where('code',$code)->first();
    }
    public function countryByName($name){
        return Country::where('name','like',"%".$name."%")->first();
    }
    public function countriesByName($name){
        return Country::where('name','like',"%".$name."%")->get();
    }
    // States
    public function states(){
        return State::All();
    }
    public function state($id){
        return State::find($id);
    }
    public function stateByCode($code){
        return State::where('code',$code)->first();
    }
    public function stateByName($name){
        return State::where('name','like',"%".$name."%")->first();
    }
    public function statesByName($name){
        return State::where('name','like',"%".$name."%")->get();
    }
    // Cities    
    public function cities(){
        return City::All();
    }
    public function city($id){
        return City::find($id);
    }
    public function cityByCode($code){
        return City::where('code',$code)->first();
    }
    public function cityByName($name){
        return City::where('name','like',"%".$name."%")->first();
    }
    public function citiesByName($name){
        return City::where('name','like',"%".$name."%")->get();
    }

}<commit_msg>Delete some useless functions<commit_after><?php

namespace LaravelArab\DataSource;

use Illuminate\Config\Repository;
use LaravelArab\DataSource\Models\Country;
use LaravelArab\DataSource\Models\State;
use LaravelArab\DataSource\Models\City;

class DataSource
{
    /**
     * Config repository.
     *
     * @var \Illuminate\Config\Repository
     */
    protected $config;
    /**
     * Creates new instance.
     *
     * @throws UnsupportedLocaleException
     */
    public function __construct()
    {
        $this->app = app();
        $this->config = $this->app['config'];
    }
    // Countries
    public function countries(){
        return Country::All();
    }
    public function country($id){
        return Country::find($id);
    }
    public function countryByCode($code){
        return Country::where('code',$code)->first();
    }
    public function countryByName($name){
        return Country::where('name','like',"%".$name."%")->first();
    }
    // States
    public function states(){
        return State::All();
    }
    public function state($id){
        return State::find($id);
    }
    public function stateByName($name){
        return State::where('name','like',"%".$name."%")->first();
    }
    // Cities    
    public function cities(){
        return City::All();
    }
    public function city($id){
        return City::find($id);
    }
    public function cityByName($name){
        return City::where('name','like',"%".$name."%")->first();
    }

}
{'fraction_non_alphanumeric': 0.17320819112627986, 'fraction_numerical': 0.0, 'mean_word_length': 2.7060063224446784, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, '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': '5856992', 'n_tokens_mistral': 995, 'n_tokens_neox': 1011, 'n_words': 196}