Saravanan666/pypi-org huggingface dataset:
Package: beluga-ml
Beluga - make predictions, get metricsBeluga is a Python library that provides easy access to all of the metrics you need in your multiclass classification tasks. We were inspired bythisfriendly Beluga whale to help others in their Machine Learning projects.Check out theIssuesfor future functionality and progress such as support for regression tasks and metric visualisations.The official PyPi release can be foundhere.OverviewGet various metrics on your Machine Learning predictionsPrint your metrics or incorporate them into downstream analysisVisualise your metrics (Coming Soon)InstallationTo install this library you can use Pypi via pippip install beluga_mlUsageImport beluga into your projectimportbelugaDocumentationMethods in metrics have following parameters:predictions- (Iterable) predictions output from your modelground_truth- (Iterable) ground truth values to compare againstraw- (bool).Optional. Use to get metrics in a dictionary instead of printing. Default:False.Methods list:true_positive: Number of correctly classified labels of the positive classtrue_negative: Number of correctly classified labels of the negative classfalse_positive: Number of incorrectly classified labels of the postive classfalse_negative: Number of incorrectly classified labels of the negative classprecision: Percentage of positive class predictions that are correctrecall: Percentage of correctly classified labels from the positive classsensitivity: (see recall)specificity: Percentage of correctly classified labels from the negative classf1: The harmomic mean of precision and recallaccuracy: Percentage of correctly classified labelsExamplesbeluga.metrics.true_positive([1, 1, 1, 0, 0], [1, 0, 1, 0, 0])
>>> True Positive
    ==============
    0       2.0000
    1       2.0000
    ==============

beluga.metrics.recall(['cat', 'dog', 'dog'], ['cat', 'dog', 'dog'])
>>> Recall
    ==============
    cat     1.0000
    dog     1.0000
    ==============

beluga.metrics.f1(['Elon Musk', 'Tim Cook', 'robot'], ['Elon Musk', 'Tim Cook', 'Mark Zuckerberg'])
>>> F1 score
    ========================
    Elon Musk         1.0000
    Mark Zuckerberg   0.0000
    Tim Cook          1.0000
    ========================Running CodeRun the code from the home direcotry for any development as follows:python -m beluga.metricsThis should return nothing as all development tests have been removed.TestsRun the tests from the library home directory with the following:python -m setup pytestCheck the coverage of these tests using:pytest --cov=beluga tests/ --cov-report term-missingLicenseGPL-3.0 LicenseBeluga uses open source packages to work properly:numpy- The fundamental package for scientific computing with Python.And of coursebelugaitself is open source with apublic repositoryon GitHub.
