Get the current view state of the camera

        Returns a dict of key-value pairs. The exact keys depend on the
        camera. Can be passed to set_state() (of this or another camera
        of the same type) to reproduce the state.
773248
def get_state(self):
        
        D = {}
        for key in self._state_props:
            D[key] = getattr(self, key)
        return D
1371820
def state_dict(self) -> Dict[str, Any]:
        
        return {key: value for key, value in self.__dict__.items() if key != 'optimizer'}
20154
def load_state_dict(self, state_dict: Dict[str, Any]) -> None:
        
        self.__dict__.update(state_dict)
476144
def state(self):
        
        state = self._resource.get('state', self.default_state)
        if state not in State:
            state = getattr(State, state)

        if not self.parent:
            raise Exception('Unable to check the parent state')

        parent_state = self.parent.state

        return max([state, parent_state], key=attrgetter('value'))
544622
def camera_position(self):
        
        return [self.camera.GetPosition(),
                self.camera.GetFocalPoint(),
                self.camera.GetViewUp()]
58888
def viewkeys(self):
		
		if hasattr(self._nodes, 'viewkeys'):
			return self._nodes.viewkeys()
		else:
			return self._nodes.keys()
693928
def camera_position(self, camera_location):
        
        if camera_location is None:
            return

        if isinstance(camera_location, str):
            camera_location = camera_location.lower()
            if camera_location == 'xy':
                self.view_xy()
            elif camera_location == 'xz':
                self.view_xz()
            elif camera_location == 'yz':
                self.view_yz()
            elif camera_location == 'yx':
                self.view_xy(True)
            elif camera_location == 'zx':
                self.view_xz(True)
            elif camera_location == 'zy':
                self.view_yz(True)
            return

        if isinstance(camera_location[0], (int, float)):
            return self.view_vector(camera_location)

        # everything is set explicitly
        self.camera.SetPosition(camera_location[0])
        self.camera.SetFocalPoint(camera_location[1])
        self.camera.SetViewUp(camera_location[2])

        # reset clipping range
        self.ResetCameraClippingRange()
        self.camera_set = True
979591
def get_default_input_values_for_state(self, state):
        
        from rafcon.core.states.library_state import LibraryState
        result_dict = {}
        for input_port_key, value in state.input_data_ports.items():
            if isinstance(state, LibraryState):
                if state.use_runtime_value_input_data_ports[input_port_key]:
                    default = state.input_data_port_runtime_values[input_port_key]
                else:
                    default = value.default_value
            else:
                default = value.default_value
            # if the user sets the default value to a string starting with $, try to retrieve the value
            # from the global variable manager
            if isinstance(default, string_types) and len(default) > 0 and default[0] == '$':
                from rafcon.core.singleton import global_variable_manager as gvm
                var_name = default[1:]
                if not gvm.variable_exist(var_name):
                    logger.error("The global variable '{0}' does not exist".format(var_name))
                    global_value = None
                else:
                    global_value = gvm.get_variable(var_name)
                result_dict[value.name] = global_value
            else:
                # set input to its default value
                result_dict[value.name] = copy.copy(default)
        return result_dict
319579
def get_cameras(self):
        """"""
        response = api.request_homescreen(self)
        try:
            all_cameras = {}
            for camera in response['cameras']:
                camera_network = str(camera['network_id'])
                camera_name = camera['name']
                camera_id = camera['id']
                camera_info = {'name': camera_name, 'id': camera_id}
                if camera_network not in all_cameras:
                    all_cameras[camera_network] = []

                all_cameras[camera_network].append(camera_info)
            return all_cameras
        except KeyError:
            _LOGGER.error("Initialization failue. Could not retrieve cameras.")
            return {}
959045
def in_state(obj, states, stateflowid='review_state'):
    
    if not states:
        return False
    obj_state = getCurrentState(obj, stateflowid=stateflowid)
    return obj_state in states
679075
def current_state(self):
        '''
        
        '''
        c_state = getattr(self, '_current_state_hydrated', None)
        if not c_state:
            c_state = json.loads(self.base_state)
            setattr(self, '_current_state_hydrated', c_state)
            setattr(self, '_current_state_hydrated_changed', False)
        return c_state
816257
def currentPixmapRect(self):
        
        pixmap = self.currentPixmap()
        rect   = self.rect()
        size   = pixmap.size()
        
        x = rect.center().x() - (size.width() / 2.0)
        y = rect.center().y() - (size.height() / 2.0)
        
        return QtCore.QRect(x, y, size.width(), size.height())
1008213
def get_view(self, view_name):
        
        return self.measure_to_view_map.get_view(view_name=view_name,
                                                 timestamp=self.time)
948294
def state_invariant_scope(self, state: Sequence[tf.Tensor]):
        '''
        '''
        scope = {}
        scope.update(self.non_fluents_scope())
        scope.update(self.state_scope(state))
        return scope
672560
def get_iss(self, key):
        
        _state = self.get_state(key)
        if not _state:
            raise KeyError(key)
        return _state['iss']
1112206
def set_key_state(self, key, state):
        
        key.state = state
        self.renderer.draw_key(self.surface, key)
1148574
def view_set(method_name):
    

    def view_set(value, context, **_params):
        method = getattr(context["view"], method_name)
        return _set(method, context["key"], value, (), {})

    return view_set