# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     name: python3
# ---

# + [markdown] id="joDEN9996NPZ"
# # Nbdev
# > In this chapter, we will learn about publishing python notebooks with [Nbdev](http://nbdev.fast.ai/tutorial/).
#
# - toc: true
# - description: this isnt working
# - image: images/company_logo.png
# - keywords: thisworks
# - badges: true
# - comments: true
# - categories: [test]
# - hide: false
# - metadata_key1: metadata_value1
# - metadata_key2: metadata_value2

# + [markdown] id="L0bXqQMJKVK2"
# [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/bnia/dataguide/main?filepath=%2Fnotebooks%2F06_Nbdev.ipynb)
# [![Binder](https://pete88b.github.io/fastpages/assets/badges/colab.svg)](https://colab.research.google.com/github/bnia/dataguide/blob/main/notebooks/06_Nbdev.ipynb)
# [![Binder](https://pete88b.github.io/fastpages/assets/badges/github.svg)](https://github.com/bnia/dataguide/tree/main/notebooks/06_Nbdev.ipynb)
# [![Open Source Love svg3](https://badges.frapsoft.com/os/v3/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/)
#
# [![NPM License](https://img.shields.io/npm/l/all-contributors.svg?style=flat)](https://github.com/bnia/dataguide/blob/main/LICENSE)
# [![Active](http://img.shields.io/badge/Status-Active-green.svg)](https://bnia.github.io) 
# [![GitHub last commit](https://img.shields.io/github/last-commit/bnia/dataguide.svg?style=flat)]()  
#
# [![GitHub stars](https://img.shields.io/github/stars/bnia/dataguide.svg?style=social&label=Star)](https://github.com/bnia/dataguide) 
# [![GitHub watchers](https://img.shields.io/github/watchers/bnia/dataguide.svg?style=social&label=Watch)](https://github.com/bnia/dataguide) 
# [![GitHub forks](https://img.shields.io/github/forks/bnia/dataguide.svg?style=social&label=Fork)](https://github.com/bnia/dataguide) 
# [![GitHub followers](https://img.shields.io/github/followers/bnia.svg?style=social&label=Follow)](https://github.com/bnia/dataguide) 
#
# [![Tweet](https://img.shields.io/twitter/url/https/github.com/bnia/dataguide.svg?style=social)](https://twitter.com/intent/tweet?text=Check%20out%20this%20%E2%9C%A8%20colab%20by%20@bniajfi%20https://github.com/bnia/dataguide%20%F0%9F%A4%97) 
# [![Twitter Follow](https://img.shields.io/twitter/follow/bniajfi.svg?style=social)](https://twitter.com/bniajfi)

# + id="xd8MjmFvugUz"
#hide
# !pip freeze > requirements.txt

# + id="KJCFuYT38nfb"
# !pip install nbdev

# + id="6ZPUuf1r6NPT"
#hide
from nbdev import *

# + [markdown] id="N38-ZVW26NPa"
# ## (Non-Technical) Introduction

# + [markdown] id="AwIspUH_6NPb"
# [![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/)
#
# [![ForTheBadge built-with-love](http://ForTheBadge.com/images/badges/built-with-love.svg)](https://GitHub.com/Naereen/) [![GitHub license](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://github.com/Naereen/StrapDown.js/blob/master/LICENSE)
#
# [![ForTheBadge powered-by-electricity](http://ForTheBadge.com/images/badges/powered-by-electricity.svg)](http://ForTheBadge.com)

# + [markdown] id="AmnKSU6l6NPb"
# Fastai, the organization that created this tool, helps empower others by lowering the barrier of entry when breaking into software (AI) development. 
#
# In their own words:

# + [markdown] id="aYpgUXhA6NPb"
# > Nbdev is a tool that allows you to fully develop a library in Jupyter Notebooks, putting all your code, tests, and documentation in one place. -[Nbdev](http://nbdev.fast.ai/)

# + [markdown] id="L0hoasKF6NPd"
#
# The Nbdev library and tutorial is actually written using a notebook. They can be created and published by running the notebook on itself!
#
# If you check, you can see that their [tutorial](http://nbdev.fast.ai/) is actually being hosted on [GitHub](https://github.com/fastai/nbdev/tree/master/docs) pages.

# + [markdown] id="HnNEosdM6NPb"
# Some of the tools that Fastai provides includes:
#
# - [Nbdev](https://github.com/fastai/nbdev) - For software development and documentation
# - [Fastpages](https://github.com/fastai/fastpages) - Works like Nbdev but for blogging
# - [Fastscript](https://github.com/fastai/fastscript) - Converts a python function to a CLI script
# - [Fastprogress](https://github.com/fastai/fastprogress) - Reveals a progress bar for long processes
# - [FastiAi](https://github.com/fastai/fastai) - Data convenience tools and AI models
# - [FastAi Course](https://course.fast.ai/) - V3; a practical deep-learning course

# + [markdown] id="8SQZYkoh6NPc"
# Are you using one of these products? Tweet @jeremyphoward and [staff](https://www.fast.ai/about/#founders) or @HamelHusain for all their work!

# + [markdown] id="OqNN6coI6NPc"
# ### With Nbdev, you can:

# + [markdown] id="S_nOF-Ej6NPc"
# 1) **Publish notebooks as a module on PyPI.**
# - A) "Flag" cells to [export](http://nbdev.fast.ai/export/) them as part of the Python library
#
# 2) **Install it anywhere**: `pip install <nameOfModule>`
# - A) This can be used in conjunction with Fastscript to create CLI scripts
# - B) The CLI help interface is reachble by typing `! <NameofMdule> -h`
#
# 3) **Convert notebooks to documenation in HTML and Markdown.** 
# - A) Use the index.ipynb to auto-generate a homepage and a Github and PyPI README.md file.
# - C) Have the backticked function auto-link to a functioning GitHub source code.
# - D) Host the documentation on GitHub pages so they are always up to date.
# - E) "Flag" cells to either collapse or hide the cells or the output from documentation.
# - F) Personalize the [Jekyll](https://jekyllrb.com/) website templates used to make the site.
# - G) Store photos in an images folder for use in your notebook and have it copied to your website.
#
# 4) **Use created modules across notebooks in realtime.**
# - A) Auto-reload modules across notebooks during development if a their corresponding .py script is updated 