Package: beluga-py
## beluga_pyCommand line interface and python module for the BelugaCDN API. Python2 and Python3 compatible.### Installation```pip install beluga_py```### API Usage```from beluga_py.api import BelugaAPIapi = BelugaAPI(token_id=<BELUGACDN_TOKEN_ID>, token_secret=<BELUGACDN_TOKEN_SECRET>)# orapi = BelugaAPI(username=<BELUGACDN_USERNAME>, password=<BELUGACDN_PASSWORD>)# get a list of all site configurationsr = api.get('api/cdn/v2/sites')# create an authentication tokenr = api.post('api/token/token', json={'description': 'test from api'})data = r.json()```### Command Line```# get a list of all site configurationsbeluga --username <your username> --password <your password> --service api/cdn/v2 --path sites# create an authentication tokenbeluga --username <your username> --password <your password> --method POST --service api/token --path token --body '{"description": "my new token"}'```Refer BelugaCDN's API documentation at https://docs.belugacdn.com/ for more information.#### Notes* based on [`python-beluga`](https://github.com/belugacdn/python-beluga) by Adam Jacob Muller ([@AdamJacobMuller](https://github.com/AdamJacobMuller))
Package: belvaio-request-id
Belvaio Request IdBelvaio Request Id is anaiohttpset of utils that help us to track request journey between services.request_id_middleware: aiohttp middleware that generate randomrequest_idor read it fromX-Request-Idheader for each http request.RequestIdFilter: logging filter that allow attachrequest_idto every logging record.RequestIdAccessLogger: addrequest_idto aiohttp access log. This log message is logged outside the scope where we set the context var that store therequest_id, so we need to define our ownAccessLoggerthat fixes this.IfSentryis used  arequest_idtag is added when the http request is processed.Motivation:Skyscanner / aiotask-contextRequirementsPython 3.7+aiohttp>= 3.5Installationpipinstallbelvaio-request-idExample"""POC to demonstrate the usage of the belvaio-request-id package for writing the request_id from aiohttp into every log call. If you run this script, you can try to query with curl or the browser:$ curl http://127.0.0.1:8080/MateuHello, Mateu. Your request id is 93234aa6d4524f4bb76622e5d0c85589.$ curl -H "X-Request-ID: e72ec21b412845cf86a8aee50331cc4f" http://127.0.0.1:8080/MateuHello, Mateu. Your request id is e72ec21b412845cf86a8aee50331cc4f.In the terminal you should see something similar to:======== Running on http://0.0.0.0:8080 ========(Press CTRL+C to quit)2020-03-20 11:43:20,248 INFO __main__ 93234aa6d4524f4bb76622e5d0c85589 | Received new GET /Mateu call2020-03-20 11:43:20,249 INFO aiohttp.access 93234aa6d4524f4bb76622e5d0c85589 | 127.0.0.1 "GET /Mateu HTTP/1.1" 200 266 "curl/7.64.1""""importlogging.configfromaiohttpimportwebfrombelvaio_request_id.loggerimportRequestIdAccessLoggerfrombelvaio_request_id.middlewareimportrequest_id_middlewarefrombelvaio_request_id.utilsimportget_request_idLOG_SETTINGS={"version":1,"disable_existing_loggers":False,"handlers":{"console":{"class":"logging.StreamHandler","level":"INFO","formatter":"default","filters":["requestid"],},},"filters":{"requestid":{"()":"belvaio_request_id.logger.RequestIdFilter",},},"formatters":{"default":{"format":"%(asctime)s%(levelname)s%(name)s%(request_id)s|%(message)s",},},"loggers":{"":{"level":"DEBUG","handlers":["console"],"propagate":True},},}logging.config.dictConfig(LOG_SETTINGS)logger=logging.getLogger(__name__)asyncdefhandle(request):name=request.match_info.get("name")logger.info("Received new GET /%scall",name)text=f"Hello,{name}. Your request id is{get_request_id()}.\n"returnweb.Response(text=text)if__name__=="__main__":app=web.Application(middlewares=[request_id_middleware])app.router.add_route("GET","/{name}",handle)web.run_app(app,access_log_format='%a"%r"%s%b "%{User-Agent}i"',access_log_class=RequestIdAccessLogger,)ContributingThe Belvo team happily welcomes contributions.
If you wish to submit a pull request, please be sure check the items on this list:Tests related to the changed code were executedThe source code has been coded following the OWASP security best practices (https://owasp.org/www-pdf-archive/OWASP_SCP_Quick_Reference_Guide_v2.pdf).Commit message properly labeledThere is a ticket associated to each PR.Guidelineswill help you get ready to contribute to this project!
Package: belvys
Belvys is a package to fetch data through the REST API of energy portfolio management software “Belvis”.InstallationpipinstallbelvysOr add it topyproject.toml.DocumentationDocumentation is hosted on readthedocs:https://belvys.readthedocs.io/The package defines 3 classes:Tenant, which is the main class, andStructureandApi, which it depends on.TheTenantclass uses a structure specification (an instance of theStructureclass) and an interface (an instance of theApiclass) to retrieve timeseries (more specificallyportfolyo.PfLineinstances) from Belvis.The purpose of theStructureclass is primarily to specify the portfolios and timeseries we are interested in. This includes original Belvis portfolios, as well as synthetic ones that are the sum of several original porfolios. It also specifies where relevant prices can be found in Belvis.TheApiclass is used to query the belvis Api and retrieve data, including the authentication part.RepositoryThe git repository is hosted on github:http://www.github.com/rwijtvliet/belvysDevelopingThis project usesblackto format code andflake8for linting. We also supportpre-committo ensure these have been run. To configure your local environment please install these development dependencies and set up the commit hooks.poetryinstall--withdev,testpre-commitinstallDevelopment is done on feature branches, which are merged back intomastervia pull request.Before creating a pull request:Merge the current state ofmasterinto the feature branch;Increase the version number (by runningpoetry version major|minor|patch) of the feature branch.PublishingTo publish the current state ofmaster, run thecreate_tag.shscript. It will create a tag from the version number and push it to github. (The version number must be unequal to a previous tag, which is automatically true if the development is only done in feature branches, and every feature branch increases the version number.) On github, a release can be drafted from the tag.DisclaimerThis package interacts with the Belvis software which is delevoped by Kisters. This package is not written by, maintained by, or associated with Kisters in any way.
Package: bem
BEM :  beyond the exoplanet mass-radius relation with random forestPredicting the radius of exoplanets based on its planetary and stellar parametersBranca Edmée MarquesA portuguese scientist who worked on nuclear physics in France with Marie CurieTo install bempipinstallbemorgitclonehttps://github.com/soleneulmer/bem.gitcdbem
pythonsetup.pyinstallA simple decision treeto predict exoplanet radiusHow to run bem:1. Load dataset and model# Load exoplanet and solar system planets datasetdataset=bem.load_dataset()# Plot the dataset radius as a function of mass and equilibrium temperaturebem.plot_dataset(dataset)# Build the random forest model and predict radius of the datasetregr,y_test_predict,_,train_test_sets=bem.random_forest_regression(dataset)2. Predict the radius of your planetmy_planet = [planetary_mass,
semi major axis,
eccentricity,
stellar radius,
stellar effective temperature,
stellar mass]or with error barsmy_planet = [planetary_mass, error,
semi major axis, error
eccentricity, error,
stellar radius, error,
stellar effective temperature, error,
stellar mass, error]# Predict a new radiusradius,my_pred_planet=bem.predict_radius(my_planet=np.array([[1.63,0.034,0.02,0.337,3505.0,0.342]]),my_name=np.array(['GJ 357 b']),regr=regr,jupiter_mass=False,error_bar=False)# If error_bar is True# print('Radius: ', radius[0][0], '+-', radius[1])3. Compute error bars for the radius predictions# Load exoplanet and solar system planets dataset with uncertaintiesdataset_errors=bem.load_dataset_errors()# Compute the error bars for the test set planetsradii_test_output_error,_=bem.computing_errorbars(regr,dataset_errors,train_test_sets)# Plot the test set, true radius versus RF predicted radiusbem.plot_true_predicted(train_test_sets,y_test_predict,radii_test_output_error)4. Radial velocity dataset# Load the radial velocity datasetdataset_rv=bem.load_dataset_RV()# Predict the radius of the RV datasetradii_RV_RF=regr.predict(dataset_rv)# Plot the predictions of the RV datasetbem.plot_dataset(dataset_rv,predicted_radii=radii_RV_RF,rv=True)5. Diagnostic plots# Plot the learning curvebem.plot_learning_curve(regr,dataset)# Plot the validation curvesbem.plot_validation_curves(regr,dataset,name='features')bem.plot_validation_curves(regr,dataset,name='tree')bem.plot_validation_curves(regr,dataset,name='depth')6. LIME explanationssee theirgithub# Explain the RF predictions# of the exoplanets from the test setbem.plot_LIME_predictions(regr,dataset,train_test_sets)# LIME explanation for your planet# in this case GJ 357 bbem.plot_LIME_predictions(regr,dataset,train_test_sets,my_pred_planet=my_pred_planet,my_true_radius=1.166)
Package: be-micropython-nextion
MicroPython Nextion libraryMicroPython Nextion libraryGeneralPorted library to interact withNextion serial displays,
based on theITEAD Arduino Nextionlibrary.InstallationInstall required toolsPython3 must be installed on your system. Check the current Python version
with the following commandpython--version
python3--versionDepending on which commandPython 3.x.y(with x.y as some numbers) is
returned, use that command to proceed.python3-mvenv.venvsource.venv/bin/activate

