A real hacky way to convert Python code to Ruby