# + [markdown] id="6UErNfHT6NPd"
# ### *While we were on-topic!*

# + [markdown] id="uE_mFsvJ6NPe"
# If this is more than you need, consider the following: 
#
# - Sharing the Colab links directly. 
# - [Nbconvert](https://nbconvert.readthedocs.io/en/latest/) notes into HTML, LaTeX, PDF, Markdown, etc.
# - Using [mybinder](https://mybinder.org/)
# > Have a repository full of Jupyter notebooks? With Binder, open those notebooks in an executable environment, making your code immediately reproducible by anyone, anywhere.
#

# + [markdown] id="j4Y0a16b6NPe"
# ## (Technical) Overview

# + [markdown] id="CpEWWtdZ6NPe"
# 1. Nbdev is a Python library that is executed directly from the terminal.
#
# 2. At its heart, a user simply enters a directory and executes one of the Nbdev terminal commands.
#
# 3. Python notebooks are automatically located and processed for publication and deployment.
#
# 4. Specific "Flags" (either the Comment or ["Magic"](https://ipython.readthedocs.io/en/stable/interactive/magics.html#) variety) tell Nbdev how to treat cells.
#
# 5. Photos stored in the 'images' folder will be copied over to your publication folder.
#

# + [markdown] id="raGdUN9X6NPe"
# ### <a name="nbcmd"></a>Nbdev Terminal Commands

# + [markdown] id="xcA90huX6NPf"
# Entering these commands into the terminal at the project's root directory will handle most of everything. 
#
# *Pip and Git specific steps are not listed, but are included in sections below.*

# + [markdown] id="Zfz7BlRi6NPf"
# > Important: Information in this section is ever-changing! Quotes found here came from Nbdev's [official documentation](https://nbdev.fast.ai/cli/#nbdev_nb2md), from which you will derive much more insight with respect to using these functions.

# + [markdown] id="EheViw-B6NPf"
# #### Create

# + [markdown] id="omQ_zq9Q6NPf"
# > - `nbdev_new`: creates a new Nbdev project.
# > - `nbdev_update_lib`: propagates any change in the library back to the notebooks.

# + [markdown] id="gVKmdxcm6NPf"
# #### Compile

# + [markdown] id="2_yDAVGa6NPf"
# > - `nbdev_nb2md`: converts a notebook to a Markdown file.
# > - `nbdev_build_docs`: builds the documentation from the notebooks.
# > - `nbdev_build_lib`: builds the library from the notebooks.
# > - `nbdev_bump_version`/ `nbdev_bump`: increments version in settings.py by one.

# + [markdown] id="0hQ8NCES6NPg"
# *Nbdev ignores any file that starts with an underscore. Version bumping must be performed each time prior to uploading to PyPI.*
#
# Combine commands with with regular expressions for more power.
# - A commands like `nbdev_build_docs --fname=[!test]*.ipynb` will run all files except ones with filenames that start with 'test'

# + [markdown] id="o56607C56NPg"
# #### Publish
#

# + [markdown] id="0o8-ED_v6NPg"
# > - `nbdev_clean_nbs`: removes all superfluous metadata form the notebooks to avoid merge conflicts.
# > - `nbdev_install_git_hooks`: installs the git hooks that use ( `nbdev_fix_merge` and `nbdev_diff_nbs`) automatically on each commit/merge.

# + [markdown] id="TbXZOj0U6NPg"
# *GitHooks must run once on project creation for them is complete so that can be set up permanently.*

# + [markdown] id="F5uJXtPb6NPg"
# #### Check

# + [markdown] id="MFy5xTcJ6NPh"
# > - `nbdev_read_nbs`: reads all notebooks to make sure none are broken.
# > - `nbdev_trust_nbs`: trusts all notebooks so that the HTML content is shown.
# > - `nbdev_upgrade`: updates an existing Nbdev project to use the latest features.

# + [markdown] id="kvC6KE_r6NPh"
# nbdev_upgrade can run any time there are new updates, through it only needs to run once per update.

# + [markdown] id="bL1ElWdA6NPh"
# ### <a name="nbflags"></a> Nbdev Flags (Mark Up/Cell Magic) 

# + [markdown] id="o1q3EfEv6NPh"
# Nbdev scripts rely on special [comments **or** magics](https://nbdev.fast.ai/tutorial/#nbdev-flags), depending on your choice, for cell-level handling of notebooks.

# + [markdown] id="EzQJVLYC6NPh"
# Whereas Nbdev's terminal commands are executed at a project's root directory, content covered in this section is placed in the notebooks' cells.
#
# Most Nbdev flags define design instructions for when we create the website/module (Ex. `default_exp`, `autoreload`).

# + [markdown] id="XK-3BuH96NPi"
# **1.** **Basic Comment and Magics**

# + [markdown] id="MJQX876z6NPi"
# > **Warning**: Content in this section is pulled from the Fastpages [blog](https://fastpages.fast.ai/fastpages/jupyter/2020/02/21/introducing-fastpages.html#Other-Feautures) [posts](https://pete88b.github.io/fastpages/nbdev/fastai/jupyter/2020/07/24/nbdev-deep-dive.html) and the Nbdev docs. If you have any issues, you will have to scoure these sources to resolve them!

# + [markdown] id="7TxR0bZj6NPi"
# To gain access to [Nbdev's new 'magics'](https://pete88b.github.io/fastpages/nbdev/fastai/jupyter/2020/06/02/nbdev-magic.html), you my find it neccesary to execute the command `nbdev_upgrade` only once; add `from nbdev import *` to the top of a notebook in a code-cell (this [article](https://pete88b.github.io/fastpages/nbdev/fastai/jupyter/2020/06/02/nbdev-magic.html) covers that); and put Flags at the top of a cell for it to work.

# + [markdown] id="iQM8Fe0M6NPi"
# > **Important**: The list shown below was obtained from [here](https://pete88b.github.io/fastpages/nbdev/fastai/jupyter/2020/06/02/nbdev-magic.html). As always, please refer to the official source for up to date information.

