def BeforeUpload(target, source, env):  # pylint: disable=W0613,W0621

    if "program" in COMMAND_LINE_TARGETS:
        return

    env.AutodetectUploadPort()
    env.Prepend(UPLOADERFLAGS=['"$UPLOAD_PORT"'])

    if env.get("BOARD_OPTIONS", {}).get("upload", {}).get(
            "use_1200bps_touch", False):
        env.TouchSerialPort("$UPLOAD_PORT", 1200)
dataset/ETHPy150Open platformio/platformio/platformio/builder/scripts/intel_arc32.py/BeforeUpload/original