Skip to content

Instantly share code, notes, and snippets.

Kangwon Lee (Education) kangwonlee

  • Mechanical Engineering, Korea Polytechnic University
  • SiHeung, Kyung Gi Do, Republic of Korea
View GitHub Profile
@kangwonlee
kangwonlee / get_parser_cv_conf_paper.py
Last active Mar 6, 2017
CV (Curriculum Vitae) conference paper entry parser in regular expression
View get_parser_cv_conf_paper.py
"""
This is an attempt to automate extracting some fields from an entry of Curriculum Vitae on a conference publication.
For more about regular expression, please refer to https://docs.python.org/library/re.html.
"""
import re
def get_parser_cv_conf_paper():
return re.compile(
r'(?P<paper_number>\(\d+\))[.,]?\s*(?P<authors>.+?)\s*[,:;]?\s*["“](?P<paper_title>.+?)["“”],?\s*(?P<conference_info>.+)')
@kangwonlee
kangwonlee / unpack_ipynb.py
Created Mar 8, 2017
Unpack iPython notebook
View unpack_ipynb.py
'''unpack ipynb'''
import os
from pprint import pprint
import re
import sys
def dont_do_anything(fw, cell_dict):
print "won't do anything about", cell_dict["cell_type"]
print cell_dict
@kangwonlee
kangwonlee / ipynb_remove_output.py
Created Aug 13, 2017
remove ipython outputs and execution numbers
View ipynb_remove_output.py
"""
Jupyter notebook could be good for educational purpose.
Before release in class, output generated during testing and execution number need to be removed.
"""
import os
import sys
import nbformat
@kangwonlee
kangwonlee / unittest_commit_range.py
Created Dec 2, 2017
Run unittest over a range of commits
View unittest_commit_range.py
import subprocess
import sys
def generate_commit(data_txt):
for line in data_txt.splitlines():
yield line.split()[0]
def main(git_path, start_commit, end_commit, python_path, unittest_file_path):
View unique_or.py
"""
To augment lines of a text file with an 'OR' logical operator
How to use:
1. Prepare a .txt file with line items to combine with 'OR'
2. Use the file name as argument for the script
3. This script would generate a text
"""
You can’t perform that action at this time.