Saravanan666/pypi-org huggingface dataset:
Package: tgedr-pipeline-common
Introductioncommon library to define pipeline interfacesGetting Startedinstallationyou can install the package frompypi:pip install tgedr-pipeline-commonusageTODOrationaleTODOBuildcheck thehelper.shscriptTestcheck thehelper.shscriptContributejust submit a PR to ourrepositorywhen you want, we'll look at it
Package: tgenv
Introductiontgenv is a Python CLI tool for managingterragruntversions.If you have any questions, any remarks or even bugs, feel free to open an issue.There is currently no or will ever be any support for windows.PrerequisitesYou need python3.8 installed.InstallationpipinstalltgenvUsageShow available versionstgenvlist-remoteInstall a versiontgenvinstallv0.24.4Show current versiontgenvcurrentUse an installed versiontgenvusev0.24.4Show installed versiontgenvlistRemove installed versionstgenvremovev0.24.4Remove all versionstgenvpurgeLicensingThis program is published under the GPL-3.0-only. See theLICENSEfile.
Package: tgeraser
TgEraserTgEraser is a Python tool that allows you to delete all your messages from a chat, channel, or conversation on Telegram without requiring admin privileges. Official Telegram clients do not provide a one-click solution to delete all your messages; instead, you have to manually select and delete messages, with a limit of 100 messages per batch. TgEraser solves this problem and offers a convenient way to mass-delete your messages on Telegram.Installationpip install tgeraser
tgeraserTo use TgEraser, you'll need to provideapi_idandapi_hash, which you can obtain fromhere.There are two methods to defineapi_idandapi_hash:Set them as environment variables (TG_API_IDandTG_API_HASH).Allow the tool to prompt you for input during execution, with an option to save the credentials in acredentials.jsonfile located in the same directory as the sessions (by default,~/.tgeraser/).UsageTgEraser deletes all your messages from a chat, channel, or conversation on Telegram without requiring admin privileges.

Usage:
    tgeraser [(session <session_name>) --entity-type TYPE -l NUM [-d PATH] -p PEER_ID] | [-k]
    tgeraser session <session_name> -p PEER_ID -t STRING
    tgeraser session <session_name> -w [--entity-type TYPE]
    tgeraser -h | --help
    tgeraser --version

Options:
    -d --directory PATH         Specify a directory where your sessions are stored. [default: ~/.tgeraser/]
    -w --wipe-everything        Delete all messages from all entities of a certain type that you have in your dialog list.
    --entity-type TYPE          Available types: any, chat, channel, user. [default: chat]
    -p --peers PEER_ID          Specify certain peers by comma (chat/channel/user).
    -l --limit NUM              Show a specified number of recent chats.
    -t --time-period STRING     Specify a period for an infinite loop to run messages deletion every X seconds/minutes/hours/days/weeks.
                                Example: --time-period "3*days" OR --time-period "5*seconds"
    -k --kill                   Terminate existing background TgEraser processes (only for Unix-like OS).
    -h --help                   Show this screen.
    --version                   Show version.Executing the tool without options will guide you through the creation of your first user session. After that you can create sessions for multiple users using thetgeraser session <new_session_name>command.ContributingIf you have any issues or suggestions, please feel free to open an issue or submit a pull request.
