<commit_before>import os
import unittest

import opensim as osim

test_dir = os.path.join(os.path.dirname(os.path.abspath(osim.__file__)),
                        'tests')

# Silence warning messages if mesh (.vtp) files cannot be found.
osim.Model.setDebugLevel(0)

class TestComponentInterface(unittest.TestCase):
    def test_printComponentsMatching(self):
        model = osim.Model(os.path.join(test_dir,
            "gait10dof18musc_subject01.osim"))
        num_matches = model.printComponentsMatching("_r")
        self.assertEquals(num_matches, 98)
    def test_attachGeometry_memory_management(self):
        model = osim.Model()
        model.getGround().attachGeometry(osim.Sphere(1.5))<commit_msg>Python test most also call finalizeFromProperties<commit_after>import os
import unittest

import opensim as osim

test_dir = os.path.join(os.path.dirname(os.path.abspath(osim.__file__)),
                        'tests')

# Silence warning messages if mesh (.vtp) files cannot be found.
osim.Model.setDebugLevel(0)

class TestComponentInterface(unittest.TestCase):
    def test_printComponentsMatching(self):
        model = osim.Model(os.path.join(test_dir,
            "gait10dof18musc_subject01.osim"))
        model.finalizeFromProperties();
        num_matches = model.printComponentsMatching("_r")
        self.assertEquals(num_matches, 98)
    def test_attachGeometry_memory_management(self):
        model = osim.Model()
        model.getGround().attachGeometry(osim.Sphere(1.5))
{'fraction_non_alphanumeric': 0.10294117647058823, 'fraction_numerical': 0.014705882352941176, 'mean_word_length': 3.6490683229813663, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4146262', 'n_tokens_mistral': 477, 'n_tokens_neox': 461, 'n_words': 83}