<commit_before>require 'active_support/core_ext/module/attribute_accessors'

module Evercam
  module Services
    mattr_accessor :dalli_cache
    mattr_accessor :snapshot_bucket
    mattr_accessor :public_bucket

    options = { :namespace => "app_v1", :compress => true, :expires_in => 300, value_max_bytes: 20000000 }
    if ENV["MEMCACHEDCLOUD_SERVERS"]
      self.dalli_cache = Dalli::Client.new(ENV["MEMCACHEDCLOUD_SERVERS"].split(','), :username => ENV["MEMCACHEDCLOUD_USERNAME"], :password => ENV["MEMCACHEDCLOUD_PASSWORD"])
    else
      self.dalli_cache = Dalli::Client.new('127.0.0.1:11211', options)
    end

    if Evercam::Config.env == :development
      if !system('lsof -i:10453')
        system('2>/dev/null 1>&2 fakes3 --root=/tmp/fakes3 --port=10453 &')
        abort 'FakeS3 was not running and was started automatically, start the server again to continue'
      end
      s3 = AWS::S3.new(
        :access_key_id => Evercam::Config[:amazon][:access_key_id],<commit_msg>Added a way to skip fakes3 initialization by passing NO_FAKE_S3=true<commit_after>require 'active_support/core_ext/module/attribute_accessors'

module Evercam
  module Services
    mattr_accessor :dalli_cache
    mattr_accessor :snapshot_bucket
    mattr_accessor :public_bucket

    options = { :namespace => "app_v1", :compress => true, :expires_in => 300, value_max_bytes: 20000000 }
    if ENV["MEMCACHEDCLOUD_SERVERS"]
      self.dalli_cache = Dalli::Client.new(ENV["MEMCACHEDCLOUD_SERVERS"].split(','), :username => ENV["MEMCACHEDCLOUD_USERNAME"], :password => ENV["<PASSWORD>CLOUD_PASSWORD"])
    else
      self.dalli_cache = Dalli::Client.new('127.0.0.1:11211', options)
    end

    if Evercam::Config.env == :development && ENV['NO_FAKE_S3'].blank?
      if !system('lsof -i:10453')
        system('2>/dev/null 1>&2 fakes3 --root=/tmp/fakes3 --port=10453 &')
        abort 'FakeS3 was not running and was started automatically, start the server again to continue'
      end
      s3 = AWS::S3.new(
        :access_key_id => Evercam::Config[:amazon][:access_key_id],
{'fraction_non_alphanumeric': 0.13201160541586074, 'fraction_numerical': 0.04110251450676983, 'mean_word_length': 4.237974683544304, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 2, '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': '7508535', 'n_tokens_mistral': 768, 'n_tokens_neox': 717, 'n_words': 139}