Saravanan666/pypi-org huggingface dataset:
Package: throat
Throathttps://phuks.co/A phoxy link and discussion aggregator with snek (python3)Dependencies:A database server, MySQL, MariaDB and Postres have been tested. Sqlite should work for messing locallyRedisPython >= 3.7A recent node/npmlibmagic and gobjectSetup:We recommend using a virtualenv or PyenvInstall Python dependencies withpip install -r requirements.txtInstall Node dependencies withnpm installBuild the bundles withnpm run buildCopyexample.config.ymltoconfig.ymland edit itSet up the database by executing./scripts/migrate.pyAnd you're done! You can run a test server by executing./throat.py. For production instances we recommend setting upgunicornDevelop on DockerIf you prefer to develop on dockerThe provided Docker resources only support PostgresYou still must copyexample.config.yamltoconfig.yamland make any changes you wantIn addition, configs are overridden by environment variables set in docker-compose.yml
which reference the redis and postgres services created by docker-compose.make upwill bring the containerized site up and mount your current working directory
inside the container for dev. It also runs the migrations on start-up.make downwill spin down the containerized services.To add an admin user to a running docker-compose application:docker exec throat_throat_1 python3 scripts/admins.py --add {{username}}If Wheezy templates are not automatically reloading in docker between changes, trydocker restart throat_throat_1.Docker DeploymentsGunicornCMD [ "gunicorn", \
      "-w", "4", \
      "-k", "geventwebsocket.gunicorn.workers.GeventWebSocketWorker", \
      "-b", "0.0.0.0:5000", \
      "throat:app" ]Authenticating with a Keycloak serverOptionally, user authentication can be done using a Keycloak server.
