<commit_before><?php namespace ALttP;

use Illuminate\Database\Eloquent\Model;
use Hashids\Hashids;

class Seed extends Model {
	protected $stored_patch;

	public static function boot() {
		parent::boot();

		$hasher = new Hashids('vt', 10);

		static::saved(function($seed) {
			if ($this->stored_patch) {
				$sha1 = sha1($this->stored_patch);
				$patch = Patch::firstOrCreate([
					'sha1' => $sha1
				]);
				$patch->patch = $this->stored_patch;
				$patch->save();

				$this->patch()->associate($patch);
			}
		});

		static::created(function($seed) use ($hasher) {
			$seed->hash = $hasher->encode($seed->id);<commit_msg>context<commit_after><?php namespace ALttP;

use Illuminate\Database\Eloquent\Model;
use Hashids\Hashids;

class Seed extends Model {
	protected $stored_patch;

	public static function boot() {
		parent::boot();

		$hasher = new Hashids('vt', 10);

		static::saved(function($seed) {
			if ($seed->stored_patch) {
				$sha1 = sha1($seed->stored_patch);
				$patch = Patch::firstOrCreate([
					'sha1' => $sha1
				]);
				$patch->patch = $seed->stored_patch;
				$patch->save();

				$seed->stored_patch = null;
				$seed->patch()->associate($patch);
				$seed->save();
			}
		});

		static::created(function($seed) use ($hasher) {
			$seed->hash = $hasher->encode($seed->id);
{'fraction_non_alphanumeric': 0.189272030651341, 'fraction_numerical': 0.009195402298850575, 'mean_word_length': 3.9657794676806084, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '2037472', 'n_tokens_mistral': 542, 'n_tokens_neox': 457, 'n_words': 82}