52136a7dda72978004f6af8e90e9ebe7596c27b8,examples/misc/image_thumbnail_sgskip.py,,,#,20
Before Change
print("Usage: python %s IMAGEDIR" % __file__)
raise SystemExit
indir = sys.argv[1]
if not os.path.isdir(indir):
print("Could not find input directory "%s"" % indir)
raise SystemExit
outdir = "thumbs"
if not os.path.exists(outdir):
os.makedirs(outdir)
for fname in glob.glob(os.path.join(indir, "*.png")):
basedir, basename = os.path.split(fname)
outfile = os.path.join(outdir, basename)
fig = image.thumbnail(fname, outfile, scale=0.15)
print("saved thumbnail of %s to %s" % (fname, outfile))
After Change
if not args.imagedir.isdir():
sys.exit(f"Could not find input directory {args.imagedir}")
outdir = Path("thumbs")
outdir.mkdir(parents=True, exist_ok=True)
for path in args.imagedir.glob("*.png"):
outpath = outdir / path.name
fig = image.thumbnail(path, outpath, scale=0.15)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: matplotlib/matplotlib
Commit Name: 52136a7dda72978004f6af8e90e9ebe7596c27b8
Time: 2019-11-26
Author: anntzer.lee@gmail.com
File Name: examples/misc/image_thumbnail_sgskip.py
Class Name:
Method Name:
Project Name: matplotlib/matplotlib
Commit Name: 52136a7dda72978004f6af8e90e9ebe7596c27b8
Time: 2019-11-26
Author: anntzer.lee@gmail.com
File Name: examples/misc/image_thumbnail_sgskip.py
Class Name:
Method Name:
Project Name: hyperspy/hyperspy
Commit Name: 629167ee324a0b955ef46cd5a0cd7bb504ef8c44
Time: 2020-09-09
Author: tjof2@cam.ac.uk
File Name: hyperspy/misc/io/tools.py
Class Name:
Method Name: ensure_directory
Project Name: gboeing/osmnx
Commit Name: 58306568739f409d295cdf37bfd38a1ef0de7b3e
Time: 2020-12-04
Author: 6774676+eumiro@users.noreply.github.com
File Name: osmnx/plot.py
Class Name:
Method Name: _save_and_show