@defer.inlineCallbacks
    def process_input(self, input, baton):
        trace = input or list()
        pipeline_provider = yield self.pipeline_provider_dependency.wait_for_resource()

        dot = util.dict_get_path(baton, self.svg_path, '')

        steps = list()
        processors = dict()

        for trace_step in trace:
            steps.append(
                dict(
                    baton = trace_step['baton'],
                    failure = trace_step.get('failure'),
                    source = id(trace_step['source']),
                    destination = id(trace_step['destination']),
                )
            )

            for processor in trace_step['source'], trace_step['destination']:
                if not processor:
                    continue

                # store the current state of the processor
                processors[id(processor)] = dict(name=reflect.fullyQualifiedName(processor.__class__), state=getattr(processor, '__dict__', dict()))
        
        pipeline_names = sorted(pipeline_provider.processor_graph_factory.pipelines_configuration.keys())

        variables = dict(dot=dot, steps=self.json_encoder.encode(steps), pipeline_names=self.json_encoder.encode(pipeline_names), processors=self.json_encoder.encode(processors))

        # since this is not a performance critical path at all, we read the template from disk every single time so that the template
        # can be edited without restarting the piped service.
        trace_template = open(self.template).read()
        html = trace_template % variables

        defer.returnValue(html)
dataset/ETHPy150Open foundit/Piped/piped/processors/trace_processors.py/RenderTrace.process_input/original