Saravanan666/pypi-org huggingface dataset:
Package: timeloop-ng
Timeloop-NGTimeloop-NG (for next generation) is a service that can be used to run periodic
tasks after a certain interval.It's the successor oftimeloopfrom
Sankalp Jonna as pull requests were never accepted.Each job runs on a separate thread and when the service is shut down, it waits
till all tasks currently being executed are completed.Installationpipinstalltimeloop-ngWriting jobsThe jobs run the first time after the first wait interval.importtimefromtimeloopimportTimeloopfromdatetimeimporttimedeltatl=Timeloop()@tl.job(interval=timedelta(seconds=2))defsample_job_every_2s():print("2s job current time :{}".format(time.ctime()))@tl.job(interval=timedelta(seconds=5))defsample_job_every_5s():print("5s job current time :{}".format(time.ctime()))@tl.job(interval=timedelta(seconds=10))defsample_job_every_10s():print("10s job current time :{}".format(time.ctime()))Jobs that only run a certain amount of timeBy default, all jobs run until they are stopped. At times you may want to run a job only once or twice.importtimefromtimeloopimportTimeloopfromdatetimeimporttimedeltatl=Timeloop()@tl.job(interval=timedelta(seconds=10),num_executions=2)defrun_me_twice_with_10s_pause():print("10s job current time :{}".format(time.ctime()))Jobs with a different initial intervalAt times, you want@tl.job(interval=timedelta(seconds=1),initial_delay=timedelta(seconds=10))defrun_after10s_and_then_every_second():print("job current time :{}".format(time.ctime()))@tl.job(interval=timedelta(seconds=1),num_executions=2,initial_delay=timedelta(seconds=10))defrun_after10s_and_then_after_1second_then_stop():print("job current time :{}".format(time.ctime()))Start time loop in separate threadBy default timeloop starts in a separate thread.Please do not forget to calltl.stopbefore exiting the program, Or else the jobs wont shut down gracefully.tl.start()whileTrue:try:time.sleep(1)exceptKeyboardInterrupt:tl.stop()breakStart time loop in main threadDoing this will automatically shut down the jobs gracefully when the program is killed, so no need to calltl.stoptl.start(block=True)AuthorSankalp Jonna (author of the original version)Christoph Becker akatuergeist
Package: timely
Python Timely=============Stopwatch interface for Python. Currently supports two modes: timing execution (:class:`Stopwatch`), and pausing the completion of a block of code until a specified time has elapsed :class:`Blocker`.Stopwatch usage---------------::with Stopwatch() as s:do_a()do_b()print s.duration() # time it took to execute do_a() and do_b()do_c()print s.duration() # time it took to execute do_a(), do_b(), and do_c()if s > 3: # comparators implicitly evaluate durationprint 'took longer than 3 seconds'Blocker usage-------------::with Blocker(3) as w:print 'Happens immediately!'time.sleep(1.5)  # executes immediately# ... we wait here until 3 seconds have passedprint '3 seconds have passed!'
Package: timelyOSC
timelyOSCOpen Sound Control library for Python 3InstallThese are generic installation instructions.To use, permanentlyThe quickest way to get started is to install the current release from PyPI:pip3 install --user timelyOSCTo use, temporarilyIf you prefer to keep .local clean, install to a virtualenv:python3 -m venv venvname
venvname/bin/pip install timelyOSC
. venvname/bin/activateTo developFirst clone the repo using HTTP or SSH:git clone https://github.com/combatopera/timelyOSC.git
git clone git@github.com:combatopera/timelyOSC.gitNow use pyven's pipify to create a setup.py, which pip can then use to install the project editably:python3 -m venv pyvenvenv
pyvenvenv/bin/pip install pyven
pyvenvenv/bin/pipify timelyOSC

python3 -m venv venvname
venvname/bin/pip install -e timelyOSC
. venvname/bin/activate
Package: timem
TimemA simple decorator to profile memory usage and time taken by python functionsInstallpip install timemUsageIn example.py:fromtimemimportprofile@profiledefisPal(s):returns==s[::-1]print(isPal("UwU"))Output:"isPal" took 10.012 ms to execute

