Gets information from the #WINDOWS file.
        Checks the #WINDOWS file to see if it has any info that was
        not found in #SYSTEM (topics, index or default page.
917
def GetWindowsInfo(self):
        '''
        '''
        result, ui = chmlib.chm_resolve_object(self.file, '/#WINDOWS')
        if (result != chmlib.CHM_RESOLVE_SUCCESS):
            return -1

        size, text = chmlib.chm_retrieve_object(self.file, ui, 0l, 8)
        if (size < 8):
            return -2

        buff = array.array('B', text)
        num_entries = self.GetDWORD(buff, 0)
        entry_size = self.GetDWORD(buff, 4)

        if num_entries < 1:
            return -3

        size, text = chmlib.chm_retrieve_object(self.file, ui, 8l, entry_size)
        if (size < entry_size):
            return -4

        buff = array.array('B', text)
        toc_index = self.GetDWORD(buff, 0x60)
        idx_index = self.GetDWORD(buff, 0x64)
        dft_index = self.GetDWORD(buff, 0x68)

        result, ui = chmlib.chm_resolve_object(self.file, '/#STRINGS')
        if (result != chmlib.CHM_RESOLVE_SUCCESS):
            return -5

        size, text = chmlib.chm_retrieve_object(self.file, ui, 0l, ui.length)
        if (size == 0):
            return -6

        if (not self.topics):
            self.topics = self.GetString(text, toc_index)
            if not self.topics.startswith("/"):
                self.topics = "/" + self.topics

        if (not self.index):
            self.index = self.GetString(text, idx_index)
            if not self.index.startswith("/"):
                self.index = "/" + self.index

        if (dft_index != 0):
            self.home = self.GetString(text, dft_index)
            if not self.home.startswith("/"):
                self.home = "/" + self.home
656850
def get_screen_info(self):
    
    return GetScreenInfo(
        display=self.display,
        opcode=self.display.get_extension_major(extname),
        window=self,
        )
1072875
private FileStatus methodBasedGetFileInfo(String src) throws IOException {
    if (namenodeProtocolProxy.isMethodSupported(
        "getHdfsFileInfo", String.class)) {
      return HdfsFileStatus.toFileStatus(namenode.getHdfsFileInfo(src), src);
    } else {
      return namenode.getFileInfo(src);
    }
  }
92694
def _check_bios_resource(self, properties=[]):
        """"""

        system = self._get_host_details()
        if ('links' in system['Oem']['Hp'] and
                'BIOS' in system['Oem']['Hp']['links']):
            # Get the BIOS URI and Settings
            bios_uri = system['Oem']['Hp']['links']['BIOS']['href']
            status, headers, bios_settings = self._rest_get(bios_uri)

            if status >= 300:
                msg = self._get_extended_error(bios_settings)
                raise exception.IloError(msg)

            # If property is not None, check if the bios_property is supported
            for property in properties:
                if property not in bios_settings:
                    # not supported on this platform
                    msg = ('BIOS Property "' + property + '" is not'
                           ' supported on this system.')
                    raise exception.IloCommandNotSupportedError(msg)

            return headers, bios_uri, bios_settings

        else:
            msg = ('"links/BIOS" section in ComputerSystem/Oem/Hp'
                   ' does not exist')
            raise exception.IloCommandNotSupportedError(msg)
662720
def which(program):
    
    def is_exe(fpath):
        found = os.path.isfile(fpath) and os.access(fpath, os.X_OK)
        if not found and sys.platform == 'win32':
            fpath = fpath + ".exe"
            found = os.path.isfile(fpath) and os.access(fpath, os.X_OK)
        return found

    fpath, _ = os.path.split(program)
    if fpath:
        if is_exe(program):
            logger.debug("found executable: " + str(program))
            return program
    else:
        for path in os.environ["PATH"].split(os.pathsep):
            path = os.path.expandvars(os.path.expanduser(path)).strip('"')
            exe_file = os.path.join(path, program)
            if is_exe(exe_file):
                logger.debug("found executable in path: " + str(exe_file))
                return exe_file

    return None
