data_gen_api.py 文件源码

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

项目:raw-data-repository 作者: all-of-us 项目源码 文件源码
def post(self):
    resource = request.get_data()
    resource_json = json.loads(resource)
    num_participants = int(resource_json.get('num_participants', 0))
    include_physical_measurements = bool(resource_json.get('include_physical_measurements', False))
    include_biobank_orders = bool(resource_json.get('include_biobank_orders', False))
    requested_hpo = resource_json.get('hpo', None)
    if num_participants > 0:
      participant_generator = FakeParticipantGenerator(InProcessClient())
      for _ in range(0, num_participants):
        participant_generator.generate_participant(include_physical_measurements,
                                                   include_biobank_orders,
                                                   requested_hpo)
    if resource_json.get('create_biobank_samples'):
      deferred.defer(
          generate_samples,
          resource_json.get('samples_missing_fraction', _SAMPLES_MISSING_FRACTION))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号