本文整理匯總了Python中weblab.data.experiments.ExperimentUsage.experiment_use_id方法的典型用法代碼示例。如果您正苦於以下問題:Python ExperimentUsage.experiment_use_id方法的具體用法?Python ExperimentUsage.experiment_use_id怎麽用?Python ExperimentUsage.experiment_use_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類weblab.data.experiments.ExperimentUsage
的用法示例。
在下文中一共展示了ExperimentUsage.experiment_use_id方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: to_business_light
# 需要導入模塊: from weblab.data.experiments import ExperimentUsage [as 別名]
# 或者: from weblab.data.experiments.ExperimentUsage import experiment_use_id [as 別名]
def to_business_light(self):
usage = ExperimentUsage()
usage.experiment_use_id = self.id
usage.start_date = _splitted_utc_datetime_to_timestamp(self.start_date, self.start_date_micro)
usage.end_date = _splitted_utc_datetime_to_timestamp(self.end_date, self.end_date_micro)
usage.from_ip = self.origin
usage.reservation_id = self.reservation_id
usage.experiment_id = ExperimentId(self.experiment.name, self.experiment.category.name)
usage.coord_address = CoordAddress.translate(self.coord_address)
request_info = {}
for prop in self.properties:
name = prop.property_name.name
value = prop.value
request_info[name] = value
usage.request_info = request_info
return usage