<commit_before>class Agent

  attr_accessor :id, :name, :languages, :skills, :activity, :visibility, :call_id,
                :locked, :availability, :idle_since, :mutex, :unlock_scheduled


  def handle_message
    if (user = User.where(name: name).first)
      user.send_user_update_to_clients
    end
  end


  def language=(langs)
    @languages = langs
  end


  def skill=(skills)
    @skills = skills
  end


  class << self

    def create_fake
      raise unless Rails.env.development?
      fn = Faker::Name.name

      User.create_from(
        full_name:    fn,
        roles:        ['agent'],
        password:     '<PASSWORD>',
        confirmation: '<PASSWORD>',
        email:        email_for(fn),
        languages:    samples_for(:langs),
        skills:       samples_for(:skills)
      )
    end


    def email_for(fn)
      fn.downcase.gsub(' ', '-').gsub(/[.']/, '') + '@mail.com'
    end


    def samples_for(sym)
      [send(sym).next, send(sym).next, send(sym).next].sample(1 + rand(3))
    end


    def langs
      @memo_langs ||= WimConfig.languages.keys.cycle
    end


    def skills
      @memo_skills ||= WimConfig.skills.keys.cycle
    end
  end<commit_msg>add locale for fake agents<commit_after>class Agent

  attr_accessor :id, :name, :languages, :skills, :activity, :visibility, :call_id,
                :locked, :availability, :idle_since, :mutex, :unlock_scheduled


  def handle_message
    if (user = User.where(name: name).first)
      user.send_user_update_to_clients
    end
  end


  def language=(langs)
    @languages = langs
  end


  def skill=(skills)
    @skills = skills
  end


  class << self

    def create_fake
      raise unless Rails.env.development?
      fn = Faker::Name.name

      User.create_from(
        full_name:    fn,
        roles:        ['agent'],
        password:     '<PASSWORD>',
        confirmation: 'P4ssw0rd',
        email:        email_for(fn),
        locale:       ui_locales.next,
        languages:    samples_for(:langs),
        skills:       samples_for(:skills)
      )
    end


    def email_for(fn)
      fn.downcase.gsub(' ', '-').gsub(/[.']/, '') + '@mail.com'
    end


    def samples_for(sym)
      [send(sym).next, send(sym).next, send(sym).next].sample(1 + rand(3))
    end


    def ui_locales
      @memo_loc ||= WimConfig.ui_locales.cycle
    end


    def langs
      @memo_langs ||= WimConfig.languages.keys.cycle
    end


    def skills
      @memo_skills ||= WimConfig.skills.keys.cycle
    end
  end
{'fraction_non_alphanumeric': 0.1251987281399046, 'fraction_numerical': 0.0023847376788553257, 'mean_word_length': 2.2186700767263425, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 6, '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': '1504513', 'n_tokens_mistral': 886, 'n_tokens_neox': 850, 'n_words': 176}