Saravanan666/pypi-org huggingface dataset:
Package: sherpa-client
sherpa-clientA client library for accessing Sherpa API documentationUsageFirst, create a client and log in:fromsherpa_clientimportSherpaClientclient=SherpaClient(base_url="https://api.example.com")client.login_with_token(Credentials(email="login",password="pwd"))Now call your endpoint and use your models:fromsherpa_client.modelsimportMyDataModelfromsherpa_client.api.my_tagimportget_my_data_modelfromsherpa_client.typesimportResponsemy_data:MyDataModel=get_my_data_model.sync(client=client)# or if you need more info (e.g. status_code)response:Response[MyDataModel]=get_my_data_model.sync_detailed(client=client)Or do the same thing with an async version:fromsherpa_client.modelsimportMyDataModelfromsherpa_client.api.my_tagimportget_my_data_modelfromsherpa_client.typesimportResponsemy_data:MyDataModel=awaitget_my_data_model.asyncio(client=client)response:Response[MyDataModel]=awaitget_my_data_model.asyncio_detailed(client=client)By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle.client=AuthenticatedClient(base_url="https://internal_api.example.com",token="SuperSecretToken",verify_ssl="/path/to/certificate_bundle.pem",)You can also disable certificate validation altogether, but beware thatthis is a security risk.client=AuthenticatedClient(base_url="https://internal_api.example.com",token="SuperSecretToken",verify_ssl=False)Things to know:Every path/method combo becomes a Python module with four functions:sync: Blocking request that returns parsed data (if successful) orNonesync_detailed: Blocking request that always returns aRequest, optionally withparsedset if the request was successful.asyncio: Likesyncbut the async instead of blockingasyncio_detailed: Likesync_detailedby async instead of blockingAll path/query params, and bodies become method arguments.If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)Any endpoint which did not have a tag will be insherpa_client.api.defaultBuilding / publishing this ClientThis project usesPoetryto manage dependencies  and packaging.  Here are the basics:Update the metadata in pyproject.toml (e.g. authors, version)If you're using a private repository, configure it with Poetrypoetry config repositories.<your-repository-name> <url-to-your-repository>poetry config http-basic.<your-repository-name> <username> <password>Publish the client withpoetry publish --build -r <your-repository-name>or, if for public PyPI, justpoetry publish --buildIf you want to install this client into another project without publishing it (e.g. for development) then:If that projectis using Poetry, you can simply dopoetry add <path-to-this-client>from that projectIf that project is not using Poetry:Build a wheel withpoetry build -f wheelInstall that wheel from the other projectpip install <path-to-wheel>
Package: sherpa-ncnn
IntroductionYou can usesherpa-ncnnforreal-timespeech recognition (i.e., speech-to-text)
onLinuxmacOSWindowsEmbedded Linux (32-bit arm and 64-bit aarch64)Androidetc ...We support all platforms thatncnnsupports.Everything can be compiled from source with static link. The generated
executable depends only on system libraries.HINT: It does not depend on PyTorch or any other inference frameworks
other thanncnn.Please see the documentationhttps://k2-fsa.github.io/sherpa/ncnn/index.htmlfor installation and usages, e.g.,How to build an Android appHow to download and use pre-trained modelsWe provide a few YouTube videos for demonstration about real-time speech recognition
withsherpa-ncnnusing a microphone:English:https://www.bilibili.com/video/BV1TP411p7dh/Chinese:https://www.bilibili.com/video/BV1214y177vuMultilingual (Chinese + English) with endpointing Python demo :https://www.bilibili.com/video/BV1eK411y788/Android demosMultilingual (Chinese + English) Android demo 1:https://www.bilibili.com/video/BV1Ge411A7XSMultilingual (Chinese + English) Android demo 2:https://www.bilibili.com/video/BV1eK411y788/Chinese (with background noise)Android demo :https://www.bilibili.com/video/BV1GR4y167fxChineseAndroid demo :https://www.bilibili.com/video/BV1744y1Z76HChinese poem with background musicAndroid demo :https://www.bilibili.com/video/BV1vR4y1k7eoSee alsohttps://github.com/k2-fsa/sherpa
Package: sherpa-streamlit
sherpa_streamlitKairntech Sherpa building blocks for Streamlit appsThis package contains utilities for visualizing and building interactiveKairntechSherpa-powered apps withStreamlit. It includes various building blocks you can
use in your own Streamlit app, like visualizers fornamed entities,text classification, and more.InstallationYou can simplypip install sherpa-streamlit.QuickstartThe package includes building blocks that call into Streamlit and set up all the required elements for you. You can either use the individual components directly and combine them with other elements in your app, or call the visualize function to embed the whole visualizer.Put the following example code in a file.# streamlit_app.py
import sherpa_streamlit