pipinstall-rrequirements.txtSetupInstall package with upipConnect the MicroPython device to a network (if possible)importnetworkstation=network.WLAN(network.STA_IF)station.active(True)station.connect('SSID','PASSWORD')station.isconnected()GeneralInstall the latest package version of this lib on the MicroPython deviceimportmipmip.install("github:brainelectronics/micropython-nextion")For MicroPython versions below 1.19.1 use theupippackage instead ofmipimportupipupip.install('micropython-nextion')Specific versionInstall a specific, fixed package version of this lib on the MicroPython deviceimportmip# install a verions of a specific branchmip.install("github:brainelectronics/micropython-nextion",version="feature/add-mip-package-file")# install a tag versionmip.install("github:brainelectronics/micropython-nextion",version="0.15.0")For MicroPython versions below 1.19.1 use theupippackage instead ofmipimportupipupip.install('micropython-nextion')Test versionInstall a specific release candidate version uploaded toTest Python Package Indexon every PR on the
MicroPython device. If no specific version is set, the latest stable version
will be used.importmipmip.install("github:brainelectronics/micropython-nextion",version="0.15.0-rc1.dev29")For MicroPython versions below 1.19.1 use theupippackage instead ofmipimportupip# overwrite index_urls to only take artifacts from test.pypi.orgupip.index_urls=['https://test.pypi.org/pypi']upip.install('micropython-nextion')See alsobrainelectronics Test PyPi Server in Dockerfor a test PyPi server running on Docker.ManuallyUpload files to boardCopy the module to the MicroPython board and import them as shown below
usingRemote MicroPython shellOpen the remote shell with the following command. Additionally use-b 115200in case no CP210x is used but a CH34x.rshell--port/dev/tty.SLAB_USBtoUART--editornanoPerform the following command inside thershellto copy all files and
folders to the devicemkdir/pyboard/lib
mkdir/pyboard/lib/nextion

