Saravanan666/pypi-org huggingface dataset:
Package: metricflow
Build and maintain all of your metric logic in code.Welcome to MetricFlowSee our latest updates in theMetricflow Changelog!MetricFlow is a semantic layer that makes it easy to organize metric definitions. It takes those definitions and generates legible and reusable SQL. This makes it easy to get consistent metrics output broken down by attributes (dimensions) of interest.The name comes from the approach taken to generate metrics. A query is compiled into a query plan (represented below) called a dataflow that constructs metrics. The plan is then optimized and rendered to engine-specific SQL.MetricFlow provides a set of abstractions that help you construct complicated logic and dynamically generate queries to handle:Multi-hop joins between fact and dimension sourcesComplex metric types such as ratio, expression, and cumulativeMetric aggregation to different time granularitiesAnd so much moreTo get up and running with your own metrics, you should rely onMetricFlow’s documentation.LicensingMetricFlow is distributed under a Business Source License (BUSL-1.1). For details on our additional use grant, change license, and change date please refer to ourlicensing agreement.Getting StartedInstall MetricFlowMetricFlow can be installed from PyPi for use as a Python library with the following command:pip install dbt-metricflowMetricFlow currently serves as a query compilation and SQL rendering library, built to work in conjunction with a dbt project. As such, using MetricFlow requires a working dbt project and a dbt adapter. We provide thedbt-metricflowbundle for this purpose. You may choose to install other adapters as optional extras from dbt-metricflow.You may need to install Postgres or Graphviz. You can do so by following the install instructions forPostgresorGraphviz. Mac users may prefer to use brew:brew install postgresqlorbrew install graphviz.TutorialThe best way to get started is to follow the tutorial steps, which you can access by running:mf tutorialNote: this must be run from a dbt project root directory.ResourcesWebsiteDocumentationSlack CommunityMetricFlow Git RepositoryCHANGELOG.mdTENETS.mdContributing and Code of ConductThis project will be a place where people can easily contribute high-quality updates in a supportive environment.Please read ourcode of conductbefore diving in.To get started on direct contributions, head on over to ourcontributor guide.LicenseMetricFlow is source-available software.Version 0 to 0.140.0 was covered by the Affero GPL license.
Version 0.150.0 and greater is covered by the BSL license..MetricFlow is built bydbt Labs.
Package: metricflow-lite
NoteThis is not the fullMetricFlowpackage, this is MetricFlow-Lite. MetricFlow-Lite is a forked version of MetricFlow with some deps removed.WarningMetricFlow-Lite is not supported. I.e., issues/bugs/change requests should happen on the fullMetricFlowpacakge.Welcome to MetricFlow-LiteMetricFlow-Lite is a forked version of MetricFlow with data warehouse connector dependencies removed. This necessary for some of our (Transform) internal projects.LicenseMetricFlow-Lite is open source software. The project relies on several licenses including AGPL-3.0-or-later and Apache (specified at folder level).MetricFlow-Lite is built byTransform
Package: metricflow-to-zenlytic
Zenlytic AdaptersUtilities for converting semantic layer YAML files to Zenlytic's format.Steps for usage:Runpip install metricflow-to-zenlytic$ metricflow_to_zenlytic [DIRECTORY]from the command line, where[DIRECTORY]is the directory yourdbt_project.ymlfile is in.Usage in PythonTo run the function in python you can do so like this:from metricflow_to_zenlytic.metricflow_to_zenlytic import (
    load_mf_project,
    convert_mf_project_to_zenlytic_project,
)

# Load the metricflow project
metricflow_project = load_mf_project(metricflow_folder)

# Convert to Zenyltic models and views
models, views = convert_mf_project_to_zenlytic_project(metricflow_project, "my_model", "my_company")

