Saravanan666/pypi-org huggingface dataset:
Package: pycausal-explorer
Pycausal-explorerPycausal-explorer is a python module for causal inference and treatment effect estimation. It implements a set of
algorithms that supports causal analysis.Installation GuideYou can install the package through pip:pip install pycausal-explorerBasic UsageAll models are inherited from BaseCausalModel, that inherits from scikit-learn BaseEstimator.
It uses scikit-learn framework to fit and predict the outcome. It implements predict_ite and predict_ate
methods that return the individual treatment effect and the average treatment effect, respectively.from pycausal_explorer.datasets.synthetic import create_synthetic_data
from pycausal_explorer.meta import XLearner

x, treatment, y = create_synthetic_data()
model = XLearner()
model.fit(x, treatment, y)
treatment_effect = model.predict_ite(x)Current Implemented ModelsThis version currently implements propensity score and iptw in the reweight package, linear regression in the linear package, causal forests in forest package and x-learn in meta package.Using PipelinesPycausal-explorer has a Pipeline class inherited from scikit-learn Pipeline.
It implements the method predict_ite, so it can be used pro predict treatment effect in a pipeline:from sklearn.preprocessing import StandardScaler

from pycausal_explorer.datasets.synthetic import create_synthetic_data
from pycausal_explorer.pipeline import Pipeline
from pycausal_explorer.reweight import IPTW

