<commit_before><?php

namespace WpMvc
{
  class Blog extends \WpMvc\BaseModel
  {
    public static $table_name = 'wp_blogs';
    public static $class_name = '\WpMvc\Blog';
    public static $id_column = 'blog_id';
    public static $name_column = 'path';
    public $option;

    public function init_relations()
    {
      $options = Option::find_by_blog_id( $this->{static::$id_column} );

      foreach ( $options as $option ) {
        if ($option->option_name)
          $this->option->{$option->option_name} = $option;
      }
    }

    public static function find_by_path($path)
    {
      global $wpdb;

      $table_name = static::$table_name;

      $query = "SELECT * FROM $table_name WHERE path = '$path' ORDER BY blog_id;";

      return self::query( $query );
    }

    public static function find_public($id)
    {
      global $wpdb;

      $table_name = static::$table_name;

      $query = "SELECT * FROM $table_name WHERE blog_id = $id AND public = 1 ORDER BY blog_id;";

      return self::query( $query );
    }

    public static function find_public_recently_updated($num = 20)
    {
      $table_name = static::$table_name;

      $query = "SELECT * FROM $table_name WHERE public = 1 ORDER BY last_updated DESC LIMIT $num;";

      return self::query( $query );
    }

    public static function find_public_recently_created($num = 20)
    {
      $table_name = static::$table_name;

      $query = "SELECT * FROM $table_name WHERE public = 1 ORDER BY registered DESC LIMIT $num;";

      return self::query( $query );
    }

    public static function find_recently_updated($num = 20)
    {
      $table_name = static::$table_name;

      $query = "SELECT * FROM $table_name ORDER BY last_updated DESC LIMIT $num;";
<commit_msg>Don't include deleted blogs<commit_after><?php

namespace WpMvc
{
  class Blog extends \WpMvc\BaseModel
  {
    public static $table_name = 'wp_blogs';
    public static $class_name = '\WpMvc\Blog';
    public static $id_column = 'blog_id';
    public static $name_column = 'path';
    public $option;

    public function init_relations()
    {
      $options = Option::find_by_blog_id( $this->{static::$id_column} );

      foreach ( $options as $option ) {
        if ($option->option_name)
          $this->option->{$option->option_name} = $option;
      }
    }

    public static function find_by_path($path)
    {
      global $wpdb;

      $table_name = static::$table_name;

      $query = "SELECT * FROM $table_name WHERE path = '$path' ORDER BY blog_id;";

      return self::query( $query );
    }

    public static function find_public($id)
    {
      global $wpdb;

      $table_name = static::$table_name;

      $query = "SELECT * FROM $table_name WHERE blog_id = $id AND public = 1 AND deleted = 0 ORDER BY blog_id;";

      return self::query( $query );
    }

    public static function find_public_recently_updated($num = 20)
    {
      $table_name = static::$table_name;

      $query = "SELECT * FROM $table_name WHERE public = 1 AND deleted = 0 ORDER BY last_updated DESC LIMIT $num;";

      return self::query( $query );
    }

    public static function find_public_recently_created($num = 20)
    {
      $table_name = static::$table_name;

      $query = "SELECT * FROM $table_name WHERE public = 1 AND deleted = 0 ORDER BY registered DESC LIMIT $num;";

      return self::query( $query );
    }

    public static function find_recently_updated($num = 20)
    {
      $table_name = static::$table_name;

      $query = "SELECT * FROM $table_name ORDER BY last_updated DESC LIMIT $num;";

{'fraction_non_alphanumeric': 0.12017887087758525, 'fraction_numerical': 0.005869200670765791, 'mean_word_length': 2.9072052401746724, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '2919966', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1116, 'n_words': 306}