def records(self, record_type="arbitrary"):
        """ Records representing this data (in the format of input records).

        Parameters
        ----------
        record_type : str, { "interval", "arbitrary", "pulse", "billing", "arbitrary_start", "billing_start", "arbitrary_end", "billing_end" }
            Way in which the data should be represented.

        Returns
        -------
        records : list of dict
            Records consistent with the record type.
        """
        records = []
        if record_type == "interval":
            for s, v, est in zip(self.data.index, self.data, self.estimated):
                records.append({
                    "start": s.to_datetime(),
                    "value": v,
                    "estimated": bool(est),
                })
        elif ["arbitrary", "billing"] in record_type:
            for s, e, v, est in zip(self.data.index, self.data.index[1:], self.data, self.estimated):
                records.append({
                    "start": s.to_datetime(),
                    "end": e.to_datetime(),
                    "value": v,
                    "estimated": bool(est),
                })
        elif record_type in ["arbitrary_start", "billing_start"]:
            for s, v, est in zip(self.data.index, self.data, self.estimated):
                records.append({
                    "start": s.to_datetime(),
                    "value": v,
                    "estimated": bool(est),
                })
        elif record_type in ["arbitrary_end", "billing_end"]:
            records.append({
                "end": self.data.index[0].to_datetime(),
                "value": np.nan,
                "estimated": False,
            })
            for e, v, est in zip(self.data.index[1:], self.data, self.estimated):
                records.append({
                    "end": e.to_datetime(),
                    "value": v,
                    "estimated": bool(est),
                })
        elif record_type == "pulse":
            for i in self.data.index:
                records.append({
                    "pulse": i.to_datetime(),
                })

            shape = (self.data.values.shape[0] - 1,)
            if len(records) > 1 and not all(self.data.values[1:] == \
                    np.tile(self.data.values[1], shape)):
                message = 'record_type="pulse" implies that all values' \
                        ' should be the same, but they are not: {}'\
                        .format(self.data.values)
                warn(message)
        else:
            message = "Unsupported record_type: {}".format(record_type)
            raise ValueError(message)
        return records
dataset/ETHPy150Open impactlab/eemeter/eemeter/consumption.py/ConsumptionData.records/swapped operands of `in`