<commit_before>from neo.core.baseneo import BaseNeo

class Block(BaseNeo):
    """
    Main container gathering all the data, whether discrete or continous, for a
    given recording session.
    
    A block is not necessarily temporally homogeneous, in contrast to Segment.
    
    *Usage*:
    
    TODO
    
    *Required attributes/properties*:
        None
    
    *Recommended attributes/properties*:
        :name: A label for the dataset 
        :description: text description
        :file_origin: filesystem path or URL of the original data file.
        :file_datetime: the creation date and time of the original data file.
        :rec_datetime: the date and time of the original recording
        :index: TODO: WHAT IS THIS FOR?
    
    *Container of*:
        :py:class:`Segment`
        :py:class:`RecordingChannelGroup`
    
    """
    def __init__(self, name='', file_origin='', description='',
                 file_datetime=None, rec_datetime=None, index=None, **kargs):
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **kargs)
        
        self.file_datetime = file_datetime
        self.rec_datetime = rec_datetime
        self.index = index
        
        self.segments = [ ]
        self.recordingchannelgroups = [ ]
        
    @property
    def list_units(self):
        """
        Return a list of all Units in a block.
        """
        units = [ ]
        for rcg in self.recordingchannelgroups:
            for rc in rcg.recordingchannel:
                for unit in rc.units:
                    if unit not in units:
                        units.append(unit)
        return units


<commit_msg>For Block I came back to name=None, file_origin=None, description=None for default value because they are recommended attributes.<commit_after>from neo.core.baseneo import BaseNeo

class Block(BaseNeo):
    """
    Main container gathering all the data, whether discrete or continous, for a
    given recording session.
    
    A block is not necessarily temporally homogeneous, in contrast to Segment.
    
    *Usage*:
    
    TODO
    
    *Required attributes/properties*:
        None
    
    *Recommended attributes/properties*:
        :name: A label for the dataset 
        :description: text description
        :file_origin: filesystem path or URL of the original data file.
        :file_datetime: the creation date and time of the original data file.
        :rec_datetime: the date and time of the original recording
        :index: TODO: WHAT IS THIS FOR?
    
    *Container of*:
        :py:class:`Segment`
        :py:class:`RecordingChannelGroup`
    
    """
    def __init__(self, name=None, file_origin=None, description=None,
                 file_datetime=None, rec_datetime=None, index=None, **kargs):
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **kargs)
        
        self.file_datetime = file_datetime
        self.rec_datetime = rec_datetime
        self.index = index
        
        self.segments = [ ]
        self.recordingchannelgroups = [ ]
        
    @property
    def list_units(self):
        """
        Return a list of all Units in a block.
        """
        units = [ ]
        for rcg in self.recordingchannelgroups:
            for rc in rcg.recordingchannel:
                for unit in rc.units:
                    if unit not in units:
                        units.append(unit)
        return units



{'fraction_non_alphanumeric': 0.07505643340857787, 'fraction_numerical': 0.0, 'mean_word_length': 2.0195911413969334, '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': '4394154', 'n_tokens_mistral': 942, 'n_tokens_neox': 918, 'n_words': 302}