Prompt:
buff = Buffer.from(fontArchive, 'base64')
                        bplist.parseFile buff, (err, obj) =>
                            throw err if err
                            fontName = nsArchiveParse(obj).NSFontDescriptorAttributes.NSFontNameAttribute
                            return if fontsByName[fontName]?
                            localFontIdMapping[layer.do_objectID] = fontName

                    layer.exportOptions = {
                        _class: 'exportOptions',
                        exportFormats: [{
                            _class: 'exportFormat',
                            absoluteSize: 0,
                            fileFormat: 'png',
                            name: '',
                            namingScheme: 0,
                            scale: 2,
                            visibleScaleType: 0
                        }],
                        includedLayerIds: [],
                        layerOptions: 0,
                        shouldTrim: false

Response:
}

                return {new_page_json: JSON.stringify(page_json), localFontIdMapping}

            ).then(({new_page_json, localFontIdMapping}) -> new Promise((resolve, reject) ->

                fs.writeFile page_json_file_path, new_page_json, (err) ->
                    return reject(err) if err
                    resolve(localFontIdMapping)
            ))
        )

    # zip the updated package back into a single .sketch file
    .then ([localFontIdMapping]) -> new Promise (resolve, reject) ->

        [dir, outfile] = [extract_dir, path.relative(extract_dir, output_file_path)]
        [escaped_dir, escaped_outfile] = [dir, outfile].map((fpath) -> shellescape([fpath]))

        exec "cd #{escaped_dir} && zip -q -r #{escaped_outfile} *", (err, stdout, stderr) ->
            return reject({err, stderr}) if err
            console.log("zip logged:", stdout) if not _l.isEmpty(stdout)
            resolve(localFontIdMapping)


Response:
###global define###

define ['angular', 'controllers/controllers', 'services/messageService'], (angular, controllers) ->
	'use strict'

	searchHistory = []

	controllers.controller 'searchHistoryController', ['$scope', 'messageService', ($scope, messageService) ->
		$scope.searchHistory = searchHistory

		messageService.subscribe 'search', (name, parameters) ->
			$scope.searchHistory.push parameters
	]


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
###global define###

define ['angular', 'controllers/controllers', 'services/messageService'], (angular, controllers) ->
	'use strict'

	searchHistory = []

	controllers.controller 'searchHistoryController', ['$scope', 'messageService', ($scope, messageService) ->
		$scope.searchHistory = searchHistory

		messageService.subscribe 'search', (name, parameters) ->
			$scope.searchHistory.push parameters
	]
```

Response:
/*global define*/
define(['angular', 'controllers/controllers', 'services/messageService'], function(angular, controllers) {
  'use strict';
  var searchHistory;
  searchHistory = [];
  return controllers.controller('searchHistoryController', [
    '$scope',
    'messageService',
    function($scope,
    messageService) {
      $scope.searchHistory = searchHistory;
      return messageService.subscribe('search',
    function(name,
    parameters) {
        return $scope.searchHistory.push(parameters);
      });
    }
  ]);
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
/*global define*/
define(['angular', 'controllers/controllers', 'services/messageService'], function(angular, controllers) {
  'use strict';
  var searchHistory;
  searchHistory = [];
  return controllers.controller('searchHistoryController', [
    '$scope',
    'messageService',
    function($scope,
    messageService) {
      $scope.searchHistory = searchHistory;
      return messageService.subscribe('search',
    function(name,
    parameters) {
        return $scope.searchHistory.push(parameters);
      });
    }
  ]);
});
```

Response:
###global define###

define ['angular', 'controllers/controllers', 'services/messageService'], (angular, controllers) ->
	'use strict'

	searchHistory = []

	controllers.controller 'searchHistoryController', ['$scope', 'messageService', ($scope, messageService) ->
		$scope.searchHistory = searchHistory

		messageService.subscribe 'search', (name, parameters) ->
			$scope.searchHistory.push parameters
	]


Prompt:
###global define###

define ['angular', 'controllers/controllers', 'services/messageService'], (angular, controllers) ->
	'use strict'

	searchHistory = []

Response:
controllers.controller 'searchHistoryController', ['$scope', 'messageService', ($scope, messageService) ->
		$scope.searchHistory = searchHistory

		messageService.subscribe 'search', (name, parameters) ->
			$scope.searchHistory.push parameters
	]


Response:
###global define###

define ['use!angular', 'controllers/controllers', 'services/messageService'], (angular, controllers) ->
	'use strict'

	searchHistory = []

	controllers.controller 'searchHistoryController', ['$scope', 'messageService', ($scope, messageService) ->
		$scope.searchHistory = searchHistory

		messageService.subscribe 'search', (name, parameters) ->
			$scope.searchHistory.push parameters
	]


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
###global define###

define ['use!angular', 'controllers/controllers', 'services/messageService'], (angular, controllers) ->
	'use strict'

	searchHistory = []

	controllers.controller 'searchHistoryController', ['$scope', 'messageService', ($scope, messageService) ->
		$scope.searchHistory = searchHistory

		messageService.subscribe 'search', (name, parameters) ->
			$scope.searchHistory.push parameters
	]
```

Response:
/*global define*/
define(['use!angular', 'controllers/controllers', 'services/messageService'], function(angular, controllers) {
  'use strict';
  var searchHistory;
  searchHistory = [];
  return controllers.controller('searchHistoryController', [
    '$scope',
    'messageService',
    function($scope,
    messageService) {
      $scope.searchHistory = searchHistory;
      return messageService.subscribe('search',
    function(name,
    parameters) {
        return $scope.searchHistory.push(parameters);
      });
    }
  ]);
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
/*global define*/
define(['use!angular', 'controllers/controllers', 'services/messageService'], function(angular, controllers) {
  'use strict';
  var searchHistory;
  searchHistory = [];
  return controllers.controller('searchHistoryController', [
    '$scope',
    'messageService',
    function($scope,
    messageService) {
      $scope.searchHistory = searchHistory;
      return messageService.subscribe('search',
    function(name,
    parameters) {
        return $scope.searchHistory.push(parameters);
      });
    }
  ]);
});
```

Response:
###global define###

define ['use!angular', 'controllers/controllers', 'services/messageService'], (angular, controllers) ->
	'use strict'

	searchHistory = []

	controllers.controller 'searchHistoryController', ['$scope', 'messageService', ($scope, messageService) ->
		$scope.searchHistory = searchHistory

		messageService.subscribe 'search', (name, parameters) ->
			$scope.searchHistory.push parameters
	]


Prompt:
###global define###

define ['use!angular', 'controllers/controllers', 'services/messageService'], (angular, controllers) ->
	'use strict'

	searchHistory = []

Response:
controllers.controller 'searchHistoryController', ['$scope', 'messageService', ($scope, messageService) ->
		$scope.searchHistory = searchHistory

		messageService.subscribe 'search', (name, parameters) ->
			$scope.searchHistory.push parameters
	]


Response:
util = (require '../util')
tryParseJSON = util.tryParseJSON
cliff = util.cliff

module.exports = (data)->
  if json = tryParseJSON data
    awkward.log ''
    awkward.log cliff.inspect json
    return
  lines = data.split '\n'
  if lines[1].length < 40
    formatted_op = []
    step = 10
    while lines.length
      formatted_op.push lines.splice 0,step
    formatted_op = (_.zip.apply _,formatted_op).map (a)->
      _.compact a

    awkward.log ''
    awkward.log cliff.stringifyRows formatted_op
  else
    awkward.log ''
    awkward.log data


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
util = (require '../util')
tryParseJSON = util.tryParseJSON
cliff = util.cliff

module.exports = (data)->
  if json = tryParseJSON data
    awkward.log ''
    awkward.log cliff.inspect json
    return
  lines = data.split '\n'
  if lines[1].length < 40
    formatted_op = []
    step = 10
    while lines.length
      formatted_op.push lines.splice 0,step
    formatted_op = (_.zip.apply _,formatted_op).map (a)->
      _.compact a

    awkward.log ''
    awkward.log cliff.stringifyRows formatted_op
  else
    awkward.log ''
    awkward.log data
```

Response:
var cliff, tryParseJSON, util;

util = require('../util');

tryParseJSON = util.tryParseJSON;

cliff = util.cliff;

module.exports = function(data) {
  var formatted_op, json, lines, step;
  if (json = tryParseJSON(data)) {
    awkward.log('');
    awkward.log(cliff.inspect(json));
    return;
  }
  lines = data.split('\n');
  if (lines[1].length < 40) {
    formatted_op = [];
    step = 10;
    while (lines.length) {
      formatted_op.push(lines.splice(0, step));
    }
    formatted_op = (_.zip.apply(_, formatted_op)).map(function(a) {
      return _.compact(a);
    });
    awkward.log('');
    return awkward.log(cliff.stringifyRows(formatted_op));
  } else {
    awkward.log('');
    return awkward.log(data);
  }
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var cliff, tryParseJSON, util;

util = require('../util');

tryParseJSON = util.tryParseJSON;

cliff = util.cliff;

module.exports = function(data) {
  var formatted_op, json, lines, step;
  if (json = tryParseJSON(data)) {
    awkward.log('');
    awkward.log(cliff.inspect(json));
    return;
  }
  lines = data.split('\n');
  if (lines[1].length < 40) {
    formatted_op = [];
    step = 10;
    while (lines.length) {
      formatted_op.push(lines.splice(0, step));
    }
    formatted_op = (_.zip.apply(_, formatted_op)).map(function(a) {
      return _.compact(a);
    });
    awkward.log('');
    return awkward.log(cliff.stringifyRows(formatted_op));
  } else {
    awkward.log('');
    return awkward.log(data);
  }
};
```

Response:
util = (require '../util')
tryParseJSON = util.tryParseJSON
cliff = util.cliff

module.exports = (data)->
  if json = tryParseJSON data
    awkward.log ''
    awkward.log cliff.inspect json
    return
  lines = data.split '\n'
  if lines[1].length < 40
    formatted_op = []
    step = 10
    while lines.length
      formatted_op.push lines.splice 0,step
    formatted_op = (_.zip.apply _,formatted_op).map (a)->
      _.compact a

    awkward.log ''
    awkward.log cliff.stringifyRows formatted_op
  else
    awkward.log ''
    awkward.log data


Prompt:
util = (require '../util')
tryParseJSON = util.tryParseJSON
cliff = util.cliff

module.exports = (data)->
  if json = tryParseJSON data
    awkward.log ''
    awkward.log cliff.inspect json
    return
  lines = data.split '\n'
  if lines[1].length < 40

Response:
formatted_op = []
    step = 10
    while lines.length
      formatted_op.push lines.splice 0,step
    formatted_op = (_.zip.apply _,formatted_op).map (a)->
      _.compact a

    awkward.log ''
    awkward.log cliff.stringifyRows formatted_op
  else
    awkward.log ''
    awkward.log data


Response:
cliff = require 'cliff'
cliff.inspect = (require 'eyes').inspector(
  styles: {
      all:     'red',
      label:   'underline',
      other:   'inverted',
      key:     'bold',
      special: 'grey',
      string:  'green',
      number:  'magenta',
      bool:    'blue',
      regexp:  'green'
  })

tryParseJSON = (jsonString) ->
  try
    o = JSON.parse(jsonString)
    if o and typeof o == 'object'
      return o
  catch e
  false

