Saravanan666/pypi-org huggingface dataset:
Package: exp-mixture-model
exp_mixture_modelMaximum likelihood estimation and model selection for the exponential mixture model (i.e., mixture of exponential distributions)When you use this code, please cite the following paper:Makoto Okada, Kenji Yamanishi, Naoki Masuda.
Long-tailed distributions of inter-event times as mixtures of exponential distributions.
arXiv:19xx.xxxxxInstallationexp_mixture_modelis hosted on PyPI. So, one can install it by runningpipinstallexp_mixture_modelIf you want to install from source, clone the exp_mixture_model git repository by runninggitclonehttps://github.com/naokimas/exp_mixture_model.gitThen, navigate to the top-level of the cloned directory and runpythonsetup.pyinstallYou can test our code by runningpythonsetup.pytestIf you use Anaconda, you may install required packages by runningcondainstall--filerequirements.txtQuick UseFit an EMM to data stored in a file (e.g. sample.dat) by runningpythonemmfit.py-fsample.dat-k10'10' is the initial number of components.'sample.dat' is provided as part of this package. It is synthetic data that we generated by runningfromemmimportgenerate_emmx=generate_emm(1000,10)To select the best model among EMMs with different numbers of components, don't specify 'k' and instead specify the model selection criterion using '-c' as follows.pythonemmfit.py-fsample.dat-cDNMLOne can specify either 'marginal_log_likelihood', 'joint_log_likelihood', 'AIC', 'BIC', 'AIC_LVC', 'BIC_LVC', 'NML_LVC', or 'DNML' as the argument of '-c'.Default is 'DNML'.Check details of the usage by runningpythonemmfit.py--helpUsageFit an EMM to data by runningfromexp_mixture_modelimportEMMx=[1.5,2.3,...]# data can be either a list or numpy array## Alternatively, one can load data from a file using numpy as follows.## import numpy as np# x = np.loadtxt("sample.dat")#model=EMM()pi,mu=model.fit(x)# estimate the parametersmodel.print_result()# print 'k_final' (i.e., the estimated effective number of components) and the estimated parametersmodel.plot_survival_probability()# plot the survival probability (= cumulative complementary distribution function) for the estimated EMM and the given data 'x'.Select the number of components based on a model selection criterion by runningfromexp_mixture_modelimportEMMsx=[1.5,2.3,...]emms=EMMs()emms.fit(x)# fit EMMs with different values of 'k', i.e., the number of components. The default uses 13 values of 'k'. This process is computationally heavy.best_model=emms.select('DNML')# select the best number of components under the 'DNML' criterion. One can specify either 'marginal_log_likelihood', 'joint_log_likelihood', 'AIC', 'BIC', 'AIC_LVC', 'BIC_LVC', 'NML_LVC', or 'DNML' as the argument of 'emms.select'.emms.print_result_table()# print the values of 'k_final', likelihoods, and 'DNML' for each 'k' valuebest_model.print_result()# print 'k_final' and the estimated parameter values of the selected EMM
Package: expnbk
Experiment_Notebookexpnbkprovides a class for creating an experiment with its own results directory that automatically contains a copy of the code used to run the experiment. Super useful for reproducibility.InstallationTo install Experiment_Notebook, run this command in your terminal:$pipinstall-UexpnbkThis is the preferred method to install Experiment_Notebook, as it will always install the most recent stable release.If you don't havepipinstalled, theseinstallation instructionscan guide you through the process.Quick StartTheexpnbkpackage provides a classExperiment. Upon instantiation,  it takes a snapshot of the current working directory and saves all files into aresults/current_timefolder within the current directory (seeUsagefor variations). It also provides functions that automatically save figures to the same output directory. Check out the following example and you shall see similar changes in your directories.$ tree
    .
    ├── file1        
    └── dir1
        └── file2>>>fromexpnbkimportExperiment>>>exp=Experiment()>>>fig=exp.figure()>>>fig.savefig("image1.png")$ tree
    .
    ├── file1
    ├── dir1
    │   └── file2
    └── results
        └── 2020-12-31_123006
            ├── <project_name>
            │   ├── file1
            │   └── dir1
            │       └── file2
            └── image1.pngUsageImport theexpnkpackage:>>>fromexpnbkimportExperimentCreate anExperimentclass with attributes:>>>exp=Experiment(expname='some_experiemnt',results_dir='path_to_results_directory',copy_code=True,ignore_dirs=None):expname: str, optionalA name identifying the type of experiment run.results_dir: str, optionalPath to the desired results directory for storing experiment details.copy_code: bool, optionalShould the experiment results include the code used to generate them?ignore_dirs: list(str), optionalAny directories that should not be copied with the code.Save figures to the same output directory as above:>>>fig=exp.figure()//Getamatplotlibfigure>>>fig.savefig("image1.png")//`savefig`functionwillputitintheexperimentdirectory