Package: tgext.admin
Introduction============Changelog===========0.7.0-----* Improved template engine detection, didn't work well for unsupported engines. Now admin properly displays when using Kajiki* Admin.make_controller is now a public method so that users can leverage it to create new CRUD controllers with Admin lookandfeel0.6.6-----* Fix for allow_only not accepting custom predicated* Preliminary support for Sprox version with subdocuments editing0.6.0------Support for Layouts in TGAdminConfig with Bootstrap3 Layout0.3----Lookup now uses ProviderSelector, for better mongo support0.2.6-----Bugfix release.  Support for _method fields in TG2.10.2.5------* Addition of defaultCrudRestController toCRCConfig allows one to customize the controllerthat the admin uses.* Fixes tgadminconfig to override the Password properly for Users
Package: tgext.browserlimit
About BrowserLimitBrowserlimit is a TurboGears2 extension meant to quickly limit access to a website
only to modern browsers. BrowserLimit requires TurboGears2.1.4 or newer.Installingtgext.browerlimit can be installed both from pypi or from bitbucket:easy_install tgext.browserlimitshould just work for most of the usersEnabling BrowserLimitUsing BrowserLimit is quite simple, you can just plug it usingtgext.pluggable.If you want to avoid usingtgext.pluggablefor any reason it is still
possible to use tgext.browserlimit by manually setting it up.
At the end of your applicationconfig/app_cfg.pyimporttgext.browserlimit:import tgext.browserlimit
tgext.browserlimit.plugme(base_config, {})Choosing Browser LimitsBy default tgext.browserlimit will limit site access to browsers which have a fairly
compatible HTML4 support, those include IE8, Chrome4, Firefox3.6, Safari3.2This can be changed by specifying thebase_config.browserlimitoption inside
yourconfig/app_cfg.pybefore loading browserlimit. Valid values are:MODERN -> Most modern browsers with top edge featuresHTML5 -> Minimal HTML5 support like video and canvasBASIC -> Good HTML4 support (the default)MINIMAL -> Cover as much as possible (minimum IE version 7)New limits can be enabled using thebase_config.browserlimitsoption.
This must be a dictionary where the KEY is the limit name and the value is a class
that implements__init__(self, user_agent)andis_met(self, environ) -> boolmethods.
Package: tgext.celery
About tgext.celerytgext.celery is a TurboGears2 extension that integrates celery into a turbogears applicationI tested this extension just with the celery[mongodb]==3.1 bundle of celery and pymongo==3.5.1
using mongodb as both message broker and result backendintegrates bothcelery beatandcelery workerInstallingtgext.celery can be installed from pypi:pip install tgext.celeryshould just work for most of the users.PluggingTo enable tgext.celery put inside your applicationconfig/app_cfg.pythe following:from tgext.pluggable import plug
plug(base_config, 'tgext.celery')put in your*.inifile the options that you want to pass to your celery application
prefixed by`celery.`:#celery config
celery.CELERY_TASK_SERIALIZER = json
celery.CELERY_RESULT_SERIALIZER = json
celery.CELERY_ACCEPT_CONTENT = json
celery.CELERY_TIMEZONE = UTC
celery.BROKER_URL = mongodb://localhost:27017/dbname
celery.CELERY_RESULT_BACKEND = mongodb://localhost:27017/dbname
celery.CELERYD_POOL = celery.concurrency.threads.TaskPool
celery.CELERY_INCLUDE = myproject.lib.celery.tasks
celery.CELERYD_CONCURRENCY = 3
celery.WITHOUT_GOSSIP = true
celery.WITHOUT_HEARTBEAT = true
celery.WITHOUT_MINGLE = trueseehttp://docs.celeryproject.org/en/3.1/configuration.html#configurationfor other optionsdisabling gossip, heartbeat and mingle can be dono only from the celery worker cli, we added them
to the configuration. We reccomend to disable them if you aren’t using monitoring tools,
because of a bug:https://github.com/celery/celery/issues/1047that will fill your db with GBs of messages.you can pass other options (that override the other in the .ini file) when plugging this extension
this is convenient because the options in the .ini file aren’t evaluated:plug(
    base_config,
    'tgext.celery',
    celery_config={
        'CELERY_MONGODB_BACKEND_SETTINGS': {
            'database': 'dbname',
        },
        'CELERYBEAT_SCHEDULE': {
            'delete-unassociated-images-every-12-hours': {
                'task': 'delete_unassociated_images',
                'schedule': timedelta(hours=12),
            },
        },
    },
)Writing tasksRemember to set theCELERY_INCLUDEoption
here’s an example with a task:from __future__ import absolute_import

from myproject import model

from tgext.celery.celery import celery_app

import logging

logger = logging.getLogger(__name__)

celery_app.config_from_object(config['celery_configuration_object'])


@celery_app.task(name='delete_unassociated_images')
def delete_unassociated_images():
    logger.info('started')
    model.Image.query.remove({'post_id': None})
    logger.info('finished')Executingtgext.celerysets two gearbox commands, you can run celery with:gearbox celeryworker -c production.ini --logfile=/var/log/circus/myproject_celery_worker_tasks.logand:gearbox celerybeat -c production.iniin a production environment you should put these commands in a circus watcher or supervisord
Package: tgext.chameleon_genshi
Chameleon Genshi rendering engine support for TG2.3.2+UsageInsire yourconfig/app_cfg.pyregister the ChameleonGenshi renderer:from tgext.chameleon_genshi import ChameleonGenshiRenderer