x, w, y = create_synthetic_data()
pipe = Pipeline([("norm", StandardScaler()), ("clf", IPTW())])
pipe.fit(x, y, clf__treatment=w)
treatment_effect = pipe.predict_ite(x)
Package: pyCausalFS
pyCausalFS：A Python Library of Causality-based Feature Selection for Causal Structure Learning and ClassificationOverviewThis is a fork of pyCausalFS that removes example files and data to allow for easier integration as a python module. The original repository can be found here:https://github.com/wt-hu/pyCausalFS. This fork may have tweaks to make it easier to pip install.
You can install this via pypi:pip install pyCausalFSThe pyCausalFS library provides access to a wide range of well-established and state-of-the-art causality-based feature selection approaches. The library is designed to facilitate the development of new algorithms in this research area and make it easier to compare new methods and existing ones available.The pyCausalFS library implements 30 representative causality-based feature selection methods. Specifically, it consists of 25 methods using conditional independence tests (16 single MB learning algorithms, 3 multiple MB learning algorithms, and 6 PC learning algorithms), and 5 score-based approaches.1）	Constraint-based MB learning methods:GSMB, IAMB, IAMBnPC, Inter-IAMB, Fast-IAMB, Inter-IAMBnPC, LRH, BAMB, FBEDk, MMMB, PCMB, HITON-MB,
Semi-HITON-MB, IPCMB, STMB, MBOR2）	Multiple MB learning methods:KIAMB, TIE*(TIE and TIE_p)3）	Constraint-based PC learning methods:PC-simple, MBtoPC, HITON-PC, Semi-HITON-PC, GetPC, MMPC4）	score-based MB learning methods:SLL, S^2TMB, S^2TMB_p5）	score-based PC learning methods:SLL-PC, S^2TMB-PCFurthermore, using the pyCausalFS library, users can easily generate different local structure learning methods and local-to-global structure learning methods, which includes 3 local BN structure learning algorithms and three local-to-global BN learning algorithms.6）	local BN structure learning algorithms:PCD-by-PCD, MB-by-MB, CMB7）	local-to-global BN learning algorithms:MMHC, GSBN, MBGSLAll implementation details please read the manual documentation.
Package: pycause
rendering emergent causal structureLicenseThis project is Copyright (c) Simon Birrer and licensed under
the terms of the BSD 3-Clause license. This package is based upon
theAstropy package templatewhich is licensed under the BSD 3-clause license. See the licenses folder for
more information.ContributingWe love contributions! pycause is open source,
built on open source, and we’d love to have you hang out in our community.
Package: pycave
PyCavePyCave allows you to run traditional machine learning models on CPU, GPU, and even on multiple
nodes. All models are implemented inPyTorchand provide anEstimatorAPI
that is fully compatible withscikit-learn.For Gaussian mixture model, PyCave allows for 100x speed ups when using a GPU and enables to train
on markedly larger datasets via mini-batch training. The full suite of benchmarks run to compare
PyCave models against scikit-learn models is available on thedocumentation website.PyCave version 3 is a complete rewrite of PyCave which is tested much more rigorously, depends on
well-maintained libraries and is tuned for better performance. While you are, thus, highly
encouraged to upgrade, refer topycave-v2.borchero.comfor
documentation on PyCave 2.FeaturesSupport for GPU and multi-node training by implementing models in PyTorch and relying onPyTorch LightningMini-batch training for all models such that they can be used on huge datasetsWell-structured implementation of modelsHigh-levelEstimatorAPI allows for easy usage such that models feel and behave like in
scikit-learnMedium-levelLightingModuleimplements the training algorithmLow-level PyTorchModulemanages the model parametersInstallationPyCave is available viapip:pipinstallpycaveIf you are usingPoetry:poetryaddpycaveUsageIf you've ever used scikit-learn, you'll feel right at home when using PyCave. First, let's create
some artificial data to work with:importtorchX=torch.cat([torch.randn(10000,8)-5,torch.randn(10000,8),torch.randn(10000,8)+5,])This dataset consists of three clusters with 8-dimensional datapoints. If you want to fit a K-Means
model, to find the clusters' centroids, it's as easy as:frompycave.clusteringimportKMeansestimator=KMeans(3)estimator.fit(X)# Once the estimator is fitted, it provides various properties. One of them is# the `model_` property which yields the PyTorch module with the fitted parameters.print("Centroids are:")print(estimator.model_.centroids)Due to the high-level estimator API, the usage for all machine learning models is similar. The API
documentation provides more detailed information about parameters that can be passed to estimators
and which methods are available.GPU and Multi-Node trainingFor GPU- and multi-node training, PyCave leverages PyTorch Lightning. The hardware that training
runs on is determined by theTrainerclass. It'sinitmethod provides various configuration options.If you want to run K-Means with a GPU, you can pass the optionsaccelerator='gpu'anddevices=1to the estimator's initializer:estimator=KMeans(3,trainer_params=dict(accelerator='gpu',devices=1))Similarly, if you want to train on 4 nodes simultaneously where each node has one GPU available,
you can specify this as follows:estimator=KMeans(3,trainer_params=dict(num_nodes=4,accelerator='gpu',devices=1))In fact,you do not need to change anything else in your code.Implemented ModelsCurrently, PyCave implements three different models:GaussianMixtureMarkovChainK-MeansLicensePyCave is licensed under theMIT License.
Package: pycavedb
#cavedb
这是一个实现了ssdb和redis同步协议的同步工具，它可以从ssdb或redis同步数据。#pycavedb示例
1.创建对象继承于cavedb.cavedb。
2.调用其 slaveof_redis/slaveof_ssdb方法，从redis/ssdb同步数据，其中last_replid和last_offset表示同步进度，从覆盖的notify_psync/notify_command/notify_idle方法中可以获取同步进度。
3.在同步时，cavedb会插入几个特殊的同步命令，实际使用时需过滤掉它们，这几个命令分别为命令含义sync_start开始同步sync_continue己同步完全量部分，开始同步增量部分#! /usr/bin/python
#coding:utf-8

import cavedb
import time

class cavedb_impl(cavedb.cavedb):
	def notify_psync(self,replid,offset):
		return True;

	def notify_idle(self,replid,offset):
		return True;

	def notify_command(self,replid,offset,args):
		print args
		if len(args) > 0 and args[0] in ["sync_start","sync_overflow","sync_continue"]:
			return True;
		return True;

cavedb_instance = cavedb_impl();