# + [markdown] id="GlEOrzLB6NPi"
# | Comment flag                                | Magic flag                  |                                                                                |
# |---------------------------------------------|-----------------------------|--------------------------------------------------------------------------------|
# | `default_exp`                               | `nbdev_default_export`      | Define the name of the module everything should be exported in.                |
# | `exports`                                   | `nbdev_export_and_show`     | Export and show code in the docs.                                              |
# | `exporti`                                   | `nbdev_export_internal`     | Export but do not show in docs and or add to `__all__`.                        |
# | `export`                                    | `nbdev_export`              | Export but do not show in docs.                                                |
# | `hide_input`                                | `nbdev_hide_input`          | Do not show input of a test cell in docs.                                      |
# | `hide_output`                               | `nbdev_hide_output`         | Do not show output of a test cell in docs.                                     |
# | `hide`                                      | `nbdev_hide`                | Do not show a test cell or markdown in docs.                                   |
# | `default_cls_lvl`                           | `nbdev_default_class_level` | Define the default toc level of classes.                                       |
# | `collapse_output open` or `collapse-output` | `nbdev_collapse_output`     | Inlcude output in the docs under a collapsable element.                        |
# | `collapse_input close` or `collapse-input`  | `nbdev_collapse_output`     | Inlcude input in the docs under a collapsable element.                         |
# | `collapse_show` or `collapse-show`          | `nbdev_collapse_input open` | Inlcude input in the docs under a collapsable element that is open by default. |
# | `collapse_hide` or `collapse-hide`          | `nbdev_collapse_input`      | Inlcude input in the docs under a collapsable element.                         |
# | `collapse`                                  | `nbdev_collapse_input`      | Inlcude input in the docs under a collapsable element.                         |

# + [markdown] id="M2Z03gQO6NPi"
# **2**: **Autoreloading** 
#
#

# + [markdown] id="xSqLo7zCiQFv"
# Put `%load_ext autoreload` `%autoreload 2` in ipynbs. If you are working the notebook and importing the local version of your library, the imported modules will auto update whenever the corresponding .py file gets updated.
#
# > Note: This opens new doors in your programming experience. 
# > 
# > Provided all the notebooks have access to the same file directory:
# > 1. You can edit .py's and use `update_lib` to push the exported code's edits back into their original ipynbs (ran anywhere) 
# > 2. You can edit .IPYNB's and use `build_lib` to push the exported code's edits back into their .pys (ran anywhere) 
# > 
# > The autoreload feature will let you immediately test the new modules from any desired notebook.  

# + [markdown] id="_o0lvq2P6NPj"
# **3. Console Scripts** are made by marking up functions using the [fastscript](https://fastscript.fast.ai/) tool and editing the settings.ini file (see this [example](https://github.com/fastai/nbdev/blob/554e63b1b05390a3ad2bc086d8485f98b1e63ca4/settings.ini)).
#

# + [markdown] id="65S2xF6E6NPj"
# **4. Anchor Links**
#
# > Anchor links are web links that allow users to leapfrog to a specific point on a website page. They save them the need to scroll and skim-read, making navigation easier. - [Telegraph](https://www.telegraph.co.uk/branded-content/marketing-guides/what-is-anchor-link/)
#
# > For example,
# <a name="hyperlinkingValue"></a> Both landmark and [hyperlink](#hyperlinkingValue) have been placed on this line. Click the link for this line to zip up to the top of your screen. 
#
# Code: 
# ``` 
# # This is the hyperlink
# [hyperlinktext](#hyperlinkingValue) 
#
# # It will take you to wherever you place this landmark
# <a name="hyperlinkingValue"></a>
# ```
#
#

# + [markdown] id="1-o7Uw1O6NPj"
# **5**: **Jekyll Automated Document Hyperlinking**
#
# Mentioning an exported class with backticks `functionName` will create a hyperlink to its sourcode on GitHub. This will only work if it is an exported function.
#
# - Functions and Classes have are automatically documented. 
#
# - Class methods are not shown by default, so use [`show_doc(class.method`)](http://nbdev.fast.ai/showdoc/#show_doc) to do this.

# + [markdown] id="hLsxu-3t6NPj"
# **6.** **Jekyll Metadata**
#
# The cell `#default_exp` located at the top of a cell can also be used for
# [YAML](https://yaml.org/), a data-serialization standard. This is used as [Front Matter](https://assemble.io/docs/YAML-front-matter.html) that can be [used with Jekyll](https://jekyllrb.com/docs/datafiles/) to render templates.
# > In the markdown cell with the title, you can add the summary as a block quote by putting an empty block quote for an empty summary. Next, add a list with any additional metadata you would like to add **[`get_metadata`](https://nbdev.fast.ai/export2html/#get_metadata)**.

# + [markdown] id="ioIJ2z-f6NPj"
# **7. Jekyll Images**
#
# The 'images' folder can be used to conjure up pictures, with an example provided below:
#
# `![](notebookfolder/images/company_logo.png)`
#
# These images will be added to and displayed in the docs.

# + [markdown] id="cw3O7C486NPk"
# ![](./images/ai_of_me.jpg)

# + [markdown] id="Aq13T9KL6NPk"
# **8. Jekyll [Notes](http://nbdev.fast.ai/export2html/#add_jekyll_notes)**
#
# The following section was written using the following markups: 
#
# ```> Note:```, ```> Warning:```, ```> Tip:``` and ```> Important: text goes here```
#
# > Note: This is a note.
#
# > Warning: This is a warning.
#
# > Tip: This is a tip.
#
# > Important: This is an Important doc link to [`add_jekyll_notes`](/export2html#add_jekyll_notes), which should also work fine.
#

# + [markdown] id="o3_hgZ6z6NPk"
# **9. Jekyll [Search](http://nbdev.fast.ai/search/)**
#
# This is functionality not covered here, but may be added in the future.
#
# **10. Jekyll Custom Sidebar**
#
# This is used for your HTML documentation, which can be configured using meta-markup [JSON](https://www.json.org/json-en.html).
#
# > The default sidebar lists all html pages with their respective title, except the index that is named "Overview". To build a custom sidebar, set the flag custom_sidebar in your settings.ini to True then change the sidebar.json file in the doc_folder to your liking. Otherwise, the sidebar is updated at each doc build.

# + [markdown] id="uQ-ptbNf6NPk"
# ## Getting Started

# + [markdown] id="SoP0-e306NPk"
# To get started, install the Nbdev libarary.

# + id="Hcb1E01E6NPl"
# %%capture
# ! pip install nbdev

# + [markdown] id="Ymyh3zHM6NPl"
# ### Connect to Folder

