<commit_before>//
//  ViewAttributes+Convenience.swift
//  Pods
//
//  Created by Gao on 27/04/2017.
//
//

import Foundation


extension ViewAttribute {
    @nonobjc
    public convenience init(identifier: String,
                            applicator: @escaping (_ view: Any, _ value: Any) -> Void,
                            unapplicator:((_ view: Any, _ value: Any) -> Void)?                     = nil,
                            updater:     ((_ view: Any, _ oldValue: Any, _ newValue: Any) -> Void)? = nil) {

        self.init(__identifierString:identifier, applicator:applicator, unapplicator:unapplicator, updater:updater)
    }

}

extension ViewAttributeMap {

    public convenience init(_ attributes: Attribute...) {
        self.init(attributes:attributes);
    }
    public convenience init(attributes: [Attribute] ) {
        self.init(Attribute.convert(attributes: attributes))
    }
}



extension ViewConfiguration {

    public convenience init(_ cls: AnyClass?, attributeMap: ViewAttributeMap? = nil) {
        self.init(viewClass: cls.map(ViewClass.init), viewAttributeMap: attributeMap)
    }

    public convenience init(_ cls: AnyClass = UIView.self, attributes: Attribute... ) {
        self.init(cls, attributes: attributes)
    }

    public convenience init(_ cls: AnyClass = UIView.self, attributes: [Attribute] ) {
        self.init(viewClass: ViewClass(cls), viewAttributeMap: ViewAttributeMap(attributes:attributes))
    }

    public convenience init(_ cls: ViewClass, attributes: [Attribute] ) {
        self.init(viewClass: cls, viewAttributeMap: ViewAttributeMap(attributes:attributes))
    }

}


extension LayoutDimension: ExpressibleByFloatLiteral {

    public convenience init(_ value: CGFloat) {
        self.init(point: value)
    }
    public static func p(_ value: CGFloat) -> LayoutDimension {
        return LayoutDimension(point: value)
    }
    public static func percent(_ value: CGFloat) -> LayoutDimension {
        return LayoutDimension(percent: value)
    }
}



extension LayoutSize {

    public convenience init(size: CGSize) {
        self.init(cgSize: size)
    }
    public convenience init(width: LayoutDimension? = nil,
                     height:LayoutDimension? = nil,
                     minWidth: LayoutDimension? = nil,
                     maxWidth: LayoutDimension? = nil,
                     minHeight: LayoutDimension? = nil,
                     maxHeight: LayoutDimension? = nil) {
        self.init()
        self.width = width
        self.height = height
        self.minWidth = minWidth 
        self.maxWidth = maxWidth 
        self.minHeight = minHeight 
        self.maxHeight = maxHeight 
    }
    public convenience init(width: CGFloat? = nil,
                            height:CGFloat? = nil,
                            minWidth: CGFloat? = nil,
                            maxWidth: CGFloat? = nil,
                            minHeight: CGFloat? = nil,
                            maxHeight: CGFloat? = nil) {
        self.init()
        if let width = width {
            self.width = .p(width)
        }
        if let height = height {
            self.height = .p(height)
        }
        if let minWidth = minWidth {
            self.minWidth = .p(minWidth)
        }
        if let maxWidth = maxWidth {
            self.maxWidth = .p(maxWidth)
        }
        if let minHeight = minHeight {
            self.minHeight = .p(minHeight)
        }
        if let maxHeight = maxHeight {
            self.maxHeight = .p(maxHeight)
        }
    }

    public convenience init(size: CGSize,
                     minWidth: LayoutDimension? = nil,
                     maxWidth: LayoutDimension? = nil,
                     minHeight: LayoutDimension? = nil,
                     maxHeight: LayoutDimension? = nil) {
        self.init()
        self.width = .p(size.width)
        self.height = .p(size.height)
        self.minWidth = minWidth
        self.maxWidth = maxWidth 
        self.minHeight = minHeight
        self.maxHeight = maxHeight
    }

    public static func size(_ size: CGSize) -> LayoutSize {
        return LayoutSize(cgSize: size)
    }
    public static func size(_ width: CGFloat, _ height: CGFloat) -> LayoutSize {
        return LayoutSize(cgSize: CGSize(width: width, height: height))
    }
    public static func height(_ h: CGFloat) -> LayoutSize {
        let s = self.init()
        s.height = .p(h)
        return s
    }
    public static func width(_ w: CGFloat) -> LayoutSize {
        let s = self.init()
        s.width = .p(w)
        return s
    }
}

