def initWithComplexQuery(query):
        """
        create a query using a complex event query
        """
        q = QueryEvents()
        # provided an instance of ComplexEventQuery
        if isinstance(query, ComplexEventQuery):
            q._setVal("query", json.dumps(query.getQuery()))
        # provided query as a string containing the json object
        elif isinstance(query, six.string_types):
            foo = json.loads(query)
            q._setVal("query", query)
        # provided query as a python dict
        elif isinstance(query, dict):
            q._setVal("query", json.dumps(query))
        # unrecognized value provided
        else:
            assert False, "The instance of query parameter was not a ComplexEventQuery, a string or a python dict"
        return q
def initWithComplexQuery ( query ) : q = QueryEvents ( ) if isinstance ( query , ComplexEventQuery ) : q . _setVal ( "query" , json . dumps ( query . getQuery ( ) ) ) elif isinstance ( query , six . string_types ) : foo = json . loads ( query ) q . _setVal ( "query" , query ) elif isinstance ( query , dict ) : q . _setVal ( "query" , json . dumps ( query ) ) else : assert False , "The instance of query parameter was not a ComplexEventQuery, a string or a python dict" return q
create a query using a complex event query