# + [markdown] id="2kVNkxmr6NPl"
# Give Colabs access to your Google Drive

# + colab={"base_uri": "https://localhost:8080/"} id="0D-YmdW46NPl" executionInfo={"status": "ok", "timestamp": 1626577684648, "user_tz": 240, "elapsed": 17566, "user": {"displayName": "Baltimore Neighborhood Indicators Alliance", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gg-q3A7kTIHf7wESw989OAOaJeUYKXGEdoA4M3NTA=s64", "userId": "16379023391965073054"}} outputId="0fff6cc3-637e-46f2-dccd-ed03e5350194"
#hide_output
from google.colab import drive
drive.mount('/content/drive')

# + [markdown] id="TVpUAXI96NPm"
# Navigate to the Google Drive directory where you store your projects folder.

# + [markdown] id="8Io-ox8J6NPm"
# ## Creating a New Project

# + [markdown] id="IYmYBGPe6NPn"
# The Nbdev library will only work with projects that have the proper file structure and files. 
#
# Once configured, you may simply write in a notebook (placing Nbdev 'FLAGS' where needed) and publish using an Nbdev terminal commands. The Nbdev command will process the notebook and each of its cells according to rules denoted by the 'FLAGS'.

# + [markdown] id="H5E8Cd9K6NPn"
# ### Getting a template

# + [markdown] id="pMlvyDul6NPn"
# You can grab a free project template containing all the needed files and proper structure. With this, you can get started in one of two methods shown below.

# + [markdown] id="p05jrGxW6NPn"
# #### Method 1) Grabbing a template using GitHub and the browser.

# + [markdown] id="tduhG8Dv6NPn"
# Now, create a new [repository](https://github.com/fastai/nbdev_template/generate).

# + id="qUUCEgES6NPn" colab={"base_uri": "https://localhost:8080/"} executionInfo={"status": "ok", "timestamp": 1626052930050, "user_tz": 240, "elapsed": 1296, "user": {"displayName": "Baltimore Neighborhood Indicators Alliance", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gg-q3A7kTIHf7wESw989OAOaJeUYKXGEdoA4M3NTA=s64", "userId": "16379023391965073054"}} outputId="e18904e0-422f-4769-b6c5-328da33da2c1"
#hide_output
# ! git clone https://github.com/fastai/nbdev_template.git

# + id="O-xpElfeQ2A4"
# ls

# + id="RSixWDN86NPn"
#hide
# !mv nbdev_template VitalSigns
# !mv VitalSigns ../z

# + id="S5H8wvdtTkgb"
# !cp RBIntel.ipynb ../VitalSigns

# + id="cVcLTtSC6NPo" colab={"base_uri": "https://localhost:8080/"} executionInfo={"status": "ok", "timestamp": 1626053058325, "user_tz": 240, "elapsed": 122, "user": {"displayName": "Baltimore Neighborhood Indicators Alliance", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gg-q3A7kTIHf7wESw989OAOaJeUYKXGEdoA4M3NTA=s64", "userId": "16379023391965073054"}} outputId="91fcf0ef-fefb-457d-d349-ba6a29230fdf"
#hide
# cd ../VitalSigns

# + id="CDngb2aC6NPo" colab={"base_uri": "https://localhost:8080/"} executionInfo={"status": "ok", "timestamp": 1626053109721, "user_tz": 240, "elapsed": 282, "user": {"displayName": "Baltimore Neighborhood Indicators Alliance", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gg-q3A7kTIHf7wESw989OAOaJeUYKXGEdoA4M3NTA=s64", "userId": "16379023391965073054"}} outputId="7fed2075-ae9f-4239-dc6d-d940831130cf"
#hide
# !ls

# + [markdown] id="_-SZ-Z8S6NPo"
# #### Method 2) Grabbing a template using the Nbdev library and the terminal.

# + colab={"base_uri": "https://localhost:8080/"} id="pnBlZPLiSfRh" executionInfo={"status": "ok", "timestamp": 1626052608323, "user_tz": 240, "elapsed": 442, "user": {"displayName": "Baltimore Neighborhood Indicators Alliance", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gg-q3A7kTIHf7wESw989OAOaJeUYKXGEdoA4M3NTA=s64", "userId": "16379023391965073054"}} outputId="3fda7a0b-2b90-4888-e762-2b1c9f6f1c10"
# !git init

# + [markdown] id="B2wFHzXe6NPo"
# An Nbdev terminal command can be used to **create a template** project directory.
#
# Use -h to view positional args.

# + id="8a13byOB6NPo"
#hide
# cd ../

# + id="1L1v-MOD6NPp" colab={"base_uri": "https://localhost:8080/"} executionInfo={"status": "ok", "timestamp": 1626052347577, "user_tz": 240, "elapsed": 1875, "user": {"displayName": "Baltimore Neighborhood Indicators Alliance", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gg-q3A7kTIHf7wESw989OAOaJeUYKXGEdoA4M3NTA=s64", "userId": "16379023391965073054"}} outputId="b666e518-2264-4aa5-fa8c-5e7d3e9fe134"
#collapse_output
# ! nbdev_new -h

# + [markdown] id="A9yZqkgV6NPp"
# We will need to register your **GitHub credentials** appropraitely configured for it to work.

# + id="JBqcnZU26NPp"
#collapse_input open
# ! git config --global user.email "<EMAIL>"
# ! git config --global user.name "bnia"

# + [markdown] id="1Fl0uNLn6NPp"
# Now, you can just run the command to **create a new project/directory** by a name of your choosing.

# + id="zUc5nHP86NPp" colab={"base_uri": "https://localhost:8080/"} executionInfo={"status": "ok", "timestamp": 1626052718872, "user_tz": 240, "elapsed": 1848, "user": {"displayName": "Baltimore Neighborhood Indicators Alliance", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gg-q3A7kTIHf7wESw989OAOaJeUYKXGEdoA4M3NTA=s64", "userId": "16379023391965073054"}} outputId="05f47a77-f006-4fcd-9d60-931fffe32264"
#hide_output
# ! nbdev_new 'test123'

# + [markdown] id="TLHtNuVn6NPq"
# If you enter it, you will see it comes all set up.

