Skip to content

Commit 58c2e9f

Browse files
committed
Format Update
1 parent 1001dd0 commit 58c2e9f

23 files changed

Lines changed: 112 additions & 94 deletions

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.1.0
3+
rev: v3.3.0
44
hooks:
55
- id: check-yaml
66
- id: check-ast
77
- id: end-of-file-fixer
88
- id: trailing-whitespace
99
- id: check-toml
1010
- id: requirements-txt-fixer
11-
- id: sort-simple-yaml
1211
- id: check-json
1312
- id: check-merge-conflict
1413
- repo: https://github.com/psf/black
15-
rev: 19.10b0
14+
rev: 20.8b1
1615
hooks:
1716
- id: black
1817
- repo: https://gitlab.com/PyCQA/flake8
19-
rev: 3.8.3
18+
rev: 3.8.4
2019
hooks:
2120
- id: flake8
21+
args: [--config=setup.cfg]
2222
- repo: https://github.com/pre-commit/mirrors-mypy
23-
rev: v0.782
23+
rev: v0.790
2424
hooks:
2525
- id: mypy
2626
- repo: https://github.com/asottile/blacken-docs
27-
rev: v1.7.0
27+
rev: v1.8.0
2828
hooks:
2929
- id: blacken-docs
3030
- repo: local
@@ -42,6 +42,6 @@ repos:
4242
- id: shellcheck
4343
- id: shfmt
4444
- repo: https://github.com/prettier/prettier
45-
rev: "2.0.5"
45+
rev: "2.1.2"
4646
hooks:
4747
- id: prettier

docs/source/_build/html/genindex.html

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -536,18 +536,15 @@ <h2 id="F">F</h2>
536536
</td>
537537
</tr>
538538
</table>
539-
<<<<<<< HEAD
539+
<<<<<<< HEAD
540540
<h2 id="G">G</h2>
541-
<table
542-
style="width: 100%;"
543-
=======
541+
<table style="width: 100%;" =======
544542

545543
<h2 id="G">G</h2>
546-
<table
547-
style="width: 100%"
548-
>>>>>>> 7117180... doc updates and library version increment
549-
class="indextable genindextable"
550-
>
544+
<table style="width: 100%">
545+
>>>>>> 7117180... doc updates and library
546+
version increment class="indextable
547+
genindextable" >
551548
<tr>
552549
<td
553550
style="
@@ -568,10 +565,8 @@ <h2 id="G">G</h2>
568565
</td>
569566
</tr>
570567
</table>
571-
<<<<<<< HEAD
572-
=======
573-
574-
>>>>>>> 7117180... doc updates and library version increment
568+
<<<<<<< HEAD ======= >>>>>>> 7117180... doc
569+
updates and library version increment
575570
<h2 id="I">I</h2>
576571
<table
577572
style="width: 100%"