# Save as yaml files
out_directory = '/save/to/here/'
zenlytic_views_to_yaml(models, views, out_directory)Testing$ pytest
Package: metrician
MetricianMetrician is a small lightweight module that easily and automatically records performance metrics for you.
Right now, Metrician is only compatible with Pytorch. There are a lot of great tools out there likePytoch Lightingthat have built in loggers. Although there is nothing wrong with these tools (in fact, I'm a big fan), I find myself writing the same few lines of code over and over and over again, just to log the same metrics. I hate redundancy, so I wrote a tool to fix that issue. You're still able to use the same libraries, but now you don't have to code as much.UsageimporttorchfromtorchimportnnfrommetricianimportMetricWriter,Defaults# initialize dataX=torch.randn(10,10)# input size 10Y=torch.randn(10,4)# 4 classes# initialize simple model, loss and optimizermodel=nn.Linear(10,4)optim=torch.optim.SGD(model.parameters())loss_fn=nn.L1Loss()# initialize Metric Writermw=MetricWriter(Defaults.SimpleClf)# initialize with basic classifier metrics# inside your training loopfor_inrange(EPOCHS):y=model(X)# you can either pass the loss function into the metric writer to automatically# record the loss or do that seperately. If you pass in the loss, it will automatically# call your loss function for you i.e. (loss = loss_fn(yhat,y) ) and return the result# if you are recording every couple of steps/batches it's recommended that you do not pass# the loss function to the metric writerloss=mw(y,Y,loss_fn)loss.backward()optim.step()Feeling Lazy?With Metrician you can leverage existing class methods to automatically create a config, reducing the amount of code you need.importtorchfromtorchimportnnfrommetricianimportMetricWriter,Defaults# initialize dataX=torch.randn(10,10)# input size 10Y=torch.randn(10,4)# 4 classes# initialize simple classification modelmodel=nn.Linear(10,4)# initialize Metric Writermw=MetricWriter.from_model(model)# print( mw.cfg.config_type )# >>> classification# or# initialize simple regression modelmodel=nn.Linear(10,1)# initialize Metric Writermw=MetricWriter.from_model(model)# print( mw.cfg.config_type )# >>> regression...Want to integrate it into another library like Pytorch Lightening?Metrician is an easy module to integrate into any existing Pytorch library/framework.def__init__(self):...self.accuracy=pl.metrics.Accuracy()self.mw=MetricWriter(Defaults.SimpleCLF)deftraining_step(self,batch,batch_idx):x,y=batchpreds=self(x)# instead of normally typing# self.log('my_loss', loss,)# ...# self.log('my_accuracy',self.accuracy(preds, y))# instead typeself.mw((preds,y))TODOsadd histograms, embeddings and graphsTensorflow Support?????profit
Package: metric-learn
metric-learn: Metric Learning in Pythonmetric-learn contains efficient Python implementations of several popular supervised and weakly-supervised metric learning algorithms. As part ofscikit-learn-contrib, the API of metric-learn is compatible withscikit-learn, the leading library for machine learning in Python. This allows to use all the scikit-learn routines (for pipelining, model selection, etc) with metric learning algorithms through a unified interface.AlgorithmsLarge Margin Nearest Neighbor (LMNN)Information Theoretic Metric Learning (ITML)Sparse Determinant Metric Learning (SDML)Least Squares Metric Learning (LSML)Sparse Compositional Metric Learning (SCML)Neighborhood Components Analysis (NCA)Local Fisher Discriminant Analysis (LFDA)Relative Components Analysis (RCA)Metric Learning for Kernel Regression (MLKR)Mahalanobis Metric for Clustering (MMC)DependenciesPython 3.6+ (the last version supporting Python 2 and Python 3.5 wasv0.5.0)numpy>= 1.11.0, scipy>= 0.17.0, scikit-learn>=0.21.3Optional dependenciesFor SDML, using skggm will allow the algorithm to solve problematic cases
(install from commita0ed406).pip install'git+https://github.com/skggm/skggm.git@a0ed406586c4364ea3297a658f415e13b5cbdaf8'to install the required version of skggm from GitHub.For running the examples only: matplotlibInstallation/SetupIf you use Anaconda:conda install-cconda-forgemetric-learn. See more optionshere.To install from PyPI:pip installmetric-learn.For a manual install of the latest code, download the source repository and runpython setup.py install. You may then runpytest testto run all tests (you will need to have thepytestpackage installed).UsageSee thesphinx documentationfor full documentation about installation, API, usage, and examples.CitationIf you use metric-learn in a scientific publication, we would appreciate
citations to the following paper:metric-learn: Metric Learning Algorithms in Python, de Vazelheset al., Journal of Machine Learning Research, 21(138):1-6, 2020.Bibtex entry:@article{metric-learn,
  title = {metric-learn: {M}etric {L}earning {A}lgorithms in {P}ython},
  author = {{de Vazelhes}, William and {Carey}, CJ and {Tang}, Yuan and
            {Vauquier}, Nathalie and {Bellet}, Aur{\'e}lien},
  journal = {Journal of Machine Learning Research},
  year = {2020},
  volume = {21},
  number = {138},
  pages = {1--6}
}
Package: metric-log-influx-importer
OverviewInfluxLogImporter is a Python utility designed to import metric logs into InfluxDB, a time-series database, from various data sources including flat files (CSV, JSON), APIs, and other databases. It automates the process of data transformation and loading, ensuring that metrics are stored efficiently for analysis, monitoring, and alerting purposes. This tool is particularly useful for DevOps, data engineers, and analysts looking to centralize their metric logs for better observability and operational intelligence.FeaturesSupports importing from CSV, JSON files, and external APIs.
Customizable mapping to transform data into InfluxDB-compatible schemas.
Batch processing for efficient data import.
Error handling and logging for reliable imports.
CLI for easy integration with automation scripts.RequirementsPython 3.8+
InfluxDB 2.0+
Requests (for API data fetching)
Pandas (for data manipulation)ConfigurationBefore running the importer, configure your data sources and InfluxDB connection settings in config.py. This includes specifying the source file paths or API endpoints, data formats, and InfluxDB credentials (URL, bucket, org, and token).UsageImporting DataRun the importer with the following command:Copy codepython import.pyCommand-Line Arguments--source: Specify the data source type (file, api).
--path: Path to the data file or API endpoint URL.
--format: Data format (csv, json).
Package: metric-py
METRIC-PYA python wrapper for METRIC library (https://panda.technology/de/metric)InstallationYou need Python 3.6+Linux & OS Xpython -m pip install metric-py -i https://test.pypi.org/simple/Windows (x64 only)You will need to install any BLAS implementation.
The easiest way is by usingMiniconda:condaconfig--addchannelsconda-forge
condaupdate-nbaseconda-y
condainstall-cconda-forgelibopenblasopenblas-yThen you can use pip to installpython -m pip install metric-py -i https://test.pypi.org/simple/Build from the sourcegit clone --recurse-submodules https://github.com/panda-official/metricDownload and extractBoost(1.67+).
For Windows there are pre-build binaries available.Install PrerequisitesUbuntusudo apt-get install cmake
sudo apt-get install libboost-all-dev
sudo apt-get install libopenblas-devWindowsInstallMiniconda.
In Conda CLI initialize your virtual environment with desired Python version:condacreate--namemy_env-ypython=3.8
condaactivatemy_envInstall OpenBLAS from alternative repocondaconfig--addchannelsconda-forge
condaupdate-nbaseconda-y
condainstall-cconda-forgelibopenblasopenblas-yBuild packageAt least 2GB of RAM is requiredpython setup.py bdist_wheelto limit memory usage during build addMAKE="make -j1":MAKE="make -j1" python3 setup.py bdist_wheelInstall modulepython -m pip install dist/*Examplesimportnumpyfrommetric.correlationimportEntropyfrommetric.distanceimportEuclidean,P_norm,Manhattenaent=numpy.float_([[5.0,5.0],[2.0,2.0],[3.0,3.0],[5.0,1.0],])print("Entropies:")formetricin(Euclidean,P_norm,Manhatten):res=Entropy(metric=metric(),p=3,k=2)(aent)print(f'using{metric}:{res:.5f}')res=Entropy(p=3,k=2)(aent)print(f'using Default:{res:.5f}')for more examples please checkexamples/folder
Package: metricq
metricq - python librariesThis is a python implementation of the MetricQ protocol.
It allows you to write Sources and Sinks to easily send and receive data over
the MetricQ infrastructure.InstallationInstall the package from PyPI:$pipinstallmetricqExamplesTheexamplesdirectory contains some basic
examples.
To play around with them, check out a copy of this repository and (in your
favourite venv) install their dependencies:$pipinstall-e'.[examples]'A simple Source is implemented inmetricq_source.py, as is a Sink inmetricq_sink.py.
We will use the former to produce data for a metric calledtest.py.dummy, which we
will then receive and print with the latter.Assuming a MetricQ instance is reachable atlocalhost, configure a
client(consult the documentation of your favourite config provider on how
to do that)namedsource-py-dummyto produce values with a frequency of
0.5Hz (i.e. every 2 seconds) :{"rate":0.5}To start the Source, run:$./examples/metricq_source.py--server'amqp://localhost/'--token'source-py-dummy'This should now send values for the metrictest.py.dummyin 2-second intervals.
To see (in detail) what's going on, add-v DEBUGto the arguments above.On the other side, run$./examples/metricq_sink.py--server'amqp://localhost/'--metrics'test.py.dummy'and you should see new values for the metrictest.py.dummyappear every 2 seconds.Tools and utility scriptsThe repositorymetricq/metricq-toolscontains a collection of tools and utility scripts to monitor and administrate
a MetricQ network.
Install them fromPyPI:$ pip install metricq-toolsDevelopment setupClone the repository, and in a virtual environment run$pipinstall-e'.[dev]'This will install all tools necessary for testing and linting.
To test code manually, runpytest.
Format code usingblackandisort, or lint withflake8.
To make sure a source distribution (sdist) contains the correct files, runcheck-manifest.
Tools are configured insetup.cfgrespectivelypyproject.toml.To test code in a fresh environment, run thetoxtest harness:$toxThis runs the same step as our CI does.
Iftoxpasses locally there's high chances that CI steps will pass too.We recommend to install ourpre-commithooks:$pre-commitinstallThis way commits that fail tests or do not comply with our code style are rejected right away.
Package: metricq-sink-nsca
This tool is a MetricQ sink that sends passive service check results for
metrics, based on their availability and value range.InstallationInstall the latest release ofmetric-sink-nscafromPyPI:$pipinstallmetric-sink-nscaOptionally, install the[uvloop]extra to use an optimized event loop implementationbased on uvloop:$pipinstall'metric-sink-nsca[uvloop]'Developement versionTo install the latest development version, clonethe repoand install from source:$gitclonehttps://github.com/metricq/metricq-sink-nsca.git/path/to/repo$pipinstall/path/to/repoUsage and ConfigurationBasic setup (MetricQ management server, client token etc) is configured via
command line; for more information, issue:$metricq-sink-nsca--helpAll other configuration is provided over the MetricQ network.
See sectionConfigurationof thedocumentationfor more information.Licensemetricq-sink-nsca
Copyright (C) 2019  Technische Universität Dresden

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.
Package: metrics4mdp
Quantitative metrics of Multidimensional Projections (MDP) in PythonBased on the code written byHyung-Kwon KoInstallationpip3 install metrics4mdpUsageExamplefrommetric4mdpimportMDPMetricProvidermlist=[""DTM", "DTM_KL1", "Continuity", "Trustworthiness"]metricprovider=MDPMetricProvider(raw_data,emb_data,mlist,k=7)
Package: metrics.bumpversion
installationto install:$pipinstallmetrics.bumpversionto uninstall:$pipuninstallmetrics.bumpversionfor details please see the documentation of metrics.metrics.bumpversionThemetrics.bumpversionpackage is a plugin for the metrics package.metrics.bumpversion adds version information to the “build” section of
the .metrics file.version information is extracted from the .bumpversion.cfg fileLicenseCopyright (c) 2018 Mark Fink and others. metrics is released under the
MIT License (see MIT_LICENSE).
Package: metrics-collector
# Garena Metrics CollectorA system monitoring daemon for recording server statistics in [InfluxDB](http://influxdb.com/).## InstallationYou can install this via PyPI, like so:```shsudo pip install garena_metrics_collector.zip```And then all you have to do is go to **/etc/garena_metrics_collector/** and edit the **config.ini** file there and you should be ready to log.Assuming that you renamed the config file to **config.ini**, you can go ahead and run this:```shgarena_metrics_collector start```And the daemon will start logging everything to the InfluxDB server you specified.## Included CollectorsThis is a list of some of the default packaged collectors that are enabled:### **cpu** - `system.cpu`#### Returns percentages of CPU allocation|Key|Type|Description||---|----|-----------||**usage**|*int*|Percent used by user processes|### **disk** - `system.disk`#### Returns information about disk usage|Key|Type|Description||---|----|-----------||**total**|*long*|Total available space *in bytes*||**used**|*long*|Space used *in bytes*||**free**|*long*|Free space *in bytes*|**Note**: This plugin also returns a combined total available under the `system.disk.total` series.### **load** - `system.load`#### Returns system load information|Key|Type|Description||---|----|-----------||**1m**|*int*|1 minute load average||**5m**|*int*|5 minute load average||**15m**|*int*|15 minute load average|### **memory** - `system.memory`#### Returns system memory allocations and usageAll of these values are calculated in *bytes*.|Key|Type|Description||---|----|-----------||**total**|*long*|Total memory||**available**|*long*|Total uncached memory||**used**|*long*|Total cached memory|### **net** - `system.net.*`#### Returns network information seperated by interface|Key|Type|Description||---|----|-----------||**bytes_tx**|*long*|Total bytes sent||**bytes_rx**|*long*|Total bytes received||**packets_rx**|*long*|Total packets received||**packets_tx**|*long*|Total packets sent||**errors_in**|*long*|Total incoming packet errors||**errors_out**|*long*|Total outgoing packet errors||**dropped_in**|*long*|Total incoming dropped packets||**dropped_out**|*long*|Total outgoing dropped packets|## Custom CollectorsYou can go ahead and add collectors to the **/etc/garena_metrics_collector/collectors/** and we will automatically run them in the cycles and report their values.Here's some examples:**collectors/example.py**:```pythonimport randclass ExampleCollector(CollectorThread):identifier = 'example' # This is required!def collect(self, cache):# Stateful cache (across collections)if last not in cache:reutrn []return [{"measurement": "your_measurement","fields": {'point': rand.randint(0, 100) - cache['last']}}]```Tags are auto added, including server public IP and hostname(configurable in hostname).## LicenseMIT license, see the **LICENSE** file.
Package: metrics-exporter
metrics_exporterHow to useSet the metrics names and the postgres connection:me=MetricsExporter(metricsGroups=[['metric1','metric2'],['metric3']],tableName='it',user='root',password='root',dbname='postgres',host='localhost',port=5432,bufferSize=10000)For each metrics, 3 other metrics will be calculated:Nomamlized value over the metric groupAccumulated value of the metricNormalized accumulated value over the metric groupNow you can insert a new metric for a month in a page/user:me.insertMetric(1,'pippo','201005',[{'metric1':2,'metric2':4},{'metric3':2}])To be sure that all metrics have been saved to the database in the end run:me.finalize()Pip packageTo update the pip packagepythonsetup.pysdist
twineuploaddist/*
Package: metrics-felbeaver
Metrics is a Python package for computing various software metrics from the source code. This package can compute:rawmetrics (various LOC, blank lines, different line averages and line percentages, etc.)HalsteadmetricsMcCabe’scomplexity (cyclomatic complexity)Henry-KafuraInformation Flow metrics (module complexity)UsageMetrics package can be used from command line or programmatically. Here’s a code example of using package API:import metrics

metrics.foo('source_file.c') # returns a valueA command line usage example is shown below:$ metrics cc source_file.c
source_file.c
   F 356:0 func1
   F 1093:0 func2

Average complexity: F (724.5)Detailed documantation for how package can be used is athttps://metrics.readthedocs.org/.ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.LisenceMIT
Package: metrics.gitinfo
installationto install:$pipinstallmetrics.gitinfoto uninstall:$pipuninstallmetrics.gitinfofor details please see the documentation of metrics.metrics.gitinfoThemetrics.gitinfopackage is a plugin for the existing metrics
package.Acknowledgementsmuch of my work has been inspired byAdam Tornhills new
bookfor reading the git repo we use GitPython
(https://github.com/gitpython-developers/GitPython)to find file changes in the repo we usehttps://github.com/Bachmann1234/diff-coverLicenseCopyright (c) 2018 Mark Fink and others. metrics is released under the
MIT License (see MIT_LICENSE).