# + id="zBPrd6QA6NPq" colab={"base_uri": "https://localhost:8080/"} executionInfo={"status": "ok", "timestamp": 1626052471366, "user_tz": 240, "elapsed": 294, "user": {"displayName": "Baltimore Neighborhood Indicators Alliance", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gg-q3A7kTIHf7wESw989OAOaJeUYKXGEdoA4M3NTA=s64", "userId": "16379023391965073054"}} outputId="b85c5980-d233-43bc-b7f0-b080409f7ba7"
#hide
# !cd VitalSigns

# + [markdown] id="DQJOWvFV6NPq"
# As you can see, it comes all set up.

# + id="ILKLTuQT6NPq"
#hide
# ls

# + [markdown] id="ujyaGrZh6NPq"
# ### Configuring the Template

# + [markdown] id="Ubi5fvB76NPq"
# **There are some one-offs to perform on the template.**

# + [markdown] id="NOSbkzBx6NPq"
# #### GitHooks

# + [markdown] id="vj3jI-K66NPr"
# Run `! nbdev_install_git_hooks` 
#
# > To set up GitHooks that will remove metadata from your notebooks when you commit, greatly reducing the chance you have a conflict. 
# > 
# > But if you do get a conflict later, simply run nbdev_fix_merge filename.ipynb. This will replace any conflicts in cell outputs with your version. If there are conflicts in input cells, then both cells will be included in the merged file, along with standard conflict markers (e.g. =====). Then, you can open the notebook in Jupyter and choose which version to keep.
#  ~ nbdev [tutorial](http://nbdev.fast.ai/cli/#nbdev_install_git_hooks)

# + id="hQ-RbrS46NPr"
# %%capture
# remove metadata from your notebooks when you commit reducing the chance you have a conflict.
# ! nbdev_install_git_hooks
# if you do get a conflict, simply run nbdev_fix_merge filename.ipynb

# + [markdown] id="H0tJVyTM6NPr"
# #### Settings.ini

# + [markdown] id="a_Xo9XqL6NPr"
# Everything is included in the template for the library to be packaged.
#
# Your settings.ini is where all parts of nbdev look for any required configuration information. 
#
# Complete the Python form below to update the `settings.ini` file.

# + [markdown] id="RokQ4SJ16NPr"
# Really, only the '**folder_name**' and '**github_username**' fields need to be edited for this to work.
#
# The form values entered here will be inserted into the settings.ini doc. 

# + id="-VIn2weR6NPs" cellView="form"
#collapse_input
#@title Example form fields
#@markdown Forms support many types of fields.

# Name of the project
folder_name = "VitalSigns"  #@param {type:"string"}
company_name = "BNIA-JFI" #@param {type:"string"}
# GitHub Username
github_username = 'bniajfi'  #@param {type:"string"}
description = "Python Scripts for BNIA-JFI's Vital Signs Data"  #@param {type:"string"}
keywords = "Community Data"  #@param {type:"string"}
# Who are you?
author = "<NAME>"  #@param {type:"string"}
author_email = '<EMAIL>' #@param {type:"string"}
# Where are your notebooks? They are currently at the basepath.
path_to_locate_notebooks = "."  #@param {type:"string"}
# Where should your documentation be put? {type:"string"}
path_to_place_documentation = "docs" #@param {type:"string"}
#@markdown ---

user=github_username
nbs_path=path_to_locate_notebooks
doc_path=path_to_place_documentation
lib_name=folder_name

# Now let's rewrite the settings.ini file.

innertext = """
[DEFAULT]
# All sections below are required unless otherwise specified
host = github
lib_name = """+lib_name+"""
company_name = """+company_name+"""

user = """+user+"""
description = """+description+"""
keywords = """+keywords+"""
author = """+author+"""
author_email = """+author_email+"""
copyright = MIT
branch = master
version = 0.0.1
min_python = 3.6
audience = Developers
language = English
# Set to True if you want to create a more fancy sidebar.json than the default
custom_sidebar = False
# Add licenses and see current list in `setup.py`
license = apache2
# From 1-7: Planning Pre-Alpha Alpha Beta Production Mature Inactive
status = 2

# Optional. Same format as setuptools requirements
# requirements = 
# Optional. Same format as setuptools console_scripts
# console_scripts = 
# Optional. Same format as setuptools dependency-links
# dep_links = 

###
# You probably won't need to change anything under here,
#   unless you have some special requirements
###

# Change to, e.g. "nbs", to put your notebooks in nbs dir instead of repo root
nbs_path = """+nbs_path+"""
doc_path = """+doc_path+"""

# Whether to look for library notebooks recursively in the `nbs_path` dir
recursive = False

# Anything shown as '%(...)s' is substituted with that setting automatically
doc_host =  https://%(user)s.github.io
#For Enterprise Git pages use:  
#doc_host = https://pages.github.%(company_name)s.com.  


doc_baseurl = /%(lib_name)s/
# For Enterprise Github pages docs use:
# doc_baseurl = /%(repo_name)s/%(lib_name)s/

git_url = https://github.com/%(user)s/%(lib_name)s/tree/%(branch)s/
# For Enterprise Github use:
#git_url = https://github.%(company_name)s.com/%(repo_name)s/%(lib_name)s/tree/%(branch)s/



lib_path = %(lib_name)s
title = %(lib_name)s

#Optional advanced parameters
#Monospace docstings: adds <pre> tags around the doc strings, preserving newlines/indentation.
#monospace_docstrings = False
#Test flags: introduce here the test flags you want to use separated by |
#tst_flags = 
#Custom sidebar: customize sidebar.json yourself for advanced sidebars (False/True)
#custom_sidebar = 
#Cell spacing: if you want cell blocks in code separated by more than one new line
#cell_spacing = 
#Custom jekyll styles: if you want more jekyll styles than tip/important/warning, set them here
#jekyll_styles = note,warning,tip,important
"""

# Write-Overwrites 
file1 = open("settings.ini", "w")  # write mode 
file1.write(innertext) 
file1.close() 

# + [markdown] id="L6aRolxX6NPs"
# #### Edit the Notebooks

