WeixuanZ / flood-warning-system

Re-defined variable from outer scope PYL-W0621
Anti-pattern
Major
2 occurrences in this check
Redefining name 'i' from outer scope (line 342)
511    def prediction_func():
512        """Function that wraps the prediction code."""
513        predict_plots = []
514        for i, station in enumerate(highrisk_stations):515            try:
516                date, level = predict(
517                    station.name,
Redefining name 'predicting_text' from outer scope (line 251)
543            predict_plot.plot_height = 400
544            predict_plot.sizing_mode = "scale_width"
545            predict_plots.append(Panel(child=predict_plot, title=station.name))
546            predicting_text = Div(547                text="<p><i>Prediction is running... {:.0%}</i></p>".format(i / 6)
548            )
549            doc.add_next_tick_callback(