Saravanan666/pypi-org huggingface dataset:
Package: txinvoke
Run inline callbacks fromTwistedasInvoketasks.InstallationpipinstalltxinvokeExample# -*- coding: utf-8 -*-# tasks.pyimporttimeimporttxmongofromtxinvokeimporttask_on_callbacks@task_on_callbacks(name='test_task')defexample(verbose=False):connection=yieldtxmongo.MongoConnection()test_collection=connection.db.testforxinrange(10000):data=x*time.time()doc={'something':data}yieldtest_collection.insert(doc,safe=True)ifverbose:print("Test data '{data}' was inserted".format(data=data))CaveatsSorry, but tasks chainingwill NOTwork currently.
Package: txjuju
txjujuprovidestwisted-based tools
for interacting withJuju.  This
includes both an API client and a CLI wrapper.  The library is limited
to Python 2, but does support both Juju 1.x and 2.x.  Support for
Python 3 is on the radar.Note that only a portion of Juju’s capability is exposed in txjuju.
This is because the code originates in theLandscapeproject and did not grow
much beyond the needs of Landscape.  The official Python bindings for
Juju (python-libjuju)
will usually offer a better experience.  At some point python-libjuju
may entirely supercede txjuju.Key ComponentsHere are the essential classes of txjuju:txjuju.api.Endpointtxjuju.api.Juju2APIClientandtxjuju.api.Juju1APIClienttxjuju.cli.Juju2CLIandtxjuju.cli.Juju1CLIAdditionally,txjuju.prepare_for_bootstrap()is especially useful.For more information seeDOC.rst.Example UsageAPI Clientfromtwisted.internetimportreactorfromtwisted.internet.deferimportinlineCallbacksfromtxjuju.apiimportEndpointendpoint=Endpoint(reactor,"ec2-1-2-3-4.compute-1.amazonaws.com")deferred=endpoint.connect()@inlineCallbacksdefconnected(client):yieldclient.login("user-admin","54830489236383334d1d9fd84adae72c")yieldclient.setAnnotations("unit","1",{"foo":"bar"})deferred.addCallback(connected)reactor.run()CLI Wrapperimportpprintfromtwisted.internetimportreactorfromtwisted.internet.deferimportinlineCallbacks,returnValuefromtxjujuimportprepare_for_bootstrapfromtxjuju.cliimportBootstrapSpec,Juju1CLIcfgdir="/tmp/my-juju"spec=BootstrapSpec("my-env","lxd")cli=Juju1CLI(cfgdir)@inlineCallbacksdefbootstrap():prepare_for_bootstrap(spec,"1.25.6",cfgdir)yieldcli.boostrap(spec.name,"0")raw=yieldcli.api_info(spec.name)returnValue(raw)deferred=bootstrap()deferred.addCallback(lambdav:pprint.pprint(v))reactor.run()ContributingIf you’d like to contribute to txjuju, feel free to open an issue or
send us a pull request.  As far as borrowing from txjuju goes, the
code is LGPLv3-licensed.PackagingA Python package may be created usingpython2 setup.py sdist.
For building a debian package seeBUILDandbuild.sh.StyleThe txjuju code follows PEP 8.  It is a good idea to frequently run
something likeflake8when
making changes.  Other txjuju-specific guidelines:use double quotes for stringstest methods should have docstringsTestingTo run the test suite, runmake testorpython2-munittest txjuju.tests.test_XXX.
Package: txkazoo
# txkazoo[![Build Status](https://travis-ci.org/rackerlabs/txkazoo.svg)](https://travis-ci.org/rackerlabs/txkazoo)
[![Coverage Status](https://coveralls.io/repos/rackerlabs/txkazoo/badge.png)](https://coveralls.io/r/rackerlabs/txkazoo)Twisted wrapper for [Kazoo](https://github.com/python-zk/kazoo/).## StatusThis is not yet meant for public use.## Running testsUse [tox](http://tox.testrun.org/). By default, this will run the
entire test suite plus a number of sanity checks. Any additional
positional arguments passed totoxwill be passed totrial,  the
test runner. You can use this to only test part of the test suite, for
example:` tox--txkazoo.test.test_something `
Package: txKeystone
# Twisted Python Keystone Agent[![Build Status](https://secure.travis-ci.org/racker/python-twisted-keystone-agent.png)](http://travis-ci.org/racker/python-twisted-keystone-agent)## Example Usage```pythonfrom twisted.internet import reactorfrom twisted.web.client import Agentfrom txKeystone import KeystoneAgentagent = Agent(reactor)RACKSPACE_USERNAME = '' # your username hereRACKSPACE_APIKEY = '' # your API key hereAUTH_URL = 'https://identity.api.rackspacecloud.com/v2.0/tokens'keystone_agent = KeystoneAgent(agent,AUTH_URL,(RACKSPACE_USERNAME, RACKSPACE_APIKEY))````keystone_agent` can now be used like a [twisted.web.client.Agent](http://twistedmatrix.com/documents/current/web/howto/client.html)(see "[Receiving Responses](http://twistedmatrix.com/documents/current/web/howto/client.html#auto4)")to make requests to Rackspace APIs, and the `X-Tenant-Id` and `X-Auth-Token` headers will be set automatically.
Package: txkube
What is this?txkube is a Twisted-based client library for interacting withKubernetes.Usage Samplefrom__future__importprint_functionfromtwisted.internet.taskimportreactfromtxkubeimportnetwork_kubernetes_from_context@reactdefmain(reactor):k8s=network_kubernetes_from_context(reactor)d=k8s.versioned_client()d.addCallback(lambdaclient:client.list(client.model.v1.Namespace))d.addCallback(print)returndInstallingTo install the latest version of txkube using pip:$ pip install txkubeFor additional development dependencies, install thedevextra:$ pip install txkube[dev]Testingtxkube uses pyunit-style tests.
After installing the development dependencies, you can run the test suite with trial:$ pip install txkube[dev]
$ trial txkubetxkube also includes integration tests.
It isnotrecommended that you run these against anything but a dedicatedtestingKubernetes cluster.Minikubeis an easy way to obtain such a thing.
Once running:$ pip install txkube[dev]
$ TXKUBE_INTEGRATION_CONTEXT=minikube trial txkubeThis will run the full test suite which includes the integration tests.
It will interact with (andmake destructive changes to) the identified Kubernetes cluster.Licensetxkube is open source software released under the MIT License.
See the LICENSE file for more details.
Package: txlib-too
This library is a wrapper around the Transifex API, built to provide a
simpler interface to users of the API.At this moment, it supports only a subset of the endpoints of the API.
In particular, it allows certain operations on Projects, Resources and
Translations.UsageInitializationBefore making any requests, you need to setup the HTTP handler, which
will be used for all subsequent requests.Authentication works both with username/password or with an API token.fromtxlib_too.http.authimportBasicAuthfromtxlib_too.http.http_requestsimportHttpRequestfromtxlib_too.registryimportregistrycredentials=BasicAuth(username='api',password='')host='https:/www.transifex.com/'conn=HttpRequest(host,auth=credentials)registry.setup({'http_handler':conn})ProjectsTODOResourcesGet resourcefromtxlib_too.api.resourcesimportResourcefromtxlib_too.http.exceptionsimportNotFoundError,ServerErrortry:r=Resource.get(project_slug='project_slug',slug='resource_slug')print(r.slug)# 'resource_slug'exceptNotFoundError:print('Resource not found')exceptServerErrorase:print('Exception while retrieving resource:{}'.format(e))Create/update resourcefromtxlib_too.api.resourcesimportResourcefromtxlib_too.http.exceptionsimportNotFoundError,ServerErrortry:r=Resource.get(project_slug='project_slug',slug='resource_slug')# Resource exists, update it# Not all fields are allowed here. For example, if i18n_type# is provided, the request will fail with a 400 errortry:r.save(content='{"key1": "text1"}')exceptServerErrorase:print('Exception while updating resource:{}'.format(e))exceptNotFoundError:# Resource does not exist, create one nowtry:r=Resource(project_slug='project_slug',slug='resource_slug')r.save(name='R1',i18n_type='KEYVALUEJSON',content='{"key1": "text1"}')exceptServerErrorase:print('Exception while creating resource:{}'.format(e))exceptServerErrorase:print('Exception while retrieving resource:{}'.format(e))Alternatively, instead of passing all parameters tosave(), you can
do the following:r=Resource.get(...)r.name='...'r.i18n_type='...'r.content='...'r.save()TranslationsGet translationfromtxlib_too.api.translationsimportTranslationfromtxlib_too.http.exceptionsimportNotFoundError,ServerErrortry:t=Translation.get(project_slug='project_slug',slug='resource_slug',lang='translation_language')print(t.lang)# 'translation_language'exceptNotFoundError:print('Translation not found')exceptServerErrorase:print('Exception while retrieving translation:{}'.format(e))Create/update translationfromtxlib_too.api.translationsimportTranslationfromtxlib_too.http.exceptionsimportNotFoundError,ServerErrortry:t=Translation(project_slug=project_slug,slug=resource_slug,lang=language_code)t.save(content=content)exceptServerErrorase:print('Exception while retrieving translation:{}'.format(e))
Package: txlogstash
A twisted LogObserver sending json lines to a logstash, splunk, or any modern json capable event/log server.The log events are tweaked in order to be properly indexed by elasticsearch.
Special attention has been given to properly dump the failures.Usage:from txlogstash import TCPJsonLineLogObserver
from twisted.logger import globalLogPublisher
globalLogPublisher.addObserver(TCPJsonLineLogObserver("tcp:logger.example.com:5000")Logstash.json:input {
    tcp {
            port => 5000
            codec => json_lines
    }
}
output {
    elasticsearch {
            hosts => "elasticsearch:9200"
    }
}
Package: txlongpoll
Generic long poll server used by Launchpad and Landscape.DependenciesBy default txlongpoll attempts to build without going to the network;
instead it tries to find all dependencies from download-cache/dist,
and you must download all the dependencies yourself.If you prefer to use resources from the ‘net, PyPI for example, then:Remove the –setup-source and –download-base options in Makefile to
allow bootstrap.py to download setuptools.Comment out theinstall-from-cache= trueline in buildout.cfg
to allow bin/buildout to download dependencies.To run the tests you may also need lp:rabbitfixture (bzr branch
lp:rabbitfixture). Build an sdist tarball and drop it into
download-cache/dist. You may also need to do the same for
testresources-0.2.4_r58 until it reaches PyPI.txlongpoll needs a recent RabbitMQ with support for rejection. Maverick’s
1.8.0 is not sufficient, but 2.1.1 works fine, so >= Natty is OK.Building$ make buildwill build only those parts needed to run txlongpoll. No support for
tags or testing.Testing$ make checkwill build all the test-related parts of txlongpoll and then do a full
test run, but$ make bin/testwill just do the first part.There is testrepository <https://launchpad.net/testrepository>
support, so you can also do the following:$ testr init
$ testr runThis is probably the best way to develop txlongpoll.Running$ bin/twistd txlongpoll
Package: txm
txm - A Tmux Helper Tooltxmis a command-line utility to make working withtmuxmore efficient and user-friendly. It's written in Python and aims to abstract some of the complexities involved in managing tmux sessions, panes, and command executions.Table of Contentstxm - A Tmux Helper ToolTable of ContentsInstallationUsageSession ManagementCreate a New SessionList All SessionsAttach to a SessionDetach from a SessionPane ManagementSplit Pane VerticallySplit Pane HorizontallyNavigate Between PanesCommand ExecutionExecute a CommandConfiguration.txm-config.json.txm-presets.jsonContributingLicenseInstallationTo installtxm, navigate to the root directory of the project and execute the following command:pipinstall.This will build the package and install it. Also the package is temporarily available on pypitest (to move it later to pypi)pip install -i https://test.pypi.org/simple/ txmUsageHere are the available functionalities oftxm.Session ManagementCreate a New SessionTo create a new session, run:txmnew[SESSION_NAME]List All SessionsTo list all available sessions, run:txmlistAttach to a SessionTo attach to an existing session, run:txmattach[SESSION_NAME]Detach from a SessionTo detach from the current session, run:txmdetachPane ManagementSplit Pane VerticallyTo split the current pane vertically, run:txmvsplitSplit Pane HorizontallyTo split the current pane horizontally, run:txmhsplitNavigate Between PanesTo navigate between panes, run:txmnavigate[DIRECTION]DIRECTIONcan be one of the following:Ufor up,Dfor down,Lfor left,Rfor right.Command ExecutionExecute a CommandTo execute a command in the current pane, run:txmrun[COMMAND]Configurationtxmcan optionally read from a.txm-config.jsonfile located in the root directory for user-specific settings..txm-config.jsonThis configuration file contains settings and preferences for your TXM utility. It should be placed in the root directory of your project or your home directory.Default Template:{"tmux_path":"/usr/local/bin/tmux","log_directory":"logs/","default_session_name":"my_session"}tmux_path: Specifies the path to the tmux executable.log_directory: Specifies the directory where tmux pane logs will be saved.default_session_name: Specifies the default name for a new tmux session..txm-presets.jsonThis file holds the saved tmux session presets. It will be automatically generated by thetxm savecommand, or you can create it manually in the directory of your choice.Default Template:{"presets":[{"name":"preset_1","windows":[{"name":"window_1","panes":["command1","command2"]},{"name":"window_2","panes":["command3","command4"]}]}]}name: Specifies the name of the saved preset.windows: Array of windows in the preset.name: Name of the window.panes: Array of commands to run in each pane.ContributingContributions are welcome. Feel free to open a pull request or submit an issue.LicenseThis project is licensed under the MIT License. See the LICENSE.md file for details.
Package: txmc
通过txmc实现在我的世界中畅游https://www.yuque.com/makeblock.net.cn/pluginMinecraft扩展包旨在为更多少儿编程机构提供更加丰富的课程。Minecraft已全面支持：Scratch 、Python、C++支持的Minecraft服务器版本:1.7.x、1.8.x、1.9.x、1.10.x、1.11.x、1.12.x 、1.1.3x、1.14.x、1.15.x、1.16.x、1.17.x、1.18.x、1.19.x课程服务器地址mc.makeblock.net.cn欢迎各位小伙伴投稿或提出更好的改进建议下载Minecraft客户端[点击查看视频教程][点击查看积木百科]↓↓预览一下学生们的优秀编程作品↓↓如需自建服务器支持可发邮件联系刘老师®Copyright 童心少年
Package: txnats
NATS DocumentationHOW TO microservice communication.How do I get my services to talk to each other with out registering each
one in a directory?How do I scale a back end service and allow front end services to use
all of them quickly?How do I have a fast, scalable, resilient communication service with out
a lot of headaches?A good answer to all of these is to use NATS. NATS is a masterpiece
protocol designed with the cloud in mind. HTTP was good, but it was
designed for servers sending single resources to clients on an
uncontrolled network.Install dependenciesI suggest creating a virtualenv.$ make depsTry the demo:$ make prepare-exampleOpen two extra terminal windows and from one run:$ ./example/respond.pyfrom the other run:$ ./example/sub_only.pyThen from the first window run:./example/nats_demo.pyUsageMake a subject subscriber.for full context seesub_only.py:First, define a message handler for a subscription:def on_happy_msg(nats_protocol, sid, subject, reply_to, payload):
    print "got message", sid, subjectThen in create the endpoint, nats protocol instance and connect them:point = TCP4ClientEndpoint(reactor, "demo.nats.io", 4222)

nats_protocol = txnats.io.NatsProtocol(
    verbose=False,
    on_connect=lambda np: np.sub("happy", "6", on_msg=on_happy_msg))

connecting = connectProtocol(point, nats_protocol)
reactor.run()When a message comes in for the subject “happy”on_happy_msgwill be
called.Make a subject responder.The only difference from a subscriber is that theon_msgfunction
will publish a message to thereply_tosubject of the message:def respond_on_msg(nats_protocol, sid, subject, reply_to, payload):
    if reply_to:
        nats_protocol.pub(reply_to, "Roger, from {}!".format(responder_id))…:nats_protocol = txnats.io.NatsProtocol(
    verbose=False,
    on_connect=lambda np: np.sub("get-response", "6", on_msg=respond_on_msg))For full context seerespond.pyDistribute the responder load.To distribute the load: subscribe with a queue-group and any message
will go to one of the responders:nats_protocol = txnats.io.NatsProtocol(
    verbose=False,
    on_connect=lambda np: np.sub("get-response", "6",
                                 queue_group="excelsior",
                                 on_msg=respond_on_msg))However many processes you have subscribed to this subject and queue
group will have the messages sent to only one of them. If there are four
running, and 100 messages are sent on the “get-response” subject, each
one should only have to respond to 25, distributing the work load.For full context seequeue_respond.pyand something that will make a bunch of requests on that subject.make_requests.py
Package: txnet
txnetKeras inspired pure python neural network libraryfromtxnet.modelsimportSequentialfromtxnet.layersimportDense,ReLU,Sigmoidimportnumpyasnpx=np.array([[1,1],[0,1],[1,0],[0,0]])y=np.array([[0],[1],[1],[0]])model=Sequential()model.add(Dense(2,5,0.01))model.add(ReLU())model.add(Dense(5,1,0.01))model.add(Sigmoid())model.fit(x,y,10000)print(model.predict(x))
Package: txOneDrive
txOneDriveDeprecation Notice:this module uses obsolete API and wasn’t
maintained for a while, use officialonedrive-sdk-pythonmodule or something built on it instead.Twisted-based python async interface forOneDrive API (version
5.0)(formerly known as SkyDrive).API is mostly the same as inpython-onedrivemodule
(txOneDriveAPI class maps to OneDriveAPIWrapper, txOneDrive to
OneDriveAPI) - methods are re-used directly from classes there, so more
info on these can be found in that project.Key difference from synchronous python-onedrive module is that all
methods return twisted Deferred objects as scheduled to run by event
loop, allowing to run multiple operations (like large file uploads)
concurrently within one python process.Service was called SkyDrive prior to 2014-02-19, when it got renamed to
OneDrive. This package similarly renamed from txskydrive to txonedrive.Usage ExampleFollowing script will print listing of the root OneDrive folder, upload
“test.txt” file there, try to find it in updated folder listing and then
remove it.from twisted.internet import defer, reactor
from txonedrive.api_v5 import txOneDrivePersistent

@defer.inlineCallbacks
def do_stuff():
    api = txOneDrivePersistent.from_conf()

    # Print root directory ("me/skydrive") listing
    print list(e['name'] for e in (yield api.listdir()))

    # Upload "test.txt" file from local current directory
    file_info = yield api.put('test.txt')

    # Find just-uploaded "test.txt" file by name
    file_id = yield api.resolve_path('test.txt')

    # Check that id matches uploaded file
    assert file_info['id'] == file_id

    # Remove the file
    yield api.delete(file_id)

do_stuff().addCallback(lambda ignored: reactor.stop())
reactor.run()Note that txOneDriveAPIPersistent convenience class uses Microsoft
LiveConnect authentication data from “~/.lcrc” file, which must be
created as described in more detailin python-onedrive
docs.InstallationIn case you’ve missed Deprecation Notice at the start of this file:DO NOT USEthis project for anything new, use officialonedrive-sdk-pythoninstead.It’s a regular package for Python 2.7 (not 3.X).Usingpipis the best way:% pip install txonedriveIf you don’t have it, use:% easy_install pip
% pip install txonedriveAlternatively (see
also):% curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python
% pip install txonedriveOr, if you absolutely must:% easy_install txonedriveBut, you really shouldn’t do that.Current-git version can be installed like this:% pip install 'git+https://github.com/mk-fg/txonedrive.git#egg=txonedrive'Note that to install stuff in system-wide PATH and site-packages,
elevated privileges are often required. Use “install –user”,~/.pydistutils.cfgorvirtualenvto do
unprivileged installs into custom paths.RequirementsPython 2.7 (not 3.X)Twisted(core, web, at least 12.2.0)python-onedrive
Package: txp
TXPDevelopmentThe following tools are used for this project:Poetryis used for dependency and package managmentNoxis used as automation tool, mainly for testingBlackis the mandatory formatter toolPyEnvis recommended as a tool to handle multiple python versions in developers machines.Setup the development environmentInstall a supported Python version on your machine (compatible Python versions ^3.8). The recommended way is to usePyEnv.Install the global Python required dependencies:pip install poetry noxClone this repository, and execute the following command in the repository root folder:poetry installThis will install all the dependencies fortxpin a virtual enviroment created by Poetry for your project.
All the required dependencies for development are installed in that virtual enviroment.Configure your IDE to work with the virtual enviroment or the command line if you use an editor.To activate the virtual enviroment on your terminal (MacOS, Linux) you can execute:source /path/to/poetry/cache/virtualenvs/test-O3eWbxRl-py3.7/bin/activateThe path to your virtual enviroment location can be found withpoetry env infocommand.Testing
Package: tx_people
This Django application was generated using theTexas Tribune’sGeneric
Django app template.Installation & ConfigurationYou can install this usingpiplike this:pip install tx_peopleOnce installed, you need to add it to yourINSTALLED_APPS.  You can do that
however you like or you can copy-and-paste this in after yourINSTALLED_APPSare defined.INSTALLED_APPS += ['tx_people', ]Now you’re ready to start usingtx_people.UsageTODOExampleAll of the usage is outlined, along with tests inside theexampledirectory.  See that directory for more information on how to run the tests and
example project.
Package: txpkgme
txpkgme is a Python client forpkgme-service, that uses
Twisted to handle pkgme-service’s asynchronous nature.If this sort of thing interests you, you might want to look up:pkgmethe pkgme projectAutomatic packagingLicensingAll files are Copyright (C) 2012  Canonical Ltd.This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the License.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.Getting helpIf you’d like help with libdep-service, you can find the developers on the#pkgmechannel on Freenode.  Alternatively, join thedeveloper mailing
listand send an email topkgme-devs@lists.launchpad.net.
Package: txpkgupload
0.5 (2023-02-13)Drop Python 2 support.Adjust directory creation to work around a change inos.makedirsin
Python 3.7.Add Python 3.8 support.Remove dependencies onzope.component,zope.security, andzope.server.0.4 (2021-01-04)Convert from buildout to pip.Pass moduli path to SSHService, needed to support the
diffie-hellman-group-exchange-* key exchange algorithms.Upgrade to Twisted 18.4.0, lazr.sshserver 0.1.8, and various other
dependencies.Implement FTP extensions for IPv6.Port to Python 3.0.3 (2015-02-03)Stub out openDirectory and getAttrs properly to avoid OOPSes with certain
clients.0.2 (2015-01-23)Institute a temporary directory on the same filesystem as the upload root.Stop creating obsolete .distro files.Remove locking, since we now move directories into place atomically.Fix memory leak when closing SFTP connections.0.1.1 (2015-01-13)Add twisted.plugins package to binary distributions0.1 (2015-01-13)Initial release