Saravanan666/pypi-org huggingface dataset:
Package: tkVideo
tkVideoPython module for playing videos (without sound) inside tkinter Label widget using Pillow and imageioAbout The ProjecttkVideo is a Python module for playing videos in GUIs created with tkinter. It does so by binding to atkinter.Labelwidget of the user's choice and rapidly changing its image object.Built Withtkinter (Python built-in)imageioPillowInstallationEnd-users:Clone the repo and runsetup.pygitclonehttps://github.com/huskeee/tkvideo.git
python./tkvideo/setup.pyorInstall the package from PyPIpipinstalltkvideoDevelopers and contributorsClone the repo and install the module in developer modegitclonehttps://github.com/huskeee/tkvideo.git
python./tkvideo/setup.pydeveloporInstall the package from PyPI in editable modepipinstall-etkvideoThis will create a shim between your code and the module binaries that gets updated every time you change your code.UsageImport tkinter and tkvideoCreateTk()parent and the label you'd like to useCreatetkvideo.tkvideoobject with its parameters (video file path, label name, whether to loop the video or not and size of the video)Start the player thread with<player_name>.play()Start the Tk main loopExample code:fromtkinterimport*fromtkvideoimporttkvideoroot=Tk()my_label=Label(root)my_label.pack()player=tkvideo.tkvideo("C:\\path\\to\\video.mp4",my_label,loop=1,size=(1280,720))player.play()root.mainloop()Issues / suggestionsHave a problem that needs to be solved or a suggestion to make? See theissuespage.LicenseDistributed under the MIT License. SeeLICENSEfor more information.ContactXenofon Konitsas -@huskeeeeee-konitsasx@gmail.comProject Link:https://github.com/huskeee/tkvideoSpecial thanks to@Pythonistaon StackOverflow for the frame loading codeReadme file created usingOthneil Drew's awesome template â™¥
Package: tkvideo-moviepy
tkVideoPython module for playing videos (without sound) inside tkinter Label widget using Pillow and imageioAbout The ProjecttkVideo is a Python module for playing videos in GUIs created with tkinter.
It does so by binding to atkinter.Labelwidget of the user's choice and rapidly changing its image object.Built Withtkinter (Python built-in)imageioPillowInstallationUsersFrom PyPIpipinstalltkvideoFrom cloned repogitclonehttps://github.com/MysteryBlokHed/tkvideo-moivepycdtkvideo-moviepy
pythonsetup.pyinstallDevelopers and contributorsFrom cloned repogitclonehttps://github.com/MysteryBlokHed/tkvideo-moivepycdtkvideo-moviepy
pythonsetup.pydeveloporEditable mode from PyPIpipinstall-etkvideo-moviepyThis will create a shim between your code and the module binaries that gets updated every time you change your code.UsageImport tkinter and tkvideo-moviepyCreateTk()parent and the label you'd like to useGet a moviepy videoCreatetkvideoobject with its parameters (moviepy clip, label name, whether to loop the video or not and size of the video)Start the player thread with<player_name>.play()Start the Tk main loopExample code:fromtkinterimport*fromtkvideoimporttkvideofrommoviepy.editorimportVideoFileCliproot=Tk()my_label=Label(root)my_label.pack()clip=VideoFileClip('path/to/video.mp4')player=tkvideo(clip,my_label,loop=1,size=(1280,720))player.play()root.mainloop()Issues & SuggestionsHave a problem that needs to be solved or a suggestion to make? See theissuespage.LicenseDistributed under the MIT License. SeeLICENSEfor more information.
Package: tkvideoplayer
TkVideoplayerThis is a simple library to play video files in tkinter. This library also provides the ability to play, pause,
skip and seek to specific timestamps.Example:importtkinterastkfromtkVideoPlayerimportTkinterVideoroot=tk.Tk()videoplayer=TkinterVideo(master=root,scaled=True)videoplayer.load(r"samplevideo.mp4")videoplayer.pack(expand=True,fill="both")videoplayer.play()# play the videoroot.mainloop()read the documentationhereyou can easily integrate this withCustomTkinteras well: referHow to integrate with CustomTkinter?Please immediately upgrade to the latest version if you are using version 1.3 or belowSample video player made using tkVideoPlayer:Note the above is a video player made using this library. The UI doens't come along with the library. Refer example on how to build the video playerhereOther libraries you might be interested in:tkstylesheet- Helps you style your tkinter application using stylesheets.tkTimePicker- An easy-to-use timepicker.PyCollision- Helps you draw hitboxes for 2d games.Donate:I'm a passionate supporter of open-source initiatives. Developing and maintaining open-source projects requires a significant commitment of time and effort. My goal is to transition to working on open-source projects on a full-time basis. If you'd like to support me and the open-source community, please consider making small donations so I can dedicate more time to open-source work.DonateOther ways to supportThe sitehttps://adostrings.comand some of the production grade apps for sale to support open-source initiatives. Send mail topaul@adostrings.comto get to know more.
Package: tkviews
tkviewspyviewsadapter for tkinter. It allows to create ui widgets using xml with binding.InstallationInstall using pip:pip install tkviewsTo install dev version:pip install git+https://github.com/eumis/tkviews.git@devDemo applicationTo get started using tkviews see demo app.Clone repository to folder([root_folder])Run following command to install tkviews packagepip install [root_folder] -eTo run demo app execute following commandscd [root_folder]\demo
python run.pyDocsSee some documentation indocsfolderLicenseMITCopyright (c) 2017-present, eumis (Eugen Misievich)
Package: tkvlc
PyTkinterVLCThis is a simplified version of theOfficial VLC Tkinter Examplemade to fit my personal needs.Works on Windows [Tested on Windows 10 64-Bit]Works on Linux (Xorg) [Tested on Arch Linux 64-Bit With DWM]Probably Won't Work on macOS [Not Tested]InstallationpipinstalltkvlcUsageExampleimporttkvlcexampleVideoURL="https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_10mb.mp4"exampleVideoTitle="Bunny Video"exampleIconPath="./icons/vlcCone.ico"player=tkvlc.Player(video=exampleVideoURL,title=exampleVideoTitle,iconPath=exampleIconPath)player.start()Video Player Key BindingsSpace = Pause/ResumeUp Arrow = Increase Volume By 5%Down Arrow = Decrease Volume By 5%Right Arrow = Go Forward 30 secondsLeft Arrow = Go Backward 30 secondsF = Toggle fullscreenM = Mute/UnmuteQ = QuitE = Quit
Package: tkwebview2
tkwebview2tkinter浏览器-网页组件，tkwebview2登场！！！基于pythonnet-webview绑定和WebView2.Core，将受到微软WebView2的持续改进支持，外观和效能相比tkinterie得到大幅度改进。依赖以下是tkwebview2的依赖库：pythonnet(clr)pywebview(webview)使用方法WebView2(master,width:int,height:int,url:str='',**kw)'''master::父组件width::初始宽度height::初始高度url::网址或html文件，可以为空**kw::其它Frame参数'''例子：fromtkinterimportTkfromtkwebview2.tkwebview2importWebView2,have_runtime,install_runtimeclr.AddReference('System.Windows.Forms')clr.AddReference('System.Threading')fromSystem.Windows.FormsimportControlfromSystem.ThreadingimportThread,ApartmentState,ThreadStart#范例defmain():ifnothave_runtime():#没有webview2 runtimeinstall_runtime()root=Tk()root.title('pywebview for tkinter test')root.geometry('1200x600+5+5')frame=WebView2(root,500,500)frame.pack(side='left')frame.load_html('<h1>hi hi</h1>')frame2=WebView2(root,500,500)frame2.pack(side='left',padx=20,fill='both',expand=True)frame2.load_url('https://smart-space.com.cn/')root.mainloop()if__name__=="__main__":t=Thread(ThreadStart(main))t.ApartmentState=ApartmentState.STAt.Start()t.Join()必须在STA线程模式创建窗口方法get_url()返回当前url。evaluate_js(self,script,callback=None)执行JavaScript代码，并返回最终结果。callback绑定一个函数，回调js执行返回内容。load_css(self,css)加载CSS样式。load_html(self,content,base_uri=None)加载HTML代码，base_uri为基本URL，默认为本程序启动目录。load_url(self,url)加载全新url。reload(self)重新加载页面。event_new_window(self,command=None)绑定新窗口事件event_core_completed(self,command)响应core核心初始化事件。可获取self.core。更多方法请使用底层类：self.web::WebView2 Classself.core::CoreWebView2 Class（需要页面加载完成后可用，或绑定加载完成事件）判断WebView2 runtime是否存在并处理tkwebview2提供了两个函数：have_runtime,install_runtime。have_runtime()判断运行环境是否存在，存在返回True，不存在返回False。fromtkwebview2.tkwebview2importhave_runtimeprint(have_runtime())install_runtime()下载并安装运行环境。fromtkwebview2.tkwebview2importhave_runtime,install_runtimeifnothave_runtime():install_runtime()注意：该函数会暂停程序运行，直到安装界面被用户手动关闭。期间，会下载安装程序到当前工作目录，安装完成后会自动删除。What's new-3.5.0-fixinitializationbug caused by pywebview new version.-3.4.0-text_select, menu, devtools  are enabled.-3.3.3-add new demo contributed bytt68686,002.pyLicene: MPL v2.0.-3.3.2-fix the js function.-3.3.1-fix animportbug.-3.3.0-Delete the NewWindowRequest event.-3.2.0-Add some functions. Add some event callback methods. Download setup.exe in working path.-3.0.0-Using EdgeChrome in pywebview as widget instead of pywebview's window. More powerful.-2.0.1-[fix]Addtry ... except ...to avoid error when importing as a test or a package.-2.0.0-You can use functionhave_runtimeandinstall_runtimeto check or download WebView2 Runtime in your application conveniently.-1.2.0-You can use it when you add a WebView in your window separately. However, you should destroy it when you want to close a window or a widget.-1.1.0-Upload to PYPI.
Package: tkwidgettree
TkWidgetTree============Build trees of Tk widgets from a dict structure or use the FileParser classto load them from a JSON file.Details-------TkWidgetTree is a wrapper for the various Tk widgets (Frames, Buttons, Menu:s,etc.), it is most conveninetly invoked with the TkWidgetTree.from_dict(tree,root) static method, it builds a tree structure of TkWidgetTree objects fromnested dicts with the input to the TkWidgetTree constructor.The parameters to the constructor are:name		- The Tk widget class to create or the name of the widgetparent*		- The Tk widget that will be used as the parent(tk.Button(parent, ...)id*		- A tree-unique name for this widget, for when you want tofind it for setting callbacks or fetching values (or whatever)options*	- A dict containing the options passed to the widget creation(tk.Button(parent, **options))pack*		- A dict containing the options to give to the pack method. Thisclass only supports the pack arrangement method for themoment.children*	- A list of child TkWidgetTree:s. The widgets in this list willget this widget set as the parent when render()ing.[*] OptionalYou can then run the render() method on the root of your tree and they willbe recursively created. Once you've rendred all the widgets, you can set upyour callbacks by first finding your buttons/sliders whatnot by calling thefind method and using the TkWidgetTree.widget parameter to further set upthe widgets....config={'name': 'Frame','children': [{'id': 'mybutton','name': 'Button','options': { 'text': 'Hello World' },'pack: { 'side': tk.LEFT }}]}tree = TkWidgetTree.from_dict(config)tree.render()button = tree.find('mybutton')button.widget.config(callback=do_stuff)tree.mainloop()...Loading from a file-------------------But keeping a chunky dict of your application in the source is still prettyclunky, so why not put the structure in a file instead? That's where theFileParser class comes in. It essentially reads a JSON-serialized version ofthe above structure, with one small twist; any Tk constants you might want touse are set as strings, with the key prefixed by an @-sign.... "pack": { "@side": "LEFT" } ...
Package: tkwinico
tkwinico为Windows系统提供开发系统托盘的功能。注意事项版本号前两位是库的版本号，后一位则是Winico的版本号。如x.x.71或x.x.6，Winico的71版本支持x64位电脑
而6版本支持x32位电脑
请按需要安装仅支持Windows系统示例fromtkwinicoimport*importtkinterastkWindow=tk.Tk()Ico=Winico(Window)defCallBack(Message,X,Y):ifMessage=="WM_RBUTTONDOWNessage":Menu=tk.Menu(tearoff=False)Menu.add_command(label="Quit",command=Window.quit)Menu.tk_popup(X,Y)Ico.tray_add(Ico.icon(APPLICATION),callback=CallBack,callback_args=[MESSAGE,X,Y])Window.mainloop()
Package: tkwinterm
Windows Terminal EmulatorThis project is a fully functional terminal emulator application for Windows.FeaturesLocal terminal emulation on Windows.Tabbed interface for managing multiple terminal sessions.Support for text-based UI applications likeVIMandhtopwill work when ssh'd to a linux host.Customizable appearance and behavior.Screen ShotsLibraries Usedtkinter: Standard GUI toolkit for Python used for the application interface.pyte: A simple VTXXX-compatible terminal emulator library used for interpreting escape sequences and managing the terminal state.uuid: For generating unique identifiers for terminal sessions.threading: For managing concurrent operations.winpty: A Windows software package providing an interface to the Windows pseudo terminal (WinPTY).Key ClassesApp: The main application class that initializes the GUI, manages terminal tabs, and handles user interactions.Terminal: A class representing a single terminal instance. It handles the rendering of the terminal screen, input events, and terminal resizing.WinPtyHandler: This class manages the interaction with the local Windows command line, encapsulating the functionality provided by WinPTY.KeyHandler: A utility class for interpreting keyboard input and sending it to the terminal.MethodologyThe core of the terminal emulation is handled bypyte. Here's how it's integrated into our application:Terminal Output Handling: When output from the command line is available, it is fed intopyte'sByteStreamobject.pyteinterprets this data, which includes processing escape sequences and maintaining an in-memory representation of the terminal's screen.Screen Rendering: TheTerminalclass translatespyte's in-memory screen into text and colors in thetkinter.Textwidget. This involves converting the screen's character cells into styled text that can be displayed in the GUI.Input Handling: User input from the keyboard is captured by theKeyHandlerand sent to theWinPtyHandler. For remote connections, input would be sent via an SSH channel.Terminal Resizing: When the terminal window is resized, bothpyteandWinPtyHandlerare informed of the new dimensions.pyteuses this information to update its screen model, andWinPtyHandleradjusts the pseudo terminal accordingly.Session Management: Each terminal tab has a unique session, identified by a UUID. This allows for multiple independent terminal sessions within the application.Getting StartedTo run the application, ensure you have Python installed and the required packages available. Clone the repository, and run the main script:pythonmain_winpty.pyContributionsContributions to the project are welcome. Please fork the repository and submit a pull request with your enhancements.LicenseThis project is licensed under the GPLv3 License - see the LICENSE file for details.Build# Create a wheelpipinstallwheelsetuptoolspythonsetup.pysdistbdist_wheel
Package: tkx
DocumentationDevelopment Roadmaptkx (tkinter (e)xtension) *tkx (pronounced "tics") is a GUI library built on top of tkinter with the intention of minimizing pain while setting up user interfaces. As it stands, tkx isheavilyunder development and it could be quite a while before it reaches maturity.One of the first ideas in the conception of tkx was implementing support for CSS, the straightforward syntax of which would make styling tkinter widgets far less painful and verbose. This will also allow developers to separate visual styles from logic.As it stands, tkx doesn't change much. Here are two code examples with identical output:Without tkximporttkinterastkdefmain():# Create a window.root=tk.Tk()root.title("Hello, World!")root.pack_propagate(0)# Add some text.tk.Label(root,text="This is some text.").pack()# Run the application.root.mainloop()if__name__=="__main__":main()Note:root.pack_propagate(0)is used to prevent the window from resizing to match the size of thetk.Labelobject. This is the default behavior in tkx, as shown below.With tkximporttkinterastkimporttkxdefmain():# Create a window.root=tkx.Window("Hello, World!")# Add some text.root.add(tk.Label,text="This is some text.")# Run the application.root.mainloop()if__name__=="__main__":main()On Windows systems, both programs above will output a window resembling the following:CSS StylesheetsAll it takes to style elements with tkx is a CSS file and aStylesheetobject. Consider the following code:importtkinterastkimporttkxdefmain():# Define a stylesheet and main window.stylesheet=tkx.Stylesheet("./main.css")root=tkx.Window("Test!",stylesheet)# Add a button and give it some functionality.btn=root.add(tk.Button,text="Click me!")btn.bind("<Button-1>",lambda_:print("Hello, World!"))# Add some text.root.add(tk.Label,text="This is text!")root.add(tk.Label,text="This is some more text!")root.mainloop()if__name__=="__main__":main()And the following CSS stylesheet:/* main.css */:root{--bg:#333;--fg:#ddd;--blue:#0ac;}Window{background:var(--bg);width:300;height:120;}Button{background:var(--blue);border-style:flat;color:black;}Label{background:var(--bg);border-style:flat;border-width:2;color:var(--fg);}The above code outputs the following:* Name is subject to change.
Package: tky
【tky】 _ Python方法集合项目项目介绍Tang kai yue 个人整合部分使用的python方法；本项目是用于记录个人使用的一些Python方法类汇总合集，以方便后续在使用的时候借鉴或复用；
类似笔记形式，减少后续查找的成本和提高类工作生产力，如对本内容感兴趣的欢迎一起来添砖加瓦；文件结构tky               |  pip包名
|-  __init__.py
|-  t_sql.py      |  SQL类集合（SQL/ES...）
|-  t_jde.py      |  判断类集合（判空/匹配...）
|-  t_gui.py      |  GUI类集合（点击/清除/输入/扫描元素...）
|-  t_msg.py      |  消息类集合（企业微信...）
|-  t_file.py     |  文件类集合（Jenkins/文件夹/Excel...）
|-  t_dev.py      |  DEV类集合（APP/PC浏览器...）
|-  t_tsg.py      |  测试数据类集合（随机数据生成...）
|-  tky_test.py   |  tky模块 测试文件（部分示例内容...）操作相关一、安装pip官源安装：pip install tkypycharm工具安装：设置-项目-Python解释器-新增包-搜索tky-安装；二、升级升级：pip install --upgrade tky三、卸载卸载：pip uninstall tky使用说明工具包在使用时有模块依赖，发现报没模块的异常时，请安装对应的工具包；具体的清单以在下方列出；模块依赖清单：import re, os
import json
import urllib.request
import cx_Oracle
import pymysql
import datetime
import string
import random
import xlrd (建议使用1.2.0的包，支持XLSX格式)
import selenium.webdriver.support.ui as ui
from openpyxl import load_workbook
from appium import webdriver
from selenium import webdriver
from xml.dom import minidom
from setuptools import find_packages, setup
from elasticsearch import Elasticsearch, helpersPIP安装指令：pip install re
pip install os
pip install json
pip install urllib
pip install time
pip install datetime
pip install string
pip install random
pip install cx_Oracle == 8.0.1
pip install pymysql
pip install xlrd  == 1.2.0
pip install selenium == 3.141.0
pip install openpyxl
pip install appium == 0.43
pip install xml.dom
pip install setuptools == 50.3.0
pip install elasticsearch == 7.9.1
pip insatll math

