Saravanan666/pypi-org huggingface dataset:
Package: optimum-openvino
Optimum OpenVINOOptimum OpenVINO is an extension forOptimumlibrary which bringsIntel OpenVINObackend forHugging Face Transformers:hugs:.This project provides multiple APIs to enable different tools:OpenVINO RuntimeNeural Network Compression Framework (NNCF)Post-Training Optimization Tool (POT)InstallInstall only runtime:pipinstalloptimum-openvinoor with all dependencies:pipinstalloptimum-openvino[all]OpenVINO RuntimeThis module provides an inference API for Hugging Face models. There are options to use models with PyTorch*, TensorFlow* pretrained weights or use native OpenVINO IR format (a pair of filesov_model.xmlandov_model.bin).To use OpenVINO backend, import one of theAutoModelclasses withOVprefix. Specify a model name or local path infrom_pretrainedmethod.fromoptimum.intel.openvinoimportOVAutoModel# PyTorch trained model with OpenVINO backendmodel=OVAutoModel.from_pretrained(<name_or_path>,from_pt=True)# TensorFlow trained model with OpenVINO backendmodel=OVAutoModel.from_pretrained(<name_or_path>,from_tf=True)# Initialize a model from OpenVINO IRmodel=OVAutoModel.from_pretrained(<name_or_path>)NNCFNNCFis used for model training with applying such features like quantization, pruning. To enable NNCF in you training pipeline do the following steps:ImportNNCFAutoConfig:fromoptimum.intel.nncfimportNNCFAutoConfigNOTE:NNCFAutoConfigmust be imported beforetransformersto make magic workInitialize a config from.jsonfile:nncf_config=NNCFAutoConfig.from_json(training_args.nncf_config)Pass a config toTrainerobject. In example,trainer=QuestionAnsweringTrainer(model=model,args=training_args,train_dataset=train_datasetiftraining_args.do_trainelseNone,eval_dataset=eval_datasetiftraining_args.do_evalelseNone,eval_examples=eval_examplesiftraining_args.do_evalelseNone,tokenizer=tokenizer,data_collator=data_collator,post_process_function=post_processing_function,compute_metrics=compute_metrics,nncf_config=nncf_config,)Trainingexamplescan be found in Transformers library.
NNCF configs are published inconfigfolder. Add--nncf_configwith a path to corresponding config when train your model. More command line exampleshere.python examples/pytorch/token-classification/run_ner.py --model_name_or_path bert-base-cased --dataset_name conll2003 --output_dir bert_base_cased_conll_int8 --do_train --do_eval --save_strategy epoch --evaluation_strategy epoch --nncf_config nncf_bert_config_conll.jsonTo use NNCF component, install the package with[nncf]or[all]extras:pipinstalloptimum-openvino[nncf]POTTBD
Package: optimus-id
python-optimusThis is based fully onpjebs/optimus-gofor Go which is based onjenssegers/optimusfor PHP which is based on Knuth's Integer Hashing (Multiplicative Hashing) from his bookThe Art Of Computer Programming, Vol. 3, 2nd Edition, Section 6.4, Page 516.With this library, you can transform your internal id's to obfuscated integers based on Knuth's integer hash. It is similar toHashids, but will generate integers instead of random strings. It is also super fast.>>> my_optimus.encode(42)
7773166408443174426
>>> my_optimus.decode(7773166408443174426)
42This library supports both 32 and 64 bits integers, although in Python you don't have that differentiation between int32 and int64, even bigint or bignum is the same sincePEP 237. The reason you need a bitlength is that the algorithm itself works on a fixed bitlength. By default this library uses 64 bits.Python SupportSo far it's only tested on Python 3.8 and Python 3.9Installationpip install python-optimusUsageBasic usage:fromoptimus_idsimportOptimusmy_optimus=Optimus(prime=<yourprimenumber>)my_int_id=<someidyouhave>my_int_id_hashed=my_optimus.encode(my_int_id)assertmy_int_id==my_optimus.decode(my_int_id_hashed)The caveat with the usage above is that every time you create yourOptimusinstance it will have a random component, even with using the same prime, so a proper usage should be like this:fromoptimus_idsimportOptimusmy_optimus=Optimus(prime=<yourprimenumber>,random=<somerandomnumber>)my_int_id=<someidyouhave>my_int_id_hashed=my_optimus.encode(my_int_id)assertmy_int_id==my_optimus.decode(my_int_id_hashed)To generate a suitable random number you could do this:fromoptimus_idsimportrand_n,MAX_64_INT# use 32 instead of 64 if you want tomy_random_number=rand_n(MAX_64_INT-1)You can also generate anOptimusintance and then keep itsprime,inverseandrandomproperties stored, so you can always configure a new instance with the same components, or even pickle it:fromoptimus_idsimportgenerate,Optimusmy_optimus=generate()# store the following variables or pickle the my_optimus variableprime=my_optimus.primeinverse=my_optimus.inverserandom=my_optimus.randombitlength=my_optimus.bitlength# create a new instance with the same parameters or unpickle an instancemy_other_optimus=Optimus(prime=prime,inverse=inverse,random=random,bitlength=bitlength,)assertmy_optimus.encode(42)==my_other_optimus.encode(42)assertmy_optimus.decode(my_other_optimus.encode(42))==my_other_optimus.decode(my_optimus.encode(42))NOTEfor the generate function to work, it needs data, the data is large, and not available with the package, the data should be downloaded fromhereand the path to it is passed to thegeneratefunction. By default it expects the data to be in a folder calledoptimus-primesin the current working directory.├── your-app.py
├── ...
└── optimus-primes
    ├── p1.txt
    ├── p2.txt
    ├── ...
    └── p50.txtCheck thetestsfolder for test cases and other usage examples.LicenseThis work is licensed underMIT License.
