Saravanan666/pypi-org huggingface dataset:
Package: lcsspy
Introductionlcsspy is a Python package to compute the longest common subsequence
(also known as LCSS) similarity measure for time series data.LCSS reconstructs a common subsequence by matching similar elements
in the two series.
Two elements are matched if they are sufficiently close in time and
also have similar values.Getting StartedInstallationlcsspy supports any Python version starting from 3.9, and is OS independent.Regular installation can be performed by running the following command.pip install lcsspyThis will install lcsspy and its required dependencies.If you want, you can install pytest as an optional dependency by running
a slightly different command.pip install lcsspy[tests]This allows you to run existing tests, or write your own.
Refer to thepytest documentationto learn more about running tests.UsageDiscrete LCSSDiscrete LCSS measures similarity between time series with discrete
time indexes. It's the formulation introduced byVlachos.The following script matches elements that have a value difference
smaller than 1.1, and that are at most 1 index position apart.importmatplotlib.pyplotaspltimportnumpyasnpfromlcsspy.lcssimportdiscrete_lcssts1=np.array([1,2,2,9,14,11,19,18])ts2=np.array([2,1,4,7,10,15,12,8,17])result=discrete_lcss(ts1=ts1,ts2=ts2,epsilon=1.1,delta=1,plot=True)print(result.lcss_measure)plt.show()Running this code displays two figures.
The first one plots the input time series and signals which elements were
matched with a green line.The second figure plots only the elements from the input series that are part
of the common subsequence.
In this case, the common subsequence has length 6 since it contains six pairs
of elements that were matched.This value is divided by the length of
the shortest series to obtain the LCSS
measure which belongs to the range $[0, 1]$.The measure equals $6/8$, which is printed to the console.0.75Continuous LCSSContinuous LCSS deals with time series that have continuous
time indexes (timestamps).
It's particularly useful when the two series are very irregular and present
many gaps.In the following example, elements are matched if they have a value difference
smaller than 0.9, and their timestamps are at most 1 minute apart.importmatplotlib.pyplotaspltimportpandasaspdfromlcsspy.lcssimportcontinuous_lcssts1=pd.Series([12.4,13.7,15.8,8.7],index=pd.DatetimeIndex(["2023-11-17 08:42:23","2023-11-17 08:43:35","2023-11-17 08:45:06","2023-11-17 08:50:23",]),)ts2=pd.Series([13.2,13.0,19.0,9.0,9.2],index=pd.DatetimeIndex(["2023-11-17 08:42:39","2023-11-17 08:44:02","2023-11-17 08:45:32","2023-11-17 08:49:37","2023-11-17 08:51:12",]),)result=continuous_lcss(ts1=ts1,ts2=ts2,epsilon=0.9,delta=pd.Timedelta(minutes=1),plot=True)print(result.lcss_measure)plt.show()The LCSS measure equals $3/4$ and similar plots to those concerning the
discrete LCSS example are displayed.Refer to thedocumentationfor more details.TestingThis package uses the pytest framework to run tests.
A test folder which achieves 100% code coverage is provided.Copyright and LicenseAll source code is Copyright (c) 2023 Francesco Lafratta.lcsspy is licensed under theMIT License.
Package: lcszh
流程数智化通用函数功能函数输入输出配置文件读取read_config配置文件的路径配置文件内容组成的字典(dict)文件目录判断check_and_creat_dir目录路径存在：返回True； 不存在：创建目录，返回False多边形面积计算get_PolygonArea各顶点位置坐标面积括号中内容获取get_bracketed_content文本字符串文本中所有小括号中的内容组成的listE-mail提取get_email文本字符串emailemail在文本中的位置email的域名括号及其中内容去除rm_bracketed文本字符串不含括号及括号中的内容的文本符号去除rm_symbol文本字符串没有符号的纯文本最长公共序列获取get_max_subseq两段文本字符串两段文本的最长公公序列最长公共字串获取get_max_comstr两段文本字符串两段文本的最长公共字符串中文判断is_chinese文本字符串包含中文:True不包含中文：False字符串全角转半角change_strQ2B字符串均转化为半角字符的字符串json文件读取read_jsonjson文件路径json格式内容将json数据写入json文件write_json保存的文件名要保存的数据json文件读取csv数据read_csvcsv文件的路径，数据格式参数列表(list)或字典(dic)格式的数据将数据写入csv文件write_csv列表(list)或字典(dic)格式的数据csv文件读取excel数据read_excelexcel文件的路径，数据格式参数列表(list)或字典(dic)格式的数据将数据写入excel文件write_excel列表(list)或字典(dic)格式的数据excel文件读取txt文件read_txttxt文件的路径列表(list)格式的数据将数据写入txt文件write_txt列表(list)格式的数据txt文件读取docx文档read_wordword文件的路径列表(list)格式的数据计算两个向量的相似度compute_vecsimilar_one_2_one两个向量两个向量的相似度计算一个向量和多个向量的相似度compute_vecsimilar__one_2_many一个向量和一个包含多个向量的列表最大相似度下标最大相似度对应相似度计算多个向量和多个向量的相似度compute_vecsimilar__many_2_many两个分别包含多个向量的列表第一个列表中的每条向量和第二个列表向量中相似度最高的下标最大相似度对应相似度生成词云word_cloud_diagram需要生成词云的文本词云图片保存路径词云图片用来生成词云的词
Package: lct
A tool to aid in completing theAstronomical League’s Lunar and Lunar II observing clubs.
It is written inPythonusingPyQtfor the UI and thepyephemlibrary for lunar
calculations.The program provides general information about the current lunar status. Based on the current
location of the lunar terminator, the program determines the visibility of features required to
complete the observing clubs. Certain requirements are based on the current lunar phase and the
times to and from new moon. These are calculated and presented in a table with indicators that
show when the requirement is occurring (not necessarily visible).InstallingRequirementsPython 2.7PyQt >= 4.8 (not 5)pyephem >= 3.7.4.1tzlocal >= 1.1.1QDarkStyle >= 1.9LinuxThe correct version ofPythonshould already be install on your system. If not, get the 2.7 version
via the appropriate package manager. You will then need to installPyQtlibraries and build tools
packages. The names vary between OS flavors. Next, follow the installation instructions forpipappropriate to Linux. Once that is complete, run the following:pip install lctOSXThe correct version ofPythonshould already be install on your system. To getPyQt, the best
way is viahomebrew:brew install pyqtThen, follow the installation instructions forpipappropriate to OSX. Once that is complete,
run the following:pip install lctWindowsDownload the correct version fromPython. Be sure you note if you install the 64-bit or 32-bit
version of Python. Download the correct associated version ofPyQtfrom their site and install.
Next, download the correct associated version ofpyephemand install. Then, follow the installation
instructions forpipappropriate to Windows. Once that is complete, run the following:pip install lctAlternatively, you can download the associated version of the Lunar Club Tools here. However, you
will need to install two other packages viapip:pip install tzlocal
pip install qdarkstyleRunningAs long as the installation directory forPythonscripts is in your PATH, the program is run via
the following:lunar_club_tools.py
Package: lctools
## lc-toolshttp://novel.github.com/lc-tools/lc-tools is a set of command line tools to control various clouds. It
uses libcloud for cloud related stuff so should support as much cloud
providers as libcloud does.## Installationsudo python setup.py install## DocumnetationTutorial for the latest version is available online:http://novel.github.com/lc-tools/doc/latest/tutorial/This README contains basic information how to get started.## Getting startedWe will use GoGrid as example.First, create config file:~/.lcrcwith the following content:[default]
driver = gogrid
access_id = your_key_id
secret_key = your_passwordIt is self-explanatory. Don’t forget to runchmod 600on it to
keep your credentials secret.When you’re done with the configuration file, you can start managing your
servers. To list the available image, fire up lc-image-list command
in your shell:$ lc-image-list|grep -i centos
image CentOS 5.2 (32-bit) w/ RightScale (id = 62)
image CentOS 5.2 (64-bit) w/ RightScale (id = 63)
image CentOS 5.3 (32-bit) w/ None (id = 1531)
image CentOS 5.3 (64-bit) w/ None (id = 1532)Now, to get a list of available node sizes, do:$ lc-sizes-list
size 512MB (id=512MB, ram=512, disk=30 bandwidth=None)
size 4GB (id=4GB, ram=4096, disk=240 bandwidth=None)
size 2GB (id=2GB, ram=2048, disk=120 bandwidth=None)
size 8GB (id=8GB, ram=8192, disk=480 bandwidth=None)
size 1GB (id=1GB, ram=1024, disk=60 bandwidth=None)So now you know ids of the images and available sizes,
you can use them to create a new node like that:lc-node-add -i 62 -s 1GB -n mynewnodeIt will create a centos node (id = 64) of size 1GB (id = ‘1GB’)
with name ‘mynewnode’.Now, to get a list of nodes, use:$ lc-node-list
100xxx  mynode1     173.204.xx.yy  Running
100xxx  mynode2    173.204.xx.zz  RunningWhen you’re done with the node, you can remove it:$ lc-node-do -i node_id destroywherenode_idis an id of the node you want to destroy. If
you want to reboot node, just pass ‘reboot’ argument to this
command instead of ‘destroy’.## SupportAny feedback is welcome! You can use github to contact me
or plain old email:novel@FreeBSD.org
Package: lcubo_helpers
lcubo_helperssome functions and classes I copy paste in several projects. this is a kitten saverFree software: MIT licenseDocumentation:https://lcubo-helpers.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2016-06-10)First release on PyPI.
Package: lcu-connector
LCU ConnectorThis library serves to make the connection with the League Client API in a simple way, although there are others, such aslcu-driver(which by the way is very good), but with lcu-driver, for example, I couldn't work and structure my code the way I wanted it to, so I decided to make my own wrapper.Quick startI will be brief in the explanation but I guarantee that it will be enough, as this library is simple to use. Among other things, I'm working on more elaborate documentation.So, hand in the dough! Or rather, on the keyboard...InstallationJust use pip and it's fine.pipinstalllcu-connectorHow to useImport theConnectorfrom thelcu_connectormodule, instantiate it and start the session via the.start()method or passing thestart=Trueparameter directly in the instance.fromlcu_connectorimportConnector# Method 01conn=Connector(start=True)# Method 02conn=Connector()conn.start()Now have fun, theConnectorobject has the same attributes as therequestslibrary and derivatives.fromlcu_connectorimportConnectorconn=Connector(start=True)# Getting the data of the currently connected summonerres=conn.get('/lol-summoner/v1/current-summoner')print(res.json())# Getting a summoner's data by namesummoner_name='JohnDoe'res=conn.get('/lol-summoner/v1/summoners?name={summoner_name}')print(res.json())# Performing POST requestdata={'foo':'bar'}res=conn.post('API_URL',data=data)ifres.status_code==200:do_something()conn.stop()You can see all available links for League Client throughLCU Explorer.To-doAPI event watcherBuilt-in functions for commonly used tasks (like a get_summoner_by_name())More detailed documentation
Package: lcu-connectorpy
lcu_connectorpyA Python implementaion ofthislibrary.DownloadVia pip:pipinstalllcu-connectorpyUsagefromlcu_connectorpyimportConnectorconn=Connector()conn.start()print(conn.url,conn.auth,sep='\n')>>>https://127.0.0.1:18633>>>("riot","H9y4kOYVkmjWu_5mVIg1qQ")See thedocsfor more.
Package: lcu-connector-python
This project helps to easily connect to Riot Games' LCU API.
To use this, install withpip install lcu_connector_pythonWhen you want to use it.import lcu_connector_python as lcu
api_connection_data = lcu.connect()If League of Legends is not install in the defualt location, "C:/Riot Games/League of Legends", then you will need to pass the location of your league folder. Example:import lcu_connector_python as lcu
api_connection_data = lcu.connect("C:/Riot Games/League of Legends/RADS/projects/league_client/releases/0.0.0.178/deploy/LeagueClient.exe")The connect() function returns a dictionary which include data required to connect to the LCU{
    port: "localhost port number",
    url: "url used to communicated with the lcu",
    authorization: "auth token",
    connection_method: "http or https"
}
Package: lcu-driver
lcu-driverlcu-driver is a library made to communicate with League of Legends Client API in a easy way. It provides an API capable of handling LCU connection status and websockets events for you and prepare HTTP requests to be used directly with endpoints. Inspired inlcu-connector. It has been tested on Windows, Linux and MacOS.If you don't feel like using lcu-driver or it doesn't suit your needs, I recommend tryingWillump. Willump is an amazing and simple alternative to this library.If you have any questions about how LCU API works or you're having problems with lcu-driver joinRiot API Dev CommunityDiscord server or send a private message to André#5360Download$ pip install lcu-driverProblemsWhen running an application built using lcu-driver, some users will come across theAccessDeniederror. To fix this error you should install psutil in a version earlier than 5.7.0.Running the command below should solve the problem.$ pip install -U psutil==5.6.5DocumentationYou can find lcu-driver documentationhereEndorsementlcu-driver isn’t endorsed by Riot Games and doesn’t reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc.
Package: lcutil
General useful utility functions for Python projects.These are functions I use every day. Ideally they should make their way into the standard library.
I understand we cannot put everything in the standard library, hence this package. ;)The various modules have the following requirements:# util_email
imapclient
pyzmail

