| 32 | return False |
| 33 | |
| 34 | def __order_first_b(a:List[str], b:List[str], text): |
| 35 | # make sure that all a happens after b in text |
| 36 | # a: change balance |
| 37 | # b: change interest, a should happen after b |
| 38 | |
| 39 | # if any is empty, return false |
| 40 | if len(a) == 0 or len(b) == 0: |
| 41 | return False |
| 42 | |
| 43 | # if a and b point to the same statement, return false |
| 44 | if len(a) == 1 and len(b) == 1: |
| 45 | stmt_a = a[0] |
| 46 | stmt_b = b[0] |
| 47 | if stmt_a in stmt_b or stmt_b in stmt_a: |
| 48 | return False |
| 49 | |
| 50 | # if a or b are not in the text, return false |
| 51 | text_has_a_flag = False |
| 52 | text_has_b_flag = False |
| 53 | |
| 54 | for a_var in a: |
| 55 | if a_var in text: |
| 56 | text_has_a_flag = True |
| 57 | break |
| 58 | for b_var in b: |
| 59 | if b_var in text: |
| 60 | text_has_b_flag = True |
| 61 | break |
| 62 | if not text_has_a_flag or not text_has_b_flag: |
| 63 | return False |
| 64 | |
| 65 | # if exist a happens before b, return false |
| 66 | for a_var in a: |
| 67 | for b_var in b: |
| 68 | if a_var in text and b_var in text: |
| 69 | try: |
| 70 | if text.index(a_var) < text.index(b_var): |
| 71 | return True |
| 72 | except: |
| 73 | continue |
| 74 | |
| 75 | # if all a happens after b, return true |
| 76 | return False |
| 77 | |
| 78 | def __call_arg_check(function:str, arg:str, text:str): |
| 79 | if function not in text: |