module.exports = (data)->
  if json = tryParseJSON data
    awkward.log ''
    awkward.log cliff.inspect json
    return
  lines = data.split '\n'
  if lines[1].length < 40
    formatted_op = []
    step = 10
    while lines.length
      formatted_op.push lines.splice 0,step
    formatted_op = (_.zip.apply _,formatted_op).map (a)->
      _.compact a

    awkward.log ''
    awkward.log cliff.stringifyRows formatted_op
  else
    awkward.log ''
    awkward.log data


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
cliff = require 'cliff'
cliff.inspect = (require 'eyes').inspector(
  styles: {
      all:     'red',
      label:   'underline',
      other:   'inverted',
      key:     'bold',
      special: 'grey',
      string:  'green',
      number:  'magenta',
      bool:    'blue',
      regexp:  'green'
  })

tryParseJSON = (jsonString) ->
  try
    o = JSON.parse(jsonString)
    if o and typeof o == 'object'
      return o
  catch e
  false

module.exports = (data)->
  if json = tryParseJSON data
    awkward.log ''
    awkward.log cliff.inspect json
    return
  lines = data.split '\n'
  if lines[1].length < 40
    formatted_op = []
    step = 10
    while lines.length
      formatted_op.push lines.splice 0,step
    formatted_op = (_.zip.apply _,formatted_op).map (a)->
      _.compact a

    awkward.log ''
    awkward.log cliff.stringifyRows formatted_op
  else
    awkward.log ''
    awkward.log data
```

Response:
var cliff, tryParseJSON;

cliff = require('cliff');

cliff.inspect = (require('eyes')).inspector({
  styles: {
    all: 'red',
    label: 'underline',
    other: 'inverted',
    key: 'bold',
    special: 'grey',
    string: 'green',
    number: 'magenta',
    bool: 'blue',
    regexp: 'green'
  }
});

tryParseJSON = function(jsonString) {
  var e, o;
  try {
    o = JSON.parse(jsonString);
    if (o && typeof o === 'object') {
      return o;
    }
  } catch (error) {
    e = error;
  }
  return false;
};

module.exports = function(data) {
  var formatted_op, json, lines, step;
  if (json = tryParseJSON(data)) {
    awkward.log('');
    awkward.log(cliff.inspect(json));
    return;
  }
  lines = data.split('\n');
  if (lines[1].length < 40) {
    formatted_op = [];
    step = 10;
    while (lines.length) {
      formatted_op.push(lines.splice(0, step));
    }
    formatted_op = (_.zip.apply(_, formatted_op)).map(function(a) {
      return _.compact(a);
    });
    awkward.log('');
    return awkward.log(cliff.stringifyRows(formatted_op));
  } else {
    awkward.log('');
    return awkward.log(data);
  }
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var cliff, tryParseJSON;

cliff = require('cliff');

cliff.inspect = (require('eyes')).inspector({
  styles: {
    all: 'red',
    label: 'underline',
    other: 'inverted',
    key: 'bold',
    special: 'grey',
    string: 'green',
    number: 'magenta',
    bool: 'blue',
    regexp: 'green'
  }
});

tryParseJSON = function(jsonString) {
  var e, o;
  try {
    o = JSON.parse(jsonString);
    if (o && typeof o === 'object') {
      return o;
    }
  } catch (error) {
    e = error;
  }
  return false;
};

module.exports = function(data) {
  var formatted_op, json, lines, step;
  if (json = tryParseJSON(data)) {
    awkward.log('');
    awkward.log(cliff.inspect(json));
    return;
  }
  lines = data.split('\n');
  if (lines[1].length < 40) {
    formatted_op = [];
    step = 10;
    while (lines.length) {
      formatted_op.push(lines.splice(0, step));
    }
    formatted_op = (_.zip.apply(_, formatted_op)).map(function(a) {
      return _.compact(a);
    });
    awkward.log('');
    return awkward.log(cliff.stringifyRows(formatted_op));
  } else {
    awkward.log('');
    return awkward.log(data);
  }
};
```

Response:
cliff = require 'cliff'
cliff.inspect = (require 'eyes').inspector(
  styles: {
      all:     'red',
      label:   'underline',
      other:   'inverted',
      key:     'bold',
      special: 'grey',
      string:  'green',
      number:  'magenta',
      bool:    'blue',
      regexp:  'green'
  })

tryParseJSON = (jsonString) ->
  try
    o = JSON.parse(jsonString)
    if o and typeof o == 'object'
      return o
  catch e
  false

module.exports = (data)->
  if json = tryParseJSON data
    awkward.log ''
    awkward.log cliff.inspect json
    return
  lines = data.split '\n'
  if lines[1].length < 40
    formatted_op = []
    step = 10
    while lines.length
      formatted_op.push lines.splice 0,step
    formatted_op = (_.zip.apply _,formatted_op).map (a)->
      _.compact a

    awkward.log ''
    awkward.log cliff.stringifyRows formatted_op
  else
    awkward.log ''
    awkward.log data


Prompt:
cliff = require 'cliff'
cliff.inspect = (require 'eyes').inspector(
  styles: {
      all:     'red',
      label:   'underline',
      other:   'inverted',
      key:     'bold',
      special: 'grey',
      string:  'green',
      number:  'magenta',
      bool:    'blue',
      regexp:  'green'
  })

tryParseJSON = (jsonString) ->
  try
    o = JSON.parse(jsonString)
    if o and typeof o == 'object'
      return o
  catch e

Response:
false

module.exports = (data)->
  if json = tryParseJSON data
    awkward.log ''
    awkward.log cliff.inspect json
    return
  lines = data.split '\n'
  if lines[1].length < 40
    formatted_op = []
    step = 10
    while lines.length
      formatted_op.push lines.splice 0,step
    formatted_op = (_.zip.apply _,formatted_op).map (a)->
      _.compact a

    awkward.log ''
    awkward.log cliff.stringifyRows formatted_op
  else
    awkward.log ''
    awkward.log data


Response:
cliff = require 'cliff'

module.exports = (data)->
  lines = data.split '\n'
  if lines[1].length < 40
    formatted_op = []
    step = 10
    while lines.length
      formatted_op.push lines.splice 0,step
    formatted_op = (_.zip.apply _,formatted_op).map (a)->
      _.compact a

    awkward.log ''
    awkward.log cliff.stringifyRows formatted_op
  else
    awkward.log ''
    awkward.log data


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
cliff = require 'cliff'

module.exports = (data)->
  lines = data.split '\n'
  if lines[1].length < 40
    formatted_op = []
    step = 10
    while lines.length
      formatted_op.push lines.splice 0,step
    formatted_op = (_.zip.apply _,formatted_op).map (a)->
      _.compact a

    awkward.log ''
    awkward.log cliff.stringifyRows formatted_op
  else
    awkward.log ''
    awkward.log data
```

Response:
var cliff;

cliff = require('cliff');

module.exports = function(data) {
  var formatted_op, lines, step;
  lines = data.split('\n');
  if (lines[1].length < 40) {
    formatted_op = [];
    step = 10;
    while (lines.length) {
      formatted_op.push(lines.splice(0, step));
    }
    formatted_op = (_.zip.apply(_, formatted_op)).map(function(a) {
      return _.compact(a);
    });
    awkward.log('');
    return awkward.log(cliff.stringifyRows(formatted_op));
  } else {
    awkward.log('');
    return awkward.log(data);
  }
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var cliff;

cliff = require('cliff');

module.exports = function(data) {
  var formatted_op, lines, step;
  lines = data.split('\n');
  if (lines[1].length < 40) {
    formatted_op = [];
    step = 10;
    while (lines.length) {
      formatted_op.push(lines.splice(0, step));
    }
    formatted_op = (_.zip.apply(_, formatted_op)).map(function(a) {
      return _.compact(a);
    });
    awkward.log('');
    return awkward.log(cliff.stringifyRows(formatted_op));
  } else {
    awkward.log('');
    return awkward.log(data);
  }
};
```

Response:
cliff = require 'cliff'

module.exports = (data)->
  lines = data.split '\n'
  if lines[1].length < 40
    formatted_op = []
    step = 10
    while lines.length
      formatted_op.push lines.splice 0,step
    formatted_op = (_.zip.apply _,formatted_op).map (a)->
      _.compact a

    awkward.log ''
    awkward.log cliff.stringifyRows formatted_op
  else
    awkward.log ''
    awkward.log data


Prompt:
cliff = require 'cliff'

module.exports = (data)->
  lines = data.split '\n'
  if lines[1].length < 40
    formatted_op = []
    step = 10
    while lines.length

Response:
formatted_op.push lines.splice 0,step
    formatted_op = (_.zip.apply _,formatted_op).map (a)->
      _.compact a

    awkward.log ''
    awkward.log cliff.stringifyRows formatted_op
  else
    awkward.log ''
    awkward.log data


Response:
React = require 'react'
Immutable = require 'immutable'
LiteLoadingCircle = React.createFactory require('react-lite-misc').LoadingCircle

colors = require '../util/colors'

{div, span} = React.DOM
T = React.PropTypes

module.exports = React.createClass
  displayName: 'team-wireframe'

  propTypes:
    team: T.instanceOf(Immutable.Map).isRequired

  render: ->
    div className: 'team-wireframe',
      div className: 'icon', @props.team.get('name')[0]
      div className: 'name', @props.team.get('name')

      LiteLoadingCircle()


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
Immutable = require 'immutable'
LiteLoadingCircle = React.createFactory require('react-lite-misc').LoadingCircle

colors = require '../util/colors'

{div, span} = React.DOM
T = React.PropTypes

module.exports = React.createClass
  displayName: 'team-wireframe'

  propTypes:
    team: T.instanceOf(Immutable.Map).isRequired

  render: ->
    div className: 'team-wireframe',
      div className: 'icon', @props.team.get('name')[0]
      div className: 'name', @props.team.get('name')

      LiteLoadingCircle()
```

Response:
var Immutable, LiteLoadingCircle, React, T, colors, div, span;

React = require('react');

Immutable = require('immutable');

LiteLoadingCircle = React.createFactory(require('react-lite-misc').LoadingCircle);

colors = require('../util/colors');

({div, span} = React.DOM);

T = React.PropTypes;

module.exports = React.createClass({
  displayName: 'team-wireframe',
  propTypes: {
    team: T.instanceOf(Immutable.Map).isRequired
  },
  render: function() {
    return div({
      className: 'team-wireframe'
    }, div({
      className: 'icon'
    }, this.props.team.get('name')[0]), div({
      className: 'name'
    }, this.props.team.get('name')), LiteLoadingCircle());
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var Immutable, LiteLoadingCircle, React, T, colors, div, span;

React = require('react');

Immutable = require('immutable');

LiteLoadingCircle = React.createFactory(require('react-lite-misc').LoadingCircle);

colors = require('../util/colors');

({div, span} = React.DOM);

T = React.PropTypes;

module.exports = React.createClass({
  displayName: 'team-wireframe',
  propTypes: {
    team: T.instanceOf(Immutable.Map).isRequired
  },
  render: function() {
    return div({
      className: 'team-wireframe'
    }, div({
      className: 'icon'
    }, this.props.team.get('name')[0]), div({
      className: 'name'
    }, this.props.team.get('name')), LiteLoadingCircle());
  }
});
```

