Saravanan666/pypi-org huggingface dataset:
Package: dwave-inspector
D-Wave InspectorA tool for visualizing problems submitted to, and answers received from, a
D-Wave structured solver such as an AdvantageTMquantum computer.ExampleThis example shows a typical usage: a binary quadratic model minor-embedded
onto a quantum processing unit (QPU).fromdwave.systemimportDWaveSampler,EmbeddingCompositeimportdimodimportdwave.inspector# Get samplersampler=EmbeddingComposite(DWaveSampler())# Define a problemx,y,z=dimod.Binaries(['x','y','z'])bqm=x*y-x*z+2*y# Samplesampleset=sampler.sample(bqm,num_reads=100)# Inspectdwave.inspector.show(sampleset)Installation or BuildingIfD-Wave Ocean SDK 2.0+is installed:dwaveinstallinspectorOtherwise, install the package from PyPI:pipinstalldwave-inspectorand then install the closed-source dependency with:pipinstalldwave-inspectorapp--extra-index=https://pypi.dwavesys.com/simplePlease note this closed-source dependency is released under theD-Wave EULAlicense.Alternatively, clone and build from source:gitclonehttps://github.com/dwavesystems/dwave-inspector.gitcddwave-inspectorpipinstall-rrequirements.txtpythonsetup.pyinstallWhen building from source, the closed-source component still needs to be
installed as above.LicenseReleased under the Apache License 2.0. SeeLICENSEfile.Visualization component released under theD-Wave EULA.ContributingOcean’scontributing guidehas guidelines for contributing to Ocean packages.Release NotesD-Wave Inspector usesrenoto manage
its release notes.When making a contribution to D-Wave Inspector that will affect users, create
a new release note file by running:renonewyour-short-descriptor-hereYou can then edit the file created underreleasenotes/notes/.
Remove any sections not relevant to your changes.
Commit the file along with your changes.See reno’suser guidefor details.
Package: dwave-neal
> :warning:dwave-nealis deprecated in favor ofdwave-samplers.dwave-nealAn implementation of a simulated annealing sampler.A simulated annealing sampler can be used for approximate Boltzmann sampling or
heuristic optimization. This implementation approaches the equilibrium
distribution by performing updates at a sequence of increasing beta values,beta_schedule, terminating at the target beta. Each spin is updated once
in a fixed order per point in the beta_schedule according to a Metropolis-
Hastings update. When beta is large the target distribution concentrates, at
equilibrium, over ground states of the model. Samples are guaranteed to match
the equilibrium for long ‘smooth’ beta schedules.For more information, see Kirkpatrick, S.; Gelatt Jr, C. D.; Vecchi, M. P.
(1983). “Optimization by Simulated Annealing”. Science. 220 (4598): 671–680Example Usageimportnealsampler=neal.SimulatedAnnealingSampler()h={0:-1,1:-1}J={(0,1):-1}sampleset=sampler.sample_ising(h,J)InstallationTo install:pipinstalldwave-nealTo build from source:pipinstall-rrequirements.txtpythonsetup.pybuild_ext--inplacepythonsetup.pyinstallLicenseReleased under the Apache License 2.0. See LICENSE file.ContributingOcean’scontributing guidehas guidelines for contributing to Ocean packages.
Package: dwave-networkx
D-Wave NetworkXD-Wave NetworkX is an extension ofNetworkX—a
Python language package for exploration and analysis of networks and network
algorithms—for users of D-Wave quantum computers. It provides tools for working
with Quantum Processing Unit (QPU) topology graphs, such as the Pegasus used on
the AdvantageTMsystem, and implementations of graph-theory algorithms on D-Wave
quantum computers and other binary quadratic model samplers.This example generates a Pegasus graph of the size used by Advantage QPUs.>>> import dwave_networkx as dnx
>>> graph = dnx.pegasus_graph(16)See the documentation for more examples.InstallationInstallation from PyPi:pipinstalldwave_networkxInstallation from source:pipinstall-rrequirements.txtpythonsetup.pyinstallLicenseReleased under the Apache License 2.0.ContributingOcean’scontributing guidehas guidelines for contributing to Ocean packages.
Package: dwave-ocean-sdk
OceanisD-Wave’ssuite of tools for solving hard problems
with quantum computers.InstallationInstallation fromPyPI:pipinstalldwave-ocean-sdkFor more information, see the Ocean documentation’sinstallationpage.Getting StartedSign up for the Leap quantum cloud service here:Leap signup.Start learning with the following D-Wave resources:System Documentationto
learn about quantum computers and how to use them.Getting Started with Oceanto install and start coding with Ocean software.dwave-examplesfor code examples
and Jupyter Notebooks.Resource Libraryon
D-Wave website for whitepapers and additional resources.Example Quantum ProgramThe following lines of code solve and visualize arandomproblemon a quantum computer.importdimodimportdwave.inspectorimportdwave.systembqm=dimod.generators.ran_r(1,20)sampler=dwave.system.EmbeddingComposite(dwave.system.DWaveSampler())sampleset=sampler.sample(bqm,num_reads=100)dwave.inspector.show(sampleset)The left side of thevisualizedsolution represents the problem’s variables as circles, with white dots for
variables assigned values of -1 and blue dots for values of +1; the colors of the
connecting lines represent values of the quadratic coefficients for each pair of
variables. The right side shows the qubits representing these variables on a
quantum processing unit.You can find introductory examples in theOcean documentationanddwave-examplesGitHub repository, and
many customer prototype applications on theD-Wave website.SupportFind support here:Leap user communityto converse with a large community of D-Wave users.Leap help centerto search the Leap knowledge base.SDK GitHub repoto
open issues or request features on the Ocean SDK or on any one of itspackages.ContributingYour contributions are welcome!Ocean’scontributing guidehas guidelines for contributing to Ocean packages.LicenseReleased under the Apache License 2.0. See LICENSE file.
Package: dwave-preprocessing
dwave-preprocessingdwave-preprocessingprovides preprocessing tools for binary quadratic models
(BQM) and presolve algorithms for constrained quadratic models (CQM).importdwave.preprocessingThis package contains several preprocessing composites that can aid in solving
BQMs and a presolver that can reduce a problem’s redundant variables and
constraints to improve the accuracy of CQMs. For details on underlying
algorithms and usage, see the package’sReference Documentation.InstallationInstall from a package on PyPI:pipinstalldwave-preprocessingor install from source:pipinstall-rrequirements.txtpythonsetup.pybuild_ext--inplacepythonsetup.pyinstallLicenseReleased under the Apache License 2.0. SeeLICENSEfile.ContributingOcean’scontributing guidehas guidelines for contributing to Ocean packages.Release Notesdwave-preprocessingmakes use ofrenoto manage its
release notes.When making a contribution todwave-preprocessingthat will affect users, create a new
release note file by runningrenonewyour-short-descriptor-hereYou can then edit the file created underreleasenotes/notes/.
Remove any sections not relevant to your changes.
Commit the file along with your changes.
Package: dwave-qiskit-plugin
D-Wave Ocean plugin for IBM QiskitEnablesQiskitusers to obtain ground state(s) of Ising Hamiltonians usingD-Wave's QPU available viaLeap.The package provides an implementation of Qiskit'sMinimumEigensolverinterface (available asDWaveMinimumEigensolver) which can be used directly on qubit operators, or viaqikist.optimization'sMinimumEigenOptimizer.ExamplesSolve aQuadraticProgramwithMinimumEigenOptimizer(see Qiskit'stutorial)
usingDWaveMinimumEigensolver:>>>fromqiskit.optimizationimportQuadraticProgram>>>fromqiskit.optimization.algorithmsimportMinimumEigenOptimizer>>>fromdwave.plugins.qiskitimportDWaveMinimumEigensolver...>>># Construct a simple quadratic program>>>qp=QuadraticProgram()>>>qp.binary_var('x')>>>qp.binary_var('y')>>>qp.minimize(quadratic={'xy':1})...>>># Solve using Qiskit's MinimumEigenOptimizer on D-Wave QPU as a minimum eigen solver>>>dwave_mes=DWaveMinimumEigensolver()>>>optimizer=MinimumEigenOptimizer(dwave_mes)>>>result=optimizer.solve(qp)...>>>print(result)optimalfunctionvalue:0.0optimalvalue:[0.1.]status:SUCCESS>>>result.samples[('01',0.0,0.39),('00',0.0,0.25),('10',0.0,0.36)]Solve a 6-city TSP (orsome other Ising model).>>>fromqiskit.optimization.applications.isingimporttsp>>>fromqiskit.optimization.applications.ising.commonimportsample_most_likely>>>fromdwave.plugins.qiskitimportDWaveMinimumEigensolver...>>>six_cities_tsp=tsp.random_tsp(6,seed=123)>>>operator,offset=tsp.get_operator(six_cities_tsp)...>>>print(operator.print_details())IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIZ(-400141.5+0j)IIIIIIIIIIIIIIIIIIIIIIIIIIIIZIIIIIII(-400152.5+0j)IIIIIIIIIIIIIIIIIIIIIIIIIIIIZIIIIIIZ(12+0j)# snipped for brevity>>>print(operator.num_qubits)36...>>>dwave_mes=DWaveMinimumEigensolver(num_reads=1000)>>>result=dwave_mes.compute_minimum_eigenvalue(operator)...>>>x=sample_most_likely(result.eigenstate)>>>tsp.tsp_feasible(x)True>>>tsp.get_tsp_solution(x)[2,3,5,1,4,0]For comparison, trying this onNumPyMinimumEigensolverproduces:>>>fromqiskit.aqua.algorithmsimportNumPyMinimumEigensolver>>>result=NumPyMinimumEigensolver().compute_minimum_eigenvalue(operator)# snipped for brevityMemoryError:Unabletoallocate512.GiBforanarraywithshape(68719476737,)anddatatypeuint64and trying withQAOAbacked with "qasm_simulator" produces:>>>fromqiskitimportBasicAer>>>fromqiskit.aquaimportQuantumInstance>>>fromqiskit.aqua.algorithmsimportQAOA>>>quantum_instance=QuantumInstance(BasicAer.get_backend('qasm_simulator'))>>>qaoa_mes=QAOA(quantum_instance=quantum_instance,initial_point=[0.,0.])>>>result=qaoa_mes.compute_minimum_eigenvalue(operator)# snipped for brevityBasicAerError:'Number of qubits 36 is greater than maximum (24) for "qasm_simulator".'InstallationCompatible with Python 3.6+,Qiskit0.23.0+,
andOcean3.1.0+.pipinstalldwave-qiskit-pluginTo install from source:pipinstall-rrequirements.txt
pythonsetup.pyinstallTest requirements are intests/requirements.txt.Note:Configured access to D-Wave APIis required.LicenseReleased under the Apache License 2.0. SeeLICENSEfile.
Package: dwave-scikit-learn-plugin
D-Wavescikit-learnPluginThis package provides ascikit-learntransformer forfeature selectionusing a
quantum-classicalhybrid solver.This plugin makes use of a Leap™ quantum-classical hybrid solver. Developers can get started bysigning upfor the Leap quantum cloud service for free.
Those seeking a more collaborative approach and assistance with building a production application can
reach out to D-Wavedirectlyand also explore the feature selectionofferingin AWS Marketplace.The package's main class,SelectFromQuadraticModel, can be used in any existingsklearnpipeline.
For an introduction to hybrid methods for feature selection, see theFeature Selection for CQM.ExamplesA minimal example of using the plugin to select 20 of 30 features of ansklearndataset:>>>fromsklearn.datasetsimportload_breast_cancer>>>fromdwave.plugins.sklearnimportSelectFromQuadraticModel...>>>X,y=load_breast_cancer(return_X_y=True)>>>X.shape(569,30)>>>X_new=SelectFromQuadraticModel(num_features=20).fit_transform(X,y)>>>X_new.shape(569,20)For large problems, the default runtime may be insufficient. You can use the CQM solver'smin_time_limitmethod to find the minimum accepted runtime for your problem; alternatively, simply submit as above
and check the returned error message for the required runtime.The feature selector can be re-instantiated with a longer time limit.>>>X_new=SelectFromQuadraticModel(num_features=20,time_limit=200).fit_transform(X,y)InstallationTo install the core package:pipinstalldwave-scikit-learn-pluginLicenseReleased under the Apache License 2.0ContributingOcean'scontributing guidehas guidelines for contributing to Ocean packages.Release Notesdwave-scikit-learn-pluginmakes use ofrenoto manage its
release notes.When making a contribution todwave-scikit-learn-pluginthat will affect users, create a new
release note file by runningrenonewyour-short-descriptor-hereYou can then edit the file created underreleasenotes/notes/.
Remove any sections not relevant to your changes.
Commit the file along with your changes.
Package: dwave-sona-core
Dwave SONA Core迪威智能 SONA 服務專用核心開發套件安裝與使用開發環境需求Python 3.8 或更新版本poetryffmpeg安裝與使用環境建構$pipinstallpoetry下載與安裝$exportPYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
$poetryaddgit+ssh://git@github.com/DeepWaveInc/dwave-sona-core.git撰寫 Inferencer 模組fromtypingimportDict,ListfromloguruimportloggerfrompydanticimportBaseModel,Fieldfromsona.core.inferencerimportInferencerBasefromsona.core.messagesimportFile,ResultclassInputParamSchema(BaseModel):param1:int=Field(42,description="this is the value of param1")param2:str=Field("43",description="this is the value of param2")classInputFilesSchema(BaseModel):origin:str=Field("data/test.mp3",description="this is the value of origin")classSimpleInferencer(InferencerBase):name="mock"description="This is a simple inferencer"input_params_schema=InputParamSchema()input_files_schema=InputFilesSchema()defon_load(self)->None:logger.info(f"Download{self.__class__.__name__}models...")definference(self,params:Dict,files:List[File])->Result:logger.info(f"Get params{params}")logger.info(f"Get files{files}")returnResult(files=[File(label="output",path=files[0].path)],data={"output_key":"output_val"},)if__name__=="__main__":inferencer=SimpleInferencer()inferencer.cmd()測試指令$pythonsimple.py--help
Usage:simple.py[OPTIONS]<filepath:origin>Thisisasimpleinferencer

