Response:
colors	= require "colors"

Deploy = require "./deploy"
Generator = require "./generator"

module.exports = class GPLOY

	servers			: null
	connection		: null
	ignoreInclude	: false

	constructor: ->
		# Call the gploy.yaml template generator
		if process.argv[2] == "install"
			new Generator()
		# Open the help
		else if process.argv[2] == "--help" or process.argv[2] == "-h"
			console.log "show help"
		# Deploy
		else
			@servers = process.argv.splice(2, process.argv.length)
			# Check if we should ignore the include parameter for this deploy
			@ignoreInclude = @servers.indexOf("-i") >= 0 or @servers.indexOf("--ignore-include") >= 0
			# Remove the ignore flag from the server list
			@servers = @servers.filter (value) -> value isnt "-i" and value isnt "--ignore-include"
			# If you don't set any servers, add an empty one to upload the first environment only
			@servers.push null if @servers.length is 0

			@deploy()

	deploy: =>
		# Dispose the current connection
		if @connection
			@connection.dispose()
			@connection = null

		# Keep deploying until all servers are updated
		if @servers.length
			@connection = new Deploy @servers[0], @ignoreInclude
			@connection.completed.add @deploy
			@servers.shift()
		# Finish the process
		else
			console.log "All Completed :)".green.bold
			process.exit(code=0)


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
colors	= require "colors"

Deploy = require "./deploy"
Generator = require "./generator"

module.exports = class GPLOY

	servers			: null
	connection		: null
	ignoreInclude	: false

	constructor: ->
		# Call the gploy.yaml template generator
		if process.argv[2] == "install"
			new Generator()
		# Open the help
		else if process.argv[2] == "--help" or process.argv[2] == "-h"
			console.log "show help"
		# Deploy
		else
			@servers = process.argv.splice(2, process.argv.length)
			# Check if we should ignore the include parameter for this deploy
			@ignoreInclude = @servers.indexOf("-i") >= 0 or @servers.indexOf("--ignore-include") >= 0
			# Remove the ignore flag from the server list
			@servers = @servers.filter (value) -> value isnt "-i" and value isnt "--ignore-include"
			# If you don't set any servers, add an empty one to upload the first environment only
			@servers.push null if @servers.length is 0

			@deploy()

	deploy: =>
		# Dispose the current connection
		if @connection
			@connection.dispose()
			@connection = null

		# Keep deploying until all servers are updated
		if @servers.length
			@connection = new Deploy @servers[0], @ignoreInclude
			@connection.completed.add @deploy
			@servers.shift()
		# Finish the process
		else
			console.log "All Completed :)".green.bold
			process.exit(code=0)
```

Response:
var Deploy, GPLOY, Generator, colors;

colors = require("colors");

Deploy = require("./deploy");

Generator = require("./generator");

module.exports = GPLOY = (function() {
  class GPLOY {
    constructor() {
      this.deploy = this.deploy.bind(this);
      // Call the gploy.yaml template generator
      if (process.argv[2] === "install") {
        new Generator();
      // Open the help
      } else if (process.argv[2] === "--help" || process.argv[2] === "-h") {
        console.log("show help");
      } else {
        // Deploy
        this.servers = process.argv.splice(2, process.argv.length);
        // Check if we should ignore the include parameter for this deploy
        this.ignoreInclude = this.servers.indexOf("-i") >= 0 || this.servers.indexOf("--ignore-include") >= 0;
        // Remove the ignore flag from the server list
        this.servers = this.servers.filter(function(value) {
          return value !== "-i" && value !== "--ignore-include";
        });
        if (this.servers.length === 0) {
          // If you don't set any servers, add an empty one to upload the first environment only
          this.servers.push(null);
        }
        this.deploy();
      }
    }

    deploy() {
      var code;
      // Dispose the current connection
      if (this.connection) {
        this.connection.dispose();
        this.connection = null;
      }
      // Keep deploying until all servers are updated
      if (this.servers.length) {
        this.connection = new Deploy(this.servers[0], this.ignoreInclude);
        this.connection.completed.add(this.deploy);
        return this.servers.shift();
      } else {
        // Finish the process
        console.log("All Completed :)".green.bold);
        return process.exit(code = 0);
      }
    }

  };

  GPLOY.prototype.servers = null;

  GPLOY.prototype.connection = null;

  GPLOY.prototype.ignoreInclude = false;

  return GPLOY;

}).call(this);


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var Deploy, GPLOY, Generator, colors;

colors = require("colors");

Deploy = require("./deploy");

Generator = require("./generator");

module.exports = GPLOY = (function() {
  class GPLOY {
    constructor() {
      this.deploy = this.deploy.bind(this);
      // Call the gploy.yaml template generator
      if (process.argv[2] === "install") {
        new Generator();
      // Open the help
      } else if (process.argv[2] === "--help" || process.argv[2] === "-h") {
        console.log("show help");
      } else {
        // Deploy
        this.servers = process.argv.splice(2, process.argv.length);
        // Check if we should ignore the include parameter for this deploy
        this.ignoreInclude = this.servers.indexOf("-i") >= 0 || this.servers.indexOf("--ignore-include") >= 0;
        // Remove the ignore flag from the server list
        this.servers = this.servers.filter(function(value) {
          return value !== "-i" && value !== "--ignore-include";
        });
        if (this.servers.length === 0) {
          // If you don't set any servers, add an empty one to upload the first environment only
          this.servers.push(null);
        }
        this.deploy();
      }
    }

    deploy() {
      var code;
      // Dispose the current connection
      if (this.connection) {
        this.connection.dispose();
        this.connection = null;
      }
      // Keep deploying until all servers are updated
      if (this.servers.length) {
        this.connection = new Deploy(this.servers[0], this.ignoreInclude);
        this.connection.completed.add(this.deploy);
        return this.servers.shift();
      } else {
        // Finish the process
        console.log("All Completed :)".green.bold);
        return process.exit(code = 0);
      }
    }

  };

  GPLOY.prototype.servers = null;

  GPLOY.prototype.connection = null;

  GPLOY.prototype.ignoreInclude = false;

  return GPLOY;

}).call(this);
```

Response:
colors	= require "colors"

Deploy = require "./deploy"
Generator = require "./generator"

module.exports = class GPLOY

	servers			: null
	connection		: null
	ignoreInclude	: false

	constructor: ->
		# Call the gploy.yaml template generator
		if process.argv[2] == "install"
			new Generator()
		# Open the help
		else if process.argv[2] == "--help" or process.argv[2] == "-h"
			console.log "show help"
		# Deploy
		else
			@servers = process.argv.splice(2, process.argv.length)
			# Check if we should ignore the include parameter for this deploy
			@ignoreInclude = @servers.indexOf("-i") >= 0 or @servers.indexOf("--ignore-include") >= 0
			# Remove the ignore flag from the server list
			@servers = @servers.filter (value) -> value isnt "-i" and value isnt "--ignore-include"
			# If you don't set any servers, add an empty one to upload the first environment only
			@servers.push null if @servers.length is 0

			@deploy()

	deploy: =>
		# Dispose the current connection
		if @connection
			@connection.dispose()
			@connection = null

		# Keep deploying until all servers are updated
		if @servers.length
			@connection = new Deploy @servers[0], @ignoreInclude
			@connection.completed.add @deploy
			@servers.shift()
		# Finish the process
		else
			console.log "All Completed :)".green.bold
			process.exit(code=0)


Prompt:
colors	= require "colors"

Deploy = require "./deploy"
Generator = require "./generator"

module.exports = class GPLOY

	servers			: null
	connection		: null
	ignoreInclude	: false

	constructor: ->
		# Call the gploy.yaml template generator
		if process.argv[2] == "install"
			new Generator()
		# Open the help
		else if process.argv[2] == "--help" or process.argv[2] == "-h"
			console.log "show help"
		# Deploy
		else
			@servers = process.argv.splice(2, process.argv.length)
			# Check if we should ignore the include parameter for this deploy

Response:
@ignoreInclude = @servers.indexOf("-i") >= 0 or @servers.indexOf("--ignore-include") >= 0
			# Remove the ignore flag from the server list
			@servers = @servers.filter (value) -> value isnt "-i" and value isnt "--ignore-include"
			# If you don't set any servers, add an empty one to upload the first environment only
			@servers.push null if @servers.length is 0

			@deploy()

	deploy: =>
		# Dispose the current connection
		if @connection
			@connection.dispose()
			@connection = null

		# Keep deploying until all servers are updated
		if @servers.length
			@connection = new Deploy @servers[0], @ignoreInclude
			@connection.completed.add @deploy
			@servers.shift()
		# Finish the process
		else
			console.log "All Completed :)".green.bold
			process.exit(code=0)


Response:
colors	= require "colors"

Deploy = require "./deploy"
Generator = require "./generator"

module.exports = class GPLOY

	servers		: null
	connection	: null

	constructor: ->
		# Call the gploy.yaml template generator
		if process.argv[2] == "init" or process.argv[2] == "--init" or process.argv[2] == "--i"
			new Generator()
		# Open the help
		else if process.argv[2] == "help" or process.argv[2] == "--help" or process.argv[2] == "-h"
			console.log "show help"
		# Deploy
		else
			@servers = process.argv.splice(2, process.argv.length)
			@servers.push "default" if @servers.length is 0

			@deploy()

	deploy: =>
		# Dispose the current connection
		if @connection
			@connection.dispose()
			@connection = null

		# Keep deploying until all servers are updated
		if @servers.length
			@connection = new Deploy @servers[0]
			@connection.completed.add @deploy
			@servers.shift()
		# Finish the process
		else
			console.log "All Completed :)".green.bold
			process.exit(code=0)


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
colors	= require "colors"

Deploy = require "./deploy"
Generator = require "./generator"

module.exports = class GPLOY

	servers		: null
	connection	: null

	constructor: ->
		# Call the gploy.yaml template generator
		if process.argv[2] == "init" or process.argv[2] == "--init" or process.argv[2] == "--i"
			new Generator()
		# Open the help
		else if process.argv[2] == "help" or process.argv[2] == "--help" or process.argv[2] == "-h"
			console.log "show help"
		# Deploy
		else
			@servers = process.argv.splice(2, process.argv.length)
			@servers.push "default" if @servers.length is 0

			@deploy()

	deploy: =>
		# Dispose the current connection
		if @connection
			@connection.dispose()
			@connection = null

		# Keep deploying until all servers are updated
		if @servers.length
			@connection = new Deploy @servers[0]
			@connection.completed.add @deploy
			@servers.shift()
		# Finish the process
		else
			console.log "All Completed :)".green.bold
			process.exit(code=0)
