(values: Iterable[Any], *, minimum: int = 1, maximum: Optional[int] = None)
| 147 | |
| 148 | |
| 149 | def _unique_ints(values: Iterable[Any], *, minimum: int = 1, maximum: Optional[int] = None) -> List[int]: |
| 150 | seen: Set[int] = set() |
| 151 | result: List[int] = [] |
| 152 | for value in values or []: |
| 153 | try: |
| 154 | number = int(value) |
| 155 | except (TypeError, ValueError): |
| 156 | continue |
| 157 | if number < minimum: |
| 158 | continue |
| 159 | if maximum is not None and number > maximum: |
| 160 | continue |
| 161 | if number in seen: |
| 162 | continue |
| 163 | seen.add(number) |
| 164 | result.append(number) |
| 165 | return result |
| 166 | |
| 167 | |
| 168 | def _string_list(values: Any) -> List[str]: |
no outgoing calls
no test coverage detected