<commit_before>#!/usr/bin/env python

class GFFFeature:

    def __init__(self):
        self.seqid = None
        self.source = None
        self.type = None
        self.start = None
        self.end = None
        self.score = None
        self.strand = None
        self.phase = None
        self.attributes = {} # Empty dictionary

    def add_child(self, child):
        child_type = child.type.lower() # For API, use lowercase names
        if hasattr(self, child_type): # Already have children of this type, append it to the list
            getattr(self, child_type).append(child)
        else: # No children with this type yet, make new list
            setattr(self, child_type, [child])

    def has_child(self, child_type):
        if hasattr(self, child_type.lower()):
            return True
        return False
<commit_msg>GFFFeature has a cool constructor<commit_after>#!/usr/bin/env python

class GFFFeature:

    def __init__(self, seqid=None, source=None, type=None, start=None, end=None, score=None, strand=None, phase=None, attributes=None):
        self.seqid = seqid
        self.source = source
        self.type = type
        self.start = start
        self.end = end
        self.score = score
        self.strand = strand
        self.phase = phase
        if not attributes:
            self.attributes = {} # Empty dictionary
        else:
            self.attributes = attributes

    def add_child(self, child):
        child_type = child.type.lower() # For API, use lowercase names
        if hasattr(self, child_type): # Already have children of this type, append it to the list
            getattr(self, child_type).append(child)
        else: # No children with this type yet, make new list
            setattr(self, child_type, [child])

    def has_child(self, child_type):
        if hasattr(self, child_type.lower()):
            return True
        return False

{'fraction_non_alphanumeric': 0.09133858267716535, 'fraction_numerical': 0.0, 'mean_word_length': 2.2195945945945947, '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': '2440484', 'n_tokens_mistral': 548, 'n_tokens_neox': 531, 'n_words': 167}