Saravanan666/pypi-org huggingface dataset:
Package: diana
A simple async-friendly dependency injection framework for Python 3.Supports:Async methodsParametrized dependenciesType annotationsSimple ExampleimportdianaclassMyThing(object):def__init__(self,prefix):self.prefix=prefixdefget(self,suffix):returnself.prefix+suffixclassMyModule(diana.Module):@diana.providerdefprovide_thing(self)->MyThing:returnMyThing("a_prefix_")@diana.injectordefrequires_a_thing(*,thing:MyThing):returnthing.get('suffix')diana.injector.load_module(MyModule())requires_a_thing()# returns "a_prefix_suffix"Parametrized DependenciesimportdianaimporttypingSnake=typing.NewType('Snake',str)classSnakeModule(diana.Module):@diana.providerdefprovide_snake(self,length:int)->Snake:returnSnake('-'+('='*length)+e)@diana.injector(a_snake=Snake)@diana.injector.param('a_snake',length=5)defsnake_printer(a_snake):print(a_snake,"Hissss")diana.injector.load_module(SnakeModule())snake_printer()# Prints: -=====e HissssModulesModules provide dependencies.NoteThe same dependency can be provided by both an async and sync providers
as shown in theATypeproviders below.classMyModule(diana.Module):defload(self,injector):# Called when the module is loaded against `injector`.passdefunload(self,injector):# Called when the module is unloaded against `injector`.pass@diana.providerdefprovide_atype(self)->AType:returnAType()@diana.providerasyncdefprovide_atype_async(self)->AType:awaitasync_stuff()returnAType()@diana.provides(BType)defprovide_btype(self):returnBType()@MyModule.providerdefprovide_ctype(module)->CType:returnCType()@MyModule.provides(DType)defprovide_dtype(module):returnDType()Injection StylesThere are three formats for injecting dependencies into functionsType Annotation w/ inspectExplicitParametrizedThe following examples are all equivalent.# Type Annotation w/ Inspect@diana.injectordeffunc_a(*,a:AType,b:BType):pass# Explicit@diana.injector.inject(a=AType,b=BType)deffunc_a(*,a,b):pass# Parametrized.# Note, if the second argument to param() is omitted, the type must be# hinted by one of the previous methods.@diana.injector.param('a',AType,a_param=...)@diana.injector.param('b',BType,b_param=...)deffunc_a(*,a,b):passIn all cases, injected arguments must be keyword-only.Alternatively, a dependency can be manually provided, bypassing any injection.func_a(a=AType(),b=BType())Missing FeaturesCompared to other dependency injection frameworks, a few features are missing.Scope management - Currently there is no provision for scope to be managed by
diana and remains the Module/provider’s responsibility.Constructor/Instance Injecting - it is not possible to have Diana set attributes
on instances by decorating the class definition.Thread safety - There have been no attempts to make Diana thread safe. In theory,
if modules are only loaded once (presumably at runtime), thread safety can be managed
by the Modules/providers.
Package: diana-client
DIANA ClientThis is a python client for the DIANA REST API. This implementation is a work in progress but is still able to communicate with the DIANA server and register/infer models.fromdiana_clientimportHTTPClientclient=HTTPClient(diana_server_url="https://diana.distributive.network",model_registry_url="https://models.diana.distributive.network")print(f"Can we connect?{client.check_diana_server_connection()}")#### Register a Modelresponse=client.register_model(model_name="my_model",model_path="./my_model.onnx",preprocess_path="./preprocess.py",postprocess_path="./postprocess.py",password="my_password",language="python",packages=["numpy","pandas","opencv-python"])print(response.text)### Model registered successfully!#### Infer a Modelresponse=client.infer(inputs=files,# a list of the bytes of each inputmodel_name="my_model",slice_batch=1,# number of inputs per sliceinference_id="my_inference_id",# An identifier for the inferencecompute_group_info="joinKey/joinSecret"# The compute group info for the inference)
Package: dian-person-rut-status
🔎 Get Person's DIAN Rut Status by TIN 📑🇨🇴This module allows you to retrieve a person's DIAN RUT status by providing their TIN (NIT in Spanish) throughDIAN's public official website. It is implemented as a function that operates synchronously within therequests library. Currently, it is an early version of the Minimum Viable Product (MVP) and is ready to be used.DIAN Public official siteThe public oficial can befound here.Installationpipinstalldian_person_rut_statusUsageOnce the package is installed.fromdian_person_rut_statusimportmuiscaperson_rut_status=muisca.get_person_rut_status(tin="Colombian Person TIN")The'tin'in this context refers to theColombia Unique Taxpayer Number, a unique identifier assigned to individuals obligated to pay taxes. It is important to note that the'tin'should be provided without itscheck digit
Package: diaosigui
About the AuthorVery sorry, my English is not pretty good because i am just a middle
school sutdent in Shanghai,China.I was playing the game “diaosigui” (or called “HangMan”) with my
classmates when suddenlyI had an inspiration – Why not put it into
python!It is easy for me to do, and I completed it in 10 minutes. All I need to
do is to wait then.How to useIt is very easy. First, usepip install diaosiguito get the
package. Second, import it. Third, use it:dsg.diaosigui(). “No
argument” is allowed.Copy the code if you are idle.importdiaosiguiasdsgtry:dsg.diaosigui(use_windows=True,ans='Any word you want...')except:print("There must be sth. wrong with the installation")Easy, right?ThanksThank the following people:☐ My friends☐ My python teacher☐ You
Package: diapyr
diapyrConstructor injection for PythonOverviewAutomatic wiring between application objectsDeclare what collaborator types you want in your constructor using an @types decorator, they correspond with paramsYou can decorate a (factory) function in the same way, in which case the return type must also be declared using 'this' kwargSurround a type in square brackets if you want a list of all matching objects, normally diapyr provides a unique matchAdd such classes/factories to a DI instanceYou can also add objects, for example an application config objectRequest a type from the DI instance and diapyr will attempt to make it for you, along with the rest of the object graphInstances are cached in the DI objectOn exit from 'with' clause, dispose is called on any created instances that have itMotivationManual wiring is messy and tedious especially when an app gets bigConstructor injection avoids spaghetti codeIt's trivial to depend on an object anywhere in the graph as long as you don't create a reference cycle e.g. most objects will depend on the same config instanceNo need to resort to globals, which come with a big risk of leaking state between unit testsUnit testing is easy when an object only interacts with what was passed into its constructorConventionWhen depending on a config object the constructor should first extract what it needs and assign those values to fieldsCollaborators should also be assigned to fields, and ideally the constructor won't do anything elseAdvancedParameter defaults are honoured, this can be used to depend on module log object in real life and pass in a mock in unit testsDecorating an instance method (without 'this' kwarg) will make it behave as an additional constructorTake advantage of name mangling (start with double underscore e.g. __init) to avoid having to call superDecorating an instance method with 'this' kwarg will make it behave as a factory functionAdding a class to DI will implicity add all such methods it has as factoriesYou can play fast and loose with types, diapyr doesn't care whether a factoried object satisfies the declared typeInstallThese are generic installation instructions.To use, permanentlyThe quickest way to get started is to install the current release from PyPI:pip3 install --user diapyrTo use, temporarilyIf you prefer to keep .local clean, install to a virtualenv:python3 -m venv venvname
venvname/bin/pip install diapyr
. venvname/bin/activateTo developFirst clone the repo using HTTP or SSH:git clone https://github.com/combatopera/diapyr.git
git clone git@github.com:combatopera/diapyr.gitNow use pyven's pipify to create a setup.py, which pip can then use to install the project editably:python3 -m venv pyvenvenv
pyvenvenv/bin/pip install pyven
pyvenvenv/bin/pipify diapyr

