A method to get a state copy of the library specified via the lib_os_path.

        :param lib_os_path: the location of the library to get a copy for
        :return:
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
672668
def license():
    ''' 

    '''
    from os.path import join
    with open(join(__path__[0], 'LICENSE.txt')) as lic:
        print(lic.read())
301541
def find_library(name, cached=True, internal=True):
    

    # a new one
    if not cached:
        return cdll.LoadLibrary(_so_mapping[name])

    # from the shared internal set or a new one
    if internal:
        if name not in _internal:
            _internal[name] = cdll.LoadLibrary(_so_mapping[name])
        return _internal[name]

    # a shared one
    return getattr(cdll, _so_mapping[name])
1369545
def find_lib_fpath(libname, root_dir, recurse_down=True, verbose=False, debug=False):
    

    def get_lib_fname_list(libname):
        """
        input <libname>: library name (e.g. 'hesaff', not 'libhesaff')
        returns <libnames>: list of plausible library file names
        """
        if sys.platform.startswith('win32'):
            libnames = ['lib' + libname + '.dll', libname + '.dll']
        elif sys.platform.startswith('darwin'):
            libnames = ['lib' + libname + '.dylib']
        elif sys.platform.startswith('linux'):
            libnames = ['lib' + libname + '.so']
        else:
            raise Exception('Unknown operating system: %s' % sys.platform)
        return libnames

    def get_lib_dpath_list(root_dir):
        """
        input <root_dir>: deepest directory to look for a library (dll, so, dylib)
        returns <libnames>: list of plausible directories to look.
        """
        'returns possible lib locations'
        get_lib_dpath_list = [root_dir,
                              join(root_dir, 'lib'),
                              join(root_dir, 'build'),
                              join(root_dir, 'build', 'lib')]
        return get_lib_dpath_list

    lib_fname_list = get_lib_fname_list(libname)
    tried_fpaths = []
    while root_dir is not None:
        for lib_fname in lib_fname_list:
            for lib_dpath in get_lib_dpath_list(root_dir):
                lib_fpath = normpath(join(lib_dpath, lib_fname))
                if exists(lib_fpath):
                    if verbose:
                        print('\n[c] Checked: '.join(tried_fpaths))
                    if debug:
                        print('using: %r' % lib_fpath)
                    return lib_fpath
                else:
                    # Remember which candiate library fpaths did not exist
                    tried_fpaths.append(lib_fpath)
            _new_root = dirname(root_dir)
            if _new_root == root_dir:
                root_dir = None
                break
            else:
                root_dir = _new_root
        if not recurse_down:
            break

    msg = ('\n[C!] load_clib(libname=%r root_dir=%r, recurse_down=%r, verbose=%r)' %
           (libname, root_dir, recurse_down, verbose) +
           '\n[c!] Cannot FIND dynamic library')
    print(msg)
    print('\n[c!] Checked: '.join(tried_fpaths))
    raise ImportError(msg)
373361
def patch_lib_paths(fname, library_dirs):
    
    if sys.platform != 'darwin':
        return
    
    libs = _get_libs(fname)
    for lib in libs:
        if not lib.startswith(('@', '/')):
            real_lib = _find_library(lib, library_dirs)
            if real_lib:
                _install_name_change(fname, lib, real_lib)
262146
def _get_classpath():
    
    try:
        orig_cp = os.environ['CLASSPATH']
    except KeyError:
        return []
    expanded_cp = []
    for i in orig_cp.split(os.path.pathsep):
        expanded_cp.extend(_jar_glob(i))
    return expanded_cp
470238
function getLibStateAccessor(libState) {
      /** The current state name */
      return { get actionName() {
          return libState.actionName;
        }
        /** Is in idle state (no more states to progress to) */
        , get isIdle() {
          return libState.isIdle;
        }
        /** State can be paused manually or via action dispatch or returning null/undefined from timeoutMS function */
        , get isPaused() {
          return libState.isPaused;
        }
        /** The epoch MS that the user was last active */
        , get lastActive() {
          return useFastStore ? fastState.lastActive : libState.lastActive;
        }
        /** Event information captured on the last recorded user action */
        , get lastEvent() {
          return useFastStore ? fastState.lastEvent : libState.lastEvent;
        }
        /** The timeoutID for the current scheduled next event if it exists */
        , get timeoutID() {
          return useFastStore ? fastState.timeoutID : libState.timeoutID;
        }
      };
    }
988746
def get_libs_dir(self, arch):
        ''''''
        ensure_dir(join(self.libs_dir, arch))
        return join(self.libs_dir, arch)
