Saravanan666/pypi-org huggingface dataset:
Package: lrtools
TRK-Loader-PythonLine Rider .trk format implemented in Python 3Loading Tracksfromlrtools.trkformatimport*# trk formatfromlrtools.trackimport*# track and line objectsfromlrtools.utilsimport*# utilitiesTo load a trackname.trk:track=load_trk("track.trk","name")Saving Tracksfromlrtools.trkformatimport*# trk formatfromlrtools.trackimport*# track and line objectsfromlrtools.utilsimport*# utilitiesTo save a track asname.trk:track=Track()save_trk(track,"name.trk")Track Structure# assuming track is a Track object:track.YGravity:int# Y gravitytrack.XGravity:int# X gravitytrack.GravityWellSize:int# Gravity well sizetrack.BGColorR:inttrack.BGColorG:inttrack.BGColorB:inttrack.LineColorR:inttrack.LineColorG:inttrack.LineColorB:inttrack.lines:List[Line]track.Filename:strtrack.Name:strtrack.Remount:booltrack.ZeroStart:booltrack.frictionless:booltrack.ver:int(61or62)track.StartOffset:Vectortrack.Triggers:listtrack.StartZoom:inttrack.current_id:inttrack.Triggers:listTodoAddprune()method toTrack.Trackto prune line IDswrite the rest of the docs on other parts line line triggers and theLineobjectAdd JSON support
Package: lru-cache-pubsub-cache-clear
lru_cache_pubsub_cache_clearlru_cache_pubsub_cache_clearis a decorator to broadcastcache_clear()calls tolru_cacheacross
multiple instances of an application. This allows for local cache access speed and redis-like centralized cache invalidation. Example:from lru_cache_pubsub_cache_clear.decorators import lru_cache_pubsub_cache_clear
from django_redis import get_redis_connection


@lru_cache_pubsub_cache_clear(get_redis_connection=get_redis_connection,
                              channel_name='CHANNEL_CACHE_CLEAR')
@lru_cache(maxsize=1000000)
def get_data(key)
    ...
    return valueHereget_redis_connectionis a callable which returns a redis connection (e.g.django_redis.get_redis_connection).Then every time one of app instances callsget_data.cache_clear()it will be executed on all connected instances.
