示例#1
0
def test_Bebop():
    b = Bebop()

    assert isinstance(b, Bebop)
    assert Bebop.__base__ == object

    with pytest.raises(KeyError):
        b.use(Bebop)

    b = Bebop()

    code = Code((b.opcode['swap_top2'], ))
    core = Core(code, stack=[Block.new_integer(19), Block.new_integer(21)])

    assert core.all_right
    assert core.stack[-1].data == 21

    ret, = core

    assert core.all_right
    assert core.stack[-1].data == 19

    assert isinstance(ret, Block)
    assert ret.type == Block.type_integer
    assert ret.data == 19

    core = Core(code)

    ret, = core

    assert core.all_right is False
    assert core.error_msg == 'swap_top2() with less than two'

    assert isinstance(ret, Block)
    assert ret.type == Block.type_error
    assert ret.data == 'swap_top2() with less than two'

    code = Code((b.opcode['get_answer'], ))
    core = Core(code)

    core.register['answer'] = Block.new_integer(37)

    ret, = core

    assert core.all_right
    assert core.stack[-1].data == 37

    assert isinstance(ret, Block)
    assert ret.type == Block.type_integer
    assert ret.data == 37
示例#2
0
    def multicore_run_all(self, code, ignore_ret_type=False):
        """
		Runs a code item (possibly after many others without clearing).
		"""
        stacks = self.multicore_state['stacks']
        registers = self.multicore_state['registers']
        pic_lists = self.multicore_state['pic_lists']

        for stack, register, pic_list in zip(stacks, registers, pic_lists):
            core = Core(code, stack, register)

            try:
                *_, ret = core

            except Exception:
                return Block.new_error('Try/catch caught an exception')

            if ret.type == Block.type_error or not core.all_right:
                return ret

            if ret.type == Block.type_picture:
                pic_list.append(ret)
            elif not ignore_ret_type:
                return Block.new_error('Code item does not return a picture')

            stack = core.stack
            register = core.register

        return Block(None, Block.type_no_error)
示例#3
0
 def __init__(self, filename):
     infantry = unit_w.Unit('data\\units\\infantry.txt')
     marines = unit_w.Unit('data\\units\\marines.txt')
     mob_infantry = unit_w.Unit('data\\units\\mobinf.txt')
     tank = unit_w.Unit('data\\units\\tank.txt')
     artillery = unit_w.Unit('data\\units\\artillery.txt')
     filename = ('data\\battle_maps\\' + str(filename))
     self.core = Core()
     self.units_list = [infantry, marines, mob_infantry, tank, artillery]
     self.hp_last1 = [
         infantry.get_abil('xp', 0),
         marines.get_abil('xp', 0),
         mob_infantry.get_abil('xp', 0),
         tank.get_abil('xp', 0),
         artillery.get_abil('xp', 0)
     ]
     self.hp_last2 = copy.copy(self.hp_last1)
     self.move_last1 = [
         infantry.get_abil('move', 0),
         marines.get_abil('move', 0),
         mob_infantry.get_abil('move', 0),
         tank.get_abil('move', 0),
         artillery.get_abil('move', 0)
     ]
     self.move_last2 = copy.copy(self.move_last1)
     self.cells_list = self.core.load_battle_cells(filename)
     self.coord_army1 = self.get_army_coords(0)
     self.coord_army2 = self.get_army_coords(1)
示例#4
0
	def run(self, code, relation=None, peek_answer=False):
		"""
		Runs code over the data of a relation instance.

		If relation argument is given, the relation is assumed to be a Block of type tuple with the first two elements being
		the from and to Kind instances and possibly more elements. The instances are pushed to the stack by this method.

		Optionally, an initial stack can be given.

		It returns the top of the stack after the last code block (or last executed block on error) is run. All possible errors
		force this to be a Block of type_error. No valid programs can return a type_error.
		"""

		core = Core(code)

		if relation is not None:
			question, answer, is_test = relation.data

			core.register['question'] = question

			if peek_answer or not is_test:
				core.register['answer']	= answer

		*_, ret = core

		return ret
示例#5
0
def main():
    map = Map()
    try:
        map.get_random_map(MAPS_PATH)
    except MapError as e:
        print("Map error:", e)
        exit(FAILURE)  # TODO: Handle multiple map loading retries etc...
    core = Core(map)
    core.run()
