Saravanan666/pypi-org huggingface dataset:
Package: doublethink
doublethinkRethinkDB python library. Provides connection manager and ORM framework
(object-relational mapping, sometimes called ODM or OM for nosql databases).Connection ManagerThree main purposes:round-robin connections among database serversmake sure connections close at proper timeretry retry-able queries on failureNot currently a connection pool, because it doesn’t keep any connections open.
Should be possible to implement connection pooling without changing the API.
However, testing suggests there would be no appreciable performance gain from
connection pooling.Usage Exampleimport doublethink
rr = doublethink.Rethinker(['db0.foo.com', 'db0.foo.com:38015', 'db1.foo.com'], 'my_db')
rr.table('mytable').insert({'foo':'bar','baz':2}).run()
for result in rr.table('mytable'):
    print("result={}".format(result))ORMSimple yet powerful ORM system.Does not enforce a schema.Usage Exampleimport doublethink

rr = doublethink.Rethinker(['db0.foo.com', 'db0.foo.com:38015', 'db1.foo.com'], 'my_db')

class MyTable(doublethink.Document):
    pass
MyTable.table_create(rr)

doc1 = MyTable(rr, {'animal': 'elephant', 'size': 'large'})
doc1.save()

doc1_copy = MyTable.load(rr, doc1.id)
doc1_copy.food = 'bread'
doc1_copy.save()

doc1.first_name = 'Frankworth'
doc1.save()

