Saravanan666/pypi-org huggingface dataset:
Package: tokens-retriever
This package contains only a class with only one__init__which retrieves the requested environment variables.fromtokensimportTokens# as it all the that the package providesFor instance, we've to get some authorization tokens that already defined in the environment to interact with the Discord API and the Telegram API.tokens=Tokens(["discord","telegram"])The class "Tokens" on initialization will retrieve as attributes these tokens from the environment as "PACKAGE_DISCORD_TOKEN" and "PACKAGE_TELEGRAM_TOKEN" or just "DISCORD_TOKEN" and "TELEGRAM_TOKEN" if the__name__is undefined.bot.run(tokens.discord)The attribute "discord" should contain a string of the token if it has been in the environment, as the same as for "telegram".
Package: tokenterminal
Token TerminalUnofficialToken Terminal APIclient in pythonFor more information, seeToken Terminal API DocumentationInstallation:use pip to install:pip install tokenterminalAuthentication:Pass API key in object initialization.Example usage:from tokenterminal import TokenTerminal

# object initialization
token_terminal = TokenTerminal(key='xxxxx-xxxx-xxxx-xxxx-xxxxxxxx')

# Fetch all data for projects' 
projects_data = token_terminal.get_all_projects()

for project_info in projects_data:
    print(project_info)

# Fetch project's historical metrics

project_metrics = token_terminal.get_historical_metrics('0x')
for metrics in project_metrics:
    print(metrics)