```

Response:
var Deploy, GPLOY, Generator, colors;

colors = require("colors");

Deploy = require("./deploy");

Generator = require("./generator");

module.exports = GPLOY = (function() {
  class GPLOY {
    constructor() {
      this.deploy = this.deploy.bind(this);
      // Call the gploy.yaml template generator
      if (process.argv[2] === "init" || process.argv[2] === "--init" || process.argv[2] === "--i") {
        new Generator();
      // Open the help
      } else if (process.argv[2] === "help" || process.argv[2] === "--help" || process.argv[2] === "-h") {
        console.log("show help");
      } else {
        // Deploy
        this.servers = process.argv.splice(2, process.argv.length);
        if (this.servers.length === 0) {
          this.servers.push("default");
        }
        this.deploy();
      }
    }

    deploy() {
      var code;
      // Dispose the current connection
      if (this.connection) {
        this.connection.dispose();
        this.connection = null;
      }
      // Keep deploying until all servers are updated
      if (this.servers.length) {
        this.connection = new Deploy(this.servers[0]);
        this.connection.completed.add(this.deploy);
        return this.servers.shift();
      } else {
        // Finish the process
        console.log("All Completed :)".green.bold);
        return process.exit(code = 0);
      }
    }

  };

  GPLOY.prototype.servers = null;

  GPLOY.prototype.connection = null;

  return GPLOY;

}).call(this);


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var Deploy, GPLOY, Generator, colors;

colors = require("colors");

Deploy = require("./deploy");

Generator = require("./generator");

module.exports = GPLOY = (function() {
  class GPLOY {
    constructor() {
      this.deploy = this.deploy.bind(this);
      // Call the gploy.yaml template generator
      if (process.argv[2] === "init" || process.argv[2] === "--init" || process.argv[2] === "--i") {
        new Generator();
      // Open the help
      } else if (process.argv[2] === "help" || process.argv[2] === "--help" || process.argv[2] === "-h") {
        console.log("show help");
      } else {
        // Deploy
        this.servers = process.argv.splice(2, process.argv.length);
        if (this.servers.length === 0) {
          this.servers.push("default");
        }
        this.deploy();
      }
    }

    deploy() {
      var code;
      // Dispose the current connection
      if (this.connection) {
        this.connection.dispose();
        this.connection = null;
      }
      // Keep deploying until all servers are updated
      if (this.servers.length) {
        this.connection = new Deploy(this.servers[0]);
        this.connection.completed.add(this.deploy);
        return this.servers.shift();
      } else {
        // Finish the process
        console.log("All Completed :)".green.bold);
        return process.exit(code = 0);
      }
    }

  };

  GPLOY.prototype.servers = null;

  GPLOY.prototype.connection = null;

  return GPLOY;

}).call(this);
```

Response:
colors	= require "colors"

Deploy = require "./deploy"
Generator = require "./generator"

module.exports = class GPLOY

	servers		: null
	connection	: null

	constructor: ->
		# Call the gploy.yaml template generator
		if process.argv[2] == "init" or process.argv[2] == "--init" or process.argv[2] == "--i"
			new Generator()
		# Open the help
		else if process.argv[2] == "help" or process.argv[2] == "--help" or process.argv[2] == "-h"
			console.log "show help"
		# Deploy
		else
			@servers = process.argv.splice(2, process.argv.length)
			@servers.push "default" if @servers.length is 0

			@deploy()

	deploy: =>
		# Dispose the current connection
		if @connection
			@connection.dispose()
			@connection = null

		# Keep deploying until all servers are updated
		if @servers.length
			@connection = new Deploy @servers[0]
			@connection.completed.add @deploy
			@servers.shift()
		# Finish the process
		else
			console.log "All Completed :)".green.bold
			process.exit(code=0)


Prompt:
colors	= require "colors"

Deploy = require "./deploy"
Generator = require "./generator"

module.exports = class GPLOY

	servers		: null
	connection	: null

	constructor: ->
		# Call the gploy.yaml template generator
		if process.argv[2] == "init" or process.argv[2] == "--init" or process.argv[2] == "--i"
			new Generator()
		# Open the help
		else if process.argv[2] == "help" or process.argv[2] == "--help" or process.argv[2] == "-h"
			console.log "show help"
		# Deploy
		else

Response:
@servers = process.argv.splice(2, process.argv.length)
			@servers.push "default" if @servers.length is 0

			@deploy()

	deploy: =>
		# Dispose the current connection
		if @connection
			@connection.dispose()
			@connection = null

		# Keep deploying until all servers are updated
		if @servers.length
			@connection = new Deploy @servers[0]
			@connection.completed.add @deploy
			@servers.shift()
		# Finish the process
		else
			console.log "All Completed :)".green.bold
			process.exit(code=0)


Response:
colors	= require "colors"

Deploy = require "./deploy"
Generator = require "./generator"

module.exports = class GPLOY

	servers		: null
	connection	: null

	constructor: ->

		if process.argv[2] == "init"
			new Generator()
		else
			@servers = process.argv.splice(2, process.argv.length)
			@servers.push "default" if @servers.length is 0

			@deploy()

	deploy: =>
		if @connection
			@connection.dispose()
			@connection = null
			console.log ""

		if @servers.length
			@connection = new Deploy @servers[0], @deploy
			@connection.completed.add @deploy
			@servers.shift()
		else
			console.log "All Completed :)".green.bold
			process.exit(code=0)


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
colors	= require "colors"

Deploy = require "./deploy"
Generator = require "./generator"

module.exports = class GPLOY

	servers		: null
	connection	: null

	constructor: ->

		if process.argv[2] == "init"
			new Generator()
		else
			@servers = process.argv.splice(2, process.argv.length)
			@servers.push "default" if @servers.length is 0

			@deploy()

	deploy: =>
		if @connection
			@connection.dispose()
			@connection = null
			console.log ""

		if @servers.length
			@connection = new Deploy @servers[0], @deploy
			@connection.completed.add @deploy
			@servers.shift()
		else
			console.log "All Completed :)".green.bold
			process.exit(code=0)
```

Response:
var Deploy, GPLOY, Generator, colors;

colors = require("colors");

Deploy = require("./deploy");

Generator = require("./generator");

module.exports = GPLOY = (function() {
  class GPLOY {
    constructor() {
      this.deploy = this.deploy.bind(this);
      if (process.argv[2] === "init") {
        new Generator();
      } else {
        this.servers = process.argv.splice(2, process.argv.length);
        if (this.servers.length === 0) {
          this.servers.push("default");
        }
        this.deploy();
      }
    }

    deploy() {
      var code;
      if (this.connection) {
        this.connection.dispose();
        this.connection = null;
        console.log("");
      }
      if (this.servers.length) {
        this.connection = new Deploy(this.servers[0], this.deploy);
        this.connection.completed.add(this.deploy);
        return this.servers.shift();
      } else {
        console.log("All Completed :)".green.bold);
        return process.exit(code = 0);
      }
    }

  };

  GPLOY.prototype.servers = null;

  GPLOY.prototype.connection = null;

  return GPLOY;

}).call(this);


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var Deploy, GPLOY, Generator, colors;

colors = require("colors");

Deploy = require("./deploy");

Generator = require("./generator");

module.exports = GPLOY = (function() {
  class GPLOY {
    constructor() {
      this.deploy = this.deploy.bind(this);
      if (process.argv[2] === "init") {
        new Generator();
      } else {
        this.servers = process.argv.splice(2, process.argv.length);
        if (this.servers.length === 0) {
          this.servers.push("default");
        }
        this.deploy();
      }
    }

    deploy() {
      var code;
      if (this.connection) {
        this.connection.dispose();
        this.connection = null;
        console.log("");
      }
      if (this.servers.length) {
        this.connection = new Deploy(this.servers[0], this.deploy);
        this.connection.completed.add(this.deploy);
        return this.servers.shift();
      } else {
        console.log("All Completed :)".green.bold);
        return process.exit(code = 0);
      }
    }

  };

  GPLOY.prototype.servers = null;

  GPLOY.prototype.connection = null;

  return GPLOY;

}).call(this);
```

Response:
colors	= require "colors"

Deploy = require "./deploy"
Generator = require "./generator"

module.exports = class GPLOY

	servers		: null
	connection	: null

	constructor: ->

		if process.argv[2] == "init"
			new Generator()
		else
			@servers = process.argv.splice(2, process.argv.length)
			@servers.push "default" if @servers.length is 0

			@deploy()

	deploy: =>
		if @connection
			@connection.dispose()
			@connection = null
			console.log ""

		if @servers.length
			@connection = new Deploy @servers[0], @deploy
			@connection.completed.add @deploy
			@servers.shift()
		else
			console.log "All Completed :)".green.bold
			process.exit(code=0)


Prompt:
colors	= require "colors"

Deploy = require "./deploy"
Generator = require "./generator"

module.exports = class GPLOY

	servers		: null
	connection	: null

	constructor: ->

		if process.argv[2] == "init"
			new Generator()
		else
			@servers = process.argv.splice(2, process.argv.length)

Response:
@servers.push "default" if @servers.length is 0

			@deploy()

	deploy: =>
		if @connection
			@connection.dispose()
			@connection = null
			console.log ""

		if @servers.length
			@connection = new Deploy @servers[0], @deploy
			@connection.completed.add @deploy
			@servers.shift()
		else
			console.log "All Completed :)".green.bold
			process.exit(code=0)


Response:
colors	= require "colors"

Deploy = require './deploy'
Generator = require './generator'

module.exports = class GPLOY

	servers		: null
	connection	: null

	constructor: ->

		if process.argv[2] == "init"
			new Generator()
		else
			@servers = process.argv.splice(2, process.argv.length)
			@servers.push "default" if @servers.length is 0

			@deploy()

	deploy: =>
		if @connection
			@connection.dispose()
			@connection = null
			console.log ""

		if @servers.length
			@connection = new Deploy @servers[0], @deploy
			@connection.completed.add @deploy
			@servers.shift()
		else
			console.log "All Completed :)".green.bold
			process.exit(code=0)


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
colors	= require "colors"

Deploy = require './deploy'
Generator = require './generator'

module.exports = class GPLOY

	servers		: null
	connection	: null

	constructor: ->

		if process.argv[2] == "init"
			new Generator()
		else
			@servers = process.argv.splice(2, process.argv.length)
			@servers.push "default" if @servers.length is 0

			@deploy()

	deploy: =>
		if @connection
			@connection.dispose()
			@connection = null
			console.log ""

		if @servers.length
			@connection = new Deploy @servers[0], @deploy
			@connection.completed.add @deploy
			@servers.shift()
		else
			console.log "All Completed :)".green.bold
			process.exit(code=0)