doc1.refresh()Service RegistryNow also has a ServiceRegistry class, a lightweight solution for service
discovery for distributed services. Maintains service info and status in
a rethinkdb table called “services”.
Package: doublex
Powerful test doubles framework for Python[install|docs|changelog|sources|issues|PyPI|github clone]a trivial exampleimportunittestfromdoubleximportSpy,assert_that,calledclassSpyUseExample(unittest.TestCase):deftest_spy_example(self):# givenspy=Spy(SomeCollaboratorClass)cut=YourClassUnderTest(spy)# whencut.a_method_that_call_the_collaborator()# thenassert_that(spy.some_method,called())See more aboutdoublex doubles.Featuresdoubles have not public API framework methods. It could cause silent misspelling.doubles do not require collaborator instances, just classes, and it never instantiate them.assert_that()is used for ALL assertions.mock invocation order is relevant by default.supports old and new style classes.supports Python versions: 3.6, 3.7, 3.8, 3.9, 3.10Debianamateur repository:debhttps://uclm-arco.github.io/debiansid main(always updated)official package(may be outdated)official ubuntu packagedebian dir:svn://svn.debian.org/svn/python-modules/packages/doublex/trunkrelatedslidespyDoublesdoublex-expectscrateother doublesludibriodoubles
Package: doublex-expects
Doublex-Expects is a matchers library for theExpectsassertion library. It provides matchers for theDoublextest double library.UsageJust import theexpectcallable and the Doublex-Expects matchers and start writing assertions for test doubles.Spiesfromexpectsimportexpectfromdoublex_expectsimport*fromdoubleximportSpymy_spy=Spy()my_spy.method()expect(my_spy.method).to(have_been_called)Mocksfromexpectsimportexpectfromdoublex_expectsimport*fromdoubleximportMockwithMock()asmy_mock:my_mock.reset()my_mock.add(1)my_mock.reset()my_mock.add(1)expect(my_mock).to(have_been_satisfied)Matchershave_been_calledAsserts that a spy has been called.expect(my_spy.method).to(have_been_called)expect(my_spy.method).not_to(have_been_called)have_been_called_withAsserts that a spy has been called with given arguments.expect(my_spy.method).to(have_been_called_with('foo',key='bar'))expect(my_spy.method).to(have_been_called_with(a(str),key=match('\w+')))expect(my_spy.method).to(have_been_called_with(anything,key='bar'))expect(my_spy.method).to(have_been_called_with('foo',any_arg))expect(my_spy.method).not_to(have_been_called_with('bar',key='foo'))Times called modifiersonceAsserts that a spy has been called exactlyonce.expect(my_spy.method).to(have_been_called.once)expect(my_spy.method).to(have_been_called_with('foo').once)expect(my_spy.method).not_to(have_been_called.once)twiceAsserts that a spy has been called exactlytwice.expect(my_spy.method).to(have_been_called.twice)expect(my_spy.method).to(have_been_called_with('foo').twice)expect(my_spy.method).not_to(have_been_called.twice)exactlyAsserts that a spy has been called exactlyntimes.expect(my_spy.method).to(have_been_called.exactly(3))expect(my_spy.method).to(have_been_called_with('foo').exactly(3))expect(my_spy.method).not_to(have_been_called.exactly(3))maxAsserts that a spy has been called maximum ofntimes.expect(my_spy.method).to(have_been_called.max(2))expect(my_spy.method).to(have_been_called_with('foo').max(2))expect(my_spy.method).not_to(have_been_called.max(2))minAsserts that a spy has been called minimum ofntimes.expect(my_spy.method).to(have_been_called.min(2))expect(my_spy.method).to(have_been_called_with('foo').min(2))expect(my_spy.method).not_to(have_been_called.min(2))have_been_satisfiedVerifies that a mock calls have been satisfied.expect(my_mock).to(have_been_satisfied)expect(my_mock).not_to(have_been_satisfied)have_been_satisfied_in_any_orderVerifies that a mock calls have been satisfied regardless of the execution order.expect(my_mock).to(have_been_satisfied_in_any_order)expect(my_mock).not_to(have_been_satisfied_in_any_order)InstallationYou can install the last stable release from PyPI usingpiporeasy_install.$pipinstalldoublex-expectsAlso you can install the latest sources fromGithub.$pipinstall-egit+git://github.com/jaimegildesagredo/doublex-expects.git#egg=doublex-expectsSpecsTo run the specs you should install the testing requirements and then runmamba.$pythonsetup.pydevelop$pipinstall-rtest-requirements.txt$mamba
Package: doubly_linked_list
This code is a Python implementation of a doubly linked list. I needed it
for a very narrow scope, so the functionality might not have what you’re
looking for. If you’d like a feature added, please emailAWNystrom@gmail.comINSTALLATION
To instal, run the following command:
python setup.py installTESTING
To run unit tests, run the following command:
python doubly_linked_list/test_doubly_linked_list.pyUSAGE
Here’s some example usage:>>> from doubly_linked_list import DoublyLinkedList
>>> dll = DoublyLinkedList(range(10))
>>> print dll
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> dll.moveToHead(dll.tail)
>>> print dll
[9, 0, 1, 2, 3, 4, 5, 6, 7, 8]
>>> dll.removeHead()
>>> print dll
[0, 1, 2, 3, 4, 5, 6, 7, 8]
>>> from random import shuffle
>>> shuffle(dll)
>>> print dll
[1, 4, 0, 2, 6, 3, 5, 7, 8]
>>> dll.moveToHead(dll.getNodeByIndex(4))
>>> print dll
[6, 1, 4, 0, 2, 3, 5, 7, 8]
Package: doubly-py-linked-list
Doubly (Py) Linked List 1️⃣ ↔️ 2️⃣ ↔️ 3️⃣A module that implements doubly linked lists in pythonExamplepython -m pip install doubly-py-linked-list>>>fromdoubly_py_linked_listimportDoublyLinkedListasdll>>>d=dll([1,2,3,4])>>>d1<->2<->3<->4>>>node_0=d.insert_head(0)>>>node_5=d.insert_tail(5)>>>forvind:...print(v)...012345>>>d.move_to_head(node_5)>>>d.move_to_tail(node_0)>>>list(d)[5,1,2,3,4,0]>>>d.pop_head()5>>>list(d)[1,2,3,4,5,0]>>>d.pop_tail()0>>>list(d)[1,2,3,4]>>>d.nodes()[ddl_node(1),ddl_node(2),ddl_node(3),ddl_node(4)]
Package: doubt
DoubtBringing back uncertainty to machine learning.A Python package to include prediction intervals in the predictions of machine
learning models, to quantify their uncertainty.InstallationYou can installdoubtwithpip:pipinstalldoubtIf you want to be able to use the preprocessed regression datasets as well, you install
it with thedatasetsextra:pipinstalldoubt[datasets]FeaturesBootstrap wrapper for all Scikit-Learn modelsCan also be used to calculate usual bootstrapped statistics of a datasetQuantile Regression for all generalised linear modelsQuantile Regression ForestsA uniform dataset API, with 24 regression datasets and countingQuick StartIf you already have a model in Scikit-Learn, then you can simply
wrap it in aBootto enable predicting with prediction intervals:>>>fromsklearn.linear_modelimportLinearRegression>>>fromdoubtimportBoot>>>fromdoubt.datasetsimportPowerPlant>>>>>>X,y=PowerPlant().split()>>>clf=Boot(LinearRegression())>>>clf=clf.fit(X,y)>>>clf.predict([10,30,1000,50],uncertainty=0.05)(481.9203102126274,array([473.43314309,490.0313962]))Alternatively, you can use one of the standalone models with uncertainty
outputs. For instance, aQuantileRegressionForest:>>>fromdoubtimportQuantileRegressionForestasQRF>>>fromdoubt.datasetsimportConcrete>>>importnumpyasnp>>>>>>X,y=Concrete().split()>>>clf=QRF(max_leaf_nodes=8)>>>clf.fit(X,y)>>>clf.predict(np.ones(8),uncertainty=0.25)(16.933590347847982,array([8.93456428,26.0664534]))Citation@inproceedings{mougannielsen2023monitoring,
  title={Monitoring Model Deterioration with Explainable Uncertainty Estimation via Non-parametric Bootstrap},
  author={Mougan, Carlos and Nielsen, Dan Saattrup},
  booktitle={AAAI Conference on Artificial Intelligence},
  year={2023}
}
Package: doubutsushogi
DOUBUTSUSHOGIAdoubutsushogi (animal chess)analyzer.This project uses the complete state values calculated indoubutsushogi-solveproject.An interactive analyzer app is deployed on theStreamlit Cloud.Install# from pypipip3installdoubutsushogi# or from githubgitclonehttps://github.com/kota7/doubutsushogi-py.git
pip3install-U./doubutsushogi-pySome usagefromdoubutsushogi.gameimportState# game state at the beginnings=State.initial_state()print(s)#  -------# | k l z |# | . h . |# | . H . |# | Z L K |#  -------# H: 0 Z: 0 K: 0# h: 0 z: 0 k: 0# Player 1's turnfromdoubutsushogi.evaluateimportevaluate_states# Numeric evalutation of the state# The first run takes some time (typically a few minutes) to downloading database from https://github.com/kota7/doubutsushogi-solve/releasesevaluate_states([s])#[-4612]# Note: positive value indicates that the first player is winning,#       negative the second player,#       and zero means a tie.
Package: douglog
douglogA simple command line program that quickly creates and opens single log files with a date in a semi-organized way. Use tools likefzforripgrepto search through the generated logs.Dependenciesgit: to use thegitsubcommand.Example ConfigDefault location is~/.config/dlog.toml.editor = "nvim"
home = "~/dlogs"
logbooks = ["homelab", "work"]editorsets your editor.homeis where you want to store your logs.logbooksis a list of your logs (to organize separate logging).Usage$ dlog log <log-name>
$ dlog list
$ dlog search <regex>
$ dlog git <git commands>For DevelopmentTo install locally for testing:source pyenv/bin/activate
pip install -e .
Package: dougrain-forms
A generator for hypermedia forms, following an unofficial draft by Mike Kelly.
The format is roughly based onthis GistbyMike Kelly.Installationpip install dougrain-formsUsageExample:from dougrain_forms import FormsMixin