示例#6
0
def custom():
    ''' This is strictly for testing, invoke with -c, --custom'''

    c = Core()
    b = Brain(c)

    print(c.get_data(["AAPL", "GOOG"], "day", limit=20))

    rsi = b.RSI("ROKU", timeframe="15Min")
    print(rsi)
示例#7
0
 def _get_cores(self):
     cores = []
     i = 0
     while True:
         if exists(f'/sys/devices/system/cpu/cpu{i}'):
             cores.append(Core(i))
             i += 1
         else:
             break
     return cores
示例#8
0
    def live_button(self):
        """
        Action triggered when the 'live' button is pressed
        """
        self.dockwidget.liveButton.setEnabled(False)

        # if no layer do nothing
        if not self.dockwidget.checkBoxCorrected.isChecked():
            if not self.dockwidget.checkBoxDifference.isChecked():
                if not self.dockwidget.checkBoxBrut.isChecked():
                    ErrorWindow("Erreur selection couche", "Veillez selectionner une couche avant de continuer",
                                "critical")
                    #enable live_button
                    self.dockwidget.liveButton.setEnabled(True)
                    return

        # init core
        if self.core is None:
            # Get the current database selection (in the UI selector)
            selected = self.dockwidget.databaseSelector.currentText()
            if selected == "":
                ErrorWindow("Erreur selection base de donnees",
                            "Veillez selectionner une base de donnees avant de valider",
                            "information")

                # enable live_button
                self.dockwidget.liveButton.setEnabled(True)
                return

            # Construct the @Core class (Main Class)
            # The Class need the global information of the database
            # The Class need to manipulate layers so a reference to the interface (iface) is required
            self.core = Core(
                self.database_connection.value(selected + '/host'),
                self.database_connection.value(selected + '/port'),
                self.database_connection.value(selected + '/username'),
                self.database_connection.value(selected + '/password'),
                self.database_connection.value(selected + '/database'),
                self.iface
            )

        self.core.connect_init()

        self.update_layer_list()
        print("live -> stop")
        # unbind live event
        self.dockwidget.liveButton.clicked.disconnect(self.live_button)
        # change text
        self.dockwidget.liveButton.setText("Stop")
        # bind stop event
        self.dockwidget.liveButton.clicked.connect(self.stop_button)
        # enable liveButton
        self.dockwidget.liveButton.setEnabled(True)
        # disable resetButton
        self.dockwidget.resetButton.setEnabled(False)
示例#9
0
    def generate_random_core(self, cores, upper_time_delay):
        for i in range(1, cores + 1, 1):
            sid = self.generate_unique_sid()
            name = self.generate_random_name(10)
            start_time = self.generate_start_time()
            time.sleep(random.randrange(1, upper_time_delay + 1, 1))
            end_time = self.generate_end_time()

            core = Core(sid, name, start_time, end_time)
            self.core_list.append(core)
            print(core)
示例#10
0
def main():
    clock = threading.Event()
    memory = Memory()
    bus = Bus(memory)
    cores = [Core(1, bus), Core(2, bus), Core(3, bus), Core(4, bus)]
    bus.set_cores(cores)

    core_threads = []
    for core in cores:
        thread = threading.Thread(target=core.processor.run, args=(clock, ))
        thread.start()
        core_threads.append(thread)
    mem_thread = threading.Thread(target=memory.run, args=(clock, ))
    mem_thread.start()

    os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1"
    QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
    app = QApplication(sys.argv)
    window = Window(clock, cores, memory)
    sys.exit(app.exec_())
 def __init__(self, action):
     core = Core()
     if (not action):
         core.sectionMenu()
     else:
         params = self.getParameters(action)
         get = params.get
         if hasattr(core, get("action")):
             getattr(core, get("action"))(params)
         else:
             core.sectionMenu()