python3 -m venv venvname
venvname/bin/pip install -e diapyr
. venvname/bin/activate
Package: diario
=================================
DIARIO Python SDK|Pypi Version|DIARIO bridges a natural gap that antiviruses do not usually match. DIARIO is not intended to replace antiviruses, but to cover the gap with fresh samples: DIARIO is especially good detecting them. DIARIO helps detect fresh malware without compromising your privacy or sharing content... |Pypi Version| image::https://img.shields.io/pypi/v/diario.svg:target:https://pypi.python.org/pypi/diarioPrerequisitesPython 3 or 2.7+A valid account in DIARIO (https://diario.elevenpaths.com) in order to get aAPP_IDandSECRET_KEYkeys (Registration is FREE).InstallationInstall diario package using pip::pip install diarioMinimal usageCreate a DIARIO object with the "Application ID" and "Secret" previously obtained.. code-block:: pythonfrom diario import Diario
api = Diario("APP_ID_HERE", "SECRET_KEY_HERE")'host' and 'port' default parameters are set to diario-elevenlabs.e-paths.com and 443.Call to DIARIO Server to do searches, upload and analyze documents, ..... code-block:: pythonresponse = api.search('23203f9264161714cdb8d2f474b9b641e6a735f8cea4098c40a3cab87439d749')After every API call, get DIARIO response data and errors and handle them.. code-block:: pythonresponse_data = response.data
response_error = response.errorREST API specificationRest API documentation (https://diario.elevenpaths.com/dashboard/apispecification/index).
Package: diarrhouea
THE PROJECT HAS BEEN RENAMEDSeekhansoulinstead.diarrhouea is a simple VTE-based terminal emulator written in PythonDependenciesPython 3PyGObjectGTK+ 3VTEWhere's the fucking manual?At the time, only--helpis availableHow to configureJust put your command line arguments into~/.diarrhouearcand you'll be fine
Package: diaryapps
Diary_appGetting Started
This is a website built using django 2.2.3 for practicing  djangoPrerequisites
python 3.7
Django 2.2.3Give examples
Installing
pip3 install diaryapp
change database settings on diary.settings
python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py runserverRunning the tests
use pytest to run test
use tox to automate tests
use flake8 to test coding stylesDeployment
use anisble or pip registry to deployBuilt With
django  - The web framework used
Contributing
Please read CONTRIBUTING.md for details of the codeVersioning
we use github for versioningAuthors
Justus Njogu- Initial work
See also the list of contributors who participated in this project.License
This project is licensed under the MIT License - see the LICENSE.md file for detailsAcknowledgments
Hat tip to anyone whose code was usedcoding toward better future.
Package: diarycli
DiaryCLI$ pip install diarycliOne CLI command to create and organize your diaries in the terminal.$ diaryopens a CLI editor to today's diary (path:$DIARY_DIR/year/month/date.md)$ diary catcat the content of today's diary to terminal.$ diary 2020-01-01create a diary entry for 2020/01/01 in the appropriate file path.Use environment argumentDIARY_DIRandDIARY_EDITORto configure where the diary are and what editor to use, by default, it usevimas editor and~/diaryas path for diary.When installing viapip, if you see following message:WARNING: The script diary is installed in '/some/path/examples/bin' which is not on PATH
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-locationYou may want to add this location toPATH, to do that, add the following line to your.rcfile:export PATH=$PATH:/some/path/examples/binDemoInspirationInspiration from bash diary script that I have created and used for years:https://github.com/Aperocky/diaryman/blob/master/diaryman.shpipprovides an easier way to package and distribute this software.
Package: diarypy
DiaryPyA python class to automatically save the partial/intermediary results of a running experiment in a set of notebooks (csv files) and images as files.Create a new diaryfrom diarypy.diary import Diary
diary = Diary(name='world', path='hello', overwrite=False,
              stdout=False, stderr=False)Create all the notebooks that you want to usediary.add_notebook('validation')
# You can use the returned instance later
notebook_test = diary.add_notebook('test')
# And specify the header
notebook_train = diary.add_notebook('training', header=['iteration', 'accuracy'])Store your results in the different notebooksdiary.add_entry('validation', ['accuracy', 0.3])
diary.add_entry('validation', ['accuracy', 0.5])
diary.add_entry('validation', ['accuracy', 0.9])
notebook_train.add_entry([0, 0.4])
notebook_train.add_entry([1, 0.6])
notebook_train.add_entry([2, 0.8])
notebook_test.add_entry(['First test went wrong', 0.345, 'label_1'])Add an imagefrom PIL import Image
image = Image.new(mode="1", size=(16,16), color=0)
diary.save_image(image, filename='test_results')Resulting filesThe files that are generated after executing the previous lines arehello/
└── world
    ├── description.txt
    ├── images
    │   └── test_results_4.png
    ├── test.csv
    └── training.csv
    └── validation.csvthe content of the files isdescription.txtDate: 2015-10-22 17:43:19.764797
Name : world
Path : hello/world
Overwrite : False
Image_format : pngvalidation.csv1,1,|2021-06-17|,|12:56:45.945000|,|accuracy|,0.3
2,2,|2021-06-17|,|12:56:46.813717|,|accuracy|,0.5
3,3,|2021-06-17|,|12:56:53.358989|,|accuracy|,0.9training.csv|id1|,|id2|,|date|,|time|,|iteration|,|accuracy|
4,1,|2021-06-17|,|12:56:54.231691|,0,0.4
5,2,|2021-06-17|,|12:56:55.128130|,1,0.6
6,3,|2021-06-17|,|12:56:56.006014|,2,0.8test.csv7,1,|2021-06-17|,|12:56:56.761961|,|First test went wrong|,0.345,|label_1|Unittestpython -m unittest discover diarypy
Package: diasapi
CMCC-DIAS-ClientDIAS API Client for access and analysis of CMCC dataRequirementsPython 3.7InstallationConda Installation$condainstall-cppos-cmccdiasapiPip installation$pipinstalldiasapiCloning the repository$gitclonehttps://github.com/CMCC-Foundation/cmcc-dias-client
$cdcmcc-dias-client
$pythonsetup.pyinstallConfigurationTo use the tool a file$HOME/.diasapircmust be created as followingurl:http://dias.cmcc.scc:8282/api/v1
key:<uid>:<api-key>ExamplesFor some examples how to use the tool seehere
Package: diaspora-event-sdk
Diaspora: Resilience-enabling services for science from HPC to edgeEvent Fabric SDK Installation GuideRecommended Method: Use withkafka-pythonFor easy integration with Diaspora Event Fabric, use theKafkaProducerandKafkaConsumerclasses from our SDK. This requires thekafka-pythonlibrary.To install the Event Fabric SDK andkafka-python,with the following command:pipinstall"diaspora-event-sdk[kafka-python]"Alternative Installation: Without Kafka Client LibraryTo use alternative Kafka client libraries (e.g.,confluent-kafka-python,aiokafka, and libraries for other programming laguages), you can install the SDK without thekafka-pythondependency. This option still provides topic-level access control (authorization) and login credential management features.To install the SDK withoutkafka-python, use:pipinstalldiaspora-event-sdkNote: This method does not include dependencies forKafkaProducerandKafkaConsumerclasses mentioned in the QuickStartUse Diaspora Event Fabric SDKGetting Started: Visit ourQuickStart Guidefor details on using the SDK with the kafka-python library and instructions for other Kafka clients.Troubleshooting and Credential Management: Consult ourTrobleShooting Guidefor solving common issues and tips on managing keys effectively.Advanced Usage: Explore theFaust Streaming Guidefor advanced event streaming with Faust.
Package: diastatic-malt
DiastaticMaltDiastaticMalt is a tool for source-to-source transformations and operator
overloading in Python, including the overloading built-in Python keywords.
It can be utilized to transform regular Python code into a new form better
suited for specific purposes, such as program capture.The contents of DiastaticMalt are copied with modification from the TensorFlow project,
in particular theAutoGraphmodule, under the Apache 2.0 license, allowing the use of AutoGraph functionality without
depending on TensorFlow. The modifications made here may eventually be contributed
to TensorFlow.InstallationDiastaticMalt can be installed viapip:pip install diastatic-maltContributing to DiastaticMaltWe welcome contributions — simply fork the DiastaticMalt repository, and then make apull
requestcontaining your contribution.We also encourage bug reports, suggestions for new features and enhancements.SupportSource Code:https://github.com/PennyLaneAI/diastatic-maltIssue Tracker:https://github.com/PennyLaneAI/diastatic-malt/issuesIf you are having issues, please let us know by posting the issue on our GitHub issue tracker.We also have aPennyLane discussion forum—come join the community
and chat with the PennyLane team.Note that we are committed to providing a friendly, safe, and welcoming environment for all. Please
read and respect theCode of Conduct.LicenseDiastaticMalt isfreeandopen source, released under the Apache License, Version 2.0.
Package: diastema
=================================================Diastema: Musical intervals and modality analysis=================================================Overview========**Diastema**, is a project to analyse musical modality. It uses Python2.For now, it's main features are :* Fondamental frequencies extraction (using *PredominentMelody()* from **Essentia**);* Getting the main frequencies as peaks of the probability density function from frequencies;* Comparing PDFs using a correlation coefficient;* Getting a similarity matrix between melodies.Installation============First, you need to install manually **Essentia** (http://essentia.upf.edu/).Then, install Diastema with the following :.. code:: pythonpip install diastemaOr :.. code:: pythongit clone https://github.com/AnasGhrab/diastemapython setup.py installBasic Usage=====To use Diastema :.. code:: pythonfrom diastema import *path = "path/to/a/folder/with/audios/wav/files/"Music = Melodies(path)Then you can.. code:: pythonMusic.PdfsPlot()Music.Simatrix()To Do=====Contact=======Homepage: http://anas.ghrab.tnEmail:* Anas Ghrab <anas.ghrab@gmail.com>License=======The MIT License (MIT)Copyright (c) 2015 Anas GhrabPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.
Package: dias-uteis
dias_uteisBiblioteca feita para facilitar o uso e cálculos de dias úteis no calendário brasileiro.Sem dependências externas.Testado em todas versões do Python a partir da versão 3.6.Fácil uso, API simples.Extremamente leve.Instalaçãopip install dias_uteisUsoimportdatetimeimportdias_uteisasdus>>> dus.last_du()
datetime.date(2023, 11, 7)

>>> dus.next_du() 
datetime.date(2023, 11, 9)

>>> date = datetime.date(2023, 11, 8)
>>> dus.is_du(date)
True

>>> corpus_christi_2020 = datetime.date(2020, 6, 11) # Corpus Christi 2020
>>> dus.is_holiday(corpus_christi_2020)
True

>>> dus.delta_du(date, 5) # Soma 5 dias úteis
datetime.date(2023, 11, 16)

>>> dus.delta_du(date, -2) # Subtrai 2 dias úteis
datetime.date(2023, 11, 6)

>>> a = datetime.date(2023,11,6)
>>> b = datetime.date(2023,11,16)
>>> dus.diff_du(a, b)
7

>>> start = datetime.date(2023, 10, 20) 
>>> end = datetime.date(2023, 11, 7)  
>>> dus.du_range(start, end)
[datetime.date(2023, 10, 20), datetime.date(2023, 10, 23), datetime.date(2023, 10, 24),
datetime.date(2023, 10, 25), datetime.date(2023, 10, 26), datetime.date(2023, 10, 27),
datetime.date(2023, 10, 30), datetime.date(2023, 10, 31), datetime.date(2023, 11, 1), 
datetime.date(2023, 11, 3), datetime.date(2023, 11, 6)]

>>> dus.year_holidays(2023) # Lista todos feriados de 2023
[datetime.date(2023, 1, 1), datetime.date(2023, 2, 20), datetime.date(2023, 2, 21), 
datetime.date(2023, 4, 7), datetime.date(2023, 4, 21), datetime.date(2023, 5, 1), 
datetime.date(2023, 6, 8), datetime.date(2023, 9, 7), datetime.date(2023, 10, 12), 
datetime.date(2023, 11, 2), datetime.date(2023, 11, 15), datetime.date(2023, 12, 25)]
Package: dias-uteis-rpa
dias-uteis-brasilget dias_uteis_brasil, dias_uteis_mes, hoje_eh_dia_util########### como chamar e utilizar a classe ###################fromdias_uteis_brasilimportdia_utildia_util.dias_uteis_mes()dia_util.feriados_nacionais(2022)dia_util.dias_uteis_mes(11,2022)res=dia_util.hoje_eh_dia_util(25,12,2022)print(res)
Package: diatomic-py
Python package to calculate the hyperfine energy levels of singlet sigma diatomic molecules (e.g. RbCs, KCs and KRb) under various applied fields.
The hyperfine structure can be calculated in static electric and magnetic fields and, when provided the polarisability, oscillating electric fields.More detailed information can be found in the documentation athttps://diatomic-py.readthedocs.io.Diatomic-py is licensed under a BSD 3 clause license, a copy can be foundhere.If you use our work for academic purposes you can cite us using:J.A.Blackmoreet al.Diatomic-py: A python module for calculating the rotational and hyperfine structure of\(^1\Sigma\)molecules, [Arxive-prints2205.05686](https://arxiv.org/abs/2205.05686) (2022).This work has continued to evolve since the release of the paper, and so the API is different.PyPi InstallationThis form of the package is not currently available on PyPIManual InstallationClone the repository:gitclonehttps://github.com/durham-qlm/diatomic-py.gitcddiatomic-pyIt is recommended to then install the python package into virtual environment:# You may need to substitute `python` for `python3` if you're on macOSpython-mvenv./venvsource./venv/bin/activate# After activating the virtual env you should only need `python`python--versionwhichpythonThe below installation commands assume you are active in such an environment.
You can then install the package, there are various options indicated inside
the square brackets for the command types:# Installs essentials + matplotlibpython-mpipinstall".[plotting]"# OR if you also want to run test suite:python-mpipinstall".[test,plotting]"pytest# OR if you want to develop code for the packagepython-mpipinstall-e".[dev,plotting]"pre-commitinstallExampleimportnumpyasnpimportmatplotlib.pyplotaspltimportscipy.constantsfromdiatomic.systemsimportSingletSigmaMoleculeimportdiatomic.operatorsasoperatorsimportdiatomic.calculateassolverGAUSS=1e-4# TMHz=scipy.constants.h*1e6# Generate Moleculemol=SingletSigmaMolecule.from_preset("Rb87Cs133")mol.Nmax=2# Generate HamiltoniansH0=operators.hyperfine_ham(mol)Hz=operators.zeeman_ham(mol)# Parameter SpaceB=np.linspace(0.001,300,50)*GAUSS# Overall HamiltonianHtot=H0+Hz*B[:,None,None]# Solve (diagonalise) Hamiltonianseigenenergies,eigenstates=solver.solve_system(Htot)# Plot resultsfig,(ax_up,ax_down)=plt.subplots(2,1,sharex=True)ax_down.plot(B/GAUSS,eigenenergies[:,0:32]/MHz,c="k",lw=0.5,alpha=0.3)ax_up.plot(B/GAUSS,eigenenergies[:,32:128]/MHz,c="k",lw=0.5,alpha=0.3)ax_down.set_xlabel("Magnetic Field (G)")fig.supylabel("Energy / h (MHz)")plt.show()For more examples of usage, see the./examplesfolder.