{"task": {"agent_timeout": 1800, "task": "781", "verifier_timeout": 1800, "instruction": "# 781: DS-1000 Task\n\n## Prompt\nProblem:\nI'm searching for examples of using scipy.optimize.line_search. I do not really understand how this function works with multivariable functions. I wrote a simple example\nimport scipy as sp\nimport scipy.optimize\ndef test_func(x):\n    return (x[0])**2+(x[1])**2\n\ndef test_grad(x):\n    return [2*x[0],2*x[1]]\n\nsp.optimize.line_search(test_func,test_grad,[1.8,1.7],[-1.0,-1.0])\nAnd I've got\nFile \"D:\\Anaconda2\\lib\\site-packages\\scipy\\optimize\\linesearch.py\", line 259, in phi\nreturn f(xk + alpha * pk, *args)\nTypeError: can't multiply sequence by non-int of type 'float'\nThe result should be the alpha value of line_search\nA:\n<code>\nimport scipy\nimport scipy.optimize\nimport numpy as np\ndef test_func(x):\n    return (x[0])**2+(x[1])**2\n\ndef test_grad(x):\n    return [2*x[0],2*x[1]]\nstarting_point = [1.8, 1.7]\ndirection = [-1, -1]\n</code>\nresult = ... # put solution in this variable\nBEGIN SOLUTION\n<code>\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": []}