@@ -82,7 +82,7 @@ def gen_sentence(
8282 """
8383 if not start_seq :
8484 # Non-cryptographic use, pseudo-random generator is acceptable here
85- start_seq = random .choice (self .word ) # noqa: S311 # nosec B311
85+ start_seq = random .choice (self .word ) # noqa: S311 # nosec B311 # NOSONAR
8686 rand_text = start_seq .lower ()
8787 self ._word_prob = {
8888 i : self .counts [i ] / self .n
@@ -108,10 +108,10 @@ def _next_word(
108108 N = len (word_list )
109109 for _ in range (N ):
110110 # Non-cryptographic use, pseudo-random generator is acceptable here
111- w = random .choice (word_list ) # noqa: S311 # nosec B311
111+ w = random .choice (word_list ) # noqa: S311 # nosec B311 # NOSONAR
112112 if duplicate is False :
113113 while w in words :
114- w = random .choice (word_list ) # noqa: S311 # nosec B311
114+ w = random .choice (word_list ) # noqa: S311 # nosec B311 # NOSONAR
115115 words .append (w )
116116
117117 if output_str :
@@ -185,7 +185,7 @@ def gen_sentence(
185185 """
186186 if not start_seq :
187187 # Non-cryptographic use, pseudo-random generator is acceptable here
188- start_seq = random .choice (self .words ) # noqa: S311 # nosec B311
188+ start_seq = random .choice (self .words ) # noqa: S311 # nosec B311 # NOSONAR
189189 late_word = start_seq
190190 list_word = []
191191 list_word .append (start_seq )
@@ -204,7 +204,7 @@ def gen_sentence(
204204 if len (p2 ) == 0 :
205205 break
206206 # Non-cryptographic use, pseudo-random generator is acceptable here
207- items = temp [probs .index (random .choice (p2 ))] # noqa: S311 # nosec B311
207+ items = temp [probs .index (random .choice (p2 ))] # noqa: S311 # nosec B311 # NOSONAR
208208 late_word = items [- 1 ]
209209 list_word .append (late_word )
210210
@@ -288,7 +288,7 @@ def gen_sentence(
288288 late_word : Union [str , tuple [str , str ]]
289289 if not start_seq :
290290 # Non-cryptographic use, pseudo-random generator is acceptable here
291- start_seq = random .choice (self .bi_keys ) # noqa: S311 # nosec B311
291+ start_seq = random .choice (self .bi_keys ) # noqa: S311 # nosec B311 # NOSONAR
292292 late_word = start_seq
293293 list_word : list [Union [str , tuple [str , str ]]] = []
294294 list_word .append (start_seq )
@@ -307,7 +307,7 @@ def gen_sentence(
307307 if len (p2 ) == 0 :
308308 break
309309 # Non-cryptographic use, pseudo-random generator is acceptable here
310- items = temp [probs .index (random .choice (p2 ))] # noqa: S311 # nosec B311
310+ items = temp [probs .index (random .choice (p2 ))] # noqa: S311 # nosec B311 # NOSONAR
311311 late_word = items [1 :]
312312 list_word .append (late_word )
313313
0 commit comments