```

Response:
var Deploy, GPLOY, Generator, colors;

colors = require("colors");

Deploy = require('./deploy');

Generator = require('./generator');

module.exports = GPLOY = (function() {
  class GPLOY {
    constructor() {
      this.deploy = this.deploy.bind(this);
      if (process.argv[2] === "init") {
        new Generator();
      } else {
        this.servers = process.argv.splice(2, process.argv.length);
        if (this.servers.length === 0) {
          this.servers.push("default");
        }
        this.deploy();
      }
    }

    deploy() {
      var code;
      if (this.connection) {
        this.connection.dispose();
        this.connection = null;
        console.log("");
      }
      if (this.servers.length) {
        this.connection = new Deploy(this.servers[0], this.deploy);
        this.connection.completed.add(this.deploy);
        return this.servers.shift();
      } else {
        console.log("All Completed :)".green.bold);
        return process.exit(code = 0);
      }
    }

  };

  GPLOY.prototype.servers = null;

  GPLOY.prototype.connection = null;

  return GPLOY;

}).call(this);


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var Deploy, GPLOY, Generator, colors;

colors = require("colors");

Deploy = require('./deploy');

Generator = require('./generator');

module.exports = GPLOY = (function() {
  class GPLOY {
    constructor() {
      this.deploy = this.deploy.bind(this);
      if (process.argv[2] === "init") {
        new Generator();
      } else {
        this.servers = process.argv.splice(2, process.argv.length);
        if (this.servers.length === 0) {
          this.servers.push("default");
        }
        this.deploy();
      }
    }

    deploy() {
      var code;
      if (this.connection) {
        this.connection.dispose();
        this.connection = null;
        console.log("");
      }
      if (this.servers.length) {
        this.connection = new Deploy(this.servers[0], this.deploy);
        this.connection.completed.add(this.deploy);
        return this.servers.shift();
      } else {
        console.log("All Completed :)".green.bold);
        return process.exit(code = 0);
      }
    }

  };

  GPLOY.prototype.servers = null;

  GPLOY.prototype.connection = null;

  return GPLOY;

}).call(this);
```

Response:
colors	= require "colors"

Deploy = require './deploy'
Generator = require './generator'

module.exports = class GPLOY

	servers		: null
	connection	: null

	constructor: ->

		if process.argv[2] == "init"
			new Generator()
		else
			@servers = process.argv.splice(2, process.argv.length)
			@servers.push "default" if @servers.length is 0

			@deploy()

	deploy: =>
		if @connection
			@connection.dispose()
			@connection = null
			console.log ""

		if @servers.length
			@connection = new Deploy @servers[0], @deploy
			@connection.completed.add @deploy
			@servers.shift()
		else
			console.log "All Completed :)".green.bold
			process.exit(code=0)


Prompt:
colors	= require "colors"

Deploy = require './deploy'
Generator = require './generator'

module.exports = class GPLOY

	servers		: null
	connection	: null

	constructor: ->

		if process.argv[2] == "init"
			new Generator()
		else
			@servers = process.argv.splice(2, process.argv.length)

Response:
@servers.push "default" if @servers.length is 0

			@deploy()

	deploy: =>
		if @connection
			@connection.dispose()
			@connection = null
			console.log ""

		if @servers.length
			@connection = new Deploy @servers[0], @deploy
			@connection.completed.add @deploy
			@servers.shift()
		else
			console.log "All Completed :)".green.bold
			process.exit(code=0)


Response:
colors	= require "colors"

Deploy = require './deploy'
Generator = require './generator'

module.exports = class GPLOY

	servers		: null
	connection	: null

	constructor: ->
		if process.argv[2] == "init"
			new Generator()
		else
			@servers = process.argv.splice(2, process.argv.length)
			@servers.push "default" if @servers.length is 0

			@deploy()

	deploy: =>
		if @connection
			@connection.dispose()
			@connection = null
			console.log ""

		if @servers.length
			@connection = new Deploy @servers[0], @deploy
			@connection.completed.add @deploy
			@servers.shift()
		else
			console.log "All Completed".green.bold
			process.exit(code=0)


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
colors	= require "colors"

Deploy = require './deploy'
Generator = require './generator'

module.exports = class GPLOY

	servers		: null
	connection	: null

	constructor: ->
		if process.argv[2] == "init"
			new Generator()
		else
			@servers = process.argv.splice(2, process.argv.length)
			@servers.push "default" if @servers.length is 0

			@deploy()

	deploy: =>
		if @connection
			@connection.dispose()
			@connection = null
			console.log ""

		if @servers.length
			@connection = new Deploy @servers[0], @deploy
			@connection.completed.add @deploy
			@servers.shift()
		else
			console.log "All Completed".green.bold
			process.exit(code=0)
```

Response:
var Deploy, GPLOY, Generator, colors;

colors = require("colors");

Deploy = require('./deploy');

Generator = require('./generator');

module.exports = GPLOY = (function() {
  class GPLOY {
    constructor() {
      this.deploy = this.deploy.bind(this);
      if (process.argv[2] === "init") {
        new Generator();
      } else {
        this.servers = process.argv.splice(2, process.argv.length);
        if (this.servers.length === 0) {
          this.servers.push("default");
        }
        this.deploy();
      }
    }

    deploy() {
      var code;
      if (this.connection) {
        this.connection.dispose();
        this.connection = null;
        console.log("");
      }
      if (this.servers.length) {
        this.connection = new Deploy(this.servers[0], this.deploy);
        this.connection.completed.add(this.deploy);
        return this.servers.shift();
      } else {
        console.log("All Completed".green.bold);
        return process.exit(code = 0);
      }
    }

  };

  GPLOY.prototype.servers = null;

  GPLOY.prototype.connection = null;

  return GPLOY;

}).call(this);


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var Deploy, GPLOY, Generator, colors;

colors = require("colors");

Deploy = require('./deploy');

Generator = require('./generator');

module.exports = GPLOY = (function() {
  class GPLOY {
    constructor() {
      this.deploy = this.deploy.bind(this);
      if (process.argv[2] === "init") {
        new Generator();
      } else {
        this.servers = process.argv.splice(2, process.argv.length);
        if (this.servers.length === 0) {
          this.servers.push("default");
        }
        this.deploy();
      }
    }

    deploy() {
      var code;
      if (this.connection) {
        this.connection.dispose();
        this.connection = null;
        console.log("");
      }
      if (this.servers.length) {
        this.connection = new Deploy(this.servers[0], this.deploy);
        this.connection.completed.add(this.deploy);
        return this.servers.shift();
      } else {
        console.log("All Completed".green.bold);
        return process.exit(code = 0);
      }
    }

  };

  GPLOY.prototype.servers = null;

  GPLOY.prototype.connection = null;

  return GPLOY;

}).call(this);
```

Response:
colors	= require "colors"

Deploy = require './deploy'
Generator = require './generator'

module.exports = class GPLOY

	servers		: null
	connection	: null

	constructor: ->
		if process.argv[2] == "init"
			new Generator()
		else
			@servers = process.argv.splice(2, process.argv.length)
			@servers.push "default" if @servers.length is 0

			@deploy()

	deploy: =>
		if @connection
			@connection.dispose()
			@connection = null
			console.log ""

		if @servers.length
			@connection = new Deploy @servers[0], @deploy
			@connection.completed.add @deploy
			@servers.shift()
		else
			console.log "All Completed".green.bold
			process.exit(code=0)


Prompt:
colors	= require "colors"

Deploy = require './deploy'
Generator = require './generator'

module.exports = class GPLOY

	servers		: null
	connection	: null

	constructor: ->
		if process.argv[2] == "init"
			new Generator()
		else
			@servers = process.argv.splice(2, process.argv.length)
			@servers.push "default" if @servers.length is 0

Response:
@deploy()

	deploy: =>
		if @connection
			@connection.dispose()
			@connection = null
			console.log ""

		if @servers.length
			@connection = new Deploy @servers[0], @deploy
			@connection.completed.add @deploy
			@servers.shift()
		else
			console.log "All Completed".green.bold
			process.exit(code=0)


Response:
XMLNode = require './XMLNode'
NodeType = require './NodeType'

# Represents a  CDATA node
module.exports = class XMLDocumentFragment extends XMLNode

  # Initializes a new instance of `XMLDocumentFragment`
  #
  constructor: () ->
    super null

    @name = "#document-fragment"
    @type = NodeType.DocumentFragment


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
XMLNode = require './XMLNode'
NodeType = require './NodeType'

# Represents a  CDATA node
module.exports = class XMLDocumentFragment extends XMLNode

  # Initializes a new instance of `XMLDocumentFragment`
  #
  constructor: () ->
    super null

    @name = "#document-fragment"
    @type = NodeType.DocumentFragment
```

Response:
var NodeType, XMLDocumentFragment, XMLNode;

XMLNode = require('./XMLNode');

NodeType = require('./NodeType');

// Represents a  CDATA node
module.exports = XMLDocumentFragment = class XMLDocumentFragment extends XMLNode {
  // Initializes a new instance of `XMLDocumentFragment`

  constructor() {
    super(null);
    this.name = "#document-fragment";
    this.type = NodeType.DocumentFragment;
  }

};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var NodeType, XMLDocumentFragment, XMLNode;

XMLNode = require('./XMLNode');

NodeType = require('./NodeType');

// Represents a  CDATA node
module.exports = XMLDocumentFragment = class XMLDocumentFragment extends XMLNode {
  // Initializes a new instance of `XMLDocumentFragment`

  constructor() {
    super(null);
    this.name = "#document-fragment";
    this.type = NodeType.DocumentFragment;
  }

};
```

Response:
XMLNode = require './XMLNode'
NodeType = require './NodeType'

# Represents a  CDATA node
module.exports = class XMLDocumentFragment extends XMLNode

  # Initializes a new instance of `XMLDocumentFragment`
  #
  constructor: () ->
    super null

    @name = "#document-fragment"
    @type = NodeType.DocumentFragment


Prompt:
XMLNode = require './XMLNode'
NodeType = require './NodeType'

# Represents a  CDATA node
module.exports = class XMLDocumentFragment extends XMLNode

Response:
# Initializes a new instance of `XMLDocumentFragment`
  #
  constructor: () ->
    super null

    @name = "#document-fragment"
    @type = NodeType.DocumentFragment


Response:
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

