<commit_before>if (typeof iD === 'undefined') iD = {};

iD.Entity = function() {
    this.parents = {};
    // The ID locally
    this._id = iD.Util.id();
	this.connection =  null;
    // The ID in OSM terms
	this.id = NaN;
	this.loaded = false;
	this.entityType =  '';
	this.modified = false;
	this.deleted = false;
};

iD.Entity.prototype = {
	isType:function(type) {
		// summary:		Is this entity of the specified type ('node','way','relation')?
		return this.entityType === type;
	},

	toString:function() {
		return this.entityType + " . " + this.id;
	},

	// --------------------------------
	// Provoke redraw and other changes
	refresh:function() {
		// summary:		Ask the connection to provoke redraw and other changes.
		this.connection.refreshEntity(this);
	},

	// -------------------------------------
	// Bounding box check (to be overridden)

	within:function(left, right, top, bottom) {
		// summary:		Is the entity within the specified bbox?
		return !this.deleted;	// Boolean
	},



	// ---------------
	// Parent-handling
	addParent: function(entity) {
		// summary:		Record a parent (a relation or way which contains this entity).
		this.parents[entity._id] = entity;
	},
	removeParent: function(entity) {
		// summary:		Remove a parent (e.g. when node removed from a way).
        delete this.parents[entity._id];
	},
	hasParent: function(entity) {
		// summary:		Does this entity have the specified parent (e.g. is it in a certain relation)?
		return !!this.parents[entity._id];
	},
	parentObjects: function() {
		// summary:		List of all parents of this entity.
		return _.values(this.parents);
	},
	hasParentWays: function() {
		// summary:		Does this entity have any parents which are ways?
        return !!_.find(this.parentObjects(), function(p) {
            return p.entityType === 'way';
        });
	},
	parentWays: function() {
		// summary:		Return an array of all ways that this entity is a member of.
		return this._parentObjectsOfClass('way');	// Array
	},
	parentRelations: function() {
		// summary:		Return an array of all relations that this entity is a member of.
		return this._parentObjectsOfClass('relation');	// Array
	},
	_parentObjectsOfClass: function(_class) {
        return _.filter(this.parentObjects(), function(p) {
            return p.entityType === _class;
        });
	}
};
<commit_msg>Remove control character<commit_after>if (typeof iD === 'undefined') iD = {};

iD.Entity = function() {
    this.parents = {};
    // The ID locally
    this._id = iD.Util.id();
	this.connection =  null;
    // The ID in OSM terms
	this.id = NaN;
	this.loaded = false;
	this.entityType =  '';
	this.modified = false;
	this.deleted = false;
};

iD.Entity.prototype = {
	isType:function(type) {
		// summary:		Is this entity of the specified type ('node','way','relation')?
		return this.entityType === type;
	},

	toString:function() {
		return this.entityType + " . " + this.id;
	},

	// --------------------------------
	// Provoke redraw and other changes
	refresh:function() {
		// summary:		Ask the connection to provoke redraw and other changes.
		this.connection.refreshEntity(this);
	},

	// -------------------------------------
	// Bounding box check (to be overridden)

	within:function(left, right, top, bottom) {
		// summary:		Is the entity within the specified bbox?
		return !this.deleted;	// Boolean
	},



	// ---------------
	// Parent-handling
	addParent: function(entity) {
		// summary:		Record a parent (a relation or way which contains this entity).
		this.parents[entity._id] = entity;
	},
	removeParent: function(entity) {
		// summary:		Remove a parent (e.g. when node removed from a way).
        delete this.parents[entity._id];
	},
	hasParent: function(entity) {
		// summary:		Does this entity have the specified parent (e.g. is it in a certain relation)?
		return !!this.parents[entity._id];
	},
	parentObjects: function() {
		// summary:		List of all parents of this entity.
		return _.values(this.parents);
	},
	hasParentWays: function() {
		// summary:		Does this entity have any parents which are ways?
        return !!_.find(this.parentObjects(), function(p) {
            return p.entityType === 'way';
        });
	},
	parentWays: function() {
		// summary:		Return an array of all ways that this entity is a member of.
		return this._parentObjectsOfClass('way');	// Array
	},
	parentRelations: function() {
		// summary:		Return an array of all relations that this entity is a member of.
		return this._parentObjectsOfClass('relation');	// Array
	},
	_parentObjectsOfClass: function(_class) {
        return _.filter(this.parentObjects(), function(p) {
            return p.entityType === _class;
        });
	}
};

{'fraction_non_alphanumeric': 0.16854649925516066, 'fraction_numerical': 0.0, 'mean_word_length': 2.6632891660171474, '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': '2305664', 'n_tokens_mistral': 1487, 'n_tokens_neox': 1425, 'n_words': 426}