base_config.register_rendering_engine(ChameleonGenshiRenderer)
base_config.renderers.append('chameleon_genshi')
Package: tgext.crud
TurboGears CRUD Generator=========================Automatically creates CRUD and REST-APIS based on a SQLAlchemy or Ming model.This is the tool that empowers the ``tgext.admin`` extension, but can also be used by itself.0.8.0-----* __setters__ are no longer supported.* __form_new_options__ and __form_edit_options__ are now available to set options specific to new or edit forms.* get_all now logs exception when unable to retrieve data* post, put and delete now return the created/edited/deleted object when called from child class method* When subclassed error handler are now properly retrieved from the subclass when overridden.* post, put and delete now redirect after the controller has been executed, not during.0.7.4-----* Allow custom provider selector0.5.6-----------------------* Make possible to choose whenever to rollback session or abort transaction when a database error occurs using the tgext.crud.abort_transactions option0.4 (Jan. 31, 2012)-----------------------* Support filtering results in table view when passing arguments to the url* Added keep_params option which makes possible to keep aroundfilters, useful when you want to administer only a subset of theavailable objects.0.3 (Sept. 30, 2009)----------------------* Mako template support* Title template fixes* Provider session bug fixed* TW 0.9.7.2 support* Pagination added.0.2.x------Prehistory (should have kept better logs)
Package: tgext.debugbar
About Debug Toolbartgext.debugbar provides a Debug Toolbar for TurboGears2 framework.Exposed sections are:Controller and Rendering time reportingController ProfilingRequest Parameters, Headers, Attributes and EnvironSQLAlchemy Queries reporting and timingExplain and Show result of performed SQLAlchemy queriesList mounted controllers, their path and exposed methodsLog MessagesInstallingtgext.debugbar can be installed both from pypi or from bitbucket:easy_install tgext.debugbarshould just work for most of the usersUsing it with PluggablesLike any other pluggable extension, the debugbar can be
activated through the pluggables interface inside
yourapp_cfg.py:from tgext.pluggable import plug
plug(base_config, 'tgext.debugbar')The debugbar will then check for thedebugconfig option
disabling itself when it is false.Using it without pluggableWhile the pluggables interface makes convenient to
pass options to the debugbar, you might want to avoid
using it for various reasons. In such cases you can
enable the debugbar by adding the following
lines to your projectapp_cfg.py:from tgext.debugbar import enable_debugbar
enable_debugbar(base_config)Enabling LogsWhenever your response is JSON or an ajax request, or any other
kind of content which is not a plain HTML page, the debugbar bar
is not injected inside your response.
This is to prevent it from messing with your output when it would
probably break things.There are cases when you might be interested in getting access
to some informations from the debugbar even when your output
is not HTML. For example your might be interested in knowing
which queries have been performed to retrieve your JSON response.To enable logging such informations you can pass theenable_logs=Trueoption to theplugcall which activates the debugbar.Inventing ModeThe DebugBar provides the inventing mode, such feature is inspired
by theInventing On Principleto speed up experimenting and prototyping
with your website. Whenever the inventing mode is enable your web page
will automatically update when you change it, being it a controller, template
or css change.The inventing mode can be enabled by passing theinventing=Trueoption to theplugcall which activates the debugbar.If you want to disable inventing mode for CSS files, you can enable the
inventing mode and then pass theinventing_css=Falseoption.
Package: tgext.djangoforms
About Turbo Django Forms-------------------------Turbo Django Forms is a basic package that allows you to use Django formsin turbogears. You should be able to follow the django documentation todeal with validation etc.Installing-------------------------------tgext.djangoforms can be installed from pypi::pip install tgext.djangoformsshould just work for most of the usersEnabling Turbo Django Forms----------------------------------In your application *lib/app_globals.py* import **TDForms**::from tgext.djangoforms import TDFormsAnd call it inside the **__init__**::class Globals(object):def __init__(self):self.tdf = TDForms()Creating Forms----------------------------Creating forms works the same as with standard Django::from django import formsclass ContactForm(forms.Form):subject = forms.CharField(max_length=100)message = forms.CharField()sender = forms.EmailField()cc_myself = forms.BooleanField(required=False)Controller----------------------------You can follow most of the django forms tutorial::@expose('mysite.templates.index')def index(self, **kw):"""Handle the front-page."""if kw:form = ContactForm(kw)if form.is_valid():print form.cleaned_data//do stufftg.flash("Form OK")else:form = ContactForm()return dict(page='Index', form=form)Rendering Forms----------------------------You can use the standard django style template notation in your Genshi template - but add a g.tdf(...)::<form>${g.tdf(form.as_p)}<button>Submit</button></form>
Package: tgext.ecommerce
About tgext.ecommercetgext.ecommerce is a Pluggable eCommerce Framework for TurboGears2.Installingtgext.ecommerce can be installed both from pypi or from bitbucket:pip install tgext.ecommerceshould just work for most of the usersPlugging tgextecommerceIn your applicationconfig/app_cfg.pyimportplug:from tgext.pluggable import plugThen at theend of the filecall plug with tgext.ecommerce:plug(base_config, 'tgext.ecommerce')You will be able to access tgext.ecommerge functions astg.app_globals.shop
Package: tgext.evolve
tgext.evolve is a TurboGears2 extension for generic migrations and evolutions.tgext.evolveis safe to be used in multiprocessing and multithreading environmentsas it relies on a distributed lock on your database to perform evolutions.During the evolution period the application will respond with a503status code,
feel free to configure TurboGears to trap it and use your ErrorController to provide
a custom page.Installingtgext.evolve can be installed from pypi:pip install tgext.evolveshould just work for most of the users.EnablingTo enable tgext.evolve put inside your applicationconfig/app_cfg.pythe following:import tgext.evolve
tgext.evolve.plugme(base_config, options={
    'evolutions': [
        # ... Your evolutions ...
    ]
})or you can usetgext.pluggablewhen available:from tgext.pluggable import plug
plug(base_config, 'tgext.evolve', evolutions=[
    # ... Your evolutions ...
])tgext.evolve can then be disabled using thetgext.evolve.enabled = falseoption in your configuration files. This is often the case during test suites.Using EvolutionsEvolutions are a subclass oftgext.evolve.Evolutionthat
must provide anevolution_idproperty and anevolve()method.Here is a sample evolution that does not much apart waiting for 10 seconds:import time
from tgext.evolve import Evolution