# util_fs
unidecode

# util_ftp
ftputil
paramiko

# util_image
pillow

# util_logging
logging_treeIf you only need one module it is recommended you install from source and manage the requirments yourself.Example usage:fromPILimportImagefromlcutilimportutil_emailasuefromlcutilimportutil_imageasuiface=ui.scale_width(Image.open('face.jpg'),100)back=ui.scale_width(Image.open('back.jpg'),100)stiched=ui.stitch_vertical(face,back)stiched.save('/tmp/stiched.jpg')ue.html_email(from_='me <me@example.com>',to=['alice <alice@example.com>'],bcc=['bob <bob@example.com>'],subject='Here is an image for you',html_body='<html><body><h1>Hello World!</h1></body></html>',files=['/tmp/stiched.jpg'],smtp_server='smtp.example.com',smtp_port=25,smtp_username='username',smtp_password='password')
Package: lcviz
Early Development Software WarningLCviz is still very early on in development and is not currently recommended for use.LicenseSeeLICENSE.rstfor more information.ContributingWe love contributions!lcvizis open source,
built on open source, and we’d love to have you hang out in our community.Imposter syndrome disclaimer: We want your help. No, really.There may be a little voice inside your head that is telling you that you’re not
ready to be an open source contributor; that your skills aren’t nearly good
enough to contribute. What could you possibly offer a project like this one?We assure you - the little voice in your head is wrong. If you can write code at
all, you can contribute code to open source. Contributing to open source
projects is a fantastic way to advance one’s coding skills. Writing perfect code
isn’t the measure of a good developer (that would disqualify all of us!); it’s
trying to create something, making mistakes, and learning from those
mistakes. That’s how we all improve, and we are happy to help others learn.Being an open source contributor doesn’t just mean writing code, either. You can
help out by writing documentation, tests, or even giving feedback about the
project (and yes - that includes giving feedback about the contribution
process). Some of these contributions may be the most valuable to the project as
a whole, because you’re coming to the project with fresh eyes, so you can see
the errors and assumptions that seasoned contributors have glossed over.Note:This disclaimer was originally written byAdrienne Lowefor aPyCon talk, and was adapted by
lcviz based on its use in the README file for theMetPy project.
Package: lcw
lcw is likewc-lbut faster, less precise, and equally accurate.usage: lcw [-h] [--sample-size N] [--page-size PAGE_SIZE] [--pattern PATTERN]
           [--regex]
           file [file ...]

