Saravanan666/pypi-org huggingface dataset:
Package: simplesuper
SimpleSuperLicense: ISC - See LICENSE.txt fileThis is a simple piece of code born out of our frustration with the
repetitiveness of calling overridden methods in python.
having to writesuper(TheCurrentClassThatImIn, self).the_method_that_im_currently_in(all, the, arguments, again)every time you want to do that is just not DRY and makes refactoring
that much more tedious.Wouldn't it be much cooler if you could just write self.super() instead?
Yeah, we thought so, too.In the class where you want to use this (or any superclass),
you need to make the SuperProxy available like this:class SuperClass(object):
    super = SuperProxy()Afterwards you can just use it in three forms in any method:Auto-pick-up all available arguments and call the super method of the current methodself.super()Call super method of current method but with explicit argumentsself.super(some_arguments)Get a proxy for the superclass and call a specific method with specific argumentsself.super.whatever_method(whatever, arguments)(self.super is the same as super(CurrentClass, self) but more DRY)Known Bugs:Works only for object subclasses (new style classes)Doesn't find super-methods of decorated methods as the code
of the current method can't be found in the class object under
the name of the method.TODO:Find a way so you can do something like from simple_super import
use_in_object to get every object enhanced by its niceness.Changelog:1.0.10 (2023-01-10)Drop support for python 3 versions below 3.6 that are not supported by
the python team anymore.Add support for all modern python versions up to 3.111.0.5 and 1.0.6, 1.0.7, 1.0.8, 1.0.9 (2016-09-07)package for pypi to have an easy dependencysmall cleanups to make it easier to step over this code in the debugger1.0.4 (2010-06-06)Add heuristic to move arguments to kwargs if lower method has more named
arguments than the upper method1.0.3 (2010-05-31)Added compatibility for Python 3Moved stand-alone functions into nice classes1.0.2 (2010-03-27)Simplistic heuristic detection if self.super() or
self.super(*args, **kwargs) was called so we can pass the right parametersMade simple_super compatible with Python 2.3 and old-style classes1.0.1do not add arguments if subclass uses self.super() and super class does
not get any arguments besides self.1.0initial release
Package: simplesvg
Simple python library for programatically building SVG XML. (backed by xml4hhttps://github.com/jmurty/xml4h)WhyThere are two solid libraries for doing similar things already (pySVGhttp://codeboje.de/pysvg/and svgwritehttps://pypi.python.org/pypi/svgwrite/), but neither does quite what I find myself needing so succinctly as this.Installationpip install simplesvgFunctionsA note on **kwargsFor all of thekwarg-using functions below, any arguments passed will be directly added to the XML elements. Camel case will be converted to hyphenated words automatically (e.g.strokeWidthbecomesstroke-width). Common usage of this would befill,stroke,stroke-width, andid. Seeexample.pyfor some usage of these.simplesvg.SVG(width, height, **kwargs)Creates a new SVG document with specified with and height (in pixels). Elements within can exceed these bounds (but they might not be rendered depending on what’s being used to display the SVG).SVG.to_xml()Serializes the document to XML and returns the resulting string.SVG.circle(x, y, r, **kwargs)x,y= coordinate for the center of the circler= radiusSVG.rectangle(x, y, width, height, **kwargs)x,y= coordinate of the upper-left corner of the rectanglewidth,height= dimensions of the rectangleSVG.line(x1, y1, x2, y2, **kwargs)x1,y1= coordinate of the first point.x2,y2= coordinate of the second point.SVG.polygon(points, **kwargs)points= an ordered list of pairs representing points on the polygon (e.g.[(1,2), (3,4), (1,6]])simplesvg.rgb(r, g, b)Helper function that you can pass withfillorstroketo used RGB colors instead of named colors.Seeexample.pyin the repo for usage of all of this.
Package: simple-swag
simple-swagswagis a simple Static Website Auto-Generator (also known as aStatic Site Generatoror SSG).To use it, first install to your Python environment:pipinstallgit+https://github.com/peterprescott/simple-swagThen make a new folder for your site:mkdirnew-sitecdnew-siteAnd useswagtostarta new site:swagstartThen serve it locally:swagserve
Package: simple-symbolic-robotics
Simple Symbolic RoboticsSimple Symbolic Robotics is a Python library providing a collection of helper functions designed for fundamental robotics computations, particularly in kinematics. This library leverages symbolic computation using SymPy, combined with numerical libraries like NumPy and SciPy, to offer a versatile toolkit for robotics enthusiasts, researchers, and engineers.FeaturesSymbolic computation of skew-symmetric matrices.Functions to validate and compute rotation matrices.Utilities for handling homogeneous transformations and rotations.Simplified interfaces for common robotics calculations.InstallationInstall Simple Symbolic Robotics using pip:pipinstallsimple_symbolic_roboticsUsageImport the library and use its functions in your Python scripts or interactive sessions.importsimple_symbolic_roboticsasssr# Example usage:R=ssr.Rx(pi/4)# Rotation about the x-axis by 45 degreesFor more use see jupyter notebooks in thenotebooks folder:ContributingContributions are welcome! If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.LicensingThe code in this project is licensed under the MIT License.
Package: simplet5
Quickly train T5/mT5/byT5 models in just 3 lines of codesimpleT5is built on top of PyTorch-lightning⚡️ and Transformers🤗 that lets you quickly train your T5 models.T5 models can be used for several NLP tasks such as summarization, QA , QG , translation , text generation, and more.Here's a link toMedium articlealong with anexample colab notebookInstall# It's advisable to create a new python environment and install simplet5pipinstall--upgradesimplet5UsagesimpleT5for summarization task# importfromsimplet5importSimpleT5# instantiatemodel=SimpleT5()# load (supports t5, mt5, byT5 models)model.from_pretrained("t5","t5-base")# trainmodel.train(train_df=train_df,# pandas dataframe with 2 columns: source_text & target_texteval_df=eval_df,# pandas dataframe with 2 columns: source_text & target_textsource_max_token_len=512,target_max_token_len=128,batch_size=8,max_epochs=5,use_gpu=True,outputdir="outputs",early_stopping_patience_epochs=0,precision=32)# load trained T5 modelmodel.load_model("t5","path/to/trained/model/directory",use_gpu=False)# predictmodel.predict("input text for prediction")ArticlesGeek Culture: simpleT5 — Train T5 Models in Just 3 Lines of CodeAbstractive Summarization with SimpleT5⚡️Training T5 model in just 3 lines of Code with ONNX InferenceKaggle: simpleT5⚡️ -  Generating one line summary of papersYoutube: Abstractive Summarization Demo with SimpleT5AcknowledgementsTransformers by HuggingFace 🤗Pytorch Lightning ⚡️Fastt5
Package: simpletable
This module removes some of the boiler-plate code required to use the excellentpytablesmodule to save and access structured data.Example Usage:>>> from simpletable import SimpleTable
>>> import tablesdefine a table as a subclass of simple table.>>> RGB = tables.Enum(list('RGB'))
>>> class ATable(SimpleTable):
...     x = tables.Float32Col()
...     y = tables.Float32Col()
...     name = tables.StringCol(16)
...     color = tables.EnumCol(RGB, 'R', 'uint8')instantiate with: args: filename, tablename>>> tbl = ATable('test_docs.h5', 'atable1')insert as with pytables:>>> row = tbl.row
>>> for i in range(50):
...    row['x'], row['y'] = i, i * 10
...    row['name'] = "name_%i" % i
...    # NOTE how we have to manually translate the enum column.
...    row['color'] = RGB['G']
...    row.append()
>>> tbl.flush()can have the enum cols automatically translated usinginsert>>> data = {'x': 1000, 'y': 2000, 'color': 'G', 'name': 'flintstone'}
>>> tbl.insert(data, row)
>>> row.append()
>>> tbl.flush()there is alsoinsert_many()method with takes an iterable
of dicts with keys matching the colunns (x, y, name) in this
case.query the data (query() alias of tables’ readWhere()
note that pytables sends back the data with enum cols as they were
and does nothing to translate them to their original values.>>> tbl.query('(x > 4) & (y < 70)') #doctest: +NORMALIZE_WHITESPACE
array([(1, 'name_5', 5.0, 50.0), (1, 'name_6', 6.0, 60.0)],
       dtype=[('color', '|u1'), ('name', '|S16'), ('x', '<f4'), ('y', '<f4')])get translated enumcols in an iterator with the .q  method.>>> r = tbl.q('x == 1000') # doctest: +NORMALIZE_WHITESPACE
>>> r # doctest: +ELLIPSIS
<generator ...>>>> list(r)
[{'color': 'G', 'x': 1000.0, 'name': 'flintstone', 'y': 2000.0}]or use thetranslate_enummethod>>> for row_with_enum in tbl.query('(x > 4) & (y < 70)'):
...     tbl.translate_enum(row_with_enum)
{'color': 'G', 'x': 5.0, 'name': 'name_5', 'y': 50.0}
{'color': 'G', 'x': 6.0, 'name': 'name_6', 'y': 60.0}Note that usingqortranslate_enumwill affect performance.
Package: simpletag
Sourcehttps://github.com/yangacer/simpletagUsage>>> import simpletag

>>> ns = simpletag.TextNS('myTextTagSpace') # Create a namespace of text IDs
... # Create integer IDs namespace with `simpletag.IntNS()`

>>> doc_1 = '/a/b'
>>> tags_1 = ['tag']

>>> doc_2 = '/b/a'
>>> tags_2 = 'tag simple!'

>>> ns.update(doc_1, tags_1)
>>> ns.update(doc_2, tags_2)

>>> print [ doc for doc in ns.query_ids('tag') ]
[u'/a/b', u'/b/a']

>>> print [ tag for tag in ns.query_tags(doc_1) ]
[u'tag']

>>> print [ st for st in ns.stats() ]
[{
    'term': u'simple', 'documents': 1, 'occurrences': 1
}, {
    'term': u'tag', 'documents': 2, 'occurrences': 2
}]

>>> ns.purge()Tag QueryTag set query with SQLite FTS query syntax.>>> ns.update(1, [u'民主', u'自由'])
>>> ns.update(2, [u'民主', u'Cxin123'])

>>> query  = ''
... # Query IDs of tags '民主' but not 'Cxin*' (tags start with Cxin)

>>> if ns.using_parenthesis_query:
>>>     query = u'民主 NOT Cxin*'
>>> else:
>>>     query = u'民主 -Cxin*'

>>> print [tag for tag in ns.query_ids(query)]
[1]NOTESQLite supportsstandardandparenthesissyntax, and
the two are enabled mutual exclusively at compiling SQLite. Detect which one
being used thrusimpletag.ns.using_parenthesis. SeeSQLite
documentationfor
further information.TODOsAs a Flask plug-inBenchmarkFurther tags analytics (e.g. top-k ~ KNN classification)
Package: simple-tagger
# tagger
Simple console tool for manage tag on files and directoriesTool provide 4 console tool for manage tags:
- tag - set tag(s) to files or directories
- lstag - show files or directories that have specified tag
- lsotag - show tag(s) for specified files or directories
- rmtag - remove tag(s) from specified files or directoriesYou can know about parameters of these tool by adding “–help” parameter.Tool use sqlite database to store information about files and tags.
By default database location is ~/.tagger.db.
You can change this by creating config /etc/tagger.conf (for all users) or ~/.tagger.conf (only for one user)
Example of config you can find in repo.
Package: simpletap
simpletapis a test runner that integrates with the unittest framework to
produceTAP (Test Anything Protocol)compatible output.UsageIn your test scripts, instead of:if__name__=="__main__":unittest.main()use:if__name__=="__main__":fromsimpletapimportTAPTestRunnerunittest.main(testRunner=TAPTestRunner(buffer=True))A small test case like:importunittestclassIntegerArithmeticTestCase(unittest.TestCase):deftestAdd(self):# test method names begin 'test*'"test adding values"self.assertEqual((1+2),3)self.assertEqual(0+1,1)deftestMultiply(self):"test multiplying values"self.assertEqual((0*10),0)self.assertEqual((5*8),40)deftestFail(self):"a failing test"self.assertEqual(0,1)@unittest.expectedFailuredeftestExpectFail(self):"we saw this coming"self.assertEqual(0,1)@unittest.expectedFailuredeftestUnexpectFail(self):"someone fixed it already"self.assertEqual(0,0)@unittest.skipIf(True,"Skipping this one")deftestSkip(self):"pending a fix"self.assertEqual(0,1)deftestError(self):"oops something went wrong"no_such_variable+1# Oops!if__name__=="__main__":fromsimpletapimportTAPTestRunnerunittest.main(testRunner=TAPTestRunner(buffer=True))When saved in a file calledtest.pyand executed would produce:1..7ok1- test.py: test adding valuesnot ok2- test.py: oops something went wrong# ERROR: NameError on file test.py line 38 in testError: 'no_such_variable + 1  # Oops!':
#        name 'no_such_variable' is not definedok3- test.py: we saw this coming#TODO# EXPECTED_FAILURE: AssertionError on file test.py line 24 in testExpectFail: 'self.assertEqual(0, 1)':
#                   0 != 1not ok4- test.py: a failing test# FAIL: AssertionError on file test.py line 19 in testFail: 'self.assertEqual(0, 1)':
#       0 != 1ok5- test.py: test multiplying valuesok6- test.py: pending a fix#skip# SKIP:
#       Skipping this onenot ok7- test.py: someone fixed it already# FIXED
# UNEXPECTED_SUCCESS:
#                     testUnexpectFail (__main__.IntegerArithmeticTestCase)You can also launchsimpletapdirectly from the command line in much the same way you do with unittest:python -m simpletap test.IntegerArithmeticTestCaseTestingThe test suite is configured to run viatox.Projectssimpletapis currently being used by:taskwarriorfirefox_decryptChangelog2.0.0skipkeyword is no longer used. Now fully compliant withTAPusingok/not okSKIPnow results inokEXPECTED_FAILUREnow results inokUNEXPECTED_SUCCESSis now explicitly handled and results innot ok
Package: simpletap-lib
SimpleTapConfigurationThe configuration file is a JSON file in the config directory in the user's profile. Here is an example:{"servers":[["1.sts.benmickler.com",5623]],"benmickler.simpletap.switchbox.switches":{"switchbox_name":"SimpleTap switchbox","auto_connect":true},"benmickler.simpletap.rfid.mfrc522":{"scan_delay":0.75},"extensions":{"disabled":["benmickler.simpletap.rfid.mfrc522"],"auto_start":true},"package_manager":{"repositories":[{"url":"packages.st.benmickler.com","auto update":true,"auto upgrade apps":true,"auto upgrade packages":true,"auto upgrade system":true,"auto upgrade extensions":true}]},"benmickler.simpletap.tts.polly":{"aws_access_key_id":"[YOUR AWS ACCESS KEY ID]","aws_secret_access_key":"[YOUR AWS SECRET ACCESS KEY]","voices":{"en":"Olivia","de":"Vicki"},"output_format":"mp3","region_name":"ap-southeast-2"},"main app":"benmickler.simpletap.main"}
Package: simpletaskrun
A simple interface of excuting python functions or shell commands parallellyimportosfromsimpletaskrunimportRunnerdeftask(cmd):#execute shell command and python codeos.system(cmd)print('%shas been echoed'%cmd.split(' ')[-1])# 10 is the max task num in same timerunner=Runner(10)foriinrange(100):cmd='echo%s'%irunner.add(task,[cmd])runner.clear()
Package: simpletasks
simpletasksSimple tasks runner for Python.This can be helpful to handle automated processes and make them available via command line interface viaclick.UsageSample:importclickfromsimpletasksimportCli,CliParams,Task@click.group()defcli():pass@Cli(cli,params=[click.argument("n",type=int),CliParams.progress()])classFibonacciTask(Task):defcompute(self,n:int)->int:self.logger.debug(f"Called with n={n}")f1,f2=0,1ifn==0:returnf1ifn==1:returnf2for_inself.progress(range(1,n)):f1,f2=f2,f1+f2returnf2defdo(self)->None:n=cast(int,self.options.get("n"))result=self.compute(n)print(f"f({n}) ={result}")if__name__=="__main__":cli()Gives:$pythonsample/compute.pyfibonacci3--no-progress
f(3)=2ContributingTo initialize the environment:poetry install --no-root
poetry install -E click -E tqdmTo run tests (including linting and code formatting checks), please run:poetry run pytest --mypy --flake8 && poetry run black --check .
Package: simple-tcp
SIMPLE TCP TESTING TOOLSimple tools to manually test socket programming project. Requires python3.Features:Arguments can be inputted via command line arguments vs via interactive consoleVerbose mode vs silent modeSSL/TLS wrapped socket (optional)Does not require additional python module (only usingsocket,argparse,ssl, andsys)Common Usage:python3 simple_tcp.py -s -p 3000: start server socket on port 3000 and accept connection from all interfacepython3 simple_tcp.py -c -h 192.168.1.20 -p 3000: connect to 192.168.1.20:3000python3 simple_tcp.py -i: interactive mode, the script will ask for host, port and mode interactively (easier for noobs)Arguments:"-h"/"--help": display all command line arguments"-a"/"--host": (optional) set target host, ex:-a 192.168.137.20, will default tolocalhostif not set"-p"/"--port": (optional) set target port, ex:-p 8888, will default to80if not set"-b"/"--buffer": (optional) set buffer size, ex:-b 1024, will default to4092if not setflag mode: "-s"/"--server" or "-c"/"--client", can only choose one, will default to client mode if not setflag interactive: "-i"/"--interactive", ask for host, port, buffer, and mode interactively (automatically assumed if no arguments provided)flag verbose: "--verbose", display verbose output (useful for debugging)SSL Arguments:flag ssl: "--ssl": add this flag to use ssl mode"--ssl_server_certificate": set path to ssl server certificate (for ssl server mode only)"--ssl_server_privatekey": set path to ssl server private key (for ssl server mode only)"--ssl_client_ca": set path to certificate authority (CA)'s certificate (for ssl client mode only)
Package: simpletcpclient
Simple TCP ClientA simple interactive TCP client, written in Python. Basically a simple python version of netcat.Installationpip3installsimpletcpclientUsagesimpletcpclient<server><port>Simple TCP client also has built-inautocomplete, activated using thetabkey. It currently supports basic HTTP and SMTP commands:GET,Host:,MAIL FROM:,RCPT TO:etc.
Package: simpletemplate
基于代码生成的简单模板引擎installpip3installsimpletemplatefromsimpletemplateimportTemplateTemplate("Hello, {{name}}!").render({'name':'world'})模板语法%{fields=jclass.fields}%

private{{jclass.name}}(Builderbuilder){%{forfieldinfields:}%this.{{field.name}}=builder.{{field.name}};%{end}%}publicstaticclassBuilder{%{forfieldinfields:}%private{{field.jtype}}{{field.name}}=null;%{end}%%{forfieldinfields:}%%{iffield.comment:}%/***{{field.comment}}*/%{end}%publicBuilderset{{field.name.title()}}({{field.jtype}}{{field.name}}){this.{{field.name}}={{field.name}};returnthis;}%{end}%public{{jclass.name}}build(){returnnew{{jclass.name}}(this);}}测试代码'''interface'''deftest_template():classObj:passdefjfield(jtype:str,name:str,*,modifier:str='',init_value:str='',comment:str=''):field=Obj()field.modifier=modifierfield.jtype=jtypefield.name=namefield.initial_value=init_valuefield.comment=commentreturnfielddata=Obj()data.name='ShareConfig'data.fields=[]data.fields.append(jfield('Tencent','tencent',modifier='private final'))data.fields.append(jfield('IWXApi','wxApi',modifier='private final',comment='wechat share'))print(Template(TMPL_BUILDER).render({'jclass':data}))if__name__=='__main__':test_template()generated Java CodeprivateShareConfig(Builderbuilder){this.tencent=builder.tencent;this.wxApi=builder.wxApi;}publicstaticclassBuilder{privateTencenttencent=null;privateIWXApiwxApi=null;publicBuildersetTencent(Tencenttencent){this.tencent=tencent;returnthis;}/*** wechat share*/publicBuildersetWxapi(IWXApiwxApi){this.wxApi=wxApi;returnthis;}publicShareConfigbuild(){returnnewShareConfig(this);}}
Package: simple-template
simple_templateA templating library for simple placeholder filling. Useful when the full might
ofJinjaand friends is unnecessary.Installationsimple_template can be installed fromPyPIorconda-forge.Install from PyPIpipinstallsimple_templateInstall from conda-forgecondainstall-cconda-forgesimple_templateUsageUsage information can be found by runninghelp(simple_template).Help on module simple_template:

NAME
    simple_template - Fills in placeholder values in a string or file.

DESCRIPTION
    Intended for HTML files. Simple substitution only, with an easy API

CLASSES
    class TemplateError(builtins.KeyError)
        Rendering a template failed due a placeholder without a value.

FUNCTIONS
    render(template: str, /, **variables) -> str
        Render the template with the provided variables.

        The template should contain placeholders that will be replaced. These
        placeholders consist of the placeholder name within double curly braces. The
        name of the placeholder should be a valid python identifier. Whitespace
        between the braces and the name is ignored. E.g.: `{{ placeholder_name }}`

        An exception will be raised if there are placeholders without corresponding
        values. It is acceptable to provide unused values; they will be ignored.

        Parameters
        ----------
        template: str
            Template to fill with variables.

        **variables: Any
            Keyword arguments for the placeholder values. The argument name should
            be the same as the placeholder's name. You can unpack a dictionary of
            value with `render(template, **my_dict)`.

        Returns
        -------
        rendered_template: str
            Filled template.

        Raises
        ------
        TemplateError
            Value not given for a placeholder in the template.
        TypeError
            If the template is not a string, or a variable cannot be casted to a
            string.

        Examples
        --------
        >>> template = "<p>Hello {{myplaceholder}}!</p>"
        >>> simple_template.render(template, myplaceholder="World")
        "<p>Hello World!</p>"

    render_file(template_path: str, /, **variables) -> str
        Render a template directly from a file.

        Otherwise the same as `simple_template.render()`.

        Examples
        --------
        >>> simple_template.render_file("/path/to/template.html", myplaceholder="World")
        "<p>Hello World!</p>"Licencesimple_template is licenced under the BSD0 licence, so you can do whatever you
like with it. See the full licence text in theLICENCEfile.
Package: simple-termenu
Simple Termenusimple-termenu is a package for create a simple terminal menu with lot of efforts.Installation :pip install simple-termenuUtilisation :print(print(simple-termenu.menuMaker(data, title, style, parameters))data :If you don't want to use custom index use list like that : ["first","second","third"]But if you want to use custom index type this : [["index", "first"], ["index", "second"], ["index", "third"]]You can also mix like : ["first", "second", ["index", "third"]]title :Just a string like "title" or "This is title"style :You have rounded, flat, doubled and unicode styleparameters :List like [2,2,1,1,0] (this is default values)
1 margin, the space outside menu2 padding, the space inside menu3 space, inside at top and bottom4 index, the first index, exemple : 1 if you want "1,2,3,.." or X if you want "x,x+1,x+2,...5 title margin, the margin before the title start at 0Helpsimple-termenu.help()
Package: simple_terminal
[<img src="https://travis-ci.org/seanchon/simple_terminal.svg?branch=master">](https://travis-ci.org/seanchon/simple_terminal)[<img src="https://img.shields.io/pypi/pyversions/simple-terminal.svg">](https://pypi.python.org/pypi/simple_terminal)# simple_terminalA simple way to run terminal commands within a Python script.## Code Example```pythonfrom simple_terminal import Terminalterminal = Terminal()results = terminal.command('ls')```or```pythonfrom simple_terminal import Terminalwith Terminal() as terminal:results = terminal.command('ls')```## MotivationThis library exists to run terminal commands from within a script and capture stdout to create easier automation of commonly performed tasks.## Installationpip install simple_terminal## LicenseMIT
Package: simpletex
simpletex: Simple LaTeX Documentssimpletex is a Python library for automatically generating LaTeX documents. It is extremely easy to use:fromsimpleteximportwrite,savefromsimpletex.documentimportDocument,Section,SubsectionwithDocument(size='11pt'):withSection('Section Name'):withSubsection('Subsection Name'):write('Hello World!')save('filename.tex')Full documentation can be found athttp://simpletex.readthedocs.io/.