Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var chai, csv, should;

chai = require('chai');

csv = require('../../src/formatters/csv');

should = chai.should();

describe("The CSV formatter", function() {
  it("should be a function", function() {
    return csv.should.be.a('function');
  });
  it("should return a string", function() {
    return csv({}).should.be.a('string');
  });
  return it("should create a csv", function() {
    var stats;
    stats = {
      total: 1,
      source: 2,
      comment: 3,
      single: 4,
      block: 5,
      mixed: 6,
      empty: 7
    };
    return csv({
      summary: stats
    }).should.equal(`Path,Physical,Source,Comment,Single-line comment,Block comment,Mixed,Empty
Total,1,2,3,4,5,6,7`);
  });
});
```

Response:
chai      = require 'chai'
csv       = require '../../src/formatters/csv'
should    = chai.should()

describe "The CSV formatter", ->

  it "should be a function", ->
    csv.should.be.a 'function'

  it "should return a string", ->
    csv({}).should.be.a 'string'

  it "should create a csv", ->
    stats =
      total   : 1
      source  : 2
      comment : 3
      single  : 4
      block   : 5
      mixed   : 6
      empty   : 7
    csv(summary: stats).should.equal """
      Path,Physical,Source,Comment,Single-line comment,Block comment,Mixed,Empty
      Total,1,2,3,4,5,6,7
      """


Prompt:
chai      = require 'chai'
csv       = require '../../src/formatters/csv'
should    = chai.should()

describe "The CSV formatter", ->

  it "should be a function", ->
    csv.should.be.a 'function'

  it "should return a string", ->
    csv({}).should.be.a 'string'

Response:
it "should create a csv", ->
    stats =
      total   : 1
      source  : 2
      comment : 3
      single  : 4
      block   : 5
      mixed   : 6
      empty   : 7
    csv(summary: stats).should.equal """
      Path,Physical,Source,Comment,Single-line comment,Block comment,Mixed,Empty
      Total,1,2,3,4,5,6,7
      """


Response:
chai      = require 'chai'
csv       = require '../../src/formatters/csv'
should    = chai.should()

describe "The CSV formatter", ->

  it "should be a function", ->
    csv.should.be.a 'function'

  it "should return a string", ->
    csv({}).should.be.a 'string'

  it "should create a csv", ->
    stats =
      loc   : 1
      sloc  : 2
      cloc  : 3
      scloc : 4
      mcloc : 5
      nloc  : 6
    csv(summary: stats).should.equal """
      Path,Physical,Source,Total comment,Single-line comment,Multi-line comment,Empty
      Total,1,2,3,4,5,6
      """


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
chai      = require 'chai'
csv       = require '../../src/formatters/csv'
should    = chai.should()

describe "The CSV formatter", ->

  it "should be a function", ->
    csv.should.be.a 'function'

  it "should return a string", ->
    csv({}).should.be.a 'string'

  it "should create a csv", ->
    stats =
      loc   : 1
      sloc  : 2
      cloc  : 3
      scloc : 4
      mcloc : 5
      nloc  : 6
    csv(summary: stats).should.equal """
      Path,Physical,Source,Total comment,Single-line comment,Multi-line comment,Empty
      Total,1,2,3,4,5,6
      """
```

Response:
var chai, csv, should;

chai = require('chai');

csv = require('../../src/formatters/csv');

should = chai.should();

