Saravanan666/pypi-org huggingface dataset:
Package: evm-trace
Quick StartEthereum Virtual Machine transaction tracing toolDependenciespython3version 3.8 to 3.11.InstallationviapipYou can install the latest release viapip:pipinstallevm-traceviasetuptoolsYou can clone the repository and usesetuptoolsfor the most up-to-date version:gitclonehttps://github.com/ApeWorX/evm-trace.gitcdevm-trace
python3setup.pyinstallQuick UsageGeth Style TracesIf you are using a node that supports thedebug_traceTransactionRPC, you can useweb3.pyto get trace frames:fromweb3importHTTPProvider,Web3fromevm_traceimportTraceFrameweb3=Web3(HTTPProvider("https://path.to.my.node"))txn_hash="0x..."struct_logs=web3.manager.request_blocking("debug_traceTransaction",[txn_hash]).structLogsforiteminstruct_logs:frame=TraceFrame.model_validate(item)If you want to get the call-tree node, you can do:fromevm_traceimportCallType,get_calltree_from_geth_traceroot_node_kwargs={"gas_cost":10000000,"gas_limit":10000000000,"address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","calldata":"0x00","value":1000,"call_type":CallType.CALL,}# Where `trace` is a `TraceFrame` (see example above)calltree=get_calltree_from_geth_trace(trace,**root_node_kwargs)Parity Style TracesIf you are using a node that supports thetrace_transactionRPC, you can useweb3.pyto get trace objects:fromevm_traceimportCallType,ParityTraceListraw_trace_list=web3.manager.request_blocking("trace_transaction",[txn_hash])trace_list=ParityTraceList.model_validate(raw_trace_list)And to make call-tree nodes, you can do:fromevm_traceimportget_calltree_from_parity_tracetree=get_calltree_from_parity_trace(trace_list)Gas ReportsIf you are using a node that supports creating traces, you can get a gas report.fromevm_trace.gasimportget_gas_report# see examples above for creating a calltreecalltree=get_calltree_from_geth_trace(trace,**root_node_kwargs)gas_report=get_gas_report(calltree)For a more custom report, use themerge_reportsmethod to combine a list of reports into a single report.
Pass two or moreDict[Any, Dict[Any, List[int]]]to combine reports whereList[int]is the gas used.Customize the values ofAnyaccordingly:The firstAnyrepresents the bytes from the address.The secondAnyrepresents the method selector.For example, you may replace addresses with token names or selector bytes with signature call strings.Import the method like so:fromevm_trace.gasimportmerge_reportsDevelopmentThis project is in development and should be considered a beta.
Things might not be in their final state and breaking changes may occur.
Comments, questions, criticisms and pull requests are welcomed.LicenseThis project is licensed under theApache 2.0.
Package: evm-warp
NOTEWarp is under heavy development and is currently not stable. A stable release will be released in the coming weeks.WarpWarp brings Solidity to StarkNet, making it possible to transpile Ethereum smart contracts to Cairo, and use them on StarkNet.Table of Contents :clipboard:InstallationUsageWant to contribute?LicenseInstallation :gear:Prerequisites:InstallKudu, our tool to generate the Yul AST, and add it to your PATH.Linux:sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install -y python3.7
sudo apt install -y python3.7-dev
sudo apt install -y libgmp3-dev
sudo apt-get install -y python3.7-venv
python3.7 -m venv ~/warp_demo
source ~/warp_demo/bin/activate
cd warp
make warpMacOs:brew install python@3.7
brew install gmp
python3.7 -m venv ~/warp_demo
source ~/warp_demo/bin/activate
cd warp
make warpUsage :computer:You can transpile your Solidity/Vyper contracts with:warp transpile FILE_PATH CONTRACT_NAMECONTRACT_NAMEis the name of the primary contract (non-interface, non-library, non-abstract contract) that you wish to transpileTo deploy the transpiled program to Starknet use:warp deploy CONTRACT.jsonTo invoke a public/external method use:warp invoke --program CONTRACT.json --address ADDRESS --function FUNCTION_NAME --inputs "INPUTS"The--inputsflag requires its argument to be a string and have each value separated by a space.You can check the status of your transaction with:warp status TX_IDWant to contribute? :thumbsup:Your contributions are always welcome, seecontribution guidelines.LicenseApache LicenseVersion 2.0, January 2004.
Package: evnex
python-evnexPython client for the Evnex API.Author not affiliated with Evnex.FeaturesTalks to your Evnex charger via Cloud APIAutomatic retries with exponential backoffAutomatic re-authenticationOptionally pass in ahttpxclientOptionally pass in tokens to resume existing sessionInstallationpip install evnexUsageimportasynciofrompydanticimportSecretStrfrompydantic_settingsimportBaseSettingsfromevnex.apiimportEvnexclassEvnexAuthDetails(BaseSettings):EVNEX_CLIENT_USERNAME:strEVNEX_CLIENT_PASSWORD:SecretStrasyncdefmain():creds=EvnexAuthDetails()evnex=Evnex(username=creds.EVNEX_CLIENT_USERNAME,password=creds.EVNEX_CLIENT_PASSWORD.get_secret_value())user_data=awaitevnex.get_user_detail()fororginuser_data.organisations:print("Getting 7 day insight for",org.name,"User:",user_data.name)insights=awaitevnex.get_org_insight(days=7,org_id=org.id)forsegmentininsights:print(segment)if__name__=='__main__':asyncio.run(main())Examplespython-evnexis intended as a library, but a few example scripts are provided in theexamplesfolder.Providing authentication for the examples is via environment variables, e.g. on nix systems:export EVNEX_CLIENT_USERNAME=you@example.com
export EVNEX_CLIENT_PASSWORD=<your password>

