Saravanan666/pypi-org huggingface dataset:
Package: npy-patcher
npy-cpp-patchesRead N-Dimensional patches from.npyfiles. This module is built usingC++and hasPython3bindings.Data SpecificationsArrays must be saved inC-contiguousformat, i.e.NOTFortran-contiguous.First dimension is indexed using in a non-contiguous manner. For example, this can be used to extract specific channels within a natural image.Next dimensions are specified by a patch shapeC++vector orPythontuple. To extract patches of lower dimensionality than that of the data, set the corresponding dimensions to1.Python UsageInstallpip install npy-patcherUsagefromnpy_patcherimportPatcherDouble,PatcherFloat,PatcherInt,PatcherLong# In this example lets say our data has shape (10, 90, 90), and is therefore 3D.data_fpath='/my/numpy/file.npy'patcher=PatcherFloat()# Use PatcherFloat for np.float32 datatypenc_index=[0,1,3,5,7]# Non-contiguous indexpatch_shape=(30,30)# Contiguous patch shape.patch_stride=(30,30)# Contiguous patch stride, set a smaller value than `patch_stride` for overlapping patches.patch_num=2# The patch number indexes the patches (starting from 0). So in our example the index 2# would be equivalent to data[nc_index, 0:30, 60:90]. The variable indexes the patches# in C-contiguous manner, i.e. the last dimension has the smallest stride.extra_padding=(0,0)# Optionally apply extra padding, this is applied after initial padding calculation.patch_num_offset=(0,0)# Optionally provide an offset to extract patches after.patch=patcher.get_patch(data_fpath,nc_index,patch_shape,patch_stride,patch_num,extra_padding,patch_num_offset)patch=patch.reshape((5,30,30))# PatcherFloat returns a list, therefore we need to reshape.C++ UsageBelow is an example written inC++, equivalent to thePythonusage above.// test.cpp#include"src/patcher.hpp"#include<vector>#include<string>intmain(){std::stringfpath="data.npy";std::vector<size_t>nc_index{0,1,3,5,7};std::vector<size_t>patch_shape{30,30};std::vector<size_t>patch_stride{30,30};size_tpatch_num=2;std::vector<size_t>extra_padding={0,0};std::vector<size_t>patch_num_offset={0,0};Patcher<float>patcher;// Here the patch object is a contiguous 1D vectorstd::vector<float>patch=patcher.get_patch(fpath,nc_index,patch_shape,patch_stride,patch_num,extra_padding,patch_num_offset);return0;}You can then build the package, for example usingg++:$cdnpy-cpp-patches/
$g++-std=c++17-I./-gtest.cppsrc/npy_header.cppsrc/pyparse.cpp-otest
Package: npysearch
npysearchnpysearch implements an efficient BLAST-like sequence comparison algorithm, written in C++11 and using native Python datatypes and bindings. npysearch is light-weight, fast, and dependency-free. The code base of npysearch is adapted fromnsearch.Installationfrom pypipip install npysearchfrom conda-forgeInstalling from theconda-forgechannel can be achieved by addingconda-forgeto your channes with:conda config --add channels conda-forge
conda config --set channel_priority strictYou can skip the above step ifconda-forgechannel has been added already.Once the conda-forge channel has been enabled,npysearchcan be installed with:conda install npysearchfrom github# Clone repository from github
git clone https://github.com/tamminenlab/npysearch.git

