<commit_before>r"""
"""

# import to process args
import sys
import os

# import vtk modules.
import vtk
from vtk.web import server, wamp, protocols

# import annotations
from autobahn.wamp import exportRpc

try:
    import argparse
except ImportError:
    # since  Python 2.6 and earlier don't have argparse, we simply provide
    # the source for the same as _argparse and we use it instead.
    import _argparse as argparse

import converter
import sys
import traceback

# =============================================================================
# Create custom File Opener class to handle clients requests
# =============================================================================

class _WebMolecule(wamp.ServerProtocol):
    authKey = "vtkweb-secret"

    # Application configuration
    def __init__(self):
      self.view = None
      wamp.ServerProtocol.__init__(self)

    @exportRpc
    def load(self, inchikey):

      self.reader = vtk.vtkCMLMoleculeReader()
      #self.reader.SetFileName('/home/cjh/work/VTKData/Data/porphyrin.cml')
      self.mapper = vtk.vtkMoleculeMapper()
      self.mapper.SetInputConnection(self.reader.GetOutputPort())
      self.mapper.UseBallAndStickSettings()

      self.actor = vtk.vtkActor()
      self.actor.SetMapper(self.mapper)

      self.renderer = vtk.vtkRenderer()
      self.window = vtk.vtkRenderWindow()
      self.window.AddRenderer(self.renderer);

      interactor = vtk.vtkRenderWindowInteractor()
      interactor.SetRenderWindow(self.window);
      interactor.GetInteractorStyle().SetCurrentStyleToTrackballCamera()

      self.renderer.AddActor(self.actor);
      self.renderer.SetBackground(1,1,1);

      # VTK Web application specific
      _WebMolecule.view = self.window<commit_msg>Update exportRpc endpoints<commit_after>r"""
"""

# import to process args
import sys
import os

# import vtk modules.
import vtk
from vtk.web import server, wamp, protocols

# import annotations
from autobahn.wamp import register as exportRpc

try:
    import argparse
except ImportError:
    # since  Python 2.6 and earlier don't have argparse, we simply provide
    # the source for the same as _argparse and we use it instead.
    import _argparse as argparse

import converter
import sys
import traceback

# =============================================================================
# Create custom File Opener class to handle clients requests
# =============================================================================

class _WebMolecule(wamp.ServerProtocol):
    authKey = "vtkweb-secret"

    # Application configuration
    def __init__(self, config):
      self.view = None
      wamp.ServerProtocol.__init__(self, config)

    @exportRpc("load")
    def load(self, inchikey):

      self.reader = vtk.vtkCMLMoleculeReader()
      #self.reader.SetFileName('/home/cjh/work/VTKData/Data/porphyrin.cml')
      self.mapper = vtk.vtkMoleculeMapper()
      self.mapper.SetInputConnection(self.reader.GetOutputPort())
      self.mapper.UseBallAndStickSettings()

      self.actor = vtk.vtkActor()
      self.actor.SetMapper(self.mapper)

      self.renderer = vtk.vtkRenderer()
      self.window = vtk.vtkRenderWindow()
      self.window.AddRenderer(self.renderer);

      interactor = vtk.vtkRenderWindowInteractor()
      interactor.SetRenderWindow(self.window);
      interactor.GetInteractorStyle().SetCurrentStyleToTrackballCamera()

      self.renderer.AddActor(self.actor);
      self.renderer.SetBackground(1,1,1);

      # VTK Web application specific
      _WebMolecule.view = self.window
{'fraction_non_alphanumeric': 0.16923507985430092, 'fraction_numerical': 0.002801905295601009, 'mean_word_length': 3.9790794979079496, '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': '6409279', 'n_tokens_mistral': 1055, 'n_tokens_neox': 1007, 'n_words': 235}