class FormsDocument(Document, FormsMixin):
    pass

doc = FormsDocument.empty()
doc.add_link('self', '/foo')

doc.set_form(
    'attack',
    '/attacks',
    headers={
        'Content-Type': 'application/json'
    },
    method='POST',
    schema=ATTACK_SCHEMA
)

print(doc.as_object())Output:{
    "_forms": {
        "attack": {
            "headers": {
                "Content-Type": "application/json"
            },
            "href": "/attacks",
            "method": "POST",
            "schema": {
                "required": [
                    "name",
                    "damage"
                ],
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "damage": {
                        "minimum": 0,
                        "type": "integer",
                        "description": "How much does it hurt?"
                    }
                },
                "title": "Damage Schema"
            }
        }
    },
    "_links": {
        "self": {
            "href": "/foo"
        }
    }
}APIBy mixing inFormMixininto your document, you get three new methods:set_form(self, rel, target, **kwargs)delete_form(self, rel)form(self, href, **kwargs)Until real docs have been written, take a look atthe source.
Package: doujinapi
DoujinAPI2-pyDoujinshi.orgunofficial wrapper ofofficial APIRequirementsPoetry(>=1.16)Python(>=3.8.x)Doujinshi.org API KEYUsage(TODO:publishonpypi)importasynciofromdoujinApiimportDoujinApi# You can get api key from doujinshi.org easily.client=DoujinApi("INPUT_YOUR_API_KEY")asyncdefmain():searchResult=awaitclient.searchBookByName("魔法少女は深淵になにをみるか?")returnsearchResultbooks=asyncio.run(main())print(books)# And you'll get below[Book(id='B868487',name_jp='魔法少女は深淵になにをみるか?',name_en=None,name_r=None,authors=[Author(id='A109490',name_jp='彩電',name_en=None,name_r='None',name_alt=[],count=47)],circles=[Circle(id='C69210',name_jp='こねこぼたん',name_en=None,name_r='コネコボタン',name_alt=[],count=41,authors=[])],parodies=[Parody(id='P4828',name_jp='ご注文はうさぎですか?',name_en='Is the Order a Rabbit?',name_r='ゴチュウモンハウサギデスカ',name_alt=['Gochūmon wa Usagi Desu ka?','gochuumon wa usagi desu ka'],count=1944,contents=[],characters=[])],characters=[Character(id='H23212',name_jp='香風智乃',name_en='Kafuu Chino',name_r='カフウチノ',name_alt=['チノ'],count=576,sex=<Sex.FEMALE:2>,age=13,contents=[]),Character(id='H23211',name_jp='保登心愛',name_en='Hoto Kokoa',name_r='ホトココア',name_alt=['ココア','Cocoa'],count=400,sex=<Sex.FEMALE:2>,age=None,contents=[],)],contents=[Content(name_jp='不詳',name_en='Unknown',name_r=None,count=1601292,)],date_released=datetime.date(2015,12,29),event=Convention(id='N2386',name_jp='コミックマーケット 89',name_en='Comic Market 89',name_r='コミックマーケット89',name_alt=['コミックマーケット89'],count=16268,date_start=datetime.date(2015,12,29),date_end=datetime.date(2015,12,31)),image='https://img.doujinshi.org/big/434/868487.jpg',url='https://www.doujinshi.org/book/868487',pages=28,nsfw=False,anthology=False,copyshi=False,magazine=False,isbn=None,language=<Language.JAPANESE:3>)]# And you can parse the book as filenamefilename=client.parseBookAsFilename(books[0])print(filename)# And you'll see below(C89)[こねこぼたん(彩電)]魔法少女は深淵になにをみるか?(ご注文はうさぎですか?)# Also you can search book by imageasyncdefmain2():resp=awaitclient.searchBookByImage("RELATIVE_PATH_TO_IMAGE")returnrespNoteDoujinshi.org API is really complex for me.
Please make an issue if something is wrong.This is rechallenge after 5 years past.
Does this code looks better thanbefore? XDSometimes doujinshi.org server goes down, but don't worry, the server will come back soon :v
Package: doup
🚀 doupA command line tool to find and update dockertags in project files.Why you should use doupThe version of docker images should not set tolatestto avoid upgrade nightmares and ensure the stability of your environment.
But containers should also be upgraded regulary to get new features and fixes of security issues.You have to check for each container individually if a new version is published or not.doupcan save you a lot of time and is taking this task from you.Example~/dev/repos/best_repo_ever(main)>doup--dry-run.

