<commit_before>from typing import List, Tuple
import numpy as np
from pyrep.backend import sim
from pyrep.objects.object import Object, object_type_to_class
from pyrep.const import ObjectType, PrimitiveShape, TextureMappingMode
from pyrep.textures.texture import Texture
import os
import collections


SShapeVizInfo = collections.namedtuple(
    'SShapeVizInfo',
    [
        'vertices',
        'indices',
        'normals',
        'shading_angle',
        'colors',
        'texture',
        'texture_id',
        'texture_coords',
        'texture_apply_mode',
        'texture_options',
    ],
)


class Shape(Object):
    """Shapes are rigid mesh objects that are composed of triangular faces.
    """

    @staticmethod
    def create(type: PrimitiveShape, size: List[float],
               mass=1., backface_culling=False, visible_edges=False,
               smooth=False, respondable=True,
               static=False, renderable=True, position=None,
               orientation=None, color=None) -> 'Shape':
        """Creates a primitive shape in the scene.

        :param type: The type of primitive to shape. One of:
            PrimitiveShape.CUBOID
            PrimitiveShape.SPHERE
            PrimitiveShape.CYLINDER
            PrimitiveShape.CONE
        :param size: A list of the x, y, z dimensions.
        :param mass: A float representing the mass of the object.
        :param backface_culling: If backface culling is enabled.
        :param visible_edges: If the object will have visible edges.
        :param smooth: If the shape appears smooth.
        :param respondable: Shape is responsible.
        :param static: If the shape is static.
        :param renderable: If the shape is renderable.
        :param position: The x, y, z position.
        :param orientation: The z, y, z orientation (in radians).
        :param color: The r, g, b values of the shape.
        :return: The created Shape object.
        """
        options = 0
        if backface_culling:
            options |= 1
        if visible_edges:
            options |= 2
        if smooth:
            options |= 4
        if respondable:
            options |= 8
        if static:
            options |= 16

        handle = sim.simCreatePureShape(type.value, options, size, mass, None)
        ob = Shape(handle)<commit_msg>Update shape.py<commit_after>from typing import List, Tuple
import numpy as np
from pyrep.backend import sim
from pyrep.objects.object import Object, object_type_to_class
from pyrep.const import ObjectType, PrimitiveShape, TextureMappingMode
from pyrep.textures.texture import Texture
import os
import collections


SShapeVizInfo = collections.namedtuple(
    'SShapeVizInfo',
    [
        'vertices',
        'indices',
        'normals',
        'shading_angle',
        'colors',
        'texture',
        'texture_id',
        'texture_coords',
        'texture_apply_mode',
        'texture_options',
    ],
)


class Shape(Object):
    """Shapes are rigid mesh objects that are composed of triangular faces.
    """

    @staticmethod
    def create(type: PrimitiveShape, size: List[float],
               mass=1., backface_culling=False, visible_edges=False,
               smooth=False, respondable=True,
               static=False, renderable=True, position=None,
               orientation=None, color=None) -> 'Shape':
        """Creates a primitive shape in the scene.

        :param type: The type of primitive to shape. One of:
            PrimitiveShape.CUBOID
            PrimitiveShape.SPHERE
            PrimitiveShape.CYLINDER
            PrimitiveShape.CONE
        :param size: A list of the x, y, z dimensions.
        :param mass: A float representing the mass of the object.
        :param backface_culling: If backface culling is enabled.
        :param visible_edges: If the object will have visible edges.
        :param smooth: If the shape appears smooth.
        :param respondable: Shape is responsible.
        :param static: If the shape is static.
        :param renderable: If the shape is renderable.
        :param position: The x, y, z position.
        :param orientation: The x, y, z orientation (in radians).
        :param color: The r, g, b values of the shape.
        :return: The created Shape object.
        """
        options = 0
        if backface_culling:
            options |= 1
        if visible_edges:
            options |= 2
        if smooth:
            options |= 4
        if respondable:
            options |= 8
        if static:
            options |= 16

        handle = sim.simCreatePureShape(type.value, options, size, mass, None)
        ob = Shape(handle)
{'fraction_non_alphanumeric': 0.07997427101200687, 'fraction_numerical': 0.003430531732418525, 'mean_word_length': 2.1886534518113465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4001063', 'n_tokens_mistral': 1290, 'n_tokens_neox': 1262, 'n_words': 438}