<commit_before>"""
.. module:: elementtype.py
   :platform: Linux

.. moduleauthor:: <NAME> <<EMAIL>>


"""
class ElementType(object):
    '''
    The ElementType class is an in-memory representation of a graph element
    type. It provides some functions to operate on all entities of the same type
    and keeps the description of the structured attributes.
    '''


    def __init__(self, typedef, type_name):
        self._get_typedefinition = typedef
        self._typename = type_name


    def get_type_definition(self):
        '''
        Returns a dictionary comprising the structured attributes of 
        this graph element type.
        
        Return:
            The created type declaration (dict).
        '''
        result = {}
        for attr in self._get_typedefinition(self._typename):
            result[attr[1]] = attr[0]
        return result
    
    def get_type_name(self):
        '''
        Returns the type name of this object.
        
        Return:
            The type name (str).
        '''
        return self._typename
    
    
class VertexType(ElementType, object):
    '''
    The VertexType.
    '''

    def __init__(self, typedef, vertex_type):
        super(VertexType, self).__init__(typedef, vertex_type)
        
class EdgeType(ElementType, object):
    '''
    The EdgeType.
    '''

    def __init__(self, typedef, edge_type):
        super(EdgeType, self).__init__(typedef, edge_type)<commit_msg>Update elementtype.py<commit_after>"""
.. module:: elementtype.py
   :platform: Linux

.. moduleauthor:: <NAME> <<EMAIL>>


"""
class ElementType(object):
    '''
    The ElementType class is an in-memory representation of a graph element
    type. It provides some functions to operate on all entities of the same type
    and keeps the description of the structured attributes.
    '''


    def __init__(self, typedef, type_name):
        self._get_typedefinition = typedef
        self._typename = type_name


    def get_type_definition(self):
        '''
        Returns a dictionary comprising the structured attributes of 
        this graph element type.
        
        Return:
            The created type declaration (dict).
        '''
        result = {}
        for attr in self._get_typedefinition(self._typename):
            result[attr[1]] = attr[0]
        return result
    
    def get_type_name(self):
        '''
        Returns the type name of this object.
        
        Return:
            The type name (str).
        '''
        return self._typename
       
    #TODO count available elements
    #TDOD provide search method on these elements
    #TODO remove all elements plus type
    
    
class VertexType(ElementType, object):
    '''
    The VertexType.
    '''

    def __init__(self, typedef, vertex_type):
        super(VertexType, self).__init__(typedef, vertex_type)
        
class EdgeType(ElementType, object):
    '''
    The EdgeType.
    '''

    def __init__(self, typedef, edge_type):
        super(EdgeType, self).__init__(typedef, edge_type)
{'fraction_non_alphanumeric': 0.09117743522466383, 'fraction_numerical': 0.0013119055428009183, 'mean_word_length': 2.251599147121535, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4584867', 'n_tokens_mistral': 832, 'n_tokens_neox': 796, 'n_words': 257}