#
# Annotation Chart Widget
#
cyclotronApp.controller 'AnnotationChartWidget', ($scope, configService, dashboardService, dataService) ->

    $scope.loading = false
    $scope.dataSourceError = false
    $scope.dataSourceErrorMessage = null

    widgetConfig = configService.widgets.annotationChart
    themeOptions = widgetConfig.themes[$scope.widget.theme]?.options || {}

    $scope.chartObject =
        type: 'AnnotationChart'
        options: _.assign _.cloneDeep(widgetConfig.options), themeOptions

    $scope.widgetTitle = -> _.jsExec $scope.widget.title

    $scope.updateChart = (data) ->
        return unless $scope.widget.xAxis.column? and $scope.widget.series?

        chartData =
            cols: []
            rows: []


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

#
# Annotation Chart Widget
#
cyclotronApp.controller 'AnnotationChartWidget', ($scope, configService, dashboardService, dataService) ->

    $scope.loading = false
    $scope.dataSourceError = false
    $scope.dataSourceErrorMessage = null

    widgetConfig = configService.widgets.annotationChart
    themeOptions = widgetConfig.themes[$scope.widget.theme]?.options || {}

    $scope.chartObject =
        type: 'AnnotationChart'
        options: _.assign _.cloneDeep(widgetConfig.options), themeOptions

    $scope.widgetTitle = -> _.jsExec $scope.widget.title

    $scope.updateChart = (data) ->
        return unless $scope.widget.xAxis.column? and $scope.widget.series?

        chartData =
            cols: []
            rows: []
```

Response:
/*
 * Copyright (c) 2013-2015 the original author or authors.
 *
 * Licensed under the MIT License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.opensource.org/licenses/mit-license.php
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the License.
 */

// Annotation Chart Widget

cyclotronApp.controller('AnnotationChartWidget', function($scope, configService, dashboardService, dataService) {
  var ref, themeOptions, widgetConfig;
  $scope.loading = false;
  $scope.dataSourceError = false;
  $scope.dataSourceErrorMessage = null;
  widgetConfig = configService.widgets.annotationChart;
  themeOptions = ((ref = widgetConfig.themes[$scope.widget.theme]) != null ? ref.options : void 0) || {};
  $scope.chartObject = {
    type: 'AnnotationChart',
    options: _.assign(_.cloneDeep(widgetConfig.options), themeOptions)
  };
  $scope.widgetTitle = function() {
    return _.jsExec($scope.widget.title);
  };
  return $scope.updateChart = function(data) {
    var chartData;
    if (!(($scope.widget.xAxis.column != null) && ($scope.widget.series != null))) {
      return;
    }
    return chartData = {
      cols: [],
      rows: []
    };
  };
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
/*
 * Copyright (c) 2013-2015 the original author or authors.
 *
 * Licensed under the MIT License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.opensource.org/licenses/mit-license.php
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the License.
 */

// Annotation Chart Widget

cyclotronApp.controller('AnnotationChartWidget', function($scope, configService, dashboardService, dataService) {
  var ref, themeOptions, widgetConfig;
  $scope.loading = false;
  $scope.dataSourceError = false;
  $scope.dataSourceErrorMessage = null;
  widgetConfig = configService.widgets.annotationChart;
  themeOptions = ((ref = widgetConfig.themes[$scope.widget.theme]) != null ? ref.options : void 0) || {};
  $scope.chartObject = {
    type: 'AnnotationChart',
    options: _.assign(_.cloneDeep(widgetConfig.options), themeOptions)
  };
  $scope.widgetTitle = function() {
    return _.jsExec($scope.widget.title);
  };
  return $scope.updateChart = function(data) {
    var chartData;
    if (!(($scope.widget.xAxis.column != null) && ($scope.widget.series != null))) {
      return;
    }
    return chartData = {
      cols: [],
      rows: []
    };
  };
});
```

Response:
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

#
# Annotation Chart Widget
#
cyclotronApp.controller 'AnnotationChartWidget', ($scope, configService, dashboardService, dataService) ->

    $scope.loading = false
    $scope.dataSourceError = false
    $scope.dataSourceErrorMessage = null

    widgetConfig = configService.widgets.annotationChart
    themeOptions = widgetConfig.themes[$scope.widget.theme]?.options || {}

    $scope.chartObject =
        type: 'AnnotationChart'
        options: _.assign _.cloneDeep(widgetConfig.options), themeOptions

    $scope.widgetTitle = -> _.jsExec $scope.widget.title

    $scope.updateChart = (data) ->
        return unless $scope.widget.xAxis.column? and $scope.widget.series?

        chartData =
            cols: []
            rows: []


Prompt:
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

#
# Annotation Chart Widget
#
cyclotronApp.controller 'AnnotationChartWidget', ($scope, configService, dashboardService, dataService) ->

Response:
$scope.loading = false
    $scope.dataSourceError = false
    $scope.dataSourceErrorMessage = null

    widgetConfig = configService.widgets.annotationChart
    themeOptions = widgetConfig.themes[$scope.widget.theme]?.options || {}

    $scope.chartObject =
        type: 'AnnotationChart'
        options: _.assign _.cloneDeep(widgetConfig.options), themeOptions

    $scope.widgetTitle = -> _.jsExec $scope.widget.title

    $scope.updateChart = (data) ->
        return unless $scope.widget.xAxis.column? and $scope.widget.series?

        chartData =
            cols: []
            rows: []


Response:
secondaryAxis = null

        # xAxis
        xAxisId = _.jsExec $scope.widget.xAxis.column

        chartData.cols.push {
            id: xAxisId
            label: 'xAxisLabel'
            type: 'datetime'
        }

        xAxisFormatter = switch $scope.widget.xAxis.format
            when 'epoch' then (d) ->
                moment.unix(d).toDate()
            when 'epochmillis' then (d) ->
                moment(d).toDate()
            when 'string' then (d) ->
                if $scope.widget.xAxis.formatString?
                    moment(d, $scope.widget.xAxis.formatString).toDate()
                else
                    moment(d).toDate()
            else _.identity

        # Series
        _.each $scope.widget.series, (series, index) ->
            columnId = _.jsExec series.column
            label = _.jsExec series.label
            if !label? then label = _.titleCase columnId

            if series.secondaryAxis == true
                secondaryAxis = index

            chartData.cols.push {
                id: columnId
                label: label
                type: 'number'
            }

            if series.annotationTitleColumn?
                id = _.jsExec series.annotationTitleColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-title'
                    type: 'string'
                }


Prompt:
secondaryAxis = null

        # xAxis
        xAxisId = _.jsExec $scope.widget.xAxis.column

        chartData.cols.push {
            id: xAxisId
            label: 'xAxisLabel'
            type: 'datetime'
        }

        xAxisFormatter = switch $scope.widget.xAxis.format
            when 'epoch' then (d) ->
                moment.unix(d).toDate()
            when 'epochmillis' then (d) ->
                moment(d).toDate()
            when 'string' then (d) ->
                if $scope.widget.xAxis.formatString?
                    moment(d, $scope.widget.xAxis.formatString).toDate()
                else
                    moment(d).toDate()
            else _.identity

Response:
# Series
        _.each $scope.widget.series, (series, index) ->
            columnId = _.jsExec series.column
            label = _.jsExec series.label
            if !label? then label = _.titleCase columnId

            if series.secondaryAxis == true
                secondaryAxis = index

            chartData.cols.push {
                id: columnId
                label: label
                type: 'number'
            }

            if series.annotationTitleColumn?
                id = _.jsExec series.annotationTitleColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-title'
                    type: 'string'
                }


Response:
if series.annotationTextColumn?
                id = _.jsExec series.annotationTextColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-text'
                    type: 'string'
                }

        if secondaryAxis?
            scaleColumns = switch secondaryAxis
                when 0 then [0, 1]
                else [secondaryAxis, 0]
            $scope.chartObject.options.scaleColumns = scaleColumns

        chartData.rows = _.map data, (row) ->
            {
                c: _.map chartData.cols, (column) ->
                    if column.type == 'datetime'
                        { v: xAxisFormatter(row[column.id]) }
                    else
                        { v: row[column.id] }
            }

        $scope.chartObject.data = chartData
        _.merge $scope.chartObject.options, _.compile($scope.widget.options, {})

    $scope.reload = ->
        $scope.dataSource.execute(true)

    $scope.handleError = (message) ->
        console.log 'Annotation Chart error: ' + message

    # Load Data Source
    dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
    $scope.dataSource = dataService.get dsDefinition

    # Initialize
    if $scope.dataSource?
        $scope.dataVersion = 0
        $scope.loading = true


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
if series.annotationTextColumn?
                id = _.jsExec series.annotationTextColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-text'
                    type: 'string'
                }

        if secondaryAxis?
            scaleColumns = switch secondaryAxis
                when 0 then [0, 1]
                else [secondaryAxis, 0]
            $scope.chartObject.options.scaleColumns = scaleColumns

        chartData.rows = _.map data, (row) ->
            {
                c: _.map chartData.cols, (column) ->
                    if column.type == 'datetime'
                        { v: xAxisFormatter(row[column.id]) }
                    else
                        { v: row[column.id] }
            }

        $scope.chartObject.data = chartData
        _.merge $scope.chartObject.options, _.compile($scope.widget.options, {})

    $scope.reload = ->
        $scope.dataSource.execute(true)

    $scope.handleError = (message) ->
        console.log 'Annotation Chart error: ' + message

    # Load Data Source
    dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
    $scope.dataSource = dataService.get dsDefinition

    # Initialize
    if $scope.dataSource?
        $scope.dataVersion = 0
        $scope.loading = true
