Saravanan666/pypi-org huggingface dataset:
Package: faust-streaming-rocksdb
Python bindings for RocksDB 6.This project is now deprecated, users should now usehttps://github.com/Congyuwang/RocksDictsince it has better documentation, portability, and an active community.Seehttps://faust-streaming.github.io/python-rocksdb/for a more comprehensive install and
usage description.Quick InstallThis library is built for Debian + Ubuntu Distributions.pip3installfaust-streaming-rocksdbQuick Usage Guide>>>importrocksdb>>>db=rocksdb.DB('test.db',rocksdb.Options(create_if_missing=True))>>>db.put(b'a',b'data')>>>print(db.get(b'a'))b'data'AcknowledgementsThis project attempts to collect the efforts put into different forks of thepyrocksdbproject that was originally written bystephan-hof, as sadly
none seems to be actively maintained. In particular, thepython-rocksdbfork
created bytwmht, but it also incorporates changes from other forks and
unfinished pull requests. The current state of this project has pulled all of
these commits fromNightTsarina’sfork.
Package: fau-tools
IntroductionThis is a small tool that uses the PyTorch framework, providing assistance in completing classification task using CNN.Features: train model, print training process, save training files, plot figures, etc.Installpip install fau-toolsUsageimportThe following code is recommended.importfau_toolsquick startThe tutor will use a simple example to help you get started quickly!The following example uses Fau-tools to train a model in MNIST hand-written digits dataset.importtorchimporttorch.nnasnnimporttorch.utils.dataastdataimporttorchvisionimportfau_tools# A simple CNN networkclassCNN(nn.Module):def__init__(self):super().__init__()self.conv=nn.Sequential(nn.Conv2d(1,16,3,1,1),# -> (16, 28, 28)nn.ReLU(),nn.MaxPool2d(2),# -> (16, 14, 14)nn.Conv2d(16,32,3,1,1),# -> (32, 14, 14)nn.ReLU(),nn.MaxPool2d(2)# -> (32, 7, 7))self.output=nn.Linear(32*7*7,10)defforward(self,x):x=self.conv(x)x=x.flatten(1)returnself.output(x)# Hyper Parameters definitiontotal_epoch=10lr=1E-2batch_size=1024# Load datasettrain_data=torchvision.datasets.MNIST('datasets',True,torchvision.transforms.ToTensor(),download=True)test_data=torchvision.datasets.MNIST('datasets',False,torchvision.transforms.ToTensor())train_data.data=train_data.data[:6000]# mini datatest_data.data=test_data.data[:2000]# mini data# Get data loadertrain_loader=tdata.DataLoader(train_data,batch_size,True)test_loader=tdata.DataLoader(test_data,batch_size)# Initialize model, optimizer and loss functionmodel=CNN()loss_function=nn.CrossEntropyLoss()optimizer=torch.optim.Adam(model.parameters(),lr)# Train!fau_tools.TaskRunner(model,train_loader,test_loader,loss_function,optimizer,total_epoch,exp_path="MNIST").train()Now, we can run the python script, and the training process will be visualized as the following picture.Three files namedbest.pth,scalars.csvandexp_info.txtwill be saved.The first file is the weight of trained model.The second file records scalar value changes in the training process.The third file saves information about the experiment.The above is the primary usage of this tool, but there are also some other snazzy features, which will be introduced later. [TODO]ENDHope you could like it! And welcome issues and pull requests.
Package: faux
Quick and easy server mocking.InstallationVia github:~$gitclonehttp://github.com/bprinty/faux.git~$cdfaux~$pythonsetup.pyinstallVia pip:~$pipinstallfauxDocumentationDocumentation for the package can be foundhere.UsageThefauxprovides utilities for mocking responses from external services during testing. Withfaux, you can easily serve a directory structure mocking url endpoints for an externally managed service and use that server for testing.High-LevelFor instance, if you have a directory structure that looks like the following:├── _uuid
├── file
└── query/
    ├── data
    └── arg=testWith the following as contents of the files in that directory structure:# _uuid
{
    "status": "ok",
    "city": "{{city}}"
}

# file
{
    "status": "ok",
    "month": "{{month}}",
}

# query/arg=test
{
    "status": "ok",
    "arg": "test",
    "digit": {{random_digit}}
}

