<gh_stars>0
import pyvisa
def find_instruments():
    rm = pyvisa.ResourceManager()
    instruments = rm.list_resources()
    return {'usb':[i for i in instruments if 'USB' in i],
            'gpib':[i for i in instruments if 'GPIB' in i],
            'serial':[i for i in instruments if 'ASRL' in i]}

def play_star_wars(smu):
    c, d, e, f, g, a, b, c5, d5, e5, f5, g5, pause = 262, 294, 330, 349, 392, 440, 494, 523, 587, 659, 689, 783, 0

    TAB_DURATION = 1
    star_wars = (
        (1, c),
        (1, g),
        (1/6, f),
        (1/6, e),
        (1/6, d),
        (1, c5),
        (1/2, g),
        (1/6, f),
        (1/6, e),
        (1/6, d),
        (1, c5),
        (1/2, g),
        (1/6, f),
        (1/6, e),
        (1/6, f),
        (2, d),
        (1/6, c),
        (1/16, pause),
        (1/6, c),
        (1/16, pause),
        (1, c),
        (1, g),
        (1/6, f),
        (1/6, e),
        (1/6, d),
        (1, c5),
        (1/2, g),
        (1/6, f),
        (1/6, e),
        (1/6, d),
        (1, c5),
        (1/2, g),
        (1/6, f),
        (1/6, e),
        (1/6, f),
        (2, d),
    )

    for duration, freq in star_wars:
        smu.write(f'beeper.beep({duration*TAB_DURATION}, {freq})')

import pyvisa
def find_instruments():
    rm = pyvisa.ResourceManager()
    instruments = rm.list_resources()
    return {'usb':[i for i in instruments if 'USB' in i],
            'gpib':[i for i in instruments if 'GPIB' in i],
            'serial':[i for i in instruments if 'ASRL' in i]}

def play_star_wars(smu):
    c, d, e, f, g, a, b, c5, d5, e5, f5, g5, pause = 262, 294, 330, 349, 392, 440, 494, 523, 587, 659, 689, 783, 0

    TAB_DURATION = 1
    star_wars = (
        (1, c),
        (1, g),
        (1/6, f),
        (1/6, e),
        (1/6, d),
        (1, c5),
        (1/2, g),
        (1/6, f),
        (1/6, e),
        (1/6, d),
        (1, c5),
        (1/2, g),
        (1/6, f),
        (1/6, e),
        (1/6, f),
        (2, d),
        (1/6, c),
        (1/16, pause),
        (1/6, c),
        (1/16, pause),
        (1, c),
        (1, g),
        (1/6, f),
        (1/6, e),
        (1/6, d),
        (1, c5),
        (1/2, g),
        (1/6, f),
        (1/6, e),
        (1/6, d),
        (1, c5),
        (1/2, g),
        (1/6, f),
        (1/6, e),
        (1/6, f),
        (2, d),
    )

    for duration, freq in star_wars:
        smu.write(f'beeper.beep({duration*TAB_DURATION}, {freq})')