Package: lru_cacher
lru_cacher=========This is a  Least Recently Used (LRU) Cache implementation in Python.INSTALLATIONTo install, simply runpython setup.py installTo run unit tests, runpython setup.py testEXAMPLE USAGE>>> from time import sleep>>>>>> from lru_cacher import LruCacher>>>>>> def slowSqrt(n):>>>   sleep(2)>>>   return n**0.5>>>>>> cache = LruCache(max_size=200, plan_b_func=slowSqrt)>>> #This lookup will be slow>>> answer, found_in_cache = cache.lookup(49)>>> print answer, found_in_cache7.0 False>>>>>> #This lookup will be fast>>> answer, found_in_cache = cache.lookup(49)>>> print answer, found_in_cache7.0 True>>>>>> #Let's modify the cache>>> cache.update(49, 'seven')>>> answer, found_in_cache = cache.lookup(49)>>> print answer, found_in_cacheseven True
Package: lru-dict
LRU DictA fixed size dict like container which evicts Least Recently Used (LRU) items
once size limit is exceeded. There are many python implementations available
which does similar things. This is a fast and efficient C implementation.
LRU maximum capacity can be modified at run-time.
If you are looking for pure python version, lookelse where.UsageThis can be used to build a LRU cache. Usage is almost like a dict.fromlruimportLRUl=LRU(5)# Create an LRU container that can hold 5 itemsprintl.peek_first_item(),l.peek_last_item()#return the MRU key and LRU key# Would print None Noneforiinrange(5):l[i]=str(i)printl.items()# Prints items in MRU order# Would print [(4, '4'), (3, '3'), (2, '2'), (1, '1'), (0, '0')]printl.peek_first_item(),l.peek_last_item()#return the MRU key and LRU key# Would print (4, '4') (0, '0')l[5]='5'# Inserting one more item should evict the old itemprintl.items()# Would print [(5, '5'), (4, '4'), (3, '3'), (2, '2'), (1, '1')]l[3]# Accessing an item would make it MRUprintl.items()# Would print [(3, '3'), (5, '5'), (4, '4'), (2, '2'), (1, '1')]# Now 3 is in frontl.keys()# Can get keys alone in MRU order# Would print [3, 5, 4, 2, 1]dell[4]# Delete an itemprintl.items()# Would print [(3, '3'), (5, '5'), (2, '2'), (1, '1')]printl.get_size()# Would print 5l.set_size(3)printl.items()# Would print [(3, '3'), (5, '5'), (2, '2')]printl.get_size()# Would print 3printl.has_key(5)# Would print Trueprint2inl# Would print Truel.get_stats()# Would print (1, 0)l.update(5='0')# Update an itemprintl.items()# Would print [(5, '0'), (3, '3'), (2, '2')]l.clear()printl.items()# Would print []defevicted(key,value):print"removing:%s,%s"%(key,value)l=LRU(1,callback=evicted)l[1]='1'l[2]='2'# callback would print removing: 1, 1l[2]='3'# doesn't call the evicted callbackprintl.items()# would print [(2, '3')]dell[2]# doesn't call the evicted callbackprintl.items()# would print []Installpip install lru-dictoreasy_install lru_dictWhen to use thisLike mentioned above there are many python implementations of an LRU. Use this
if you need a faster and memory efficient alternative. It is implemented with a
dict and associated linked list to keep track of LRU order. See code for a more
detailed explanation. To see an indicative comparison with a pure python module,
consider abenchmarkagainstpylru(just chosen at random, it should
be similar with other python implementations as well).$ python bench.py pylru.lrucache
Time : 3.31 s, Memory : 453672 Kb
$ python bench.py lru.LRU
Time : 0.23 s, Memory : 124328 Kb
Package: lruheap
LRU CachePackage for tracking store in-data memory using replacement cache algorithm / LRU cache. The Priority of storing or removing the data based on Min-Max heap algorithm or basic priority queue instead using OrderedDict module that provided by Python.UsageLRUCache only works in Python version 3.5 and above, you can install it with :pip3installlruheapDocumentationYou can read the fully detailed explanation about LRUCache inhereContributionSince this package is still being under developed, any contributions are much welcomed and you can read on contribution page.LicenseThis package is licensed under the MIT License.
Package: lru-ng
The C-extension module lru_ng provides a class LRUDict that is compatible with a large subset of methods in Python's dict. It maintains recent-access order and enforces a fixed size, discarding the least-recently used items when the capacity is filled.This extension class is largely compatible with the lru.LRU type.For more information, please visit the project homepage: https://github.com/congma/lru_ng
Package: lru-od
lru-odPython implementation of LRU-Cache usingOrderedDictInstallingPython 3.7 or higher required!To install the stable version of the library:# on linux/macOSpython3-mpipinstalllru-od# windowspy-3-mpipinstalllru-odTo install the development version of the library:$gitclonehttps://github.com/XiehCanCode/lru-od
$cdlru-od
$python3-mpipinstall-U.ExamplefromlruimportLRUCachecache:LRUCache[str,str]=LRUCache(max_size=2)cache.set("foo","bar")# you can also use: cache['foo'] = 'bar'cache.set("bar","foo")print(cache.get("foo"))# this key-pair would be pushed to endcache.set("ping","pong")# since we're exceeding the max size, the least used will be removed, in this case it's {'bar': 'foo'}APIclass LRUCacheLRU Cache implementationParametersmax_size: Optional[int]Max size of the cache, default's to 120Operationsx == yx != yx in yMethodscache_info() -> strInformation about the cacheget(key: Any) -> Any | NoneGet a value of the key-value pair with givenkeyif existsitems() -> tuple[Any, Any]D.values() -> a set-like object providing a view on D's itemskeys() -> KeysView[Any]D.keys() -> a set-like object providing a view on D's keysremove(key: Any) -> NoneRemove a key-value pair associated with thekeyparameter if existsset(key: Any, value: Any) -> dict[Any, Any]Set/Update a new/existing key-value pair with givenkeyandpairand returns the key-value pair created/updatedvalues() -> ValuesView[Any]D.values() -> a set-like object providing a view on D's values
Package: lru_py
A simple python implementation for the least recently used caching algorithm.Hello, worldA simple use for LRU:from lru_py import LRU

