Saravanan666/pypi-org huggingface dataset:
Package: error-parity
error-parityFast postprocessing of any score-based predictor to meet fairness criteria.Theerror-paritypackage can achieve strict or relaxed fairness constraint fulfillment,
which can be useful to compare ML models at equal fairness levels.InstallingInstall package fromPyPI:pip install error-parityOr, for development, you can clone the repo and install from local sources:git clone https://github.com/socialfoundations/error-parity.git
pip install ./error-parityGetting startedSee detailed example notebooks under theexamples folder.fromerror_parityimportRelaxedThresholdOptimizer# Given any trained model that outputs real-valued scoresfair_clf=RelaxedThresholdOptimizer(predictor=lambdaX:model.predict_proba(X)[:,-1],# for sklearn API# predictor=model,  # use this for a callable modelconstraint="equalized_odds",tolerance=0.05,# fairness constraint tolerance)# Fit the fairness adjustment on some data# This will find the optimal _fair classifier_fair_clf.fit(X=X,y=y,group=group)# Now you can use `fair_clf` as any other classifier# You have to provide group information to compute fair predictionsy_pred_test=fair_clf(X=X_test,group=group_test)How it worksGiven a callable score-based predictor (i.e.,y_pred = predictor(X)), and some(X, Y, S)data to fit,RelaxedThresholdOptimizerwill:Compute group-specific ROC curves and their convex hulls;Compute ther-relaxed optimal solution for the chosen fairness criterion (usingcvxpy);Find the set of group-specific binary classifiers that match the optimal solution found.each group-specific classifier is made up of (possibly randomized) group-specific thresholds over the given predictor;if a group's ROC point is in the interior of its ROC curve, partial randomization of its predictions may be necessary.Features and implementation road-mapWe welcome community contributions forcvxpyimplementations of other fairness constraints.Currently implemented fairness constraints:equality of odds (Hardt et al., 2016);i.e., equal group-specific TPR and FPR;useconstraint="equalized_odds";equal opportunity;i.e., equal group-specific TPR;useconstraint="true_positive_rate_parity";predictive equality;i.e., equal group-specific FPR;useconstraint="false_positive_rate_parity";Road-map:demographic parity;i.e., equal group-specific predicted prevalence;CitingThis repository contains code and supplementary materials for the following preprint:André F. Cruz and Moritz Hardt. "Unprocessing Seven Years of Algorithmic Fairness."arXiv preprint, 2023.
Package: errorpro
ErrorPro allows to do calculations in IPython with physical quantities, which contain a value, error and unit.It’s features are:calculations with physical quantities including error propagation and SI unit propagationspecifying your data in an intuitive physicist-oriented waycalculating whole data sets at once (to a certain extend multi-dimensional)calculating weighted and unweighted mean valuesfitting curves to data (using scipy’s curve_fit)plotting your data (using matplotlib)arranging your data nicely in HTML and LaTex tablesshowing the error formula and it’s LaTex codeTo learn more about ErrorPro, have a look at theWiki!
Package: error-propagation
Error PropagationEvery number should have an error, even if it's 0.To do so, we have created a python package that makes it easy to propagate errors when performing calculations.(10 ± 3) + (11 ± 4) != (21 ± 7)To calculate the error when adding 2 numbers, the L2 norm must be calculated(10 ± 3) + (11 ± 4) != (21 ± (3 ** 2 + 4 ** 2) ** 0.5) == (21 ± 5)Calculating the error when multiplying, dividing, exponentiation is significantly harder, but
still important! Please checkoutthis notebookfor derivations of
error propagation formulas.How to useCreate a Complex class instance:Basic Functionalityfromerror_propagationimportComplexa=Complex(10,3)b=Complex(11,4)# Compute basic operationsa+b# 21.0 ± 5.0a-b# -1.0 ± 5.0a*b# 110.0 ± 51.85556864985669a/b# 0.9090909090909091 ± 0.42855841859385696a**b# 100000000000.0 ± 978367874409.4901# Compute basic equalitiesa==b# Falsea!=b# Truea<b# Truea<=b# Truea>b# Falsea>=b# FalseNumpy and Pandas integrationfromerror_propagationimportComplex,arrays_to_compleximportnumpyasnpimportpandasaspda=np.array([Complex(3,4),Complex(8,3)])b=np.array([Complex(2,3),Complex(10,4)])a+b# array([5.0 ± 5.0, 18.0 ± 5.0], dtype=object)a*b# array([6.0 ± 12.041594578792296, 80.0 ± 43.86342439892262], dtype=object)df=pd.DataFrame({"values":[1,2],"errors":[3,4]})df["complex_numbers"]=arrays_to_complex(values=df["values"],errors=df["errors"])Financial functionsfromerror_propagationimportComplexfromerror_propagation.financeimportnpvresult=npv(cash=[Complex(10,2),Complex(11,3),Complex(12,1)],discount_rate=Complex(0.05,0.001),)result# 29.867184969225782 ± 3.432196994041631Leverage functionsfromerror_propagationimportComplexa=Complex(10,3)b=Complex(11,4)Complex.add(a,b)# 21.0 ± 5.0Complex.sub(a,b)# -1.0 ± 5.0Complex.mul(a,b)# 110.0 ± 51.85556864985669Complex.truediv(a,b)# 0.9090909090909091 ± 0.42855841859385696Complex.pow(a,b)# 100000000000.0 ± 978367874409.4901To see more examples, go todocs/functionality.mdand thetestsfolder.How to installerror-propagation is hosted on PyPpip install error-propagation
Package: errorship
errorshiperrorshipis a python library that sends exceptions/errors
generated by your application to your datadog account.The exceptions together with their stacktraces are then rendered
beatifully with proper syntax highlighting preserved.You can search for exceptions in datadog using the tags that you had
set or via full text search.Are you tired of looking at metrics in datadog and then switching over
to another website to track your applications exceptions?Try`errorship<https://errorship.com>`__errorshiphas no third-party dependencies.It works in both Python 2 & python 3Click here for
DocumentationInstallationpipinstallerrorshipUsageAdd the following piece of code at a place where it can be executed
very early at the startup of your application.Such a place can be in an__init__.pyfile or at the top of yourmain.pyfile.importerrorshiperrorship.setup(datadog_agent_host="localhost",datadog_agent_port=8125,errorship_license_key="MyErrorshipLicenseKey",tags={# this tags will be added to the errors/exceptions# that are sent to datadog"env":"production","project":"accounting","deployment_version":"v12.56"})More documentation isavailableScreenshotsErrors, exceptions, stacktraces and associated metadata as rendered in
datadog;errorship rendered exceptions in datadogerrorship rendered exceptions in datadogerrorship rendered exceptions in datadogerrorship rendered exceptions in datadog
Package: error-simplesqlite
SimpleSQLite LibrarySimplesqlite is a sqlite3 based python library that provides a simple interface to communicate with a sqlite databasefromsimplesqliteimportSSQLite,Fielddefexample():db=SSQLite()db.create('user',Field('name').primary().text(),Field('age').integer().null())db.insert('user',{"name":"Carlos1","age":24})
Package: error-solver
Error SolverAboutThis package contains classes for estimating the propagation error tolerances
for a system of equations.InstallationThis package may be installed via pip:pip install error_solverThe above installation only install the dependencies required for theErrorSolverPyclass. To also install the dependencies necessary for theErrorSolverclass, use the following command instead:pip install error_solver[all]Example: Error in CylinderThe below example determines the propagation error tolerances for the cross sectional
areaAand volumeVof a cylinder given the measurement tolerance for the radiusrand heighth.fromerror_solverimportErrorSolver# Define the equationsEQUATIONS=['A = pi * r**2','V = A * h']# Solve the equations by some means and assemble the values in a dictionaryvalues={'h':12,'r':5,'A':78.54,'V':942.48}# Define the known error toleranceserrors={'h':0.05,'r':0.05}solver=ErrorSolver(EQUATIONS)solver.solve(values,errors)#           value      error  pct_error  is_calc# var# A     78.539816   1.570796   2.000000     True# V    942.477796  22.776547   2.416667     True# h     12.000000   0.050000   0.416667    False# r      5.000000   0.050000   1.000000    False
Package: error-suggester
Error SuggesterA Python library for error suggestions.Installationpipinstallerror-suggesterUsagefromerror_suggesterimportErrorSuggester# Initialize ErrorSuggester with your OpenAI API key and enable auto suggestionsErrorSuggester('YOUR_API_KEY').enable_auto_suggestions()FeaturesAutomatic error suggestions based on the provided error message.Helps in identifying possible resolutions for encountered errors and exceptions.
Package: errortext
errortexterrortextis a Python package to provide error messages for Python
exceptions, even if the original message is empty.As example consider the following function that might fail in different ways:fromerrortextimporterror_textdefdo_something(action_to_perform):ifaction_to_perform=="walk":print("walking")elifaction_to_perform=="sleep":raiseValueError("must be tired in order to sleep")elifaction_to_perform=="run":raiseNotImplementedError("run")else:assertFalseOne could use the following code to run this function and print possible
error details by using the error message of the exception fromstr(error):try:do_something(action)print(f"Success: done with{action}")exceptExceptionaserror:print(f"Error: cannot{action}:{str(error)}")As you notice, some error will not have any meaningful message:do_something("sleep") -> cannot sleep: must be tired in order to sleep
do_something("run")   -> cannot run: run
do_something("xxx")   -> cannot xxx:No change the error handler to:print(f"Error with error_text: cannot{action}:{error_text(error)}")The error messages will at least contain some hint at what went wrong:do_something("sleep") -> cannot sleep: must be tired in order to sleep
do_something("run")   -> cannot run: NotImplementedError: run
do_something("xxx")   -> cannot xxx: AssertionError
Package: error-visor
Error VisorQue es?Es un proyecto destinado a guardar registros personalizados en un archivo json que será utilizado
más tarde para visualizarse en una app web de forma localizada y ordenada. Solo es necesaria una
sentencia y listo, ya tienes el registro del error en tu app.Cómo funciona?Primero instalamos con:pipinstallerror-visorImportamos el módulo:importerror_visorasEVLuego localizamos el lugar desde donde queremos mandar el log. Por ejemplo un bloqueexceptiony
colocamos el siguiente código:exceptExceptionasex:EV.log(EV.Error(description='Error de muestra',ex=ex,priority=EV.Priority.HIGH))Para unaadvertencia/warning:exceptExceptionasex:EV.log(EV.Warning(description='Advertencia de muestra',ex=ex,follow_me=True))Y listo, tendremos el registro en un json!CHANGELOGv0.0.6Fixed: Package .whl has the wrong uploadedv0.0.5Added: printable function to EV.log() -> It prints the status of the log to saveFixed: When we pass an Exception with args, it raises a JSONDecodeError!v0.0.4Modified: Now to log should be:EV.log(EV.Error(...))#orEV.log(EV.Warning(...))Modified: RTypes have new attrcontext. Its a merge betweenfunctionandclass.Fixed: Make of new log when thelogsdir exists. The new log file wasn't created or created empty.v0.0.3Fixed: Making of newlogsdir when that not exists. Really work now!Added: Warning TypeModified: RTypes have have new format to use. RTypes are like:EV.Error,EV.Warning, etc.v0.0.2Fixed: Making of newlogsdir when that not existsv0.0.1First upload
Package: error-wrapper
Error WrapperInheritance from the package’s classes allows you to handle errors of any level in a uniform way and automatically log error messages if desired. This is a familiar routine, a fraction of which I wanted to reduce:)InstallationInstall from PyPI with:pip install error-wrapperUsageCompletely abstract example:)logger=logging.getLogger(__name__)classDivNum(ErrorWrapper):deftest_args_number(self,*args):iflen(args)!=2:self.raise_instance_error(f'{ARG_NUM_ERROR}{len(args)}')return@run_method_if_no_errorsdeftest_args_type(self,*args):ifnotisinstance(args[0],int)ornotisinstance(args[1],int):self.raise_instance_error(ARG_TYPE_ERROR)returndefdiv(self,*args):self.clear_instance_error()self.test_args_number(*args)self.test_args_type(*args)ifself.error:returnself.error_detailtry:returnargs[0]/args[1]exceptExceptionase:self.raise_instance_exception(e)returnself.error_detail# Default creating params: report_prefix=None, exception_name_in_detail=False,#                          logger=None, auto_logging=Falsedivnum_with_defaults=DivNum()divnum_with_auto_logging=DivNum(auto_logging=True,logger=logger)divnum_with_prefix_in_log_or_error_vessage=DivNum(report_prefix='DevNum instance error: ')
Package: errr
errrElegantly create detailed exceptions in Python.Detailed exceptions>>>importerrr>>>classMyException(errr.DetailedException,list_detailts=True,details=["cause","type"]):...pass...>>>example=MyException("The backend server crashed","backend","crash")>>>raiseexample__main__.MyException:ThebackendservercrashedDetails:Ëªcause:backendËªtype:crash>>>example.details{'cause':'backend','type':'crash'}>>>example.cause'backend'Semantic exceptionsYou can also rapidly create large semantic trees of exceptions using themake_treefunction, listing exceptions as keyword arguments using theerrr.exceptionfactory
method. Themake_treemethod executes these recursive factories to produce your
exceptions. Nesting these factory methods will make the resultant exceptions inherit from
eachother. All of the produced exceptions are then flat injected into the given module
dictionary (typically) this should beglobals()but you can inject into other modules
usingsys.modules["name"].__dict__.fromerrrimportmake_tree,exceptionas_emake_tree(# Pass the module dictionary as first argumentglobals(),# List your nested exceptionsRootException=_e(ChildException=_e(),Child2Exception=_e()),SecondRootException=_e(# List details as positional arguments"detail1","detail2",# And continue with child exceptions as keyword argumentsAnotherChildException=_e()))print(RootException)# <class '__main__.RootException'>print(ChildException)# <class '__main__.ChildException'>print(ChildException.__bases__)# (<class '__main__.RootException'>,)Exception wrappingYou can catch and reraise exceptions as a new type of exception with thewrapfunction:importerrrclassLibraryError(errr.DetailedException,details=["library"]):passforname,libraryinlibraries.items():try:library.load()exceptExceptionase:errr.wrap(LibraryError,e,name,prepend="When trying to load%library% it reported:\n")# Traceback#   ...# __main__.LibraryError: When trying to load myLibrary it reported:# Module 'missing' not found.
Package: errs
errsType-safe error handling for Python.Free software: MIT licenseDocumentation:https://errs.readthedocs.io.Installationpip install errsUsageThe@errsdecorator marks any function or method that raises anException. Rather than handling theExceptionexplicitly, we collect the result of the function and then check whether an error occurred.This leads to code that is more explicit about error handling as well as resilient to the raising of unforeseen exceptions. This style is similar to error handling in Go.Additionally, all exceptions wrapped by@errswill be logged to the default Python logger on the error level. This provides a powerful abstraction where runtime behaviors are logged and separated from current application state.fromerrsimporterrs@errsdefraises():#type: () -> intraiseException('this will get logged')return0defcheck_error():#type: () -> Noneout,err=raises()print('Error:{err}'.format(err.check()))if__name__=='__main__':check_error()#prints Error: TrueCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2018-12-30)First release on PyPI.
Package: errui
ErrUIOpen a window when an exception is raised and prompt the end user to decide what to do.Installationpython-mpipinstallerruiExampleAbortWindow(Optional suppression)This is likecontextlib.suppressexcept you get to choose whether to suppress it or to let the exception through and still be raised.fromerruiimportAbortWindowwithAbortWindow(KeyError):{}[0]
Package: ersatz-table-valued-functions
ersatz-table-valued-functionsA bad idea.ersatz(adj.): made or used as a substitute, typically an inferior one, for something else.InstallationInstall this library usingpip:pip install ersatz-table-valued-functionsUsageThis library lets you rewrite queries like:SELECTroot,squareFROMtbl_squares(3)into queries like:WITH_ersatz_1AS(SELECTJSON_EXTRACT(value,'$[0]')AS"root",JSON_EXTRACT(value,'$[1]')AS"square"FROMJSON_EACH((SELECTtbl_squares(3))))SELECTroot,squareFROM_ersatz_1That is: it translates a query thatlookslike it needs a table-valued function
into one that uses a scalar-valued function that returns a JSON 2D array.To use it:fromersatz_table_valued_functionsimportrewriterewrite('SELECT root, square FROM tbl_squares(3)',{'TBL_SQUARES':['root','square']})DevelopmentTo contribute to this library, first checkout the code. Then create a new virtual environment:cd ersatz-table-valued-functions
python -m venv venv
source venv/bin/activateNow install the dependencies and test dependencies:pip install -e '.[test]'To run the tests:pytest
Package: erscimenu
ErscimenuCreate UL LI html menu from django model queryset .Quick startAdderscimenuto your INSTALLED_APPS setting like this:INSTALLED_APPS = [
...,
'erscimenu' ,
]2.Runpython manage.py makemigrationsandpython manage.py migrateto create the MenuModel models.3.add your menu with admin registered MenuModel.4.Use this command to add menu with your views like this:from erscimenu.menu import MenuClass

def index(request):
	c=MenuClass()
	return HttpResponse(c)4.Runpython manage.py runserverVisithttp://127.0.0.1:8000to create users and its cards.Model is like this:class MenuModel(models.Model):
	title = models.CharField(max_length=100)
	css_class = models.CharField(max_length=100,null=True,blank=True)
	link = models.CharField(max_length=1000,null=True,blank=True)
	parent = models.ForeignKey("self",models.DO_NOTHING,null=True,blank=True) 
	def __str__(self):
		return self.title
Package: erscipcard
ErscipcardErscipcard is a Django app to create personeli card.
For each user,create a card and export it as pdf and docx documents.TipYou can edit model.py file to create your own database table , also edit template MSWord file to customize your card.Quick start1.Add "erscipcard" to your INSTALLED_APPS in your project setting.py file:INSTALLED_APPS = [
...,
'erscipcard',
]2.Include the erscipcard URLconf in your project urls.py like this:path('erscipcard/', include('erscipcard.urls')),3.Runpython manage.py makemigrations(optional) andpython manage.py migrateto create the erscipcard models.then runpython manage.py createsuperuserto create personel for login erscipcard page.4.Visithttp://127.0.0.1:8000/erscipcard/to create users and its cards.You can download card template , edit it and uplaod your custom template , then print cards.You can also set variables in your project settings.py to control some things like below:CSRF_TRUSTED_ORIGINS = ['YourSiteAddress','https://*.127.0.0.1']
ERSCIPCARD_PICWIDTH = "5" #for width of picture in your card
ERSCIPCARD_EXCLUDE = ['reserv1','reserv2','reserv3','reserv4',] #which fields shown in your insert and edir form
ERSCIPCARD_LABELS = { 'address' : 'نشانی',}#custom labels for addition fields
Package: ersciyt
ErscipcardQuick start1.Add "ersciyt" to your INSTALLED_APPS in your project setting.py file:INSTALLED_APPS = [
...,
'ersciyt',
]2.Include the erscipcard URLconf in your project urls.py like this:path('yt/', include('ersciyt.urls')),3.Visithttp://127.0.0.1:8000/yt/to create users and its cards.4.run this command if you on shell.cloud.google:python
>>>from ersciyt import inst
>>>inst.run()
Package: ersilia
🎉 Welcome to the Ersilia Model Hub 🌟Table of ContentsProject DescriptionQuick start guideContributeLicense and citationAbout usProject DescriptionTheErsilia Model Hubis a unified platform of pre-trained AI/ML models dedicated to 🦠 infectious and neglected disease research. Our mission is to offer an open-source, 🛠 low-code solution that provides seamless access to AI/ML models for 💊 drug discovery. Models housed in our hub come from two sources:📚 Published models from literature (with due third-party acknowledgement)🛠 Custom models developed by theErsilia teamor our valued contributors.Read more about the project in theErsilia BookBrowse available models in theErsilia Model HubQuick Start GuidePlease check the package requirements in theInstallation Guide. The next steps are a quickstart guide to installing Ersilia.Create a conda environment and activate itcondacreate-nersiliapython=3.10
condaactivateersiliaClone this repository and install with pipgitclonehttps://github.com/ersilia-os/ersilia.gitcdersilia
pipinstall-e.Once the Ersilia Model Hub is installed, you can use the CLI to run predictions. First, select a model from theErsilia Model Hubandfetchit:ersiliafetchretrosynthetic-accessibilityGenerate a few (5) example molecules, to be used as input. Theexamplecommand will generate the adequate input for the model in useersiliaexampleretrosynthetic-accessibility-n5-fmy_molecules.csvThen,serveyour model:ersiliaserveretrosynthetic-accessibilityAndrunthe model:ersiliarun-imy_molecules.csv-omy_predictions.csvFinally,closethe service when you are done.ersiliacloseIf you no longer want to use the model, you candeleteit.ersiliadeleteretrosynthetic-accessibilityPlease see theErsilia Bookfor more examples and detailed explanations.ContributeThe Ersilia Model Hub is a Free, Open Source Software and we highly value new contributors. There are several ways in which you can contribute to the project:A good place to start is checking openissues.If you have identified a bug in the code, please open a new issue using the bug template.Share any feedback with the community usingGitHub Discussionsfor the projectCheck ourContributing Guidefor more detailsThe Ersilia Open Source Initiative adheres to theContributor Covenantcode of conduct.Submit a New ModelIf you want to incorporate a new model in the platform, open a new issue using themodel request templateor contact us using the followingform.After submitting your model request via an issue (suggested), a maintainer will review your request. If they/approveyour request, a new model respository will be created for you to fork and use! There is ademo repositoryexplaining the steps one-by-one.License and CitationThis repository is open-sourced under theGPL-3 License.
Pleasecite usif you use it!About UsTheErsilia Open Source Initiativeis a Non Profit Organization (1192266) with the mission is to equip labs, universities and clinics in LMIC with AI/ML tools for infectious disease research.Help usachieve our mission orvolunteerwith us!
Package: ers-terminal-utils
terminal-utilsA python package for UNIX terminal utilitiesMenuGetting startedInstalationWith public pip repositoryLocal installationUninstallationUsageDynamic choicesMode: One choiceMode: Multiple choicesLICENSEGetting startedInstallationWith public pip repositorypipinstallers-terminal-utilsUninstallationpipuninstallers-terminal-utilsUsageDynamic choices via terminalMode: one choice(Source Code)fromterminal_utils.choices_via_terminalimportChoicesViaTerminalLIST_OF_CHOICES=['Option 1','Option 2','Option 3','Option 4','Option 5']TITTLE='Choose an option'response=ChoicesViaTerminal(TITTLE,LIST_OF_CHOICES).main()chosen_option_index,chosen_option_text=response[0]print()print('Chosen option index:{}\n''Chosen option text:{}'.format(chosen_option_index,chosen_option_text))Mode: Multiple choices(Source Code)fromterminal_utils.choices_via_terminalimportChoicesViaTerminalLIST_OF_CHOICES=['Option 1','Option 2','Option 3','Option 4','Option 5']TITTLE='Choose one or more options'response=ChoicesViaTerminal(TITTLE,LIST_OF_CHOICES,mode='multiple_choices').main()print('')forchosen_option_index,chosen_option_textinresponse:print('- Chosen option index:{}|Chosen option text:{}'.format(chosen_option_index,chosen_option_text))LICENSEThis project is licensed under the MIT License - see theLICENSEpage for details.