#NEWLINE# def from_args( scope , metrics , start , stop , days , limit , dimensions , filter , segment , **description ) : #NEWLINE# #INDENT# if limit : #NEWLINE# #INDENT# limit = list ( map ( int , limit . split ( ',' ) ) ) #NEWLINE# #UNINDENT# description . update ( { #NEWLINE# #INDENT# 'range' : { #NEWLINE# #INDENT# 'start' : start , #NEWLINE# 'stop' : stop , #NEWLINE# 'days' : days , #NEWLINE# #UNINDENT# } , #NEWLINE# 'metrics' : utils . cut ( metrics , ',' ) , #NEWLINE# 'limit' : limit , #NEWLINE# #UNINDENT# } ) #NEWLINE# if dimensions : #NEWLINE# #INDENT# description [ 'dimensions' ] = utils . cut ( dimensions , ',' ) #NEWLINE# #UNINDENT# query = ga . query . describe ( scope , description ) #NEWLINE# for f in filter : #NEWLINE# #INDENT# query = ga . query . refine ( query , { #NEWLINE# #INDENT# 'filter' : dict ( utils . cut ( f , '=' , ',' ) ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# for s in segment : #NEWLINE# #INDENT# query = ga . query . refine ( query , { #NEWLINE# #INDENT# 'segment' : dict ( utils . cut ( s , '=' , ',' ) ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return [ query ]