import _ast


def UnaryOpMap(operator):
  """Maps operator strings for unary operations to their _ast node."""
  op_dict = {
      '+': _ast.UAdd,
      '-': _ast.USub,
      'not': _ast.Not,
      '~': _ast.Invert,
  }

  return op_dict[operator]()