Saravanan666/pypi-org huggingface dataset:
Package: profetorch
ProFeTorchFB Prophet + Fastai + pyTorch.This is an alternative implementation of prophet which uses quantile regression instead of MCMC sampling. It provides the following benefits over prophet:GPU usage.Strict(er) upper and lower bounds.Can add any other set of features to the time series.The time series is implemented as follows:\begin{aligned}
y &= b(T(t) + S(t) + F(x)|l,u) \
T(t) &= mt + a \
S(t) &= \sum_{n=1}^N\left(a_n \cos\left(\frac{2\pi nt}{P}\right) + b_n \sin\left(\frac{2\pi nt}{P}\right)\right) \
F(x) &= w^T x\
b(y|l,u) &= \begin{cases}
l \quad \text{if } y < l \
y \quad \text{if } l < y < u \
u \quad \text{if } y > u
\end{cases}
\end{aligned}where $T(t)$ is the trend line, $S(t)$ are the seasonal components composed of a fourier sum, $F(x)$ is a linear function which weights features that is not related to time.The task is therefore to find the parameters $a, m, \cup_n a_n, \cup_n b_n, w$ that minimises a loss function $l(\hat{y}, y)$. The default is set to minimise $l1$ loss $\frac{1}{N}\sum_{i=1}^N |y_i - \hat{y_i}|$ so that the reliance on outliers is minimised. By default we also calculate the 5th and 95th quantile by minimising the tilted loss function. The quantile functions are calculated as:
\begin{align}
y_5 &= b(\hat{y} - (m_5 t + a_5)|l,u) \
y_{95} &= b(\hat{y} + (m_{95} t + a_{95})|l,u)
\end{align}Installpip install profetorchProFeTorch Trainingmodel_params={'y_n':10,'m_n':7,'l':0,'h':train_df['y'].max()*2}model=Model(train_df,model_args=model_params,epochs=30,alpha=1e-2,beta=0)model.fit(train_df)/opt/miniconda3/lib/python3.7/site-packages/pandas/core/frame.py:4117: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  errors=errors,






