Checks if a given string is a file on local system. Args: obj (:obj:`str`): The string to check.
(obj: FilePathInput | None)
| 79 | |
| 80 | |
| 81 | def is_local_file(obj: FilePathInput | None) -> bool: |
| 82 | """ |
| 83 | Checks if a given string is a file on local system. |
| 84 | |
| 85 | Args: |
| 86 | obj (:obj:`str`): The string to check. |
| 87 | """ |
| 88 | if obj is None: |
| 89 | return False |
| 90 | |
| 91 | path = Path(obj) |
| 92 | try: |
| 93 | return path.is_file() |
| 94 | except Exception: |
| 95 | return False |
| 96 | |
| 97 | |
| 98 | def parse_file_input( # pylint: disable=too-many-return-statements |
no outgoing calls
no test coverage detected
searching dependent graphs…