def _create_traced_edge_entry(self, i, trace_step, mean_time):
        time_spent = trace_step.get('time_spent', None)

        color = self._get_color_for_time(time_spent, mean_time) if time_spent is not None else 'black'
        fontcolor = 'black'
        constraint = 'true'
        style = 'solid'

        # if this edge is used because of an exception, we render it a bit differently:
        if trace_step.get('failure') is not None:
            style = 'dashed'
            if trace_step.get('is_error_consumer', False):
                color = 'red'
                fontcolor = 'red'
            else:
                color = 'pink'
                # we dont want unhandled errors to affect the layout of the graph.
                constraint = 'false'

        source_id = id(trace_step['source'])
        destination_id = id(trace_step['destination'])

        if not trace_step['destination']:
            # if the destination is None, it is a return value, and we use the copied batons id instead of id(None).
            destination_id = id(trace_step['baton'])

        label = '%i' % (i+1)
        tooltip = ''
        if time_spent:
            tooltip = '%.2f ms' %(time_spent*1000)

        return '%s -> %s [label="%s", id="baton_%i", color="%s", fontcolor="%s", constraint=%s, style="%s", tooltip="%s", labeltooltip="%s"]' % (source_id, destination_id, label, i, color, fontcolor, constraint, style, tooltip, tooltip)
dataset/ETHPy150Open foundit/Piped/piped/processors/trace_processors.py/DiagramTrace._create_traced_edge_entry/original