Package: tokentrim
TokenTrimTokenTrim intelligently trims OpenAImessagesto fit within a model's token limit (shortening a message by removing characters from the middle), making it easy to avoid exceeding the maximum token count.It's best suited for use directly in OpenAI API calls:importtokentrimasttmodel="gpt-4"response=openai.ChatCompletion.create(model=model,messages=tt.trim(messages,model)# Trims old messages to fit under model's max token count)TokenTrim's behavior is based on OpenAI's ownbest practices.InstallationUse the package manager pip to install TokenTrim:pipinstalltokentrimUsageThe primary function in the TokenTrim library istrim(). This function receives a list of messages and a model name, and it returns a trimmed list of messages that should be within the model's token limit.importtokentrimastt# Force a system_message to be prepended to your messages list. This will not be trimmed.system_message="You are a helpful assistant."response=openai.ChatCompletion.create(model=model,messages=tt.trim(messages,model,system_message=system_message))Parametersmessages: A list of message objects to be trimmed. Each message is a dictionary with 'role' and 'content'.model: The OpenAI model being used (e.g., 'gpt-4', 'gpt-4-32k'). This determines the token limit.system_message(optional): A system message to preserve at the start of the conversation.trim_ratio(optional): Target ratio of tokens to use after trimming. Default is 0.75, meaning it will trim messages so they use about 75% of the model's token limit.return_response_tokens(optional): If set to True, the function also returns the number of tokens left available for the response after trimming.Return ValueBy default,trim()returns the trimmed list of messages. Ifreturn_response_tokensis set to True, it returns a tuple where the first element is the trimmed list of messages, and the second element is the number of tokens left available for the response.LicenseThis project is licensed under the terms of the MIT license.
Package: token-utils
token-utilsThis project consists of a single module which is extracted from theideaspackage.
Its purpose is to simplify manipulations of tokens from
Python'stokenize module.
One of its features is that, unlike Python's version, the following
is always guaranteed:fromtoken_utilsimporttokenize,untokenizesource="Arbitrary Python code here"assertsource==untokenize(tokenize(source))Seeideas documentationfor more information
Package: tokenvault
TokenVaultTokenVault is a lightweight package to manage users and validate them using tokens in your application in a single
encrypted file and asymmetric token encryption.It was designed to manage users within a file in a repository such that if the file is compromised, the tokens and
metadata are still safe.InstallationpipinstalltokenvaultQuickstartfromtokenvaultimportTokenVaultvault=TokenVault()# you give this token to the user for authenticationtoken=vault.add("alon@gmail.com",metadata={"name":"Alon Sababa","Country":"Israel"})vault.validate(token){'name':'Alon Sababa','Country':'Israel'}assertvault.validate('not a token in the vault')isNonevault.save("vault.db")TokenVault("vault.db").validate(token){'name':'Alon Sababa','Country':'Israel'}Encrypt the vaultFor added security, by adding a password to the vault, the file itself get encrypted and therefore the list of keys
too.You can provide the password manually or it is automatically picked-up from the environment
variableTOKENVAULT_PASSWORDif it exists.You can share the environment variable with your team members and server secrets so that they decrypt the file
automatically.importosfromtokenvaultimportTokenVaultvault=TokenVault()token=vault.add("alon@gmail.com",metadata={"name":"Alon Sababa","Country":"Israel"})password=vault.generate_key()vault.save("vault.db",password=password)TokenVault("vault.db",password=password).validate(token)# using the environment variableos.environ['TOKENVAULT_PASSWORD']=passwordTokenVault("vault.db").validate(token){'name':'Alon Sababa','Country':'Israel'}CLIAn easy way to manage users manually is to use the CLI.Default vault file isvault.dbin the current directory.When a password or token is generated, it is copied to the clipboard. You can add a flag to print it to the screen
too.tv --help

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  add        Add a new key to the vault and copy the token to the clipboard
  encrypted  Check if the vault is encrypted
  init       Initialize a vault file in 'path' argument.
  list       List existing keys in the vault
  remove     Add a new key to the vault and copy the token to the clipboard
  validate   Add a new key to the vault and copy the token to the clipboardQuickstart without password:$tvinitvault.db--no-password# this copy the token to the clipboard$tvaddalon@gmail.comvault.db--metadata='{"some":"information"}'$tvlistvault.db
alon
$tvvalidate<token>{'some':'information'}$tvremovealon@gmail.comvault.dbQuickstart with password:$tvinitvault.db--echo-password# this copy the password to the clipboardpassword:G99********
Vaultcreatedatvault.dbandencryptedwithpassword

$exportTOKENVAULT_PASSWORD=G99********
$tvaddalon@gmail.comvault.db# this copy the token to the clipboard$tvvalidate<token>{}# no metadata provided
Package: tokenVerif
jwt verification codeFree software: MIT licenseInstallationpip install tokenVerifYou can also install the in-development version with:pip install https://github.com/samsonic/tokenVerif/archive/master.zipDocumentationhttps://tokenVerif.readthedocs.io/DevelopmentTo run the all tests run:toxNote, to combine the coverage data from all the tox environments run:Windowsset PYTEST_ADDOPTS=--cov-append
toxOtherPYTEST_ADDOPTS=--cov-append toxChangelog0.0.1 (2020-06-06)First release on PyPI.
Package: tokesim
TokesimTokesimA Tokeneconomics Simulator.View Demo·
    
    ·Table of ContentsAbout The ProjectGetting StartedPrerequisitesInstallationUsageRun SimulationStart explorerConfigurationsContributingResourcesAbout The ProjectTokesimis an Agent Based Modeling tool that makes it easy to test token economic models. It's built usingmesa-behaviorsan extension toMesaABM framework bring more type hints and patterns to make models,agents,utility functions and strategies shareable and more extensible.  The goal of Tokesim is to help developers run simulations against Smart Contracts, in a block chain agnostic way, using shreable and reusable modules and libraries to do so.Tokesim Features:Typehints to make agents and models extensibleAbility to run against and simulation against your smart contractsAn architecture to make the simulations portable to multiple chainsChartJS integration from Mesa frameworkSupport for testing Ethereum based smart contracts directlyGetting StartedPrerequisitesnodev10.15.3or laternpmv6.4.1or laterpython3.7or later but not 3.8 ;)InstallationClone/ download the project, and install dependencies. For developmentgitclonehttps://github.com/tokesim/tokesim.git&&cdtokesimpython3.7-mvenvvenvsourcevenv/bin/activate
pipinstallpoetry
poetrybuild
npminstall-g@tokesim/tokesim-chain# in a new terminal windowtokesim-chain--port5554orpipinstalltokesim
npminstall-g@tokesim/tokesim-chain# in a new terminal windowtokesim-chain--port3004UsageRun simulationIn order to run a simulation against a chain the default init will create a simulation for you to modify as you see fit. You'll need to start the chain simulation service.# remember to activate your venvsourcevenv/bin/activate
pipinstalltokesim# just like create react app generate templatetokesiminit--dirsimple-token--agents20#start chain simulatortokesim-chain-cethereum--port3004#run the simulation defaults to terminating after 100 stepstokesimrun--config./simple-token/simulation.json--port3004Simulation App LayoutBy default tokesim init will generate a default application layout, that specifies the accounts used a balance for each of the agents as well as configuration file and some simple bonded token curve agents. The contracts specified are a listedhere# ./simple-token/.
└──simple-token└──contracts||──SimpleToken.bin|└──SimpleToken_abi.json|──accounts.json|──config_schema.json|──simple_token_agent.py|──simple_token_model.py|──simple_token_config.py└──simulation.jsonConfigurationsExplanation coming soonRoadmapComing soonContributingHow to contribute, build and release are outlined inCONTRIBUTING.md,BUILDING.mdandRELEASING.mdrespectively. Commits in this repository follow theCONVENTIONAL_COMMITS.mdspecification.LicenseApache License 2.0ResourcesMesamesa-behaviorstokesim-chainOpenRPC
Package: tokima
TokimaTools for my own use. using Akamai APITo use Akamai API you need some formatted date 'from' and 'to' as '2015-01-31' inList Products per Contractor inList Usage per Contracttokima = TokimaDate(year="2018", month="6")

tokima.month -> 6
tokima.year ->  2018
tokima.year_month -> "2018-06"
tokima.first_day() ->  "2018-06-01"
tokima.last_day() ->  "2018-06-30"
tokima.day_numbers -> 30
Package: tokio
async-tokio is a drop-in replacement of the built-in asyncio event loop. async-tokio is implemented in rust and uses tokio-rs under the hood andPyO3 python binding.Using tokio loopYou can create an instance of the loop manually, using:importtokiopolicy=tokio.EventLoopPolicy()asyncio.set_event_loop_policy(policy)Development of tokio loopTo build tokio loop, you’ll need rustnightlyand Python 3.6.  The best way
is to create a virtual env, so that you’ll havepythoncommands pointing to the correct tools.git clone git@github.com:PyO3/tokio.gitcd tokiomake buildmake testStatusAt the moment async-tokio works on unix like systems only.
Supported api:time api (call_at, call_later)sockets api (sock_xxx methods)tcp (client/server)unix domain socketdnspipessubprocesssignalsexecutorsUDP support is missing.Licenseasync-tokiois offered under the Apache 2.0 licenses.CHANGES0.2.0 (07-23-2017)Use pyo3 python bindingPyO3python binding.Implement more asyncio APIs0.1.0Initial release
Package: tokko-auth-lite
Installationpip3installtokko_auth_lite
sudo-Hpip3installtokko_auth_liteUsagefromtokko_auth_lite.coreimportTokenfromtokko_auth_lite.tools.testingimportTokenFabrik_jwt=TokenFabrik(permission=["companies:read_branches","spacex:launch_rockets"])token=Token.from_header({"Authorization":f"Bearer{_jwt}"})print(token)print(token.is_valid())print(token.permissions)print(token.has_permission("companies:read_branches","spacex:launch_rockets"))print(token.has_permission("spacex:launch_rockets"))print(token.has_permission("companies:read_branches","spacex:launch_rockets",require_all=True))print(token.user_id)TutorialsTokenFabrikQuiero un JWTUso avanzado
Package: tokko-es-query-factory
Installpip install tokko-es-query-factoryUsefrom tokko_es_query_factory import filters
from tokko_es_query_factory.query_factory import QueryFactory


class FilterFactory(QueryFactory):
    """" Filter Factory! """
    CONFIG = {
        "address": filters.ContainsTextFilter,
        "age": filters.RangeIntFilter
        }Filter typesComplexFilterAvailabilityFilterMultipleFilterOperationFilterNetworkFilterLocationFilterMultipleIntFilterMultipleMatchMultipleNoMatchPositiveIntFilterBooleanFilterStrFilterContainsTextFilterRangeIntFilterRangeFloatFilterChoiceIntFilterStatusFilterDispositionFilterCurrencyFilterPropertyConditionFilterPropertySituationFilter
Package: tokko-locations-client
Installpipinstalltokko-locations-clientBasic usagefromtokko_locations_client.coreimportLocationsAPIClient# You can also declare AuthToken and HomeURL using environment variables:# + AuthToken: TOKKO_AUTH_TOKEN# + HomeURL: LOCATIONS_API_HOMEapi=LocationsAPIClient(home_url="http://www.tokkobroker.com",auth_token="your-tokko-user-auth-token")# List All countriesprint(api.countries())# Get Country by <int: CountryID>print(api.country(1))# Argentina#  Get State by <int: StateID>print(api.state(146))# Capital Federal# Get Location by <int: LocationsID>print(api.location(24673))# Almagro# Searching for location Almagro by keywordprint(api.location_quick_search("Almagro"))
Package: tokopedia
tokopediaPython SDK for Tokopedia Seller API. This SDK allows you to integrate your system into TokopediaFeatured APIWebhooks API: Register webhook to get notification through your system.Product API: Create and manage products with/without variant.Order API: Get order info and manage all incoming orders.Logistic API: Manage your Third-party logistics service.Shop API: View and Update Shop Information.Category API: Get all product category information.Interaction API: Get all messages, replies, and send a reply.Statistic API: Get the statistics of your transactions and buyers.
Package: toktokkie
toktokkiemasterdevelopThe toktokkie media manager consists of a collection of command-line tools used
for keeping track of media.Currently, the following media types are supported:BookBook SeriesMovieTV SeriesMangaVisual NovelsStructureThe metadata for a Media directory is stored inside the.metasubdirectory in a file calledinfo.json. Additionally, folder icons may
be stored in.meta/icons. Depending on the metadata type, additional
special folder may exist.Generating and modifying metadataTo generate metadata for a media directory, runtoktokkie metadata-gen <media_type> <directories...>Metadata can be modified using a text editor or thetoktokkie metadata-addutility.Further InformationChangelogLicense (GPLv3)GitlabGithubProgstatsPyPi
Package: tokviz
tokvizFile Structuretokviz/
├── assets/
│   ├── example-deberta-v3-small.png
│   └── example-gpt2.png
├── tokviz/
│   ├── __init__.py
│   └── visualization.py
├── README.md
├── LICENSE
├── setup.py
└── pyproject.tomltokvizis a Python library for visualizing tokenization patterns across different language models. This library offers a comprehensive platform for researchers, data scientists, and NLP enthusiasts to gain insights into how different language models process and tokenize text.Key Features:Model Comparison:The visualizer allows users to compare tokenization patterns across multiple language models, including popular models like GPT-2, DistilGPT-2, and DeBERTa-v3-small. By displaying color-coded tokens side by side, users can easily identify differences and similarities in tokenization behavior.Flexible Input:Users can input any text of their choice, allowing for dynamic exploration of tokenization patterns across diverse textual inputs. Whether analyzing short sentences, paragraphs, or entire documents, the visualizer adapts to the user's input for comprehensive analysis.Color-Coded Visualization:Tokens are color-coded based on their properties and index, providing a visually intuitive representation of tokenization patterns. This enables users to quickly identify individual tokens and patterns within the text, facilitating deeper analysis and interpretation.InstallationYou can install tokviz via pip:pipinstalltokvizUsagefromtokvizimporttoken_visualizer# Define input texttext="In this example, the get_color function would need to be adjusted based on the specific properties of your model's tokenizer.\You might want to inspect the special tokens, check if a token is part of a special group,\or use any other relevant information provided by the tokenizer.\Keep in mind that the color logic may vary depending on the model,\so you need to tailor it to your specific use case."# Compare tokenization across different language modelstoken_visualizer(text,models=['microsoft/deberta-v3-small','openai-community/gpt2'])This will visualize tokenization patterns for the input text using the specified language models. You can pass a list of model names or identifiers to the models parameter. By default, it compares tokenization with the GPT-2 model.ReferencesThis library is based on the notebookLLM Tokenizer Visualizer
Package: tokyo.py
tokyo.pyPython library for interacting with Tokyo API (https://api.miduwu.ga/)Installationpip install tokyo.pyUsageimporttokyoimportasynciofromtokyo.propertiesimportApiapi=Api()print(api.endpoints)asyncdefmain():json=awaittokyo.Json.get(endpoint=...,builders={...})bytes=awaittokyo.Buffer.get(endpoint=...,builders={...})anime=awaittokyo.Anime.get(endpoint=...,builders=[...])print(json,bytes,anime)# Parameter "endpoint" is the request endpoint string.# Parameter "builders" is the request parameters/route. {} for parameters, [] for route.# await tokyo.Json.get(endpoint = '8ball', builders = {'text': 'Hi'})# await tokyo.Anime.get(endpoint = 'gifs', builders = ['angry'])asyncio.run(main())
Package: tokyo-python
tokyo-python is a set of Python interfaces to `Mikio Hirabayashi<http://fallabs.com/>`_'s Tokyo libraries, it includes:- :mod:`tokyo.cabinet`, an interface to `Tokyo Cabinet <http://fallabs.com/tokyocabinet/>`_- :mod:`tokyo.dbm`, a :mod:`dbm` compatible interface to :mod:`tokyo.cabinet`- :mod:`tokyo.tyrant`, an interface to `Tokyo Tyrant <http://fallabs.com/tokyotyrant/>`_- :mod:`tokyo.dystopia`, an interface to `Tokyo Dystopia <http://fallabs.com/tokyodystopia/>`_Useful links:- `Latest release <http://pypi.python.org/pypi/tokyo-python/>`_- `Documentation <http://packages.python.org/tokyo-python/>`_- `Mailing list <http://groups.google.com/group/tokyo-python>`_- `Bug reports and feature requests <http://code.google.com/p/tokyo-python/issues/list>`_`tokyo-python's source code <http://tokyo-python.googlecode.com/>`_ is currentlyhosted by `Google code <http://code.google.com/>`_ and kept in a `Subversion<http://subversion.apache.org/>`_ repository.- `Subversion instructions <http://code.google.com/p/tokyo-python/source/checkout>`_- `Subversion browser <http://code.google.com/p/tokyo-python/source/browse/>`_
Package: tola-payments
Tola Payments Python PackageA python package to easy push payment integration with Tola Payments with Mpesa, TigoPesa, and AirtelMoney Tanzania. You can easily charge a customer's phone number with a specified amount, and the package will handle the necessary details to make the payment using the Tola Mobile API. No need to integrate each MNO individualy.InstallationUse the package managerpipto install Tola Payments package.Installation To install the Tola Payments package, run the following command:pipinstalltola_paymentsConfigurationTo use the package, you need to set up your Tola Mobile API credentials in a .env file. Add the following variables to your .env file: To use the Tola Payments package, you first need to import it into your Python code. Here's an example:TOLA_USERNAME = "my_username"
TOLA_PASSWORD = "my_password"
VODA_TARGET = "my_voda_target"
TIGO_TARGET = "my_tigo_target"
AIRTEL_TARGET = "my_airtel_target"
TOLA_LIVE_URL = "my_tola_live_url"Next, create an instance of the TolaPayments class, providing your Tola Mobile API credentials:fromtolapymentsimportTolaPaymentstolapayments=TolaPayments(is_sandbox=True)Note that the is_sandbox parameter specifies whether you're using the Tola Mobile sandbox environment or the live environment. If you're using the sandbox environment, set is_sandbox to True. Otherwise, set it to False and provide the live API URL via the TOLA_LIVE_URL environment variable.To charge a customer, call the charge_customer method on your TolaPayments instance, passing in the customer's phone number, the amount to charge, and a source referenceresponse=tolapayments.charge_costomer(amount="1000",phone_number="+25561189850",sourcereference='4546f56543poF66')print(response.text)LicenseMIT
Package: tol-colors
Tol_colorsColor schemes for lines and maps, color-blind safeThoses color schemes were designed by Paul Tol. This repository is only packaging his work so that it can be easily installed using pip.
His work and details on how to use thoses schemes can be found on hiswebsiteand in thedocsdirectory.InstallUsing pip:pipinstalltol-colorsFrom source:gitclonehttps://github.com/Descanonge/tol_colors.gitcdtol_colors
pipinstall.Get startedShow the available colorsets, colormaps, and discrete rainbow colormap:importtol_colorsastctc.main()Get a colorset:cset=tc.tol_cset('bright')Get a colormap:cmap=tc.tol_cmap('sunset')See the functions docstrings for details.To change default colorset (for lines) and colormap:importmatplotlib.pyplotaspltplt.rc('axes',prop_cycle=plt.cycler('color',list(tc.tol_cset('bright'))))plt.cm.register_cmap('rainbow_PuRd',tc.tol_cmap('rainbow_PuRd'))plt.rc('image',cmap='rainbow_PuRd')RequirementsnumpymatplotlibSee alsoOther packages already implement these colorschemes and might better suit your needs:color_tolpyplot-themes
Package: toleranceinterval
AbouttoleranceintervalA small Python library for one-sided tolerance bounds and two-sided tolerance intervals.MethodsCheckout thedocumentation. This is what has been implemented so far:twosidenormalnormal_factorlognormalonesidenormallognormalnon_parametrichanson_koopmanshanson_koopmans_cmhRequirements"numpy >= 1.14.0""scipy >= 0.19.0""sympy >= 1.4""setuptools >= 38.6.0"Installationpython -m pip install toleranceintervalor clone  and install from sourcegit clone https://github.com/cjekel/tolerance_interval_py
python -m pip install ./tolerance_interval_pyExamplesThe syntax follows(x, p, g), wherexis the random sample,pis the percentile, andgis the confidence level. Herexcan be a single set of random samples, or sets of random samples of the same size.Estimate the 10th percentile to 95% confidence, of a random samplexusing the Hanson and Koopmans 1964 method.importnumpyasnpimporttoleranceintervalastix=np.random.random(100)bound=ti.oneside.hanson_koopmans(x,0.1,0.95)print(bound)Estimate the central 90th percentile to 95% confidence, of a random samplexassumingxfollows a Normal distribution.importnumpyasnpimporttoleranceintervalastix=np.random.random(100)bound=ti.twoside.normal(x,0.9,0.95)print('Lower bound:',bound[:,0])print('Upper bound:',bound[:,1])All methods will allow you to specify sets of samples as 2-D numpy arrays. The caveat here is that each set must be the same size. This example estimates the 95th percentile to 90% confidence using the non-parametric method. Herexwill be 7 random sample sets, where each set is of 500 random samples.importnumpyasnpimporttoleranceintervalastix=np.random.random((7,500))bound=ti.oneside.non_parametric(x,0.95,0.9)# here bound will print for each set of n=500 samplesprint('Bounds:',bound)ChangelogChanges will be stored inCHANGELOG.md.ContributingAll contributions are welcome! Please let me know if you have any questions, or run into any issues.LicenseMIT License
Package: tolerant-isinstance
isinstance - more tolerant# Tested with:# Python 3.9.13# Windows 10Thisfunctionchecks:isinstance(__object,modul)type(__object).__module__==getattr(modul,"__name__")str(type(__object))==str(type(modul))p=pd.NAisinstance(p,pd.NA)# Exceptionisinstance_tolerant(p,pd.NA)# no Exceptionp=Noneisinstance(p,None)# Exceptionisinstance_tolerant(p,None)# no Exception