Package: exp-notifier
Experiment NotifierUsageSlack notificationsThe experiment notifier assumes that for sending messages you haveSLACK_BOT_TOKENeither in:current working directory stored in./.slack_bot_tokenfileor at your home dir in the file$HOME/.slack_bot_tokenor inSLACK_BOT_TOKENvariableNote, that storing the token in a file with600permissions is the recommended method.CLI usage$ sleep 9999; ntf --channel exp-notifier --text "Done sleeping $? Your long running task just finished!"Python usagefrom notifier.context import SlackMessage

with SlackMessage(channel='exp-notifier') as sm:
  sm.write('test from python')InstallationSetup and install the appSet permissions/scopes tochat:write,identityb:basic,groups:write,im:writeRememberSLACK_BOT_TOKENSetup Socket mode.RememberSLACK_APP_TOKENAdd your appAPPNAME e.g. exp-notifierto slack channel#CHANNEL e.g. #exp-notifierInstall the client library and thentfpython scriptpip install exp-notifierDevelopment# change to git root directory of source code
pip install -e '.[dev]'FeaturesSending text message to a channel under the app name.Sending a text instant message (IM).Attach file (log file) to a messageAttach a picture / sound file to be played backSend a text message and mention a personBlock code execution, present poll to a user, continue based on the poll answer.Pull requests are welcome!
Package: expon
exponExperiment tool for deep learning (PyTorch).featuresGit checkexpon could automatically check the git status of current working directory.In each experiment, it first check the git status (raise expception if the working tree is not clean), and save the current git commit id for code restore and experiment reproduce.Experiment save.expon save the all the experment information including the defined metrics, config, experiment seed and perhaps metric visualization (like loss-epochs) in one place. The output supports markdown and html form.demofrom expon import EXP, Params, Metric

# init. The save directory will be './EXP/run/demo/'
exp = EXP(workspace = 'run', exp_name='demo', exp_description='this is a demo')

# experiment params
params = expon.Params()
params.lamb = 1
params.learning_rate = 0.001
params.batch_size = 512

exp.set_params(params)

# experiment metrics
loss = expon.Metric('loss', 'epoch', draw=True)
acc = expon.Metric('acc', draw=True)
exp.add_metric(loss)
exp.add_metric(acc)

# expon will randomly set the random, numpy and torch seed in [0, 999].
exp.set_seed()

# assume 100 epochs
for i in range(0, 100):
    loss.update(1-0.01*i)
    acc.update(0.01*i)

# add addition information
exp.add_info({'final acc': 0.91})

# save the experiment to one place
exp.save(output_format='md', show_metric=False)
Package: exponential-counter
exponential_counterTable of ContentsUsageInstallationLicenseUsagefrom exponential_counter import ExponentialCounter, LinearCounter
counter = LinearCounter(max_value=4)
values = [counter() for i in range(8)]
# [0, 1, 2, 3, 4, 4, 4, 4]