Package: optimusprimal
Optimus-Primal: A Lightweight primal-dual solveroptimusprimalis a light weight proximal splitting Forward Backward Primal Dual based solver for convex optimization problems.
The current version supports finding the minimum of f(x) + h(A x) + p(B x) + g(x), where f, h, and p are lower semi continuous and have proximal operators, and g is differentiable. A and B are linear operators.
To learn more about proximal operators and algorithms, visitproximity operator repository. We suggest that users read the tutorial“The Proximity Operator Repository. User’s guide”.QUICK INSTALLYou can installoptimusprimalwith PyPi by runningpipinstalloptimusprimalINSTALL FROM SOURCEAlternatively, you can installoptimusprimalfrom GitHub by first cloning the repositorygitclonegit@github.com:astro-informatics/Optimus-Primal.gitcdOptimus-Primaland running the build script and run install tests bybashbuild_optimusprimal.shpytest--blackoptimusprimal/tests/BASIC USAGEAfter installingoptimusprimalone cane.g.perform an constrained proximal primal dual reconstruction byimportnumpyasnpimportoptimusprimal.primal_dualasprimal_dualimportoptimusprimal.linear_operatorsaslinear_opsimportoptimusprimal.prox_operatorsasprox_opsoptions={'tol':1e-5,'iter':5000,'update_iter':50,'record_iters':False}# Load some datay=np.load('Some observed signal y')# Load a file of observed data.epsilon=sigma*np.sqrt(y.size+2np.sqrt(y.size))# where sigma is your noise std.# Define a forward model i.e. y = M(x) + nM=np.ones_like(y)# Here M = Identity for simplicity.p=prox_ops.l2_ball(epsilon,y,linear_ops.diag_matrix_operator(M))# Create a l2-ball data-fidelity.# Define a regularisation i.e. ||W(x)||_1wav=['db1','db3','db4']# Select some wavelet dictionaries.psi=linear_operators.dictionary(wav,levels=6,y.shape)# Define multi-dictionary wavelets.h=prox_ops.l1_norm(gamma=1,psi)# Create an l1-norm regulariser.# Recover an estiamte i.e. x_est = min[h(x)] s.t. p(x) <= epsilonx_est,=primal_dual.FBPD(y,options,None,None,h,p,None)# Recover an estimate of x.CONTRIBUTORSLuke Pratley,Matthijs Mars,Matthew Price.LICENSEoptimusprimalis released under the GPL-3 license (seeLICENSE.txt), subject to
the non-commercial use condition.optimusprimal
Copyright (C) 2021 Luke Pratley & contributors