lru_cache = LRU(max_size = 2)
lru_cache['hello'] = 'world'
lru_cache['world'] = 'hello'
lru_cache['hello'] = 'world'
print "The first item now is: " + lru_cache.top()
print "The value of the key 'world' now is: " + lru_cache['world']
print "The first item now after retrieving the key 'world' is: " +lru_cache.top()How To:Initializing an object:lru_cache = LRU(max_size = 2)Setting a value, regular assigningment with the square bracket operator [ ]:lru_cache[‘hello’] = ‘world’Retrieving a value, using square bracket operator [ ]:lru_cache[‘hello’]Deletin, using the del and using square bracket operators:del lru_cache[‘hello’]Retrieving the most recently used item:lru_cache.top()InstallationAutomatic installation:pip install lru_pyManual installation: Download the latest source fromGitHub.tar xvzf lru_py-[VERSION].tar.gz
cd lru_py-[VERSION]
python setup.py build
sudo python setup.py install
Package: lru-redis-cache
LRU CacheThis is a simple Least Recently Used (LRU) Cache with expiration time that use redis to store the data.InstallationUsageImportLRUCachefrom the lru_redis_cache module, when creating an instance of this class you could pass:cache_size: Max size of the cache, the default value is 10ttl: Max time to expire the cache, the default value is 60 secondsredis_host: Host where the redis instance is allocated, default is localhostredis_port: Redis port, default is 6379This class has three public methods to manage the cache:set(name, value)this function set a new cache value or replace the previous.get(name)this function return the cache element if it is stores, otherwise it will return aNonevalue.set_connection(RedisConnection)this function allows you to set the redis instance to be used.fromlru_redis_cacheimportLRUCachecache=LRUCache(cache_size=5,ttl=60)cache.set("my_key","my_value")cache.get("my_key")# Output"my_value"TestsIn order to run the test cases you need to install the basic requirements fromrequirements.txtby running the following command.pip install -r requirements.txtThen, you need to runpython -m pytestInformationLRU Cache Implementation
Package: lru-ttl
IntroductionThis is a Python LRU cache implementation with TTL support, this way you can ensure you will not get results older than the specified TTL.Installationpip install lru-ttlHow to use>>>fromlruttlimportLRUCache>>>cache=LRUCache(10)>>>cache.set('key1',['some object'],5)>>>cache['key1']['some object']>>># wait a couple of seconds>>>cache['key1']>>>cache=LRUCache(2)>>>cache.set('key1','val1')>>>cache.set('key2','val2')>>>cache.set('key3','val3')>>>'key1'incacheFalse>>>'key2'incacheTrue>>>'key3'incacheTrueThe TTL doesnothave precedence, so the last recently used keys will be evicted first!>>>cache=LRUCache(2)>>>cache.set('key1','val1')>>>cache.set('key2','val2',10000)>>>cache.set('key3','val3')>>>'key1'incacheFalse>>>'key2'incacheTrue
Package: lruun
lru_unofficialLRU implementation in TensorFlow 2.0.
The LRU was introduced inResurrecting Recurrent Neural Networks for Long Sequencesat ICML, and
belongs to the state-space models family, which are models able to handle extremely long sequences more
gracefully than attention based architectures. You can findherethe JAX implementation that we took as a reference, as recommended by one of the authors.JAX and PyTorch implementations to come. However, parallel scans are not implemented
native in PyTorch, as notedhere.
However custom implementations exist, such asthis one.We implement the LRU unit and also the final LRU residual block used in the paper. For both
we provide a recurrent form and a scan form. In our tests, the scan form was up to 300x faster
than the recurrent form on a GPU, giving the same output. You can install the package withpip instal lruun. After that, you can import the layers as follows:fromlruun.tfimportLinearRecurrentUnitCell,LinearRecurrentUnitFFNfromlruun.tfimportResLRUCell,ResLRUFFN
Package: lrz-sync-share
This little library makes it easy to upload and manage files on LRZ Sync+Share.Usage:from lrz_sync_share import lrz_session

