Returns the LibraryState which was selected in the LibraryTree

        :return: selected state in TreeView
        :rtype: LibraryState
195363
def _get_selected_library_state(self):
        
        library_os_path, library_path, library_name, item_key = self.extract_library_properties_from_selected_row()
        if library_path is None:
            return None

        logger.debug("Link library state '{0}' (with library tree path: {2} and file system path: {1}) into state "
                     "machine.".format(str(item_key), library_os_path,
                                       self.convert_if_human_readable(str(library_path)) + "/" + str(item_key)))
        library_name = library_os_path.split(os.path.sep)[-1]
        return LibraryState(library_path, library_name, "0.1", format_folder_name_human_readable(library_name))
831202
def get_selections(self):
        """"""
        sm_selection, sm_filtered_selected_model_set = self.get_state_machine_selection()
        tree_selection, selected_model_list = self.get_view_selection()
        return tree_selection, selected_model_list, sm_selection, sm_filtered_selected_model_set
371449
def _get_library_os_path_from_library_dict_tree(self, library_path, library_name):
        """"""
        if library_path is None or library_name is None:
            return None
        path_list = library_path.split(os.sep)
        target_lib_dict = self.libraries
        # go down the path to the correct library
        for path_element in path_list:
            if path_element not in target_lib_dict:  # Library cannot be found
                target_lib_dict = None
                break
            target_lib_dict = target_lib_dict[path_element]
        return None if target_lib_dict is None or library_name not in target_lib_dict else target_lib_dict[library_name]
1275730
def lstat(self):
        
        if self._closed:
            self._raise_closed()
        return self._accessor.lstat(self)
5226
def get_connection_state(self, connection: str) -> Dict[str, Any]:
        
        if connection not in self.connections:
            raise ConnectionNotOpen(connection)

        return self.connections[connection].state
485812
def get_library_state_copy_instance(self, lib_os_path):
        

        # originally libraries were called like this; DO NOT DELETE; interesting for performance tests
        # state_machine = storage.load_state_machine_from_path(lib_os_path)
        # return state_machine.version, state_machine.root_state

        # TODO observe changes on file system and update data
        if lib_os_path in self._loaded_libraries:
            # this list can also be taken to open library state machines TODO -> implement it -> because faster
            state_machine = self._loaded_libraries[lib_os_path]
            # logger.info("Take copy of {0}".format(lib_os_path))
            # as long as the a library state root state is never edited so the state first has to be copied here
            state_copy = copy.deepcopy(state_machine.root_state)
            return state_machine.version, state_copy
        else:
            state_machine = storage.load_state_machine_from_path(lib_os_path)
            self._loaded_libraries[lib_os_path] = state_machine
            if config.global_config.get_config_value("NO_PROGRAMMATIC_CHANGE_OF_LIBRARY_STATES_PERFORMED", False):
                return state_machine.version, state_machine.root_state
            else:
                state_copy = copy.deepcopy(state_machine.root_state)
                return state_machine.version, state_copy
1104987
def _on_add_library(self, *event):
        
        self.view['library_tree_view'].grab_focus()
        if react_to_event(self.view, self.view['library_tree_view'], event):
            temp_library_name = "<LIB_NAME_%s>" % self._lib_counter
            self._lib_counter += 1
            library_config = self.core_config_model.get_current_config_value("LIBRARY_PATHS", use_preliminary=True,
                                                                             default={})
            library_config[temp_library_name] = "<LIB_PATH>"
            self.core_config_model.set_preliminary_config_value("LIBRARY_PATHS", library_config)
            self._select_row_by_column_value(self.view['library_tree_view'], self.library_list_store,
                                             self.KEY_STORAGE_ID, temp_library_name)
            return True
