def parse_rev_range(rev_str):
  '''Parse a revision or revision range of the form xxx or xxx:yyy or xxx: or :yyy.'''
  l = [s.strip() for s in rev_str.split(":")]
  if len(l) == 2:
    return (l[0] if l[0] else None, l[1] if l[1] else None)
  elif len(l) == 1:
    return (l[0], None)
  else:
    raise InvalidArgument("invalid revision range: '%s'" % rev_str)
dataset/ETHPy150Open bloomreach/zinc/zinc.py/parse_rev_range/original