def get_stats_value(self, item, value):
        """Return the stats object for a specific item=value in JSON format.

        Stats should be a list of dict (processlist, network...)
        """
        if not isinstance(self.stats, list):
            return None
        else:
            if value.isdigit():
                value = int(value)
            try:
                return self._json_dumps({value: [i for i in self.stats if i[item] == value]})
            except (KeyError, ValueError) as e:
                logger.error(
                    "Cannot get item({})=value({}) ({})".format(item, value, e))
                return None
def get_stats_value ( self , item , value ) : if not isinstance ( self . stats , list ) : return None else : if value . isdigit ( ) : value = int ( value ) try : return self . _json_dumps ( { value : [ i for i in self . stats if i [ item ] == value ] } ) except ( KeyError , ValueError ) as e : logger . error ( "Cannot get item({})=value({}) ({})" . format ( item , value , e ) ) return None
Return the stats object for a specific item=value in JSON format.

        Stats should be a list of dict (processlist, network...)