def _get_stat(self):
        """
        Get statistics from devfile in list of lists of words
        """

        def dev_filter(x):
            # get first word and remove trailing interface number
            x = x.strip().split(" ")[0][:-1]

            if x in self.interfaces_blacklist:
                return False

            if self.all_interfaces:
                return True

            if x in self.interfaces:
                return True

            return False

        # read devfile, skip two header files
        x = filter(dev_filter, open(self.devfile).readlines()[2:])

        try:
            # split info into words, filter empty ones
            return [list(filter(lambda x: x, _x.split(" "))) for _x in x]

        except StopIteration:
            return None
def _get_stat ( self ) : def dev_filter ( x ) : x = x . strip ( ) . split ( " " ) [ 0 ] [ : - 1 ] if x in self . interfaces_blacklist : return False if self . all_interfaces : return True if x in self . interfaces : return True return False x = filter ( dev_filter , open ( self . devfile ) . readlines ( ) [ 2 : ] ) try : return [ list ( filter ( lambda x : x , _x . split ( " " ) ) ) for _x in x ] except StopIteration : return None
Get statistics from devfile in list of lists of words