Saravanan666/pypi-org huggingface dataset:
Package: dispatches-dynamic-sweep-data
QuickstartStep 1: Install the data package in your DISPATCHES environment using pipcondaactivatedispatches-dev# or the name of your DISPATCHES dev environmentpipinstallgit+https://github.com/gmlc-dispatches/dynamic-sweep-dataStep 2: Access the contents of the data package in your code usingdispatches_data.apiUsingdispatches_data.api.path():fromdispatches_data.apiimportpath# path_to_data_package is a standard pathlib.Path objectpath_to_data_package=path("dynamic_sweep")# subdirectories and files can be accessed using the pathlib.Path APIpath_to_NE_results=path_to_data_package/"NE"/"sweep_parameters_results_NE_whole.h5"assertpath_to_NE_results.is_file()# if the path must be passed to a function that only accepts `str` objects, it can be converted using `str()`path_to_NE_results_as_str=str(path_to_NE_results)Usingdispatches_data.api.files():fromdispatches_data.apiimportfiles# paths_to_all_results_files will be a list of pathlib.Path objects for each file matching the specified `pattern`paths_to_all_results_files=files("dynamic_sweep",pattern="**/sweep_parameters_results_*_whole.h5")# check that the list of found files is not emptyassertpaths_to_all_results_files# `dispatches_data.api.files()` always returns a list, even if only one file matchespath_to_NE_results=files("dynamic_sweep",pattern="NE/*result_*_whole.h5")[0]ExamplesLoading multiple CSV files into a pandas DataFrameimportpandasaspdfromdispatches_data.apiimportfilesdefload_data(case_study:str="NE")->pd.DataFrame:results_file_pattern=f"{case_study}/results_*_sweep_*/*.csv"csv_files_to_load=files("dynamic_sweep",pattern=results_files_pattern)ifnotcsv_files_to_load:raiseLookupError("No files found with pattern{results_file_pattern!r}")df=pd.concat([pd.read_csv(csv_path)forcsv_pathincsv_files_to_load],axis="index")# process df as neededreturndfdefmain():df_NE=load_data("NE")df_RE=load_data("RE")...
Package: dispatch-reactor
dispatchPython package for timed dispatching of events or workUsage### The Reactor ###
from dispatch import Reactor

r = Reactor()
# The dispatch function needs two parameters, a schedule and an action
schedule = r.schedule_interval(seconds=2) # Run every 2 seconds
action = r.action(print, "hello") # Call the print function with the parameter "hello"
r.dispatch(schedule, action)
r.run()


### The Actions ###
# There are two helper functions that build actions based on functions:

r.action(func, parameter, parameter2, kwarg1=value) # Runs in main loop
r.background_action(func, parameter, parameter2, kwarg1=value) # Runs in new thread

### The Schedules ###
# A schedule is just an iterator that returns timestamps but there are 
# several constructors included which make needing to write one rare

from datetime import datetime

# Run once on April 1st 2012 at 4 am
r.schedule_one_time(datetime(2020,4,1,4)) 

# Run on August 5th and 8th, 2020 
timestamps = [datetime(2020, 8, 1), datetime(2020, 8, 5)]
schedule = iter(timestamps) 

# To run at 8am and 5pm on Tuesdays and thursdays
r.schedule_calendar(days_of_week=["Tuesday", "Thursday"], hours=[8, 17])

# To run hourly on the 15th minute
r.schedule_hourly(minute=15)

# To run daily at 5:12 pm 
r.schedule_daily(hour=17, minute=12)

# To run every hour and a half
r.schedule_interval(hours=1, minutes=30)

# To run every 26 hours till the year 2020 
r.schedule_interval(days=1 hours=2, till=datetime(2020, 1, 1))

# To run on the 1st 5th, 10th, 15th, 20th, and 25th of the month @ midnight
r.schedule_calendar(days=[1,5,10,15,20,25])

