This file contains 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 json | |
def to_json(dictionary, filename): | |
with open(filename,'w') as fp: | |
json.dump(dictionary, fp,sort_keys=True, indent=4,ensure_ascii=False) |
This file contains 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
from matplotlib import font_manager, rc | |
font_name = font_manager.FontProperties(fname="c:/Windows/Fonts/malgun.ttf").get_name() | |
rc('font', family=font_name) |
This file contains 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 os | |
def get_file_from_desktop(filename): | |
filepath = os.path.expanduser('~/Desktop') | |
fullpath = get_file(filepath,filename) | |
return fullpath | |
This file contains 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
from setuptools import setup, find_packages | |
setup( | |
name = 'ccpy', | |
version = '0.1', | |
description = 'ccpy', | |
author = 'jeakwon', | |
author_email = 'onlytojay@gmail.com', | |
url = 'https://github.com/jeakwon/ccpy', | |
download_url = 'https://github.com/jeakwon/ccpy/archive/0.0.tar.gz', |
This file contains 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
[metadata] | |
description-file = README.md |
This file contains 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 numpy as np | |
arr = np.array([ | |
[1,2], | |
[3,4], | |
]) | |
print(arr) |
This file contains 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
from setuptools import setup, find_packages | |
with open('README.md', encoding='utf-8') as f: | |
long_description = f.read() | |
setup( | |
name = 'ypcc', | |
version = '0.6.6', | |
long_description = long_description, | |
long_description_content_type='text/markdown', | |
description = 'ccpy', |
This file contains 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
# -*- coding: utf-8 -*- | |
import logging.handlers | |
class Setting: | |
"""로거 세팅 클래스 | |
:: | |
Setting.LEVEL = logging.INFO # INFO 이상만 로그를 작성 | |
""" |
This file contains 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
def runtime(func): | |
@wraps(func) | |
def decorated(*args, **kwargs): | |
# Decorate front of func | |
before = time.time() | |
output = func(*args, **kwargs) | |
# Decorate back of func | |
after = time.time() |
This file contains 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 os | |
os.environ["GOOGLE_APPLICATION_CREDENTIALS"]="<credential_file>.json" | |
def transcribe_gcs_with_word_time_offsets(gcs_uri): | |
"""Transcribe the given audio file asynchronously and output the word time | |
offsets.""" | |
from google.cloud import speech | |
from google.cloud.speech import enums | |
from google.cloud.speech import types | |
client = speech.SpeechClient() |
OlderNewer