def METHOD_NAME(self, cmd, cwd='./'):
    if self.timeout is not None and \
            not isinstance(self.timeout, (float, int)):
        raise TypeError('timeout argument is not a float')
    command = []
    if self.timeout:
        command += ['timeout', '-k', str(self.timeout + 1), 
                str(self.timeout)]
    command += cmd
    p = subprocess.Popen(
            command, 
            stdout=subprocess.PIPE, 
            stderr=subprocess.PIPE, 
            cwd=cwd)
    output = io.StringIO()
    t1 = threading.Thread(
            target=limited_reader, 
            args=(p.stdout, output, LIMIT_BYTES))
    t2 = threading.Thread(
            target=limited_reader, 
            args=(p.stderr, output, LIMIT_BYTES))
    t1.start()
    t2.start()
    t1.join()
    t2.join()
    p.wait()
    status = p.returncode
    output = output.getvalue()
    is_timeout = status == 124
    ret = dict()
    ret["status"] = status == 0 and not is_timeout
    ret["retcode"] = status
    ret["is_timeout"] = is_timeout
    ret["output"] = output
    ret["course_id"] = self.course_id
    ret["issue_id"] = self.issue_id
    return json.dumps(ret), ret