<commit_before>import numpy as np

from ..points          import transform_points
from ..util            import is_sequence, is_instance_named
from ..transformations import rotation_matrix
from .transforms       import TransformForest

from collections import deque

class Scene:
    '''
    A simple scene graph which can be rendered directly via pyglet/openGL,
    or through other endpoints such as a raytracer. 

    Meshes and lights are added by name, which can then be moved by updating
    transform in the transform tree. 
    '''

    def __init__(self, 
                 node       = None, 
                 base_frame ='world'):

        # instance name : mesh name
        self.nodes = {}

        # mesh name : Trimesh object
        self.meshes     = {}
        self.flags      = {}
        self.transforms = TransformForest(base_frame = base_frame)

        self.add_mesh(node)
        self.set_camera()

    def add_mesh(self, mesh):
        '''
        Add a mesh to the scene.

        If the mesh has multiple transforms defined in its metadata, 
        a new instance of the mesh will be created at each transform. 
        '''        
        if not is_instance_named(mesh, 'Trimesh'):
            return
        if is_sequence(mesh):
            for i in mesh:
                self.add_mesh(i)
            return

        if 'name' in mesh.metadata: 
            name_mesh = mesh.metadata['name']
        else:
            name_mesh = 'mesh_' + str(len(self.meshes))

        self.meshes[name_mesh] = mesh

        if 'transforms' in mesh.metadata:
            transforms = np.array(mesh.metadata['transforms'])
        else:
            transforms = np.eye(4).reshape((-1,4,4))
<commit_msg>bugfix for test order<commit_after>import numpy as np

from ..points          import transform_points
from ..util            import is_sequence, is_instance_named
from ..transformations import rotation_matrix
from .transforms       import TransformForest

from collections import deque

class Scene:
    '''
    A simple scene graph which can be rendered directly via pyglet/openGL,
    or through other endpoints such as a raytracer. 

    Meshes and lights are added by name, which can then be moved by updating
    transform in the transform tree. 
    '''

    def __init__(self, 
                 node       = None, 
                 base_frame ='world'):

        # instance name : mesh name
        self.nodes = {}

        # mesh name : Trimesh object
        self.meshes     = {}
        self.flags      = {}
        self.transforms = TransformForest(base_frame = base_frame)

        self.add_mesh(node)
        self.set_camera()

    def add_mesh(self, mesh):
        '''
        Add a mesh to the scene.

        If the mesh has multiple transforms defined in its metadata, 
        a new instance of the mesh will be created at each transform. 
        '''        
        if is_sequence(mesh):
            for i in mesh:
                self.add_mesh(i)
            return
        if not is_instance_named(mesh, 'Trimesh'):
            return

        if 'name' in mesh.metadata: 
            name_mesh = mesh.metadata['name']
        else:
            name_mesh = 'mesh_' + str(len(self.meshes))

        self.meshes[name_mesh] = mesh

        if 'transforms' in mesh.metadata:
            transforms = np.array(mesh.metadata['transforms'])
        else:
            transforms = np.eye(4).reshape((-1,4,4))

{'fraction_non_alphanumeric': 0.07853403141361257, 'fraction_numerical': 0.002326934264107039, 'mean_word_length': 1.8610648918469217, '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': '1270434', 'n_tokens_mistral': 959, 'n_tokens_neox': 912, 'n_words': 307}