<commit_before># -*- coding: utf-8 -*-
# Copyright (C) 2013-2015 MUJIN Inc.

class ViewerMixin:

    def SetViewerFromParameters(self, viewerparameters, usewebapi=False, timeout=10, fireandforget=True, **kwargs):
        taskparameters = {'command': 'SetViewerFromParameters',
                          'viewerparameters':viewerparameters
        }
        taskparameters.update(kwargs)
        return self.ExecuteCommand(taskparameters, usewebapi=usewebapi, timeout=timeout, fireandforget=fireandforget)
        
    def MoveCameraZoomOut(self, zoommult=0.9, zoomdelta=20, usewebapi=False, timeout=10, fireandforget=True, **kwargs):
        taskparameters = {'command': 'MoveCameraZoomOut',
                          'zoomdelta':float(zoomdelta),
                          'zoommult': float(zoommult)
        }
        taskparameters.update(kwargs)
        return self.ExecuteCommand(taskparameters, usewebapi=usewebapi, timeout=timeout, fireandforget=fireandforget)
    
    def MoveCameraZoomIn(self, zoommult=0.9, zoomdelta=20, usewebapi=False, timeout=10, fireandforget=True, **kwargs):
        taskparameters = {'command': 'MoveCameraZoomIn',
                          'zoomdelta':float(zoomdelta),
                          'zoommult':float(zoommult)
        }
        taskparameters.update(kwargs)
        return self.ExecuteCommand(taskparameters, usewebapi=usewebapi, timeout=timeout, fireandforget=fireandforget)
    
    def MoveCameraLeft(self, ispan=True, panangle=5.0, pandelta=40, usewebapi=False, timeout=10, fireandforget=True, **kwargs):
        taskparameters = {'command': 'MoveCameraLeft',
                          'pandelta':float(pandelta),
                          'panangle':float(panangle),
                          'ispan':bool(ispan)
        }
        taskparameters.update(kwargs)
        return self.ExecuteCommand(taskparameters, usewebapi=usewebapi, timeout=timeout, fireandforget=fireandforget)
    
    def MoveCameraRight(self, ispan=True, panangle=5.0, pandelta=40, usewebapi=False, timeout=10, fireandforget=True, **kwargs):
        taskparameters = {'command': 'MoveCameraRight',
                          'pandelta':float(pandelta),
                          'panangle':float(panangle),
                          'ispan':bool(ispan)
        }
        taskparameters.update(kwargs)
        return self.ExecuteCommand(taskparameters, usewebapi=usewebapi, timeout=timeout, fireandforget=fireandforget)
    
    def MoveCameraUp(self, ispan=True, angledelta=3.0, usewebapi=False, timeout=10, fireandforget=True, **kwargs):
        taskparameters = {'command': 'MoveCameraUp',
                          'angledelta':float(angledelta),
                          'ispan':bool(ispan)
        }
        taskparameters.update(kwargs)
        return self.ExecuteCommand(taskparameters, usewebapi=usewebapi, timeout=timeout, fireandforget=fireandforget)
    
    def MoveCameraDown(self, ispan=True, angledelta=3.0, usewebapi=False, timeout=10, fireandforget=True, **kwargs):
        taskparameters = {'command': 'MoveCameraDown',
                          'angledelta':float(angledelta),
                          'ispan':bool(ispan)
        }
        taskparameters.update(kwargs)
        return self.ExecuteCommand(taskparameters, usewebapi=usewebapi, timeout=timeout, fireandforget=fireandforget)
    
    def SetCameraTransform(self, pose=None, transform=None, distanceToFocus=0.0, usewebapi=False, timeout=10, fireandforget=True, **kwargs):
        """sets the camera transform
        :param transform: 4x4 matrix
        """        
        taskparameters = {'command': 'SetCameraTransform',
                          'distanceToFocus':float(distanceToFocus),
                          }
        if transform is not None:
            taskparameters['transform'] = [list(row) for row in transform]
        if pose is not None:
            taskparameters['pose'] = [float(f) for f in pose]
        taskparameters.update(kwargs)
        return self.ExecuteCommand(taskparameters, usewebapi=usewebapi, timeout=timeout, fireandforget=fireandforget)
    
    def GetCameraTransform(self, usewebapi=False, timeout=10, **kwargs):
        """gets the camera transform, and other
        """
        taskparameters = {'command': 'GetCameraTransform'
                          }
        taskparameters.update(kwargs)
        return self.ExecuteCommand(taskparameters, usewebapi=usewebapi, timeout=timeout)

<commit_msg>Fix viewer camera pan.<commit_after># -*- coding: utf-8 -*-
# Copyright (C) 2013-2015 MUJIN Inc.