cpnextion/*/pyboard/lib/nextion

cpexamples/basic/main.py/pyboard
cpexamples/boot.py/pyboardUsageUse one of theexamplesto get started. Read also theexamples READMEto find all supported elementsCreditsBig thank you toITEAD Studiofor the implementation
of the Arduino library.
Package: bemo
Bemo(back-end mock) - it’s simple way to mock your back-end from
webdriver UI tests.InstallationInstallbemousingpip:$ pip install bemo…or installbemorunning command below if you want to use Python
2.7:$ pip install bemo[py2x]Enjoy!Usagefrom selenium import webdriver
from selene.conditions import text
from selene.tools import set_driver, visit, s

import bemo


wd = webdriver.Firefox()
set_driver(wd)

visit('https://accounts.google.com/SignUp')

with bemo.Session(wd=wd) as session:
    handler = session.handle('InputValidator', body={
        'input01': {
            'Valid': 'false',
            'ErrorMessage': 'Error!',
            'Errors': {
                'GmailAddress': 'It work.',
            },
            'ErrorData': [],
        },
        'Locale': 'ru',
    })
    session.inject()

    s('#GmailAddress').set('John Snow')
    s('#submitbutton').click()

    s('#errormsg_0_GmailAddress').should_have(text('It work.'))

    handler.assert_called_once_with({
        'method': 'POST',
        'url': 'InputValidator?resource=SignUp',
    })TestingJust runtoxto test package.Licensebemois licensed under the MIT license. See the license file for
details.
Package: be-modbus-wrapper
BE Modbus WrapperCustom brainelectronics python modbus wrapperGeneralCustom brainelectronics specific python modbus wrapper.InstallationUsageContributingUnittestsCreditsInstallationpipinstallbe-modbus-wrapperUsagefrombe_modbus_wrapperimportModbusWrapperContributingUnittestsRun the unittests locally with the following command after installing this
package in a virtual environment# run all testsnose2--configtests/unittest.cfg# run only one specific testsnose2tests.test_modbus_wrapper.TestModbusWrapper.test_load_modbus_registers_fileGenerate the coverage files withpythoncreate_report_dirs.py
coveragehtmlThe coverage report is placed atbe-modbus-wrapper/reports/coverage/html/index.htmlCreditsBased on thePyPa sample project.
Package: bemplt
Forked fromhttps://github.com/dy1901/bempltECG plotPlot standard ECG chart from data.Support both direct plotting and plotting SVG preview in browser (currently only works on mac)Support saving PNG and SVG to diskSupport customer defined lead orderSupport customer defined column countInstallpip install bempltNoticeInput data should be m x n matrix, which m is lead count of ECG and n is length of single lead signal.Default sample rate is 500 Hz.ExamplePlot 12 lead ECGparams:parameterdescriptionecgm x n ECG signal data, which m is number of leads and n is length of signal.sample_rateSample rate of the signal.titleTitle which will be shown on top off chartlead_indexLead name array in the same order of ecg, will be shown on left of signal plot, defaults to ['I', 'II', 'III', 'aVR', 'aVL', 'aVF', 'V1', 'V2', 'V3', 'V4', 'V5', 'V6']lead_orderLead display ordercolumnsdisplay columns, defaults to 2styledisplay style, defaults to None, can be 'bw' which means black whiterow_heighthow many grid should a lead signal haveshow_lead_nameshow lead nameshow_gridshow gridshow_separate_lineshow separate lineimport bemplt

ecg = load_data() # load data should be implemented by yourself 
bemplt.plot(ecg, sample_rate = 500, title = 'ECG 12')
bemplt.show()Plot single lead ECGimport bemplt

ecg = load_data() # load data should be implemented by yourself 
bemplt.plot_1(ecg[1], sample_rate=500, title = 'ECG')
bemplt.show()Save result as pngimport bemplt

ecg = load_data() # load data should be implemented by yourself 
bemplt.plot_12(ecg, sample_rate = 500, title = 'ECG 12')
bemplt.save_as_png('example_ecg','tmp/')License: MIT
Package: bemserver-api-client
BEMServer is a free Building Energy Management software platform.Its purpose is to store data collected in buildings and produce useful information such as performance indicators or alerts.This package is a client forBEMServer API, based onrequests.API client entry pointsAPI resourcesAPI client entry pointGeneral/about/about/users/users/users_by_user_groups/user_by_user_groups/user_groups/user_groups/user_groups_by_campaigns/user_groups_by_campaigns/user_groups_by_campaign_scopes/user_groups_by_campaign_scopes/campaigns/campaigns/campaign_scopes/campaign_scopes/io/ioStructural elements/sites/sites/buildings/buildings/storeys/storeys/spaces/spaces/zones/zones/structural_element_properties/structural_element_properties/site_properties/site_properties/site_property_data/site_property_data/building_properties/building_properties/building_property_data/building_property_data/storey_properties/storey_properties/storey_property_data/storey_property_data/space_properties/space_properties/space_property_data/space_property_data/zone_properties/zone_properties/zone_property_data/zone_property_dataTimeseries/timeseries/timeseries/timeseries_properties/timeseries_properties/timeseries_property_data/timeseries_property_data/timeseries_by_sites/timeseries_by_sites/timeseries_by_buildings/timeseries_by_buildings/timeseries_by_storeys/timeseries_by_storeys/timeseries_by_spaces/timeseries_by_spaces/timeseries_by_zones/timeseries_by_zones/timeseries_by_events/timeseries_by_events/weather_timeseries_by_sites/weather_ts_by_sitesTimeseries data/timeseries_data_states/timeseries_datastates/timeseries_data/timeseries_dataAnalysis/analysis/analysis/energies/energies/energy_end_uses/energy_end_uses/energy_consumption_timeseries_by_sites/energy_cons_ts_by_sites/energy_consumption_timeseries_by_buildings/energy_cons_ts_by_buildings/energy_production_technologies/energy_prod_technologies/energy_production_timeseries_by_sites/energy_prod_ts_by_sites/energy_production_timeseries_by_buildings/energy_prod_ts_by_buildingsEvents andnotifications/events/events/events_by_sites/event_by_sites/events_by_buildings/event_by_buildings/events_by_storeys/event_by_storeys/events_by_spaces/event_by_spaces/events_by_zones/event_by_zones/event_categories/event_categories/event_categories_by_users/event_categories_by_users/notifications/notificationsServices/st_cleanups_by_campaigns/st_cleanup_by_campaign/st_cleanups_by_timeseries/st_cleanup_by_timeseries/st_check_missings_by_campaigns/st_check_missing_by_campaign/st_check_outliers_by_campaigns/st_check_outlier_by_campaign/st_download_weather_data_by_sites/st_download_weather_by_site/st_download_weather_forecast_data_by_sites/st_download_weather_forecast_by_site
Package: bemserver-ui
BEMServer is a free Building Energy Management software platform.Its purpose is to store data collected in buildings and produce useful information such as performance indicators or alerts.InstallationSettingsFlask custom var config available:BEMSERVER_API_HOST = “localhost”API host name (and port)BEMSERVER_API_USE_SSL = TrueIs API published through SSL?BEMSERVER_API_AUTH_METHOD = “http_basic”API authentication methodBEMSERVER_UI_TIMEZONE_NAME = “UTC”Default application timezone name, when not overrided campaign timezoneBEMSERVER_UI_NOTIFICATION_UPDATER_DELAY = 60000Delay, in seconds, between each check of new notificationsBEMSERVER_UI_USER_GUIDE_URL = https://bemserver-docs.readthedocs.io/en/latest/user_guide.htmlUser guide URL(optional)BEMSERVER_UI_PARTNERS_FILE = NoneAbsolute path of json file that describes the project’s partnersExample ofBEMSERVER_UI_PARTNERS_FILEfile structure:[
    {
        "Nobatek/INEF4": {
            "use_as_project_logo": true,
            "url": "https://nobatek.inef4.com",
            "logo": {
                "style": "height: 50px;",
                "src": "https://www.nobatek.inef4.com/wp-content/uploads/2017/08/logo-transp-2.png"
            }
        }
    },
    {
        "Flask": {
            "url": "https://flask.palletsprojects.com/en/latest/",
            "logo": {
                "style": "height: 50px;",
                "src": "https://flask.palletsprojects.com/en/latest/_images/flask-logo.png"
            },
            "text": "The Python micro framework for building web applications."
        }
    }
](optional)BEMSERVER_UI_PLUGINS = NoneList of absolute file paths that locate the__init__.pyfile from each UI plugin package to load
Package: bemval
Basic Email Validator (bemval)Super simple and/or basic email validator without using external libraries (i.e. just python std functions)InstallationRun the following command in your terminal:pip3 install -U bemvalHow to usefrombemval.validatorimportEmailValidatorvalidator=EmailValidator()valid,errors=validator.validate('is.this-an@email.com')print('Is a valid email? ->%s'%('YES'ifvalidelse'NO'))iflen(errors)>0:print('Errors:\n-%s'%'\n- '.join(errors))