spokestack/activation_timeout.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class ActivationTimeout:
8-
""" Speech pipeline activation timeout
8+
"""Speech pipeline activation timeout
99
1010
Args:
1111
frame_width (int): frame width of the audio (ms)
@@ -23,7 +23,7 @@ def __init__(
2323
self._active_length = 0
2424

2525
def __call__(self, context: SpeechContext, frame=None) -> None:
26-
""" Main entry point that manages timeout
26+
"""Main entry point that manages timeout
2727
2828
Args:
2929
context (SpeechContext): the current state of the pipeline

spokestack/asr/google/speech_recognizer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ def __call__(self, context: SpeechContext, frame: np.ndarray) -> None:
8484
self._send(frame)
8585

8686
def _begin(self, context) -> None:
87-
self._thread = Thread(target=self._receive, args=(context,),)
87+
self._thread = Thread(
88+
target=self._receive,
89+
args=(context,),
90+
)
8891
self._thread.start()
8992

9093
def _receive(self, context):

spokestack/asr/spokestack/cloud_client.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313

1414

1515
class CloudClient:
16-
""" Spokestack client for cloud based speech to text
16+
"""Spokestack client for cloud based speech to text
1717
18-
Args:
19-
key_id (str): identity from spokestack api credentials
20-
key_secret (str): secret key from spokestack api credentials
21-
socket_url (str): url for socket connection
22-
audio_format (str): format of input audio
23-
sample_rate (int): audio sample rate (kHz)
24-
language (str): language for recognition
25-
limit (int): Limit of messages per api response
26-
idle_timeout (Any): Time before client timeout. Defaults to None
18+
Args:
19+
key_id (str): identity from spokestack api credentials
20+
key_secret (str): secret key from spokestack api credentials
21+
socket_url (str): url for socket connection
22+
audio_format (str): format of input audio
23+
sample_rate (int): audio sample rate (kHz)
24+
language (str): language for recognition
25+
limit (int): Limit of messages per api response
26+
idle_timeout (Any): Time before client timeout. Defaults to None
2727
"""
2828

2929
def __init__(
@@ -66,7 +66,7 @@ def __init__(
6666
self._idle_count: int = 0
6767

6868
def __call__(self, audio: Union[bytes, np.ndarray], limit: int = 1) -> List[str]:
69-
""" Audio to text interface for the cloud client
69+
"""Audio to text interface for the cloud client
7070
7171
Args:
7272
audio (bytes|np.ndarray): input audio can be in the form of
@@ -138,7 +138,7 @@ def disconnect(self) -> None:
138138
self._socket = None
139139

140140
def send(self, frame: np.ndarray):
141-
""" sends a single frame of audio
141+
"""sends a single frame of audio
142142
143143
Args:
144144
frame (np.ndarray): segment of PCM-16 encoded audio
@@ -197,7 +197,7 @@ def idle_count(self, value: int):
197197

198198

199199
class APIError(Exception):
200-
""" Spokestack api error pass through
200+
"""Spokestack api error pass through
201201
202202
Args:
203203
response (dict): message from the api service

spokestack/asr/spokestack/speech_recognizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
class CloudSpeechRecognizer:
17-
""" Speech recognizer for use in the speech pipeline
17+
"""Speech recognizer for use in the speech pipeline
1818
1919
Args:
2020
spokestack_id (str): identity under spokestack api credentials
@@ -46,7 +46,7 @@ def __init__(
4646
self._is_active = False
4747

4848
def __call__(self, context: SpeechContext, frame: np.ndarray) -> None:
49-
""" Entry point of the recognizer
49+
"""Entry point of the recognizer
5050
5151
Args:
5252
context (SpeechContext): current state of the speech pipeline

spokestack/context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __init__(self) -> None:
2020
self._handlers: dict = {}
2121

2222
def add_handler(self, name: str, function: Callable) -> None:
23-
""" Adds a handler to the context
23+
"""Adds a handler to the context
2424
2525
Args:
2626
name (str): The name of the event handler
@@ -30,7 +30,7 @@ def add_handler(self, name: str, function: Callable) -> None:
3030
self._handlers[name] = function
3131

3232
def event(self, name: str) -> None:
33-
""" Calls the event handler
33+
"""Calls the event handler
3434
3535
Args:
3636
name (str): The name of the event handler

spokestack/io/pyaudio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def is_stopped(self) -> bool:
7878

7979

8080
class PyAudioOutput:
81-
""" Outputs audio to the default system output
81+
"""Outputs audio to the default system output
8282
8383
Args:
8484
num_channels (int): number of audio channels
@@ -97,7 +97,7 @@ def __init__(self, num_channels: int = 1, sample_rate: int = 24000) -> None:
9797
)
9898

9999
def write(self, frame: bytes) -> None:
100-
""" Writes a single frame of audio to output
100+
"""Writes a single frame of audio to output
101101
102102
Args:
103103
frame (bytes): a single frame of audio

spokestack/models/tensorflow.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
class TFLiteModel:
16-
""" TFLite model base class for managing multiple inputs/outputs
16+
"""TFLite model base class for managing multiple inputs/outputs
1717
1818
Args:
1919
model_path (str): Path to .tflite model file
@@ -31,7 +31,7 @@ def __init__(self, model_path: str, **kwargs: Any) -> None:
3131
self._interpreter.allocate_tensors()
3232

3333
def __call__(self, *args) -> List[np.ndarray]:
34-
""" Forward pass of the TFLite model
34+
"""Forward pass of the TFLite model
3535
3636
Args:
3737
inputs (Any): inputs to the TFLite model
@@ -52,7 +52,7 @@ def __call__(self, *args) -> List[np.ndarray]:
5252

5353
@property
5454
def input_details(self) -> List[Any]:
55-
""" Property for accesing the TFLite model input_details
55+
"""Property for accesing the TFLite model input_details
5656
5757
Returns: Input details for the TFLite model
5858
@@ -61,7 +61,7 @@ def input_details(self) -> List[Any]:
6161

6262
@property
6363
def output_details(self) -> List[Any]:
64-
""" Property for accesing the TFLite model output_details
64+
"""Property for accesing the TFLite model output_details
6565
6666
Returns: Output details for the TFLite model
6767

spokestack/nlu/parsers/digits.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
def parse(metadata: Dict[str, Any], raw_value: str) -> str:
19-
""" Digit Parser
19+
"""Digit Parser
2020
2121
Args:
2222
metadata (Dict[str, Any]): digit slot metadata

0 commit comments

Comments
 (0)