<commit_before>
import Foundation
import CoreLocation
import BrightFutures

class LocationManagerWrapper : NSObject, CLLocationManagerDelegate {
    
    let locationManager = CLLocationManager()
    let promise = Promise<String>()
    
    override init() {
        super.init()
        setup()
    }
    
    func setup(){
        self.locationManager.delegate = self
        self.locationManager.desiredAccuracy = kCLLocationAccuracyBest
        self.locationManager.requestWhenInUseAuthorization()
       
    }
    
    func locationManager(manager: CLLocationManager!, didUpdateLocations locations: [AnyObject]!) {
        CLGeocoder().reverseGeocodeLocation(manager.location, completionHandler: {(placemarks, error)->Void in
            
            self.handleError(error)
            self.handleLocation(placemarks)
            
            })
    }
    
    func handleLocation(placemarks: [AnyObject]) {
        if placemarks.isEmpty {
            println("Error with the data.")
        } else {
            let pm:CLPlacemark = placemarks.first as CLPlacemark
            promise.success(pm.country)
            locationManager.stopUpdatingLocation()
            println("Received country by gps: \(pm.country)")
        }

    }
    
    func getCountry() -> Future<String> {<commit_msg>testcode<commit_after>
import Foundation
import CoreLocation
import BrightFutures


class LocationManagerWrapper : NSObject, CLLocationManagerDelegate {
    
    let locationManager = CLLocationManager()
    let promise = Promise<String>()
    
    override init() {
        super.init()
        setup()
    }
    
    func setup(){
        self.locationManager.delegate = self
        self.locationManager.desiredAccuracy = kCLLocationAccuracyBest
        self.locationManager.requestWhenInUseAuthorization()
       
    }
    
    func locationManager(manager: CLLocationManager!, didUpdateLocations locations: [AnyObject]!) {
        CLGeocoder().reverseGeocodeLocation(manager.location, completionHandler: {(placemarks, error)->Void in
            
            self.handleError(error)
            self.handleLocation(placemarks)
            
            })
    }
    
    func handleLocation(placemarks: [AnyObject]) {
        if placemarks.isEmpty {
            println("Error with the data.")
        } else {
            let pm:CLPlacemark = placemarks.first as CLPlacemark
            println(pm.ISOcountryCode)
            promise.success(pm.country)
            locationManager.stopUpdatingLocation()
            println("Received country by gps: \(pm.country)")
        }

    }
    
    func getCountry() -> Future<String> {
{'fraction_non_alphanumeric': 0.08608266970041714, 'fraction_numerical': 0.0, 'mean_word_length': 2.356234096692112, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '6199113', 'n_tokens_mistral': 692, 'n_tokens_neox': 693, 'n_words': 133}