def pending(self, filename):
        def parse_value(value):
            if value == "U":
                return None
            else:
                return float(value)

        def parse_line(line):
            fields = line.split(':')
            ds_time = int(fields.pop(0))
            ds_values = [parse_value(v) for v in fields]
            return ds_time, ds_values

        def parse_result(result):
            lines = result.splitlines()
            # skip the first line which is the status
            updates = [parse_line(l) for l in lines[1:]]
            # probably not really needed but just to be safe
            updates.sort()
            return updates

        # This is required because no such file is returned if rrdcached
        # has not received any updates even if the file does exist
        def mask_error(failure):
            if (isinstance(failure.value, protocol.RRDCacheError) and
                    failure.value.args[0] == "-1 No such file or directory"):
                return []
            else:
                return failure

        assert self._client
        filename = self._escape_filename(filename)
        d = self._client.sendLine("PENDING %s" % filename)
        d.addCallbacks(parse_result, mask_error)
        return d
dataset/ETHPy150Open marineam/nagcat/python/twirrdy/twist.py/RRDTwistedAPI.pending/original