@@ -33,14 +33,14 @@ class SimpleFunction(typing.NamedTuple):
3333
3434def str_pieces (in_str : str , in_pieces_len : list [int ]) -> Strings :
3535 """returns in_str split into pieces of lengths as in in_pieces_len"""
36- assert all (_ > 0 for _ in in_pieces_len )
37- assert sum (in_pieces_len ) == len (in_str )
36+ assert all (_ > 0 for _ in in_pieces_len ) # nosec B101
37+ assert sum (in_pieces_len ) == len (in_str ) # nosec B101
3838 cur_str = in_str
3939 res = []
4040 for _ in in_pieces_len :
4141 res .append (cur_str [:_ ])
4242 cur_str = cur_str [_ :]
43- assert "" .join (res ) == in_str
43+ assert "" .join (res ) == in_str # nosec B101
4444 return res
4545
4646
@@ -49,11 +49,11 @@ def random_pieces_len(in_total_len: int) -> list[int]:
4949 cur_num = in_total_len
5050 res = []
5151 while cur_num > 0 :
52- tmp_len = random .randint (1 , max (cur_num , 1 ))
52+ tmp_len = random .randint (1 , max (cur_num , 1 )) # nosec B311
5353 res .append (tmp_len )
5454 cur_num -= tmp_len
5555 random .shuffle (res )
56- assert sum (res ) == in_total_len
56+ assert sum (res ) == in_total_len # nosec B101
5757 return res
5858
5959
@@ -63,7 +63,7 @@ def random_split(in_str: str) -> Strings:
6363
6464
6565def _interesting_random_split (in_str : str ) -> Strings :
66- assert len (in_str ) > 1
66+ assert len (in_str ) > 1 # nosec B101
6767 res = random_split (in_str )
6868 while len (res ) == 1 :
6969 res = random_split (in_str )
@@ -114,12 +114,14 @@ def __init__(self, initial_call: InitialCall, needed_functions: SimpleFunctions)
114114
115115 def _check_data (self ) -> None :
116116 if self .initial_call is not None and not isinstance (self .initial_call , Atom ):
117- assert self .needed_functions
117+ assert self .needed_functions # nosec B101
118118 if self .needed_functions :
119- assert isinstance (self .initial_call , int )
120- assert self .initial_call + 1 == len (self .needed_functions )
119+ assert isinstance (self .initial_call , int ) # nosec B101
120+ assert self .initial_call + 1 == len (self .needed_functions ) # nosec B101
121121 for fun_id , fun in enumerate (self .needed_functions ):
122- assert all (_ < fun_id for _ in fun .called_list if not isinstance (_ , Atom ))
122+ assert all (
123+ _ < fun_id for _ in fun .called_list if not isinstance (_ , Atom )
124+ ) # nosec B101
123125
124126 def needed_function_definitions_str_list (
125127 self , in_function_to_str , ** kwargs
0 commit comments