lrz = lrz_session("username", "password", "ldap")
lrz.login()

lrz.upload("share", "a.txt")
url = lrz.get_link("share", "a.txt")ShibbolethsFor the third parameter forlrz_session(user, password, shibboleth)use the following shibboleths:EstablishmentShibbolethGastkennungen/Guests/ExternldapAkademie der Bildenden KünsteldapAkademie für Politische BildungldapBAdW LRZ WMIldapHochschule MünchenldapHochschule Weihenstephan-TriesdorfldapLMU MünchenldapTU MünchenldapHochschule Kemptenhttps://syncandshare.lrz.de/Shibboleth.sso/Login?SAMLDS=1&target=https%3A//syncandshare.lrz.de/login/shibboleth&entityID=https%3A//idp.hs-kempten.de/idp/shibbolethHochschule Neu-Ulmhttps://syncandshare.lrz.de/Shibboleth.sso/Login?SAMLDS=1&target=https%3A//syncandshare.lrz.de/login/shibboleth&entityID=https%3A//sso.hs-neu-ulm.de/idp/shibbolethHochschule Rosenheimhttps://syncandshare.lrz.de/Shibboleth.sso/Login?SAMLDS=1&target=https%3A//syncandshare.lrz.de/login/shibboleth&entityID=https%3A//idp.fh-rosenheim.de/idp/shibbolethOstbayerische Technische Hochschule Regensburghttps://syncandshare.lrz.de/Shibboleth.sso/Login?SAMLDS=1&target=https%3A//syncandshare.lrz.de/login/shibboleth&entityID=https%3A//sso.hs-regensburg.de/idp/shibbolethUniversität Passauhttps://syncandshare.lrz.de/Shibboleth.sso/Login?SAMLDS=1&target=https%3A//syncandshare.lrz.de/login/shibboleth&entityID=https%3A//sso.uni-passau.de/idp/shibbolethTODOEditing filenamesDeleting filesCreating directoriesCreating root foldersetc., basically full web functionality
Package: ls2d
LS2D(LS)2D: LES and SCM - Large Scale Dynamics(LS)2D is a Python toolkit, developed to simplify all the steps required to downscale ERA5 with doubly-periodic large-eddy simulation (LES), or single-column models (SCMs). For the retrieval of ERA data, it relies on the Copernicus Data Store (CDS), or the Meteorological Archival and Retrieval System (MARS) at ECMWF computer systems.InstallationIf you want to use CDS to download the ERA5 data, then please start by following the steps explained athttps://cds.climate.copernicus.eu/api-how-to.PyPIIt is easiest to install (LS)2D from PyPI:pip install ls2dBy default, this excludes thecdsapias a dependency. If you do want to install that as a dependency, use:pip install ls2d[cds]ManualFor a manual installation, you can clone the package from Github:git clone https://github.com/LS2D/LS2D.gitIn each script where you want to use (LS)2D, add the (LS)2D root directory to the Python path:import sys
sys.path.append('/path/to/LS2D')You will have to manually install the dependencies withpip install numpy scipy netCDF4 matplotlib cdsapi.UsageSome examples are provided athttps://github.com/LS2D/LS2D/tree/main/examples. The scriptexample_1.pydownloads the ERA5 data, calculates the initial conditions and large scale forcings, and creates an example plot.The examples directory also contains example cases for MicroHH (https://github.com/microhh/microhh).Downloading ERA5 data(LS)2D contains two methods to download ERA5: through theCopernicus Data Store(open for everyone), or using MARS at ECMWF systems.The ERA5 model level data that (LS)2D requires is stored on tape archives, so downloads using CDS tend to be slow with long queueing times. For that reason,ls2d.download_era5()will stop the Python script once the download requests are submitted to CDS. On subsequent calls ofls2d.download_era5(), (LS)2D will check the status of the CDS request, and if the request is finished, download the ERA5 data.ThesettingsdictionaryAll settings for (LS)2D are wrapped in a dictionary:central_lat: central latitude of LES/SCM domaincentral_lon: central longitude of LES/SCM domainarea_size: spatial size of ERA5 download (central lat/lon +/-area_sizedegrees)era5_path: storage location of ERA5 downloads/dataera5_expver: ERA5 experiment version number (1=normal ERA5,5=near realtime). With CDS, only1works.case_name: experiment name, only used to create subdirectory inera5_path.start_date: Pythondatetimeobject with start date/timeend_date: Pythondatetimeobject with end date/timewrite_log: Write ERA5 download to screen (False) or log file (True)data_source: Download method (CDSorMARS).MARSonly works on e.g. the ECMWF supercomputer.
Package: ls2ncdu
ls2ncduParser for systems which only havels -lRavailableJSON format ref:https://dev.yorhel.nl/ncdu/jsonfmtInstallpip3install--userls2ncdu
ls2ncdu--helpUsageOutput is written to stdout. Takes output fromls -lR. The resulting .json file is readable byncdu -fExample usage forNCI massdata:mdss ls -lR | ls2ncdu.py > mdss_files.json
ncdu -f mdss_files.txt
Package: ls336-ioc
EPICS-IOC for the Lakeshore 336 Temperature ControllerQuick 'n dirty:Download via PyPI:pip install ls336-iocor via GitLab:git clone https://gitlab.com/kmc3-xpp/fridgeConfigure at least the IP address and the EPICS prefix and start via shell:$ export LS336_EPICS_PREFIX="BEAMLINE:LS336:"
$ export LS336_HOST="10.0.0.17"
$ ls336-ioc
INFO:fridge.ioc:Lake Shore Model 336 version: 2.5
INFO:root:Starting IOC, PV list following
[...]
INFO:caproto.ctx:Server startup complete....or create container and start via Docker or Podman:$ podman build -t ls336-ioc -f fridge/Dockerfile -v $PWD/fridge:/fridge_src:z
$ podman run -ti --rm \
    -e LS336_EPICS_PREFIX="BEAMLINE:LS336:" \
    -e LS336_HOST=10.0.0.17\
    --name fridge ls336-ioc:latest
