python/ray/_private/runtime_env/packaging.py
def _dir_travel(
    path: Path,
    excludes: List[Callable],
    handler: Callable,
    logger: Optional[logging.Logger] = default_logger,
):
    """Travels the path recursively, calling the handler on each subpath.

    Respects excludes, which will be called to check if this path is skipped.
    """
    e = _get_gitignore(path)

    if e is not None:
        excludes.append(e)

    skip = any(e(path) for e in excludes)
    if not skip:
        try:
            handler(path)
        except Exception as e:
            logger.error(f"Issue with path: {path}")
            raise e
        if path.is_dir():
            for sub_path in path.iterdir():
                _dir_travel(sub_path, excludes, handler, logger=logger)

    if e is not None:
        excludes.pop()
Travels the path recursively, calling the handler on each subpath.

    Respects excludes, which will be called to check if this path is skipped.
    
Travels the path recursively, calling the handler on each subpath.
Respects excludes, which will be called to check if this path is skipped.
Travels the path recursively calling the handler on each subpath . Respects excludes which will be called to check if this path is skipped .
def _dir_travel(
    path: Path,
    excludes: List[Callable],
    handler: Callable,
    logger: Optional[logging.Logger] = default_logger,
):
    e = _get_gitignore(path)
    if e is not None:
        excludes.append(e)
    skip = any(e(path) for e in excludes)
    if not skip:
        try:
            handler(path)
        except Exception as e:
            logger.error(f"Issue with path: {path}")
            raise e
        if path.is_dir():
            for sub_path in path.iterdir():
                _dir_travel(sub_path, excludes, handler, logger=logger)
    if e is not None:
        excludes.pop()
def _dir_travel ( path : Path , excludes : List [ Callable ] , handler : Callable , logger : Optional [ logging . Logger ] = default_logger , ) : e = _get_gitignore ( path ) if e is not None : excludes . append ( e ) skip = any ( e ( path ) for e in excludes ) if not skip : try : handler ( path ) except Exception as e : logger . error ( f"Issue with path: {path}" ) raise e if path . is_dir ( ) : for sub_path in path . iterdir ( ) : _dir_travel ( sub_path , excludes , handler , logger = logger ) if e is not None : excludes . pop ( )
Travels the path recursively, calling the handler on each subpath.
Travels the path recursively calling the handler on each subpath .
"""Travels the path recursively, calling the handler on each subpath.

    Respects excludes, which will be called to check if this path is skipped.
    """
path
Path
excludes
List[Callable]
handler
Callable
logger
Optional[logging.Logger]