def check_target_serial_port():
    arduino_settings = settings.get_arduino_settings()
    serial_ports = list_serial_ports()
    target_serial_port = arduino_settings.get('serial_port', 'no_serial')
    if serial_ports and not target_serial_port in serial_ports:
        target_serial_port = serial_ports[0]
        arduino_settings.set('serial_port', target_serial_port)
    return target_serial_port
dataset/ETHPy150Open Robot-Will/Stino/stino/pyarduino/base/serial_port.py/check_target_serial_port/original