describe("The CSV formatter", function() {
  it("should be a function", function() {
    return csv.should.be.a('function');
  });
  it("should return a string", function() {
    return csv({}).should.be.a('string');
  });
  return it("should create a csv", function() {
    var stats;
    stats = {
      loc: 1,
      sloc: 2,
      cloc: 3,
      scloc: 4,
      mcloc: 5,
      nloc: 6
    };
    return csv({
      summary: stats
    }).should.equal(`Path,Physical,Source,Total comment,Single-line comment,Multi-line comment,Empty
Total,1,2,3,4,5,6`);
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var chai, csv, should;

chai = require('chai');

csv = require('../../src/formatters/csv');

should = chai.should();

describe("The CSV formatter", function() {
  it("should be a function", function() {
    return csv.should.be.a('function');
  });
  it("should return a string", function() {
    return csv({}).should.be.a('string');
  });
  return it("should create a csv", function() {
    var stats;
    stats = {
      loc: 1,
      sloc: 2,
      cloc: 3,
      scloc: 4,
      mcloc: 5,
      nloc: 6
    };
    return csv({
      summary: stats
    }).should.equal(`Path,Physical,Source,Total comment,Single-line comment,Multi-line comment,Empty
Total,1,2,3,4,5,6`);
  });
});
```

Response:
chai      = require 'chai'
csv       = require '../../src/formatters/csv'
should    = chai.should()

describe "The CSV formatter", ->

  it "should be a function", ->
    csv.should.be.a 'function'

  it "should return a string", ->
    csv({}).should.be.a 'string'

  it "should create a csv", ->
    stats =
      loc   : 1
      sloc  : 2
      cloc  : 3
      scloc : 4
      mcloc : 5
      nloc  : 6
    csv(summary: stats).should.equal """
      Path,Physical,Source,Total comment,Single-line comment,Multi-line comment,Empty
      Total,1,2,3,4,5,6
      """


Prompt:
chai      = require 'chai'
csv       = require '../../src/formatters/csv'
should    = chai.should()

describe "The CSV formatter", ->

  it "should be a function", ->
    csv.should.be.a 'function'

  it "should return a string", ->
    csv({}).should.be.a 'string'

Response:
it "should create a csv", ->
    stats =
      loc   : 1
      sloc  : 2
      cloc  : 3
      scloc : 4
      mcloc : 5
      nloc  : 6
    csv(summary: stats).should.equal """
      Path,Physical,Source,Total comment,Single-line comment,Multi-line comment,Empty
      Total,1,2,3,4,5,6
      """


Response:
chai      = require 'chai'
csv       = require '../../src/formatters/csv'
should    = chai.should()

describe "The CSV formatter", ->

  it "should be a function", ->
    csv.should.be.a 'function'

  it "should return a string", ->
    csv({}).should.be.a 'string'

  it "should create a csv", ->
    stats =
      loc   : 1
      sloc  : 2
      cloc  : 3
      scloc : 4
      mcloc : 5
      nloc  : 6
    csv(stats).should.equal """
      Path,Physical,Source,Total comment,Single-line comment,Multi-line comment,Empty
      Total,1,2,3,4,5,6
      """


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
chai      = require 'chai'
csv       = require '../../src/formatters/csv'
should    = chai.should()

describe "The CSV formatter", ->

  it "should be a function", ->
    csv.should.be.a 'function'

  it "should return a string", ->
    csv({}).should.be.a 'string'

  it "should create a csv", ->
    stats =
      loc   : 1
      sloc  : 2
      cloc  : 3
      scloc : 4
      mcloc : 5
      nloc  : 6
    csv(stats).should.equal """
      Path,Physical,Source,Total comment,Single-line comment,Multi-line comment,Empty
      Total,1,2,3,4,5,6
      """
```

Response:
var chai, csv, should;

chai = require('chai');

csv = require('../../src/formatters/csv');

should = chai.should();

describe("The CSV formatter", function() {
  it("should be a function", function() {
    return csv.should.be.a('function');
  });
  it("should return a string", function() {
    return csv({}).should.be.a('string');
  });
  return it("should create a csv", function() {
    var stats;
    stats = {
      loc: 1,
      sloc: 2,
      cloc: 3,
      scloc: 4,
      mcloc: 5,
      nloc: 6
    };
    return csv(stats).should.equal(`Path,Physical,Source,Total comment,Single-line comment,Multi-line comment,Empty
Total,1,2,3,4,5,6`);
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var chai, csv, should;

chai = require('chai');

csv = require('../../src/formatters/csv');

should = chai.should();

describe("The CSV formatter", function() {
  it("should be a function", function() {
    return csv.should.be.a('function');
  });
  it("should return a string", function() {
    return csv({}).should.be.a('string');
  });
  return it("should create a csv", function() {
    var stats;
    stats = {
      loc: 1,
      sloc: 2,
      cloc: 3,
      scloc: 4,
      mcloc: 5,
      nloc: 6
    };
    return csv(stats).should.equal(`Path,Physical,Source,Total comment,Single-line comment,Multi-line comment,Empty
Total,1,2,3,4,5,6`);
  });
});
```

Response:
chai      = require 'chai'
csv       = require '../../src/formatters/csv'
should    = chai.should()

describe "The CSV formatter", ->

  it "should be a function", ->
    csv.should.be.a 'function'

  it "should return a string", ->
    csv({}).should.be.a 'string'

  it "should create a csv", ->
    stats =
      loc   : 1
      sloc  : 2
      cloc  : 3
      scloc : 4
      mcloc : 5
      nloc  : 6
    csv(stats).should.equal """
      Path,Physical,Source,Total comment,Single-line comment,Multi-line comment,Empty
      Total,1,2,3,4,5,6
      """


Prompt:
chai      = require 'chai'
csv       = require '../../src/formatters/csv'
should    = chai.should()

describe "The CSV formatter", ->

  it "should be a function", ->
    csv.should.be.a 'function'

  it "should return a string", ->
    csv({}).should.be.a 'string'

Response:
it "should create a csv", ->
    stats =
      loc   : 1
      sloc  : 2
      cloc  : 3
      scloc : 4
      mcloc : 5
      nloc  : 6
    csv(stats).should.equal """
      Path,Physical,Source,Total comment,Single-line comment,Multi-line comment,Empty
      Total,1,2,3,4,5,6
      """


Response:
createAttribute = (label, name, exprString) ->
  attribute = Model.Attribute.createVariant
    label: label
    name: name
  attribute.setExpression(exprString)
  return attribute

# =============================================================================
# Components
# =============================================================================

Model.Component = Model.NodeWithAttributes.createVariant
  label: "Component"

  graphicClass: Graphic.Component

  graphic: ->
    graphic = new @graphicClass()
    _.extend graphic, @getAttributesValuesByName()
    return graphic

Model.Transform = Model.Component.createVariant
  label: "Transform"

  matrix: ->
    {x, y, sx, sy, rotate} = @getAttributesValuesByName()
    return Util.Matrix.naturalConstruct(x, y, sx, sy, rotate)
  defaultAttributesToChange: ->
    {x, y} = @getAttributesByName()
    return [x, y]
  controllableAttributes: ->
    {x, y, sx, sy, rotate} = @getAttributesByName()
    return [x, y, sx, sy, rotate]
  controlPoints: ->
    {x, y, sx, sy} = @getAttributesByName()
    return [
      {point: [0, 0], attributesToChange: [x, y], filled: true}
      {point: [1, 0], attributesToChange: [sx], filled: false}
      {point: [0, 1], attributesToChange: [sy], filled: false}
    ]

Model.Transform.addChildren [
  createAttribute("X", "x", "0.00")
  createAttribute("Y", "y", "0.00")
  createAttribute("Scale X", "sx", "1.00")
  createAttribute("Scale Y", "sy", "1.00")
  createAttribute("Rotate", "rotate", "0.00")
]


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
createAttribute = (label, name, exprString) ->
  attribute = Model.Attribute.createVariant
    label: label
    name: name
  attribute.setExpression(exprString)
  return attribute

# =============================================================================
# Components
# =============================================================================

Model.Component = Model.NodeWithAttributes.createVariant
  label: "Component"

  graphicClass: Graphic.Component

  graphic: ->
    graphic = new @graphicClass()
    _.extend graphic, @getAttributesValuesByName()
    return graphic

Model.Transform = Model.Component.createVariant
  label: "Transform"

  matrix: ->
    {x, y, sx, sy, rotate} = @getAttributesValuesByName()
    return Util.Matrix.naturalConstruct(x, y, sx, sy, rotate)
  defaultAttributesToChange: ->
    {x, y} = @getAttributesByName()
    return [x, y]
  controllableAttributes: ->
    {x, y, sx, sy, rotate} = @getAttributesByName()
    return [x, y, sx, sy, rotate]
  controlPoints: ->
    {x, y, sx, sy} = @getAttributesByName()
    return [
      {point: [0, 0], attributesToChange: [x, y], filled: true}
      {point: [1, 0], attributesToChange: [sx], filled: false}
      {point: [0, 1], attributesToChange: [sy], filled: false}
    ]

Model.Transform.addChildren [
  createAttribute("X", "x", "0.00")
  createAttribute("Y", "y", "0.00")
  createAttribute("Scale X", "sx", "1.00")
  createAttribute("Scale Y", "sy", "1.00")
  createAttribute("Rotate", "rotate", "0.00")
]
```

Response:
var createAttribute;

createAttribute = function(label, name, exprString) {
  var attribute;
  attribute = Model.Attribute.createVariant({
    label: label,
    name: name
  });
  attribute.setExpression(exprString);
  return attribute;
};

// =============================================================================
// Components
// =============================================================================
Model.Component = Model.NodeWithAttributes.createVariant({
  label: "Component",
  graphicClass: Graphic.Component,
  graphic: function() {
    var graphic;
    graphic = new this.graphicClass();
    _.extend(graphic, this.getAttributesValuesByName());
    return graphic;
  }
});

Model.Transform = Model.Component.createVariant({
  label: "Transform",
  matrix: function() {
    var rotate, sx, sy, x, y;
    ({x, y, sx, sy, rotate} = this.getAttributesValuesByName());
    return Util.Matrix.naturalConstruct(x, y, sx, sy, rotate);
  },
  defaultAttributesToChange: function() {
    var x, y;
    ({x, y} = this.getAttributesByName());
    return [x, y];
  },
  controllableAttributes: function() {
    var rotate, sx, sy, x, y;
    ({x, y, sx, sy, rotate} = this.getAttributesByName());
    return [x, y, sx, sy, rotate];
  },
  controlPoints: function() {
    var sx, sy, x, y;
    ({x, y, sx, sy} = this.getAttributesByName());
    return [
      {
        point: [0,
      0],
        attributesToChange: [x,
      y],
        filled: true
      },
      {
        point: [1,
      0],
        attributesToChange: [sx],
        filled: false
      },
      {
        point: [0,
      1],
        attributesToChange: [sy],
        filled: false
      }
    ];
  }
});

Model.Transform.addChildren([createAttribute("X", "x", "0.00"), createAttribute("Y", "y", "0.00"), createAttribute("Scale X", "sx", "1.00"), createAttribute("Scale Y", "sy", "1.00"), createAttribute("Rotate", "rotate", "0.00")]);


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

createAttribute = function(label, name, exprString) {
  var attribute;
  attribute = Model.Attribute.createVariant({
    label: label,
    name: name
  });
  attribute.setExpression(exprString);
  return attribute;
};

// =============================================================================
// Components
// =============================================================================
Model.Component = Model.NodeWithAttributes.createVariant({
  label: "Component",
  graphicClass: Graphic.Component,
  graphic: function() {
    var graphic;
    graphic = new this.graphicClass();
    _.extend(graphic, this.getAttributesValuesByName());
    return graphic;
  }
});

Model.Transform = Model.Component.createVariant({
  label: "Transform",
  matrix: function() {
    var rotate, sx, sy, x, y;
    ({x, y, sx, sy, rotate} = this.getAttributesValuesByName());
    return Util.Matrix.naturalConstruct(x, y, sx, sy, rotate);
  },
  defaultAttributesToChange: function() {
    var x, y;
    ({x, y} = this.getAttributesByName());
    return [x, y];
  },
  controllableAttributes: function() {
    var rotate, sx, sy, x, y;
    ({x, y, sx, sy, rotate} = this.getAttributesByName());
    return [x, y, sx, sy, rotate];
  },
  controlPoints: function() {
    var sx, sy, x, y;
    ({x, y, sx, sy} = this.getAttributesByName());
    return [
      {
        point: [0,
      0],
        attributesToChange: [x,
      y],
        filled: true
      },
      {
        point: [1,
      0],
        attributesToChange: [sx],
        filled: false
      },
      {
        point: [0,
      1],
        attributesToChange: [sy],
        filled: false
      }
    ];
  }
});

Model.Transform.addChildren([createAttribute("X", "x", "0.00"), createAttribute("Y", "y", "0.00"), createAttribute("Scale X", "sx", "1.00"), createAttribute("Scale Y", "sy", "1.00"), createAttribute("Rotate", "rotate", "0.00")]);
```

Response:
createAttribute = (label, name, exprString) ->
  attribute = Model.Attribute.createVariant
    label: label
    name: name
  attribute.setExpression(exprString)
  return attribute

# =============================================================================
# Components
# =============================================================================

Model.Component = Model.NodeWithAttributes.createVariant
  label: "Component"

  graphicClass: Graphic.Component

  graphic: ->
    graphic = new @graphicClass()
    _.extend graphic, @getAttributesValuesByName()
    return graphic

Model.Transform = Model.Component.createVariant
  label: "Transform"

  matrix: ->
    {x, y, sx, sy, rotate} = @getAttributesValuesByName()
    return Util.Matrix.naturalConstruct(x, y, sx, sy, rotate)
  defaultAttributesToChange: ->
    {x, y} = @getAttributesByName()
    return [x, y]
  controllableAttributes: ->
    {x, y, sx, sy, rotate} = @getAttributesByName()
    return [x, y, sx, sy, rotate]
  controlPoints: ->
    {x, y, sx, sy} = @getAttributesByName()
    return [
      {point: [0, 0], attributesToChange: [x, y], filled: true}
      {point: [1, 0], attributesToChange: [sx], filled: false}
      {point: [0, 1], attributesToChange: [sy], filled: false}
    ]

Model.Transform.addChildren [
  createAttribute("X", "x", "0.00")
  createAttribute("Y", "y", "0.00")
  createAttribute("Scale X", "sx", "1.00")
  createAttribute("Scale Y", "sy", "1.00")
  createAttribute("Rotate", "rotate", "0.00")
]


Prompt:
createAttribute = (label, name, exprString) ->
  attribute = Model.Attribute.createVariant
    label: label
    name: name
  attribute.setExpression(exprString)
  return attribute

# =============================================================================
# Components
# =============================================================================

Model.Component = Model.NodeWithAttributes.createVariant
  label: "Component"

  graphicClass: Graphic.Component

  graphic: ->
    graphic = new @graphicClass()
    _.extend graphic, @getAttributesValuesByName()
    return graphic

Model.Transform = Model.Component.createVariant
  label: "Transform"

Response:
matrix: ->
    {x, y, sx, sy, rotate} = @getAttributesValuesByName()
    return Util.Matrix.naturalConstruct(x, y, sx, sy, rotate)
  defaultAttributesToChange: ->
    {x, y} = @getAttributesByName()
    return [x, y]
  controllableAttributes: ->
    {x, y, sx, sy, rotate} = @getAttributesByName()
    return [x, y, sx, sy, rotate]
  controlPoints: ->
    {x, y, sx, sy} = @getAttributesByName()
    return [
      {point: [0, 0], attributesToChange: [x, y], filled: true}
      {point: [1, 0], attributesToChange: [sx], filled: false}
      {point: [0, 1], attributesToChange: [sy], filled: false}
    ]

Model.Transform.addChildren [
  createAttribute("X", "x", "0.00")
  createAttribute("Y", "y", "0.00")
  createAttribute("Scale X", "sx", "1.00")
  createAttribute("Scale Y", "sy", "1.00")
  createAttribute("Rotate", "rotate", "0.00")
]


Response:
createAnchor = (x, y) ->
  anchor = Model.Anchor.createVariant()
  transform = anchor.childOfType(Model.Transform)
  attributes = transform.getAttributesByName()
  attributes.x.setExpression(x)
  attributes.y.setExpression(y)
  return anchor

Model.PathComponent = Model.Component.createVariant
  _devLabel: "PathComponent"
  label: "Path"
  graphicClass: Graphic.PathComponent

Model.PathComponent.addChildren [
  createAttribute("Close Path", "closed", "true")
]

Model.Path = Model.Shape.createVariant
  label: "Path"
  graphicClass: Graphic.Path

Model.Path.addChildren [
  Model.PathComponent.createVariant()
  Model.Fill.createVariant()
  Model.Stroke.createVariant()
]

Model.Circle = Model.Path.createVariant
  label: "Circle"
  graphicClass: Graphic.Circle

Model.Rectangle = Model.Path.createVariant
  label: "Rectangle"

Model.Rectangle.addChildren [
  createAnchor("0.00", "0.00")
  createAnchor("0.00", "1.00")
  createAnchor("1.00", "1.00")
  createAnchor("1.00", "0.00")
]

Model.TextComponent = Model.Component.createVariant
  _devLabel: "TextComponent"
  label: "Text"
  graphicClass: Graphic.TextComponent


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
createAnchor = (x, y) ->
  anchor = Model.Anchor.createVariant()
  transform = anchor.childOfType(Model.Transform)
  attributes = transform.getAttributesByName()
  attributes.x.setExpression(x)
  attributes.y.setExpression(y)
  return anchor

Model.PathComponent = Model.Component.createVariant
  _devLabel: "PathComponent"
  label: "Path"
  graphicClass: Graphic.PathComponent

Model.PathComponent.addChildren [
  createAttribute("Close Path", "closed", "true")
]

Model.Path = Model.Shape.createVariant
  label: "Path"
  graphicClass: Graphic.Path

Model.Path.addChildren [
  Model.PathComponent.createVariant()
  Model.Fill.createVariant()
  Model.Stroke.createVariant()
]

Model.Circle = Model.Path.createVariant
  label: "Circle"
  graphicClass: Graphic.Circle

Model.Rectangle = Model.Path.createVariant
  label: "Rectangle"

Model.Rectangle.addChildren [
  createAnchor("0.00", "0.00")
  createAnchor("0.00", "1.00")
  createAnchor("1.00", "1.00")
  createAnchor("1.00", "0.00")
]

Model.TextComponent = Model.Component.createVariant
  _devLabel: "TextComponent"
  label: "Text"
  graphicClass: Graphic.TextComponent
```

Response:
var createAnchor;

createAnchor = function(x, y) {
  var anchor, attributes, transform;
  anchor = Model.Anchor.createVariant();
  transform = anchor.childOfType(Model.Transform);
  attributes = transform.getAttributesByName();
  attributes.x.setExpression(x);
  attributes.y.setExpression(y);
  return anchor;
};

Model.PathComponent = Model.Component.createVariant({
  _devLabel: "PathComponent",
  label: "Path",
  graphicClass: Graphic.PathComponent
});

Model.PathComponent.addChildren([createAttribute("Close Path", "closed", "true")]);

Model.Path = Model.Shape.createVariant({
  label: "Path",
  graphicClass: Graphic.Path
});

Model.Path.addChildren([Model.PathComponent.createVariant(), Model.Fill.createVariant(), Model.Stroke.createVariant()]);

Model.Circle = Model.Path.createVariant({
  label: "Circle",
  graphicClass: Graphic.Circle
});

Model.Rectangle = Model.Path.createVariant({
  label: "Rectangle"
});

Model.Rectangle.addChildren([createAnchor("0.00", "0.00"), createAnchor("0.00", "1.00"), createAnchor("1.00", "1.00"), createAnchor("1.00", "0.00")]);

Model.TextComponent = Model.Component.createVariant({
  _devLabel: "TextComponent",
  label: "Text",
  graphicClass: Graphic.TextComponent
});


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

createAnchor = function(x, y) {
  var anchor, attributes, transform;
  anchor = Model.Anchor.createVariant();
  transform = anchor.childOfType(Model.Transform);
  attributes = transform.getAttributesByName();
  attributes.x.setExpression(x);
  attributes.y.setExpression(y);
  return anchor;
};

Model.PathComponent = Model.Component.createVariant({
  _devLabel: "PathComponent",
  label: "Path",
  graphicClass: Graphic.PathComponent
});

Model.PathComponent.addChildren([createAttribute("Close Path", "closed", "true")]);

Model.Path = Model.Shape.createVariant({
  label: "Path",
  graphicClass: Graphic.Path
});

Model.Path.addChildren([Model.PathComponent.createVariant(), Model.Fill.createVariant(), Model.Stroke.createVariant()]);

Model.Circle = Model.Path.createVariant({
  label: "Circle",
  graphicClass: Graphic.Circle
});

Model.Rectangle = Model.Path.createVariant({
  label: "Rectangle"
});

Model.Rectangle.addChildren([createAnchor("0.00", "0.00"), createAnchor("0.00", "1.00"), createAnchor("1.00", "1.00"), createAnchor("1.00", "0.00")]);

Model.TextComponent = Model.Component.createVariant({
  _devLabel: "TextComponent",
  label: "Text",
  graphicClass: Graphic.TextComponent
});
```

Response:
createAnchor = (x, y) ->
  anchor = Model.Anchor.createVariant()
  transform = anchor.childOfType(Model.Transform)
  attributes = transform.getAttributesByName()
  attributes.x.setExpression(x)
  attributes.y.setExpression(y)
  return anchor

Model.PathComponent = Model.Component.createVariant
  _devLabel: "PathComponent"
  label: "Path"
  graphicClass: Graphic.PathComponent

Model.PathComponent.addChildren [
  createAttribute("Close Path", "closed", "true")
]

Model.Path = Model.Shape.createVariant
  label: "Path"
  graphicClass: Graphic.Path

Model.Path.addChildren [
  Model.PathComponent.createVariant()
  Model.Fill.createVariant()
  Model.Stroke.createVariant()
]

Model.Circle = Model.Path.createVariant
  label: "Circle"
  graphicClass: Graphic.Circle

Model.Rectangle = Model.Path.createVariant
  label: "Rectangle"

Model.Rectangle.addChildren [
  createAnchor("0.00", "0.00")
  createAnchor("0.00", "1.00")
  createAnchor("1.00", "1.00")
  createAnchor("1.00", "0.00")
]

Model.TextComponent = Model.Component.createVariant
  _devLabel: "TextComponent"
  label: "Text"
  graphicClass: Graphic.TextComponent


Prompt:
createAnchor = (x, y) ->
  anchor = Model.Anchor.createVariant()
  transform = anchor.childOfType(Model.Transform)
  attributes = transform.getAttributesByName()
  attributes.x.setExpression(x)
  attributes.y.setExpression(y)
  return anchor

Model.PathComponent = Model.Component.createVariant
  _devLabel: "PathComponent"
  label: "Path"
  graphicClass: Graphic.PathComponent

Model.PathComponent.addChildren [
  createAttribute("Close Path", "closed", "true")
]

Model.Path = Model.Shape.createVariant
  label: "Path"
  graphicClass: Graphic.Path

Model.Path.addChildren [
  Model.PathComponent.createVariant()

Response:
Model.Fill.createVariant()
  Model.Stroke.createVariant()
]

Model.Circle = Model.Path.createVariant
  label: "Circle"
  graphicClass: Graphic.Circle

Model.Rectangle = Model.Path.createVariant
  label: "Rectangle"

Model.Rectangle.addChildren [
  createAnchor("0.00", "0.00")
  createAnchor("0.00", "1.00")
  createAnchor("1.00", "1.00")
  createAnchor("1.00", "0.00")
]

Model.TextComponent = Model.Component.createVariant
  _devLabel: "TextComponent"
  label: "Text"
  graphicClass: Graphic.TextComponent


Response:
createAttribute = (label, name, exprString) ->
  attribute = Model.Attribute.createVariant
    label: label
    name: name
  attribute.setExpression(exprString)
  return attribute

# =============================================================================
# Components
# =============================================================================

Model.Component = Model.Node.createVariant
  label: "Component"

  attributes: ->
    @childrenOfType(Model.Attribute)

  getAttributesByName: ->
    _.indexBy @attributes(), "name"

  getAttributesValuesByName: ->
    result = {}
    for attribute in @attributes()
      name = attribute.name
      value = attribute.value()
      result[name] = value
    return result

  graphicClass: Graphic.Component

  graphic: ->
    graphic = new @graphicClass()
    _.extend graphic, @getAttributesValuesByName()
    return graphic

Model.Transform = Model.Component.createVariant
  label: "Transform"

  matrix: ->
    {x, y, sx, sy, rotate} = @getAttributesValuesByName()
    return Util.Matrix.naturalConstruct(x, y, sx, sy, rotate)
  defaultAttributesToChange: ->
    {x, y} = @getAttributesByName()
    return [x, y]
  controllableAttributes: ->
    {x, y, sx, sy, rotate} = @getAttributesByName()
    return [x, y, sx, sy, rotate]
  controlPoints: ->


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
createAttribute = (label, name, exprString) ->
  attribute = Model.Attribute.createVariant
    label: label
    name: name
  attribute.setExpression(exprString)
  return attribute

# =============================================================================
# Components
# =============================================================================

Model.Component = Model.Node.createVariant
  label: "Component"

  attributes: ->
    @childrenOfType(Model.Attribute)

  getAttributesByName: ->
    _.indexBy @attributes(), "name"

  getAttributesValuesByName: ->
    result = {}
    for attribute in @attributes()
      name = attribute.name
      value = attribute.value()
      result[name] = value
    return result

  graphicClass: Graphic.Component

  graphic: ->
    graphic = new @graphicClass()
    _.extend graphic, @getAttributesValuesByName()
    return graphic

Model.Transform = Model.Component.createVariant
  label: "Transform"

  matrix: ->
    {x, y, sx, sy, rotate} = @getAttributesValuesByName()
    return Util.Matrix.naturalConstruct(x, y, sx, sy, rotate)
  defaultAttributesToChange: ->
    {x, y} = @getAttributesByName()
    return [x, y]
  controllableAttributes: ->
    {x, y, sx, sy, rotate} = @getAttributesByName()
    return [x, y, sx, sy, rotate]
  controlPoints: ->
```

Response:
var createAttribute;

createAttribute = function(label, name, exprString) {
  var attribute;
  attribute = Model.Attribute.createVariant({
    label: label,
    name: name
  });
  attribute.setExpression(exprString);
  return attribute;
};

// =============================================================================
// Components
// =============================================================================
Model.Component = Model.Node.createVariant({
  label: "Component",
  attributes: function() {
    return this.childrenOfType(Model.Attribute);
  },
  getAttributesByName: function() {
    return _.indexBy(this.attributes(), "name");
  },
  getAttributesValuesByName: function() {
    var attribute, i, len, name, ref, result, value;
    result = {};
    ref = this.attributes();
    for (i = 0, len = ref.length; i < len; i++) {
      attribute = ref[i];
      name = attribute.name;
      value = attribute.value();
      result[name] = value;
    }
    return result;
  },
  graphicClass: Graphic.Component,
  graphic: function() {
    var graphic;
    graphic = new this.graphicClass();
    _.extend(graphic, this.getAttributesValuesByName());
    return graphic;
  }
});

Model.Transform = Model.Component.createVariant({
  label: "Transform",
  matrix: function() {
    var rotate, sx, sy, x, y;
    ({x, y, sx, sy, rotate} = this.getAttributesValuesByName());
    return Util.Matrix.naturalConstruct(x, y, sx, sy, rotate);
  },
  defaultAttributesToChange: function() {
    var x, y;
    ({x, y} = this.getAttributesByName());
    return [x, y];
  },
  controllableAttributes: function() {
    var rotate, sx, sy, x, y;
    ({x, y, sx, sy, rotate} = this.getAttributesByName());
    return [x, y, sx, sy, rotate];
  },
  controlPoints: function() {}
});


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

createAttribute = function(label, name, exprString) {
  var attribute;
  attribute = Model.Attribute.createVariant({
    label: label,
    name: name
  });
  attribute.setExpression(exprString);
  return attribute;
};

// =============================================================================
// Components
// =============================================================================
Model.Component = Model.Node.createVariant({
  label: "Component",
  attributes: function() {
    return this.childrenOfType(Model.Attribute);
  },
  getAttributesByName: function() {
    return _.indexBy(this.attributes(), "name");
  },
  getAttributesValuesByName: function() {
    var attribute, i, len, name, ref, result, value;
    result = {};
    ref = this.attributes();
    for (i = 0, len = ref.length; i < len; i++) {
      attribute = ref[i];
      name = attribute.name;
      value = attribute.value();
      result[name] = value;
    }
    return result;
  },
  graphicClass: Graphic.Component,
  graphic: function() {
    var graphic;
    graphic = new this.graphicClass();
    _.extend(graphic, this.getAttributesValuesByName());
    return graphic;
  }
});

Model.Transform = Model.Component.createVariant({
  label: "Transform",
  matrix: function() {
    var rotate, sx, sy, x, y;
    ({x, y, sx, sy, rotate} = this.getAttributesValuesByName());
    return Util.Matrix.naturalConstruct(x, y, sx, sy, rotate);
  },
  defaultAttributesToChange: function() {
    var x, y;
    ({x, y} = this.getAttributesByName());
    return [x, y];
  },
  controllableAttributes: function() {
    var rotate, sx, sy, x, y;
    ({x, y, sx, sy, rotate} = this.getAttributesByName());
    return [x, y, sx, sy, rotate];
  },
  controlPoints: function() {}
});
```

Response:
createAttribute = (label, name, exprString) ->
  attribute = Model.Attribute.createVariant
    label: label
    name: name
  attribute.setExpression(exprString)
  return attribute

# =============================================================================
# Components
# =============================================================================

Model.Component = Model.Node.createVariant
  label: "Component"

  attributes: ->
    @childrenOfType(Model.Attribute)

  getAttributesByName: ->
    _.indexBy @attributes(), "name"

  getAttributesValuesByName: ->
    result = {}
    for attribute in @attributes()
      name = attribute.name
      value = attribute.value()
      result[name] = value
    return result

  graphicClass: Graphic.Component

  graphic: ->
    graphic = new @graphicClass()
    _.extend graphic, @getAttributesValuesByName()
    return graphic

Model.Transform = Model.Component.createVariant
  label: "Transform"

  matrix: ->
    {x, y, sx, sy, rotate} = @getAttributesValuesByName()
    return Util.Matrix.naturalConstruct(x, y, sx, sy, rotate)
  defaultAttributesToChange: ->
    {x, y} = @getAttributesByName()
    return [x, y]
  controllableAttributes: ->
    {x, y, sx, sy, rotate} = @getAttributesByName()
    return [x, y, sx, sy, rotate]
  controlPoints: ->


Prompt:
createAttribute = (label, name, exprString) ->
  attribute = Model.Attribute.createVariant
    label: label
    name: name
  attribute.setExpression(exprString)
  return attribute

# =============================================================================
# Components
# =============================================================================

Model.Component = Model.Node.createVariant
  label: "Component"

  attributes: ->
    @childrenOfType(Model.Attribute)

  getAttributesByName: ->
    _.indexBy @attributes(), "name"

  getAttributesValuesByName: ->
    result = {}
    for attribute in @attributes()
      name = attribute.name
      value = attribute.value()

Response:
result[name] = value
    return result

  graphicClass: Graphic.Component

  graphic: ->
    graphic = new @graphicClass()
    _.extend graphic, @getAttributesValuesByName()
    return graphic

Model.Transform = Model.Component.createVariant
  label: "Transform"

  matrix: ->
    {x, y, sx, sy, rotate} = @getAttributesValuesByName()
    return Util.Matrix.naturalConstruct(x, y, sx, sy, rotate)
  defaultAttributesToChange: ->
    {x, y} = @getAttributesByName()
    return [x, y]
  controllableAttributes: ->
    {x, y, sx, sy, rotate} = @getAttributesByName()
    return [x, y, sx, sy, rotate]
  controlPoints: ->


Response:
{x, y, sx, sy} = @getAttributesByName()
    return [
      {point: [0, 0], attributesToChange: [x, y], filled: true}
      {point: [1, 0], attributesToChange: [sx], filled: false}
      {point: [0, 1], attributesToChange: [sy], filled: false}
    ]

Model.Transform.addChildren [
  createAttribute("X", "x", "0.00")
  createAttribute("Y", "y", "0.00")
  createAttribute("Scale X", "sx", "1.00")
  createAttribute("Scale Y", "sy", "1.00")
  createAttribute("Rotate", "rotate", "0.00")
]

Model.Fill = Model.Component.createVariant
  label: "Fill"
  graphicClass: Graphic.Fill

Model.Fill.addChildren [
  createAttribute("Fill Color", "color", "rgba(0.93, 0.93, 0.93, 1.00)")
]

Model.Stroke = Model.Component.createVariant
  label: "Stroke"
  graphicClass: Graphic.Stroke

Model.Stroke.addChildren [
  createAttribute("Stroke Color", "color", "rgba(0.60, 0.60, 0.60, 1.00)")
  createAttribute("Line Width", "lineWidth", "1")
]

# =============================================================================
# Elements
# =============================================================================

Model.Shape = Model.Element.createVariant
  label: "Shape"

Model.Shape.addChildren [
  Model.Transform.createVariant()
]

Model.Group = Model.Shape.createVariant
  label: "Group"


Prompt:
{x, y, sx, sy} = @getAttributesByName()
    return [
      {point: [0, 0], attributesToChange: [x, y], filled: true}
      {point: [1, 0], attributesToChange: [sx], filled: false}
      {point: [0, 1], attributesToChange: [sy], filled: false}
    ]

Model.Transform.addChildren [
  createAttribute("X", "x", "0.00")
  createAttribute("Y", "y", "0.00")
  createAttribute("Scale X", "sx", "1.00")
  createAttribute("Scale Y", "sy", "1.00")
  createAttribute("Rotate", "rotate", "0.00")
]

Model.Fill = Model.Component.createVariant
  label: "Fill"
  graphicClass: Graphic.Fill

Model.Fill.addChildren [
  createAttribute("Fill Color", "color", "rgba(0.93, 0.93, 0.93, 1.00)")
]

Response:
Model.Stroke = Model.Component.createVariant
  label: "Stroke"
  graphicClass: Graphic.Stroke

Model.Stroke.addChildren [
  createAttribute("Stroke Color", "color", "rgba(0.60, 0.60, 0.60, 1.00)")
  createAttribute("Line Width", "lineWidth", "1")
]

# =============================================================================
# Elements
# =============================================================================

Model.Shape = Model.Element.createVariant
  label: "Shape"

Model.Shape.addChildren [
  Model.Transform.createVariant()
]

Model.Group = Model.Shape.createVariant
  label: "Group"


Response:
createAnchor = (x, y) ->
  anchor = Model.Anchor.createVariant()
  transform = anchor.childOfType(Model.Transform)
  attributes = transform.getAttributesByName()
  attributes.x.setExpression(x)
  attributes.y.setExpression(y)
  return anchor

Model.PathComponent = Model.Component.createVariant
  devLabel: "PathComponent"
  label: "Path"
  graphicClass: Graphic.PathComponent

Model.PathComponent.addChildren [
  createAttribute("Close Path", "closed", "true")
]

Model.Path = Model.Shape.createVariant
  label: "Path"
  graphicClass: Graphic.Path

Model.Path.addChildren [
  Model.PathComponent.createVariant()
  Model.Fill.createVariant()
  Model.Stroke.createVariant()
]

Model.Circle = Model.Path.createVariant
  label: "Circle"
  graphicClass: Graphic.Circle

Model.Rectangle = Model.Path.createVariant
  label: "Rectangle"

Model.Rectangle.addChildren [
  createAnchor("0.00", "0.00")
  createAnchor("0.00", "1.00")
  createAnchor("1.00", "1.00")
  createAnchor("1.00", "0.00")
]

Model.TextComponent = Model.Component.createVariant
  devLabel: "TextComponent"
  label: "Text"
  graphicClass: Graphic.TextComponent


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
createAnchor = (x, y) ->
  anchor = Model.Anchor.createVariant()
  transform = anchor.childOfType(Model.Transform)
  attributes = transform.getAttributesByName()
  attributes.x.setExpression(x)
  attributes.y.setExpression(y)
  return anchor

Model.PathComponent = Model.Component.createVariant
  devLabel: "PathComponent"
  label: "Path"
  graphicClass: Graphic.PathComponent

Model.PathComponent.addChildren [
  createAttribute("Close Path", "closed", "true")
]

Model.Path = Model.Shape.createVariant
  label: "Path"
  graphicClass: Graphic.Path

Model.Path.addChildren [
  Model.PathComponent.createVariant()
  Model.Fill.createVariant()
  Model.Stroke.createVariant()
]

Model.Circle = Model.Path.createVariant
  label: "Circle"
  graphicClass: Graphic.Circle

Model.Rectangle = Model.Path.createVariant
  label: "Rectangle"

Model.Rectangle.addChildren [
  createAnchor("0.00", "0.00")
  createAnchor("0.00", "1.00")
  createAnchor("1.00", "1.00")
  createAnchor("1.00", "0.00")
]

Model.TextComponent = Model.Component.createVariant
  devLabel: "TextComponent"
  label: "Text"
  graphicClass: Graphic.TextComponent
```

Response:
var createAnchor;

createAnchor = function(x, y) {
  var anchor, attributes, transform;
  anchor = Model.Anchor.createVariant();
  transform = anchor.childOfType(Model.Transform);
  attributes = transform.getAttributesByName();
  attributes.x.setExpression(x);
  attributes.y.setExpression(y);
  return anchor;
};

Model.PathComponent = Model.Component.createVariant({
  devLabel: "PathComponent",
  label: "Path",
  graphicClass: Graphic.PathComponent
});

Model.PathComponent.addChildren([createAttribute("Close Path", "closed", "true")]);

Model.Path = Model.Shape.createVariant({
  label: "Path",
  graphicClass: Graphic.Path
});

Model.Path.addChildren([Model.PathComponent.createVariant(), Model.Fill.createVariant(), Model.Stroke.createVariant()]);

Model.Circle = Model.Path.createVariant({
  label: "Circle",
  graphicClass: Graphic.Circle
});

Model.Rectangle = Model.Path.createVariant({
  label: "Rectangle"
});

Model.Rectangle.addChildren([createAnchor("0.00", "0.00"), createAnchor("0.00", "1.00"), createAnchor("1.00", "1.00"), createAnchor("1.00", "0.00")]);

Model.TextComponent = Model.Component.createVariant({
  devLabel: "TextComponent",
  label: "Text",
  graphicClass: Graphic.TextComponent
});


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

createAnchor = function(x, y) {
  var anchor, attributes, transform;
  anchor = Model.Anchor.createVariant();
  transform = anchor.childOfType(Model.Transform);
  attributes = transform.getAttributesByName();
  attributes.x.setExpression(x);
  attributes.y.setExpression(y);
  return anchor;
};

Model.PathComponent = Model.Component.createVariant({
  devLabel: "PathComponent",
  label: "Path",
  graphicClass: Graphic.PathComponent
});

Model.PathComponent.addChildren([createAttribute("Close Path", "closed", "true")]);

Model.Path = Model.Shape.createVariant({
  label: "Path",
  graphicClass: Graphic.Path
});

Model.Path.addChildren([Model.PathComponent.createVariant(), Model.Fill.createVariant(), Model.Stroke.createVariant()]);

Model.Circle = Model.Path.createVariant({
  label: "Circle",
  graphicClass: Graphic.Circle
});

Model.Rectangle = Model.Path.createVariant({
  label: "Rectangle"
});

Model.Rectangle.addChildren([createAnchor("0.00", "0.00"), createAnchor("0.00", "1.00"), createAnchor("1.00", "1.00"), createAnchor("1.00", "0.00")]);

Model.TextComponent = Model.Component.createVariant({
  devLabel: "TextComponent",
  label: "Text",
  graphicClass: Graphic.TextComponent
});
```

Response:
createAnchor = (x, y) ->
  anchor = Model.Anchor.createVariant()
  transform = anchor.childOfType(Model.Transform)
  attributes = transform.getAttributesByName()
  attributes.x.setExpression(x)
  attributes.y.setExpression(y)
  return anchor

Model.PathComponent = Model.Component.createVariant
  devLabel: "PathComponent"
  label: "Path"
  graphicClass: Graphic.PathComponent

Model.PathComponent.addChildren [
  createAttribute("Close Path", "closed", "true")
]

Model.Path = Model.Shape.createVariant
  label: "Path"
  graphicClass: Graphic.Path

Model.Path.addChildren [
  Model.PathComponent.createVariant()
  Model.Fill.createVariant()
  Model.Stroke.createVariant()
]

Model.Circle = Model.Path.createVariant
  label: "Circle"
  graphicClass: Graphic.Circle

Model.Rectangle = Model.Path.createVariant
  label: "Rectangle"

Model.Rectangle.addChildren [
  createAnchor("0.00", "0.00")
  createAnchor("0.00", "1.00")
  createAnchor("1.00", "1.00")
  createAnchor("1.00", "0.00")
]

Model.TextComponent = Model.Component.createVariant
  devLabel: "TextComponent"
  label: "Text"
  graphicClass: Graphic.TextComponent


Prompt:
createAnchor = (x, y) ->
  anchor = Model.Anchor.createVariant()
  transform = anchor.childOfType(Model.Transform)
  attributes = transform.getAttributesByName()
  attributes.x.setExpression(x)
  attributes.y.setExpression(y)
  return anchor

Model.PathComponent = Model.Component.createVariant
  devLabel: "PathComponent"
  label: "Path"
  graphicClass: Graphic.PathComponent

Model.PathComponent.addChildren [
  createAttribute("Close Path", "closed", "true")
]

Model.Path = Model.Shape.createVariant
  label: "Path"
  graphicClass: Graphic.Path

Model.Path.addChildren [
  Model.PathComponent.createVariant()

Response:
Model.Fill.createVariant()
  Model.Stroke.createVariant()
]

Model.Circle = Model.Path.createVariant
  label: "Circle"
  graphicClass: Graphic.Circle

Model.Rectangle = Model.Path.createVariant
  label: "Rectangle"

Model.Rectangle.addChildren [
  createAnchor("0.00", "0.00")
  createAnchor("0.00", "1.00")
  createAnchor("1.00", "1.00")
  createAnchor("1.00", "0.00")
]

Model.TextComponent = Model.Component.createVariant
  devLabel: "TextComponent"
  label: "Text"
  graphicClass: Graphic.TextComponent


Response:
createAttribute = (label, name, exprString) ->
  attribute = Model.Attribute.createVariant
    label: label
    name: name
  attribute.setExpression(exprString)
  return attribute

# =============================================================================
# Components
# =============================================================================

Model.Component = Model.Node.createVariant
  attributes: ->
    @childrenOfType(Model.Attribute)

  getAttributesByName: ->
    _.indexBy @attributes(), "name"

  getAttributesValuesByName: ->
    result = {}
    for attribute in @attributes()
      name = attribute.name
      value = attribute.value()
      result[name] = value
    return result

  graphicClass: Graphic.Component

  graphic: ->
    graphic = new @graphicClass()
    _.extend graphic, @getAttributesValuesByName()
    return graphic

Model.Transform = Model.Component.createVariant
  label: "Transform"
  matrix: ->
    {x, y, sx, sy, rotate} = @getAttributesValuesByName()
    return Util.Matrix.naturalConstruct(x, y, sx, sy, rotate)
  defaultAttributesToChange: ->
    {x, y} = @getAttributesByName()
    return [x, y]
  controllableAttributes: ->
    {x, y, sx, sy, rotate} = @getAttributesByName()
    return [x, y, sx, sy, rotate]
  controlPoints: ->
    {x, y, sx, sy} = @getAttributesByName()
    return [
      {point: [0, 0], attributesToChange: [x, y], filled: true}


Prompt:
createAttribute = (label, name, exprString) ->
  attribute = Model.Attribute.createVariant
    label: label
    name: name
  attribute.setExpression(exprString)
  return attribute

# =============================================================================
# Components
# =============================================================================

Model.Component = Model.Node.createVariant
  attributes: ->
    @childrenOfType(Model.Attribute)

  getAttributesByName: ->
    _.indexBy @attributes(), "name"

  getAttributesValuesByName: ->
    result = {}
    for attribute in @attributes()
      name = attribute.name
      value = attribute.value()
      result[name] = value
    return result

Response:
graphicClass: Graphic.Component

  graphic: ->
    graphic = new @graphicClass()
    _.extend graphic, @getAttributesValuesByName()
    return graphic

Model.Transform = Model.Component.createVariant
  label: "Transform"
  matrix: ->
    {x, y, sx, sy, rotate} = @getAttributesValuesByName()
    return Util.Matrix.naturalConstruct(x, y, sx, sy, rotate)
  defaultAttributesToChange: ->
    {x, y} = @getAttributesByName()
    return [x, y]
  controllableAttributes: ->
    {x, y, sx, sy, rotate} = @getAttributesByName()
    return [x, y, sx, sy, rotate]
  controlPoints: ->
    {x, y, sx, sy} = @getAttributesByName()
    return [
      {point: [0, 0], attributesToChange: [x, y], filled: true}


Response:
createAnchor = (x, y) ->
  anchor = Model.Anchor.createVariant()
  transform = anchor.childOfType(Model.Transform)
  attributes = transform.getAttributesByName()
  attributes.x.setExpression(x)
  attributes.y.setExpression(y)
  return anchor

Model.PathComponent = Model.Component.createVariant
  label: "Path"
  graphicClass: Graphic.PathComponent

Model.PathComponent.addChildren [
  createAttribute("Close Path", "closed", "true")
]

Model.Path = Model.Shape.createVariant
  label: "Path"
  graphicClass: Graphic.Path

Model.Path.addChildren [
  Model.PathComponent.createVariant()
  Model.Fill.createVariant()
  Model.Stroke.createVariant()
]

Model.Circle = Model.Path.createVariant
  label: "Circle"
  graphicClass: Graphic.Circle

Model.Rectangle = Model.Path.createVariant
  label: "Rectangle"

Model.Rectangle.addChildren [
  createAnchor("0.00", "0.00")
  createAnchor("0.00", "1.00")
  createAnchor("1.00", "1.00")
  createAnchor("1.00", "0.00")
]

Model.TextComponent = Model.Component.createVariant
  label: "Text"
  graphicClass: Graphic.TextComponent

Model.TextComponent.addChildren [
  createAttribute("Text", "text", '"Text"')


Prompt:
createAnchor = (x, y) ->
  anchor = Model.Anchor.createVariant()
  transform = anchor.childOfType(Model.Transform)
  attributes = transform.getAttributesByName()
  attributes.x.setExpression(x)
  attributes.y.setExpression(y)
  return anchor

Model.PathComponent = Model.Component.createVariant
  label: "Path"
  graphicClass: Graphic.PathComponent

Model.PathComponent.addChildren [
  createAttribute("Close Path", "closed", "true")
]

Model.Path = Model.Shape.createVariant
  label: "Path"
  graphicClass: Graphic.Path

Model.Path.addChildren [
  Model.PathComponent.createVariant()
  Model.Fill.createVariant()
  Model.Stroke.createVariant()

Response:
]

Model.Circle = Model.Path.createVariant
  label: "Circle"
  graphicClass: Graphic.Circle

Model.Rectangle = Model.Path.createVariant
  label: "Rectangle"

Model.Rectangle.addChildren [
  createAnchor("0.00", "0.00")
  createAnchor("0.00", "1.00")
  createAnchor("1.00", "1.00")
  createAnchor("1.00", "0.00")
]

Model.TextComponent = Model.Component.createVariant
  label: "Text"
  graphicClass: Graphic.TextComponent

Model.TextComponent.addChildren [
  createAttribute("Text", "text", '"Text"')


Response:
createAttribute = (label, name, exprString) ->
  attribute = Model.Attribute.createVariant
    label: label
    name: name
  attribute.setExpression(exprString)
  return attribute

# =============================================================================
# Components
# =============================================================================

Model.Component = Model.Node.createVariant
  attributes: ->
    @childrenOfType(Model.Attribute)

  getAttributesByName: ->
    _.indexBy @attributes(), "name"

  getAttributesValuesByName: ->
    result = {}
    for attribute in @attributes()
      name = attribute.name
      value = attribute.value()
      result[name] = value
    return result

  graphicClass: Graphic.Component

  graphic: ->
    graphic = new @graphicClass()
    _.extend graphic, @getAttributesValuesByName()
    return graphic

Model.Transform = Model.Component.createVariant
  label: "Transform"
  matrix: ->
    {x, y, sx, sy, rotate} = @getAttributesValuesByName()
    return Util.Matrix.naturalConstruct(x, y, sx, sy, rotate)
  defaultAttributesToChange: ->
    {x, y} = @getAttributesByName()
    return [x, y]
  controllableAttributes: ->
    {x, y, sx, sy, rotate} = @getAttributesByName()
    return [x, y, sx, sy, rotate]

Model.Transform.addChildren [
  createAttribute("X", "x", "0.00")
  createAttribute("Y", "y", "0.00")


Prompt:
createAttribute = (label, name, exprString) ->
  attribute = Model.Attribute.createVariant
    label: label
    name: name
  attribute.setExpression(exprString)
  return attribute

# =============================================================================
# Components
# =============================================================================

Model.Component = Model.Node.createVariant
  attributes: ->
    @childrenOfType(Model.Attribute)

  getAttributesByName: ->
    _.indexBy @attributes(), "name"

  getAttributesValuesByName: ->
    result = {}
    for attribute in @attributes()
      name = attribute.name
      value = attribute.value()
      result[name] = value
    return result

Response:
graphicClass: Graphic.Component

  graphic: ->
    graphic = new @graphicClass()
    _.extend graphic, @getAttributesValuesByName()
    return graphic

Model.Transform = Model.Component.createVariant
  label: "Transform"
  matrix: ->
    {x, y, sx, sy, rotate} = @getAttributesValuesByName()
    return Util.Matrix.naturalConstruct(x, y, sx, sy, rotate)
  defaultAttributesToChange: ->
    {x, y} = @getAttributesByName()
    return [x, y]
  controllableAttributes: ->
    {x, y, sx, sy, rotate} = @getAttributesByName()
    return [x, y, sx, sy, rotate]

Model.Transform.addChildren [
  createAttribute("X", "x", "0.00")
  createAttribute("Y", "y", "0.00")


Response:
createAttribute = (label, name, exprString) ->
  attribute = Model.Attribute.createVariant
    label: label
    name: name
  attribute.setExpression(exprString)
  return attribute

# =============================================================================
# Components
# =============================================================================

Model.Component = Model.Node.createVariant
  attributes: ->
    @childrenOfType(Model.Attribute)

  getAttributesByName: ->
    _.indexBy @attributes(), "name"

  getAttributesValuesByName: ->
    result = {}
    for attribute in @attributes()
      name = attribute.name
      value = attribute.value()
      result[name] = value
    return result

  graphicClass: Graphic.Component

  graphic: ->
    graphic = new @graphicClass()
    _.extend graphic, @getAttributesValuesByName()
    return graphic

Model.Transform = Model.Component.createVariant
  label: "Transform"
  matrix: ->
    v = @getAttributesValuesByName()
    return Util.Matrix.naturalConstruct(v.x, v.y, v.sx, v.sy, v.rotate)
  defaultAttributesToChange: ->
    attributesByName = @getAttributesByName()
    return [attributesByName.x, attributesByName.y]

Model.Transform.addChildren [
  createAttribute("X", "x", "0.00")
  createAttribute("Y", "y", "0.00")
  createAttribute("Scale X", "sx", "1.00")
  createAttribute("Scale Y", "sy", "1.00")
  createAttribute("Rotate", "rotate", "0.00")


Prompt:
createAttribute = (label, name, exprString) ->
  attribute = Model.Attribute.createVariant
    label: label
    name: name
  attribute.setExpression(exprString)
  return attribute

# =============================================================================
# Components
# =============================================================================

Model.Component = Model.Node.createVariant
  attributes: ->
    @childrenOfType(Model.Attribute)

  getAttributesByName: ->
    _.indexBy @attributes(), "name"

  getAttributesValuesByName: ->
    result = {}
    for attribute in @attributes()
      name = attribute.name
      value = attribute.value()
      result[name] = value
    return result

Response:
graphicClass: Graphic.Component

  graphic: ->
    graphic = new @graphicClass()
    _.extend graphic, @getAttributesValuesByName()
    return graphic

Model.Transform = Model.Component.createVariant
  label: "Transform"
  matrix: ->
    v = @getAttributesValuesByName()
    return Util.Matrix.naturalConstruct(v.x, v.y, v.sx, v.sy, v.rotate)
  defaultAttributesToChange: ->
    attributesByName = @getAttributesByName()
    return [attributesByName.x, attributesByName.y]

Model.Transform.addChildren [
  createAttribute("X", "x", "0.00")
  createAttribute("Y", "y", "0.00")
  createAttribute("Scale X", "sx", "1.00")
  createAttribute("Scale Y", "sy", "1.00")
  createAttribute("Rotate", "rotate", "0.00")


Response:
createAttribute = (label, name, exprString) ->
  attribute = Model.Attribute.createVariant
    label: label
    name: name
  attribute.setExpression(exprString)
  return attribute

# =============================================================================
# Components
# =============================================================================

Model.Component = Model.Node.createVariant
  attributes: ->
    @childrenOfType(Model.Attribute)

  getAttributesByName: ->
    _.indexBy @attributes(), "name"

  getAttributesValuesByName: ->
    _.mapObject @getAttributesByName(), (attribute) ->
      attribute.value()

  graphicClass: Graphic.Component

  graphic: ->
    graphic = new @graphicClass()
    _.extend graphic, @getAttributesValuesByName()
    return graphic

Model.Transform = Model.Component.createVariant
  label: "Transform"
  matrix: ->
    v = @getAttributesValuesByName()
    return Util.Matrix.naturalConstruct(v.x, v.y, v.sx, v.sy, v.rotate)
  defaultAttributesToChange: ->
    attributesByName = @getAttributesByName()
    return [attributesByName.x, attributesByName.y]

Model.Transform.addChildren [
  createAttribute("X", "x", "0.00")
  createAttribute("Y", "y", "0.00")
  createAttribute("Scale X", "sx", "1.00")
  createAttribute("Scale Y", "sy", "1.00")
  createAttribute("Rotate", "rotate", "0.00")
]


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
createAttribute = (label, name, exprString) ->
  attribute = Model.Attribute.createVariant
    label: label
    name: name
  attribute.setExpression(exprString)
  return attribute

# =============================================================================
# Components
# =============================================================================

Model.Component = Model.Node.createVariant
  attributes: ->
    @childrenOfType(Model.Attribute)

  getAttributesByName: ->
    _.indexBy @attributes(), "name"

  getAttributesValuesByName: ->
    _.mapObject @getAttributesByName(), (attribute) ->
      attribute.value()

  graphicClass: Graphic.Component

  graphic: ->
    graphic = new @graphicClass()
    _.extend graphic, @getAttributesValuesByName()
    return graphic

Model.Transform = Model.Component.createVariant
  label: "Transform"
  matrix: ->
    v = @getAttributesValuesByName()
    return Util.Matrix.naturalConstruct(v.x, v.y, v.sx, v.sy, v.rotate)
  defaultAttributesToChange: ->
    attributesByName = @getAttributesByName()
    return [attributesByName.x, attributesByName.y]

Model.Transform.addChildren [
  createAttribute("X", "x", "0.00")
  createAttribute("Y", "y", "0.00")
  createAttribute("Scale X", "sx", "1.00")
  createAttribute("Scale Y", "sy", "1.00")
  createAttribute("Rotate", "rotate", "0.00")
]
```

Response:
var createAttribute;

createAttribute = function(label, name, exprString) {
  var attribute;
  attribute = Model.Attribute.createVariant({
    label: label,
    name: name
  });
  attribute.setExpression(exprString);
  return attribute;
};

// =============================================================================
// Components
// =============================================================================
Model.Component = Model.Node.createVariant({
  attributes: function() {
    return this.childrenOfType(Model.Attribute);
  },
  getAttributesByName: function() {
    return _.indexBy(this.attributes(), "name");
  },
  getAttributesValuesByName: function() {
    return _.mapObject(this.getAttributesByName(), function(attribute) {
      return attribute.value();
    });
  },
  graphicClass: Graphic.Component,
  graphic: function() {
    var graphic;
    graphic = new this.graphicClass();
    _.extend(graphic, this.getAttributesValuesByName());
    return graphic;
  }
});

Model.Transform = Model.Component.createVariant({
  label: "Transform",
  matrix: function() {
    var v;
    v = this.getAttributesValuesByName();
    return Util.Matrix.naturalConstruct(v.x, v.y, v.sx, v.sy, v.rotate);
  },
  defaultAttributesToChange: function() {
    var attributesByName;
    attributesByName = this.getAttributesByName();
    return [attributesByName.x, attributesByName.y];
  }
});

Model.Transform.addChildren([createAttribute("X", "x", "0.00"), createAttribute("Y", "y", "0.00"), createAttribute("Scale X", "sx", "1.00"), createAttribute("Scale Y", "sy", "1.00"), createAttribute("Rotate", "rotate", "0.00")]);


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

createAttribute = function(label, name, exprString) {
  var attribute;
  attribute = Model.Attribute.createVariant({
    label: label,
    name: name
  });
  attribute.setExpression(exprString);
  return attribute;
};

// =============================================================================
// Components
// =============================================================================
Model.Component = Model.Node.createVariant({
  attributes: function() {
    return this.childrenOfType(Model.Attribute);
  },
  getAttributesByName: function() {
    return _.indexBy(this.attributes(), "name");
  },
  getAttributesValuesByName: function() {
    return _.mapObject(this.getAttributesByName(), function(attribute) {
      return attribute.value();
    });
  },
  graphicClass: Graphic.Component,
  graphic: function() {
    var graphic;
    graphic = new this.graphicClass();
    _.extend(graphic, this.getAttributesValuesByName());
    return graphic;
  }
});

Model.Transform = Model.Component.createVariant({
  label: "Transform",
  matrix: function() {
    var v;
    v = this.getAttributesValuesByName();
    return Util.Matrix.naturalConstruct(v.x, v.y, v.sx, v.sy, v.rotate);
  },
  defaultAttributesToChange: function() {
    var attributesByName;
    attributesByName = this.getAttributesByName();
    return [attributesByName.x, attributesByName.y];
  }
});

Model.Transform.addChildren([createAttribute("X", "x", "0.00"), createAttribute("Y", "y", "0.00"), createAttribute("Scale X", "sx", "1.00"), createAttribute("Scale Y", "sy", "1.00"), createAttribute("Rotate", "rotate", "0.00")]);
```

Response:
createAttribute = (label, name, exprString) ->
  attribute = Model.Attribute.createVariant
    label: label
    name: name
  attribute.setExpression(exprString)
  return attribute

# =============================================================================
# Components
# =============================================================================

Model.Component = Model.Node.createVariant
  attributes: ->
    @childrenOfType(Model.Attribute)

  getAttributesByName: ->
    _.indexBy @attributes(), "name"

  getAttributesValuesByName: ->
    _.mapObject @getAttributesByName(), (attribute) ->
      attribute.value()

  graphicClass: Graphic.Component

  graphic: ->
    graphic = new @graphicClass()
    _.extend graphic, @getAttributesValuesByName()
    return graphic

Model.Transform = Model.Component.createVariant
  label: "Transform"
  matrix: ->
    v = @getAttributesValuesByName()
    return Util.Matrix.naturalConstruct(v.x, v.y, v.sx, v.sy, v.rotate)
  defaultAttributesToChange: ->
    attributesByName = @getAttributesByName()
    return [attributesByName.x, attributesByName.y]

Model.Transform.addChildren [
  createAttribute("X", "x", "0.00")
  createAttribute("Y", "y", "0.00")
  createAttribute("Scale X", "sx", "1.00")
  createAttribute("Scale Y", "sy", "1.00")
  createAttribute("Rotate", "rotate", "0.00")
]


Prompt:
createAttribute = (label, name, exprString) ->
  attribute = Model.Attribute.createVariant
    label: label
    name: name
  attribute.setExpression(exprString)
  return attribute

# =============================================================================
# Components
# =============================================================================

Model.Component = Model.Node.createVariant
  attributes: ->
    @childrenOfType(Model.Attribute)

  getAttributesByName: ->
    _.indexBy @attributes(), "name"

  getAttributesValuesByName: ->
    _.mapObject @getAttributesByName(), (attribute) ->
      attribute.value()

  graphicClass: Graphic.Component

Response:
graphic: ->
    graphic = new @graphicClass()
    _.extend graphic, @getAttributesValuesByName()
    return graphic

Model.Transform = Model.Component.createVariant
  label: "Transform"
  matrix: ->
    v = @getAttributesValuesByName()
    return Util.Matrix.naturalConstruct(v.x, v.y, v.sx, v.sy, v.rotate)
  defaultAttributesToChange: ->
    attributesByName = @getAttributesByName()
    return [attributesByName.x, attributesByName.y]

Model.Transform.addChildren [
  createAttribute("X", "x", "0.00")
  createAttribute("Y", "y", "0.00")
  createAttribute("Scale X", "sx", "1.00")
  createAttribute("Scale Y", "sy", "1.00")
  createAttribute("Rotate", "rotate", "0.00")
]


Response:
createAnchor = (x, y) ->
  anchor = Model.Anchor.createVariant()
  transform = anchor.childOfType(Model.Transform)
  attributes = transform.getAttributesByName()
  attributes.x.setExpression(x)
  attributes.y.setExpression(y)
  return anchor

Model.PathComponent = Model.Component.createVariant
  label: "Path"
  # TODO graphicClass

Model.PathComponent.addChildren [
  createAttribute("Close Path", "closed", "true")
]

Model.Path = Model.Shape.createVariant
  label: "Path"
  graphicClass: Graphic.Path

Model.Path.addChildren [
  Model.PathComponent.createVariant()
  Model.Fill.createVariant()
  Model.Stroke.createVariant()
]

Model.Circle = Model.Path.createVariant
  label: "Circle"
  graphicClass: Graphic.Circle

Model.Rectangle = Model.Path.createVariant
  label: "Rectangle"

Model.Rectangle.addChildren [
  createAnchor("0.00", "0.00")
  createAnchor("0.00", "1.00")
  createAnchor("1.00", "1.00")
  createAnchor("1.00", "0.00")
]

Model.TextComponent = Model.Component.createVariant
  label: "Text"
  # TODO graphicClass

Model.TextComponent.addChildren [
  createAttribute("Text", "text", '"Text"')


Prompt:
createAnchor = (x, y) ->
  anchor = Model.Anchor.createVariant()
  transform = anchor.childOfType(Model.Transform)
  attributes = transform.getAttributesByName()
  attributes.x.setExpression(x)
  attributes.y.setExpression(y)
  return anchor

Model.PathComponent = Model.Component.createVariant
  label: "Path"
  # TODO graphicClass

Model.PathComponent.addChildren [
  createAttribute("Close Path", "closed", "true")
]

Model.Path = Model.Shape.createVariant
  label: "Path"
  graphicClass: Graphic.Path

Model.Path.addChildren [
  Model.PathComponent.createVariant()
  Model.Fill.createVariant()
  Model.Stroke.createVariant()

Response:
]

Model.Circle = Model.Path.createVariant
  label: "Circle"
  graphicClass: Graphic.Circle

Model.Rectangle = Model.Path.createVariant
  label: "Rectangle"

Model.Rectangle.addChildren [
  createAnchor("0.00", "0.00")
  createAnchor("0.00", "1.00")
  createAnchor("1.00", "1.00")
  createAnchor("1.00", "0.00")
]

Model.TextComponent = Model.Component.createVariant
  label: "Text"
  # TODO graphicClass

Model.TextComponent.addChildren [
  createAttribute("Text", "text", '"Text"')


Response:
recorder = require 'actions-recorder'

# Todo: language function and Monent locale

enLocale = require '../locales/en'
zhLocale = require '../locales/zh'
zhTwLocale = require '../locales/zh-tw'
moment = require '../util/moment'

if module.hot
  module.hot.accept ['../locales/en', '../locales/zh', '../locales/zh-tw'], ->
    enLocale = require '../locales/en'
    zhLocale = require '../locales/zh'
    zhTwLocale = require '../locales/zh-tw'

cachedLanguage = 'zh'
moment.locale 'zh-cn'

recorder.subscribe (core) ->
  language = exports.getLang()
  if language isnt cachedLanguage
    if language is 'en'
      cachedLanguage = 'en'
      moment.locale 'en'
    else if language is 'zh-tw'
      cachedLanguage = 'zh-tw'
      moment.locale 'zh-tw'
    else if language is 'zh'
      cachedLanguage = 'zh'
      moment.locale 'zh-cn'

exports.getText = (text, language) ->
  language or= exports.getLang()

  if language is 'en'
    localeSource = enLocale
  else if language is 'zh-tw'
    localeSource = zhTwLocale
  else
    localeSource = zhLocale

  if localeSource[text]?
    localeSource[text]
  else
    "{{#{text}}}"

exports.getLang = ->
  store = recorder.getStore()
  language = store.getIn(['prefs', 'language']) or 'zh'


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
recorder = require 'actions-recorder'

# Todo: language function and Monent locale

enLocale = require '../locales/en'
zhLocale = require '../locales/zh'
zhTwLocale = require '../locales/zh-tw'
moment = require '../util/moment'

if module.hot
  module.hot.accept ['../locales/en', '../locales/zh', '../locales/zh-tw'], ->
    enLocale = require '../locales/en'
    zhLocale = require '../locales/zh'
    zhTwLocale = require '../locales/zh-tw'

cachedLanguage = 'zh'
moment.locale 'zh-cn'

recorder.subscribe (core) ->
  language = exports.getLang()
  if language isnt cachedLanguage
    if language is 'en'
      cachedLanguage = 'en'
      moment.locale 'en'
    else if language is 'zh-tw'
      cachedLanguage = 'zh-tw'
      moment.locale 'zh-tw'
    else if language is 'zh'
      cachedLanguage = 'zh'
      moment.locale 'zh-cn'

exports.getText = (text, language) ->
  language or= exports.getLang()

  if language is 'en'
    localeSource = enLocale
  else if language is 'zh-tw'
    localeSource = zhTwLocale
  else
    localeSource = zhLocale

  if localeSource[text]?
    localeSource[text]
  else
    "{{#{text}}}"

exports.getLang = ->
  store = recorder.getStore()
  language = store.getIn(['prefs', 'language']) or 'zh'
```

Response:
var cachedLanguage, enLocale, moment, recorder, zhLocale, zhTwLocale;

recorder = require('actions-recorder');

// Todo: language function and Monent locale
enLocale = require('../locales/en');

zhLocale = require('../locales/zh');

zhTwLocale = require('../locales/zh-tw');

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

if (module.hot) {
  module.hot.accept(['../locales/en', '../locales/zh', '../locales/zh-tw'], function() {
    enLocale = require('../locales/en');
    zhLocale = require('../locales/zh');
    return zhTwLocale = require('../locales/zh-tw');
  });
}

cachedLanguage = 'zh';

moment.locale('zh-cn');

recorder.subscribe(function(core) {
  var language;
  language = exports.getLang();
  if (language !== cachedLanguage) {
    if (language === 'en') {
      cachedLanguage = 'en';
      return moment.locale('en');
    } else if (language === 'zh-tw') {
      cachedLanguage = 'zh-tw';
      return moment.locale('zh-tw');
    } else if (language === 'zh') {
      cachedLanguage = 'zh';
      return moment.locale('zh-cn');
    }
  }
});

exports.getText = function(text, language) {
  var localeSource;
  language || (language = exports.getLang());
  if (language === 'en') {
    localeSource = enLocale;
  } else if (language === 'zh-tw') {
    localeSource = zhTwLocale;
  } else {
    localeSource = zhLocale;
  }
  if (localeSource[text] != null) {
    return localeSource[text];
  } else {
    return `{{${text}}}`;
  }
};

exports.getLang = function() {
  var language, store;
  store = recorder.getStore();
  return language = store.getIn(['prefs', 'language']) || 'zh';
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var cachedLanguage, enLocale, moment, recorder, zhLocale, zhTwLocale;

recorder = require('actions-recorder');

// Todo: language function and Monent locale
enLocale = require('../locales/en');

zhLocale = require('../locales/zh');

zhTwLocale = require('../locales/zh-tw');

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

if (module.hot) {
  module.hot.accept(['../locales/en', '../locales/zh', '../locales/zh-tw'], function() {
    enLocale = require('../locales/en');
    zhLocale = require('../locales/zh');
    return zhTwLocale = require('../locales/zh-tw');
  });
}

cachedLanguage = 'zh';

moment.locale('zh-cn');

recorder.subscribe(function(core) {
  var language;
  language = exports.getLang();
  if (language !== cachedLanguage) {
    if (language === 'en') {
      cachedLanguage = 'en';
      return moment.locale('en');
    } else if (language === 'zh-tw') {
      cachedLanguage = 'zh-tw';
      return moment.locale('zh-tw');
    } else if (language === 'zh') {
      cachedLanguage = 'zh';
      return moment.locale('zh-cn');
    }
  }
});

exports.getText = function(text, language) {
  var localeSource;
  language || (language = exports.getLang());
  if (language === 'en') {
    localeSource = enLocale;
  } else if (language === 'zh-tw') {
    localeSource = zhTwLocale;
  } else {
    localeSource = zhLocale;
  }
  if (localeSource[text] != null) {
    return localeSource[text];
  } else {
    return `{{${text}}}`;
  }
};

exports.getLang = function() {
  var language, store;
  store = recorder.getStore();
  return language = store.getIn(['prefs', 'language']) || 'zh';
};
```

Response:
recorder = require 'actions-recorder'

# Todo: language function and Monent locale

enLocale = require '../locales/en'
zhLocale = require '../locales/zh'
zhTwLocale = require '../locales/zh-tw'
moment = require '../util/moment'

if module.hot
  module.hot.accept ['../locales/en', '../locales/zh', '../locales/zh-tw'], ->
    enLocale = require '../locales/en'
    zhLocale = require '../locales/zh'
    zhTwLocale = require '../locales/zh-tw'

cachedLanguage = 'zh'
moment.locale 'zh-cn'

recorder.subscribe (core) ->
  language = exports.getLang()
  if language isnt cachedLanguage
    if language is 'en'
      cachedLanguage = 'en'
      moment.locale 'en'
    else if language is 'zh-tw'
      cachedLanguage = 'zh-tw'
      moment.locale 'zh-tw'
    else if language is 'zh'
      cachedLanguage = 'zh'
      moment.locale 'zh-cn'

exports.getText = (text, language) ->
  language or= exports.getLang()

  if language is 'en'
    localeSource = enLocale
  else if language is 'zh-tw'
    localeSource = zhTwLocale
  else
    localeSource = zhLocale

  if localeSource[text]?
    localeSource[text]
  else
    "{{#{text}}}"

exports.getLang = ->
  store = recorder.getStore()
  language = store.getIn(['prefs', 'language']) or 'zh'


Prompt:
recorder = require 'actions-recorder'

# Todo: language function and Monent locale

enLocale = require '../locales/en'
zhLocale = require '../locales/zh'
zhTwLocale = require '../locales/zh-tw'
moment = require '../util/moment'

if module.hot
  module.hot.accept ['../locales/en', '../locales/zh', '../locales/zh-tw'], ->
    enLocale = require '../locales/en'
    zhLocale = require '../locales/zh'
    zhTwLocale = require '../locales/zh-tw'

cachedLanguage = 'zh'
moment.locale 'zh-cn'

recorder.subscribe (core) ->
  language = exports.getLang()
  if language isnt cachedLanguage
    if language is 'en'
      cachedLanguage = 'en'
      moment.locale 'en'

Response:
else if language is 'zh-tw'
      cachedLanguage = 'zh-tw'
      moment.locale 'zh-tw'
    else if language is 'zh'
      cachedLanguage = 'zh'
      moment.locale 'zh-cn'

exports.getText = (text, language) ->
  language or= exports.getLang()

  if language is 'en'
    localeSource = enLocale
  else if language is 'zh-tw'
    localeSource = zhTwLocale
  else
    localeSource = zhLocale

  if localeSource[text]?
    localeSource[text]
  else
    "{{#{text}}}"

exports.getLang = ->
  store = recorder.getStore()
  language = store.getIn(['prefs', 'language']) or 'zh'


Response:
log   = require('./logger')
spawn = require('child_process').spawn

module.exports = ->
  @Processes = {}

  class @Process
    constructor: (file, message, options = {}) ->
      @file = file
      @message = message
      @options = options

    start: (args...) ->
      unless @_started
        @_started = $.defer()
        @_process = spawn(@file, args, @options)
        @_process.stdout.on 'data', @_stdout
        @_process.stderr.on 'data', @_stderr

        @_process.on 'exit', @_exit
        @_process.on 'error', @_error
        @_process.on 'close', @_close
        @_process.on 'disconnect', @_disconnect
        @_process.on 'message', @_message

        process.on 'exit', @stop
        process.on 'error', @stop

      @_started.promise

    stop: =>
      @_process.kill() and (@_process = null) if @_process
      $.fulfilled(!@_process)

    _stdout: (data) =>
      @_logBuffer(log.info, "STDOUT", data)

      if @_started.promise.isPending()
        @_started.fulfill() if ~data.toString().indexOf(@message)

    _stderr: (data) =>
      @_logBuffer log.warn, "STDERR", data

    _exit: (code, signal) =>
      @_log log.error, "EXIT", [code, signal].join(', ')

    _error: (error) =>
      @_started.reject(error)

    _close: (code, signal) =>


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
log   = require('./logger')
spawn = require('child_process').spawn

module.exports = ->
  @Processes = {}

  class @Process
    constructor: (file, message, options = {}) ->
      @file = file
      @message = message
      @options = options

    start: (args...) ->
      unless @_started
        @_started = $.defer()
        @_process = spawn(@file, args, @options)
        @_process.stdout.on 'data', @_stdout
        @_process.stderr.on 'data', @_stderr

        @_process.on 'exit', @_exit
        @_process.on 'error', @_error
        @_process.on 'close', @_close
        @_process.on 'disconnect', @_disconnect
        @_process.on 'message', @_message

        process.on 'exit', @stop
        process.on 'error', @stop

      @_started.promise

    stop: =>
      @_process.kill() and (@_process = null) if @_process
      $.fulfilled(!@_process)

    _stdout: (data) =>
      @_logBuffer(log.info, "STDOUT", data)

      if @_started.promise.isPending()
        @_started.fulfill() if ~data.toString().indexOf(@message)

    _stderr: (data) =>
      @_logBuffer log.warn, "STDERR", data

    _exit: (code, signal) =>
      @_log log.error, "EXIT", [code, signal].join(', ')

    _error: (error) =>
      @_started.reject(error)

    _close: (code, signal) =>
```

Response:
var log, spawn;

log = require('./logger');

spawn = require('child_process').spawn;

module.exports = function() {
  this.Processes = {};
  return this.Process = class Process {
    constructor(file, message, options = {}) {
      this.stop = this.stop.bind(this);
      this._stdout = this._stdout.bind(this);
      this._stderr = this._stderr.bind(this);
      this._exit = this._exit.bind(this);
      this._error = this._error.bind(this);
      this._close = this._close.bind(this);
      this.file = file;
      this.message = message;
      this.options = options;
    }

    start(...args) {
      if (!this._started) {
        this._started = $.defer();
        this._process = spawn(this.file, args, this.options);
        this._process.stdout.on('data', this._stdout);
        this._process.stderr.on('data', this._stderr);
        this._process.on('exit', this._exit);
        this._process.on('error', this._error);
        this._process.on('close', this._close);
        this._process.on('disconnect', this._disconnect);
        this._process.on('message', this._message);
        process.on('exit', this.stop);
        process.on('error', this.stop);
      }
      return this._started.promise;
    }

    stop() {
      if (this._process) {
        this._process.kill() && (this._process = null);
      }
      return $.fulfilled(!this._process);
    }

    _stdout(data) {
      this._logBuffer(log.info, "STDOUT", data);
      if (this._started.promise.isPending()) {
        if (~data.toString().indexOf(this.message)) {
          return this._started.fulfill();
        }
      }
    }

    _stderr(data) {
      return this._logBuffer(log.warn, "STDERR", data);
    }

    _exit(code, signal) {
      return this._log(log.error, "EXIT", [code, signal].join(', '));
    }

    _error(error) {
      return this._started.reject(error);
    }

    _close(code, signal) {}

  };
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var log, spawn;

log = require('./logger');

spawn = require('child_process').spawn;

module.exports = function() {
  this.Processes = {};
  return this.Process = class Process {
    constructor(file, message, options = {}) {
      this.stop = this.stop.bind(this);
      this._stdout = this._stdout.bind(this);
      this._stderr = this._stderr.bind(this);
      this._exit = this._exit.bind(this);
      this._error = this._error.bind(this);
      this._close = this._close.bind(this);
      this.file = file;
      this.message = message;
      this.options = options;
    }

    start(...args) {
      if (!this._started) {
        this._started = $.defer();
        this._process = spawn(this.file, args, this.options);
        this._process.stdout.on('data', this._stdout);
        this._process.stderr.on('data', this._stderr);
        this._process.on('exit', this._exit);
        this._process.on('error', this._error);
        this._process.on('close', this._close);
        this._process.on('disconnect', this._disconnect);
        this._process.on('message', this._message);
        process.on('exit', this.stop);
        process.on('error', this.stop);
      }
      return this._started.promise;
    }

    stop() {
      if (this._process) {
        this._process.kill() && (this._process = null);
      }
      return $.fulfilled(!this._process);
    }

    _stdout(data) {
      this._logBuffer(log.info, "STDOUT", data);
      if (this._started.promise.isPending()) {
        if (~data.toString().indexOf(this.message)) {
          return this._started.fulfill();
        }
      }
    }

    _stderr(data) {
      return this._logBuffer(log.warn, "STDERR", data);
    }

    _exit(code, signal) {
      return this._log(log.error, "EXIT", [code, signal].join(', '));
    }

    _error(error) {
      return this._started.reject(error);
    }

    _close(code, signal) {}

  };
};
```

Response:
log   = require('./logger')
spawn = require('child_process').spawn

module.exports = ->
  @Processes = {}

  class @Process
    constructor: (file, message, options = {}) ->
      @file = file
      @message = message
      @options = options

    start: (args...) ->
      unless @_started
        @_started = $.defer()
        @_process = spawn(@file, args, @options)
        @_process.stdout.on 'data', @_stdout
        @_process.stderr.on 'data', @_stderr

        @_process.on 'exit', @_exit
        @_process.on 'error', @_error
        @_process.on 'close', @_close
        @_process.on 'disconnect', @_disconnect
        @_process.on 'message', @_message

        process.on 'exit', @stop
        process.on 'error', @stop

      @_started.promise

    stop: =>
      @_process.kill() and (@_process = null) if @_process
      $.fulfilled(!@_process)

    _stdout: (data) =>
      @_logBuffer(log.info, "STDOUT", data)

      if @_started.promise.isPending()
        @_started.fulfill() if ~data.toString().indexOf(@message)

    _stderr: (data) =>
      @_logBuffer log.warn, "STDERR", data

    _exit: (code, signal) =>
      @_log log.error, "EXIT", [code, signal].join(', ')

    _error: (error) =>
      @_started.reject(error)

    _close: (code, signal) =>


Prompt:
log   = require('./logger')
spawn = require('child_process').spawn

module.exports = ->
  @Processes = {}

  class @Process
    constructor: (file, message, options = {}) ->
      @file = file
      @message = message
      @options = options

    start: (args...) ->
      unless @_started
        @_started = $.defer()
        @_process = spawn(@file, args, @options)
        @_process.stdout.on 'data', @_stdout
        @_process.stderr.on 'data', @_stderr

        @_process.on 'exit', @_exit
        @_process.on 'error', @_error
        @_process.on 'close', @_close
        @_process.on 'disconnect', @_disconnect
        @_process.on 'message', @_message

Response:
process.on 'exit', @stop
        process.on 'error', @stop

      @_started.promise

    stop: =>
      @_process.kill() and (@_process = null) if @_process
      $.fulfilled(!@_process)

    _stdout: (data) =>
      @_logBuffer(log.info, "STDOUT", data)

      if @_started.promise.isPending()
        @_started.fulfill() if ~data.toString().indexOf(@message)

    _stderr: (data) =>
      @_logBuffer log.warn, "STDERR", data

    _exit: (code, signal) =>
      @_log log.error, "EXIT", [code, signal].join(', ')

    _error: (error) =>
      @_started.reject(error)

    _close: (code, signal) =>


Response:
@_log log.warn, "CLOSE", [code, signal].join(', ')

    _disconnect: =>
      @_log log.info, "DISCONNECT"

    _message: (message) =>
      @_log log.info, "MESSAGE", message

    _log: (logger, type, data) =>
      logger "#{@file}:#{type} - #{data}" if data

    _logBuffer: (logger, type, buffer) =>
      @_log(logger, type, line) for line in buffer.toString().split("\n")


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
@_log log.warn, "CLOSE", [code, signal].join(', ')

    _disconnect: =>
      @_log log.info, "DISCONNECT"

    _message: (message) =>
      @_log log.info, "MESSAGE", message

    _log: (logger, type, data) =>
      logger "#{@file}:#{type} - #{data}" if data

    _logBuffer: (logger, type, buffer) =>
      @_log(logger, type, line) for line in buffer.toString().split("\n")
```

Response:
this._log(log.warn, "CLOSE", [code, signal].join(', ')({
  _disconnect: () => {
    return this._log(log.info, "DISCONNECT");
  },
  _message: (message) => {
    return this._log(log.info, "MESSAGE", message);
  },
  _log: (logger, type, data) => {
    if (data) {
      return logger(`${this.file}:${type} - ${data}`);
    }
  },
  _logBuffer: (logger, type, buffer) => {
    var i, len, line, ref, results;
    ref = buffer.toString().split("\n");
    results = [];
    for (i = 0, len = ref.length; i < len; i++) {
      line = ref[i];
      results.push(this._log(logger, type, line));
    }
    return results;
  }
}));


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
this._log(log.warn, "CLOSE", [code, signal].join(', ')({
  _disconnect: () => {
    return this._log(log.info, "DISCONNECT");
  },
  _message: (message) => {
    return this._log(log.info, "MESSAGE", message);
  },
  _log: (logger, type, data) => {
    if (data) {
      return logger(`${this.file}:${type} - ${data}`);
    }
  },
  _logBuffer: (logger, type, buffer) => {
    var i, len, line, ref, results;
    ref = buffer.toString().split("\n");
    results = [];
    for (i = 0, len = ref.length; i < len; i++) {
      line = ref[i];
      results.push(this._log(logger, type, line));
    }
    return results;
  }
}));
```

Response:
@_log log.warn, "CLOSE", [code, signal].join(', ')

    _disconnect: =>
      @_log log.info, "DISCONNECT"

    _message: (message) =>
      @_log log.info, "MESSAGE", message

    _log: (logger, type, data) =>
      logger "#{@file}:#{type} - #{data}" if data

    _logBuffer: (logger, type, buffer) =>
      @_log(logger, type, line) for line in buffer.toString().split("\n")


Prompt:
@_log log.warn, "CLOSE", [code, signal].join(', ')

    _disconnect: =>
      @_log log.info, "DISCONNECT"

    _message: (message) =>

Response:
@_log log.info, "MESSAGE", message

    _log: (logger, type, data) =>
      logger "#{@file}:#{type} - #{data}" if data

    _logBuffer: (logger, type, buffer) =>
      @_log(logger, type, line) for line in buffer.toString().split("\n")


Response:
log   = require('./logger')
spawn = require('child_process').spawn

module.exports = ->
  @Processes = {}

  class @Process
    constructor: (file, message, options = {}) ->
      @file = file
      @message = message
      @options = options

    start: (args...) ->
      unless @_started
        @_started = $.defer()
        @_process = spawn('node', [@file].concat(args))
        @_process.stdout.on 'data', @_stdout
        @_process.stderr.on 'data', @_stderr

        @_process.on 'exit', @_exit
        @_process.on 'error', @_error
        @_process.on 'close', @_close
        @_process.on 'disconnect', @_disconnect
        @_process.on 'message', @_message

        process.on 'exit', @stop
        process.on 'error', @stop

      @_started.promise

    stop: =>
      @_process.kill() and (@_process = null) if @_process
      $.fulfilled(!@_process)

    _stdout: (data) =>
      @_logBuffer(log.info, "STDOUT", data)

      if @_started.promise.isPending()
        @_started.fulfill() if ~data.toString().indexOf(@message)

    _stderr: (data) =>
      @_logBuffer log.warn, "STDERR", data

    _exit: (code, signal) =>
      @_log log.error, "EXIT", [code, signal].join(', ')

    _error: (error) =>
      @_started.reject(error)

    _close: (code, signal) =>


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
log   = require('./logger')
spawn = require('child_process').spawn

module.exports = ->
  @Processes = {}

  class @Process
    constructor: (file, message, options = {}) ->
      @file = file
      @message = message
      @options = options

    start: (args...) ->
      unless @_started
        @_started = $.defer()
        @_process = spawn('node', [@file].concat(args))
        @_process.stdout.on 'data', @_stdout
        @_process.stderr.on 'data', @_stderr

        @_process.on 'exit', @_exit
        @_process.on 'error', @_error
        @_process.on 'close', @_close
        @_process.on 'disconnect', @_disconnect
        @_process.on 'message', @_message

        process.on 'exit', @stop
        process.on 'error', @stop

      @_started.promise

    stop: =>
      @_process.kill() and (@_process = null) if @_process
      $.fulfilled(!@_process)

    _stdout: (data) =>
      @_logBuffer(log.info, "STDOUT", data)

      if @_started.promise.isPending()
        @_started.fulfill() if ~data.toString().indexOf(@message)

    _stderr: (data) =>
      @_logBuffer log.warn, "STDERR", data

    _exit: (code, signal) =>
      @_log log.error, "EXIT", [code, signal].join(', ')

    _error: (error) =>
      @_started.reject(error)

    _close: (code, signal) =>
```

Response:
var log, spawn;

log = require('./logger');

spawn = require('child_process').spawn;

module.exports = function() {
  this.Processes = {};
  return this.Process = class Process {
    constructor(file, message, options = {}) {
      this.stop = this.stop.bind(this);
      this._stdout = this._stdout.bind(this);
      this._stderr = this._stderr.bind(this);
      this._exit = this._exit.bind(this);
      this._error = this._error.bind(this);
      this._close = this._close.bind(this);
      this.file = file;
      this.message = message;
      this.options = options;
    }

    start(...args) {
      if (!this._started) {
        this._started = $.defer();
        this._process = spawn('node', [this.file].concat(args));
        this._process.stdout.on('data', this._stdout);
        this._process.stderr.on('data', this._stderr);
        this._process.on('exit', this._exit);
        this._process.on('error', this._error);
        this._process.on('close', this._close);
        this._process.on('disconnect', this._disconnect);
        this._process.on('message', this._message);
        process.on('exit', this.stop);
        process.on('error', this.stop);
      }
      return this._started.promise;
    }

    stop() {
      if (this._process) {
        this._process.kill() && (this._process = null);
      }
      return $.fulfilled(!this._process);
    }

    _stdout(data) {
      this._logBuffer(log.info, "STDOUT", data);
      if (this._started.promise.isPending()) {
        if (~data.toString().indexOf(this.message)) {
          return this._started.fulfill();
        }
      }
    }

    _stderr(data) {
      return this._logBuffer(log.warn, "STDERR", data);
    }

    _exit(code, signal) {
      return this._log(log.error, "EXIT", [code, signal].join(', '));
    }

    _error(error) {
      return this._started.reject(error);
    }

    _close(code, signal) {}

  };
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var log, spawn;

log = require('./logger');

spawn = require('child_process').spawn;

module.exports = function() {
  this.Processes = {};
  return this.Process = class Process {
    constructor(file, message, options = {}) {
      this.stop = this.stop.bind(this);
      this._stdout = this._stdout.bind(this);
      this._stderr = this._stderr.bind(this);
      this._exit = this._exit.bind(this);
      this._error = this._error.bind(this);
      this._close = this._close.bind(this);
      this.file = file;
      this.message = message;
      this.options = options;
    }

    start(...args) {
      if (!this._started) {
        this._started = $.defer();
        this._process = spawn('node', [this.file].concat(args));
        this._process.stdout.on('data', this._stdout);
        this._process.stderr.on('data', this._stderr);
        this._process.on('exit', this._exit);
        this._process.on('error', this._error);
        this._process.on('close', this._close);
        this._process.on('disconnect', this._disconnect);
        this._process.on('message', this._message);
        process.on('exit', this.stop);
        process.on('error', this.stop);
      }
      return this._started.promise;
    }

    stop() {
      if (this._process) {
        this._process.kill() && (this._process = null);
      }
      return $.fulfilled(!this._process);
    }

    _stdout(data) {
      this._logBuffer(log.info, "STDOUT", data);
      if (this._started.promise.isPending()) {
        if (~data.toString().indexOf(this.message)) {
          return this._started.fulfill();
        }
      }
    }

    _stderr(data) {
      return this._logBuffer(log.warn, "STDERR", data);
    }

    _exit(code, signal) {
      return this._log(log.error, "EXIT", [code, signal].join(', '));
    }

    _error(error) {
      return this._started.reject(error);
    }

    _close(code, signal) {}

  };
};
```

Response:
log   = require('./logger')
spawn = require('child_process').spawn

module.exports = ->
  @Processes = {}

  class @Process
    constructor: (file, message, options = {}) ->
      @file = file
      @message = message
      @options = options

    start: (args...) ->
      unless @_started
        @_started = $.defer()
        @_process = spawn('node', [@file].concat(args))
        @_process.stdout.on 'data', @_stdout
        @_process.stderr.on 'data', @_stderr

        @_process.on 'exit', @_exit
        @_process.on 'error', @_error
        @_process.on 'close', @_close
        @_process.on 'disconnect', @_disconnect
        @_process.on 'message', @_message

        process.on 'exit', @stop
        process.on 'error', @stop

      @_started.promise

    stop: =>
      @_process.kill() and (@_process = null) if @_process
      $.fulfilled(!@_process)

    _stdout: (data) =>
      @_logBuffer(log.info, "STDOUT", data)

      if @_started.promise.isPending()
        @_started.fulfill() if ~data.toString().indexOf(@message)

    _stderr: (data) =>
      @_logBuffer log.warn, "STDERR", data

    _exit: (code, signal) =>
      @_log log.error, "EXIT", [code, signal].join(', ')

    _error: (error) =>
      @_started.reject(error)

    _close: (code, signal) =>


Prompt:
log   = require('./logger')
spawn = require('child_process').spawn

module.exports = ->
  @Processes = {}

  class @Process
    constructor: (file, message, options = {}) ->
      @file = file
      @message = message
      @options = options

    start: (args...) ->
      unless @_started
        @_started = $.defer()
        @_process = spawn('node', [@file].concat(args))
        @_process.stdout.on 'data', @_stdout
        @_process.stderr.on 'data', @_stderr

        @_process.on 'exit', @_exit
        @_process.on 'error', @_error
        @_process.on 'close', @_close
        @_process.on 'disconnect', @_disconnect
        @_process.on 'message', @_message

Response:
process.on 'exit', @stop
        process.on 'error', @stop

      @_started.promise

    stop: =>
      @_process.kill() and (@_process = null) if @_process
      $.fulfilled(!@_process)

    _stdout: (data) =>
      @_logBuffer(log.info, "STDOUT", data)

      if @_started.promise.isPending()
        @_started.fulfill() if ~data.toString().indexOf(@message)

    _stderr: (data) =>
      @_logBuffer log.warn, "STDERR", data

    _exit: (code, signal) =>
      @_log log.error, "EXIT", [code, signal].join(', ')

    _error: (error) =>
      @_started.reject(error)

    _close: (code, signal) =>


Response:
log   = require('./logger')
spawn = require('child_process').spawn

module.exports = ->
  @Processes = {}

  class @Process
    constructor: (file, message, options = {}) ->
      @file = file
      @message = message
      _.extend(@options, options)

    start: (args...) ->
      unless @_started
        @_started = $.defer()
        @_process = spawn('node', [@file].concat(args))
        @_process.stdout.on 'data', @_stdout
        @_process.stderr.on 'data', @_stderr

        @_process.on 'exit', @_exit
        @_process.on 'error', @_error
        @_process.on 'close', @_close
        @_process.on 'disconnect', @_disconnect
        @_process.on 'message', @_message

        process.on 'exit', @stop
        process.on 'error', @stop

      @_started.promise

    stop: =>
      @_process.kill() and (@_process = null) if @_process
      $.fulfilled(!@_process)

    _stdout: (data) =>
      @_logBuffer(log.info, "STDOUT", data)

      if @_started.promise.isPending()
        @_started.fulfill() if ~data.toString().indexOf(@message)

    _stderr: (data) =>
      @_logBuffer log.warn, "STDERR", data

    _exit: (code, signal) =>
      @_log log.error, "EXIT", [code, signal].join(', ')

    _error: (error) =>
      @_started.reject(error)

    _close: (code, signal) =>