class TestEvolution1(Evolution):
    evolution_id = 'test_evolution_1'

    def evolve(self):
        time.sleep(10)Please note that in case you modify data or touch the database
throughmodel.DBSessionor other manners you mustflushandcommityour UnitOfWork and Transaction yourself as evolutions
are performed outside the transaction manager in a separated thread.Then you can register your evolution with something like:from tgext.pluggable import plug
plug(base_config, 'tgext.evolve', evolutions=[
    TestEvolution1
])In case your evolution requires parameters you can register an
instance of it instead of registering the class.NoteThere is no opposite to theevolve()method as there is no
guarantee that evolutions are reversible. In case you need
reversible migrations for database schemas please use a
schema migration framework.ChangeLog0.0.5small bugfix and deprecation gardening0.0.4small Python3 compatibility fixes0.0.3Experimental support for SQLAlchemy, tested on SQLite and MySQL.0.0.2Allow disabling tgext.evolve usingtgext.evolve.enabled = Falsein.inifiles.0.0.1First release with only MongoDB/Ming support.
Package: tgext.langdomain
About tgext.langdomaintgext.langdomain is a TurboGears2 extension that supports detecting the user
language from the domain it is connecting from.Installingtgext.langdomain can be installed from pypi:pip install tgext.langdomainshould just work for most of the users.EnablingTo enable tgext.langdomain put inside your applicationconfig/app_cfg.pythe following:import tgext.langdomain
tgext.langdomain.plugme(base_config)or you can usetgext.pluggablewhen available:from tgext.pluggable import plug
plug(base_config, 'tgext.langdomain')Optionslangdomain will force the language of the current request based on:Top Level Domain,SubDomainandparamunless there is
already a language stored into the session.By default none of those behaviours is enabledWhen plugging langdomain the following options to turn on behaviours are available:param-> Name of the GET param used to force language,Truemeanslang.tld-> Dict oftldthat map to a languageEXAMPLE:plug(app_cfg, 'tgext.langdomain',
     tld={
       'com': 'en',
       'it': 'it'
})subdomain-> Dict of subdomains that map to a languageEXAMPLE:plug(app_cfg, 'tgext.langdomain',
     subdomain={
       'en': 'en',
       'it': 'it'
})When requests are performed likeit.server.netit will lookupitinside
thesubdomaindictionary andnetinside thetlddictionary.
Package: tgext.less
About tgext.lessLESSis a dynamic stylesheet language that extends CSS with dynamic behaviour
such as variables, mixins, operations and functions.tgext.less is a middleware aimed at makingTurboGears2development easier,
tgext.less converts regular less files to css using the official less compiler (lessc), thus it currently
requires is to be installed.tgext.less is based ontgext.scssby Alessandro Molina and is
under the same license (MIT).Installingtgext.less can be installed both from pypi or from bitbucket:easy_install tgext.lessYou will also need to install the less compiler, for instructions on this check the less website under the
server side usage section.http://www.lesscss.org/Enabling tgext.lessUsing tgext.less is really simple, you edit yourconfig/middeware.pyand just after
the#Wrap your base TurboGears 2 application with custom middleware herecomment wrapappwithLESSMiddleware:from tgext.less import LESSMiddleware