# + [markdown] id="UC0UTfDj6NPt"
# To start, notice how there are two `.ipynb`'s. 
#
# These are two notebooks used for the template.
#
# 1. `index.ipynb` - When index.ipynb gets converted to 'index.html' it becomes the documentations homepage since browsers understand 'index.html' to be a website's homepage. When published, this notebook will also be made into the README.md document that can be shown on GitHub repositories pages and PyPI. Once published to PyPI, the index notebook (i.e. the homepage) can be used to show others how to install and use the library!
#
# 2. `00_core.ipynb` - This is the 'core' component of the python library. You don't have to keep the 'core' part. The left two digits in the filename help the website navigation so you can increment your notebooks by the order you want them displayed. The index.ipynb is the only notebook that does not have this logic apply to it. Inside the notebook, you will see a template near ready for deployment. If the lib_name was to be replaced and a function was declared with an `# export flag` at the top of its cell; this would be ready for deployment and publishing to PyPI!

# + id="oOvHrlux6NPt"
# ! mkdir ./notebooks
# ! mv ./00_core.ipynb ./notebooks/
# ! mv index.ipynb ./notebooks/

# + id="0NCPt14A6NPt" colab={"base_uri": "https://localhost:8080/"} executionInfo={"status": "ok", "timestamp": 1626056111408, "user_tz": 240, "elapsed": 157, "user": {"displayName": "Baltimore Neighborhood Indicators Alliance", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gg-q3A7kTIHf7wESw989OAOaJeUYKXGEdoA4M3NTA=s64", "userId": "16379023391965073054"}} outputId="9285814d-e377-4167-c82c-a810c510366e"
#hide
# !ls

# + [markdown] id="44Sk9AqY6NPu"
# #### Create the library and documentation.

# + [markdown] id="-Am7p1Be6NPu"
# Install libraries used in your exported module here, or else the next spet will not work.
#
# For now, since we are working with the start template, this should not be a problem.

# + [markdown] id="oQAjPb1q6NPu"
# Once ready, run `! nbdev_build_lib`
#
# - You will now find that you have a new directory, with the name of whatever you set lib_name to.

# + id="jVhg7t836NPu" colab={"base_uri": "https://localhost:8080/"} executionInfo={"status": "ok", "timestamp": 1626056349944, "user_tz": 240, "elapsed": 282, "user": {"displayName": "Baltimore Neighborhood Indicators Alliance", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gg-q3A7kTIHf7wESw989OAOaJeUYKXGEdoA4M3NTA=s64", "userId": "16379023391965073054"}} outputId="3d93d9e1-96d2-4992-d53c-4c0f2a049173"
#hide
# !ls

# + id="x532Somv6NPv" colab={"base_uri": "https://localhost:8080/"} executionInfo={"status": "ok", "timestamp": 1626057062737, "user_tz": 240, "elapsed": 1762, "user": {"displayName": "Baltimore Neighborhood Indicators Alliance", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gg-q3A7kTIHf7wESw989OAOaJeUYKXGEdoA4M3NTA=s64", "userId": "16379023391965073054"}} outputId="0999bebb-2115-439e-9c27-2306ad557173"
#hide_output
# ! nbdev_build_lib --fname RBIntel.ipynb

# + id="JLjS5XIF6NPv" colab={"base_uri": "https://localhost:8080/"} executionInfo={"status": "ok", "timestamp": 1626056184803, "user_tz": 240, "elapsed": 161, "user": {"displayName": "Baltimore Neighborhood Indicators Alliance", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gg-q3A7kTIHf7wESw989OAOaJeUYKXGEdoA4M3NTA=s64", "userId": "16379023391965073054"}} outputId="937be21d-0b85-405e-d576-c142773ce44f"
#hide
# !ls

# + [markdown] id="sW7PJ1hB6NPv"
# **Congratulations**! You have now successfully created a Python library. 
#
# The library itself is still empty. In order to export code, be sure to use the `#export` Flag on cells.

# + [markdown] id="AozShiPI6NPw"
# Be sure to explore the Flags and Commands!

# + id="qhZun3o36NPw"
#hide
# cd ../dataguide

# + id="fot8eNr36NPx"
#hide
# !ls

# + [markdown] id="LBBIYs_f6NPx"
# #### Configuring Git-Github

# + id="SapJWLRS6NPx"
#hide_output
# ! git init

# + [markdown] id="eOu-lCiF6NPx"
# In order to [add an existing project](https://docs.github.com/en/github/importing-your-projects-to-github/adding-an-existing-project-to-github-using-the-command-line) to GitHub: 
# - [Create a new repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-new-repository) with the repositories name the same as the new library.
# - Ensure the repository is absolutely empty so we can make a clean push.

# + [markdown] id="sPL3YZuy6NPy"
# One you do create the GitHub repository through the website, you can connect the your Git repository to the GitHub repository using this command:

# + id="FzjhgFY_6NPy"
# Make replacements whereever needed and run this! Be sure to remove our password once this is run.

# # ! git remote add ORIGIN https://<USER NAME>:<passwrd>@github.com/<USER NAME>/<REPO NAME>.git

# + [markdown] id="okwTG1CX6NPy"
# You will now be able to commit this local repository to GitHub.

# + [markdown] id="ISyy60IW6NPy"
# #### Create a PyPI account

# + [markdown] id="O9STkkfT6NPy"
# In order for you to be able to publish to [PyPI](https://pypi.org/), you must have an account. Click "register" on the top right corner of their website to build an account.
#
# Your username should be the `user` value from your settings.ini file.

# + [markdown] id="LhuhaJ0X6NPy"
# #### Publishing!
#
# Refer to the Build Proccess, PyPI, and Git sections below.

# + [markdown] id="ViYTkPqF6NPz"
# ## Pipeline 1/3: NBDEV

# + [markdown] id="NB71vjrz6NPz"
# (Run once Modules, Docs, and the README are created using NBDEV and are ready to be published onto the web.)

# + [markdown] id="CCRI6q_f6NPz"
# You need to install the libraries in this nb so that they are used in your other nb.

# + id="urL5e1X96NPz"
# %%capture
# 1_ACS EXPLORE AND DOWNLOAD
# !pip install -U -q ipywidgets
# !pip install geopandas
# !jupyter nbextension enable --py widgetsnbextension

# + id="oliAPLm66NPz"
# %%capture
# 02_Merge_Data.ipynb
# !pip install geopandas
# !pip install dataplay
# !pip install dexplot

# + [markdown] id="0TUVnnFi6NP0"
# Enter the project if it exists. Otherwise, go to the folder you want it to exist at.