1028148
def get_or_create_home_repo(reset=False):
	
	dosetup = True
	if os.path.exists(ONTOSPY_LOCAL):
		dosetup = False

		if reset:
			import shutil
			var = input("Delete the local library and all of its contents? (y/n) ")
			if var == "y":
				shutil.rmtree(ONTOSPY_LOCAL)
				dosetup = True
			else:
				pass

	if dosetup or not(os.path.exists(ONTOSPY_LOCAL)):
		os.mkdir(ONTOSPY_LOCAL)
	if dosetup or not(os.path.exists(ONTOSPY_LOCAL_CACHE)):
		# print "HERE"
		os.makedirs(ONTOSPY_LOCAL_CACHE)
	if dosetup or not(os.path.exists(ONTOSPY_LOCAL_VIZ)):
		os.mkdir(ONTOSPY_LOCAL_VIZ)
	if dosetup or not(os.path.exists(ONTOSPY_LIBRARY_DEFAULT)):
		os.mkdir(ONTOSPY_LIBRARY_DEFAULT)

	LIBRARY_HOME = get_home_location()  # from init file, or default

	# check that the local library folder exists, otherwise prompt user to create it
	if not(os.path.exists(LIBRARY_HOME)):
		printDebug("Warning: the local library at '%s' has been deleted or is not accessible anymore." % LIBRARY_HOME, "important")
		printDebug("Please reset the local library by running 'ontospy-manager -u <a-valid-path>'", "comment")
		raise SystemExit(1)

	if dosetup:
		print(Fore.GREEN + "Setup successfull: local library created at <%s>" % LIBRARY_HOME + Style.RESET_ALL)
	# else:
		# print(Style.DIM + "Local library: <%s>" % LIBRARY_HOME + Style.RESET_ALL)

	return True
748050
def _load_library(library_names, library_file_extensions,
                  library_search_paths, version_check_callback):
    
    candidates = _find_library_candidates(library_names,
                                          library_file_extensions,
                                          library_search_paths)
    library_versions = []
    for filename in candidates:
        version = version_check_callback(filename)
        if version is not None and version >= (3, 0, 0):
            library_versions.append((version, filename))

    if not library_versions:
        return None
    library_versions.sort()
    return ctypes.CDLL(library_versions[-1][1])
637100
def find_library_file(libname):
    
    # Use a dummy argument parser to get user specified library dirs
    parser = argparse.ArgumentParser(add_help=False)
    parser.add_argument("--library-dirs", "-L", default='')
    args, unknown = parser.parse_known_args()
    user_lib_dirs = args.library_dirs.split(':')
    # Append default search path (not a complete list)
    lib_dirs = user_lib_dirs + [os.path.join(sys.prefix, 'lib'),
                              '/usr/local/lib',
                              '/usr/lib',
                              '/usr/lib/x86_64-linux-gnu']

    compiler = ccompiler.new_compiler()
    return compiler.find_library_file(lib_dirs, libname)
1295518
def __get_container_path(self, host_path):
    
    libname = os.path.split(host_path)[1]
    return os.path.join(_container_lib_location, libname)
368380
def paths_of_libs(some_libs)
      local_libs = Array.new

      some_libs.each do |lib|
        if PrjFileCache.contain?('LIB', lib)
          local_libs << "#{tc.settings['LIB_OUT']}/lib#{lib}.a"
        elsif PrjFileCache.contain?('SOLIB', lib)
          local_libs << "#{tc.settings['LIB_OUT']}/lib#{lib}.so"
        end
      end

      local_libs
    end
1345306
def findLibrary(name):
    
    assert is_unix, "Current implementation for Unix only (Linux, Solaris, AIX)"

    lib = None

    # Look in the LD_LIBRARY_PATH
    lp = compat.getenv('LD_LIBRARY_PATH', '')
    for path in lp.split(os.pathsep):
        libs = glob(os.path.join(path, name + '*'))
        if libs:
            lib = libs[0]
            break

    # Look in /etc/ld.so.cache
    if lib is None:
        expr = r'/[^\(\)\s]*%s\.[^\(\)\s]*' % re.escape(name)
        m = re.search(expr, compat.exec_command('/sbin/ldconfig', '-p'))
        if m:
            lib = m.group(0)

    # Look in the known safe paths
    if lib is None:
        paths = ['/lib', '/usr/lib']
        if is_aix:
            paths.append('/opt/freeware/lib')
        for path in paths:
            libs = glob(os.path.join(path, name + '*'))
            if libs:
                lib = libs[0]
                break

    # give up :(
    if lib is None:
        return None

    # Resolve the file name into the soname
    dir, file = os.path.split(lib)
    return os.path.join(dir, getSoname(lib))
910763
def get_parquet_lib(cls):
        
        if cls.__parquet_lib is None:
            parq_env = os.environ.get('QUILT_PARQUET_LIBRARY', ParquetLib.ARROW.value)
            cls.__parquet_lib = ParquetLib(parq_env)
        return cls.__parquet_lib
59551
def _findSwiplLin():
    

    # Maybe the exec is on path?
    (path, swiHome) = _findSwiplFromExec()
    if path is not None:
        return (path, swiHome)

    # If it is not, use  find_library
    path = _findSwiplPathFromFindLib()
    if path is not None:
        return (path, swiHome)

    # Our last try: some hardcoded paths.
    paths = ['/lib', '/usr/lib', '/usr/local/lib', '.', './lib']
    names = ['libswipl.so', 'libpl.so']

    path = None
    for name in names:
        for try_ in paths:
            try_ = os.path.join(try_, name)
            if os.path.exists(try_):
                path = try_
                break

    if path is not None:
        return (path, swiHome)

    return (None, None)
1098189
def copy(self):
        
        state_copy = State()
        state_copy._state_dict = copy.deepcopy(self._state_dict)
        return state_copy