def split_filter_op(expression):
 (left, sep, right) = expression.partition(':')
 if sep:
  try:
   timeutils.parse_isotime(expression)
   op = 'eq'
   threshold = expression
  except ValueError:
   op = left
   threshold = right
 else:
  op = 'eq'
  threshold = left
 return (op, threshold)

def split_filter_op ( expression ) : ( left , sep , right ) = expression . partition ( ':' ) if sep : try : timeutils . parse_isotime ( expression ) op = 'eq' threshold = expression except ValueError : op = left threshold = right else : op = 'eq' threshold = left return ( op , threshold )
split operator from threshold in an expression .