# + colab={"base_uri": "https://localhost:8080/"} id="O4cO6k7k6NP0" executionInfo={"elapsed": 6867, "status": "ok", "timestamp": 1615316865537, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14GiQg4PIuuYRyIyCWtHJXvMzkkkBSQpEzUYL20Bjog=s64", "userId": "06248540216665543849"}, "user_tz": 300} outputId="71c0ec58-4b67-4728-af36-4f38931bbe05"
# cd ../

# + id="6KUK9Fhg6NP0"
#hide
# !ls

# + colab={"base_uri": "https://localhost:8080/"} id="ubGf30sk6NP0" executionInfo={"elapsed": 799, "status": "ok", "timestamp": 1615316878185, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14GiQg4PIuuYRyIyCWtHJXvMzkkkBSQpEzUYL20Bjog=s64", "userId": "06248540216665543849"}, "user_tz": 300} outputId="23e09895-4db4-40ed-8799-aa8d2e93eb10"
#hide
# %cd dataplay

# + id="mIWYBv_x6NP0"
#hide
# %cd dataguide

# + id="uvLytCRW4tAp"
#hide
# %cd notebooks

# + id="SvaYvt60edI2"
#hide
# %cd ../

# + colab={"base_uri": "https://localhost:8080/"} id="k_TvGvl96NP1" executionInfo={"status": "ok", "timestamp": 1621903475267, "user_tz": 240, "elapsed": 225, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14GiQg4PIuuYRyIyCWtHJXvMzkkkBSQpEzUYL20Bjog=s64", "userId": "06248540216665543849"}} outputId="f1e4ae38-ced0-4d10-d42e-e90122482ff5"
#hide 
# !ls

# + [markdown] id="MDY5K2pz6NP1"
# As long as you are wherever you are developing the library in your folder, both of these commands will work:

# + colab={"base_uri": "https://localhost:8080/"} id="X-BybYnu6NP1" executionInfo={"status": "ok", "timestamp": 1621903515139, "user_tz": 240, "elapsed": 2644, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14GiQg4PIuuYRyIyCWtHJXvMzkkkBSQpEzUYL20Bjog=s64", "userId": "06248540216665543849"}} outputId="71a94c05-c2ca-4ad8-dbbf-5b2c66530237"
#hide_output
# first. builds the .py files from from .ipynbs
# !nbdev_build_lib

# + colab={"base_uri": "https://localhost:8080/"} id="Nocef4ytzm7Q" executionInfo={"status": "ok", "timestamp": 1621903520357, "user_tz": 240, "elapsed": 2816, "user": {"displayName": "<NAME>", "photoUrl": "https://<KEY>", "userId": "06248540216665543849"}} outputId="02600ddf-e63a-4486-97a0-234f04d3b7c2"
#hide_output
# second. Push .pu changes back to their original .ipynbs
# !nbdev_update_lib 

# + id="cLHc7IWi6NP1"
#hide_output
# nbdev_build_docs builds the documentation from the notebooks
# !nbdev_build_docs --force_all True --mk_readme True 

# + id="RFjhl_oDeS38"
# sometimes. Update .ipynb import statements if the .py filename.classname changes. 
# # !relimport2name

# + id="8uy5VWDKgWDS"
# this will reload imported modules whenever the .py file changes. 
# whenever the .py file changes via nbdev_build_lib or _update_lib. 
# # %load_ext autoreload
# # %autoreload 2

# + id="Uz2VGKP_6NP1"
#hide
# %cd notebooks

# + id="SKHTFTvi6NP1"
#hide_output
# ! nbdev_clean_nbs
# ! nbdev_fix_merge 00_github.ipynb
# ! nbdev_fix_merge 01_colabs.ipynb
# ! nbdev_fix_merge 01_5_Explore_and_Download.ipynb
# ! nbdev_fix_merge 02_scooterExploration.ipynb
# ! nbdev_fix_merge 03_nbdev.ipynb
# ! nbdev_fix_merge index.ipynb
# ! nbdev_clean_nbs
# ! find . -name "*.bak" -type f -delete

# + id="gczXodZW6NP2"
#hide_output
# nbdev_nb2md(fname:"A notebook file name to convert", dest:"The destination folder"='.', img_path:"Folder to export images to"='', jekyll:"To use jekyll metadata for your markdown file or not"=False)
# ! nbdev_nb2md 00_github.ipynb --dest "../markdown" 
# ! nbdev_nb2md 01_colabs.ipynb --dest "../markdown" 
# ! nbdev_nb2md 02_scooterExploration.ipynb --dest "../markdown" 
# ! nbdev_nb2md 03_nbdev.ipynb --dest "../markdown" 
# ! nbdev_nb2md index.ipynb --dest "../markdown" 
# ! find . -type d -name "*files" -exec rm -rf {} \;

# + id="NIs_Gj5z6NP2"
#hide
# %cd ../

# + colab={"base_uri": "https://localhost:8080/"} id="h1vTn52T6NP2" executionInfo={"elapsed": 630, "status": "ok", "timestamp": 1615316942773, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14GiQg4PIuuYRyIyCWtHJXvMzkkkBSQpEzUYL20Bjog=s64", "userId": "06248540216665543849"}, "user_tz": 300} outputId="7476278d-afef-49a8-f59b-8c067f07dbc9"
#hide
# !ls

# + [markdown] id="KxLxHdK_6NP3"
# ## Pipeline 2/3: GIT

# + [markdown] id="-NPSj_Fs6NP3"
# Before you push, run `nbdev_clean_nbs` to ensure that the push will work. Of course, **that** is ensured by `nbdev_fix_merge`.

# + id="XbU5tf_i6NP3"
#hide
# This code was meant to do what the code above it is doing it. Kept for posterity.
# fix_conflicts('notebooks/index.ipynb') # This is ran as a method within nbdev_fix_merge
# from nbdev.export import *
# from nbdev.merge import *
# tst_nb = read_nb('notebooks/index.ipynb')
# print(tst_nb)

# + [markdown] id="-e06fAdq6NP3"
# Run once the Modules, Docs and README have been created using NBDEV but not published.

# + id="5SE6ljRx6NP3"
# # cd datalab

# + id="TSk-KWkR6NP3"
#hide_output
# ! git add *

# + id="Nfc9qmr16NP4"
# ls

# + id="PBt6nSUl6NP4"
# !git config --global user.name "bnia"

