<commit_before><?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Resource extends Model
{

    use SoftDeletes;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['name', 'author', 'description',
        'date', 'priority', 'resource_id', 'active'];

    /**
     * Get the tutorials associated with this resource
     *
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function tutorials()
    {
        return $this->hasMany('App\Tutorial')->orderBy('priority');
    }

    /**
     * Get the user who added the resource
     *
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function user()
    {
        return $this->belongsTo('App\User');
    }

    /**
     * Get the tags associated with this resource
     *
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function tags()
    {
        return $this->belongsToMany('App\Tag', 'resource_tags')->withTimestamps();
    }

    /**
     * Get the tags associated with this resource
     *
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function disciplines()
    {
        return $this->belongsToMany('App\Tag', 'resource_tags')
            ->where('tags.tagtype_id', 1)
            ->withTimestamps();
    }
<commit_msg>add tag support<commit_after><?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Resource extends Model
{

    use SoftDeletes;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['name', 'author', 'description',
        'date', 'priority', 'resource_id', 'active'];

    /**
     * Get the tutorials associated with this resource
     *
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function tutorials()
    {
        return $this->hasMany('App\Tutorial')->orderBy('priority');
    }

    /**
     * Get the user who added the resource
     *
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function user()
    {
        return $this->belongsTo('App\User');
    }

    /**
     * Get the tags associated with this resource
     *
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function tags()
    {
        return $this->belongsToMany('App\Tag', 'resource_tags')
                    ->withTimestamps();
    }

    /**
     * Get the tags associated with this resource
     *
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function disciplines()
    {
        return $this->belongsToMany('App\Tag', 'resource_tags')
            ->where('tags.tagtype_id', 1)
            ->withTimestamps();
    }

    /**
     * Get the list of tag ids associated with the resource
     *
     * @return array
     */
    public function getTagIds()
    {
        return $this->tags->lists('id')->toArray();
    }

{'fraction_non_alphanumeric': 0.1278698979591837, 'fraction_numerical': 0.0006377551020408163, 'mean_word_length': 2.309071729957806, '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': '5583352', 'n_tokens_mistral': 943, 'n_tokens_neox': 932, 'n_words': 202}