# To run mondays on every hour 
r.schedule_calendar(days_of_week=['Monday'], hours='*')
Package: dispatk
# dispatk## DescriptionThis function is inspired by singledispatch of Python 3.4+ (PEP 443),but the dispatch happens on the key extracted fro the arguments values.```from dispatk import dispatk@dispatk(lambda n: int(n))def fib(n):return fib(n-1) + fib(n-2)@fib.register(0)def _(n):return 0@fib.register(1, 2)def _(n):return 1@fib.register(41)def _(n):return 165580141```*register* accepts one or more keys, so```@fib.register(1, 2)def _(n):return 1```is equivalent to```@fib.register(1)@fib.register(2)def _(n):return 1```
Package: dispel
DISPEL is a python DIgital Signal ProcEssing Library developed to standardize extraction of sensor-derived measures (SDMs) from wearables or smartphones data.👋Goodbye to Guesswork:Transparency is key, and with DISPEL, you can track and standardize every step of your data analysis, ditching the guesswork for good.💸Kick Clinical Trial Costs to the Curb:Say hello to DISPEL, your new best friend for slashing the hefty price tag and long timelines of clinical trials. Join the revolution !🐍Python Power:Tap into the power of Python with DISPEL. It's user-friendly, packed with helpful guides, and sprinkled with examples to get your data dancing to your tune.🌊Embrace the Data Deluge:Don't drown in data—master it. DISPEL devours data from any source, spits it out formatted, and readies it for some serious number crunching.💻Code That Cares:Our object-oriented codebase is the heart of a centralized hub designed for all your data analysis needs, making your workflow smooth and seamless.🔬Customize Like a Pro:Flex your research muscles with DISPEL's modular pipeline, which adapts to your project's needs, skips the snags, and keeps the insights rolling in.🏆Real-World Ready:Step out of the lab and into the world with confidence. DISPEL equips you with the tools to factor in real-world variables, ensuring your research stays relevant and resilient.ContributionJoin our efforts in enhancing DISPEL's capabilities by contributing new processing modules and improvements; for detailed guidelines, please refer to ourCONTRIBUTINGfile.DocumentationSee ourdocumentationfor how to install and get started withDISPEL.The TeamDISPEL is a community-driven project with several skillful engineers and researchers contributing to it.DISPEL is currently maintained byAlf Scotland,Angelos KaratsidisandGautier Cosne, with major contributions of talented individuals in various forms and means.
A non-exhaustive list needs to mention: Adrien Juraver, Joaquin Penalver de Andres, Ali Neishabouri, Clément Dulong, Oussama Tchita, Loïc Carment, Angéline Plaud, Kevin Bouaou.LicenseDISPEL has a MIT-license, as found in theLICENSEfile.
Package: dispel4py
dispel4py is a free and open-source Python library for describing abstract stream-based workflows for distributed data-intensive applications. It enables users to focus on their scientific methods, avoiding distracting details and retaining flexibility over the computing infrastructure they use.  It delivers mappings to diverse computing infrastructures, including cloud technologies, HPC architectures and  specialised data-intensive machines, to move seamlessly into production with large-scale data loads. The dispel4py system maps workflows dynamically onto multiple enactment systems, such as MPI, STORM and Multiprocessing, without users having to modify their workflows.Among all the features of dispel4py we would like highlight the following ones:Abstract: users don’t need to worry about the properties of underlying middleware, implementations or systems.Distributed: dispel4py is designed for programming for large applications, by exploiting heterogeneous, distributed systems. Abstract workflows get translated and enacted-executed in a number of contexts, such as Apache Storm and MPI-powered clusters.Data-intensive: data-intensive applications are those which are complex due to data-volume, data complexity or sophisticated data handling. dispel4py employs the data streaming model for dealing with large volumes of data over distributed systems, or with complex data-driven algorithms.Efficient: the data-streaming communicates data directly between stages without going via disk, which can often be an overhead and bottleneck.Scalable: develop on your laptop and run in production.Familiar: use your favourite editors and Python development tools.Extensible: write your own data processing components.Agile: rapidly prototype your methods on your own laptop then migrate them seamlessly to production scale.Light weight: The cost of coupling stages is so low, that small steps can be mixed with major stages freely.Ubiquitous: It runs anywhere Python runs, which is virtually everywhere.Open: the software is freely usable under the Apache 2 licenseWhat makes dispel4py different from other workflow systems is that it is built on the strength and familiarity of Python, it gains from many available scientific libraries, and it uses the tools that users normally use to program. It operates on data units in data streams rather than tasks on files and processes run continuously and concurrently coupled by streams. It can therefore deal with continuous data streams from observations, as well as handle finite streams from archives.
Package: disperse
dispersedisperse is a simple script that I use to create releases for some of the free
software packages I maintain. It's meant to streamline the releasing process,
reducing the human effort involved in creating a release as well as the
likelihood of a brown-bag release.It can do one or more of the following:check if CI is currently passing (for supported platforms, like GitHub)derive the intended new version by checking existing releases and
version strings specified in project filesupdate NEWS files with the release datemake sure various files contain the correct version stringverify that the testsuite runs successfullyoptionally only create a release if there were no changes to the repository
in the last X days (useful for running in a cronjob)upload to a repository site:sources and universal wheels to pypi, if the project is a Python projectcrates.io, if the project is a rust projectcreate a git tag for the new releasecreate "release" entries (on supported platforms, like GitHub)After the release has completed, it can also update
e.g. NEWS for the next release.Disperse was previously known as "releaser".ConfigurationTo a large extent, disperse will automatically figure out what needs to happen.
It can discover the projects you maintain on pypi by reading ~/.pypirc for your
username and enumerating them.It can parse and modify setup.py and Cargo.toml files.It uses a configuration file (disperse.conf) for anything that can not be
autodetected, and which lives in the repository root.For example:tag_format: "dulwich-%(release)s"
   news_path: "NEWS"Basic usagedisperse has various subcommands. The core ones are:release - create a new release for project in $CWD or at a specific URLdiscover - find projects that the current user owns (e.g. on pypi) and