default_text = "Sundar Pichai is the CEO of Google."
sherpa_streamlit.visualize(default_text)You can then run your app withstreamlit run streamlit_app.py. The app should pop up in your web browser.DevelopingPre-requesitesYou will need to installflit(for building the package) andtox(for orchestrating testing and documentation building):python3 -m pip install flit toxClone the repository:git clone https://github.com/oterrier/sherpa_streamlitRunning the test suiteYou can run the full test suite against all supported versions of Python (3.8) with:toxBuilding the documentationYou can build the HTML documentation with:tox -e docsThe built documentation is available at `docs/_build/index.html.
Package: sherry
sherryPython web frameworkpipinstallsherrySimple applicationfromsherryimportSherry,get,Requesthi_str="hi{}"app=Sherry()@get("/",app)defhello_world(request:Request):returnhi_str.format(request.query.get("name")or"world")app.run(9527)Create application enginefromsherryimportSherry,Engineapp1=Sherry()# orapp2=Engine()# with regexapp3=Engine(re=True)Add handlersCreate handlerIf a return value exists for the function, it will be converted to a response (if not)defmy_handler(*args,**kwargs)->Response|Any:passIf there is no return value, the response will be the response field of the first parameterThe second parameter is the response field of the first parameterfromsherryimportRequest,Responsedefmy_handler(ctx:Request)->None:passdefmy_handler(req:Request,res:Response)->None:"""req.response == res # True"""passAdd route, method, handlersapp=Engine()app.add_route("GET""""http method""","/""""pattern""",handlers)app.add_route("GET","/:some""""match one dynamic""",handlers)app.add_route("GET","/xx/*any""""match multiple dynamic""",handlers)with regexapp=Engine(re=True)app.add_route("GET","^/\d$""""match one number""",handlers)Wrappingapp.get("/",handlers)app.post("/",handlers)...Decoratorsfromsherry.decoratorsimporthandler,get# ...@handler("/""""pattern""",["GET"""""http methods"""],app)deffunc():pass@get("/""""pattern""",app)deffunc():passexamplefromsherryimportEngine,handlerapp=Engine()# function decorators@handler("/",["GET"],app)defindex_handler():pass# asapp.add_route("GET","/",index_handler)# class decorators@handler("/",["GET"],app)classPages:defmiddle_handler():passdefindex_handler():pass# asapp.add_route("GET",Pages.middle_handler,Pages.index_handler)
Package: shesha
Table of ContentsTable of ContentsRequirementsInstallation of Anaconda/MinicondaInstallation of COMPASS via condaInstallation of SHESHA package for COMPASSTest your installationRun the simulationMore documentation (maybe not fully up-to-date)Questions?RequirementsLinux distribution with wget and git installedNvidia GPU card withCUDA toolkit>= 11.8 (Older versions could be available on request)Installation of Anaconda/MinicondaCOMPASS binaries, which contain the optimized GPU code, can be installed via Anaconda.
Then, you have to install Anaconda 3 or Miniconda 3 (python 3 is required).We recommend Miniconda instead of Anaconda as it is much lighter, but it's up to you.exportCONDA_ROOT=$HOME/miniconda3
wgethttps://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bashMiniconda3-latest-Linux-x86_64.sh-b-p$CONDA_ROOTDon't forget to add your Miniconda or Anaconda directory to your PATH:exportPATH=$CONDA_ROOT/bin:$PATHInstallation of COMPASS via condaOnce Miniconda is installed, installing the COMPASS binaries is easy :condainstall-ccompasscompass-yNote: conda main channel is compiled with CUDA 12. For previous version please have a look to theother channeland post an issue and we will try to provide it.This command line will also install dependencies in your conda environment.Installation of SHESHA package for COMPASSFirst, you will need to set some environment variables:exportSHESHA_ROOT=$HOME/sheshaexportPYTHONPATH=$SHESHA_ROOT:$PYTHONPATHexportPYTHONDONTWRITEBYTECODE=1Finally, you can get the Shesha package of COMPASS. This python package is the user level of COMPASS. It also contains all the initialization functions.gitclonehttps://github.com/ANR-COMPASS/shesha.git$SHESHA_ROOTTest your installationOnce the installation is complete, verify that everything is working fine :cd$SHESHA_ROOT/tests
./checkCompass.shThis test will basically launch fast simulation test cases and it will print if those cases have been correctly initialised.Run the simulationYou are ready !
You can try it with one of our paramaters file:cd$SHESHA_ROOTipython-ishesha/scripts/closed_loop.pydata/par/par4bench/scao_sh_16x16_8pix.pyAnd if you want to launch the GUI:cd$SHESHA_ROOTipython-ishesha/widgets/widget_ao.pyMore documentation (maybe not fully up-to-date)Project GitHub pages with a detailed user manual :https://anr-compass.github.io/compass/doc auto-generated from code:http://shesha.readthedocs.iowiki page of the COMPASS project:https://projets-lesia.obspm.fr/projects/compass/wiki/WikiQuestions?Please feel free to create an issue on Github for any questions and inquiries.
Package: shetar
Python implementations of translation and rotation theorems for spherical solutions of the Helmholtz equation in three dimensions.
This is heavily based on the book “Fast Multipole Methods for the Helmholtz Equation in Three Dimensions”,
by N. A. Gumerov and R. Duraiswami, Elsevier 2005.Documentattion:https://spherical-helmholtz-translation-and-rotation.readthedocs.io/en/latest/Source code and issue tracker:https://github.com/AppliedAcousticsChalmers/Spherical-Helmholtz-Translation-and-Rotation
Package: sheval
🐴 shevalSafely evaluate mathematical and logical expressions. Most operations are supported.Whitelisted data typesFor security, only certain data types are allowed for constants and variables.strintfloatcomplexlisttuplesetdictboolbytesNoneTypeExamplefromshevalimportsheval# Variables can be passed on.variables=dict(x=2,y=3,)# And functions too!functions=dict(double=lambdax:x*2,)sheval('double(x) > y',variables,functions)
Package: shewchuk
shewchukSummaryshewchukis a collection of computational geometry utilities
for robust processing of geometries with floating point coordinates.Named after and based onthe workofJonathan Richard Shewchuk.In what followspythonis an alias forpython3.8orpypy3.8or any later version (python3.9,pypy3.9and so on).InstallationInstall the latestpip&setuptoolspackages versionspython-mpipinstall--upgradepipsetuptoolsUserDownload and install the latest stable version fromPyPIrepositorypython-mpipinstall--upgradeshewchukDeveloperDownload the latest version fromGitHubrepositorygitclonehttps://github.com/lycantropos/shewchuk.gitcdshewchukInstallpythonsetup.pyinstallUsage>>>fromshewchukimportincircle_test>>>incircle_test(3,3,0,0,2,0,0,2)==-1True>>>incircle_test(2,2,0,0,2,0,0,2)==0True>>>incircle_test(1,1,0,0,2,0,0,2)==1True>>>fromshewchukimportkind>>>kind(1,0,0,0,2,0)==-1True>>>kind(0,0,0,1,1,0)==0True>>>kind(0,0,1,0,2,0)==1True>>>fromshewchukimportorientation>>>orientation(0,0,0,1,1,0)==-1True>>>orientation(0,0,1,0,2,0)==0True>>>orientation(0,0,1,0,0,1)==1TrueDevelopmentBumping versionPreparationInstallbump2version.Pre-releaseChoose which version number category to bump followingsemver
specification.Test bumping versionbump2version--dry-run--verbose$CATEGORYwhere$CATEGORYis the target version number category name, possible
values arepatch/minor/major.Bump versionbump2version--verbose$CATEGORYThis will set version tomajor.minor.patch-alpha.ReleaseTest bumping versionbump2version--dry-run--verbosereleaseBump versionbump2version--verbosereleaseThis will set version tomajor.minor.patch.Running testsInstall dependenciespython-mpipinstall-rrequirements-tests.txtPlainpytestInsideDockercontainer:withCPythondocker-compose--filedocker-compose.cpython.ymlupwithPyPydocker-compose--filedocker-compose.pypy.ymlupBashscript:withCPython./run-tests.shor./run-tests.shcpythonwithPyPy./run-tests.shpypyPowerShellscript:withCPython.\run-tests.ps1or.\run-tests.ps1cpythonwithPyPy.\run-tests.ps1pypy
Package: shfd
My custom wrapper for subprocess inspired byEnvoy.Features :full unicode supportpipe with python operator |multi platformMethod chaining availablePython versions supported :2.62.73.13.23.3UsageRun a command>>> cmd = shfd.run('echo "hello world"')
>>> cmd.retcode
0
>>> cmd.out
u'hello world\n'
>>> cmd.err
u''Example with pipe and chaining>>> cmd = (shfd.cmd('git log') | 'head -n 30').run()
>>> cmd.command
u'git log | head -n 30'
>>> cmd.out
u'...'TestsTest one version ::python test_shfd.pyTest all available versions ::python test_multi_shfd.py
Package: shfmt-py
shfmt-pyA python wrapper to provide a pip-installableshfmtbinary.Internally this package provides a convenient way to download the pre-built
shellcheck binary for your particular platform.This package is totally cloned fromshellcheck-pyand modified to provideshfmtinstead.Installationpipinstallshfmt-pyUsageCLIAfter installation, theshfmtbinary should be available in your
environment (orshfmt.exeon windows).As pre-commit hookSeepre-commitfor instructionsSample.pre-commit-config.yaml:-repo:https://github.com/maxwinterstein/shfmt-pyrev:v3.4.3.1hooks:-id:shfmtFAQQ: I get something likeSSL: CERTIFICATE_VERIFY_FAILEDon macOS
A: Install certificates with e.g.:"/Applications/Python 3.9/Install Certificates.command". Seehereorherefor
Package: shgo
.. image::https://travis-ci.org/Stefan-Endres/shgo.svg?branch=master:target:https://travis-ci.org/Stefan-Endres/shgo.. image::https://coveralls.io/repos/github/Stefan-Endres/shgo/badge.png?branch=master:target:https://coveralls.io/github/Stefan-Endres/shgo?branch=masterRepository:https://github.com/Stefan-Endres/shgoDescriptionFinds the global minimum of a function using simplicial homology global
optimisation (shgo_). Appropriate for solving general purpose NLP and blackbox
optimisation problems to global optimality (low dimensional problems).
The general form of an optimisation problem is given by:.. _shgo:https://stefan-endres.github.io/shgo/::minimize f(x) subject to

