if
statements can be merged PTC-W0048688 Returns:
689 tuple: (segments, sample_rate, audio_length). See :meth:`~lecture2notes.end_to_end.transcribe.webrtcvad_utils.vad_segment_generator`.
690 """
691 if desired_sample_rate:692 if desired_sample_rate not in (
693 8000,
694 16000,
Nested if
statements can be collapsed into a single if
statement by separating their condition using and
operator.
Merging collapsible if
statements increases the code's readability.
if condition1:
if condition2:
dosomething()
if condition1 and condition2:
dosomething()
DeepSource will not raise this issue when the nested if
statements have comments in between them, as it could be explaining why the nested if
is in place.