Saravanan666/pypi-org huggingface dataset:
Package: ndx-sound
ndx-sound Extension for NWBNWB extension for sounds.Installationpipinstallndx-soundUsagePythonAdd to an NWB filefrompynwbimportNWBFilefromscipy.ioimportwavfilefromndx_soundimportAcousticWaveformSeries# The file path to the audio filefile_path="audio_data.wav"# Read the audio file to get the rate of the recording and the waveformsampling_rate,samples=wavfile.read(file_path)# Create an AcousticWaveformSeries object with a given name and descriptionacoustic_waveform_series=AcousticWaveformSeries(name="acoustic_stimulus",data=samples,rate=sampling_rate,description="acoustic stimulus",)# Create an NWBFile object where this AcousticWaveformSeries can be added tonwbfile=NWBFile(session_description=...,identifier=...,session_start_time=...,)# If a recording of behavior, add to acquisitionnwbfile.add_acquisition(acoustic_waveform_series)# If a stimulus, add to stimulusnwbfile.add_stimulus(acoustic_waveform_series)VisualizationStatic widgetsUseplot_soundto visualize the waveform series and the spectrogram.
For longer recordings, specify thetime_windowargument for the start and end time
of the recording to be shown.fromndx_sound.widgetsimportplot_soundplot_sound(nwbfile.stimulus["acoustic_stimulus"])# Show only from 5 to 15 secondsplot_sound(nwbfile.stimulus["acoustic_stimulus"],time_window=(5,15))Useacoustic_waveform_widgetto include an Audio element that plays the sound.fromndx_sound.widgetsimportacoustic_waveform_widgetacoustic_waveform_widget(nwbfile.stimulus["acoustic_stimulus"],time_window=(5,15))Interactive widgetsUseAcousticWaveformWidgetto use a slider for interactively scrolling through the
recording and a button for changing the duration of the sound that is being shown.fromndx_sound.widgetsimportAcousticWaveformWidgetAcousticWaveformWidget(nwbfile.stimulus["acoustic_stimulus"])nwbwidgetsUseload_widgetsto load the interactive sound widget intonwb2widget.fromndx_sound.widgetsimportload_widgetsfromnwbwidgetsimportnwb2widgetload_widgets()nwb2widget(nwbfile)nwbwidgets and HDF5IOWhen usingnwb2widgetwith an NWB file that is read from disk, make sure to haveload_widgetsimported within the same Jupyter cell where your data is being loaded.frompynwbimportNWBHDF5IOfromndx_sound.widgetsimportload_widgetsfromnwbwidgetsimportnwb2widgetload_widgets()io=NWBHDF5IO("audio.nwb",mode="r",load_namespaces=True)nwbfile=io.read()nwb2widget(nwbfile)This extension was created usingndx-template.
Package: ndx-survey-data
ndx-survey-data Extension for NWBStructure for storing the survey data in a NWB file.Installation$pipinstallndx-survey-dataUsagefrompynwbimportNWBHDF5IO,NWBFilefromdatetimeimportdatetimefromndx_survey_data.survey_definitionsimportnrs_survey_tableimportnumpyasnpnrs_survey_table.add_row(pain_intensity_rating=1.1,pain_relief_rating=5.5,relative_pain_intensity_rating=np.nan,pain_unpleasantness=np.nan,unix_timestamp=1588217283)nrs_survey_table.add_row(pain_intensity_rating=np.nan,pain_relief_rating=1,relative_pain_intensity_rating=6,pain_unpleasantness=2.7,unix_timestamp=1588217283)nrs_survey_table.add_row(pain_intensity_rating=5.3,pain_relief_rating=np.nan,relative_pain_intensity_rating=0.8,pain_unpleasantness=2.1,unix_timestamp=1588217283)nrs_survey_table.add_row(pain_intensity_rating=3.7,pain_relief_rating=np.nan,relative_pain_intensity_rating=6,pain_unpleasantness=np.nan,unix_timestamp=1588217283)nwbfile=NWBFile('description','id',datetime.now().astimezone())nwbfile.create_processing_module(name='behavior',description='survey/behavioral data')nwbfile.processing['behavior'].add(nrs_survey_table)withNWBHDF5IO('test_nwb.nwb','w')asio:io.write(nwbfile)withNWBHDF5IO('test_nwb.nwb','r',load_namespaces=True)asio:nwbfile=io.read()print(nwbfile.processing['behavior'].data_interfaces['nrs_survey_table'].to_dataframe().to_html())pain_intensity_ratingpain_relief_ratingrelative_pain_intensity_ratingpain_unpleasantnessunix_timestampid01.15.5NaNNaN15882172831NaN1.06.02.7158821728325.3NaN0.82.1158821728333.7NaN6.0NaN1588217283To add a custom survey:fromndx_survey_dataimportQuestionResponse,SurveyTableq1=QuestionResponse(name='question1',description='desc',options=['option 1','option 2','option 3'])q2=QuestionResponse(name='question2',description='desc',options=['option 1','option 2','option 3'])q3=QuestionResponse(name='question3',description='desc',options=['option 1','option 2','option 3'])custom_survey_table=SurveyTable(name='custom_survey_table',description='desc',columns=[q1,q2,q3])custom_survey_table.add_row(question1=1.3,question2=3.9,question3=0.2,unix_timestamp=1588217283)custom_survey_table.add_row(question1=3.3,question2=1.4,question3=0.6,unix_timestamp=1588217283)custom_survey_table.add_row(question1=2.5,question2=2.1,question3=2.8,unix_timestamp=1588217283)
Package: ndx-tank-metadata
ndx-tank-metadataNWB LabMetaData extension forTank lab.Install$ pip install ndx-tank-metadataUsageThis extension is built for extending the LabMetaData schema with custom fields requested for the
conversion of Virmen metadata. The extension is built into the Tank lab conversion
pipeline (tank-lab-to-nwb) and is not necessary
to be installed separately. Alternatively, it can be used from a python script as demonstrated below.importosfrompynwbimportNWBFile,NWBHDF5IOfromdatetimeimportdatetimefromndx_tank_metadataimportLabMetaDataExtension,RigExtension,MazeExtensionnwbfile=NWBFile('description','id',datetime.now().astimezone())# Add rig informationrig={'name':'rig','rig':'VRTrain6','simulationMode':0,'hasDAQ':1,'hasSyncComm':0,'minIterationDT':0.01,'arduinoPort':'COM5','sensorDotsPerRev':[1967.6,1967.6,1967.6,1967.6],'ballCircumference':63.8,'toroidXFormP1':0.5193,'toroidXFormP2':0.5171,'colorAdjustment':[0.,0.4,0.5],'soundAdjustment':0.2,'nidaqDevice':1,'nidaqPort':1,'nidaqLines':[0,11],'syncClockChannel':5,'syncDataChannel':6,'rewardChannel':0,'rewardSize':0.004,'rewardDuration':0.05,'laserChannel':1,'rightPuffChannel':2,'leftPuffChannel':3,'webcam_name':'Live! Cam Sync HD VF0770'}rig_extension=RigExtension(**rig)# Create mazes tablemaze_extension=MazeExtension(name='mazes',description='description of the mazes')maze_dict={'world':1,'lStart':'5','lCue':'45','lMemory':'10','cueDuration':'NaN','cueVisibleAt':'Inf','cueProbability':'Inf','cueDensityPerM':'3','nCueSlots':'3','tri_turnHint':1,'color':[],'turnHint_Mem':0,'numTrials':10,'numTrialsPerMin':2,'criteriaNTrials':1,'warmupNTrials':[],'numSessions':0,'performance':0,'maxBias':1,'warmupMaze':[],'warmupPerform':[],'warmupBias':[],'warmupMotor':[],'easyBlock':0,'easyBlockNTrials':10,'numBlockTrials':20,'blockPerform':0.7}# Add each maze to extensionmaze_extension.add_row(**maze_dict)# Create LabMetaData containerlab_metadata_dict=dict(name='LabMetaData',experiment_name='test',world_file_name='test',protocol_name='test',stimulus_bank_path='test',commit_id='test',location='test',num_trials=245,session_end_time=datetime.utcnow().isoformat(),rig=rig_extension,mazes=maze_extension)# Populate metadata extensionlab_metadata=LabMetaDataExtension(**lab_metadata_dict)# Add to filenwbfile.add_lab_meta_data(lab_metadata)filename='test_labmetadata.nwb'withNWBHDF5IO(filename,'w')asio:io.write(nwbfile)
Package: ndxtest
lets you test trading strategies on the S&P 500.pip install ndxtestExplore the documentationReport BugÂ·Request FeatureTable of ContentsAbout The ProjectBuilt WithGetting StartedPrerequisitesInstallationUsageRoadmapContributingLicenseContactAcknowledgmentsAbout The Projectndxtestis a package for Python developed bylksdnx. It lets you test trading ideas
and perform backtests on the S&P 500. The daily price data for S&P 500 companies is available in the
repository.Developing, documenting, testing and releasingndxtestwas and is primarily an educational project.
Use it at your own risk and read thedisclaimeron the documentation page.(back to top)Built With(back to top)Getting StartedFor detailed information on how to install and usendxtestplease refer to theUser Manualon the documentation page.PrerequisitesInstallPython 3.9or higher.Install an IDE of your choice to work with.Installgitto easily download the requireddatadirectory from the repository.Allow both Python and git to be added to thePathduring their respective installations.InstallationIn the terminal do:pipinstallndxtestThis will installndxtestas well as its python package dependencies:numpy,pandas,matplotlib,yfinanceandfpdfThen in the terminal do:gitclone--depth1--filter=blob:none--sparsehttps://github.com/lksdnx/ndxtestcdndxtest
gitsparse-checkoutsetdataYou can delete the .git folder afterwards. Keep thedatafolder.(back to top)UsageFor instructions on how to work with this package, please refer to
theDocumentation.RoadmapSeehereabout new features of upcoming releases ofndxtestSee theopen issuesfor a list of proposed features (and known issues).(back to top)ContributingAny contributions aregreatly appreciated.If you have an idea that would makendxtestbetter, please fork the repo and create a pull request.
You can also simply open anissue.
Don't forget to give the project a star! Thanks again!Fork the ProjectCreate your Feature Branch:git checkout -b feature/AmazingFeatureCommit your Changes:git commit -m 'Add some AmazingFeature'Push to the Branch:git push origin feature/AmazingFeatureOpen a Pull Request(back to top)LicenseDistributed under the MIT License. SeeLICENSE.txtfor more information.(back to top)Contactlksdnx -lukas.dnx@gmail.comProject Link:https://github.com/lksdnx/ndxtest(back to top)AcknowledgmentsI express my gratitude to all the people who contributed to build theFreeCodeCamp. You have created an amazing
online resource. Furthermore I would like to thank all the content creators on YouTube for producing excellent
educative material on coding. Keep up the great work!(back to top)
Package: ndx-whisk
ndx-whisk Extension for NWBndx-whisk is anNWBextension to store whisker tracking measurements. It is intended to convert.whiskersand.measurementsfiles generated bywhisk (Janelia Whisker Tracker), or saved tohdf5withWhiskiWrap, but can be used with other whisker tracking methods.Installationpip install ndx-whiskUsageSee test scripttest_whiskermeasurement.pyinsrc/pynwb/tests.frompynwbimportNWBHDF5IO,NWBFilefromndx_whiskimportWhiskerMeasurementTableimportnumpyasnp# Load your datawhisker_data=read_whisker_measurement_table('tracked_data.whiskers')# Create a WhiskerMeasurementTablewhisker_meas=WhiskerMeasurementTable(name='name',description='description')# Add data to the WhiskerMeasurementTableforiinrange(np.shape(whisker_data['frame_id'])[0]):whisker_meas.add_row({k:whisker_data[k][i]forkinwhisker_data.keys()})# Set up a NWB filenwbfile=set_up_nwbfile()path='tracked_data.nwb'# Add a ProcessingModule for behavioral databehavior_module=nwbfile.create_processing_module(name="behavior",description="Processed behavioral data")# Add the WhiskerMeasurementTablenwbfile.processing['behavior'].add(whisker_meas)# Save to NWB filewithNWBHDF5IO(path,mode='w')asio:io.write(nwbfile)This extension was created usingndx-template.
Package: ndx-zebrafish
ndx-zebrafish Extension for NWBProvides standard container formats for tracking zebrafish behavior.
For now tail and position tracking are specified, withInstallationpython-mpipinstallndx-zebrafishUsageExample storage of freely-swimming fish tracking data:tail_direction=pynwb.behavior.SpatialSeries("fish_direction",{},timestamps={},)tail_shape=pynwb.behavior.SpatialSeries("tail_shape",{},timestamps={},unit="radians",)position=pynwb.behavior.SpatialSeries("fish_position",{}timestamps={},unit="mm",)behavior_storage=ZebrafishBehavior(name=f"fish_{i_fish}_behavior",fish_id=i_fish,position=position,orientation=tail_direction,tail_shape=tail_shape,)This extension was created usingndx-template.
Package: ndy-cli
NutDoneYet-CLINutDoneYet-CLI is a task management tool that allows you to easily manage your to-do list from the command line. It is currently under development and does not have any functionality at the moment.FeaturesNutDoneYet-CLI will include the following features:Natural language support for date inputLabels for categorizing tasksProjects for organizing related tasksSub-tasks for breaking down larger tasks into smaller onesGetting StartedAt the moment, there is no functionality available in NutDoneYet-CLI. Stay tuned for updates as development progresses.ContributingContributions to NutDoneYet-CLI are welcome! If you'd like to contribute, please submit a pull request.LicenseNutDoneYet-CLI is licensed under theMIT License.
Package: ne2001
Python implementation of Cordes-Lazio’s NE2001 Galactic Free Electron Density Model.
BEWARE:  The code as implemented in FORTRAN differs in several ways from the
2003 posting (astro-ph/0301598:http://adsabs.harvard.edu/abs/2003astro.ph..1598C).
See the docs for details.Free software: BSD licenseDevelopmentTo run the all tests run:toxNote, to combine the coverage data from all the tox environments run:Windowsset PYTEST_ADDOPTS=--cov-append
toxOtherPYTEST_ADDOPTS=--cov-append toxChangelog0.0.1 (‘’)First release on PyPI.0.0.2 (‘Not released yet’)Add simple_lb scriptAdd units
Package: neads
Neads is a modular tool for modelling of dynamical systems with complex
internal structure by complex networks. The library is able to automatically
configure various parametrized analytical pipelines, it allows executing all
potential runs and comparing their results. Also, it stores intermediate
results and makes them available for acceleration of subsequent calculations
as well as potential pipelines extensions. This tool is suitable for analysing
many real-world systems including the human brain, financial systems or social
networks.InstallInstall Neads viapip:$ pip install neadsBugsPlease report any bugs you findhere.
Package: neadva
neadvaPython 3 implementation of Hungarian Tax Office (NAV) version 3 reporting api0.52 Alpha version update of the module. Can be used to supply data and return transaction numbers safely (working).
Suggest to check the invoices before submitting in the test interface of NAV API firstMore work required for full interface support of NAV API.Clone the repo to install:git clone https://github.com/ServerAstra/neadvaor install using pip:pip install neadvaOverall library architecture at the moment allows one-liners as well as full object-oriented approach.Every interface class allows overrides for configuration and necessary options, they also provide result items as a dictionary and as properties simultaneously allowing automated processing and ease of use via interpreter console.In the future we will also implement additional interface for familiar ORM like methods.Unfortunately the limitations of NAV API and its documentation prevent this from becoming a priority so this has been postponed for the time being.Usage:fromneadvaimportInvoice,Transaction,SubmitInvoices,MapTaxNumber,ConfigConfig.user={"login":"login","password":"password","taxNumber":"12345678","signKey":"12-345678-910111213141516","exchangeKey":"12345678910"}Config.software={"softwareId":"HU12345678RANDOM","softwareName":"None","softwareOperation":"LOCAL_SOFTWARE","softwareMainVersion":"0","softwareDevName":"NAV Kft.","softwareDevContact":"nun@nil.com"}taxrequestdata=MapTaxNumber('12345678')()print(taxrequestdata)print(taxrequestdata.items())importglobinvoices=SubmitInvoices()forinvoiceinglob.glob('Invoices/*.xml'):print(invoice)withopen(invoice,'r')asf:invoices.append(Invoice(f.read()))sentinvoices=invoices()print(sentinvoices.transaction)print(sentinvoices.items())or since v0.5forinvoiceinglob.glob('Invoices/*.xml'):invoices.append(Invoice.fromfile(invoice))sentinvoices=invoices()print(sentinvoices.transaction)print(sentinvoices.items())Optionally you can choose to not compress data:Config.compression=FalseOr go live with:Config.live=TrueConfig class is global for all instances in the current interpreter run.
However you can supply an instance explicitly viaconfig = Config(**configvalues)where configvalues has user dict and software dict and includes other non-default modifications for each separate class.WarningTested only with test interface of NAV not production interface. Might still have some bugs due to differences in test and prod environment which happens sometimesModules required:pip install pycryptodome lxml pybase62 requestsTodo:Support for transaction searchSupport for invoice searchSingle interface where you just useneadva.taxinfo('12345678')neadva.upload(*files)neadva.download(from="2021-04", till="2021-10")neadva.status(*listofinvoices)Support for annulments
Package: neapolitan
I have a Django model:fromdjango.dbimportmodelsclassBookmark(models.Model):url=models.URLField(unique=True)title=models.CharField(max_length=255)note=models.TextField(blank=True)favourite=models.BooleanField(default=False)I want easy CRUD views for it, without it taking all day:# urls.pyfromneapolitan.viewsimportCRUDViewclassBookmarkView(CRUDView):model=Bookmarkfields=["url","title","note"]filterset_fields=["favourite",]urlpatterns=[...]+BookmarkView.get_urls()Neapolitan’sCRUDViewprovides the standard list, detail,
create, edit, and delete views for a model, as well as the hooks you need to
be able to customise any part of that.Neapolitan provides base templates and re-usable template tags to make getting
your model on the page as easy as possible.Where you take your app after that is up to you. But Neapolitan will get you
started.Let’s go! 🚀Next stopthe docs🚂Versioning and StatusNeapolitan uses a two-part CalVer versioning scheme, such as23.7. The first
number is the year. The second is the release number within that year.This is alpha software. I’m still working out the details of the API, and I’ve
only begun the docs.But: You could just readneapolitan.views.CRUDViewand see what it does.
Up to you. 😜InstallationInstall with pip:pipinstallneapolitanAddneapolitanto yourINSTALLED_APPS:INSTALLED_APPS=[..."neapolitan",]Templates expect abase.htmltemplate to exist and for that to defined acontentblock. (Refs <https://github.com/carltongibson/neapolitan/issues/6>.)
Package: nearest-colour
Nearest ColoursFind the nearest W3C/X11 named colors to a given color.
This module,nearest_colour, provides two functions:fromtypingimportList,Literal,UnionfromcolourimportColorColorSpace=Literal["hsv","rgb","yiq","hls"]defnearest_x11(color:Union[Color,str],n:int=1,space:ColorSpace="hls")->List[Color]:passdefnearest_w3c(color:Union[Color,str],n:int=1,space:ColorSpace="hls")->List[Color]:passEach will return thencolors that are closest (Euclidean distance) tocolorin the specified color-spacefrom either the set of W3C web colors or the set of Unix X11 colors.
Web colors arestandardized by W3C, whereas Unix X11 colors aredefined in the X11 source-code.Note:these two sets of colors are almost entirely overlapping, but not completely.
Colors may be provided as eithercolourColorobjects, or as W3C colors strings.
The default color-space for distance computation is HSL, which is perceptually uniform and therefore returns colors which are perceptually closer to the given color.
A list is always returned, even ifn == 1, and the ordering is from most similar to least similar.
If you pass a large wnough integer (say, 256), you'll get the ranking for all colors in the respective set.
Package: near-lake-framework
NEAR Lake Framework for PythonAvailable in programming languages:Rust|Javascript|Python3NEAR Lake Framework is a small library companion toNEAR Lake. It allows you to build
your own indexer that subscribes to the stream of blocks from the NEAR Lake data source and create your own logic to process
the NEAR Protocol data.Official NEAR Lake Framework launch announcementhas been published on the NEAR Gov Forum
Greetings from the Data Platform Team! We are happy and proud to announce an MVP release of a brand new word in indexer building approach - NEAR Lake Framework.Exampleimportasyncioimportosfromnear_lake_frameworkimportLakeConfig,streamerasyncdefmain():config=LakeConfig.mainnet()config.start_block_height=69130938config.aws_access_key_id=os.getenv("AWS_ACCESS_KEY_ID")config.aws_secret_key=os.getenv("AWS_SECRET_ACCESS_KEY")stream_handle,streamer_messages_queue=streamer(config)whileTrue:streamer_message=awaitstreamer_messages_queue.get()print(f"Received Block #{streamer_message.block.header.height}from Lake Framework")loop=asyncio.get_event_loop()loop.run_until_complete(main())How to useDependenciesInstallnear-lake-framework$pip3installnear-lake-frameworkCredentialsTo be able to access the data from NEAR Lake you need to provide credentials. Please, see theCredentials articleConfigurationEverything should be configured before the start of your indexer application viaLakeConfigstruct.Available parameters:s3_bucket_name: str- provide the AWS S3 bucket name (near-lake-testnet,near-lake-mainnetor yours if you run your own NEAR Lake)s3_region_name: str- provide the region for AWS S3 bucketstart_block_height: BlockHeight- block height to start the stream fromblocks_preload_pool_size: int- provide the number of blocks to preload (default: 200)Cost estimatesTL;DRapproximately $18.15 per month (for AWS S3 access, paid directly to AWS) for the reading of fresh blocksExplanation:Assuming NEAR Protocol produces accurately 1 block per second (which is really not, the average block production time is 1.3s). A full day consists of 86400 seconds, that's the max number of blocks that can be produced.According theAmazon S3 priceslistrequests are charged for $0.005 per 1000 requests andgetis charged for $0.0004 per 1000 requests.Calculations (assuming we are following the tip of the network all the time):86400 blocks per day * 5 requests for each block / 1000 requests * $0.0004 per 1k requests = $0.173 * 30 days = $5.19Note:5 requests for each block means we have 4 shards (1 file for common block data and 4 separate files for each shard)And a number oflistrequests we need to perform for 30 days:86400 blocks per day / 1000 requests * $0.005 per 1k list requests = $0.432 * 30 days = $12.96

$5.19 + $12.96 = $18.15The price depends on the number of shardsPublishing to PyPiFollow this guide to safely publish PyPi package
Package: nearmiss
nearmissNEARby MISmatch Searchnearmiss is a fast inexact text matching tool for finding repeats of an area
around a specific anchor string throughout text,
optionally finding matches with substitutions.It is primarily intended for finding near-match sections of DNA in the vicinity
of specific anchor sequences. The current substitution alphabet is limited toACGT.The speed of nearmiss comes from a C extension that uses the SA-IS suffix array
library from Yuta Mori and pointer magic instead.
The search time for anchors isO(|anchor| log |text|).
The search time for repeats isO(a(sw)^d log t), whereais the number of anchors foundsis the size of the substitution alphabetwis the size of the matching windowdis the maximum desired number of substitutions to allow in the windowandtis the size of the search textUse>>> from nearmiss import Searcher
>>> seq = "TACTANGGnnnTAAAAGnGG"
>>> searcher = Searcher(seq)
>>> searcher.find_anchors("GG")
[6, 18]
>>> searcher.find_anchors("nGG")
[17]
>>> searcher.find_repeat_counts("GG", (-4, -2), max_distance=1)
{18: [1, 0], 6: [1, 0]}
>>> searcher.find_repeat_counts("GG", (-4, -2), max_distance=2)
{18: [1, 0, 1], 6: [1, 0, 1]}For more detailed information, see the source documentation withpydoc nearmiss.Searcherorhelp(nearmiss.Searcher).To limit the number of threads used outside the source, set the environment
variableOMP_NUM_THREADSto the number of desired threads.InstallingNon-python dependenciesnearmiss uses OpenMP to drastically speed up mismatch searching on many anchors.
To install that on Debian/Ubuntu systems, runsudo apt-get install libomp5.with pippip install nearmissfrom sourcepip install .in the source directory