Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
_datasource.pyi31 linesDownload Raw Back to lib
1from _typeshed import OpenBinaryMode, OpenTextMode
2from pathlib import Path
3from typing import IO, Any, TypeAlias
4
5_Mode: TypeAlias = OpenBinaryMode | OpenTextMode
6
7###
8
9# exported in numpy.lib.nppyio
10class DataSource:
11    def __init__(self, /, destpath: Path | str | None = ".") -> None: ...
12    def __del__(self, /) -> None: ...
13    def abspath(self, /, path: str) -> str: ...
14    def exists(self, /, path: str) -> bool: ...
15
16    # Whether the file-object is opened in string or bytes mode (by default)
17    # depends on the file-extension of `path`
18    def open(self, /, path: str, mode: _Mode = "r", encoding: str | None = None, newline: str | None = None) -> IO[Any]: ...
19
20class Repository(DataSource):
21    def __init__(self, /, baseurl: str, destpath: str | None = ".") -> None: ...
22    def listdir(self, /) -> list[str]: ...
23
24def open(
25    path: str,
26    mode: _Mode = "r",
27    destpath: str | None = ".",
28    encoding: str | None = None,
29    newline: str | None = None,
30) -> IO[Any]: ...
31 
codekingpro/portable-devtools · Team Ai