{"task": {"agent_timeout": 1800, "task": "470", "verifier_timeout": 1800, "instruction": "# 470: DS-1000 Task\n\n## Prompt\nProblem:\nnumpy seems to not be a good friend of complex infinities\nHow do I compute mean of an array of complex numbers?\nWhile we can evaluate:\nIn[2]: import numpy as np\nIn[3]: np.mean([1, 2, np.inf])\nOut[3]: inf\nThe following result is more cumbersome:\nIn[4]: np.mean([1 + 0j, 2 + 0j, np.inf + 0j])\nOut[4]: (inf+nan*j)\n...\\_methods.py:80: RuntimeWarning: invalid value encountered in cdouble_scalars\n  ret = ret.dtype.type(ret / rcount)\nI'm not sure the imaginary part make sense to me. But please do comment if I'm wrong.\nAny insight into interacting with complex infinities in numpy?\nA:\n<code>\nimport numpy as np\ndef f(a = np.array([1 + 0j, 2 + 3j, np.inf + 0j])):\n    # return the solution in this function\n    # result = f(a)\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": []}