Saravanan666/pypi-org huggingface dataset:
Package: fast-scboot
FastScboot is a statistics tool to perform the stratified clustered bootstrap sampling on given data. The algorithm is fast in the sense that the remaining bottleneck to the speed of the algorithm is the speed of memory access during the inplace fancy indexing operation.Installpip install fast-scbootGetting startedFirst import the package and initialize theSamplerobject.fromfast_scbootimportSamplers=Sampler()Let’s create a sample data.importnumpyasnpimportpandasaspdclusts=np.asarray([0,1,1,2,0,1,1,0,2,2])strats=np.asarray([0,0,0,0,1,1,1,2,2,2])data=np.squeeze(np.dstack([strats,clusts])).astype(np.double)data=pd.DataFrame(data,columns=['strat','clust'])Two preparatory steps are preparing the data, and creating some data cache:s.prepare_data(data,'strat','clust')s.setup_cache()After that, you can start drawing samples:foriinrange(100):sampled=s.sample_data(seed=i)How does it work?When theprepare_datamethod is invoked, once the original data has been sorted by strata and cluster levels, themake_index_matrixcreates three auxiliary arrays:idx_mtx,strat_arr, andclust_arr. Theidx_mtxarray stores information on where each cluster begins and how many rows it occupies, as well as the actual cluster value. Thestrat_arris an index array that indexes the strata levels at each of the cluster level. Theclust_arrdoes the same but for the cluster levels. The reason the values of theclust_arrare not uniformly increasing likestrat_arrin this example is because internally, the unique indices are created using the Cantor pairing function for speed (and then re-cast into integer using Pandas “cateory” type).When thesample_datamethod is invoked, three additional auxiliary data are created. Theclust_cnt_arrarray stores the number of unique cluster values in each strata, in this case, [3, 2, 2]. The total number of unique strata values is stored in thenum_stratsvariable (3 in this case), and the same for cluster is store in thenum_clustsvariable (7 in this case).We produce a random array from [0, 1] uniform distribution with size equal tonum_clusts. It’s important that we invoke random sampling function once because usually it’s very expensive to call them repeatedly. Then we use theclust_cnt_arrand loop through (vectorized using Cython) the uniform random numbers and multiply them by the values inclust_cnt_arr, and then cast them to integer datatype. We are effectively mapping the uniform random values from [0, 1] to appropriate range of integer values, which can be used as randomly bootstrap sampled indices (stored insvariable) for theidx_mtxarray.Thesarray is used on theidx_mtx, where we are effectively sampling with replacement clusters from each stratum (i.e. from each colored area). Once we have cluster bootstrap sampledidx_mtx, we can use the information stored in that matrix to construct thesampled_idxsarray, which records indices of the sampled data in terms of the indicies of the original data. The final return value is produced by fancy indexing the original data using thesampled_idxs. The native numpy fancy indexing is somewhat costly due to data copy, so we provide our own inplace version of fancy indexing.
Package: fast-scores
fast-scores[]Calculate correlatioin matrix fastPreinstall fasttextpip install fasttextFor Windows without a C/C++ compiler:Download a proper whl (e.g.,fasttext‑0.9.2‑cp36‑cp36m‑win_amd64.whlfor 64bits Python 3.6 etc)  fromhttps://www.lfd.uci.edu/~gohlke/pythonlibs/#fasttextpipinstallfasttext*.whlor (for python 3.8)pip install https://github.com/ffreemt/ezbee/raw/main/data/artifects/fasttext-0.9.2-cp38-cp38-win_amd64.whlInstallationpip install fast-scoresUsage# from fast-scores\tests\test_gen_cmat.pyfromfast_scores.gen_cmatimportgen_cmattext_en="test this\nbla bla\n love"text_zh="测试\n 爱\n吃了吗\n你好啊"list1=[elm.strip()forelmintext_en.splitlines()ifelm.strip()]list2=[elm.strip()forelmintext_zh.splitlines()ifelm.strip()]cmat=gen_cmat(list1,list2)# len(list2) x len(list1)print(cmat)# [[0.75273851 0.         0.        ]#  [0.         0.         0.86848247]#  [0.         0.         0.        ]#  [0.         0.         0.        ]]len_y,len_x=cmat.shape