[...]Here's a list of environment variables that might help:LS336_HOST: host name or IP of the LS336 controllerLS336_PORT: port to connect to (typically 7777)LS336_VISA_DEV: PyVISA device to connecto to, instead of the
TCP/IP device. If set, overrides host/port.LS336_VISA_RMAN: PyVISA resource manager. Defaults to "@py".
If you've got this far, you know what this is good for ;-)LS336_EPICS_PREFIX: EPICS PV prefix to use. Include trailing column
(:) if you need one. Defaults toKMC3:XPP:LS336:.LS336_LOGGING: one of "error", "warn", "info" or "debug". Defaults
to "info".LS336_LOG_STATUS: if set to "yes", the IOC will periodically
(about once per second) log the
current status of all variables it observes to the "info" logging
facility. The default is not to do that.Enjoy.
Package: lsalib
A Latent Semantic Analysis Library==================================Author(s): Keith MurrayContact: kmurrayis@gmail.comRequirements:=============Python 2.7.6Standard Libraries:os, sys, and mathAdded Libraries:numpy, scipy, sklearnInstallation:=============```pythonpip install lsalib```Usage:======This library is a termDocMatrix class.It was built to follow the Thesis of Sam Way, found here http://digitalcommons.unl.edu/elecengtheses/42/```python>>> import lsalib# To use this, initalize a varible,>>> lsa = lsalib.termDocMatrix()# After this, you can add documents to the matrix. This can be done in a number of ways# With Strings:>>> lsa.add("HELLO WORLD! THE WIND RISES, WE MUST TRY TO LIVE")# With Dictionaries (a key:count relationship)>>> lsa.add({"tree":5, "apple":3, "WORLD":8, "planes":2})# With lists of strings:>>> lsa.add(["apples", "oranges", "apples", "WORLD", "HELLO"])# With lists of dictionaries which follow the key:count relationship:>>> lsa.add([D1, D2, D3, D4])```It's important to note that there is no processing done on any of the inputs.This means the inputs are case sensitive, any symbol such as a comma tied to a word willalso be included in the term list.Therefore "Apples", "apples", and "apples," are all treated as unique words.If this is undesirable, the strings will need to be preprocessed before lsa.add() is called.As each document is added to the matrix, a term frequency weighting is applied.```python# Once all documents are added to the matrix, the inverse document frequency weighting# can be called:>>> lsa.weight_idf()# And once that has completed, use lsa.nmf to reduce the weighted term doc matrix# to it's basis k components for the terms and documents:>>> P, Q = lsa.nmf(5)# P is the basis vector set for the terms, and has a dimensionality of terms x k,# Q is the basis vector set for the documents, and has a dimensionality of docs x k,# P x Q.T will yield an approximation of the original term document matrix with a certain error# This error is stored in lsa.er>>> print lsa.er```
Package: lsankidb
lsankidblsfor your localAnkidatabase.Dump all your Anki terms in order to save them, search them,grepthem ordiffthem.$ lsankidb
Listing /home/me/.local/share/Anki2/User 1/collection.anki2 ...

