Saravanan666/pypi-org huggingface dataset:
Package: fastbot
FastbotFastbot is an sdk for building enterprise-grade conversational experiences, written in Python.How to installpipinstallfastbostIntegration with other frameworksfromfastbotimportDialogManager,InMemoryDataStore,InMemoryDialogSetfromfastbot.responsesimportinit,end,ContentType,Requestapp=DialogManager(data_store=InMemoryDataStore(),dialog_set=InMemoryDialogSet())if__name__=='__main__':@app.root(default="enter_number")defroot_handler(dialog=None,request=None,state=None,**kwargs):returninit(text="Hello\nPlease enter\n1. Yes\n2. No")@app.dialogue(name="enter_number")defselected_choice(dialog=None,request=None,state=None,**kwargs):returnend(text="You entered request{0}".format(request.text),content_type=ContentType.TEXT)rq=Request(channel_type='facebook',session="user-1",text="Hello")rp=app.handle(rq)print(rp.json())rq=Request(channel_type='facebook',session="user-1",text="Hello")rp=app.handle(rq)fromdjango.viewsimportViewimportfastbot.jsonfromfastbotimportDialogManager,InMemoryDataStore,InMemoryDialogSetfromfastbot.responsesimportinit,end,ContentType,Requestfromdjango.httpimportJsonResponseapp=DialogManager(data_store=InMemoryDataStore(),dialog_set=InMemoryDialogSet())@app.root(default="enter_number")defroot_handler(dialog=None,request=None,state=None,**kwargs):returninit(text="Hello\nPlease enter\n1. Yes\n2. No")@app.dialogue(name="enter_number")defselected_choice(dialog=None,request=None,state=None,**kwargs):returnend(text="You entered request{0}".format(request.text),content_type=ContentType.TEXT)# django exampleclassBotRequestHandler(View):defpost(self,request):body=json.loads(request.body.decode('utf-8'))returnJsonResponse(app.handle(Request(**body)),encoder=fastbot.json.JSONEncoder)# console examplerq=Request(channel_type='facebook',session="user-1",text="Hello")rp=app.handle(rq)print(rp.json())rq=Request(channel_type='facebook',session="user-1",text="Hello")rp=app.handle(rq)print(rp.json())# flaskfromflaskimportFlask,ResponseasFlaskResponse,request,jsonifyimportjsonapi=Flask(__name__)@api.route("/endpoint",methods=['POST'])defhello():resp=FlaskResponse()resp.headers['Content-Type']='application/json'returnrespif__name__=="__main__":app.run()fromfastapiimportRequest,FastAPIapi=FastAPI()@api.post("/endpoint")asyncdefget_body(request:Request):data=awaitrequest.json()returnapp.handle(Request(**data)).json()print(rp.json())
Package: fastBPE
fastBPEC++ implementation ofNeural Machine Translation of Rare Words with Subword Units, with Python API.InstallationCompile with:g++ -std=c++11 -pthread -O3 fastBPE/main.cc -IfastBPE -o fastUsage:List commands./fast
usage: fastbpe <command> <args>

The commands supported by fastBPE are:

getvocab input1 [input2]             extract the vocabulary from one or two text files
learnbpe nCodes input1 [input2]      learn BPE codes from one or two text files
applybpe output input codes [vocab]  apply BPE codes to a text file
applybpe_stream codes [vocab]        apply BPE codes to stdin and outputs to stdoutfastBPE also supports stdin inputs. For instance, these two commands are equivalent:./fast getvocab text > vocab
cat text | ./fast getvocab - > vocabBut the first one will memory map the input file to read it efficiently, which can be more than twice faster than stdin on very large files. Similarly, these two commands are equivalent:./fast applybpe output input codes vocab
cat input | ./fast applybpe_stream codes vocab > outputAlthough the first one will be significantly faster on large datasets, as it uses multi-threading to pre-compute the BPE splits of all words in the input file.Learn codes./fast learnbpe 40000 train.de train.en > codesApply codes to train./fast applybpe train.de.40000 train.de codes
./fast applybpe train.en.40000 train.en codesGet train vocabulary./fast getvocab train.de.40000 > vocab.de.40000
./fast getvocab train.en.40000 > vocab.en.40000Apply codes to valid and test./fast applybpe valid.de.40000 valid.de codes vocab.de.40000
./fast applybpe valid.en.40000 valid.en codes vocab.en.40000
./fast applybpe test.de.40000  test.de  codes vocab.de.40000
./fast applybpe test.en.40000  test.en  codes vocab.en.40000Python APITo install the Python API, simply run:pythonsetup.pyinstallNote:For Mac OSX Users, addexport MACOSX_DEPLOYMENT_TARGET=10.x(x=9 or 10, depending on your version) or-stdlib=libc++to theextra_compile_argsofsetup.pybefore/during the above install command, as appropriate.Call the API using:importfastBPEbpe=fastBPE.fastBPE(codes_path,vocab_path)bpe.apply(["Roasted barramundi fish","Centrally managed over a client-server architecture"])>>['Ro@@ asted barr@@ am@@ un@@ di fish','Centr@@ ally managed over a cli@@ ent-@@ server architecture']
Package: fast-brainfuck
A big bugfix is applied to this package due to the technique Python uses to import modules.In previous versions, when brainfuck_to_function is called, it creates a module named _foo, which is imported. But Python also stores it into a cache, that means when you call brainfuck_to_function again, the new module would not be imported, which causes a function the same as the previous function is returned.However, in this version and higher, a module with a random name is created instead, which fixed the bug.This is a very fast brainfuck "compiler".When used, it builds brainfuck code into Python extension modules, and imports it.Requires:Python>=3.6C++ Compiler availablepybind11Running brainfuckUse the 'brainfuck_to_function' function to convert brainfuck into function.
It will take several seconds for the C++ compiler to build the module, but after build, you can call it anytime without building, which will be faster, and about 3x faster than directly using a brainfuckinterpreterimplemented in C++.fromfastbfimportbrainfuck_to_functioncode='++++++++[>++++++++<-]>++++++++.>++++++++++++[>++++++++<-]>+++++.+++++++..+++.>++++[>++++++++<-]>.<<<<+++++++++++++++.>>.+++.------.--------.>>+.'func=brainfuck_to_function(code)func()# Hello World!Freezing brainfuck into executablesfast-brainfuck is not supposed to be frozen into executables (e.g. using PyInstaller).
But fortunately, you can use the 'dist_brainfuck' function to convert brainfuck into Python modules.
You can write setup.py like this:fromfastbfimportdist_brainfuckcode='++++++++[>++++++++<-]>++++++++.>++++++++++++[>++++++++<-]>+++++.+++++++..+++.>++++[>++++++++<-]>.<<<<+++++++++++++++.>>.+++.------.--------.>>+.'dist_brainfuck(code,'hello')Then runpython setup.py build_ext --inplace, the files hello.py and hello.xxx.pyd (hello.xxx.so) will be created, you can now useimporthellohello.run()to run the brainfuck in your script (whichCANbe frozen into executables).Note that fast-brainfuck doesNOTclean up the temporary files it creates. You have to manually delete them if you want.fast-brainfuck can run onCPythonorPyPy.ImportError: xxxIf you encountered this error when using this package in PyPy in Windows, that means your username has non-ASCII characters.
You can runimportosos.environ['TMP']='C:\\Somedir'before using fast-brainfuck to fix the error.Note that moving the pointer to the left of the origin causesUNDEFINED BEHAVIORin this version
Package: fast-bss-eval
fast_bss_evalDo you have a zillion BSS audio files to process and it is taking days ?
Is your simulation never ending ?Fear no more!fast_bss_evalis here to helpyou!fast_bss_evalis a fast implementation of the bss_eval metrics for the
evaluation of blind source separation.  Our implementation of the bss_eval
metrics has the following advantages compared to other existing ones.seamlessly works withbothnumpyarrays andpytorchtensorsvery fastcan be even faster by using an iterative solver (adduse_cg_iter=10option to the function call)differentiable via pytorchcan run on GPU via pytorchAuthorRobin ScheiblerQuick StartInstall# from pypipipinstallfast-bss-eval# or from sourcegitclonehttps://github.com/fakufaku/fast_bss_evalcdfast_bss_eval
pipinstall-e.UseAssuming you have multichannel signals for the estmated and reference sources
stored in wav format files namesmy_estimate_file.wavandmy_reference_file.wav, respectively, you can quickly evaluate the bss_eval
metrics as follows.fromscipy.ioimportwavfileimportfast_bss_eval# open the files, we assume the sampling rate is known# to be the samefs,ref=wavfile.read("my_reference_file.wav")_,est=wavfile.read("my_estimate_file.wav")# compute the metricssdr,sir,sar,perm=fast_bss_eval.bss_eval_sources(ref.T,est.T)BenchmarkThis package is significantly faster than other packages that also allow
to compute bss_eval metrics such asmir_evalorsigsep/bsseval.
We did a benchmark using numpy/torch, single/double precision floating point
arithmetic (fp32/fp64), and using either Gaussian elimination or aconjugate
gradient descent(solve/CGD10).CitationIf you use this package in your own research, please citeour paperdescribing it.@misc{scheibler_sdr_2021,title={SDR --- Medium Rare with Fast Computations},author={Robin Scheibler},year={2021},eprint={2110.06440},archivePrefix={arXiv},primaryClass={eess.AS}}License2021 (c) Robin Scheibler, LINE CorporationAll of this code is released underMIT Licensewith the exception offast_bss_eval/torch/hungarian.pywhich is under3-clause BSD License.
Package: fastcache
C implementation of Python 3 functools.lru_cache.  Provides speedup of 10-30x
over standard library.  Passes test suite from standard library for lru_cache.Provides 2 Least Recently Used caching function decorators:clru_cache - built-in (faster)>>> from fastcache import clru_cache, __version__
>>> __version__
'1.1.0'
>>> @clru_cache(maxsize=325, typed=False)
... def fib(n):
...     """Terrible Fibonacci number generator."""
...     return n if n < 2 else fib(n-1) + fib(n-2)
...
>>> fib(300)
222232244629420445529739893461909967206666939096499764990979600
>>> fib.cache_info()
CacheInfo(hits=298, misses=301, maxsize=325, currsize=301)
>>> print(fib.__doc__)
Terrible Fibonacci number generator.
>>> fib.cache_clear()
>>> fib.cache_info()
CacheInfo(hits=0, misses=0, maxsize=325, currsize=0)
>>> fib.__wrapped__(300)
222232244629420445529739893461909967206666939096499764990979600
>>> type(fib)
>>> <class 'fastcache.clru_cache'>lru_cache  - python wrapper around clru_cache>>> from fastcache import lru_cache
>>> @lru_cache(maxsize=128, typed=False)
... def f(a, b):
...     pass
...
>>> type(f)
>>> <class 'function'>(c)lru_cache(maxsize=128, typed=False, state=None, unhashable=’error’)Least-recently-used cache decorator.Ifmaxsizeis set to None, the LRU features are disabled and the cache
can grow without bound.Iftypedis True, arguments of different types will be cached separately.
For example, f(3.0) and f(3) will be treated as distinct calls with
distinct results.Ifstateis a list or dict, the items will be incorporated into the
argument hash.The result of calling the cached function with unhashable (mutable)
arguments depends on the value ofunhashable:Ifunhashableis ‘error’, a TypeError will be raised.Ifunhashableis ‘warning’, a UserWarning will be raised, and
the wrapped function will be called with the supplied arguments.
A miss will be recorded in the cache statistics.Ifunhashableis ‘ignore’, the wrapped function will be called
with the supplied arguments. A miss will will be recorded in
the cache statistics.View the cache statistics named tuple (hits, misses, maxsize, currsize)
with f.cache_info().  Clear the cache and statistics with f.cache_clear().
Access the underlying function with f.__wrapped__.See:http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used
Package: fast-captcha
fast_captchafast to use captchainstallpipinstallfast-captchatext_captchafromfast_captchaimporttext_captchaprint(text_captcha())# BnZUimg_captchafromfast_captchaimportimg_captchaimg,text=img_captcha()print(img)# <_io.BytesIO object at 0x000002366AB93DB0>print(text)# 2z22FastAPIfromfastapiimportFastAPIfromfastapi.responsesimportStreamingResponsefromfast_captchaimportimg_captchaapp=FastAPI()@app.get('/captcha',summary='captcha',name='captcha')defget_captcha():img,text=img_captcha()returnStreamingResponse(content=img,media_type='image/jpeg')Django-NinjafromninjaimportNinjaAPIfromdjango.httpimportStreamingHttpResponsefromfast_captchaimportimg_captchaapp=NinjaAPI()@app.get('/captcha',summary='captcha',url_name='captcha')defget_captcha(request):img,text=img_captcha()returnStreamingHttpResponse(streaming_content=img,content_type='image/jpeg')LicenseMIT LicenseCopyright (c) 2022 xiaowuPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Package: fast-carpenter
Turns your trees into tables (ie. reads ROOT TTrees, writes summary Pandas DataFrames)fast-carpenter can:Be controlled using YAML-based config filesDefine new variablesCut out events or define phase-space “regions”Produce histograms stored as CSV files using multiple weighting schemesMake use of user-defined stages to manipulate the dataPowered by:AlphaTwirl (presently): to run the dataset splittingAtuproot: to adapt AlphaTwirl to use uprootuproot: to load ROOT Trees into memory as numpy arraysfast-flow: to manage the processing config filesfast-curator: to orchestrate the lists of datasets to be processedEspresso: to keep the developer(s) writing codeA tool from the Faster Analysis Software Taskforce:http://fast-hep.web.cern.ch/Installation and usageVisit thedocumentationfor full details.
Package: fast-cat
FastcatA rapid, highly-realistic, scanner specific CBCT simulator.FeaturesInstallationFeaturesX-ray spectra calculation using the models from xpecgenDetector response based on MC optical simulation of ScintillatorsHigh resolution Catphan phantomsBowtie filters, flattening filters, ant-scatter grid modelsPython library and Graphical User InterfaceInstallationThis package is not currently released. A release will be made after supporting papers are published.
Package: fastcd
Fastcd allows you to navigate quickly to the desired directory that has been visited recently.FeaturesAutocompleteFuzzy searchShortcuts for directoriesFlexible configurationUsageJust enterjin the terminal to launch fastcd’s jumper.Fastcd’s jumper shows last visited directories and allows you to change cwd quickly.
Start typing to filter directories.
You can use arrows and Page Up/Down to navigate the list.Control:'Esc', 'F10' or 'Meta + q' to exit.
'Enter' to change directory to the selected.
'Meta + Enter' to change directory to the entered.
'Tab' for auto completion. If entered path is not valid it will be extended.
'Shift + Tab' to paste selected path.
'Ctrl + w' or 'Ctrl + u' to clean up input.
'Meta + Backspace' to remove word.
'Ctrl + c' to copy selected path to clipboard (pygtk support required).Search:'Meta + f' to turn on/off fuzzy search.
'Meta + r' to change search position (any pos / from the beginning of the directory name).
'Meta + s' to turn on/off case sensitive search.
'Meta + l' to move search forward.
'Meta + b' to move search backward.Shortcuts:'Shift + F2', 'Shift + F3', 'Shift + F4' or 'Shift + F5' to set selected path as shortcut.
'F2', 'F3', 'F4' or 'F5' to paste shortcut path.Supported extra symbols:* - any number of any character
$ - end of the lineExtra options and parameters can be found infastcd/config.json.Metais usually stands foraltkey.ExamplesTipsMissing or non-existent directories will be displayed dimmed and marked with*.
However, if you press Enter twice, you will cd to the nearest existing directory.If the entered path is not present in the database, but exists, you will still be able to go into it.If you want to redefine shortcuts (~/.local/share/fastcd/config.json), but don’t know their key codes - usekey_picker.py.You can change palette in~/.local/share/fastcd/config.json.Your current path in shell will be first in list,
while the previous path (OLDPWD) will be the second.
Previous path is selected by default.
Thus fastcd (j) + enter is equivalent tocd -.Typej-lto list shortcuts and directories to which they point.If you want to change directory immediately when pressing path shortcut (F2-F8) - changeexit_after_path_shortcut_pressedto 1 inconfig.jsonSupported platformsLinuxMacOsInstallationGet the utility:sudo python3-mpip install fastcdorpython3-mpip install fastcd--userInstall shell hook to make fastcd able to track visited directories:python3-mfastcd install.Restart console session or runsource~/.bashrcto apply changes.Typejand press enter to run fastcd.If you would like to install another alias name for fastcd use:python3-mfastcd install--alias=fcdInstallation from source codeGet source code:cd $HOME
git clone https://github.com/frazenshtein/fastcdEach user who wants to use fastcd should install shell hook first:python3 fastcd/fastcd/__main__.py install
source ~/.bashrcUtility requires python 3 + extra module:sudo python3 -m pip install urwidIf you do not have pip try first:sudo apt-get install python3-pip
Package: fast-cd-pyb
Fast Complementary Dynamics CodeWe're currently working on a pip installation, but for now, this is how you can get started with our codebase.Clone this repo and all its submodules:git clone --recursive https://github.com/otmanon/fast_cd_pybInside the repository above, install the dependencies:pip install -r requirements.txtFinally, build the library from source by running:python setup.py installAppsWe provide a variety of fast_cd apps shown in our paper.Interactive Affine HandleRunimport fast_cd_pyb as fcd
fcd.apps.interactive_cd_affine_handle()This should run a few computations, and then finally open a window with the
classic Complementary Dynamics fish. By playing with the Guizmo, you can interact with
the fish. Pressgto change guizmo transorm operations.We also provide a few different meshes. The demo found indemos/affine_handle.pyshows how to change some of the inputs we
give to theinteractive_cd_affine_handlesuch as changing the subspace size, reading from cache,
or using different meshes.We also provide many example meshes in thedatadirectory. To run the demo on a.mshfile of your choice, runfcd.apps.interactive_cd_affine_handle(msh_file_path)
Package: fastchange
fastchange: Fast change point detection in PythonFastchange is a change point detection library that is intended to be extendable, interpretable, and above all else, fast! We acheive this by adhering to the Scikit-learn API and using Numba, a just-in-time compiler that allows developers to write pure Python with NumPy that is then compiled to fast C code.DocumentationAll documentation can be found athttps://gursky1.github.io/fastchange/
Package: fastcharmap
Fastcharmap is about 5 times faster than Python’s charmap routines.Usage:  fastcharmap.hook(‘codec_name’)Fastcharmap inserts faster code that works when unicode() or “”.encode
are called.  Installation requires a binary distribution or a C
compiler; Pyrex is required for changes to the source.  Python’s
developers are working on faster charmap codecs for a future version of
Python; fastcharmap may be useful until then.
Package: fastckpt
FastCkpt: accelerate your LLM training in one line!Fast gradient checkpoint is designed for accelerate the training with memory-efficient attention like FlashAttention and LightSeq. FastCkpt has monkey patch for both rematerialization-aware checkpointing and FlashAttention, so you can patch both in only one line!Paper:https://arxiv.org/pdf/2310.03294.pdfNews[2023/10] FastCkpt now supports LlamaModel in Huggingface!InstallpipinstallfastckptUsageFastCkpt now supports HF training pipeline.Use FaskCkpt and FlashAttentionTo usefasckptwithflash_attn, import and runreplace_hf_ckpt_with_fast_ckptbeforeimportingtransformers# add monkey patch for fastckptfromfastckpt.llama_flash_attn_ckpt_monkey_patchimportreplace_hf_ckpt_with_fast_ckptreplace_llama_attn_with_flash_attn()# import transformers and other packagesimporttransformers...Use FlashAttention onlyTo only replace theLlamaAttentionwithflash_attnwithout chaning the checkpointing strategy, import and runreplace_llama_attn_with_flash_attn# add monkey patch for fastckptfromfastckpt.llama_flash_attn_monkey_patchimportreplace_llama_attn_with_flash_attnreplace_llama_attn_with_flash_attn()# import transformers and other packagesimporttransformers...
Package: fastcli
fastcliPython3 CLI script for fast.comFree software: MITDocumentation:https://fastcli.readthedocs.orgFeaturesShows approximate download speed by way of Fast.com.IntroductionFast.com is a newish Netflix download speed test. It bases its results on
download speed of actual Netflix video content, which makes it much harder for
ISPs to embellish their results (without also speeding up all of Netflix, which
may account for as much as 30% of all internet traffic).It doesn't test upload speed or ping, sofastclidoesn't either.DependenciesPython >= 3.5Seerequirements.txtQuickstartpip3installfastcli
fastcliDevelopment SetupClone the repo:git clone https://github.com/n8henrie/fastcli && cd fastcliInstall into a virtualenv:python3-mvenvvenvsourcevenv/bin/activate
pip3install.[dev]ConfigurationOptionally accepts a--runtimeargument which may affect accuracy by
changing to values shorter or longer than the default of 10 (seconds).AcknowledgementsNetflix, for creatingFast.comMany thanks to groundwork laid byhttps://github.com/sanderjo/fast.comTroubleshooting / FAQfastcli requires Python >= 3.5History0.1.1 :: 2021-06-09Update to API V2Dependency updatesMigrate to GitHub Actions instead of Travis0.1.0 :: 2016-11-27First release on GitHub.First release on PyPI.