```

Response:
var dsDefinition, id, scaleColumns;

if (series.annotationTextColumn != null) {
  id = _.jsExec(series.annotationTextColumn);
  chartData.cols.push({
    id: id,
    label: columnId + '-text',
    type: 'string'
  });
}

if (typeof secondaryAxis !== "undefined" && secondaryAxis !== null) {
  scaleColumns = (function() {
    switch (secondaryAxis) {
      case 0:
        return [0, 1];
      default:
        return [secondaryAxis, 0];
    }
  })();
  $scope.chartObject.options.scaleColumns = scaleColumns;
}

chartData.rows = _.map(data, function(row) {
  return {
    c: _.map(chartData.cols, function(column) {
      if (column.type === 'datetime') {
        return {
          v: xAxisFormatter(row[column.id])
        };
      } else {
        return {
          v: row[column.id]
        };
      }
    })
  };
});

$scope.chartObject.data = chartData;

_.merge($scope.chartObject.options, _.compile($scope.widget.options, {}));

$scope.reload = function() {
  return $scope.dataSource.execute(true);
};

$scope.handleError = function(message) {
  return console.log('Annotation Chart error: ' + message);
};

// Load Data Source
dsDefinition = dashboardService.getDataSource($scope.dashboard, $scope.widget);

$scope.dataSource = dataService.get(dsDefinition);

// Initialize
if ($scope.dataSource != null) {
  $scope.dataVersion = 0;
  $scope.loading = true;
}


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var dsDefinition, id, scaleColumns;

if (series.annotationTextColumn != null) {
  id = _.jsExec(series.annotationTextColumn);
  chartData.cols.push({
    id: id,
    label: columnId + '-text',
    type: 'string'
  });
}

if (typeof secondaryAxis !== "undefined" && secondaryAxis !== null) {
  scaleColumns = (function() {
    switch (secondaryAxis) {
      case 0:
        return [0, 1];
      default:
        return [secondaryAxis, 0];
    }
  })();
  $scope.chartObject.options.scaleColumns = scaleColumns;
}

chartData.rows = _.map(data, function(row) {
  return {
    c: _.map(chartData.cols, function(column) {
      if (column.type === 'datetime') {
        return {
          v: xAxisFormatter(row[column.id])
        };
      } else {
        return {
          v: row[column.id]
        };
      }
    })
  };
});

$scope.chartObject.data = chartData;

_.merge($scope.chartObject.options, _.compile($scope.widget.options, {}));

$scope.reload = function() {
  return $scope.dataSource.execute(true);
};

$scope.handleError = function(message) {
  return console.log('Annotation Chart error: ' + message);
};

// Load Data Source
dsDefinition = dashboardService.getDataSource($scope.dashboard, $scope.widget);

$scope.dataSource = dataService.get(dsDefinition);

// Initialize
if ($scope.dataSource != null) {
  $scope.dataVersion = 0;
  $scope.loading = true;
}
```

Response:
if series.annotationTextColumn?
                id = _.jsExec series.annotationTextColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-text'
                    type: 'string'
                }

        if secondaryAxis?
            scaleColumns = switch secondaryAxis
                when 0 then [0, 1]
                else [secondaryAxis, 0]
            $scope.chartObject.options.scaleColumns = scaleColumns

        chartData.rows = _.map data, (row) ->
            {
                c: _.map chartData.cols, (column) ->
                    if column.type == 'datetime'
                        { v: xAxisFormatter(row[column.id]) }
                    else
                        { v: row[column.id] }
            }

        $scope.chartObject.data = chartData
        _.merge $scope.chartObject.options, _.compile($scope.widget.options, {})

    $scope.reload = ->
        $scope.dataSource.execute(true)

    $scope.handleError = (message) ->
        console.log 'Annotation Chart error: ' + message

    # Load Data Source
    dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
    $scope.dataSource = dataService.get dsDefinition

    # Initialize
    if $scope.dataSource?
        $scope.dataVersion = 0
        $scope.loading = true


Prompt:
if series.annotationTextColumn?
                id = _.jsExec series.annotationTextColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-text'
                    type: 'string'
                }

        if secondaryAxis?
            scaleColumns = switch secondaryAxis
                when 0 then [0, 1]
                else [secondaryAxis, 0]
            $scope.chartObject.options.scaleColumns = scaleColumns

        chartData.rows = _.map data, (row) ->
            {
                c: _.map chartData.cols, (column) ->
                    if column.type == 'datetime'
                        { v: xAxisFormatter(row[column.id]) }
                    else

Response:
{ v: row[column.id] }
            }

        $scope.chartObject.data = chartData
        _.merge $scope.chartObject.options, _.compile($scope.widget.options, {})

    $scope.reload = ->
        $scope.dataSource.execute(true)

    $scope.handleError = (message) ->
        console.log 'Annotation Chart error: ' + message

    # Load Data Source
    dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
    $scope.dataSource = dataService.get dsDefinition

    # Initialize
    if $scope.dataSource?
        $scope.dataVersion = 0
        $scope.loading = true


Response:
# Data Source (re)loaded
        $scope.$on 'dataSource:' + dsDefinition.name + ':data', (event, eventData) ->
            return unless eventData.version > $scope.dataVersion
            $scope.dataVersion = eventData.version

            $scope.dataSourceError = false
            $scope.dataSourceErrorMessage = null

            data = eventData.data[dsDefinition.resultSet].data

            # Filter the data if the widget has "filters"
            if $scope.widget.filters?
                data = dataService.filter(data, $scope.widget.filters)

            # Sort the data if the widget has "sortBy"
            if $scope.widget.sortBy?
                data = dataService.sort(data, $scope.widget.sortBy)

            # Check for no data
            if _.isEmpty(data) && $scope.widget.noData?
                $scope.nodata = _.jsExec($scope.widget.noData)
            else
                $scope.nodata = null
                $scope.updateChart data

            $scope.loading = false

        # Data Source error
        $scope.$on 'dataSource:' + dsDefinition.name + ':error', (event, data) ->
            $scope.dataSourceError = true
            $scope.dataSourceErrorMessage = data.error
            $scope.nodata = null
            $scope.loading = false

        # Data Source loading
        $scope.$on 'dataSource:' + dsDefinition.name + ':loading', ->
            $scope.loading = true

        # Initialize the Data Source
        $scope.dataSource.init dsDefinition


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
# Data Source (re)loaded
        $scope.$on 'dataSource:' + dsDefinition.name + ':data', (event, eventData) ->
            return unless eventData.version > $scope.dataVersion
            $scope.dataVersion = eventData.version

            $scope.dataSourceError = false
            $scope.dataSourceErrorMessage = null

            data = eventData.data[dsDefinition.resultSet].data

            # Filter the data if the widget has "filters"
            if $scope.widget.filters?
                data = dataService.filter(data, $scope.widget.filters)

            # Sort the data if the widget has "sortBy"
            if $scope.widget.sortBy?
                data = dataService.sort(data, $scope.widget.sortBy)

            # Check for no data
            if _.isEmpty(data) && $scope.widget.noData?
                $scope.nodata = _.jsExec($scope.widget.noData)
            else
                $scope.nodata = null
                $scope.updateChart data

            $scope.loading = false

        # Data Source error
        $scope.$on 'dataSource:' + dsDefinition.name + ':error', (event, data) ->
            $scope.dataSourceError = true
            $scope.dataSourceErrorMessage = data.error
            $scope.nodata = null
            $scope.loading = false

        # Data Source loading
        $scope.$on 'dataSource:' + dsDefinition.name + ':loading', ->
            $scope.loading = true

        # Initialize the Data Source
        $scope.dataSource.init dsDefinition
```

Response:
// Data Source (re)loaded
$scope.$on('dataSource:' + dsDefinition.name + ':data', function(event, eventData) {
  var data;
  if (!(eventData.version > $scope.dataVersion)) {
    return;
  }
  $scope.dataVersion = eventData.version;
  $scope.dataSourceError = false;
  $scope.dataSourceErrorMessage = null;
  data = eventData.data[dsDefinition.resultSet].data;
  // Filter the data if the widget has "filters"
  if ($scope.widget.filters != null) {
    data = dataService.filter(data, $scope.widget.filters);
  }
  // Sort the data if the widget has "sortBy"
  if ($scope.widget.sortBy != null) {
    data = dataService.sort(data, $scope.widget.sortBy);
  }
  // Check for no data
  if (_.isEmpty(data) && ($scope.widget.noData != null)) {
    $scope.nodata = _.jsExec($scope.widget.noData);
  } else {
    $scope.nodata = null;
    $scope.updateChart(data);
  }
  return $scope.loading = false;
});

// Data Source error
$scope.$on('dataSource:' + dsDefinition.name + ':error', function(event, data) {
  $scope.dataSourceError = true;
  $scope.dataSourceErrorMessage = data.error;
  $scope.nodata = null;
  return $scope.loading = false;
});

// Data Source loading
$scope.$on('dataSource:' + dsDefinition.name + ':loading', function() {
  return $scope.loading = true;
});

// Initialize the Data Source
$scope.dataSource.init(dsDefinition);


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
// Data Source (re)loaded
$scope.$on('dataSource:' + dsDefinition.name + ':data', function(event, eventData) {
  var data;
  if (!(eventData.version > $scope.dataVersion)) {
    return;
  }
  $scope.dataVersion = eventData.version;
  $scope.dataSourceError = false;
  $scope.dataSourceErrorMessage = null;
  data = eventData.data[dsDefinition.resultSet].data;
  // Filter the data if the widget has "filters"
  if ($scope.widget.filters != null) {
    data = dataService.filter(data, $scope.widget.filters);
  }
  // Sort the data if the widget has "sortBy"
  if ($scope.widget.sortBy != null) {
    data = dataService.sort(data, $scope.widget.sortBy);
  }
  // Check for no data
  if (_.isEmpty(data) && ($scope.widget.noData != null)) {
    $scope.nodata = _.jsExec($scope.widget.noData);
  } else {
    $scope.nodata = null;
    $scope.updateChart(data);
  }
  return $scope.loading = false;
});

// Data Source error
$scope.$on('dataSource:' + dsDefinition.name + ':error', function(event, data) {
  $scope.dataSourceError = true;
  $scope.dataSourceErrorMessage = data.error;
  $scope.nodata = null;
  return $scope.loading = false;
});

// Data Source loading
$scope.$on('dataSource:' + dsDefinition.name + ':loading', function() {
  return $scope.loading = true;
});

// Initialize the Data Source
$scope.dataSource.init(dsDefinition);
```

Response:
# Data Source (re)loaded
        $scope.$on 'dataSource:' + dsDefinition.name + ':data', (event, eventData) ->
            return unless eventData.version > $scope.dataVersion
            $scope.dataVersion = eventData.version

            $scope.dataSourceError = false
            $scope.dataSourceErrorMessage = null

            data = eventData.data[dsDefinition.resultSet].data

            # Filter the data if the widget has "filters"
            if $scope.widget.filters?
                data = dataService.filter(data, $scope.widget.filters)

            # Sort the data if the widget has "sortBy"
            if $scope.widget.sortBy?
                data = dataService.sort(data, $scope.widget.sortBy)

            # Check for no data
            if _.isEmpty(data) && $scope.widget.noData?
                $scope.nodata = _.jsExec($scope.widget.noData)
            else
                $scope.nodata = null
                $scope.updateChart data

            $scope.loading = false

        # Data Source error
        $scope.$on 'dataSource:' + dsDefinition.name + ':error', (event, data) ->
            $scope.dataSourceError = true
            $scope.dataSourceErrorMessage = data.error
            $scope.nodata = null
            $scope.loading = false

        # Data Source loading
        $scope.$on 'dataSource:' + dsDefinition.name + ':loading', ->
            $scope.loading = true

        # Initialize the Data Source
        $scope.dataSource.init dsDefinition


