Saravanan666/pypi-org huggingface dataset:
Package: fastomit
fastomitFast k-v omissionTable of ContentsInstallationLicenseBenchmarksInstallationpip install fastomitUsageTrust Omitterfromfastomit.omitimportOmitter,always_omit,globally_hidden,hide,reset_omissions# always omit keys abc and pwom=Omitter(["abc","pw"])my_dict={"abc":"val","pw":"val2","ok":True,"val":"v2"}assertom.omit(my_dict)=={"abc":"***","pw":"****","ok":True,"val":"v2"}# always omit keys abc and defalways_omit(["abc","def"])om=Omitter()my_dict={"abc":"v1","def":"value","deg":"nohide"}assertom.omit(my_dict)=={"abc":"**","def":"*****","deg":"nohide"}# no global omissionsreset_omissions()om=Omitter()assertom.omit(my_dict)==my_dictNo-Trust Omitterfromfastomit.omitimportNoTrustOmitter,always_trust,globally_trusted,reset_trusted# omits anything but these keysom=NoTrustOmitter(["abc","pw"])my_dict={"abc":"val","pw":"val2","ok":True,"val":"v2"}assertom.omit(my_dict)=={"abc":"val","pw":"val2","val":"**"}# trust keys abc and defalways_trust(["abc","def"])om=NoTrustOmitter([])my_dict={"abc":"v1","def":"value","deg":"hide"}assertom.omit(my_dict)=={"abc":"v1","def":"value","deg":"****"}# trust nothingreset_trusted()om=NoTrustOmitter()assertom.omit(my_dict)=={"abc":"**","def":"*****","deg":"****"}assertglobally_trusted()==[]Licensefastomitis distributed under the terms of theMITlicense.
Package: fastone-ucloud
fastone-uclouducloud deployment services that work on FastOne stack for computing serviceFree software: MIT licenseDocumentation:https://fastone-ucloud.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2020-09-20)First release on PyPI.
Package: fastopendata_client
FastOpenData ClientThe Python client for FastOpenData.To use this client to retrieve data, you must have an API key. You can use the
client itself to get a free API key that's suitable for evaluation purposes:>>> from fastopendata_client import FastOpenData
>>> api_key = FastOpenData.get_api_key('YOUR_EMAIL_ADDRESS')Save your API key somewhere; you will use it each time you invoke the FastOpenData
client. If you lose your key, you can call this method again with the same
email address.The free API key is rate limited and not suitable for production purposes. To
subscribe to the FastOpenData service and receive a key that will provide unlimited
access, please visithttps://fastopendata.com. If you have questions about the
service or your particular use-case, emailzac@fastopendata.com.The main class for this client isFastOpenDatawhich is invoked like so:>>> from fastopendata_client import FastOpenData
>>> session = FastOpenData(api_key="<YOUR_API_KEY>")
>>> data = session.request(free_form_query="123 Main Street, Tallahassee, FL, 12345")datanow contains a dictionary with all the data from the FastOpenData server.If you have a Pandas dataframe, you can append new columns containing data from
FastOpenData by callingFastOpenData.append_to_dataframeand specifying which
columns contain address information. For example, ifCOLUMN_NAMEcontains
unstructured address strings, you can do this:>>> import pandas as pd
>>> from fastopendata_client import FastOpenData
>>> session = FastOpenData(api_key="<YOUR_API_KEY>")
>>> df = pd.DataFrame(...)
>>> session.append_to_dataframe(df, free_form_query=COLUMN_NAME)Nowdfcontains many new columns containing data from the FastOpenData server.If your dataframe has columns containing structured address information, you
can do:>>> session.append_to_dataframe(
        df,
        address1=ADDRESS1_COLUMN,
        address2=ADDRESS2_COLUMN,
        city=CITY_COLUMN,
        state=STATE_COLUMN,
        zip_code=ZIP_CODE_COLUMN
    )Note that you have the option of specifying eitherfree_form_queryor the column names for structured address data, but not both. Doing so will raise an exception.
