Saravanan666/pypi-org huggingface dataset:
Package: conformity
Conformityis a declarative schema validation library designed for use in libraries, services, application
settings, and more.Declare a schema:fromconformity.fieldsimportDictionary,Float,Integer,List,UnicodeStringperson=Dictionary({"name":UnicodeString(),"height":Float(gte=0),"event_ids":List(Integer(gt=0)),})Check to see if data is valid:data={"name":"Andrew","height":180.3,"event_ids":[1,"3"]}errors=person.errors(data)# Key event_ids: Index 1: Not an integerAnd wrap functions to validate on the way in and out:kwargs=Dictionary({"name":UnicodeString(),"score":Integer(),},optional_keys=["score"])@validate_call(kwargs,UnicodeString())defgreet(name,score=0):ifscore>10:return"So nice to meet you,{}!".format(name)else:return"Hello,{}.".format(name)There’s support for basic string, numeric, geographic, temporal, networking, and other field types, with everything
easily extensible (optionally via subclassing). Conformity also boasts support for full-blown application settings
schema definition and validation complete with definable defaults, and includes Sphinxautodocextensions to help
you generate meaningful documentation for your code using Conformity.LicenseConformity is licensed under theApache License, version 2.0.InstallationConformity is available in PyPi and can be installing directly via Pip or listed insetup.py,requirements.txt,
orPipfile:pipinstall'conformity~=1.26'install_requires=[...'conformity~=1.26',...]conformity~=1.26conformity = {version="~=1.26"}DocumentationThe complete Conformity documentation is available onRead the Docs!
Package: confound-prediction
Confound PredictionConfound_prediction is a Python module to control confound effect in the prediction or classification model.Any successful prediction model may be driven by a confounding effect that is correlated with the effect of interest. It is important to control that detected associations are not driven by unwanted effects. It is common issue in in neuroscience, epidemiology, economy, agriculture, etc.This module provides 3 methods to tackle confounding effects in predictive models:1. Confound-isolating cross-validation2. Out-of-sample deconfounding3. Deconfounding test and train jointly (which should not be used, and is provided only for illustration)Confound-isolating cross-validation“Confound-isolating cross-validation” is a non-parametric approach to control for a confounding effect in a predictive model. It is based on crafting a test set on which the effect of interest is independent from the confounding effect.What expect from Confound_prediction?Developed framework is based on anti mutual information sampling, a novel sampling approach to create a test set in which the effect of interest is independent from the confounding effect. The grafical illustration of classic and confound-isolating cross-validation:How does it work?You provide usVariables:X- data with shape (n_samples, n_features)y- target vector with shape (n_samples)z- confound vector with shape (n_samples)Optional parametersmin_sample_size- minimum sample size to be reached, default is 10% of the datan_remove- number of the samples to be removed on each iteration of sampling, default is 4prng- control the pseudo random number generator, default is Nonecv_folds- number of folders in the cross validation, default is 10We return youVariables:x_test, x_train, y_test, y_train, ids_test, ids_train- train and test ofX,yandsampled indexesInstallingDependencesconfound_prediction package requires:Python (>= 3.5)Scipy (>=1.1.0)Scikit-learn (>=0.21.2)Numpy (>=1.14.2)Pytest(>=5.1.1)Optional dependency:Matplotlib (>=2.2.2) for example visualizationSeaborn (>=0.8) for example visualizationUser installationpipinstallTBDExamplesExample: create train set and test set without confounding effectpythonexample/Example_get_testset.pyExample: compare prediction on data sampled with different deconfounding methods on the data with direct link between target and confoundpythonexample/Example-prediction-different-deconfounding-direct-confound.pyExample: compare prediction on the data with different confound effectpythonexample/Example-prediction-isolatingcv-deconfounding-dif-confound.pyExample: evolution of mutual information and correlation on each itteration of 'confound-isolation cross-validation' methodpythonexample/Example_compare_mutual_info_correlation.pyReferences[1] TBD[2] D. Chyzhyk, G. Varoquaux, B. Thirion and M. Milham, "Controlling a confound in predictive models with a test set minimizing its effect," 2018 International Workshop on Pattern Recognition in Neuroimaging (PRNI), Singapore, 2018, pp. 1-4.
doi: 10.1109/PRNI.2018.8423961PDF
Package: confounds
Vision / GoalsThe high-level goals of this package is to develop high-quality library to conquer confounds and covariates in ML applications. By conquering, we mean methods and tools tovisualize and establish the presence of confounds (e.g. quantifying confound-to-target relationships),offer solutions to handle them appropriately via correction or removal etc, andanalyze the effect of the deconfounding methods in the processed data (e.g. ability to check if they worked at all, or if they introduced new or unwanted biases etc).MethodsResidualize (e.g. via regression)Augment (include confounds as predictors)Harmonize (correct batch effects via rescaling or normalization etc)Stratify (sub- or resampling procedures to minimize confounding)Utilities (Goals 1 and 3)Home-page:https://github.com/raamana/confoundsAuthor: Pradeep Reddy Raamana
Author-email:raamana@gmail.comLicense: Apache Software License 2.0
Description: conquering confounds and covariates in machine learning
Keywords: confounds
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Package: confparser
Python Config Parser Libraryconfparser is a config parser by yml file or dictionary.In confparser, you can easily access to value through dot notation.Like,conf.debug,conf.server.dev.debug.Installationpip3installconfparserUsageConfig by .yml fileCreate yml filedebug:Trueserver:dev:debug:Trueport:8000prod:debug:Falseport:80Import confparser and insert your yml file.fromconfparserimportConfParserconfig=ConfParser(path='./config.yml').to_obj()print(config)# {'debug': True, 'server': {'dev': {'debug': True, 'port': 8000}, 'prod': {'debug': False, 'port': 80}}}print(config.debug)# Trueprint(config.server)# {'dev': {'debug': True, 'port': 8000}, 'prod': {'debug': False, 'port': 80}}print(config.server.dev)# {'debug': True, 'port': 8000}print(config.server.dev.debug)# Trueprint(config.server.dev.port)# 8000print(config.server.prod.debug)# Falseprint(config.server.prod.port)# 80Config by dictionaryImport confparser and insert your dictionary.fromconfparserimportConfParserconf_dict={'debug':True,'server':{'dev':{'debug':True,'port':8000,},'prod':{'debug':False,'port':80,},}}config=ConfParser(conf_dict=conf_dict).to_obj()print(config)# {'debug': True, 'server': {'dev': {'debug': True, 'port': 8000}, 'prod': {'debug': False, 'port': 80}}}print(config.debug)# Trueprint(config.server)# {'dev': {'debug': True, 'port': 8000}, 'prod': {'debug': False, 'port': 80}}print(config.server.dev)# {'debug': True, 'port': 8000}print(config.server.dev.debug)# Trueprint(config.server.dev.port)# 8000print(config.server.prod.debug)# Falseprint(config.server.prod.port)# 80Notepathandconf_dictcannot be used at once.DependenciesTo use parsing yml file,pyyamlis needed.But it will be install automatically with confparser so you don't have to install manually.
Package: confplot
ConfPlot: Plot Confusion Matrix in PythonPlot a pretty confusion matrix (like Matlab) in python using seaborn and matplotlibThis module lets you plot a pretty looking confusion matrix from a np matrix or from a prediction results and actual labels.Sample plots:Getting startedInstallationpip install confplotUsagePlot confusion matrix from matrix# import packageimportconfplot# assume you have a confusion matrix array like thisarray=np.array([[13,0,1,0,2,0],[0,50,2,0,10,0],[0,13,16,0,0,3],[0,0,0,13,1,0],[0,40,0,1,15,0],[0,0,0,0,0,20]])# convert it to a pandas dataframedf_cm=DataFrame(array,index=range(1,7),columns=range(1,7))# create and save confusion matrix plot as "cm_plot.png"confplot.plot_confusion_matrix_from_matrix(df_cm,outfile="cm_plot.png")Plot confusion matrix from data# import packageimportconfplot# assume you have 1D y_true (actual values) and y_pred (predictions) arraysy_true=...y_pred=...# arange targetclass names if you wantcolumns=["ahududu","ananas","armut","avokado","ayva"]# create and save confusion matrix plot as "cm_plot.png"confplot.plot_confusion_matrix_from_data(y_true,y_pred,columns,outfile="cm_plot.png")
Package: confpluspy
Reads file with configurations and returns dictionary with sections
and options. All options will be turned into python objects (DON’T
FORGET PUT ALL STRING OPTIONS WITHIN QUOTES).You can use @SECTION:OPTION@ notation to refer to existed python object,
or $SECTION:OPTION$ to convert object back into a string and insert a string.Returns option dictionary or raise an error.
Empty dictionary indicates error with file opening, reading or parsing.If confreader couldn’t turn option into some python object, this
options is skipped and Warning message will put in logger.
Package: confpoint
Confpoint (Confluence / SharePoint) toolsThis module contains a set of CLI utils for working with the Atlassian Confluence and the Microsoft SharePoint.
It contains three submodules:publisher, uploader, downloader.publishermodule allowed to you a public and remove Confluence page. The page creating from markdown file.Using example (PowerShell script):py-mconfpoint.publisher--user"user@mail.com"--apikey"123abc"`--space"your space"`--parent"parent page (optional)"`--title"title page in Confluence"`--file"*.MD file which will be published"`--link"https://your_domain.atlassian.net"uploadermodule allowed to you upload a file or directory to the SharePoint server.Using example (PowerShell script):py-mconfpoint.uploader--user"user@mail.com"--password"pass"`--file"path/to/uploading/file"`--remote"remote/path/in/SharePoint/server"`--group"your sharepoint group (somthing like /sites/Team)"`--link"https://your_domain.sharepoint.com"`--timeout10downloadermodule allowed to you download a file or directory from the SharePoint server. Also support recursive downloading content from directory.Using example (PowerShell script):py-mconfpoint.downloader--user"user@mail.com"--password"pass"`--outputdir"path/to/local/output/directory"`--remote"remote/path/in/SharePoint/server"`--group"your sharepoint group (somthing like /sites/Team)"`--link"https://your_domain.sharepoint.com"`--recursiveUsefully notesFor building .exe file:./py2exe.ps1Create virtual env and activate itpy -m venv env
.\env\Scripts\activateInstall fromTestPyPi:pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple confpointUsefully notes and linksInstall dependency: pip3 install -r requerments.txtGet token for confluence.Check this arcticleor thisFor upload files to SharePoint use your login and password (login == --user; password == --apikey)Open file pusher.cmd and write your login, token and etcDocker imgage withConfpoint and PowerShell
Package: conf-root
Conf Root基于dataclass的符合逻辑的配置取用方式。使用方法fromconf_root.conf_rootimportconfigurationasconfiguration_atfromdataclassesimportdataclass@configuration_at('settings.yaml')@dataclassclassAppConfig:database_host:str='localhost'database_port:int=5432database_user:str='admin'database_password:str='default_password'app_config=AppConfig()解释说明检测是否存在settings.yaml，如果不存在则按照默认值新建文件。如存在settings.yaml，则加载文件中的配置。提供存储和加载的接口，可供动态改动。app_config.save()app_config.load()note: dataclass 中的字段需指定类型。
Package: confs
confsCLI tool that lists tools for which the given project has configuration files.For example, if the project has.isort.cfgfile or[tool.isort]section inpyproject.toml, confs will detect that the project usesisort. A possible use-case is to implement CI jobs for linters that are run only if the corresponding configuration file is represented in the project.Installationpython3-mpipinstall--userconfsCLI usageconfs list- list tools configured in the current directory.confs list --path=/path/to/project/- list tools configured in the specified directory.confs has flake8- check if the project hasflake8configured. The exit code is 1 if the tool is not configured.API usagefrompathlibimportPathfromconfsimportget_toolspath=Path('.')print(get_tools(path))
Package: confscript
confScriptdon't think it is another *script language!!It can do a lot..install via pippip install confscriptlet's get started!some basic concepts:headers have this syntax:== name ==header can be anything example: "C++" or "@(@(@(@(@!!!" anything!keyword and value have this syntax:keyword : valuehere, value can be a string or number or True or False..What about lists?lists values are separated by a ","example:== header ==
key : value1,value2,value3what separates data headers?all headers are separated by a ---okay?
now, look at this data:== Python ==
extensions : .py,.pyw,etc,etc
command    : python (filepath)
---
== JavaC ==
extensions : .java,
command    : javac (filepath) && java (filebasename)Example data:== TestingData ==
lucky word              	  : python
lucky number                  : 10
is lucky-number really lucky? : True
---
== Employee ==
name: George
age: 30
country: United Kingdom
email: george.the.great@cube.co.net.comit will become:{'TestingData':{'lucky word':'python','lucky number':10,'is lucky-number really lucky?':True},'Employee':{'name':'George','age':30,'country':'United Kingdom','email':'george.the.great@cube.co.net.com','IPv6 address (lol)':'C0BE:5BC6:F8F0:FAB4:EB59:482F:C4D3:4DFD'}}so what's in this module?there are 3 functions:read(str)      : convert confscript data to python dict & return the dict
readFile(str)  : read the given file which contains the data & return the dict
dump(dict)     : convert dict to confscript & return confscript datasimple! isn't it?
Package: confselector
config selector>>>importos>>>SELFDIR=os.path.dirname(os.path.abspath('.'))# or : SELFDIR = os.path.dirname(os.path.abspath(__file__))>>>PROJECTDIR=os.path.dirname(SELFDIR)>>>>>>fromconfselectorimportConfSelector>>>ConfSelector.configure([PROJECTDIR,os.path.join(PROJECTDIR,'config'),os.path.join(PROJECTDIR,'conf'),SELFDIR,])>>>>>>pyfile,configobj=ConfSelector.selected('-dev')>>>print(pyfile,configobj)>>>>>>pyfile,configobj=ConfSelector.selected('-prod')>>>print(pyfile,configobj)>>>>>>pyfile,configobj=ConfSelector.selected('')>>>print(pyfile,configobj)>>>
Package: confsmooth
Confidence Based SmoothingThe algorithm smooths functions preserving local peaks. To distinguish peaks from noise it needs noise standard deviation.Installationpip install --upgrade confsmoothUsageimportos,shutil,statsmodelsimportmatplotlib.pyplotaspltimportnumpyasnpfromstatsmodels.nonparametric.kernel_regressionimportKernelRegfromconfsmoothimportconfsmoothfromscipy.signalimportsavgol_filterx=np.linspace(-2,2,500)real_noise_level=0.002y=1-np.power(np.abs(x)+0.01,0.01)+np.random.normal(0,real_noise_level,len(x))# estimate noise standard deviationsavgol=savgol_filter(y,21,1)noise_level=np.std(y-savgol)print('Estimated noise level =',noise_level,'Real noise level =',real_noise_level)smoothed_conf=confsmooth(y,noise_level,confidence=0.995,deg=2)kr=KernelReg(endog=y,exog=x,var_type='c',bw=[0.1])smoothed_kr,_=kr.fit(x)fig,ax=plt.subplots()ax.plot(x,y,label='initial')ax.plot(x,savgol,label='savgol')ax.plot(x,smoothed_kr,label='Kernel regr')ax.plot(x,smoothed_conf,label='confsmooth')ax.legend()plt.show()
Package: confspirator
An offshoot of OpenStack’soslo.configwith a focus on nested
configuration groups, and the ability to use yaml and toml instead of
flat ini files.CONFspirator doesn’t include any command-line integrations currently
so you will need to add a command to your application to export a
generated config using the built in functions.It does have support for loading in config files, or a preloaded
config dictionary against your config group tree.The library’s focus is on in-code defaults and config field validation,
while giving you a lot of power when dealing with nesting, dynamic config
loading for plugins, and useful overlay logic.It allows you to define sane defaults, document your config, validate
the values when loading it in, and provides useful ways of working
with that config during testing.Installationpip install confspiratorDocumentationFor more information and examples of usagecheck out the docs.
Package: confstar
ConfstarWhat is this library?Confstar is a config loader (similar to django settings loader) with ✨magic-annotations✨ handlers.Also, Confstar is a part ofpie-audioproject. I just wanted to make an independent repository for it.What are ✨magic-annotations✨?Basically, it's micro-handlers that let's you to control field behaviour  viatype annotations.For example, you can specify how many elements list must have, lock the field to prevent it from editing and etc.How to use confstar?It's really that simple:ImportConfiginstance ofConfLoader(or define your own)Import it wherever you wantConfiguration module# configs/consts.pyfromconfstar.typesimport*PUBLIC_STRING_VALUE="String Value"PRIVATE_INT_FIELD:Lock=100PUBLIC_MIN_FIELD:Min[3]=[1,2]PUBLIC_MAX_FIELD:Max[3]=[1,2,3]PUBLIC_RANGE_FIELD:Range[1,5]=2Your applicationfromconfstar.loaderimportConfig,ConfLoaderConfig.add_handlers(Lock,Min,Max)Config.import_module("configs.config")# Or load configuration module by using relative file pathMyConfig=ConfLoader()MyConfig.load_by_path("configs/myconfig.py")# You can freely overwrite this field# because it has no handlers attached to itConfig.PUBLIC_STRING_VALUE="New string value!"# Will throw an errorConfig.PRIVATE_INT_FIELD=321Config.PUBLIC_MIN_FIELD=[1,2,3,4]Config.PUBLIC_MAX_FIELD.extend([4,5,6])Config.PUBLIC_RANGE_FIELD=6Writing your own handlerOf course, we have built-in magic-annotations, but if you want to write your own, it's really that easy:Define your own handlerfrom__future__importannotationsfromtypingimportAny,TypefromconfstarimportAnnotatedHandlerclassMagicHandler(AnnotatedHandler):defset(self,field:str,value:Any)->Any:"""Set or throw and error if validation fail"""ifnotvalue%2==0:raiseValueError(f"An error has been occurred in{self.__class__.__name__}")self._attributes[field]=valuedefget(self,field:str)->Any:"""Return field from `_attributes`"""returnself._attributes[field]# or via `dict.get` methoddef__class_getitem__(cls,value:Any)->Type[MagicHandler]:"""Provide the type annotation logicField: HandlerType[<values>]"""Define alias to ignore linter (which is optional)Magic=type("Magic",(MagicHandler,),{})Apply your handler on some fieldfrommy_handlersimportMagicMAGIC_FIELD:Magic=...
Package: conftab
conftabconfig table配置web版本管理系统（config version manager with web or code easily）
作为开发人员，经常会涉及到环境部署，一些数据库地址帐号密码配置我们不希望硬编码在项目文件里，再被一不小心提交到代码仓库再开源出去，所以，需要在内网环境部署一套配置管理系统。这样项目中再连接这个管理地址取到相应的配置，可以方便部署和管理环境配置又不用担心重要的信息泄露出去。RUN服务端： 启动web管理界面和接口pipinstallconftab# 运用sqlite数据库，-f指定配置数据的保存文件位置，方便备份和加密迁移，-p指定服务端的监听端口python-mconftab.ctlrun-p7788-f'./conftab.db'# 如果想要后台长期启动，可以利用nohup，并将日志写入conftab.log文件nohuppython3.9-mconftab.ctlrun-p7788-h"0.0.0.0"-f'./conftab.db'>conftab.log2>&1&客户端： 项目通过接口在线取config配置importconftabCONFIG=conftab.Tab(project='default',env='dev',ver='1.0.0',manager_url='127.0.0.1:7788')# 设置CONFIG.set('ES_PORT',9200)# 可以在代码里也可以在web界面里去调整，浏览器访问 http://127.0.0.1:7788/html/conf 进行界面config管理# 获取ES_PORT=CONFIG.get('ES_PORT')# 批量获取conf=CONFIG.dict()# 一次性获取该项目全部配置dict，减少http请求ES_PORT=conf.get('ES_PORT')更多详细可见 example.py 文件TODO listweb managerserver manager
Package: conf-templater
Config files templaterPackage provides templating ofmako-basedtemplates of package config files.PurposeThe main idea is, that config can be generated via console arguments of it`s required values. It is useful for deploy with configuration systems like ansible and others.There is no more reason to keep config template itself separately from application (in deploy scripts/roles/whatever) or to define example with comments what config values require changing.Besides that, package or program, as usual, is situated in system package directory (with config templates), that looks like one more problem during configuring.Installation (standalone usage)sudo-Hpython3-mpipinstallconf-templaterUsage (standalone)conf_templater--helporconfig_templater--helpUsage (python package)Addconf-templatertorequirements.txt.Create cli script file, for examplemypackage/scripts/config.py, that contains:fromconf_templaterimporttemplate_configdefrun():template_config(package='mypackage',subpath='config')if__name__=='__main__':run()Create config file in package structure, for examplemypackage/config/development.makoDefine entry point insetup.pyfile:fromsetuptoolsimportsetupsetup(name='mypackage',install_requires=['conf_templater'],entry_points={'console_scripts':['mypackage_config = mypackage.scripts.config:run']})Run for developmentpython3-mpipinstall-e.Run for helpmypackage_config--help
Package: conftext
This package contains a couple of mudules:conftext - a helper for managing configuration contexts.conf_ini - unified configuration handling for ini files.conftextMotivationImagine handling multi-tenant services, that each require certain config contexts to be specified
for using them (think db connection information for instance). A “configuration matrix” if you like.
The parameters of these config options are the same, but their values differ. You are creating CLI
tools for working with these services and find yourself doing:$some_task1(db_host=service_A_ip,db_name=service_A_name,param1,param2)$some_task2(db_host=service_A_ip,db_name=service_A_name)$some_task3(db_host=service_A_ip,db_name=service_A_name,param1)$some_task1(db_host=service_B_ip,db_name=service_B_name,param1,param2)$some_task2(db_host=service_B_ip,db_name=service_B_name)$some_task3(db_host=service_B_ip,db_name=service_B_name,param1)This small library intends to help bring things back to:$some_task1(param1,param2)$some_task2()$some_task3(param1)This is just an example. The tool is meant to be generic and is not nescessarily only made for this
particular use case.OperationThis tool works by providing a way to persist configuration coordinates that can be used to look up
the appropriate configuration in the “configuarion matrix”. The configuration coordinates are stored
in a file at well-known location (look at current dir, then traverse upwards in file hierarchy until/or~/.config/conftext.ini).A command-line tool, also called conftext, can be used to show and manipulate the conftext file.UsageUseget_configin code where context-aware config should be loaded. The conftext invoke task can
then be used to switch the context config.Example in code:defaults=dict(service='dummy',context='local')config=Conftext(section='package.module',default_config=defaults)Command-line usage:$conftextshow$conftextset--service<someservice>$conftextset--service<someservice>--context<somecontext>Ideasadd a enter task for the CLI tool that will enter the conf context?when inside conf context, consider modifying the prompt to show vital context configadd exit task as welladd python prompt with config context as well?conf_iniProvides unified configuarion for ini files.Currently, this means that the configuration for a given package/module is expected to be found in:~/.config/<package>/<module>.iniand that the file is expected to in a.iniformat that can be parsed by the configparser of the
python standard library.