示例#12
0
    def __init__(self, hilillos_to_run, quantum):

        self.__pcb = PCBDataStructure()
        self.threads_barrier = Barrier(2)
        self.__dead_barrier = False
        self.__killing_lock = Lock()  # Lock used to kill the barrier
        self.__waiting_lock = Lock()
        self.__system_main_memory = MainMemory(self.__pcb, hilillos_to_run)
        self.__simulation_statistics = SimulationStatistics()
        self.__core0 = Core(0, self)
        self.__core1 = Core(1, self)
        self.__core_count = 2
        self.running_cores = 2
        self.__system_clock = 0
        self.__default_quantum = quantum
        self.__core_finished = False
        self.__core_finished_counter = 0

        # Data buss, instruction buss, cache 0, cache 1
        self.__locks = [Lock(), Lock(), Lock(), Lock()]
        self.__lock_owner = [-1, -1, -1, -1]
示例#13
0
 def __init__(self,map_name):
     pygame.init()
     self.core = Core()
     self.mode = Event_Handler()
     self.file = 'ingame_temp'#заміна self.file в Core.py
     #self.map_type - треба замінити в Core.py
     #self.x_coord_start self.x_coord_end - замінити в Core.py
     self.battle = Battle('1')
     self.resources = Resources()
     self.graphical_logic = Graphical_logic()
     self.w_event = Events()
     self.minimap_x =0
     self.minimap_y =0
     self.count = 0
     self.days = 0
     self.fraction = 1 # першими ходять червоні
     self.map_name = map_name
     self.stage = 0
     self.save_load_name = ''
     self.fractions = [[1, 1, 0, 0, 3, 1],[2, 1, 0, 0, 0, 0]]
示例#14
0
def main():
    # Clear Screen
    cls()
    print(
        "+==================================================================+")
    print(
        "‖  Intelligent S3 Upload                                           ‖")
    print(
        "+==================================================================+")

    # Check Python Version
    if sys.version_info[0] < 3:
        print("Python 3 required to run this application")
        sys.exit()

    # Parse Arguments
    args = parse_args()

    try:
        # Store the Start Time
        start_time = time()

        # Load & Validate Credentials
        credentials = load_credentials()
        validate_credentials(credentials)

        # Init Core Class
        core = Core(credentials, args.path)

        # Start Uploading Process
        core.upload()

    except Exception as e:
        print(e)
    except KeyboardInterrupt as e:
        print("\n- Upload process interrupted.")
        if len(str(e)) != 0:
            print("- Total bytes uploaded: {}".format(e))
    finally:
        overall_time = str(timedelta(seconds=time() - start_time))
        print("- Overall Time: {}".format(overall_time))
示例#15
0
def main():
    # Clear Screen
    cls()
    print("+==================================================================+")
    print("‖  Intelligent S3 Upload                                           ‖")
    print("+==================================================================+")

    # Parse Arguments
    args = parse_args()

    # Execution Status & Error
    status = 0  # 0: SUCCESS | 1: INTERRUPTED | 2: ERROR
    error = None

    try:
        # Store the Start Time
        start_time = time.time()

        # Load & Validate Credentials
        credentials = load_credentials()
        validate_credentials(credentials)

        # Init Core Class
        core = Core(credentials, args.path)  

        # Start Uploading Process
        core.upload()

    except Exception as e:
        status = 2
        error = str(e)
    except KeyboardInterrupt as e:
        status = 1
        print("\n- Upload process interrupted.")
        if len(str(e)) != 0:
            print("- Total bytes uploaded: {}".format(e))
    finally:
        overall_time = str(timedelta(seconds=time.time() - start_time))
        print("- Overall Time: {}".format(overall_time))
        if credentials['slack_url']:
            slack(credentials['slack_url'], overall_time, status, error)
示例#16
0
    def build_code_base(output_fn, context):
        """
		Outermost method building everything from scratch.
		"""

        cd_base = CodeBase()
        field = Field(Example)
        solved = Search.solved_problems()

        for name in solved.keys():
            source = solved[name]
            code = field.compile(source)
            x_code = Code(code.data + (BopBack.bopback_tests_verify_answer, ))

            problem = context.get_problem_startswith(name)

            for example in problem:
                core = Core(x_code)

                question, answer, _ = example.data

                q_copy = question.data.copy()
                a_copy = answer.data.copy()

                core.register['question'] = question
                core.register['answer'] = answer

                *_, ret = core

                assert isinstance(ret, Block)
                assert ret.type == Block.type_integer
                assert isinstance(ret.data, int)

                assert ret.data == 1

                assert np.array_equal(q_copy, core.register['question'].data)
                assert np.array_equal(a_copy, core.register['answer'].data)

            cd_base.add(code, source, name, question)

        cd_base.save(output_fn)
