def _import_pulse(self, records):
        if records == []:
            return pd.Series([]), pd.Series([])
        try:
            sorted_records = sorted(records, key=lambda x: x["pulse"])
        except __HOLE__:
            message = 'Records must all have a "pulse" key.'
            raise ValueError(message)
        pulses = [r.get("pulse") for r in sorted_records]
        estimateds = [bool(r.get("estimated")) for r in sorted_records]
        values = np.tile(float(self.pulse_value),(len(pulses),))
        values[0] = np.nan # the first pulse is treated as the first start
        dt_index = pd.DatetimeIndex(pulses)
        data = pd.Series(values,index=dt_index)
        estimated = pd.Series(estimateds, index=dt_index)
        return data, estimated
dataset/ETHPy150Open impactlab/eemeter/eemeter/consumption.py/ConsumptionData._import_pulse