Prompt:
# Data Source (re)loaded
        $scope.$on 'dataSource:' + dsDefinition.name + ':data', (event, eventData) ->
            return unless eventData.version > $scope.dataVersion
            $scope.dataVersion = eventData.version

            $scope.dataSourceError = false
            $scope.dataSourceErrorMessage = null

            data = eventData.data[dsDefinition.resultSet].data

            # Filter the data if the widget has "filters"
            if $scope.widget.filters?
                data = dataService.filter(data, $scope.widget.filters)

            # Sort the data if the widget has "sortBy"
            if $scope.widget.sortBy?
                data = dataService.sort(data, $scope.widget.sortBy)

            # Check for no data
            if _.isEmpty(data) && $scope.widget.noData?

Response:
$scope.nodata = _.jsExec($scope.widget.noData)
            else
                $scope.nodata = null
                $scope.updateChart data

            $scope.loading = false

        # Data Source error
        $scope.$on 'dataSource:' + dsDefinition.name + ':error', (event, data) ->
            $scope.dataSourceError = true
            $scope.dataSourceErrorMessage = data.error
            $scope.nodata = null
            $scope.loading = false

        # Data Source loading
        $scope.$on 'dataSource:' + dsDefinition.name + ':loading', ->
            $scope.loading = true

        # Initialize the Data Source
        $scope.dataSource.init dsDefinition


Response:
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

#
# Annotation Chart Widget
#
cyclotronApp.controller 'AnnotationChartWidget', ($scope, configService, dashboardService, dataService) ->

    $scope.loading = false
    $scope.dataSourceError = false
    $scope.dataSourceErrorMessage = null

    $scope.widgetTitle = -> _.jsExec $scope.widget.title

    # Load data source
    dsDefinition = dashboardService.getDataSource($scope.dashboard, $scope.widget)
    $scope.dataSource = dataService.get(dsDefinition)

    widgetConfig = configService.widgets.annotationChart
    themeOptions = widgetConfig.themes[$scope.widget.theme]?.options || {}

    $scope.chartObject =
        type: 'AnnotationChart'
        options: _.assign _.cloneDeep(widgetConfig.options), themeOptions

    $scope.updateChart = (data) ->
        return unless $scope.widget.xAxis.column? and $scope.widget.series?


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

#
# Annotation Chart Widget
#
cyclotronApp.controller 'AnnotationChartWidget', ($scope, configService, dashboardService, dataService) ->

    $scope.loading = false
    $scope.dataSourceError = false
    $scope.dataSourceErrorMessage = null

    $scope.widgetTitle = -> _.jsExec $scope.widget.title

    # Load data source
    dsDefinition = dashboardService.getDataSource($scope.dashboard, $scope.widget)
    $scope.dataSource = dataService.get(dsDefinition)

    widgetConfig = configService.widgets.annotationChart
    themeOptions = widgetConfig.themes[$scope.widget.theme]?.options || {}

    $scope.chartObject =
        type: 'AnnotationChart'
        options: _.assign _.cloneDeep(widgetConfig.options), themeOptions

    $scope.updateChart = (data) ->
        return unless $scope.widget.xAxis.column? and $scope.widget.series?
```

Response:
/*
 * Copyright (c) 2013-2015 the original author or authors.
 *
 * Licensed under the MIT License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.opensource.org/licenses/mit-license.php
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the License.
 */

// Annotation Chart Widget

cyclotronApp.controller('AnnotationChartWidget', function($scope, configService, dashboardService, dataService) {
  var dsDefinition, ref, themeOptions, widgetConfig;
  $scope.loading = false;
  $scope.dataSourceError = false;
  $scope.dataSourceErrorMessage = null;
  $scope.widgetTitle = function() {
    return _.jsExec($scope.widget.title);
  };
  // Load data source
  dsDefinition = dashboardService.getDataSource($scope.dashboard, $scope.widget);
  $scope.dataSource = dataService.get(dsDefinition);
  widgetConfig = configService.widgets.annotationChart;
  themeOptions = ((ref = widgetConfig.themes[$scope.widget.theme]) != null ? ref.options : void 0) || {};
  $scope.chartObject = {
    type: 'AnnotationChart',
    options: _.assign(_.cloneDeep(widgetConfig.options), themeOptions)
  };
  return $scope.updateChart = function(data) {
    if (!(($scope.widget.xAxis.column != null) && ($scope.widget.series != null))) {

    }
  };
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
/*
 * Copyright (c) 2013-2015 the original author or authors.
 *
 * Licensed under the MIT License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.opensource.org/licenses/mit-license.php
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the License.
 */

// Annotation Chart Widget

cyclotronApp.controller('AnnotationChartWidget', function($scope, configService, dashboardService, dataService) {
  var dsDefinition, ref, themeOptions, widgetConfig;
  $scope.loading = false;
  $scope.dataSourceError = false;
  $scope.dataSourceErrorMessage = null;
  $scope.widgetTitle = function() {
    return _.jsExec($scope.widget.title);
  };
  // Load data source
  dsDefinition = dashboardService.getDataSource($scope.dashboard, $scope.widget);
  $scope.dataSource = dataService.get(dsDefinition);
  widgetConfig = configService.widgets.annotationChart;
  themeOptions = ((ref = widgetConfig.themes[$scope.widget.theme]) != null ? ref.options : void 0) || {};
  $scope.chartObject = {
    type: 'AnnotationChart',
    options: _.assign(_.cloneDeep(widgetConfig.options), themeOptions)
  };
  return $scope.updateChart = function(data) {
    if (!(($scope.widget.xAxis.column != null) && ($scope.widget.series != null))) {

    }
  };
});
```

Response:
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

#
# Annotation Chart Widget
#
cyclotronApp.controller 'AnnotationChartWidget', ($scope, configService, dashboardService, dataService) ->

    $scope.loading = false
    $scope.dataSourceError = false
    $scope.dataSourceErrorMessage = null

    $scope.widgetTitle = -> _.jsExec $scope.widget.title

    # Load data source
    dsDefinition = dashboardService.getDataSource($scope.dashboard, $scope.widget)
    $scope.dataSource = dataService.get(dsDefinition)

    widgetConfig = configService.widgets.annotationChart
    themeOptions = widgetConfig.themes[$scope.widget.theme]?.options || {}

    $scope.chartObject =
        type: 'AnnotationChart'
        options: _.assign _.cloneDeep(widgetConfig.options), themeOptions

    $scope.updateChart = (data) ->
        return unless $scope.widget.xAxis.column? and $scope.widget.series?


Prompt:
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

#
# Annotation Chart Widget
#
cyclotronApp.controller 'AnnotationChartWidget', ($scope, configService, dashboardService, dataService) ->

Response:
$scope.loading = false
    $scope.dataSourceError = false
    $scope.dataSourceErrorMessage = null

    $scope.widgetTitle = -> _.jsExec $scope.widget.title

    # Load data source
    dsDefinition = dashboardService.getDataSource($scope.dashboard, $scope.widget)
    $scope.dataSource = dataService.get(dsDefinition)

    widgetConfig = configService.widgets.annotationChart
    themeOptions = widgetConfig.themes[$scope.widget.theme]?.options || {}

    $scope.chartObject =
        type: 'AnnotationChart'
        options: _.assign _.cloneDeep(widgetConfig.options), themeOptions

    $scope.updateChart = (data) ->
        return unless $scope.widget.xAxis.column? and $scope.widget.series?


Response:
chartData =
            cols: []
            rows: []

        secondaryAxis = null

        # xAxis
        xAxisId = _.jsExec $scope.widget.xAxis.column

        chartData.cols.push {
            id: xAxisId
            label: 'xAxisLabel'
            type: 'datetime'
        }

        xAxisFormatter = switch $scope.widget.xAxis.format
            when 'epoch' then (d) ->
                moment.unix(d).toDate()
            when 'epochmillis' then (d) ->
                moment(d).toDate()
            when 'string' then (d) ->
                if $scope.widget.xAxis.formatString?
                    moment(d, $scope.widget.xAxis.formatString).toDate()
                else
                    moment(d).toDate()
            else _.identity

        # Series
        _.each $scope.widget.series, (series, index) ->
            columnId = _.jsExec series.column
            label = _.jsExec series.label
            if !label? then label = _.titleCase columnId

            if series.secondaryAxis == true
                secondaryAxis = index

            chartData.cols.push {
                id: columnId
                label: label
                type: 'number'
            }


Prompt:
chartData =
            cols: []
            rows: []

        secondaryAxis = null

        # xAxis
        xAxisId = _.jsExec $scope.widget.xAxis.column

        chartData.cols.push {
            id: xAxisId
            label: 'xAxisLabel'
            type: 'datetime'
        }

        xAxisFormatter = switch $scope.widget.xAxis.format
            when 'epoch' then (d) ->
                moment.unix(d).toDate()
            when 'epochmillis' then (d) ->
                moment(d).toDate()

Response:
when 'string' then (d) ->
                if $scope.widget.xAxis.formatString?
                    moment(d, $scope.widget.xAxis.formatString).toDate()
                else
                    moment(d).toDate()
            else _.identity

        # Series
        _.each $scope.widget.series, (series, index) ->
            columnId = _.jsExec series.column
            label = _.jsExec series.label
            if !label? then label = _.titleCase columnId

            if series.secondaryAxis == true
                secondaryAxis = index

            chartData.cols.push {
                id: columnId
                label: label
                type: 'number'
            }


