def _import_arbitrary(self, records):
        if records == []:
            return pd.Series([]), pd.Series([])
        try:
            sorted_records = sorted(records, key=lambda x: x["start"])
        except KeyError:
            message = 'Records must all have a "start" key and an'\
                    ' "end" key.'
            raise ValueError(message)
        start_datetimes = []
        values = []
        estimateds = []
        previous_end_datetime = None
        for record in sorted_records:
            start = record.get("start")
            end = record.get("end")
            value = record.get("value")
            estimated = record.get("estimated")
            if start is None or end is None:
                message = 'Records must all have a "start" key and an'\
                        ' "end" key.'
                raise ValueError(message)
            else:
                if start >= end:
                    message = 'Record start must be earlier than end:'\
                            '{} >= {}.'.format(start,end)
                    raise ValueError(message)
            if previous_end_datetime is None or\
                    start == previous_end_datetime:
                start_datetimes.append(start)
                values.append(value)
                previous_end_datetime = end
                estimateds.append(bool(estimated))
            elif previous_end_datetime < start:
                message = 'Skipping overlapping record: '\
                        'start ({}) < previous end ({})'\
                        .format(start,previous_end_datetime)
                warn(message)
            else: # start > previous_end_datetime:
                start_datetimes.append(previous_end_datetime)
                values.append(np.nan)
                estimateds.append(False)
                start_datetimes.append(start)
                values.append(value)
                previous_end_datetime = end
                estimateds.append(bool(estimated))
        # append a NaN to represent the end date of the last one.
        start_datetimes.append(previous_end_datetime)
        values.append(np.nan)
        estimateds.append(False)
        dt_index = pd.DatetimeIndex(start_datetimes)
        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_arbitrary/swapped operands of `<`