massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 2and3 / time.pyi
1 """Stub file for the 'time' module."""\r
2 # See https://docs.python.org/3/library/time.html\r
3 \r
4 import sys\r
5 from typing import Any, NamedTuple, Tuple, Union, Optional\r
6 if sys.version_info >= (3, 3):\r
7     from types import SimpleNamespace\r
8 \r
9 _TimeTuple = Tuple[int, int, int, int, int, int, int, int, int]\r
10 \r
11 if sys.version_info < (3, 3):\r
12     accept2dyear: bool\r
13 altzone: int\r
14 daylight: int\r
15 timezone: int\r
16 tzname: Tuple[str, str]\r
17 \r
18 if sys.version_info >= (3, 7) and sys.platform != 'win32':\r
19     CLOCK_BOOTTIME: int  # Linux\r
20     CLOCK_PROF: int  # FreeBSD, NetBSD, OpenBSD\r
21     CLOCK_UPTIME: int  # FreeBSD, OpenBSD\r
22 \r
23 if sys.version_info >= (3, 3) and sys.platform != 'win32':\r
24     CLOCK_HIGHRES: int = ...  # Solaris only\r
25     CLOCK_MONOTONIC: int = ...  # Unix only\r
26     CLOCK_MONOTONIC_RAW: int = ...  # Linux 2.6.28 or later\r
27     CLOCK_PROCESS_CPUTIME_ID: int = ...  # Unix only\r
28     CLOCK_REALTIME: int = ...  # Unix only\r
29     CLOCK_THREAD_CPUTIME_ID: int = ...  # Unix only\r
30 \r
31 \r
32 if sys.version_info >= (3, 3):\r
33     class struct_time(\r
34         NamedTuple(\r
35             '_struct_time',\r
36             [('tm_year', int), ('tm_mon', int), ('tm_mday', int),\r
37              ('tm_hour', int), ('tm_min', int), ('tm_sec', int),\r
38              ('tm_wday', int), ('tm_yday', int), ('tm_isdst', int),\r
39              ('tm_zone', str), ('tm_gmtoff', int)]\r
40         )\r
41     ):\r
42         def __init__(\r
43             self,\r
44             o: Union[\r
45                 Tuple[int, int, int, int, int, int, int, int, int],\r
46                 Tuple[int, int, int, int, int, int, int, int, int, str],\r
47                 Tuple[int, int, int, int, int, int, int, int, int, str, int]\r
48             ],\r
49             _arg: Any = ...,\r
50         ) -> None: ...\r
51         def __new__(\r
52             cls,\r
53             o: Union[\r
54                 Tuple[int, int, int, int, int, int, int, int, int],\r
55                 Tuple[int, int, int, int, int, int, int, int, int, str],\r
56                 Tuple[int, int, int, int, int, int, int, int, int, str, int]\r
57             ],\r
58             _arg: Any = ...,\r
59         ) -> struct_time: ...\r
60 else:\r
61     class struct_time(\r
62         NamedTuple(\r
63             '_struct_time',\r
64             [('tm_year', int), ('tm_mon', int), ('tm_mday', int),\r
65              ('tm_hour', int), ('tm_min', int), ('tm_sec', int),\r
66              ('tm_wday', int), ('tm_yday', int), ('tm_isdst', int)]\r
67         )\r
68     ):\r
69         def __init__(self, o: _TimeTuple, _arg: Any = ...) -> None: ...\r
70         def __new__(cls, o: _TimeTuple, _arg: Any = ...) -> struct_time: ...\r
71 \r
72 def asctime(t: Union[_TimeTuple, struct_time] = ...) -> str: ...\r
73 def clock() -> float: ...\r
74 def ctime(secs: Optional[float] = ...) -> str: ...\r
75 def gmtime(secs: Optional[float] = ...) -> struct_time: ...\r
76 def localtime(secs: Optional[float] = ...) -> struct_time: ...\r
77 def mktime(t: Union[_TimeTuple, struct_time]) -> float: ...\r
78 def sleep(secs: float) -> None: ...\r
79 def strftime(format: str, t: Union[_TimeTuple, struct_time] = ...) -> str: ...\r
80 def strptime(string: str, format: str = ...) -> struct_time: ...\r
81 def time() -> float: ...\r
82 if sys.platform != 'win32':\r
83     def tzset() -> None: ...  # Unix only\r
84 \r
85 if sys.version_info >= (3, 3):\r
86     def get_clock_info(name: str) -> SimpleNamespace: ...\r
87     def monotonic() -> float: ...\r
88     def perf_counter() -> float: ...\r
89     def process_time() -> float: ...\r
90     if sys.platform != 'win32':\r
91         def clock_getres(clk_id: int) -> float: ...  # Unix only\r
92         def clock_gettime(clk_id: int) -> float: ...  # Unix only\r
93         def clock_settime(clk_id: int, time: float) -> None: ...  # Unix only\r
94 \r
95 if sys.version_info >= (3, 7):\r
96     def clock_gettime_ns(clock_id: int) -> int: ...\r
97     def clock_settime_ns(clock_id: int, time: int) -> int: ...\r
98     def monotonic_ns() -> int: ...\r
99     def perf_counter_ns() -> int: ...\r
100     def process_time_ns() -> int: ...\r
101     def time_ns() -> int: ...\r
102     def thread_time() -> float: ...\r
103     def thread_time_ns() -> int: ...\r