def smugup(opts, args):
    albumId = opts.album
    if "_" in albumId:
        albumId, albumKey = albumId.split("_")
    logger.info("using album %s", albumId)

    # login
    m = pysmug.login()

    filenames = set()
    if not opts.overwrite:
        # get the current filenames
        images = m.images_get(albumId=albumId, albumKey=albumKey, heavy=True)
        [filenames.add(x["FileName"]) for x in images["Album"]["Images"]]

    # check for files to upload
    n = 0
    b = m.batch()
    b.concurrent = 2
    for arg in args:
        basename = os.path.basename(arg)
        if basename in filenames:
            logger.warning("skipping %s", arg)
            continue
        n += 1
        logger.info("uploading %s", arg)
        b.images_upload(albumId=albumId, filename=arg)

    # upload
    logger.info("uploading %d files", n)
    for i, (params, result) in enumerate(b()):
        logger.info("uploaded (%d/%d) %s", i, n, result)
dataset/ETHPy150Open bzimmer/pysmug/pysmug/smugup.py/smugup/original