Saravanan666/pypi-org huggingface dataset:
Package: simple-dependency-injection
simple-dependency-injectionsimple-dependency-injection is a library is lightweight library to apply dependency injection pattern in a simple way.Note:simple-dependency-injection is in a development state, there were some checks to finish the first versionInstallYou can install it through pippip install simple-dependency-injectionUseTo use simple-dependency-injection only have to create a dependency container and register your dependencies.The library check types of parameters and result, its important typing that.That is an example of dependency container configurationfrom abc import ABC, abstractmethod
from simple_dependency_injection.dependency_container import DependencyContainer

class ConfigDependencyInterface(ABC):
    @abstractmethod
    def get_percent_benefit(self) -> float:
        pass

class ConfigDependency(ConfigDependencyInterface):
    def get_percent_benefit(self) -> float:
        return 10.0
   
def config_generator() -> ConfigDependencyInterface:
    return ConfigDependency()

class ServiceInterface(ABC):
    def __init__(self, config: ConfigDependencyInterface):
        self.config = config

    @abstractmethod
    def calculate_benefit(self, amount: float) -> float:
        pass

class Service(ServiceInterface):
    def calculate_benefit(self, amount: float) -> float:
        return amount * (self.config.get_percent_benefit() / 100)
  
def service_generator(config: ConfigDependencyInterface) -> ServiceInterface:
    return Service(config=config)

dependency_container = DependencyContainer()
dependency_container.register_dependency(
    ConfigDependencyInterface, config_generator
)
dependency_container.register_dependency(
    ServiceInterface, service_generator
)Once the dependency container is created, you can use it with inject decorator.@dependency_container.inject
def main(service: ServiceInterface):
    service.calculate_benefit(10)

main()Other way to use the dependency container is get the dependency directlydependency_container.get_dependency(ServiceInterface).calculate_benefit(10)For testing is easy override dependenciesclass ConfigToTestDependency(ConfigDependencyInterface):
    def get_percent_benefit(self) -> float:
        return 0.0

def test_config_generator() -> ConfigDependencyInterface:
    return ConfigToTestDependency()

with dependency_container.test_container() as dependency_container_test:
    dependency_container_test.override(
        ConfigDependencyInterface, test_config_generator
    )
    main()
Package: simple-dependency-resolver
Simple Dependency ResolverSimple text based dependency resolution algorithmFree software: MIT licenseFeaturesTODOCreditsThis package was created withCookiecutterand thegitlab-data/cookiecutter-pypackage, which was forked from theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2022-10-10)First release on PyPI.
Package: simple-deployment
simple-deploymentChatbot Interface with Flask and Hugging Face TransformersDescriptionThis project is a chatbot interface that integrates Hugging Face's Transformers library with a Flask backend. It serves a frontend built with HTML, CSS, and JavaScript to interact with the user. The user can input text which is then processed by the Flask backend and fed into a pre-trained language model. The model's generated text is then sent back to the frontend and displayed.Folder Structurefrontend/: Contains all frontend HTML, CSS, and JavaScript files.index.html: Main HTML file that provides the user interface.backend/: Contains Flask application and related backend code.app.py: Main Flask application script.models/: Folder where pre-trained language models are saved.requirements.txt: Lists all Python dependencies.How to UsePrerequisitesPython 3.xpipInstallationClone the repository.git clone https://github.com/your-repo-link.gitNavigate to the project directory.cd Chatbot-InterfaceInstall the required Python packages.pip install -r requirements.txtRunning the ApplicationStart the Flask application.python backend/app.pyOpen a web browser and go tohttp://127.0.0.1:5000/.Use the frontend interface to interact with the chatbot. You can choose a pre-trained model from the dropdown or upload your own.Interacting with the ChatbotType your text into the input field and press "Send" or hit the Enter key.The chatbot's response will appear below your message.ReferenceViktor Veselov 10/28/2023
Package: simpleder
SimpleDEROverviewThis is a lightweight library to compute Diarization Error Rate (DER).FeaturesNOTsupported:Handling overlapped speech,i.e.two speakers speaking at the same time.Allowing segment boundary tolerance,a.k.a.thecollarvalue.For more sophisticated metrics with these supports, please usepyannote-metricsinstead.To learn more about speaker diarization, here is a curated list of resources:awesome-diarization.Diarization Error RateDiarization Error Rate (DER) is the most commonly used metrics forspeaker diarization.Its strict form is:False Alarm + Miss + Overlap + Confusion
DER = ------------------------------------------
                   Reference LengthThe definition of each term:Reference Length:The total length of the reference (ground truth).False Alarm: Length of segments which are considered as speech in
