Checks if a scheme is present.
If no scheme is found, it is assumed that a local path is used, and file:// is prepended.
181172
private function addFileSchemeWhenSchemeIsAbsent(string $uri): string
    {
        $scheme = parse_url($uri, PHP_URL_SCHEME);

        if (empty($scheme)) {
            $uri = 'file://' . $uri;
        } elseif (preg_match('/^[a-z]$/i', (string) $scheme)) { // windows driver letter
            $uri = 'file:///' . $uri;
        }

        return $uri;
    }
1335178
function isIncludeFile( path ) {
            if ( fs.statSync( path ).isFile() &&
                getIncludeFileExtensions().indexOf( getFileExtension( path ) ) !== - 1 ) return true;

            return false;
        }
476329
def is_scheme(scheme, slashes=True):
    """"""
    scheme = scheme.lower()
    if slashes:
        return scheme in URI_SCHEMES
    return scheme in URI_SCHEMES and not URI_SCHEMES[scheme]
317779
def _checkpath(self, path):
        
        if path.startswith("/") or ".." in path or path.strip() != path:
            raise NotFoundException()
1308126
protected void checkHttpSchemeSpecificPartSlashPrefix(final URI base,
            final String scheme, final String schemeSpecificPart)
    throws URIException {
        if (scheme == null || scheme.length() <= 0) {
            return;
        }
        if (!scheme.equals("http") && !scheme.equals("https")) {
            return;
        }
        if ( schemeSpecificPart == null 
                || !schemeSpecificPart.startsWith("//")) {
            // only acceptable if schemes match
            if (base == null || !scheme.equals(base.getScheme())) {
                throw new URIException(
                        "relative URI with scheme only allowed for " +
                        "scheme matching base");
            } 
            return; 
        }
        if (schemeSpecificPart.length() <= 2) {
            throw new URIException("http scheme specific part is " +
                "too short: " + schemeSpecificPart);
        }
    }
543312
function checkContainsPathComponent(dirs, path) {
    return _.find(dirs, function(dir) {
      var v = path.indexOf(dir);
      return v == 0;
    });
  }
375555
function isDirectory(filePath) {
  if (!isExist(filePath)) return false;
  try {
    const stat = fs.statSync(filePath);
    return stat.isDirectory();
  } catch (e) {
    return false;
  }
}
1079722
def check_path(file_path):
    '''
        
    '''
    directory = os.path.dirname(file_path)
    if directory != '':
        if not os.path.exists(directory):
            os.makedirs(directory, 0o775)
1041524
function isDirectory(filePath, callback) {
  try {
    fs.stat(filePath, function (err, data) {
      if (err) {
        callback(null, false);
      } else {
        callback(null, data.isDirectory());
      }
    });
  } catch (e) {
    callback(null, false);
  }
}
83229
public final boolean isFileAllowedForPreprocessing(@Nullable final File file) {
    boolean result = false;
    if (file != null && file.isFile() && file.length() != 0L) {
      result = this.extensions.contains(PreprocessorUtils.getFileExtension(file));
    }
    return result;
  }
1219937
def is_valid_dir(path):
    '''  '''
    return os.path.exists(path) and os.path.isdir(path)
600554
protected void checkPath(Path path) {
    URI uri = path.toUri();
    if (uri.getScheme() == null)                // fs is relative 
      return;
    String thisScheme = this.getUri().getScheme();
    String thatScheme = uri.getScheme();
    String thisAuthority = this.getUri().getAuthority();
    String thatAuthority = uri.getAuthority();
    //authority and scheme are not case sensitive
    if (thisScheme.equalsIgnoreCase(thatScheme)) {// schemes match
      if (thisAuthority == thatAuthority ||       // & authorities match
          (thisAuthority != null && 
           thisAuthority.equalsIgnoreCase(thatAuthority)))
        return;

      if (thatAuthority == null &&                // path's authority is null
          thisAuthority != null) {                // fs has an authority
        URI defaultUri = getDefaultUri(getConf()); // & is the conf default 
        if (thisScheme.equalsIgnoreCase(defaultUri.getScheme()) &&
            thisAuthority.equalsIgnoreCase(defaultUri.getAuthority()))
          return;
        try {                                     // or the default fs's uri
          defaultUri = get(getConf()).getUri();
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
        if (thisScheme.equalsIgnoreCase(defaultUri.getScheme()) &&
            thisAuthority.equalsIgnoreCase(defaultUri.getAuthority()))
          return;
      }
    }
    throw new IllegalArgumentException("Wrong FS: "+path+
                                       ", expected: "+this.getUri());
  }
275163
def check_path(self, path):
        
        path = os.path.abspath(path)
        if os.path.exists(path):
            return path
        else:
            utils.die("input file does not exists:\n  {}".format(path))
851261
private static void checkFile(File file) {
		if (false == file.exists()) {
			throw new UtilException("File [{}] not exist !", file.getAbsolutePath());
		}
		if (false == file.isFile()) {
			throw new UtilException("Path [{}] is not a file !", file.getAbsolutePath());
		}
	}
311004
def check_path(path, otherwise):
    

    if os.path.exists(path):
        print("WARNING: Path '%s' already exists; skipping" % path)
    else:
        otherwise(path)
1055596
def _ensure_url_has_path(self, url):
        
        inx = url.find('://')
        if inx > 0:
            rest = url[inx + 3:]
        elif url.startswith('//'):
            rest = url[2:]
        else:
            rest = url

        if '/' in rest:
            return url

        scheme, netloc, path, query, frag = urlsplit(url)
        if not path:
            path = '/'

        url = urlunsplit((scheme, netloc, path, query, frag))
        return url
350992
def file_exists?(file_path)
      if @site.respond_to?(:in_source_dir)
        File.exist? @site.in_source_dir(file_path)
      else
        File.exist? Bunto.sanitized_path(@site.source, file_path)
      end
    end