<commit_before>import Foundation

extension Array {
  var size: Int { return self.count }
  mutating func add(element: Element) {
    self.append(element)
  }
  mutating func addAll(other: Array) {
    for element in other {
      self.append(element)
    }
  }
  func get(index: Int) -> Element {
    return self[index]
  }
}

extension Dictionary {
  var size: Int { return self.count }
  mutating func put(key: Key, _ value: Value) {
    self[key] = value
  }
  mutating func putAll(other: Dictionary) {
    for (key, value) in other {
      self.updateValue(value, forKey: key)
    }
  }
  func isEmpty() -> Bool {
    return self.isEmpty
  }
  mutating func remove(key: Key) -> Value? {
    return self.removeValueForKey(key)
  }
}

extension Set {
  var size: Int { return self.count }
  mutating func add(element: Element) {
    self.insert(element)
  }
  mutating func addAll(other: Set) {
    for element in other {
      self.insert(element)
    }
  }
  func isEmpty() -> Bool {
    return self.isEmpty
  }
}

extension String {
  var length: Int { return characters.count }
  func substring(startIndex: Int, _ endIndex: Int) -> String {
    let start = self.startIndex.advancedBy(startIndex)
    let end = self.startIndex.advancedBy(endIndex)
    return self.substringWithRange(Range<String.Index>(start: start, end: end))
  }
  func substring(startIndex: Int) -> String {
    return substring(startIndex, self.length)
  }
  func contains(string: String) -> Bool {
    return self.rangeOfString(string) != nil
  }
  func replace(target: String, _ withString: String) -> String {
    return self.stringByReplacingOccurrencesOfString(target,
                                                     withString: withString,
                                                     options: NSStringCompareOptions.LiteralSearch,
                                                     range: nil)
  }
  func isEmpty() -> Bool {
    return isEmpty
  }
}

enum Exception: ErrorType {
  case NumberFormat
}
<commit_msg>Update kotlift.swift for clear() calls<commit_after>import Foundation

extension Array {
  var size: Int { return self.count }
  mutating func add(element: Element) {
    self.append(element)
  }
  mutating func addAll(other: Array) {
    for element in other {
      self.append(element)
    }
  }
  func get(index: Int) -> Element {
    return self[index]
  }
  mutating func clear() {
    self.removeAll()
  }
}

extension Dictionary {
  var size: Int { return self.count }
  mutating func put(key: Key, _ value: Value) {
    self[key] = value
  }
  mutating func putAll(other: Dictionary) {
    for (key, value) in other {
      self.updateValue(value, forKey: key)
    }
  }
  func isEmpty() -> Bool {
    return self.isEmpty
  }
  mutating func remove(key: Key) -> Value? {
    return self.removeValueForKey(key)
  }
  mutating func clear() {
    self.removeAll()
  }
}

extension Set {
  var size: Int { return self.count }
  mutating func add(element: Element) {
    self.insert(element)
  }
  mutating func addAll(other: Set) {
    for element in other {
      self.insert(element)
    }
  }
  func isEmpty() -> Bool {
    return self.isEmpty
  }
  mutating func clear() {
    self.removeAll()
  }
}

extension String {
  var length: Int { return characters.count }
  func substring(startIndex: Int, _ endIndex: Int) -> String {
    let start = self.startIndex.advancedBy(startIndex)
    let end = self.startIndex.advancedBy(endIndex)
    return self.substringWithRange(Range<String.Index>(start: start, end: end))
  }
  func substring(startIndex: Int) -> String {
    return substring(startIndex, self.length)
  }
  func contains(string: String) -> Bool {
    return self.rangeOfString(string) != nil
  }
  func replace(target: String, _ withString: String) -> String {
    return self.stringByReplacingOccurrencesOfString(target,
                                                     withString: withString,
                                                     options: NSStringCompareOptions.LiteralSearch,
                                                     range: nil)
  }
  func isEmpty() -> Bool {
    return isEmpty
  }
}

enum Exception: ErrorType {
  case NumberFormat
}

{'fraction_non_alphanumeric': 0.10233222275107091, 'fraction_numerical': 0.0, 'mean_word_length': 2.419853539462978, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4350263', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1241, 'n_words': 328}