Given a path, returns True if the path should be kept, False if it should be cut.
964779
def keep_path(self, path):
        
        if len(path.addr_trace) < 2:
            return True

        return self.should_take_exit(path.addr_trace[-2], path.addr_trace[-1])
62998
public static boolean checkIsPathOrLinkToSvg(String path) {

        if (path == null) {
            return false;
        }
        path = path.trim().toLowerCase();
        int paramPos = path.indexOf("?");
        if (paramPos >= 0) {
            path = path.substring(0, paramPos);
        }
        return path.endsWith(".svg");
    }
699022
def _pruned(self, path):
    """"""
    if path[0] == '/':
      path = path[1:]
    for rule in reversed(self.pruneRules):
      if isinstance(rule, six.string_types):
        if fnmatch(path, rule):
          return True
      elif rule(path):
        return True
    return False
35594
def is_path(path):
    
    if not isinstance(path, basestring):
        return False
    portal_path = get_path(get_portal())
    if not path.startswith(portal_path):
        return False
    obj = get_object_by_path(path)
    if obj is None:
        return False
    return True
1203
def scary_path(path):
    
    if not path:
        return True
    assert isinstance(path, bytes)
    return not NOT_SCARY.match(path)
479378
def isdir(self, path, follow_symlinks=True):
        
        return self._is_of_type(path, S_IFDIR, follow_symlinks)
1243729
def check_for_unc_path(path):
    
    if (
        os.name == "nt"
        and len(path.drive) > 2
        and not path.drive[0].isalpha()
        and path.drive[1] != ":"
    ):
        return True
    else:
        return False
716348
function maybeSkip(path) {
  if(path.__jsdoc_to_assert_checked__) {
    return true;
  }
  const {node} = path;
  if (node.leadingComments != null && node.leadingComments.length > 0) {
    return false;
  }
  return true;
}
560438
private boolean isWar(String path) {
        String currentDir = Paths.get(".").toAbsolutePath().normalize().toString();
        String classesDirPath = Paths.get(path).toAbsolutePath().normalize().toString();
        return classesDirPath.startsWith(currentDir);
    }
614257
int removePath(int path) {
		int prev = getPrevPath(path);
		int next = getNextPath(path);
		int geometry = getGeometryFromPath(path);
		if (prev != -1)
			setNextPath_(prev, next);
		else {
			setFirstPath_(geometry, next);
		}
		if (next != -1)
			setPrevPath_(next, prev);
		else {
			setLastPath_(geometry, prev);
		}

		clearPath(path);

		setGeometryPathCount_(geometry, getPathCount(geometry) - 1);
		freePath_(path);
		return next;
	}
1269986
function (path) {
    if (fs.existsSync(path) && fs.statSync(path).isDirectory()) {
      return true;
    }
    return false;
  }
444068
public boolean delete(Path path, boolean recursive) throws IOException {
      Path absolute = makeAbsolute(path);
      String srep = absolute.toUri().getPath();
      if (kfsImpl.isFile(srep))
        return kfsImpl.remove(srep) == 0;

      FileStatus[] dirEntries = listStatus(absolute);
      if ((!recursive) && (dirEntries != null) && 
            (dirEntries.length != 0)) {
        throw new IOException("Directory " + path.toString() + 
        " is not empty.");
      }
      if (dirEntries != null) {
        for (int i = 0; i < dirEntries.length; i++) {
          delete(new Path(absolute, dirEntries[i].getPath()), recursive);
        }
      }
      return kfsImpl.rmdir(srep) == 0;
    }
252956
def _CheckIfPathIsValidForDeletion(path, prefix=None, directories=None):
  """"""
  precondition.AssertType(path, Text)
  precondition.AssertType(prefix, Text)

  if prefix and os.path.basename(path).startswith(prefix):
    return True

  path = path.lower()
  for directory in directories or []:
    directory = directory.lower()
    if os.path.commonprefix([directory, path]) == directory:
      return True
  return False
529871
public static function isAllowedAbsPath($path) {
		if (self::isAbsPath($path) &&
				self::validPathStr($path) &&
				(self::isFirstPartOfStr($path, PATH_site)
						||
						($GLOBALS['TYPO3_CONF_VARS']['BE']['lockRootPath'] && self::isFirstPartOfStr($path, $GLOBALS['TYPO3_CONF_VARS']['BE']['lockRootPath']))
				)
		) {
			return TRUE;
		}
	}
535530
def _is_path(s):
    """"""
    if isinstance(s, string_types):
        try:
            return op.exists(s)
        except (OSError, ValueError):
            return False
    else:
        return False
1310944
def _ensure_tree(path):
    
    try:
        os.makedirs(path)
    except OSError as e:
        if e.errno == errno.EEXIST:
            if not os.path.isdir(path):
                raise
            else:
                return False
        elif e.errno == errno.EISDIR:
            return False
        else:
            raise
    else:
        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'));
  }