def register(self, patt=None, cback=None, final=True):
        """ Register a callback and associated pattern
        
        Slurp.register(patt=None, cback=None, final=True)
        
        Register a handler, using cback, when matching patt.
        If final is True, then Slurp will stop processing for that trigger, once it has
        matched it (this is on a per line basis).
        
        Example:
        
        obj = Slurp(open('/etc/fstab', 'r'))
        # Print only commented out lines
        obj.register('^#.*$', print)
        # *or*
        obj.register('^#.*$', print, False) # This will allow multiple callbacks to match        
        
        """
        # Check argument non-None..ness first and foremost
        if patt != None and cback != None:
            # Then check types
            if type(patt) != types.StringType or type(cback) != types.FunctionType:
                raise InvalidArgument
            else:
                # Check to see that our list of callbacks doesn't have one of these
                # instances already in it.
                for itm in self.triggers:
                    if itm[0] == patt:
                        return False
                # Ok, passed that, lets add it in
                self.triggers.append([patt, cback, final])
                return True
        else:
            raise InvalidArgument
 Register a callback and associated pattern
        
        Slurp.register(patt=None, cback=None, final=True)
        
        Register a handler, using cback, when matching patt.
        If final is True, then Slurp will stop processing for that trigger, once it has
        matched it (this is on a per line basis).
        
        Example:
        
        obj = Slurp(open('/etc/fstab', 'r'))
        # Print only commented out lines
        obj.register('^#.*$', print)
        # *or*
        obj.register('^#.*$', print, False) # This will allow multiple callbacks to match        
        
        
recipes/Python/578532_slurppy_Regex_based_simple_parsing/recipe-578532.py