assertcmat.max()>0.86# 0.868_=divmod(cmat.argmax(),len_x)assertcmat[_]==cmat.max()
Package: fastselenium
fastselenium介绍封装了一些selenium的用法，使其更加简单软件架构软件架构说明安装教程pip安装pipinstallfastseleniumpip安装（使用阿里镜像加速）pipinstallfastselenium-ihttps://mirrors.aliyun.com/pypi/simple使用说明demoimportfastseleniumfromseleniumimportwebdriverdriver=webdriver.Chrome()driver.get('www.gitee.com')test_res=fastselenium.save_cookie(driver=driver)
Package: fastsemsim
See the full documentation at https://fastsemsim.readthedocs.io/en/latest/The source repository is available at https://sourceforge.net/p/fastsemsim/Home-page: https://sourceforge.net/p/fastsemsim/Author: Marco MinaAuthor-email: marco.mina.85@gmail.comLicense: GNU GPL version 3Download-URL: https://sourceforge.net/projects/fastsemsim/files/Description: FastSemSim is a Python package to calculate semantic similarity over ontologies (including the Gene Ontology).See the full documentation at https://fastsemsim.readthedocs.io/en/latest/The source repository is available at https://sourceforge.net/p/fastsemsim/Keywords: semantic similarity,Ontology,Gene OntologyPlatform: UNKNOWNClassifier: Development Status :: 4 - BetaClassifier: Intended Audience :: Science/ResearchClassifier: License :: OSI Approved :: GNU General Public License (GPL)Classifier: Natural Language :: EnglishClassifier: Operating System :: POSIX :: LinuxClassifier: Operating System :: MacOSClassifier: Operating System :: Microsoft :: WindowsClassifier: Programming Language :: PythonRequires: pandasDescription-Content-Type: text/markdown
Package: fast-sentence-classify
Fast Sentence Classification (fast-sentence-classify)Sample Usagefromfast_sentence_classifyimportclassifyd_result=classify("I'd like it if you could give me some directions to the library")Result:{"data":{"input_text":"I'd like it if you could give me some directions to the library","output_text":"WHERE_LOCATION"},"event":"fast-sentence-classify","service":"classify","stopwatch":"117.30μs","ts":"1666897985.085184"}
Package: fast-sentence-segment
Fast Sentence Segmentation (fast-sentence-segment)Fast and Efficient Sentence SegmentationUsagefromfast_sentence_segmentimportsegment_textresults=segment_text('here is a dr. who says something.  and then again, what else?  i dont know.  Do you?')assertresults==[['here is a dr. who says something.','and then again, what else?','i dont know.','Do you?']]Why use a double-scripted list?The segementation process will segment into paragraphs and sentences.  A paragraph is composed of 1..* sentences, hence each list of lists is equivalent to a paragraph.This usageresults=segment_text(input_text,flatten=True)Will return a list of strings, regardless of paragraph delimitation.
Package: fast-sentence-tokenize
Fast Sentence Tokenizer (fast-sentence-tokenize)Best in class tokenizerUsageImportfromfast_sentence_tokenizeimportfast_sentence_tokenizeCall Tokenizerresults=fast_sentence_tokenize("isn't a test great!!?")Results["isn't","a","test","great","!","!","?"]Note that whitespace is not preserved in the output by default.This generally results in a more accurate parse from downstream components, but may make the reassembly of the original sentence more challenging.Preserve Whitespaceresults=fast_sentence_tokenize("isn't a test great!!?",eliminate_whitespace=False)Results["isn't ","a ","test ","great","!","!","?"]This option preserves whitespace.This is useful if you want to re-assemble the tokens using the pre-existing spacingassert''.join(tokens)==input_text
Package: fast-sentence-transformers
Fast Sentence TransformersThis repository contains code to run fastersentence-transformersusing tools like quantization andONNX. Just run your model much faster, while a lot of memory. There is not much to it!Installpipinstallfast-sentence-transformersOr for GPU support.pipinstallfast-sentence-transformers[gpu]Quickstartfromfast_sentence_transformersimportFastSentenceTransformerasSentenceTransformer# use any sentence-transformerencoder=SentenceTransformer("all-MiniLM-L6-v2",device="cpu",quantize=True)encoder.encode("Hello hello, hey, hello hello")encoder.encode(["Life is too short to eat bad food!"]*2)BenchmarkIndicative benchmark for CPU usage with smallest and largest model onsentence-transformers. Note, ONNX doesn't have GPU support for quantization yet.modelTypedefaultONNXONNX+quantizedONNX+GPUparaphrase-albert-small-v2memory1x1x1x1xspeed1x2x5x20xparaphrase-multilingual-mpnet-base-v2memory1x1x4x4xspeed1x2x5x20xShout-OutThis package heavily leans onsentence-transformersandtxtai.
Package: fastsession
FastSessionEnglish|日本語FastSession is a session management library for FastAPI.It provides a middleware,FastSessionMiddleware,
that helps you manage user sessions effectively in your FastAPI applications.FeaturesOnly the session ID is stored as a browser cookie.
(Similar to Java Servlet and Node.js express session)The session ID can be shared only through signed and confidential
communication channels, and since no session contents are stored
in the browser, an extremely secure session system can be built.Session ID generation and session data storage.Session cookie management with signature verification for enhanced security.In-memory store for session data enabled.InstallationUse the package manager PIP to install FastSession.pip install fastsessionUsageHere is a basic usage example:importuvicornfromfastapiimportFastAPI,Requestfromfastapi.staticfilesimportStaticFilesfromfastsessionimportFastSessionMiddleware,MemoryStoreHOST='localhost'PORT=18080app=FastAPI()app.add_middleware(FastSessionMiddleware,secret_key="my-secret-key",# Key for cookie signaturestore=MemoryStore(),# Store for session savinghttp_only=True,# True: Cookie cannot be accessed from client-side scripts such as JavaScriptsecure=False,# True: Requires Httpsmax_age=0,# When 0 is specified, it is only effective while the browser is active. If a value greater than 0 is specified, the session will continue for the specified time even after closing the browsersession_cookie="sid",# Name of the session cookiesession_object="session"# Attribute name of the Session manager under request.state)@app.get("/session_test")asyncdefsession_test(request:Request):# get session managersession_mgr=request.state.session# get session store (dictionary)session=session_mgr.get_session()# get session idsession_id=session_mgr.get_session_id()print(f"sessionID:{session_id}")if"test_counter"notinsession:session["test_counter"]=0session["test_counter"]+=1return{"test_counter":session['test_counter']}app.mount("/",StaticFiles(directory="html",html=True),name="public")defstart_server():uvicorn.run(app,host=HOST,port=PORT)defmain():start_server()if__name__=="__main__":main()
Package: fastshapv1
# FastSHAP (V1)
> This project brings in part of theSHAPlibrary intofastai(V1) and make it compatible. Thank you to Nestor Demeure for his assistance with the project!## Installpip install fastshap## How to useFirst we’ll quickly train aADULTStabular model` from fastai2.tabular.all import * `` path = untar_data(URLs.ADULT_SAMPLE) df =pd.read_csv(path/'adult.csv')`` dep_var = 'salary' cat_names = ['workclass', 'education','marital-status','occupation', 'relationship', 'race'] cont_names = ['age', 'fnlwgt','education-num']procs = [Categorify, FillMissing, Normalize] `` splits =IndexSplitter(list(range(800,1000)))(range_of(df))to = TabularPandas(df, procs, cat_names, cont_names,y_names="salary",splits=splits) dls = to.dataloaders() `` learn = tabular_learner(dls,layers=[200,100],metrics=accuracy) learn.fit(1,1e-2)`And now for some example usage!` from fastshap.interp import * `` exp = ShapInterpretation(learn,df.iloc[:100])``exp.dependence_plot('age')`Classification model detected, displaying score for the class <50k.
(useclass_idto specify another class)![png](docs/images/output_13_2.png)For more examples see [01_Interpret](https://muellerzr.github.io/fastshap//interpret)For more unofficial fastai extensions, see the [Fastai Extensions Repository](https://github.com/nestordemeure/fastai-extensions-repository).
Package: fastshelf
fastshelfhigh performance persistent python3 dict with choices of backendUsage Examplefrom fastshelf import Shelf
import dbm.gnu
path = "/tmp/shelf1.gnudb"
shelf1 = Shelf(dbm.gnu.open(path,'cf'))

shelf1['a'] = 'A'
shelf1[(1,2,3)] = 'B'
shelf1[144] = {1,2,3,4,12}

print(dict(shelf1))
shelf1.close()

shelf1 = Shelf(dbm.gnu.open(path,'cf'))
print(dict(shelf1))
print(shelf1[(1,2,3)])

import shutil
shutil.rmtree(path)

shelf2 = Shelf(dbm.gnu.open(path,'cf'))
print(shelf2.get("non_existing_key"))  # output None
shelf2['a']='A'
print('a' in shelf2) # output True
del shelf2['a']
print('a' in shelf2) # output False
shelf2.update((i,i**2) for i in range(100))  # batch write
print(len(shelf2))  #output 100
print(shelf2[3]) #output 9UsageShelf class of package fastshelf is a dict-like wrapper, that can use any python objects as key and value.Shelf handles the serialization and deserialization of python objects.Shelf object initializes with arguments:backend: a dbm-like key-value storage database with "bytes" key and value, options include python3's own gnudb, PlyvelDB(via plyvel) and RocksDB(via lbry-rocksdb) or your own bytes-based key/value storeserializer: a pickle-like serialization library, by default "pickle", which you can replace with dill/msgpack/bson/jsontrack_value_changes: if True, enableexperimentalfeature of tracking and writing back value object changes, to maintain similar new style object reference semantics with dictYou can use Shelf like a dict. In addition to standard dict interfaces, batch writes (Shelf.update) can significantly save time.
Package: fastshermanmorrison-pulsar
FastShermanMorrisonCython code to more quickly evaluate ShermanMorrison combinations as need by
kernel ecorr in Enterprise.InstallationThe FastShermanMorrison add-on to Enterprise can be easily installed straight
from github usingpipinstallgit+https://github.com/nanograv/fastshermanmorrison.gitFrom Pypi, you can dopipinstallfastshermanmorrison-pulsarConda requires cpu architecture-specific compiles, so that is currently not
supported.
Package: fastshuffle
FastShuffleA memory efficient Python module to quickly shuffle parallel text corpora. The main advantage is that it never loads the entire dataset in memory, using memory-mapped file offsets instead.InstallationpipinstallfastshuffleUsagefromfastshuffleimportfile_shufflesrc,tgt=file_shuffle("source.txt","target.txt")print(src,tgt)# source.txt.shuffled target.txt.shuffledYou can also simultaneously sample/isolate a certain number of sentences from the dataset (which are then removed from the shuffled result)from fastshuffle import file_shuffle_sample

src, tgt, src_sample, tgt_sample = file_shuffle("source.txt", "target.txt", 5) # Sample 5 sentences
print(src, tgt, src_sample, tgt_sample)
# source.txt.shuffled target.txt.shuffled source.txt.shuffled.sample target.txt.shuffled.sampleNotesSource and target must have the same number of lines. No validation checks are made.Buildgitclonehttps://github.com/LibreTranslate/FastShufflecdFastShuffle
pythonsetup.pybuildStandalone BinaryYou can also use fastshuffle as a standalone Windows, macOS or Linux application (but you currently need to build from source, we don't provide binaries).mkdir build
cd build && cmake .. && make -j4
./shuffle source.txt target.txtContributingWe welcome pull requests!LicenseAGPLv3
Package: fastsl
This is the Python implementation of FastSL, an efficient algorithm to
identify synthetic lethal gene/reaction sets in genome-scale metabolic
models.This package is based oncobrapyand provides a simple
command-line tool.For documentation, please visit:http://fastsl-py.readthedocs.ioBasic requirement(s):- Python 3.6 for Gurobi 8
- Python 3.5 for IBM CPLEX and Gurobi 7Installation:Use pip to install from PyPI (recommended inside a virtual environment):pip install fastslContribute:Issue Tracker:<https://github.com/RamanLab/FastSL-py/issues>Support:If you are having issues, please let us know.
Contact us at: <fast-sl@ramanlab.groups.io>License:The project is licensed under GPL v3 license.Note:CPLEX and Gurobi are not included. Both are available for free (for
academic purposes). All solvers are supported whose interfaces are
provided byoptlang.
Package: fastsnmp
fastsnmpSNMP poller oriented to poll bunch of hosts in short time. Package include poller and SNMP coder/encoder library.[Reference manual] (http://fastsnmp.readthedocs.org/)Example:fromfastsnmpimportsnmp_pollerhosts=("127.0.0.1",)# oids in group must be with same indexesoid_group={"1.3.6.1.2.1.2.2.1.2":"ifDescr","1.3.6.1.2.1.2.2.1.10":"ifInOctets",}community="public"snmp_data=snmp_poller.poller(hosts,[list(oid_group)],community)fordinsnmp_data:print("host=%soid=%s.%svalue=%s"%(d[0],oid_group[d[1]],d[2],d[3]))Output:host=127.0.0.1 oid=ifInOctets.1 value=243203744
host=127.0.0.1 oid=ifDescr.1 value=b'lo'
host=127.0.0.1 oid=ifInOctets.2 value=1397428486
host=127.0.0.1 oid=ifDescr.2 value=b'eth0'Type conversion:SNMPPythonoctetstring, ipaddressbytesnullNoneobjectidstrcounter32, unsigned32, gauge32, counter64, integerintnoSuchInstanceNonenoSuchObjectNoneendOfMibViewNoneNotices:ipaddress can be converted to string usingstr(ipaddress.IPv4Address(b"\x01\x01\x01\x01"))orsocket.inet_ntoa(b"\x01\x01\x01\x01")Another python SNMP libraries:PySNMP- very good SNMP librarylibsnmp- SNMP coder/decoder (abandoned project)Bindings to Net-SNMP
Package: fastsnmpy
Fastsnmpy is a bunch of classes that create a wrapper around theexisting python extensions for netsnmp. It provides the following :-- Ability to snmpbulkwalk devices, which makes it several magnitudesfaster than today's implementation of snmpwalk.- snmpmultiwalk, which provides an asynchronous multithreaded wayto walk nodes, resulting in several devices being walked at thesame time, effectively using all cores on a multicore machine.- One-Line, and Two-Line scripts that enable you to discover/walkall devices in a whole datacenter- Both Linux and Windows support
Package: fastsnmpy2
Fastsnmpy is a module that leverages python-extensions that come
with net-snmp and provide highly parallelized faster-methods to walk
oid-trees on devices.In addition, it provides a method to bulkwalk mib-trees. BulkWalk
methods are missing from native python-bindings for net-snmp. By
creating a wrapper around the GetBulk method instead, and maintaining
state while traversing the oid-tree, fastsnmpy provides a clever
solution to bulkwalk oids much faster.It provides the following methods as of Fastsnmpy-1.2.1snmpwalk(): Native python-bindings distributed with
net-snmp, combined with fastsnmpy’s ability to parallelize
snmpwalk operations.snmpbulkwalk(): Ability to snmpbulkwalk devices, which makes
it several magnitudes faster than net-snmp’s implementation of snmpwalk.By leveraging the getbulk method, this module provides a quick
snmpbulkwalk utility.PROCESS-POOLS: By passing in a ‘workers=n’ attribute to the above
methods, fastsnmpy can instantiate a process-pool to parallelize
the snmpwalk and snmpbulkwalk methods, resulting in several devices
being walked at the same time,
effectively using all cores on a multicore machine.One-Line, and Two-Line scripts that enable you to discover/walk
all devices in a whole datacenterBoth Linux and Windows support
Package: fastsom
FastsomA PyTorch and Fastai based implementation of Self-Organizing Maps.You can find documentation and exampleshere.ContentsFastsomContentsGetting startedInstall as a dependencyDocker boilerplatePrerequisitesBuilding the imageRunning the containerDeveloping inside the containerDocumentation setupDocumenting the codeBuilding the docsDeploying the docs on GH PagesGetting startedInstall as a dependencyTo install Fastsom, you can usepipto install thePyPi package:pipinstallfastsomor you can install directly from Github:pipinstallgit+ssh://github.com/kireygroup/fastsom# orpipinstallgit+https://github.com/kireygroup/fastsomAlternatively, you can clone the repository and then install as follows:gitclonegit@github.com:kireygroup/fastsomcdfastsom
pythonsetup.pyinstallDocker boilerplateThis project was bootstrapped with thecookiecutter-dl-dockertemplate.PrerequisitesTo run examples for this project you can either use Docker / Nvidia-Docker or recreate the environment on your local machine by using the providedrequirements.txt.Steps for Docker are described below.Building the imageAn utility script can be found inbin/build.sh:./bin/build.shRunning the containerA run script is available:./bin/run.shThis will mount the directories/fastsomand/nbsinside the container, allowing for code changes to be automatically replicated.Note: if you plan on using Nvidia-Docker, you should use one of the images available on the Nvidia Container Repository.The container will start a new Jupyter Notebook server on port 8888. Jupyter Lab is also available.Note that thefastsomfolder will be mounted inside the container, so any change you make to the source files or notebooks will be replicated on both host and container.Developing inside the containerWith Visual Studio Code and PyCharm, it is possible to use the container Python interpreter for development.An SSH server has been configured inside the container to allow connection via PyCharm's remote interpreter feature.In Visual Studio Code, this can be done via theRemote - Containers extension.Documentation setupFastsom's documentation is built withSphinxand deployed to Gihtub Pages via thegh-pagesbranch.Documenting the codeWe use a Numpy docstring notation (check outthis linkfor more information about the various docstring styles).Building the docsTo generate the static HTML documentation, use the following:cddocs
makedocsDeploying the docs on GH PagesDocs are automatically built from the master branch and pushed to thegh-pagesbranch on each version tag.
Package: fast-soup
FastSoupBeautifulSoup interface for lxmlKey featuresFASTsearch in treeFASTserialize to strBeautifulSoup4 interface to interact with object:Search:find,find_all,find_next,find_next_siblingText:get_text,stringTag:name,get,clear,__getitem__,__str__,__repr__,append,new_tag,extract,replace_withInstallpipinstallfast-soup==1.1.0How to usefromfast_soupimportFastSoupcontent=...# read some html contentsoup=FastSoup(content)# interact like BS4 objectresult=soup.find('a',id='my_link')# interact like lxml objectel=result.unwrap()FAQQ:BS4 already implement lxml parser. Why i should use FastSoup?A:Yes, BS4 implementparser, and it’s just building the tree. All next interactions proceed with “Python speed”:
searching, serialization.
FastSoup internally use lxml and guarantee “C speed”.Q:How FastSoup speedup works?A:FastSoup just buildxpathand execute them. For prevent rebuilding LRU cache used.Q:Why you don’t support whole interface? This will be soon?A:I wrote functions which speed up parsing in my projects. Just create a issue or pull request and i think we find the solution ;)MiscellaneousYou can got power of BeautifulSoup when wrap your lxml objects, e.g:fromfast_soupimportTagcontent=...# some bytes ready to parsecontext=lxml.etree.iterparse(io.BytesIO(content),...)forevent,elemincontext:tag=Tag(elem)tag_text=tag.get_text()tag_attr=tag['attribute']