Estimate how many lines are in a file.

positional arguments:
  file

optional arguments:
  -h, --help            show this help message and exit
  --sample-size N, -n N
                        How many pages to count (default: 1000)
  --page-size PAGE_SIZE, -p PAGE_SIZE
                        Size of an observation (default: 16384)
  --pattern PATTERN, -e PATTERN
                        The pattern to match (default: b'\n')
  --regex, -r           Use regular expressions (statistically unsound)
                        (default: False)SpeedIt’s faster thanwc-lon big files.$ wc -c big-file.csv
 1071895374 big-file.csv

$ time lcw big-file.csv
2386238 ± 22903 lines (99% confidence)

real    0m0.172s
user    0m0.140s
sys     0m0.027s

$ time wc -l big-file.csv
 2388430 big-file.csv

real    0m1.379s
user    0m1.170s
sys     0m0.197sMathlcw uses elementary statistics to perform unbiased estimates of the
number of lines in a file. It takes a random sample of “pages” within
the file and counts how many newlines are in each page.It multiplies the average count by the number of pages in the file
in order to get its best guess at the number of lines in the file
(the maximum likelihood estimate) and then computes a 99% normal
confidence interval, applying a finite population correction for the
estimate the standard deviation of sample totals.TuningIt is best to use the page size that your storage medium uses;
modern storage media read entire pages at once, so using a page size
that is too small will be bad for performance.The sample size is set with-n, and typical rules of thumb say
that this should be at least 20 for the confidence level to be valid.
The page size is set with-pand should be something like
2048, 4096, 8192, or 16384.Matching things other than newlineYou can count occurrences of a string other than newline; specify
the string with-e. It will be interpreted as a regular expression
if you pass-r. The statistical estimates do not account for the
variable length of regular expression matches, so you are better off
using plain strings if you care about accuracy.Future workI have been thinking about how to quickly sample from lots of files.
Things like lcw can help us with samples within files, but it can be
could be part of a broader survey plan, with cluster sampling or
stratification on directories or filenames and with multistage sampling,
using pilot tests to estimate the costs of the sampling of different
files.lcw presently uses a simple random sample. Because data in text files
often vary with their position within the file, (Later lines often
correspond to later dates.) systematic sampling would be appropriate.Or, does this already exist so I don’t have to write it?
Package: lcwc
python-lcwcpython-lcwc is a Python library for theLCWCincident feed.The library features multiple clients for retrieving incidents: a web scraper, an RSS feed parser, and an ArcGIS REST client. See notes below for more information.Installationpip install lcwcExampleimportaiohttpfromlcwc.feedimportClientclient=Client()asyncwithaiohttp.ClientSession()assession:incidents=awaitclient.get_incidents(session)forincidentinincidents:print(f'{incident.date}-{incident.description}')NotesWeb ClientThe web client uses web-scraping which can be a bit limited for identification purposes but is the most reliable. The web client is the recommended client for use unless you need more granular information such as static identifers.Feed ClientThe feed client uses the RSS feed and is similar to the web client except it overs an (admittedly arbitrary) GUID for each incident. Categorization can be a bit off since the feed doesn't supply that in formation so we have to attempt to extrapolate the category from the incident description/units assigned. Use the web client if you need more accurate categorization.ArcGIS REST ClientThe ArcGIS REST client uses the ArcGIS REST API to retrieve incidents. This is the most accurate client since it uses the same data source as the LCWC website. This is still a bit of a prototype and may be subject to change. The ArcGIS REST client is the recommended client if you need more granular information such as static identifiers and coordinates.
Package: lcwgsus
lcwgsus: processing low-coverage vcf filesLcwgsus is a Python package the Sus has written to perform downstream low-coverage whole-genome sequencing (lcWGS) analysis, hence more of personal use at all releases at the forseeable feature. This package will be properly editted and formatted if related works are about to be published.DocumentationOnline documentation is currently UNAVAILABLE, due to its lack priority :)SeeHowever, feel free to reach out, submit bugs, and/or make suggestions on improvement of this library. All are welcomed!DependenciesLcwgsus supports Python 3.8+.Installation requiresnumpy,pandas,matplotlib,seaborn,statsmodels, andscipy.DevelopmentSee the main site of lcwgsus:https://github.com/Suuuuuuuus/lcwgsus.Bugs shall be submitted to theissue tracker. Please kindly provide a REPRODUCIBLE example demonstrating the problem, otherwise debugging per se is foolhardy :)
Package: lcyutils
# Personal Tools写这个个人仓库的目的是为自己的代码提供一些可以直接调用的常用的东西。当前一个需求是以邮件/QQ消息（需要结合服务器部署的QQrobot来做，比较烦）的形式来实现远端跑代码时候的自动化提醒，就不需要我自己一个个的去check。## 使用查看当前有哪些写好的文件：`python import lcytools.help lcytools.help.fileList() `# code## qqmessage这是个很有意思的工具接口，通过这个接口，只要添加QQ 1794957373为好友之后调用函数就可以直接获得推送的消息。一个样例：`python import lcytools.qqmessage as qqPush qqPush.lcy_qqmessage_help()qqPush.lcy_qqmessage(qq="1157***882就是你的QQ",message="来一条测试消息~")`然后你的QQ就可以接收到相应的消息推送。<img src=”https://luochengyu.oss-cn-beijing.aliyuncs.com/img/image-20220519151316793.png” alt=”image-20220519151316793” style=”zoom:80%;” />这比较有利于在远端跑程序的时候可以直接调这个函数，通过QQ接收进度推送。不需要不停的连接到远端，在手机上就可以便捷的查看进度了~## emailMe给自己发送文件，调用方式：`python import lcytools.emailMe as eMeM.lcy_email(["11158340882@qq.com"],key= "这是一个防止SMTP密码丢掉的自己密码hh") `## help提供一个查询接口，发送一下当前有哪些东西
Package: lcz
LCZSimplified Leela Chess Zero with PythonProvides a simple interface around the originalLCZero python bindingsUsageimportlczlcz.eval(fens=['rnbqkbnr/pp2pppp/2p5/3p4/3PP3/8/PPP2PPP/RNBQKBNR w KQkq - 0 3','r2qkbnr/pp2pppp/2n5/3p1b2/3P1B2/5N2/PPP2PPP/RN1QKB1R w KQkq - 4 6'],weights_path='/path/to/lcz.pb.gz')# if not specified, uses the pre-packaged 'maia-1900.pb.gz'# [{'b1d2': 0.008045054972171783, # [0, 1] probabilities (softmaxed)#   'b1a3': 5.8913348766509444e-05,#   'b1c3': 0.21684584021568298,#    ...#   },#   {'b1d2': 0.015918008983135223,#    'b1a3': 0.0013550063595175743,#    'b1c3': 0.09632844477891922,#    ...#   }]Heads upExpect it to take ages to build, as the whole C++ lib gets compiled. You can usepip install -vto check progress
Package: lczerolens
lczerolens :mag:Leela Chess Zero (lc0) Lens: a set of utilities to make the analysis of Leela Chess Zero networks easy.Getting StartedInstallspipinstalllczerolensLoad a ModelBuild a model from leela file (convert then load):fromlczerolensimportAutoBuildermodel=AutoBuilder.from_path("leela-network.onnx")Predict a MoveUse a wrapper and the utils to predict a policy vector and obtain an UCI move:importchessimporttorchfromlczerolensimportmove_utils,ModelWrapper# Wrap the modelwrapper=ModelWrapper(model)board=chess.Board()# Get the model predictionsout=wrapper.predict(board)policy=out["policy"]# Use the predictionbest_move_index=policy.argmax()move=move_utils.decode_move(best_move_index)board.push(move)print(uci_move,board)Compute a HeatmapUse a lens to compute a heatmapfromlczerolensimportvisualisation_utils,LrpLens# Get the lenslens=LrpLens()# Compute the relevanceassertlens.is_compatible(wrapper)relevance=lens.compute_heatmap(board,wrapper)# Choose a plane index and render the heatmap on the boardplane_index=0heatmap=relevance_tensor[plane_index].view(64)ifboard.turn==chess.BLACK:heatmap=heatmap.view(8,8).flip(0).view(64)svg_board,fig=visualisation_utils.render_heatmap(board,heatmap,normalise="abs")Convert a NetworkTo convert a network you'll need to have installed thelc0extra:pipinstalllczerolens[lc0]fromlczerolensimportlczeroaslczero_utilslczero_utils.convert_to_onnx("leela-network.pb.gz","leela-network.onnx")DemoAdditionally, you can run the gradio demo locally (also deployed on HF). First you'll need gradio, which is packaged in thedemoextra:pipinstalllczerolens[demo]And then launch the demo (running on port8000):makedemoFull Documentation:red_circle: Documentation coming soon.ContributeSee the guidelines inCONTRIBUTING.md.