counter = ExponentialCounter(start=4, step=3, max_value=32)
values = [counter() for i in range(6)]
# [4, 12, 32, 32, 32, 32]Installationpip install exponential-counterLicenseexponential-counteris distributed under the terms of theMITlicense.
Package: exponent-server-sdk
exponent-server-sdk-pythonThis repo is maintained by Expo's awesome community :heart_eyes:! So, if you have problems with the code in this repository, please feel free to open an issue, and make a PR. Thanks!Installationpip install exponent_server_sdkUsageUse to send push notifications to Exponent Experiences from a Python server.Full documentationon the API is available if you want to dive into the details.Here's an example on how to use this with retries and reporting viapyrollbar.fromexponent_server_sdkimport(DeviceNotRegisteredError,PushClient,PushMessage,PushResponseError,PushServerError,)fromrequests.exceptionsimportConnectionError,HTTPError# Basic arguments. You should extend this function with the push features you# want to use, or simply pass in a `PushMessage` object.defsend_push_message(token,message,extra=None):try:response=PushClient().publish(PushMessage(to=token,body=message,data=extra))exceptPushServerErrorasexc:# Encountered some likely formatting/validation error.rollbar.report_exc_info(extra_data={'token':token,'message':message,'extra':extra,'errors':exc.errors,'response_data':exc.response_data,})raiseexcept(ConnectionError,HTTPError)asexc:# Encountered some Connection or HTTP error - retry a few times in# case it is transient.rollbar.report_exc_info(extra_data={'token':token,'message':message,'extra':extra})raiseself.retry(exc=exc)try:# We got a response back, but we don't know whether it's an error yet.# This call raises errors so we can handle them with normal exception# flows.response.validate_response()exceptDeviceNotRegisteredError:# Mark the push token as inactivefromnotifications.modelsimportPushTokenPushToken.objects.filter(token=token).update(active=False)exceptPushTicketErrorasexc:# Encountered some other per-notification error.rollbar.report_exc_info(extra_data={'token':token,'message':message,'extra':extra,'push_response':exc.push_response._asdict(),})raiseself.retry(exc=exc)
Package: exponot
Reference implementation of crytographic API of Exposure Notification system based on documents shared by Apple/Google.This reference implementation usespycryptodomeandcryptographylibraries.Referenceshttps://www.apple.com/covid19/contacttracing/https://covid19-static.cdn-apple.com/applications/covid19/current/static/contact-tracing/pdf/ExposureNotification-CryptographySpecificationv1.2.pdfhttps://www.pycryptodome.org/en/latest/https://cryptography.io/en/latest/https://github.com/DP-3T/documentshttps://sunblaze-ucb.github.io/privacy/papers/epione.pdf
Package: expool
ExpoolSimple asynchronous execution pool primitive.
You can think of it as of athreading.ThreadPoolfor coroutines.UsageimportasynciofromexpoolimportExecutionPoolSimpleasyncdefmain():pool=ExecutionPoolSimple(size=3)# size parameter sets the max amount of concurrent coroutinesasyncdefsome_job():awaitasyncio.sleep(3)awaitpool.add(some_job)# Returns immediately if the pool is not full.awaitpool.add(some_job)# If the pool max size is reached, waits# until one of the pool's coroutines finishes.awaitpool.close()# wait for all of the jobs to finish.You may also set a timeout for.close()method:awaitpool.close(timeout=10)If the timeout is reached,ExecutionPoolSimplecancels all remaining coroutines and returns.You may also want to check outExecutionPooldecorators:ExecutionPoolMonitored- a pool with periodical logging of the jobs inside the pool;ExecutionPoolCapped- a pool with a limited lifespan.Installationpipinstallexpool
Package: export
exportControl module exportsAboutThis library dynamically generates an__all__attribute for modulesInstallpip install exportUsagePrivate by DefaultDoesexport objects markedpublic,doesn'texport everything else# lib.pyimportexportexport.init(default=export.PRIVATE)@export.publicdeffoo():passdefbar():passdefbaz():pass>>>importlib>>>>>>lib.__all__['foo']Public by DefaultDoesn'texport objects markedprivate,doesexport everything else# lib.pyimportexportexport.init(default=export.PUBLIC)deffoo():pass@export.privatedefbar():pass@export.privatedefbaz():pass>>>importlib>>>>>>lib.__all__['export','foo']
Package: export-ast
Export ASTExport a Python abstract syntax tree to a dictionary/json.Usagepipinstallexport-astimportastfromexport_astimportast_to_dictcode="print('Hello World!')"tree=ast.parse(code)d=ast_to_dict(tree)# Or as AST string (indent must be >0)...tree_str=ast.dump(tree,indent=2)d=ast_to_dict(tree_str)ExamplePython Codedefhello_world():print('Hello World!')if__name__=='__main__':hello_world()Abstract Syntax TreeModule(body=[FunctionDef(name='hello_world',args=arguments(posonlyargs=[],args=[],kwonlyargs=[],kw_defaults=[],defaults=[]),body=[Expr(value=Call(func=Name(id='print',ctx=Load()),args=[Constant(value='Hello World!')],keywords=[]))],decorator_list=[]),If(test=Compare(left=Name(id='__name__',ctx=Load()),ops=[Eq()],comparators=[Constant(value='__main__')]),body=[Expr(value=Call(func=Name(id='hello_world',ctx=Load()),args=[],keywords=[]))],orelse=[])],type_ignores=[])Dictionary{"Module":{"body":[{"FunctionDef":{"name":"hello_world","args":{"arguments":{"posonlyargs":[],"args":[],"kwonlyargs":[],"kw_defaults":[],"defaults":[]}},"body":[{"Expr":{"value":{"Call":{"func":{"Name":{"id":"print","ctx":"Load"}},"args":[{"Constant":{"value":"Hello World!"}}],"keywords":[]}}}}],"decorator_list":[]}},{"If":{"test":{"Compare":{"left":{"Name":{"id":"__name__","ctx":"Load"}},"ops":["Eq"],"comparators":[{"Constant":{"value":"__main__"}}]}},"body":[{"Expr":{"value":{"Call":{"func":{"Name":{"id":"hello_world","ctx":"Load"}},"args":[],"keywords":[]}}}}],"orelse":[]}}],"type_ignores":[]}}
Package: exportcomments
ExportComments API for PythonOfficial Python client for theExportComments API. Build and run machine learning models for language processing from your Python apps.InstallationYou can use pip to install the library:$pipinstallexportcommentsAlternatively, you can just clone the repository and run the setup.py script:$pythonsetup.pyinstallUsageBefore making requests to the API, you need to create an instance of the ExportComments client. You will have to use youraccount API Key:fromexportcommentsimportExportComments# Instantiate the client Using your API keyex=ExportComments('<YOUR API TOKEN HERE>')Usage ExamplesFrom the ExportComments client instance, you can call any endpoint:Check exportresponse=ex.exports.check(guid='dfd6a2f2-5579-421f-96ac-98993d0edea1')ResponsesThe response object returned by every endpoint call is aExportCommentsResponseobject. Thebodyattribute has the parsed response from the API:print(response.body)# =>  {# =>      "code": 200,# =>      "success": true,# =>      "data": {# =>          "url": "https://www.instagram.com/p/1234567",# =>          "guid": "2cfb0b9d-7633-4341-a702-cb889fe549eb",# =>          "status": "queueing",# =>          "replies": false,# =>          "fileName": "comments5ea4b4d5a7602-1325511884314646.xlsx",# =>          "fileNameRAW": "08b735760a5a40eb1fd70ca16e97aed3-2e0916fe-de86-4422-8449-fb608cbe5221.json",# =>          "total": 0,# =>          "totalExported": 0,# =>          "retry": 0,# =>          "error": null,# =>          "repliesCount": 0,# =>          "twitterType": null,# =>          "timezone": "UTC",# =>          "createdAt": "2016-08-26T07:32:09+00:00",# =>          "updatedAt": "2016-08-26T07:32:09+00:00",# =>          "exportedAt": "",# =>          "downloadUrl": "/exports/comments5ea4b4d5a7602-1325511884314646.xlsx",# =>          "rawUrl": "/exports/08b735760a5a40eb1fd70ca16e97aed3-2e0916fe-de86-4422-8449-fb608cbe5221.json"# =>      },# =>      "message": null# =>  }Create exportresponse=ex.exports.create(url='https://www.instagram.com/p/1234567',replies='false',twitterType=None)ErrorsEndpoint calls may raise exceptions. Here is an example on how to handle them:fromexportcomments.exceptionsimportPlanQueryLimitError,ExportCommentsExceptiontry:response=ex.exports.create(url='https://www.instagram.com/p/1234567',replies='false',twitterType=None)exceptPlanQueryLimitErrorase:# No monthly queries left# e.response contains the ExportCommentsResponse objectprint(e.error_code,e.detail)exceptExportCommentsException:raiseAvailable exceptions:classDescriptionExportCommentsExceptionBase class for every exception below.RequestParamsErrorAn invalid parameter was sent. Check the exception message or response object for more information.AuthenticationErrorAuthentication failed, usually because an invalid token was provided. Check the exception message.ForbiddenErrorYou don't have permissions to perform the action on the given resource.PlanRateLimitErrorYou have sent too many requests in the last minute.ConcurrencyRateLimitErrorYou have sent too many requests in the last second.
Package: export-dynamodb
Export DynamoDb CliOverviewexport-dynamodb cli scan sequentially through all your dynamodb items. it supports to export to
either csv or json format.PrerequisiteYou must have at least Python 3.6 to run export-dynamodb cli tool.export-dynamodb does not support to authenticate with AWS. You must be able to setAWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYto your environment variable. Referhttps://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.htmlto learn how you can
set these keys to your environment.# Install export-dynamodb$pipinstallexport-dynamodb# List of all export-dynamodb cli options.$export-dynamodb--help# Export table and write to TABLE_NAME.csv file$export-dynamodb-tTABLE_NAME-fcsv# Export table and write to output.csv file$export-dynamodb-tTABLE_NAME-fcsv-ooutput.csv
Package: exporteer-evernote-osx
exporteer_evernote_osxThis is a very simple tool for exporting data from Evernote.
It uses AppleScript to tell the Mac Evernote app to perform an export.UsageInstall:Install python3 and pippip3 install exporteer_evernote_osxBefore running an export, you might wish to ensure the app has synced with the cloud:exporteer_evernote_osxsyncTo export all your notes to HTML files, with each notebook in a separate subdirectory:exporteer_evernote_osxexport-nTARGET_DIRTo export all notes matching a query (for instance, notes created this year) to an enex file:exporteer_evernote_osxexport-Eq'created:year'TARGET_FILE.enexLinks between notesEvernote's export functionality does not embed the note's unique identifier, or the name of the notebook to which the note belongs, into the HTML or enex files.
Also, any links between notes are exported as links into the Evernote app, rather than links between the files.To address these limitations, you can run this tool in 'enhanced' mode:exporteer_evernote_osxexport-eTARGET_DIRIn this mode, the tool modifies the HTML files after export to add extra metadata fields containing the notebook name and note URL.NOTE: This can be very slow and also bog down your computer.
I suggest exporting the notes in batches of at most a few hundred, using the-qparameter, and restarting the Evernote app between each batch.
Then you can combine them into one folder like this:exporteer_evernote_osxmergeTARGET_DIRFIRST_BATCH_DIRSECOND_BATCH_DIR..Finally, you can replace theevernote://links in the HTML files with links to the corresponding exported files, by using therelinkcommand:exporteer_evernote_osxrelinkTARGET_DIRThis may take a while with large numbers of notes - my current implementation is pretty inefficient.More documentationFull command list and options can be seen in thedoc folder.DevelopmentSetup:Install python3 and pipClone the repoI recommend creating a venv:cdexporteer_evernote_osx
python3-mvenvvenvsourcevenv/bin/activateInstall dependencies:pipinstall.
pipinstall-rrequirements-dev.txtTo run integration tests (these assume you've created at least a couple notes this month in a couple different notebooks):PYTHONPATH=srcpytest(Overriding PYTHONPATH as shown ensures the tests run against the code in the src/ directory rather than the installed copy of the package.)To run the CLI:PYTHONPATH=srcpython-mexporteer_evernote_osx...ContributingBug reports and pull requests are welcome on GitHub athttps://github.com/brokensandals/exporteer_evernote_osx.LicenseThis is available as open source under the terms of theMIT License.
Package: exporteer-todoist
exporteer_todoistThis is a very simple tool for exporting data from Todoist via their API.Getting StartedInstall python3 and pippip install exporteer_todoistLook up your API tokenTo download the latest backup (i.e., what you would get by going to 'Backups' in 'Settings' in Todoist) as a zip file:exportTODOIST_API_TOKEN=your_token_here
exporteer_todoistlatest_backup>backup.zipTo download JSON representing afull sync:exportTODOIST_API_TOKEN=your_token_here
exporteer_todoistfull_sync>backup.jsonNote that the latter is essentially equivalent to just running this curl command:curlhttps://api.todoist.com/sync/v8/sync\-dtoken=your_token_here\-dsync_token='*'\-dresource_types='["all"]'\>backup.jsonDevelopmentSetup:Install python3 and pipClone the repoI recommend creating a venv:cdexporteer_todoist
python3-mvenvvenvsourcevenv/bin/activateInstall dependencies:pipinstall.
pipinstall-rrequirements-dev.txtTo run integration tests (these will download real data from your Todoist account, so a token is required):exportTODOIST_API_TOKEN=your_api_tokenPYTHONPATH=srcpytest(Overriding PYTHONPATH as shown ensures the tests run against the code in the src/ directory rather than the installed copy of the package.)To run the CLI:exportTODOIST_API_TOKEN=your_api_tokenPYTHONPATH=srcpython-mexporteer_todoist...ContributingBug reports and pull requests are welcome on GitHub athttps://github.com/brokensandals/exporteer_todoist.LicenseThis is available as open source under the terms of theMIT License.
Package: export-elements
# export-elements[![code-climate-image]][code-climate]
[![circle-ci-image]][circle-ci]
[![codecov-image]][codecov]
[![gemnasium-image]][gemnasium]Wrapper around govuk elements for use in Directory apps in Department for International Trade.—## Installation`shell pip installexport-elements`## Development$ git clonehttps://github.com/uktrade/export-elements$ cd export-elements
$ npm install
$## Test$ make test # python tests
$ gulp test # javascript tests## DemoRun the following command then visithttp://localhost:3000$ gulp develop## Publish to PyPIThe package should be published to PyPI on merge to master. If you need to do it locally then get the credentials from rattic and add the environment variables to your host machine:Setting                     |————————— |DIRECTORY_PYPI_USERNAME     |DIRECTORY_PYPI_PASSWORD     |Then run the following command:make publish[code-climate-image]:https://codeclimate.com/github/uktrade/export-elements/badges/issue_count.svg[code-climate]:https://codeclimate.com/github/uktrade/export-elements[circle-ci-image]:https://circleci.com/gh/uktrade/export-elements/tree/master.svg?style=svg[circle-ci]:https://circleci.com/gh/uktrade/export-elements/tree/master[codecov-image]:https://codecov.io/gh/uktrade/export-elements/branch/master/graph/badge.svg[codecov]:https://codecov.io/gh/uktrade/export-elements[gemnasium-image]:https://gemnasium.com/badges/github.com/uktrade/export-elements.svg[gemnasium]:https://gemnasium.com/github.com/uktrade/export-elements