Saravanan666/pypi-org huggingface dataset:
Package: titulus
TitulusText visualization python packagefromtitulusimportcolor,print_test="Nous sommes le 12/24/2018 aujourd'hui. Mon numéro de tel est le (301)227-1340"tokens=test.split()weights=np.random.randint(low=0,high=10,size=len(tokens))print_(' '.join(color(tokens,weights,n=10)))fromsklearn.datasetsimportfetch_20newsgroupsfromsklearn.feature_extraction.textimportTfidfVectorizerfromsklearn.linear_modelimportSGDClassifierfromsklearn.pipelineimportPipelinecategories=['alt.atheism','talk.religion.misc']newsgroups_train=fetch_20newsgroups(subset='train',categories=categories)newsgroups_test=fetch_20newsgroups(subset='test',categories=categories)X_train,X_test=newsgroups_train.data,newsgroups_test.datay_train,y_test=newsgroups_train.target,newsgroups_test.targetidx=np.random.randint(len(X_vec_list))tokens=tokenizer(X_train[idx])token_idx=[voc.index(t)iftinvocelse-1fortintokens]weights=[X_vec_arr[idx,:][i]ifi>0else0foriintoken_idx]print_(' '.join(color(tokens,weights,start_hex="#FEFEFE",finish_hex="#00a4e4",n=20)))text_clf=Pipeline([('vect',vectorizer),('clf',SGDClassifier(loss='hinge',penalty='l2',tol=0.2,alpha=1e-3,max_iter=15,random_state=42)),])_=text_clf.fit(X_train,y_train)X_vec=vectorizer.transform(X_train)X_vec_arr=X_vec.toarray()X_vec_list=[list(x)forxinX_vec_arr]voc=vectorizer.get_feature_names()idx=np.random.randint(len(X_vec_list))tokens=tokenizer(X_train[idx])token_idx=[voc.index(t)iftinvocelse-1fortintokens]weights_=np.multiply(X_vec_arr[idx,:],text_clf.named_steps['clf'].coef_[0,:])weights=[weights_[i]ifi>0else0foriintoken_idx]print_(' '.join(color(tokens,weights,start_hex="#34BF49",finish_hex="#BE0027",middle_hex="#FEFEFE",n=20)))
Package: titus2
Project Documentation -LinkData Scientist: Why is my cutting edge model still not in production?Scenario 1:IT Team: We are still implementing the scoring engine in Go/Java/C++.Scenario 2:IT Team: We are still figuring out how to read the model.pkl file you provided.. .and the push to production pang continues ..New Features!titus2home page and documentation has been migrated tohttps://realworldpython.github.io.Changes in titus2 v1.2.1View the complete changeloghere.Titus 2 - Portable Format for Analytics (PFA) implementation for Python 3.4-3.9Titus 2 is a fork of the original Titus python library which resides in the (now defunct)Hadrian repository. Titus is not actively maintained by the Open Data Group and only supports Python 2, so this fork was created to actively support its development for Python 3.Titus 2 is a complete, independent implementation ofPortable Format for Analytics (PFA)in pure Python. PFA is a specification for scoring/inference engines: event-based processors that perform predictive or analytic calculations. It is a model interchange format which helps smoothen the transition from statistical model development to large-scale and/or online production.titus2also focuses on model development, so it includes model producers and PFA manipulation tools in addition to runtime execution (scoring) engine.RequirementsTitus 2 uses a number of open source projects to work properly:avro-python3 >= 1.8.2numpy == 1.14.0(python 3.4 & 3.5) ornumpy >=1.15.0, <1.20(python 3.6+)pytz >= 2019.1pyyaml >= 5.1.2ply >= 3.11The above packages are available viapipand are automatically installed during setup.InstallationTitus requiresPython 3.4+to run.
It can be installed via pip/pip3 as follows:$pipinstalltitus2or you can directly install the latest build from github repository via$pipinstallgit+https://github.com/animator/titus2.gitAfter installation please run the following elementary example in pythonfromtitus.genpyimportPFAEnginepfa={"input":"double","output":"double","action":[{"+":["input",100]}]}engine,=PFAEngine.fromJson(pfa)l=[1.0,2.0,3.0,4.0,5.0]fornuminl:print(num,engine.action(num))User Guide and TutorialsSee theProject Documentationfor user guide and tutorials.Current Testing FrameworkTo run the tests, you can executepython3 setup.py testTo generate the coverage report, you can executepip3 install coverage
coverage run setup.py test
coverage reportTesting Status:Unit testing status availablehereConformance testing status availablehereIssues, Questions and Feature RequestsPlease raise an issue/question/requesthere.DevelopmentWant to contribute? Great!Please raise anissueto discuss your ideas and send apull request.TodosWrite MORE Tests forscripts/*.Addscikit-learnmodel export to PFA tutorials.
Package: titus-optimize
Virtual EnvironmentSetup a virtual environment before executing any build/test/release
opearations.$virtualenv--python=python3.6venv...Installingsetuptools,pip,wheel...done.$.venv/bin/activateTestWe use tox to run tests. After setting up a virtual environment,
requirements and tox must be installed.(venv)$pip3install-rrequirements.txt(venv)$pip3installtox(venv)$tox...py36:commandssucceededlinters:commandssucceededcongratulations:)Build a development packageTo build a package for development purposes, do the following.(venv)$python3setup.pysdistbdist_wheelrunningsdistrunningegg_info...adding'titus_optimize-0.0.14+hlocal.g34f75d0.dirty.dist-info/METADATA'adding'titus_optimize-0.0.14+hlocal.g34f75d0.dirty.dist-info/WHEEL'adding'titus_optimize-0.0.14+hlocal.g34f75d0.dirty.dist-info/top_level.txt'adding'titus_optimize-0.0.14+hlocal.g34f75d0.dirty.dist-info/RECORD'removingbuild/bdist.macosx-10.9-x86_64/wheelThe packages will be in the generateddistdirectory(venv)$lsdisttitus_optimize-0.0.14+hlocal.g34f75d0.dirty-py3-none-any.whltitus_optimize-0.0.14+hlocal.g34f75d0.dirty.tar.gzReleaseCheckout themasterbranch$gitcheckoutmaster$gitpullUpdate theVERSIONvariabled insetup.py$gitdiffHEAD~1setup.pydiff--gita/setup.pyb/setup.pyindexf1a9f38..3078372100755---a/setup.py+++b/setup.py@@-5,7+5,7@@fromsetuptoolsimportsetupfromsetuptools.command.installimportinstall-VERSION="0.1.4"+VERSION="0.1.5"defreadme():"""print long description"""Commit that change$gitaddsetup.py$gitcommit-m"Release 0.1.5"Tag the commit with the same version insetup.py$gittag0.1.5Push the commit tomaster$gitpushoriginmasterPush the tags tomaster$gitpush--tagsThis will kick off a CI job which will publish topypi.
Package: tiupy
tiupyA Python module for interacting with the TIU (Tishk International University) website, offering features like login, profile information retrieval, and course data access.InstallationYou can install tiupy using pip:pip install tiupyAlternatively, clone the repository and install it manually:git clone https://github.com/heromr/tiupy.git
cd tiupy
python setup.py installGetting StartedTo get started with the Tiu Python Module, follow these steps:1. Import the modulefrom tiupy import Tiu2. Create an instance of Tiutiu = Tiu()You can customize the initialization by providing optional parameters like proxies and request timeout.MethodsThe Tiu module provides the following methods for interaction:`login(username: str, password: str)`Login to the TIU website.await tiu.login(username='your_username', password='your_password')`sid_login(SID: str)`Login using a session ID (SID).await tiu.sid_login(SID='your_session_id')`logout()`Log out from the TIU website.await tiu.logout()`get_courses_data()`Fetch course data from the TIU website.courses_data = await tiu.get_courses_data()LicenseThis module is open-source and available under the MIT License. See theLICENSEfile for more details.
Package: tiv
[![Build Status](https://travis-ci.org/nul-one/tiv.png)](https://travis-ci.org/nul-one/tiv)
[![PyPI version](https://badge.fury.io/py/tiv.svg)](https://badge.fury.io/py/tiv)
[![License](https://img.shields.io/badge/License-BSD%203–Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![Requirements Status](https://requires.io/github/nul-one/tiv/requirements.svg?branch=master)](https://requires.io/github/nul-one/tiv/requirements/?branch=master)Print images (jpg, png, gif) in terminal.Installation### install from pypi (recommend)pip3 install tiv### install from git (latest master)pip3 install -U git+https://gitlab.com/nul.one/tiv.gitUsagetiv [OPTIONS] IMAGE [IMAGE [IMAGE…]]### Options-w, –width INTEGER- Set image width in number of terminal characters. Default is 69.-a, –aspect-ratio FLOAT- Specify character aspect ratio (width:hight). Default is 0.5.
Package: tivendor
tivendorUsagefrom tivendor import TiVendor

config =  {
    'TIADMIN_HOST': os.getenv('TIADMIN_HOST', 'http://tiadmin.kong:8000'),
    'KAFKA_HOST': os.getenv('KAFKA_HOST', 'kafka-kafka.kafka:9092'),
    'KAFKA_TOPIC': os.getenv('KAFKA_TOPIC', 'supplier-request'),
    'KAFKA_ENABLE': os.getenv('KAFKA_ENABLE', 'on'),
    'DEFAULT_SERVICE_NAME': os.getenv('DEFAULT_SERVICE_NAME', 'default_service_name'),
    'LOGGER_NAME': os.getenv('LOGGER_NAME', 'main'),
    'REDIS_HOST': os.getenv('REDIS_HOST', 'supplier-redis'),
    'REDIS_PORT': os.getenv('REDIS_PORT', 6379),
    'REDIS_DB': os.getenv('REDIS_DB', 0),
    'REDIS_PASSWORD': os.getenv('REDIS_PASSWORD', None),
    'SM4_SECRET': os.getenv('SM4_SECRET', ''),  # 可以通过调用 api 获取
}
vendor = TiVendor(config)

r = vendor.request('bqsblmatch-test', service_name='bqsblmatch', ti_request_headers={}, json={'name': 'Johnny',})
print(r.json())
Package: tivix-django-braintree
InstallationInstall django_braintree (ideally in your virtualenv!) using pip or simply getting a copy of the code and putting it in a directory in your codebase.pip installtivix-django-braintreeAdddjango_braintreeto your Django settingsINSTALLED_APPS:INSTALLED_APPS = [
    # ...
    "django_braintree",
]Add these lines in settings.py file:BRAINTREE_MERCHANT = 'your_merchant_key'
BRAINTREE_PUBLIC_KEY = 'your_public_key'
BRAINTREE_PRIVATE_KEY = 'your_private_key'

from braintree import Configuration, Environment

Configuration.configure(
    Environment.Sandbox,
    BRAINTREE_MERCHANT,
    BRAINTREE_PUBLIC_KEY,
    BRAINTREE_PRIVATE_KEY
)Add url to urls.py:url(r'', include('django_braintree.urls')),If you’re using South for schema migrations runpython manage.py migrate django_braintreeor simply do asyncdb.Additional InformationBraintree uses default templates:django_braintree/payments_billing.html
django_braintree/fragments/cc_form.html
django_braintree/fragments/current_cc_info.html
django_braintree/fragments/pay.html
django_braintree/fragments/payments_billing.htmlBraintree requires including the js fromdjango_commonthat enables ajax forms etc.django_commonis available athttps://github.com/Tivix/django-commonIf a template variablecc_form_post_urlis passed to the template then this form posts to it, otherwise it posts to the urlpayments_billing.If a template variablecc_form_success_redirect_urlis passed it takes user to that url then after form post has succeeded.Braintree is set up to sandbox mode at default. To change this you must switchEnvironment.SandboxtoEnvironment.Productionin settings file.Revision Historyv0.1.2 Changed urls.py to be compatible with Django 1.4+v0.1.3 Changed urls.py to be compatible with Django 1.5+This opensource app is brought to you by Tivix, Inc. (http://tivix.com/)
Package: tiwarilog
to install logover use
pip install logover
once you install the package goto logover package and cut config.json file and put it into your folders main directory and change the "END_POINT" to wherever you want to dump your data and change "END_POINT_TO_SIMULATE_DB" to endpoint from where you will fetch includes and levels.
config.json
{
"buffer_size":"5",
"timer":"10",
"END_POINT":"https://httpdump.io/bpmpg",
"END_POINT_TO_SIMULATE_DB":"http://127.0.0.1:9000/",
"time_to_refresh_cofg_file" : "30"
}in place of "END_POINT" put your own end point where you want to dumb the data. in include array you need to pass the route which you allow to log. If you put "*" it means you want to allow all the route. Do same configuration for levels.
once you done with config file just put the code below to the end of all your route so that it will process all your route. (REMEMBER:- put this at the end of all your route. )
@app.before_request
def start_timer():
print('before every request')
g.start = time.time()@app.after_request
def fun(response):
myRouteLog.log_request(response)
return responsenow in the last step :-
if you want to use logger for specific task like INFO,ERROR,WARNING use like :-
logover.info('your message')
logover.error('your message')
logover.warn('your message')by default buffersize is 5 and time out is 30sec, if you want to change it just change in config.json file and restart the server.
Package: tixent
Tixent: A Text Splitting ToolPyPICI/CDBuild SystemCodeDocstringsInstallationpip install tixentExampleSuppose we have a function template that generates a string from a list of texts.
Additionally, suppose we have a large list of texts.
When you apply that list of texts to the function, it generates a long string.Tixent can split the string generated by the template function so that the return value ofcounterfor each element is less than a certain number.Here,counteris a function that maps a string to an integer.
Examples of such functions arelen, which measures the length of a string, ortiktoken_counter("text-davinci-003"), which measures the number of tokens in a stringfromtypingimportListfromtixentimportsplit,tiktoken_counterdefsummarization_template(texts:List[str])->str:text=" ".join(texts)t="Summarize the following text.\n"t+=f'Text: """{text}"""'returnttexts=["Lorem ipsum dolor sit amet","consectetur adipiscing elit","sed do eiusmod tempor incididunt ut labore et dolore magna aliqua","Ut enim ad minim veniam","quis nostrud exercitation ullamco laboris nisi","ut aliquip ex ea commodo consequat","Duis aute irure dolor in reprehenderit in voluptate velit","esse cillum dolore eu fugiat nulla pariatur","Excepteur sint occaecat cupidatat non proident","sunt in culpa qui officia deserunt mollit anim id est laborum",]counter=tiktoken_counter("text-davinci-003")max_count=60split_texts=split(texts,summarization_template,counter,max_count)fortextinsplit_texts:count=counter(text)assertcount<=max_countprint(f"count:{count}")print(text)print()count: 60Summarize the following text.Text: """Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Ut enim ad minim veniam"""count: 58Summarize the following text.Text: """quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat Duis aute irure dolor in reprehenderit in voluptate velit"""count: 43Summarize the following text.Text: """esse cillum dolore eu fugiat nulla pariatur Excepteur sint occaecat cupidatat non proident"""count: 31Summarize the following text.Text: """sunt in culpa qui officia deserunt mollit anim id est laborum"""
Package: tixte.py
importasyncioimporttixteasyncdefmain():client=tixte.Client('your-master-token','your-domain')file=tixte.File('this_image.png')asyncwithclient:upload=awaitclient.upload(file)# Upload fileprint(f'Uploaded file{upload.url}-{upload.filename}')asyncio.run(main())InstallingRecommended Python 3.8.0 or higherTo install the library you can do the following# Linux / MacOS
python -m pip install tixte.py

# Windows
py -m pip install tixte.pyInstalling Master Branchpython-mpipinstallgit+https://github.com/NextChai/tixte.pyObtaining Your Master TokenA master token is a token given by Tixte to allow applications
to access and make requests to the API. It can be obtained by:Going to theTixte dashboardPressingControl + Shift + Ito open the developer consoleEntering the following command:localStorage.getItem("sessionToken")The response outputted into the console is your master token.DocumentationDocumentation is availablehere.Please note the layout and style for the documentation and all
of the source that goes along with it is directly fromRapptz/discord.py.All credit for the source of the documentation goes to Rapptz and his group is contributors. In my experience with sphinx,
there is nothing close to how well put together this style of documentation is, it's a pleasure to work with it.
Package: tizero
IntroductionReinforcement learning agent for Google Research Football.Code accompanying the paper
"TiZero: Mastering Multi-Agent Football with Curriculum Learning and Self-Play" (AAMAS 2023). [paper] [videos].InstallationFollow the instructions ingfootballto set up the environment.pip install gfootball openrl "openrl[selfplay]"pip install tizero(or clone this repo andpip install -e .).test the installation bypython3 -m gfootball.play_game --action_set=full.Evaluate JiDi submissions locallyYou can evaluate your agent locally using tizero:tizeroeval--left_agentsubmission_dir1--right_agentsubmission_dir2--total_game10For example, you can evaluate tizero with random agent as below:tizeroeval--left_agentsubmission/tizero--right_agentsubmission/random_agent--total_game10For evaluations for JiDi submissions on other games, please refer to theArenaof OpenRL
and thisexamplefor the snake game.Show a saved dump fileshow detailed infomation of a match via:tizero show dump_fileshow keypoints of a mactch via:tizero keypoint dump_fileYou can download an example dump file fromhere.Then execute:tizero show daily_6484285.dumportizero keypoint daily_6484285.dump. Then you will see a GUI as below:Convert dump file to videoAfter the installation, you can use tizero to convert a dump file to a video file.
The usage istizero dump2video <dump_file> <output_dir> --episode_length <the length> --render_type <2d/3d>.You can download an example dump file fromhere.
And then executetizero dump2video daily_6484285.dump ./in your terminal. By default, the episode length is 3000 and the render type is 2d.
Wait a minute, you will get a video file nameddaily_6484285.aviin your current directory.Submit TiZero to JIDI(及第评测平台)JIDI is a public evaluation platform for RL agents. You can submit your agent of GRF at:http://www.jidiai.cn/env_detail?envid=34.We provide several agents under./submission/directory,  which can be submitted to JIDI directly:./submission/tizero: the final model of TiZero for JIDI submission, which ranked 1st on October 28th, 2022../submission/random_agent: the random agent for JIDI submission.CitePlease cite our paper if you use our codes or our weights in your own work:@article{lin2023tizero,
  title={TiZero: Mastering Multi-Agent Football with Curriculum Learning and Self-Play},
  author={Lin, Fanqi and Huang, Shiyu and Pearce, Tim and Chen, Wenze and Tu, Wei-Wei},
  journal={arXiv preprint arXiv:2302.07515},
  year={2023}
}
Package: tjax
This repository implements a variety of tools for the differential programming libraryJAX.Major componentsTjax’s major components are:Adataclassdecoratordataclassthat facilitates defining structured JAX objects (so-called “pytrees”), which benefits from:the ability to mark fields as static (not available inchex.dataclass), anda display method that produces formatted text according to the tree structure.Afixed_pointfinding library heavily based onfax.  Our
librarysupports stochastic iterated functions, anduses dataclasses instead of closures to avoid leaking JAX tracers.Ashimfor the gradient transformation libraryoptaxthat supports:easy differentiation and vectorization of “gradient transformation” (learning rule) parameters,gradient transformation objects that can be passeddynamicallyto jitted functions, andgeneric type annotations.A pretty printerprint_genericfor aggregate and vector types, including dataclasses.  (Seedisplay.)  It features:a version for printing traced valuestapped_print_generic,decoding size of the batched axes when printing ordinary and traced values,colorized tree output for aggregate structures, andformatted tabular output for arrays (or statistics when there’s no room for tabular output).Minor componentsTjax also includes:Versions ofcustom_vjpandcustom_jvpthat support being used on methods:custom_vjp_methodandcustom_vjp_method(Seeshims.)Tools for working with cotangents.  (Seecotangent_tools.)JAX tree registration forNetworkXgraph types.  (Seegraph.)Leaky integrationleaky_integrateand Ornstein-Uhlenbeck process iterationdiffused_leaky_integrate.  (Seeleaky_integral.)An improved version ofjax.tree_util.Partial.  (Seepartial.)A testing functionassert_tree_allclosethat automatically produces testing code.  And, a related
functiontree_allclose.  (Seetesting.)Basic tools likedivide_where.  (Seetools.)Contribution guidelinesConventions: PEP8.How to run tests:pytest.How to clean the source:ruff.pyrightmypyisort.pylinttjaxtests
Package: tjc-gym
tjc-gymTraffic Juntion Continuous (tjc) is a continuous version of the environment Traffic Junction defined inLearning Multiagent Communication
with Backpropagation. The environment is based on OpenAI Gym and has an continouos observation and action space where the original is discrete.InstallationThrough PyPi:pipinstalltjc-gymOr directly by cloning repo:gitclonehttps://github.com/jakobdybdahl/tjc-gym.gitcdtjc-gym
pipinstall-e.Usageimportgymenv=gym.make('tjc_gym:TrafficJunctionContinuous6-v0')done=[False]*env.n_agentsscore=0obs=env.reset()whilenotall(done):env.render()actions=[acsp.sample()forascpinenv.action_space]obs_,rewards,done,info=env.step(actions)score+=sum(rewards)ReferenceIf you want to site our work, please see the citation file in the repo for details. Through GitHub it is possible to 'Cite this repository' and get a BibTeX reference - it can be found in the 'About' section of this repo.AcknowledgementThis environment was developed byRasmusThorsenandjakobdybdahlto complement our master thesis at @Aarhus University.
Package: tjcloud
TJCloudThis is my personal cloud - for hobby programming, personal projects,
and experiments.Key TechnologiesI’m leaning on the following core technologies:Terraform(andTerraform
CloudorGithub
Actions) for provisioning
infrastructure as codeKubernetesfor orchestrating various
workloadsNGINX Ingressfor
exposing web services to the web from the clusterDigitalOceanas my
main Kubernetes provider, while using block storage container storage
interface for persistent storage.Cloudflarefor DNS, TLS, and origin
server protection.Cloudflare
Accessfor
zero-trust accessGitHub Packagesas my main
image registry.Previous TechnologiesThese are tech that I’ve retired from my personal cloud:Linode, due to an ominous acquisition by Akamai
and a price increase despite no feature parity withDigitalOceanto which I have moved.Linode Kubernetes
Engine, a simple,
developer-friendly, and inexpensive cloud provider for managed
Kubernetes, andLinode Object
Storagefor
storing data filesSelf-hosted stack for user management and authentication of itnernal
services, replaced byCloudflare
AccessKeycloakfor identity and access
managementOAuth2 Proxyas main
gateway to protect private servicesSelf-hosted stack for image building, replaced byGitHub
ActionsKanikofor
building images inside a Kubernetes clusterApplicationsI host the following applications:my personal coding and writing environment fromcode-serverthat allows me to
develop on the cloud, with any device (including iPads and
chromebooks!). Some additional mods features are:Protected domains (https://<port>.<domain>) to test web apps
running on the server or for exposing environments like Jupyter or
PlutoCustom web fonts through an NGINX sub_filterPython, Julia, JS, and R installations for the confused data personDisabled ApplicationsThe code is still in the repo, but is no longer in active use:PGAdmin, an excellent open source
administration console for PostgreSQLMastodon- my own personal Mastodon server
for interacting with the Fediverse (open source Twitter but less
annoying virality and more useful, insightful content)FreshRSS- feed reading service, I read usingReederon iOS and Mac.Kill the Newsletter-
A self-hosted, secure version ofKill the
Newsletterfor managing newsletters
and feeding them into FreshRSS.PostgreSQLfor my main databaseClickhouseas a requirement for Plausible
Analytics, storing clickstream dataRedisas a requirement for Mastodon, but also for
general caching in the development serverPlausible Analyticsfor hosting
privacy-friendly website analyticstheKubernetes Dashboardfor administering the cluster, andmetrics-serverfor collecting data to present in the dashboard.