Filename: example.py

Line #    Mem usage    Increment  Occurences   Line Contents
============================================================
    11     20.4 MiB     20.4 MiB           1       @profile
    12                                             def isPal(s):
    13     20.4 MiB      0.0 MiB           1           return s == s[::-1]


TrueSome configurations1. Only profile timefromtimemimportprofile@profile(memory=False)defisPalindromeWithDelay(s):importtimetime.sleep(3)returns==s[::-1]print(isPalindromeWithDelay("UwU"))Output:"isPal" took 10.028 ms to execute

True2. Only profile memoryfromtimemimportprofile@profile(timer=False)defisPalindrome(s):returns==s[::-1]print(isPalindrome("sdasdf"))OutputFilename: example.py

Line #    Mem usage    Increment  Occurences   Line Contents
============================================================
    11     20.6 MiB     20.6 MiB           1       @profile(timer=False)
    12                                             def isPal(s):
    13     20.6 MiB      0.0 MiB           1           return s == s[::-1]


True
Package: timemachines
timemachinesSimple prediction functions (documentedandassessed)Becausewhy notdo things inwalk-forward incrementalfashion withone line of code? Here yt is a vector or scalar, and we want to predict yt (or its first coordinate if a vector) three steps in advance.from timemachines.skaters.somepackage.somevariety import something as f
 for yt in y:
     xt, xt_std, s = f(y=yt, s=s, k=3)This emits a k-vector xt of forecasts, and corresponding k-vector xt_std of estimated standard errors. Seeskatersfor choices of somepackage, somevariety and something. You can also ensemble, compose, bootstrap and do other things with one line of code.See thedocs.Packages usedSkaters draw on functionality frompopular python time-series packageslikeriver,pydlm,tbats,pmdarima,statsmodels.tsa,neuralprophet, FacebookProphet,
Uber'sorbit, Facebook'sgreykiteand more. See thedocs.What's a "skater"?More abstractly:$$
f : (y_t, state; k) \mapsto ( [\hat{y}(t+1),\hat{y}(t+2),\dots,\hat{y}(t+k) ], [\sigma(t+1),\dots,\sigma(t+k)], posterior\ state))
$$where $\sigma(t+l)$ estimates the standard error of the prediction $\hat{y}(t+l)$.If you prefer an legitimate (i.e. stateful) state machine, seeFAQquestion 1.Skater function conventionsSeedocs/interfacefor description of skater inputs and outputs. Briefly:x, w, s = f(   y:Union[float,[float]],             # Contemporaneously observerd data, 
                                                     # ... including exogenous variables in y[1:], if any. 
            s=None,                                  # Prior state
            k:float=1,                               # Number of steps ahead to forecast. Typically integer. 
            a:[float]=None,                          # Variable(s) known in advance, or conditioning
            t:float=None,                            # Time of observation (epoch seconds)
            e:float=None,                            # Non-binding maximal computation time ("e for expiry"), in seconds
            r:float=None)                            # Hyper-parameters ("r" stands for for hype(r)-pa(r)amete(r)s)Contributions and capstone projectsSeeCONTRIBUTE.mdandgood first issues.See the suggested steps for acapstone project.Getting live helpFAQ.See the Slack invite on my user pagehere.Office hourshere.Learn how to deploy some of these models and try to win thedaily $125 prize.InstallinstructionsOh what a mess the Python timeseries ecosystem is. So packages are not installed by default. See the methodicalinstall instructionsand be incremental for best results. The infamousxkcd cartoonreally does describe the alternative quite well.CiteThanks@electronic{cottontimemachines,
        title = {{Timemachines: A Python Package for Creating and Assessing Autonomous Time-Series Prediction Algorithms}},
        year = {2021},
        author = {Peter Cotton},
        url = {https://github.com/microprediction/timemachines}
    }or somethinghere.