hypothesis, but not in reference.Miss: Length of segments which are considered as speech in
reference, but not in hypothesis.Overlap: Length of segments which are considered as overlapped speech
in hypothesis, but not in reference.This library does NOT support overlap.Confusion: Length of segments which are assigned to different speakers
in hypothesis and reference (after applying an optimal assignment).The unit of each term isseconds.Note that DER can theoretically be larger than 1.0.References:pyannote-metrics documentationXavier Anguera's thesisTutorialInstallInstall the package by:pip3installsimplederorpython3-mpipinstallsimplederAPIHere is a minimal example:importsimpleder# reference (ground truth)ref=[("A",0.0,1.0),("B",1.0,1.5),("A",1.6,2.1)]# hypothesis (diarization result from your algorithm)hyp=[("1",0.0,0.8),("2",0.8,1.4),("3",1.5,1.8),("1",1.8,2.0)]error=simpleder.DER(ref,hyp)print("DER={:.3f}".format(error))This should output:DER=0.350
Package: simpledf
An easier to use apply function for pandas groupby operations involving a
custom function. SeeJupyter notebook examplethat verifies the complexity of selection sort.InstallationThis package exists onpypi.
You can install it usingpip:pip install simpledfDemoHere is a quick demo of how this package works:>>> import simpledf as sdf
>>> import pandas as pd
>>> import numpy as np
>>> x = pd.DataFrame({'Data': [1, 2, 3], 'Group': ['A', 'B', 'B']})
>>> def f(y):
        y['Mean'] = np.mean(y['Data'].values)
        return y