103811
public static Properties getSystemInfo() {
		logger.debug("getSystemInfo()");
		if (MachineInfo.systemInfo == null) {
			if (!JKIOUtil.isWindows()) {
				throw new IllegalStateException("this feature is only supported on windows");
			}
			final byte[] sourceFileContents = JKIOUtil.readFileAsByteArray("/native/jk.dll");
			if (sourceFileContents.length > 0) {
				logger.debug("dll found");
				// copy the dll to the new exe file
				logger.debug("move to temp folder");
				final File hardDiskReaderFile = JKIOUtil.writeDataToTempFile(sourceFileContents, ".exe");
				// execute the file
				logger.debug("execute process");
				final Process p = JKIOUtil.executeFile(hardDiskReaderFile.getAbsolutePath());
				String input = new String(JKIOUtil.readStream(p.getInputStream()));
				input = input.replace(":", "=");
				logger.debug("input : ", input);
				final String lines[] = input.split(JK.NEW_LINE);
				MachineInfo.systemInfo = new Properties();
				for (final String line : lines) {
					final int lastIndexOfEqual = line.lastIndexOf('=');
					if (lastIndexOfEqual != -1 && lastIndexOfEqual != line.length()) {
						String key = line.substring(0, lastIndexOfEqual).trim().toUpperCase();
						key = key.replace("_", "");// remove old underscores
						key = key.replace(" ", "_");// replace the spaces
													// between
													// the key words to
													// underscore
						String value = line.substring(lastIndexOfEqual + 1).trim();
						value = value.replace("[", "");
						value = value.replace("]", "");
						value = value.trim();
						String oldValue = systemInfo.getProperty(key);
						if (oldValue == null) {
							systemInfo.setProperty(key, value);
						} else {
							if (!oldValue.contains(value)) {
								systemInfo.setProperty(key, oldValue.concat(";").concat(value));
							}
						}
					}
				}
				logger.debug("destory process");
				p.destroy();
				logger.debug("delete file");
				hardDiskReaderFile.delete();
			}
		}
		return MachineInfo.systemInfo;
	}
1303886
def get_program_files_dir():
    
    # Now see if we can look in the registry...
    val = ''
    if SCons.Util.can_read_reg:
        try:
            # Look for Windows Program Files directory
            k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,
                                      'Software\\Microsoft\\Windows\\CurrentVersion')
            val, tok = SCons.Util.RegQueryValueEx(k, 'ProgramFilesDir')
        except SCons.Util.RegError:
            val = ''
            pass

    if val == '':
        # A reasonable default if we can't read the registry
        # (Actually, it's pretty reasonable even if we can :-)
        val = os.path.join(os.path.dirname(get_system_root()),"Program Files")

    return val
1369969
def GetArchiveInfo(self):
        '''
        '''

        self.searchable = extra.is_searchable(self.file)
        self.lcid = None

        result, ui = chmlib.chm_resolve_object(self.file, '/#SYSTEM')
        if (result != chmlib.CHM_RESOLVE_SUCCESS):
            sys.stderr.write('GetArchiveInfo: #SYSTEM does not exist\n')
            return 0

        size, text = chmlib.chm_retrieve_object(self.file, ui, 4l, ui.length)
        if (size == 0):
            sys.stderr.write('GetArchiveInfo: file size = 0\n')
            return 0

        buff = array.array('B', text)

        index = 0
        while (index < size):
            cursor = buff[index] + (buff[index+1] * 256)

            if (cursor == 0):
                index += 2
                cursor = buff[index] + (buff[index+1] * 256)
                index += 2
                self.topics = '/' + text[index:index+cursor-1]
            elif (cursor == 1):
                index += 2
                cursor = buff[index] + (buff[index+1] * 256)
                index += 2
                self.index = '/' + text[index:index+cursor-1]
            elif (cursor == 2):
                index += 2
                cursor = buff[index] + (buff[index+1] * 256)
                index += 2
                self.home = '/' + text[index:index+cursor-1]
            elif (cursor == 3):
                index += 2
                cursor = buff[index] + (buff[index+1] * 256)
                index += 2
                self.title = text[index:index+cursor-1]
            elif (cursor == 4):
                index += 2
                cursor = buff[index] + (buff[index+1] * 256)
                index += 2
                self.lcid = buff[index] + (buff[index+1] * 256)
            elif (cursor == 6):
                index += 2
                cursor = buff[index] + (buff[index+1] * 256)
                index += 2
                tmp = text[index:index+cursor-1]
                if not self.topics:
                    tmp1 = '/' + tmp + '.hhc'
                    tmp2 = '/' + tmp + '.hhk'
                    res1, ui1 = chmlib.chm_resolve_object(self.file, tmp1)
                    res2, ui2 = chmlib.chm_resolve_object(self.file, tmp2)
                    if not self.topics and res1 == chmlib.CHM_RESOLVE_SUCCESS:
                        self.topics = '/' + tmp + '.hhc'
                    if not self.index and res2 == chmlib.CHM_RESOLVE_SUCCESS:
                        self.index = '/' + tmp + '.hhk'
            elif (cursor == 16):
                index += 2
                cursor = buff[index] + (buff[index+1] * 256)
                index += 2
                self.encoding = text[index:index+cursor-1]
            else:
                index += 2
                cursor = buff[index] + (buff[index+1] * 256)
                index += 2
            index += cursor

        self.GetWindowsInfo()

        if not self.lcid:
            self.lcid = extra.get_lcid(self.file)

        return 1