last_offset = 0;
last_replid = "";

cavedb_instance.slaveof_redis("127.0.0.1",6379,"",last_replid,last_offset);

while True:
	time.sleep(1);
	print("cavedb running...");
Package: pycaverdock
CaverDock is a software tool for rapid analysis of transport processes in proteins. It models the transportation of a ligand - a substrate, a product, an inhibitor, a co-factor or a co-solvent - from outside environment into the protein active or binding site and vice versa.The current version of CaverDock uses Caver for pathway identification and heavily modified Autodock Vina as a docking engine. The tool is much faster than molecular dynamic simulations (2-20 min per job), making it suitable even for virtual screening. The software is extremely easy to use as it requires in its minimalistic configuration the setup for AutoDock Vina and geometry of the tunnel.This API wraps all calculation steps to Python functions and enables the users to construct customized high throughput analysis pipelines.
Package: pycaw
pycawPython Core Audio Windows Library, working for both Python2 and Python3.InstallLatest stable release:pip install pycawDevelopment branch:pip install https://github.com/AndreMiras/pycaw/archive/develop.zipSystem requirements:choco install visualcpp-build-toolsUsagefromcomtypesimportCLSCTX_ALLfrompycaw.pycawimportAudioUtilities,IAudioEndpointVolumedevices=AudioUtilities.GetSpeakers()interface=devices.Activate(IAudioEndpointVolume._iid_,CLSCTX_ALL,None)volume=interface.QueryInterface(IAudioEndpointVolume)volume.GetMute()volume.GetMasterVolumeLevel()volume.GetVolumeRange()volume.SetMasterVolumeLevel(-20.0,None)See more in theexamplesdirectory.TestsSee in thetestsdirectory.
Package: pycax
pycaCellular Automata, CA, in Python.Featureseasy to add new rules, check Rule30you can even witch rules during computemultiple dimensions universes (1d and 2d) supportsupport multiply cell types in one universesupport customized neighbour searchunit tests (more is coming)Get startedSee something runningClone the codeInstall libraries:pip install -r requirements.txtPick a script formexample/folderMagic...Explore the codefrompyca.universe1dimportUniverse1Dfrompyca.rules.RulesimportRule30frompyca.observerimportplot1d_universeuniverse=Universe1D(300)universe.register_cell_type(Rule30,'random',prob=0.5)universe.initialize()universe.compute(300)plot1d_universe(universe)Or for classic rulexxx system, you can just pus a str represent rule for ClassicRule!frompyca.universe1dimportUniverse1Dfrompyca.rules.BaseRuleimportClassicRulefrompyca.observerimportplot1d_universesize=600universe=Universe1D(size)universe.register_cell_type(ClassicRule,'single',pos=size-1,rule='01101110')# Rule110 hereuniverse.initialize()universe.compute(size)plot1d_universe(universe)ConceptsUniverse, contains all the cells, and function to trigger computationCellType, rule of the cell is defined hereobserver, way to observe universe, well it can be visual, but it can also be something else, like sounds!Currently, 2 2D universe is supported, you can define a CA by injecting a
new type of CellType.Road map3D universeHyperGraph UniverseInteractive ObserversMusical ObserversExamples:Rule 0 - Rule 255pngs2D Cyclic AChttp://psoup.math.wisc.edu/mcell/rullex_cycl.htmlcodeGame of Lifehttps://en.wikipedia.org/wiki/Conway%27s_Game_of_LifeCodeRule30https://en.wikipedia.org/wiki/Rule_30CodeRule 110https://en.wikipedia.org/wiki/Rule_110CodeSwitch rulesCodeRelated projectsCellular-Automaton-ViewercellularAutomata, Haskell versionA CA Game
Package: pycb
Tower3 C extension for libcouchbase.Assumes that libcouchbase is installed at :/usr/local/include/libcouchbase/usr/include/libcouchbase##v0.0.5
* Create libevent event base for our io_ops, then call it in non-blocking mode to allow timeouts when connecting to a bucket.
* Added PycbKeyNotFound and PycbKeyExists exceptions## V0.0.4
* Added checks for libcouchbase calls that don’t fail but also don’t generate a callback.## v0.0.3
* Added create and delete bucket. added tests## V0.0.2
* Added create method to class Couchbase, which creates a new bucket## v0.0.1:
* Initial release
Package: pycbc-glue-obsolete
# pycbc-glue repositoryThis repository contains a stripped down version of lalsuite/glue for use
with PyCBC until the dependencies contained in this repository are retired.## Notes on repository creationThe repository was created from the 1.48 release (ER7 release) with the
commands:git init
git remote add -f origin git://ligo-vcs.phys.uwm.edu/lalsuite.git
git checkout glue-1-48-branch
git filter-branch –subdirectory-filter glue
git branch -f master glue-1-48-branch
git checkout master
git branch -D glue-1-48-branch
for t ingit tag; do git tag -d $t ; doneThe repository was then switched to github withgit remote rename origin upstream
git remote add origingit@github.com:ligo-cbc/pycbc-glue.git
git push -u origin master
Package: pycbcount
PyCBCountPyCBCount is a Python package designed to calculate various metrics from Complete Blood Count (CBC) tests. This package provides functionalities to compute key hematological parameters such as Mean Corpuscular Volume (MCV), Mean Corpuscular Hemoglobin (MCH), and Neutrophil to Lymphocyte Ratio (NLR), among others. It also includes reference ranges for a comprehensive list of CBC metrics across different age groups.InstallationTo install pycbcount, run the following command:pipinstallpycbcountUsageHere is how you can use the pycbcount package:importpycbcountascbcfrompycbcountimportreference_range# Calculate MCVmcv_value=cbc.mcv(hct=0.45,rbc=5.2e6)# Calculate MCHmch_value=cbc.mch(hb=14,rbc=5.2e6)# Adult reference range for MCV and MCHreference_range["Adult"]["MCV"]reference_range["Adult"]["MCH"]# Adult age reference range for MCH and MCHreference_range[18]["MCV"]reference_range[18]["MCH"]FeaturesCalculation of MCV, MCH, MCHC, NLR, ANC, and ALC.Reference ranges for WBC, RBC, HGB, HCT, MCV, MCH, MCHC, RDW, PLT, Neutrophils, Lymphocytes, Monocytes, Eosinophils, and Basophils.Formulas and ReferencesMCV Formula:Mean Corpuscular Volume (Wikipedia)MCH Formula:Mean Corpuscular Hemoglobin (Wikipedia)MCHC Formula:Mean Corpuscular Hemoglobin Concentration (Wikipedia)NLR Formula:Neutrophil to Lymphocyte Ration (Wikipedia)ANC Formula:Absolute Neutrophil Count (Wikipedia)ALC Formula:Complete Blood Count (Wikipedia)Reference Ranges:Complete Blood Count (Wikipedia)ContributingContributions to pycbcount are highly appreciated, whether they come in the form of code improvements, bug reports, or documentation updates. This project, particularly, welcomes assistance from medical professionals or hematologists for verifying the medical accuracy of the calculations and reference data.If you're a medical expert and notice any discrepancies or potential improvements in the medical content of this package, please feel free to correct them or suggest changes. This kind of contribution is invaluable to ensure that pycbcount provides reliable and accurate information.LicenseThis project is licensed under the MIT License - see theLICENSEfile for details.
Package: pycbc-weave
Weave provides tools for including C/C++ code within Python code. Inlining
C/C++ code within Python generally results in speedups of 1.5x to 30x over
algorithms written in pure Python.Weave is the stand-alone version of the deprecated Scipy submodulescipy.weave.   It is Python 2.x only, and is provided for users that need
new versions of Scipy (from which theweavesubmodule may be removed) but
have existing code that still depends onscipy.weave.  For new code, users
are recommended to use Cython.
Package: pycbf
pycbf- CBFlib for pythonThis repository builds thepycbfportion only of Paul J Ellis and Herbert J
Bernstein'sCBFlib, as amanylinuxbinary wheel installable throughpip install pycbf.In order to do this, it has some limitations compared to the full build of CBFlib:No HDF5 bindingsNo (custom) libTiff bindingsNo CBF regex capabilitiesNo header files included - this is not intended to be used as a linking
targetIn addition to the base 0.9.6, this has the following significant alterations:VersionChanges0.9.6.0Regenerated SWIG bindings for Python 3 compatibility. Compiled withSWIG_PYTHON_STRICT_BYTE_CHAR.0.9.6.2Drop python 2.7. Accept bothbytesandstr. Addread_buffermethod, andlibimgbindings.0.9.6.4Windows support, type annotations forpycbf.Img, anddials-dataregression tests.For details, please see theCHANGELOG.
Package: pycbg
PyCBG is a python module able to generateCB-Geo MPM's input files.Install PyCBGFrom PyPIThe last upload of PyCBG onPyPIcan be simply installed usingpip:python3 -m pip install pycbgInstallation automatically includes the following dependencies:numpygmshpandasmatplotlibversioneersphinx(at least version3.3.1)sphinx_rtd_themeDirectly from the packageIf you want to install a specific version of PyCBG (e.g. the most recent one), you can download the package and install it withpip.Downloading PyCBGYou can download the package withgit:git clone git@forgemia.inra.fr:mpm-at-recover/pycbg.gitAlternativly, you can download it manually fromForgeMia.Installing PyCBGFrom the root of thepycbgdirectory (the one you just downloaded), type the following command:python3 -m pip install -e .DocumentationOn ReadTheDocsThe latest build of the documentation atReadTheDocsis available onlinehere. If nothing appears underClasses overviewleft of your screen, please reload the page (this is probably a small bug on ReadTheDocs).Local buildThe documentation can also be built locally usingsphinx. From the root of PyCBG, run the following command:sh build_doc.shThis will execute a bash script that builds the documentation in a folder namedpycbg_doc, located in the same directory as pycbg.
The documentation can then be accesed by openingpycbg_doc/_build/html/index.htmlin your browser.The pycbg_doc folder name can be modified if necessary when executing the bash script:sh build_doc.sh my_folder_name
Package: pycbp
CBP(Constrained Belief Propagation)Constrained Belief Progapation is a package for solving inference tasks with collective\aggregate evidence.What is collective\aggregate evidence?Let us consider a task, estimating dymanics of bird migration. We consider the following different kinds of evidenceInstall trackers for interested birds. So we access to the trajectories of sampled birds. We can query the position of interested birds at any time and how they move.We shoot a video for the birds migration. We can quety the distibution of the birds in the space at any time. However, we do not have access to individual trajectories and how birds move overtime.The second information is an instance of collective\aggregate evidence, which remove the distinguishability of individuals.Why do we need collective\aggregate evidence?Easy and cheap to acquirePrivacy concernSometimes, collective\aggregate evidence is the ony information we access to analysis collective behavior.How can we represent the special evidence?In CBP, we represent the special evidence as a special nodes  in probabilistic graphical model(PGM), named node with fixed marginal constraints.  A hidden markov model with  aggregate evidence can be presented as:The shaded nodes represents the aggregate evidence.  We can introduce a simple version:How to do inference?In CBP framework, we present a nice elegant connections between multi-marginal optimal transport problems and inference problem for PGM.  We implement algorithms similar to the standard belief propagation. In CBP, we presentIterative Scaling Belief PropagationandContrained Norm-producttwo algorithms. More details can be find thepaper.Citation@article{haasler2020multi,
  title={Multi-marginal optimal transport and probabilistic graphical models},
  author={Haasler, Isabel and Singh, Rahul and Zhang, Qinsheng and Karlsson, Johan and Chen, Yongxin},
  journal={arXiv preprint arXiv:2006.14113},
  year={2020}
}
Package: pycbpf
About pycbpfInspired bycbpfc.pycbpf2c converts tcpdump filter expression to C code which can be injected to a BCC script.This aims to provide native python support, so BCC can import it directly.And it provides a BCC script for dump filtered packet to pcap format.Simple usecaseYou can save packets to a pcap file like below to sniffer packet fromdev_queue_xmitpython3 -m pycbpf.c2ebpf -i eth0 -w file.pcap <tcpdump expresion>Or with no pcap file specified, you need to pipe output to tcpdumppython3 -m pycbpf.c2ebpf -i eth0 <tcpdump expresion> | tcpdump -r - -nevExamples of usageOf course you can generate a C program from tcpdump expresion and implement your own BCC script.
Cmdline below will generate the C program, which can be used directly in BCC.python3 -m pycbpf.cbpf2c <tcpdump expression>Steps to use it in python:1 - Install and import packagespip3 install pycbpffrom bcc import BPF
from pycbpf import cbpf2c, filter2cbpf2 - Generate cbpf and compile to C program, and enable BPF for trace. Write you test_text with space reserved for the generated code. Use the inline functioncbpf_filter_funcin you trace program and handle return value properly.test_text = """

/* reserve space for the generated code cbpf_filter_func */
%s

your_func()
{
      u32 datalen = 0;
      u32 ret = 0;
      u8 *data;
      ...

      ret = cbpf_filter_func(data, data + datalen);
      if (!ret) {
            return 0;
      }

      filter_event.perf_submit(ctx, &e, sizeof(e));
}

"""