Response:
React = require 'react'
Immutable = require 'immutable'
LiteLoadingCircle = React.createFactory require('react-lite-misc').LoadingCircle

colors = require '../util/colors'

{div, span} = React.DOM
T = React.PropTypes

module.exports = React.createClass
  displayName: 'team-wireframe'

  propTypes:
    team: T.instanceOf(Immutable.Map).isRequired

  render: ->
    div className: 'team-wireframe',
      div className: 'icon', @props.team.get('name')[0]
      div className: 'name', @props.team.get('name')

      LiteLoadingCircle()


Prompt:
React = require 'react'
Immutable = require 'immutable'
LiteLoadingCircle = React.createFactory require('react-lite-misc').LoadingCircle

colors = require '../util/colors'

{div, span} = React.DOM
T = React.PropTypes

module.exports = React.createClass

Response:
displayName: 'team-wireframe'

  propTypes:
    team: T.instanceOf(Immutable.Map).isRequired

  render: ->
    div className: 'team-wireframe',
      div className: 'icon', @props.team.get('name')[0]
      div className: 'name', @props.team.get('name')

      LiteLoadingCircle()


Response:
_ = require 'lodash'
SimpleAuth = require './simpleAuth'

deleteSubscriptionIfAuthorized = (authedDevice, params, callback=_.noop, dependencies={}) ->
  database = dependencies.database ? require './database'
  getDevice = dependencies.getDevice ? require './getDevice'

  getDevice params.uuid, (error, toDevice) =>
    return callback error if error?

    simpleAuth = new SimpleAuth()
    simpleAuth.canConfigure authedDevice, toDevice, (error, canConfigure) =>
      return callback error if error?
      return callback new Error('Insufficient permissions to remove subscription on behalf of that device') unless canConfigure

      subscription = {subscriberUuid: params.uuid, emitterUuid: params.targetUuid, type: params.type}
      database.subscriptions.remove subscription, multi: true, callback

module.exports = deleteSubscriptionIfAuthorized


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
SimpleAuth = require './simpleAuth'

deleteSubscriptionIfAuthorized = (authedDevice, params, callback=_.noop, dependencies={}) ->
  database = dependencies.database ? require './database'
  getDevice = dependencies.getDevice ? require './getDevice'

  getDevice params.uuid, (error, toDevice) =>
    return callback error if error?

    simpleAuth = new SimpleAuth()
    simpleAuth.canConfigure authedDevice, toDevice, (error, canConfigure) =>
      return callback error if error?
      return callback new Error('Insufficient permissions to remove subscription on behalf of that device') unless canConfigure

      subscription = {subscriberUuid: params.uuid, emitterUuid: params.targetUuid, type: params.type}
      database.subscriptions.remove subscription, multi: true, callback

module.exports = deleteSubscriptionIfAuthorized
```

Response:
var SimpleAuth, _, deleteSubscriptionIfAuthorized;

_ = require('lodash');

SimpleAuth = require('./simpleAuth');

deleteSubscriptionIfAuthorized = function(authedDevice, params, callback = _.noop, dependencies = {}) {
  var database, getDevice, ref, ref1;
  database = (ref = dependencies.database) != null ? ref : require('./database');
  getDevice = (ref1 = dependencies.getDevice) != null ? ref1 : require('./getDevice');
  return getDevice(params.uuid, (error, toDevice) => {
    var simpleAuth;
    if (error != null) {
      return callback(error);
    }
    simpleAuth = new SimpleAuth();
    return simpleAuth.canConfigure(authedDevice, toDevice, (error, canConfigure) => {
      var subscription;
      if (error != null) {
        return callback(error);
      }
      if (!canConfigure) {
        return callback(new Error('Insufficient permissions to remove subscription on behalf of that device'));
      }
      subscription = {
        subscriberUuid: params.uuid,
        emitterUuid: params.targetUuid,
        type: params.type
      };
      return database.subscriptions.remove(subscription, {
        multi: true
      }, callback);
    });
  });
};

module.exports = deleteSubscriptionIfAuthorized;


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var SimpleAuth, _, deleteSubscriptionIfAuthorized;

_ = require('lodash');

SimpleAuth = require('./simpleAuth');

deleteSubscriptionIfAuthorized = function(authedDevice, params, callback = _.noop, dependencies = {}) {
  var database, getDevice, ref, ref1;
  database = (ref = dependencies.database) != null ? ref : require('./database');
  getDevice = (ref1 = dependencies.getDevice) != null ? ref1 : require('./getDevice');
  return getDevice(params.uuid, (error, toDevice) => {
    var simpleAuth;
    if (error != null) {
      return callback(error);
    }
    simpleAuth = new SimpleAuth();
    return simpleAuth.canConfigure(authedDevice, toDevice, (error, canConfigure) => {
      var subscription;
      if (error != null) {
        return callback(error);
      }
      if (!canConfigure) {
        return callback(new Error('Insufficient permissions to remove subscription on behalf of that device'));
      }
      subscription = {
        subscriberUuid: params.uuid,
        emitterUuid: params.targetUuid,
        type: params.type
      };
      return database.subscriptions.remove(subscription, {
        multi: true
      }, callback);
    });
  });
};

module.exports = deleteSubscriptionIfAuthorized;
```

Response:
_ = require 'lodash'
SimpleAuth = require './simpleAuth'

deleteSubscriptionIfAuthorized = (authedDevice, params, callback=_.noop, dependencies={}) ->
  database = dependencies.database ? require './database'
  getDevice = dependencies.getDevice ? require './getDevice'

  getDevice params.uuid, (error, toDevice) =>
    return callback error if error?

    simpleAuth = new SimpleAuth()
    simpleAuth.canConfigure authedDevice, toDevice, (error, canConfigure) =>
      return callback error if error?
      return callback new Error('Insufficient permissions to remove subscription on behalf of that device') unless canConfigure

      subscription = {subscriberUuid: params.uuid, emitterUuid: params.targetUuid, type: params.type}
      database.subscriptions.remove subscription, multi: true, callback

module.exports = deleteSubscriptionIfAuthorized


Prompt:
_ = require 'lodash'
SimpleAuth = require './simpleAuth'

deleteSubscriptionIfAuthorized = (authedDevice, params, callback=_.noop, dependencies={}) ->
  database = dependencies.database ? require './database'
  getDevice = dependencies.getDevice ? require './getDevice'

  getDevice params.uuid, (error, toDevice) =>
    return callback error if error?

Response:
simpleAuth = new SimpleAuth()
    simpleAuth.canConfigure authedDevice, toDevice, (error, canConfigure) =>
      return callback error if error?
      return callback new Error('Insufficient permissions to remove subscription on behalf of that device') unless canConfigure

      subscription = {subscriberUuid: params.uuid, emitterUuid: params.targetUuid, type: params.type}
      database.subscriptions.remove subscription, multi: true, callback

module.exports = deleteSubscriptionIfAuthorized


Response:
###global define###

define ['libs/angular'], (angular) ->
	'use strict'

	angular.module 'responseInterceptors', []


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
###global define###

define ['libs/angular'], (angular) ->
	'use strict'

	angular.module 'responseInterceptors', []
```

Response:
/*global define*/
define(['libs/angular'], function(angular) {
  'use strict';
  return angular.module('responseInterceptors', []);
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
/*global define*/
define(['libs/angular'], function(angular) {
  'use strict';
  return angular.module('responseInterceptors', []);
});
```

Response:
###global define###

define ['libs/angular'], (angular) ->
	'use strict'

	angular.module 'responseInterceptors', []


Prompt:
###global define###

define ['libs/angular'], (angular) ->

Response:
'use strict'

	angular.module 'responseInterceptors', []


Response:
request = require 'request'

options =
  method: 'POST'
  headers:
    "Content-Type": "application/json"
  url: 'http://talk.bi/v1/services/webhook/b443cb1660f15fad9b3e0de8c2c29f1a11701a82'

[
  'data'
].forEach (payloadName) ->
  payload = require "../services/payloads/jinshuju-#{payloadName}"
  request payload(options), (err, res, body) -> console.log body


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
request = require 'request'

options =
  method: 'POST'
  headers:
    "Content-Type": "application/json"
  url: 'http://talk.bi/v1/services/webhook/b443cb1660f15fad9b3e0de8c2c29f1a11701a82'

[
  'data'
].forEach (payloadName) ->
  payload = require "../services/payloads/jinshuju-#{payloadName}"
  request payload(options), (err, res, body) -> console.log body
```

Response:
var options, request;

request = require('request');

options = {
  method: 'POST',
  headers: {
    "Content-Type": "application/json"
  },
  url: 'http://talk.bi/v1/services/webhook/b443cb1660f15fad9b3e0de8c2c29f1a11701a82'
};

['data'].forEach(function(payloadName) {
  var payload;
  payload = require(`../services/payloads/jinshuju-${payloadName}`);
  return request(payload(options), function(err, res, body) {
    return console.log(body);
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var options, request;

request = require('request');

options = {
  method: 'POST',
  headers: {
    "Content-Type": "application/json"
  },
  url: 'http://talk.bi/v1/services/webhook/b443cb1660f15fad9b3e0de8c2c29f1a11701a82'
};

['data'].forEach(function(payloadName) {
  var payload;
  payload = require(`../services/payloads/jinshuju-${payloadName}`);
  return request(payload(options), function(err, res, body) {
    return console.log(body);
  });
});
```

Response:
request = require 'request'

options =
  method: 'POST'
  headers:
    "Content-Type": "application/json"
  url: 'http://talk.bi/v1/services/webhook/b443cb1660f15fad9b3e0de8c2c29f1a11701a82'

[
  'data'
].forEach (payloadName) ->
  payload = require "../services/payloads/jinshuju-#{payloadName}"
  request payload(options), (err, res, body) -> console.log body


Prompt:
request = require 'request'

options =
  method: 'POST'
  headers:
    "Content-Type": "application/json"

Response:
url: 'http://talk.bi/v1/services/webhook/b443cb1660f15fad9b3e0de8c2c29f1a11701a82'

[
  'data'
].forEach (payloadName) ->
  payload = require "../services/payloads/jinshuju-#{payloadName}"
  request payload(options), (err, res, body) -> console.log body


Response:
Driver = require('selenium-webdriver')
expect = require('chai').expect

module.exports = ->
  @When /^I execute a step$/, ->

  @Then /^the step should have a pending method$/, ->
    expect(@Pending).to.exist

  @When /^I execute a pending step$/, -> @Pending()

  @Then /^the following step should not execute$/, ->
    throw new Error "this step should not execute"

  @Then /^the environment should expose Driver$/, ->
    expect(@Driver).to.equal(Driver)


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Driver = require('selenium-webdriver')
expect = require('chai').expect

module.exports = ->
  @When /^I execute a step$/, ->

  @Then /^the step should have a pending method$/, ->
    expect(@Pending).to.exist

  @When /^I execute a pending step$/, -> @Pending()

  @Then /^the following step should not execute$/, ->
    throw new Error "this step should not execute"

  @Then /^the environment should expose Driver$/, ->
    expect(@Driver).to.equal(Driver)
