<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run_exec(repodir, command, output, index):
 """Runs the specified command in the repo directory. :arg repodir: the absolute path of the repo directory to run 'command' in. :arg command: what to run in the 'repodir'. Should be valid in the context of the $PATH variable. :arg output: the multiprocessing queue to push the results to. :arg index: the index of this test in the master list. """

    from os import path
    from subprocess import Popen, PIPE
    from datetime import datetime
    
    child = Popen("cd {}; {} > {}.cidat".format(repodir, command, index),
                  shell=True, executable="/bin/bash")
    # Need to do this so that we are sure the process is done before moving on
    child.wait()
    output.put({"index": index, "end": datetime.now(), "code": child.returncode,
                "output": path.join(repodir, "{}.cidat".format(index))})