release them if they have unreleased changes and are significant enoughvalidate - validate the disperse configurationRunning from dockerThe easiest way to run disperse is to use the docker image atghcr.io/jelmer/disperse. You'll need to make sure that appropriate SSH
and PGP keys are available.The author regularly runs disperse inside of a Kubernetes cronjob.FutureIn the future, I would like it to:support more languages than just python and rust
Package: dispersion
DispersionThedispersionPython package provides a way of loading and evaluating files
containing the dispersion of the refractive index of materials.Read the full documentation athttps://dispersion.readthedocs.io/en/latest/index.htmlBackgroundIn optics, the phenomenon that the refractive index depends upon the
frequency is called the phenomenon of dispersion, because it is the basis
of the fact that light is "dispersed" by a prism into a spectrum.Feynman Lectures in physicsGetting StartedPython is required to install and use thedispersionpackage. It
is recommended to use a package manager such as pip to install the package.
::pip install dispersionnow we need to tell the package where you are going to store the material data
files. To do this we run the script that comes with the package
::dispersion_setupThis script will ask you to type in the path to a folder where the database
file structure will be installed. Secondly, you will be asked to
name the database. Finally you will be asked if you would like to install
the available modules.Now that the database has been setup, we can start using the package. For
examples and further documentation, see the related pages.
Package: dispie
Dispie🚀 A fantastic library created for use with Discord.pyInstallInstall stable version(Recommended):python3-mpipinstalldispieInstall developement version:python3-mpipinstallgit+https://github.com/PranoyMajumdar/dispieFeaturesQuick overview of the available features.Button PaginatorAdvance Embed Builder (With Select Menus)
Package: displate
displateThis is a boilerplate writer command line utility for discord.pycommandsoptionsFollowing are the options for displate--file
name of the file to write in--type
type of boilerplate you want to write
for example: main and cogscommandsdisplate --file main --type maindisplate --file cog --type cogsIf you think this library is helpful Kindly join my discord serverclick here
Package: displayarray
A library for displaying arrays as video in Python.Display arrays while updating themfrom displayarray import display
import numpy as np

arr = np.random.normal(0.5, 0.1, (100, 100, 3))

