<commit_before>//
//  PhotoListFetcher.swift
//  localview
//
//  Created by <NAME> on 8/13/15.
//  Copyright (c) 2015 sparkwing. All rights reserved.
//

import UIKit
import Alamofire
import SwiftyJSON

protocol PhotoListFetcherDelegate {
    func photoListFetcherDidFinish(photoListFetcher : PhotoListFetcher)
}

class PhotoListFetcher: NSOperation {
    var delegate : PhotoListFetcherDelegate?
    var flickrPhotos : [FlickrPhoto] = []
    var currentLatitude : String!
    var currentLongitude : String!
    
    init(currentLatitude : String, currentLongitude: String) {
        self.currentLatitude = currentLatitude
        self.currentLongitude = currentLongitude
    }
    
    override func main() {
        if self.cancelled {
            return
        }
        
        let flickrSearchParameters = ["method": FlickrConstants.SEARCH_METHOD,
            "api_key": FlickrConstants.FLICKR_KEY,
            "lat": self.currentLatitude,
            "lon": self.currentLongitude,
            "per_page": FlickrConstants.NUMBER_OF_PHOTOS,
            "format": FlickrConstants.FORMAT_TYPE,
            "privacy_filter": FlickrConstants.PRIVACY_FILTER,
            "nojsoncallback": FlickrConstants.JSON_CALLBACK]
        
        Alamofire.request(Method.GET, FlickrConstants.FLICKR_URL, parameters: flickrSearchParameters as? [String : AnyObject]).responseJSON { (request, response, result) in
            var innerJson:JSON = JSON(result.value!)
            for (_, subJson) in innerJson["photos"]["photo"] {
                let flickrPhoto : FlickrPhoto = FlickrPhoto()
                flickrPhoto.title = subJson["title"].string
                flickrPhoto.bigImageUrl = FlickrApiUtils.photoUrlForSize(FlickrApiUtils.FlickrPhotoSize.PhotoSizeLarge1024, photoDictionary: subJson)
                flickrPhoto.smallImageUrl = FlickrApiUtils.photoUrlForSize(FlickrApiUtils.FlickrPhotoSize.PhotoSizeSmallSquare75, photoDictionary: subJson)
                flickrPhoto.photoSetId = subJson["id"].string
                self.flickrPhotos.append(flickrPhoto)
            }
            dispatch_async(dispatch_get_main_queue(), {
                print("call back")
                print("we got \(self.flickrPhotos.count) photos")
                self.delegate?.photoListFetcherDidFinish(self)

            })
            
        }
        
    }
}
<commit_msg>Remove debug logs<commit_after>//
//  PhotoListFetcher.swift
//  localview
//
//  Created by <NAME> on 8/13/15.
//  Copyright (c) 2015 sparkwing. All rights reserved.
//

import UIKit
import Alamofire
import SwiftyJSON

protocol PhotoListFetcherDelegate {
    func photoListFetcherDidFinish(photoListFetcher : PhotoListFetcher)
}

class PhotoListFetcher: NSOperation {
    var delegate : PhotoListFetcherDelegate?
    var flickrPhotos : [FlickrPhoto] = []
    var currentLatitude : String!
    var currentLongitude : String!
    
    init(currentLatitude : String, currentLongitude: String) {
        self.currentLatitude = currentLatitude
        self.currentLongitude = currentLongitude
    }
    
    override func main() {
        if self.cancelled {
            return
        }
        
        let flickrSearchParameters = ["method": FlickrConstants.SEARCH_METHOD,
            "api_key": FlickrConstants.FLICKR_KEY,
            "lat": self.currentLatitude,
            "lon": self.currentLongitude,
            "per_page": FlickrConstants.NUMBER_OF_PHOTOS,
            "format": FlickrConstants.FORMAT_TYPE,
            "privacy_filter": FlickrConstants.PRIVACY_FILTER,
            "nojsoncallback": FlickrConstants.JSON_CALLBACK]
        
        Alamofire.request(Method.GET, FlickrConstants.FLICKR_URL, parameters: flickrSearchParameters as? [String : AnyObject]).responseJSON { (request, response, result) in
            var innerJson:JSON = JSON(result.value!)
            for (_, subJson) in innerJson["photos"]["photo"] {
                let flickrPhoto : FlickrPhoto = FlickrPhoto()
                flickrPhoto.title = subJson["title"].string
                flickrPhoto.bigImageUrl = FlickrApiUtils.photoUrlForSize(FlickrApiUtils.FlickrPhotoSize.PhotoSizeLarge1024, photoDictionary: subJson)
                flickrPhoto.smallImageUrl = FlickrApiUtils.photoUrlForSize(FlickrApiUtils.FlickrPhotoSize.PhotoSizeSmallSquare75, photoDictionary: subJson)
                flickrPhoto.photoSetId = subJson["id"].string
                self.flickrPhotos.append(flickrPhoto)
            }
            dispatch_async(dispatch_get_main_queue(), {
                self.delegate?.photoListFetcherDidFinish(self)

            })
            
        }
        
    }
}

{'fraction_non_alphanumeric': 0.0878101402373247, 'fraction_numerical': 0.006472491909385114, 'mean_word_length': 2.599378881987578, 'pattern_counts': {'":': 16, '<': 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': '6322767', 'n_tokens_mistral': 1371, 'n_tokens_neox': 1302, 'n_words': 228}