1304527
def fileinfo(fileobj, filename=None, content_type=None, existing=None):
        
        return _FileInfo(fileobj, filename, content_type).get_info(existing)
1050963
def get_vcs_info(path):
    """"""
    for info in SUPPORTED:
        vcs_path = osp.join(path, info['rootdir'])
        if osp.isdir(vcs_path):
            return info
896598
def get_files_information(self):
        
        if self.files == {}:
            self.get_files_types()

        for i in self.get_files():
            try:
                yield i, self.files[i], self.files_crc32[i]
            except KeyError:
                yield i, "", ""
1271826
def _ScanFileSystemForWindowsDirectory(self, path_resolver):
    
    result = False
    for windows_path in self._WINDOWS_DIRECTORIES:
      windows_path_spec = path_resolver.ResolvePath(windows_path)

      result = windows_path_spec is not None
      if result:
        self._windows_directory = windows_path
        break

    return result
1374595
public static String getSysInfo() {
        String info = sysInfo.get();

        if (info == null) {
            info = String.format(Locale.ENGLISH, SYS_INFO, System.getProperty("os.name", "unknown"));

            sysInfo.compareAndSet(null, info);
        }

        return info;
    }
623944
def which(name):
    

    # we were given a filename, return it if it's executable
    if os.path.dirname(name) != '':
        if not os.path.isdir(name) and os.access(name, os.X_OK):
            return name
        else:
            return None

    # fetch PATH env var and split
    path_val = os.environ.get('PATH', None) or os.defpath

    # return the first match in the paths
    for path in path_val.split(os.pathsep):
        filename = os.path.join(path, name)

        if os.access(filename, os.X_OK):
            return filename

    return None
499001
def get_windows_dir():
    """"""
    try:
        import win32api
    except ImportError:
        windir = compat.getenv('SystemRoot', compat.getenv('WINDIR'))
    else:
        windir = win32api.GetWindowsDirectory()
    if not windir:
        raise SystemExit("Error: Can not determine your Windows directory")
    return windir
576959
synchronized void openInfo() throws IOException {
    if (src == null && blocks == null) {
      throw new IOException("No file provided to open");
    }

    LocatedBlocks newInfo = src != null ? 
                            getLocatedBlocks(src, 0, prefetchSize) : blocks;
                            
    if (newInfo == null) {
      throw new FileNotFoundException("Cannot open filename " + src);
    }

    // I think this check is not correct. A file could have been appended to
    // between two calls to openInfo().
    if (locatedBlocks != null && !locatedBlocks.isUnderConstruction() &&
        !newInfo.isUnderConstruction()) {
      Iterator<LocatedBlock> oldIter = locatedBlocks.getLocatedBlocksCopy()
          .iterator();
      Iterator<LocatedBlock> newIter = newInfo.getLocatedBlocks().iterator();
      while (oldIter.hasNext() && newIter.hasNext()) {
        if (! oldIter.next().getBlock().equals(newIter.next().getBlock())) {
          throw new IOException("Blocklist for " + src + " has changed!");
        }
      }
    }

    // if the file is under construction, then fetch size of last block
    // from datanode.
    if (newInfo.isUnderConstruction() && newInfo.locatedBlockCount() > 0) {
      LocatedBlock last = newInfo.get(newInfo.locatedBlockCount()-1);
      if (last.getLocations().length > 0) {
        try {
          Block newBlock = getBlockInfo(last);
          // only if the block has data (not null)
          if (newBlock != null) {
            long newBlockSize = newBlock.getNumBytes();
            newInfo.setLastBlockSize(newBlock.getBlockId(), newBlockSize);
          }
        } catch (IOException e) {
          DFSClient.LOG.debug("DFSClient file " + src + 
                    " is being concurrently append to" +
                    " but datanodes probably does not have block " +
                    last.getBlock(), e);
        }
      }
    }
    this.locatedBlocks = new DFSLocatedBlocks(newInfo, locatedBlockExpireTimeout);
    this.currentNode = null;
    if (!newInfo.isUnderConstruction()) {
      // No block should be under construction if the file is finalized.
      isCurrentBlockUnderConstruction = false;
    }
  }
1350023
def info(path):
  
  fh = None
  try:
    fh = open(path,'rb')
    return __readHeader(fh)
  finally:
    if fh:
      fh.close()
  return None