Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
khuyentran1401 committed Jun 23, 2021
1 parent b6ef311 commit 49b9b7c
Show file tree
Hide file tree
Showing 36 changed files with 33,092 additions and 71 deletions.
2 changes: 2 additions & 0 deletions .fdignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
README.md
df.md
12 changes: 12 additions & 0 deletions applications/notion_examples/add_new.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from hashlib import new
from notion.client import NotionClient
from notion.block import ColumnBlock, TodoBlock
from rich import inspect

client = NotionClient(token_v2="02a65af9ae61ae50bc17f3333d251e2580d9fd1293bdc68990a474372a458a56b63b1b2868f47e5b21e947ddc093634ce8442de2390f14bcdc54bbaa0d6d2921fad82538d01c9d78c9931f6daea5")
page = client.get_block("https://www.notion.so/1063a61b0a4548959373f995b008d13e?v=6fba291866984949abf7c2c6e2e85ae1")

inspect(page, methods=True)
# print(page)
content = page.get()
print(content)
10 changes: 10 additions & 0 deletions applications/notion_examples/get_title.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from notion.client import NotionClient

client = NotionClient(token_v2="02a65af9ae61ae50bc17f3333d251e2580d9fd1293bdc68990a474372a458a56b63b1b2868f47e5b21e947ddc093634ce8442de2390f14bcdc54bbaa0d6d2921fad82538d01c9d78c9931f6daea5")

page = client.get_block("https://www.notion.so/1063a61b0a4548959373f995b008d13e?v=6fba291866984949abf7c2c6e2e85ae1")
print("Page title is", page.title)

page.title = "My connections"
print("New page title is", page.title)

9 changes: 9 additions & 0 deletions applications/notion_examples/traverse.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from notion.client import NotionClient

client = NotionClient(token_v2="02a65af9ae61ae50bc17f3333d251e2580d9fd1293bdc68990a474372a458a56b63b1b2868f47e5b21e947ddc093634ce8442de2390f14bcdc54bbaa0d6d2921fad82538d01c9d78c9931f6daea5")
page = client.get_block("https://www.notion.so/1063a61b0a4548959373f995b008d13e?v=6fba291866984949abf7c2c6e2e85ae1")

for child in page.children:
print(child.title)

print("Parent of {} is {}".format(page.id, page.parent.id))
7 changes: 4 additions & 3 deletions applications/pywebio_1_3_0/app_pin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
from pywebio import start_server
from utils import IMAGE_TO_LINK


def app():
def create_text():
put_markdown("# Can Dinosaur and Circle Have the Same Statistics?")
put_text("Two datasets with the same mean, standard deviation, and correlation "
"could be very different.\n\n"
"To test this idea, choose a starting shape and a target shape. The starting shape"
" will transform into the target shape while keeping the same statistics.")

def app():
create_text()
start_shapes = ['dino', 'big_slant']
target_shapes = ['x', 'h_lines', 'v_lines', 'wide_lines', 'high_lines', 'slant_up', 'slant_down',
'center', 'star', 'down_parab', 'circle', 'bullseye', 'dots']

put_select(label='Start Shape', name='start_shape', options=start_shapes)
put_select(label='Target Shape', name='target', options=target_shapes)
while True:
Expand Down
25 changes: 25 additions & 0 deletions applications/same-stats-different-graphs/app_before.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from pywebio.input import *
from pywebio.output import *
from pywebio import pin
from pywebio import start_server
from utils import IMAGE_TO_LINK


def app():
put_markdown("# Can Dinosaur and Circle Have the Same Statistics?")
put_text("If 2 datasets have the same statistics, they should be similar right?"
" Not quite so. Two datasets with the same mean, standard deviation, and correlation "
"could be very different.\n\n"
"To test this idea, choose a starting shape and a target shape. The starting shape"
" will transform into the target shape while keeping the same statistics.")

start_shapes = ['dino', 'big_slant']
target_shapes = ['x', 'h_lines', 'v_lines', 'wide_lines', 'high_lines', 'slant_up', 'slant_down',
'center', 'star', 'down_parab', 'circle', 'bullseye', 'dots']

start_shape = select(label='start_shape', options=start_shapes)
target = select(label='target', options=target_shapes)
put_image(IMAGE_TO_LINK[f'{start_shape}_{target}.gif'])

if __name__ == '__main__':
start_server(app, debug=True, port='44315')
Loading

0 comments on commit 49b9b7c

Please sign in to comment.