ReferenceError: set is not defined

URL of experiment: CircleSequencingTask [PsychoPy] (not sure if this will work as its in pilot currently)

Description of the problem:
In my task, the participant must move to different targets in a sequence. In the final block of my task, a list is generated for each target the participant moves to. Each target moved to appends a corresponding number to the list. The trial is stopped when this list gets to 5 items (so when 5 targets have been hit) - see below.

b = list(set(count1)) 
if len(b) == 5:
    continueRoutine = False

On the builder it runs fine with Python, but on Pavlovia it does not work and gives me this error.

I’ve tried to define ‘set’ in different ways, but none have worked. I’ve also tried rewriting the part that does this using JS set functions, but this did not work either. Below are some of the JS defining I have tried, based on things I found online.

var count1 = new set();
let set = new Set();
Set() = [];

Do let me know if you need anything else. Hopefully you can help!

Many thanks

Managed to figure this out, it seems the Python auto translate did not work correctly, so it required tweaking it manually.

I changed the above set code to the below. Not sure how it worked, but it did!

Hopefully this can help someone else.

    const uniqueb = Array.from(new Set(count1));
    if ((uniqueb.length === 5)) {
        continueRoutine = false;