```

Response:
var Driver, expect;

Driver = require('selenium-webdriver');

expect = require('chai').expect;

module.exports = function() {
  this.When(/^I execute a step$/, function() {});
  this.Then(/^the step should have a pending method$/, function() {
    return expect(this.Pending).to.exist;
  });
  this.When(/^I execute a pending step$/, function() {
    return this.Pending();
  });
  this.Then(/^the following step should not execute$/, function() {
    throw new Error("this step should not execute");
  });
  return this.Then(/^the environment should expose Driver$/, function() {
    return expect(this.Driver).to.equal(Driver);
  });
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var Driver, expect;

Driver = require('selenium-webdriver');

expect = require('chai').expect;

module.exports = function() {
  this.When(/^I execute a step$/, function() {});
  this.Then(/^the step should have a pending method$/, function() {
    return expect(this.Pending).to.exist;
  });
  this.When(/^I execute a pending step$/, function() {
    return this.Pending();
  });
  this.Then(/^the following step should not execute$/, function() {
    throw new Error("this step should not execute");
  });
  return this.Then(/^the environment should expose Driver$/, function() {
    return expect(this.Driver).to.equal(Driver);
  });
};
```

Response:
Driver = require('selenium-webdriver')
expect = require('chai').expect

module.exports = ->
  @When /^I execute a step$/, ->

  @Then /^the step should have a pending method$/, ->
    expect(@Pending).to.exist

  @When /^I execute a pending step$/, -> @Pending()

  @Then /^the following step should not execute$/, ->
    throw new Error "this step should not execute"

  @Then /^the environment should expose Driver$/, ->
    expect(@Driver).to.equal(Driver)


Prompt:
Driver = require('selenium-webdriver')
expect = require('chai').expect

module.exports = ->
  @When /^I execute a step$/, ->

  @Then /^the step should have a pending method$/, ->
    expect(@Pending).to.exist

Response:
@When /^I execute a pending step$/, -> @Pending()

  @Then /^the following step should not execute$/, ->
    throw new Error "this step should not execute"

  @Then /^the environment should expose Driver$/, ->
    expect(@Driver).to.equal(Driver)


Response:
expect = require('chai').expect

module.exports = ->
  @When /^I execute a step$/, ->

  @Then /^the step should have a pending method$/, ->
    expect(@Pending).to.exist

  @When /^I execute a pending step$/, -> @Pending()

  @Then /^the following step should not execute$/, ->
    throw new Error "this step should not execute"


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
expect = require('chai').expect

module.exports = ->
  @When /^I execute a step$/, ->

  @Then /^the step should have a pending method$/, ->
    expect(@Pending).to.exist

  @When /^I execute a pending step$/, -> @Pending()

  @Then /^the following step should not execute$/, ->
    throw new Error "this step should not execute"
```

Response:
var expect;

expect = require('chai').expect;

module.exports = function() {
  this.When(/^I execute a step$/, function() {});
  this.Then(/^the step should have a pending method$/, function() {
    return expect(this.Pending).to.exist;
  });
  this.When(/^I execute a pending step$/, function() {
    return this.Pending();
  });
  return this.Then(/^the following step should not execute$/, function() {
    throw new Error("this step should not execute");
  });
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var expect;

expect = require('chai').expect;

module.exports = function() {
  this.When(/^I execute a step$/, function() {});
  this.Then(/^the step should have a pending method$/, function() {
    return expect(this.Pending).to.exist;
  });
  this.When(/^I execute a pending step$/, function() {
    return this.Pending();
  });
  return this.Then(/^the following step should not execute$/, function() {
    throw new Error("this step should not execute");
  });
};
```

Response:
expect = require('chai').expect

module.exports = ->
  @When /^I execute a step$/, ->

  @Then /^the step should have a pending method$/, ->
    expect(@Pending).to.exist

  @When /^I execute a pending step$/, -> @Pending()

  @Then /^the following step should not execute$/, ->
    throw new Error "this step should not execute"


Prompt:
expect = require('chai').expect

module.exports = ->
  @When /^I execute a step$/, ->

  @Then /^the step should have a pending method$/, ->

Response:
expect(@Pending).to.exist

  @When /^I execute a pending step$/, -> @Pending()

  @Then /^the following step should not execute$/, ->
    throw new Error "this step should not execute"


