fix js -> python translation