German
    ['Hello', 'Hallo']
    ['How are you?', "Wie geht's?"]
French
    ['Hello', 'Bonjour']
    ['How are you?', 'Comment ça va ?']See on GitHub.
Package: lsanomaly
Table of ContentsFeaturesInstallationUsageReferenceDocumentationHistoryLicenseFeaturesCompatible with scikit-learn package modulesProbabilistic outlier detection modelRobust classifier when given multiple inlier classesEasy to install and get startedInstallationThe best way to install lsanomaly is to:pip install lsanomalyBecause lsanomaly requires scikit-learn it also requires numpy and scipy
inherintly. Make sure you have successfully installed these packages if you’re
having trouble getting lsanomaly to install.UsageFor those familiar with scikit-learn the interface will be familiar, in fact lsanomaly was built to be compatible with sklearn modules where applicable. Here is basic usage of lsanomaly to get started quick as possible.Configuring the ModelThe LSAnomaly provides reasonable default parameters when given an empty init or it can be passed values for rho and sigma. The value rho controls sensitivity to outliers and sigma determines the ‘smoothness’ of the
boundary. These values can be tuned to improve your results using lsanomaly.fromlsanomalyimportLSAnomaly# At train time lsanomaly calculates parameters rho and sigmalsanomaly=LSAnomaly()# or alternativelylsanomaly=LSAnomaly(sigma=3,rho=0.1)Training the ModelAfter the model is configured the training data can be fit.importnumpyasnplsanomaly.fit(np.array([[1],[2],[3],[1],[2],[3]]))Making PredictionsNow that the data is fit, we will probably want to try and predict on some data not in the training set.>>>lsanomaly.predict([0])[0.0]>>>lsanomaly.predict_proba([0])array([[0.5760205,0.4239795]])ReferenceJ.A. Quinn, M. Sugiyama. A least-squares approach to anomaly detection in static and sequential data. Pattern Recognition Letters 40:36-40, 2014.[pdf]DocumentationComing soon…HistoryTo check out the complete release notes see thechangelog.LicenseThe MIT License (MIT)Copyright (c) 2016 John QuinnPermission 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 TH