Loco-CTO / Rystal-V6-Experiments

Re-defined variable from outer scope PYL-W0621
Anti-pattern
Major
14 days ago2 months old
Redefining name 'output_file' from outer scope (line 200)
140        return won, columns, mega_score, deficient_score
141
142    def run_simulation(
143        self, num_spins: int, output_file, print_results: bool = False144    ) -> tuple[float, float]:
145        """
146        Runs a simulation of the spinner for a given number of spins.
Redefining name 'url' from outer scope (line 44)
36        return False
37
38
39def check_websocket_sync(url):40    return asyncio.get_event_loop().run_until_complete(check_websocket(url))
41
42
Redefining name 'url' from outer scope (line 44)
26import websockets
27
28
29async def check_websocket(url):30    try:
31        async with websockets.connect(url) as websocket:
32            print(f"connected to {url}")
Redefining name 'move' from outer scope (line 515)
466            str: The chosen move (e.g., 'd3'), or None if no valid moves are available.
467        """
468        if self.game.current_turn == "B" and self.ai_player_black:
469            move = self.ai_player_black.choose_move()470            if move is None or not self.ai_player_black.is_valid_move(move):
471                print("AI (Black) has no valid moves.")
472                return None
Redefining name 'move' from outer scope (line 515)
389            Image: The generated board image.
390        """
391        board_copy = [row[:] for row in self.game.board]
392        for move in self.game.get_valid_moves(self.game.current_turn):393            row, col = self.game.position_to_indices(move)
394            board_copy[row][col] = "*"
395        print("  a b c d e f g h\n +----------------")