Options:--param2<string>thisisthevalueofparam2--param1<integer>thisisthevalueofparam1--helpShowthismessageandexit.$pythontests/simple.pytests/simple.py2023-10-1702:18:41.702|INFO|__main__:on_load:25-DownloadSimpleInferencermodels...2023-10-1702:18:41.702|INFO|__main__:inference:28-Getparams{'param2':'43','param1':42}2023-10-1702:18:41.703|INFO|__main__:inference:29-Getfiles[File(label='origin',path='tests/simple.py',metadata={})]{"files":[{"label":"output","path":"tests/simple.py","metadata":{}}],"data":{"output_key":"output_val"}}
Package: dwave-system
dwave-systemdwave-systemis a basic API for easily incorporating the D-Wave system as a
sampler in theD-Wave Ocean software stack,
directly or throughLeap‘s cloud-based
hybrid solvers. It includesDWaveSampler, a dimod sampler that accepts and
passes system parameters such as system identification and authentication down
the stack,LeapHybridSampler, for Leap’s hybrid solvers, and other. It also
includes several useful composites—layers of pre- and post-processing—that
can be used withDWaveSamplerto handle minor-embedding,
optimize chain strength, etc.InstallationInstallation from PyPI:pipinstalldwave-systemInstallation from PyPI with drivers:NotePrior to v0.3.0, runningpip installdwave-systeminstalled a driver dependency calleddwave-drivers(previously also calleddwave-system-tuning). This dependency has a restricted license and has been made optional
as of v0.3.0, but is highly recommended. To view the license details:fromdwave.driversimport__license__print(__license__)To install with optional dependencies:pipinstalldwave-system[drivers]--extra-index-urlhttps://pypi.dwavesys.com/simpleInstallation from source:pipinstall-rrequirements.txtpythonsetup.pyinstallNote that installing from source installsdwave-drivers. To uninstall the proprietary components:pipuninstalldwave-driversLicenseReleased under the Apache License 2.0. See LICENSE file.ContributingOcean’scontributing guidehas guidelines for contributing to Ocean packages.
Package: dwave-tabu
> :warning:Note:dwave-tabuis deprecated in favor ofdwave-samplers.dwave-tabuA C/C++ implementation of theMST2 multistart tabu search algorithmfor quadratic unconstrained binary optimization (QUBO) problems with adimod samplerPython interface.InstallationInstall from a wheel on PyPI:pip install dwave-tabuExampleThis example solves a two-variable Ising model.>>> from tabu import TabuSampler
>>> response = TabuSampler().sample_ising({'a': -0.5, 'b': 1.0}, {('a', 'b'): -1})LicenseReleased under the Apache License 2.0. SeeLICENSEfile.ContributingOcean’scontributing guidehas guidelines for contributing to Ocean packages.
Package: dwave-tuner
D-Wave Tunerdwave-tunersimplifies the process of tuning annealing parameters, allowing
you to concentrate on your model and specific problem. Simply specify the
number of embeddings, chain strengths, and annealing times, and watch as
dwave-tuner tailors the tuning experience to your needs.FeaturesEffortless parameter tuning: Grid scan chain strengths and annealing
times with a given number of embeddings.Caching for efficiency: D-Wave responses are cached by default, enhancing
performance by utilizing cached results unless you modify the scan or alter
the parameters.User-Friendly: Minimal configuration; just specify your preferences in a
dictionary, and letdwave-tunerhandle the details.Example UsageimportdwavetunerSpecify the scan parameters:parameters={'num_embeddings':10,'num_chain_strengths':1,'num_reads':1000,'num_reps':1}Create aScannerto schedule theJobs:scanner=dwavetuner.Scanner(my_model.bqm,label='my_model',**parameters)Perform a grid scanscanner.grid_scan()The grid scan stores the results inscanner.results. It returns a response
that can also be accessed viaprint(scanner.response)The verbose tuning data can be accessed viax,ys,yerrs=scanner.scan_results('chain_strength')For annealing time scans, replacechain_strengthwithannealing_time.Note thatxis one list, whileysanyerrscontainscanner.num_embeddingslists - one for each embedding.Alternatively, use these self-explanatoryparameters:# Scan chain strengthsparameters={'num_embeddings':10,'chain_strengths_start':0.24,'chain_strengths_end':0.44,'num_chain_strengths':10,'num_reads':100,'num_reps':1}# Scan annealing timesparameters={'chain_strength':0.28,'num_annealing_times':10,'num_reads':100,'num_reps':5}AuthorOrkun Şensebatgit@senseb.at
Package: dwbzen
dwbzendwbzen has python implementations of some of the classes in my github projects:commonlib: math classes including Markov Chains,
and utilities/classes used by other projects.text-processing: Generates text using Markov chains,
and part-of-speech (POS) patterns from POS word files Part Of Speech Databasemusic_framework: A Java framework encapsulating musical structure,
notation and theory for purposes of composition and analysis.dwbzen includes the following sub-packages:commontextmusicI usedGithub-flavored Markdownto write content.
Package: dwca-writer
dwca-writerPython package for writing Darwin Core Archives (DwC-A).Installationpip install dwca-writerQuick startfromdwcawriterimportArchive,Tableimportosimportpandasaspddf_core=pd.DataFrame(data={"occurrenceID":[1,2,3],"scientificName":["Abra alba","Lanice conchilega","Nereis diversicolor"],"notes":["white","brown","green"],"year":[2008,2009,2010]})df_extension=pd.DataFrame(data={"id":[1,2,3],"measurementType":["temperature","temperature","temperature"],"measurementValue":[12,13,14]})archive=Archive()archive.eml_text=""core_table=Table(spec="https://rs.gbif.org/core/dwc_occurrence_2022-02-02.xml",data=df_core,id_index=0,only_mapped_columns=True)archive.core=core_tableextension_table=Table(spec="https://rs.gbif.org/extension/dwc/measurements_or_facts_2022-02-02.xml",data=df_extension,id_index=0)archive.extensions.append(extension_table)print(archive)Archive with 1 core tables and 1 extension tables
Table of type http://rs.tdwg.org/dwc/terms/Occurrence with 3 rows and 4 columns
  occurrenceID: http://rs.tdwg.org/dwc/terms/occurrenceID (column 1)
  scientificName: http://rs.tdwg.org/dwc/terms/scientificName (column 2)
  notes
  year: http://rs.tdwg.org/dwc/terms/year (column 3)
