Saravanan666/pypi-org huggingface dataset:
Package: npp-materialslab-tools
npp_materialslab_toolsAuthor: Nikolaos PapadakisThis is a repository for the materials lab at HMU.documentation is in the github pages forhmu.materialslab.tools.It contains a number of utilities for the easier (and verified) calcualation of properties from the tests that are normally carried out.It contains:Tensile testing with the Imada MX2 universal testing machinea quick utility based on a matplotlib windowa tk mvc controller window with more capabilitiesDIC processing for tensile testing.batch processingrolling gui (incomplete)types of strain:true strainengineering strain (cauchy)interpolation:linearcubicsplinerawoutput imagesdisplacementmarkersgridstrain map (not complete)capture gui for a microscope USB cameraTektronix dmm 4020 Digital multimeter functionfor logging data (simple script)for logging data (tk mvc controller window)installationcd to the directory and executepython setup.py install
python setup.py developor (when loaded to pypi)pip install npp_materialslab_toolsto use it import:import npp_materialslab_tools as mltInstallation procedure using Condacreating a new environment (recommended)This is the recommended method.>condacreate-nmaterialslabpython=3>condaactivatematerialslabAlternatively *if you are running low on space on a SSD * drive you can use the prefix option (IMPORTANT:read through the followingStackOverflow Question: how to specify new environment location for conda create)Install dependenciesActivate the new conda environment and install the following:>condaactivatematerialslab
>condainstallopencvnumpyscipy
>condainstallmatplotlibpandasseaborn
>condainstallipythonjupyter
>condainstallopenpyxlInstall materialslab package.from sourceClone the repository from online to <hmu.materialslab.tools>.Change directory into<hmu.materialslab.tools>/pypkg/cd ./pypkgInstall the package locally:python setup.py installfrom pypi (not yet implemented)This will be simpler but not yet implemented>pipinstallmaterialslab-whatevername
Package: nppy
Neural Pre-processing Python(NPPy)Objective: NPPY is an end-to-end weakly supervised learning approach for converting raw head MRI images to intensity-normalized, skull-stripped brain in a standard coordinate space.Methods: NPPY solves three sub-tasks simultaneously through a neural network, without individual sub-task supervision. The sub-tasks include geometric-preserving intensity mapping, spatial transformation, and skull stripping. The model disentangles intensity mapping and spatial normalization to solve the under-constrained objective.Results: NPPY outperforms the state-of-the-art methods, which tackle only a single sub-task, according to quantitative results. The importance of NPP's architecture design is demonstrated through ablation experiments. Additionally, NPP provides users with the flexibility to control each task during inference time.InstructionsNeural Pre-processing Python(NPPY) can be accessed as a python library package.Python library packageTo use the NPP python (nppy) library, either clone this repository and install via 'pip install -e .' or install directly with pip.pip install nppyUsageOnce you download the Neural Pre-processing docker script, you can use NPP with the following command-line syntax:nppy -i input_folder -o output_folder -s -g -w -1In this command, "input_folder" represents the path to the input folder and "output_folder" is the pre-processed output folder path. NPP generates brain mask, intensity normalized brain and intensity normalized brain in the standard coordinate space.
For the large majority of images with voxel sizes near 1 mm3, NPP should run in less than 10 seconds on the CPU. As image size or resolution increases, the runtime might increase as well. If you encounter any issues, please contact the NPP development team for support.NPPY PapersIf you use NPPY or some part of the code, please cite:Neural Pre-processing:Neural Pre-Processing: A Learning Framework for End-to-end Brain MRI Pre-processing.Xinzi He, Alan Wang,Mert R. SabuncuMedical Image Computing and Computer Assisted Intervention 2023.SpringerarXiv:2303.12148Pre-trained modelsSee list of pre-trained models availablehere.Data:The Neural Pre-processing python(NPPY) model has been trained on a combination of seven different datasets, namely GSP, ADNI, OASIS, ADHD, ABIDE, MCIC, and COBRE. However, please note that most of the data used in the NPP papers cannot be shared due to redistribution restrictions. Nonetheless, if any researcher requires access to the Freesurfer outputs utilized during the training process, please feel free to contact me.
Package: npr-cli
npr-cliA simple cli for streaming your favorite npr stations.Installationpipinstallnpr-cliInstallation requires VLC, homebrew instructions can be foundhere.Usagenpr

