Saravanan666/pypi-org huggingface dataset:
Package: delcom904x
delcom904xdelcom904x is a python class and command-line script to control theDelcom Products 904x
series multi-color visual signal indicators.
These are USB HID devices that are easily controllable from most platforms.It has been tested with the904005-SBbut should work with any of the other models without any issues. The yellow in the green,
red andyellowindicators is wired the same as blue. There also doesn't appear to be a
method of detecting if the attached indicator supports blue or yellow, so blue and yellow
commands are synonyms.Installation$ pip install delcom904x
    $ control_delcom904x --green --red --flash --cyclecontrol-delcom904xusage-h, --help        show this help message and exit
    --list            List all USB devices.
    --info            Returns info on the device.
    --red             Enable the red light.
    --green           Enable the green light.
    --blue            Enable the blue light.
    --yellow          Enable the yellow light (if equipped; synonym for blue).
    --flash           Turns on flashing.
    --cycle [100]     Turns on cycling.
    --intensity [80]  Sets brightness: 0-100.
    --buzzer          Buzzes three times.
    --reset           Resets the device.Python Code Exampleimportdelcom904xlight=delcom904x.DelcomMultiColorIndicator()light.set_color(delcom904x.red,flashing=True)udev NotesOn Linux machines, the default udev rulesets may set the permissions on the device to only
