Saravanan666/pypi-org huggingface dataset:
Package: dpshdl
dpshdlA framework-agnostic library for loading data.InstallationpipinstalldpshdlUsageDatasets should override a single method,next, which returns a single sample.fromdpshdl.datasetimportDatasetfromdpshdl.dataloaderimportDataloaderimportnumpyasnpclassMyDataset(Dataset[int,np.ndarray]):defnext(self)->int:return1# Loops forever.withDataloader(MyDataset(),batch_size=2)asloader:forsampleinloader:assertsample.shape==(2,)Error HandlingYou can wrap any dataset in anErrorHandlingDatasetto catch and log errors:fromdpshdl.datasetimportErrorHandlingDatasetwithDataloader(ErrorHandlingDataset(MyDataset()),batch_size=2)asloader:...This wrapper will detect errors in thenextfunction and log error summaries, to avoid crashing the entire program.Ad-hoc TestingWhile developing datasets, you usually want to loop through a few samples to make sure everything is working. You can do this easily as follows:MyDataset().test(max_samples=100,handle_errors=True,# To automatically wrap the dataset in an ErrorHandlingDataset.print_fn=lambdai,sample:print(f"Sample{i}:{sample}"))CollatingThis package provides a default implementation of dataset collating, which can be used as follows:fromdpshdl.collateimportcollateclassMyDataset(Dataset[int,np.ndarray]):defcollate(self,items:list[int])->np.ndarray:returncollate(items)Alternatively, you can implement your own custom collating strategy:fromdpshdl.collateimportcollateclassMyDataset(Dataset[int,list[int]]):defcollate(self,items:list[int])->list[int]:returnitemsThere are additional arguments that can be passed to thecollatefunction to automatically handle padding and batching:fromdpshdl.collateimportpad_all,pad_sequenceimportfunctoolsimportrandomimportnumpyasnpitems=[np.random.random(random.randint(5,10))for_inrange(5)]# Randomly sized arrays.collate(items)# Will fail because the arrays are of different sizes.collate(items,pad=True)# Use the default padding strategy.collate(items,pad=functools.partial(pad_all,left_pad=True))# Left-padding.collate(items,pad=functools.partial(pad_sequence,dim=0,left_pad=True))# Pads a specific dimension.PrefetchingSometimes it is a good idea to trigger a host-to-device transfer before a batch of samples is needed, so that it can take place asynchronously while other computation is happening. This is called prefetching. This package provides a simple utility class to do this:fromdpshdl.datasetimportDatasetfromdpshdl.dataloaderimportDataloaderfromdpshdl.prefetcherimportPrefetcherimportnumpyasnpimporttorchfromtorchimportTensorclassMyDataset(Dataset[int,np.ndarray]):defnext(self)->int:return1defto_device_func(sample:np.ndarray)->Tensor:# Because this is non-blocking, the H2D transfer can take place in the# background while other computation is happening.returntorch.from_numpy(sample).to("cuda",non_blocking=True)withPrefetcher(to_device_func,Dataloader(MyDataset(),batch_size=2))asloader:forsampleinloader:assertsample.device.type=="cuda"
Package: dpshell
This is a python command line toolkit that helps to deal with file information extraction.UsageisemptyJust runisemptyin terminal, providingfolder locationandfile type (extension):Usage:isempty[OPTIONS]FILE_DIRPythoncommandlinetooltocheckemptyfiles.Example:$isemptyfiles-directory-ttxtExample:$cdfiles-directory$isempty.-ttxtOptions:-t,--typeTEXTSpecifythefiletype.[required]--helpShowthismessageandexit.
Package: dpsim
DPsimDPsim is a solver library for dynamic power system simulation.It supports both the electromagnetic transient (EMT) and dynamic phasor (DP) domain for dynamic simulation.A powerflow solver is included for standalone usage or initialization of dynamic simulations.It provides a Python module which can be embedded in any Python 3 application / scripts.The simulation core is implemented in highly-efficient C++ code.It supports real-time execution with time-steps down to 50 uS.It can load models in the IEC61970 CIM / CGMES XML format.It can be interfaced to a variety of protocols and interfaces viaVILLASnode.DocumentationThedocumentationhas build / installation instructions, links to examples and explains the concepts implemented in DPsim as well as its architecture.LicenseThe project is released under the terms of theMPL 2.0.ContactMarkus Mirzmmirz@eonerc.rwth-aachen.deSteffen Vogelstvogel@eonerc.rwth-aachen.deJan Dinkelbachjdinkelbach@eonerc.rwth-aachen.de
Package: dpu-kmeans
dpu_kmeansCIstatuspip buildsA project built withpybind11andscikit-build, running the KMeans algorithm on in-memory processors with the UPMEM SDK.Installationinstall theUPMEM SDKpip install dpu-kmeansUsageimportnumpyasnpfromdpu_kmeansimportKMeansX=np.array([[1,2],[1,4],[1,0],[10,2],[10,4],[10,0]])kmeans=KMeans(2)kmeans.fit(X)print(kmeans.cluster_centers_)Output:[[0.999862672.][10.000137332.]]Developmentclone this repositoryinstall theUPMEM SDKinstall the build requirements inpyproject.tomlcd dpu_kmeanspre-commit installpip install -e .ORclone this repositoryopen folder in VS Codestart in Dev Containerto debug:python setup.py develop --build-type DebugNote:The dev container is for development only and uses the PIM simulator.TemplatingTo use this project as a base for your own UPMEM DIMM project:click on "Use this template" in githubcreate a new project from this oneturn off Conda and Wheels workflows in github actions as they are not operational right nowchange foldersrc/dpu_kmeanstosrc/<your_project>change project name (all instances ofdpu_kmeans) and info in:README.mdsetup.cfgsetup.py (cmake_install_dir="src/dpu_kmeans").gitignore (src/dpu_kmeans/dpu_program/)CMakeLists.txt (project(dpu_kmeans VERSION ${VERSION}))conda.recipe/meta.yaml (optional)docs (optional)if you intend to use github actions to auto-publish to pypi, update the project secrets as described inPublishing package distribution releases using GitHub Actions CI/CD workflowsTestingclone this repositoryinstall theUPMEM SDKinstallnoxcd dpu_treesnoxORclone this repositoryopen folder in VS Codestart in Dev ContainernoxNote:nox,python setup.pyandpipmight fail if you executedpip install -e .previously, delete the_skbuildcache or runpython setup.py cleanto solve.Test callimportdpu_kmeansdpu_kmeans.test_checksum()Expected return:0x007f8000
Package: dpuser
=====dpuser=====Django app.Detailed documentation is in the "docs" directory.Quick start-----------1. Add "dpuser" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [...'dpuser',]2. Include the polls URLconf in your project urls.py like this::url(r'^polls/', include('polls.urls')),3. Run `python manage.py migrate` to create the dpuser models.4. Start the development server and visit http://127.0.0.1:8000/admin/to create a poll (you'll need the Admin app enabled).5. Visit http://127.0.0.1:8000/polls/ to participate in the poll.
Package: dput
dput-ng is a from-scratch refresh of the olddput(1)command. This tool is
used (at some point) to aid with the act of uploading a package to an archive.dput-ng aims to be compatible with the olddput(1)config files, while
adding additional features for better sanity checking, and designed in an
extensible way.Check the [docs](http://dput.rtfd.org) for more on topics that might
interest you.
Package: dputils
A python library which can be used to extraxct data from files, pdfs, doc(x) files, as well as save data into these
files. This library can be used to scrape and extract webpage data from websites as well.Installation Requirements and InstructionsPython versions 3.8 or above should be installed. After that open your terminal:
For Windows users:pipinstalldputilsFor Mac/Linux users:pip3installdputilsFiles ModulesFunctions from dputils.files:get_data:To import, use statement:fromdputils.filesimportget_dataObtains data from files of any extension given as args(supports text files, binary files, pdf, doc for now, more
coming!)sample call:content=get_data(r"sample.docx")print(content)Returns a string or binary data depending on the output argimages will not be extractedsave_data:save_data can be used to write and save data into a file of valid extension.sample call:fromdputils.filesimportsave_datapdfContent=save_data("sample.pdf","Sample text to insert")print(pdfContent)Returns True if file is successfully accessed and modified. Otherwise, False.Scrape ModulesThe Scraper class is a web scraping tool that uses the BeautifulSoup library to extract data from a specified URL. The
class has several methods including init, validate_url, clean_url, soup, get, and get_all. The init method takes in a
URL, a user agent, cookies, and a clean flag. The validate_url method checks if the URL is valid and the clean_url
method removes any query parameters from the URL. The soup method makes a request to the URL and returns a BeautifulSoup
object of the webpage. The get method takes in a list of Tag objects and returns a dictionary of the extracted data. The
get_all method takes in a target tag, an items tag, and a list of tags and returns a list of dictionaries of the
extracted data for each item. The class also has the ability to handle errors and provide information about the
extraction process.These functions can used on python versions 3.8 or greater.References for more help:https://github.com/digipodium/dputilsThank you for using dputils!
Package: dpvis
dpvisThe topic of dynamic programming (DP) is particularly challenging for learners
newly introduced to algorithm design. The library will serve as a learning aid
for studying DP. To this end, we design a widely accessible library that can be
used by students to visualize and interact with DP algorithms.The ultimate goal of this library is not to implement visualization for any
finite collection of DP problems.
Instead, the library will have the capacity to visualize any DP algorithm,
provided that the algorithm is implemented correctly.Our visualization library works with native Python implementations of DP.The library has three major features:Capability to illustrate step-by-step executions of the DP as it fills out
the dynamic programming array. This includes visualization of pre-computations
and the backtracking process.Interactive self-testing feature in which the user will be quizzed on which
cells will be used to compute the result, which cell will the result be
stored, and what is the value of the result.InstallationNOTE: This instruction should be updated after we release to PyPI.Clone the fork locally and change directory:# With SSH:gitclonegit@github.com:itsdawei/dpvis.git# Without SSH:gitclonehttps://github.com/itsdawei/dpvis.gitcddpvisThere is a few options to managing virtual environment:(Recommended) InstallCondaand install the
library locally viapip:condacreate-ndpvispython=3.11
condaactivatedpvis
pipinstall-e.Alternatively, installPoetryand run:poetryinstallAlthough highly recommended, a virtual environment is not necessary as
long as you have installed a Python package manager such aspip. In this case, you can install the
library directly with:pipinstall-e.You can verify the installation by running one of our many demos.pythondemos/knapsack.py# With Poetrypoetryrunpythondemos/knapsack.pyOpenhttps://127.0.0.1:8050/with your favorite
browser.DocumentationThe documentation is compiled withmkdocs-materialandmkdocstringsTo serve the documentation locally, runpoetryinstall--withdocs
poetryrunmakeservedocsContributorsdpvis is developed and maintained byRamiro Deo-Campo VuongEric HanDavid H. LeeAditya PrasadTianyu WangLicensedpvis is released under theMIT License.
Package: dpvisu
Datapack VisualizerThis is a very scuffed tool I made mostly for myself. So if you find madman-logic please let me know - I've probably just grown too used to it to notice myself.InstallationPython 3.9.5 or greater is required.InstallGraphvizand add it to PATH.Install DatapackVisualizer from pypi:pipinstalldpvisuUseCalldpvisuand follow the instructions. If everything is set up right, a.svgfile should get generated and displayed.Alternatively you can provide the full path to any of the following folders as a command-line argument (only 1).../datapack/- Generates call graph for all contained datapacks in a single.svg(Useful in case of multiple inter-connected datapacks)../datapack/<datapack_name>/- Generates a call graph for the given datapack../datapack/<datapack_name>/data/- Generates a call graph for the given datapack
Package: dpx2ffv1
[![Build Status](https://travis-ci.com/DerouineauNicolas/dpx_to_ffv1.svg?branch=master)](https://travis-ci.com/DerouineauNicolas/dpx_to_ffv1)[![PyPI version](https://badge.fury.io/py/dpx2ffv1.svg)](https://badge.fury.io/py/dpx2ffv1)dpx2ffv1===================This program takes a folder filled with dpx indexed images as an input and encode them as a unique ffv1/mkv binary.The program detects if the indexed image have an offset and a prefix (see test folder for an example)Requirements-------------------ffmpeg binary should be available on your system.Install (System wide)-------------------python3 setup.py installRun-------------------python3 -m dpx2ffv1 --input=./testdpx/ --output=ffv1out.mkvordpx2ffv1 --input=./testdpx/ --output=ffv1out.mkvGenerate Dist and upload-------------------python3 setup.py sdist bdist_wheelpython3.7 -m twine upload dist/*
Package: dpy2-migration-helper
dpy2-migration-helperHelper for d.py 1.x -> 2.x migrations.
Searches for and reports (potentially) required changes.This is only slightly smarter than a simple regex search
and mostly aims to speed up the manual part of those searches.InstallationCreate a venv if you don't already have one:python -m venv .venvInstall this package:python -m pip install dpy2-migration-helperUsageusage: dpy2-migration-helper [-h] src [src ...]

positional arguments:
  src         Path to cog's module file or package directory.

optional arguments:
  -h, --help  show this help message and exitLicenseDistributed under the Apache License 2.0. SeeLICENSEfor more information.Jakub Kuczys  · 
GitHub@Jackenmen
Package: dpy-appcommands
dpy-appcommandsSupportIf you want any support then join mydiscord serverInstallationTo install this module, runpipinstall-Udpy-appcommandsUsageFor a headstart, here's an example
but if you want to view full
documentation on it thenclick hereimportappcommandsfromdiscord.extimportcommandsbot=appcommands.Bot(command_prefix=commands.when_mentioned_or('?'))classBlep(SlashCommand):def__init__(self):super().__init__(name="blep",description="Some blep description",)asyncdefcallback(self,ctx:InteractionContext,pleb:str=None):awaitctx.reply(f"why{pleb}",ephemeral=True)# or@bot.slashcommand(name="test",description="test")asyncdeftest(ctx):awaitctx.send("tested")# or@bot.slashcommand(name="test2",description="test")asyncdeftest(ctx):awaitctx.respond(f"tested{ctx.author}")@bot.eventasyncdefon_ready():print(f'Logged on as{bot.user}(ID:{bot.user.id})')awaitbot.add_app_command(Blep(),on_discord=True)# awaitedbot.run("TOKEN")Screenshots
Package: dpybrew
dpybrewA discord.py extension/service managerFree software: MIT licenseDocumentation:https://dpybrew.readthedocs.io.InstallationYou can install dpybrew from Pypi.$pipinstalldpybrewUseageShow extension list$dpybrewlistor$dpybrewlistyour-extensions-pathInstall extensions$dpybrewinstall[extension-name]or$dpybrewinstallgit+url-dircogs/All extensions ->https://gist.github.com/sizumita/19ec79e3ad0ecfae89cca665ddf717e1FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2020-03-29)First release on PyPI.0.2.0 (2020-03-30)[Add] view extensions command.[Add] install extensions command.
Package: dpy-button-utils
UsageButtonPaginatorfromdiscord.extimportcommandsfromdpy_button_utilsimportButtonPaginatorbot=commands.Bot(command_prefix="!",help_command=None)@bot.command()asyncdefpage_plain_text(ctx:commands.Context):paginator=ButtonPaginator(bot,messages=[f"Option{x}"forxinrange(10)],timeout=10)awaitpaginator.run(ctx)@bot.command()asyncdefpage_embeds(ctx:commands.Context):paginator=ButtonPaginator(bot,embeds=[discord.Embed(title="bonk",description=f"Option{x}")forxinrange(10)])awaitpaginator.run(ctx)bot.run("TOKEN")After the paginator is done, you can access the page it left off on withpaginator.counter.ButtonConfirmationfromdiscord.extimportcommandsfromdpy_button_utils.confirmationimportButtonConfirmationbot=commands.Bot(command_prefix="!",help_command=None)@bot.command()asyncdefconfirm(ctx:commands.Context):ifawaitButtonConfirmation(ctx,"Do the bad thing?",destructive=True,confirm="YES",cancel="no pls").run():awaitctx.send("yes :D")else:awaitctx.send(":(")@bot.command()asyncdefconfirm2(ctx:commands.Context):ifawaitButtonConfirmation(ctx,"Do the thing?",destructive=False,confirm="YES",cancel="no pls").run():awaitctx.send("yes :D")else:awaitctx.send(":(")bot.run("TOKEN")ButtonConfirmationtakes a few different keyword arguments, after theContextandmessage.destructive- can either beTrueorFalse.Truecauses a red confirm button, andFalsecauses a blue onetimeout- Time in seconds for the confirmation to auto-cancelconfirm- Confirmation button labelcancel- Cancel button labelconfirm_message- Text to change to on a confirmationcancel_message- Text to change to on a cancelThe defaults are:destructive- Falsetimeout- 60confirm- Confirmcancel- Cancelconfirm_message-None- this appendsConfirmedto the original messagecancel_message-None- this appendsCancelledto the original message
Package: dpy-check
Installpip install dpy-checkDocsPENDING...
Until then, here is some implementation code:importdpycheckaschkfromdiscord.extimportcommandsbot=commands.Bot(...)# if the error handler has been attached to an object,# it can be acquired through `ErrorHandler.get(object)`error_handler=chk.ErrorHandler(...,attach_to=bot)@bot.command()@chk.ctx.Check.all(chk.user_has_role(...),chk.Any(chk.membership("d")>=5,chk.user_has_channel_perms(...)))asyncdefcmd(...):...cmd.error(error_handler.error)bot.run(...)When using extensions, you must use.placeholderin combination withresolve_placeholdersif you want to use the error handler:importdpycheckaschkfromdiscord.extimportcommandsclassmycog(commands.Cog):def__init__(self,bot:commands.Bot)->None:self.bot=bot# get the attached ErrorHandler and run `resolve_placeholders`chk.ErrorHandler.get(bot).resolve_placeholders(self)# we use a placeholder and resolve in `__init__`# to attach the error handler. Make sure the# placeholder is at the very top (or more specifically,# make sure it happens *after* the command is created)@chk.ErrorHandler.placeholder@chk.ctx.Check.all(10>=chk.membership("m")>=5,chk.in_channel(...),chk.Not(chk.user_has_role(...)))@commands.command()asyncdefcmd(...):...asyncdefsetup(...):...
Package: dpy-components
dpy-componentsThis lib adds components support for discord.py.Please note this is beta yet.Exampleimportosfromdiscord.extimportcommands,componentsbot=commands.Bot("c ")bot.load_extension("discord.ext.components")@bot.eventasyncdefon_ready():print('We have logged in as{0.user}'.format(bot))@bot.command()asyncdeftest(ctx,button_label,hidden:bool):awaitcomponents.send(ctx,"Click this",components=[components.Button(button_label,name="button1")])cmp=awaitbot.wait_for("button_click",check=lambdac:c.name=="button1")awaitcmp.send(f"You clicked{button_label}.",hidden=hidden)bot.run(os.getenv("token"))ReferenceButtonTypeRepresents button type.primary,primary_cta,blue,blurpleRepresents1.success,primary_success,greenRepresents2.secondary,gray,greyRepresents3.danger,destructive,redRepresents4.link,urlRepresents5.components.sendThis function is a coroutine.
Send message with components.components.send(channel:discord.abc.Messageable,content=None,*,tts=False,embed=None,file=None,files=None,delete_after=None,nonce=None,allowed_mentions=None,reference=None,mention_author=None,components=[])channnel: Channel to send the message.content..mention_author: Same asdiscord.abc.Messageable.send.components: Components to attach to the message.If you want to use multi row components, please specify 2D list.components.replyThis function is a coroutine.An utility function for replying message.Same as:awaitsend(target.channel,*args,reference=target.to_reference(),**kwargs)components.ButtonRepresents a button in component.label: Label for the button.custom_id|name: Custom id for the button.url: URL for the button.style: Style for the button.Pass values ofButton Styles, orButtonType.emoji: Emoji for the button.enabled: Whether the button is enabled.Properties.disabled: Same asnot self.enabled.on_button_click(cmp: ButtonResponse)Fires when user clicked button.ButtonResponseRepresents a button response.Do not initialize this class directly.id: ID of the interaction.application_id: Application ID of the interaction.guild: Guild of the interaction.channel: Channel of the interaction.message: Message of the interaction.member: Member who pressed the button.token: Token of the interaction.custom_id|name: Custom ID of the button.ButtonResponse.sendThis function is a coroutine.Responds interaction.ButtonResponse.send(content=None,*,embed=None,embeds=[],allowed_mentions=None,tts=False,hidden=False)content...tts: Same asdiscord.abc.Messageable.send.hidden: Hide the message or not.ButtonResponse.defer_sourceThis function is a coroutine.ACK an interaction with DeferredChannelMessageWithSource(5).The user sees a loading state.ButtonResponse.defer_updateThis function is a coroutine.ACK an interaction with DeferredUpdateMessage(6).The user doesn't see a loading state.
Package: dpy-devtools
Installpip install dpy-devtoolsDocsPENDING...
Until then, here is some implementation code:fromdiscord.extimportcommandsimportdiscordfromdpydevtoolsimportDevTools,ControlGroupOptionsbot=commands.Bot(...)tools=DevTools("!bot",bot,cg_defaults={"global":ControlGroupOptions.disabled,"example_group_0":ControlGroupOptions.adminplus},cw_defaults={"example_whitelist_0":[12345678901234567890]})@bot.command(name="bot")asyncdefcmd(ctx:commands.Context,*queries:str)->None:returnawaittools.delegate(ctx,*queries)@bot.command(name="test")@tools.command(group="example_group_0",whitelist="example_whitelist_0",tracker="example_tracker_0")asyncdeftest_command(...):...bot.run(...)When using extensions, you must use.placeholderin combination withresolve_placeholders:fromdpydevtoolsimportDevToolsfromdiscord.extimportcommandsclassmycog(commands.Cog):def__init__(self,bot:commands.Bot)->None:self.bot=commands.BotDevTools.get(bot).resolve_placeholders(self)# make sure the placeholder is at the very top (or# more specifically, make sure it happens *after*# the command is created)@DevTools.placeholder(group=...,...)@commands.command(name="test")asyncdeftest_command(...):...asyncdefsetup(...):...The available commands can be accessed by running<prefix><commandname> -h. This usesargparse, and is navigatable in a similar way through discord.
Package: dpyhr
dpyhrdpyhr is a hot cog reloader (that uses discord.py cog's implementation) to reload anytime you wanted to save!SetupInstall dpyhr with pip (pip install dpyhr)Import dpyhr and run it withimportdpyhrdpyhr.run(*paths:str,bot:commands.Bot=None,selection:Selection=Selection.normal,reloader:typing.Callable=None,conditional:typing.Callable=None,recursive:bool=False,**kwargs)dpyhr.runhave a documentation as thisRun dphyr in another thread.Args:*paths (str): Paths you want to watch for cogs. Supply those as argumentbot (commands.Bot, Optional): For reloading extensions (if reloader doesn't exists)selection (Selection, optional): Observer selection. Defaults to Selection.normal.reloader (typing.Callable, optional): Reload module with your own function. Defaults to None.conditional (typing.Callable, optional): Conditional when event is triggered. Defaults to None.recursive (bool, optional): Recursive reloading. Defaults to False.**kwargs: Other arguments for observer.Returns:None: No returns.Cautiondpyhr wouldn't work if you called your bot outside of the entrypoint starter so nested path wouldn't work in this case. you need to run it inside directory where you want python file to run else reloader might get wrong path and spits errors out.Why you don't shipped discord.py with this package?Because dpyhr is trying to be able to compatible with any discord.py versions that havediscord.ext.commands(other discord.py forks should works if they havecommands.Bot.reload_extensionand their package name isdiscord)