示例#17
0
def test_successful_end_to_end():
    ctx = Context('data')
    prb = ctx.get_problem_startswith('496994bd')

    code = Code(
        (Bebop.bebop_get_question, BopForward.bopforward_pic_all_as_pat,
         BopForward.bopforward_pat_flip_up_down, Bebop.bebop_get_question,
         BopForward.bopforward_pic_all_as_pat,
         BopForward.bopforward_2pat_merge_as_pic))

    for example in prb:
        q, a, _ = example.data

        core = Core(code)
        core.register['question'] = q

        *_, last_block = core

        assert core.all_right
        assert len(core.stack) == 1
        assert isinstance(last_block, Block)
        assert last_block.type == Block.type_picture

        assert np.array_equal(last_block.data, a.data)
示例#18
0
from Core import Core
from trading_api_wrappers import Buda

cr = Core()


class Order():
    orderList = None

    def new(self, inMkt, inType, inLimit, inAmount):
        try:
            buda = Buda.Auth(cr.k, cr.s)
            res = buda.new_order(inMkt, inType, "limit", inLimit, inAmount)

        except Exception:
            pass

    def cancel(self, orderId):
        try:
            buda = Buda.Auth(cr.k, cr.s)
            buda.cancel_order(orderId)
        except Exception:
            pass

    def myOrders(self, inMkt, inStatus):
        try:
            buda = Buda.Auth(cr.k, cr.s)
            self.orderList = buda.order_pages(inMkt, None, None, inStatus)

        except Exception:
            pass
示例#19
0
#!/usr/bin/env python3

import time
import sys
from Core import Core

if __name__ == "__main__":
    try:
        Handler = Core(
            sys.argv[1]
        )  # Creates Handler object 'dbname' is passed as command-line argument
        if Handler.status == "Initialized":
            Handler.startHandle()  # Starts handeling of all locks and buttons
            print("Started " + time.ctime())
            while True:  # Updates every Xseconds - passed as command-line argument
                time.sleep(float(sys.argv[2]))
                Handler.update()  # after the time calls 'update' method
                print("Updated " + time.ctime())
        elif Handler.status == "Error":
            sys.exit()
    except IndexError:  # Occurs when there are not passed all command-line arguments
        print(
            "ERROR\nNo database or update time specified\nusage: sudo python3 Main.py <dbname> <seconds>"
        )
        sys.exit()

    except Exception as err:  # Uknown error
        print(err)
        print("EXCEPTION")
        Handler.DB.close()
        time.sleep(2)
示例#20
0
文件: __init__.py 项目: zhangqb/rs
def main():

    args = Args().get_args()
    Core(args).recommend()
示例#21
0
from TestConfig import BASE_URL, IMPOSSIBLE_URL
from Core import Core
from CyFailedCIError import CyFailedCIError
from requests.status_codes import codes
""" Built from http://pyunit.sourceforge.net/pyunit.html """

import unittest

resourceErrorRoot = "urn:cytoscape:ci:copycatLayout-app:v1"

_copyLayout = CopyLayout(
    CyRESTInstance(base_url=BASE_URL))  # assumes Cytoscape answers at base_url
_bad_copyLayout = CopyLayout(CyRESTInstance(
    base_url=IMPOSSIBLE_URL))  # # for verifying proper exception thrown

_core = Core(
    CyRESTInstance(base_url=BASE_URL))  # assumes Cytoscape answers at base_url


class CopyLayoutTestCase(unittest.TestCase):
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def get_network_view_suids(self):
        viewSUIDs = []
        netSUIDs = _core._cy_caller.execute_get('/v1/networks')
        for suid in netSUIDs:
            viewSUIDs.extend(
                _core._cy_caller.execute_get('/v1/networks/%d/views' % suid))
示例#22
0
from File_Write import File_Write
from File_Read import File_Read
from Core import Core


def main():
    try:
        # Read text from file
        _File_Read.File_R()
        for URL in set(_File_Read._File_Read__URL):
            _Core.URL(URL)
        # Write text to file
        _File_Write.File_W(set(_Core._Core__Emails))
    except Exception:
        pass