prog = filter2cbpf.CbpfProg(["ip"])
prog_c = cbpf2c.CbpfC(prog)
cfun = prog_c.compile_cbpf_to_c()
test_text = bpf_text%cfun
bpf_ctx = BPF(text=test_text, debug=0)3 - write bcc perf event callbackdef filter_events_cb(_cpu, data, _size):
      # print some data
      # or write to pcap files

bctx['filter_event'].open_perf_buffer(filter_events_cb)Further explainAs for the code generated from cbpf, for example, filterippackets, will generate C program:static inline u32
cbpf_filter_func (const u8 *const data, const u8 *const data_end) {
      __attribute__((unused)) u32 A, X, M[16];
      __attribute__((unused)) const u8 *indirect;

      if (data + 12 > data_end) { return 0; }
      A = bpf_ntohs(*((u16 *)(data + 12)));
      if (A != 0x800) {goto label3;}
      return 262144;
label3:
      return 0;
}It follows what cbpf code tells us to do:(000) ldh      [12]
(001) jeq      #0x800           jt 2	jf 3
(002) ret      #262144
(003) ret      #0A little explain about the cbpf code and cbpf_filter_func above:First read 2 byte at offset 12.Test the data read, if equal to 0x0800, jump to 002, else jump to 003. We name the position to labelX, X is the PC value.If label is right after last instruction, it will be ignored.
002 and 003 will return value and exit the function.seec2ebpf.pyas an example to save packets to pcap filesLICENSEpycbpf is MIT licensed, as found in the LICENSE file
Package: pycbr
pycbrMicroframework to implement Case-Based Reasoning systemsInstallationAssuming you have aPython3distribution withpip, to install a development version, cd to the directory with this file and:pip3 install -e .As an alternative, a virtualenv might be used to install the package:# Prepare a clean virtualenv and activate it
virtualenv -p /usr/bin/python3.6 venv
source venv/bin/activate
# Install the package
pip3 install -e .To install also the dependencies to run the tests or to generate the documentation install some of the extras likepip3 install -e '.[docs,test]'Mind the quotes.DocumentationTo generate the documentation, thedocsextra dependencies must be installed. Furthermore,pandocmust be
available in your system.To generate an html documentation with sphinx run:make docsTo generate a PDF documentation using LaTeX:make pdfTestTo run the unitary tests:make test