This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import gym | |
import numpy as np | |
import pygad.torchga | |
import pygad | |
import torch | |
import torch.nn as nn | |
from multiprocessing import Pool | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# # Jeżeli poprzednia sesja sobie wisi np. na stronie wymagającej potwierdzenia | |
# # jej opuszczenia, to będzie problem, stąd: | |
# browser.execute_script("window.onbeforeunload = function() {};") | |
# | |
# def close_all_popups(driver): | |
# for h in driver.window_handles[1:]: | |
# driver.switch_to_window(h) | |
# driver.close() | |
# driver.switch_to_window(driver.window_handles[0]) | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
# save me as yourapp/management/commands/upload_file_to_model.py | |
from argparse import FileType | |
from pathlib import Path | |
from django.contrib.contenttypes.models import ContentType | |
from django.core.management.base import BaseCommand | |
from django.core.files.base import File |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def clickButtonBuggyMarionetteDriver(browser, id): | |
try: | |
browser.execute_script("$('#" + id + "').click()") | |
except WebDriverException, e: | |
if e.msg.startswith("Failed to find value field"): | |
pass | |
else: | |
raise e |