{"task": {"agent_timeout": 1800, "task": "7", "verifier_timeout": 1800, "instruction": "# 7: DS-1000 Task\n\n## Prompt\nProblem:\nI have a dataset :\nid    url     keep_if_dup\n1     A.com   Yes\n2     A.com   Yes\n3     B.com   No\n4     B.com   No\n5     C.com   No\n\n\nI want to remove duplicates, i.e. keep first occurence of \"url\" field, BUT  keep duplicates if the field \"keep_if_dup\" is YES.\nExpected output :\nid    url     keep_if_dup\n1     A.com   Yes\n2     A.com   Yes\n3     B.com   No\n5     C.com   No\n\n\nWhat I tried :\nDataframe=Dataframe.drop_duplicates(subset='url', keep='first')\n\n\nwhich of course does not take into account \"keep_if_dup\" field. Output is :\nid    url     keep_if_dup\n1     A.com   Yes\n3     B.com   No\n5     C.com   No\n\n\nA:\n<code>\nimport pandas as pd\n\n\ndf = pd.DataFrame({'url': ['A.com', 'A.com', 'A.com', 'B.com', 'B.com', 'C.com', 'B.com'],\n                   'keep_if_dup': ['Yes', 'Yes', 'No', 'No', 'No', 'No', 'Yes']})\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": []}