Saravanan666/pypi-org huggingface dataset:
Package: nblibrarian
Tools for maintaining a library of Jupyter notebooks that are sourced
from a “warehouse” of notebooks (another github repository).InstallingYou can install nblibrarian from pypipipinstallnblibrarianor from sourcegitclonehttps://github.com/lheagy/nblibrariancdnblibrarianpipinstall-e.Configuring nblibrarianThere are two files that you need in order to configurenblibrarian:.library-config.yml.jupyter-include.library-config.ymlThe.library-config.ymlfile specifies details of the source repository and if you would like to include theenvironment.ymlfile and / or therequirements.txtfile. (We recommend you download at least one of these). The structure of the.library-config.ymlis as follows:# information about the source librarysource:github:user:geoscixyz# github username or organizationrepo:geosci-labs# github repositorybranch:master# [optional] branch to fetch material fromdirectory:notebooks# [optional] directory where the notebooks are in the repository - including it will speed up the search for the desired notebooks# setup options for the librarysetup:environment:environment.yml# [optional] include the environment.yml from the sourcerequirements:requirements.txt# [optional] include the requirements.txt file.jupyter-includeThe.jupyter-includefile describes which notebooks you would like included in your library. It follows the same
syntax as a.gitignorefile.# this is a comment

# dc resistivity
notebooks/dcip/DCIP_2D_Overburden_Pseudosections.ipynb  # you can specify the full path
notebooks/dcip/DC_Building_Pseudosections  # also without the .ipynb extension
DC_Cylinder_2D.ipynb  # or just specify the notebook name

