{"body":"BASH=/bin/bash\nBASH_ARGC=()\nBASH_ARGV=()\nBASH_LINENO=()\nBASH_REMATCH=([0]=\"c\")\nBASH_SOURCE=()\nBASH_VERSINFO=([0]=\"3\" [1]=\"2\" [2]=\"57\" [3]=\"1\" [4]=\"release\" [5]=\"arm64-apple-darwin21\")\nBASH_VERSION='3.2.57(1)-release'\nCOLUMNS=144\nDIRSTACK=()\nEDITOR=emacs\nEUID=503\nGROUPS=()\nHISTFILE=/Users/dev/.bash_sessions/2E20C5EC-DF17-48E4-BF13-C624F657F800.historynew\nHISTFILESIZE=100000\nHISTSIZE=100000\nHOME=/Users/dev\nHOSTNAME=MacBook-Pro.local\nHOSTTYPE=arm64\nIFS=$' \\t\\n'\nJAVA_HOME='/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/'\nLANG=en_US.UTF-8\nLINES=51\nLOGNAME=dev\nMACHTYPE=arm64-apple-darwin21\nMAILCHECK=60\nOLDPWD=/Users/dev/src/pypy\nOPTERR=1\nOPTIND=1\nOSTYPE=darwin21\nPATH='/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/opt/homebrew/bin/:/Users/dev/Library/Python/2.7/bin:/Users/dev/bin:/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/'\nPIPESTATUS=([0]=\"127\")\nPPID=99834\nPROMPT_COMMAND=update_terminal_cwd\nPS1='\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ '\nPS2='\\[\\033[01;32m\\]>\\[\\033[00m\\] '\nPS4='+ '\nPWD=/Users/dev/src/pypy/pypy/doc\nRC=0\nSHELL=/bin/bash\nSHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor\nSHELL_SESSION_DID_HISTORY_CHECK=1\nSHELL_SESSION_DID_INIT=1\nSHELL_SESSION_DIR=/Users/dev/.bash_sessions\nSHELL_SESSION_FILE=/Users/dev/.bash_sessions/2E20C5EC-DF17-48E4-BF13-C624F657F800.session\nSHELL_SESSION_HISTFILE=/Users/dev/.bash_sessions/2E20C5EC-DF17-48E4-BF13-C624F657F800.history\nSHELL_SESSION_HISTFILE_NEW=/Users/dev/.bash_sessions/2E20C5EC-DF17-48E4-BF13-C624F657F800.historynew\nSHELL_SESSION_HISTFILE_SHARED=/Users/dev/.bash_history\nSHELL_SESSION_HISTORY=1\nSHELL_SESSION_TIMESTAMP_FILE=/Users/dev/.bash_sessions/_expiration_check_timestamp\nSHLVL=1\nSSH_AUTH_SOCK=/private/tmp/com.apple.launchd.90lbhaVAwh/Listeners\nTERM=xterm-256color\nTERM_PROGRAM=Apple_Terminal\nTERM_PROGRAM_VERSION=443\nTERM_SESSION_ID=2E20C5EC-DF17-48E4-BF13-C624F657F800\nTMPDIR=/var/folders/66/k55ys14j43x_r373lwl1cv6w0000gq/T/\nUID=503\nUSER=dev\nVIRTUALENVWRAPPER_ENV_BIN_DIR=bin\nVIRTUALENVWRAPPER_HOOK_DIR=/Users/dev/.virtualenvs\nVIRTUALENVWRAPPER_PROJECT_FILENAME=.project\nVIRTUALENVWRAPPER_PYTHON=/opt/homebrew/Cellar/virtualenvwrapper/4.8.4_1/libexec/bin/python\nVIRTUALENVWRAPPER_SCRIPT=/opt/homebrew/Cellar/virtualenvwrapper/4.8.4_1/libexec/bin/virtualenvwrapper.sh\nVIRTUALENVWRAPPER_VIRTUALENV=virtualenv\nVIRTUALENVWRAPPER_VIRTUALENV_CLONE=virtualenv-clone\nVIRTUALENVWRAPPER_WORKON_CD=1\nWORKON_HOME=/Users/dev/.virtualenvs\nXPC_FLAGS=0x0\nXPC_SERVICE_NAME=0\n_=environ\n__CFBundleIdentifier=com.apple.Terminal\n_cdsitepackages_complete () \n{ \n    local cur=\"$2\";\n    COMPREPLY=($(cdsitepackages && compgen -d -- \"${cur}\" ))\n}\n_cdvirtualenv_complete () \n{ \n    local cur=\"$2\";\n    COMPREPLY=($(cdvirtualenv && compgen -d -- \"${cur}\" ))\n}\n_lsvirtualenv_usage () \n{ \n    echo \"lsvirtualenv [-blh]\";\n    echo \"  -b -- brief mode\";\n    echo \"  -l -- long mode\";\n    echo \"  -h -- this help message\"\n}\n_virtualenvs () \n{ \n    local cur=\"${COMP_WORDS[COMP_CWORD]}\";\n    COMPREPLY=($(compgen -W \"`virtualenvwrapper_show_workon_options`\" -- ${cur}))\n}\nadd2virtualenv () \n{ \n    virtualenvwrapper_verify_workon_home || return 1;\n    virtualenvwrapper_verify_active_environment || return 1;\n    site_packages=\"`virtualenvwrapper_get_site_packages_dir`\";\n    if [ ! -d \"${site_packages}\" ]; then\n        echo \"ERROR: currently-active virtualenv does not appear to have a site-packages directory\" 1>&2;\n        return 1;\n    fi;\n    path_file=\"$site_packages/_virtualenv_path_extensions.pth\";\n    if [ \"$*\" = \"\" ]; then\n        echo \"Usage: add2virtualenv dir [dir ...]\";\n        if [ -f \"$path_file\" ]; then\n            echo;\n            echo \"Existing paths:\";\n            cat \"$path_file\" | grep -v \"^import\";\n        fi;\n        return 1;\n    fi;\n    remove=0;\n    if [ \"$1\" = \"-d\" ]; then\n        remove=1;\n        shift;\n    fi;\n    if [ ! -f \"$path_file\" ]; then\n        echo \"import sys; sys.__plen = len(sys.path)\" > \"$path_file\" || return 1;\n        echo \"import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)\" >> \"$path_file\" || return 1;\n    fi;\n    for pydir in \"$@\";\n    do\n        absolute_path=\"$(virtualenvwrapper_absolutepath \"$pydir\")\";\n        if [ \"$absolute_path\" != \"$pydir\" ]; then\n            echo \"Warning: Converting \\\"$pydir\\\" to \\\"$absolute_path\\\"\" 1>&2;\n        fi;\n        if [ $remove -eq 1 ]; then\n            sed -i.tmp \"\\:^$absolute_path$: d\" \"$path_file\";\n        else\n            sed -i.tmp '1 a\\\n'\"$absolute_path\"'\n' \"$path_file\";\n        fi;\n        rm -f \"${path_file}.tmp\";\n    done;\n    return 0\n}\nallvirtualenv () \n{ \n    virtualenvwrapper_verify_workon_home || return 1;\n    typeset d;\n    IFS='%';\n    virtualenvwrapper_show_workon_options | while read d; do\n        [ ! -d \"$WORKON_HOME/$d\" ] && continue;\n        echo \"$d\";\n        echo \"$d\" | sed 's/./=/g';\n        ( source \"$WORKON_HOME/$d/$VIRTUALENVWRAPPER_ENV_BIN_DIR/activate\";\n        virtualenvwrapper_cd \"$VIRTUAL_ENV\";\n        \"$@\" );\n        echo;\n    done;\n    unset IFS\n}\ncdproject () \n{ \n    virtualenvwrapper_verify_workon_home || return 1;\n    virtualenvwrapper_verify_active_environment || return 1;\n    if [ -f \"$VIRTUAL_ENV/$VIRTUALENVWRAPPER_PROJECT_FILENAME\" ]; then\n        typeset project_dir=\"$(cat \"$VIRTUAL_ENV/$VIRTUALENVWRAPPER_PROJECT_FILENAME\")\";\n        if [ ! -z \"$project_dir\" ]; then\n            virtualenvwrapper_cd \"$project_dir\";\n        else\n            echo \"Project directory $project_dir does not exist\" 1>&2;\n            return 1;\n        fi;\n    else\n        echo \"No project set in $VIRTUAL_ENV/$VIRTUALENVWRAPPER_PROJECT_FILENAME\" 1>&2;\n        return 1;\n    fi;\n    return 0\n}\ncdsitepackages () \n{ \n    virtualenvwrapper_verify_workon_home || return 1;\n    virtualenvwrapper_verify_active_environment || return 1;\n    typeset site_packages=\"`virtualenvwrapper_get_site_packages_dir`\";\n    virtualenvwrapper_cd \"$site_packages/$1\"\n}\ncdvirtualenv () \n{ \n    virtualenvwrapper_verify_workon_home || return 1;\n    virtualenvwrapper_verify_active_environment || return 1;\n    virtualenvwrapper_cd \"$VIRTUAL_ENV/$1\"\n}\ncpvirtualenv () \n{ \n    virtualenvwrapper_verify_workon_home || return 1;\n    virtualenvwrapper_verify_virtualenv_clone || return 1;\n    typeset src_name=\"$1\";\n    typeset trg_name=\"$2\";\n    typeset src;\n    typeset trg;\n    if [ \"$src_name\" = \"\" ]; then\n        echo \"Please provide a valid virtualenv to copy.\";\n        return 1;\n    else\n        if [ ! -e \"$WORKON_HOME/$src_name\" ]; then\n            src=\"$(virtualenvwrapper_expandpath \"$src_name\")\";\n            if [ ! -e \"$src\" ]; then\n                echo \"Please provide a valid virtualenv to copy.\";\n                return 1;\n            fi;\n            src_name=\"$(basename \"$src\")\";\n        else\n            src=\"$WORKON_HOME/$src_name\";\n        fi;\n    fi;\n    if [ \"$trg_name\" = \"\" ]; then\n        trg=\"$WORKON_HOME/$src_name\";\n        trg_name=\"$src_name\";\n    else\n        trg=\"$WORKON_HOME/$trg_name\";\n    fi;\n    trg=\"$(virtualenvwrapper_expandpath \"$trg\")\";\n    if [ -e \"$trg\" ]; then\n        echo \"$trg_name virtualenv already exists.\";\n        return 1;\n    fi;\n    echo \"Copying $src_name as $trg_name...\";\n    ( [ -n \"$ZSH_VERSION\" ] && setopt SH_WORD_SPLIT;\n    virtualenvwrapper_cd \"$WORKON_HOME\" && \"$VIRTUALENVWRAPPER_VIRTUALENV_CLONE\" \"$src\" \"$trg\";\n    [ -d \"$trg\" ] && virtualenvwrapper_run_hook \"pre_cpvirtualenv\" \"$src\" \"$trg_name\" && virtualenvwrapper_run_hook \"pre_mkvirtualenv\" \"$trg_name\" );\n    typeset RC=$?;\n    [ $RC -ne 0 ] && return $RC;\n    [ ! -d \"$WORKON_HOME/$trg_name\" ] && return 1;\n    workon \"$trg_name\";\n    virtualenvwrapper_run_hook \"post_mkvirtualenv\";\n    virtualenvwrapper_run_hook \"post_cpvirtualenv\"\n}\nlssitepackages () \n{ \n    virtualenvwrapper_verify_workon_home || return 1;\n    virtualenvwrapper_verify_active_environment || return 1;\n    typeset site_packages=\"`virtualenvwrapper_get_site_packages_dir`\";\n    ls $@ \"$site_packages\";\n    path_file=\"$site_packages/_virtualenv_path_extensions.pth\";\n    if [ -f \"$path_file\" ]; then\n        echo;\n        echo \"_virtualenv_path_extensions.pth:\";\n        cat \"$path_file\";\n    fi\n}\nlsvirtualenv () \n{ \n    typeset long_mode=true;\n    if command -v \"getopts\" > /dev/null 2>&1; then\n        OPTIND=1;\n        while getopts \":blh\" opt \"$@\"; do\n            case \"$opt\" in \n                l)\n                    long_mode=true\n                ;;\n                b)\n                    long_mode=false\n                ;;\n                h)\n                    _lsvirtualenv_usage;\n                    return 1\n                ;;\n                ?)\n                    echo \"Invalid option: -$OPTARG\" 1>&2;\n                    _lsvirtualenv_usage;\n                    return 1\n                ;;\n            esac;\n        done;\n    else\n        typeset -a args;\n        args=($(getopt blh \"$@\"));\n        if [ $? != 0 ]; then\n            _lsvirtualenv_usage;\n            return 1;\n        fi;\n        for opt in $args;\n        do\n            case \"$opt\" in \n                -l)\n                    long_mode=true\n                ;;\n                -b)\n                    long_mode=false\n                ;;\n                -h)\n                    _lsvirtualenv_usage;\n                    return 1\n                ;;\n            esac;\n        done;\n    fi;\n    if $long_mode; then\n        allvirtualenv showvirtualenv \"$env_name\";\n    else\n        virtualenvwrapper_show_workon_options;\n    fi\n}\nmkproject () \n{ \n    typeset -a in_args;\n    typeset -a out_args;\n    typeset -i i;\n    typeset tst;\n    typeset a;\n    typeset t;\n    typeset force;\n    typeset templates;\n    in_args=(\"$@\");\n    force=0;\n    if [ -n \"$ZSH_VERSION\" ]; then\n        i=1;\n        tst=\"-le\";\n    else\n        i=0;\n        tst=\"-lt\";\n    fi;\n    while [ $i $tst $# ]; do\n        a=\"${in_args[$i]}\";\n        case \"$a\" in \n            -h | --help)\n                virtualenvwrapper_mkproject_help;\n                return\n            ;;\n            -f | --force)\n                force=1\n            ;;\n            -t)\n                i=$(( $i + 1 ));\n                templates=\"$templates ${in_args[$i]}\"\n            ;;\n            *)\n                if [ ${#out_args} -gt 0 ]; then\n                    out_args=(\"${out_args[@]-}\" \"$a\");\n                else\n                    out_args=(\"$a\");\n                fi\n            ;;\n        esac;\n        i=$(( $i + 1 ));\n    done;\n    set -- \"${out_args[@]}\";\n    eval \"typeset envname=\\$$#\";\n    virtualenvwrapper_verify_project_home || return 1;\n    if [ -d \"$PROJECT_HOME/$envname\" -a $force -eq 0 ]; then\n        echo \"Project $envname already exists.\" 1>&2;\n        return 1;\n    fi;\n    mkvirtualenv \"$@\" || return 1;\n    virtualenvwrapper_cd \"$PROJECT_HOME\";\n    virtualenvwrapper_run_hook \"project.pre_mkproject\" $envname;\n    echo \"Creating $PROJECT_HOME/$envname\";\n    mkdir -p \"$PROJECT_HOME/$envname\";\n    setvirtualenvproject \"$VIRTUAL_ENV\" \"$PROJECT_HOME/$envname\";\n    virtualenvwrapper_cd \"$PROJECT_HOME/$envname\";\n    for t in $templates;\n    do\n        echo;\n        echo \"Applying template $t\";\n        virtualenvwrapper_run_hook --name $(echo $t | sed 's/^ //') \"project.template\" \"$envname\" \"$PROJECT_HOME/$envname\";\n    done;\n    virtualenvwrapper_run_hook \"project.post_mkproject\"\n}\nmktmpenv () \n{ \n    typeset tmpenvname;\n    typeset RC;\n    typeset -a in_args;\n    typeset -a out_args;\n    in_args=(\"$@\");\n    if [ -n \"$ZSH_VERSION\" ]; then\n        i=1;\n        tst=\"-le\";\n    else\n        i=0;\n        tst=\"-lt\";\n    fi;\n    typeset cd_after_activate=$VIRTUALENVWRAPPER_WORKON_CD;\n    while [ $i $tst $# ]; do\n        a=\"${in_args[$i]}\";\n        case \"$a\" in \n            -n | --no-cd)\n                cd_after_activate=0\n            ;;\n            -c | --cd)\n                cd_after_activate=1\n            ;;\n            *)\n                if [ ${#out_args} -gt 0 ]; then\n                    out_args=(\"${out_args[@]-}\" \"$a\");\n                else\n                    out_args=(\"$a\");\n                fi\n            ;;\n        esac;\n        i=$(( $i + 1 ));\n    done;\n    set -- \"${out_args[@]}\";\n    tmpenvname=$(\"$VIRTUALENVWRAPPER_PYTHON\" -c 'import uuid,sys; sys.stdout.write(uuid.uuid4()+\"\\n\")' 2>/dev/null);\n    if [ -z \"$tmpenvname\" ]; then\n        tmpenvname=$(\"$VIRTUALENVWRAPPER_PYTHON\" -c 'import random,sys; sys.stdout.write(hex(random.getrandbits(64))[2:-1]+\"\\n\")' 2>/dev/null);\n    fi;\n    tmpenvname=\"tmp-$tmpenvname\";\n    mkvirtualenv \"$@\" \"$tmpenvname\";\n    RC=$?;\n    if [ $RC -ne 0 ]; then\n        return $RC;\n    fi;\n    [ \"$cd_after_activate\" = \"1\" ] && cdvirtualenv;\n    echo \"This is a temporary environment. It will be deleted when you run 'deactivate'.\" | tee \"$VIRTUAL_ENV/README.tmpenv\";\n    cat - >> \"$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/postdeactivate\"  <<EOF\nif [ -f \"$VIRTUAL_ENV/README.tmpenv\" ]\nthen\n    echo \"Removing temporary environment:\" $(basename \"$VIRTUAL_ENV\")\n    rmvirtualenv $(basename \"$VIRTUAL_ENV\")\nfi\nEOF\n\n}\nmkvirtualenv () \n{ \n    typeset -a in_args;\n    typeset -a out_args;\n    typeset -i i;\n    typeset tst;\n    typeset a;\n    typeset envname;\n    typeset requirements;\n    typeset packages;\n    typeset interpreter;\n    typeset project;\n    in_args=(\"$@\");\n    if [ -n \"$ZSH_VERSION\" ]; then\n        i=1;\n        tst=\"-le\";\n    else\n        i=0;\n        tst=\"-lt\";\n    fi;\n    while [ $i $tst $# ]; do\n        a=\"${in_args[$i]}\";\n        case \"$a\" in \n            -a)\n                i=$(( $i + 1 ));\n                project=\"${in_args[$i]}\";\n                if [ ! -d \"$project\" ]; then\n                    echo \"Cannot associate project with $project, it is not a directory\" 1>&2;\n                    return 1;\n                fi;\n                project=\"$(virtualenvwrapper_absolutepath ${project})\"\n            ;;\n            -h | --help)\n                virtualenvwrapper_mkvirtualenv_help $a;\n                return\n            ;;\n            -i)\n                i=$(( $i + 1 ));\n                packages=\"$packages ${in_args[$i]}\"\n            ;;\n            -p | --python*)\n                if echo \"$a\" | grep -q \"=\"; then\n                    interpreter=\"$(echo \"$a\" | cut -f2 -d=)\";\n                else\n                    i=$(( $i + 1 ));\n                    interpreter=\"${in_args[$i]}\";\n                fi\n            ;;\n            -r)\n                i=$(( $i + 1 ));\n                requirements=\"${in_args[$i]}\";\n                requirements=\"$(virtualenvwrapper_expandpath \"$requirements\")\"\n            ;;\n            *)\n                if [ ${#out_args} -gt 0 ]; then\n                    out_args=(\"${out_args[@]-}\" \"$a\");\n                else\n                    out_args=(\"$a\");\n                fi\n            ;;\n        esac;\n        i=$(( $i + 1 ));\n    done;\n    if [ ! -z $interpreter ]; then\n        out_args=(\"--python=$interpreter\" ${out_args[@]});\n    fi;\n    set -- \"${out_args[@]}\";\n    eval \"envname=\\$$#\";\n    virtualenvwrapper_verify_workon_home || return 1;\n    virtualenvwrapper_verify_virtualenv || return 1;\n    ( [ -n \"$ZSH_VERSION\" ] && setopt SH_WORD_SPLIT;\n    virtualenvwrapper_cd \"$WORKON_HOME\" && \"$VIRTUALENVWRAPPER_VIRTUALENV\" $VIRTUALENVWRAPPER_VIRTUALENV_ARGS \"$@\" && [ -d \"$WORKON_HOME/$envname\" ] && virtualenvwrapper_run_hook \"pre_mkvirtualenv\" \"$envname\" );\n    typeset RC=$?;\n    [ $RC -ne 0 ] && return $RC;\n    [ ! -d \"$WORKON_HOME/$envname\" ] && return 0;\n    if [ ! -z \"$project\" ]; then\n        setvirtualenvproject \"$WORKON_HOME/$envname\" \"$project\";\n        RC=$?;\n        [ $RC -ne 0 ] && return $RC;\n    fi;\n    workon \"$envname\";\n    if [ ! -z \"$requirements\" ]; then\n        pip install -r \"$requirements\";\n    fi;\n    for a in $packages;\n    do\n        pip install $a;\n    done;\n    virtualenvwrapper_run_hook \"post_mkvirtualenv\"\n}\nrmvirtualenv () \n{ \n    virtualenvwrapper_verify_workon_home || return 1;\n    if [ ${#@} = 0 ]; then\n        echo \"Please specify an environment.\" 1>&2;\n        return 1;\n    fi;\n    typeset env_name;\n    for env_name in \"$@\";\n    do\n        echo \"Removing $env_name...\";\n        typeset env_dir=\"$WORKON_HOME/$env_name\";\n        if [ \"$VIRTUAL_ENV\" = \"$env_dir\" ]; then\n            echo \"ERROR: You cannot remove the active environment ('$env_name').\" 1>&2;\n            echo \"Either switch to another environment, or run 'deactivate'.\" 1>&2;\n            return 1;\n        fi;\n        if [ ! -d \"$env_dir\" ]; then\n            echo \"Did not find environment $env_dir to remove.\" 1>&2;\n        fi;\n        typeset prior_dir=\"$(pwd)\";\n        virtualenvwrapper_cd \"$WORKON_HOME\";\n        virtualenvwrapper_run_hook \"pre_rmvirtualenv\" \"$env_name\";\n        command \\rm -rf \"$env_dir\";\n        virtualenvwrapper_run_hook \"post_rmvirtualenv\" \"$env_name\";\n        if [ -d \"$prior_dir\" ]; then\n            virtualenvwrapper_cd \"$prior_dir\";\n        fi;\n    done\n}\nsetvirtualenvproject () \n{ \n    typeset venv=\"$1\";\n    typeset prj=\"$2\";\n    if [ -z \"$venv\" ]; then\n        venv=\"$VIRTUAL_ENV\";\n    fi;\n    if [ -z \"$prj\" ]; then\n        prj=\"$(pwd)\";\n    else\n        prj=$(virtualenvwrapper_absolutepath \"${prj}\");\n    fi;\n    if [ ! -d \"$venv\" ]; then\n        venv=\"$WORKON_HOME/$venv\";\n    fi;\n    if [ ! -d \"$venv\" ]; then\n        echo \"No virtualenv $(basename $venv)\" 1>&2;\n        return 1;\n    fi;\n    if [ ! -d \"$prj\" ]; then\n        echo \"Cannot associate virtualenv with \\\"$prj\\\", it is not a directory\" 1>&2;\n        return 1;\n    fi;\n    echo \"Setting project for $(basename $venv) to $prj\";\n    echo \"$prj\" > \"$venv/$VIRTUALENVWRAPPER_PROJECT_FILENAME\"\n}\nshell_session_delete_expired () \n{ \n    if ( [ ! -e \"$SHELL_SESSION_TIMESTAMP_FILE\" ] || [ -z \"$(/usr/bin/find \"$SHELL_SESSION_TIMESTAMP_FILE\" -mtime -1d)\" ] ); then\n        local expiration_lock_file=\"$SHELL_SESSION_DIR/_expiration_lockfile\";\n        if /usr/bin/shlock -f \"$expiration_lock_file\" -p $$; then\n            echo -n 'Deleting expired sessions...' 1>&2;\n            local delete_count=$(/usr/bin/find \"$SHELL_SESSION_DIR\" -type f -mtime +2w -print -delete | /usr/bin/wc -l);\n            [ \"$delete_count\" -gt 0 ] && echo $delete_count' completed.' 1>&2 || echo 'none found.' 1>&2;\n            ( umask 077;\n            /usr/bin/touch \"$SHELL_SESSION_TIMESTAMP_FILE\" );\n            /bin/rm \"$expiration_lock_file\";\n        fi;\n    fi\n}\nshell_session_history_allowed () \n{ \n    if [ -n \"$HISTFILE\" ]; then\n        local allowed=0;\n        if shopt -q histappend || [ -n \"$HISTTIMEFORMAT\" ]; then\n            allowed=${SHELL_SESSION_HISTORY:-0};\n        else\n            allowed=${SHELL_SESSION_HISTORY:=1};\n        fi;\n        if [ $allowed -eq 1 ]; then\n            return 0;\n        fi;\n    fi;\n    return 1\n}\nshell_session_history_check () \n{ \n    if [ ${SHELL_SESSION_DID_HISTORY_CHECK:-0} -eq 0 ]; then\n        SHELL_SESSION_DID_HISTORY_CHECK=1;\n        if shell_session_history_allowed; then\n            shell_session_history_enable;\n        fi;\n        if [ \"$PROMPT_COMMAND\" = \"shell_session_history_check\" ]; then\n            unset PROMPT_COMMAND;\n        else\n            if [[ $PROMPT_COMMAND =~ (.*)(; *shell_session_history_check *| *shell_session_history_check *; *)(.*) ]]; then\n                PROMPT_COMMAND=\"${BASH_REMATCH[1]}${BASH_REMATCH[3]}\";\n            fi;\n        fi;\n    fi\n}\nshell_session_history_enable () \n{ \n    ( umask 077;\n    /usr/bin/touch \"$SHELL_SESSION_HISTFILE_NEW\" );\n    HISTFILE=\"$SHELL_SESSION_HISTFILE_NEW\";\n    SHELL_SESSION_HISTORY=1\n}\nshell_session_save () \n{ \n    if [ -n \"$SHELL_SESSION_FILE\" ]; then\n        echo -ne '\\nSaving session...' 1>&2;\n        ( umask 077;\n        echo 'echo Restored session: \"$(/bin/date -r '$(/bin/date +%s)')\"' >|\"$SHELL_SESSION_FILE\" );\n        declare -F shell_session_save_user_state > /dev/null && shell_session_save_user_state;\n        shell_session_history_allowed && shell_session_save_history;\n        echo 'completed.' 1>&2;\n    fi\n}\nshell_session_save_history () \n{ \n    shell_session_history_enable;\n    history -a;\n    if [ -f \"$SHELL_SESSION_HISTFILE_SHARED\" ] && [ ! -s \"$SHELL_SESSION_HISTFILE\" ]; then\n        echo -ne '\\n...copying shared history...' 1>&2;\n        ( umask 077;\n        /bin/cp \"$SHELL_SESSION_HISTFILE_SHARED\" \"$SHELL_SESSION_HISTFILE\" );\n    fi;\n    echo -ne '\\n...saving history...' 1>&2;\n    ( umask 077;\n    /bin/cat \"$SHELL_SESSION_HISTFILE_NEW\" >> \"$SHELL_SESSION_HISTFILE_SHARED\" );\n    ( umask 077;\n    /bin/cat \"$SHELL_SESSION_HISTFILE_NEW\" >> \"$SHELL_SESSION_HISTFILE\" );\n    : >|\"$SHELL_SESSION_HISTFILE_NEW\";\n    if [ -n \"$HISTFILESIZE\" ]; then\n        echo -n 'truncating history files...' 1>&2;\n        HISTFILE=\"$SHELL_SESSION_HISTFILE_SHARED\";\n        HISTFILESIZE=\"$HISTFILESIZE\";\n        HISTFILE=\"$SHELL_SESSION_HISTFILE\";\n        HISTFILESIZE=\"$size\";\n        HISTFILE=\"$SHELL_SESSION_HISTFILE_NEW\";\n    fi;\n    echo -ne '\\n...' 1>&2\n}\nshell_session_update () \n{ \n    shell_session_save && shell_session_delete_expired\n}\nshowvirtualenv () \n{ \n    typeset env_name=\"$1\";\n    if [ -z \"$env_name\" ]; then\n        if [ -z \"$VIRTUAL_ENV\" ]; then\n            echo \"showvirtualenv [env]\";\n            return 1;\n        fi;\n        env_name=$(basename \"$VIRTUAL_ENV\");\n    fi;\n    virtualenvwrapper_run_hook \"get_env_details\" \"$env_name\";\n    echo\n}\ntoggleglobalsitepackages () \n{ \n    virtualenvwrapper_verify_workon_home || return 1;\n    virtualenvwrapper_verify_active_environment || return 1;\n    typeset no_global_site_packages_file=\"`virtualenvwrapper_get_site_packages_dir`/../no-global-site-packages.txt\";\n    if [ -f $no_global_site_packages_file ]; then\n        rm $no_global_site_packages_file;\n        [ \"$1\" = \"-q\" ] || echo \"Enabled global site-packages\";\n    else\n        touch $no_global_site_packages_file;\n        [ \"$1\" = \"-q\" ] || echo \"Disabled global site-packages\";\n    fi\n}\nupdate_terminal_cwd () \n{ \n    local url_path='';\n    { \n        local i ch hexch LC_CTYPE=C LC_COLLATE=C LC_ALL= LANG=;\n        for ((i = 0; i < ${#PWD}; ++i))\n        do\n            ch=\"${PWD:i:1}\";\n            if [[ \"$ch\" =~ [/._~A-Za-z0-9-] ]]; then\n                url_path+=\"$ch\";\n            else\n                printf -v hexch \"%02X\" \"'$ch\";\n                url_path+=\"%${hexch: -2:2}\";\n            fi;\n        done\n    };\n    printf '\\e]7;%s\\a' \"file://$HOSTNAME$url_path\"\n}\nvirtualenvwrapper () \n{ \n    cat  <<EOF\n\nvirtualenvwrapper is a set of extensions to Ian Bicking's virtualenv\ntool.  The extensions include wrappers for creating and deleting\nvirtual environments and otherwise managing your development workflow,\nmaking it easier to work on more than one project at a time without\nintroducing conflicts in their dependencies.\n\nFor more information please refer to the documentation:\n\n    http://virtualenvwrapper.readthedocs.org/en/latest/command_ref.html\n\nCommands available:\n\nEOF\n\n    typeset helpmarker=\"#:help:\";\n    cat \"$VIRTUALENVWRAPPER_SCRIPT\" | grep \"^$helpmarker\" | sed -e \"s/^$helpmarker/  /g\" | sort | sed -e 's/$/\\''\n/g'\n}\nvirtualenvwrapper_absolutepath () \n{ \n    if [ \"$1\" = \"\" ]; then\n        return 1;\n    else\n        \"$VIRTUALENVWRAPPER_PYTHON\" -c \"import os,sys; sys.stdout.write(os.path.abspath(\\\"$1\\\")+'\\n')\";\n        return 0;\n    fi\n}\nvirtualenvwrapper_cd () \n{ \n    if [ -n \"${BASH:-}\" ]; then\n        builtin \\cd \"$@\";\n    else\n        if [ -n \"${ZSH_VERSION:-}\" ]; then\n            builtin \\cd -q \"$@\";\n        else\n            command \\cd \"$@\";\n        fi;\n    fi\n}\nvirtualenvwrapper_derive_workon_home () \n{ \n    typeset workon_home_dir=\"$WORKON_HOME\";\n    if [ \"$workon_home_dir\" = \"\" ]; then\n        workon_home_dir=\"$HOME/.virtualenvs\";\n    fi;\n    if echo \"$workon_home_dir\" | ( unset GREP_OPTIONS;\n    command \\grep '^[^/~]' > /dev/null ); then\n        workon_home_dir=\"$HOME/$WORKON_HOME\";\n    fi;\n    if echo \"$workon_home_dir\" | ( unset GREP_OPTIONS;\n    command \\egrep '([\\$~]|//)' > /dev/null ); then\n        workon_home_dir=\"$(virtualenvwrapper_expandpath \"$workon_home_dir\")\";\n    fi;\n    echo \"$workon_home_dir\";\n    return 0\n}\nvirtualenvwrapper_expandpath () \n{ \n    if [ \"$1\" = \"\" ]; then\n        return 1;\n    else\n        \"$VIRTUALENVWRAPPER_PYTHON\" -c \"import os,sys; sys.stdout.write(os.path.normpath(os.path.expanduser(os.path.expandvars(\\\"$1\\\")))+'\\n')\";\n        return 0;\n    fi\n}\nvirtualenvwrapper_get_python_version () \n{ \n    \"$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/python\" -V 2>&1 | cut -f2 -d' ' | cut -f-2 -d.\n}\nvirtualenvwrapper_get_site_packages_dir () \n{ \n    \"$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/python\" -c \"import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())\"\n}\nvirtualenvwrapper_initialize () \n{ \n    export WORKON_HOME=\"$(virtualenvwrapper_derive_workon_home)\";\n    virtualenvwrapper_verify_workon_home -q || return 1;\n    if [ \"$VIRTUALENVWRAPPER_HOOK_DIR\" = \"\" ]; then\n        VIRTUALENVWRAPPER_HOOK_DIR=\"$WORKON_HOME\";\n    fi;\n    export VIRTUALENVWRAPPER_HOOK_DIR;\n    mkdir -p \"$VIRTUALENVWRAPPER_HOOK_DIR\";\n    virtualenvwrapper_run_hook \"initialize\";\n    virtualenvwrapper_setup_tab_completion;\n    return 0\n}\nvirtualenvwrapper_mkproject_help () \n{ \n    echo \"Usage: mkproject [-f|--force] [-t template] [virtualenv options] project_name\";\n    echo;\n    echo \"-f, --force    Create the virtualenv even if the project directory\";\n    echo \"               already exists\";\n    echo;\n    echo \"Multiple templates may be selected.  They are applied in the order\";\n    echo \"specified on the command line.\";\n    echo;\n    echo \"mkvirtualenv help:\";\n    echo;\n    mkvirtualenv -h;\n    echo;\n    echo \"Available project templates:\";\n    echo;\n    \"$VIRTUALENVWRAPPER_PYTHON\" -c 'from virtualenvwrapper.hook_loader import main; main()' -l project.template\n}\nvirtualenvwrapper_mktemp () \n{ \n    command \\mktemp \"$@\"\n}\nvirtualenvwrapper_mkvirtualenv_help () \n{ \n    echo \"Usage: mkvirtualenv [-a project_path] [-i package] [-r requirements_file] [virtualenv options] env_name\";\n    echo;\n    echo \" -a project_path\";\n    echo;\n    echo \"    Provide a full path to a project directory to associate with\";\n    echo \"    the new environment.\";\n    echo;\n    echo \" -i package\";\n    echo;\n    echo \"    Install a package after the environment is created.\";\n    echo \"    This option may be repeated.\";\n    echo;\n    echo \" -r requirements_file\";\n    echo;\n    echo \"    Provide a pip requirements file to install a base set of packages\";\n    echo \"    into the new environment.\";\n    echo;\n    echo 'virtualenv help:';\n    echo;\n    \"$VIRTUALENVWRAPPER_VIRTUALENV\" $@\n}\nvirtualenvwrapper_run_hook () \n{ \n    typeset hook_script;\n    typeset result;\n    hook_script=\"$(virtualenvwrapper_tempfile ${1}-hook)\" || return 1;\n    ( virtualenvwrapper_cd \"$WORKON_HOME\" && \"$VIRTUALENVWRAPPER_PYTHON\" -m 'virtualenvwrapper.hook_loader' ${HOOK_VERBOSE_OPTION:-} --script \"$hook_script\" \"$@\" );\n    result=$?;\n    if [ $result -eq 0 ]; then\n        if [ ! -f \"$hook_script\" ]; then\n            echo \"ERROR: virtualenvwrapper_run_hook could not find temporary file $hook_script\" 1>&2;\n            command \\rm -f \"$hook_script\";\n            return 2;\n        fi;\n        source \"$hook_script\";\n    else\n        if [ \"${1}\" = \"initialize\" ]; then\n            cat - 1>&2  <<EOF\nvirtualenvwrapper.sh: There was a problem running the initialization hooks.\n\nIf Python could not import the module virtualenvwrapper.hook_loader,\ncheck that virtualenvwrapper has been installed for\nVIRTUALENVWRAPPER_PYTHON=$VIRTUALENVWRAPPER_PYTHON and that PATH is\nset properly.\nEOF\n\n        fi;\n    fi\n    command \\rm -f \"$hook_script\";\n    return $result\n}\nvirtualenvwrapper_setup_tab_completion () \n{ \n    if [ -n \"${BASH:-}\" ]; then\n        function _virtualenvs () \n        { \n            local cur=\"${COMP_WORDS[COMP_CWORD]}\";\n            COMPREPLY=($(compgen -W \"`virtualenvwrapper_show_workon_options`\" -- ${cur}))\n        };\n        function _cdvirtualenv_complete () \n        { \n            local cur=\"$2\";\n            COMPREPLY=($(cdvirtualenv && compgen -d -- \"${cur}\" ))\n        };\n        function _cdsitepackages_complete () \n        { \n            local cur=\"$2\";\n            COMPREPLY=($(cdsitepackages && compgen -d -- \"${cur}\" ))\n        };\n        complete -o nospace -F _cdvirtualenv_complete -S/ cdvirtualenv;\n        complete -o nospace -F _cdsitepackages_complete -S/ cdsitepackages;\n        complete -o default -o nospace -F _virtualenvs workon;\n        complete -o default -o nospace -F _virtualenvs rmvirtualenv;\n        complete -o default -o nospace -F _virtualenvs cpvirtualenv;\n        complete -o default -o nospace -F _virtualenvs showvirtualenv;\n    else\n        if [ -n \"$ZSH_VERSION\" ]; then\n            function _virtualenvs () \n            { \n                reply=($(virtualenvwrapper_show_workon_options))\n            };\n            function _cdvirtualenv_complete () \n            { \n                reply=($(cdvirtualenv && ls -d ${1}*))\n            };\n            function _cdsitepackages_complete () \n            { \n                reply=($(cdsitepackages && ls -d ${1}*))\n            };\n            compctl -K _virtualenvs workon rmvirtualenv cpvirtualenv showvirtualenv;\n            compctl -K _cdvirtualenv_complete cdvirtualenv;\n            compctl -K _cdsitepackages_complete cdsitepackages;\n        fi;\n    fi\n}\nvirtualenvwrapper_show_workon_options () \n{ \n    virtualenvwrapper_verify_workon_home || return 1;\n    ( virtualenvwrapper_cd \"$WORKON_HOME\" && echo */$VIRTUALENVWRAPPER_ENV_BIN_DIR/activate ) 2> /dev/null | command \\tr \"\\n\" \" \" | command \\sed \"s|/$VIRTUALENVWRAPPER_ENV_BIN_DIR/activate |/|g\" | command \\tr \"/\" \"\\n\" | command \\sed \"/^\\s*$/d\" | ( unset GREP_OPTIONS;\n    command \\egrep -v '^\\*$' ) 2> /dev/null\n}\nvirtualenvwrapper_tempfile () \n{ \n    typeset suffix=${1:-hook};\n    typeset file;\n    file=\"$(virtualenvwrapper_mktemp -t virtualenvwrapper-$suffix-XXXXXXXXXX)\";\n    touch \"$file\";\n    if [ $? -ne 0 ] || [ -z \"$file\" ] || [ ! -f \"$file\" ]; then\n        echo \"ERROR: virtualenvwrapper could not create a temporary file name.\" 1>&2;\n        return 1;\n    fi;\n    echo $file;\n    return 0\n}\nvirtualenvwrapper_verify_active_environment () \n{ \n    if [ ! -n \"${VIRTUAL_ENV}\" ] || [ ! -d \"${VIRTUAL_ENV}\" ]; then\n        echo \"ERROR: no virtualenv active, or active virtualenv is missing\" 1>&2;\n        return 1;\n    fi;\n    return 0\n}\nvirtualenvwrapper_verify_project_home () \n{ \n    if [ -z \"$PROJECT_HOME\" ]; then\n        echo \"ERROR: Set the PROJECT_HOME shell variable to the name of the directory where projects should be created.\" 1>&2;\n        return 1;\n    fi;\n    if [ ! -d \"$PROJECT_HOME\" ]; then\n        [ \"$1\" != \"-q\" ] && echo \"ERROR: Project directory '$PROJECT_HOME' does not exist.  Create it or set PROJECT_HOME to an existing directory.\" 1>&2;\n        return 1;\n    fi;\n    return 0\n}\nvirtualenvwrapper_verify_resource () \n{ \n    typeset exe_path=\"$(command \\which \"$1\" | (unset GREP_OPTIONS; command \\grep -v \"not found\"))\";\n    if [ \"$exe_path\" = \"\" ]; then\n        echo \"ERROR: virtualenvwrapper could not find $1 in your path\" 1>&2;\n        return 1;\n    fi;\n    if [ ! -e \"$exe_path\" ]; then\n        echo \"ERROR: Found $1 in path as \\\"$exe_path\\\" but that does not exist\" 1>&2;\n        return 1;\n    fi;\n    return 0\n}\nvirtualenvwrapper_verify_virtualenv () \n{ \n    virtualenvwrapper_verify_resource $VIRTUALENVWRAPPER_VIRTUALENV\n}\nvirtualenvwrapper_verify_virtualenv_clone () \n{ \n    virtualenvwrapper_verify_resource $VIRTUALENVWRAPPER_VIRTUALENV_CLONE\n}\nvirtualenvwrapper_verify_workon_environment () \n{ \n    typeset env_name=\"$1\";\n    if [ ! -d \"$WORKON_HOME/$env_name\" ]; then\n        echo \"ERROR: Environment '$env_name' does not exist. Create it with 'mkvirtualenv $env_name'.\" 1>&2;\n        return 1;\n    fi;\n    return 0\n}\nvirtualenvwrapper_verify_workon_home () \n{ \n    RC=0;\n    if [ ! -d \"$WORKON_HOME/\" ]; then\n        if [ \"$1\" != \"-q\" ]; then\n            echo \"NOTE: Virtual environments directory $WORKON_HOME does not exist. Creating...\" 1>&2;\n        fi;\n        mkdir -p \"$WORKON_HOME\";\n        RC=$?;\n    fi;\n    return $RC\n}\nvirtualenvwrapper_workon_help () \n{ \n    echo \"Usage: workon env_name\";\n    echo \"\";\n    echo \"           Deactivate any currently activated virtualenv\";\n    echo \"           and activate the named environment, triggering\";\n    echo \"           any hooks in the process.\";\n    echo \"\";\n    echo \"       workon\";\n    echo \"\";\n    echo \"           Print a list of available environments.\";\n    echo \"           (See also lsvirtualenv -b)\";\n    echo \"\";\n    echo \"       workon (-h|--help)\";\n    echo \"\";\n    echo \"           Show this help message.\";\n    echo \"\";\n    echo \"       workon (-c|--cd) envname\";\n    echo \"\";\n    echo \"           After activating the environment, cd to the associated\";\n    echo \"           project directory if it is set.\";\n    echo \"\";\n    echo \"       workon (-n|--no-cd) envname\";\n    echo \"\";\n    echo \"           After activating the environment, do not cd to the\";\n    echo \"           associated project directory.\";\n    echo \"\"\n}\nwipeenv () \n{ \n    virtualenvwrapper_verify_workon_home || return 1;\n    virtualenvwrapper_verify_active_environment || return 1;\n    typeset req_file=\"$(virtualenvwrapper_tempfile \"requirements.txt\")\";\n    pip freeze | egrep -v '(distribute|wsgiref|appdirs|packaging|pyparsing|six)' > \"$req_file\";\n    if [ -n \"$(cat \"$req_file\")\" ]; then\n        echo \"Uninstalling packages:\";\n        cat \"$req_file\";\n        echo;\n        pip uninstall -y $(cat \"$req_file\" | grep -v '^-f' | sed 's/>/=/g' | cut -f1 -d=);\n    else\n        echo \"Nothing to remove.\";\n    fi;\n    rm -f \"$req_file\"\n}\nworkon () \n{ \n    typeset -a in_args;\n    typeset -a out_args;\n    in_args=(\"$@\");\n    if [ -n \"$ZSH_VERSION\" ]; then\n        i=1;\n        tst=\"-le\";\n    else\n        i=0;\n        tst=\"-lt\";\n    fi;\n    typeset cd_after_activate=$VIRTUALENVWRAPPER_WORKON_CD;\n    while [ $i $tst $# ]; do\n        a=\"${in_args[$i]}\";\n        case \"$a\" in \n            -h | --help)\n                virtualenvwrapper_workon_help;\n                return 0\n            ;;\n            -n | --no-cd)\n                cd_after_activate=0\n            ;;\n            -c | --cd)\n                cd_after_activate=1\n            ;;\n            *)\n                if [ ${#out_args} -gt 0 ]; then\n                    out_args=(\"${out_args[@]-}\" \"$a\");\n                else\n                    out_args=(\"$a\");\n                fi\n            ;;\n        esac;\n        i=$(( $i + 1 ));\n    done;\n    set -- \"${out_args[@]}\";\n    typeset env_name=\"$1\";\n    if [ \"$env_name\" = \"\" ]; then\n        lsvirtualenv -b;\n        return 1;\n    else\n        if [ \"$env_name\" = \".\" ]; then\n            IFS='%';\n            env_name=\"$(basename $(pwd))\";\n            unset IFS;\n        fi;\n    fi;\n    virtualenvwrapper_verify_workon_home || return 1;\n    virtualenvwrapper_verify_workon_environment \"$env_name\" || return 1;\n    activate=\"$WORKON_HOME/$env_name/$VIRTUALENVWRAPPER_ENV_BIN_DIR/activate\";\n    if [ ! -f \"$activate\" ]; then\n        echo \"ERROR: Environment '$WORKON_HOME/$env_name' does not contain an activate script.\" 1>&2;\n        return 1;\n    fi;\n    type deactivate > /dev/null 2>&1;\n    if [ $? -eq 0 ]; then\n        typeset -f deactivate | grep 'typeset env_postdeactivate_hook' > /dev/null 2>&1;\n        if [ $? -eq 0 ]; then\n            deactivate;\n            unset -f deactivate > /dev/null 2>&1;\n        fi;\n    fi;\n    virtualenvwrapper_run_hook \"pre_activate\" \"$env_name\";\n    source \"$activate\";\n    virtualenvwrapper_original_deactivate=`typeset -f deactivate | sed 's/deactivate/virtualenv_deactivate/g'`;\n    eval \"$virtualenvwrapper_original_deactivate\";\n    unset -f deactivate > /dev/null 2>&1;\n    eval 'deactivate () {\n        typeset env_postdeactivate_hook\n        typeset old_env\n\n        # Call the local hook before the global so we can undo\n        # any settings made by the local postactivate first.\n        virtualenvwrapper_run_hook \"pre_deactivate\"\n\n        env_postdeactivate_hook=\"$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/postdeactivate\"\n        old_env=$(basename \"$VIRTUAL_ENV\")\n\n        # Call the original function.\n        virtualenv_deactivate $1\n\n        virtualenvwrapper_run_hook \"post_deactivate\" \"$old_env\"\n\n        if [ ! \"$1\" = \"nondestructive\" ]\n        then\n            # Remove this function\n            unset -f virtualenv_deactivate >/dev/null 2>&1\n            unset -f deactivate >/dev/null 2>&1\n        fi\n\n    }';\n    VIRTUALENVWRAPPER_PROJECT_CD=$cd_after_activate virtualenvwrapper_run_hook \"post_activate\";\n    return 0\n}\n","name":"","extension":"txt","url":"https://www.irccloud.com/pastebin/qr2PbNI4","modified":1653372475,"id":"qr2PbNI4","size":36760,"lines":1129,"own_paste":false,"theme":"","date":1653372475}