Finishedin20seconds.
Searchedin11547filesandfound17manageddockerimages.|Filename|Repository|Tag|Next|hasMajorVersionUpdate||-------------------|------------------------------|----------------------------|---------------------------|-------------------------||all/vars.yml|plantuml/plantuml-server|jetty-v1.2022.14|jetty-v1.2023.0|False||all/vars.yml|louislam/uptime-kuma|1.19.2-alpine|1.19.4-alpine|False||all/jellyfin.yml|jellyfin/jellyfin|20221230.11-unstable-amd64|20230114.9-unstable-amd64|False||all/container.yml|homeassistant/home-assistant|2023.1.1|2023.1.4|False|Prepare your project for doupEach dockerimage has to be marked in the previous line:# doup:latest
haproxy_docker_image: haproxy:2.6.2-bullseyedoup: doup is looking for lines which containsdoup:*latest: the tag on dockerhub which is used to get the latest concrete tagQuickSetupdoupis published on PyPi and can be installed withpip install doup.
Afterwards you should mark some Docker-Version-Strings in your project and rundoup --dry-run.Incoming featuresadd output: release date of docker imageadd command:doup list imageslist marked dockertagsadd command:doup find imagesfinds not marked dockertags
Package: doupand
easy to use as most of the data returned are pandas DataFrame objectscan be easily saved as csv, excel or json filescan be inserted into MySQL or MongodbTarget Usersfinancial market analyst of Chinalearners of financial data analysis with pandas/NumPypeople who are interested in China financial dataInstallationpip install doupandUpgradepip install –upgrade doupandQuick Startimport doupand as dp

