<commit_before>//===--- Collections.swift ------------------------------------------------------===//
//Copyright (c) 2016 <NAME> (dileping)
//
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//===----------------------------------------------------------------------===//

import Foundation

#if swift(>=3.0)
#else
    public typealias Collection = CollectionType
    public typealias Sequence = SequenceType
    public typealias IteratorProtocol = GeneratorType
    public typealias OptionSet = OptionSetType
    
    public extension Sequence where Generator.Element == String {
        public func joined(separator separator: String) -> String {
            return self.joinWithSeparator(separator)
        }
    }
    
    public extension BidirectionalIndexType {
        public func advanced(by n: Self.Distance) -> Self {
            return self.advancedBy(n)
        }
        
        public func advanced(by n: Self.Distance, limit: Self) -> Self {
            return self.advancedBy(n, limit: limit)
        }
    
        public func distance(to other: Self) -> Distance {
            return self.distanceTo(other)
        }
    }
    
    extension Array {
        /// Append the elements of `newElements` to `self`.
        ///
        /// - Complexity: O(*length of result*).
        public mutating func append<S : Sequence where S.Generator.Element == Element>(contentsOf newElements: S) {
            self.appendContentsOf(newElements)
        }
        
        /// Append the elements of `newElements` to `self`.
        ///
        /// - Complexity: O(*length of result*).
        //public mutating func append<C : Collection where C.Generator.Element == Element>(contentsOf newElements: C) {
        //    return self.appendContentsOf(newElements)
        //}
        
        public mutating func insert<C : Collection where C.Generator.Element == Element>(contentsOf newElements: C, at i: Int) {
            self.insertContentsOf(newElements, at: i)
        }
        
        /// Insert `newElement` at index `i`.
        ///
        /// - Precondition: `i <= count`.
        ///
        /// - Complexity: O(`self.count`).
        public mutating func insert(newElement: Element, at i: Int) {
            return self.insert(newElement, atIndex: i)
        }
        
        /// Remove and return the element at index `i`.<commit_msg>Added constructor to Array<commit_after>//===--- Collections.swift ------------------------------------------------------===//
//Copyright (c) 2016 <NAME> (dileping)
//
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//===----------------------------------------------------------------------===//

import Foundation

#if swift(>=3.0)
#else
    public typealias Collection = CollectionType
    public typealias Sequence = SequenceType
    public typealias IteratorProtocol = GeneratorType
    public typealias OptionSet = OptionSetType
    
    public extension Sequence where Generator.Element == String {
        public func joined(separator separator: String) -> String {
            return self.joinWithSeparator(separator)
        }
    }
    
    public extension BidirectionalIndexType {
        public func advanced(by n: Self.Distance) -> Self {
            return self.advancedBy(n)
        }
        
        public func advanced(by n: Self.Distance, limit: Self) -> Self {
            return self.advancedBy(n, limit: limit)
        }
    
        public func distance(to other: Self) -> Distance {
            return self.distanceTo(other)
        }
    }
    
    extension Array {
        /// Construct a Array of `count` elements, each initialized to
        /// `repeating` value.
        public init(repeating repeatedValue: Element, count: Int) {
            self.init(count: count, repeatedValue: repeatedValue)
        }
        /// Append the elements of `newElements` to `self`.
        ///
        /// - Complexity: O(*length of result*).
        public mutating func append<S : Sequence where S.Generator.Element == Element>(contentsOf newElements: S) {
            self.appendContentsOf(newElements)
        }
        
        /// Append the elements of `newElements` to `self`.
        ///
        /// - Complexity: O(*length of result*).
        //public mutating func append<C : Collection where C.Generator.Element == Element>(contentsOf newElements: C) {
        //    return self.appendContentsOf(newElements)
        //}
        
        public mutating func insert<C : Collection where C.Generator.Element == Element>(contentsOf newElements: C, at i: Int) {
            self.insertContentsOf(newElements, at: i)
        }
        
        /// Insert `newElement` at index `i`.
        ///
        /// - Precondition: `i <= count`.
        ///
        /// - Complexity: O(`self.count`).
        public mutating func insert(newElement: Element, at i: Int) {
            return self.insert(newElement, atIndex: i)
        }
        
        /// Remove and return the element at index `i`.
{'fraction_non_alphanumeric': 0.14563432210491034, 'fraction_numerical': 0.0033517680576504107, 'mean_word_length': 1.9384539635647464, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '749215', 'n_tokens_mistral': 1508, 'n_tokens_neox': 1471, 'n_words': 511}