<commit_msg>remove convenient initializer for LayoutSize<commit_after>//
//  ViewAttributes+Convenience.swift
//  Pods
//
//  Created by Gao on 27/04/2017.
//
//

import Foundation


extension ViewAttribute {
    @nonobjc
    public convenience init(identifier: String,
                            applicator: @escaping (_ view: Any, _ value: Any) -> Void,
                            unapplicator:((_ view: Any, _ value: Any) -> Void)?                     = nil,
                            updater:     ((_ view: Any, _ oldValue: Any, _ newValue: Any) -> Void)? = nil) {

        self.init(__identifierString:identifier, applicator:applicator, unapplicator:unapplicator, updater:updater)
    }

}

extension ViewAttributeMap {

    public convenience init(_ attributes: Attribute...) {
        self.init(attributes:attributes);
    }
    public convenience init(attributes: [Attribute] ) {
        self.init(Attribute.convert(attributes: attributes))
    }
}



extension ViewConfiguration {

    public convenience init(_ cls: AnyClass?, attributeMap: ViewAttributeMap? = nil) {
        self.init(viewClass: cls.map(ViewClass.init), viewAttributeMap: attributeMap)
    }

    public convenience init(_ cls: AnyClass = UIView.self, attributes: Attribute... ) {
        self.init(cls, attributes: attributes)
    }

    public convenience init(_ cls: AnyClass = UIView.self, attributes: [Attribute] ) {
        self.init(viewClass: ViewClass(cls), viewAttributeMap: ViewAttributeMap(attributes:attributes))
    }

    public convenience init(_ cls: ViewClass, attributes: [Attribute] ) {
        self.init(viewClass: cls, viewAttributeMap: ViewAttributeMap(attributes:attributes))
    }

}


extension LayoutDimension: ExpressibleByFloatLiteral {

    public convenience init(_ value: CGFloat) {
        self.init(point: value)
    }
    public static func p(_ value: CGFloat) -> LayoutDimension {
        return LayoutDimension(point: value)
    }
    public static func percent(_ value: CGFloat) -> LayoutDimension {
        return LayoutDimension(percent: value)
    }
}



extension LayoutSize {

    public convenience init(size: CGSize) {
        self.init(cgSize: size)
    }
    public convenience init(width: LayoutDimension? = nil,
                     height:LayoutDimension? = nil,
                     minWidth: LayoutDimension? = nil,
                     maxWidth: LayoutDimension? = nil,
                     minHeight: LayoutDimension? = nil,
                     maxHeight: LayoutDimension? = nil) {
        self.init()
        self.width = width
        self.height = height
        self.minWidth = minWidth 
        self.maxWidth = maxWidth 
        self.minHeight = minHeight 
        self.maxHeight = maxHeight 
    }

    public convenience init(size: CGSize,
                     minWidth: LayoutDimension? = nil,
                     maxWidth: LayoutDimension? = nil,
                     minHeight: LayoutDimension? = nil,
                     maxHeight: LayoutDimension? = nil) {
        self.init()
        self.width = .p(size.width)
        self.height = .p(size.height)
        self.minWidth = minWidth
        self.maxWidth = maxWidth 
        self.minHeight = minHeight
        self.maxHeight = maxHeight
    }

    public static func size(_ size: CGSize) -> LayoutSize {
        return LayoutSize(cgSize: size)
    }
    public static func size(_ width: CGFloat, _ height: CGFloat) -> LayoutSize {
        return LayoutSize(cgSize: CGSize(width: width, height: height))
    }
    public static func height(_ h: CGFloat) -> LayoutSize {
        let s = self.init()
        s.height = .p(h)
        return s
    }
    public static func width(_ w: CGFloat) -> LayoutSize {
        let s = self.init()
        s.width = .p(w)
        return s
    }

    public func width(_ v: LayoutDimension) -> LayoutSize {
        self.width = v
        return self
    }
}


{'fraction_non_alphanumeric': 0.09838576646636031, 'fraction_numerical': 0.0018852362436667844, 'mean_word_length': 2.0325116112897463, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 22, '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': '2131782', 'n_tokens_mistral': 2369, 'n_tokens_neox': 2314, 'n_words': 586}