Response:
if series.annotationTitleColumn?
                id = _.jsExec series.annotationTitleColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-title'
                    type: 'string'
                }

            if series.annotationTextColumn?
                id = _.jsExec series.annotationTextColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-text'
                    type: 'string'
                }

        if secondaryAxis?
            scaleColumns = switch secondaryAxis
                when 0 then [0, 1]
                else [secondaryAxis, 0]
            $scope.chartObject.options.scaleColumns = scaleColumns

        chartData.rows = _.map data, (row) ->
            {
                c: _.map chartData.cols, (column) ->
                    if column.type == 'datetime'
                        { v: xAxisFormatter(row[column.id]) }
                    else
                        { v: row[column.id] }
            }

        $scope.chartObject.data = chartData
        _.merge $scope.chartObject.options, _.compile($scope.widget.options, {})

    # Load data from the data source
    $scope.loadData = ->
        # Reset scope variables
        $scope.loading = true
        $scope.dataSourceError = false
        $scope.dataSourceErrorMessage = null


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
if series.annotationTitleColumn?
                id = _.jsExec series.annotationTitleColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-title'
                    type: 'string'
                }

            if series.annotationTextColumn?
                id = _.jsExec series.annotationTextColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-text'
                    type: 'string'
                }

        if secondaryAxis?
            scaleColumns = switch secondaryAxis
                when 0 then [0, 1]
                else [secondaryAxis, 0]
            $scope.chartObject.options.scaleColumns = scaleColumns

        chartData.rows = _.map data, (row) ->
            {
                c: _.map chartData.cols, (column) ->
                    if column.type == 'datetime'
                        { v: xAxisFormatter(row[column.id]) }
                    else
                        { v: row[column.id] }
            }

        $scope.chartObject.data = chartData
        _.merge $scope.chartObject.options, _.compile($scope.widget.options, {})

    # Load data from the data source
    $scope.loadData = ->
        # Reset scope variables
        $scope.loading = true
        $scope.dataSourceError = false
        $scope.dataSourceErrorMessage = null
```

Response:
var id, scaleColumns;

if (series.annotationTitleColumn != null) {
  id = _.jsExec(series.annotationTitleColumn);
  chartData.cols.push({
    id: id,
    label: columnId + '-title',
    type: 'string'
  });
}

if (series.annotationTextColumn != null) {
  id = _.jsExec(series.annotationTextColumn);
  chartData.cols.push({
    id: id,
    label: columnId + '-text',
    type: 'string'
  });
}

if (typeof secondaryAxis !== "undefined" && secondaryAxis !== null) {
  scaleColumns = (function() {
    switch (secondaryAxis) {
      case 0:
        return [0, 1];
      default:
        return [secondaryAxis, 0];
    }
  })();
  $scope.chartObject.options.scaleColumns = scaleColumns;
}

chartData.rows = _.map(data, function(row) {
  return {
    c: _.map(chartData.cols, function(column) {
      if (column.type === 'datetime') {
        return {
          v: xAxisFormatter(row[column.id])
        };
      } else {
        return {
          v: row[column.id]
        };
      }
    })
  };
});

$scope.chartObject.data = chartData;

_.merge($scope.chartObject.options, _.compile($scope.widget.options, {}));

// Load data from the data source
$scope.loadData = function() {
  // Reset scope variables
  $scope.loading = true;
  $scope.dataSourceError = false;
  return $scope.dataSourceErrorMessage = null;
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var id, scaleColumns;

if (series.annotationTitleColumn != null) {
  id = _.jsExec(series.annotationTitleColumn);
  chartData.cols.push({
    id: id,
    label: columnId + '-title',
    type: 'string'
  });
}

if (series.annotationTextColumn != null) {
  id = _.jsExec(series.annotationTextColumn);
  chartData.cols.push({
    id: id,
    label: columnId + '-text',
    type: 'string'
  });
}

if (typeof secondaryAxis !== "undefined" && secondaryAxis !== null) {
  scaleColumns = (function() {
    switch (secondaryAxis) {
      case 0:
        return [0, 1];
      default:
        return [secondaryAxis, 0];
    }
  })();
  $scope.chartObject.options.scaleColumns = scaleColumns;
}

chartData.rows = _.map(data, function(row) {
  return {
    c: _.map(chartData.cols, function(column) {
      if (column.type === 'datetime') {
        return {
          v: xAxisFormatter(row[column.id])
        };
      } else {
        return {
          v: row[column.id]
        };
      }
    })
  };
});

$scope.chartObject.data = chartData;

_.merge($scope.chartObject.options, _.compile($scope.widget.options, {}));

// Load data from the data source
$scope.loadData = function() {
  // Reset scope variables
  $scope.loading = true;
  $scope.dataSourceError = false;
  return $scope.dataSourceErrorMessage = null;
};
```

Response:
if series.annotationTitleColumn?
                id = _.jsExec series.annotationTitleColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-title'
                    type: 'string'
                }

            if series.annotationTextColumn?
                id = _.jsExec series.annotationTextColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-text'
                    type: 'string'
                }

        if secondaryAxis?
            scaleColumns = switch secondaryAxis
                when 0 then [0, 1]
                else [secondaryAxis, 0]
            $scope.chartObject.options.scaleColumns = scaleColumns

        chartData.rows = _.map data, (row) ->
            {
                c: _.map chartData.cols, (column) ->
                    if column.type == 'datetime'
                        { v: xAxisFormatter(row[column.id]) }
                    else
                        { v: row[column.id] }
            }

        $scope.chartObject.data = chartData
        _.merge $scope.chartObject.options, _.compile($scope.widget.options, {})

    # Load data from the data source
    $scope.loadData = ->
        # Reset scope variables
        $scope.loading = true
        $scope.dataSourceError = false
        $scope.dataSourceErrorMessage = null


Prompt:
if series.annotationTitleColumn?
                id = _.jsExec series.annotationTitleColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-title'
                    type: 'string'
                }

            if series.annotationTextColumn?
                id = _.jsExec series.annotationTextColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-text'
                    type: 'string'
                }

        if secondaryAxis?
            scaleColumns = switch secondaryAxis
                when 0 then [0, 1]
                else [secondaryAxis, 0]

Response:
$scope.chartObject.options.scaleColumns = scaleColumns

        chartData.rows = _.map data, (row) ->
            {
                c: _.map chartData.cols, (column) ->
                    if column.type == 'datetime'
                        { v: xAxisFormatter(row[column.id]) }
                    else
                        { v: row[column.id] }
            }

        $scope.chartObject.data = chartData
        _.merge $scope.chartObject.options, _.compile($scope.widget.options, {})

    # Load data from the data source
    $scope.loadData = ->
        # Reset scope variables
        $scope.loading = true
        $scope.dataSourceError = false
        $scope.dataSourceErrorMessage = null


Response:
$scope.dataSource.getData(dsDefinition, (data, headers, isUpdate, diff) ->

            $scope.dataSourceError = false
            $scope.dataSourceErrorMessage = null

            # Filter the data with the widget filters if needed
            if $scope.widget.filters?
                data = dataService.filter(data, $scope.widget.filters)

            # Sort the data if the widget has sortBy
            if $scope.widget.sortBy?
                data = dataService.sort(data, $scope.widget.sortBy)

            # Check for no Data
            if _.isEmpty(data) && $scope.widget.noData?
                $scope.nodata = _.jsExec($scope.widget.noData)
            else
                $scope.nodata = null
                $scope.updateChart data

            $scope.loading = false

        , (errorMessage, status) ->
            $scope.loading = false

            # Error callback
            $scope.dataSourceError = true
            $scope.dataSourceErrorMessage = errorMessage
            $scope.nodata = null
        , ->
            $scope.loading = true
        )

    $scope.reload = ->
        $scope.dataSource.execute(true)

    $scope.handleError = (message) ->
        console.log 'Annotation Chart error: ' + message

    # Initialize
    if not _.isUndefined(dsDefinition)
        $scope.loadData()


Prompt:
$scope.dataSource.getData(dsDefinition, (data, headers, isUpdate, diff) ->

            $scope.dataSourceError = false
            $scope.dataSourceErrorMessage = null

            # Filter the data with the widget filters if needed
            if $scope.widget.filters?
                data = dataService.filter(data, $scope.widget.filters)

            # Sort the data if the widget has sortBy
            if $scope.widget.sortBy?
                data = dataService.sort(data, $scope.widget.sortBy)

            # Check for no Data
            if _.isEmpty(data) && $scope.widget.noData?
                $scope.nodata = _.jsExec($scope.widget.noData)
            else
                $scope.nodata = null
                $scope.updateChart data

            $scope.loading = false

Response:
, (errorMessage, status) ->
            $scope.loading = false

            # Error callback
            $scope.dataSourceError = true
            $scope.dataSourceErrorMessage = errorMessage
            $scope.nodata = null
        , ->
            $scope.loading = true
        )

    $scope.reload = ->
        $scope.dataSource.execute(true)

    $scope.handleError = (message) ->
        console.log 'Annotation Chart error: ' + message

    # Initialize
    if not _.isUndefined(dsDefinition)
        $scope.loadData()


Response:
if series.annotationTitleColumn?
                id = _.jsExec series.annotationTitleColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-title'
                    type: 'string'
                }

            if series.annotationTextColumn?
                id = _.jsExec series.annotationTextColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-text'
                    type: 'string'
                }

        if secondaryAxis?
            scaleColumns = switch secondaryAxis
                when 0 then [0, 1]
                else [secondaryAxis, 0]
            $scope.chartObject.options.scaleColumns = scaleColumns

        chartData.rows = _.map data, (row) ->
            {
                c: _.map chartData.cols, (column) ->
                    if column.type == 'datetime'
                        { v: xAxisFormatter(row[column.id]) }
                    else
                        { v: row[column.id] }
            }

        $scope.chartObject.data = chartData
        _.merge $scope.chartObject.options, _.compile($scope.widget.options, {})

        console.log $scope.chartObject

    # Load data from the data source
    $scope.loadData = ->
        # Reset scope variables
        $scope.loading = true
        $scope.dataSourceError = false
        $scope.dataSourceErrorMessage = null


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
if series.annotationTitleColumn?
                id = _.jsExec series.annotationTitleColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-title'
                    type: 'string'
                }

            if series.annotationTextColumn?
                id = _.jsExec series.annotationTextColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-text'
                    type: 'string'
                }

        if secondaryAxis?
            scaleColumns = switch secondaryAxis
                when 0 then [0, 1]
                else [secondaryAxis, 0]
            $scope.chartObject.options.scaleColumns = scaleColumns

        chartData.rows = _.map data, (row) ->
            {
                c: _.map chartData.cols, (column) ->
                    if column.type == 'datetime'
                        { v: xAxisFormatter(row[column.id]) }
                    else
                        { v: row[column.id] }
            }

        $scope.chartObject.data = chartData
        _.merge $scope.chartObject.options, _.compile($scope.widget.options, {})

        console.log $scope.chartObject

    # Load data from the data source
    $scope.loadData = ->
        # Reset scope variables
        $scope.loading = true
        $scope.dataSourceError = false
        $scope.dataSourceErrorMessage = null