if __name__ == "__main__":
    _File_Write = File_Write()
    _File_Read = File_Read()
    _Core = Core()
    print(" ___                       ___     ___  __        __  ___  __   __")
    print("|__   |\/|  /\  | |    __ |__  \_/  |  |__)  /\  /  `  |  /  \ |__)")
    print("|___  |  | /~~\ | |___    |___ / \  |  |  \ /~~\ \__,  |  \__/ |  \ \n")
    main()
示例#23
0
 def add_from_array(self, tau, Sv, n_nh3, Tex, Tk, intensity, mass, density,
                    loc, types):
     for i in range(len(tau)):
         new_core = Core(tau[i], Sv[i], n_nh3[i], Tex[i], Tk[i],
                         intensity[i], mass[i], density[i], loc, types[i])
         self.add_core(new_core)
 def core(self):
     core = Core(self.user)
     core.routine()
示例#25
0
    parser.add_argument('--critic_node1', default=10, type=int)
    parser.add_argument('--critic_node2', default=5, type=int)
    parser.add_argument('--lr_actor', default=0.01, type=float)
    parser.add_argument('--lr_critic', default=0.01, type=float)
    parser.add_argument('--tau', default=0.001, type=float)
    parser.add_argument('--gamma', default=0.9, type=float)
    parser.add_argument('--epsilon', default=0.95, type=float)
    parser.add_argument('--buffer_size', default=1000, type=int)
    parser.add_argument('--batch_size', default=100, type=int)
    parser.add_argument('--random_seed', default=2, type=int)
    parser.add_argument('--folder', default='Data', type=str)
    parser.add_argument('--name', default='Exp1', type=str)
    parser.add_argument('--train_iteration', default=300000, type=int)
    parser.add_argument('--valid_iteration', default=2000, type=int)
    parser.add_argument('--device', default=None)
    args = parser.parse_args()

    if args.random_seed > 0:
        random.seed(args.random_seed)
        np.random.seed(args.random_seed)
        torch.manual_seed(args.random_seed)

    env = Env(args.trade)

    if torch.cuda.is_available():
        args.device = torch.device('cuda:0')

    agent = Core(env.state_dim, env.action_dim, env.message_num, env.channel_num, args)
    train(args.train_iteration, agent, env)
    # valid(args.valid_iteration, agent, env)
示例#26
0
    if args.debug:
        l = logging.DEBUG
    if args.quiet:
        l = logging.CRITICAL

    if args.output:
        logging.basicConfig(filename=args.output, level=l)
    else:
        logging.basicConfig(stream=stderr, level=l)

    time_period = None
    minutes = 1  # DEFAULT - USE MINUTE BARS
    if args.timeframe:
        try:
            minutes = int(args.timeframe)
        except:
            logging.critical(
                "Please enter an integer for minutes. Exiting....")
            exit()
        if minutes < 1 or minutes > 1440:
            logging.critical(
                "Please enter a number of minutes between 1 and 1440. Exiting...."
            )
            exit()

    core = Core()
    brain = Brain(core)

    platform = Platform(core, brain, minutes)
    platform.run()
示例#27
0
import cv2 as cv2
import asyncio

from Core import Core

if __name__ == '__main__':

    imgParser = Core()
    imgParser.readFile("cactusmic.png")

    asyncio.run(imgParser.parseImg())
    imgParser.showImg()

    cv2.waitKey()
示例#28
0
文件: main.py 项目: JpRod96/TLSB
from SignClassifier import MLPSignClassifier
import sys
sys.path.insert(0, 'D:/desktop/TLSB/PersonDetector/PersonDetector')
from HaarCascadeProcessor import HaarCascadeProcessor

haar = HaarCascadeProcessor()
classifier_path = "D:/desktop/TLSB/FirstPyNN/FirstPyNN/MLP/results/nuevasSeñas/sigmoidal/una capa/4/40aug/bestModel78.h5"

raro = "D://desktop//TLSB//FirstPyNN//FirstPyNN//MLP//results//primer intento/bestModel80.h5"