You will need to create a realm for the users on the server, as well
as Keycloak clients with appropriate permissions.  Seedoc/keycloak.orgfor instructions.TestsPython testsPython, redis, libmagic and gobject are required, but node and postgres are not.Install dependencies withpip install -r requirements.txtInstall the test dependencies withpip install -r requirements-test.txtRun the tests withpython -m pytestThe tests are not affected by your configuration inconfig.yaml.
If you wish to run the tests against production database or
authentication servers (instead of the defaults, which are sqlite and
local authentication), you may put configuration settings intest_config.yamland run the tests withTEST_CONFIG=test_config.yaml python -m pytestChatIf you have any questions, you can reach us on #throat:phuks.co onMatrixYou can manage default subs by using$ ./scripts/defaults.pyTo add/remove administrators use$ ./scripts/admins.py
Package: throne
throne-cliRead the full docs here!What is throne?throneis an open-source command line tool developed by a network engineer for network engineers. thrones purpose is to help make looking up
internet related information easier on the person doing it.Ever needed to look up who owns an IP? Need to check a BGP looking glass to see if your prefix is getting advertised? What about getting abuse contacts?
I've needed to do that and I've always had to go to multiple sites to get all of the information. throne fixes that. throne leverages APIs from
multiple different sources and presents the information you're looking for in one easy to use place in a readable format.FeaturesGathers RIR information on a specified AS#Gets RIR information on IP prefixes or IP addresses (v4 & v6)BGP looking glass queriesIP Geolocation queriesPeeringDB queries (Only providing organization by ASN & IX information currently)APIs LeveragedARIN RDAPRIPEstatPeeringDBip-apiShodanIANA RDAPthrone API
Package: throne-trader
ThroneTraderA collection of algorithms to analyze, categorize and predict stocks.These algorithms are used to assess stocks, and make predictions about future stock prices.The collection of algorithms leverage data analysis, machine learning, and statistical methods to achieve its objectives in the context of financial markets and investments.Installationpython-mpipinstallthrone-traderUsagePredict future stock prices using machine learningfromthronetraderimportPredictionspredictions=Predictions(symbol="AAPL")print(predictions.linear_regression_prediction())print(predictions.gradient_boosting_prediction())Generate buy/sell/hold signals based on real-time datafromthronetraderimportRealTimeSignalsrealtime_signals=RealTimeSignals(symbol="AAPL")print(realtime_signals.get_financial_signals())print(realtime_signals.get_insider_signals())series1,series2=realtime_signals.get_trading_volume()print(series1.name)print(series1.to_dict())print(series2.name)print(series2.to_dict())Generate buy/sell/hold signals based on strategic algorithmsfromthronetraderimportStrategicSignalsstrategic_signals=StrategicSignals(symbol="AAPL")print(strategic_signals.get_bollinger_bands_signals())print(strategic_signals.get_breakout_signals())print(strategic_signals.get_crossover_signals())print(strategic_signals.get_macd_signals())print(strategic_signals.get_rsi_signals()):bulb: While individual algorithms may lack optimal accuracy, the aggregation of multiple algorithms proves valuable and effective in enhancing overall prediction accuracy.:warning: Please note that stock prediction is inherently challenging, and the accuracy of any prediction model will depend on the quality and relevance of the data used, the choice of algorithms, and the changing dynamics of the stock market. Continuous evaluation and improvement of the model are essential to enhance its predictive capabilities.ComponentsPredict stock price using deep learning modelsAnalyze stock price using machine learning modelsGenerate buy/sell/hold signals using real time dataGenerate buy/sell/hold signals using financial strategiesSample NotebooksLong Short-Term MemoryGradient BoostingLinear RegressionDisclaimerRemember to thoroughly backtest and paper trade any strategy before using real funds, and always exercise caution and risk management when trading stocks.Whythrone-trader?This name draws inspiration from the "Game of Thrones" series, where various characters vie for the Iron Throne,
symbolizing power, wealth, and influence."ThroneTrader" signifies the algorithm's quest for dominance in the financial markets, much like the characters in the
show strive to sit upon the Iron Throne.Coding StandardsDocstring format:GoogleStyling conventions:PEP 8Clean code with pre-commit hooks:flake8andisortRelease NotesRequirementpython-mpipinstallgitverseUsagegitverse-releasereverse-frelease_notes.rst-t'Release Notes'LintingPreCommitwill ensure linting, and the doc creation are run on every commit.Requirementpipinstallsphinx==5.1.1pre-commitrecommonmarkpytestUsagepre-commitrun--all-filesPypi PackageRunbookLicense & copyright© Vignesh RaoLicensed under theMIT License
Package: throttle
pip3installthrottleSimple Usageimporttimeimportthrottle# limit to 3 calls# allow more every 1 second@throttle.wrap(1,3)defaesthetic(*values):return' '.join(values).upper()forindexinrange(10):result=aesthetic('beautiful')success=notresultisthrottle.failprint(index,success)time.sleep(0.23)Complex Usageimporttimeimportrandomimportthrottle# allow more every 1 seconddelay=1# limit to 3 callslimit=3# only check values less than 5 against the limitkey=lambdavalue:value<5# or Static()valve=throttle.Valve()# make some quick callsforindexinrange(30):item=random.randrange(0,8)allow=valve.check(delay,limit,item,key=key)print(item,allow)time.sleep(0.23)LinksDocumentation
Package: throttle-controller
throttle-controllerMotivationThis package provides a simple throttle controller for general use-cases.
For example, you can use this package to throttle API requests to avoid rate-limiting.Usagefromthrottle_controllerimportSimpleThrottleControllerthrottle=SimpleThrottleController.create(default_cooldown_time=3.0)throttle.wait_if_needed("http://example.com/path/to/api")throttle.record_use_time_as_now("http://example.com/path/to/api")...# requeststhrottle.wait_if_needed("http://example.com/path/to/api")# wait 3.0 secondsthrottle.record_use_time_as_now("http://example.com/path/to/api")withstatementfromthrottle_controllerimportSimpleThrottleControllerthrottle=SimpleThrottleController.create(default_cooldown_time=3.0)for_inrange(10):withthrottle.use("http://example.com/path/to/api"):# wait if cooldown neededrequests.get("http://example.com/path/to/api")CautionCurrently this package supports only to use in single thread / single process use-cases.LICENSEThe 3-Clause BSD License. See also LICENSE file.
Package: throttle-memcache
throttle========The throttle library provides a robust and versatile throttling mechanism for Python.It can be used in multiple environments, from a single thread to a distributedserver cluster.It supports Python versions 2.6 to 3.3.Usage-----In order to perform throttling tasks, simply use the :meth:`~throttle.throttle`function:.. code-block:: pythonimport throttledef some_fun(uid):if not throttle.check(key=uid, rate=30, size=10):raise ThrottleError()# Do the jobAlgorithm---------throttle uses the "token bucket" algorithm: for each key, a virtual bucketexists.Whenever a new request gets in, the algorithm performs the following actions:- Test if adding the request's cost to the bucket would exceed its capacity;in that case, return False- Otherwise, add the request's cost to the bucket, and return TrueSimultaneously, the bucket's current value is decremented at the chosen rate.This allows for temporary bursts and average computations.Installing----------From pip (https://pypi.python.org/pypi/throttle):.. code-block:: sh$ pip install throttleFrom Github:.. code-block:: sh$ git clone git://github.com/rbarrois/throttle.git
Package: throttling
Throttling system for Django views.Basic UsageAdd to settingsINSTALLED_APPS = (
    ...
    'throttling',
)and in your viewsfrom throttling.decorators import throttle