Table of type http://rs.tdwg.org/dwc/terms/MeasurementOrFact with 3 rows and 3 columns
  id (column 1)
  measurementType: http://rs.tdwg.org/dwc/terms/measurementType (column 2)
  measurementValue: http://rs.tdwg.org/dwc/terms/measurementValue (column 3)archive.export("dummy.zip")
Package: dwcl
DashWindowCloseListenerDashWindowCloseListener is a Dash component library that allows you to listen to the browser window close event. This can be used to stop the Dash server when the user closes his window, which is useful when using Dash apps as part of a multi step a workflow.This is illustrated in the following example:Get started with:Install Dash and its dependencies:pip install -r requirements.txt(https://dash.plotly.com/installation)Runpython usage.pyVisithttp://localhost:8050in your web browserWhen closing the browser window, the dash server will stop.ContributingSeeCONTRIBUTING.md
Package: dwclib
OverviewPython wrapper to DataWarehouse Connect.Free software: ISC licenseInstallationconda install -c conda-forge dwclibpip install dwclibInstallation through conda greatly simplifies dependency management.Additionally, Microsoft SQL Server drivers are needed and will need to be installed seperately.
See here for more information:https://github.com/mkleehammer/pyodbc/wikiChangelog2023.6.21Remove all occurences of naive datetime since dask now support tz-awareNew config file syntax to be compatible with other librariesFix a bug when Pleth waveform return all NaN2023.6.7Support for querying alerts using the read_alerts callUse the platformdirs package for config file location2022.9.14Support numeric labels and sublabels in read_patients and read_numericsSupport to query for multiple patients at once in read_numerics2022.6.23Convert packaging from flit to poetryAdd linting and testing with nox, flake8 and safetyCreate scaffolding for future Sphinx documentationFix a number of bugs in corner cases (division by zero, ...)Add a generic Dask wrapper to run custom DWC queries with Dask2022.3.22Convert packaging from old-style setup.py to flitRefactor: extract common code between dask and pandas versionNo longer relies on user defined function in the databasePatients: add read_patient function to fetch a single patientNumerics: read_numerics patientids can be a list or a str. When it is a list, a MultiIndex is returned
Package: dw-client
[![GitHub Actions badge](https://github.com/DeskWatch/dw-client/workflows/Build/badge.svg)](https://github.com/DeskWatch/dw-client/actions)
[![PyPI](https://img.shields.io/pypi/v/dw-client)](https://pypi.org/projectdw-client/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Typechecking: Mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)[Documentation](https://deskwatch.readthedocs.io/en/latest/)Client library for DeskWatch in Python.Please see the documentation for usage and examples.## How to installTo install the latest git version directly from github without cloning, runpip install git+https://github.com/DeskWatch/dw-client.gitTo install from a cloned version, cd into the directory and runpoetry installto install inside an virtualenv. If you want to install it
system-wide it can be installed withpip install ., but that has the issue
that it might not get the exact version of the dependencies due to not reading
the poetry.lock file.## DebuggingRun python withLOG_LEVEL=debugto get additional debugging outputIf invalid events have been queued for submission, you may need to delete the file-based queues generated by this libraryTo use the development version of this library usedw-client = {path = “../dw-client” }inpyproject.toml## ExamplesTheexamples/directory contains a couple of example scripts, including:time_spent_today.py- fetches all non-afk events and sums their duration to get the total active time for the day.merge_buckets.py- merges two buckets with non-intersecting events by moving all events from one into the other.redact_sensitive.py- redact sensitive events.