# query/data
{
    "status": "ok",
    "data": "test"
}Endpoints mirroring that file structure will be available:>>>importrequests>>>r=requests.get('http://localhost:1234/4db5fd8c-8aa6-4c29-b979-dab3ce71e64e')>>>print(r.json()){"status":"ok","city":"Sacramento",}>>>r=requests.get('http://localhost:1234/file')>>>print(r.json()){"status":"ok","month":"05"}>>>r=requests.get('http://localhost:1234/query?arg=test')>>>print(r.json()){"status":"ok","arg":"test","digit":4}>>>r=requests.get('http://localhost:1234/query/data')>>>print(r.json()){"status":"ok","data":"test"}It’s also worth noting (alluded to above) that you can mock arbitrary data in your responses using methods from thefakerlibrary. Items like{{city}}and{{month}}above were automatically and randomly filled without outputs from afaker.Faker()object during the request.One other special file above is the_uuidfile, which will return data from the_uuidfile whenever a uuid is included as part of the request.Starting a ServerFor the previous example, you can start the server on a specific port using:.. code-block:: bash~$ faux serve -P 1234 /path/to/directoryUsing Within TestsOne of the most common paradigms for using this software is to mock a service during testing. To do so with this module, you can easily set up a py.test fixture that will run throughout your test session:importunittestimportpytestRESOURCES='/path/to/testing/resources'@pytest.fixture(scope='session')defserver():"""
    Set up mock server for testing request caching.
    """fromfauximportServerapp=Server(__name__,cache=RESOURCES)withapp.run(port=1234):yieldreturnOnce you’ve defined the fixture, you can use it on a test class or function like so:# test function@pytest.mark.usefixtures("server")deftest_function():return# test class@pytest.mark.usefixtures("server")classTestClass(unittest.TestCase):deftest_method():returnWith the code above, the server you’re mocking will run throughout your testing session and will gracefully exit when the test session stops.Other FunctionalityTo see other functionality provided by the library, please see thedocumentation.Questions/FeedbackFile an issue in theGitHub issue tracker.