# Install package using pip
pip install ./npysearchExamples# Import npysearch packageimportnpysearchasnpy# Read query file into a dictionaryquery=npy.read_fasta("npysearch/data/query.fasta")# Read database file into a dictionarydatabase=npy.read_fasta("npysearch/data/db.fasta")# BLAST the query against the databaseresults_dna=npy.blast(query,database)# BLAST protein sequence file against itself using filenames as blast function argumentsresults_prot=npy.blast(query="npysearch/data/prot.fasta",database="npysearch/data/prot.fasta",alphabet="protein")CaveatsTheblastfunction automatically detects whether the query and database arguments were passed as string paths to fasta files or as dictionaries of sequences. Both of them need not be input as the same type.Usehelp(npy)(assuming you've imported npysearch as npy) to get a list of the functions included and their docstrings. For docstrings of specific functions, for example blast, usehelp(npy.blast)
Package: npzigzag
npzigzagThis is a simple numpy implementation of a zigzag indicator. It's only dependencies are pandas and numpy.UsagepipinstallnpzigzagfromnpzigzagimportcoreaszzThis package has one method:core.zigzag(X, pc, include_first = True)Parameters:X:pd.Series or np.ndarray or listMain data to compute the indicator on.pc:floatPercentage change treshold. This indicates the minimum jump the timeseries has to make before a pivot is recognized in the zigzag indicator.include_first:boolIndicates wether or not to add the first observation of X as a pivot point,Returns:pivot_indices:np.ndarrayif X isnp.ndarrayorlist,pd.Int64Indexif X ispd.SeriesArray with indices of zigzag pivot points.Example:fromnpzigzagimportcoreaszzimportnumpyasnpX=np.cumprod(1+np.random.randn(100)/100)zz_pivots=zz.zigzag(X,0.02,False)plt.plot(X,'--')plt.plot(zz_pivots,X[zz_pivots])plt.scatter(zz_pivots,X[zz_pivots])Ouputs:
Package: np-zoom-in
Zoom in on a picture$pipinstallnp-zoom-infromnp_zoom_inimportnp_zoom_inzoim=np_zoom_in(r"C:\Users\Gamer\anaconda3\envs\dfdir\xxxxxxxxxx.png",zoom_factor=1.2,mode="mirror",)# Possible parameters:# https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.zoom.html
Package: np-zro
np_zroFor use on internal Allen Institute networkJust thezro.Proxyclass extracted frommpeconfig, withzmqas a dependency.Installpython-mpipinstall--extra-index-urlhttps://pypi.org/simplenp_zroBasic usageProxy.__getattr__andProxy.__setattr__are forwarded to remotezmqobject:>>>fromnp_zroimportProxy>>>camstim_agent=Proxy('w10sv111814',port=5000,serialization='json')# BTVTest.1-Stim>>>camstim_agent.mouse_id='366122'>>>camstim_agent.mouse_id'366122'
Package: npzviewer
InstallJust use pip for installingpip install npzviewerUsagenpzviewer supports file dropping, opening from command line, and by clicking open on it’s menu.usage: npzviewer [-h] [-v] [npzfile]npzviewer is a .npz viewer, for numpy saved files.positional arguments:npzfile        a single .npz fileoptional arguments:-h,--helpshow this help message and exit-v,--versionget software version.Copyright 2019 Erico Vieira Porto, GPLv2.Recommended Install and RunFor installingpip3in Ubuntu, usesudo apt install python3-pip.pip3 install npzviewerAfter install, just open a terminal and type:npzviewerWindows install and runIn Windows, install Python 3 fromhttps://www.python.org/, and then opencmd.exeand type (press enter after):python -m pip install npzviewerTo run, you can type the following incmd.exeor therun…promptpython -m npzviewer
Package: nqdb
NQDBNot quite the DB Google used to have, not quite the DB Google has now.
Of course, better than both.This is a mock of NDB, almost.
It enables interfacing to Google Datastore, or to other DBs, by
changing the client.UsageModelsfromnqdbimport*client=DatastoreClient()classPerson(Model):_client=clientfirst_name=StringProperty('first_name')last_name=StringProperty('last_name')p=Person()p.first_name="Luca"p.last_name="de Alfaro"p.put()id=p.key_idprint("id:",id)q=Person(id=id)q.get()print("First name:",q.first_name)print("Last name:",q.last_name)Keysp=Person()p.first_name="Joe"p.last_name="Falchetto"put(p)id=p.key_idk=Key(Person,id)q=k.get()Batch operationsfromnqdbimportput_multip=Person()p.first_name="Joe"p.last_name="Falchetto"q=Person()q.first_name="Luca"q.last_name="de Alfaro"put_multi([p,q])The client used byput_multiis derived from the client used forpandq.
You cannot mix in the same batch operations models with different clients.Queriesq=Person.query()q.filter(Person.first_name=='Luca')q.filter(Person.gender=='Male')forpinq.fetch():print(p.last_name)You can add an ordering to a query by:q.order(+Person.first_name)You can use both+Person.first_nameand-Person.first_name,
but one of+,-should be present.Cachingclient=DatastoreClient(cache=MyCache())Look atcache.Cacheto see the (very few) methods you need to implement to use a new cache.And as usual, look at the test files, because those do not lie.
Package: nqdm
NQDMA more generalised implementation to TQDM-progress bars,
which simulates a single loop for multiple loops and returns
multiple elements at the same time. It can iterate over the deeper levels. It is compatible with many data types,
is customizable and beginner-friendly.InstallingInstall it using the terminalpip install nqdmThen import it as followsfrom nqdm import nqdmGet StartedPlease checkmain.ipynbfor use casesBuilt Withtqdm- The progress barAuthorsYamac Eren Ay-Initial work-yamaceayLicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for detailsSpecial Thanks to:Stanislav Kosorin-stano45Ori Toledo-Logo design-oritoledoAcknowledgmentsIt's worth mentioning that this module is built on top ofTQDM,  I would like to
thank them for making this process of creating progress bars easy and flexible.
Package: nqe
Neural Quantile EstimationSimulation-Based Inference with Quantile Regression.InstallationTo install, clone this repo and runpip install -e .We are yet to have the first release of NQE.
While already available on pypi, it is likely some not-up-to-date dev version,
so please directly build from GitHub for now.DocumentationComing soon, please check back later.Citing NQEIf you find NQE useful for your research, please consider citing our papers accordingly:He Jia,Simulation-Based Inference with Quantile Regression
Package: nqgcs
NQGCSThis package offers a pleasant interface to Google Cloud Storage.Usage:Create an NQGCS objectThere are three ways.  On Appengine, you can do simply:fromnqgcsimportNQGCSnqgcs=NQGCS()You can do the above also if you use:export GOOGLE_APPLICATION_CREDENTIALS="[PATH]"Otherwise, you can use a json key file.  You can either pass the
path to the file:fromnqgcsimportNQGCSnqgcs=NQGCS(json_key_path="your json key to gcs")Or you can pass the file content, read via json:fromnqgcsimportNQGCSnqgcs=NQGCS(keys=keys)Access GCSUpload a filewithopen("myfile","r")asf:nqgcs.upload("bucket name","file name",f,type="text/plain")Write a string to GCSnqgcs.write("bucket name","file name","my content string",type="text/plain")Read a string from GCSs=nqgcs.read("bucket name","file name")Download a file from GCSnqgcs.download("bucket name","file name")Delete a file, list filesnqgcs.delete("bucket name","file name")forfinnqgcs.listfiles("bucket_name",maximum=200):print("The file name is:",f)
Package: nqgym
NQGymA command-line utility that creates Python projects.FeaturesNQGymcan help you create a Python project template, or a web service project template.Features of the Python project template:Usemaketo facilitate the development process, such ascreating virtual environmentinstalling dependent libsbuilding the disttesting and running UT coverageSupportCLI(Command-Line Interface) to start / stop the app or run other commands from the Python entry point.How to use itInstall from PyPi:$pipinstall-UnqgymFind the help:$nqgym--help
$nqgymcreate--helpCreate a Python project:$nqgymcreateThe generator will ask you for some input data, you might want to have at hand before generating the project.The input variables, with their default values (some auto generated) are:project_name: The name of the project.package_name: The name of the Python package. By default, based on the project name.python_version: The version of Python you want to use.More detailsAfter using the generator, your new project (the directory created) will contain an extensiveREADME.mdwith instructions for development, deployment, etc. You can read it to find more details.How to contributePlease follow the guidecontributionto develop and contribute NQGym.Release notesv1.0.0 12/8/2021Project init.Created the Python project template.Support make, cli.Support UT and UT coverage.LicenseThis project is licensed under the terms of the BSD license.
Package: nqlib
Welcome to NQLibNQLib is aPythonlibrary to design noise shaping quantizer for discrete-valued input control.What can I do with NQLib?In the real world, a dynamic system may have to be controlled by discrete-valued signals due to the inclusion of actuators that are driven by ON/OFF or network with capacity limitations. In such a case, a good output may be obtained by converting continuous-valued input to discrete-valued input with a quantizer designed by NQLib.ExampleSeehere.InstallYou can install NQLib by using pippip install nqlibor conda.conda install -c conda-forge nqlibReferencesNQLib is a Python library version ofODQ Toolbox,
which were developed inMATLAB.The algorithms used in NQLib are based on the following paper.[1] S. Azuma and T. Sugie: Synthesis of optimal dynamic quantizers for discrete-valued input control;IEEE Transactions on Automatic Control, Vol. 53,pp. 2064–2075 (2008)[2] S. Azuma, Y. Minami and T. Sugie: Optimal dynamic quantizers for feedback control with discrete-level actuators; Journal of Dynamic Systems, Measurement, and Control, Vol. 133, No. 2, 021005 (2011)[3] 南，加嶋：システムの直列分解に基づく動的量子化器設計；計測自動制御学会論文集，Vol. 52, pp. 46–51(2016)[4] R. Morita, S. Azuma, Y. Minami and T. Sugie: Graphical design software for dynamic quantizers in control systems; SICE Journal of Control, Measurement, and System Integration, Vol. 4, No. 5, pp. 372-379 (2011)[5] Y. Minami and T. Muromaki: Differential evolution-based synthesis of dynamic quantizers with fixed-structures; International Journal of Computational Intelligence and Applications, Vol. 15, No. 2, 1650008 (2016)LicenseThis software is released under the MIT License, see LICENSE.txt.
Package: nqlog
nqlogLuca de Alfaro, 2020Not quite the logger Google wrote, not quite the logger Luca wanted, but at least:It logs to the Google cloud.It groups logs for the same "request" into the same log entry.The severity of the grouped lines is equal to the maximum severity of any line in the group.It avoids running string formatting for strings that are logged below the minimum level.This seems trivial and normal, but unfortunately, it is no longer the standard behavior.  In GC, log lines are no longer automatically grouped together for each request, and even if you figure out how to have them grouped, the groupno longer inherits the maximum severity of any line in the group.The chief limitation of this logger is that it works only for
single-threaded services.  Extension to multi-threaded services is
a work in progress.UseKeys to GCIn your "main" file, you need:importosos.environ['GOOGLE_APPLICATION_CREDENTIALS']="keys/google_cloud_keys.json"where of course you replace the path with the actual one.  The keys are json keys to a service account that has logging rights on Google cloud.Logger useAll you need is:fromnqlogimportlogthis,loggingThen, you need to decorate the functions whose execution corresponds to a "request".  This can be the execution of a web request (e.g., a bottle entry point), or the execution of a task from a scheduler.@logthis()deffunction_to_be_logged():...Once this is done, whenever inside the function to be logged, or one of the things it calls, you do:logging.info("This is a log line")the log line is logged together with all other lines of the request. The grouping is thread-safe, so if you callfunction_to_be_loggedfrom multiple threads (e.g., to service requests in parallel), everything works as it should.The logthis decorator takes optional parameters:Decorator to cause a function to be logged.
:param log_name: Name of the log to be used for logging.
:param resource: resource to be used for logging.  You can create a
    resource e.g. via:
    from google.cloud.logging.resource import Resource
    resource = Resource( type='gae_app',
                labels={
                    "project_id": os.getenv("GOOGLE_CLOUD_PROJECT")
                    "module_id": os.getenv("GAE_MODULE")
                    "service_id": os.getenv("GAE_SERVICE")
                    "version_id": os.getenv("GAE_VERSION")
                   })
