def _which(name, PATH=None, exit=0):
    '''Find fully qualified path for a file.
    '''
    n = os.path.expanduser(name)
    if os.path.isabs(n):
        return n
    p = PATH or os.environ.get('PATH', '')
    for d in p.split(os.pathsep):
        f = os.path.join(d, n)
        if os.path.isfile(f):
            return f
    if exit:
        _print("utility %r missing", name)
        sys.exit(exit)
    return None
Find fully qualified path for a file.
    
recipes/Python/534147_backtrace2line__stack_traces_source_file_name/recipe-534147.py