Saravanan666/pypi-org huggingface dataset:
Package: deep-lincs
deep_lincsA deep learning wrapper around Keras forLincsL1000 expression data.Check out the documentationhere.Installation$pipinstalldeep-lincsGetting startedThe data for 1.3 million L1000 profiles are availabeon GEO. The script load_files.sh fetches theLevel 3data along with all metadata available. The largest file is quite big (~50Gb) so please be patient.$gitclonehttps://github.com/manzt/deep_lincs.git&&cddeep_lincs
$sourceload_files.sh# download raw data from GEO$cdnotebooks$jupyterlab# get started in a notebookL1000 DatasetTheDatasetclass is built with a variety of methods to load, subset, filter, and combine expression and metadata.fromdeep_lincsimportDataset# Select samplescell_ids=["VCAP","MCF7","PC3"]pert_types=["trt_cp","ctl_vehicle","ctl_untrt"]# Loading a Datasetdataset=Dataset.from_yaml("settings.yaml",cell_id=cell_ids,pert_type=pert_types)# Normalizing the expression datadataset.normalize_by_gene("standard_scale")# Chainable methodssubset=dataset.sample_rows(5000).filter_rows(pert_id=["ctl_vehicle","ctl_untrt"])ModelsModels interface with theDatasetclass to make training and evaluating different arcitectures simple.Single Classifierfromdeep_lincs.modelsimportSingleClassifiermodel=SingleClassifier(dataset,target="cell_id")model.prepare_tf_datasets(batch_size=64)model.compile_model([128,128,64,32],dropout_rate=0.1)model.fit(epochs=10)model.evaluate()# Evaluates on isntance test Datasetmodel.evaluate(subset)# Evalutates model on user-defined DatasetMultiple Classifierfromdeep_lincs.modelsimportMutliClassifiertargets=["cell_id","pert_type"]model=MutliClassifier(dataset,target=targets)model.prepare_tf_datasets(batch_size=64)model.compile_model(hidden_layers=[128,128,64,32])model.fit(epochs=10)model.evaluate()# Evaluates on isntance test Datasetmodel.evaluate(subset)# Evalutates model on user-defined DatasetAutoencoderfromdeep_lincs.modelsimportAutoEncodermodel=AutoEncoder(dataset)model.prepare_tf_datasets(batch_size=64)model.compile_model(hidden_layers=[128,32,128],l1_reg=0.01)model.fit(epochs=10)model.encoder.predict()# Gives encodings for instance test Datasetmodel.encoder.predict(subset)# Gives encodings for user-defined Dataset
Package: deeplite-model-converter
Deeplite Model ConverterCollaboration is one of the biggest challenge is designing deep learning based solutions. There are multiple formats available using which a deep learning mdoel can be expressed: PyTorch, Tensorflow, ONNX, TFLite. This open source converter library aims to convert convert deep learning models from one format to another.InstallationInstall using pipInstall from sourceInstall in Dev modeHow to UsePyTorch2ONNXTF2TFLiteExamplesSupported ConvertersContribute a ConverterInstall using pipUse following command to install the package from our internal PyPI repository.$pipinstall--upgradepip$pipinstalldeeplite-model-converterInstall from source$gitclonehttps://github.com/Deeplite/deeplite-model-converter.git$pipinstall.Install in Dev mode$gitclonehttps://github.com/Deeplite/deeplite-model-converter.git$pipinstall-e.$pipinstall-rrequirements-test.txtTo test the installation, one can run the basic tests usingpytestcommand in the root folder.NOTE:Currently, we support Tensorflow 2.4+ versions, and onnxruntime 1.8. Wedo notsupport all the OPSET versions of ONNX, yet.How to UsePyTorch2ONNX# Step 1: Define native pytorch dataloaders and modeldata_splits=/*...loaditerabledataloaders...*/model=/*...loadnativedeeplearningmodel...*/# Step 2: Instantiate a converter objectpytorch2onnx=PyTorch2ONNX(model=model)pytorch2onnx.set_config(precision='fp32',device=Device.CPU)# Step 3: Convert the format and savedataloader=TorchProfiler.enable_forward_pass_data_splits(data_splits)rval=pytorch2onnx.convert(dataloader,dynamic_input='bchw',path="model.onnx")TF2TFLite# Step 1: Define native Tensorflow modelmodel_conc_functions=/*...loadTFnativemodelasconcretefunctions...*/# Step 2: Instantiate a converter objecttf2tflite=TF2TFLite(model=model_conc_functions)# Step 3: Convert the format and savetflite_model,rval=tf2tflite.convert()tf2tflite.save(tflite_model,"model.tflite")ExamplesTo run an example,pip install deeplite-torch-zoo
python examples/converters/pytorch2tflite.pySupported ConvertersThe following converters are supported till now,pytorch2onnxpytorch2jitonnx2tftf2tfliteContribute a ConverterWe always welcome community contributions to expand the scope ofdeeplite-model-converterand also to have additional new converters. In general, we follow thefork-and-pullGit workflow.Forkthe repo on GitHubClonethe project to your own machineCommitchanges to your own branchPushyour work back up to your forkSubmit aPull requestso that we can review your changesNOTE: Be sure to merge the latest from "upstream" before making a pull request!
Package: deeplookup
Deep Lookup - Deep Learning for Domain Name SystemInstallationInstallation Using PyPipipinstalldeeplookupUsing DeepLookupDeepLookup provides aResolverinstance that inheritsdns.resolver.ResolverfromdeeplookupimportResolverresolver=Resolver()foripinresolver.resolve("google.com","A"):print(f"ip:{ip.to_text()}")The code above performs a verification of a queried name using a neural network trained
to detect malicious queries (DGAsand tunnels). For the example above the
output will look like following:ip:142.250.184.206When the queried name is generated using domain generation algorithm, the resolver throwsdns.resolver.NXDOMAINwithout even accessing a remote name server.foripinresolver.resolve("mjewnjixnjaa.com","A"):print(f"ip:{ip.to_text()}")The example above throwsdns.resolver.NXDOMAINerror with the following
message:dns.resolver.NXDOMAIN:TheDNSquerynamedoesnotexist:mjewnjixnjaa.com.TrainingThe model is trained usingtfxpipeline, where the training dataset is uploaded,
split into the training and evaluation subsets and then used to fit the neural network.In order to trigger the training pipeline use the following command:python-mdeeplookup.pipeline.gta1This command creates a folder called "tfx", where all artifacts are persisted. See thetfx/pipelines/gta1/serving_model/gta1/*folder to access the model in HDF5 format.PublicationsBubnov Y., Ivanov N. (2020) Text analysis of DNS queries for data exfiltration protection of computer networks,Informatics, 3, 78-86.Bubnov Y., Ivanov N. (2020) Hidden Markov model for malicious hosts detection in a computer network,Journal of BSU. Mathematics and Informatics, 3, 73-79.Bubnov Y., Ivanov N. (2021) DGA domain detection and botnet prevention using Q-learning for POMDP,Doklady BGUIR, 2, 91-99.DatasetsBubnov Y. (2019) DNS Tunneling Queries for Binary Classification,Mendeley Data, v1.Zago M., Perez. M.G., Perez G.M. (2020) UMUDGA - University of Murcia Domain Generation Algorithm Dataset,Mendeley Data, v1.Bybnov Y. (2021) DGTA-BENCH - Domain Generation and Tunneling Algorithms for Benchmark,Mendeley Data, v1.
Package: deeplot
deeplota library to display/visualize images of neural networksPython Library aimed for displaying architecture image of neural networks.*Low code*Easy to useThis library has been built using opencv and matplotlib.Table of ContentsInstallationDocumentationAvailable ArchitecturesUsageInstallationCreate a python virtual environment using venv or conda or pipenv etc.
Once, you have the env ready, just use below command to get the installation going:pip install -m deeplotThe sources for deeplot can be downloaded from theGithub repo_.You can either clone the public repository:git clone https://github.com/SimeraAI/deeplot.gitOnce you have a copy of the source, you can install it with:python setup.py installDocumentationFor complete Documentation with tutorials visitReadTheDocsAvailable ArchitecturesResNetDenseNetVGGMobileNetSqueezeNetInceptionResNeXtUsagefromdeeplotimportdeeplotdeeplot.VGG()deeplot.GoogleNet()Future Roadmap(Contributions are Welcome)Add new Architectures
include a visualization of the architecture
include a util tool to convert the architecture to a graph
Package: deepl.py
deepl.pyA Python wrapper for the DeepL APIinstallingInstall and update using pip:pip install deepl.pyA simple example.# Sync Sampleimportdeepltext='I have a pen.'translator=deepl.Translator(deepl.RequestsAdapter('Your API key'))defmain():print(translator.translate(text,target_lang=deepl.TargetLang.Japanese))if__name__=='__main__':main()#Async Sampleimportasyncioimportdeepltext='I have a pen.'translator=deepl.Translator(deepl.AiohttpAdapter('Your API key'))asyncdefmain():print(awaittranslator.translate(text,target_lang=deepl.TargetLang.Japanese))if__name__=='__main__':loop=asyncio.get_event_loop()loop.run_until_complete(main())Thank you to everyone who Helped me (#^^#)
Package: deepl-scraper-pp
deepl-scraper-pp[]scrape deepl using pyppeteer, cross platform (Windows/MacOS/Linux)Installationpipinstalldeepl-scraper-pp# pip install deepl-scraper-pp  # upgrade to the latest versionorpoetryadddeepl-scraper-pp# poetry add deepl-scraper-pp@latest  # upgrade to the latest versionor clone the repo (git clone https://github.com/ffreemt/deepl-scraper-pyppeteer.git) and install from it.UsageIn anipythonsession:# ipythonfromdeepl_scraper_pp.deepl_trimportdeepl_trres=awaitdeepl_tr("test me")print(res)# '考我 试探我 测试我 试探'print(awaitdeepl_tr("test me",to_lang="de"))# mich testen mich prüfen testen Sie michtext="Pyppeteer has almost same API as puppeteer. More APIs are listed in the document"print(awaitdeepl_tr(text,to_lang="zh"))# Pyppeteer的API与puppeteer几乎相同。更多的API在文档中列出。inpythonimportasynciofromdeepl_scraper_pp.deepl_trimportdeepl_trasyncdefmain():text1="test me"text2="Pyppeteer has almost same API as puppeteer. More APIs are listed in the document"coros=[deepl_tr(elm)forelmin[text1,text2]]res=awaitasyncio.gather(*coros,return_exceptions=True)print(res)loop=asyncio.get_event_loop()try:loop.run_until_complete(main())finally:loop.close()# output: ['考我 试探我 测试我 试探', 'Pyppeteer的API与puppeteer几乎相同。更多的API在文档中列出']DisclaimerThe pypi is beta and will likely remain beta -- use it at your own peril.
Package: deepl-scraper-pp2
deepl-scraper-pp2[]scrape deepl using pyppeteer2 with para info, cross platform (Windows/MacOS/Linux)Introdeepl-scraper-pp2is more or less deepl-scraper-pp.deepl-scraper-pp2however preserves newlines in the translated text. Hence, it will make life easier when trying to process large chunks of text.deepl-scraper-pp2is originally intended fordeepl-tr-webuibut can be used elsewhere as well.Installationpipinstalldeepl-scraper-pp2# pip install deepl-scraper-pp2  # upgrade to the latest versionorpoetryadddeepl-scraper-pp2# poetry add deepl-scraper-pp2@latest  # upgrade to the latest versionor clone the repo (git clone https://github.com/ffreemt/deepl-scraper-pyppeteer2.git) and install from it.Usageinpythonimportasynciofromdeepl_scraper_pp2.deepl_trimportdeepl_trprint(asyncio.run(deepl_tr("test 1\n\ntest 2"))# '测试1 \n\n  测试2'Or start a local serveruvicorndeepl_scraper_pp2.deepl_server:app# orpython-mdeepl_scraper_pp2.run_uvicornand consume the REST APIimportrequestsres=requests.post("http://127.0.0.1:8000/text",json={"text":"test 1\n\ntest2","to_lang":"zh"},headers={"accept":"application/json","Content-Type":"application/json"})print(res.json())# {'q': {'text': 'test 1\n\ntest2', 'from_lang': None, 'to_lang': 'zh', 'description': None},'result':'测试1\n\n测试2'}Consulthttp://127.0.0.1:8000/docsfor details.DisclaimerThe pypi is beta and will likely remain beta -- use it at your own peril.
Package: deepl-scraper-pw
deepl-scraper-playwrightScrape deepl using playwrightInstall itpipinstalldeepl-scraper-pw# pip install git+https://github.com/ffreemt/deepl-scraper-playwright# poetry add git+https://github.com/ffreemt/deepl-scraper-playwright# git clone https://github.com/ffreemt/deepl-scraper-playwright && cd deepl-scraper-playwrightUse itfrompprintimportpprintfromdeepl_scraper_pwimportdeepl_trpprint(deepl_tr("Test me\n\nTest him"))# '测试我\n\n测试他'pprint(deepl_tr("Test me\n\nTest him",from_lang="en",to_lang="de"))# 'Teste mich\n\nTesten Sie ihn'DebugShould something go wrong, you can turn on HEADFUL (a firefox browser will show up). Place .env in the current work directory, with the following content:PWBROWSER_HEADFUL=1You can also set DEBUG env variable to turn on detailed debug messages, in Windows:set DEBUG=1In Linux and friendsexport DEBUG=1
Package: deepl-tr
deepl-trdeepl translate using deepl-fastapi and webui2Install itx(notreadyyet)pipinstalldeepl-tr# pip install git+https://github.com/ffreemt/deepl-tr-webui# poetry add git+https://github.com/ffreemt/deepl-tr-webui# git clone https://github.com/ffreemt/deepl-tr-webui && cd deepl-tr-webuiUse itpython-mdeepl_tr# ordeepl-tr
Package: deepl-translate
DeepL TranslateAn unofficial python package to translate text usingDeepL.Installationpipinstalldeepl-translateUsageSupported languagesCurrently the following languages are supported:AbbreviationLanguageWriting in own languageBGBulgarianБългарскиZHChinese中文CSCzechČeskyDADanishDanskNLDutchNederlandsENEnglishEnglishETEstonianEestiFIFinnishSuomiFRFrenchFrançaisDEGermanDeutschELGreekΕλληνικάHUHungarianMagyarITItalianItalianoJAJapanese日本語LVLatvianLatviešuLTLithuanianLietuviųPLPolishPolskiPTPortuguesePortuguêsRORomanianRomânăRURussianРусскийSKSlovakSlovenčinaSLSlovenianSlovenščinaESSpanishEspañolSVSwedishSvenskaYou can either input the abbreviation or the language written in english.Command line toolHelpdeepl--helpusage: deepl [-h] [--version] [--formal | --informal] [-t TEXT | -f FILE] source_language target_language

Python client to translate texts using deepl.com

positional arguments:
  source_language       Source language of your text
  target_language       Target language of your desired text

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --formal              Use formal tone in translation
  --informal            Use informal tone in translation
  -t TEXT, --text TEXT  Text to be translated
  -f FILE, --file FILE  File to be translatedExample 1This will translate a Spanish (ES) text into Russian (RU):deeplspanishrussian-t"¡Buenos días!"Доброе утро!Example 2This will translate the file (test.txt) text from Italian (IT) into Portuguese (PT):deeplITPT--filetest.txtExample 3This will translate a Spanish (ES) text into Russian (RU) informaltone:deeplESRU--text"¿Cómo te llamas?"--formalКак Вас зовут?Note:informalwould be "Кактебязовут?"Example 4This will translate a Japanese (JP) text into German (DE) ininformaltone:deeplJPDE--text"お元気ですか？"--informalWie geht es dir?Note:formalwould be "Wie geht esIhnen?"Python libraryExample 1This will translate a Chinese (ZH) text into Dutch (NL):importdeepldeepl.translate(source_language="ZH",target_language="NL",text="你好")'Hallo'Example 2This will translate adanishtext intogermanin informal tone:importdeepldeepl.translate(source_language="danish",target_language="german",text="Ring til mig!",formality_tone="informal")'Ruf mich an!'
Package: deepl-tr-async
deepl-tr-asyncdeepl translate for free with async and proxy support, based on pyppeteerChanges in v0.0.5Python 3.6 is no longer supported.get_ppbrowseris now an indepent package thatdeepl-tr-asyncdepents on.Pre-installation of libicuFor Linux/OSXE.g.Ubuntu:sudo apt install libicu-devCentos:yum install libicuOSX:brew install icu4cFor WindowsDownload and install the pyicu and pycld2 whl packages for your OS version fromhttps://www.lfd.uci.edu/~gohlke/pythonlibs/#pyicuandhttps://www.lfd.uci.edu/~gohlke/pythonlibs/#pycld2Installationpip install deepl-tr-asyncValidate installationpython -c "import deepl_tr_async; print(deepl_tr_async.__version__)"
# 0.0.2 or other version infoUsagefrom the command line 命令行调用translate the system clipboad (not tested in Linux) 翻译系统剪贴板deepl-trtranslate text supplied from the command line 翻译终端提供的句子deepl-tr --copyfrom=false this is a testHelp 帮助：deepl-tr -?ordeepl-tr --helpfullProgrammatic use 程序调用import asyncio
from deepl_tr_async import deepl_tr_async
from deepl_tr_async.google_tr_async import google_tr_async

loop = asyncio.get_event_loop()

sent = 'Global coronavirus pandemic kills more than 30,000'

res = loop.run_until_complete(deepl_tr_async(sent, to_lang='zh'))
print(res)
# Alternatives:
# 全球冠状病毒大流行导致超过3万人死亡
# 全球冠状病毒大流行导致3万多人死亡
# 全球冠状病毒大流行导致超过30,000人死亡
# 全球冠状病毒大流行导致3万多人丧生

res = loop.run_until_complete(google_tr_async(sent, to_lang='zh'))
print(res)
# 全球冠状病毒大流行杀死超过30,000人

tasks = [deepl_tr_async(sent, to_lang='zh'), google_tr_async(sent, to_lang='zh')]
_ = asyncio.gather(*tasks)
res = loop.run_until_complete(_)
print(res)
['Alternatives:\n全球冠状病毒大流行导致超过3万人死亡\n全球冠状病毒大流行导致3万多人死亡\n全球冠状病毒大流行导致超过30,000人死亡\n全球冠状病毒大流行导致3万多人丧生', '全球冠状病毒大流行杀死超过30,000人']Environment variables: PPBROWSER_HEADFUL, PPBROWSER_DEBUG, PPBROWSER_PROXYThis version ofdeep-tr-asyncmakes use of the packageget-ppbrowser.get-ppbrowseris a headless browser based onpyppeteer2.To turn off headless mode, i.e., to show the browser in action, set PPBROWSER_HEADFUL to 1 (or true or True) in the.envfile, e.g.,PPBROWSER_HEADFUL=1or from the cmomand line, e.g.,setPPBROWSER_HEADFUL=1# export PPBROWSER_HEADFUL=1 in linux or iOSor in a python scriptimportosos.environ["PPBROWSER_HEADFUL"]="1"# note the quotesPPBROWSER_DEBUG and PPBROWSER_PROXY can be set in a similar manner.
Package: deepl-tr-pp
deepl-tr-pyppeteerdeepl translate via pyppeteerInstallationpipinstalldeepl-tr-ppTo update to the latest version:pipinstalldeepl-tr-pp-U# poetry add deepl-tr-pp@latest  # if you use poetryor clone the github repo, install and run from the sourcegitcloneclonehttps://github.com/ffreemt/deepl-tr-pyppeteercddeepl-tr-pyppeteer
pipinstallpoetry
poetryinstall--no-dev

poetryrunpython-mdeepl_tr_pp# equivalent to executing `deepl-tr-pp` belowUsageLanguages supported:["en", "de", "zh", "fr", "es", "pt", "it", "nl", "pl", "ru", "ja"](currently supported by the website)Input file formats currently supported: txt and docx, files with other suffix (e.g., .csv, .tsv) will simply treated as text.To interrupt anytime:Ctrl-c. The first few versions may not run too smoothly. If it hangs, presscontrolandcat the same time to exit.deepl-tr-pp-pfile.txt# en to zh, default en to zh, dualtext output, docx formatdeepl-tr-pp-pfile.txt-fde# de to zhdeepl-tr-pp-pfile.txt-fde-ten# de to endeepl-tr-pp# browse for a file, en to zhdeepl-tr-pp--copyfrom# text from the clipboard, en to zhdeepl-tr-pp-pfile.txt--nodualtext# en to zh, default en to zh, just translate textdeepl-tr-pp-pfile.txt--nooutput-docx# default en to zh, dualtext, text formatBy default, the text version of the output is copied to the clipboard, turn this off by --nocopytodeepl-tr-pp-pfile.txt--nocopytoFiner Control Using .env and Environ VariablesTo show the browser in action or set debug or proxy, create an.envfile and set the corresponding environ variables (these can also be set from the command line, e.g.,set DEEPLTR_HEADFUL=true(in Windows) orexport DEEPLTR_HEADFUL=true(in Linux) ):# .envDEEPLTR_HEADFUL=trueDEEPLTR_DEBUG=true# DEEPLTR_HEADFUL=True# DEEPLTR_HEADFUL=tRue  # also works# DEEPLTR_HEADFUL=False# DEEPLTR_HEADFUL=fAlse# DEEPLTR_HEADFUL=1# DEEPLTR_HEADFUL='1'# must use capitals# DEEPLTR_PROXY=SOCKS5://127.0.0.1:1080Helpdeepl-tr-pp--helpshort--[no]copyfrom:copyfromclipboard,defaultfalse,willattempttobrowserforafilepathifcopyfromissetfalse)(default:'false')--[no]copyto:copytheresulttoclipboard(default:'true')--[no]debug:printdebugmessages.(default:'false')-d,--[no]dualtext:dualtextornodualtextoutput(default:'true')-p,--filepath:sourcetextfilepath(relativeorabsolute),ifnotprovided,clipboardcontentwillbeusedassourcetext.(default:'')-f,--from-lang:sourcelanguage,defaultenglish)(default:'en')-o,--[no]output-docx:outputdocxortext(default:'true')-t,--to-lang:targetlanguage,defaultchinese(default:'zh')--[no]version:printversionandexit(default:'false')ordeepl-tr-pp--helpfullFor DevelopersInstallpoetrythe way you like it.git clone the repohttps://github.com/ffreemt/deepl-tr-pyppeteer,cd deepl-tr-pyppeteerOr fork first andgit pullyour own repo.poetry installActivate the virtual environment, e.g.,.venv\Scripts\activate(In Windows) orsource .venv/bin/activate(in Linux) provided you setpoetry config --local virtualenvs.in-project truepython -m deepl_tr_ppCode and optionally submit PR
Package: deeply
Using this package you can do a deep conversion of your dataclass to a
dictionary and initialize it from dict.Getting itTo download deeply, either fork this github repo or simply use PyPI via
pip.$pipinstalldeeplyUsage1 - ImportfromdeeplyimportDeeplyfromdataclassesimportdataclass2 - Define your data classes with the following inheritance:@dataclassclassA(Deeply):a1:inta2:int@dataclassclassB(Deeply):b1:strb2:str@dataclassclassC(Deeply):a:Ab:B3 - Create an instance of the class and you can already use it:c=C(A(1,2),B('foo','bar'))c.to_web()# {'a': {'a1': 1, 'a2': 2}, 'b': {'b1': 'foo', 'b2': 'bar'}}4 - You can also initialize your class from a dictionary:c=C.init_from_dict({'a':{'a1':1,'a2':2},'b':{'b1':'foo','b2':'bar'}})# C(a=A(a1=1, a2=2), b=B(b1='foo', b2='bar'))5 - And finally: you can set your own conversion rules in deep dict.Deeply.rules:List[Tuple[Callable[[T],bool],Callable[[T],Any]]]=[(lambdaobj:hasattr(obj,'isoformat'),lambdaobj:obj.isoformat()),]
Package: deeply-nested
DeeplyNestedThe aim of the library is to make working with Deeply nested json structures more fun.from  src  import  NestedObject 
sample_dict  = { "k1":"v1", "k2":[{"a1":"v2","a2":"v3"},{"a1":"v4","a2":"v5"}]}

d2  =  NestedObject(sample_dict)
d2.data

print(d2.paths) 
# List of all available paths ['/k1', '/k2', '/k2[0]', '/k2[0]/a1', '/k2[0]/a2', '/k2[1]', '/k2[1]/a1', '/k2[1]/a2']

print(d2.keys()) # List of keys Similar to .keys method in dict ['/k1', '/k2', '/k2[0]', '/k2[0]/a1', '/k2[0]/a2', '/k2[1]', '/k2[1]/a1', '/k2[1]/a2']

print(d2.items())
# list of tuples Similar to the items method in a normal dictionary
# [('/k1', 'v1'), ('/k2', [{'a1': 'v2', 'a2': 'v3'}, {'a1': 'v4', 'a2': 'v5'}]), ('/k2[0]', {'a1': 'v2', 'a2': 'v3'}), ('/k2[0]/a1', 'v2'), ('/k2[0]/a2', 'v3'), ('/k2[1]', {'a1': 'v4', 'a2': 'v5'}), ('/k2[1]/a1', 'v4'), ('/k2[1]/a2', 'v5')]

print(d2.get(keypath='/k2'))
# Tuple with (key, value) where key is the keypath
# ('/k2', [{'a1': 'v2', 'a2': 'v3'}, {'a1': 'v4', 'a2': 'v5'}])

print(d2.get(keypath='/k2[i]/a1'))
# List of tuple with i replaced with length of list in k2 key
# [('/k2[0]', {'a1': 'v2', 'a2': 'v3'}), ('/k2[1]', {'a1': 'v4', 'a2': 'v5'})]Please feel free to raise an issue. This is under active maintainence.
Package: deep-mab
Deep Contextual MABMAB and linear/non-linear Contextual MAB algorithms.AlgorithmsMulti-Arm BanditsEpsilon GreedyUCBThompson SamplingContextual Multi-Arm BanditsNeural Net Epsilon GreedyLinUCBNeural Net UCBUsage InstructionsThis project is published onPyPI. To install package, run:pip install deep-mabTo run the algorithms, import the package and call the respective functions. For example, to run the LinUCB algorithm, run:from deep_mab.cmab import LinUCB
model = LinUCB(n_arms=10, alpha=1, fit_intercept=True)
model.fit(X_train, y_train)
model.predict(X_test)For more details, refer to thedocumentation.To run the examples, clone the repository and run the following commands:cd deep-mab
pip install -r requirements.txt
python examples/linucb_example.pyTo run the tests, run the following commands:cd deep-mab
pip install -r requirements.txt
pytest