If the list has duplicates, return one of the duplicates. Otherwise, return None.
(list: list[T])
| 8237 | |
| 8238 | |
| 8239 | def find_duplicate(list: list[T]) -> T | None: |
| 8240 | """If the list has duplicates, return one of the duplicates. |
| 8241 | |
| 8242 | Otherwise, return None. |
| 8243 | """ |
| 8244 | for i in range(1, len(list)): |
| 8245 | if list[i] in list[:i]: |
| 8246 | return list[i] |
| 8247 | return None |
| 8248 | |
| 8249 | |
| 8250 | def remove_imported_names_from_symtable(names: SymbolTable, module: str) -> None: |
no test coverage detected
searching dependent graphs…