```

Response:
var id, scaleColumns;

if (series.annotationTitleColumn != null) {
  id = _.jsExec(series.annotationTitleColumn);
  chartData.cols.push({
    id: id,
    label: columnId + '-title',
    type: 'string'
  });
}

if (series.annotationTextColumn != null) {
  id = _.jsExec(series.annotationTextColumn);
  chartData.cols.push({
    id: id,
    label: columnId + '-text',
    type: 'string'
  });
}

if (typeof secondaryAxis !== "undefined" && secondaryAxis !== null) {
  scaleColumns = (function() {
    switch (secondaryAxis) {
      case 0:
        return [0, 1];
      default:
        return [secondaryAxis, 0];
    }
  })();
  $scope.chartObject.options.scaleColumns = scaleColumns;
}

chartData.rows = _.map(data, function(row) {
  return {
    c: _.map(chartData.cols, function(column) {
      if (column.type === 'datetime') {
        return {
          v: xAxisFormatter(row[column.id])
        };
      } else {
        return {
          v: row[column.id]
        };
      }
    })
  };
});

$scope.chartObject.data = chartData;

_.merge($scope.chartObject.options, _.compile($scope.widget.options, {}));

console.log($scope.chartObject);

// Load data from the data source
$scope.loadData = function() {
  // Reset scope variables
  $scope.loading = true;
  $scope.dataSourceError = false;
  return $scope.dataSourceErrorMessage = null;
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var id, scaleColumns;

if (series.annotationTitleColumn != null) {
  id = _.jsExec(series.annotationTitleColumn);
  chartData.cols.push({
    id: id,
    label: columnId + '-title',
    type: 'string'
  });
}

if (series.annotationTextColumn != null) {
  id = _.jsExec(series.annotationTextColumn);
  chartData.cols.push({
    id: id,
    label: columnId + '-text',
    type: 'string'
  });
}

if (typeof secondaryAxis !== "undefined" && secondaryAxis !== null) {
  scaleColumns = (function() {
    switch (secondaryAxis) {
      case 0:
        return [0, 1];
      default:
        return [secondaryAxis, 0];
    }
  })();
  $scope.chartObject.options.scaleColumns = scaleColumns;
}

chartData.rows = _.map(data, function(row) {
  return {
    c: _.map(chartData.cols, function(column) {
      if (column.type === 'datetime') {
        return {
          v: xAxisFormatter(row[column.id])
        };
      } else {
        return {
          v: row[column.id]
        };
      }
    })
  };
});

$scope.chartObject.data = chartData;

_.merge($scope.chartObject.options, _.compile($scope.widget.options, {}));

console.log($scope.chartObject);

// Load data from the data source
$scope.loadData = function() {
  // Reset scope variables
  $scope.loading = true;
  $scope.dataSourceError = false;
  return $scope.dataSourceErrorMessage = null;
};
```

Response:
if series.annotationTitleColumn?
                id = _.jsExec series.annotationTitleColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-title'
                    type: 'string'
                }

            if series.annotationTextColumn?
                id = _.jsExec series.annotationTextColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-text'
                    type: 'string'
                }

        if secondaryAxis?
            scaleColumns = switch secondaryAxis
                when 0 then [0, 1]
                else [secondaryAxis, 0]
            $scope.chartObject.options.scaleColumns = scaleColumns

        chartData.rows = _.map data, (row) ->
            {
                c: _.map chartData.cols, (column) ->
                    if column.type == 'datetime'
                        { v: xAxisFormatter(row[column.id]) }
                    else
                        { v: row[column.id] }
            }

        $scope.chartObject.data = chartData
        _.merge $scope.chartObject.options, _.compile($scope.widget.options, {})

        console.log $scope.chartObject

    # Load data from the data source
    $scope.loadData = ->
        # Reset scope variables
        $scope.loading = true
        $scope.dataSourceError = false
        $scope.dataSourceErrorMessage = null


Prompt:
if series.annotationTitleColumn?
                id = _.jsExec series.annotationTitleColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-title'
                    type: 'string'
                }

            if series.annotationTextColumn?
                id = _.jsExec series.annotationTextColumn
                chartData.cols.push {
                    id: id
                    label: columnId + '-text'
                    type: 'string'
                }

        if secondaryAxis?
            scaleColumns = switch secondaryAxis
                when 0 then [0, 1]
                else [secondaryAxis, 0]
            $scope.chartObject.options.scaleColumns = scaleColumns

Response:
chartData.rows = _.map data, (row) ->
            {
                c: _.map chartData.cols, (column) ->
                    if column.type == 'datetime'
                        { v: xAxisFormatter(row[column.id]) }
                    else
                        { v: row[column.id] }
            }

        $scope.chartObject.data = chartData
        _.merge $scope.chartObject.options, _.compile($scope.widget.options, {})

        console.log $scope.chartObject

    # Load data from the data source
    $scope.loadData = ->
        # Reset scope variables
        $scope.loading = true
        $scope.dataSourceError = false
        $scope.dataSourceErrorMessage = null


Response:
{ replace } = require('../helpers')
TransformerBase = require('./base')

###
# Converts `function () {} ()` into `do ->`.
###

module.exports = class extends TransformerBase

  CallExpression: (node) ->
    valid =
      isIife(node) and
      isAllIdentifiers(node.arguments) and
      sameArgs(node.callee.params, node.arguments)

    return node unless valid

    replace node,
      type: 'CoffeeDoExpression'
      function: node.callee
      arguments: node.arguments

###
# Helper: ensure all nodes in `args` are Identifiers
###

isAllIdentifiers = (args) ->
  for arg in args
    return false if arg.type isnt 'Identifier'
  true

###
# Helper: ensure a CallExpression is an IIFE
###

isIife = (node) ->
  node.callee?.type is 'FunctionExpression' and
  node.callee?.id is null

###
# Helper: ensure argument names are the same
###

sameArgs = (left, right) ->
  left.map((p) -> p.name).join("/") is
    right.map((p) -> p.name).join("/")


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
{ replace } = require('../helpers')
TransformerBase = require('./base')

###
# Converts `function () {} ()` into `do ->`.
###

module.exports = class extends TransformerBase

  CallExpression: (node) ->
    valid =
      isIife(node) and
      isAllIdentifiers(node.arguments) and
      sameArgs(node.callee.params, node.arguments)

    return node unless valid

    replace node,
      type: 'CoffeeDoExpression'
      function: node.callee
      arguments: node.arguments

###
# Helper: ensure all nodes in `args` are Identifiers
###

isAllIdentifiers = (args) ->
  for arg in args
    return false if arg.type isnt 'Identifier'
  true

###
# Helper: ensure a CallExpression is an IIFE
###

isIife = (node) ->
  node.callee?.type is 'FunctionExpression' and
  node.callee?.id is null

###
# Helper: ensure argument names are the same
###

sameArgs = (left, right) ->
  left.map((p) -> p.name).join("/") is
    right.map((p) -> p.name).join("/")
```

Response:
/*
 * Helper: ensure all nodes in `args` are Identifiers
 */
/*
 * Helper: ensure a CallExpression is an IIFE
 */
/*
 * Helper: ensure argument names are the same
 */
var TransformerBase, isAllIdentifiers, isIife, replace, sameArgs;

({replace} = require('../helpers'));

TransformerBase = require('./base');

/*
 * Converts `function () {} ()` into `do ->`.
 */
module.exports = class extends TransformerBase {
  CallExpression(node) {
    var valid;
    valid = isIife(node) && isAllIdentifiers(node.arguments) && sameArgs(node.callee.params, node.arguments);
    if (!valid) {
      return node;
    }
    return replace(node, {
      type: 'CoffeeDoExpression',
      function: node.callee,
      arguments: node.arguments
    });
  }

};

isAllIdentifiers = function(args) {
  var arg, i, len;
  for (i = 0, len = args.length; i < len; i++) {
    arg = args[i];
    if (arg.type !== 'Identifier') {
      return false;
    }
  }
  return true;
};

isIife = function(node) {
  var ref, ref1;
  return ((ref = node.callee) != null ? ref.type : void 0) === 'FunctionExpression' && ((ref1 = node.callee) != null ? ref1.id : void 0) === null;
};

sameArgs = function(left, right) {
  return left.map(function(p) {
    return p.name;
  }).join("/") === right.map(function(p) {
    return p.name;
  }).join("/");
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
/*
 * Helper: ensure all nodes in `args` are Identifiers
 */
/*
 * Helper: ensure a CallExpression is an IIFE
 */
/*
 * Helper: ensure argument names are the same
 */
var TransformerBase, isAllIdentifiers, isIife, replace, sameArgs;

({replace} = require('../helpers'));

TransformerBase = require('./base');

/*
 * Converts `function () {} ()` into `do ->`.
 */
module.exports = class extends TransformerBase {
  CallExpression(node) {
    var valid;
    valid = isIife(node) && isAllIdentifiers(node.arguments) && sameArgs(node.callee.params, node.arguments);
    if (!valid) {
      return node;
    }
    return replace(node, {
      type: 'CoffeeDoExpression',
      function: node.callee,
      arguments: node.arguments
    });
  }

};

isAllIdentifiers = function(args) {
  var arg, i, len;
  for (i = 0, len = args.length; i < len; i++) {
    arg = args[i];
    if (arg.type !== 'Identifier') {
      return false;
    }
  }
  return true;
};

isIife = function(node) {
  var ref, ref1;
  return ((ref = node.callee) != null ? ref.type : void 0) === 'FunctionExpression' && ((ref1 = node.callee) != null ? ref1.id : void 0) === null;
};

sameArgs = function(left, right) {
  return left.map(function(p) {
    return p.name;
  }).join("/") === right.map(function(p) {
    return p.name;
  }).join("/");
};
```

Response:
{ replace } = require('../helpers')
TransformerBase = require('./base')

###
# Converts `function () {} ()` into `do ->`.
###

module.exports = class extends TransformerBase

  CallExpression: (node) ->
    valid =
      isIife(node) and
      isAllIdentifiers(node.arguments) and
      sameArgs(node.callee.params, node.arguments)

    return node unless valid

    replace node,
      type: 'CoffeeDoExpression'
      function: node.callee
      arguments: node.arguments

###
# Helper: ensure all nodes in `args` are Identifiers
###

isAllIdentifiers = (args) ->
  for arg in args
    return false if arg.type isnt 'Identifier'
  true

###
# Helper: ensure a CallExpression is an IIFE
###

isIife = (node) ->
  node.callee?.type is 'FunctionExpression' and
  node.callee?.id is null

###
# Helper: ensure argument names are the same
###

sameArgs = (left, right) ->
  left.map((p) -> p.name).join("/") is
    right.map((p) -> p.name).join("/")