Response:
###
    QuoJS
    (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
    http://quojs.tapquo.com
###

(($$) ->

    ELEMENT_ID = 1
    HANDLERS = {}
    EVENT_METHODS =
        preventDefault: "isDefaultPrevented"
        stopImmediatePropagation: "isImmediatePropagationStopped"
        stopPropagation: "isPropagationStopped"
    EVENTS_DESKTOP =
        touchstart: "mousedown"
        touchmove: "mousemove"
        touchend: "mouseup"
        tap: "click"
        doubletap: "dblclick"
        orientationchange: "resize"

    $$.Event = (type, touch) ->
        event = document.createEvent("Events")
        event.initEvent type, true, true, null, null, null, null, null, null, null, null, null, null, null, null
        if touch
            event[property] = touch[property] for property of touch
        event

    $$.fn.bind = (event, callback) ->
        @each ->
            _subscribe @, event, callback
            return

    $$.fn.unbind = (event, callback) ->
        @each ->
            _unsubscribe @, event, callback
            return

    $$.fn.delegate = (selector, event, callback) ->
        @each (i, element) ->
            _subscribe element, event, callback, selector, (fn) ->
                (e) ->
                    match = $$(e.target).closest(selector, element).get(0)
                    if match
                        evt = $$.extend(_createProxy(e),
                            currentTarget: match
                            liveFired: element
                        )
                        fn.apply match, [ evt ].concat([].slice.call(arguments, 1))


Prompt:
###
    QuoJS
    (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
    http://quojs.tapquo.com
###

(($$) ->

    ELEMENT_ID = 1
    HANDLERS = {}
    EVENT_METHODS =
        preventDefault: "isDefaultPrevented"
        stopImmediatePropagation: "isImmediatePropagationStopped"
        stopPropagation: "isPropagationStopped"
    EVENTS_DESKTOP =
        touchstart: "mousedown"
        touchmove: "mousemove"
        touchend: "mouseup"
        tap: "click"
        doubletap: "dblclick"
        orientationchange: "resize"

    $$.Event = (type, touch) ->
        event = document.createEvent("Events")
        event.initEvent type, true, true, null, null, null, null, null, null, null, null, null, null, null, null

Response:
if touch
            event[property] = touch[property] for property of touch
        event

    $$.fn.bind = (event, callback) ->
        @each ->
            _subscribe @, event, callback
            return

    $$.fn.unbind = (event, callback) ->
        @each ->
            _unsubscribe @, event, callback
            return

    $$.fn.delegate = (selector, event, callback) ->
        @each (i, element) ->
            _subscribe element, event, callback, selector, (fn) ->
                (e) ->
                    match = $$(e.target).closest(selector, element).get(0)
                    if match
                        evt = $$.extend(_createProxy(e),
                            currentTarget: match
                            liveFired: element
                        )
                        fn.apply match, [ evt ].concat([].slice.call(arguments, 1))


Response:
$$.fn.undelegate = (selector, event, callback) ->
        @each ->
            _unsubscribe @, event, callback, selector
            return

    $$.fn.trigger = (event, touch) ->
        event = $$.Event(event, touch) if $$.toType(event) is "string"
        @each ->
            @dispatchEvent event
            return

    $$.fn.addEvent = (element, event_name, callback) ->
        if element.addEventListener
            element.addEventListener event_name, callback, false
        else if element.attachEvent
            element.attachEvent "on" + event_name, callback
        else
            element["on" + event_name] = callback

    $$.fn.removeEvent = (element, event_name, callback) ->
        if element.removeEventListener
            element.removeEventListener event_name, callback, false
        else if element.detachEvent
            element.detachEvent "on" + event_name, callback
        else
            element["on" + event_name] = null

    _subscribe = (element, event, callback, selector, delegate_callback) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        element_handlers = HANDLERS[element_id] or (HANDLERS[element_id] = [])
        delegate = delegate_callback and delegate_callback(callback, event)
        handler =
            event: event
            callback: callback
            selector: selector
            proxy: _createProxyCallback(delegate, callback, element)
            delegate: delegate
            index: element_handlers.length


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
$$.fn.undelegate = (selector, event, callback) ->
        @each ->
            _unsubscribe @, event, callback, selector
            return

    $$.fn.trigger = (event, touch) ->
        event = $$.Event(event, touch) if $$.toType(event) is "string"
        @each ->
            @dispatchEvent event
            return

    $$.fn.addEvent = (element, event_name, callback) ->
        if element.addEventListener
            element.addEventListener event_name, callback, false
        else if element.attachEvent
            element.attachEvent "on" + event_name, callback
        else
            element["on" + event_name] = callback

    $$.fn.removeEvent = (element, event_name, callback) ->
        if element.removeEventListener
            element.removeEventListener event_name, callback, false
        else if element.detachEvent
            element.detachEvent "on" + event_name, callback
        else
            element["on" + event_name] = null

    _subscribe = (element, event, callback, selector, delegate_callback) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        element_handlers = HANDLERS[element_id] or (HANDLERS[element_id] = [])
        delegate = delegate_callback and delegate_callback(callback, event)
        handler =
            event: event
            callback: callback
            selector: selector
            proxy: _createProxyCallback(delegate, callback, element)
            delegate: delegate
            index: element_handlers.length
```

Response:
var _subscribe;

$$.fn.undelegate = function(selector, event, callback) {
  return this.each(function() {
    _unsubscribe(this, event, callback, selector);
  });
};

$$.fn.trigger = function(event, touch) {
  if ($$.toType(event) === "string") {
    event = $$.Event(event, touch);
  }
  return this.each(function() {
    this.dispatchEvent(event);
  });
};

$$.fn.addEvent = function(element, event_name, callback) {
  if (element.addEventListener) {
    return element.addEventListener(event_name, callback, false);
  } else if (element.attachEvent) {
    return element.attachEvent("on" + event_name, callback);
  } else {
    return element["on" + event_name] = callback;
  }
};

$$.fn.removeEvent = function(element, event_name, callback) {
  if (element.removeEventListener) {
    return element.removeEventListener(event_name, callback, false);
  } else if (element.detachEvent) {
    return element.detachEvent("on" + event_name, callback);
  } else {
    return element["on" + event_name] = null;
  }
};

_subscribe = function(element, event, callback, selector, delegate_callback) {
  var delegate, element_handlers, element_id, handler;
  event = _environmentEvent(event);
  element_id = _getElementId(element);
  element_handlers = HANDLERS[element_id] || (HANDLERS[element_id] = []);
  delegate = delegate_callback && delegate_callback(callback, event);
  return handler = {
    event: event,
    callback: callback,
    selector: selector,
    proxy: _createProxyCallback(delegate, callback, element),
    delegate: delegate,
    index: element_handlers.length
  };
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var _subscribe;

$$.fn.undelegate = function(selector, event, callback) {
  return this.each(function() {
    _unsubscribe(this, event, callback, selector);
  });
};

$$.fn.trigger = function(event, touch) {
  if ($$.toType(event) === "string") {
    event = $$.Event(event, touch);
  }
  return this.each(function() {
    this.dispatchEvent(event);
  });
};

$$.fn.addEvent = function(element, event_name, callback) {
  if (element.addEventListener) {
    return element.addEventListener(event_name, callback, false);
  } else if (element.attachEvent) {
    return element.attachEvent("on" + event_name, callback);
  } else {
    return element["on" + event_name] = callback;
  }
};

$$.fn.removeEvent = function(element, event_name, callback) {
  if (element.removeEventListener) {
    return element.removeEventListener(event_name, callback, false);
  } else if (element.detachEvent) {
    return element.detachEvent("on" + event_name, callback);
  } else {
    return element["on" + event_name] = null;
  }
};

_subscribe = function(element, event, callback, selector, delegate_callback) {
  var delegate, element_handlers, element_id, handler;
  event = _environmentEvent(event);
  element_id = _getElementId(element);
  element_handlers = HANDLERS[element_id] || (HANDLERS[element_id] = []);
  delegate = delegate_callback && delegate_callback(callback, event);
  return handler = {
    event: event,
    callback: callback,
    selector: selector,
    proxy: _createProxyCallback(delegate, callback, element),
    delegate: delegate,
    index: element_handlers.length
  };
};
```

Response:
$$.fn.undelegate = (selector, event, callback) ->
        @each ->
            _unsubscribe @, event, callback, selector
            return

    $$.fn.trigger = (event, touch) ->
        event = $$.Event(event, touch) if $$.toType(event) is "string"
        @each ->
            @dispatchEvent event
            return

    $$.fn.addEvent = (element, event_name, callback) ->
        if element.addEventListener
            element.addEventListener event_name, callback, false
        else if element.attachEvent
            element.attachEvent "on" + event_name, callback
        else
            element["on" + event_name] = callback

    $$.fn.removeEvent = (element, event_name, callback) ->
        if element.removeEventListener
            element.removeEventListener event_name, callback, false
        else if element.detachEvent
            element.detachEvent "on" + event_name, callback
        else
            element["on" + event_name] = null

    _subscribe = (element, event, callback, selector, delegate_callback) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        element_handlers = HANDLERS[element_id] or (HANDLERS[element_id] = [])
        delegate = delegate_callback and delegate_callback(callback, event)
        handler =
            event: event
            callback: callback
            selector: selector
            proxy: _createProxyCallback(delegate, callback, element)
            delegate: delegate
            index: element_handlers.length


Prompt:
$$.fn.undelegate = (selector, event, callback) ->
        @each ->
            _unsubscribe @, event, callback, selector
            return

    $$.fn.trigger = (event, touch) ->
        event = $$.Event(event, touch) if $$.toType(event) is "string"
        @each ->
            @dispatchEvent event
            return

    $$.fn.addEvent = (element, event_name, callback) ->
        if element.addEventListener
            element.addEventListener event_name, callback, false
        else if element.attachEvent
            element.attachEvent "on" + event_name, callback
        else
            element["on" + event_name] = callback

Response:
$$.fn.removeEvent = (element, event_name, callback) ->
        if element.removeEventListener
            element.removeEventListener event_name, callback, false
        else if element.detachEvent
            element.detachEvent "on" + event_name, callback
        else
            element["on" + event_name] = null

    _subscribe = (element, event, callback, selector, delegate_callback) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        element_handlers = HANDLERS[element_id] or (HANDLERS[element_id] = [])
        delegate = delegate_callback and delegate_callback(callback, event)
        handler =
            event: event
            callback: callback
            selector: selector
            proxy: _createProxyCallback(delegate, callback, element)
            delegate: delegate
            index: element_handlers.length


Response:
element_handlers.push handler
        $$.fn.addEvent element, handler.event, handler.proxy

    _unsubscribe = (element, event, callback, selector) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        _findHandlers(element_id, event, callback, selector).forEach (handler) ->
            delete HANDLERS[element_id][handler.index]

            $$.fn.removeEvent element, handler.event, handler.proxy

    _getElementId = (element) -> element._id or (element._id = ELEMENT_ID++)

    _environmentEvent = (event) ->
        environment_event = (if ($$.isMobile()) then event else EVENTS_DESKTOP[event])
        (environment_event) or event

    _createProxyCallback = (delegate, callback, element) ->
        callback = delegate or callback
        proxy = (event) ->
            result = callback.apply(element, [ event ].concat(event.data))
            event.preventDefault()    if result is false
            result
        proxy

    _findHandlers = (element_id, event, fn, selector) ->
        (HANDLERS[element_id] or []).filter (handler) ->
            handler and (not event or handler.event is event) and (not fn or handler.fn is fn) and (not selector or handler.selector is selector)

    _createProxy = (event) ->
        proxy = $$.extend( originalEvent: event, event)
        $$.each EVENT_METHODS, (name, method) ->
            proxy[name] = ->
                @[method] = ->
                    true

                event[name].apply event, arguments

            proxy[method] = ->
                false
        proxy


Prompt:
element_handlers.push handler
        $$.fn.addEvent element, handler.event, handler.proxy

    _unsubscribe = (element, event, callback, selector) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        _findHandlers(element_id, event, callback, selector).forEach (handler) ->
            delete HANDLERS[element_id][handler.index]

            $$.fn.removeEvent element, handler.event, handler.proxy

    _getElementId = (element) -> element._id or (element._id = ELEMENT_ID++)

    _environmentEvent = (event) ->
        environment_event = (if ($$.isMobile()) then event else EVENTS_DESKTOP[event])
        (environment_event) or event

    _createProxyCallback = (delegate, callback, element) ->
        callback = delegate or callback
        proxy = (event) ->

Response:
result = callback.apply(element, [ event ].concat(event.data))
            event.preventDefault()    if result is false
            result
        proxy

    _findHandlers = (element_id, event, fn, selector) ->
        (HANDLERS[element_id] or []).filter (handler) ->
            handler and (not event or handler.event is event) and (not fn or handler.fn is fn) and (not selector or handler.selector is selector)

    _createProxy = (event) ->
        proxy = $$.extend( originalEvent: event, event)
        $$.each EVENT_METHODS, (name, method) ->
            proxy[name] = ->
                @[method] = ->
                    true

                event[name].apply event, arguments

            proxy[method] = ->
                false
        proxy


Response:
###
    QuoJS 2.2.0
    (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
    http://quojs.tapquo.com
###

(($$) ->

    ELEMENT_ID = 1
    HANDLERS = {}
    EVENT_METHODS =
        preventDefault: "isDefaultPrevented"
        stopImmediatePropagation: "isImmediatePropagationStopped"
        stopPropagation: "isPropagationStopped"
    EVENTS_DESKTOP =
        touchstart: "mousedown"
        touchmove: "mousemove"
        touchend: "mouseup"
        tap: "click"
        doubletap: "dblclick"
        orientationchange: "resize"

    $$.Event = (type, touch) ->
        event = document.createEvent("Events")
        event.initEvent type, true, true, null, null, null, null, null, null, null, null, null, null, null, null
        if touch
            event[property] = touch[property] for property of touch
        event

    $$.fn.bind = (event, callback) ->
        @each ->
            _subscribe @, event, callback
            return

    $$.fn.unbind = (event, callback) ->
        @each ->
            _unsubscribe @, event, callback
            return

    $$.fn.delegate = (selector, event, callback) ->
        @each (i, element) ->
            _subscribe element, event, callback, selector, (fn) ->
                (e) ->
                    match = $$(e.target).closest(selector, element).get(0)
                    if match
                        evt = $$.extend(_createProxy(e),
                            currentTarget: match
                            liveFired: element
                        )
                        fn.apply match, [ evt ].concat([].slice.call(arguments, 1))


Prompt:
###
    QuoJS 2.2.0
    (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
    http://quojs.tapquo.com
###

(($$) ->

    ELEMENT_ID = 1
    HANDLERS = {}
    EVENT_METHODS =
        preventDefault: "isDefaultPrevented"
        stopImmediatePropagation: "isImmediatePropagationStopped"
        stopPropagation: "isPropagationStopped"
    EVENTS_DESKTOP =
        touchstart: "mousedown"
        touchmove: "mousemove"
        touchend: "mouseup"
        tap: "click"
        doubletap: "dblclick"
        orientationchange: "resize"

    $$.Event = (type, touch) ->
        event = document.createEvent("Events")
        event.initEvent type, true, true, null, null, null, null, null, null, null, null, null, null, null, null

Response:
if touch
            event[property] = touch[property] for property of touch
        event

    $$.fn.bind = (event, callback) ->
        @each ->
            _subscribe @, event, callback
            return

    $$.fn.unbind = (event, callback) ->
        @each ->
            _unsubscribe @, event, callback
            return

    $$.fn.delegate = (selector, event, callback) ->
        @each (i, element) ->
            _subscribe element, event, callback, selector, (fn) ->
                (e) ->
                    match = $$(e.target).closest(selector, element).get(0)
                    if match
                        evt = $$.extend(_createProxy(e),
                            currentTarget: match
                            liveFired: element
                        )
                        fn.apply match, [ evt ].concat([].slice.call(arguments, 1))


Response:
###
    QuoJS 2.2.0
    (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
    http://quojs.tapquo.com
###

(($$) ->

    ELEMENT_ID = 1
    HANDLERS = {}
    EVENT_METHODS =
        preventDefault: "isDefaultPrevented"
        stopImmediatePropagation: "isImmediatePropagationStopped"
        stopPropagation: "isPropagationStopped"
    EVENTS_DESKTOP =
        touchstart: "mousedown"
        touchmove: "mousemove"
        touchend: "mouseup"
        tap: "click"
        doubletap: "dblclick"
        orientationchange: "resize"

    $$.Event = (type, touch) ->
        event = document.createEvent("Events")
        event.initEvent type, true, true, null, null, null, null, null, null, null, null, null, null, null, null
        if touch
            event.pageX = touch.x1
            event.pageY = touch.y1
            event.toX = touch.x2
            event.toY = touch.y2
            event.fingers = touch.fingers
        event

    $$.fn.bind = (event, callback) ->
        @each ->
            _subscribe @, event, callback
            return

    $$.fn.unbind = (event, callback) ->
        @each ->
            _unsubscribe @, event, callback
            return


Prompt:
###
    QuoJS 2.2.0
    (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
    http://quojs.tapquo.com
###

(($$) ->

    ELEMENT_ID = 1
    HANDLERS = {}
    EVENT_METHODS =
        preventDefault: "isDefaultPrevented"
        stopImmediatePropagation: "isImmediatePropagationStopped"
        stopPropagation: "isPropagationStopped"
    EVENTS_DESKTOP =
        touchstart: "mousedown"
        touchmove: "mousemove"
        touchend: "mouseup"
        tap: "click"
        doubletap: "dblclick"
        orientationchange: "resize"

Response:
$$.Event = (type, touch) ->
        event = document.createEvent("Events")
        event.initEvent type, true, true, null, null, null, null, null, null, null, null, null, null, null, null
        if touch
            event.pageX = touch.x1
            event.pageY = touch.y1
            event.toX = touch.x2
            event.toY = touch.y2
            event.fingers = touch.fingers
        event

    $$.fn.bind = (event, callback) ->
        @each ->
            _subscribe @, event, callback
            return

    $$.fn.unbind = (event, callback) ->
        @each ->
            _unsubscribe @, event, callback
            return


Response:
$$.fn.delegate = (selector, event, callback) ->
        @each (i, element) ->
            _subscribe element, event, callback, selector, (fn) ->
                (e) ->
                    match = $$(e.target).closest(selector, element).get(0)
                    if match
                        evt = $$.extend(_createProxy(e),
                            currentTarget: match
                            liveFired: element
                        )
                        fn.apply match, [ evt ].concat([].slice.call(arguments, 1))
            return

    $$.fn.undelegate = (selector, event, callback) ->
        @each ->
            _unsubscribe @, event, callback, selector
            return

    $$.fn.trigger = (event, touch) ->
        event = $$.Event(event, touch) if $$.toType(event) is "string"
        @each ->
            @dispatchEvent event
            return

    $$.fn.addEvent = (element, event_name, callback) ->
        if element.addEventListener
            element.addEventListener event_name, callback, false
        else if element.attachEvent
            element.attachEvent "on" + event_name, callback
        else
            element["on" + event_name] = callback

    $$.fn.removeEvent = (element, event_name, callback) ->
        if element.removeEventListener
            element.removeEventListener event_name, callback, false
        else if element.detachEvent
            element.detachEvent "on" + event_name, callback
        else
            element["on" + event_name] = null


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
$$.fn.delegate = (selector, event, callback) ->
        @each (i, element) ->
            _subscribe element, event, callback, selector, (fn) ->
                (e) ->
                    match = $$(e.target).closest(selector, element).get(0)
                    if match
                        evt = $$.extend(_createProxy(e),
                            currentTarget: match
                            liveFired: element
                        )
                        fn.apply match, [ evt ].concat([].slice.call(arguments, 1))
            return

    $$.fn.undelegate = (selector, event, callback) ->
        @each ->
            _unsubscribe @, event, callback, selector
            return

    $$.fn.trigger = (event, touch) ->
        event = $$.Event(event, touch) if $$.toType(event) is "string"
        @each ->
            @dispatchEvent event
            return

    $$.fn.addEvent = (element, event_name, callback) ->
        if element.addEventListener
            element.addEventListener event_name, callback, false
        else if element.attachEvent
            element.attachEvent "on" + event_name, callback
        else
            element["on" + event_name] = callback

    $$.fn.removeEvent = (element, event_name, callback) ->
        if element.removeEventListener
            element.removeEventListener event_name, callback, false
        else if element.detachEvent
            element.detachEvent "on" + event_name, callback
        else
            element["on" + event_name] = null
```

Response:
$$.fn.delegate = function(selector, event, callback) {
  return this.each(function(i, element) {
    _subscribe(element, event, callback, selector, function(fn) {
      return function(e) {
        var evt, match;
        match = $$(e.target).closest(selector, element).get(0);
        if (match) {
          evt = $$.extend(_createProxy(e), {
            currentTarget: match,
            liveFired: element
          });
          return fn.apply(match, [evt].concat([].slice.call(arguments, 1)));
        }
      };
    });
  });
};

$$.fn.undelegate = function(selector, event, callback) {
  return this.each(function() {
    _unsubscribe(this, event, callback, selector);
  });
};

$$.fn.trigger = function(event, touch) {
  if ($$.toType(event) === "string") {
    event = $$.Event(event, touch);
  }
  return this.each(function() {
    this.dispatchEvent(event);
  });
};

$$.fn.addEvent = function(element, event_name, callback) {
  if (element.addEventListener) {
    return element.addEventListener(event_name, callback, false);
  } else if (element.attachEvent) {
    return element.attachEvent("on" + event_name, callback);
  } else {
    return element["on" + event_name] = callback;
  }
};

$$.fn.removeEvent = function(element, event_name, callback) {
  if (element.removeEventListener) {
    return element.removeEventListener(event_name, callback, false);
  } else if (element.detachEvent) {
    return element.detachEvent("on" + event_name, callback);
  } else {
    return element["on" + event_name] = null;
  }
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
$$.fn.delegate = function(selector, event, callback) {
  return this.each(function(i, element) {
    _subscribe(element, event, callback, selector, function(fn) {
      return function(e) {
        var evt, match;
        match = $$(e.target).closest(selector, element).get(0);
        if (match) {
          evt = $$.extend(_createProxy(e), {
            currentTarget: match,
            liveFired: element
          });
          return fn.apply(match, [evt].concat([].slice.call(arguments, 1)));
        }
      };
    });
  });
};

$$.fn.undelegate = function(selector, event, callback) {
  return this.each(function() {
    _unsubscribe(this, event, callback, selector);
  });
};

$$.fn.trigger = function(event, touch) {
  if ($$.toType(event) === "string") {
    event = $$.Event(event, touch);
  }
  return this.each(function() {
    this.dispatchEvent(event);
  });
};

$$.fn.addEvent = function(element, event_name, callback) {
  if (element.addEventListener) {
    return element.addEventListener(event_name, callback, false);
  } else if (element.attachEvent) {
    return element.attachEvent("on" + event_name, callback);
  } else {
    return element["on" + event_name] = callback;
  }
};

$$.fn.removeEvent = function(element, event_name, callback) {
  if (element.removeEventListener) {
    return element.removeEventListener(event_name, callback, false);
  } else if (element.detachEvent) {
    return element.detachEvent("on" + event_name, callback);
  } else {
    return element["on" + event_name] = null;
  }
};
```

Response:
$$.fn.delegate = (selector, event, callback) ->
        @each (i, element) ->
            _subscribe element, event, callback, selector, (fn) ->
                (e) ->
                    match = $$(e.target).closest(selector, element).get(0)
                    if match
                        evt = $$.extend(_createProxy(e),
                            currentTarget: match
                            liveFired: element
                        )
                        fn.apply match, [ evt ].concat([].slice.call(arguments, 1))
            return

    $$.fn.undelegate = (selector, event, callback) ->
        @each ->
            _unsubscribe @, event, callback, selector
            return

    $$.fn.trigger = (event, touch) ->
        event = $$.Event(event, touch) if $$.toType(event) is "string"
        @each ->
            @dispatchEvent event
            return

    $$.fn.addEvent = (element, event_name, callback) ->
        if element.addEventListener
            element.addEventListener event_name, callback, false
        else if element.attachEvent
            element.attachEvent "on" + event_name, callback
        else
            element["on" + event_name] = callback

    $$.fn.removeEvent = (element, event_name, callback) ->
        if element.removeEventListener
            element.removeEventListener event_name, callback, false
        else if element.detachEvent
            element.detachEvent "on" + event_name, callback
        else
            element["on" + event_name] = null


Prompt:
$$.fn.delegate = (selector, event, callback) ->
        @each (i, element) ->
            _subscribe element, event, callback, selector, (fn) ->
                (e) ->
                    match = $$(e.target).closest(selector, element).get(0)
                    if match
                        evt = $$.extend(_createProxy(e),
                            currentTarget: match
                            liveFired: element
                        )
                        fn.apply match, [ evt ].concat([].slice.call(arguments, 1))
            return

    $$.fn.undelegate = (selector, event, callback) ->
        @each ->
            _unsubscribe @, event, callback, selector
            return

    $$.fn.trigger = (event, touch) ->

Response:
event = $$.Event(event, touch) if $$.toType(event) is "string"
        @each ->
            @dispatchEvent event
            return

    $$.fn.addEvent = (element, event_name, callback) ->
        if element.addEventListener
            element.addEventListener event_name, callback, false
        else if element.attachEvent
            element.attachEvent "on" + event_name, callback
        else
            element["on" + event_name] = callback

    $$.fn.removeEvent = (element, event_name, callback) ->
        if element.removeEventListener
            element.removeEventListener event_name, callback, false
        else if element.detachEvent
            element.detachEvent "on" + event_name, callback
        else
            element["on" + event_name] = null


Response:
_subscribe = (element, event, callback, selector, delegate_callback) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        element_handlers = HANDLERS[element_id] or (HANDLERS[element_id] = [])
        delegate = delegate_callback and delegate_callback(callback, event)
        handler =
            event: event
            callback: callback
            selector: selector
            proxy: _createProxyCallback(delegate, callback, element)
            delegate: delegate
            index: element_handlers.length

        element_handlers.push handler
        $$.fn.addEvent element, handler.event, handler.proxy

    _unsubscribe = (element, event, callback, selector) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        _findHandlers(element_id, event, callback, selector).forEach (handler) ->
            delete HANDLERS[element_id][handler.index]

            $$.fn.removeEvent element, handler.event, handler.proxy

    _getElementId = (element) -> element._id or (element._id = ELEMENT_ID++)

    _environmentEvent = (event) ->
        environment_event = (if ($$.isMobile()) then event else EVENTS_DESKTOP[event])
        (environment_event) or event

    _createProxyCallback = (delegate, callback, element) ->
        callback = delegate or callback
        proxy = (event) ->
            result = callback.apply(element, [ event ].concat(event.data))
            event.preventDefault()    if result is false
            result
        proxy

    _findHandlers = (element_id, event, fn, selector) ->
        (HANDLERS[element_id] or []).filter (handler) ->
            handler and (not event or handler.event is event) and (not fn or handler.fn is fn) and (not selector or handler.selector is selector)


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
_subscribe = (element, event, callback, selector, delegate_callback) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        element_handlers = HANDLERS[element_id] or (HANDLERS[element_id] = [])
        delegate = delegate_callback and delegate_callback(callback, event)
        handler =
            event: event
            callback: callback
            selector: selector
            proxy: _createProxyCallback(delegate, callback, element)
            delegate: delegate
            index: element_handlers.length

        element_handlers.push handler
        $$.fn.addEvent element, handler.event, handler.proxy

    _unsubscribe = (element, event, callback, selector) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        _findHandlers(element_id, event, callback, selector).forEach (handler) ->
            delete HANDLERS[element_id][handler.index]

            $$.fn.removeEvent element, handler.event, handler.proxy

    _getElementId = (element) -> element._id or (element._id = ELEMENT_ID++)

    _environmentEvent = (event) ->
        environment_event = (if ($$.isMobile()) then event else EVENTS_DESKTOP[event])
        (environment_event) or event

    _createProxyCallback = (delegate, callback, element) ->
        callback = delegate or callback
        proxy = (event) ->
            result = callback.apply(element, [ event ].concat(event.data))
            event.preventDefault()    if result is false
            result
        proxy

    _findHandlers = (element_id, event, fn, selector) ->
        (HANDLERS[element_id] or []).filter (handler) ->
            handler and (not event or handler.event is event) and (not fn or handler.fn is fn) and (not selector or handler.selector is selector)
```

Response:
var _createProxyCallback, _environmentEvent, _findHandlers, _getElementId, _subscribe, _unsubscribe;

_subscribe = function(element, event, callback, selector, delegate_callback) {
  var delegate, element_handlers, element_id, handler;
  event = _environmentEvent(event);
  element_id = _getElementId(element);
  element_handlers = HANDLERS[element_id] || (HANDLERS[element_id] = []);
  delegate = delegate_callback && delegate_callback(callback, event);
  handler = {
    event: event,
    callback: callback,
    selector: selector,
    proxy: _createProxyCallback(delegate, callback, element),
    delegate: delegate,
    index: element_handlers.length
  };
  element_handlers.push(handler);
  return $$.fn.addEvent(element, handler.event, handler.proxy);
};

_unsubscribe = function(element, event, callback, selector) {
  var element_id;
  event = _environmentEvent(event);
  element_id = _getElementId(element);
  return _findHandlers(element_id, event, callback, selector).forEach(function(handler) {
    delete HANDLERS[element_id][handler.index];
    return $$.fn.removeEvent(element, handler.event, handler.proxy);
  });
};

_getElementId = function(element) {
  return element._id || (element._id = ELEMENT_ID++);
};

_environmentEvent = function(event) {
  var environment_event;
  environment_event = (($$.isMobile()) ? event : EVENTS_DESKTOP[event]);
  return environment_event || event;
};

_createProxyCallback = function(delegate, callback, element) {
  var proxy;
  callback = delegate || callback;
  proxy = function(event) {
    var result;
    result = callback.apply(element, [event].concat(event.data));
    if (result === false) {
      event.preventDefault();
    }
    return result;
  };
  return proxy;
};

_findHandlers = function(element_id, event, fn, selector) {
  return (HANDLERS[element_id] || []).filter(function(handler) {
    return handler && (!event || handler.event === event) && (!fn || handler.fn === fn) && (!selector || handler.selector === selector);
  });
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var _createProxyCallback, _environmentEvent, _findHandlers, _getElementId, _subscribe, _unsubscribe;

_subscribe = function(element, event, callback, selector, delegate_callback) {
  var delegate, element_handlers, element_id, handler;
  event = _environmentEvent(event);
  element_id = _getElementId(element);
  element_handlers = HANDLERS[element_id] || (HANDLERS[element_id] = []);
  delegate = delegate_callback && delegate_callback(callback, event);
  handler = {
    event: event,
    callback: callback,
    selector: selector,
    proxy: _createProxyCallback(delegate, callback, element),
    delegate: delegate,
    index: element_handlers.length
  };
  element_handlers.push(handler);
  return $$.fn.addEvent(element, handler.event, handler.proxy);
};

_unsubscribe = function(element, event, callback, selector) {
  var element_id;
  event = _environmentEvent(event);
  element_id = _getElementId(element);
  return _findHandlers(element_id, event, callback, selector).forEach(function(handler) {
    delete HANDLERS[element_id][handler.index];
    return $$.fn.removeEvent(element, handler.event, handler.proxy);
  });
};

_getElementId = function(element) {
  return element._id || (element._id = ELEMENT_ID++);
};

_environmentEvent = function(event) {
  var environment_event;
  environment_event = (($$.isMobile()) ? event : EVENTS_DESKTOP[event]);
  return environment_event || event;
};

_createProxyCallback = function(delegate, callback, element) {
  var proxy;
  callback = delegate || callback;
  proxy = function(event) {
    var result;
    result = callback.apply(element, [event].concat(event.data));
    if (result === false) {
      event.preventDefault();
    }
    return result;
  };
  return proxy;
};

_findHandlers = function(element_id, event, fn, selector) {
  return (HANDLERS[element_id] || []).filter(function(handler) {
    return handler && (!event || handler.event === event) && (!fn || handler.fn === fn) && (!selector || handler.selector === selector);
  });
};
```

Response:
_subscribe = (element, event, callback, selector, delegate_callback) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        element_handlers = HANDLERS[element_id] or (HANDLERS[element_id] = [])
        delegate = delegate_callback and delegate_callback(callback, event)
        handler =
            event: event
            callback: callback
            selector: selector
            proxy: _createProxyCallback(delegate, callback, element)
            delegate: delegate
            index: element_handlers.length

        element_handlers.push handler
        $$.fn.addEvent element, handler.event, handler.proxy

    _unsubscribe = (element, event, callback, selector) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        _findHandlers(element_id, event, callback, selector).forEach (handler) ->
            delete HANDLERS[element_id][handler.index]

            $$.fn.removeEvent element, handler.event, handler.proxy

    _getElementId = (element) -> element._id or (element._id = ELEMENT_ID++)

    _environmentEvent = (event) ->
        environment_event = (if ($$.isMobile()) then event else EVENTS_DESKTOP[event])
        (environment_event) or event

    _createProxyCallback = (delegate, callback, element) ->
        callback = delegate or callback
        proxy = (event) ->
            result = callback.apply(element, [ event ].concat(event.data))
            event.preventDefault()    if result is false
            result
        proxy

    _findHandlers = (element_id, event, fn, selector) ->
        (HANDLERS[element_id] or []).filter (handler) ->
            handler and (not event or handler.event is event) and (not fn or handler.fn is fn) and (not selector or handler.selector is selector)


Prompt:
_subscribe = (element, event, callback, selector, delegate_callback) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        element_handlers = HANDLERS[element_id] or (HANDLERS[element_id] = [])
        delegate = delegate_callback and delegate_callback(callback, event)
        handler =
            event: event
            callback: callback
            selector: selector
            proxy: _createProxyCallback(delegate, callback, element)
            delegate: delegate
            index: element_handlers.length

        element_handlers.push handler
        $$.fn.addEvent element, handler.event, handler.proxy

    _unsubscribe = (element, event, callback, selector) ->
        event = _environmentEvent(event)
        element_id = _getElementId(element)
        _findHandlers(element_id, event, callback, selector).forEach (handler) ->

Response:
delete HANDLERS[element_id][handler.index]

            $$.fn.removeEvent element, handler.event, handler.proxy

    _getElementId = (element) -> element._id or (element._id = ELEMENT_ID++)

    _environmentEvent = (event) ->
        environment_event = (if ($$.isMobile()) then event else EVENTS_DESKTOP[event])
        (environment_event) or event

    _createProxyCallback = (delegate, callback, element) ->
        callback = delegate or callback
        proxy = (event) ->
            result = callback.apply(element, [ event ].concat(event.data))
            event.preventDefault()    if result is false
            result
        proxy

    _findHandlers = (element_id, event, fn, selector) ->
        (HANDLERS[element_id] or []).filter (handler) ->
            handler and (not event or handler.event is event) and (not fn or handler.fn is fn) and (not selector or handler.selector is selector)


Response:
_createProxy = (event) ->
        proxy = $$.extend( originalEvent: event, event)
        $$.each EVENT_METHODS, (name, method) ->
            proxy[name] = ->
                @[method] = ->
                    true

                event[name].apply event, arguments

            proxy[method] = ->
                false
        proxy

    return

) Quo


Prompt:
_createProxy = (event) ->
        proxy = $$.extend( originalEvent: event, event)
        $$.each EVENT_METHODS, (name, method) ->
            proxy[name] = ->
                @[method] = ->
                    true

                event[name].apply event, arguments

Response:
proxy[method] = ->
                false
        proxy

    return

) Quo


Response:
###
    QuoJS 2.1
    (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
    http://quojs.tapquo.com
###

(($$) ->

    ELEMENT_ID = 1
    HANDLERS = {}
    EVENT_METHODS =
        preventDefault: "isDefaultPrevented"
        stopImmediatePropagation: "isImmediatePropagationStopped"
        stopPropagation: "isPropagationStopped"
    EVENTS_DESKTOP =
        touchstart: "mousedown"
        touchmove: "mousemove"
        touchend: "mouseup"
        tap: "click"
        doubletap: "dblclick"
        orientationchange: "resize"

    $$.Event = (type, touch) ->
        event = document.createEvent("Events")
        event.initEvent type, true, true, null, null, null, null, null, null, null, null, null, null, null, null
        if touch
            event.pageX = touch.x1
            event.pageY = touch.y1
            event.toX = touch.x2
            event.toY = touch.y2
            event.fingers = touch.fingers
        event

    $$.fn.bind = (event, callback) ->
        @each ->
            _subscribe @, event, callback
            return

    $$.fn.unbind = (event, callback) ->
        @each ->
            _unsubscribe @, event, callback
            return


Prompt:
###
    QuoJS 2.1
    (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
    http://quojs.tapquo.com
###

(($$) ->

    ELEMENT_ID = 1
    HANDLERS = {}
    EVENT_METHODS =
        preventDefault: "isDefaultPrevented"
        stopImmediatePropagation: "isImmediatePropagationStopped"
        stopPropagation: "isPropagationStopped"
    EVENTS_DESKTOP =
        touchstart: "mousedown"
        touchmove: "mousemove"
        touchend: "mouseup"
        tap: "click"
        doubletap: "dblclick"
        orientationchange: "resize"

Response:
$$.Event = (type, touch) ->
        event = document.createEvent("Events")
        event.initEvent type, true, true, null, null, null, null, null, null, null, null, null, null, null, null
        if touch
            event.pageX = touch.x1
            event.pageY = touch.y1
            event.toX = touch.x2
            event.toY = touch.y2
            event.fingers = touch.fingers
        event

    $$.fn.bind = (event, callback) ->
        @each ->
            _subscribe @, event, callback
            return

    $$.fn.unbind = (event, callback) ->
        @each ->
            _unsubscribe @, event, callback
            return


Response:
###
    QuoJS 2.0
    (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
    http://quojs.tapquo.com
###

(($$) ->

    ELEMENT_ID = 1
    HANDLERS = {}
    EVENT_METHODS =
        preventDefault: "isDefaultPrevented"
        stopImmediatePropagation: "isImmediatePropagationStopped"
        stopPropagation: "isPropagationStopped"
    EVENTS_DESKTOP =
        touchstart: "mousedown"
        touchmove: "mousemove"
        touchend: "mouseup"
        tap: "click"
        doubletap: "dblclick"
        orientationchange: "resize"

    $$.Event = (type, touch) ->
        event = document.createEvent("Events")
        event.initEvent type, true, true, null, null, null, null, null, null, null, null, null, null, null, null
        if touch
            event.pageX = touch.x1
            event.pageY = touch.y1
            event.toX = touch.x2
            event.toY = touch.y2
            event.fingers = touch.fingers
        event

    $$.fn.bind = (event, callback) ->
        @each ->
            _subscribe @, event, callback
            return

    $$.fn.unbind = (event, callback) ->
        @each ->
            _unsubscribe @, event, callback
            return


Prompt:
###
    QuoJS 2.0
    (c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
    http://quojs.tapquo.com
###

(($$) ->

    ELEMENT_ID = 1
    HANDLERS = {}
    EVENT_METHODS =
        preventDefault: "isDefaultPrevented"
        stopImmediatePropagation: "isImmediatePropagationStopped"
        stopPropagation: "isPropagationStopped"
    EVENTS_DESKTOP =
        touchstart: "mousedown"
        touchmove: "mousemove"
        touchend: "mouseup"
        tap: "click"
        doubletap: "dblclick"
        orientationchange: "resize"

Response:
$$.Event = (type, touch) ->
        event = document.createEvent("Events")
        event.initEvent type, true, true, null, null, null, null, null, null, null, null, null, null, null, null
        if touch
            event.pageX = touch.x1
            event.pageY = touch.y1
            event.toX = touch.x2
            event.toY = touch.y2
            event.fingers = touch.fingers
        event

    $$.fn.bind = (event, callback) ->
        @each ->
            _subscribe @, event, callback
            return

    $$.fn.unbind = (event, callback) ->
        @each ->
            _unsubscribe @, event, callback
            return


Response:
Polygon = mojs.shapesMap.getShape('polygon')
Bit     = mojs.shapesMap.getShape('bit')
ns      = 'http://www.w3.org/2000/svg'
svg     = document.createElementNS?(ns, "svg")

describe 'Polygon ->', ->
  it 'should extend Bit', ->
    polygon  = new Polygon
    expect(polygon instanceof Bit).toBe true

  describe '_declareDefaults method ->', ->
    it 'should call super', ->
      polygon = new Polygon
      spyOn Bit::, '_declareDefaults'
      polygon._declareDefaults()
      expect(Bit::._declareDefaults).toHaveBeenCalled()
    it 'should defaults for `tag` and `points`', ->
      polygon = new Polygon
      expect(polygon._defaults.tag).toBe 'path'
      expect(polygon._defaults.points).toBe 3

  it 'should have points prop', ->
    tri = new Polygon
    expect(tri._props.points).toBe 3
  it 'should have recieve points prop', ->
    tri = new Polygon points: 8
    expect(tri._props.points).toBe 8
  it 'should calculate _radialPoints', ->
    tri = new Polygon
    tri._draw()
    expect(tri._radialPoints).toBeDefined()
    expect(tri._radialPoints.length).toBe tri._props.points

  describe '_draw method ->', ->
    it 'should add properties to el', ->
      tri = new Polygon
        radius:   20

      tri._draw()
      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-20.0000 L17.3205,10.0000 L-17.3205,10.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -20 L 17.3205 10 L -17.3205 10 Z'
      expect(isD or isIE9D).toBe true


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Polygon = mojs.shapesMap.getShape('polygon')
Bit     = mojs.shapesMap.getShape('bit')
ns      = 'http://www.w3.org/2000/svg'
svg     = document.createElementNS?(ns, "svg")

describe 'Polygon ->', ->
  it 'should extend Bit', ->
    polygon  = new Polygon
    expect(polygon instanceof Bit).toBe true

  describe '_declareDefaults method ->', ->
    it 'should call super', ->
      polygon = new Polygon
      spyOn Bit::, '_declareDefaults'
      polygon._declareDefaults()
      expect(Bit::._declareDefaults).toHaveBeenCalled()
    it 'should defaults for `tag` and `points`', ->
      polygon = new Polygon
      expect(polygon._defaults.tag).toBe 'path'
      expect(polygon._defaults.points).toBe 3

  it 'should have points prop', ->
    tri = new Polygon
    expect(tri._props.points).toBe 3
  it 'should have recieve points prop', ->
    tri = new Polygon points: 8
    expect(tri._props.points).toBe 8
  it 'should calculate _radialPoints', ->
    tri = new Polygon
    tri._draw()
    expect(tri._radialPoints).toBeDefined()
    expect(tri._radialPoints.length).toBe tri._props.points

  describe '_draw method ->', ->
    it 'should add properties to el', ->
      tri = new Polygon
        radius:   20

      tri._draw()
      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-20.0000 L17.3205,10.0000 L-17.3205,10.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -20 L 17.3205 10 L -17.3205 10 Z'
      expect(isD or isIE9D).toBe true
```

Response:
var Bit, Polygon, ns, svg;

Polygon = mojs.shapesMap.getShape('polygon');

Bit = mojs.shapesMap.getShape('bit');

ns = 'http://www.w3.org/2000/svg';

svg = typeof document.createElementNS === "function" ? document.createElementNS(ns, "svg") : void 0;

describe('Polygon ->', function() {
  it('should extend Bit', function() {
    var polygon;
    polygon = new Polygon();
    return expect(polygon instanceof Bit).toBe(true);
  });
  describe('_declareDefaults method ->', function() {
    it('should call super', function() {
      var polygon;
      polygon = new Polygon();
      spyOn(Bit.prototype, '_declareDefaults');
      polygon._declareDefaults();
      return expect(Bit.prototype._declareDefaults).toHaveBeenCalled();
    });
    return it('should defaults for `tag` and `points`', function() {
      var polygon;
      polygon = new Polygon();
      expect(polygon._defaults.tag).toBe('path');
      return expect(polygon._defaults.points).toBe(3);
    });
  });
  it('should have points prop', function() {
    var tri;
    tri = new Polygon();
    return expect(tri._props.points).toBe(3);
  });
  it('should have recieve points prop', function() {
    var tri;
    tri = new Polygon({
      points: 8
    });
    return expect(tri._props.points).toBe(8);
  });
  it('should calculate _radialPoints', function() {
    var tri;
    tri = new Polygon();
    tri._draw();
    expect(tri._radialPoints).toBeDefined();
    return expect(tri._radialPoints.length).toBe(tri._props.points);
  });
  return describe('_draw method ->', function() {
    return it('should add properties to el', function() {
      var d, d2, isD, isIE9D, tri;
      tri = new Polygon({
        radius: 20
      });
      tri._draw();
      d = tri.el.getAttribute('d');
      d2 = 'M0.0000,-20.0000 L17.3205,10.0000 L-17.3205,10.0000 z';
      isD = d === d2;
      isIE9D = d === 'M 0 -20 L 17.3205 10 L -17.3205 10 Z';
      return expect(isD || isIE9D).toBe(true);
    });
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var Bit, Polygon, ns, svg;

Polygon = mojs.shapesMap.getShape('polygon');

Bit = mojs.shapesMap.getShape('bit');

ns = 'http://www.w3.org/2000/svg';

svg = typeof document.createElementNS === "function" ? document.createElementNS(ns, "svg") : void 0;

describe('Polygon ->', function() {
  it('should extend Bit', function() {
    var polygon;
    polygon = new Polygon();
    return expect(polygon instanceof Bit).toBe(true);
  });
  describe('_declareDefaults method ->', function() {
    it('should call super', function() {
      var polygon;
      polygon = new Polygon();
      spyOn(Bit.prototype, '_declareDefaults');
      polygon._declareDefaults();
      return expect(Bit.prototype._declareDefaults).toHaveBeenCalled();
    });
    return it('should defaults for `tag` and `points`', function() {
      var polygon;
      polygon = new Polygon();
      expect(polygon._defaults.tag).toBe('path');
      return expect(polygon._defaults.points).toBe(3);
    });
  });
  it('should have points prop', function() {
    var tri;
    tri = new Polygon();
    return expect(tri._props.points).toBe(3);
  });
  it('should have recieve points prop', function() {
    var tri;
    tri = new Polygon({
      points: 8
    });
    return expect(tri._props.points).toBe(8);
  });
  it('should calculate _radialPoints', function() {
    var tri;
    tri = new Polygon();
    tri._draw();
    expect(tri._radialPoints).toBeDefined();
    return expect(tri._radialPoints.length).toBe(tri._props.points);
  });
  return describe('_draw method ->', function() {
    return it('should add properties to el', function() {
      var d, d2, isD, isIE9D, tri;
      tri = new Polygon({
        radius: 20
      });
      tri._draw();
      d = tri.el.getAttribute('d');
      d2 = 'M0.0000,-20.0000 L17.3205,10.0000 L-17.3205,10.0000 z';
      isD = d === d2;
      isIE9D = d === 'M 0 -20 L 17.3205 10 L -17.3205 10 Z';
      return expect(isD || isIE9D).toBe(true);
    });
  });
});
```

Response:
Polygon = mojs.shapesMap.getShape('polygon')
Bit     = mojs.shapesMap.getShape('bit')
ns      = 'http://www.w3.org/2000/svg'
svg     = document.createElementNS?(ns, "svg")

describe 'Polygon ->', ->
  it 'should extend Bit', ->
    polygon  = new Polygon
    expect(polygon instanceof Bit).toBe true

  describe '_declareDefaults method ->', ->
    it 'should call super', ->
      polygon = new Polygon
      spyOn Bit::, '_declareDefaults'
      polygon._declareDefaults()
      expect(Bit::._declareDefaults).toHaveBeenCalled()
    it 'should defaults for `tag` and `points`', ->
      polygon = new Polygon
      expect(polygon._defaults.tag).toBe 'path'
      expect(polygon._defaults.points).toBe 3

  it 'should have points prop', ->
    tri = new Polygon
    expect(tri._props.points).toBe 3
  it 'should have recieve points prop', ->
    tri = new Polygon points: 8
    expect(tri._props.points).toBe 8
  it 'should calculate _radialPoints', ->
    tri = new Polygon
    tri._draw()
    expect(tri._radialPoints).toBeDefined()
    expect(tri._radialPoints.length).toBe tri._props.points

  describe '_draw method ->', ->
    it 'should add properties to el', ->
      tri = new Polygon
        radius:   20

      tri._draw()
      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-20.0000 L17.3205,10.0000 L-17.3205,10.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -20 L 17.3205 10 L -17.3205 10 Z'
      expect(isD or isIE9D).toBe true


Prompt:
Polygon = mojs.shapesMap.getShape('polygon')
Bit     = mojs.shapesMap.getShape('bit')
ns      = 'http://www.w3.org/2000/svg'
svg     = document.createElementNS?(ns, "svg")

describe 'Polygon ->', ->
  it 'should extend Bit', ->
    polygon  = new Polygon
    expect(polygon instanceof Bit).toBe true

  describe '_declareDefaults method ->', ->
    it 'should call super', ->
      polygon = new Polygon
      spyOn Bit::, '_declareDefaults'
      polygon._declareDefaults()
      expect(Bit::._declareDefaults).toHaveBeenCalled()
    it 'should defaults for `tag` and `points`', ->
      polygon = new Polygon
      expect(polygon._defaults.tag).toBe 'path'
      expect(polygon._defaults.points).toBe 3

  it 'should have points prop', ->

Response:
tri = new Polygon
    expect(tri._props.points).toBe 3
  it 'should have recieve points prop', ->
    tri = new Polygon points: 8
    expect(tri._props.points).toBe 8
  it 'should calculate _radialPoints', ->
    tri = new Polygon
    tri._draw()
    expect(tri._radialPoints).toBeDefined()
    expect(tri._radialPoints.length).toBe tri._props.points

  describe '_draw method ->', ->
    it 'should add properties to el', ->
      tri = new Polygon
        radius:   20

      tri._draw()
      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-20.0000 L17.3205,10.0000 L-17.3205,10.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -20 L 17.3205 10 L -17.3205 10 Z'
      expect(isD or isIE9D).toBe true


Response:
it 'should work with radiusX and fallback to radius', ->
      # svg = document.createElementNS?(ns, "svg")
      tri = new Polygon
        # ctx:      svg
        radius:   20
        radiusX:  40
      tri._draw()
      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-20.0000 L34.6410,10.0000 L-34.6410,10.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -20 L 34.641 10 L -34.641 10 Z'
      expect(isD or isIE9D).toBe true

    it 'should work with radiusY and fallback to radius', ->
      # svg = document.createElementNS?(ns, "svg")
      tri = new Polygon
        # ctx:      svg
        radius:   20
        radiusY:  40

      tri._draw()

      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-40.0000 L17.3205,20.0000 L-17.3205,20.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -40 L 17.3205 20 L -17.3205 20 Z'
      expect(isD or isIE9D).toBe true
    it 'should call super method', ->
      polygon  = new Polygon
      spyOn(Polygon.prototype, '_draw')
      polygon._draw()
      expect(Polygon.prototype._draw).toHaveBeenCalled()

    it 'should not set `d` attribute if nothing changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._draw()
      expect( polygon.el.setAttribute ).not.toHaveBeenCalled()