submit_download_job.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:Falco 作者: VCCRI 项目源码 文件源码
def set_mapper_number(manifest_file):
    accession_counts = 0

    if manifest_file.startswith("s3://"):
        s3_client = boto3.resource("s3")

        bucket_name, key_prefix = manifest_file.strip().strip("/")[5:].split("/", 1)

        with tempfile.TemporaryDirectory() as tmpdirname:
            s3_client.Object(bucket_name, key_prefix).download_file(tmpdirname+"/manifest")

            for line in open(tmpdirname+"/manifest"):
                accession_counts += 1
    else:
        for line in open(manifest_file):
            accession_counts += 1

    return accession_counts
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号