Package: timemap
Timemaprepository under renovationA python package to deal with location history files, such
as GMAPS takeout json.The main motivation behind this package is to allow simple analytics
based on where you have been, for example, how long did you spend
at the office over January?Supported providers:Google - takeout's jsonSettingsYou can customize the runtime parameters through a configuration file
or command line parameters (requires extension).Configuration FileThe configuration consist of a yaml file. All the items in it, will be
exposed as settings to your script.filepath:./.history.jsonstart:2019-03-01end:2019-03-31radius:200# in meterslatitude:44.434# in decimal formatlongitude:22.213# in decimal formatContributingFeel free to send me your pull requests
Package: timematic
timematicUtilities for working with datetime.Read the DocsInstallationpiptimematicis available onpip:pipinstalltimematicGitHubYou can also install the latest version of the code directly from GitHub:pipinstallgit+git://github.com/MicaelJarniac/timematicUsageFor more examples, see thefull documentation.fromtimematicimporttimematicContributingPull 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.More details can be found inCONTRIBUTING.Contributors ✨LicenseMITCreated fromcookiecutter-python-project.
Package: timeme
DescriptionThis decorator prints the running time that a function needed to complete.fromtimemeimporttimemefromtimeimportsleep@timemedeffunction(a,b):sleep(2)function(1,2)# 'function' ((1, 2), {}) 2.00 secInstallationThe package has been uploaded toPyPI, so you can install it with pip:pip install timeme
Package: timemg
Time-Mg - Time ManagerCopyright (c) 2018-2019 Jeremie DECOCK (http://www.jdhp.org)Web site:http://www.jdhp.org/projects_en.htmlSource code:https://github.com/jeremiedecock/timemgIssue tracker:https://github.com/jeremiedecock/timemg/issuesTime-Mg on PyPI:https://pypi.python.org/pypi/timemgTime-Mg on Anaconda Cloud:https://anaconda.org/jdhp/timemgDescriptionTime-Mg is an open source tool to manage time.WarningThis project is in beta stage.DependenciesPython >= 3.0Qt5 for PythonMatplotlibPandasInstallationGnu/LinuxYou can install, upgrade, uninstall Time-Mg with these commands (in a
terminal):pip install --pre timemg
pip install --upgrade timemg
pip uninstall timemgOr, if you have downloaded the Time-Mg source code:python3 setup.py installWindowsYou can install, upgrade, uninstall Time-Mg with these commands (in acommand prompt):py -m pip install --pre timemg
py -m pip install --upgrade timemg
py -m pip uninstall timemgOr, if you have downloaded the Time-Mg source code:py setup.py installMacOSXNote:The following installation procedure has been tested to work with Python
3.5 under MacOSX 10.9 (Mavericks).
It should also work with more recent MacOSX systems.You can install, upgrade, uninstall Time-Mg with these commands (in a
terminal):pip install --pre timemg
pip install --upgrade timemg
pip uninstall timemgOr, if you have downloaded the Time-Mg source code:python3 setup.py installTime-Mg requires Qt5 and its Python 3 bindings plus few additional
libraries to run.Bug reportsTo search for bugs or report them, please use the Time-Mg Bug Tracker at:https://github.com/jeremiedecock/timemg/issuesLicenseThis project is provided under the terms and conditions of theMIT License.
Package: timemon
1.0.0-dev (Next Release)Dropped support for Python 2.5.Added support for Python 3.2 and 3.3.Changed shebang lines in all files from using “python -u” to “python”.
All of the eventlisteners in this package use supervisor.childutils, which
does an explicit flush after every write to stdout.0.11 (2014-08-15)Added support formemmonto check against cumulative RSS of a process
and all its child processes.  Patch by Lukas Graf.Fixed a bug introduced in 0.9 where the-uand-noptions inmemmonwere parsed incorrectly.  Patch by Harald Friessnegger.0.10 (2014-07-08)Honor timeout in httok checks even on trying the connection.
Without it, processes that take make than 60 seconds to accept connections
and http_ok with TICK_60 events cause a permanent restart of the process.httpoknow sends aUser-Agentheader ofhttpok.Removedsetuptoolsfrom therequireslist insetup.pybecause
it caused installation issues on some systems.0.9 (2013-09-18)Added license.Fixed bug in cmd line option validator for ProcessStateEmailMonitor
Bug report by Val JordanAdded-uoption to memmon the only send an email in case the restarted
process’ uptime (in seconds) is below this limit.  This is useful to only
get notified if a processes gets restarted too frequently.
Patch by Harald Friessnegger.0.8 (2013-05-26)Superlance will now refuse to install on an unsupported version of Python.Allow SMTP credentials to be supplied to ProcessStateEmailMonitor
Patch by Steven Davidson.Added-noption to memmon that adds this name to the email
subject to identify which memmon process restarted a process.
Useful in case you run multiple supervisors that control
different processes with the same name.
Patch by Harald Friessnegger.ProcessStateEmailMonitor now adds Date and Message-ID headers to emails.
Patch by Andrei Vereha.0.7 (2012-08-22)Thecrashmailbatch--toEmailoption now accepts a comma-separated
list of email addresses.0.6 (2011-08-27)Separated unit tests into their own filesCreatedfatalmailbatchpluginCreatedcrashmailbatchpluginSphinxified documentation.Fixedtest_suiteto use the correct module name in setup.py.Fixed the tests formemmonto import the correct module.Applied patch from Sam Bartlett: processes which are not autostarted
have pid “0”.  This was crashingmemmon.AddsmtpHostcommand line flag tomailbatchprocessors.Addedcrashsmsfrom Juan Batiz-BenetConvertedcrashmailbatchand friends from camel case to pythonic styleFixed a bug wherehttpokwould crash with the-b(in-body)
option.  Patch by Joaquin Cuenca Abela.Fixed a bug wherehttpokwould not handle a URL with a query string
correctly.  Patch by Joaquin Cuenca Abela.Fixed a bug wherehttpokwould not handle process names with a
group (“group:process”) properly.  Patch by Joaquin Cuenca Abela.0.5 (2009-05-24)Added thememmonplugin, originally bundled with supervisor and
now moved to superlance.0.4 (2009-02-11)Addedeagerandnot-eageroptions to thehttpokplugin.Ifnot-eageris set, and no process being monitored is in theRUNNINGstate, skip the URL check / mail message.0.3 (2008-12-10)Addedgcoreandcorediroptions to thehttpokplugin.0.2 (2008-11-21)Added thecrashmailplugin.0.1 (2008-09-18)Initial release
Package: timems
timemsUse this package to easily convert various time formats to seconds.What is it?fromtimemsimportmsms('2w')# 1209600ms('1m')# 60How to use?fromtimemsimportmsimportasyncioasyncio.sleep(ms('1h'))# sleeping 3600 sec. / 1hFormatsm, min, minute, h, ho, hour, d, day, w, week, y, year, mon, month, y, yearFind a Bug?Report ithere
Package: timeMyScript
⏲ timeMyScript - lazy script timingI don't understand why something so simple didn't existWe are lazy.🔧 InstallationOpen up your terminal and install the pypi package with:pip install timeMyScriptThis package usesatexitandtimestandard libraries so you are good to go🎨 UsageUseimport timeMyScripton top of all your code and at exit the result will be printed
Package: timeN
Package DescriptiontimeN is a simple package that contains a customizable@timendecorator which times how long it takes (in milliseconds) for the decorated function to run n timesUsageThe timen decorator is quite simple to use. it can be imported by simply importing the timeN package withimporttimeNFrom there, the timeN decorator can be used like any other decorator, with the exception that you must end the decorator in parentheses since it takes optional parameters@timeN()deffoo():print("Hello World")Output:Hello World
...
Hello World
foo took 2.0 milliseconds to run 10 timesThe 2 optional parameters are: n (number of times to run the function) and round_to (number decimal places to round the final result to).@timeN(100,5)deffoo():print("Hello World")Output:Hello World
...
Hello World
foo took 11.99365 milliseconds to run 100 times
Package: timenotes
TimeNotes Readmean easy-use tool for time researching安装pipinstalltimenotes引用importtimenotes声明一个笔记本timenote=timenotes.Timenote(words=None,intimeshow=False)words参数为自定义输出形式，不填时默认为"阶段[{}]：{}时间花费 {} 秒"例如，需要输入这种形式的字符串：words="区块{}：{}时间 {} 喵"intimeshow参数为True时，每结束一个时间段的记录(具体为end)就会自动输出为False时，不输出，需要在结尾专门输出，同时这种输出可以保持格式的对齐默认为False使用timenote.start("示例一")......timenote.note("示例二")......timenote.pause()......timenote.start()......timenote.end()......timenote.show()timenote.sleep(1)timenote.start()可以输入一个字符串类型的参数并作为这个阶段的名称如果无输入参数则自动以当前阶段的序数为名称timenote.end()用于结束一个阶段的记录timenote.note()和同时执行end和start的效果相同timenote.show()用于输出记录，这里建议名字长度不同时使用纯中文`timenote.sleep()用于使程序休眠一定时间，单位为秒
Package: timeoff
timeoff 🏝Track your hours accrued and set goals and reminders to take a break!$timeofflist|    o               ,---.,---.|--- .,-.-.,---.,---.|__. |__.|    || | ||---'|   ||    |`---'`` ' '`---'`---'`    `Current schedule: SemiMonthly4 hours on the 1st and 15th of the month╭────────────┬───────┬──────────┬─────────┬─────────────╮│   Start    │  End  │   Type   │   Hours │   Remaining │├────────────┼───────┼──────────┼─────────┼─────────────┤│            │       │ Initial  │     100 │         100 ││ 2023-05-12 │   -   │ Vacation │      -8 │          92 ││ 2023-05-15 │   -   │ Accrued  │       4 │          96 │╰────────────┴───────┴──────────┴─────────┴─────────────╯FeaturesAutomaticaly updates PTO hours over time.Define schedules to set accrued PTO rates.View the remaining hours of PTO available to you.InstallationTo installtimeoff:$pipinstalltimeoffUsageDocumentation is in the works! Please run the-hhelp flag in the meantime. The interactive prompts will guide you through further instructions.$timeoff-husage: timeoff [-h] {add,list,rm,settings} ...Timeoff CLIpositional arguments:{add,list,rm,settings}sub-command helpadd                 Add an absencelist                List absencesrm                  Remove an absencesettings            Manage settingsoptional arguments:-h, --help            show this help message and exitThe data is stored in~/.timeoff.Python APIYou can also use this as a Python library.Retrieve a list of all PTO hours remaining and absenses taken.importtimeofftimeoff.get()Return the number of hours of PTO remaining as of today.timeoff.available_hours()You can also pass in a future date to see how many hours you'll have accumulated by then.fromdatetimeimportdatetimeoff.available_hours(date(2023,9,4))
Package: timeoutcontext
Asignalbased
timeout context manager and decorator.Since it is signal based this package can not work under Windows operating
system.UsageAs a context manager:importsysfromtimeimportsleepfromtimeoutcontextimporttimeoutifsys.version_info<(3,3):fromtimeoutcontext._timeoutimportTimeoutErrortry:withtimeout(1):sleep(2)exceptTimeoutError:print('timeout')As a decorator:importsysfromtimeimportsleepfromtimeoutcontextimporttimeoutifsys.version_info<(3,3):fromtimeoutcontext._timeoutimportTimeoutError@timeout(1)defwait():sleep(2)try:wait()exceptTimeoutError:print('timeout')LicenseFree software: BSD licenseHistory1.2.0 (2018-03-11)Allow sub-second timeout1.1.1 (2016-09-05)Fix README code exemples1.1.0 (2016-09-05)Add the “Not working on Windows operating system” noticeRename TimeoutException to TimeoutError1.0.0 (2016-01-23)First release on PyPI.
Package: timeout-decorator
Timeout decoratorInstallationFrom source code:python setup.py installFrom pypi:pip install timeout-decoratorUsageimport time
import timeout_decorator

@timeout_decorator.timeout(5)
def mytest():
    print("Start")
    for i in range(1,10):
        time.sleep(1)
        print("{} seconds have passed".format(i))

if __name__ == '__main__':
    mytest()Specify an alternate exception to raise on timeout:import time
import timeout_decorator

@timeout_decorator.timeout(5, timeout_exception=StopIteration)
def mytest():
    print("Start")
    for i in range(1,10):
        time.sleep(1)
        print("{} seconds have passed".format(i))

if __name__ == '__main__':
    mytest()MultithreadingBy default, timeout-decorator uses signals to limit the execution time
of the given function. This appoach does not work if your function is
executed not in a main thread (for example if it’s a worker thread of
the web application). There is alternative timeout strategy for this
case - by using multiprocessing. To use it, just passuse_signals=Falseto the timeout decorator function:import time
import timeout_decorator

@timeout_decorator.timeout(5, use_signals=False)
def mytest():
    print "Start"
    for i in range(1,10):
        time.sleep(1)
        print("{} seconds have passed".format(i))

if __name__ == '__main__':
    mytest()WarningMake sure that in case of multiprocessing strategy for timeout, your function does not return objects which cannot
be pickled, otherwise it will fail at marshalling it between master and child processes.AcknowledgementDerived fromhttp://www.saltycrane.com/blog/2010/04/using-python-timeout-decorator-uploading-s3/andhttps://code.google.com/p/verse-quiz/source/browse/trunk/timeout.pyContributeI would love for you to fork and send me pull request for this project.
Please contribute.LicenseThis software is licensed under theMIT licenseSeeLicense fileChangelog0.3.1Fixed issue with PicklingError causes the timeout to never be reached.0.3.0Added optional threading support via python multiprocessing (bubenkoff)Switched to pytest test runner (bubenkoff)0.2.1Initial public release
Package: timeouter
timeouterTimeout helper tools library for PythonInstallpip3installtimeouterExamplesSimple class usageimporttimeouter,timet=timeouter.Timer(1)time.sleep(0.5)t.has(0.1)# Truet.has(0.6)# Falset.get()# returns remaining timet.get(laps=3)# returns remaining time, split into 3 equal lapst.reset()# resets timeout counter# raises TimeoutError if timer has expired, message is optionalt.check(message=message)# get remaining time, raise TimeoutError if expired, message is optionalt.get(check=True,check_message=message)Custom timeout exceptionException for the single timer objectclassMyException(Exception):passt.set_exception_class(MyException)Default exception for all new timersclassMyException(Exception):passtimeouter.set_default_exception_class(MyException)Thread-local usageimporttimeouterasto# init for the current threadto.init(1)time.sleep(2)# module methods check, get, has, reset, set_timeout and set_exception_class# are proxied to thread-local objectto.check()
Package: timeout-executor
timeout-executorhow to install$pipinstalltimeout_executor# or$pipinstall"timeout_executor[all]"# or$pipinstall"timeout_executor[billiard]"# or$pipinstall"timeout_executor[loky]"# or$pipinstall"timeout_executor[dill]"# or$pipinstall"timeout_executor[cloudpickle]"how to useimporttimefromtimeout_executorimportTimeoutExecutordefsample_func()->None:time.sleep(10)executor=TimeoutExecutor(1)try:executor.apply(sample_func)exceptExceptionasexc:assertisinstance(exc,TimeoutError)executor=TimeoutExecutor(1,pickler="dill")# or cloudpickleresult=executor.apply(lambda:"done")assertresult=="done"LicenseMIT, seeLICENSE.
Package: timeout-iterator
python-timeout-iteratortimeout-iteratorprovides a timeout in iteration.Installation$pipinstalltimeout-iteratorUsagewithout_terminatewithout_terminateis a generator that it will not yield after the timeout,
but it will not raise an exception.fromtimeout_iteratorimportwithout_terminateresults=[]foriinwithout_terminate(range(10),seconds=0.3):results.append(i)time.sleep(0.1)assertresults==[0,1,2]terminateterminateis a generator that it will raise an exception after the timeout.fromtimeout_iteratorimportterminatetry:results=[]foriinterminate(range(10),seconds=0.3):results.append(i)time.sleep(0.1)exceptTimeoutError:passassertresults==[0,1,2]LICENSEBSD 3-Clause License