def _get_device_pfi_lines(self, device): r = re.compile('/PFI[0-9]+$', flags=re.IGNORECASE) return list(filter(r.search, device.terminals))