docstr: Update range with given unary operation.
  
  >>> import gast as ast
  >>> from pythran import passmanager, backend
  >>> node = ast.parse('''
  ... def foo():
  ...     a = 2
  ...     c = -a
  ...     d = ~a
  ...     f = +a
  ...     e = not a''')
  >>> pm = passmanager.PassManager("test")
  >>> res = pm.gather(RangeValues, node)
  >>> res['f']
  Interval(low=2, high=2)
  >>> res['c']
  Interval(low=-2, high=-2)
  >>> res['d']
  Interval(low=-3, high=-3)
  >>> res['e']
  Interval(low=0, high=1)
docstr_tok: ["Update","range","with","given","unary","operation",".",">",">",">","import","gast","as","ast",">",">",">","from","pythran","import","passmanager",",","backend",">",">",">","node","=","ast.parse","(","``","'","...","def","foo","(",")",":","...","a","=","2","...","c","=","-a","...","d","=","~a","...","f","=","+a","...","e","=","not","a","''","'",")",">",">",">","pm","=","passmanager.PassManager","(","``","test","''",")",">",">",">","res","=","pm.gather","(","RangeValues",",","node",")",">",">",">","res","[","'","f","'","]","Interval","(","low=2",",","high=2",")",">",">",">","res","[","'","c","'","]","Interval","(","low=-2",",","high=-2",")",">",">",">","res","[","'d","'","]","Interval","(","low=-3",",","high=-3",")",">",">",">","res","[","'","e","'","]","Interval","(","low=0",",","high=1",")"]
code: def visit_UnaryOp(self, node):
      """Update range with given unary operation.
  
      >>> import gast as ast
      >>> from pythran import passmanager, backend
      >>> node = ast.parse('''
      ... def foo():
      ...     a = 2
      ...     c = -a
      ...     d = ~a
      ...     f = +a
      ...     e = not a''')
      >>> pm = passmanager.PassManager("test")
      >>> res = pm.gather(RangeValues, node)
      >>> res['f']
      Interval(low=2, high=2)
      >>> res['c']
      Interval(low=-2, high=-2)
      >>> res['d']
      Interval(low=-3, high=-3)
      >>> res['e']
      Interval(low=0, high=1)
      """
      res = self.visit(node.operand)
      if isinstance(node.op, ast.Not):
          res = Interval(0, 1)
      elif (
          isinstance(node.op, ast.Invert)
          and isinstance(res.high, int)
          and isinstance(res.low, int)
      ):
          res = Interval(~res.high, ~res.low)
      elif isinstance(node.op, ast.UAdd):
          pass
      elif isinstance(node.op, ast.USub):
          res = Interval(-res.high, -res.low)
      else:
          res = UNKNOWN_RANGE
      return self.add(node, res)
  
imports: import gast
  from collections import defaultdict
  from functools import reduce
  from pythran.analyses import Aliases, CFG
  from pythran.intrinsic import Intrinsic
  from pythran.passmanager import ModuleAnalysis
  from pythran.interval import Interval, IntervalTuple, UNKNOWN_RANGE
  from pythran.tables import MODULES, attributes
label_desc: Use image node_id 7 for calling the RangeValuesBase obj's underlying member method code with example usage: obj.visit_UnaryOp(node) and returns: self