<commit_before>//
//  Flag.swift
//  ForecastIO
//
//  Created by <NAME> on 7/19/15.
//  Copyright (c) 2015 Satyam. All rights reserved.
//

import Foundation

/// A class that contains various metadata information related to a `Forecast` request.
public struct Flag {
    
    /// The presence of this property indicates that the Dark Sky data source supports the `Forecast`'s location, but a temporary error (such as a radar station being down for maintenance) has made the data unavailable.
    public let darkSkyUnavailable: Bool?
    
    /// Contains the IDs for each radar station used in servicing the `Forecast` request.
    public let darkSkyStations: Array<String>?
    
    /// Contains the IDs for each `DataPoint` station used in servicing this request.
    public let dataPointStations: Array<String>?
    
    /// Contains the IDs for each ISD station used in servicing this request.
    public let isdStations: Array<String>?
    
    /// Contains the IDs for each LAMP station used in servicing this request.
    public let lampStations: Array<String>?
    
    /// Contains the IDs for each METAR station used in servicing this request.
    public let metarStations: Array<String>?
    
    /// The presence of this property indicates that data from api.met.no was used to facilitate this request (as per their license agreement).
    public let metnoLicense: Bool?
    
    /// Contains the IDs for each data station used in servicing this request.
    public let sources: Array<String>
    
    /// The presence of this property indicates which units were used for the data in this request. `US` units are default.
    public let units: Units
    
    /**
        Creates a new `Flag` from a JSON object.
     
        - parameter fromJSON: A JSON object with keys corresponding to the `Flag`'s properties.
     
        - returns: A new `Flag` filled with data from the given JSON object.
    */
    public init(fromJSON json: NSDictionary) {
        darkSkyUnavailable = json["darksky-unavailable"] as? Bool
        darkSkyStations = json["darksky-stations"] as? Array<String>
        dataPointStations = json["datapoint-stations"] as? Array<String>
        isdStations = json["isd-stations"] as? Array<String>
        lampStations = json["lamp-stations"] as? Array<String>
        metarStations = json["metar-stations"] as? Array<String>
        metnoLicense = json["metno-license"] as? Bool
        sources = json["sources"] as! Array<String>
        units = Units(rawValue: json["units"] as! String)!
    }
}<commit_msg>Updated init docs for Flag<commit_after>//
//  Flag.swift
//  ForecastIO
//
//  Created by <NAME> on 7/19/15.
//  Copyright (c) 2015 Satyam. All rights reserved.
//

import Foundation

/// A class that contains various metadata information related to a `Forecast` request.
public struct Flag {
    
    /// The presence of this property indicates that the Dark Sky data source supports the `Forecast`'s location, but a temporary error (such as a radar station being down for maintenance) has made the data unavailable.
    public let darkSkyUnavailable: Bool?
    
    /// Contains the IDs for each radar station used in servicing the `Forecast` request.
    public let darkSkyStations: Array<String>?
    
    /// Contains the IDs for each `DataPoint` station used in servicing this request.
    public let dataPointStations: Array<String>?
    
    /// Contains the IDs for each ISD station used in servicing this request.
    public let isdStations: Array<String>?
    
    /// Contains the IDs for each LAMP station used in servicing this request.
    public let lampStations: Array<String>?
    
    /// Contains the IDs for each METAR station used in servicing this request.
    public let metarStations: Array<String>?
    
    /// The presence of this property indicates that data from api.met.no was used to facilitate this request (as per their license agreement).
    public let metnoLicense: Bool?
    
    /// Contains the IDs for each data station used in servicing this request.
    public let sources: Array<String>
    
    /// The presence of this property indicates which units were used for the data in this request. `US` units are default.
    public let units: Units
    
    /// Creates a new `Flag` from a JSON object.
    ///
    /// - parameter json: A JSON object with keys corresponding to the `Flag`'s properties.
    ///
    /// - returns: A new `Flag` filled with data from the given JSON object.
    public init(fromJSON json: NSDictionary) {
        darkSkyUnavailable = json["darksky-unavailable"] as? Bool
        darkSkyStations = json["darksky-stations"] as? Array<String>
        dataPointStations = json["datapoint-stations"] as? Array<String>
        isdStations = json["isd-stations"] as? Array<String>
        lampStations = json["lamp-stations"] as? Array<String>
        metarStations = json["metar-stations"] as? Array<String>
        metnoLicense = json["metno-license"] as? Bool
        sources = json["sources"] as! Array<String>
        units = Units(rawValue: json["units"] as! String)!
    }
}
{'fraction_non_alphanumeric': 0.08722986247544204, 'fraction_numerical': 0.003536345776031434, 'mean_word_length': 2.925212027756361, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '6110687', 'n_tokens_mistral': 1418, 'n_tokens_neox': 1374, 'n_words': 582}