This program is released under the GPL-3 license (see LICENSE.txt),
subject to a non-commercial use condition (see LICENSE_EXT.txt).

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Package: optimyzer-api-client
Optimyzer API ClientThis is the Python API Client for Optimyzer. Use it to conveniently run optimizations from Python.To get access to the API you will need an Optimyzer account.If you have any kind of issue or suggestion, please
drop us a line:info@gauss-ml.com.Getting startedInstalling theOptimyzer API Clientis very easy, just runpip install optimyzer_api_clientin your favorite Python environment and you're done. If you like it, you might want to addoptimyzer_api_clientto your project's dependencies.Optimyzer UsageOptimyzerClienthas been built to be included in any kind of workflow as easily as possible.First you have to import it:fromoptimyzer_api_clientimportOptimyzerClientThen you need to create an instance using yourOptimyzerusername and password.oac=OptimyzerClient.from_login(username="your@email.com",password="AVery$ecureP@ssw0rd!")You can also use a credentials file.oac=OptimyzerClient.from_credentials("/path/to/credentials_file.json")Once you have anOptimyzer API Clientinstance, you can start creating machines, optimizations,
and runing them.
Check out thenotebookson this repository for examples on how to get started.
Package: optini
Python class to get options from command line and config fileFree software: MIT licenseDocumentation:https://optini.readthedocs.io.FeaturesAggressively conventional defaultsCollect configuration from command line, config file, and defaultsConfiguration hierarchy: command line > config file > defaultsInterface is a module-level variable: optini.optModule-level interface allows libraries to access configAccess config options through module-level dotmap interfaceExample: optini.opt.verboseDerives command line options from option namesExample: “verbose” => -v and –verboseSingle flag to support (mostly) conventional logging options(-v, -d, -q, -L, -F LOGFILE)Single flag to support I/O options (-i input and -o output)Supports top-level ini section without a headerUses standard libraries under the hood (logging, argparse, configparser)LimitationsOnly top-level code (such as UI script) should initialize ConfigExamplesDefine one boolean option, someopt, which defaults to false; users can
specify -s at the command line, or put someopt = true in the config
file.importoptinioptini.spec.someopt.help='Set a flag'# implies -s and --someopt command line optionsdesc='This code does a thing'optini.Config(appname='myapp',file=True,desc=desc)ifoptini.opt.someopt:print("someopt flag is set")Config file defaults to ~/.<appname>.iniEnable logging config:importloggingimportoptinioptini.Config(appname='something',logging=True)# the verbose (-v) option enables info messageslogging.info('this is an info message')# the debug (-d) option enables debug messageslogging.debug('this is a debug message')# the Log (-L) option writes logs to file (default: <appname>.log)Option Specification FormatNested data structure (either dict or dotmap is valid)The top level key is the option nameTo configure each option, specify second level keys:helpstr, default=Nonefor argparse usage message, default config file commentstypetype, default=booltype hint for parsersSupported: bool, str, int, floatdefault, default=Nonethe default value for the optionrequired, default=FalseDeclare the option mandatory at the command lineshortstrShort form command line option (example: -v)longstrLong form command line option (example: –verbose)configfileboolSpecify False for command line only optionsSecond level keys, apart from configfile, are passed to argparseCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.
Package: optinist
optinistOptiNiSt(Optical Neuroimage Studio) is a GUI based workflow pipeline tools for processing two-photon calcium imaging data.OptiNiSt helps researchers try multiple data analysis methods, visualize the results, and construct the data analysis pipelines easily and quickly on GUI. OptiNiSt's data-saving format follows NWB standards.OptiNiSt also supports reproducibility of scientific research, standardization of analysis protocols, and developments of novel analysis tools as plug-in.Support libraryROI detectionSuite2pCaImAnLCCDPostprocessingBasic Neural Analysis(Event Trigger Average...)Dimension Reduction(PCA...)Neural Decoding(LDA...)Neural Population Analysis(Correlation...)Saving FormatNWBKey Features:beginner: Easy-To-Create Workflowzero-knowledge of coding: OptiNiSt allows you to create analysis pipelines easily on the GUI.:zap: Visualizing analysis resultsquick visualization: OptiNiSt supports you visualize the analysis results by plotly.:rocket: Managing Workflowsrecording and reproducing: OptiNiSt records and reproduces the workflow pipelines easily.InstallationNeed anaconda or miniconda environment.conda create -n optinist python=3.8
conda activate optinistInstall from pip.pip install optinistlaunch.run_optinistOpen browser.http://localhost:8000Documentationhttps://optinist.readthedocs.io/en/latest/Using GUIWorkflowOptiNiSt allows you to make your analysis pipelines by graph style using nodes and edges on GUI. Parameters for each analysis are easily changeable.VisualizeOptiNiSt allows you to visualize the analysis results with one click by plotly. It supports a variety of plotting styles.RecordOptiNiSt supports you in recording and reproducing workflow pipelines in an organized manner.ContributorsProposersKenji Doya, Yukako YamaneOIST Neural Computation UnitMain DevelopersShogo Akiyama,Yoshifumi TakeshimaSupport DevelopersTatsuya Tanabe,Yosuke Kaneko,Syuya SaekiReferences[Suite2p]Marius Pachitariu, Carsen Stringer, Mario Dipoppa, Sylvia Schröder, L. Federico Rossi, Henry Dalgleish, Matteo Carandini, Kenneth D. Harris. "Suite2p: beyond 10,000 neurons with standard two-photon microscopy". 2017[CaImAn]Andrea Giovannucci Is a corresponding author, Johannes Friedrich, Pat Gunn, Jérémie Kalfon, Brandon L Brown, Sue Ann Koay, Jiannis Taxidis, Farzaneh Najafi, Jeffrey L Gauthier, Pengcheng Zhou, Baljit S Khakh, David W Tank, Dmitri B Chklovskii, Eftychios A Pnevmatikakis. "CaImAn: An open source tool for scalable Calcium Imaging data Analysis". 2019[LCCD]Tsubasa Ito, Keisuke Ota, Kanako Ueno, Yasuhiro Oisi, Chie Matsubara, Kenta Kobayashi, Masamichi Ohkura, Junichi Nakai, Masanori Murayama, Toru Aonishi, "Low computational-cost cell detection method for calcium imaging data", 2022[PyNWB]Oliver Rübel, Andrew Tritt, Ryan Ly, Benjamin K. Dichter, Satrajit Ghosh, Lawrence Niu, Ivan Soltesz, Karel Svoboda, Loren Frank, Kristofer E. Bouchard, "The Neurodata Without Borders ecosystem for neurophysiological data science", bioRxiv 2021.03.13.435173, March 15, 2021
Package: optinterp
Optimal Interpolation NodesComputes a set of points with an optimalLebesgue constant. Having an exact analytical solution for these points is an unresolved problem in mathematics. The code here approximates the values numerically. Numerical approximations have been available for many years, but to my knowledge, there are no other open source Python libraries with this functionality.UsageInstallationpip install optinterpExampleimportoptinterpnds=optinterp.nodes(10)This functions similarly to numpy'schebpts1but produces points with a slightly improved Lebesgue constant:importnumpyasnpnds=np.polynomial.chebyshev.chebpts1(10)nds=nds/nds[-1]Algorithm DescriptionThis solution expoits the following properties:Optimal interpolation points can take values -1 and 1 for their minimum and maximum.To mimimize the global maximum of the Lebesgue function, all local maxima should be equal.Moving two adjacent nodes closer together reduces the local maximum of the Lebesgue function at the expense of increasing the other local maxima.Start with two initial guesses for optimal points. The extended Chebyshev nodes and a set of slightly perturbed Chebyshev nodes. Then for each set of nodes define:dx_i = x_{i+1} - x_i
dL_i = L_i - L_{avg}WhereL_iis the local maximum of the Lebesgue function betweenx_{i+1}andx_i. Now assuming eachdL_iis a function ofdx_i, use the Secant method to find roots:dx_{i, n+1} = dx_{i, n} - dL_{i, n} * (dx_{i, n} - dx_{i, n-1}) / (dL_{i, n} - dL_{i, n - 1})For the next iteration, calculate each nodex_ifrom these roots ofdx_iand scale the values to be from -1 to 1.
Package: option
OptionRust-likeOptionandResulttypes in Python, slotted and fully typed.AnOptiontype represents an optional value, everyOptionis eitherSomeand contains Some value, orNONEAResulttype represents a value that might be an error. EveryResultis eitherOkand contains a success value, orErrand contains an error value.Using anOptiontype forces you to deal withNonevalues in your code and increase type safety.Using aResulttype simplifies error handling and reducestryexceptblocks.Quick StartfromoptionimportResult,Option,Ok,Errfromrequestsimportgetdefcall_api(url,params)->Result[dict,int]:result=get(url,params)code=result.status_codeifcode==200:returnOk(result.json())returnErr(code)defcalculate(url,params)->Option[int]:returncall_api(url,params).ok().map(len)dict_len=calculate('https://example.com',{})InstallOption can be installed from PyPi:pipinstalloptionDocumentationThe documentation lives athttps://mat1g3r.github.io/option/LicenseMIT
Package: optionaldict
optionaldictoptionaldictis a dict-like object that ignore NoneType values for Python which is pickable and JSON serializable.InstallationYou can installoptionaldictsimply usingpip:pipinstalloptionaldictUsageoptionaldict's usage is very simple, you will import it by:fromoptionaldictimportoptionaldictor if you prefer the CamelCasing style naming, you can import it by:fromoptionaldictimportOptionalDictTips: In fact,optionaldictis just an alias forOptionalDict.Then you can use it just like the built-indict:d1=optionaldict(a=1,b=None)d1['c']=2d1.setdefault('d',None)d2=optionaldict()d2['a']=1d2['b']=Noned3=optionaldict({'a':1,'b':None})
Package: optional-faker
optional-fakerSmall wrapper around faker, to make values optional!Note that faker added ownoptionalproxy, which however can be used only with callables. This is why in version 2.0.0 we renamed our method tonone_or.Example>>>fromfakerimportFaker>>>importoptional_faker>>>>>>fake=Faker()>>>Faker.seed(1555)>>>>>># `fake.none_or` can take any value, and return it, or None.>>>fake.none_or(fake.pystr())'scHhghRDleajCHjEYWAu'>>>fake.none_or(fake.pystr())None>>># or it can take callable, and *args with **kwargs>>># that will be passed to this callable.>>>fake.none_or(fake.pystr,1,max_chars=10)'zmZUcJVTYX'>>>fake.none_or(fake.pystr,1,max_chars=10)None>>># there is no explicit check is callable a faker part,>>># so you can pass anything.>>>fake.none_or(lambda:"my callable!")'my callable!'>>>fake.none_or(lambda:"my callable!")NoneInstallingpipinstalloptional-fakerAnd then you need to importoptional_fakeranywhere but before creatingFakerinstance.Installing for local developinggitclonehttps://github.com/PerchunPak/optional-faker.gitcdoptional-fakerInstallingpoetryNext we need installpoetrywithrecommended way.If you use Linux, use command:curl-sSLhttps://install.python-poetry.org|python-If you use Windows, open PowerShell with admin privileges and use:(Invoke-WebRequest-Urihttps://install.python-poetry.org-UseBasicParsing).Content|python-Installing dependenciespoetryinstallIf something is not clearYou can always write me!Updatingpipinstall-Uoptional-fakerFor local developmentFor updating, just re-download repository,
if you usedgitfor downloading, just rungit pull.ThanksThis project was inspired byfaker-optional.This project was generated withpython-template.
Package: optional_import
UsageThis library contains only the context manageroptional_import:>>>fromoptional_importimportoptional_importA successful import works as usual:>>>withoptional_import():...importcollections>>>type(collections)<type'module'>If the import does not exist,optional_importsuppresses theImportErrorthat would otherwise be raised.>>>importunicornsTraceback(mostrecentcalllast):...ImportError:Nomodulenamedunicorns>>>withoptional_import():...importunicorns>>>unicornsTraceback(mostrecentcalllast):...NameError:name'unicorns'isnotdefinedExample: Django local settingsA common pattern in Django is to put default settings insettings.py,
put optional site-specific settings insettings_local.py, and import*from the local settings file if it exists.withoptional_import():from.settings_localimport*Why not just catchImportError?Optional imports can almost be achieved simply by catchingImportError:try:importfooexceptImportError:passBut this approach introduces a problem: Iffooexists but raisesImportError, we want that error to be raised, but instead it is
swallowed by theexceptclause.Withoptional_import, the error is raised as desired. In the following
example, thebadmodule tries to import a nonexistent packageunicorns:>>>withoptional_import():...importbadTraceback(mostrecentcalllast):...ImportError:Nomodulenamedunicorns
Package: optional-python
PyOptionaloptional object for pythonHow to installpip install -U optional_pythonHow to useOptional.of & Optional.of_nullablefrompyoptionalimportOptionalvalue=1final_value=Optional.of(value).map(lambdax:x+1).or_else(333)assertfinal_value==1final_value=Optional.of_nullable(None).map(lambdax:x+1).or_else(333)assertfinal_value==333Optional.or_raisefrompyoptionalimportOptionalOptional.of_nullable(None).or_raise(ValueError("value is None"))Try.offrompyoptionalimportTrydeffunc():return1/0deffunc2():return2/1defhandle_exception(e:ZeroDivisionError):return"error"result=Try.of(func).recover(handle_exception)assertresult.get()=="error"result=Try.of(func2).recover(handle_exception)assertresult.get()==2result=Try.of(lambda:1/000000000)# no exception handlerassertresult.get()isNoneresult=Try.of(lambda:1/000000000,raise_exception=True)result.get()# will raise ZeroDivisionError