:param max_duration: Max duration of a log entry in seconds.
    If the request takes longer than this, the log entry is broken into
    multiple log entries, each of at most max_duration length.
:param level: Minimum level at which logging occurs.EfficiencyOften, building a log line is computationally intensive, due to the process of converting data types and structures to a string.  nqlog contains an optimization.  If instead of doing:logging.debug("The value of my monster data structure is: %r" % monster)you do:logging.debug("The value of my monster data structure is: %r", monster)with a,instead of a%, then nqlog avoids convertingmonsterto its representation unless the log level isDEBUGor lower.
Package: nqm.iotdatabase
nqm-iot-database-utils-pythonPython port ofnqminds/nqm-iot-database-utilsInstallingUse the below to install as a library usingpip:pip3installnqm.iotdatabase# installing the latest git version:# pip3 install git+https://github.com/nqminds/nqm-iot-database-py.git#egg=nqm.iotdatabaseYou can replacepip3withpoetryif you prefer.To download the library, install dependencies for running tests, and build
documentation, do:gitclonehttps://github.com/nqminds/nqm-iot-database-py.gitcdnqm-iot-database-py/
poetryinstallDocumentationWe use Sphinx, Autodoc, Napoleon, andsphinx_autodoc_typehintsto make our documentation.The below creates html.poetryrunmakehtmlTestsUnittestspoetryrunpython-mpytestUnittests Coveragepoetryruncoveragerun--source=nqm-mpytest&&poetryruncoveragereportTypetestspoetryrunmypy-mnqm.iotdatabase&&echo-e"\e[1;32mPass! \e[0m"DoctestspoetryrunmakedoctestLintingpoetryrunpre-commitrun--all-filesPossible upgrades to make in SQLAlchemyAdd sorting on Primary Keys (SQLite feature)allow using SQLite URI connections (for read-only)
Package: nqontrol
NQontrol Servo ControllerNQontrolis a Python project aiming the replacement of analog PID controllers in the lab.The project is a solution based on the ADwin real-time platform that is able to deliver in excess of 8 simultaneous locking loops running with 200 kHz sampling frequency, and offers five second-order filtering sections per channel for optimal control performance.
It can be used up to a control bandwidth of about 12 kHz.
This Python package, together with a web-based GUI, makes the system easy to use and adapt for a wide range of control tasks in quantum-optical experiments.The source code can be found onGitLab.Read the latest changes in ourchangelog.Paper VersionA fixed state of this project isversion 1.1.
The publicated paper about this project is availablehere.
The preprint version of the paper describing can be found onarXiv.Usage ExampleHere is a short example for the Python API (see thefull examplein the docs):# Importing a ServoDevice is enoughfromnqontrolimportServoDevice# Create a new servo device object, connecting to ADwin with the device number 0.# Number 0 is reserved for a virtual mock device for testing.sd=ServoDevice(0)# Print the timestampprint(f'Uptime{sd.timestamp}s')# Get a servo object to control it.s=sd.servo(1)# Enable in and outputs.inputSw=Trues.outputSw=True# Run a threshold analysis for lockings.lockAnalysis()# Enable the autolocks.autolock(relock=True)Graphical User InterfaceNQontrolcan also be used with a responsive graphical user interface that runs in a browser (more details in thedocs):Autolock FeatureAnautolock featuremakes it simple to lock all the control loops.
It scans the output until a threshold value of theauxsignal is reached, then it activates the lock.DocumentationFor more information please read the online documentation:Current documentation of thelatest releaseCurrent documentation of thelatest development versionNQontrol InstallationIt's as simple aspipinstallnqontrolBut additionally you need to install the ADwin library.
For complete installation instructions please refer to thedocumentation page.ContributionIf you want to make changes for yourself or contribute to the project, take a look onthis pageto see how to setup the environment.
Package: nqsdk
NQ SDKPart of NQ suite byInqana.Abstract Provider ClassesConstruct your provider class using base provider classnqsdk.abstract.provider.Providerand appropriate mixin classes depending on what functionality is supported by your provider.All abstract methods must be implemented.nqsdk.abstract.provider.ProviderBase provider class. All providers must be inherited from it.nqsdk.abstract.provider.HealthCheckMixinUse if your provider supports health check requests.nqsdk.abstract.provider.BalanceCheckMixinUse if your provider supports user's balance check requests.nqsdk.abstract.provider.DeliveryCheckMixinUse if your provider supports delivery check requests.nqsdk.abstract.provider.AckCheckMixinUse if your provider supports ack check requests.nqsdk.abstract.provider.CallbackHandleMixinUse if your provider supports callbacks from your API with no difference b/wnqsdk.enums.CallbackEvent.DELIVERY&nqsdk.enums.CallbackEvent.ACKevents. E.g. all events are sent to the same URL & provider can distinguish them from callback's payload.nqsdk.abstract.provider.StaticCallbackHandleMixinUse this class if your provider only supports static callbacks, meaning that all events are sent to the same URL that is related to the provider. In this case, the provider can only extract the message external ID from the callback payload.nqsdk.abstract.provider.DeliveryHandleMixinUse if your provider supportsnqsdk.enums.CallbackEvent.DELIVERYevent callbacks sent to a specific URL provided by NQ service.nqsdk.abstract.provider.AckHandleMixinUse if your provider supportsnqsdk.enums.CallbackEvent.ACKevent callbacks sent to a specific URL provided by NQ service.Dummy Providernqsdk.dummy.provider.DummyProvideris a dummy implementation of NQ Provider Interface. It does nothing but can be used for tests.You can find it atdummy/provider.py.TestsRun tests locally:./scripts/testsLicenseLicensed under the terms of theApache License, version 2.0. SeeLICENSEfile.Copyright (c) 2023 Inqana Ltd.
Package: nqueens
N-Queen ProblemThe "N-Queens Problem" is a classical problem of chess. Here N Queens are to be placed on an N * N chessboard in such a way that no queens attack each other. A Queen can  attack other Queens if its placed on the  same row, column or on its diagonals. We use Backtracking in the backend to solve this problem .UsageTo Install this package. Use :pip install nqueensClass Definitionclass Queen:
     def __init__(self, n = 0, algo = "backtrack", pos = []):
          self.n = int(n)
          self.algo = algo
          self.pos = []
          self.count = 0
          self.queen_data = []Use the below snippit to start using the package.from nqueens import *NQueens Possible Solution Spaceqq = Queen(5)
