<commit_before>class window.DeviceController
  # always put everything inside PhoneGap deviceready
  document.addEventListener "deviceready", ->

    # Make Navigation Bar to appear with a custom title text
    steroids.navigationBar.show { title: "platform" }

  @testPing: () ->
    gotPong = (e) ->
      alert e.message

    steroids.device.ping({}, { onSuccess: gotPong })

  @testGetIPAddress: () ->
    showIPAddress = (e) ->
      alert e.ipAddress

    steroids.device.getIPAddress {
    }, {
      onSuccess: showIPAddress
    }

  @testTorchOn: () ->

    steroids.device.torch.turnOn {
    }, {
      onSuccess: () -> alert "turned on"
    }

  @testTorchOff: () ->

    steroids.device.torch.turnOff {
    }, {
      onSuccess: () -> alert "turned off"
    }

  @testTorchToggle: () ->

    steroids.device.torch.toggle {
    }, {
      onSuccess: () -> alert "toggled"
    }

  @testEnableSleep: ()->
    steroids.device.enableSleep {}, {
      onSuccess: () -> alert "enabled"
    }

  @testDisableSleep: ()->
    steroids.device.disableSleep {}, {
      onSuccess: () -> alert "disabled"
    }

  @testPlatformGetName: () ->
    steroids.device.platform.getName {},
      onSuccess: (gotName)-> alert gotName<commit_msg>Use notifications in the "device" controller<commit_after>class window.DeviceController
  # always put everything inside PhoneGap deviceready
  document.addEventListener "deviceready", ->

    # Make Navigation Bar to appear with a custom title text
    steroids.navigationBar.show { title: "platform" }

  @testPing: () ->
    gotPong = (e) ->
      notification e.message

    steroids.device.ping({}, { onSuccess: gotPong })

  @testGetIPAddress: () ->
    showIPAddress = (e) ->
      notification e.ipAddress

    steroids.device.getIPAddress {
    }, {
      onSuccess: showIPAddress
    }

  @testTorchOn: () ->

    steroids.device.torch.turnOn {
    }, {
      onSuccess: () -> notification "turned on"
    }

  @testTorchOff: () ->

    steroids.device.torch.turnOff {
    }, {
      onSuccess: () -> notification "turned off"
    }

  @testTorchToggle: () ->

    steroids.device.torch.toggle {
    }, {
      onSuccess: () -> notification "toggled"
    }

  @testEnableSleep: ()->
    steroids.device.enableSleep {}, {
      onSuccess: () -> notification "enabled"
    }

  @testDisableSleep: ()->
    steroids.device.disableSleep {}, {
      onSuccess: () -> notification "disabled"
    }

  @testPlatformGetName: () ->
    steroids.device.platform.getName {},
      onSuccess: (gotName)-> notification gotName
{'fraction_non_alphanumeric': 0.14224306369675654, 'fraction_numerical': 0.0, 'mean_word_length': 2.646723646723647, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 37, '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': '915530', 'n_tokens_mistral': 825, 'n_tokens_neox': 781, 'n_words': 148}