g_i(x) >= 0,  i = 1,...,m
h_j(x)  = 0,  j = 1,...,pwhere x is a vector of one or more variables.f(x)is the objective
functionR^n -> R,g_i(x)are the inequality constraints.h_j(x)are the equality constrains.InstallationStable:.. code::$ pip install shgoLatest:.. code::$ git clone https://github.com/Stefan-Endres/shgo
$ cd shgo
$ python setup.py install
$ python setup.py testDocumentationThe project websitehttps://stefan-endres.github.io/shgo/contains more detailed examples, notes and performance profiles.Quick exampleConsider the problem of minimizing the Rosenbrock function. This function is implemented inroseninscipy.optimize.. code:: python>>> from scipy.optimize import rosen
>>> from shgo import shgo
>>> bounds = [(0,2), (0, 2), (0, 2), (0, 2), (0, 2)]
>>> result = shgo(rosen, bounds)
>>> result.x, result.fun
(array([ 1.,  1.,  1.,  1.,  1.]), 2.9203923741900809e-18)Note that bounds determine the dimensionality of the objective function and is therefore a required input, however you can specify empty bounds usingNoneor objects like numpy.inf which will be converted to large float numbers.
Package: shgofast
SHGOFASTA monkey-patched Cython/C++ backend for bottleneck functions and classes
of thescipy.optimize.shgocode using the simplicial sampling method.InstallThe module can be installed using your preferredpipcommand from the
source archives root directory (where this README resides).The installation requires a reasonably modern C++ compiler (tested with g++
13.1.1) and the boost software library (tested with version 1.81.0). If boost
is not available, defining the C++ macroSTD_SET_ONLYwill use only standard
library components.UseSimply import thepatchandunpatchfunctions fromshgofast:fromscipy.optimizeimportshgofromshgofastimportpatchpatch()# This should run faster now if cost_fun is not the bottleneck:shgo(cost_fun,sampling_method='simplicial',**kwargs)ImprovementFrom a one-shot measurement, execution time of identicalshgocalls has
been reduced from 13 seconds to 2.5 seconds for a four-dimensional problem
in whichshgowas not limited by the function but foremost by theVertexCacheField.proc_minimisersmethod.ChangelogThe format is based onKeep a Changelog,
and this project adheres toSemantic Versioning.[0.1.2] - 2023-12-29Add missingshgofast/vertex.pyxtoMANIFEST.in.[0.1.1] - 2023-12-29Fix inclusion of build files usingMANIFEST.in.[0.1.0] - 2023-12-29Initial version.
Package: shgpy
ShgPyShgPy is a simple toolkit for analyzing rotational-anisotropy second harmonic generation (RA-SHG) data. It depends mainly on three packages,NumPy,SciPy, andSymPy-- as well as (optionally)Matplolibfor some basic plotting capability -- to simulate, manipulate, and fit RA-SHG data in a (hopefully!) intuitive way.Fitting RA-SHG data involves solving a complex global minimization problem with many degrees of freedom. Moreover, the fitting functions naively involve a degree of complexity due to the trigonometric nature of the problem. This software therefore takes a dual approach to fitting RA-SHG data -- first of all, all of the fits are done in Fourier space, which significantly reduces the complexity of the fitting formulas, and second of all, ShgPy makes heavy use of thescipy.optimize.basinhoppingalgorithm, which is particularly useful for these types of global optimization problems.For more information, please see thetutorials and documentation.
Package: shhell
ShhellSubprocess replacementdone rightwith fancy API to build commands, autocompletion and typing support ✨I was not satisfied with API of subprocess/sh/plumbum, so I decided to at least define how the perfect API should look like for me.Coming soon, sometime or just never.How I want API to look like:importshhellshhell.sh(c=shhell.curl(*'fsSL','https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh')).run()which will be translated to:sh-c"$(curl-fsSL'https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh')"shhell.<cmd>(...)will produce an instance of special class, which can invoke and get result from command both synchronously and asynchronously, allowing flexibility:importasyncioimportshhellOUTPUT_FILE="example.mp4"asyncdefdownload():awaitshhell.curl(*'fsSL',"https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_1920_18MG.mp4",output=OUTPUT_FILE)asyncdefprint_file_size():whileTrue:awaitshhell.echo(f'\t{awaitshhell.stat(OUTPUT_FILE,printf="%s")}')awaitasyncio.sleep(0.1)asyncio.run(asyncio.wait([asyncio.create_task(download()),asyncio.create_task(print_file_size())],return_when=asyncio.FIRST_COMPLETED))Pipes, redirects, subshells?I like how plumbum deos this, i.e. using python magic methods allowing|,>support. In fact, if I'm going to write this library, I'm going to steal a lot of ideas from plumbum, changing little things that I don't like.How autocompletion would even work?Code generation, of course! However, it's not going to be easy, if achievable at all...One of the options is generating signatures upon package build for executables available in PATH (expected args, types, docs) from -h/--help/man output for the command for linux/macOS.
This option is only viable on CI/CD stages, however.There should be api available for users to generate code structures for their own non-standard executables.Note: all the generated code will serve only cosmetic purpose, whether a signature was generated for a specific executable or not, the runtime result should always remain the same.Soshhell/executables/cowsay.pywould look like this:fromtypingimportAny,Literalfromshhell.commandimportCommandfromshhell.executableimportExecutable@Executable.from_dummydefcowsay(*args:Literal["b","d","g","p","s","t","w","y","l","n"],# __message this is positional only optional argument__message:str=...,# these arguments are keyword only (e='??' will be converted to -e '??')e:Any="eyes",f:Any="cowfile",T:Any="tongue",W:Any="wrapcolumn",)->Command:"""cow{say,think} version 3.03, (c) 1999 Tony MonroeUsage: cowsay [-bdgpstwy] [-h] [-e eyes] [-f cowfile][-l] [-n] [-T tongue] [-W wrapcolumn] [message]"""...However, I think it's better to have a separate file for each executable, and just add imports for them
Package: shhistory
ShhistorySimple Python library to return your shell history or dump to a JSON file.You can install this library via pip:pipinstallshhistoryExampleA quick example to print the JSON data to stdout:# test.pyfromshhistoryimportShellHistoryprint(ShellHistory.get_shell_history())You can also create a quick bash utility with this library by piping tojqfor nicer formatting:python3test.py|jqIf you would like to analyze the data more securely, you can also dump to a file:fromshhistoryimportShellHistoryprint(ShellHistory.dump_shell_history())NOTE: Windows is not currently supported. This may be added in a future update.
Package: shholiday
Usepip install#pip install shholidayTemporary usefromshholidayimportholiday2020daytuple=(1,1)# 1월 1일이 휴일인지 확인하고 싶을 때nowholiday=holiday2020()print(nowholiday.is_holiday(daytuple))Check if today's date is a holidayfromshholidayimportholiday2020fromdatetimeimportdatetimenow=datetime.now()daytuple=(str(now.month),str(now.day))nowholiday=holiday2020()print(nowholiday.is_holiday(daytuple))