Saravanan666/pypi-org huggingface dataset:
Package: nbpp
➤ nbsafetyAboutnbsafetyadds a layer of protection to computational notebooks by solving thestale dependency problemwhen executing cells out-of-order. Here's an
example in action:When the first cell is rerun, the second cell now contains a reference to an
updatedfand is suggested for re-execution with a turquoise highlight. The
third cell contains a reference to a staley--yis stale due to its
dependency on an old value off. As such, the third cell is marked as unsafe
for re-execution with a red highlight.  Once the second cell is rerun, it is
now suggested to re-execute the third cell in order to refresh its stale
output.nbsafetyaccomplishes its magic using a combination of a runtime tracer (to
build the implicit dependency graph) and a static checker (to provide warnings
before running a cell), both of which are deeply aware of Python's data model.
In particular,nbsafetyrequiresminimal to no changesin user
behavior, opting to get out of the way unless absolutely necessary and letting
you use notebooks the way you prefer.InstallpipinstallnbsafetyInterfaceThe kernel ships with an extension that highlights cells with live references
to stale symbols using red UI elements. It furthermore uses turquoise highlights
for cells with live references to updated symbols, as well as for cells that
resolve staleness.RunningTo run annbsafetykernel in Jupyter, select "Python 3 (nbsafety)" from the
list of notebook types in Jupyter's "New" dropdown dialogue. For JupyterLab,
similarly select "Python 3 (nbsafety)" from the list of available kernels in
the Launcher tab.Jupyter Notebook Entrypoint:Jupyter Lab Entrypoint:UninstallpipuninstallnbsafetyLicenseCode in this project licensed under theBSD-3-Clause License.➤ ContributorsStephen MackeRay GongShreya Shankar
Package: nb-prep
nb_prepnb_prepautomates preparing jupyter notebooks for sharing and storage.You can use thenb_prepCLI to:Convert jupyter notebooks to HTML (usingnbconvert) and:add a date prefix to the filename.add a git hash suffix to the filename.move the HTML file to a configured output directoryStrip jupyter notebooks of all cell outputs (usingnbstripout)You can also configurenb_preponce as a pre- and post-commit hook and have notebook output automatically prepared every time yougit commit.nb_prepis a useful automation tool when you have a lot of analysis notebooks in git that you want to share with stakeholders.
If your main interest is preparing clean notebooks for storing in git commits, consider usingjupytextinstead.Installationpipinstallnb_prepDocumentationSeeallianz-direct.github.io/nb_prep.
Package: nbpreprocessor
PREPROCESSING METHODS DOCUMENTATIONDeveloping a library to help with preprocessing textInstallpip install nbpreprocessorHow to use#Example for the function tokenize_sentencetokenize_sentence("This sentence will be tokenized into words")['This', 'sentence', 'will', 'be', 'tokenized', 'into', 'words']#Example for the function capitalize_every_wordcapitalize_every_word("Every word should begin with an uppercase")'Every Word Should Begin With An Uppercase'
Package: nbprocess
nbprocessThis will become v2 of nbdev in the near-ish future.InstallWith pip:pip install nbprocessWith conda:conda install -c fastai nbprocessHow to useBy default docs are exported for use withQuarto.
To install Quarto on Ubuntu, runnbprocess_install. See the Quarto
docs for other platforms.You can runnbprocess_helpfrom the terminal to see a list of all CLI
tools:!nbprocess_helpnbprocess_bump_version          Increment version in `settings.py` by one
nbprocess_clean                 Clean all notebooks in `fname` to avoid merge conflicts
nbprocess_conda                 Create and upload a conda package.
nbprocess_create_config         Creates a new config file for `lib_name` and `user` and saves it.
nbprocess_deploy                Deploy docs to GitHub Pages.
nbprocess_docs                  Generate the docs.
nbprocess_export                Export notebooks in `path` to python modules
nbprocess_filter                A notebook filter for quarto
nbprocess_fix                   Create working notebook from conflicted notebook `nbname`
nbprocess_ghp_deploy            Deploy docs in doc_path from settings.ini to GitHub Pages
nbprocess_help                  Show help for all console scripts
nbprocess_install               Install quarto and the current library.
nbprocess_install_hooks         Install git hooks to clean/trust notebooks automatically
nbprocess_install_quarto        Installs latest quarto on mac or linux.  Prints instructions for Windows.
nbprocess_migrate_directives     Convert all directives in `fname` from v1 to v2.
nbprocess_new                   Create a new project from the current git repo
nbprocess_prepare               Export notebooks to python modules, test code and clean notebooks.
nbprocess_preview               Start a local docs webserver.
nbprocess_pypi                  Create and upload python package to pypi.
nbprocess_quarto                Create quarto docs and README.md
nbprocess_release               Release both conda and pypi packages.
nbprocess_sidebar               Create sidebar.yml
nbprocess_test                  Test in parallel the notebooks matching `fname`, passing along `flags`
nbprocess_trust                 Trust notebooks matching `fname`
nbprocess_update                Propagates any change in the modules matching `fname` to the notebooks that created them
Package: nbprogress
nbprogressProgressbar for Jupyter notebooks packaged as a pip package. (ref:https://github.com/kuk/log-progress)Important to enable enable ipythonwidgets by runningjupyternbextensionenable--pywidgetsnbextensionfor jupyterlabjupyterlabextensioninstall@jupyter-widgets/jupyterlab-managerUse:pipinstallnbprogressimporttimeimportnbprogressforiinnbprogress.log(range(1,10),every=1):time.sleep(1)importosimportglobimporttimeimportnbprogressinput_dir=os.getcwd()files=glob.glob(os.path.join(input_dir,'*'))forfileinnbprogress.log(enumerate(files),every=1,size=len(files)):time.sleep(1)
Package: nbproject
nbprojectLight-weight Jupyter notebook manager. Track metadata, imports, and integrity.💡 We recommendlamindb.track()instead ofnbprojectto:consistently track data sources across notebooks, pipelines & appsfull provenance for datasets that you pull and push from notebooksmanage notebook copying & integrate with Google Colabbroader compatibilityLikenbproject,lamindbis open-source.nbprojectwill continue to be maintained as a utility forlamindb.Install:pip install nbprojectGet started:import nbproject

nbproject.header()  # Tracks notebook, displays metadata

# do things

nbproject.publish()  # Checks consecutiveness & title, sets version & imported python packagesMore: Read thedocs.
Package: nbprune
nbprunetypical use case is, a teacher writes a notebook, with solution(s) to a problem that students must solveso this means 2 versions, one for the teacher(s) with the solutions, and one for the studentsthis tool defines annotations that the teacher can use to define the parts that will be automatically removed by the toolkeywordshere are the recognized keywordstagmeaningprune-line(*)remove just that one line from the outputprune-cellremove this cell from the outputprune-beginremove this cell and the ones below from the outputprune-endremove this cell, but resume insertion on the next cellprune-begin-next(**)keep this cell from the output, and start pruning at the next oneprune-end-previous(**)stop pruning, and insert the current cellNOTES(*)prune-lineof course is not relevant, and ignored, if set in the cell's metadata tags(**) becauseprune-begin-nextandprune-end-previousappear in a cell that is visible, the whole line containing the tag is removed from the output, so it is probably best to keep these tags on a separateline formatthe tool will consider a tag is present in a cell if any line in the cell
contains one of the above keywords, with the beginning of the line containing
only#and spaces or tabsso for exemplelinematchprune-cellyes# prune-cellyes# # prune-cellyessome code prune-cellnocell metadatathe tags can also be set in the cell's metadata as well (except forprune-line) ; something like this{"tags":["prune-cell"]}examplesso that these 2 scenarios are equivalentcelltagpreserved1y2prune-celln3y4y5prune-begin-nexty6n7n8n9prune-end-previousy10yorcelltagpreserved1y2prune-celln3y4y5y6prune-beginn7n8prune-endn9y10y
Package: nb-python
NBNenural network Blocks (aka:NB, or neural network builder). This library provides massive fancy blocks for you for quick import to build your powerful. Some SOTA tricks and connections such as CSP, ASFF, Attention, BaseConv, Hardswish, all included for quick prototype your model.nbis an idea comes from engineering, we build model with some common blocks, we exploring new ideas with SOTA tricks, but all those thing can be gathered into one single place, and for model quick design and prototyping.this project is under construct for now, I will update it quickly once I found some new blocks that really works in model. Also, every single updated block will be recorded in updates.UsageHere is an example of using NB to build YoloV5!A simple example to build a layer of conv:fromnb.torch.base.conv_blockimportConvBasea=ConvBase(128,256,3,1,2,norm_cfg=dict(type="BN"),act_cfg=dict(type="Hardswish"))Be note that, the reason for us usingcfgto specific norm and activation is for users dynamically switch their configuration of model in yaml format rather than hard code it.Updates2020.09.12: New backbone SpineNet added:SpineNet is a backbone model specific for detection, it's a backbone but can do FPN's thing!! More info pls reference google's paperlink.fromnb.torch.bakbones.spinenetimportSpineNetmodel=SpineNet()2020.09.11: New added blocks:resnet.Bottleneck
resnet.BasicBlock

ConvBaseSupport MatrixWe list allconvandblocksupport innbhere:conv:ConvConvWS:https://arxiv.org/pdf/1903.10520.pdf...Blocks:CSPBlock:Copyright@Lucas Jin all rights reserved.
Package: nb-query
nb_queryPython package to search in Jupyter notebooks.Installation:$ pip install nb-queryUsage>>  from nb_query import nb_query
    >>  nb_query('Hello')
    >>  nb_query('Hello', ['data/notebooks',])
    >>  nb_query('He(ll|r)o')
    >>  nb_query(lambda line: len(line) == 2)Created with the help of the "Hypermodern python" article series.Join theCode Quality for Data Science (CQ4ds) Discord channelfor feedback.
Package: nbr
nbrNBR lets yourunlocal and remote jupyter-notebooks.InstallationIn a terminal, run:pip install nbrUsageLaunch a Jupyter server:jupyter serverExecution a local notebook, using a remote server:importasynciofromnbrimportNotebookRunner,Notebook,JupyterAPI,ExecutionStatusasyncdefmain()->None:jupyter_api=JupyterAPI()notebook=Notebook.read_file(path="Untitled.ipynb")asyncwithNotebookRunner(notebook=notebook,jupyter_api=jupyter_api)asrunner:result=awaitrunner.execute_all_cells()ifresult.status==ExecutionStatus.SUCCESS:notebook.save(path="Executed.ipynb")if__name__=="__main__":asyncio.run(main())
Package: nbreport
nbreport is a client for creating and publishing LSST’s notebook-based reports.
Notebook-based reports are generated from template repositories, computed, and published with LSST the Docs.Documentation:https://nbreport.lsst.ioInstallationnbreport is available on pypi.org:pip install nbreportnbreport is made for Python 3.6and newer.OverviewYou can use nbreport to:Create aninstanceof a report from a report repository.Fill that instance in with template variables that configure the report instance.Compute the report instance.Publish the report instance.Try this test command to get a sense for how nbreport work:nbreport test https://github.com/lsst-sqre/nbreport --git-subdir tests/TESTR-000 -c title "My first report"This test command uses theTESTR-000 example report repositoryin this project’s own Git repository.
Next, it creates a new instance calledTESTR-000-testin your current working directory and configures the notebook so that thetitlevariable is"My first report".
Finally, the test command runs the notebook to generate outputs.Learn more about nbreport and how to create reports with LSST’s notebook-based report system athttps://nbreport.lsst.io.
Package: nbreproduce
nbreproduceReproduce Jupyter Notebooks and projects inside Docker Containers (based onJupyter Docker-Stacksimages) using thenbreproduceCLI.Free software: BSD licenseDocumentation:https://econ-ark.github.io/nbreproduce/Installation:$ pip install nbreproduceFeatures:Reproduce a Jupyter Notebook (URL or local file) inside a Docker container for consistent builds across all the devices capable of running docker and Python.To test thehello_world.ipynbexample in this repo.$ nbreproduce --url https://github.com/econ-ark/nbreproduce/blob/master/tests/hello_world.ipynbThenbreproducewill create a new Jupyter notebook ending withfilename-reproduce.ipynbin the same directory which is a copy of the original notebook but executed inside the docker container environment.nbreproducerequires a special metadata tag (docker_image) inside in the Jupyter notebook to find the link to docker image on DockerHub. On the first run ofnbreproducewith a normal Jupyter notebook it will prompt you to add a docker image tag, these docker images are built on top ofJupyter Docker-Stacks. Thehello_world.ipynbexample can run with thescipy-notebookstandard image. Using the--dockerflag you can point it towards the right docker image. (Currently only DockerHub imgags are supported)$ nbreproduce --docker jupyter/scipy-notebook:latest hello_world.ipynbFor a Jupyter notebook which already has the metadata tag (docker_image), we can directly execute the notebook, kind of like papermill but inside a standardised docker environemnt :)$ nbreproduce hello_world.ipynbReproduce entire folders and projects inside a Docker environment (it works by mounting the current directory to the docker container and running a bash file which has all the required steps to reproduce all the content like figures, builiding latex documents, slides, etc).$ nbreproduce --docker econark/econ-ark-notebook do_all.sh

Executing do_all.sh using the econark/econ-ark-notebook environment inside a docker container.
Executing do_all.sh in the current directory /Users/ms/dev/REMARK/REMARKs/CGMPortfolio
....
....
....The project is in pre alpha developement mode, so things will break. Don't use this in production. The documentation website doesn't exist yet, usenbreproduce -hto get a quick desciption of various flags. Feel free to open up any issue for suggestions or submit a PR to fix bugs/implement new features.CreditsThis package was created with Cookiecutter_ and theaudreyr/cookiecutter-pypackage_ project template.Cookiecutteraudreyr/cookiecutter-pypackageHistory0.4.1 (2020-10-18)auto fix EOL for bash scripts in windows.0.4.0 (2020-09-22).dockerimage file let's you add the name of the docker image, it should exist either in the root directory or the reproduce/ directory.0.3.0 (2020-09-16)Add --inplace suppport for individual notebooks.0.2.0 (2020-08-12)Add --live interactive mode.Add ability to execute bash scripts.Docker SDK.0.1.0 (2020-06-10)Pre-alpha release to get the ball rolling.First release on PyPI.
Package: nbresnote
# Auto-research-note generator from Jupyter notebookAuthor :jh.jungFrom jupyter notebook, making the research note to md file with simple syntax.TOC(Table of contents)codefiguretableDaily note## InstallationUsing pip :`shell pip install nbresnote `## UsageFor autorun whengit commit, run below on your git repository :`shell nbresnote install `For now, theinstallcommand will make the clone of your wiki repository of current git intowiki/folder.
Unfortunately, this is fixed.For run specific.ipynbfiles`shell nbresnote note1.ipynb note2.ipynb ... `## Documentation### SyntaxBasically,nbresnoteignore all code cells. The module will read only markdown cell for making research notes.Internelly,nbresnotetrace the diff of git commit files, and get folder and filename of.ipynbin commit,
and auto documenting the markdown and daily note for the git repository.You can check the example folder.Here we prepare for specific syntax!(command)TOC(Table of contents) :Table of Contents is simple anchor of whole notebook headers
>example)
>`!TOC` in jupyter notebook
![toc](png/TOC.png)codefiguretableDaily noteSee wiki tabs.## future work :configuration changedirective of rstreference of outputs
Package: nbresult
nbresultA simple package to test Jupyter notebook result for the Le Wagon's Data Science Bootcamp.1. InstallationInstallation withpipfromPypi:pipinstallnbresult2. Usage2.1 Basic usageConsidering the default data challenge architecture:.
├──challenge.ipynb
├──Makefile
├──README.md
├──data
│└──data.csv
└──tests└──__init__.pyIf you want to test a variablelog_model_scorefrom thechallenge.ipynbnotebook withpytest:Anywhere in the notebook you can add a cell with the following code:fromnbresultimportChallengeResultresult=ChallengeResult('score',score=log_model_score)result.write()This outputs ascore.picklefile in thetestsdirectory:.
├──challenge.ipynb
├──Makefile
├──README.md
├──data
│└──data.csv
└──tests├──__init__.py└──score.pickleNow you would like to write test on thelog_model_scorewithpytest. Create atest_score.pyfile:# tests/test_score.pyfromnbresultimportChallengeResultTestCaseclassTestScore(ChallengeResultTestCase):deftest_score_is_above_82(self):self.assertEqual(self.result.score>0.82,True)Finally you can run your tests withpytest:pytesttests/test_score.pyORRun the tests withmake:Setup aMakefile# Makefiledefault:pytestpytest:PYTHONDONTWRITEBYTECODE=1pytest-v--color=yesRunmakeORRun the tests inside the notebook:fromnbresultimportChallengeResultresult=ChallengeResult('score',score=log_model_score)result.write()print(result.check())2.2 Advanced usageFor more advanced folder structure, you also can specify asubdirfolder in which store & read pickle filefromnbresultimportChallengeResultresult=ChallengeResult('score',subdir='a',# This will store pickle in tests/a/score.picklescore=log_model_score)result.write()result.check()Check out detailed example belowTestingRunmake
Package: nbresuse
Installation|Configuration|Resources Displayed|ContributingNBResuseNB Resource Usage (NBResuse) is a small extension for Jupyter Notebooks that
displays an indication of how much resources your current notebook server and
its children (kernels, terminals, etc) are using. This is displayed in the
main toolbar in the notebook itself, refreshing every 5s.InstallationYou can currently install this package from PyPI.pipinstallnbresuseIf your notebook version is < 5.3, you need to enable the extension manually.jupyter serverextension enable --py nbresuse --sys-prefix
jupyter nbextension install --py nbresuse --sys-prefix
jupyter nbextension enable --py nbresuse --sys-prefixConfigurationMemory Limitnbresusecan display a memory limit (but not enforce it). You can set this
in several ways:MEM_LIMITenvironment variable. This is set byJupyterHubif using a spawner that supports it.In the commandline when startingjupyter notebook, as--ResourceUseDisplay.mem_limit.In your Jupyter notebooktraitletsconfig fileThe limit needs to be set as an integer in Bytes.Memory usage warning thresholdThe background of the resource display can be changed to red when the user is near a memory limit.
The threshold for this warning can be configured as a fraction of the memory limit.If you want to flash the warning to the user when they are within 10% of the memory limit, you
can set the parameter--ResourceUseDisplay.mem_warning_threshold=0.1.CPU Usagenbresusecan also track CPU usage and report acpu_percentvalue as part of the/metricsresponse.You can set thecpu_limitin several ways:CPU_LIMITenvironment variable. This is set byJupyterHubif using a spawner that supports it.In the command line when startingjupyter notebook, as--ResourceUseDisplay.cpu_limit.In your Jupyter notebooktraitletsconfig fileThe limit corresponds to the number of cpus the user has access to, but does not enforce it.Additionally, you can set thetrack_cpu_percenttrait to enable CPU usage tracking (disabled by default):c=get_config()c.NotebookApp.ResourceUseDisplay.track_cpu_percent=TrueAs a command line argument:jupyternotebook--ResourceUseDisplay.track_cpu_percent=TrueResources DisplayedCurrently the server extension only reports memory usage (just RSS) and CPU usage. Other metrics will be
added in the future as needed.The notebook extension currently doesn't show CPU usage, only memory usage.ContributingIf you would like to contribute to the project, please read theCONTRIBUTING.md. TheCONTRIBUTING.mdfile
explains how to set up a development installation and how to run the test suite.
Package: nbrr
nbrr: Jupyter Notebook Reproducible RepositoriesContinuous Integration TestsPlatformStatusLinuxWindowsYou create the notebooks,nbrrwill do the rest!environment.ymlfile forconda:nbrrenv--notebooks_path.--channelconda-forge--nameMyEnv>environment.ymlTravis-CIandAppVeyorconfigurations:nbrrtravis--notebooks_path.>.travis.ymlnbrrappveyor--notebooks_path.>.appveyor.ymlREADME.mdwith a binder link for your GitHub repository:nbrrreadme"My Awesome Notebook Collection"--repository.>README.md
Package: nbrun
Runs Jupyter notebooks in parallel to verify that they are not raising any exceptions.What for?When managing a data science project you need to confidently be able to refactor your shared code and notebook dependencies. Validating that all of your notebooks are still runnable helps gain confidence that they are still intact after such changes.This script can be fired from a CI tool like Travis to ensure that future pull requests does not break your notebooks.How to use?The script searches recursively for.ipynbwithin the specified path. Use--timeoutto limit the maximum time a notebook are allowed to run.
For examplenbrun --timeout 60 ./notebookswill run all notebooks found in the folder, but will timeout if any of the notebooks did not terminate after one minute.Sometimes you don’t want to run nbrun on specific notebooks. Suffixing notebook file names with a_will cause nbrun to skip this notebook file.
For examplenotebook_.ipynbwill not be ignored.
Package: nbRunner
nbRunnerFast JupyterNotebook PYTHON RunnerRecomended Package changessudo pip install git+https://github.com/sam2332/nbparameterise.gitI have a custom nbparameterise that will allow for more features such at tagged notebooks for paramater cell selectionsExamples$ nbRunner 
usage: nbRunner Notebook
nbRunner: error: the following arguments are required: Notebook


