Saravanan666/pypi-org huggingface dataset:
Package: trulens-viz
trulens_vizVisualize NLP results for human consumptionThenlp_viz.HTMLTableclass takes phrases for which per-word attribution strenths are available. A phrase is provided to the class as a list of (word, attribution_score) tuples. Instances create a table with pairs of lines, one pair for each phrase. The first line shows the phrase's sequence of words, styled with one of two methods for communicating the word's attribution score: color, or size. The second line shows the attributions below each word.InstallationAfter cloning, and creation of a virtual environment:pip install .UsageThe above table display was created via this code:word_attrs = [('foo', -10345), ('
', -3), ('bar', 6)]
tbl = HTMLTable(word_attrs, word_styling=WordStyles.FONT_COLOR)

# Add a second phrase, using fontsize as attribution score indicator:

tbl.add_rows([('My', -12345.), 
              ('Bonny', -100),
               ('lies', 0), 
               ('over', 100), 
               ('the', 500), 
               ('ocean', 10000.)],
              word_styling=WordStyles.FONT_SIZE)

# The third phrase, uses font color instead of size:

tbl.add_rows([('My', -12345.), 
              ('Bonny', -100),
               ('lies', 0), 
               ('over', 100), 
               ('the', 500), 
               ('ocean', 10000.)],
              word_styling=WordStyles.FONT_COLOR)

print(str(tbl.doc))The printed string was transferred to a file, and opened in a browser. Alternatively, one can use the Python webbrowser package to open the file from code.The code collects all scores, and sorts them into quantile bins (default is five bins). A word's bin membership determines the word's color or fontsize for display. Currently all attributions from all phrases in a table are used for quantiling. One could experiment with using only the strenghts within one phrase for that phrase's display.
Package: trulia
# truliaPython library for accessing Trulia’s REST API## Installationpip install trulia## Usageimport trulia.stats
import trulia.locationTRULIA_KEY = “RELACE_WITH_YOUR_API_KEY”# Get all cities in California
cities = trulia.location.LocationInfo(TRULIA_KEY).get_cities_in_state(“CA”)# Get all counties in California
counties = trulia.location.LocationInfo(TRULIA_KEY).get_counties_in_state(“CA”)# Get all neighborhoods in Los Angeles
neighborhoods = trulia.location.LocationInfo(TRULIA_KEY).get_neighborhoods_in_city(“Los Angeles”, “CA”)# Get all states in the United States
states = trulia.location.LocationInfo(TRULIA_KEY).get_states()# Get all zip codes in California
zip_codes = trulia.location.LocationInfo(TRULIA_KEY).get_zip_codes_in_state(“CA”)# Get all traffic and listing stats for the city of Los Angeles in January 2014
city_stats = trulia.stats.TruliaStats(TRULIA_KEY).get_city_stats(city=”Los Angeles”, state=”CA”, start_date=”2014-01-01”, end_date=”2014-01-31”)# Get all traffic and listing stats for Santa Clara county in January 2014
county_stats = trulia.stats.TruliaStats(TRULIA_KEY).get_county_stats(city=”Santa Clara”, state=”CA”, start_date=”2014-01-01”, end_date=”2014-01-31”)# Get all traffic and listing stats for Venice, CA neighborhood in January 2014
neighborhood_stats = trulia.stats.TruliaStats(TRULIA_KEY).get_neighborhood_stats(neighborhood_id=7183, start_date=”2014-01-01”, end_date=”2014-01-31”)# Get all traffic and listing stats for California in January 2014
state_stats = trulia.stats.TruliaStats(TRULIA_KEY).get_state_stats(state=”CA”, start_date=”2014-01-01”, end_date=”2014-01-31”)# Get all traffic and listing stats for the 90025 zip code in January 2014
zip_code_stats = trulia.stats.TruliaStats(TRULIA_KEY).get_zip_code_stats(zip_code=”90025”, start_date=”2014-01-01”, end_date=”2014-01-31”)## DocumentationTrulia’s API documentation can be found here:http://developer.trulia.com/docs
Package: truman
truman: dynamic complex-system simulations for one-shot optimal decision-making agentsWhat is it?trumanis a package that implements suites ofenvironments(system
simulations) exhibiting behaviours of real world large scale systems, e.g.
changes in online consumer cohort conversion as a function of changes in
product price.truman isnotan environment for training reinforcement learning agents, but
aims to be an effective way todevelop and validate one-shot optimal
decision-making agentsthat perform well on unique systems that can’t be
reliably simulated and that have a high cost of experimentation.Main FeaturesEnvironments that are compatible (built on) OpenAI'sGyminterfaceVarious suites of environments that exhibit common behaviours of real world
dynamic systemstruman.agent_registioninterface for managing agents and their
hyperparameterstruman.runinterface for running suites of agents on suites of environments
and storing performance summaries and full historiesInstallationTo get started, you'll need to have Python 3.7+ installed. Then:pip install trumanEditable install from sourceYou can also clone the truman Git repository directly. This is useful when
you're working on adding new environments or modifying truman itself. Clone and
install in editable mode using:git clone https://github.com/datavaluepeople/truman
cd truman
pip install -e .Background: Why truman?The base framework that environments are built upon is OpenAI’sGym.  Gym is a powerful framework for building
environments and developing reinforcement learning algorithms - but Gym's
environments are mostly directed towardstrainingagents on problems that can
be simulated exactly, e.g. playing an Atari game.  Our work atdatavaluepeopleis often developing
reinforcement learning algorithms for making a massive number of optimal
decisions simultaneously on high noise and changing environments, e.g. pricing
100,000s of travel products daily, or health intervention decisions for
1,000,000s of humans daily.  In such environments, agents should be able to
learn quickly and adapt to novel behaviours, since the price of testing
algorithms is very high.Thus the suites of environments in truman are directed towards the goal oflarge scale optimised decision making on complex systems, and only allow
agents a single episode to both learn and optimize on simultaneously.LicenseMIT
Package: trumpet
trumpetBuild a website with pyramidFree software: UNLICENSEDDocumentation:https://trumpet.readthedocs.io.NewsTrumpet is getting a bit closer to the original intended goal of
being a set of building blocks and tools to help build a pyramid
web application.  Management of static resources has moved
completely away from python.  Compass is still being used to
help manage the stylesheets.  Webpack is being used to handle the
javascript, as well as some css, fonts, etc. Currently, cookiecutter
is being used to test generating project skeletons, replacing the
previous scaffold.The general concept is to have support for creating web applications
with different hosting requirements.  A creative use of cookiecutter
templates may provide the ability to generate a pyramid site, a static
application/site, or even a tree of static assets that can be used in
many projects.Goals and Progressuser managementlogin/logoutadminister users via RESTreflective sqlalchemy code, db should provide minimum user/password tablesdb supportcommon sqlalchemy code for all databasescompleterequest object with attached sessionmakercompleted by upstream scaffoldsession managementobsolete?minimal use of cookiescompleted by using JSON Web Tokensuse access_token as parameter to all requests requiring authenticationpolicies for session managementnow token policiessessions per user (configure number of sessions a user can have)sessions per device (register devices to user?)session durationsession timeout/expirationview classesbasic view classes to be used by all viewscommon methodsWIPapp settings availablestill debating usefulness, JSONAPI may be betterbase user aware view classbase class for requests that need authbase cornice resourcebase static resourcebase page resourcethis is almost good enoughsend the html page that runs the appcompleteuse template to fill the head with links and meta infohandle permissions for access to appsend auth_token as query param?server side validationstill neededuse colander to build schemas for validation (or JSONSchema?)integrate with job servers for long running jobsOldRemnants of the old README can be found [here](https://github.com/umeboshi2/trumpet/blob/master/docs/misc.md).FeaturesTODOremember vobject and icalendar to make .vcf files, etc…CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.2.0 (2017-12-07)First release on PyPI.
Package: trumpet-client
InstallationSign up at trumpet.ai (https://stag.trumpet.ai)get API KEYcreate Team athttps://stag.trumpet.aicreate Workspace athttps://stag.trumpet.aicreate Project athttps://stag.trumpet.aiinstall python SDKpip install trumpetAiStartCreate experimentimporttrumpet_client# create experimentrun=trumpet_client.init(workspace_id={workspace_id},#optionalproject_id={project_id},#optionaluser_id={user_id},api_key={api_key},exp_name={exp_name}#optional)Upload with hyperparameterrun.set_hyperparam({"learning_rate":{learning_rate},"batch_size":{batch_size},"epochs":{epochs}})Upload with learning metric logforiinrange({epochs}):run.log({target_metric},i)LicenseCopyright (C) 2022- OKESTRO INC.This package can not be copied and/or distributed without the express permission of OKESTRO Inc.
Package: trumpetune
trumpetuneServe ML inference pipelines like tunning a TrumpetTehran Azadi Tower playing a Trumpet. Generated by midjourney generative AI.Installation:pipinstall--upgradetrumpetuneUsage:# Invoke trumpetunetrumpetune--help# orpython-mtrumpetune--help# Start prediction "loop" for recipe "echo"trumpetune--recipe./echo--modeloopserving your model with trumpetunecURL and Python inference examplestrumpetune monitoravailable on localhost:8080 (or --port)
Package: trumpia
Trumpia API==========================A simple Python wrapper for Trumpia's messaging API.Features--------* An object oriented interface for Trumpia's API* Will eventually support all of Trumpia's API callsInstallation-------------pip install trumpiaUsage-----```pythonfrom trumpia import TrumpiaAPIapi = TrumpiaAPI(your_username, your_api_key)campaign_lists = api.get_lists()for i, trumpia_list in enumerate(lists):list_details = api.get_list_details(trumpia_list)# Print the list details as a dictionaryprint(list_details.__dict__)```License-------See LICENSE for details.
Package: trumpy
TRUMPY: Tracing and Reverse Understanding Memory in PytorchAnalyze how much memory is used for calculating the backward propagation (excluding parameters and gradients). This function works by tracing the computation graph used for backward propagation.The fascinating thing is that it works in both GPU and CPU. Therefore, you canfirst run the code in CPU to estimate the memory usage, which will then be a decent estimation of memory consumption in GPU!Installpip install trumpyor clone this repository and build it yourself.UsageThe core function is just one-line:from trumpy import memory_for_backward; saved_memory = memory_for_backward(net, loss). You just pass the network and the calculated loss to this function, and it will give you how much memory (in bytes) is needed for backward propagation.Example usage is intests/test.py.importtorchfromtorchvision.models.resnetimportresnet50# define device and modelsdevice=torch.device('cpu')net=resnet50().to(device)input=torch.rand(16,3,224,224).to(device)# if gpu is available, record current memoryifdevice!=torch.device('cpu'):current_memory=torch.cuda.memory_allocated()# define loss functionloss=net(input).sum()# loss is the starting point of the backward computation graphfromtrumpyimportmemory_for_backward# calculate the memory used for backwardsaved_memory=memory_for_backward(net,loss)print(f'estimated memory usage for backward related tensors in{device}:{saved_memory/1024**3}GB')# check how much memory pytorch holdsifdevice!=torch.device('cpu'):importgcgc.collect()saved_memory=torch.cuda.memory_allocated()-current_memoryprint(f'ground-truth memory usage for backward related tensors in gpu:{saved_memory/1024**3}GB')You should see something like:estimated memory usage for backward related tensors in cpu: 1.2881765365600586 GBAfter turning on the GPU (settingdevice = torch.device('cuda:0')):estimated memory usage for backward related tensors in cuda:0: 1.2881765365600586 GB
ground-truth memory usage for backward related tensors in gpu: 1.28438138961792 GBYou see that the estimated memory usage inCPUis very similar with the actual memory usage inGPU!
Package: truncate-and-write-to-sql
A small package for truncating a table before writing to itInstallpipinstalltruncate-and-write-to-sqlExample usageimportpandasaspdfromsqlalchemyimportcreate_enginefromtruncat_and_write_to_sql.methodsimporttruncate_and_write_sql# Establish a connection to a SQL databaseconnection_string='a connection string to a database'engine=create_engine(connection_string)# Create a dataframe to write to the databasedata={'First Column Name':['First value','Second value'],'Second Column Name':['First value','Second value']}df=pd.DataFrame(data)# Truncate existing values and write in new onestruncate_and_write_sql(con=engine,df=df,table='name of database table',schema='database schema e.g. stg',if_exists='append',mulit=True)
Package: truncated-binary-encoding
Python package implementing truncated binary encoding.How do I install this package?As usual, just download it using pip:pipinstalltruncated_binary_encodingTests CoverageSince some software handling coverages sometime get slightly different results, here’s three of them:Usage examplesfromtruncated_binary_encodingimporttruncated_binary_encodingtruncated_binary_encoding(0,10)# 000truncated_binary_encoding(1,10)# 001truncated_binary_encoding(2,10)# 010truncated_binary_encoding(3,10)# 011truncated_binary_encoding(4,10)# 100truncated_binary_encoding(5,10)# 101truncated_binary_encoding(6,10)# 1100truncated_binary_encoding(7,10)# 1101truncated_binary_encoding(8,10)# 1110truncated_binary_encoding(9,10)# 1111
Package: truncjson
truncjsonA library to complete truncated JSON strings.InstallpipinstalltruncjsonUse CasesWhen you possess a JSON file that is truncated, and you wish to parse its current content.When you are receiving JSON content as a stream from services like ChatGPT. This allows you to parse the JSON content each time you receive a new chunk.Simple Usagefromtruncjsonimportcompleteresult=complete('{"k1":"v1","k2":20.5,"k3":[12')print(result)# Output: {"k1":"v1","k2":20.5,"k3":[12]}Stream UsageHere we created a dummy stream with a list of chunks.fromtruncjsonimportStreamchunks=['Here yo','u go {"k1":"v1","k2":2','0.5,"k3":[12,34,"56",tr','ue,{"k31":"v31","k32":false,"k33":n','ull}]}\nAnd ano','ther one {"k','ey":1.','12} {"a','b":"cd"}']stream=Stream()forchunkinchunks:print(stream.extract(chunk))# Output:# []# ['{"k1":"v1","k2":2}']# ['{"k1":"v1","k2":20.5,"k3":[12,34,"56",true]}']# ['{"k1":"v1","k2":20.5,"k3":[12,34,"56",true,{"k31":"v31","k32":false,"k33":null}]}']# ['{"k1":"v1","k2":20.5,"k3":[12,34,"56",true,{"k31":"v31","k32":false,"k33":null}]}']# ['{"k1":"v1","k2":20.5,"k3":[12,34,"56",true,{"k31":"v31","k32":false,"k33":null}]}', '{"k":null}']# ['{"k1":"v1","k2":20.5,"k3":[12,34,"56",true,{"k31":"v31","k32":false,"k33":null}]}', '{"key":1.0}']# ['{"k1":"v1","k2":20.5,"k3":[12,34,"56",true,{"k31":"v31","k32":false,"k33":null}]}', '{"key":1.12}', '{"a":null}']# ['{"k1":"v1","k2":20.5,"k3":[12,34,"56",true,{"k31":"v31","k32":false,"k33":null}]}', '{"key":1.12}', '{"ab":"cd"}']ChatGPT UsageimportopenaiimportjsonfromtruncjsonimportStreamopenai.api_key='###'chat=openai.ChatCompletion.create(model='gpt-3.5-turbo',messages=[{'role':'system','content':'You are a intelligent assistant.'},{'role':'user','content':'Return 3 different random JSON objects each has more than 500 characters.'},],stream=True)stream=Stream()forchunk_objinchat:chunk_content=chunk_obj['choices'][0]['delta'].get('content','')forobjinstream.extract(chunk_content):print(json.loads(obj))
Package: truncnorm
TruncNormArbitrary order moments for truncated multivariate normal distributions.IntroductionGivenX ~ N(m, C), a <= X <= bwith mean vectorm, covariance matrixC, lower limit vectoraand upper
limit vectorb,importtruncnormtruncnorm.moments(m,C,a,b,4)returns all the following moments of total order less or equal to 4 as a list:[
  P(a<=X<=b),           (scalar)
  E[X_i],               (N vector)
  E[X_i*X_j],           (NxN matrix)
  E[X_i*X_j*X_k],       (NxNxN array)
  E[X_i*X_j*X_k*X_l],   (NxNxNxN array)
]for alli,j,kandl. Note that the first element in the list is a bit
of a special case. That's becauseE[1]is trivially1so giving the
normalisation constant instead is much more useful.TODODouble truncationNumerical stability could probably be increased by using logarithic scale in
critical places of the algorithmSampling (see Gessner et al below)Folded distributionOptimize recurrent integrals by using vector and index-mapping representation
instead of arrays. Using arrays makes computations efficient and simple, but
same elements are computed multiple times because of symmetry in the moments.References"On Moments of Folded and Truncated Multivariate Normal Distributions" by
Raymond Kan & Cesare Robotti, 2016"Integrals over Gaussians under Linear Domain Constraints" by Alexandra Gessner
& Oindrila Kanjilal & Philipp Hennig, 2020
Package: trundlerpy
trundlerpyThis is a Python package for the Trundler API.InstallationInstall from PyPIInstall from PyPI.pip3installtrundlerpyInstall from GitHubInstall from GitHub.pip3installgit+https://github.com/datawookie/trundlerpyTestingTo run the test suite:Set theTRUNDLER_KEYenvironment variable.Launch the tests withpytestDocumentationTo build the documentation:make-Cdocs/htmlSet the API KeyTo access the full API you’ll need to first specify an API key.
To obtain a key, pleaseget in touch.Storing your keys received from APIs and other sensitive information in a
secure file or as an environment variable is considered best practice to avoid
any potential malicious activity.importoskey=os.getenv('TRUNDLER_KEY')UsagefromtrundlerpyimportTrundlertr=Trundler(key=key)RetailersUseretailer()to get a list of retailers.tr.retailer()You can access the details for a specific retailer.tr.retailer(45)ProductsGet a list of products for a specific retailer.tr.retailer_products(5)Products can be filtered by name and brand or SKU.tr.retailer_products(5,product="coffee",brand="nespresso")tr.retailer_products(5,sku="7630047615160")A similar search can be applied across all retailers.tr.products(product="coffee")tr.products(sku="7630047615160")Get information on a specific product, filtering it by ID.tr.product(530290)Get price history data for a specific product.tr.product_prices(530290)DocumentationTrundlerPy Documentation
Package: trunk
InstallingTo install :pip install trunkUsageTrunk tries to be as simple as possiblet = Trunk("postgres://localhost/noclue")
for channel, payload in t.notifications("clues"):
    print channel, payload
t.notify("clues", "chandelier")
t.unlisten("clues")CeleryTrunk provides aKombutransport,
that allows you to use trunk withCelery,
to do so, configure Celery with :BROKER_URL = 'trunk.transport.Transport://localhost/database'SetupYou will need to create a new table and add two functions to your database.
Seetable.sqlandddl.sql.
Package: trunner
trunnerrunner 运行job python封装使用pip install trunner>=1.0.3tbasetrain:python3 -m trunner.tbase --alg ddpg --codes 000001.SZ --seed 0eval:python3 -m trunner.tbase --eval --alg ddpg --codes 000001.SZ --seed 0infer:python3 -m trunner.tbase --infer --alg ddpg --codes 000001.SZ --seed 0详细参数:tbase args
Package: trunofficial
Unofficial API to the Truecaller phone number search.Installationpip install trunofficialor if you like to live on the bleeding edge:python setup.py installCommand-line Usageusage: trunofficial [-h] [-c COUNTRYCODE] [NUMBER [NUMBER ...]]

Unofficial API to the Truecaller phone number search.

positional arguments:
  NUMBER                phone numbers to lookup on Truecaller

optional arguments:
  -h, --help            show this help message and exit
  -c COUNTRYCODE, --countrycode COUNTRYCODE
                        prioritize search by countryExample:$ trunofficial 2024561111Library Usageimport trunofficial

owner = trunofficial.search('2024561111')
print(owner.name)

mobile = owner.phone
print(mobile.number)
print(mobile.countrycode)
print(mobile.carrier)

house = owner.address
print(house.city)
print(house.timezone)For more examples, check theexamples directoryor read
the fullDocumentation.Running Testspython -m pytest testDisclaimerThis method of accessing Truecaller’s database may stop working any
moment. Use it at your own risk.LicenseThe MIT License
Package: trunserver
ContentsOverviewInstallOverviewThis package is a simple replacement for the built-in Django runserver command
that uses the far more polished and multiple process capable Twisted Web
server. It currently handles the same autoreload-after-save provided by the
built-in Django runserver command.InstallThe installation is relatively simple:pip install trunserver

or

easy_install trunserverOnce installed, simply add “trunserv” to your INSTALLED_APPS and use
“trunserver” wherever you would normally use “runserver”. You can pass
“–noreload” to trunserver as a parameter to stop the autoreload behavior.
Package: trusat
trusat-orbitConvert satellite observations to orbit predictionsThis repo supports the analyses ofIOD/RDE/UK positional formatting formatsand generation of TLEs atTruSat.org.TruSat is a citizen-powered open-source tool for space sustainability, crowdsourcing satellite observations to form an independent record of objects orbiting Earth.VisitTruSat.orgto see the live appView thedocsto learn more about the projectJoin theDiscordto follow the development discussionCurrently, this orbit propagation code is based on a Python port ofScott Campbell's C++ satfit code base. After initial prototyping, it is an aim of this repo to include OREKit and related tools for more advanced processing of orbit-related calculations.Getting started with TruSat-orbitFirst, we recommend setting up apython virtual environmentWe're still working on a clean environment setup following conversion of the project to a pip-installable packages.
A quick start looks something like:pip3 install git+https://github.com/TruSat/trusat-backend@dev.chris.package#egg=trusat_backend-1.1.0
pip3 install trusat
python -m trusat.satfitContentsiod.py- Utilities for importing, validating, and operating on IOD/RDE/UK positional formatting formatstle_util.py- Utilities to import, export, validate and operate on Two-Line Element setssatfit.py- Suite of utilities based on and extendingScott Campbell's C++ satfit code basefor reading visual observations and updating TLEssatid.py- Search TLE catalog for possible match to an UNIDentified satellite TLEelfind.py- Generate a provisional TLE from 2-3 IOD recordsTests - Unit tests for the abovetests_iod.pytests_satfit.pytests_TLE.pytests_profile.pyRun with python -m unittest discover tests/DependenciesUses Brandon Rhodespython-sgp4with C++ accelerations(Currently) requires Cython for the c-accelerated analyses module(Currently) assumes a connection to a database, see [this PR] (https://github.com/TruSat/trusat-backend/pull/111) for setting up your own local copy(Currently) requires pullingtrusat-backendinto the same parent directory as trusat-orbitCoding StyleFollowPEP 8for any Python code and the style guide recommended for any other language.Additionally seeBest of the Best PracticesMaintaining RepoStyle GuideWith the addition of commits to the master branch are done through PRs (Pull Request).Releasing VersionsCheckout masterpull from reporun the unittestscreate a tag with the new version number, starting with a 'v'. eg:git tag v0.1.1 -m "Version 0.1.1Version Numbering5. push changes to githubgit push --follow-tags7. check verification tools