<commit_before>//
//  CLLocationManager.swift
//  ZamzamKit
//
//  Created by <NAME> on 2/18/16.
//  Copyright © 2016 Zamzam Inc. All rights reserved.
//

import Foundation
import CoreLocation

public extension CLLocationManager {
    
    /// Determines if location services is enabled and authorized for always or when in use.
    static var isAuthorized: Bool {
        return CLLocationManager.locationServicesEnabled()
            && CLLocationManager.authorizationStatus()
                .within([.authorizedAlways, .authorizedWhenInUse])
    }
}<commit_msg>Enable macOS support for location authorized status<commit_after>//
//  CLLocationManager.swift
//  ZamzamKit
//
//  Created by <NAME> on 2/18/16.
//  Copyright © 2016 Zamzam Inc. All rights reserved.
//

import Foundation
import CoreLocation

public extension CLLocationManager {
    
    /// Determines if location services is enabled and authorized for always or when in use.
    static var isAuthorized: Bool {
        var statuses: [CLAuthorizationStatus] = [.authorizedAlways]
        
        #if os(iOS) || os(watchOS) || os(tvOS)
            statuses.append(.authorizedWhenInUse)
        #elseif os(macOS)
            statuses.append(.authorized)
        #endif
        
        return CLLocationManager.locationServicesEnabled()
            && CLLocationManager.authorizationStatus().within(statuses)
    }
}
{'fraction_non_alphanumeric': 0.0918293564714389, 'fraction_numerical': 0.013015184381778741, 'mean_word_length': 2.7204301075268815, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2490786', 'n_tokens_mistral': 399, 'n_tokens_neox': 377, 'n_words': 109}