<commit_before>#!/usr/local/bin/python
import os
try:
  VTK_DATA = os.environ['VTK_DATA']
except KeyError:
  VTK_DATA = '../../../vtkdata/'

from libVTKCommonPython import *
from libVTKGraphicsPython import *
from libVTKImagingPython import *

# create a rendering window and renderer
ren = vtkRenderer()
renWin = vtkRenderWindow()
renWin.AddRenderer(ren)
renWin.SetSize(300,300)

# create an actor and give it cone geometry
cone = vtkConeSource()
cone.SetResolution(8)
coneMapper = vtkPolyDataMapper()
coneMapper.SetInput(cone.GetOutput())
coneActor = vtkActor()
coneActor.SetMapper(coneMapper)

# assign our actor to the renderer
ren.AddActor(coneActor)

# enable user interface interactor
renWin.Render()

w2if =  vtkWindowToImageFilter()
w2if.SetInput(renWin)

imgDiff = vtkImageDifference()
    
rtpnm = vtkPNMReader()
rtpnm.SetFileName("valid/Cone.ppm");

imgDiff.SetInput(w2if.GetOutput());
imgDiff.SetImage(rtpnm.GetOutput());
imgDiff.Update();

if imgDiff.GetThresholdedError() <= 10:<commit_msg>ERR: test image must be Cone.tcl.ppm.<commit_after>#!/usr/local/bin/python
import os
try:
  VTK_DATA = os.environ['VTK_DATA']
except KeyError:
  VTK_DATA = '../../../vtkdata/'

from libVTKCommonPython import *
from libVTKGraphicsPython import *
from libVTKImagingPython import *

# create a rendering window and renderer
ren = vtkRenderer()
renWin = vtkRenderWindow()
renWin.AddRenderer(ren)
renWin.SetSize(300,300)

# create an actor and give it cone geometry
cone = vtkConeSource()
cone.SetResolution(8)
coneMapper = vtkPolyDataMapper()
coneMapper.SetInput(cone.GetOutput())
coneActor = vtkActor()
coneActor.SetMapper(coneMapper)

# assign our actor to the renderer
ren.AddActor(coneActor)

# enable user interface interactor
renWin.Render()

w2if =  vtkWindowToImageFilter()
w2if.SetInput(renWin)

imgDiff = vtkImageDifference()
    
rtpnm = vtkPNMReader()
rtpnm.SetFileName("valid/Cone.tcl.ppm");

imgDiff.SetInput(w2if.GetOutput());
imgDiff.SetImage(rtpnm.GetOutput());
imgDiff.Update();

if imgDiff.GetThresholdedError() <= 10:
{'fraction_non_alphanumeric': 0.1211972522080471, 'fraction_numerical': 0.011776251226692836, 'mean_word_length': 5.888513513513513, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4533166', 'n_tokens_mistral': 751, 'n_tokens_neox': 713, 'n_words': 152}