sphinx_learn 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,148 @@
1
+ # Generated from ra/jobs.proto. DO NOT EDIT.
2
+ # Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "".
3
+ # ruff: noqa: PGH004
4
+ # ruff: noqa
5
+ # fmt: off
6
+
7
+ from __future__ import annotations
8
+
9
+ from typing import Protocol, TYPE_CHECKING
10
+
11
+ from connectrpc.client import ConnectClient, ConnectClientSync
12
+ from connectrpc.code import Code
13
+ from connectrpc.errors import ConnectError
14
+ from connectrpc.method import IdempotencyLevel, MethodInfo
15
+ from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync
16
+
17
+ from .jobs_pb import SubmitJobRequest, SubmitJobResponse
18
+
19
+ if TYPE_CHECKING:
20
+ from collections.abc import AsyncGenerator, Iterable, Mapping
21
+
22
+ from connectrpc.codec import Codec
23
+ from connectrpc.compression import Compression
24
+ from connectrpc.interceptor import Interceptor, InterceptorSync
25
+ from connectrpc.request import Headers, RequestContext
26
+
27
+
28
+ class RaJobService(Protocol):
29
+ async def submit_job(self, request: SubmitJobRequest, ctx: RequestContext[SubmitJobRequest, SubmitJobResponse]) -> SubmitJobResponse:
30
+ raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
31
+
32
+
33
+ class RaJobServiceASGIApplication(ConnectASGIApplication[RaJobService]):
34
+ def __init__(
35
+ self,
36
+ service: RaJobService | AsyncGenerator[RaJobService],
37
+ *,
38
+ interceptors: Iterable[Interceptor] = (),
39
+ read_max_bytes: int | None = None,
40
+ compressions: Iterable[Compression] | None = None,
41
+ codecs: Iterable[Codec] | None = None,
42
+ ) -> None:
43
+ super().__init__(
44
+ service=service,
45
+ endpoints=lambda svc: {
46
+ "/ra.RaJobService/SubmitJob": Endpoint.unary(
47
+ method=MethodInfo(
48
+ name="SubmitJob",
49
+ service_name="ra.RaJobService",
50
+ input=SubmitJobRequest,
51
+ output=SubmitJobResponse,
52
+ idempotency_level=IdempotencyLevel.UNKNOWN,
53
+ ),
54
+ function=svc.submit_job,
55
+ ),
56
+ },
57
+ interceptors=interceptors,
58
+ read_max_bytes=read_max_bytes,
59
+ compressions=compressions,
60
+ codecs=codecs,
61
+ )
62
+
63
+ @property
64
+ def path(self) -> str:
65
+ """Returns the URL path to mount the application to when serving multiple applications."""
66
+ return "/ra.RaJobService"
67
+
68
+
69
+ class RaJobServiceClient(ConnectClient):
70
+ async def submit_job(
71
+ self,
72
+ request: SubmitJobRequest,
73
+ *,
74
+ headers: Headers | Mapping[str, str] | None = None,
75
+ timeout_ms: int | None = None,
76
+ ) -> SubmitJobResponse:
77
+ return await self.execute_unary(
78
+ request=request,
79
+ method=MethodInfo(
80
+ name="SubmitJob",
81
+ service_name="ra.RaJobService",
82
+ input=SubmitJobRequest,
83
+ output=SubmitJobResponse,
84
+ idempotency_level=IdempotencyLevel.UNKNOWN,
85
+ ),
86
+ headers=headers,
87
+ timeout_ms=timeout_ms,
88
+ )
89
+
90
+ class RaJobServiceSync(Protocol):
91
+ def submit_job(self, request: SubmitJobRequest, ctx: RequestContext[SubmitJobRequest, SubmitJobResponse]) -> SubmitJobResponse:
92
+ raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
93
+
94
+
95
+ class RaJobServiceWSGIApplication(ConnectWSGIApplication):
96
+ def __init__(
97
+ self,
98
+ service: RaJobServiceSync,
99
+ interceptors: Iterable[InterceptorSync] = (),
100
+ read_max_bytes: int | None = None,
101
+ compressions: Iterable[Compression] | None = None,
102
+ codecs: Iterable[Codec] | None = None,
103
+ ) -> None:
104
+ super().__init__(
105
+ endpoints={
106
+ "/ra.RaJobService/SubmitJob": EndpointSync.unary(
107
+ method=MethodInfo(
108
+ name="SubmitJob",
109
+ service_name="ra.RaJobService",
110
+ input=SubmitJobRequest,
111
+ output=SubmitJobResponse,
112
+ idempotency_level=IdempotencyLevel.UNKNOWN,
113
+ ),
114
+ function=service.submit_job,
115
+ ),
116
+ },
117
+ interceptors=interceptors,
118
+ read_max_bytes=read_max_bytes,
119
+ compressions=compressions,
120
+ codecs=codecs,
121
+ )
122
+
123
+ @property
124
+ def path(self) -> str:
125
+ """Returns the URL path to mount the application to when serving multiple applications."""
126
+ return "/ra.RaJobService"
127
+
128
+
129
+ class RaJobServiceClientSync(ConnectClientSync):
130
+ def submit_job(
131
+ self,
132
+ request: SubmitJobRequest,
133
+ *,
134
+ headers: Headers | Mapping[str, str] | None = None,
135
+ timeout_ms: int | None = None,
136
+ ) -> SubmitJobResponse:
137
+ return self.execute_unary(
138
+ request=request,
139
+ method=MethodInfo(
140
+ name="SubmitJob",
141
+ service_name="ra.RaJobService",
142
+ input=SubmitJobRequest,
143
+ output=SubmitJobResponse,
144
+ idempotency_level=IdempotencyLevel.UNKNOWN,
145
+ ),
146
+ headers=headers,
147
+ timeout_ms=timeout_ms,
148
+ )