diff options
Diffstat (limited to '.venv/bin')
85 files changed, 1572 insertions, 0 deletions
diff --git a/.venv/bin/Activate.ps1 b/.venv/bin/Activate.ps1 new file mode 100644 index 00000000..b49d77ba --- /dev/null +++ b/.venv/bin/Activate.ps1 @@ -0,0 +1,247 @@ +<# +.Synopsis +Activate a Python virtual environment for the current PowerShell session. + +.Description +Pushes the python executable for a virtual environment to the front of the +$Env:PATH environment variable and sets the prompt to signify that you are +in a Python virtual environment. Makes use of the command line switches as +well as the `pyvenv.cfg` file values present in the virtual environment. + +.Parameter VenvDir +Path to the directory that contains the virtual environment to activate. The +default value for this is the parent of the directory that the Activate.ps1 +script is located within. + +.Parameter Prompt +The prompt prefix to display when this virtual environment is activated. By +default, this prompt is the name of the virtual environment folder (VenvDir) +surrounded by parentheses and followed by a single space (ie. '(.venv) '). + +.Example +Activate.ps1 +Activates the Python virtual environment that contains the Activate.ps1 script. + +.Example +Activate.ps1 -Verbose +Activates the Python virtual environment that contains the Activate.ps1 script, +and shows extra information about the activation as it executes. + +.Example +Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv +Activates the Python virtual environment located in the specified location. + +.Example +Activate.ps1 -Prompt "MyPython" +Activates the Python virtual environment that contains the Activate.ps1 script, +and prefixes the current prompt with the specified string (surrounded in +parentheses) while the virtual environment is active. + +.Notes +On Windows, it may be required to enable this Activate.ps1 script by setting the +execution policy for the user. You can do this by issuing the following PowerShell +command: + +PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + +For more information on Execution Policies: +https://go.microsoft.com/fwlink/?LinkID=135170 + +#> +Param( + [Parameter(Mandatory = $false)] + [String] + $VenvDir, + [Parameter(Mandatory = $false)] + [String] + $Prompt +) + +<# Function declarations --------------------------------------------------- #> + +<# +.Synopsis +Remove all shell session elements added by the Activate script, including the +addition of the virtual environment's Python executable from the beginning of +the PATH variable. + +.Parameter NonDestructive +If present, do not remove this function from the global namespace for the +session. + +#> +function global:deactivate ([switch]$NonDestructive) { + # Revert to original values + + # The prior prompt: + if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) { + Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt + Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT + } + + # The prior PYTHONHOME: + if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) { + Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME + Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME + } + + # The prior PATH: + if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) { + Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH + Remove-Item -Path Env:_OLD_VIRTUAL_PATH + } + + # Just remove the VIRTUAL_ENV altogether: + if (Test-Path -Path Env:VIRTUAL_ENV) { + Remove-Item -Path env:VIRTUAL_ENV + } + + # Just remove VIRTUAL_ENV_PROMPT altogether. + if (Test-Path -Path Env:VIRTUAL_ENV_PROMPT) { + Remove-Item -Path env:VIRTUAL_ENV_PROMPT + } + + # Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether: + if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) { + Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force + } + + # Leave deactivate function in the global namespace if requested: + if (-not $NonDestructive) { + Remove-Item -Path function:deactivate + } +} + +<# +.Description +Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the +given folder, and returns them in a map. + +For each line in the pyvenv.cfg file, if that line can be parsed into exactly +two strings separated by `=` (with any amount of whitespace surrounding the =) +then it is considered a `key = value` line. The left hand string is the key, +the right hand is the value. + +If the value starts with a `'` or a `"` then the first and last character is +stripped from the value before being captured. + +.Parameter ConfigDir +Path to the directory that contains the `pyvenv.cfg` file. +#> +function Get-PyVenvConfig( + [String] + $ConfigDir +) { + Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg" + + # Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue). + $pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue + + # An empty map will be returned if no config file is found. + $pyvenvConfig = @{ } + + if ($pyvenvConfigPath) { + + Write-Verbose "File exists, parse `key = value` lines" + $pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath + + $pyvenvConfigContent | ForEach-Object { + $keyval = $PSItem -split "\s*=\s*", 2 + if ($keyval[0] -and $keyval[1]) { + $val = $keyval[1] + + # Remove extraneous quotations around a string value. + if ("'""".Contains($val.Substring(0, 1))) { + $val = $val.Substring(1, $val.Length - 2) + } + + $pyvenvConfig[$keyval[0]] = $val + Write-Verbose "Adding Key: '$($keyval[0])'='$val'" + } + } + } + return $pyvenvConfig +} + + +<# Begin Activate script --------------------------------------------------- #> + +# Determine the containing directory of this script +$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition +$VenvExecDir = Get-Item -Path $VenvExecPath + +Write-Verbose "Activation script is located in path: '$VenvExecPath'" +Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)" +Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)" + +# Set values required in priority: CmdLine, ConfigFile, Default +# First, get the location of the virtual environment, it might not be +# VenvExecDir if specified on the command line. +if ($VenvDir) { + Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values" +} +else { + Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir." + $VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/") + Write-Verbose "VenvDir=$VenvDir" +} + +# Next, read the `pyvenv.cfg` file to determine any required value such +# as `prompt`. +$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir + +# Next, set the prompt from the command line, or the config file, or +# just use the name of the virtual environment folder. +if ($Prompt) { + Write-Verbose "Prompt specified as argument, using '$Prompt'" +} +else { + Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value" + if ($pyvenvCfg -and $pyvenvCfg['prompt']) { + Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'" + $Prompt = $pyvenvCfg['prompt']; + } + else { + Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)" + Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'" + $Prompt = Split-Path -Path $venvDir -Leaf + } +} + +Write-Verbose "Prompt = '$Prompt'" +Write-Verbose "VenvDir='$VenvDir'" + +# Deactivate any currently active virtual environment, but leave the +# deactivate function in place. +deactivate -nondestructive + +# Now set the environment variable VIRTUAL_ENV, used by many tools to determine +# that there is an activated venv. +$env:VIRTUAL_ENV = $VenvDir + +if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) { + + Write-Verbose "Setting prompt to '$Prompt'" + + # Set the prompt to include the env name + # Make sure _OLD_VIRTUAL_PROMPT is global + function global:_OLD_VIRTUAL_PROMPT { "" } + Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT + New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt + + function global:prompt { + Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) " + _OLD_VIRTUAL_PROMPT + } + $env:VIRTUAL_ENV_PROMPT = $Prompt +} + +# Clear PYTHONHOME +if (Test-Path -Path Env:PYTHONHOME) { + Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME + Remove-Item -Path Env:PYTHONHOME +} + +# Add the venv to the PATH +Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH +$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH" diff --git a/.venv/bin/activate b/.venv/bin/activate new file mode 100644 index 00000000..0a8f6d1b --- /dev/null +++ b/.venv/bin/activate @@ -0,0 +1,70 @@ +# This file must be used with "source bin/activate" *from bash* +# You cannot run it directly + +deactivate () { + # reset old environment variables + if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then + PATH="${_OLD_VIRTUAL_PATH:-}" + export PATH + unset _OLD_VIRTUAL_PATH + fi + if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then + PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}" + export PYTHONHOME + unset _OLD_VIRTUAL_PYTHONHOME + fi + + # Call hash to forget past commands. Without forgetting + # past commands the $PATH changes we made may not be respected + hash -r 2> /dev/null + + if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then + PS1="${_OLD_VIRTUAL_PS1:-}" + export PS1 + unset _OLD_VIRTUAL_PS1 + fi + + unset VIRTUAL_ENV + unset VIRTUAL_ENV_PROMPT + if [ ! "${1:-}" = "nondestructive" ] ; then + # Self destruct! + unset -f deactivate + fi +} + +# unset irrelevant variables +deactivate nondestructive + +# on Windows, a path can contain colons and backslashes and has to be converted: +if [ "${OSTYPE:-}" = "cygwin" ] || [ "${OSTYPE:-}" = "msys" ] ; then + # transform D:\path\to\venv to /d/path/to/venv on MSYS + # and to /cygdrive/d/path/to/venv on Cygwin + export VIRTUAL_ENV=$(cygpath /home/shebes/Research/code/gn/gn-ai/.venv) +else + # use the path as-is + export VIRTUAL_ENV=/home/shebes/Research/code/gn/gn-ai/.venv +fi + +_OLD_VIRTUAL_PATH="$PATH" +PATH="$VIRTUAL_ENV/"bin":$PATH" +export PATH + +# unset PYTHONHOME if set +# this will fail if PYTHONHOME is set to the empty string (which is bad anyway) +# could use `if (set -u; : $PYTHONHOME) ;` in bash +if [ -n "${PYTHONHOME:-}" ] ; then + _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}" + unset PYTHONHOME +fi + +if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then + _OLD_VIRTUAL_PS1="${PS1:-}" + PS1='(.venv) '"${PS1:-}" + export PS1 + VIRTUAL_ENV_PROMPT='(.venv) ' + export VIRTUAL_ENV_PROMPT +fi + +# Call hash to forget past commands. Without forgetting +# past commands the $PATH changes we made may not be respected +hash -r 2> /dev/null diff --git a/.venv/bin/activate.csh b/.venv/bin/activate.csh new file mode 100644 index 00000000..32feb8c0 --- /dev/null +++ b/.venv/bin/activate.csh @@ -0,0 +1,27 @@ +# This file must be used with "source bin/activate.csh" *from csh*. +# You cannot run it directly. + +# Created by Davide Di Blasi <davidedb@gmail.com>. +# Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@gmail.com> + +alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate' + +# Unset irrelevant variables. +deactivate nondestructive + +setenv VIRTUAL_ENV /home/shebes/Research/code/gn/gn-ai/.venv + +set _OLD_VIRTUAL_PATH="$PATH" +setenv PATH "$VIRTUAL_ENV/"bin":$PATH" + + +set _OLD_VIRTUAL_PROMPT="$prompt" + +if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then + set prompt = '(.venv) '"$prompt" + setenv VIRTUAL_ENV_PROMPT '(.venv) ' +endif + +alias pydoc python -m pydoc + +rehash diff --git a/.venv/bin/activate.fish b/.venv/bin/activate.fish new file mode 100644 index 00000000..eee8b28c --- /dev/null +++ b/.venv/bin/activate.fish @@ -0,0 +1,69 @@ +# This file must be used with "source <venv>/bin/activate.fish" *from fish* +# (https://fishshell.com/). You cannot run it directly. + +function deactivate -d "Exit virtual environment and return to normal shell environment" + # reset old environment variables + if test -n "$_OLD_VIRTUAL_PATH" + set -gx PATH $_OLD_VIRTUAL_PATH + set -e _OLD_VIRTUAL_PATH + end + if test -n "$_OLD_VIRTUAL_PYTHONHOME" + set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME + set -e _OLD_VIRTUAL_PYTHONHOME + end + + if test -n "$_OLD_FISH_PROMPT_OVERRIDE" + set -e _OLD_FISH_PROMPT_OVERRIDE + # prevents error when using nested fish instances (Issue #93858) + if functions -q _old_fish_prompt + functions -e fish_prompt + functions -c _old_fish_prompt fish_prompt + functions -e _old_fish_prompt + end + end + + set -e VIRTUAL_ENV + set -e VIRTUAL_ENV_PROMPT + if test "$argv[1]" != "nondestructive" + # Self-destruct! + functions -e deactivate + end +end + +# Unset irrelevant variables. +deactivate nondestructive + +set -gx VIRTUAL_ENV /home/shebes/Research/code/gn/gn-ai/.venv + +set -gx _OLD_VIRTUAL_PATH $PATH +set -gx PATH "$VIRTUAL_ENV/"bin $PATH + +# Unset PYTHONHOME if set. +if set -q PYTHONHOME + set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME + set -e PYTHONHOME +end + +if test -z "$VIRTUAL_ENV_DISABLE_PROMPT" + # fish uses a function instead of an env var to generate the prompt. + + # Save the current fish_prompt function as the function _old_fish_prompt. + functions -c fish_prompt _old_fish_prompt + + # With the original prompt function renamed, we can override with our own. + function fish_prompt + # Save the return status of the last command. + set -l old_status $status + + # Output the venv prompt; color taken from the blue of the Python logo. + printf "%s%s%s" (set_color 4B8BBE) '(.venv) ' (set_color normal) + + # Restore the return status of the previous command. + echo "exit $old_status" | . + # Output the original/"old" prompt. + _old_fish_prompt + end + + set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV" + set -gx VIRTUAL_ENV_PROMPT '(.venv) ' +end diff --git a/.venv/bin/alembic b/.venv/bin/alembic new file mode 100755 index 00000000..2f701fa6 --- /dev/null +++ b/.venv/bin/alembic @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from alembic.config import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/api b/.venv/bin/api new file mode 100755 index 00000000..cae588c6 --- /dev/null +++ b/.venv/bin/api @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.api.api import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/async b/.venv/bin/async new file mode 100755 index 00000000..07ebfe4d --- /dev/null +++ b/.venv/bin/async @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.async.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/blocked b/.venv/bin/blocked new file mode 100755 index 00000000..f1fb1815 --- /dev/null +++ b/.venv/bin/blocked @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.blocked_async.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/bulk_fanout b/.venv/bin/bulk_fanout new file mode 100755 index 00000000..0aea429a --- /dev/null +++ b/.venv/bin/bulk_fanout @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.bulk_fanout.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/cancellation b/.venv/bin/cancellation new file mode 100755 index 00000000..f7323a3e --- /dev/null +++ b/.venv/bin/cancellation @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.cancellation.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/concurrency_limit b/.venv/bin/concurrency_limit new file mode 100755 index 00000000..ede43353 --- /dev/null +++ b/.venv/bin/concurrency_limit @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.concurrency_limit.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/concurrency_limit_rr b/.venv/bin/concurrency_limit_rr new file mode 100755 index 00000000..021871d6 --- /dev/null +++ b/.venv/bin/concurrency_limit_rr @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.concurrency_limit_rr.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/dag b/.venv/bin/dag new file mode 100755 index 00000000..2be4d322 --- /dev/null +++ b/.venv/bin/dag @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.dag.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/deep b/.venv/bin/deep new file mode 100755 index 00000000..def00188 --- /dev/null +++ b/.venv/bin/deep @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from deepdiff.commands import cli +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(cli()) diff --git a/.venv/bin/delayed b/.venv/bin/delayed new file mode 100755 index 00000000..b77b3857 --- /dev/null +++ b/.venv/bin/delayed @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.delayed.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/distro b/.venv/bin/distro new file mode 100755 index 00000000..d51ad9be --- /dev/null +++ b/.venv/bin/distro @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from distro.distro import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/docutils b/.venv/bin/docutils new file mode 100755 index 00000000..3876c945 --- /dev/null +++ b/.venv/bin/docutils @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from docutils.__main__ import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/dotenv b/.venv/bin/dotenv new file mode 100755 index 00000000..11e215cb --- /dev/null +++ b/.venv/bin/dotenv @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from dotenv.__main__ import cli +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(cli()) diff --git a/.venv/bin/dynamic_rate_limit b/.venv/bin/dynamic_rate_limit new file mode 100755 index 00000000..38032c1f --- /dev/null +++ b/.venv/bin/dynamic_rate_limit @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.rate_limit.dynamic import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/email_validator b/.venv/bin/email_validator new file mode 100755 index 00000000..323a895b --- /dev/null +++ b/.venv/bin/email_validator @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from email_validator.__main__ import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/events b/.venv/bin/events new file mode 100755 index 00000000..75553a75 --- /dev/null +++ b/.venv/bin/events @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.events.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/existing_loop b/.venv/bin/existing_loop new file mode 100755 index 00000000..f8f04e8f --- /dev/null +++ b/.venv/bin/existing_loop @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.worker_existing_loop.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/f2py b/.venv/bin/f2py new file mode 100755 index 00000000..4b43bb8c --- /dev/null +++ b/.venv/bin/f2py @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from numpy.f2py.f2py2e import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/fanout b/.venv/bin/fanout new file mode 100755 index 00000000..d4ff310d --- /dev/null +++ b/.venv/bin/fanout @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.fanout.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/fanout_sync b/.venv/bin/fanout_sync new file mode 100755 index 00000000..536e3942 --- /dev/null +++ b/.venv/bin/fanout_sync @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.fanout_sync.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/fastapi b/.venv/bin/fastapi new file mode 100755 index 00000000..0e7ef14d --- /dev/null +++ b/.venv/bin/fastapi @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from fastapi.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/filetype b/.venv/bin/filetype new file mode 100755 index 00000000..0207a157 --- /dev/null +++ b/.venv/bin/filetype @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from filetype.__main__ import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/flu b/.venv/bin/flu new file mode 100755 index 00000000..53e70994 --- /dev/null +++ b/.venv/bin/flu @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from flupy.cli.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/flu_precommit b/.venv/bin/flu_precommit new file mode 100755 index 00000000..3f8d42d4 --- /dev/null +++ b/.venv/bin/flu_precommit @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from flupy.cli.cli import precommit +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(precommit()) diff --git a/.venv/bin/futurize b/.venv/bin/futurize new file mode 100755 index 00000000..b1f702d5 --- /dev/null +++ b/.venv/bin/futurize @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from libfuturize.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/google-oauthlib-tool b/.venv/bin/google-oauthlib-tool new file mode 100755 index 00000000..1b67c6ac --- /dev/null +++ b/.venv/bin/google-oauthlib-tool @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from google_auth_oauthlib.tool.__main__ import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/gunicorn b/.venv/bin/gunicorn new file mode 100755 index 00000000..519ba5a3 --- /dev/null +++ b/.venv/bin/gunicorn @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from gunicorn.app.wsgiapp import run +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(run()) diff --git a/.venv/bin/httpx b/.venv/bin/httpx new file mode 100755 index 00000000..61026f74 --- /dev/null +++ b/.venv/bin/httpx @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from httpx import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/huggingface-cli b/.venv/bin/huggingface-cli new file mode 100755 index 00000000..b0115604 --- /dev/null +++ b/.venv/bin/huggingface-cli @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from huggingface_hub.commands.huggingface_cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/jp.py b/.venv/bin/jp.py new file mode 100755 index 00000000..07ecd608 --- /dev/null +++ b/.venv/bin/jp.py @@ -0,0 +1,54 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python + +import sys +import json +import argparse +from pprint import pformat + +import jmespath +from jmespath import exceptions + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('expression') + parser.add_argument('-f', '--filename', + help=('The filename containing the input data. ' + 'If a filename is not given then data is ' + 'read from stdin.')) + parser.add_argument('--ast', action='store_true', + help=('Pretty print the AST, do not search the data.')) + args = parser.parse_args() + expression = args.expression + if args.ast: + # Only print the AST + expression = jmespath.compile(args.expression) + sys.stdout.write(pformat(expression.parsed)) + sys.stdout.write('\n') + return 0 + if args.filename: + with open(args.filename, 'r') as f: + data = json.load(f) + else: + data = sys.stdin.read() + data = json.loads(data) + try: + sys.stdout.write(json.dumps( + jmespath.search(expression, data), indent=4, ensure_ascii=False)) + sys.stdout.write('\n') + except exceptions.ArityError as e: + sys.stderr.write("invalid-arity: %s\n" % e) + return 1 + except exceptions.JMESPathTypeError as e: + sys.stderr.write("invalid-type: %s\n" % e) + return 1 + except exceptions.UnknownFunctionError as e: + sys.stderr.write("unknown-function: %s\n" % e) + return 1 + except exceptions.ParseError as e: + sys.stderr.write("syntax-error: %s\n" % e) + return 1 + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/.venv/bin/jsonschema b/.venv/bin/jsonschema new file mode 100755 index 00000000..cbd19cd7 --- /dev/null +++ b/.venv/bin/jsonschema @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from jsonschema.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/litellm b/.venv/bin/litellm new file mode 100755 index 00000000..b74b8f39 --- /dev/null +++ b/.venv/bin/litellm @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from litellm import run_server +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(run_server()) diff --git a/.venv/bin/logger b/.venv/bin/logger new file mode 100755 index 00000000..5732c718 --- /dev/null +++ b/.venv/bin/logger @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.logger.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/mako-render b/.venv/bin/mako-render new file mode 100755 index 00000000..64ae846d --- /dev/null +++ b/.venv/bin/mako-render @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from mako.cmd import cmdline +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(cmdline()) diff --git a/.venv/bin/manual_trigger b/.venv/bin/manual_trigger new file mode 100755 index 00000000..e02a7085 --- /dev/null +++ b/.venv/bin/manual_trigger @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.manual_trigger.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/markdown_py b/.venv/bin/markdown_py new file mode 100755 index 00000000..b4c61ef2 --- /dev/null +++ b/.venv/bin/markdown_py @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from markdown.__main__ import run +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(run()) diff --git a/.venv/bin/msg_parser b/.venv/bin/msg_parser new file mode 100755 index 00000000..81f45685 --- /dev/null +++ b/.venv/bin/msg_parser @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from msg_parser.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/normalizer b/.venv/bin/normalizer new file mode 100755 index 00000000..60ebba34 --- /dev/null +++ b/.venv/bin/normalizer @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from charset_normalizer import cli +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(cli.cli_detect()) diff --git a/.venv/bin/on_failure b/.venv/bin/on_failure new file mode 100755 index 00000000..89513954 --- /dev/null +++ b/.venv/bin/on_failure @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.on_failure.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/openai b/.venv/bin/openai new file mode 100755 index 00000000..8fd558d5 --- /dev/null +++ b/.venv/bin/openai @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from openai.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/opentelemetry-bootstrap b/.venv/bin/opentelemetry-bootstrap new file mode 100755 index 00000000..a9b331d9 --- /dev/null +++ b/.venv/bin/opentelemetry-bootstrap @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from opentelemetry.instrumentation.bootstrap import run +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(run()) diff --git a/.venv/bin/opentelemetry-instrument b/.venv/bin/opentelemetry-instrument new file mode 100755 index 00000000..0b8b94c0 --- /dev/null +++ b/.venv/bin/opentelemetry-instrument @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from opentelemetry.instrumentation.auto_instrumentation import run +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(run()) diff --git a/.venv/bin/otel b/.venv/bin/otel new file mode 100755 index 00000000..fd94fab8 --- /dev/null +++ b/.venv/bin/otel @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.opentelemetry_instrumentation.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/pasteurize b/.venv/bin/pasteurize new file mode 100755 index 00000000..a81d82bc --- /dev/null +++ b/.venv/bin/pasteurize @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from libpasteurize.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/pip b/.venv/bin/pip new file mode 100755 index 00000000..3b90332e --- /dev/null +++ b/.venv/bin/pip @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/pip3 b/.venv/bin/pip3 new file mode 100755 index 00000000..3b90332e --- /dev/null +++ b/.venv/bin/pip3 @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/pip3.12 b/.venv/bin/pip3.12 new file mode 100755 index 00000000..3b90332e --- /dev/null +++ b/.venv/bin/pip3.12 @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/programatic_replay b/.venv/bin/programatic_replay new file mode 100755 index 00000000..6a6c3e8a --- /dev/null +++ b/.venv/bin/programatic_replay @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.programatic_replay.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/pydantic b/.venv/bin/pydantic new file mode 100755 index 00000000..7e85d942 --- /dev/null +++ b/.venv/bin/pydantic @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.pydantic.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/pyrsa-decrypt b/.venv/bin/pyrsa-decrypt new file mode 100755 index 00000000..3b04a90d --- /dev/null +++ b/.venv/bin/pyrsa-decrypt @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from rsa.cli import decrypt +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(decrypt()) diff --git a/.venv/bin/pyrsa-encrypt b/.venv/bin/pyrsa-encrypt new file mode 100755 index 00000000..eb7ded62 --- /dev/null +++ b/.venv/bin/pyrsa-encrypt @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from rsa.cli import encrypt +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(encrypt()) diff --git a/.venv/bin/pyrsa-keygen b/.venv/bin/pyrsa-keygen new file mode 100755 index 00000000..2ae01ef5 --- /dev/null +++ b/.venv/bin/pyrsa-keygen @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from rsa.cli import keygen +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(keygen()) diff --git a/.venv/bin/pyrsa-priv2pub b/.venv/bin/pyrsa-priv2pub new file mode 100755 index 00000000..3a477c75 --- /dev/null +++ b/.venv/bin/pyrsa-priv2pub @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from rsa.util import private_to_public +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(private_to_public()) diff --git a/.venv/bin/pyrsa-sign b/.venv/bin/pyrsa-sign new file mode 100755 index 00000000..31d69242 --- /dev/null +++ b/.venv/bin/pyrsa-sign @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from rsa.cli import sign +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(sign()) diff --git a/.venv/bin/pyrsa-verify b/.venv/bin/pyrsa-verify new file mode 100755 index 00000000..7d682dec --- /dev/null +++ b/.venv/bin/pyrsa-verify @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from rsa.cli import verify +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(verify()) diff --git a/.venv/bin/python b/.venv/bin/python new file mode 120000 index 00000000..11b9d885 --- /dev/null +++ b/.venv/bin/python @@ -0,0 +1 @@ +python3.12 \ No newline at end of file diff --git a/.venv/bin/python3 b/.venv/bin/python3 new file mode 120000 index 00000000..11b9d885 --- /dev/null +++ b/.venv/bin/python3 @@ -0,0 +1 @@ +python3.12 \ No newline at end of file diff --git a/.venv/bin/python3.12 b/.venv/bin/python3.12 new file mode 120000 index 00000000..c7c6ec26 --- /dev/null +++ b/.venv/bin/python3.12 @@ -0,0 +1 @@ +/bin/python3.12 \ No newline at end of file diff --git a/.venv/bin/r2r-serve b/.venv/bin/r2r-serve new file mode 100755 index 00000000..54274bdf --- /dev/null +++ b/.venv/bin/r2r-serve @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from r2r.serve import run_server +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(run_server()) diff --git a/.venv/bin/rate_limit b/.venv/bin/rate_limit new file mode 100755 index 00000000..67b58caa --- /dev/null +++ b/.venv/bin/rate_limit @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.rate_limit.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/retries_with_backoff b/.venv/bin/retries_with_backoff new file mode 100755 index 00000000..766a790b --- /dev/null +++ b/.venv/bin/retries_with_backoff @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.retries_with_backoff.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/rst2html b/.venv/bin/rst2html new file mode 100755 index 00000000..1cbc802c --- /dev/null +++ b/.venv/bin/rst2html @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from docutils.core import rst2html +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(rst2html()) diff --git a/.venv/bin/rst2html4 b/.venv/bin/rst2html4 new file mode 100755 index 00000000..042c886f --- /dev/null +++ b/.venv/bin/rst2html4 @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from docutils.core import rst2html4 +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(rst2html4()) diff --git a/.venv/bin/rst2html5 b/.venv/bin/rst2html5 new file mode 100755 index 00000000..bd0d7076 --- /dev/null +++ b/.venv/bin/rst2html5 @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from docutils.core import rst2html5 +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(rst2html5()) diff --git a/.venv/bin/rst2latex b/.venv/bin/rst2latex new file mode 100755 index 00000000..b4cddae7 --- /dev/null +++ b/.venv/bin/rst2latex @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from docutils.core import rst2latex +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(rst2latex()) diff --git a/.venv/bin/rst2man b/.venv/bin/rst2man new file mode 100755 index 00000000..45f1596e --- /dev/null +++ b/.venv/bin/rst2man @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from docutils.core import rst2man +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(rst2man()) diff --git a/.venv/bin/rst2odt b/.venv/bin/rst2odt new file mode 100755 index 00000000..dcf64cad --- /dev/null +++ b/.venv/bin/rst2odt @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from docutils.core import rst2odt +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(rst2odt()) diff --git a/.venv/bin/rst2pseudoxml b/.venv/bin/rst2pseudoxml new file mode 100755 index 00000000..37543085 --- /dev/null +++ b/.venv/bin/rst2pseudoxml @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from docutils.core import rst2pseudoxml +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(rst2pseudoxml()) diff --git a/.venv/bin/rst2s5 b/.venv/bin/rst2s5 new file mode 100755 index 00000000..6b555cf7 --- /dev/null +++ b/.venv/bin/rst2s5 @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from docutils.core import rst2s5 +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(rst2s5()) diff --git a/.venv/bin/rst2xetex b/.venv/bin/rst2xetex new file mode 100755 index 00000000..252d17a9 --- /dev/null +++ b/.venv/bin/rst2xetex @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from docutils.core import rst2xetex +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(rst2xetex()) diff --git a/.venv/bin/rst2xml b/.venv/bin/rst2xml new file mode 100755 index 00000000..b858a1a4 --- /dev/null +++ b/.venv/bin/rst2xml @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from docutils.core import rst2xml +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(rst2xml()) diff --git a/.venv/bin/runxlrd.py b/.venv/bin/runxlrd.py new file mode 100755 index 00000000..746e04fa --- /dev/null +++ b/.venv/bin/runxlrd.py @@ -0,0 +1,410 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# Copyright (c) 2005-2012 Stephen John Machin, Lingfo Pty Ltd +# This script is part of the xlrd package, which is released under a +# BSD-style licence. + +from __future__ import print_function + +cmd_doc = """ +Commands: + +2rows Print the contents of first and last row in each sheet +3rows Print the contents of first, second and last row in each sheet +bench Same as "show", but doesn't print -- for profiling +biff_count[1] Print a count of each type of BIFF record in the file +biff_dump[1] Print a dump (char and hex) of the BIFF records in the file +fonts hdr + print a dump of all font objects +hdr Mini-overview of file (no per-sheet information) +hotshot Do a hotshot profile run e.g. ... -f1 hotshot bench bigfile*.xls +labels Dump of sheet.col_label_ranges and ...row... for each sheet +name_dump Dump of each object in book.name_obj_list +names Print brief information for each NAME record +ov Overview of file +profile Like "hotshot", but uses cProfile +show Print the contents of all rows in each sheet +version[0] Print versions of xlrd and Python and exit +xfc Print "XF counts" and cell-type counts -- see code for details + +[0] means no file arg +[1] means only one file arg i.e. no glob.glob pattern +""" + +options = None +if __name__ == "__main__": + import xlrd + import sys + import time + import glob + import traceback + import gc + + from xlrd.timemachine import xrange, REPR + + + class LogHandler(object): + + def __init__(self, logfileobj): + self.logfileobj = logfileobj + self.fileheading = None + self.shown = 0 + + def setfileheading(self, fileheading): + self.fileheading = fileheading + self.shown = 0 + + def write(self, text): + if self.fileheading and not self.shown: + self.logfileobj.write(self.fileheading) + self.shown = 1 + self.logfileobj.write(text) + + null_cell = xlrd.empty_cell + + def show_row(bk, sh, rowx, colrange, printit): + if bk.ragged_rows: + colrange = range(sh.row_len(rowx)) + if not colrange: return + if printit: print() + if bk.formatting_info: + for colx, ty, val, cxfx in get_row_data(bk, sh, rowx, colrange): + if printit: + print("cell %s%d: type=%d, data: %r, xfx: %s" + % (xlrd.colname(colx), rowx+1, ty, val, cxfx)) + else: + for colx, ty, val, _unused in get_row_data(bk, sh, rowx, colrange): + if printit: + print("cell %s%d: type=%d, data: %r" % (xlrd.colname(colx), rowx+1, ty, val)) + + def get_row_data(bk, sh, rowx, colrange): + result = [] + dmode = bk.datemode + ctys = sh.row_types(rowx) + cvals = sh.row_values(rowx) + for colx in colrange: + cty = ctys[colx] + cval = cvals[colx] + if bk.formatting_info: + cxfx = str(sh.cell_xf_index(rowx, colx)) + else: + cxfx = '' + if cty == xlrd.XL_CELL_DATE: + try: + showval = xlrd.xldate_as_tuple(cval, dmode) + except xlrd.XLDateError as e: + showval = "%s:%s" % (type(e).__name__, e) + cty = xlrd.XL_CELL_ERROR + elif cty == xlrd.XL_CELL_ERROR: + showval = xlrd.error_text_from_code.get(cval, '<Unknown error code 0x%02x>' % cval) + else: + showval = cval + result.append((colx, cty, showval, cxfx)) + return result + + def bk_header(bk): + print() + print("BIFF version: %s; datemode: %s" + % (xlrd.biff_text_from_num[bk.biff_version], bk.datemode)) + print("codepage: %r (encoding: %s); countries: %r" + % (bk.codepage, bk.encoding, bk.countries)) + print("Last saved by: %r" % bk.user_name) + print("Number of data sheets: %d" % bk.nsheets) + print("Use mmap: %d; Formatting: %d; On demand: %d" + % (bk.use_mmap, bk.formatting_info, bk.on_demand)) + print("Ragged rows: %d" % bk.ragged_rows) + if bk.formatting_info: + print("FORMATs: %d, FONTs: %d, XFs: %d" + % (len(bk.format_list), len(bk.font_list), len(bk.xf_list))) + if not options.suppress_timing: + print("Load time: %.2f seconds (stage 1) %.2f seconds (stage 2)" + % (bk.load_time_stage_1, bk.load_time_stage_2)) + print() + + def show_fonts(bk): + print("Fonts:") + for x in xrange(len(bk.font_list)): + font = bk.font_list[x] + font.dump(header='== Index %d ==' % x, indent=4) + + def show_names(bk, dump=0): + bk_header(bk) + if bk.biff_version < 50: + print("Names not extracted in this BIFF version") + return + nlist = bk.name_obj_list + print("Name list: %d entries" % len(nlist)) + for nobj in nlist: + if dump: + nobj.dump(sys.stdout, + header="\n=== Dump of name_obj_list[%d] ===" % nobj.name_index) + else: + print("[%d]\tName:%r macro:%r scope:%d\n\tresult:%r\n" + % (nobj.name_index, nobj.name, nobj.macro, nobj.scope, nobj.result)) + + def print_labels(sh, labs, title): + if not labs:return + for rlo, rhi, clo, chi in labs: + print("%s label range %s:%s contains:" + % (title, xlrd.cellname(rlo, clo), xlrd.cellname(rhi-1, chi-1))) + for rx in xrange(rlo, rhi): + for cx in xrange(clo, chi): + print(" %s: %r" % (xlrd.cellname(rx, cx), sh.cell_value(rx, cx))) + + def show_labels(bk): + # bk_header(bk) + hdr = 0 + for shx in range(bk.nsheets): + sh = bk.sheet_by_index(shx) + clabs = sh.col_label_ranges + rlabs = sh.row_label_ranges + if clabs or rlabs: + if not hdr: + bk_header(bk) + hdr = 1 + print("sheet %d: name = %r; nrows = %d; ncols = %d" % + (shx, sh.name, sh.nrows, sh.ncols)) + print_labels(sh, clabs, 'Col') + print_labels(sh, rlabs, 'Row') + if bk.on_demand: bk.unload_sheet(shx) + + def show(bk, nshow=65535, printit=1): + bk_header(bk) + if 0: + rclist = xlrd.sheet.rc_stats.items() + rclist = sorted(rclist) + print("rc stats") + for k, v in rclist: + print("0x%04x %7d" % (k, v)) + if options.onesheet: + try: + shx = int(options.onesheet) + except ValueError: + shx = bk.sheet_by_name(options.onesheet).number + shxrange = [shx] + else: + shxrange = range(bk.nsheets) + # print("shxrange", list(shxrange)) + for shx in shxrange: + sh = bk.sheet_by_index(shx) + nrows, ncols = sh.nrows, sh.ncols + colrange = range(ncols) + anshow = min(nshow, nrows) + print("sheet %d: name = %s; nrows = %d; ncols = %d" % + (shx, REPR(sh.name), sh.nrows, sh.ncols)) + if nrows and ncols: + # Beat the bounds + for rowx in xrange(nrows): + nc = sh.row_len(rowx) + if nc: + sh.row_types(rowx)[nc-1] + sh.row_values(rowx)[nc-1] + sh.cell(rowx, nc-1) + for rowx in xrange(anshow-1): + if not printit and rowx % 10000 == 1 and rowx > 1: + print("done %d rows" % (rowx-1,)) + show_row(bk, sh, rowx, colrange, printit) + if anshow and nrows: + show_row(bk, sh, nrows-1, colrange, printit) + print() + if bk.on_demand: bk.unload_sheet(shx) + + def count_xfs(bk): + bk_header(bk) + for shx in range(bk.nsheets): + sh = bk.sheet_by_index(shx) + nrows = sh.nrows + print("sheet %d: name = %r; nrows = %d; ncols = %d" % + (shx, sh.name, sh.nrows, sh.ncols)) + # Access all xfindexes to force gathering stats + type_stats = [0, 0, 0, 0, 0, 0, 0] + for rowx in xrange(nrows): + for colx in xrange(sh.row_len(rowx)): + xfx = sh.cell_xf_index(rowx, colx) + assert xfx >= 0 + cty = sh.cell_type(rowx, colx) + type_stats[cty] += 1 + print("XF stats", sh._xf_index_stats) + print("type stats", type_stats) + print() + if bk.on_demand: bk.unload_sheet(shx) + + def main(cmd_args): + import optparse + global options + usage = "\n%prog [options] command [input-file-patterns]\n" + cmd_doc + oparser = optparse.OptionParser(usage) + oparser.add_option( + "-l", "--logfilename", + default="", + help="contains error messages") + oparser.add_option( + "-v", "--verbosity", + type="int", default=0, + help="level of information and diagnostics provided") + oparser.add_option( + "-m", "--mmap", + type="int", default=-1, + help="1: use mmap; 0: don't use mmap; -1: accept heuristic") + oparser.add_option( + "-e", "--encoding", + default="", + help="encoding override") + oparser.add_option( + "-f", "--formatting", + type="int", default=0, + help="0 (default): no fmt info\n" + "1: fmt info (all cells)\n", + ) + oparser.add_option( + "-g", "--gc", + type="int", default=0, + help="0: auto gc enabled; 1: auto gc disabled, manual collect after each file; 2: no gc") + oparser.add_option( + "-s", "--onesheet", + default="", + help="restrict output to this sheet (name or index)") + oparser.add_option( + "-u", "--unnumbered", + action="store_true", default=0, + help="omit line numbers or offsets in biff_dump") + oparser.add_option( + "-d", "--on-demand", + action="store_true", default=0, + help="load sheets on demand instead of all at once") + oparser.add_option( + "-t", "--suppress-timing", + action="store_true", default=0, + help="don't print timings (diffs are less messy)") + oparser.add_option( + "-r", "--ragged-rows", + action="store_true", default=0, + help="open_workbook(..., ragged_rows=True)") + options, args = oparser.parse_args(cmd_args) + if len(args) == 1 and args[0] in ("version", ): + pass + elif len(args) < 2: + oparser.error("Expected at least 2 args, found %d" % len(args)) + cmd = args[0] + xlrd_version = getattr(xlrd, "__VERSION__", "unknown; before 0.5") + if cmd == 'biff_dump': + xlrd.dump(args[1], unnumbered=options.unnumbered) + sys.exit(0) + if cmd == 'biff_count': + xlrd.count_records(args[1]) + sys.exit(0) + if cmd == 'version': + print("xlrd: %s, from %s" % (xlrd_version, xlrd.__file__)) + print("Python:", sys.version) + sys.exit(0) + if options.logfilename: + logfile = LogHandler(open(options.logfilename, 'w')) + else: + logfile = sys.stdout + mmap_opt = options.mmap + mmap_arg = xlrd.USE_MMAP + if mmap_opt in (1, 0): + mmap_arg = mmap_opt + elif mmap_opt != -1: + print('Unexpected value (%r) for mmap option -- assuming default' % mmap_opt) + fmt_opt = options.formatting | (cmd in ('xfc', )) + gc_mode = options.gc + if gc_mode: + gc.disable() + for pattern in args[1:]: + for fname in glob.glob(pattern): + print("\n=== File: %s ===" % fname) + if logfile != sys.stdout: + logfile.setfileheading("\n=== File: %s ===\n" % fname) + if gc_mode == 1: + n_unreachable = gc.collect() + if n_unreachable: + print("GC before open:", n_unreachable, "unreachable objects") + try: + t0 = time.time() + bk = xlrd.open_workbook( + fname, + verbosity=options.verbosity, logfile=logfile, + use_mmap=mmap_arg, + encoding_override=options.encoding, + formatting_info=fmt_opt, + on_demand=options.on_demand, + ragged_rows=options.ragged_rows, + ) + t1 = time.time() + if not options.suppress_timing: + print("Open took %.2f seconds" % (t1-t0,)) + except xlrd.XLRDError as e: + print("*** Open failed: %s: %s" % (type(e).__name__, e)) + continue + except KeyboardInterrupt: + print("*** KeyboardInterrupt ***") + traceback.print_exc(file=sys.stdout) + sys.exit(1) + except BaseException as e: + print("*** Open failed: %s: %s" % (type(e).__name__, e)) + traceback.print_exc(file=sys.stdout) + continue + t0 = time.time() + if cmd == 'hdr': + bk_header(bk) + elif cmd == 'ov': # OverView + show(bk, 0) + elif cmd == 'show': # all rows + show(bk) + elif cmd == '2rows': # first row and last row + show(bk, 2) + elif cmd == '3rows': # first row, 2nd row and last row + show(bk, 3) + elif cmd == 'bench': + show(bk, printit=0) + elif cmd == 'fonts': + bk_header(bk) + show_fonts(bk) + elif cmd == 'names': # named reference list + show_names(bk) + elif cmd == 'name_dump': # named reference list + show_names(bk, dump=1) + elif cmd == 'labels': + show_labels(bk) + elif cmd == 'xfc': + count_xfs(bk) + else: + print("*** Unknown command <%s>" % cmd) + sys.exit(1) + del bk + if gc_mode == 1: + n_unreachable = gc.collect() + if n_unreachable: + print("GC post cmd:", fname, "->", n_unreachable, "unreachable objects") + if not options.suppress_timing: + t1 = time.time() + print("\ncommand took %.2f seconds\n" % (t1-t0,)) + + return None + + av = sys.argv[1:] + if not av: + main(av) + firstarg = av[0].lower() + if firstarg == "hotshot": + import hotshot + import hotshot.stats + av = av[1:] + prof_log_name = "XXXX.prof" + prof = hotshot.Profile(prof_log_name) + # benchtime, result = prof.runcall(main, *av) + result = prof.runcall(main, *(av, )) + print("result", repr(result)) + prof.close() + stats = hotshot.stats.load(prof_log_name) + stats.strip_dirs() + stats.sort_stats('time', 'calls') + stats.print_stats(20) + elif firstarg == "profile": + import cProfile + av = av[1:] + cProfile.run('main(av)', 'YYYY.prof') + import pstats + p = pstats.Stats('YYYY.prof') + p.strip_dirs().sort_stats('cumulative').print_stats(30) + else: + main(av) diff --git a/.venv/bin/simple b/.venv/bin/simple new file mode 100755 index 00000000..748c663d --- /dev/null +++ b/.venv/bin/simple @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.simple.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/striprtf b/.venv/bin/striprtf new file mode 100755 index 00000000..2b8b9880 --- /dev/null +++ b/.venv/bin/striprtf @@ -0,0 +1,21 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +import argparse + +from striprtf.striprtf import rtf_to_text +from striprtf._version import __version__ as version + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("rtf_file", type=argparse.FileType("r", encoding="UTF-8")) + parser.add_argument("--version", action="version", version="%s" % version) + args = parser.parse_args() + in_rtf = args.rtf_file.read() + args.rtf_file.close() + + content = rtf_to_text(in_rtf) + print(content) + + +if __name__ == "__main__": + main() diff --git a/.venv/bin/tests b/.venv/bin/tests new file mode 100755 index 00000000..a6f2dffc --- /dev/null +++ b/.venv/bin/tests @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from poetry_scripts import run_tests +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(run_tests()) diff --git a/.venv/bin/timeout b/.venv/bin/timeout new file mode 100755 index 00000000..8d90aeb5 --- /dev/null +++ b/.venv/bin/timeout @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.timeout.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/tqdm b/.venv/bin/tqdm new file mode 100755 index 00000000..771f02ec --- /dev/null +++ b/.venv/bin/tqdm @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tqdm.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/uvicorn b/.venv/bin/uvicorn new file mode 100755 index 00000000..eb039134 --- /dev/null +++ b/.venv/bin/uvicorn @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from uvicorn.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/v2_simple b/.venv/bin/v2_simple new file mode 100755 index 00000000..c4cab0d8 --- /dev/null +++ b/.venv/bin/v2_simple @@ -0,0 +1,8 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from examples.v2.simple.worker import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/vba_extract.py b/.venv/bin/vba_extract.py new file mode 100755 index 00000000..0bbbcd76 --- /dev/null +++ b/.venv/bin/vba_extract.py @@ -0,0 +1,79 @@ +#!/home/shebes/Research/code/gn/gn-ai/.venv/bin/python + +############################################################################## +# +# vba_extract - A simple utility to extract a vbaProject.bin binary from an +# Excel 2007+ xlsm file for insertion into an XlsxWriter file. +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2013-2025, John McNamara, jmcnamara@cpan.org +# + +import sys +from zipfile import BadZipFile, ZipFile + + +def extract_file(xlsm_zip, filename): + # Extract a single file from an Excel xlsm macro file. + data = xlsm_zip.read("xl/" + filename) + + # Write the data to a local file. + file = open(filename, "wb") + file.write(data) + file.close() + + +# The VBA project file and project signature file we want to extract. +vba_filename = "vbaProject.bin" +vba_signature_filename = "vbaProjectSignature.bin" + +# Get the xlsm file name from the commandline. +if len(sys.argv) > 1: + xlsm_file = sys.argv[1] +else: + print( + "\nUtility to extract a vbaProject.bin binary from an Excel 2007+ " + "xlsm macro file for insertion into an XlsxWriter file.\n" + "If the macros are digitally signed, extracts also a vbaProjectSignature.bin " + "file.\n" + "\n" + "See: https://xlsxwriter.readthedocs.io/working_with_macros.html\n" + "\n" + "Usage: vba_extract file.xlsm\n" + ) + sys.exit() + +try: + # Open the Excel xlsm file as a zip file. + xlsm_zip = ZipFile(xlsm_file, "r") + + # Read the xl/vbaProject.bin file. + extract_file(xlsm_zip, vba_filename) + print(f"Extracted: {vba_filename}") + + if "xl/" + vba_signature_filename in xlsm_zip.namelist(): + extract_file(xlsm_zip, vba_signature_filename) + print(f"Extracted: {vba_signature_filename}") + + +except IOError as e: + print(f"File error: {str(e)}") + sys.exit() + +except KeyError as e: + # Usually when there isn't a xl/vbaProject.bin member in the file. + print(f"File error: {str(e)}") + print(f"File may not be an Excel xlsm macro file: '{xlsm_file}'") + sys.exit() + +except BadZipFile as e: + # Usually if the file is an xls file and not an xlsm file. + print(f"File error: {str(e)}: '{xlsm_file}'") + print("File may not be an Excel xlsm macro file.") + sys.exit() + +except Exception as e: + # Catch any other exceptions. + print(f"File error: {str(e)}") + sys.exit() |
