def __call__(self, environ, start_response):
        # We want to be careful about not sending headers twice,
        # and the content type that the app has committed to (if there
        # is an exception in the iterator body of the response)
        if environ.get('paste.throw_errors'):
            return self.application(environ, start_response)
        environ['paste.throw_errors'] = True

        try:
            __traceback_supplement__ = Supplement, self, environ
            sr_checker = ResponseStartChecker(start_response)
            app_iter = self.application(environ, sr_checker)
            return self.make_catching_iter(app_iter, environ, sr_checker)
        except:
            exc_info = sys.exc_info()
            try:
                for expect in environ.get('paste.expected_exceptions', []):
                    if isinstance(exc_info[1], expect):
                        raise
                start_response('500 Internal Server Error',
                               [('content-type', 'text/html')],
                               exc_info)
                # @@: it would be nice to deal with bad content types here
                response = self.exception_handler(exc_info, environ)
                if six.PY3:
                    response = response.encode('utf8')
                return [response]
            finally:
                # clean up locals...
                exc_info = None
Build the text of the file and write the file.
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Paste-2.0.1/paste/exceptions/errormiddleware.py/ErrorMiddleware.__call__--crossover with--dataset/ETHPy150Open Netflix/security_monkey/generate_docs.py/create_module_file