Package: fastorm
FastORMORM for async postgresBetaFastORM is a modern, fast (async), database library for projects with Python 3.10+ based on standard Python type hints.The key features are:Async postgresTested to work with Python 3.10Installpip install fastormExampleSeeexample.pyfor more examples.Let's define some tables, to show off the capabilities.classState(str,Enum):RUNNING='running'ABORTED='stopped'COMPLETED='done'# end classclassUser(FastORM):_ignored_fields=[]_primary_keys=['id']_automatic_fields=['id']_table_name='user'id:Optional[int]# Optional because automatically filled (_automatic_fields)name:strclassAuction(FastORM):_ignored_fields=[]_primary_keys=['id']_automatic_fields=['id']_table_name='auction'id:Optional[int]# Optional because automatically filled (_automatic_fields)owner:Union[int,User]# can be provided by int or the native objectprevious_owner:Optional[User]# Optional because nullablestate:State# Enum support :Dtitle:strsubtitle:Optional[str]# nullabledescription:strstart_date:datetime# datetime supportend_date:datetimemetadata:JSONTypedeleted:boolchat_id:intNow you can quickly write classes to the database:conn=awaitFastORM.create_connection('postgresql://user:password@postgres_host/database')user=User(id=None,name="hunter24")# id will be filled by the databaseawaitowner_user.insert(conn=conn)# set's the id, too.auction=Auction(id=None,# gonna be automatic if `insert(…, ignore_setting_automatic_fields=False)` (default).# two ways of setting references to other tables:# by the actual value, in this case the numeric idowner=user.id,# or via a different object,# it will use the id field (internally set by `User._primary_keys`) to determine the actual values.previous_owner=user,state=State.RUNNING,# enum will be a string in the databasetitle="I sell my soul",subtitle="Slightly used",description="You only get a share though, others claim ownership, too.",start_date=datetime.now(),end_date=datetime.now()+timedelta(days=5),# datetimes just worksmetadata={"just":["json","stuff",111,datetime.now()]},# will be native JSONB. You can have datetimes and your own classes in there as well, see `FastORM._set_up_connection`.deleted=False,chat_id=9223372036854775807,# note, this database field must be BIGINT for such large numbers)awaitauction.insert(conn=conn)Basic lookups are easy, too.# single lookup, returns one element or Noneuser=awaitUser.get(name="hunter24")user=awaitUser.get(id=1234)# list of results (list can have length 0)all_running_auctions=Auction.select(state=State.RUNNING)Of course updating and deleting is possible too.auction.state=State.COMPLETEDawaitauction.update()awaituser.delete()
Package: fastoss
fastoss介绍快速使用阿里云的oss产品软件架构软件架构说明安装教程pip安装pipinstallfastosspip安装（使用阿里云镜像加速）pipinstallfastoss-ihttps://mirrors.aliyun.com/pypi/simple使用说明demoimportfastossquery_res=fastoss.upload_file(file_dir='test.txt',key='test.txt')
Package: fastotp-sdk
FastOtpThe FastOTP Wrapper SDK is designed to simplify the integration and usage of the FastOTP service in Python applications. FastOTP is a service that provides functionality for generating, validating, and delivering One-Time Passwords (OTPs) through various channels.InstallationTo install PyResponse, you can use pip:pipinstallfastotpUsageFastotp can be used with different web frameworks, including Django, FastAPI, and Flask. Here's how you can use Fastotp in each framework:# Example usagefromfastotp_sdk.clientimportFastOTPClient,TokenTypeInitialize FastOTP clientapi_key="your_api_key"fastotp_sdk=FastOTPClient(api_key)Generate OTPgenerated_otp=fastotp_sdk.generate_otp(token_type=TokenType.NUMERIC,token_length=6,validity=10)print("Generated OTP:",generated_otp)Validate OTPvalidation_result=fastotp_sdk.validate_otp(identifier="example_identifier",token="123456")print("Validation Result:",validation_result)Get OTP Detailsotp_details=fastotp_sdk.get_otp_details(otp_id="123")print("OTP Details:",otp_details)DjangoInstall FastOtp using pip as shown in the installation section.Import the necessary functions from FastOtp in your Django views or API handlers.# In your views or modelsfromfastotp_sdk.clientimportFastOTPClient,TokenTypeapi_key="your_api_key"fastotp_sdk=FastOTPClient(api_key)# Generate OTPgenerated_otp=fastotp_sdk.generate_otp(token_type=TokenType.NUMERIC,token_length=6,validity=10)# Use generated_otp as needed in your Django application## LicenseThisprojectislicensedundertheMITLicense-seethe[LICENSE](LICENSE)filefordetails.
Package: fast-overlap
Fast OverlapA tiny cython library to calculate the pairwise overlap of all cell
masks between two time points. Created for use inhttps://github.com/Hekstra-Lab/microutil/Installpip install fast-overlapDevelopmentInstallationpython setup.py build_ext -iTo really remove stuff and build + test:rm *.so build/ fast_overlap.cpp -rf && python setup.py build_ext -i && python test_speedup.pyOn MacYou need to compile python extensions with the same compiler used to compile python. So on mac you should useclang. However the apple distributed clang doesn't include openmp so you should either use g++ locally (which seems to work for some reason, but doesn't for built wheels) or use homebrew clang as in the github workflows.
Package: fast-package-file
fast_package_filePackage a directory to a file, with fast file access and compression supportimportfast_package_file# Package a directory into a filefast_package_file.build('a_directory','a_package.file')# Prepare a package filedata_package=fast_package_file.PackagedDataFile('a_package.file')# Load a file from the packed directory and save itwithopen('any.file','wb')asany_file:data_package.load_file('path\\to\\any.file')# Or just get the raw binary datafromPILimportImagei=Image.open(io.BytesIO(data_package.load_file('image.png')))# Some other useful functionsdata_package.load_bulk(prefix='audio\\sfx\\',postfix='.wav')fast_package_file.oneshot('a_package.file','path\\to\\any.file')fast_package_file.oneshot_bulk('a_package.file',prefix='audio\\sfx\\',postfix='.wav')InstallationFrom PyPI:pipinstallfast-package-fileOr from Github:pipinstallgit+git://github.com/Kataiser/fast-package-file.git@master#egg=fast_package_fileDocumentationMore details will be available athttps://fast-package-file.readthedocs.io/en/latest/FeaturesIs fast because only the data needed is loaded from the package file, total package size is irrelevantObfuscates files from (most) usersLike a .zip file, but doesn't decompress the entire thing when reading just one fileIncludes the entire directory and subdirectories, not just surface-level filesFiles are compressed with Gzip, but only if compression improves file size (per file) and is enabled (per package file)Pretty good error handling when loading package files, just catch fast_package_file.PackageDataErrorInspired by video game packaging, such as UE4's .pak or GTA V's .rpf formatsCross-platform, has CI for Linux, MacOS, and WindowsContributeIssue Tracker:https://github.com/Kataiser/fast-package-file/issuesSource Code:https://github.com/Kataiser/fast-package-fileLicenseThe project is licensed under the MIT license.
Package: fast-pagerank
Fast Personalized PageRank ImplementationI needed a fast PageRank forWikisimproject. It had to be fast enough to run real time on relatively large graphs. NetworkX was the obvious library to use, however, it needed back and forth translation from my graph representation (which was the pretty standard csr matrix), to its internal graph data structure. These translations were slowing down the process.I implemented two versions of the algorithm in Python, both inspired by the sparse fast solutions given inCleve Moler's book,Experiments with MATLAB. The power method is much faster with enough precision for our task.Personalized PageRankI modified the algorithm a little bit to be able to calculatepersonalized PageRankas well.Comparison with Popular Python Implementations: NetworkX and iGraphBoth implementations (exact solution andpower method) are much faster than their correspondent methods in NetworkX. Thepower methodis also faster than the iGraph native implementation, which is also an eigen-vector based solution. Benchmarking is done on aml.t3.2xlargeSageMaker instance.What is the major drawback of NetworkX PageRank?I gave up using NetworkX for one simple reason: I had to calculate PageRank several times, and my internal representation of a graph was a simple sparse matrix. Every time I wanted to calculate PageRank I had to translate it to the graph representation of NetworkX, which was slow. My benchmarking shows that NetworkX  has a pretty fast implementation of PageRank (networkx.pagerank_numpyand  'networkx.pagerank_scipy), but translating from its own graph data structure to a csr matrix before doing the actual calculations is exactly what exactly slows down the whole algorithm.Note: I didn't count the time spent onnx.from_scipy_sparse_matrix(converting a csr matrix before passing it to NetworkX PageRank) in my benchmarking, But I could! Because that was another bottleneck for me, and for many other cases that one has acsradjacency matrix.Python ImplementationThe python package is hosted athttps://github.com/asajadi/fast-pagerankand you can find the installation guide in theREADME.mdfile. You also can find a detailed analysis inthe jupyter notebookorthis blog post.UsageInstallation:pip install fast-pagerankExampleLet's take Example 1 fromhttps://www.cs.princeton.edu/~chazelle/courses/BIB/pagerank.htmAssuming A=0, B=1, C=2, D=3:>>> import numpy as np
>>> from scipy import sparse
>>> from fast_pagerank import pagerank
>>> from fast_pagerank import pagerank_power
>>> A = np.array([[0,1], [0, 2], [1, 2],[2,0],[3,2]])
>>> weights = [1,1,1,1,1]
>>> G = sparse.csr_matrix((weights, (A[:,0], A[:,1])), shape=(4, 4))
>>> pr=pagerank(G, p=0.85)
>>> pr
array([0.37252685, 0.19582391, 0.39414924, 0.0375    ])The output elements are essentially the same numbers written on the nodes, but normalized (multiply the vector by 4 and you will get the same numbers)We can add personalization, or usepower method:>>> personalize = np.array([0.4, 0.2, 0.2, 0.4])
>>> pr=pagerank_power(G, p=0.85, personalize=personalize, tol=1e-6)
>>> pr
array([0.37817981, 0.18572635, 0.38609383, 0.05      ])
Package: fastpapers
Welcome to fastpapersPlay LEGO with papers.#all_slowfastpapersis a python library where I usefastaito reproduce papers onJupyter Notebooks. I usenbdevto turn these notebooks into modules.Installpip install fastpapersHow to useTrain DETR in 3 lines of codeDownload the datapath=download_coco(force_download=False)Create the DataLoaders, the Learner, and fit.dls=CocoDataLoaders.from_sources(path,vocab=coco_vocab,num_workers=0)learnd=detr_learner(dls)learnd.fit(1,lr=[1e-5,1e-5,1e-5])epochtrain_lossvalid_lossAPAP50AP75AP_smallAP_mediumAP_largeAR1AR10AR100AR_smallAR_mediumAR_largetime05.8928427.6362980.4753810.5741250.5060630.2977410.4580060.5609940.3550180.5456460.5603740.3751410.5417280.6303302:05:24Show the resultswithlearnd.removed_cbs(learnd.coco_eval):learnd.show_results(max_n=8,figsize=(10,10))Superresolution in 4 lines of codeDownload the datapath=untar_data(URLs.IMAGENETTE)Create the DataLoaders, the Learner adn fit.#hide_outputdb=DataBlock(blocks=(ResImageBlock(72),ResImageBlock(288)),get_items=get_image_files,batch_tfms=Normalize.from_stats([0.5]*3,[0.5]*3))dls=db.dataloaders(path,bs=4,num_workers=4)learn=superres_learner(dls)learn.fit(16,lr=1e-3,wd=0)learn.show_results()Library structureThe name of each module is thebibtexkeyof the corresponing paper.
For example, if you want to use the FID metric fromHeusel, Martin, et al. 2017, you can import it like so:fromfastpapers.heusel2017gansimportFIDMetricIf you want to train a pix2pix model from Isola,Phillip, et alyou can import a pix2pix_learnerfromfastpapers.isola2017imageimportpix2pix_learnerThecoremodule contains functions and classes that are useful for several papers.
For example, you have aImageNTupleto work with an arbitrary amount of images as input.path=untar_data(URLs.PETS)files=get_image_files(path/"images")it=ImageNTuple.create((files[0],files[1],files[2]))it=Resize(224)(it)it=ToTensor()(it)it.show();Or useful functions for debuging likeexplode_shapesorexplode_rangesexplode_shapes(it)[(3, 224, 224), (3, 224, 224), (3, 224, 224)]
Package: fastparquet
fastparquet is a python implementation of theparquet
format, aiming integrate
into python-based big data work-flows. It is used implicitly by
the projects Dask, Pandas and intake-parquet.We offer a high degree of support for the features of the parquet format, and
very competitive performance, in a small install size and codebase.Details of this project, how to use it and comparisons to other work can be found in thedocumentation.Requirements(all development is against recent versions in the default anaconda channels
and/or conda-forge)Required:numpypandascython >= 0.29.23 (if building from pyx files)cramjamfsspecSupported compression algorithms:Available by default:gzipsnappybrotlilz4zstandardOptionally supportedlzoInstallationInstall using conda, to get the latest compiled version:conda install -c conda-forge fastparquetor install from PyPI:pip install fastparquetYou may wish to install numpy first, to help pip’s resolver.
This may install an appropriate wheel, or compile from source. For the latter,
you will need a suitable C compiler toolchain on your system.You can also install latest version from github:pip install git+https://github.com/dask/fastparquetin which case you should also havecythonto be able to rebuild the C files.UsagePlease refer to thedocumentation.ReadingfromfastparquetimportParquetFilepf=ParquetFile('myfile.parq')df=pf.to_pandas()df2=pf.to_pandas(['col1','col2'],categories=['col1'])You may specify which columns to load, which of those to keep as categoricals
(if the data uses dictionary encoding). The file-path can be a single file,
a metadata file pointing to other data files, or a directory (tree) containing
data files. The latter is what is typically output by hive/spark.Writingfromfastparquetimportwritewrite('outfile.parq',df)write('outfile2.parq',df,row_group_offsets=[0,10000,20000],compression='GZIP',file_scheme='hive')The default is to produce a single output file with a single row-group
(i.e., logical segment) and no compression. At the moment, only simple
data-types and plain encoding are supported, so expect performance to be
similar tonumpy.savez.HistoryThis project forked in October 2016 fromparquet-python, which was not designed
for vectorised loading of big data or parallel access.
Package: fast-password-validation
FastCommonPasswordValidatorA faster drop-in replacement for Django built-inCommonPasswordValidator.
With the default password list it has 4x lookup speed gain and 30% memory savings
and these results will be even better with larger password lists.Validate whether the password is a listed common password. By default, will use built-in list of 20k
common  passwords (lowercase and deduplicated) byRoyce Williams. If called with
a file name, it will load passwords one-per-line and use for subsequent checks.Why?The original class loads a static list of 20k passwords into memory and scans through it each time it's called, which is...
far from being optimal. From Django maintainers point of view it has one advantage: it does not require
any extra dependencies, which was the main reason that class was included into the default Django distribution
whilethis wasn'tand is available as an extra module.Compiling your own password listInitialize a new Bloom filter from your data:frombloom_filterimportBloomFilterimportpathlibapprox_number_of_lines=20_000# or whatever your file hasbloom=BloomFilter(max_elements=approx_number_of_lines,error_rate=0.001)withpathlib.Path('mypasswords.txt').open()asf:forlineinf.readlines():line=line.strip()iflen(line.strip())>0andnotline.startswith('#'):bloom.add(line)# test if it works'password77'inbloom# should be True'PLWmV6Zh3viv'inbloom# should be False (but see on false positives below)And dump it as a file usingpicklemodule:importpicklewithopen('myawesomepasswords.dat')asf:pickle.dump(f,bloom)False positivesBloom filter is a probabilistic structure. The filter is by default configured for 0.001 (0.1%) error rate which
means on 1000 checks in will falsely report 1 password on average as "common" even if it was not in the original
list. In practical applications it's not really a hill to die on, and it might actually bump the respect for your
prophetic skills among the users.
Package: fastpath
IntroductionFastpath is a fast and lightweight tool for finding the shortest path in a weighted
graph.  As input it only needs the starting node, the ending node, and the weights
of each node to node edge.  For versatility it uses the Bellman-Ford algorithm, which
allows for negative weights.  Future version will incorporate the Dijkstra algorithm
to speed up runtimes on graphs that do not contain negative edges.
To installfastpath,gitclonegit@github.com:deprekate/fastpath.gitcdfastpath;makeThe only library dependency for fastpath is uthash (which is included).
The fastpathz has the extra dependency of mini-gmp (which is included).There are two flavors offastpath.  The first is the defaultfastpath, which will work
for 99% of needed cases.  It's limitation is that it uses the C-type long double for edge
weights, which can cause rounding errors if you have extremely large/small numbers for edge
weights (ie -1E50 or 1E50).
This is because during the path relaxation step of the Bellmanford code, C cannot distinguish
a difference between 1E50 and 1E50 + 1
If your numbers are extremely large/small, then you can use thefastpathzversion, which
uses infinite-precision integers as edge weights. The downside of usingfastpathzis that
decimal places get dropped, so the C code does not distinguish between 1 and 1.1.  This
limitation can partially be overcome by just multiplying all your weights by an arbitrary
number.Fastpath ExampleRun either flavor on the included sample data:fastpath--sourceA--targetZ<edges.txtfastpathz--sourceA--targetZ<edges.txtThe output of either command is the path of nodes, and should look likeA
B
D
E
ZThe structure of the graph looks like:A----->B----->C<-----F||||vvD----->E----->ZStrings can be used for the nodes, and the weights can be positive or negative long double
numbers. The weights can even be in the form of scientific shorthand (1.6E+9).Python ExampleFastPath is now also available as a PIP package available atpypi.orgIt is installable by simply using pippipinstallfastpathTo use in your python code, first import the module, write edges to the graph, and then provide a beginning node (source) and an end node (target)importfastpathasfpf=open("edges.txt","r")forlineinf:ret=fp.add_edge(line)foredgeinfp.get_path(source="A",target="Z"):print(edge)Output is the path of nodes, and should look like$pythonexample.pyA
B
D
E
Z