def SetOperator(self, operator):
    self.operator = operator
    # Find the appropriate list of operators for this attribute
    attribute_type = self.attribute_obj.GetRDFValueType()
    operators = attribute_type.operators

    # Do we have such an operator?
    self.number_of_args, self.operator_method = operators.get(
        operator, (0, None))

    if self.operator_method is None:
      raise lexer.ParseError("Operator %s not defined on attribute '%s'" % (
          operator, self.attribute))

    self.operator_method = getattr(attribute_type, self.operator_method)
Sets the operator for this expression.
dataset/ETHPy150Open google/grr/grr/lib/aff4.py/AttributeExpression.SetOperator