print(dp.datareader.ashare_description())return:s_dp_code  s_code  ... s_exchmarket s_listboard
0     000001.SZ  000001  ...         SZSE          主板
1     000002.SZ  000002  ...         SZSE          主板
2     000003.SZ  000003  ...         SZSE          主板
3     000004.SZ  000004  ...         SZSE          主板
4     000005.SZ  000005  ...         SZSE          主板
...         ...     ...  ...          ...         ...
5329  873169.BJ  873169  ...          BSE         北交所
5330  873223.BJ  873223  ...          BSE         北交所
5331  873305.BJ  873305  ...          BSE         北交所
5332  873339.BJ  873339  ...          BSE         北交所
5333  873527.BJ  873527  ...          BSE         北交所
Package: do-update-fqdn
do-update-fqdnUpdate or create a dns record through the DigitalOcean API.CaveatsThis script makes the assumption that there is only one FQDN that matches a given combination of name and
record type.
So if you have two A records for foo.example.com, this script might fail or delete one of them, depending on what I
have implemented at that moment.Right now it simply sets all records that the DO API returned for the given combination to the given--data.
I might even try to fix this shortcoming in the future.Multiple--typearguments with their own address each for updating A and AAAA in one go would also be nice.It also exposes your DO API token in the process list while running. You have to trust your local machine.
Package: do-utils
do_utilsUtils write for common usage.do_timeFunc timer - count func time with decoratorUsage:fromdo_utilsimportdo_time@do_time()defdo_print():printlen([xforxinxrange(10000)])classA(object):@do_time(func=False)defdo_print(self):printlen([xforxinxrange(10000)])do_cacheDo cache for GET request url handler in Tornado serverdo_cache:
    do cahche for request with uri & user & params
    cache_key include (protocol, host_name, path, md5(current_user, params))
    cache_expire depend on kwargs expire, the default is 5*60s
    cache from write_buffer that have not flushed wrote by self.write() and will be flush
    if cache is none:
        get data & return data & do cache
    else:
        return cache
do_api_cache:
    do cache for api handler
    if status_code == 200:
        do_cache
do_temp_cache:
    do cache for template handlerUsage:fromdo_utilsimportdo_api_cache,do_temp_cacheclassApiHandler(object):@do_api_cache(10)defget(self):print'get api'@do_temp_cache(10,with_user=False)defget(self):print'get template'Change Historyv0.0.1do utils
