<commit_before>def init
  id = ENV['PIXIV_ID'] or warn 'PIXIV_ID is not set'
  password = ENV['PIXIV_PASSWORD'] or warn 'PIXIV_PASSWORD is not set'
  abort unless id && password

  proxy =
    begin
      if ENV['HTTP_PROXY']
        host, port = ENV['HTTP_PROXY'].split(/:/)
        [host, (port || 80).to_i]
      else
        nil
      end
    end

  require 'bundler/setup'
  Bundler.require

  $pixiv = Pixiv.client(id, password) do |agent|
    agent.user_agent_alias = 'Mac Safari'
    agent.set_proxy(*proxy) if proxy
  end

  Kernel.const_set(:P, $pixiv)
  Kernel.const_set(:M, $pixiv.member)
  Kernel.const_set(:IL, $pixiv.illust_list)
  Kernel.const_set(:BL, $pixiv.bookmark_list)
  Kernel.const_set(:PBL, $pixiv.private_bookmark_list)
  Kernel.const_set(:Is, $pixiv.illusts($pixiv.member))
  Kernel.const_set(:Bs, $pixiv.bookmarks($pixiv.member))
  Kernel.const_set(:PBs, $pixiv.private_bookmarks)
end

def I(id)
  $pixiv.illust(id)
end

def M(id)
  $pixiv.member(id)
end

def IL(member, p = 1)
  $pixiv.illust_list(member, p)
end

def BL(member, p = 1)
  $pixiv.bookmark_list(member, p)
end

def PBL(p = 1)
  $pixiv.private_bookmark_list($pixiv.member_id, p)
end

def Is(list_or_member)
  $pixiv.illusts(list_or_member)
end

def Bs(list_or_member)
  $pixiv.bookmarks(list_or_member)
end<commit_msg>console_helper.rb catches up with the new Client<commit_after>def init
  id = ENV['PIXIV_ID'] or warn 'PIXIV_ID is not set'
  password = ENV['<PASSWORD>_PASSWORD'] or warn 'PIXIV_PASSWORD is not set'
  abort unless id && password

  proxy =
    begin
      if ENV['HTTP_PROXY']
        host, port = ENV['HTTP_PROXY'].split(/:/)
        [host, (port || 80).to_i]
      else
        nil
      end
    end

  require 'bundler/setup'
  Bundler.require

  $pixiv = Pixiv.client(id, password) do |agent|
    agent.user_agent_alias = 'Mac Safari'
    agent.set_proxy(*proxy) if proxy
  end

  Kernel.const_set(:P, $pixiv)
  Kernel.const_set(:M, $pixiv.member)
  Kernel.const_set(:WL, $pixiv.work_list)
  Kernel.const_set(:BL, $pixiv.bookmark_list)
  Kernel.const_set(:PBL, $pixiv.private_bookmark_list)
  Kernel.const_set(:Ws, $pixiv.works)
  Kernel.const_set(:Bs, $pixiv.bookmarks)
  Kernel.const_set(:PBs, $pixiv.private_bookmarks)
end

def M(id)
  $pixiv.member(id)
end

def I(id)
  $pixiv.illust(id)
end

def WL(member, p = 1)
  $pixiv.work_list(member, p)
end

def BL(member, p = 1)
  $pixiv.bookmark_list(member, p)
end

def PBL(p = 1)
  $pixiv.private_bookmark_list(p)
end

def Ws(member)
  $pixiv.works(member)
end

def Bs(member)
  $pixiv.bookmarks(member)
end
{'fraction_non_alphanumeric': 0.13608087091757387, 'fraction_numerical': 0.0038880248833592537, 'mean_word_length': 3.8547169811320754, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '5151411', 'n_tokens_mistral': 1093, 'n_tokens_neox': 1057, 'n_words': 212}