<commit_before>//: Playground - noun: a place where people can play

import UIKit
import PlaygroundSupport
import CoreImage

let sara = #imageLiteral(resourceName: "Screen Shot 2016-12-22 at 1.08.32 AM.png")

enum ShadowInput {
	case view(view: UIView)
	case image(image: UIImage)
}

func shadowMaker(input: ShadowInput) -> UIImage {
	switch input {
	case .view(view: let view):
		return UIImage()
	case .image(image: let image):
		print(image)
		return image
	}
}


func applyBlurEffect(image: UIImage) -> UIImage {
	let context = CIContext(options: nil)
	let imageToBlur = CIImage(image: image)
	let blurfilter = CIFilter(name: "CIGaussianBlur")
	blurfilter!.setValue(imageToBlur, forKey: "inputImage")
	blurfilter!.setValue(50.0, forKey: "inputRadius")
	let resultImage = blurfilter!.value(forKey: "outputImage") as! CIImage
	let cgImage = context.createCGImage(resultImage, from: resultImage.extent)
	let blurredImage = UIImage(cgImage: cgImage!)
	return blurredImage
	
}

class TestViewController: UIViewController {
	let imgView = UIImageView(image: sara)
	
	
	override func viewDidLoad() {
		super.viewDidLoad()
		
		view.backgroundColor = UIColor.white
		view.addSubview(imgView)
		imgView.frame = CGRect(x: 0, y: 0, width: 375, height: 375 * 809/1337)
		
		let filter = CIFilter(name: "CIGaussianBlur", withInputParameters: nil)
		filter?.setValue(CIImage(image: sara), forKey: kCIInputImageKey)
		filter?.setValue(40.0, forKey: kCIInputRadiusKey)
		
		let newImage = UIImageView(frame: CGRect(x: 0, y: 250, width: 375 , height: 375 * 809/1337))
		newImage.image = applyBlurEffect(image: sara)
		
		view.addSubview(newImage)
	}
}

let test = TestViewController()
PlaygroundPage.current.liveView = UINavigationController(rootViewController: test)<commit_msg>fix for cropping that was introduced<commit_after>//: Playground - noun: a place where people can play

import UIKit
import PlaygroundSupport
import CoreImage

let sara = #imageLiteral(resourceName: "Screen Shot 2016-12-22 at 1.08.32 AM.png")

enum ShadowInput {
	case view(view: UIView)
	case image(image: UIImage)
}

func shadowMaker(input: ShadowInput) -> UIImage {
	switch input {
	case .view(view: let view):
		return UIImage()
	case .image(image: let image):
		print(image)
		return image
	}
}


func applyBlurEffect(image: UIImage) -> UIImage {
	let context = CIContext(options: nil)
	let imageToBlur = CIImage(image: image)
	let blurfilter = CIFilter(name: "CIGaussianBlur")
	blurfilter!.setValue(imageToBlur, forKey: "inputImage")
	blurfilter!.setValue(50.0, forKey: "inputRadius")
	let resultImage = blurfilter!.value(forKey: "outputImage") as! CIImage
	let cgImage = context.createCGImage(resultImage, from: (imageToBlur?.extent)!)
	let blurredImage = UIImage(cgImage: cgImage!)
	return blurredImage
	
}

class TestViewController: UIViewController {
	let imgView = UIImageView(image: sara)
	
	
	override func viewDidLoad() {
		super.viewDidLoad()
		
		view.backgroundColor = UIColor.white
		view.addSubview(imgView)
		imgView.frame = CGRect(x: 0, y: 0, width: 375, height: 375 * 809/1337)
		
		let newImage = UIImageView(frame: CGRect(x: 0, y: 250, width: 375 , height: 375 * 809/1337))
		
		newImage.image = applyBlurEffect(image: sara)
		view.addSubview(newImage)
	}
}

let test = TestViewController()
PlaygroundPage.current.liveView = UINavigationController(rootViewController: test)
{'fraction_non_alphanumeric': 0.11239964317573595, 'fraction_numerical': 0.029438001784121322, 'mean_word_length': 5.1611721611721615, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4493946', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1132, 'n_words': 289}