be accessible to the root user. Add the following rule to/etc/udev/rules.d/and
re-plugin the indicator to allow all users to access the device (optionally, consider
changingMODE="0666"toGROUP="dialout"to allow only the dialout group access).SUBSYSTEMS=="usb", ATTRS{idVendor}=="0fc5", ATTRS{idProduct}=="b080", MODE="0666"
Package: delegable
DelegableSummaryDelegable is a simple Python alternative to Ruby on Rails' delegate module, which makes delegation easy. It enables any class to delegate its functions to an instance of another one. Here's an example:@delegableclassQue:def__init__(self):self.q=[]self.delegate('append','pop',to='q')que=Que()que.append(1)que.pop()# => 1Features:Inheritance SafeNo dependent librariesAvailable for py35, py36, py37, py38InstallpipinstalldelegableGetting StartedBasic UsagePlace @delegable.delegator on the top of a class in which you want to enable delegation.importdelegable@delegable.delegatorclassQue:def__init__(self,name='default_queue'):self._name=nameself.q=[]self.delegate('append','pop',to='q')@propertydefall(self):returnself.qque=Que('')que.append(1)que.append(2)que.pop(0)assertque.all==[2]Inheritance SafeIt works well with classes inheriting its parent which uses@delegable.delegtorwithout any problem.classQue2(Que):def__init__(self,name='default_queue'):super().__init__(name)que1=Que('')que2=Que2('')que1.delegate('append','pop',to='q')que2.delegate('append','pop',to='q')que1.append(1)que2.append(2)assertque1.all==[1]assertque2.all==[2]delegatesThe decorator offers a property,delegatesto define delegates all at once. Note it overwrites whole delegates but doesn't merge delegates.@delegable.delegatorclassQue:def__init__(self,name='default_queue'):self._name=nameself.q=[]self.delegate('append','pop',to='q')self.delegates={'s':'join'}assertque.join('ab')=='a,b'que.append(1)# => AttributeError("'Que' object has no attribute 'append'")How to TestThis project usestoxto test it against different versions of Python, with underlying pyenv.Set upYou have to have pyenv installed to run tox in this project.TestTo test with all versions:toxTo test with a certain version:tox-epy37orpyenvshell3.7.7
pytest
Package: delegate
Class to automate delegation decisions based on inheritance graph.Copyright 2004, Robert Dick (dickrp@eecs.umich.edu).Whenever you need to delegate to something, inherit from delegate and useself.__<base>.<method()> to access the base.  If the delegation wasinappropriate due to reconverging paths in the inheritance graph, the returnvalue will be None.  In the case of reconverging paths, the left-most call inthe method resolution order will be honored.  The rest will be nulified.  Youcan also check to see if the base is the no_delegation object.  Delegate to allyour bases if you need everything in the inheritance graph to be visited.  Aslong as one of a class's (transitive) bases inherits from Delegate, that'senough.For examples of use, please see the delegate.py file.Python doesn't yet automate meta-class instantiation.  If you need to inheritfrom Delegate and another class that does not have a 'type' metaclass, you'llneed to generate a shared derived metaclass and explicitly use that as yourclass's metaclass.  For example:import Delegate, qtclass sip_meta_join(type(Delegate), type(qt.QObject)):def __init__(*args):type(Delegate).__init__(*args)type(qt.QObject).__init__(*args)class MyClass(Delegate, qt.QObject):__metaclass__ = sip_meta_join...Please see the license file for legal information.
Package: delegatefn
delegatefnA Python package for adding the parameters of a delegatee function to a delegator function, while keeping the original parameters of the delegator function.InstallationTo installdelegatefn, usepip:pipinstalldelegatefnUsageTo use thedelegatedecorator function, import it fromdelegatefn:fromdelegatefnimportdelegateThen, decorate your delegator function with thedelegatedecorator, passing in the delegatee function as an argument:@delegate(delegatee)defdelegator(c:int,d:int,e:int,**kwargs):...The delegator function will now have the parameters of delegatee added to it, while keeping its original parameters.You can also customize the behavior of thedelegatedecorator by passing in the following keyword arguments:kwonly: A boolean value indicating whether the parameters of delegatee should be converted to keyword-only arguments. The default value isTrue.delegate_docstring: A boolean value indicating whether the docstring of delegatee should be used as the docstring of the delegator function. The default value isTrue.ignore: An iterable of strings containing the names of the parameters of delegatee that should be ignored. The default value is an empty set.Here is an example of how to use these keyword arguments:@delegate(delegatee,kwonly=True,delegate_docstring=True,ignore={"a","b"})defdelegator(c:int,d:int,e:int,**kwargs):...ExampleHere is an example of how to use thedelegatedecorator:fromdelegatefnimportdelegatedefdelegatee(a:int,b:int,**kwargs):...@delegate(delegatee)defdelegator(c:int,d:int,e:int,**kwargs):...The delegator function will now have the parametersa: int,b: int, andkwargsadded to it, in addition to its original parametersc: int,d: int, ande: int.AcknowledgementsThis approach was inspired byfast.ai.
Package: delegate-property
DelegateA python library for delegation (the metaprogramming feature)This library adds the@delegatedecorator which may be used to delegate
attributes from an attribute of the existing class. For example:fromdelegateimportdelegateclassParent:def__init__(self):self.a="a"self.b="b"self.d="d"# The delegate decorator makes .a and .b available on Child, through its# "parent" attribute, as though Child had an a and b attribute itself.@delegate("a","b",to="parent")classChild:def__init__(self):self.parent=Parent()self.c="c"instance=Child()assertinstance.a=="a"raised=Falsetry:# But d is not availableinstance.dexcepte:raised=Trueassertraised
Package: delegator
delegatePython implementation of Ruby’s delegate.rblicenseThe MIT License (MIT)Copyright (c) 2013 Hugo BastienPermission 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.
Package: delegator.py
Delegator.py — Subprocesses for Humans 2.0=======================================.. image:: https://img.shields.io/pypi/v/delegator.py.svg:target: https://pypi.python.org/pypi/delegator.py.. image:: https://img.shields.io/pypi/l/delegator.py.svg:target: https://pypi.python.org/pypi/delegator.py.. image:: https://img.shields.io/pypi/wheel/delegator.py.svg:target: https://pypi.python.org/pypi/delegator.py.. image:: https://img.shields.io/pypi/pyversions/delegator.py.svg:target: https://pypi.python.org/pypi/delegator.py.. image:: https://img.shields.io/badge/SayThanks.io-☼-1EAEDB.svg:target: https://saythanks.io/to/kennethreitz**Delegator.py** is a simple library for dealing with subprocesses, inspiredby both `envoy <https://github.com/kennethreitz/envoy>`_ and `pexpect <http://pexpect.readthedocs.io>`_ (in fact, it depends on it!).This module features two main functions ``delegator.run()`` and ``delegator.chain()``. One runs commands, blocking or non-blocking, and the other runs a chain of commands, separated by the standard unix pipe operator: ``|``.If you're interested in financially supporting Kenneth Reitz open source, consider `visiting this link <https://cash.me/$KennethReitz>`_. Your support helps tremendously with sustainability of motivation, as Open Source is no longer part of my day job.Basic Usage-----------Basic run functionality:.. code:: pycon>>> c = delegator.run('ls')>>> print c.outREADME.rst   delegator.py>>> c = delegator.run('long-running-process', block=False)>>> c.pid35199>>> c.block()>>> c.return_code0Commands can be passed in as lists as well (e.g. ``['ls', '-lrt']``), for parameterization.Basic chain functionality:.. code:: pycon# Can also be called with ([['fortune'], ['cowsay']]).# or, delegator.run('fortune').pipe('cowsay')>>> c = delegator.chain('fortune | cowsay')>>> print c.out_______________________________________/ Our swords shall play the orators for \| us.                                   ||                                       |\ -- Christopher Marlowe                /---------------------------------------\   ^__^\  (oo)\_______(__)\       )\/\||----w |||     ||Expect functionality is built-in too, on non-blocking commands:.. code:: pycon>>> c.expect('Password:')>>> c.send('PASSWORD')>>> c.block()Other functions:.. code:: pycon>>> c.kill()>>> c.send('SIGTERM', signal=True)# Only available when block=True, otherwise, use c.out.>>> c.err''# Direct access to pipes.>>> c.std_err<open file '<fdopen>', mode 'rU' at 0x10a5351e0># Adjust environment variables for the command (existing will be overwritten).>>> c = delegator.chain('env | grep NEWENV', env={'NEWENV': 'FOO_BAR'})>>> c.outNEWENV=FOO_BARInstallation------------::$ pip install delegator.py✨🍰✨
Package: delegatum
Simple cascading/nested scope/namespace managerDelegatum walks a list of objects that can represent key/value
mappings and returns the first match found for a key.Supports dictionaries, argparse, configparser, mapping functionsMost dictionary-like objects should work as wellPython json and yaml parsers return dictionaries, and so are supportedExamplesThe following example searches, in order: command line arguments,
a config file, a json string, a yaml string, and the output of a
function.importdelegatumimportjsonimportyaml# Requires external package PyYAMLj=json.loads('{"verbose": true, "output": "file.txt"}')y=yaml.safe_load(some_yaml_string)some_f=lambdax:x*xdelegatus=delegatum.Delegatum([cmdline,configfile,j,y,some_f])print(delegatus['verbose'])print(delegatus['garbage'])AttributesdefaultobjectDefault value to return if no lookup succeedsRaisesDelegatumErrorGeneral library error; should only occur if misconfiguredDelegatumMissErrorUsed internally for flow controlSee AlsoStandard library:argparseconfigparserjsontomllibExternal modules:PyYAMLhttps://pypi.org/project/nested-lookup/CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.
Package: delete-cli
A simple, cross-platform, command-line move-to-trash.But why?Thedelcommand is a simple alternative to using the standardrmcommand.
Usingrmas a matter of course can be dangerous and prone to mistakes. Once a file is
unlinked withrmit cannot be recovered (without having backups).All major graphical environments offer a “move to trash” option. This does a clean move
operation to a “trash” folder. Once a file as been put in the trash it can be recovered
easily. Periodically, the trash can be emptied if desired.delis a command-line implementation of this metaphor. It maintains a basicsqlite3database of files and folders put in the trash. Using the--listoption
will list the contents. Using--restorewill restore a file or folder from the trash.
Using--emptywill purge anything put in the trash bydel.InstallationIf you already have Python 3.12+ on your system, you can installdelusing Pip.pipinstalldelete-cliBasic UsageCallingdelwith no arguments or with the--helpflag yield typically Unix
style behavior, print a usage or help statement, respectively. For detailed usage and
examples you can read the manual page,man del.Deleting files and folders is as simple as:delfile1.txtfile2.txtfolderAFiles or folders that get deleted with the same basename will have a suffix added before
the extension (e.g.,file1.1.txt,file1.2.txt, …).Restore files using their basename (in the trash), their full path (in the trash) or
their original full path.DocumentationDocumentation is available atdelete-cli.readthedocs.io.
For basic usage information on the command-line use:del--help. For a more comprehensive
usage guide on the command line you can view the manual page withman del.ContributionsContributions are welcome in the form of suggestions for additional features, pull requests with
new features or bug fixes, etc. If you find bugs or have questions, open anIssuehere. If and
when the project grows, a code of conduct will be provided along side a more comprehensive set of
guidelines for contributing; until then, just be nice.
Package: delete-copies
stress-reliefGot bored in the first day of new semester and had to clean system for lot of copies of previous sem assignments and projects and notes, written this script to do the task for meUsagepython delete_copies.py <folder1> <folder2> <folder3> (and so on) <print/trash/delete>You can enter as many folders as you can, but the script checks for just the mentioned folder and its child folders, it does not include parent folderlast arguments explanation:print - just print the duplicate filestrash - deletes all the duplicate files in the folder and sends them to trash/recycle bindelete - deletes the duplicate files permanently (cant be found in trash after this is executed, there is backup too in case this is just unfortunate command execution)Note:previous version code just checks for the name of the file instead of the actual content of the file which is what duplicate file means,Executing the script did not caused any problem to me as I just copy the whole folder to another location instead of changing names of the filesAnd this error bounced back today while executing this on a folder with renaming the files which contains the same content inside
Package: delete-last-comma
All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.Description: Sample Module Repository========================This simple project is an example repo for Python projects.`Learn more <http://www.kennethreitz.org/essays/repository-structure-and-python>`_.---------------If you want to learn more about ``setup.py`` files, check out `this repository <https://github.com/kennethreitz/setup.py>`_.笨ｨ魂笨ｨPlatform: UNKNOWN
Package: delete-migrations
delete-migrationsThedelete-migrationsis a command-line app that deletes a single folder migrations or all directory migrations folder.InstallationCreate a virtual environment in root folderfor mac, linux os$virtualenv<virtualenv_name>#create a virtual environment$source<virtualenv_name>/bin/activate#activate the virtual environmentfor windows os$virtualenv<virtualenv_name>#create a virtual environment$<virtualenv_name>\Scripts\activate#activate the virtual environmentUsing Pip$pipinstalldelete-migrations#install the delete-migrations packageAccessing the package on command linecreate a file "find.py" on the root directory of your projectimport the delete-migrations command-line app in the "find.py" file from the module belowfromdelete_migration_rooseveltimportmanagementsave the "find.py"Usagefind usage commands$pythonfind.py#for mac, linux$pyfind.py#for windowsget helpusing the help command$pythonfind.py--help#for mac, linux$pyfind.py--help#for windowsusing the help command abbreviated$pythonfind.py-h#for mac, linux$pyfind.py-h#for windowsusing the <all> directory help command$pythonfind.pyall-h#for mac, linux$pyfind.pyall-h#for windowsusing the "<dir_name" directory help command$pythonfind.pydir_name-h#for mac, linux$pyfind.pydir_name-h#for windowsall migrations folderssearch and delete folders migrations$pythonfind.py--deleteall#for mac, linux$pyfind.py--deleteall#for windowssearch and delete folders migrations abbreviated$pythonfind.py-dall#for mac, linux$pyfind.py-dall#for windowsall single foldersearch and delete single folder migrations$pythonfind.py--delete<name-of-folder>#for mac, linux$pyfind.py--delete<name-of-folder>#for windowssearch and delete single folder migrations abbreviated$pythonfind.py-d<name-of-folder>#for mac, linux$pyfind.py-d<name-of-folder>#for windowsall single folderget the current version of the command-line library$pythonfind.py--version#for mac, linux$pyfind.py--version#for windowsget the current version of the command-line library abbreviated$pythonfind.py-v#for mac, linux$pyfind.py-v#for windows
Package: deleter
deleterAutomatically remove python scripts from disk after execution.
Main purpose is to delete single file executables generated by PyInstaller.Deleter does not support deleting mult-file scripts.InstallationFrom PyPIpipinstalldeleter-UFrom sourcesgitclonehttps://github.com/desty2k/deleter.gitcddeleter
pipinstall.UsageDelete app at exitimportdeleterdeleter.register()# your codeCancel app deletionimportdeleterdeleter.register()# your code# cames out that we do not need to delete appdeleter.unregister()# executable stays on disk
Package: delete-tweets
delete-tweetsThis is a simple script that helps you delete tweets (or just replies or retweets)
from your timeline. There are quite a few third-party services that allow you
to delete tweets, but these very likely will not allow you to delete tweets beyond
the infamous3,200 tweet limit.PrerequisitesUnfortunately, as of late 2018, you are required to have a Twitter Developer account
in order to create a Twitter app.Apply for a Twitter Developer accountCreate a Twitter Developer account:User profile: Use your current Twitter @username.Account details: SelectI am requesting access for my own personal use,
set your 'Account name' to your @username, and select your 'Primary country
of operation.Use case details: select 'Other', and explain in at least 300 words that
you want to create an app to semi-automatically clean up your own tweets.Terms of service: Read and accept the terms.Email verification: Confirm your email address.Now wait for your Twitter Developer account to be reviewed and approved.Create a Twitter appCreate a new Twitter app(not
available as long as your Twitter Developer account is pending review).Set 'Access permissions' of your app toRead and write.Configure your environmentOpen your Twitter Developer'sapps.Click the 'Details' button next to your newly created app.Click the 'Keys and tokens' tab, and find your keys, secret keys and access tokens.Now you need to make these keys and tokens available to your shell environment.
Assuming you are usingBash::warning: Before you continue, you should be aware that most shells record user
input (and thus secrets) into a history file. In Bash you could prevent this by
prepending your command with asingle space(requires$HISTCONTROLto be set
toignorespaceorignoreboth).exportTWITTER_CONSUMER_KEY="your_consumer_key"exportTWITTER_CONSUMER_SECRET="your_consumer_secret"exportTWITTER_ACCESS_TOKEN="your_access_token"exportTWITTER_ACCESS_TOKEN_SECRET="your_access_token_secret"Get your tweet archiveOpen theYour Twitter data pageScroll to the 'Download your Twitter data' section at the bottom of the pageRe-enter your passwordClick 'Request data', and wait for the email to arriveFollow the link in the email to download your Tweet dataUnpack the archiveGetting startedInstallationInstall the tool usingpip.python3-mpipinstalldelete-tweetsUsageDelete any tweet frombeforeJanuary 1, 2018:delete-tweets--until2018-01-01tweet.jsOr only delete all retweets:delete-tweets--filterretweetstweet.jsSpare tweetsYou can optionally spare tweets by passing theirid_str, setting a minimum
amount of likes or retweets:delete-tweets--until2018-01-01tweet.js--spare-ids212354342349872323498723Spare tweets that have at least 10 likes, or 5 retweets:delete-tweets--until2018-01-01tweet.js--spare-min-likes10--spare-min-retweets5
Package: deleuze
# DeleuzeA simple system for generating new python projects according to a resonable
default skeleton. Example:$ deleuze new supertoolThis will generate the following project directory structure:` supertool|--bin |+--supertool.py|--reqs |+--common.txt |+--dev.txt |+--production.txt |+--test.txt|--supertool |+--__init__.py|--tests |+--__init__.py |+--base.py |+--factories.py |+--test_supertool.py+--README.md+--requirements.txt+--setup.py `This provides, what is solely in my opinion, a decent initial project structure.
The requirements files are preconfigured, reasonable testing defaults are added,
and a failing unit-test is included in supertool/tests/test_supertool.py to
remind you to start by writing some passing tests.Next I usually spin up a new virtualenv environment for this project, install
the requirements, and get to work on something more interesting.