def __init__(self , filename = None, dllpath = None) :
        """
        Arguments:
            filename : the filename
        The init function will run automatically upon calling of the class, as 
        in: test = MultichannelIO(filename = filetoberead.mcd), therefore the first
        operations with the file are set here, so that the user doesn't have to
        remember to use another method, than the ones defined in the NEO library
            
        """
        BaseIO.__init__(self)
        self.filename = filename
        #set the flags for each event type
        eventID = 1        
        analogID = 2
        epochID = 3
        #if a filename was given, create a dictionary with information that will 
        #be needed later on.
        if self.filename != None:
            if dllpath is not None:
                name = os.path.splitext(os.path.basename(dllpath))[0]
                library = ns.Library(name, dllpath)
            else:
                library = None
            self.fd = ns.File(self.filename, library = library)
            #get all the metadata from file
            self.metadata = self.fd.metadata_raw
            #get sampling rate
            self.metadata["sampRate"] = self.metadata["TimeStampResolution"]/1.#hz
            #create lists and array for electrode, spike cutouts and trigger channels
            self.metadata["elecChannels"] = list()
            self.metadata["elecChanId"]   = list()
            self.metadata["num_analogs"]  = 0
            self.metadata["spkChannels"]  = list()
            self.metadata["spkChanId"]    = list()
            self.metadata["num_spkChans"] = 0
            self.metadata["triggers"]     = list()
            self.metadata["triggersId"]   = list()
            self.metadata["num_trigs"]    = 0
            self.metadata["digital epochs"] = list()
            self.metadata["digiEpochId"]    = list()
            self.metadata["num_digiEpochs"] = 0

            #loop through all entities in file to get the indexes for each entity
            #type, so that one can run through the indexes later, upon reading the 
            #segment
            for entity in self.fd.entities:
                #if entity is analog and not the digital line recording 
                #(stored as analog in neuroshare files) 
                if entity.entity_type == analogID and entity.label[0:4]!= "digi":
                    #get the electrode number                    
                    self.metadata["elecChannels"].append(entity.label[-4:])
                    #get the electrode index
                    self.metadata["elecChanId"].append(entity.id)
                    #increase the number of electrodes found
                    self.metadata["num_analogs"] += 1
                # if the entity is a event entitiy and a trigger
                if entity.entity_type == eventID and entity.label[0:4] == "trig":
                    #get the digital bit/trigger number
                    self.metadata["triggers"].append(entity.label[0:4]+entity.label[-4:])
                    #get the digital bit index
                    self.metadata["triggersId"].append(entity.id)
                    #increase the number of triggers found                    
                    self.metadata["num_trigs"] += 1
                #if the entity is non triggered digital values with duration
                if entity.entity_type == eventID and entity.label[0:4] == "digi":
                    #get the digital bit number
                    self.metadata["digital epochs"].append(entity.label[-5:])
                    #get the digital bit index
                    self.metadata["digiEpochId"].append(entity.id)
                    #increase the number of triggers found                    
                    self.metadata["num_digiEpochs"] += 1
                #if the entity is spike cutouts
                if entity.entity_type == epochID and entity.label[0:4] == "spks":
                    self.metadata["spkChannels"].append(entity.label[-4:])
                    self.metadata["spkChanId"].append(entity.id)
                    self.metadata["num_spkChans"] += 1
            
    #function to create a block and read in a segment
#    def create_block(self,
#                     lazy = False,
#                     cascade = True,
#                     
#                     ):
#        
#        blk=Block(name = self.fileName+"_segment:",
#                  file_datetime = str(self.metadata_raw["Time_Day"])+"/"+
#                                  str(self.metadata_raw["Time_Month"])+"/"+
#                                  str(self.metadata_raw["Time_Year"])+"_"+
#                                  str(self.metadata_raw["Time_Hour"])+":"+
#                                  str(self.metadata_raw["Time_Min"]))
#        
#        blk.rec_datetime = blk.file_datetime
#        return blk
    
    #create function to read segment
dataset/ETHPy150Open NeuralEnsemble/python-neo/neo/io/neuroshareapiio.py/NeuroshareapiIO.__init__/swapped operands of `/`