def _handle_data(self):
        records = {}
        start = time.time()
        while (time.time() - start) <= 0.1:
            socks = dict(self._poller.poll(timeout=self.poll_timeout))
            if self._data_socket not in socks or \
                    socks[self._data_socket] != zmq.POLLIN:
                break
            record = pickle.loads(self._data_socket.recv())
            if not isinstance(record, tuple) or len(record) != 2:
                continue
            pid, record_data = record
            if pid not in self._pid_mapping:
                continue
            records.setdefault(pid, []).append(record_data)
        for pid, record_data in records.iteritems():
            model = self._pid_mapping[pid]
            model.add_data(record_data)
        if len(records) > 0:
            return 0
        return self.poll_period
dataset/ETHPy150Open enthought/pikos/pikos/live/zmq_provider.py/ZmqProvider._handle_data/original