@app_manager.command
def set_switch_machines():
    if not flags.OPTIONS.switch_machines_file:
        print 'flag --switch_machines_file is missing'
        return
    database.init()
    switches, switch_machines = util.get_switch_machines_from_file(
        flags.OPTIONS.switch_machines_file)
    user = user_api.get_user_object(
        setting.COMPASS_ADMIN_EMAIL
    )
    switch_mapping = {}
    for switch in switches:
        added_switch = switch_api.add_switch(
            False, user=user, **switch
        )
        switch_mapping[switch['ip']] = added_switch['id']
    for switch_ip, machines in switch_machines.items():
        if switch_ip not in switch_mapping:
            print 'switch ip %s not found' % switch_ip
            sys.exit(1)
        switch_id = switch_mapping[switch_ip]
        for machine in machines:
            switch_api.add_switch_machine(
                switch_id, False, user=user, **machine
            )
Call the user's `compute` function on each window with a pre-built
dataset/ETHPy150Open openstack/compass-core/bin/manage_db.py/set_switch_machines--crossover with--dataset/ETHPy150Open quantopian/zipline/zipline/pipeline/mixins.py/CustomTermMixin._compute