with display(arr) as d:
    while d:
        arr[:] += np.random.normal(0.001, 0.0005, (100, 100, 3))
        arr %= 1.0Run functions on 60fps webcam or video input(Video Source:https://www.youtube.com/watch?v=WgXQ59rg0GM)from displayarray import display
import math as m

def forest_color(arr):
    forest_color.i += 1
    arr[..., 0] = (m.sin(forest_color.i*(2*m.pi)*4/360)*255 + arr[..., 0]) % 255
    arr[..., 1] = (m.sin((forest_color.i * (2 * m.pi) * 5 + 45) / 360) * 255 + arr[..., 1]) % 255
    arr[..., 2] = (m.cos(forest_color.i*(2*m.pi)*3/360)*255 + arr[..., 2]) % 255

forest_color.i = 0

display("fractal test.mp4", callbacks=forest_color, blocking=True, fps_limit=120)Display tensors as they’re running through TensorFlow or PyTorch# see test_display_tensorflow in test_simple_apy for full code.

...

autoencoder.compile(loss="mse", optimizer="adam")

while displayer:
    grab = tf.convert_to_tensor(
        displayer.FRAME_DICT["fractal test.mp4frame"][np.newaxis, ...].astype(np.float32)
        / 255.0
    )
    grab_noise = tf.convert_to_tensor(
        (((displayer.FRAME_DICT["fractal test.mp4frame"][np.newaxis, ...].astype(
            np.float32) + np.random.uniform(0, 255, grab.shape)) / 2) % 255)
        / 255.0
    )
    displayer.update((grab_noise.numpy()[0] * 255.0).astype(np.uint8), "uid for grab noise")
    autoencoder.fit(grab_noise, grab, steps_per_epoch=1, epochs=1)
    output_image = autoencoder.predict(grab, steps=1)
    displayer.update((output_image[0] * 255.0).astype(np.uint8), "uid for autoencoder output")Handle input eventsMouse events captured whenever the mouse moves over the window:event:0
x,y:133,387
flags:0
param:NoneCode:from displayarray.input import mouse_loop
from displayarray import display

@mouse_loop
def print_mouse_thread(mouse_event):
    print(mouse_event)

display("fractal test.mp4", blocking=True)Installationdisplayarray is distributed onPyPIas a
universal wheel in Python 3.6+ and PyPy.$ pip install displayarrayUsageAPI has been generatedhere.See tests and examples for example usage.Licensedisplayarray is distributed under the terms of bothMIT LicenseApache License, Version
2.0at your option.
Package: displayforecastio
Display the weather in your terminal!This project is designed to show off a standard python project structureTo work it assumes you have theFORECAST_APIenvironment variable set to be yourForecast.ioapi key.exportFORECAST_API="<your key here>"Installation:pipinstalldisplayforcastioThis app takes two args. A latitude and a longitude. Example usage with output is belowforecastio42.3907-71.1157Currently:rain-DrizzleonSaturdayandTuesday,withtemperaturespeakingat59°FonFriday.Setting up a development environment. I assume python 3.5.0 is installed. Though python 2.7.10 should work as well.virtualenvvenvsourcevenv/bin/activatepipinstall-rrequirements.txtpipinstall-rtest-requirements.txtRun the tests to ensure this all worked try running the tests. Like running the app one test requires theFORCAST_APIenvironment variable to be setpy.testtests
Package: displayhatmini
Display HAT MiniPre-requisitesYou must enable:spi:sudo raspi-config nonint do_spi 0You can optionally runsudo raspi-configor the graphical Raspberry Pi Configuration UI to enable interfaces.InstallingStable library from PyPi:Just runpip3 install displayhatminiIn some cases you may need to usesudoor install pip with:sudo apt install python3-pipLatest/development library from GitHub:git clone https://github.com/pimoroni/displayhatmini-pythoncd displayhatmini-pythonsudo ./install.shUseful LinksPinout -https://pinout.xyz/pinout/display_hat_miniBuy -https://shop.pimoroni.com/products/display-hat-miniChangelog0.0.2Add PWM backlight support (not super stable, but it works)Addon_button_pressedfor interrupt driven buttons0.0.1Initial Release
Package: displaylang
DisplayLangThe problem: Support a limited subset of the Python language, powerful enough
to allow authors to conveniently build HTML displays based on SymPy classes,
but limited enough to offer a reasonable expectation of safe evaluation.We call the language "DisplayLang". It was originally designed for authoring
example explorers in Proofscape, but it attempts to solve a fairly general
problem, so should be more broadly useful.In fact the set ofAllowedCallables for SymPy functions and classes which
can be used in Proofscape is defined in thepfsc-exampproject, not here.
This project is more foundational, defining AST node traversers, providing
the basic framework for definingAllowedCallables, and defining these for
built-in Python functions and methods.The languageThe syntax is defined by three things:Which statement and expression types in the Python language we support.Which callables we allow to be called.For the allowed callables, what types the arguments are allowed to be, and,
when they are strings, what regexes the strings must match.The reason for paying special attention to string arguments is that there are
functions that are definitely unsafe if they can be passed arbitrary
strings, but are probably safe as long as either we don't allow strings to be
passed at all, or we allow only strings of certain restricted forms.Of course we need to be careful about built-in Python callables, such
asexecandeval, not to mention things likeos.system. So our overall
solution is to ban all function calls outside a finite, curated, set of
approved calls. The set is expected to grow over time, in response to user
demand.Among banned statement types areimportstatements, which supports the
providing of only a finite, curated set of availablenames.Getting startedBetter docs are on the way, but for now we offer the following hints for
getting started:See thedisplaylang.build.DisplayLangProcessor.process()method, for the
core code that processes a string of DisplayLang.See also thedisplaylang.build.make_displaylang_processor()convenience
function for building aDisplayLangProcessorinstance.Check out thedisplaylang.allow.AllowedCallable.__init__()method to see
how anAllowedCallableis defined.
Package: displaylang-sympy
The DisplayLang fork of SymPySymPyis a computer algebra system written
entirely in Python. It is a powerful library, and an excellent open-source
project.This is a fork of SymPy that usesDisplayLangfor parsing
expressions.The intention is to keep up with the latest version of SymPy, while maintaining
this difference.VersioningThis project is starting out at major version 0. This is consistent with a new
project, in which there is not yet any commitment to backwards compatibility.The intention is to keep the minor version equal to the latest minor version of
SymPy.The patch version will vary independently of that of SymPy. It will encompass
patches merged from SymPy, plus patches and features unique to this project.
Package: displaylib
DisplayLibA collection of frameworks used to displayASCIIorPygamegraphics in aninfite worldRequires Pythonversion>=3.10Submodulestemplateascii(default)pygameNetworking supportDisplayLib provides mixin classes for enabling networking. Networking is available in each submodule throughdl.networking(when usingimport displaylib.[mode] as dl).To create aClient, use:classMyApp(dl.Engine,dl.Client):...Creating aServeris as simple as:classMyServer(dl.Engine,dl.Server):...Example usingdisplaylibinasciimode:importdisplaylib.asciiasdl# mode selected   ^^^^^classSquare(dl.Node2D,dl.Texture):def__init__(self,parent:dl.Node|None=None,x:int=0,y:int=0)->None:super().__init__(parent,x,y)# the most important arguments to pass downself.texture=[# you can use this style to define its visual[*"OO+OO"],# the "+" represents transparancy[*"O+++O"],# changed through `dl.Node2D.cell_transparancy`[*"OO+OO"]]def_update(self,delta:float)->None:# called every frameiflen(self.texture[1])==5:# modifying the middle lineself.texture[1].append(")")else:self.texture[1].pop()classApp(dl.Engine):def_on_start(self)->None:# use this instead of __init__# -- configdl.Screen.cell_transparant="+"# represents transparancydl.Screen.cell_default="."# changes background default# -- create nodesself.my_square=Square(x=5,y=3)# nodes are kept alive by `Node.nodes` (dict) by default# this means `del self.my_square` is needed to fully free itself.direction=1def_update(self,delta:float)->None:# called every frameifself.direction==1:self.my_square.position.x+=1ifself.my_square.position.x==22:self.direction=-1elifself.direction==-1:self.my_square.position.x-=1ifself.my_square.position.x==4:self.direction=1if__name__=="__main__":# autorun on instance creationapp=App(tps=4,width=24,height=8)Example usingdisplaylibinpygamemode:importdisplaylib.pygameasdl# mode selected   ^^^^^^importpygame# import pygameimportrandomimportmathclassCirlce(dl.Node2D):def__init__(self,parent:dl.Node|None=None,x:int=0,y:int=0)->None:super().__init__(parent,x,y)self.radius=20self.width=2self.time_elapsed=0.0def_update(self,delta:float)->None:self.time_elapsed+=deltaself.width=round(math.cos(self.time_elapsed)*3+5)def_render(self,surface:pygame.Surface)->None:pygame.draw.circle(surface,(200,50,255),(self.position.x,self.position.y),self.radius,self.width)classApp(dl.Engine):def_on_start(self)->None:print("= Started Pygame program")self.circle=Cirlce(x=200,y=100)self.elapsed_time=0.0def_update(self,delta:float)->None:self.circle.position=dl.Vec2(math.cos(self.elapsed_time)*50,math.sin(self.elapsed_time)*50)+dl.Vec2i(200,100)self.elapsed_time+=deltadef_render(self,surface:pygame.Surface)->None:pygame.draw.line(surface,color=(random.randint(0,255),random.randint(0,255),random.randint(0,255)),start_pos=(50,50),end_pos=(200,100),width=5)if__name__=="__main__":app=App("Pygame example using DisplayLib")
Package: display-server-interactions
Display Server InteractionsDSI allows you to perform basic interactions on your display server, like screenshotting a window or sending input to it.
Currently, DSI only supports X11/Xorg (GNU/Linux) and Windows but it aims to be cross-platform.WARNING: Please Do not use DSI in production, because it's currently in development!Quick overviewLook at thedocumentationfor moor informationGet a windowfromdisplay_server_interactionsimportDSIdsi=DSI()window=dsi.get_active_window()Get basic window informationprint("Active window: ")print("\tName:{}".format(window.name))print("\tPID:{}".format(window.pid))Take a screenshot of the windowimportcv2importnumpyasnpimg=np.array(window.get_image())cv2.imshow(f'Screenshot of "{window.name}"',img)whileTrue:ifcv2.waitKey(1)&0xFF==ord('q'):breakSending keys to a windowwindow.send_str("Hello World")Move the mouse pointerwindow.warp_pointer(x=42,y=73)Sending mouse clickswindow.send_mouse_click(x=42,y=73)