<commit_before>import UIKit

let tegUnderKeyboard = UnderKeyboard()

@objc
class UnderKeyboard {
  
  private weak var scrollView: UIScrollView?
  
  private class var shared: UnderKeyboard {
    return tegUnderKeyboard
  }
  
  class func scrollView(scrollView: UIScrollView) {
    shared.scrollView = scrollView
  }
  
  private init() {
    registerForKeyboardNotifications()
  }
  
  deinit {
    unRegisterForKeyboardNotifications()
  }
  
  private func registerForKeyboardNotifications() {
    NSNotificationCenter.defaultCenter().addObserver(self,
      selector: "keyboardDidShow:",
      name: UIKeyboardDidShowNotification, object: nil)
    
    NSNotificationCenter.defaultCenter().addObserver(self,
      selector: "keyboardWillHide:",
      name: UIKeyboardWillHideNotification, object: nil)
  }
  
  private func unRegisterForKeyboardNotifications() {
    NSNotificationCenter.defaultCenter().removeObserver(self)
  }
  
  func keyboardDidShow(notification: NSNotification) {
    if let currentUserInfo = notification.userInfo {
      if let value = currentUserInfo[UIKeyboardFrameBeginUserInfoKey] as? NSValue {
        let height = value.CGRectValue().size.height - tabBarHeigh
        
        let insets =  UIEdgeInsets(
          top: 0,
          left: 0,
          bottom: height,
          right: 0)
        
        scrollView?.contentInset = insets
        scrollView?.scrollIndicatorInsets = insets
      }
    }
  }
  
  func keyboardWillHide(notification: NSNotification) {
    scrollView?.contentInset = UIEdgeInsetsZero;
    scrollView?.scrollIndicatorInsets = UIEdgeInsetsZero;
  }
  
  private var tabBarHeigh: CGFloat {
    if let currentTaBarController = UIApplication.sharedApplication().delegate?.window??.rootViewController as? UITabBarController {
      return currentTaBarController.tabBar.frame.height
    }
    
    return 0
  }
}<commit_msg>Remove "current" word from optional binding variables<commit_after>import UIKit

let tegUnderKeyboard = UnderKeyboard()

@objc
class UnderKeyboard {
  
  private weak var scrollView: UIScrollView?
  
  private class var shared: UnderKeyboard {
    return tegUnderKeyboard
  }
  
  class func scrollView(scrollView: UIScrollView) {
    shared.scrollView = scrollView
  }
  
  private init() {
    registerForKeyboardNotifications()
  }
  
  deinit {
    unRegisterForKeyboardNotifications()
  }
  
  private func registerForKeyboardNotifications() {
    NSNotificationCenter.defaultCenter().addObserver(self,
      selector: "keyboardDidShow:",
      name: UIKeyboardDidShowNotification, object: nil)
    
    NSNotificationCenter.defaultCenter().addObserver(self,
      selector: "keyboardWillHide:",
      name: UIKeyboardWillHideNotification, object: nil)
  }
  
  private func unRegisterForKeyboardNotifications() {
    NSNotificationCenter.defaultCenter().removeObserver(self)
  }
  
  func keyboardDidShow(notification: NSNotification) {
    if let userInfo = notification.userInfo,
      let value = userInfo[UIKeyboardFrameBeginUserInfoKey] as? NSValue {

      let height = value.CGRectValue().size.height - tabBarHeigh
      
      let insets =  UIEdgeInsets(
        top: 0,
        left: 0,
        bottom: height,
        right: 0)
      
      scrollView?.contentInset = insets
      scrollView?.scrollIndicatorInsets = insets
    }
  }
  
  func keyboardWillHide(notification: NSNotification) {
    scrollView?.contentInset = UIEdgeInsetsZero;
    scrollView?.scrollIndicatorInsets = UIEdgeInsetsZero;
  }
  
  private var tabBarHeigh: CGFloat {
    if let tabBarController = UIApplication.sharedApplication().delegate?.window??.rootViewController as? UITabBarController {
      return tabBarController.tabBar.frame.height
    }
    
    return 0
  }
}
{'fraction_non_alphanumeric': 0.07762069885302747, 'fraction_numerical': 0.002133902373966391, 'mean_word_length': 3.427390791027155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6067484', 'n_tokens_mistral': 1070, 'n_tokens_neox': 1081, 'n_words': 215}