{"task": {"agent_timeout": 1800, "task": "678", "verifier_timeout": 1800, "instruction": "# 678: DS-1000 Task\n\n## Prompt\nProblem:\nI'm using tensorflow 2.10.0.\nI have a tensor of lengths in tensorflow, let's say it looks like this:\n[4, 3, 5, 2]\n\n\nI wish to create a mask of 1s and 0s whose number of 1s correspond to the entries to this tensor, padded by 0s to a total length of 8. I.e. I want to create this tensor:\n[[1,1,1,1,0,0,0,0],\n [1,1,1,0,0,0,0,0],\n [1,1,1,1,1,0,0,0],\n [1,1,0,0,0,0,0,0]\n]\n\n\nHow might I do this?\n\n\nA:\n<code>\nimport tensorflow as tf\n\nexample_lengths = [4, 3, 5, 2]\ndef f(lengths=example_lengths):\n    # return the solution in this function\n    # result = f(lengths)\n    ### BEGIN SOLUTION\n\n## What to do\n- Edit `solution/solution.py` so the code passes the DS-1000 tests.\n- Do not access the internet or install new packages; required libraries are preinstalled in the Docker image.\n- Run tests locally via `bash tests/test.sh`.\n\n## Notes\n- Keep the variable names/signatures implied by the prompt/code_context.\n- The evaluator uses the original DS-1000 `code_context` (`test_execution` / `test_string`).\n", "memory": "", "runnable": false, "difficulty": "", "language": "", "cpus": "", "instruction_truncated": false, "category": "", "compose": false, "has_solution": true, "oracle": null, "docker_image": "ds1000:latest", "taskset": "ds1000", "tags": []}, "runs": []}