POR_FAVOR = "D:/desktop/DATASET/2/POR_FAVOR/20191018_105014.mp4"
CAFE = "D:/desktop/DATASET/2/CAFE/20191018_104918.mp4"
HOLA = "D:/desktop/DATASET/2/HOLA/20191018_104850.mp4"
QUERER = "D:/desktop/DATASET/2/QUERER/20191018_105443.mp4"
CBBA = "D:/desktop/DATASET/CBBA/20190812_160520.mp4"
classifier = MLPSignClassifier(classifier_path)
proc = ImageProcessor(300,
                      0,
                      process_type=ImageProcessor.BLURRY_EDGES,
                      kernel_height=3,
                      kernel_width=3)
core = Core(Core.FROM_PATH,
            path=HOLA,
            image_processor=proc,
            classifier=classifier,
            debug=True,
            duplicate=True)

core.start()
#core.capture_from_camera(haar)
示例#29
0
#Author: Martín Manuel Gómez Míguez
#GitHub: @Correlo
#Date: 03/04/2020

from configparser import ConfigParser

#Modules of the developer
from Core import Core

#Read params.ini
params = ConfigParser()
params.sections()
params.read('params.ini')

#List of fields
fields = list(dict(params).keys())
#List of lenses
lenses = [elem for elem in fields if elem[0] == 'L']

#Main parte of the code
for lens in lenses:
    print()
    print('Obtaining ', lens)
    Core(params, lens)

print()
print('All the lenses were created successfully!')


示例#30
0
def test_instance_everything():
	a = Answer([[1, 0], [0, 1]])
	assert isinstance(a, Answer)
	assert Answer.__base__ == Block
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = Bebop()
	assert isinstance(a, Bebop)
	assert Bebop.__base__ == object
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = Block('hello', Block.type_error)
	assert isinstance(a, Block)
	assert Block.__base__ == object
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = Bond(None, None)
	assert isinstance(a, Bond)
	assert Bond.__base__ == Block
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = BopBack()
	assert isinstance(a, BopBack)
	assert BopBack.__base__ == object
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = BopForward()
	assert isinstance(a, BopForward)
	assert BopForward.__base__ == object
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = Code((Function(len, [Block.type_picture], Block.type_picture), Function(len, [Block.type_picture], Block.type_picture)))
	assert isinstance(a, Code)
	assert Code.__base__ == Block
	with pytest.raises(AttributeError):
		_ = a.__base__

	code = a

	a = CodeBase()
	assert isinstance(a, CodeBase)
	assert CodeBase.__base__ == Container
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = CodeEval(Example)
	assert isinstance(a, CodeEval)
	assert CodeEval.__base__ == Field
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = CodeGen(None, None, Example)
	assert isinstance(a, CodeGen)
	assert CodeGen.__base__ == CodeTree
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = CodeTree(None, Example)
	assert isinstance(a, CodeTree)
	assert CodeTree.__base__ == CodeEval
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = Core(code, [Block.new_picture(list_of_list=[[3, 2], [2, 3]])])
	assert isinstance(a, Core)
	assert Core.__base__ == Block
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = Container()
	assert isinstance(a, Container)
	assert Container.__base__ == object
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = Context()
	assert isinstance(a, Context)
	assert Context.__base__ == Container
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = Example([[3, 2], [2, 3]], [[1, 0], [0, 1]], False)
	assert isinstance(a, Example)
	assert Example.__base__ == Bond
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = Field(Example)
	assert isinstance(a, Field)
	assert Field.__base__ == Bebop
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = Function(len, Block.type_nothing, Block.type_nothing)
	assert isinstance(a, Function)
	assert Function.__base__ == Block
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = MCTS(None, None, Example)
	assert isinstance(a, MCTS)
	assert MCTS.__base__ == CodeGen
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = MctsNode()
	assert isinstance(a, MctsNode)
	assert MctsNode.__base__ == object
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = Problem()
	assert isinstance(a, Problem)
	assert Problem.__base__ == Container
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = Question([[3, 2], [2, 3]])
	assert isinstance(a, Question)
	assert Question.__base__ == Block
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = Search()
	assert isinstance(a, Search)
	assert Search.__base__ == object
	with pytest.raises(AttributeError):
		_ = a.__base__

	a = Source(('nop'))
	assert isinstance(a, Source)
	assert Source.__base__ == Block
	with pytest.raises(AttributeError):
		_ = a.__base__