qq.pprint()Use scan_queen() class function to solve NQueens problem with image input.qq = Queen(4, algo = "backtrack")
qq.scan_queen("q5.PNG")NQueens Solution space as Voice outputqq = Queen(4)
  qq.alexa()NQueens Solution space as image outputqq = Queen(4, algo = "backtrack")
  qq.display()NQueens Solution space as PNG File outputqq = Queen(4)
  qq.save()Special Credits: https://python-packaging-tutorial.readthedocs.io/en/latest/setup_py.htmlReferences: https://www.geeksforgeeks.org/printing-solutions-n-queen-problem/Visit our GitHub Repository for more information: https://github.com/toshihiroryuu/nqueens---PyPI-Package
Package: nr.ansiterm
Note: This package is in the dangerous land of0.x.yversions and may be subject to breaking
changes with minor version increments.nr.ansitermModule for producing ANSI escape codes and stylizing text in terminals. Supports SGR, LUT and
True colors as well as all ANSI attributes perWikipedia: ANSI escape code.Example:fromnr.ansitermimportstyled,parse_style,Attributeprint('Hello',styled(name,'bright_blue',attrs=['bold','underline']))print(str(parse_style('%014 italic'))+"What's kickin'?"+str(Attribute.RESET))Copyright © 2020 Niklas Rosenstein