# em
/em/EM_Pipeline.ipynb
em/EM_ThreeLoopModel.ipynb
em/*Sphere*.ipynb  # includes all notebooks in a directory called em with "Sphere" in the title

# magnetics
mag/*.ipynb  # includes all notebooks in the mag directory

# inversion
inversion  # includes notebooks in the inversion directoryUsageOnce you have specified the.library-config.ymland the.jupyter-include, you can run nblibrarian from the command line to
download the files you specified.nblibrarianThere are also a few options, to run inverbosemode usenblibrarian-vIf you ever want to update your library, you can always alter the.jupyter-includeand re-runnblibrarian. By default, it will not overwrite your current notebooks. If you do want it to overwrite them, then runnblibrarian--overwrite=TrueIf you would like to specify the path to the jupyter include and config files (for example if you put them in a different directory), then usenblibrarian--config=.library-config.yml--jupyter-include=.jupyter-includeIssuesIf you run into any bugs, questions or problems usingnblibrarian, pleasecreate an issueon github.LicenseThis work is Licensed under theBSD 3-Clause License.
Package: nb-libs
各种日常工具安装pip install nb_libs1. restart_program每隔多久重启代码自身。importtimeimportdatetimefromnb_libs.restart_programe_by_intervalimportrestart_programdef_run():print(datetime.datetime.now(),'开始运行程序')foriinrange(1000):time.sleep(0.5)print(datetime.datetime.now(),i)if__name__=='__main__':restart_program(10)# 每隔10秒重启。_run()2. nb_time.DatetimeConverter好用的时间转换,类型兼容强,入参可以是时间戳 字符串 datatime类型 DatetimeConverter 类型.3 auto_git.GitBranchMergegit 自动化 分支合并.多人合作项目git开发流程一般是:自己分支写代码 -> 自己分支commit -> 自己分支push到远程 -> 切换到开发develop分支 -> 在develop分支 git pull ->
把自己分merge到develop分支 -> develop分支 push到远程开发环境代码拉取develop代码重启部署,测试出现问题后,需要反复执行git繁琐的流程,整个过程如果手动人工操作git太折磨人了,
auto_git.GitBranchMerge 一键执行以上操作,如果有某一步git命令出现错误或冲突,是会中断操作的,不用担心.
Package: nblogic
# NBLOGICThe integration of KLOGIC and ICIT service for using information in various way.
This program run on Python 3 and terminal use-only
JSON output is provided for back-end calling## PrerequisitesThis program needs Python 3 and following libraries[MechanicalSoup](https://mechanicalsoup.readthedocs.io/en/stable/) - A Python library for automating website interaction[art](https://pypi.org/project/art/) - Used to generate ASCII art### InstallingFirst, install this project by pip` pip install nblogic `### NoteAdd apiMode and JSON language (1.0.9)## AuthorsThanawat Petchuen- [Thanawat(GitHub)](https://github.com/thanawatpetchuen) - [Thanawat(Bitbucket)](https://bitbucket.org/thanawatpetchuen/)## LicenseThis project is licensed under the MIT License
Package: nbmask
IPython extension to mask sensitive dataSimple ipython extension to mask the username or other sensitive data
from notebook cell outputs.  It may be useful when printing
or displaying sensitive information in public notebooks.
The extension modifies the ipython display system to mask textual outputs
from printing, logging and the native display system.UsageTo load the extension use the magic command%load_ext nbmask. The extension will automatically
mask the notebook display textual outputs without any further magic commands. By default the
extension will mask the username.importosimportloggingfrompathlibimportPathfromIPython.displayimportdisplaylogging.basicConfig(level="DEBUG",force=True)%load_extnbmaskusername=os.getenv('USER')print("My name is{username}!")# >>> My name is ...!documents=Path(f"/Users/{username}/Documents")print(documents)# >>> PosixPath('/Users/.../Documents')You can add more secrets with the%nbmaskmagic line command
using the ipython automatic$namevariable expansion.TOKEN=my_secret_token()%nbmask"$TOKEN"credentials=dict(user=username,token=TOKEN)print(credentials)# >>> {'user': '...', 'token': '...'}logging.debug("Token is%s",TOKEN)# >>> DEBUG:root:Token is ...To maskprintorpprintoutputs the extension include a%%maskedcell magic
but is is no longer and it will be removed.ExampleSee nbmask-tests.ipynb inextrasInstallationYou can install the current version of this package with pippip install nbmaskChangelog0.0.4Cell magic%%maskedis no longer needed. Will be removed0.0.3Masking pattern is cached
Package: nbmediasplit
nbmediasplitnbmediasplitis a script to extract base64 encoded image and audio PCM embedded in .ipynb file and save them into specified directories.nbmediasplitalso converts ipynb file to a new one which refers to stored image and audio files.installpip install nbmediasplitusageextract image files from ipynbnbmediasplit input.ipynb -i image_out_dirornbmediasplit input.ipynb --imgdir image_out_dirThe above command extract image files frominput.ipynband store them toimage_out_dir.-ior--imgdirspecifies a directory to store image files.
Filenames of the stored image are numbered in sequential order(0.png, ...).extract audio files from ipynbnbmediasplit input.ipynb -w wav_out_dirornbmediasplit input.ipynb --wavdir wav_out_dirThe above command extract audio files frominput.ipynband store them towav_out_dir.-wor--wavdirspecifies a directory to store audio files.
Filenames of the stored audio are numbered in sequential order(0.wav, ...).extract image and audio files from ipynbnbmediasplit input.ipynb -i image_out_dir -w wav_out_dirornbmediasplit input.ipynb --imgdir image_out_dir --wavdir wav_out_dirThe above command does below things.extract image files frominput.ipynband store them toimage_out_dirextract audio files frominput.ipynband store them towav_out_dir.-ior--imgdirspecifies a directory to store image files.-wor--wavdirspecifies a directory to store audio files.
Filenames of the stored image are numbered in sequential order(0.png, ...).
Filenames of the stored audio are numbered in sequential order(0.wav, ...).extract image and audio files from ipynb and convert ipynbIf you use-oor--outputoption like below command,
you can convertinput.ipynbto new ipynb file which refers to stored image files and audio files directly.nbmediasplit input.ipynb -i image_out_dir -w wav_out_dir -o converted.ipynbornbmediasplit input.ipynb --imgdir image_out_dir --wavdir wav_out_dir --output converted.ipynbThe above command extract image files and audio files, and store them to specified directories, and generate new ipynb fileconverted.ipynb.converted.ipynbincludes same content asinput.ipynb, but base64 encoded image and audio data are replaced to HTML tag refers to stored files directly like below.image tag<img src="${image_out_dir}/${n}.png" />audio tag<audio controls preload="none"><source  src="${wav_out_dir}/${n}.wav" type="audio/wav" /></audio>Also, you can use--img-prefixand--wav-prefixoptions.
These options can change the path embeded in src attribute of output html like below(actual files are storedimage_out_dirandwav_out_dir).image tag<img src="${img-prefix}/${n}.png" />audio tag<audio controls preload="none"><source  src="${wav-prefix}/${n}.wav" type="audio/wav" /></audio>show helpnbmediasplit --helpnoteUnless you trust the notebook converted by nbmediasplit in jupyter, you can't load audio source because of html sanitization.
To trust notebook in jupyterlab, go to command pallet in the left sidebar(on osx, typeshift+cmd+c) and executetrust notebook,
then you'll load audio source if the source path is correct.
Package: nbmerge
nbmerge: merge / concatenate Jupyter notebooksInstallationpipinstallnbmergeUsageFor the usage as originally specified by@fperez’s gist,nbmergefile_1.ipynbfile_2.ipynbfile_3.ipynb>merged.ipynbAlternatively, nbmerge can cursively collect all files in the current
directory and below, recursively. After collection, it sorts them
lexicographically. You can use a regular expression as a file name
predicate. All.ipynb_checkpointsare automatically ignored. And, you
can use the-ioption to ignore any notebook prefixed with an underscore
(think pseudo-private in python).For example, the following command collects all notebooks in your project
that have the wordintroin the file name and saves it to a merged file
named_merged.ipynb,nbmerge--recursive-i-p".*intro.*"-o_merged.ipynbFinally, you can also instruct the script to demarcate the boundary
between each original file with the-b/-boundary[BOUNDARY]flag.
Thesrc_nbvalue in the metadata for the first cell in each original
notebook will then contain the path of the original notebook, relative to
the cwd at the point of script execution.Lineage@fperezwrote annbmerge.pyscript which “Merge[s]/concatenate[s] multiple IPython notebooks into
one.” I use it a lot. Evidently,other people do,
too.
In early 2016, he opened anissue to add the script as an nbconvert
tool, but nothing
came of it. However, he and@Carreaucame up
with good (i.e. unsurprising)semantics for metadata merging and
notebook
naming:metadata={}forninreversed(notebooks):metadata.update(n.metadata)I don’t think it’s possible to implement the merger as a preprocessor.
Preprocessors are stateless, so you can’t implement a reduce operation.
Instead, I wrote (er, packaged up) this library as annbstripoutput-like package .
It fits in aMakefilescript just fine.Right now, only the basic (originally fperez’s) functionality is
implemented. However, I’m going to followkynan’slead and slowly pull in functionality
similar to hisnbstripoutpackage.
Package: nb-mermaid
Makemermaiddiagrams in yourJupyterNotebook Markdowninstall (easy)pipinstallnb-mermaidIn the notebook…%reload_extmermaidinstall (less easy)gitclone-bgh-pageshttps://github.com/bollwyvl/nb-mermaid.git\~/.ipython/nbextensions/nb-mermaidactivateIn the notebook…%%javascriptIPython.load_ipython_extensions(["nb-mermaid/nb-mermaid"]);roadmapnbviewer support (bookmarklet works now!)live editing (a la themermaid
editor)pan/zoomsearch
Package: nbmetalog
nbmetalognbmetalog helps you log jupyter notebook metadataFree software: MIT licenseDocumentation:https://nbmetalog.readthedocs.io.fromnbmetalogimportnbmetalogasnbm# prints metadata about notebook runtimenbm.print_metadata()# returns a dict with notebook metadatanbm.collate_summary_metadata()CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2021-09-01)First release on PyPI.
Package: nb-move-imports
nb_move_importsMove import statements in jupyter notebook to the first cellUse nb_move_importsTo run the script on a specific jupyter notebook run:nb_move_imports path/to/notebook.ipynbSkip processing of cellsIn order to skip a cell you have to tag it with theIGNORE_MV_IMPORTStag.Precommit HookAdd this section to yourpre-commit-config.yamlso that the nb_move_imports script is executed before each commit with pre-commit.-repo:https://github.com/AnH0ang/nb_move_importsrev:0.4.5hooks:-id:nb_move_importsname:nb_move_imports
Package: nb-mypy
Nb MypyNb Mypyis a facility to automatically runmypyon Jupyter notebook cells as they are executed, whilst retaining information about the execution history.InstallationNb Mypyrelies on the packages mypy and astor, but those should be automatically installed.Nb Mypycan be installed like:python3-mpipinstallnb_mypyOnce installed, you can load it via%load_ext nb_mypyin a cell of  a Jupyter notebook using the IPython kernel.Installation from sourceThe package can also be installed from source, using pip:python3-mpipinstall.UsageIn Jupyter notebooks where you want to apply
automatic type checking,
you can load this extension to do type checking by executing
(in a code cell) the line magic%load_ext nb_mypy.With the line magic%nb_mypyyou can modify the behaviour ofNb MypyHere are the ways to use the line magic%nb_mypy%nb_mypy -v: show version%nb_mypy: show the current state%nb_mypy On: enable automatic type checking%nb_mypy Off: disable automatic type checking%nb_mypy DebugOn: enable debug mode%nb_mypy DebugOff: disable debug mode%nb_mypy mypy-options[OPTIONS]: Provide extra options to mypy (for example --strict)Load automaticallyThis package is an iPython extension, thus it can be loaded automatically by adding the following line to your iPython configuration file.c.InteractiveShellApp.extensions=['nb_mypy']The configuration file can (probably) be found at~/.ipython/profile_default/ipython_config.pyor created by executingipython profile create.
To add options, for instance, always have strict type checking on, you can add the following.c.InteractiveShellApp.exec_lines=['%nb_mypy mypy-options --strict']ExamplesFor examples, see the Jupyter notebookNb_Mypy.ipynb.
Package: nbne
# NBNECode to use Neighbor Based Node Embeddings (NBNE) method to create representations to nodes in a graph.### InstallationYou can install NBNE directly from PyPI:`pip install nbne`Or from source:```git clone https://github.com/tiagopms/nbne.gitcd nbnepip install .```#### DependenciesNBNE has the following requirements:* [NetworkX](https://networkx.github.io/)* [Gensim](https://radimrehurek.com/gensim/)### Usage#### Basic UsageThe libraries gensim and networkx should be installed. Then run:```bash$ nbne --input examples/data/watts_strogatz.graph --output examples/data/watts_strogatz.emb```#### Using in other ApplicationsImport nbne module in your application and train model with:```pythonfrom nbne import train_modeltrain_model(graph, num_permutations)```Where graph should be a networkx graph. To save the model in an output file:Import nbne module in your application and train model with:```pythonfrom nbne import train_modelimport networkx as nxgraph = nx.watts_strogatz_graph(1000, 50, 0.2)train_model(graph, num_permutations, output_name)```### InputInput should be a edgelist with format:```node1_id node2_idnode1_id node3_idnode2_id node3_id```### OutputThe output is a document with `n+1` lines. The first has format:```num_nodes embeddings_size```And the other:```node_id embedding```Where `embedding` is a space separated vector with dimension `d`, i.e. `d1 d2 d3 ... dn`.
Package: nbnext
➤ 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: nbnode
NBNodeA python package for non-binary trees and simulation of flow cytometry data.NBNode enables non-binary decision trees with multiple decisions at each node.
Additionally it enables a dirichlet distribution based simulation of flow cytometry data.Installationcondacreate-y-nconda_nbnodepython=3.8condaactivateconda_nbnodegitclonehttps://git.uni-regensburg.de/ccc_verse/nbnodecdnbnodepipinstall--upgradepippipinstall.TutorialsSee the documentation and the (within) presented jupyter notebookshttps://ggrlab.github.io/nbnode/Package setupThis project has been set up using PyScaffold 4.4. For details and usage
information on PyScaffold seehttps://pyscaffold.org/:.. code-block:: bashpip install pyscaffold
putup nbnode
cd nbnode
# Create nbnode within gitlab, without README
git branch -m master main
git remote add origingit@git.uni-regensburg.de:ccc_verse/nbnode.git
git push -u origin –all
conda create -y -n conda_nbnode python=3.8
conda activate conda_nbnode
# Select conda_nbnode as default python interpreter in VsCode
#   select a single python file, then on the bottom right, the current python interpreter name
#   pops up. Click on it and select the “conda_nbnode” interpreter.
# Make sure that the correct pip is used:
#   Something like: /home/gugl/.conda_envs/conda_nbnode/bin/pip
which pip
pip install tox
tox –help# Have a clean git, then add gitlab-ci with pyscaffold
putup –update . –gitlab
pip install pre-commit
pre-commit autoupdate# Migration to github:putup –update . –github# pypi:
# login, then create a new tokenhttps://pypi.org/manage/account/token/# re-comment (after I commented them out)
# .github/workflows/ci.yml:
#       publish: […]TestsFor some tests you need data files, which are not included in the repository.
Especially all tests intests/specific_analysesneed data.
You can obtain the data by downloading the data from zenodo:pipinstallrequestspythontests/specific_analyses/e02_download_intraassay_zenodo.py
Package: nbnpy
NBN-PyThis package provides an unofficial wrapper of the National Broadband Network's (NBN) API. It allows you to programatically lookup address's and examine connection details such as the connection type (FTTP, HFC, etc), service type, connection status and more.Disclaimer:This project is not affiliated with the NBN.InstallationInstallnbnpyfrom the Python Package Index:$pipinstallnbnpyRequirementsPython 3.8+UsageThis example gets the LocationID for an address then looks up the NBN connection details for it.importpprintfromnbnpy.nbnimportNBNnbn_client=NBN()location_ids=nbn_client.get_location_ids_from_address("1 Flinders Street, Melbourne VIC")# The "get_location_ids_*" methods return a list of nearby locations# For the purpose of this example, the first result will sufficelocation_id=location_ids["suggestions"][0]["id"]location_info=nbn_client.location_information(location_id)pprint.pprint(location_info)Location Info Output{"addressDetail":{"TC2SME":true,"address1":"Unit 1 32 Flinders St","address2":"Melbourne VIC 3000 Australia","altReasonCode":"NULL_NA","cbdpricing":true,"coatChangeReason":"","disconnectionDate":"Sep 2020","disconnectionStatus":"PAST","ee":true,"eec":1,"formattedAddress":"UNIT 1 32 FLINDERS ST MELBOURNE VIC 3000 Australia","frustrated":false,"id":"LOC000175010671","latitude":-37.81540657,"longitude":144.97344433,"reasonCode":"FTTC_SA","serviceStatus":"available","serviceType":"Fixed line","speedTierAvailability":true,"techFlip":"","techType":"FTTC","wp1DisconnectionDate":"11 September 2020","wp1DisconnectionStatus":"PAST","wp2DisconnectionDate":"11 September 2020","wp2DisconnectionStatus":"PAST","wp3DisconnectionDate":"11 September 2020","wp3DisconnectionStatus":"PAST","wp4DisconnectionDate":"11 September 2020","wp4DisconnectionStatus":"PAST","zeroBuildCost":true},"servingArea":{"csaId":"CSA300000010316","description":"Exhibition","rfsMessage":"Sep 2018","serviceCategory":"brownfields","serviceStatus":"available","serviceType":"Fixed line","techType":"FTTC"},"timestamp":1654656817504}Building the ProjectThis package usespoetryandnoxfor package management and building.If nox is not already installed, install it:$pipinstallnoxRun everything including tests and documentation building$nox#Ortorunaspecificstage:$nox-s<stagename>,eg$nox-stestsIssuesIf you encounter any problems,
pleasefile an issuealong with a detailed description.
Package: nbody
# nBody### A GPU-accelerated N-body particle simulator and animatorCreate complex particle simulations the easy way: a high-level package for designing and simulating large-scale particle interactions. LetnBodydo the hard work for you!## FeaturesEasy to use – and fast –nBodycan simulate:Gravitational accelerationCoulomb interactionsParticle collisionsnBodyis highly optimized:GPU acceleration available via [`cupy`](https://cupy.chainer.org“cuPY”)CPU multiprocessing with [`numpy`](https://numpy.org/“NumPy”)Energy conservation via thevelocity-verletalgorithmAnimated [`matplotlib`](https://matplotlib.org/“Matplotlib”) visualizations included for 2-D simulations. 3-D animations are also supported through the use of [`vpython`](https://vpython.org/“VPython”).## Quick-StartUsing`numpy`arrays, you will need:An initial position array`x`with shape`(N,p)`Nis the number ofparticlespis the number ofdimensionsAn initial velocity array`v`with shape`(N,p)`An array of masses`m```withshape```(N,)`An array of charges`q`with shape`(N,)`An array of radii`r`with shape`(N,)`A possible configuration is as follows:import numpy as np
x = np.random.normal(0,   10, (N,p)) # Positions
v = np.random.normal(0,    2, (N,p)) # Velocities
m = np.random.normal(8,    1, (N, )) # Masses
q = np.random.normal(0, 1E-6, (N, )) # Charges
r = np.random.normal(1,  0.1, (N, )) # Radiim[m < 0] = np.abs(m[m < 0])
m[m == 0] = 1E-3Next, pass these arrays in the given order to the`spheres`function, so as to create a new instance`S`of class`System`with the above conditions.from nbody import *
S = spheres(x, v, m, q, r)After selecting a simulation runtime`T`and (optional) time-step`dt`, use the`solve`method to calculate the particles’ trajectories.S.solve(T, dt)If the system is 2-D such that`p == 2`, an animation can be created and saved to file; here, the filename`quick_start`is chosen, and will produce a file`animations/quick_start.mp4`.animate(S, “quick_start”)If the system is 3-D such that`p == 3`, animations can be created but not saved to file – simply omit the string argument shown above, and no warnings will be raised.Once the`solve`method has been called, it is also possible to save the`System`instance to file; in this case, the data will be saved to a directory`saved/quick_start`.save(S, “quick_start”)