Package: fauxcyrillic
fauxcyrillic - convert Latin text to faux Cyrillicfauxcyrillic is a Python library and command-line utility to convert Latin text to faux Cyrillic. FromWikipedia:Faux Cyrillic, pseudo-Cyrillic, pseudo-Russian or faux Russian typography is the use of Cyrillic letters in Latin text, usually to evoke the Soviet Union or Russia, though it may be used in other contexts as well.Installationpipcan be used to install fauxcyrillic:pipinstallfauxcyrillicTo make fauxcyrillic available outside your Python environment, I recommend to install fauxcyrillic usingpipx:pipxinstallfauxcyrillicUsagefauxcyrillic can be used as a command-line utility as follows:fauxcyrillic'<text>'Not that<text>should be in quotes in case you use spaces in your text. If no argument is provided, you will be prompted to provide your text.ContributingPlease refer toCONTRIBUTING.mdLicenseBSD-3
Package: fauxgeo
# FauxGeo: generate simple geospatial rastersFauxGeo is a python library that generates simple OSGeo-supported rasters.  The primary purpose for this library is to help test geoprocessing functions.![PyPI](https://badge.fury.io/py/fauxgeo.png)![Build](https://travis-ci.org/wbierbower/fauxgeo.svg?branch=master)## FeaturesAvailable Signal Functions| Signal Function | RasterFactory Method     || :------------- | :------------- || uniform      | `.uniform(val)`      || ramp | `.ramp(zero_index, slope=1)` || saw tooth | `.saw(low, high, period)` || triangle | `.triangle(low, high, period)` || step | `.step(low, high, period)` || random range | `.random(low, high)` || random from list | `.random(list)` || alternating | `.alternate(val1, val2)` |## InstallationTo install FauxGeo, simply:```bash$ pip install fauxgeo```## Usage```pythonimport numpy as npfrom fauxgeo import RasterFactory, Affineoptions = {'affine': Affine.identity(),'epsg': 4326,'datatype': np.float32,'nodata': -9999,'driver': 'GTIFF','shape': (10, 10)}factory = RasterFactory(**options)factory.ramp(0, 10, 5).to_file('path/to/file')```## Tests```bash$ python setup.py test```
Package: fauxgrad
fauxgradThere's plenty of excellent (tinygrad) and minimalist (micrograd) built-from-scratch, deep learning frameworks out there, so the goal offauxgradis to sacrifice some of the full functionality, and focus on the general idea and building blocks for writing your own.The walkthrough/tutorial can be found in thisnotebook.Installationpip install fauxgradExamplesCalculating some gradients:a=Value(5)b=Value(-3)c=a*bd=a+ce=d*2e.backward()print(f'The derivative that we computed before, de/da:',a.grad)>>>-4.0Plotting the backward pass graph:fromfauxgrad.utilsimportplot_graphplot_graph(e)
Package: fauxioapi
fauxioapiA simple approximation of a limited set of functions from the I/O API targeted at gridded atmospheric emissions QA in a netCDF container such as those created by SMOKE for CMAQOverviewI/O API is a programming interface used for storage and access primarily of meterological and atmospheric pollution data for CMAQ, WRF, SMOKE and other applications. I/O API is currently hosted by both GitHub and the CMAS center. It is maintained by Carlie J. Coats, Jr., Ph.D., the original architect of both CMAQ and SMOKE. This module is unofficial and has no connection to the CMAS center or the I/O API developers. This library is not considered 100% compatible with I/O API.
Currently the fauxioapi library supports gridded hourly files and can read the grid description format file. Do not contact the I/O API author or developers about issues with this module or files generated by this module.RequirementsPython 3.5 or later is required.
The library is tested with numpu 1.16 and netCDF4 1.2.9. Variations in module versions may introduce incompatibilities.InstallationInstallation may be done using Python setuptools.
Simply run python3 setup.py install to begin the process.Usage exampleimport fauxioapi as ioInitialize grid variables from griddesc file:
gridname = '12US2'
grid_description = 'GRIDDESC.txt'
grid = io.Grid(gridname, grid_description)Open I/O API dataset for reading and read a variable:
fn = 'input_data.ncf'
with io.IODataset(fn) as iodf:
var = iodf['NOX']Open I/O API dataset for writing, set dimensions, write a variable, set attributes, and write the TFLAG:
fn = 'output_data.ncf'
with io.IODataset(fn, 'w') as iodf:
iodf.set_dimensions(LAY=1, ROW=200, COL=200, VAR=1)
iodf_var = iodf.create_variable('NOX', 'REAL', ('TSTEP','LAY','ROW','COL'))
iodf_var[:] = np.zeros([25,1,200,200])
iodf.set_attributes('20200101', grid)
iodf.write_TFLAG()
Package: faux-synth
FauxSynthThe Python package for generating addresses, temporary emails, and more.
It scrapes the data from the internet and generates fake data for you.Table of ContentsInstallationUsageRandom AddressTemporary EmailReceive EmailsInstallationDownload this repository and run the following command in the terminal to install the required packages.pipinstallfaux-synthUsageRandom AddressFauxSynth provides multipleAddressGeneratorspresent inFauxSynth.addressmodule.
EachAddressGeneratorcan generate multiple addresses from different countries.In this example we will use theBestRandomsaddress generator to generate random addresses from the United States.fromFauxSynth.addressimportBestRandomsfromFauxSynth.typesimportCountry# Create an instance of the AddressGeneratoraddress_generator=BestRandoms(Country.UnitedStates)# Generate a random addressaddress=address_generator.get_address()print(address)# Generate multiple addressesaddresses=address_generator.get_addresses(5)print(addresses)# Access the address fieldsprint(address.street)Temporary EmailFauxSynth provides multipleMailHandlerpresent inFauxSynth.mailmodule.
EachMailHandlercan generate temporary emails.In this example we will use theFakeMailmail handler to generate a temporary email.fromFauxSynth.mailimportFakeMailmail_handler=FakeMail()# FakeMail automatically has a random address.# You can access it using the `address` property.print(mail_handler.address)# You can also generate a new random address by creating a new generator.# Or claim a new address with `claim_mail()`# Also check if the address is available with `check_mail()`new_address="max.mustermann"ifmail_handler.check_mail(new_address):mail_handler.claim_mail(new_address)print(mail_handler.address)else:print("Address already taken")Receive EmailsTo receive Emails using aMailHandleryou can use therefresh()method.
This method will refresh the inbox and saves the new emails in themailsproperty.Themailsproperty is a list ofMailobjects. EachMailobject has the following properties:sender: The sender of the emailsubject: The subject of the emailbody: The body of the email (Needs to be loaded withload_body())fromFauxSynth.mailimportFakeMailmail_handler=FakeMail()print(f"Current Mail Address:{mail_handler.address}")# Refresh the inboxmail_handler.refresh()# Print the mailsformailinmail_handler.mails:print(f"Sender:{mail.sender}")print(f"Subject:{mail.subject}")mail.load_body()print(f"Body:{mail.body}")print("")There is also thewait_for_mail()method.
This method will automatically refresh and wait for a new email to arrive.fromFauxSynth.mailimportFakeMailmail_handler=FakeMail()# Wait for a new emailnew_mail=mail_handler.wait_for_mail(timeout=60,interval=2)
Package: fauxtograph
Python module for training unsupervised deep, generative models on images. It uses Chainer for the Neural Network framework and implements several methods, including Variational Auto-encoders, Generative Adversarial Networks, and their combination. These methods are built with reference to personal notes and the following papers:
1) Diederik P Kingma, Max Welling; “Auto-Encoding Variational Bayes”; (2013).
2) Alec Radford et. al.; “Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks”; (2015).
3) Anders Boesen et. al.; “Autoencoding Beyond Pixels Using a Learned Similarity Metric”; (2015).
Package: fauxy
Fauxy is an ASGI webapp that will proxy requests to a remote server.
The first time it sees a request, it records the response to disk and returns it.
From then on, it can return the recorded response whenever it sees the same request.RunningFauxy can be run by any ASGI server.example.pyruns fauxy usinguvicorn.
If you've installed fauxy, you can run it withpython example.py.Matching requestsTo decide if a given request matches any recordings, fauxy creates a 'key' for the request.
It takes akey_makerfunction to do this.
The key maker function takes in a Starlette Request object and returns a JSON key.
Any request that produces identical JSON will be considered a match by fauxy.Here's a key maker that only matches on the request path:defpath_key(req:Request)->JSON:return{"path":req.url.path}If fauxy is proxying to example.com, that key maker will say any request to /1/2/3 has the key{"path": "/1/2/3"}The first time fauxy sees it, it'll proxy that to example.com/1/2/3 and record the result.
Future requests for /1/2/3 will produce the same key regardless of other attributes of the request e.g. query parameters or HTTP method.
Since those keys match, fauxy will return the recording instead of proxying again.
If a request is then made for /1/2, it produces different JSON:{"path": "/1/2"}.
That means the existing recording won't be found and fauxy will proxy and record it.Storing responsesFauxy writes out responses for all requests with a new key to the library directory you pass it.
Inside that directory, it creates a directory per recorded response.
The response directory is the full request path with a hash of the request key as its final segment.For our /1/2/3 example, if the library directory isrecordings, fauxy could produce the directoryrecordings/1/2/3/ba8d9c9d.
In that example,ba8d9c9dis the hash of the key JSON bytes.
When looking for a recording matching a request, fauxy produces the hash, walks the library directory, and returns the first matching hash directory it finds.While the request path is part of the created directory structure, it doesn't constrain matching.
As long as the hash matches, fauxy will return a response.
If you include the requested path in the key JSON, the hash will be determined by the path, but if you don't, it won't affect it.TodoProcessing responses before savingOptionally record requestsTUI for viewing requests and responsesHosting multiple reloading proxies on separate ports from a single parentContent-adressed response content deduplication
Package: fava
Fava is a web interface for the double-entry bookkeeping softwareBeancountwith a focus on features and usability.Check out the onlinedemoand learn more
about Fava on thewebsite.TheGetting Startedguide details the installation
and how to get started with Beancount.  If you are already familiar with
Beancount, you can get started with Fava:pip3 install fava
fava ledger.beancountand visit the web interface athttp://localhost:5000.If you want to hack on Fava or run a development version, see theDevelopmentpage on the
website for details. Contributions are very welcome!
Package: fava-envelope
fava-envelopeA beancount fava extension to add a envelope budgeting capability to fava and beancount. It is developed as an fava plugin and CLI.Repl.itClick the repl.it link to be able to see the plugin in actionClick the linkClick RunWhen the web pane opens, click the open in new tab ( have not figurec ouf why it is not showing in the initial window )Click the "Fava Envelope" link in fava to see the pluginInstallation via pippython -m pip install fava-envelopeTODOadd example file for screenshots and testingAdd testingadd chartsRunning fava-envelopeLoad the ExtensionAdd this to your beancount journal, and start fava as normal2000-01-01 custom "fava-extension" "fava_envelope" "{}"You should now see 'Envelope' in your fava window. You must set up a budget (see below), or else Fava will report a 404 error.Setting up budgetSet the budget start datestart date in the format <4 digit year>-<2 digit month>2020-01-01 custom "envelope" "start date" "2020-01"Budget months aheadIf you want to see future months (to budget ahead), set this parameter2020-01-01 custom "envelope" "months ahead" "2"The default is 0Set up Budget AccountsYou will need to specify the Assets and Liabilities you want included in your budget (For example ignoring Investment accounts). you can use regular expression in these statements2020-01-01 custom "envelope" "budget account" "Assets:Checking"
2020-01-01 custom "envelope" "budget account" "Liabilities:Credit-Cards:*"Set up mappingsBy default fava-envelope will use the Assets/Liabilities/Income/Expenses buckets that are not listed in the budget accounts. this directive allows you to map them to another bucket2020-01-01 custom "envelope" "mapping" "Expenses:Food:*" "Expenses:Food"Allocate money to a bucket2020-01-31 custom "envelope" "allocate" "Expenses:Food" 100.00Set up operating currencyThe envelopes will read the operating currency from the core beancount option.option "operating_currency" "EUR"It will default to USD if this option is not set. Only a single currency is supported for the budget.
Package: fava-ghost
fava-ghostfava-ghost是一个为运行和管理fava实例而设计的高效后台守护进程，它结合了 Docker 容器化技术，使得部署、更新和管理 fava 服务变得简单快捷。特性自动化同步：自动从 git 仓库同步 fava 账本文件。依赖性管理：自动管理和安装 Python 依赖，确保 fava 运行环境始终为最新状态。冲突解决：在发现合并冲突时会提醒用户手动解决。容器化：使用 Docker 容器，简化部署和迁移。Beancount 项目准备fava-ghost 并不强制用户使用特定的 fava / beancount 版本，所以用户需要在自己的项目中指定 fava / beancount 版本。fava-ghost 使用pip install -e .来安装 fava / beancount，所以你需要在你的项目中添加setup.py文件，内容如下：fromsetuptoolsimportsetupsetup(install_requires=['fava==1.26.2','beancount==2.3.6',],)使用首先安装 fava-ghost:pipinstallfava-ghostfava-ghost 需要有读写仓库权限的 Github Credentials 来同步账本文件。你可以在这里申请一个 Github Fine-grained personal access token。然后启动 fava-ghost:fava-ghost--repo-urlhttps://github.com/REPO--repo-credentialsGITHUB_TOKEN--repo-pathPATH_TO_REPO其中 PATH_TO_REPO 是你的账本仓库的本地路径，比如~/Documents/Beancount。就可以开始自动同步账本文件了。一旦启动，fava-ghost 会自动开始做如下事情:clone 你的账本仓库到 PATH_TO_REPO在账本仓库下执行 pip 安装所需依赖启动 fava 服务每隔 10 秒尝试进行同步本地账本和代码仓库同步策略对于不同的情况，fava-ghost 会采取不同的同步策略：远程有更新，本地没有更新：自动 pull远程没有更新，本地有更新：自动 push远程和本地都有更新：执行 merge，如果没有冲突，则自动 push。如果有冲突，则需要用户手动编辑文件到文件中不存在冲突标记后，自动 pushdockerfava-ghost 也可以通过 docker 运行。镜像是e7h4n/fava-ghost。你可以通过如下命令运行：dockerrune7h4n/fava-ghost-d-p5000:5000--repo-urlREPO_URL--repo-credentialsGITHUB_TOKEN通过 docker，你可以在任意一个环境下快速启动 fava 服务来托管你的 beancount 账本，无需解决环境问题。
Package: fava-inventory
fava_inventoryThis simple extension adds an inventory page in fava with an up-to-date  physical inventory count.Installationpipinstallfava_inventoryConfiguration2000-01-01 custom "fava-extension" "fava_inventory" "[('Consignment', 'In-Transit', 'In-Stock'), 'inventory.beancount']"The example above tells the extension to look for commodity entries in inventory.beancount, then summarize inventory balances in accounts containing "Consignment", "In-Transit" and "In-Stock" in their names.UsageInventory listDefine SKUs in a beancount file (eg inventory.beancount) like so:2020-01-01 commodity BH0107B
    name: "Baby Wash Basin - Blue"

2020-01-01 commodity BH0107P
    name: "Baby Wash Basin - Pink"

2020-01-01 commodity BH0107Y
    name: "Baby Wash Basin - Yellow"

2020-01-01 commodity BH0113J
    name: "Baby Bath Towel - Wagner Magical Jungle"Accounting Entires ExampleInitial purchase of physical inventory2020-07-17 * "Inventory purchase"
  Assets:Current:Inventory:In-Transit             5 FD0201P {4.74 AUD}
  Liabilities:Current:AccountsPayable:SupplierStock arrival2020-08-17 * "Stock Arrival"
Assets:Current:Inventory:In-Transit                -4 FD0201P {}
Assets:Current:Inventory:In-Stock                   4 FD0201P {4.74 AUD}Sales2020-08-26 * "Shopify sales"
order: "1037"
  Assets:Current:Inventory:In-Stock                -1 FD0201P {} @ 12.95 AUD
  Income:Operating:A-Revenue:Shopify           -20.00 AUD
  Expenses:Transaction-Fee:Bank                  1.71 AUD
  Expenses:Shipping                              8.95 AUD
  Income:Operating:Z-COGS