This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
from pathlib import Path | |
def clean_html_nb_cells( | |
content: str, start_pattern: str, end_pattern: str | |
) -> str: | |
while start_pattern in content: | |
start_ix = content.find(start_pattern) | |
end_ix = start_ix + content[start_ix:].find(end_pattern) | |
new_content = content[:start_ix] + content[end_ix:] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from functools import wraps | |
from math import trunc | |
def timer(text=''): | |
"""Decorator, prints execution time of the function decorated. | |
Args: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import email | |
import warnings | |
import pandas as pd | |
from bs4 import BeautifulSoup | |
def parse_body(message): | |
"""Parses text body from email message object with BeautifulSoup. |