PS：包的版本仅为建议项！！！版本日志版本：1.2.1 【20210430】
    1、更新t_sql.py的SQL方法,mysql连接时启用自动提交事务；
    2、汇总个人环境的依赖包；
    
 版本：1.2.0 【20210430】
    1、更新t_sql.py的SQL方法,新增了新的Mysql链接操作方法类，子方法：sel_dict/sel_sql/iud_sql/close/page_mus；
    2、新增t_jde.py的Jde_o方法,子方法 时间计算：change_time；
    3、优化部分文件/方法的注释信息；

 版本：1.1.9 【20210324】
    1、更新t_sql.py的SQL方法,新增/修改了方法名称set_val/upd_del/clear/close；【非常重要！！！】
    2、优化部分文件/方法的注释信息；

 版本：1.1.8 【20210316】
    1、新增字符串转换方法（t_jde.val_case）；
    2、优化部分文件/方法的注释信息；

 版本：1.1.7 【20210315】
    1、新增企业微信机器人消息推送（暂只支持：text/markeown 类型）；
    2、优化部分注释信息；
    
 版本：1.1.6 【20210305】
    1、修复XML读取方法时的BUG；
    
 版本：1.1.5 【20210130】
    1、新增部分测试文件，自由匹配/数据库连接及部分查询引用示例；
    2、新增数据库Mysql连接方法，依赖pymysql；
    3、模块各方法测试覆盖75%+；
    4、优化部分方法；
    
 版本：1.1.4 【20210129】
    1、新增部分测试文件，文件与EXCEL部分引用示例；
    2、修复空判断的部分方法问题；
    
 版本：1.1.3 【20210128】
    1、新增测试文件，含部分引用示例；
    2、修复部分方法问题；
    3、优化部分判断和注释说明；
    
 版本：1.1.2 【20210127】
    1、新增随机数生成方法类，t_tsg；
    2、修复部分方法问题；
    3、更新部分项目说明；
 
 版本：1.1.1 【20210127】
    1、修复部分注释对应问题；
    2、GUI方法新增自定义时间参数；
    3、更新部分项目说明；
    
 版本：1.1.0 【20210127】
    1、部分方法测试验证完成，暂未完成完全测试；
    2、修复部分方法调用异常的问题；
    3、新增方法注释；
    4、项目代码，上传码云：https://gitee.com/tangkaiyue/tky参与贡献欢迎一起参与整合，集合更多的方法调用；【1】 Tangkaiyue （创建仓库/分支，提交代码）-=-=-=【 其 他 联 系 】=-=-=-