@throttle(1000)
def view(request):
    return HttpResponse('success')Featureslimit to a maximum number of requests for each view or for a group of viewseach anonymous usereach user (anonymous or authenticated)each authenticated user with a certain user roleeach authenticated user that bellongs to a grouplimit to a shared maximum number of requests for each view or for a group of viewsall anonymous usersall users (anonymous or authenticated)all authenticated users that bellong to a group
Package: throw-catch
RabbitMQ throw & catch messagesInstallTo install run:pip install throw-catchAdd the following line at the top of your *.py file:fromthrow_catchimportthrow,catchNow you can send messages to RabbitMQ queueamq.direct.throw_catch(by default):importosAMQP_URI=os.getenv("AMQP_URI")payload={"hello":"world"}throw(payload=payload,uri=AMQP_URI)throw(payload=payload,uri=AMQP_URI,routing_key="some_routing_key")# custom routing key (direct)for_inrange(10):throw(payload=payload,tag="some_tag",uri=AMQP_URI,routing_key="some_routing_key")# custom tag && custom routing keyCatch messages from RabbitMQ:importosAMQP_URI=os.getenv("AMQP_URI")catch(uri=AMQP_URI)# {"hello": "world"}catch(uri=AMQP_URI,queue="some_routing_key")# catch 10 messages from `some_routing_key` queue (direct)catch(tag="some_tag",uri=AMQP_URI,queue="some_routing_key",count=10)# catch 10 messages from `some_routing_key` queue (direct) with tag `some_tag`Testtox
Package: throwcolour
ThrowColourThrowColour is a small Python module to make printing messages with formatting and colours easier! This module is mostly just practice with creating a working pip module for learning purposes.FeaturesSupports different types of print messages with colour codingSupport basic formatting (bold, italics)Supports timestamp printingUsageGetting itTo download throwcolour, either fork this Github repo or simply use Pypi via pip.$pipinstallthrowcolourUsing itA few functional examples of how to use ThrowColour.Basic FunctionalityA basic example of how to use thecthrowfunction.fromthrowcolourimportcthrowcthrow('Test 1,2')This would print the messageDATETIME - [INFO] Test 1,2in a nice looking purple withDATETIMEreplaced with the current timestamp.ThecthrowfunctionThe fullcthrowfunction is as follows:cthrow(message,type='INFO',formatting=None,addPrefix=True,dateTime=True)Setting thetypeargumentAs you can see, a flag can be specified. This specifies the colour of the message and the message type. When setting flags, ensure the strings match exactly the name of the flag detailed below.INFO - A nice aesthetic purple messageOK - A satisfying green messageWARN - A cautionary yellow messageERR - A not-so-good red messageFor example:cthrow("This probably isn't good",type="WARN")TheaddPrefixanddateTimeargumentsWe can also disable the prefix (the stuff inside the []) and timestamp as follows.cthrow("Look Mom, no prefix and timestamp!",addPrefix=False,dateTime=False)Setting formatting flagsWith ThrowColour it is also possible to set multiple formatting flags such as bold and italics. It is important to note that the argumentformattingtakes a list containing strings of different formatting options.cthrow("Bold and Underlined",formatting=['BOLD','UNDERLINE'])Or just bolded,cthrow("Nice and bold",formatting=['BOLD'])
Package: throwie
A small CLI tool aimed to simplify EC2 tags managementThrowie - creates or updates tags on a filtered collection of EC2 instances. In a nutshell it:Filters instances based on specified criteriaRemoves existing tags from filtered collection (if required)Creates new tags on filtered collection of EC2 instancesUsageusage: throwie [-h] -f FILTER_TYPE -i INVENTORY [INVENTORY ...] -t TAGS