python -m examples.get_charge_point_detailDeveloper NotesMaking a new releaseWhat ends up on PyPi is what really matters. Creating a release in GitHub should
trigger a release workflow that builds and publishes to PyPi.To manually release, update the version inpyproject.toml, build and publish with poetry:poetrybuild
poetrypublish
Package: evnrg
EVNRGEVNRG is an EV electrical demand simulation package that takes in trip data and turns it into useful energy data given a set of assumptions.This project was inspired by an earlier effort to simulate electrical demand from a theoretical electrified fleet replacement.
This tool is designed to track energy usage across an arbitrarily large fleet, with an arbitrary number of EVSE, and rules
that govern when charging occurs, and what type of queuing logic to use.Documentation:https://evnrg.readthedocs.io.FeaturesEVNRG takes in scenario definitions and interval travel data in order to generate arrays (Pandas Series) of:Electrical demand (per EVSE bank)Fuel consumption (per vehicle)Battery state (per vehicle)Deferred distance (per vehicle)EVSE occupancy (per EVSE bank)TODOWrite unit testsCreate Dask dispatcher for parallelized simulationsImplement geofenced rulesImplement smart charging behavior (throttling, round-robin) for situations where aBank’s maximum power is lower the sum total of eachEVSE’s maximum output.Implement analyis (dependednt onopenei-rates)LicenseThis package is Free software under the Apache Software License 2.0. See LICENSE for more information.CreditsInitially written by Alex Campbell as part of a master’s of science thesis project at the University of California, DavisEnergy Graduate Group.
This project falls under the auspices of the UC DavisInstitute of Transportation Studies (ITS)and
the UC DavisPlug-in Hybrid and Electric Vehicle Research Center. This project was funded by theOffice of Naval Research NEPTUNEprogram.This package’s skeleton was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2019-03-21)Re-committed base package to GitHub.
Package: evoalgos
DescriptionThis package contains the S-metric selection evolutionary multi-objective
optimization algorithm (SMS-EMOA) and the non-dominated sorting genetic
algorithm 2 (NSGA2) for multiobjective optimization. For single-objective
optimization, classical evolution strategies and the rather unknown CMSA-ES
(covariance matrix self-adaptation evolution strategy) are provided.
Variation for real-valued and binary search spaces is included and new
variation operators can be easily added thanks to the modular concept.The package is geared to work with optimization problems as defined in the
package optproblems. The whole package assumes minimization problems
throughout!DocumentationThe documentation is located athttps://www.simonwessing.de/evoalgos/doc/
Package: evobench
EvobenchEvobench is a collection of benchmark problems dedicated for optimization problems (both synthetic and practical). Please note that Python isn't still best tool for solving optimization problems, as loops are still slow. This might change in a next couple of years. Our main intention is to provide easily accessible package for PoC, research or teaching purposes.Getting startedpipinstallevobenchimportevobenchtrap=evobench.discrete.Trap(blocks=[4,4,4])population=trap.initialize_population(population_size=1e3)trap.evaluate_population(population)Fitness evaluation produces side effect of defining solution's fitness.print(population.solutions[0].fitness)You can also evaluate single solution.fitness=trap.evaluate_solution(population.solutions[0])Every time you evaluate undefined solution we incrementffecounter.
Solution is not evaluated again, if it didn't change.
You can access it through abenchmarkinstance.print(trap.ffe)OverviewThis package exposes following problems.PracticalTSPcVRPDiscreteTrapStep TrapBimodalStep BimodalHIFFIsing Spin GlassContinuousTrapStep TrapMultimodalStep MultimodalSawtoothCompound BenchmarkCreating your own compound benchmarks is really easy.
You just need to define your sub-benchmarks and pass them as a list. All other fuctions work just the same as with the normalBenchmark.fromevobenchimportCompoundBenchmark,continuous,discretebenchmark=CompoundBenchmark(benchmarks=[discrete.Trap(blocks=[5,2,4]),continuous.Trap(blocks=[3,6,4])],use_shuffle=True,multiprocessing=True,verbose=1)population=benchmark.initialize_population(population_size=1000)benchmark.evaluate_population(population)Ising Spin GlassTo instantiateISGyou need to pass specific problem configuration.fromevobench.discreteimportIsingSpinGlassisg=IsingSpinGlass('IsingSpinGlass_pm_16_0')You can find 5,000 instances atevobench\discrete\isg\datafolder. Instances vary in length and complexity.How to implement your own benchmarkInheritBenchmarkclass fromevobench.benchmark. Then implement:def _evaluate_solution(self, solution: Solution) -> floatdef random_solutions(self, population_size: int) -> List[Solution]Partially separableYou need to inheritSeparableclass fromevobench.separable.
Then just implement:def evaluate_block(self, block: np.ndarray) -> int.Best followevobench.discrete.trapimplementation.Linkage qualityLinkage quality metrics are located atevobench.linkage.metrics.
Available metrics:Mean Reciprocal Ranking @KMean Average Precision @KNDCG @K $BFill QualityComing soonWe'll be adding more problems in the near future. If you're looking for any particular problem, please mail us or open an issue.
We're working on linkage quality metrics. Once they're published, we'll be incorporating them to this package.
Package: evocov
EvoCovGPlib extension to learn the kernel function.Setup evocovCreate and activate virtualenv (for python2) or
venv (for python3)# for python3python3-mvenv.env# or for python2python2-mvirtualenv.envsource.env/bin/activateUpgrade pippython-mpipinstall--upgradepipInstall EvoCov packagepython-mpipinstallevocovUse EvoCovImport EvoCov and GPlib to use it in your python script.importgplibimportevocovConfigure the fitting method.lml=gplib.me.LML()bic=gplib.me.BIC()fitting_method=evocov.fit.EvoCov(obj_fun=bic.fold_measure,max_fun_call=25000,nested_fit_method=gplib.fit.MultiStart(obj_fun=lml.fold_measure,max_fun_call=250,nested_fit_method=gplib.fit.LocalSearch(obj_fun=lml.fold_measure,method="Powell",max_fun_call=100)))Initialize the GP with None covariance function.gp=gplib.GP(mean_function=gplib.mea.Fixed(),covariance_function=fitting_method.get_random_kernel())Generate some random data.importnumpyasnpdata={'X':np.arange(3,8,1.)[:,None],'Y':np.random.uniform(0,2,5)[:,None]}Fit the kernel and the hyperparameters to the training set.validation=gplib.dm.Full()log=fitting_method.fit(gp,validation.get_folds(data))Finally plot the posterior GP.posterior_gp=gp.get_posterior(data)gplib.plot.gp_1d(posterior_gp,data,n_samples=10)There are more examples in examples/ directory. Check them out!Develop EvoCovUpdate API documentationsource./.env/bin/activatepipinstallSphinxcddocs/sphinx-apidoc-f-o./../evocov
Package: evodcinv
evodcinvis a Python library to invert surface wave dispersion data (e.g., phase velocity dispersion curves) for an isotropic layered velocity model using Evolutionary Algorithms. It relies onstochopyfor the evolutionary optimizers while forward modeling is heavy-lifted bydisba.Inversion of phase velocity dispersion curve (fundamental mode).FeaturesInvertible data curves:Love-wave phase and/or group velocity dispersion curves,Rayleigh-wave phase and/or group velocity dispersion curves,Rayleigh-wave ellipticity (experimental).InstallationThe recommended way to installevodcinvand all its dependencies is through the Python Package Index:pipinstallevodcinv--userOtherwise, clone and extract the package, then run from the package location:pipinstall.--userTo test the integrity of the installed package, check out this repository and run:pytestDocumentationRefer to the onlinedocumentationfor detailed description of the API and examples.Alternatively, the documentation can be built usingSphinx:pipinstall-rdoc/requirements.txtsphinx-build-bhtmldoc/sourcedoc/buildUsageThe following example inverts a Rayleigh-wave phase velocity dispersion curve (fundamental mode).fromevodcinvimportEarthModel,Layer,Curve# Initialize modelmodel=EarthModel()# Build model search boundaries from top to bottom# First argument is the bounds of layer's thickness [km]# Second argument is the bounds of layer's S-wave velocity [km/s]model.add(Layer([0.001,0.1],[0.1,3.0]))model.add(Layer([0.001,0.1],[0.1,3.0]))# Configure modelmodel.configure(optimizer="cpso",# Evolutionary algorithmmisfit="rmse",# Misfit function typeoptimizer_args={"popsize":10,# Population size"maxiter":100,# Number of iterations"workers":-1,# Number of cores"seed":0,},)# Define the dispersion curves to invert# period and velocity are assumed to be data arrayscurves=[Curve(period,velocity,0,"rayleigh","phase")]# Run inversionres=model.invert(curves)print(res)Expected output:--------------------------------------------------------------------------------
Best model out of 501 models (1 run)

