本文整理汇总了Python中backend.Backend.get_events_raw方法的典型用法代码示例。如果您正苦于以下问题:Python Backend.get_events_raw方法的具体用法?Python Backend.get_events_raw怎么用?Python Backend.get_events_raw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类backend.Backend
的用法示例。
在下文中一共展示了Backend.get_events_raw方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: events_vimeo_analytics
# 需要导入模块: from backend import Backend [as 别名]
# 或者: from backend.Backend import get_events_raw [as 别名]
def events_vimeo_analytics():
#
# we should be aware that engineering events get submitted through various
# means (incl scripts), so if category is not set, but expected FX is, we
# count those as engineering
backend = Backend()
events = []
query = {
"query_string": {
"fields": ["category"],
"query": "*"
}
}
for event in backend.get_events_raw(query):
desc = event['desc'].replace("\n", ' ').replace("\r", ' ').strip()
tags = '-'.join(event['tags'])
expected_effect = event.get('expected_effect', '')
if type(expected_effect) is list:
expected_effect = '-'.join(expected_effect)
known_effect = event.get('known_effect', '')
event = [event['id'], event['date'], desc, tags, event['category'], expected_effect, known_effect]
events.append(event)
return events