{"input":[{"id":"207adc46","content":"Download all files from a specific directory on an FTP server using wget in a subprocess. Args: ftp_server (str): The FTP server address. Default is 'ftp.dlptest.com'. ftp_user (str): The FTP server username. Default is 'dlpuser'. ftp_passwor ... [TRUNCATED 798 chars] ... FTP server.\nYou should write self-contained code starting with:\n```\nimport subprocess\nimport ftplib\nimport os\ndef task_func(ftp_server='ftp.dlptest.com', ftp_user='dlpuser', ftp_password='rNrKYTX9g7z3RgJRmxWuGHbeu', ftp_dir='/ftp/test'):\n```"}],"target":" # Attempt to connect to the FTP server\n try:\n ftp_obj = ftplib.FTP(ftp_server)\n except Exception as e:\n raise Exception(f'Failed to connect to FTP server {ftp_server}: {str(e)}')\n\n # Attempt to login to the FTP serv ... [TRUNCATED 625 chars] ... command = f'wget ftp://{ftp_user}:{ftp_password}@{ftp_server}{ftp_dir}/{filename} -P {download_dir}'\n subprocess.call(command, shell=True)\n downloaded_files.append(filename)\n\n ftp_obj.quit()\n return downloaded_files","id":0,"group_id":0,"metadata":{"task_id":"BigCodeBench/13","entry_point":"task_func","complete_prompt":"import subprocess\nimport ftplib\nimport os\n\ndef task_func(ftp_server='ftp.dlptest.com', ftp_user='dlpuser', ftp_password='rNrKYTX9g7z3RgJRmxWuGHbeu', ftp_dir='/ftp/test'):\n \"\"\"\n Download all files from a specific directory on an FTP serv ... [TRUNCATED 909 chars] ... ctory. Outputs the message \"Failed to change to directory {ftp_dir} on server {ftp_server}: {str(e)}\"\n \n Requirements:\n - subprocess\n - ftplib\n - os\n\n Example:\n >>> task_func()\n ['file1.txt', 'file2.jpg', ...]\n \"\"\"\n","code_prompt":"import subprocess\nimport ftplib\nimport os\ndef task_func(ftp_server='ftp.dlptest.com', ftp_user='dlpuser', ftp_password='rNrKYTX9g7z3RgJRmxWuGHbeu', ftp_dir='/ftp/test'):\n","test":"import unittest\nfrom unittest.mock import patch\nimport os\nclass TestCases(unittest.TestCase):\n def setUp(self):\n \"\"\"Setup a clean test environment before each test.\"\"\"\n if not os.path.exists(\"downloaded_files\"):\n o ... [TRUNCATED 2565 chars] ... with self.assertRaises(Exception) as context:\n task_func(ftp_dir=\"/invalid_directory\")\n self.assertEqual(str(context.exception), f'Failed to change to directory /invalid_directory on server ftp.dlptest.com: {error_message}')"}}