class ViewerMixin:

    def SetViewerFromParameters(self, viewerparameters, usewebapi=False, timeout=10, fireandforget=True, **kwargs):
        taskparameters = {'command': 'SetViewerFromParameters',
                          'viewerparameters':viewerparameters
        }
        taskparameters.update(kwargs)
        return self.ExecuteCommand(taskparameters, usewebapi=usewebapi, timeout=timeout, fireandforget=fireandforget)
        
    def MoveCameraZoomOut(self, zoommult=0.9, zoomdelta=20, usewebapi=False, timeout=10, fireandforget=True, **kwargs):
        taskparameters = {'command': 'MoveCameraZoomOut',
                          'zoomdelta':float(zoomdelta),
                          'zoommult': float(zoommult)
        }
        taskparameters.update(kwargs)
        return self.ExecuteCommand(taskparameters, usewebapi=usewebapi, timeout=timeout, fireandforget=fireandforget)
    
    def MoveCameraZoomIn(self, zoommult=0.9, zoomdelta=20, usewebapi=False, timeout=10, fireandforget=True, **kwargs):
        taskparameters = {'command': 'MoveCameraZoomIn',
                          'zoomdelta':float(zoomdelta),
                          'zoommult':float(zoommult)
        }
        taskparameters.update(kwargs)
        return self.ExecuteCommand(taskparameters, usewebapi=usewebapi, timeout=timeout, fireandforget=fireandforget)
    
    def MoveCameraLeft(self, ispan=True, panangle=5.0, pandelta=0.04, usewebapi=False, timeout=10, fireandforget=True, **kwargs):
        taskparameters = {'command': 'MoveCameraLeft',
                          'pandelta':float(pandelta),
                          'panangle':float(panangle),
                          'ispan':bool(ispan)
        }
        taskparameters.update(kwargs)
        return self.ExecuteCommand(taskparameters, usewebapi=usewebapi, timeout=timeout, fireandforget=fireandforget)
    
    def MoveCameraRight(self, ispan=True, panangle=5.0, pandelta=0.04, usewebapi=False, timeout=10, fireandforget=True, **kwargs):
        taskparameters = {'command': 'MoveCameraRight',
                          'pandelta':float(pandelta),
                          'panangle':float(panangle),
                          'ispan':bool(ispan)
        }
        taskparameters.update(kwargs)
        return self.ExecuteCommand(taskparameters, usewebapi=usewebapi, timeout=timeout, fireandforget=fireandforget)
    
    def MoveCameraUp(self, ispan=True, angledelta=3.0, pandelta=0.04, usewebapi=False, timeout=10, fireandforget=True, **kwargs):
        taskparameters = {'command': 'MoveCameraUp',
                          'pandelta':float(pandelta),
                          'angledelta':float(angledelta),
                          'ispan':bool(ispan)
        }
        taskparameters.update(kwargs)
        return self.ExecuteCommand(taskparameters, usewebapi=usewebapi, timeout=timeout, fireandforget=fireandforget)
    
    def MoveCameraDown(self, ispan=True, angledelta=3.0, pandelta=0.04, usewebapi=False, timeout=10, fireandforget=True, **kwargs):
        taskparameters = {'command': 'MoveCameraDown',
                          'pandelta':float(pandelta),
                          'angledelta':float(angledelta),
                          'ispan':bool(ispan)
        }
        taskparameters.update(kwargs)
        return self.ExecuteCommand(taskparameters, usewebapi=usewebapi, timeout=timeout, fireandforget=fireandforget)
    
    def SetCameraTransform(self, pose=None, transform=None, distanceToFocus=0.0, usewebapi=False, timeout=10, fireandforget=True, **kwargs):
        """sets the camera transform
        :param transform: 4x4 matrix
        """        
        taskparameters = {'command': 'SetCameraTransform',
                          'distanceToFocus':float(distanceToFocus),
                          }
        if transform is not None:
            taskparameters['transform'] = [list(row) for row in transform]
        if pose is not None:
            taskparameters['pose'] = [float(f) for f in pose]
        taskparameters.update(kwargs)
        return self.ExecuteCommand(taskparameters, usewebapi=usewebapi, timeout=timeout, fireandforget=fireandforget)
    
    def GetCameraTransform(self, usewebapi=False, timeout=10, **kwargs):
        """gets the camera transform, and other
        """
        taskparameters = {'command': 'GetCameraTransform'
                          }
        taskparameters.update(kwargs)
        return self.ExecuteCommand(taskparameters, usewebapi=usewebapi, timeout=timeout)


{'fraction_non_alphanumeric': 0.10713101160862355, 'fraction_numerical': 0.012161415146489774, 'mean_word_length': 2.7241663235899547, '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': '122758', 'n_tokens_mistral': 2537, 'n_tokens_neox': 2484, 'n_words': 435}