Epoch 30/30 Training Loss: 0.3687, Validation Loss: 0.6105y_pred=model.predict(df)plt.figure(figsize=(12,5))plt.scatter(df['ds'],df['y'],label='Data')plt.plot(train_df['ds'],y_pred[:train_len,1],c='r',label='Train Set')plt.fill_between(train_df['ds'],y_pred[:train_len,0],y_pred[:train_len,2],alpha=0.5)plt.plot(test_df['ds'],y_pred[train_len:,1],c='g',label='Test Set')plt.fill_between(test_df['ds'],y_pred[train_len:,0],y_pred[train_len:,2],alpha=0.5)plt.show()Obviously more works needs to be done as seen in the graph above. However, note that:The seasonal component is captured.The quantiles are asymmetric, which cannot happen in the fb-prophet case.I will fix these short comings if there is enough interest.
Package: profi-dcp
PROFI-DCPA simple Python library to send and receive messages with the Profinet Discovery and basic Configuration Protocol (DCP) protocol.
It can send requests and parse the corresponding responses to identify devices over the network, get and set their parameters or reset them to factory settings.
Documentation can be foundhereand in theexamplesdirectory.This is a fork frompnio_dcp.InstallationReleaseThe latest release is available in the public PyPi repo.
Install via pip:pip install profi-dcpFrom git repoYou can also install directly from the git repo.Clone the repositorygit clone <git-url> <destination>Change into the clone directorycd <destination>Install via pippip install .WindowsTo use this library on Windows, Npcap (or WinPcap) is required. Npcap can be downloaded from here:https://nmap.org/npcap/LinuxOn Linux, no additional installations are required since raw sockets are used instead. However, this requires running it with root permission.Other Operating SystemsPNIO-DCP has not been tested on any other operating systems besides Windows and Linux.CLIprofi-dcpis the main entry point to the CLI.
It supports various subcommands which execute some basic functions.For more information use the help flag  (profi-dcp -h).Subcommandsidentifyis a subcommand to identify devices.set-ipis a subcommand to set a new ip address for a device.
Package: profig
profigis a straightforward configuration library for Python.MotivationWhy another configuration library? The simple answer is that none of the
available options give me everything I want, with an API that I enjoy using.
This library provides a lot of powerful functionality, but never at the cost of
simplicity.FeaturesAutomatic value conversion.Section nesting.Dict-like access.Single-file module with no dependencies.Extensible input/output formats.Built-in support for INI files and the Windows registry.Preserves ordering and comments of INI files.Full Unicode support.Supports Python 2.7+ and 3.2+.Installationprofiginstalls usingeasy_installorpip:$ pip install profigExampleBasic usage is cake. Let’s assume our config file looks like this:[server]
host = 192.168.1.1
port = 9090First, we specify the defaults and types to expect:>>> cfg = profig.Config('server.cfg')
>>> cfg.init('server.host', 'localhost')
>>> cfg.init('server.port', 8080)Then, we sync our current state with the state of the config file:>>> cfg.sync()As expected, we can access the updated values without undue effort, either
directly:>>> cfg['server.host']
'192.168.1.1'Or by section. Notice that the type of theportoption is preserved:>>> server_cfg = cfg.section('server')
>>> server_cfg['port']
9090ResourcesDocumentationPyPIRepository
Package: profiled
A simple profiling decorator:In[1]:fromprofiledimportprofiled,ProfilerIn[2]:@profiled...:defget_answer():...:return42...:In[3]:profiler=Profiler()In[4]:withprofiler:...:foriinrange(100000):get_answer()...:In[5]:profiler.compute_stats()Out[5]:{'get_answer':{'avg':2.2763967514038087e-07,'max':0.00016736984252929688,'min':0.0,'num':100000,'std':6.953436521202228e-07,'tot':0.022763967514038086}}The decorator also works with class methods. That’s about it.Install withpip install profiled.
Package: profile-data-directory
Profile Data DirectoryA package for profiling the files in a data directoryFree software: GNU General Public License v3Documentation:https://profile-data-directory.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2023-11-13)First release on PyPI.
Package: profile-decorator
profile-decoratorProblem/MotivationFind memory leaks in Python code quickly without significant code changes in a quickly digestible manner such that the root cause can be easily diagnosed.Until open-telemetryAdds metrics API, I want a quick and dirty decorator that will give me the  memory usage of the process in scope before and after a function is run.Usage# example.pyfromprofile_decoratorimportprofile_decoratorprofile_decorator.init()@profile_decorator.profile_memorydefmy_func():print("hello, world")if__name__=="__main__":my_func()$poetryrunpythonexample.py
hello,world{"start_time":"2021-08-29T13:20:31.435036","uss_memory_before":6852608,"end_time":"2021-08-29T13:20:31.435892","uss_memory_after":6995968,"lines":[{"filename":"/home/harry/projects/GitHub/hkiang01/profile-decorator/example.py","lineno":7,"size":752,"size_diff":0},{"filename":"/home/harry/projects/GitHub/hkiang01/profile-decorator/example.py","lineno":12,"size":560,"size_diff":0}]}DesignThe decorator will collect the following information:name of functionfilepathline numbermemory usage before function is runtimestamp when function is calledtimestamp when function is finishedmemory usage after function is runIt will expose this in json or other easily digestble format for reporting purposes.
Package: profilegraph
profilegraphA line/cell magic for displayingcProfileresults in graph form. Like%timeor%%time, but
with far more information (with the performance penalty you'd expect fromcProfile.run).Inspired bymattijn/gprof2dot_magic.InstallThis package requires Jupyter with a python kernel to be installed. The only
other python dependency isgprof2dot, which is used to convertcProfileoutput to agraphviz-compatible dotfile and is installed by pip
automatically, and agraphvizbinary,
which is used to render the SVG output. You can installgraphvizfrom the
provided download link or using the package manager of your choice.pipinstallprofilegraphUseLoad the extension in a Jupyter notebook:%load_extprofilegraphProfile a line of code by sticking%profilegraphat the start:importre%profilegraphre.sub("biz","baz","foobarbiz")If you have a whole cell that needs to be profiled, you can use the cell magic
form:%%profilegraphforiinrange(10):print(i)Developprofilegraphusesflit. Installflitwithpip install flit.Install in editable mode with:flitinstall[--symlink][--pythonpath/to/python]Upload to PyPI with:flitpublish
Package: profilelambda
profilelambdaDecorators and utils for profiling / debugging functions - especially AWS lambdaFree software: MIT licenseDocumentation:https://profilelambda.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2018-03-07)First release on PyPI.
Package: profilelog-middleware
Provides profiling results through console.log.
Home-page:https://github.com/chromano/profilelogMaintainer: Carlos H. Romano
Maintainer-email:chromano@gmail.comLicense: UNKNOWN
Description: # ProfileLogMiddlewareThis is a WSGI middleware which will profile the request and embed it in the response. The default behavior is to embed the profiling data viaconsole.table, right before the closing<html>tag. The result is that you can then see the information by opening devtools (should work on both Chrome and Firefox):![](https://github.com/chromano/profilelog-middleware/blob/master/sample.png“Chrome devtools”)## Installationpip install profilelog-middleware## UsageSimply wrap your WSGI application withprofilelog.middleware.ProfileLogMiddleware. Below is an example for thewsgi.pyfile provided with Django projects:from django.core.wsgi import get_wsgi_application
from profilelog.middleware import ProfileLogMiddlewareapplication = ProfileLogMiddleware(get_wsgi_application())## ConfigYou can specify to the middleware how far you want to go by specifying the number of function calls to display. Example:application = ProfileLogMiddleware(get_wsgi_application(), limit=5)The default value forlimitis 25, which should suffice for most usecases.## CaveatsIf you have a compression middleware in place (for example, a gzip middleware), make sure to disable it or run it afterProfileLogMiddleware, otherwise the default profile logging function won’t be able to identify the content.Platform: UNKNOWN
Package: profile-middleware
=============================profile-middleware=============================.. image:: https://badge.fury.io/py/profile-middleware.svg:target: http://badge.fury.io/py/profile-middleware.. image:: https://travis-ci.org/vinu76jsr/django_profiler.png?branch=master:target: https://travis-ci.org/vinu76jsr/django_profiler.. image:: https://coveralls.io/repos/vinu76jsr/django_profiler/badge.png?branch=master:target: https://coveralls.io/r/vinu76jsr/django_profiler?branch=masterProfiler for django viewsDocumentation-------------The full documentation is at https://django-profile-view.readthedocs.org/.Quickstart----------Install profile-middleware::pip install profile-middlewareThen use it in a project::doc:`usage`Features--------* uses cProfile moduleHistory-------0.2.6 (2014-05-14)++++++++++++++++++* Updated project link in setup file - to be reflected on PYPI0.2.5 (2014-05-13)++++++++++++++++++* Shipping with versions of jquery and datatables and images.* profiler changed from hotshot to cProfile for performance0.2.1 (2014-05-09)++++++++++++++++++* Version bump for README changes to be reflected on PyPI0.2.0 (2014-05-09)++++++++++++++++++* Documentation update for contributors.0.1.0 (2014-05-09)++++++++++++++++++* First release on PyPI.
Package: profile-python
Profile PythonOverviewProfile python is a script for you to view your data and github repositories.InstallingInstall with pip or your favorite PyPi package manager:python3 -m pip install profile-pythonUsagepython3 -m profile_pythonAuthorCoded byJoão LucasLicenseMIT License

Copyright (c) 2021 João Lucas

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Package: profile-readme
profile-readmeA CLI tool for generating a GitHub profile README using theJinja2template engine.It lets you use all features provide byJinja2to help you customize your GitHub profile README and it provides data from the GitHub API to your template.Read the documentation onhttps://profile-readme.rtfd.io/.InstallationUse the following command to installprofile-readme:$ python3 -m pip install profile-readmeLiving on the edgeIf you want to work with the latest code before it’s released, install or update the code from themasterbranch:$ python3 -m pip install -U git+https://github.com/Robert-96/profile-readme.gitQuickstartUse theinitcommand to generate a new project with an example template:$ profile-readme initUse therendercommand to update yourREADME.mdfile:$ profile-readme renderAdvanced UsageUsing Custom Build ScriptsThe command line shortcut is convenient, but sometimes your project needs something different than the defaults. To change them, you can use a build script.A minimal build script looks something like this:fromprofile_readmeimportget_github_context,ProfileGeneratorcontext={}# If you don't need the GitHub data you can remove the next linecontext.update(**get_github_context('octocat'))if__name__=="__main__":ProfileGenerator.render(template_path="README-TEMPLATE.md",output_path="README.md",context=context)Finally, just save the script asbuild.py(or something similar) and run it with your Python interpreter.$ python build.pyNote: Don't forgot to also update.github/workflows/readme.yml.
Replacepython3 -m profile_readme renderwithpython3 build.py.Loading DataThe simplest way to supply data to the template is to passProfileGenerator.rendera mapping from variable names to their values (a “context”) as thecontextkeyword argument.fromprofile_readmeimportget_github_context,ProfileGeneratorcontext={greeting='Hello, world!'}# If you don't need the GitHub data you can remove the next linecontext.update(**get_github_context('octocat'))if__name__=="__main__":ProfileGenerator.render(template_path="README-TEMPLATE.md",output_path="README.md",context=context)Anything added to this dictionary will be available in the template:# Title{{ greeting }}FiltersVariables can be modified byfilters. All the standard Jinja2 filters are supported (you can found the full listhere).  To add your own filters, simply pass filters as an argument toProfileGenerator.fromprofile_readmeimportget_github_context,ProfileGeneratorcontext=get_github_context('octocat')filters={'hello':lambdax:'Hello,{}!',}if__name__=="__main__":ProfileGenerator.render(template_path="README-TEMPLATE.md",output_path="README.md",context=context,filters=filters)Then you can use them in your template as you would expect:{{ 'World'|hello }}LicenseThis project is licensed under theMIT License.
Package: profiler_online
## 项目名`profiler_online`### 介绍:用来解析查找python程序可能存在的各方面性能或者奇葩问题的工具,通过web访问访问可以直接拿到火焰吐.Will Add Future:* 加入内存的相关信息* 查询时间范围### 安装:**pypi:**```pip install profiler_online```**源码安装:**```git clone https://github.com/rfyiamcool/profiler_online.gitcd profiler_onlinepython setup.py install```### 用法:这边已经封装好了，你需要做的只是把性能分析模块引入到你的应用里面.```from profiler_online import run_profilerrun_profiler()```### 测试:打开浏览器 http://127.0.0.1:8080  这样就可以显示正在运行服务的性能火焰图了.![image](https://github.com/rfyiamcool/profiler_online/raw/master/img/demo.png)### 问题:下面是以前创建火焰图的方法.```python test.pycurl "127.0.0.1:8080" | profiler_online/tools/flamegraph.pl > flame.html```改进的方法:```直接浏览器打开,地址栏 --> 127.0.0.1:8080```在开发过程中,遇到了python系统调用时不能正常捕获输出. 现在已经改为临时文件的方式.```cmdstr = './profiler_online/tools/flamegraph.pl'p = subprocess.Popen(cmdstr, stdin = subprocess.PIPE, stderr = subprocess.PIPE, shell = True)p.stdin.write(stats)p.stdin.flush()try:if p.stderr:stats = p.stderr.read()p.stderr.flush()if p.stdout:stats = p.stdout.read()except Exception, e:print e,Exception```
Package: profilerpy
ProfilerA python package providing simple profiling tools and reports.InstallationRunpipinstallprofilerpyorpipinstallgit+https://github.com/Rahgooy/profiler.git@masterUsageMethodsProfiler can be used as a wrapper for the files. For example:fromprofilerpyimportprofile@profiledefadd(a,b):returna+bCode blocksAnother usage is for profiling a block of code:fromprofilerpyimportdefault_profiler# Some line of codedefault_profiler.start('Price calculator')# Price calculator codesdefault_profiler.finish('Price calculator')Print summaryFinally you can print the profiling summarydefault_profiler.print_profile()Multiple profilersThis package usesdafult_profilerby default. However, you can use multiple instances of the profiler class.
For example:fromprofilerpyimportProfiler,profilepriceProfiler=Profiler()# Profile the codes related to calculating priceuserProfiler=Profiler()# Profile the codes related to the user management# Some lines of codeuserProfiler.start('Find user')# Find user codesuserProfile.finish('Find user')# ...default_profiler.start('Price calculator')# Price calculator codesdefault_profiler.finish('Price calculator')@profile('update_user',profiler=userProfiler)defupdate_user(user):passFunctions with custom names@profile('FancyName')defmethod1():pass
Package: profiler-wrapper
Python3 - Profiler WrapperThis package provides a wrapper function for easier usage of the built-in profiler.It only uses builtin modules.Installpython3-mpipinstallprofiler-wrapperSee:PyPIUsagefromprofiler_wrapperimportprofiledeffunction_to_profile(switch:bool,data:dict,msg:str):...return{'data':'test'}profile(target=function_to_profile,args=[True],kwargs={'data':{'random':'test'},'msg':'Yesterday is gone.'},lines=3,)# (#   {'data': 'test'},##   "270011472 function calls (270011215 primitive calls) in 181.830 seconds#    Ordered by: internal time##    ncalls  tottime  percall  cumtime  percall filename:lineno(function)#         1    5.000    5.000    8.000    8.000 /tmp/test.py:95(function_to_profile)#         2    2.000    2.000    3.000    3.000 /tmp/test.py:89(sub_function)#         3    1.000    1.000    1.000    1.000 /tmp/test.py:89(sub_function2)#    "# )
Package: profile-t
profile_tis a Python module for calculating confidence intervals of nonlinear regression models.Quantification of uncertainty of regression models is important for the interpretation of models and for decision making. The linear approximation and likelihood profiles are well-known possibilities for the calculation of confidence and prediction intervals for nonlinear regression models.This module allows the calculation of confidence regions of the numerical parameters and the prediction interval for any nonlinear regression model compatible with sympy. It provides helper functions to build the sympy-expressions from a string representation of the model and some support plots to analyse the model.The tau-theta plot shows the nonlinearity of the confidence interval of each parameter:The theta-theta plot shows the relationship between a pair of numerical parameters:The prediction interval shows the uncertainties around the predictions of the training data:More information available at the paper:@article{}InstallationDependenciesprofile_t requires:PythonNumPySciPySymPyMatplotlib=======User installationTo install from source, first clone this github repository and then run:pipinstall-U.Or from pypy:pipinstall-Uprofile_tChangelogSee theChangelogfile for the last changes.Examples of usageThe folderexamplescontain some examples of usage of this module.DocumentationThe documentation is available atlink.TestingYou can test the module with thetest_profile.pyscript in thetestsfolder.CitationTODOAUTHORSFabricio Olivetti de Franca <folivetti (at) ufabc.edu.br>Gabriel Kronberger <Gabriel.Kronberger (at) fh-hagenberg.at>A joint work of:Heuristics, Analysis and Learning Laboratory (HAL)Heuristics and Evolutionary Algorithms Laboratory (HEAL)
Package: profile-url-local
python-package-templateThis repository is designed to help you create local and remote package layers in Python.It focuses on building package layers and does not include GraphQL and REST-API layers.Download EnvironmentTo set up the environment, follow these steps in your terminal:gitclonehttps://github.com/circles-zone/<your-repo>.git--branchdev# or other branchcd<your-repo>
gitcheckout-bBU-<new-branch># if a new branch is neededpython-mvenvvenv
pipinstall-rrequirements.txt
...<edityourcode>...
gitadd.
gitcommit-m"Your commit message"gitpushoriginBU-<your-branch>For more detailed information, refer to thedocumentation.Check List:Directory StructureEnsure that the root directory has the following structure:.github/.vscode/(optional)directory_with_same_name_as_the_repo/db/reports/project_name/src/__init__.pyexample_class.pytests/example_class_test.py__init__.pyThis setup enables easy switching to a mono repo configuration.Database Python ScriptsPlace<table-name>.pyin the/dbfolder if needed.There's no need for a separate file for_mltables.Feel free to delete the example file if it's not required.Database Schema and DataCreate files to define the database schema, tables, views, and populate metadata and test data.Use/db/<table-name>.pyto create the schema, tables, views (including_ml_table).Use/db/<table-name>_insert.pyto create metadata and test data records.Updatesetup.pyDon't forget to update thesetup.pyfile, including the package name and version.Remember to upload the version after every deployment.Working with VS CodeEnsure that you push thelaunch.jsonfile to the repository.This enables running and debugging the code smoothly.Unit TestingWe recommend usingpytestover theunittestpackage.Create apytest.inifile in the project directory, not the root directory.
run in termianl: pytestWorkflow CompletionWhen you've addressed all the TODOs in the repository, using infrastructure classes like Logger, Database, Url, Importer, and others, make sure your Feature Branch GitHub Actions Workflow is green without warnings.All tests should run in GitHub Actions, your code should be well-documented, theREADME.mdfile should be clear and self-explanatory, test coverage should be above 90%, and all lines of code should be covered by unit tests.Once these conditions are met, you can filter and analyze your records in Logz.io.Pull thedevbranch to your Feature Branch and then create a Pull Request todev.Good luck :)check your code visibility lint with flake (Mandatory before pusj):run those command
python -m pip install flake8 pytest
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statisticsnote: you should use autopep8 extension in your code!