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

# +
# default_exp core
# -

# # module name here
#
# > Sample tutorial of nbdev

#hide
from nbdev.showdoc import *


#export
def say_hello(to):
    "Say hello to someone"
    return f'Hello {to}!'


# For each funtion, we can do a little test as when we do our experiement:

#export
say_hello("Duc")

#exprot
assert say_hello("Duc") == "Hello Duc!"


#export
class HelloSayer:
    "Say hello to `to` using `say_hello`"
    def __init__(self, to): self.to = to
    def say(self): say_hello(self.to)


# use `show_doc()` method to add documents:

from nbdev.showdoc import *
show_doc(HelloSayer.say)

# It's also helpful to stay uptodate with all modules once changes happen:

# %load_ext autoreload
# %autoreload 2

# Furthermore, it'd be nice to be able to convert notebooks to python modules within notebooks. We can use method: `notebook2script()`

from nbdev.export import *
notebook2script()

# Running test is also can be done in parallel, before we push to github by running `nbdev_test_nbs` in terminal



StarcoderdataJupyterScriptsDedupFiltered