def _cast(self, v):
        if isinstance(v, basestring):
            return v
        if isinstance(v, cp.lib.file_generator): # serve_file()
            return v
        if isinstance(v, dict):
            cp.response.headers["Content-Type"] = "application/json; charset=utf-8"
            cp.response.headers["Access-Control-Allow-Origin"] = "*" # CORS
            return json.dumps(v)
        if isinstance(v, types.GeneratorType):
            cp.response.stream = True
            return iter(self._cast(v) for v in v)
        if isinstance(v, (list, tuple, set)):
            return " ".join(self._cast(v) for v in v)
        if isinstance(v, HTTPError):
            raise cp.HTTPError(v.status, message=v.message)
        if v is None:
            return ""
        try: # (bool, int, float, object.__unicode__)
            return unicode(v)
        except:
            return encode_entities(repr(v))
The I{exec} command runs its arguments locally in a child process
dataset/ETHPy150Open clips/pattern/pattern/server/__init__.py/Application._cast--crossover with--dataset/ETHPy150Open twisted/twisted/twisted/conch/test/test_cftp.py/StdioClientTests.test_exec