<commit_before>require 'rubygems'
require 'ap'
require 'selenium-webdriver'
require 'nokogiri'

# patch ap
require_relative 'awesome_print/ostruct'

# common
require_relative 'common/helper'
require_relative 'common/patch'
require_relative 'common/version'
require_relative 'common/element/window'

# ios
require_relative 'ios/helper'
require_relative 'ios/patch'

require_relative 'ios/element/alert'
require_relative 'ios/element/button'
require_relative 'ios/element/generic'
require_relative 'ios/element/textfield'
require_relative 'ios/element/text'
require_relative 'ios/mobile_methods'

# android
require_relative 'android/dynamic'
require_relative 'android/helper'
require_relative 'android/patch'
require_relative 'android/element/alert'
require_relative 'android/element/button'
require_relative 'android/element/generic'
require_relative 'android/element/textfield'
require_relative 'android/element/text'
require_relative 'android/mobile_methods'

# device methods
require_relative 'device/device'
require_relative 'device/touch_actions'
require_relative 'device/multi_touch'

# Fix uninitialized constant Minitest (NameError)
module Minitest
  # Fix superclass mismatch for class Spec
  class Runnable
  end
  class Test < Runnable
  end
  class Spec < Test
  end
end

module Appium
  # Load appium.txt (toml format)
  # the basedir of this file + appium.txt is what's used
  #
  # ```
  # [caps]
  # app = "path/to/app"
  #
  # [appium_lib]
  # port = 8080
  # ```
  #
  # :app is expanded
  # :requires are expanded
  # all keys are converted to symbols
  #
  # @param opts [Hash] file: '/path/to/appium.txt', verbose: true
  # @return [hash] the symbolized hash with updated :app and :require keys
  def self.load_appium_txt opts={}
    raise 'opts must be a hash' unless opts.kind_of? Hash
    raise 'opts must not be empty' if opts.empty?

    file = opts[:file]
    raise 'Must pass file' unless file
    verbose = opts.fetch :verbose, false

    parent_dir = File.dirname file
    toml       = File.expand_path File.join parent_dir, 'appium.txt'
    puts "appium.txt path: #{toml}" if verbose

    toml_exists = File.exists? toml<commit_msg>Fix comment<commit_after>require 'rubygems'
require 'ap'
require 'selenium-webdriver'
require 'nokogiri'

# patch ap
require_relative 'awesome_print/ostruct'

# common
require_relative 'common/helper'
require_relative 'common/patch'
require_relative 'common/version'
require_relative 'common/element/window'

# ios
require_relative 'ios/helper'
require_relative 'ios/patch'

require_relative 'ios/element/alert'
require_relative 'ios/element/button'
require_relative 'ios/element/generic'
require_relative 'ios/element/textfield'
require_relative 'ios/element/text'
require_relative 'ios/mobile_methods'

# android
require_relative 'android/dynamic'
require_relative 'android/helper'
require_relative 'android/patch'
require_relative 'android/element/alert'
require_relative 'android/element/button'
require_relative 'android/element/generic'
require_relative 'android/element/textfield'
require_relative 'android/element/text'
require_relative 'android/mobile_methods'

# device methods
require_relative 'device/device'
require_relative 'device/touch_actions'
require_relative 'device/multi_touch'

# Fix uninitialized constant Minitest (NameError)
module Minitest
  # Fix superclass mismatch for class Spec
  class Runnable
  end
  class Test < Runnable
  end
  class Spec < Test
  end
end

module Appium
  # Load appium.txt (toml format)
  # the basedir of this file + appium.txt is what's used
  #
  # ```
  # [caps]
  # app = "path/to/app"
  #
  # [appium_lib]
  # port = 8080
  # ```
  #
  # :app is expanded
  # :require is expanded
  # all keys are converted to symbols
  #
  # @param opts [Hash] file: '/path/to/appium.txt', verbose: true
  # @return [hash] the symbolized hash with updated :app and :require keys
  def self.load_appium_txt opts={}
    raise 'opts must be a hash' unless opts.kind_of? Hash
    raise 'opts must not be empty' if opts.empty?

    file = opts[:file]
    raise 'Must pass file' unless file
    verbose = opts.fetch :verbose, false

    parent_dir = File.dirname file
    toml       = File.expand_path File.join parent_dir, 'appium.txt'
    puts "appium.txt path: #{toml}" if verbose

    toml_exists = File.exists? toml
{'fraction_non_alphanumeric': 0.0962962962962963, 'fraction_numerical': 0.001851851851851852, 'mean_word_length': 4.626302083333333, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '4004578', 'n_tokens_mistral': 1381, 'n_tokens_neox': 1359, 'n_words': 380}