<commit_before>(function(define) {'use strict';
define(function(require) {

// Defines Graphic Singleton.
// This is an abstract factory for creating graphical elements.
// Defaults to the SVGGraphic concrete implementation.

   var factoryObjects, // Abstract implementations
       Graphic,        // Container for all Graphic related work
       // Abstract classes. Factories need to provide implementation.
       Line, Path, Text,
       Rect, Curve, Arc, Group, Color;

   // The factory objects to be included
   // These are abstract class implementations.
   // Concrete factories need to provide their own subclass implementations.
   factoryObjects = {
      // A new window to draw in
      Window: require('./app/window'),
      // A sequence of one or more line segments
      Segment: require('./app/segment'),
      // A (possibly filled) rectangle
      Rect: Rect,
      // A Bezier curve with a number of control points
      Path: Path,
      // Part of an ellipse
      Arc: Arc,
      Circle: require('./app/circle'),
      // A container for objects
      Group: Group,
      // Text labels
      Text: Text
   };

   Graphic = {
      // Generic class for anything that can be part of a graphic
      // All other classes should subclass it
      Component: require('./app/component'),
      // Abstract class for the objects that are composites
      // Window and Group should subclass it
      Composite: require('./app/composite'),
      // A color specification
      Color: Color,
      // 1d coordinate transformations
      Scale: require('./app/scale'),
      // 2d coordinate transformations
      Transform: require('./app/transform'),

      // A geometric point, typically shown as circle
      Point: require('./app/point'),
      // Derived Objects that do not need independent implementation
      Line: Line,
      // "Mathematical" curve, given an "function" "f".
      // Piecewise smooth?
      Curve: Curve,
      // Overwrites all factory methods using methods provided
      // by the factory argument
      set: function(factory) {
         // Ensure factory has provided all methods
         Object.keys(factoryObjects).forEach(function(key) {
            if (!factory.hasOwnProperty(key)) {
               throw new Error('Factory must provide: ' + key);
            }
         });
         // Copy over the factory's methods
         Object.keys(factoryObjects).forEach(function(key) {
            Graphic[key] = factory[key];
         });
         return Graphic;
      }
   };

   Graphic.SVG = require('./app/svg');

   return Graphic.set(factoryObjects);
});

}(typeof define === 'function' && define.amd ? define : function(factory) {
   'use strict';
   module.exports = factory(require);
}));
<commit_msg>Create Graphic object first, so it can be passed<commit_after>(function(define) {'use strict';
define(function(require) {

// Defines Graphic Singleton.
// This is an abstract factory for creating graphical elements.
// Defaults to the SVGGraphic concrete implementation.

   var factoryObjects, // Abstract implementations
       Graphic,        // Container for all Graphic related work
       // Abstract classes. Factories need to provide implementation.
       Line, Path, Text,
       Rect, Curve, Arc, Group, Color;

   // The factory objects to be included
   // These are abstract class implementations.
   // Concrete factories need to provide their own subclass implementations.
   factoryObjects = {
      // A new window to draw in
      Window: require('./app/window'),
      // A sequence of one or more line segments
      Segment: require('./app/segment'),
      // A (possibly filled) rectangle
      Rect: Rect,
      // A Bezier curve with a number of control points
      Path: Path,
      // Part of an ellipse
      Arc: Arc,
      Circle: require('./app/circle'),
      // A container for objects
      Group: Group,
      // Text labels
      Text: Text
   };

   Graphic = {};
   // Generic class for anything that can be part of a graphic
   // All other classes should subclass it
   Graphic.Component = require('./app/component');
   // Abstract class for the objects that are composites
   // Window and Group should subclass it
   Graphic.Composite = require('./app/composite');
   // A color specification
   Graphic.Color = Color;
   // 1d coordinate transformations
   Graphic.Scale = require('./app/scale');
   // 2d coordinate transformations
   Graphic.Transform = require('./app/transform');

   // A geometric point, typically shown as circle
   Graphic.Point = require('./app/point')(Graphic);
   // Derived Objects that do not need independent implementation
   Graphic.Line = Line;
   // "Mathematical" curve, given an "function" "f".
   // Piecewise smooth?
   Graphic.Curve = Curve;
   // Overwrites all factory methods using methods provided
   // by the factory argument
   Graphic.set = function(factory) {
      // Ensure factory has provided all methods
      Object.keys(factoryObjects).forEach(function(key) {
         if (!factory.hasOwnProperty(key)) {
            throw new Error('Factory must provide: ' + key);
         }
      });
      // Copy over the factory's methods
      Object.keys(factoryObjects).forEach(function(key) {
         Graphic[key] = factory[key];
      });
      return Graphic;
   };

   Graphic.SVG = require('./app/svg');

   return Graphic.set(factoryObjects);
});

}(typeof define === 'function' && define.amd ? define : function(factory) {
   'use strict';
   module.exports = factory(require);
}));

{'fraction_non_alphanumeric': 0.10832732516222061, 'fraction_numerical': 0.0007209805335255948, 'mean_word_length': 2.4702939337085676, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1290552', 'n_tokens_mistral': 1438, 'n_tokens_neox': 1390, 'n_words': 516}