def find_source_bucket_name(opts, source_map):
    source_bucket = getattr(opts, "bucket_source", None)
    if (not source_bucket and
        source_map and
        source_map['buckets'] and
        len(source_map['buckets']) == 1):
        source_bucket = source_map['buckets'][0]['name']
    if not source_bucket:
        return "error: please specify a bucket_source", None
    logging.debug("source_bucket: " + source_bucket)
    return 0, source_bucket
If the caller didn't specify a bucket_source and
dataset/ETHPy150Open membase/membase-cli/pump.py/find_source_bucket_name