<commit_before>var acg = acg || {};

// Wrap Cocos2d-x functions
acg.p = cc.p;
acg.colour = cc.color;

acg.matters = [];

acg.time = 0;

acg.place = function (id) {
    var s = acg.matters[id];
    if (s) {
        cc.director.getRunningScene().addChild(s);
        acg.apply_attr(s, s._acg_attr);
        if (s._acg_action) s._acg_action.startWithTarget(s);
    }
};

acg.sweep = function (id) {
    var s = acg.matters[id];
    if (s) {
        s.removeFromParent(false);
    }
};

acg.action_duration = function (id) {
    var _ref;   // Let's learn from CoffeeScript!
    return (_ref = acg.matters[id]._acg_action) ? _ref.getDuration() : 0;
};

acg.matter = function (id) {
    return acg.matters[id];
};

acg.apply_attr = function (s, attr) {
    if (!(attr.x && attr.y)) attr.x = attr.y = 0.5;
    if (!(attr.ax && attr.ay)) attr.ax = attr.ay = 0.5;
    s.setNormalizedPosition(attr.x, attr.y);
    s.setAnchorPoint(attr.ax, attr.ay);
    s.setScale(attr.scale || 1);
    // FIXME: attr.colour doesn't affect sprites<commit_msg>Fix bugs about removing objects Some images aren't removed when travel() is called after going through the last event in the flow<commit_after>var acg = acg || {};

// Wrap Cocos2d-x functions
acg.p = cc.p;
acg.colour = cc.color;

acg.matters = [];

acg.time = 0;

acg.place = function (id) {
    var s = acg.matters[id];
    if (s) {
        cc.director.getRunningScene().addChild(s);
        acg.apply_attr(s, s._acg_attr);
        if (s._acg_action) s._acg_action.startWithTarget(s);
    }
};

acg.sweep = function (id) {
    var s = acg.matters[id];
    if (s && s._parent) {
        s.removeFromParent(false);
    }
};

acg.action_duration = function (id) {
    var _ref;   // Let's learn from CoffeeScript!
    return (_ref = acg.matters[id]._acg_action) ? _ref.getDuration() : 0;
};

acg.matter = function (id) {
    return acg.matters[id];
};

acg.apply_attr = function (s, attr) {
    if (!(attr.x && attr.y)) attr.x = attr.y = 0.5;
    if (!(attr.ax && attr.ay)) attr.ax = attr.ay = 0.5;
    s.setNormalizedPosition(attr.x, attr.y);
    s.setAnchorPoint(attr.ax, attr.ay);
    s.setScale(attr.scale || 1);
    // FIXME: attr.colour doesn't affect sprites
{'fraction_non_alphanumeric': 0.17007730786721237, 'fraction_numerical': 0.007276034561164165, 'mean_word_length': 2.8128249566724435, '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': '2044215', 'n_tokens_mistral': 891, 'n_tokens_neox': 863, 'n_words': 185}