>>> z = sdf.apply(x.groupby('Group'), f)
>>> print z
Package: simpledft
SimpleDFTSimpleDFT is a simple plane wave density functional theory (DFT) code.
It is a Python implementation of theDFT++pragmas proposed by Thomas Arias et al.
Also, it serves as the minimalistic prototype for theeminuscode,
which was introduced in themaster thesisof Wanja Timm Schulze to explain theory and software development compactly.
There is also a version written in Julia, calledSimpleDFT.jl.Note: From version 2.0 on, the implementation will slightly deviate from the master thesis to be in line with eminus.SimpleDFTDescriptionLanguagePython 3LicenseApache 2.0DependenciesOnly NumPyBasis setPlane waves (PW)DFTRestricted Kohn-Sham (RKS)InstallationThe package and all necessary dependencies can be installed using pippip install simpledftExamplesExample calculations, i.e., the H atom, He atom, and H2 molecule can be executed withpython examples.pySimplificationsThis code is about implementing plane wave DFT as simple as possible, while still being general.
To classify the shortcomings from a fully-fletched DFT code, the most important simplifications are listed belowRestricted Kohn-Sham DFT only, no open-shell systemsLDA only, no functionals using gradientsAll-electron Coulomb potential, no pseudopotentials to only treat valence electronsGamma-point only, no band pathsSteepest descent only, no sophisticated minimizationsRandom starting guess only, no calculated guess of the density
Package: simple-di
simple-diA simple, strictly typed dependency injection library.InstallUsageAPIInstallpipinstallsimple_diUsageExamples:fromsimple_diimportinject,Provide,Provider,containerfromsimple_di.providersimportStatic,Factory,Configuration@containerclassOptionsClass(container):cpu:Provider[int]=Static(2)worker:Provider[int]=Factory(lambdac:2*int(c)+1,c=cpu)Options=OptionsClass()@injectdeffunc(worker:int=Provide[Options.worker]):returnworkerassertfunc()==5assertfunc(1)==1Options.worker.set(2)assertfunc()==2Options.worker.reset()assertfunc()==5Options.cpu.set(1)assertfunc()==3APIcontainersync_containerinjectProvideprovidersStaticConfigurationFactorySingletonFactoryType annotation supportedinjectInject values into providers in function/method arguments.Arguments:squeeze_none: default False. Treat None value passed in as not passed.
Package: simple-diarizer
simple_diarizerSimplified diarization pipeline using some pretrained models.Made to be a simple as possible to go from an input audio file to diarized segments.importsoundfileassfimportmatplotlib.pyplotaspltfromsimple_diarizer.diarizerimportDiarizerfromsimple_diarizer.utilsimportcombined_waveplotdiar=Diarizer(embed_model='xvec',# 'xvec' and 'ecapa' supportedcluster_method='sc'# 'ahc' and 'sc' supported)segments=diar.diarize(WAV_FILE,num_speakers=NUM_SPEAKERS)signal,fs=sf.read(WAV_FILE)combined_waveplot(signal,fs,segments)plt.show()InstallSimplified diarization is available on PyPI:pip install simple-diarizerSource Video"Some Quick Advice from Barack Obama!"Pre-trained ModelsThe following pretrained models are used:Voice Activity Detection (VAD)Silero VADDeep speaker embedding extractionSpeechBrainX-VectorECAPA-TDNN(Optional/Experimental) Speech-to-textESPnet Model ZooEnglish ASR modelDemoIt can be checked out in the above link, where it will try and diarize any input YouTube URL.Other ReferencesSpectral clustering methods lifted fromhttps://github.com/wq2012/SpectralClusterPlanned Features
Package: simple-dicom-sort
python-dicom-sortScript to sort DICOM files according to their tags. With a CLI and a GUI.InstallationInstall it using pip:pip install -e .If you want to ensure the availability of the GUI, this will also install the optional PySide2 dependency:pip install -e .[GUI]UsageCalldicom_sort(orpython dicom_sort) without arguments to open the GUI (if PySide2 is available).Otherwise you can use it as a command line tool with the following syntax:usage: dicom_sort [-h] [--copy] src dest pattern

Move DICOM files into a directory structure

positional arguments:
  src         Origin directory with unsorted files
  dest        Destination directory with sorted files
  pattern     Directory pattern (example: %PatientName%/%StudyDate%/%SeriesNumber%_%SeriesName%)

optional arguments:
  -h, --help  show this help message and exit
  --copy, -c  Copy files instead of movingThe program will move (or copy) the dicom files from thesrcfolder to thedestfolder, creating an appropriate directory structure as specified bypattern. The dicom files themselves will be renamed intoimageXXXX.dcmwhereXXXXis replaced by the instance number.LicenseThis program is copyrighted by Francesco Santini (2021) and released under the MIT license. See the LICENSE file for details.
Package: simple-dictionary
Simple DictionaryThis Simple Dictionary is a dictionary in which the user can search for the definition of a word.It uses a data file that contais a vocabluary. This data file is from the Udemy course"The Python Mega Course"by"Ardit Sulce".InstallationYou can install the Simple Dictionary fromPyPIpip install simple-dictionaryThe dictionary is supported on Python 3.5 and above.How to useThe Simple Dictionary is a command line application, nameddictionary. To see the definition of a word, for exampleacid rain, simple call the program:$ dictionary acid rain
acid rain  means:
1. definition: Rain having a pH less than 5.6.If there is a typo in the name, the program will find a similar word and ask you if you want to use this similar word. For yes pressyand for no pressn.$ dictionary acid rainn
Did you mean acid rain ? y
acid rain  means:
1. definition: Rain having a pH less than 5.6.
Package: simple-dictpath
Simple DictPathProvides a simple path-like access to nested dictionary elementsInstallpipinstallsimple-dictpathExamplesfromdictpathimportdictp# First declare a dictp, just like a regular dict.testval=dictp({"first":{"second":{"animals":[{"type":"cat","name":"meow1","children":2},{"type":"cat","name":"meow1","children":4},{"type":"cat","name":"meow1","children":6},{"type":"dog","name":"dog1","eye_colour":"blue"},{"type":"dog","name":"dog2","eye_colour":"green"},]}}})# dictps can behave just like regular dicts when needed:# prints: 'meow1'print(testval["first"]["second"]["animals"][0]["name"])# But the power comes in cleanly accessing nested elements.# To use, just call the dictp value like a function with '()' syntax:animals=testval("first/second/animals")print(animals)# If a any key is missing, whole thing just returns None:cars=testval("first/third/cars")assert(carsisNone)# To force a keyError, use raise_if_missing:# This throws: KeyError: 'third'testval("first/third/cars",raise_if_missing=True)# You can use list indexes to only get certain elements in a nested list# prints: 'cat'first=testval("first/second/animals/0/type")print(first)# Uses list comprehension, e.g. "1:2", ":-1", ":", etc.last_two=testval("first/second/animals/-2:/type")middle_cats=testval("first/second/animals/1:-2/name")all_animals=testval("first/second/animals")all_types=testval("first/second/animals/:/type")# If key actually is a string with ":", use raw_index optiontestval("real/key/:/a",raw_index=True)# To only get list items that have a specific subkey, use drop_missing:# This returns [None, None, None, 'blue', 'green']testval("first/second/animals/:/eye_colour")# This returns ['blue', 'green']testval("first/second/animals/:/eye_colour",drop_missing=True)# You can also set a overide the value if missing:# This returns ['unknown', 'unknown', 'unknown', 'blue', 'green']testval("first/second/animals/:/eye_colour",value_if_missing="unknown")# These both return "no cars"testval("first/second/cars",value_if_missing="no cars")testval("first/second/cars/0/type",value_if_missing="no cars")
Package: simplediff
Simple Diff for Python version 1.0Annotate two versions of a list with the values that have been
changed between the versions, similar to unix’sdiffbut with
a dead-simple Python interface.(C) Paul Butler 2008-2012 <http://www.paulbutler.org/>
May be used and distributed under the zlib/libpng license
<http://www.opensource.org/licenses/zlib-license.php>
Package: simple-diff
simple_diffA simple diff tool for dictionary and list>>>importsimple_diff>>>old_dict={'a':1,'b':2,'c':3,'d':4}>>>new_dict={'b':1,'c':3,'d':4,'e':5}>>>>>>simple_diff.dict_diff(old_dict,new_dict){'created':[{'key':'e','value':5}],'deleted':[{'key':'a','value':1}],'unchanged':[{'key':'d','value':4},{'key':'c','value':3}],'modified':[{'old':{'key':'b','value':2},'new':{'key':'b','value':1}}]}>>>>>>old_list=[{'index':1,'name':'bob'},{'index':2,'name':'john'},{'index':3,'name':'tom'}]>>>new_list=[{'index':2,'name':'john'},{'index':3,'name':'kevin'},{'index':4,'name':'mary'}]>>>simple_diff.list_diff(old_list,new_list,key='index'){'created':[{'index':4,'name':'mary'}],'deleted':[{'index':1,'name':'bob'}],'unchanged':[{'index':2,'name':'john'}],'modified':[{'old':{'index':3,'name':'tom'},'new':{'index':3,'name':'kevin'}}]}
Package: simplediskimage
How to useSeeexamples/orhttps://simplediskimage.readthedocs.io/en/latest/Available on PyPI (pip install simplediskimage) orhttps://pypi.org/project/simplediskimage/DependenciesDebian/Ubuntu# Common
$ sudo apt install python3-parted python3-distutils
# FAT support
$ sudo apt install dosfstools mtools
# ext* support
$ sudo apt install e2fsprogs
# All
$ sudo apt install python3-parted python3-distutils dosfstools mtools e2fsprogsFedora/CentOS# Common
$ sudo dnf install python3-pyparted
# FAT support
$ sudo dnf install dosfstools mtools
# ext* support
$ sudo dnf install e2fsprogs
# All
$ sudo dnf install python3-pyparted dosfstools mtools e2fsprogsKnown issuesmtoolsanddebugfsis not good at error reporting, so if a copy fails it
might not show until you try to mount the image.Parted misbehaves on some platforms (Debian 10), and shrinks partitions. Use
Sfdisk instead. Additionally, some FAT implementations expect the filesystem
to have exactly the same size as the partition, and thus padding them will not
work, unless done exactly.copy_file_rangeseems to misbehave in containers sometimes, observed on
Fedora 30 + podman with Debian 10 container where it skips to copy some data.Future ideasConfigurable alignment, defaulting to 1MiBProper naivecopy_file_rangefunction, usingdup()GPT for sfdisk partitioner (and set it as the default)sgdisk support?Multiboot images (iso, efi, bios)MTD-type partitions: Only offsets and a possibility to get a mtdparts=-type
stringFix travis pylint import fail
Package: simple-disk-queue
Installationpip install .orpip install simple-disk-queueBy default, a folder called.cache/simple_disk_queueis created under your home directory, and will be used to store queues.If you want to change it, see "Global Settings" below.Quick StartAn example can be found inexamples/test.py.
We can first callinit_queue()to initialize the jobs, and then runsdq.DiskQueue.run('test')in different processes.0.0.1==================Core functionality: Add jobs to a queue and run jobs from a queue.
Package: simple-distance-calculator
Functionsget_coordinates(address: str) -> tupleGiven an address, returns a tuple with the latitude and longitude of the address, obtained from the OpenStreetMap Nominatim API.Parametersaddress (str): The address to get the coordinates of.Returnstuple: A tuple with two floats representing the latitude and longitude of the address, respectively.get_address(lat: float, lon: float) -> strGiven a latitude and longitude, returns the corresponding address, obtained from the OpenStreetMap Nominatim API.Parameterslat (float): The latitude of the location.lon (float): The longitude of the location.Returnsstr: A string representing the address of the location.haversine_distance(lat1, lon1, lat2, lon2) -> floatCalculates the distance in kilometers between two points on Earth using the Haversine formula.Parameterslat1 (float): The latitude of the first point.lon1 (float): The longitude of the first point.lat2 (float): The latitude of the second point.lon2 (float): The longitude of the second point.Returnsfloat: A float representing the distance in kilometers between the two points.spherical_law_of_cosines_distance(lat1, lon1, lat2, lon2) -> floatCalculates the distance in kilometers between two points on Earth using the Spherical Law of Cosines formula.Parameterslat1 (float): The latitude of the first point.lon1 (float): The longitude of the first point.lat2 (float): The latitude of the second point.lon2 (float): The longitude of the second point.Returnsfloat: A float representing the distance in kilometers between the two points.equirectangular_approximation(lat1, lon1, lat2, lon2) -> floatCalculates the distance in kilometers between two points on Earth using the Equirectangular Approximation formula.Parameterslat1 (float): The latitude of the first point.lon1 (float): The longitude of the first point.lat2 (float): The latitude of the second point.lon2 (float): The longitude of the second point.Returnsfloat: A float representing the distance in kilometers between the two points.***HOW TO USE***1. Install librarypip install simple-distance-calculator2. import functionsfrom simple_distance_calculator.distance import haversine_distance, get_coordinates, spherical_law_of_cosines_distance, get_address, equirectangular_approximationexamples for caculating distanceshaversine_distance(54.9037, 23.9578, 54.9057, 23.9562)returns - 0.24478592390463977spherical_law_of_cosines_distance(54.9037, 23.9578, 54.9057, 23.9562)returns - 0.24478591164572538equirectangular_approximation(54.9037, 23.9578, 54.9057, 23.9562)returns - 0.24478592392092405get_coordinates("Gedimino pilis")returns - (54.686758350000005, 25.29068448063221)get_address(54.686758350000005, 25.29068448063221)returns - Gedimino pilis, 5, Arsenalo g., Senamiestis, Senamiesčio seniūnija, Vilnius, Vilniaus miesto savivaldybė, Vilniaus apskritis, 01143, Lietuva
Package: simple-distributions
simple_distributionsThe code herein creates probability density functions (PDFs) for Gaussian and binomial distributions based upon simple inputs. It also allows for modification of the PDFs based on external data file provided, as well as visualization of the data and PDF in question.Installation and ImportingYou can install by runningpip install simple-distributionsbut keep in mind that it needs to be imported using the underscore, e.g.import simple_distributions
Package: simple-django-api
Simple library provides rest api for Django.Free software: BSD licenseDocumentation:https://simple-django-api.readthedocs.io.This project is mainly to solve problems below:Django doesn’t support PUT/PATCH request with request body.Django doesn’t support request body in JSON format.FeaturesSupport request body in json formatSupport PUT/PATCH method with request bodyClass-Based-View exception handlerDynamic permission checkJWT(Json Web Token) auth middlewareCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.
Package: simple-django-contact
====Simple Django Contact====Simple Django Contact form is just that. Something very very simpleto display and send emails as a contact form.This is very early on and while it works, it's nothing to write home about. Let me know features you'd like to see and we'll get them in there.The templates (and widgets) are written around Twitter's Bootstrap grid/framework.Quick start-----------1. Add "contact" to your INSTALLED_APPS setting like this::INSTALLED_APPS = (...'simple-django-contact',)2. Include the contact URLconf in your project urls.py like this::url(r'', include('simple-django-contact.urls')),3. Currently no need to sync your DB (phew!)4. Prosper?
Package: simple-django-teams
Django app for combining users into teams and setting simple permissions within a team.Changelog0.0.6 (2020-08-24)Added execute permission level to memberships.0.0.5 (2020-08-17)Soft-delete models no longer require a creator (for auto-created objects)0.0.4 (2020-07-21)Added ability to reinstate soft-delete models.0.0.3 (2020-06-11)Added custom query-set managers for Team and Membership models.Added utility method to get the active members of a Team.0.0.2 (2020-05-14)Removed old organisation name from team name constraint.Added hard-delete functionality to soft-delete models.Fixed bug with soft-deleting groups of objects.0.0.1 (2019-12-04)Initial release