<commit_before>describe('Graph', function() {

    describe('Construction and access', function() {
        it('entity', function() {
            var entities = { 'n-1': {
                    type: 'node',
                    lat: 30,
                    lon: -80,
                    id: 'n-1'
                }
            };
            var graph = iD.Graph(entities, 'first graph');
            expect(graph.entity('n-1')).toEqual(entities['n-1']);
        });

        it('annotation', function() {
            var graph = iD.Graph({}, 'first graph');
            expect(graph.annotation).toEqual('first graph');
        });
    });

    describe('operations', function() {
        it('#remove', function() {
            var entities = { 'n-1': {
                    type: 'node',
                    lat: 30,
                    lon: -80,
                    id: 'n-1'
                }
            };
            var graph = iD.Graph(entities, 'first graph');
            var g2 = graph.remove(entities['n-1'], 'Removed node');
            expect(graph.entity('n-1')).toEqual(entities['n-1']);
            expect(g2.entity('n-1')).toEqual(undefined);
        });
        it('#replace', function() {
            var entities = { 'n-1': {
                    type: 'node',
                    lat: 30,
                    lon: -80,
                    id: 'n-1'
                }
            };
            var replacement = {
                type: 'node',
                lat: 40,
                lon: -80,
                id: 'n-1'
            };
            var graph = iD.Graph(entities, 'first graph');
            var g2 = graph.replace(replacement, 'Removed node');
            expect(graph.entity('n-1').lat).toEqual(30);
            expect(g2.entity('n-1').lat).toEqual(40);
        });
    });

    describe("#modifications", function () {
        it("filters entities by modified", function () {
            var a = {modified: function () { return true; }},
                b = {modified: function () { return false; }},
                graph = iD.Graph({ 'a': a, 'b': b });
            expect(graph.modifications()).toEqual([iD.Entity(graph.entity('a'))]);
        });
    });

    describe("#creations", function () {
        it("filters entities by created", function () {
            var a = {created: function () { return true; }},
                b = {created: function () { return false; }},
                graph = iD.Graph([a, b]);
            expect(graph.creations()).toEqual([a]);
        });
    });
});<commit_msg>Fix specs<commit_after>describe('Graph', function() {

    describe('Construction and access', function() {
        it('entity', function() {
            var entities = { 'n-1': {
                    type: 'node',
                    lat: 30,
                    lon: -80,
                    id: 'n-1'
                }
            };
            var graph = iD.Graph(entities, 'first graph');
            expect(graph.entity('n-1')).toEqual(entities['n-1']);
        });

        it('annotation', function() {
            var graph = iD.Graph({}, 'first graph');
            expect(graph.annotation).toEqual('first graph');
        });
    });

    describe('operations', function() {
        it('#remove', function() {
            var entities = { 'n-1': {
                    type: 'node',
                    lat: 30,
                    lon: -80,
                    id: 'n-1'
                }
            };
            var graph = iD.Graph(entities, 'first graph');
            var g2 = graph.remove(entities['n-1'], 'Removed node');
            expect(graph.entity('n-1')).toEqual(entities['n-1']);
            expect(g2.entity('n-1')).toEqual(undefined);
        });
        it('#replace', function() {
            var entities = { 'n-1': {
                    type: 'node',
                    lat: 30,
                    lon: -80,
                    id: 'n-1'
                }
            };
            var replacement = {
                type: 'node',
                lat: 40,
                lon: -80,
                id: 'n-1'
            };
            var graph = iD.Graph(entities, 'first graph');
            var g2 = graph.replace(replacement, 'Removed node');
            expect(graph.entity('n-1').lat).toEqual(30);
            expect(g2.entity('n-1').lat).toEqual(40);
        });
    });

    describe("#modifications", function () {
        it("filters entities by modified", function () {
            var a = {id: 'a', modified: function () { return true; }},
                b = {id: 'b', modified: function () { return false; }},
                graph = iD.Graph({ 'a': a, 'b': b });
            expect(graph.modifications()).toEqual([graph.fetch('a')]);
        });
    });

    describe("#creations", function () {
        it("filters entities by created", function () {
            var a = {id: 'a', created: function () { return true; }},
                b = {id: 'b', created: function () { return false; }},
                graph = iD.Graph({ 'a': a, 'b': b });
            expect(graph.creations()).toEqual([graph.fetch('a')]);
        });
    });
});
{'fraction_non_alphanumeric': 0.17254138266796495, 'fraction_numerical': 0.015189873417721518, 'mean_word_length': 1.3303085299455535, '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': '6674804', 'n_tokens_mistral': 1447, 'n_tokens_neox': 1391, 'n_words': 298}