Checks whether the path is valid for Message Descriptor.
350663
def _IsValidPath(message_descriptor, path):
  """"""
  parts = path.split('.')
  last = parts.pop()
  for name in parts:
    field = message_descriptor.fields_by_name[name]
    if (field is None or
        field.label == FieldDescriptor.LABEL_REPEATED or
        field.type != FieldDescriptor.TYPE_MESSAGE):
      return False
    message_descriptor = field.message_type
  return last in message_descriptor.fields_by_name
242639
function doesPathExist(pathToVerify) {
    let pathExists = true;

    try {
        fs.accessSync(pathToVerify);
    } catch (error) {
        pathExists = false;
    }

    return pathExists;
}
60424
private void checkArguments(final MetadataParserPath path, final List<?> confList) {
        if (path == null) {
            throw new IllegalArgumentException("Invalid configuration. The 'path' element missing!");
        } else if (confList == null) {
            throw new IllegalArgumentException(
                "Invalid configuration. At least one 'descriptor' element has to be defined!");
        } else if (confList.isEmpty()) {
            throw new IllegalArgumentException(
                "Invalid configuration. At least one 'descriptor' element has to be defined!");
        }

    }
909333
def match(msg)
      if @type
        if { Message::SIGNAL => "signal", Message::METHOD_CALL => "method_call",
             Message::METHOD_RETURN => "method_return",
             Message::ERROR => "error" }[msg.message_type] != @type
          return false
        end
      end
      return false if @interface && @interface != msg.interface
      return false if @member && @member != msg.member
      return false if @path && @path != msg.path
      # FIXME: sender and destination are ignored
      true
    end
345050
def validate_path(path):
        

        if not isinstance(path, six.string_types) or not re.match('^/(?:[._a-zA-Z0-9-]/?)+[^/]$', path):
            raise InvalidUsage(
                "Path validation failed - Expected: '/<component>[/component], got: %s" % path
            )

        return True
1348535
protected String checkValidAliasPath(String path, Locale locale) {

        if (org.opencms.db.CmsAlias.ALIAS_PATTERN.matcher(path).matches()) {
            return null;
        } else {
            return Messages.get().getBundle(locale).key(Messages.ERR_ALIAS_INVALID_PATH_0);
        }
    }
487494
def check_file_existence(path):
    

    pathvalidate.validate_file_path(path)

    if not os.path.lexists(path):
        raise FileNotFoundError(path)

    if os.path.isfile(path):
        logger.debug("file found: " + path)
        return FileType.FILE

    if os.path.isdir(path):
        logger.debug("directory found: " + path)
        return FileType.DIRECTORY

    if os.path.islink(path):
        logger.debug("link found: " + path)
        return FileType.LINK

    raise RuntimeError()
535530
def _is_path(s):
    """"""
    if isinstance(s, string_types):
        try:
            return op.exists(s)
        except (OSError, ValueError):
            return False
    else:
        return False
1177085
function isValidPath(path, allowDots)
	{
		if (typeof path !== 'string')
			return false;
		if (!path)
			return false;
		if (!/^([a-z]:[\/\\])?[a-z0-9_~\/\.\-]+$/i.test(path))
			return false;
		if (!allowDots && /^\.{1,2}$/.test(path))
			return false;

		return true;
	}
434971
def check_has_path(self, api):
        ''''''
        if not hasattr(api, 'path'):
            msg = 'The Api class "{}" lacks a `path` attribute.'
            return [msg.format(api.__name__)]
1164157
def is_valid_folder(parser, arg):
    """"""
    arg = os.path.abspath(arg)
    if not os.path.isdir(arg):
        parser.error("The folder %s does not exist!" % arg)
    else:
        return arg
72323
function(destPath) {
    this.checkDestDir(destPath);
    var exists = existsSync(destPath);
    // we warn if
    // if (exists) {
    //   this.ui.writeLine('The destination path: ' + destPath + ' already exists. Cannot overrwrite.', 'WARNING');
    // }

    return {
      destExists: exists,
      destDir: this.createDestDir
    };
  }
58216
private boolean isDirectoryTraverse(StringBuffer path)
	{
			
		boolean directoryTraverse = false;
			
		String matchString = path.toString();
			
		//PM82876 Start
		if (WCCustomProperties.ALLOW_DOTS_IN_NAME) {
		    // The fileName can have .. , check for the failing conditions only.
		    if (matchString.indexOf("..") > -1) {
		        if( (matchString.indexOf("/../") > -1) || (matchString.indexOf("\\..\\") > -1) || 
		                        matchString.startsWith("../") || matchString.endsWith("/..") || 
		                        matchString.startsWith("..\\")|| matchString.endsWith("\\..")) 
		        {
		            directoryTraverse = true;
		            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
		                logger.logp(Level.FINE, CLASS_NAME, "isDirectoryTraverse", "bad path :" + matchString);
		        }
		    }    
		}
                else{//PM82876 End

                    /**
                     * Do not allow ".." to appear in a path as it allows one to serve files from anywhere within
                     * the file system.
                     * Also check to see if the path or URI ends with '/', '\', or '.' .
                     * PQ44346 - Allow files on DFS to be served.
                     */
                    if ( (matchString.lastIndexOf("..") != -1) && (!matchString.startsWith("/...") )) 
                    {
                        directoryTraverse = true;
                    }

                }
		if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE))
			logger.logp(Level.FINE, CLASS_NAME,"isDirectoryTraverse", "returning" + directoryTraverse + " , matchstring :" + matchString);
			
		return directoryTraverse;
	}
550017
def is_valid(container, path):
    
    try:
        tmp_hash_path = container.filename + ".hash"
        with open(tmp_hash_path, 'r') as tmp_file:
            tmp_hash = tmp_file.readline()
    except IOError:
        LOG.info("No .hash-file in the tmp-directory.")

    container_hash_path = local.path(path) / "gentoo.tar.bz2.hash"
    if container_hash_path.exists():
        with open(container_hash_path, 'r') as hash_file:
            container_hash = hash_file.readline()
            return container_hash == tmp_hash
    return False
1119812
def _is_path_match(req_path: str, cookie_path: str) -> bool:
        """"""
        if not req_path.startswith("/"):
            req_path = "/"

        if req_path == cookie_path:
            return True

        if not req_path.startswith(cookie_path):
            return False

        if cookie_path.endswith("/"):
            return True

        non_matching = req_path[len(cookie_path):]

        return non_matching.startswith("/")
1246406
public static boolean validatePath(String path) {
        if(path == null) {
            Log.w(TAG, "Uploading path not set");
            return false;
        }

        try {
            uriFromString(path);
            return true;
        } catch(DataSinkException e) {
            return false;
        }
    }
551496
def specific_path_check(path, opt):
    """"""
    if opt.exclude:
        if path in opt.exclude:
            return False

    if opt.include:
        if path not in opt.include:
            return False

    return True