$ nbRunner examples/nounVerb.ipynb 
Default does the Default


$ nbRunner examples/nounVerb.ipynb  --help
usage: nbRunner [-h] [--who [WHO]] [--verb [VERB]]

optional arguments:
  -h, --help     show this help message and exit
  --who [WHO]
  --verb [VERB]


$ nbRunner examples/nounVerb.ipynb --who=Billy --verb=knocked
Billy knockedBy Default the package uses exec due to notbook client refusingbut as you can see the timeing is horrible compared to exec$ time ./nbRunner ../randomWallpaper.ipynb --use_notebook_client
Using Notebook client

real  0m2.405s
user  0m2.247s
sys 0m1.864s


$ time ./nbRunner ../randomWallpaper.ipynb

real  0m0.552s
user  0m0.655s
sys 0m0.602s$ time nbRunner examples/nounVerb.ipynb 
Default does the Default

real  0m1.637s
user  0m1.253s
sys 0m0.146s


$ time jupyter nbconvert --to notebook --execute examples/nounVerb.ipynb 
[NbConvertApp] Converting notebook examples/nounVerb.ipynb to notebook
[NbConvertApp] Writing 2014 bytes to examples/nounVerb.nbconvert.ipynb

real  0m2.227s
user  0m1.507s
sys 0m0.178s


$ time nbRunner examples/nounVerb.ipynb 
Default does the Default

real  0m1.922s
user  0m1.205s
sys 0m0.171s



$ time jupyter nbconvert --to notebook --execute examples/nounVerb.ipynb 
[NbConvertApp] Converting notebook examples/nounVerb.ipynb to notebook
[NbConvertApp] Writing 2014 bytes to examples/nounVerb.nbconvert.ipynb

real  0m2.072s
user  0m1.461s
sys 0m0.177s