# + id="3gmLwcF_6NP4"
# !git config --global user.email "<EMAIL>"

# + id="xy7Hic9J6NP4"
# ! git commit -m "Collapse Experiments P2"

# + id="cAJshuLZ6NP4"
# git push -f origin master

# + id="5fmcIl1R6NP4"
#hide_output
# ! git push -u ORIGIN main

# + [markdown] id="u2hwdR1K6NP5"
# If you get the following error "fatal: could not read Username for 'https://github.com': No such device or address", you will need to re-establish your Git-GitHub connection.
#
# Start by running `! git remote rm ORIGIN`, then re-add like so `! git remote add ORIGIN https://<USER NAME>:<passwrd>@github.com/<USER NAME>/<REPO NAME>.git`.
#
# Be sure to make the replacements whereever needed and run this. Once this is running, be sure to remove the password.

# + [markdown] id="apflD33N6NP5"
# If GitHub pages does not show, consult this [guide](https://docs.github.com/en/github/working-with-github-pages/troubleshooting-jekyll-build-errors-for-github-pages-sites#troubleshooting-build-errors). Typically, this is a problem with the Markdown.

# + [markdown] id="Ag01NyQT6NP5"
# ## Pipeline 3/3: PyPI

# + [markdown] id="0SZBVgPp6NP5"
# Run once the Modules, Docs and README have been created using NBDEV.

# + [markdown] id="ueSwAMCy6NP5"
# Be sure you have a PyPI account that has the same username as your GitHub account before continuing.

# + [markdown] id="OV4HANKl6NP5"
# You could save your credentials into a .pypirc file, but this is not recommended.

# + id="DrW5Cr996NP5"
# # ! echo "[pypi]" > .pypirc
# # ! echo "username = 'username'" >> .pypirc
# # ! echo "password = 'password'" >> .pypirc

# + [markdown] id="IaAfZylz6NP6"
# To publish to Pypi, install twine.

# + id="-bQ-RUAS6NP6"
# %%capture
# ! pip install twine

# + [markdown] id="7sZM8_KL6NP6"
# Be sure to run this final nbdev command `! nbdev_bump_version` prior to publishing. Otherwise, you might have issues.

# + colab={"base_uri": "https://localhost:8080/"} id="CzKyaZfA6NP6" executionInfo={"elapsed": 7750, "status": "ok", "timestamp": 1615316954094, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14GiQg4PIuuYRyIyCWtHJXvMzkkkBSQpEzUYL20Bjog=s64", "userId": "06248540216665543849"}, "user_tz": 300} outputId="e209d369-b921-4a88-af7f-9b07e991c4e4"
# !nbdev_bump_version

# + id="hvNl5KnkZvCR"


# + [markdown] id="wJlTO0I_6NP6"
# Other than what has been discussed above, Nbdev has everything else all set up! Simply run make PyPI and enter your credentials when prompted at the bottom of the terminal output. Your password will be censored. Therefore, it is safe to post this code online without clearing it.

# + id="3dROenjM6NP6"
#hide_output
# ! make pypi

# + id="kKbv2PE-6NP6"
# ls

# + [markdown] id="KW8NPUi36NP7"
# ## Misc Tests

# + [markdown] id="QDDNjmnvkCnA"
# These things don't work... yet?

# + [markdown] id="BM6W2NUt6NP7"
# ![](./images/ai_of_me.jpg)

# + id="t_FO_UAn6NP7"
from IPython.display import display

# + id="l_cnh3f16NP7"
#hide
var = "hide"
display(var)

# + id="zXjhC2eq6NP7"
#hide_input
var = "hide_input"
display(var)

# + id="h4QgL1V96NP8"
#hide_output
var = "hide_output"
print('The input of this cell is visible as usual.\nWhile the OUTPUT of this cell is collapsed by default, you can expand it!')

# + id="9XsshMav6NP8"
#collapse_output
var = "collapse_output"
display(var)

# + id="89lRyzdZ6NP8"
#collapse_show
var = "collapse_show"
display(var)

# + id="0FnGxS1Y6NP8"
#collapse_hide
var = "collapse_hide"
display(var)

# + id="LcO4NN8K6NP8"
#collapse-hide 
print('The input of this cell is visible as usual.\While the OUTPUT of this cell is collapsed by default, you can expand it!')

# + id="t9UNB2bp6NP9"
#collapse_input
var = "collapse_input"
display(var)

# + id="3OohcTQF6NP9"
#collapse_input open
var = "collapse_input open"
display(var)

# + id="9y1oqm-16NP9"
#collapse_output
var = "collapse_output"
display(var)

# + id="-bDONWna6NP9"
#collapse_output open
var = "collapse_output open"
display(var)

# + id="5HnmOB2_6NP9"
#collapse_output
print('The input of this cell is visible as usual.\nWhile the OUTPUT of this cell is collapsed by default, you can expand it!')

# + [markdown] id="Pv37Ejgu6NP-"
# <details>
#   <summary> summary and details together </summary>
#   details 1
# </details>

# + [markdown] id="CkPkd2Qv6NP-"
# <details>
#   <summary> summary and details split </summary>

# + [markdown] id="AdRWnaUY6NP-"
#   summary and details split
# </details>

# + [markdown] id="UaZpr_wc6NP-"
# <details>

# + [markdown] id="V8UfRMOu6NP-"
# ####  <summary> Entirely Split </summary>

# + [markdown] id="7gY-gM1e6NP-"
#   Entirely Split

# + [markdown] id="wlWK7f0v6NP_"
# </details>

# + [markdown] id="AIVIJs6u6NP_"
# <details>
#   <summary> # md within html </summary>
#   **md within html**
# </details>

# + id="8LPL6bek6NP_"
#collapse_output
print('The input of this cell is visible as usual.\nWhile the OUTPUT of this cell is collapsed by default, you can expand it!')

# + id="0ip8Fzxu6NP_" language="html"
# <details>
#   <summary> code html </summary>
#   code html
# </details>

# + id="BLPc-UaE6NP_"
#collapse_output
# %%html
<details>
  <summary> code html collapse output </summary>
  code html collapse output
</details>

# + id="iZaiDsiI6NQA" language="html"
# <details>
#   <summary> code html </summary>
#   code html no collapse
# </details>

# + id="x0M0572G6NQA"


StarcoderdataJupyterScriptsDedupFiltered