200898
function(state) {
			var changed = false,
				opts = this.tree.options,
				unselectable = FT.evalOption(
					"unselectable",
					this,
					this,
					opts,
					false
				),
				unselectableStatus = FT.evalOption(
					"unselectableStatus",
					this,
					this,
					opts,
					undefined
				);

			if (unselectable && unselectableStatus != null) {
				state = unselectableStatus;
			}
			switch (state) {
				case false:
					changed = this.selected || this.partsel;
					this.selected = false;
					this.partsel = false;
					break;
				case true:
					changed = !this.selected || !this.partsel;
					this.selected = true;
					this.partsel = true;
					break;
				case undefined:
					changed = this.selected || !this.partsel;
					this.selected = false;
					this.partsel = true;
					break;
				default:
					_assert(false, "invalid state: " + state);
			}
			// this.debug("fixSelection3AfterLoad() _changeSelectStatusAttrs()", state, changed);
			if (changed) {
				this.renderStatus();
			}
			return changed;
		}
874606
public JobState getState() {
    if (this.completed) {
      if (this.successful) {
        return JobState.SUCCEEDED;
      } else {
        return JobState.FAILED;
      }
    } else {
      return JobState.RUNNING;
    }
    // return JobState.ofInt(this.status.getRunState());
  }
990292
def state(self):
        
        if self.is_active:
            if 'NowPlayingItem' in self.session:
                if self.session['PlayState']['IsPaused']:
                    return STATE_PAUSED
                else:
                    return STATE_PLAYING
            else:
                return STATE_IDLE
        else:
            return STATE_OFF
190302
def _get_state(pkg):
    '''
    
    '''
    cmd = ['opkg', 'status']
    cmd.append(pkg)
    out = __salt__['cmd.run'](cmd, python_shell=False)
    state_flag = ''
    for line in salt.utils.itertools.split(out, '\n'):
        if line.startswith('Status'):
            _status, _state_want, state_flag, _state_status = line.split()

    return state_flag
976132
def get_state():
    
    sdp_state = SDPState()
    errval, errdict = _check_status(sdp_state)
    if errval == "error":
        LOG.debug(errdict['reason'])
        return dict(
            current_state="unknown",
            target_state="unknown",
            last_updated="unknown",
            reason=errdict['reason']
        )
    _last_updated = sdp_state.current_timestamp
    if sdp_state.target_timestamp > _last_updated:
        _last_updated = sdp_state.target_timestamp

    return dict(
        current_state=sdp_state.current_state,
        target_state=sdp_state.target_state,
        allowed_target_states=sdp_state.allowed_target_states[
            sdp_state.current_state],
        last_updated=_last_updated.isoformat()
    ), HTTPStatus.OK
651978
public CmsResourceProjectState getProjectState() {

        if (getResource().getState().isUnchanged()) {
            return STATE_CLEAN; // STATE_CLEAN
        } else if (getLock().getSystemLock().isPublish()) {
            return STATE_LOCKED_FOR_PUBLISHING;
        } else if (getResource().getProjectLastModified().equals(getReferenceProject().getUuid())) {
            return STATE_MODIFIED_IN_CURRENT_PROJECT; // STATE_MODIFIED_CURRENT_PROJECT
        } else {
            return STATE_MODIFIED_IN_OTHER_PROJECT; // STATE_MODIFIED_OTHER_PROJECT
        }
    }
645956
CmsTreeOpenState getVfsTreeState(String treeToken) {

        return (CmsTreeOpenState)(getRequest().getSession().getAttribute(
            getTreeOpenStateAttributeName(I_CmsGalleryProviderConstants.TREE_VFS, treeToken)));
    }
1211566
def get_state(self):
        

        self.step_methods = set()
        for s in self.stochastics:
            self.step_methods |= set(self.step_method_dict[s])

        state = Sampler.get_state(self)
        state['step_methods'] = {}

        # The state of each StepMethod.
        for sm in self.step_methods:
            state['step_methods'][sm._id] = sm.current_state().copy()

        return state
1116452
def state(self, abbr: bool = False) -> str:
        
        return self.random.choice(
            self._data['state']['abbr' if abbr else 'name'])
863680
def _get_instance_state(self):
        
        instance = self._get_instance()
        statuses = instance.instance_view.statuses

        for status in statuses:
            if status.code.startswith('PowerState'):
                return status.display_status