Velocity model                                    Model parameters
----------------------------------------          ------------------------------
         d        vp        vs       rho                   d        vs        nu
      [km]    [km/s]    [km/s]   [g/cm3]                [km]    [km/s]       [-]
----------------------------------------          ------------------------------
    0.0298    0.5033    0.2055    2.0000              0.0298    0.2055    0.4000
    1.0000    2.0586    0.9935    2.0000                   -    0.9935    0.3482
----------------------------------------          ------------------------------

Number of layers: 2
Number of parameters: 5
Best model misfit: 0.0038
--------------------------------------------------------------------------------ContributingPlease refer to theContributing
Guidelinesto see how you can help. This project is released with aCode of Conductwhich you agree to abide by when contributing.
Package: evo-featureflags-client
FeatureFlags client library for PythonSeeexamplesdirectory for complete examples for some major Web frameworks.OverviewClient supports Python >=3.9.InstallationTo install package:pdm add evo-featureflags-clientTo release package:lets release 0.4.0 --message="Added feature"DevelopmentInstall dependencies:pdm install -dPre-commit./scripts/enable-hooks.sh./scripts/disable-hooks.shTODO:add docs, automate docs buildadd testsaddtracer/stats_collectorfor http manager
Package: evo-featureflags-protobuf
FeatureFlags service protobuf filesOverviewTo generate Python code from protobuf files run:pdm run protocNOTE: On mac os be sure to runpdm installlike this:CFLAGS="-I /opt/homebrew/opt/openssl/include" LDFLAGS="-L /opt/homebrew/opt/openssl/lib" GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 pdm install -G protocTo install package:pdm add evo-featureflags-protobufTo release package:VERSION=<tag> MESSAGE=<message> pdm run release"
Package: evo-featureflags-server
FeatureFlags serviceOverviewServer requires Python >= 3.11.
Server consists of actual web application and API handlers (HTTP, gRPC):Web application:fastapi_+hiku_+aiopg_on backendreact.js_ +Apollo_ on frontendgRPC API handler:grpclib_+hiku_HTTP API handler:fastapi_+hiku_ADRCheck important architecture decisions inadr/directory.InstallationOn PyPi:https://pypi.org/project/evo-featureflags-serverTo install with Sentry integration:pip3 install evo-featureflags-server[sentry]To install client library follow instructions
here:evo-featureflags-clientDevelopmentRun all this commands:lets postgreslets apply-migrations-devlets apply-seeds-dev# if you have data inseeds/directorylets web# in separate terminallets ui# in separate terminalTo start API handlers (not required for web application):lets http# in separate terminallets rpc# in separate terminalTo build UI and copy it toweb/staticdirectory:lets build-copy-ui-bundleTo release package:lets release 1.0.0 --message="Added feature"Pre-commit./scripts/enable-hooks.sh./scripts/disable-hooks.shTODO:add docs, automate docs buildadd more tests.. _fastapi:https://github.com/tiangolo/fastapi.. _hiku:https://github.com/vmagamedov/hiku.. _aiopg:https://github.com/aio-libs/aiopg.. _grpclib:https://github.com/vmagamedov/grpclib
Package: evoflow
EvoFlow - Genetic algorithms for humansYou have just found EvoFlowEvoFlow is a modern hardware accelerated genetic algorithm framework that recast
genetic algorithm programing as a dataflow computation on tensors.
Conceptually is very similar to how Tensorflow & Keras are approaching
deep-learning so if you have experience with any of those you will feel right
at home.Under the hood, EvoFlow leverage Tensorflow or Cupy to provide hardware
accelerated genetic operations. If you don't have a GPU, you can run EvoFlow on
Google Colab or it will just work fine on your CPU.Getting started in 30 secondsInstall EvoFlow:pip install evoflowHead to ourhello world notebookthat will shows you how to use EvoFlow to solve the classic OneMax problem.TutorialsThe following tutorials are availablesProblemDescriptionKey concepts showcasedOneMaxMaximize the number of ones in a chromosomeEvoFlowcore APIRandomMutationOPUniformCrossOverOpEvolution model constructionResultsbasic usageTravel Salesman problemVisit each city once while minimizing the distance traveledCustomFitness functionGenes permuting Ops:ShuffleandReverseEvolution model programatic constructionGenetic Algorithm are used to solve awide variety of problemsDeep-learning versus Evoluationary algorithmsGenerally you want to use Deep-learning when the problem is continious/smooth
and evoluationary algorithms when the problem is discrete. For example voice
generation is smooth and solving (non-linear) equations is discrete.Concretely this means that the fitness functions you use to express what constraint
to solve are very similar to the loss functions in deep-learning except they
don't need to be differentiable and therefore can perform arbitrary computation.However the cost of fitness function increased expressiveness and flexibility
compared to neural network loss is that we don't have the gradients to help
guide the model convergence and therefore coverging is more computationaly
expensive which is why having a hardware accelerated framework is essential.Genetic Algorithm terminologyGene: atomic unit. Equivalent to a neuron in deep-learning.Chromosome: ordered list of gene(s).Genotype: collection of chromosome(s). Used when the problem requires to
maximizes multiples fitness function at once.Population of x: collection of chromosomes or genotypes.
That is what makes a Tensor.Generation: One round of evolution. Equivalent to an epoch in deep-learning.Fitness function: Function that evaluate how good/fit a given chromosome is.
this is equivalent to the loss function in deep learning except it doesn't
need to be differentiable and aim to be maximized.EvoFlow TerminologyEvoluation op: Operation performed on a population of chromosome to
make them evolve. Common ops includes various type of Chromosomal crossovers
and Chromosomal mutations. Equivalent to deep-learning layers
(e.g a convolution layer).Evolution model: Directed graph of evolutionary ops that is used
to evolve the population. This is equivalent to a model architecture
in deep-learning settings.DisclaimerThis is not an official Google product.
Package: evofs
EvoFS is a python package providing a sklearn-like transformer
for multi-objective evolutionary feature selection.Quick startYou can install EvoFS along with all its dependencies fromPyPI:$pipinstallevofsCitingIf you find EovFS useful in your research, please consider citing the following paper:@inproceedings{barbiero2019novel,
  title={A Novel Outlook on Feature Selection as a Multi-objective Problem},
  author={Barbiero, Pietro and Lutton, Evelyne and Squillero, Giovanni and Tonda, Alberto},
  booktitle={International Conference on Artificial Evolution (Evolution Artificielle)},
  pages={68--81},
  year={2019},
  organization={Springer}
}SourceThe source code and minimal working examples can be found onGitHub.Running testsYou can run all unittests from command line by using python:$python-munittestdiscoveror coverage:$coveragerun-munittestdiscoverAuthorsPietro Barbiero,Giovanni Squillero,
andAlberto Tonda.LicenceCopyright 2020 Pietro Barbiero, Giovanni Squillero, and Alberto Tonda.Licensed under the Apache License, Version 2.0 (the “License”); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at:http://www.apache.org/licenses/LICENSE-2.0.Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions and
limitations under the License.