Throwie - create/update tags on a collection of EC2 instances.

optional arguments:
  -h, --help            show this help message and exit
  -f FILTER_TYPE, --filter_type FILTER_TYPE EC2 filter type, see EC2.Client.describe_instances for valid filter values
  -i INVENTORY [INVENTORY ...], --inventory INVENTORY [INVENTORY ...] EC2 filter values, space separated, could be private ip addresses or instance-id depending on filter type
  -t TAGS, --tags TAGS  EC2 tags in json formatInstallation$ pip install throwieExampleTag EC2 instances by specified private ip addresses:throwie -i 192.168.244.192 192.168.247.118 -f private-ip-address --tags '{"api-version": "v1.0.1"}'Tag EC2 instances by specified instance ids:throwie -i i-cex0d811 i-561s6370 -f instance-id --tags '{"api-version": "v1.0.1"}'
Package: throws
Python: throwsSmall but simple library providing a function decorator similar to Kotlins@throws(...)decorator with the small difference that multiple exceptions or errors can be combined in just one
single annotation. Should maily used for documentation and debugging purposes.InstallationInstallation is possible using the Pythonpipcommand line tool. For you the command to install
this library may look like this:pip3installthrowsUsageTo use the@throwdecorator simply place it before the function declaration providing every
possible exception raised by the function. For a quick example see below:fromthrowsimportthrows@throws(IOError,ValueError)defcheck_version(version_file:str)->bool:withopen(version_file,"r",encoding="utf-8")asvf:if(float(vf.read()>1.0):returntruereturnfalseThe library provides two Exceptions by itself, theEmptyListExceptionand theInvalidRaisedException. The first one is raised when there are no parameters provided to@throwand the function decorated is run. The second one occours when the function raises an
exception which is not provided to the decorator, providing the developer with feedback that he
might have forgotten about handling this specific exception!Uploading a new versionTo create and upload a new version to PyPI use the following commands:# 1) Check for correctnesspython3setup.pycheck# 2) Create distributable filespython3setup.pysdistbdist_wheel# 3) Check distributable filespython3-mtwinecheckdist/*# 4) Upload distributable filespython3-mtwineuploaddist/*LinksLibrary at the Python Package Index (PyPI):https://pypi.org/project/throws/
Package: thru
UsageAt the command prompt, usepypeto act on each item in the file with python commands:$ printf 'abc' | pype str.upper

ABCChain python functions together with!:$ printf 'Hello'  | pype 'str.upper ! len'

5Use?as a placeholder for the input at each stage:$ printf 'Hello World'  | pype 'str.split ! ?[0].upper() + "!"'

HELLO!

$ printf 'Hello World'  | pype 'str.split ! ?[0].upper() + "!" ! ?.replace("H", "J")'

JELLO!Given a server responding tohttp://localhost:8080/and a list of urls inurls.txt:http://localhost:8080/Requester_254
http://localhost:8080/Requester_083
http://localhost:8080/Requester_128
http://localhost:8080/Requester_064
http://localhost:8080/Requester_276Automatically import required modules and use their functions:$ pype 'str.strip ! requests.get ! ?.text ' < urls.txt

Hello, Requester_254. You are client number 7903 for this server.
Hello, Requester_083. You are client number 7904 for this server.
Hello, Requester_128. You are client number 7905 for this server.
Hello, Requester_064. You are client number 7906 for this server.
Hello, Requester_276. You are client number 7907 for this server.Usemapto act on each input item (mapis the default command). Useapplyto act on the sequence of items. Finding the largest number returned from the server:$ pype --newlines=no map 'str.strip ! requests.get ! ?.text ! ?.split()[6] ! int' apply 'max'  < urls.txt

7933Making sequential requests is slow. Use--asyncto make I/O really fast (see caveats below).$ time pype 'str.strip ! requests.get ! ?.text'  < urls.txt

Hello, Requester_254. You are client number 8061 for this server.
Hello, Requester_083. You are client number 8062 for this server.
Hello, Requester_128. You are client number 8063 for this server.
Hello, Requester_064. You are client number 8064 for this server.
Hello, Requester_276. You are client number 8065 for this server.

real  0m10.640s
user  0m0.548s
sys   0m0.022sMaking concurrent requests is much faster:$ time pype --async 'str.strip ! treq.get ! treq.text_content'  < urls.txt

Hello, Requester_254. You are client number 8025 for this server.
Hello, Requester_083. You are client number 8025 for this server.
Hello, Requester_128. You are client number 8025 for this server.
Hello, Requester_064. You are client number 8025 for this server.
Hello, Requester_276. You are client number 8025 for this server.

real 0m2.626s
user 0m0.574s
sys  0m0.044sInstallationTBDCaveatspypeassumestrusted command argumentsanduntrusted input stream data. It usesevalon your arguments, not on the input stream data. If you useexec,eval,subprocess, or similar commands, you can execute arbitrary code from the input stream.--asynccurrently works only withmap, notapplyand works only for a singlemappipe-string, e.g.map 'str.upper ! len ! ? & 1', not for chains, e.g.map str.upper map len map '? & 1'.StatusCheck the issues page for open ticketsThis package is experimental pre-alpha and is subject to change.
Package: thruflo.webapp
DEVELOPMENT ON THIS PACKAGES HAS MOVED TOweblayer.thruflo.webappis a WSGI compatible web application framework.  It has no test coverage and is no doubt flawed.  But it has the advantage of being setup just the way I want it:re.compilebased url mappingclass instances handling requests with methods that correspond to the HTTP Request’s method, e.g.:def post(self)handles aPOSTrequestawebob.Requestas self.requestreturn fooas the method of responding, wherefoocan be a string, awebob.Response, or alistordictto be returned as JSONmako templateswith builtin methods includingstatic_url,xsrf_form_htmlandescape, as well as references tohandlerandrequestOr to put it another way:from thruflo.webapp import web

class Hello(web.RequestHandler):
    def get(self):
        return 'hello world'



mapping = [('/.*', Hello)]
application = web.WSGIApplication(mapping)Seethruflo.webapp.demofor a slightly fleshed out example usage.
Package: thrush
# thrushAlternative OO wrapper for rrdtool.## InstallationTo install thrush from the sources:python setup.py install## DocumentationSee documentation included in source or look at the
online copy of the documentation under [http://docs.0xdeadbeef.ch/thrush/](http://docs.0xdeadbeef.ch/thrush/).## Licensethrush is licensed under the BSD License. See LICENSE for more information.
Package: thruster
ThrusterHTTP/2 Server that just worksThis is my attempt at writing a fully functional HTTP 2.0 Server in Python. Its a work in progress right now.
The server supports the ASGI 1.0 specification. Has no dependency on the hyper/h2 (except hpack) and twisted packages.
The HTTP/2 stack is being implemented completely from scratch.
Depends onbitstringfor handling binary data for the HTTP/2 protocol implementation.HTTP/2 (Current Status)Implementation of most HTTP/2 frames is done. Implemenation of rest of the frames will be done as use cases arise.All frames are organized in classes, with the Frame class as the parent.ASGI 1.0 is supported. Will be adding support for 2.0 soon.Flow Control (To be added)Stream prioritization (To be added)Works with Django (Tested against Django 1.11 and 2.2)UsageInstall the package using pippip3 install thrusterRun the following command:thruster --app path_to_your_asgi_app --cert-file path_to_certificate_file --key-file path_to_key_fileeg: thruster --app mysite --cert-file server_cert.crt --key-file server_key.key--cert-file is expected to be a .crt file and --key-file is expected to be a .key file. If --cert-file and --key-file options are not passed, thruster will look for server.crt and server.key in the current directory.
--cert-file and --key-file are required for SSL connections and HTTP2 only works with SSL. You can use --help to know about for more options.
If everything goes fine you should see the following output on the terminal.Serving HTTP on port 8000 ...The structure of your ASGI application is expected to be something like this. Eg: If you're using django.root_directory/
asgi.py
routing.py
settings.pyasgi.pyimportosimportdjangofromchannels.routingimportget_default_applicationos.environ.setdefault("DJANGO_SETTINGS_MODULE","mysite.settings")django.setup()application=get_default_application()routing.pyfromchannels.routingimportProtocolTypeRouterapplication=ProtocolTypeRouter({})settings.pyASGI_APPLICATION='mysite.routing.application'
Package: th-seal
Copyright (c) Facebook, Inc. and its affiliates.Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.Description: no description
Platform: UNKNOWN