|
2 | 2 | # --------------------------------------------------------------------------
|
3 | 3 | # Copyright (c) Microsoft Corporation. All rights reserved.
|
4 | 4 | # Licensed under the MIT License. See License.txt in the project root for license information.
|
5 |
| -# Code generated by Microsoft (R) AutoRest Code Generator. |
| 5 | +# Code generated by Microsoft (R) Python Code Generator. |
6 | 6 | # Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
7 | 7 | # --------------------------------------------------------------------------
|
8 | 8 |
|
9 | 9 | from copy import deepcopy
|
10 |
| -import sys |
11 | 10 | from typing import Any
|
12 | 11 |
|
13 | 12 | from azure.core import PipelineClient
|
|
18 | 17 | from ._operations import AnomalyDetectorClientOperationsMixin
|
19 | 18 | from ._serialization import Deserializer, Serializer
|
20 | 19 |
|
21 |
| -if sys.version_info >= (3, 8): |
22 |
| - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports |
23 |
| -else: |
24 |
| - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports |
25 |
| - |
26 | 20 |
|
27 | 21 | class AnomalyDetectorClient(AnomalyDetectorClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
|
28 |
| - """The Anomaly Detector API detects anomalies automatically in time series data. It supports two |
29 |
| - kinds of mode, one is for stateless using, another is for stateful using. In stateless mode, |
30 |
| - there are three functionalities. Entire Detect is for detecting the whole series with model |
31 |
| - trained by the time series, Last Detect is detecting last point with model trained by points |
32 |
| - before. ChangePoint Detect is for detecting trend changes in time series. In stateful mode, |
33 |
| - user can store time series, the stored time series will be used for detection anomalies. Under |
34 |
| - this mode, user can still use the above three functionalities by only giving a time range |
35 |
| - without preparing time series in client side. Besides the above three functionalities, stateful |
36 |
| - model also provide group based detection and labeling service. By leveraging labeling service |
37 |
| - user can provide labels for each detection result, these labels will be used for retuning or |
38 |
| - regenerating detection models. Inconsistency detection is a kind of group based detection, this |
39 |
| - detection will find inconsistency ones in a set of time series. By using anomaly detector |
40 |
| - service, business customers can discover incidents and establish a logic flow for root cause |
41 |
| - analysis. |
| 22 | + """The Anomaly Detector API detects anomalies automatically in time series data. |
| 23 | + It supports two kinds of mode, one is for stateless using, another is for |
| 24 | + stateful using. In stateless mode, there are three functionalities. Entire |
| 25 | + Detect is for detecting the whole series with model trained by the time series, |
| 26 | + Last Detect is detecting last point with model trained by points before. |
| 27 | + ChangePoint Detect is for detecting trend changes in time series. In stateful |
| 28 | + mode, user can store time series, the stored time series will be used for |
| 29 | + detection anomalies. Under this mode, user can still use the above three |
| 30 | + functionalities by only giving a time range without preparing time series in |
| 31 | + client side. Besides the above three functionalities, stateful model also |
| 32 | + provide group based detection and labeling service. By leveraging labeling |
| 33 | + service user can provide labels for each detection result, these labels will be |
| 34 | + used for retuning or regenerating detection models. Inconsistency detection is |
| 35 | + a kind of group based detection, this detection will find inconsistency ones in |
| 36 | + a set of time series. By using anomaly detector service, business customers can |
| 37 | + discover incidents and establish a logic flow for root cause analysis. |
42 | 38 |
|
43 | 39 | :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
|
44 | 40 | https://westus2.api.cognitive.microsoft.com). Required.
|
@@ -80,21 +76,20 @@ def send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
|
80 | 76 | request_copy = deepcopy(request)
|
81 | 77 | path_format_arguments = {
|
82 | 78 | "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
|
83 |
| - "ApiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), |
| 79 | + "ApiVersion": self._serialize.url( |
| 80 | + "self._config.api_version", self._config.api_version, "str", skip_quote=True |
| 81 | + ), |
84 | 82 | }
|
85 | 83 |
|
86 | 84 | request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
|
87 | 85 | return self._client.send_request(request_copy, **kwargs)
|
88 | 86 |
|
89 |
| - def close(self): |
90 |
| - # type: () -> None |
| 87 | + def close(self) -> None: |
91 | 88 | self._client.close()
|
92 | 89 |
|
93 |
| - def __enter__(self): |
94 |
| - # type: () -> AnomalyDetectorClient |
| 90 | + def __enter__(self) -> "AnomalyDetectorClient": |
95 | 91 | self._client.__enter__()
|
96 | 92 | return self
|
97 | 93 |
|
98 |
| - def __exit__(self, *exc_details): |
99 |
| - # type: (Any) -> None |
| 94 | + def __exit__(self, *exc_details) -> None: |
100 | 95 | self._client.__exit__(*exc_details)
|
0 commit comments