make_base_app = base_config.setup_tg_wsgi_app(load_environment)

def make_app(global_conf, full_stack=True, **app_conf):
    app = make_base_app(global_conf, full_stack=True, **app_conf)

    # Wrap your base TurboGears 2 application with custom middleware here
    app = LESSMiddleware(app)

    return appNow you just have to put your .less files insidepublic/cssand they will be served as CSS.Cache BackendsYou can change the cache backend storage into any dict like object that can serialize a dict object,
for example, you can use beaker cache by passing the cache object to the middleware constructor:from tgext.less import LESSMiddleware
from tg import cache

make_base_app = base_config.setup_tg_wsgi_app(load_environment)

def make_app(global_conf, full_stack=True, **app_conf):
    app = make_base_app(global_conf, full_stack=True, **app_conf)

    # LESS with beaker cache backend
    app = LESSMiddleware(app, cache=cache)

    return appJinja2 Extensiontgext.less provides and extension for jinja2 templates to compile LESS embedded directly on your templates,
to activate it just add it to your config/app_config.py file the following:from tgext.less.jinja import LessExtension

base_config.jinja_extensions = [LessExtension]Now you can use the less tag in your templates:<style type="text/css">
{% less "main" %}
#header {
    h1 {
        font-size: 24pt;
    }
}
{% endless %}
</style>Where “main” is a unique identifier for that LESS section.You should take into account that when using mixins or any other identifier not defined inside the
tag the LESS code will fail to compile, you can use the @import statement to include a file, in which
case you should include the path relative to your static file directory:<style type="text/css">
{% less "main" %}
@include "css/bootstrap.less";
#round_box {
    .border-radius(5px);
}
{% endless %}
</style>You should be aware that when using this extension with the LESS import statement the output can get
big quickly as the compiler currently does not just get the necessary things from the imported file but
it just naively includes the whole file (as in the example, the while bootstrap library will be included).
Package: tgext.matplotrender
About tgext.matplotrendertgext.matplotrender is a TurboGears2 extension that provides a Rendering Engine
for MatplotLib Figures.Installingtgext.matplotrender can be installed from pypi:pip install tgext.matplotrendershould just work for most of the users.EnablingTo enable tgext.matplotrender add thematplotfigrenderer to your
configuration:base_config.renderers.append('matplotfig')and plug the rendering engine inside yourconfig/app_cfg.py:importtgext.matplotrendertgext.matplotrender.plugme(base_config)UsageUsing tgext.matplotrender is as simple as exposing an action with
thematplotfigtemplate and returning the figure itself inside
thefigkey of action returned dictionary.Given the following figure:def_make_fig():fig=matplotlib.figure.Figure(figsize=(9,6))fig.Name="Sinewave"ax=fig.add_subplot(111)ax.set_xlabel("angle")ax.set_ylabel("amplitude")t=numpy.arange(0.0,2.0,0.01)s1=numpy.sin(2*numpy.pi*t)ax.plot(t,s1,color="k")returnfigIt can be exposed through TurboGears actions as:classRootController(TGController):@expose('matplotfig')deffigure(self,*args,**kwargs):returndict(fig=_make_fig())@expose('matplotfig',render_params=dict(dpi=36))deflowres(self,*args,**kwargs):returndict(fig=_make_fig())@expose('matplotfig')defcustomres(self,*args,**kwargs):options={}try:options['dpi']=int(kwargs['dpi'])except:passreturndict(fig=_make_fig(),**options)Any other value provided in the dictionary will be used as
aprint_figureargument inmatplotlib