Checks whether given vislcg_cmd1 is in system's PATH. Returns True, there is 
            a file named  vislcg_cmd1  in the path, otherwise returns False;

            The idea borrows from:  http://stackoverflow.com/a/377028
322872
def check_if_vislcg_is_in_path( self, vislcg_cmd1 ):
        ''' 
        '''
        for path in os.environ["PATH"].split( os.pathsep ):
            path1 = path.strip('"')
            file1 = os.path.join(path1, vislcg_cmd1)
            if os.path.isfile(file1) or os.path.isfile(file1+'.exe'):
               return True
        return False
74521
def is_subpath(path, parent):
  '''
  
  '''

  try:
    relpath = os.path.relpath(path, parent)
  except ValueError:
    return False  # happens on Windows if drive letters don't match
  return relpath == os.curdir or not relpath.startswith(os.pardir)
1302474
def is_valid_file(path):
    '''  '''
    return os.path.exists(path) and os.path.isfile(path)
792153
def isdir(self, path):
        
        try:
            self.remote_context.check_output(["test", "-d", path])
        except subprocess.CalledProcessError as e:
            if e.returncode == 1:
                return False
            else:
                raise
        return True
1186446
public static boolean hasWindowsDrive(String path, boolean slashed) {
    int start = slashed ? 1 : 0;
    return path.length() >= start + 2
        && (!slashed || path.charAt(0) == '/')
        && path.charAt(start + 1) == ':'
        && ((path.charAt(start) >= 'A' && path.charAt(start) <= 'Z') || (path.charAt(start) >= 'a'
        && path.charAt(start) <= 'z'));
  }
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
1189572
def is_root_path(self, filename):
        """"""
        test_filename = filename + '/'
        for root_dir in self.root_dirs:
            if test_filename.startswith(root_dir):
                return True
        return False
598661
def _is_gwf(file_path):
    """"""
    try:
        with open(file_path, 'rb') as f:
            if f.read(4) == b'IGWD':
                return True
    except IOError:
        pass
    return False
957635
def is_disabled_path(path):
    
    for disabled_path in DISABLED_PATHS:
        match = re.search(disabled_path, path[1:])
        if match:
            return True
    return False
550063
def have(cmd):
    """"""

    try:
        # Python 3.3+ only
        from shutil import which
    except ImportError:
        def which(cmd):
            """
            Given a command, return the path which conforms to the given mode
            on the PATH, or None if there is no such file.
            """

            def _access_check(path):
                """
                Check that a given file can be accessed with the correct mode.
                Additionally check that `path` is not a directory.
                """
                return (os.path.exists(path) and os.access(
                    path, os.F_OK | os.X_OK) and not os.path.isdir(path))

            # If we're given a path with a directory part, look it up directly
            # rather than referring to PATH directories. This includes checking
            # relative to the current directory, e.g. ./script
            if os.path.dirname(cmd):
                if _access_check(cmd):
                    return cmd
                return None

            paths = os.environ.get('PATH', os.defpath.lstrip(':')).split(':')

            seen = set()
            for path in paths:
                if path not in seen:
                    seen.add(path)
                    name = os.path.join(path, cmd)
                    if _access_check(name):
                        return name
            return None

    return which(cmd) is not None
644692
public boolean isSystemPath(String name)
    {
        name=name.replace('/','.');
        while(name.startsWith("."))
            name=name.substring(1);

        String[] system_classes=_context.getSystemClasses();
        if (system_classes!=null)
        {
            for (int i=0;i<system_classes.length;i++)
            {
                boolean result=true;
                String c=system_classes[i];
                if (c.startsWith("-"))
                {
                    c=c.substring(1);
                    result=false;
                }
                
                if (c.endsWith("."))
                {
                    if (name.startsWith(c))
                        return result;
                }
                else if (name.equals(c))
                    return result;
            }
        }
        
        return false;
    }
524724
def _path_is_executable_others(path):
    '''
    
    '''
    prevpath = None
    while path and path != prevpath:
        try:
            if not os.stat(path).st_mode & stat.S_IXOTH:
                return False
        except OSError:
            return False
        prevpath = path
        path, _ = os.path.split(path)
    return True
674350
def is_enabled_path(path):
    
    for enabled_path in ENABLED_PATHS:
        match = re.search(enabled_path, path[1:])
        if match:
            return True
    return False
762472
def _is_path_excluded(self, path):
        
        exclude = self._exclude
        if not exclude:
            return False
        basename = os.path.basename(path)
        if self._fnmatch(basename, exclude):
            return True

        absolute_path = os.path.abspath(path)
        match = self._fnmatch(absolute_path, exclude)
        return match
135310
def path_has(self, **kwargs):
            
            str_node    = "/" # This node will always be "False"
            for key, val in kwargs.items():
                if key == 'node':   str_node = val
            if str_node in self.l_cwd:
                return { 'found':   True,
                         'indices': [i for i, x in enumerate(self.l_cwd) if x == str_node]}
            else:
                return { 'found':   False,
                         'indices': [-1]}
199539
def _is_cow(path):
    '''
    
    '''
    dirname = os.path.dirname(path)
    return 'C' not in __salt__['file.lsattr'](dirname)[path]
741163
protected function isSameFilesystem(
        /*# string */ $path1,
        /*# string */ $path2
    )/*# : bool */ {
        return $this->path($path1)->getFilesystem() === $this->path($path2)->getFilesystem();
    }