def status(self, job_id):
check_jobid(job_id)<EOL>queue = self._get_queue()<EOL>if queue is None:<EOL><INDENT>raise QueueDoesntExist<EOL><DEDENT>ret, output = self._call('<STR_LIT>' % (<EOL>shell_escape(queue / '<STR_LIT>'),<EOL>job_id),<EOL>True)<EOL>if ret == <NUM_LIT:0>:<EOL><INDENT>directory, result = output.splitlines()<EOL>result = result.decode('<STR_LIT:utf-8>')<EOL>return RemoteQueue.JOB_DONE, PosixPath(directory), result<EOL><DEDENT>elif ret == <NUM_LIT:2>:<EOL><INDENT>directory = output.splitlines()[<NUM_LIT:0>]<EOL>return RemoteQueue.JOB_RUNNING, PosixPath(directory), None<EOL><DEDENT>elif ret == <NUM_LIT:3>:<EOL><INDENT>raise JobNotFound<EOL><DEDENT>else:<EOL><INDENT>raise RemoteCommandFailure(command="<STR_LIT>",<EOL>ret=ret)<EOL><DEDENT>
Gets the status of a previously-submitted job.