$ ls -l `brew --prefix`/share/zsh/site-functions/で _git と git-completion.bash が表示されていることを確認する。
| import csv | |
| import os | |
| from pathlib import Path | |
| import cv2 | |
| import numpy as np | |
| from PIL import Image | |
| import onnxruntime as ort | |
| from huggingface_hub import hf_hub_download |
| { | |
| "genres": [ | |
| "acoustic", | |
| "afrobeat", | |
| "alt-rock", | |
| "alternative", | |
| "ambient", | |
| "anime", | |
| "black-metal", | |
| "bluegrass", |
http://nao-y.hatenablog.com/entry/2018/08/01/231336 のコードではまった原因
Pythonでは import したモジュールはキャッシュされ、もう一度 import してもインポート処理は省略され、キャッシュが使われる
import_module 関数を使っても import 文を使っても、 fortune.py は1回しか実行されないreload を使っているこのgistのテストコードでは、patchデコレータの引数を変えた版を用意した(test2.py)。
また、テストメソッドにはmock後のオブジェクトが渡されるため、引数に m を受け取るようにした。
著者: 青い鴉(ぶるくろ)さん @bluecrow2
これは結城浩さんの運用されていた YukiWiki に当時 Coffee 様 (青い鴉(ぶるくろ)さん)がかかれていた文章です。 ただ 2018 年 3 月 7 日に YukiWiki が運用停止したため消えてしまいました。その記事のバックアップです。
今は 404 ですが、もともとの記事の URL は http://www.hyuki.com/yukiwiki/wiki.cgi?%A5%C7%A5%B9%A5%DE%A1%BC%A5%C1%A4%AC%B5%AF%A4%AD%A4%EB%CD%FD%CD%B3 になります。
昔、自分がとても感銘を受けた文章なので、このまま読めなくなるのはとてももったいないと思い、バックアップとして公開しています。
| from bs4 import BeautifulSoup | |
| from markdown import markdown | |
| import re | |
| def markdown_to_text(markdown_string): | |
| """ Converts a markdown string to plaintext """ | |
| # md -> html -> text since BeautifulSoup can extract text cleanly | |
| html = markdown(markdown_string) |
| [ | |
| { | |
| "timezones": [ | |
| "America/Aruba" | |
| ], | |
| "latlng": [ | |
| 12.5, | |
| -69.96666666 | |
| ], | |
| "name": "Aruba", |
| { | |
| "text": "RT @PostGradProblem: In preparation for the NFL lockout, I will be spending twice as much time analyzing my fantasy baseball team during ...", | |
| "truncated": true, | |
| "in_reply_to_user_id": null, | |
| "in_reply_to_status_id": null, | |
| "favorited": false, | |
| "source": "<a href=\"http://twitter.com/\" rel=\"nofollow\">Twitter for iPhone</a>", | |
| "in_reply_to_screen_name": null, | |
| "in_reply_to_status_id_str": null, | |
| "id_str": "54691802283900928", |