do api/template cache for tornado server with redisv0.0.2bugfix for install_requires cannot using 'requirements.txt'
add prefix for cache_key: 'cache:'v0.0.3bugfix for Python3 and dependence
Package: doutline
📑 DoutlineDoutlineis a Python package for generating document outlines.📑 DoutlineInstallationProjectContributingLicenceAuthorAcknowledgementsInstallationDoutline requires Python 3.8 or later.Install Doutline via pip:pipinstalldoutlineProjectContributingTo contribute a bug report, enhancement or feature request, please raise an issue atgithub.com/cariad/doutline/issues.If you want to contribute a code change, please raise an issue first so we can chat about the direction you want to take.LicenceDoutline is released atgithub.com/cariad/doutlineunder the MIT Licence.SeeLICENSEfor more information.AuthorHello! 👋 I'mCariad Ecclestonand I'm a freelance DevOps and backend engineer. My contact details are available on my personal wiki atcariad.earth.Please consider supporting my open source projects bysponsoring me on GitHub.AcknowledgementsThis documentation was pressed byEdition.
Package: douyin
# DouYinAPI of DouYin App for humans.## Installation```pip3 install douyin```## UsageHere is the sample code:```pythonimport douyinfrom douyin.structures import Topic, Music# define file handler and specify foldervideo_file_handler = douyin.handlers.VideoFileHandler(folder='./videos')music_file_handler = douyin.handlers.MusicFileHandler(folder='./musics')# define mongodb handlermongo_handler = douyin.handlers.MongoHandler()# define downloaderdownloader = douyin.downloaders.VideoDownloader([mongo_handler, video_file_handler, music_file_handler])for result in douyin.hot.trend():for item in result.data:# download videos of topic/music for 100 max perdownloader.download(item.videos(max=100))```then you can get:```Item <Topic: <1565818716518401, panama>>Processing <Video: <6616517521098935565, 真香#panama>> ...Processing <Video: <6500385230921141518, 哈哈哈哈哈>> ......Processing <Video: <6479958542747962637, 👅ก่อนกินข้>> ...Processing <Video: <6473811426107460878, 😁>> ...0%|                                                      | 0/10 [00:00<?, ?it/s]Processing 1-10 of filesProcessing <Video: <6616517521098935565, 真香#panama>> ...Saving <Video: <6616517521098935565, 真香#panama>> to mongodb...Processing <Video: <6500385230921141518, 哈哈哈哈哈>> ...Saving <Video: <6500385230921141518, 哈哈哈哈哈>> to mongodb...Processing <Video: <6562690160868199693, 皇城相府版C哩C哩跨>> .......Downloading <Video: <6580510322468064526, 第二遍 后面的小哥哥>> ...Saved <Video: <6479958542747962637, 👅ก่อนกินข้>> to mongodb successfullyDownloading <Video: <6479958542747962637, 👅ก่อนกินข้>> ...Saved <Video: <6473811426107460878, 😁>> to mongodb successfullyDownloading <Video: <6473811426107460878, 😁>> ...Downloaded file to ./videos/6580510322468064526.mp410%|████▌                                         | 1/10 [00:01<00:16,  1.84s/it]Downloaded file to ./videos/6516746291806997763.mp420%|█████████▏                                    | 2/10 [00:01<00:10,  1.33s/it]Downloaded file to ./videos/6600742831352974596.mp440%|██████████████████▍                           | 4/10 [00:02<00:05,  1.03it/s]Downloaded file to ./videos/6484393014599879950.mp450%|███████████████████████                       | 5/10 [00:02<00:04,  1.15it/s]Downloaded file to ./videos/6616517521098935565.mp460%|███████████████████████████▌                  | 6/10 [00:03<00:03,  1.27it/s]Downloaded file to ./videos/6479958542747962637.mp470%|████████████████████████████████▏             | 7/10 [00:03<00:01,  1.68it/s]Downloaded file to ./videos/6472305134377372941.mp480%|████████████████████████████████████▊         | 8/10 [00:03<00:00,  2.05it/s]Downloaded file to ./videos/6562690160868199693.mp490%|█████████████████████████████████████████▍    | 9/10 [00:04<00:00,  2.27it/s]Downloaded file to ./videos/6500385230921141518.mp4100%|█████████████████████████████████████████████| 10/10 [00:04<00:00,  2.33it/s]```![](https://ws2.sinaimg.cn/large/006tNbRwgy1fwmad1yh6wj30lf0p3aaf.jpg)![](https://ws3.sinaimg.cn/large/006tNbRwly1fwo1ystiraj30lg0e3gm0.jpg)![](https://ws3.sinaimg.cn/large/006tNbRwly1fwo20dbzduj30lg0e3q49.jpg)![](https://ws2.sinaimg.cn/large/006tNbRwly1fwo21zyfkyj30jm0m175e.jpg)## ExamplesSee [examples](./examples)