Q群1：528996178 (主)
Q群2：737511778
PIP：https://pypi.org/project/tky
码云：https://gitee.com/tangkaiyue/tky如果您喜欢这个项目还请给个关注，谢谢！作者：Tang kai yue 
邮箱：tky_1314@163.com
Package: tky2jgd
TKY2JGD国土地理院のTKY2JGDをPythonに移植したものです。オリジナルのTKY2JGDはhttp://vldb.gsi.go.jp/sokuchi/tky2jgd/download/down.cgiからダウンロードできます。座標変換パラメータファイルdata/TKY2JGD.parはv2.1.1を使用しています。Usage$ python3 tky2jgd.py 36.103774791666666 140.08785504166664
36.10696628160147 140.08457686629436>>> import tky2jgd
>>> tky2jgd.load_parameter("data/TKY2JGD.par")
>>> lat, lon = 36.103774791666666, 140.08785504166664
>>> dB, dL = tky2jgd.bilinear(lat, lon)
>>> lat += dB / 3600
>>> lon += dL / 3600
>>> print(lat, lon)
36.10696628160147 140.08457686629436
Package: tkyml
Project tkymlJust a relatively simple module to separate declarative and programative part of the creation of a tkinter UI.
The declarative part is in a yaml file while we reach our needed widget and used it in the python code (logic).
It's fully python based so it may be not very fast but it will do the thing on small project.See more about the syntax and plus in thedocumentations,
also you should go check theexemplesto learn a bit more.WarningThe project isn't available on other OS than windows due to depencies of some windows only modules allowing transparency on widget.InstallationIt is now available on pypihereso you can go along with :pip install tkymlAuthors@LoucasMaillet
Package: tkz
TikZ Figure GeneratorThe following is a code example for creating a plot with this library::importnumpyasnpimporttkzK=1000x=np.linspace(0,1.001,K)y=3*np.sin(2*np.pi*x)+0.5*np.random.randn(K)z=3*np.cos(2*np.pi*x)+0.5*np.random.randn(K)u=np.zeros((2,K))u[0,:]=np.row_stack((y,z)).min(axis=0)-2u[1,:]=np.row_stack((y,z)).max(axis=0)+2fig=tkz.Fig('test')fig.xlabel='x axis'fig.ylabel='y axis'fig.path(x,u,thickness=0,opacity=0.2)fig.path(x,y,label='first')fig.path(x,z,label='second')fig.render()First, a figure object is created withtkz.Fig(). This object holds settings
pertaining to the whole figure, like the width, height, and font size. Second,
path objects are created withfig.path(), which creates aPathobject and
appends it to the list of path objects held by theFigobject. This object
holds everything pertaining to a particular path, like thexandyarrays,
thethickness,color,opacity,dashstyle, andlabel. To render the
figure, pass the list of paths to the figure object with the.render()method.
Note, the default setting is for the LaTeX file to be generated as a standalone
file with its own document class declaration and preamble. When it is
standalone, this Python library will then try to automatically compile the LaTeX
file with thepdflatexcommand. Ifstandaloneis set toFalsethen only
the TikZ draw commands will be included. This file can then beinputwithin
thetikzpictureenvironment of another LaTeX file.
Package: tkzs
tkzsInstallationpipinstalltkzsUse a simple tokenizerfromtkzs.tokenizersimportre_tokenizertxt="Contrastive Fine-tuning Improves Robustness for Neural Rankers"re_tokenizer(txt)Use a spacy word tokenizerfromtkzs.tokenizersimportSpacyTokenizertxt="Contrastive Fine-tuning Improves Robustness for Neural Rankers"tokenizer=SpacyTokenizer(name='en_core_web_sm')tokenizer.tokenize(txt)Use a word encoderfromtkzs.encodersimportWordEncoderfromtkzs.tokenizersimportre_tokenizerdocs=["Contrastive Fine-tuning Improves Robustness for Neural Rankers","Unsupervised Neural Machine Translation for Low-Resource Domains via Meta-Learning","Spatial Dependency Parsing for Semi-Structured Document Information Extraction"]encoder=WordEncoder(tokenizer=re_tokenizer)encoder.fit(docs)encoder.batch_tokenize(docs)# return a list of tokenized sequenceencoder.encode_batch(docs)# return a tensor of size [batch_size, max_length]Use a byte encoderfromtkzs.encodersimportByteEncoderfromtkzs.tokenizersimportre_tokenizerdocs=["Contrastive Fine-tuning Improves Robustness for Neural Rankers","Unsupervised Neural Machine Translation for Low-Resource Domains via Meta-Learning","Spatial Dependency Parsing for Semi-Structured Document Information Extraction"]encoder=ByteEncoder()# return a tensor of shape [Batch, Word, Char]encoder.encode_batch(docs,char_padding='center',word_length=None,tokenizer=re_tokenizer)