<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _Comparator(self, operator):
 """Generate lambdas for uid and gid comparison."""

    if operator == "=":
      return lambda x, y: x == y
    elif operator == ">=":
      return lambda x, y: x >= y
    elif operator == ">":
      return lambda x, y: x > y
    elif operator == "<=":
      return lambda x, y: x <= y
    elif operator == "<":
      return lambda x, y: x < y
    elif operator == "!":
      return lambda x, y: x != y
    raise DefinitionError("Invalid comparison operator %s" % operator)