nprup# start the npr daemonnprdown# stop the npr daemonnprsearch# search stations by name, call or zip code.nprsearch-q<yoursearch># search stations directly.nprplay# play your latest stream.nprstop# stop streamingnprfavorites# select a stream from your favorites.TODO:Better handling of daemon, launchd/systemdRun daemon behind gunicorn/uvicornAllow over writing of last line in terminal, a giant stack of commands is ugly.Create a "Now Playing" page to display known metadata about a streamnpr reportto report errors as issues in GH.report streams that wont playacceptance criteria:should read.npr/log/error.logand send content as part of issueshould send stream object.should not create issues for open issues with the same streamreport recent errors, this is long termIssuesPlease report any bugs you encounter as issues to this repository.
Package: nprim
Este es un paquete Python utilizado para calcular que nÃºmero es primo entre 1 y ‘n’, donde ‘n’ es el nÃºmero es un parÃ¡metro de la funciÃ³n.
This program is free software: You can redistribute it and/or modify it under the terms of license by the Free Software Foundation, either version 3 of the License(at your option) any other version.
Package: nprime
InstallationTo install the package use pip:pip install nprimeIntroductionSome algorithm on prime numbers. You can find all the functions in the
filenprime/pryprime.pyAlgorithm developed :Eratosthenes sieve basedFermat’s test (based on Fermat’s theorem)Prime generating functionsMiller Rabin predictive algorithmSpecificationsLanguage: Python3.5.2Package:Basic python packages were preferredMatplotlib v2.1 - graph and mathIntegration and pipelineCode quality is monitored throughcodacity. For
the tests coverage, there’scodecovwhich is run during
theTravis CIpipeline.MathHere are a bit of information to help understand some of the algorithmsCongruence“≡” means congruent,a ≡ b (mod m)implies thatm /(a-b),∃ k ∈ Zthat verifiesa = kn + bwhich implies:a ≡ 0 (mod n) <-> a = kn <-> "a" is divisible by "n"Strong PseudoprimeA strongpseudoprimeto
a baseais an odd composite numbernwithn-1= d·2^s(for
d odd) for which eithera^d = 1(mod n)ora^(d·2^r)=-1(modn)for somer = 0, 1,...,s-1Erathostene’s SieveHow to useImplementation of the sieve of erathostenes that discover the primes and
their composite up to a limit. It returns a dictionary: - the key are
the primes up to n - the value is the list of composites of these primes
up to nfromnprimeimportsieve_eratosthenes# With as a parameter the upper limitsieve_eratosthenes(10)>>{2:[4,6,8,10],3:[9],5:[],7:[]}The previous behaviour can be called using thetrial_divisionwhich
uses theTrial
DivisionalgorithmTheoryThis sieve mark as composite the multiple of each primes. It is an
efficient way to find primes. Forn ∈ Nwithn > 2and for∀ a ∈[2,...,√n]thenn/a ∉ Nis true.Fermat’s TheoremHow to useA Probabilistic algorithm takingtrandoms numbersaand testing
the Fermat’s theorem on numbern > 1Prime probability is right is1 -1/(2^t)Returns a boolean: True ifnpasses the tests.fromnprimeimportfermat# With n the number you want to testfermat(n)TheoryIfnis prime then∀ a ∈[1,...,n-1]a^(n-1) ≡ 1 (mod n) ⇔ a^(n-1) = kn + 1Miller rabinHow to useA probabilistic algorithm which determines whether a given number (n >
1) is prime or not. The miller_rabin tests is repeatedttimes to
get more accurate results. Returns a boolean: True ifnpasses the
tests.fromnprimeimportmiller_rabin# With n the number you want to testmiller_rabin(n)TheoryForn ∈ Nandn > 2, Take a randoma ∈{1,...,n−1}Finddandssuch as withn - 1 = 2^s * d(with d odd) if(a^d)^2^r≡ 1 mod nfor allrin0tos-1Thennis
prime.The test output is false of 1/4 of the “a values” possible inn, so
the test is repeated t times.
Package: np-ringbuffer
NP Ringbuffernp_ringbufferprovides ring buffer operations using NumPy backend.Example usagefromnp_ringbuffer.ringbufferimportNumpyRingBuffer,TimedNumpyRingBufferimportnumpyasnp# construct from an existing numpy arrayringbuffer=NumpyRingBuffer.create_from_array(np.array([1,2,3]))ringbuffer.append(3)print(ringbuffer.values())# [2,3,3]ringbuffer.add_to_latest(10)print(ringbuffer.values())# [2,3,13]# construct an empty buffer with 5 capacityringbuffer=NumpyRingBuffer(capacity=10)ringbuffer.append(3)print(ringbuffer.values())# [3]ringbuffer.add_to_latest(10)print(ringbuffer.values())# [13]# automate the append and add_to_latest with interval_mstimed_ringbuffer=TimedNumpyRingBuffer(interval_ms=60_000,capacity=10)timed_ringbuffer.add(1)Practical usuageIn finance, if you want to build an real-time trading volume accumulator in 1-minute bucket. You can do something like this (this example uses 1-second bar for simplicity sake):# volume 1-second bar exampledefgenerate_volume()->float:returnrandom.random()*100defget_volume(iterations:int=1_000_000,pause_ms:float=1e-5):for_inrange(iterations):time.sleep(pause_ms)yieldgenerate_volume()timed_ringbuffer=TimedNumpyRingBuffer(interval_ms=1000,capacity=10)forvolumeinget_volume():timed_ringbuffer.add(volume)print(timed_ringbuffer.values())All of these examples are included in example.py
Package: nprint
A lightweight nested printing, for all your function within loops within
function needsInstallationYou can install using pip withpip3install--usernested_printUsageThis functions like an extension to the python print API, so you can useendandsepand everything else listed in theprint
API. Only
additional fields are added:levelnestBasic Examplefromnested_printimportnprintnprint("hi","there",level=2)# prints \t\t hi therenprint("hi","there",level=1,nest="--")# prints -- hi thereMotivation Examplefromnested_printimportnprintnprint("here")foriinrange(10):nprint(i,level=1)forjinrange(3):nprint(j,level=2)which printshere00121012...so it becomes easier for me to debugAPIlevelThis describes how many “nest” or “indentations” to add. Settinglevel=0is the same as using print.level=1indents the output
once, such that a\tis added in front when printing.nestBy default, nest is set to\t. This value can be set if you want to
modify the indentation. For example, instead of using\t, you can
setnest="  "to just add 2 spaces as the indentation. Or setnest="--"to set two dashes for every indentation.Versions1.0.x* Original publish and its fixes
Package: npr-news-now-cli
NPR News Now CLInpr-news-now-cliis a command-line tool that plays the most recent NPR News Now hourly update. It's designed to provide a simple and immediate way to stay updated with the latest news from NPR.DisclaimerThis tool is not officially affiliated with, authorized, maintained, sponsored, or endorsed by NPR (National Public Radio) or any of its affiliates or subsidiaries. This is an independent and unofficial project. Use at your own risk. The content accessed by this tool is subject to NPR's own terms of use.PrerequisitesBefore you install and usenpr-news-now-cli, you need to have VLC media player installed on your system as it relies on the VLC bindings for audio playback. Please follow the installation instructions on theVLC official website.InstallationTo installnpr-news-now-cli, make sure you have Python andpipinstalled on your system, then run the following command:pipinstallnpr-news-now-cliUsageAfter installation, you can run the tool using the following command:npr-news-nowLicenseThis project is open-source and available under the MIT License. See the LICENSE file for more information.
Package: n-profile-sdk
Getting Started with CTD - DocumentationInstall the PackageThe package is compatible with Python versions3 >=3.7, <= 3.11.
Install the package from PyPi using the following pip command:pipinstalln-profile-sdk==2.3.4You can also view the package at:https://pypi.python.org/pypi/n-profile-sdk/2.3.4Test the SDKYou can test the generated SDK and the server with test cases.unittestis used as the testing framework andpytestis used as the test runner. You can run the tests as follows:Navigate to the root directory of the SDK and run the following commandspip install -r test-requirements.txt
pytestInitialize the API ClientNote:Documentation for the client can be foundhere.The following parameters are configurable for the API Client:ParameterTypeDescriptionhoststringDefault:'HostValue'environmentEnvironmentThe API environment.Default:Environment.PRODUCTIONhttp_client_instanceHttpClientThe Http Client passed from the sdk user for making requestsoverride_http_client_configurationboolThe value which determines to override properties of the passed Http Client from the sdk userhttp_call_backHttpCallBackThe callback value that is invoked before and after an HTTP call is made to an endpointtimeoutfloatThe value to use for connection timeout.Default: 60max_retriesintThe number of times to retry an endpoint call if it fails.Default: 0backoff_factorfloatA backoff factor to apply between attempts after the second try.Default: 2retry_statusesArray of intThe http statuses on which retry is to be done.Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]retry_methodsArray of stringThe http methods on which retry is to be done.Default: ['GET', 'PUT']authorizationstringThe API client can be initialized as follows:fromctddocumentation.ctddocumentation_clientimportCtddocumentationClientfromctddocumentation.configurationimportEnvironmentclient=CtddocumentationClient(authorization='Authorization')AuthorizationThis API usesCustom Header Signature.List of APIsTasks QueriesCustom Attributes CategoriesLoginAssetsAlertsTasksQueriesInsightsSitesActivitiesLicenseUsersGroupsSensorsEventsClasses DocumentationUtility ClassesHttpResponseHttpRequest
Package: nprr
NPRR: Nonparametric randomized responseThis code implements the nonparametric randomized response (NPRR) mechanism as well as methods for computing locally differentially private confidence intervals and sequences from NPRR's output. The methods are based on the paper"A nonparametric extension of randomized response for private confidence sets"by Ian Waudby-Smith, Zhiwei Steven Wu, and Aaditya Ramdas (2023).InstallationpipinstallnprrOrganizationThe package is organized into two main submodules:nprr.mechanismsimplements privacy mechanisms including the NPRR and Laplace mechanisms along with utilities for working with them.nprr.dpcsimplements the confidence intervals and sequences from the paper as well as utilities for working with them.In addition, the package contains the following submodules:nprr.cgfimplements some cumulant generating functions (CGF) and CGF-like functions that are used throughout thenprr.dpcsmodule.nprr.plottingimplements functions for producing the plots found in the paper.nprr.typesimplements some basic type aliases used throughout the package.Reproducing the plots from the paperPlease begin the following steps from the root of the nprr directory.Create and activate a virtual environment using the method of your choice. We used venv, e.g.python3.9-mvenvvenv_dpconcsourcevenv_dpconc/bin/activateInstall the package and its dependencies.pythoninstall-e./Enter the plots directory.cdplotsGenerate figures.### Figure 1 ###pythonhoeffding_eps.py# -> output file: bounded_beta_1_1_hoeffding_eps.pdf### Figure 3 ###pythonhoeffding_tightness_max.py# -> output file: bounded_beta_50_50_tightness_max.pdf### Figure 4 ###pythonconfint_bounded.py# -> output file: bounded_beta_50_50_ci.pdf### Figure 5 ###pythonconfseq_bounded.py# -> output file: bounded_beta_50_50_cs.pdf### Figure 6 ###pythontwo-sided-running-mean.py# -> output file: wavy_cs.pdf### Figure 7 ###pythonab-test.py# -> output file: wavy_ipw_cs.pdf
Package: npsam
NP-SAMIntroductionIn this project we propose an easily implementable workflow for a fast, accurate and seamless experience of segmentation of nanoparticles.The project's experience can be significantly enhanced with the presence of a CUDA-compatible device; alternatively, Google Colab can be utilized if such a device is not accessible. For a quick access to the program and a CUDA-GPU try our Google Colab notebook.InstallationCreate a new conda environment callednpsamand activate it.conda create -n npsam python=3.10
conda activate npsamInstallPyTorch. NP-SAM has been tested with Pytorch 2.1.2 and CUDA 11.8.Then install NP-SAM, and make a static link to the ipykernelpip install npsam
python -m ipykernel install --user --name npsam --display-name npsamGet startedIn the npsam environment executejupyter labin the terminal. This will launch jupyterlab. Try out one of the example notebooks on our GitLab.Citation@article{NPSAM,
   author = {Larsen, Rasmus and Villadsen, Torben L. and Mathiesen, Jette K. and Jensen, Kirsten M. Ø and Bøjesen, Espen D.},
   title = {NP-SAM: Implementing the Segment Anything Model for Easy Nanoparticle Segmentation in Electron Microscopy Images},
   journal = {ChemRxiv},
   DOI = {10.26434/chemrxiv-2023-k73qz-v2},
   year = {2023},
   type = {Journal Article}
}AcknowledgmentThis repo benefits from Meta'sSegment AnythingandFastSAM. Thanks for their great work.
Package: npsearchsequence
Sequence / string search with NumPypip install npsearchsequenceTested against Windows 10 / Python 3.11 / Anacondanp_search_sequence(a,seq,distance=1):"""Search for the occurrence of a given sequence within a NumPy array.Parameters:- a (numpy.ndarray): The input NumPy array to search within.- seq (numpy.ndarray): The sequence to search for within the array.- distance (int, optional): The distance between consecutive elementsof the sequence in the array. Default is 1.Returns:numpy.ndarray:An array of indices where the given sequence is found in the input array.Example:seq = np.array([3, 6, 8, 4])arr = np.random.randint(0, 9, (1000000,))np_search_sequence(a=arr, seq=seq, distance=1)array([  8370,  24712,  25143, ..., 999287, 999493, 999805])"""np_search_string(string,substring,distance=1):r"""Search for the occurrence of a given substring within a string using NumPy.Parameters:- string (str or bytes): The input string to search within.- substring (str or bytes): The substring to search for within the string.- distance (int, optional): The distance between consecutive charactersof the substring in the string. Default is 1.Returns:numpy.ndarray:An array of indices where the given substring is found in the input string.Example:text = '''Welcome! Are you completely new to programming? If not then we presume you will be looking for information about why and how to get started with Python. Fortunately an experienced programmer in any programming language (whatever it may be) can pick up Python very quickly. It's also easy for beginners to use and learn, so jump in!Installing Python is generally easy, and nowadays many Linux and UNIX distributions include a recent Python. Even some Windows computers (notably those from HP) now come with Python already installed. If you do need to install Python and aren't confident about the task you can find a few notes on the BeginnersGuide/Download wiki page, but installation is unremarkable on most platforms.'''res = np_search_string(string=text*10000, substring='man', distance=1)array([  119,   238,   357, ..., 93382, 93533, 93709])res2 = np_search_string(string=(text * 10000).encode(), substring=b"man", distance=1)"""
Package: np-session
np_sessionFor use on internal Allen Institute networkA lightweight package for handling file paths and metadata associated with
Mindscope Neuropixels experiments with data on local rig-connected machines or
the /allen network.
Provides an interface that can be used by other applications.>>>fromnp_sessionimportSession# initialize with a lims session ID or a string containing one:>>>session=Session('c:/1116941914_surface-image1-left.png')>>>session.lims.id1116941914>>>session.folder'1116941914_576323_20210721'>>>session.is_ecephysTrue>>>session.rig.acq# hostnames reflect the computers used during the session, not necessarily the current machines'W10DT05515'# some properties are objects with richer information:>>>session.mouseMouse(576323)>>>session.projectProject('NeuropixelVisualBehavior')# - `pathlib` objects for filesystem paths:>>>session.lims_path.as_posix()'//allen/programs/braintv/production/visualbehavior/prod0/specimen_1098595957/ecephys_session_1116941914'>>>session.data_dict['es_id']'1116941914'# - `datetime` objects for easy date manipulation:>>>session.datedatetime.date(2021,7,21)# - dictionaries from lims (loaded lazily):>>>session.mouse.limsLIMS2MouseInfo(576323)>>>session.mouse.lims.id1098595957>>>session.mouse.lims['full_genotype']'wt/wt'# with useful string representations:>>>str(session.mouse)'576323'>>>str(session.project)'NeuropixelVisualBehavior'>>>str(session.rig)# from `np_config` package'NP.0'Adding a new projectAdd an enum with any project identifiers (e.g. lims project code) tocomponents.info.ProjectsCreate an entry for lims manifests (if applicable) in Zookeeper atprojects/np_session/manifeststhe D1 manifest will need customizing (see other entries)the default D0 and D2 manifests will likely suffice: nothing needs
to be done
Package: npsn
NPSN: Nuclear Power Surrogate NetworkNPSN is a package that allows easy training and optimization of neural networks that provide multidimensional regression of a nuclear reactor's power distribution based on control blade position(s).
The package is developed using thetensorflowbackend andkerasAPI.
The package is written to abstract the process of importing/pre-processing data, optimizing neural network architecture, and providing performance metrics.
The aim of this project is to facilitate development of surrogate models that are needed in autonomous reactor control systems.
Format for training data is detailed at the top of thedata generationscript.Exampleimportnpsnt# Define dataset directorydata_dir='~/some/data_location'# Define model nameproj_nm='npsn_surrogate'# Define number of control bladesn_x=4# Define nodalization of power distributionn_y=(15,20)#(axial_nodes, fuel_locations)# Train neural network without optimizationnpsn.train(proj_nm,data_dir,n_x,n_y)# Or with optimizationnpsn.train(proj_nm,data_dir,n_x,n_y,max_evals=100)# Post-process to quantify errornpsn.post(proj_nm)The output will be akerasmodel, in the current working directory (/cwd), that can be loaded usingkeras.models.load_model.
Error metrics will be output to the/cwd/csvdirectory and consist of mean and standard deviation of MAP error against test and training data.
If optimization studies are conducted, the data on each permutation will be output ot the/cwd/matdirectory and consist of a .mat file that can be loaded into MATLAB or withscipy.io.loadmat.InstallationTo install with pip:pip install npsnThe dependency requirements will be satisfied by pip. A full list of the environment used is inrequirements.
The package was developed on Ubuntu 18.04, but is written to also work on Mac and Windows OS.Paper using NPSNCiteIf you use NPSN in your work, please cite as:A. J. Dave, J. Wilson, K. Sun, "Deep Surrogate Models for Multi-dimensional Regression of Reactor Power," arXiv:, 2020.ContactIf you have any questions, comments, or suggestions feel free toemailme!