def _namespace_to_ord(namespace):
  """Converts a namespace string into an int representing its lexographic order.

  >>> _namespace_to_ord('')
  ''
  >>> _namespace_to_ord('_')
  1
  >>> _namespace_to_ord('__')
  2

  Args:
    namespace: A namespace string.

  Returns:
    An int representing the lexographical order of the given namespace string.
  """
  n = 0
  for i, c in enumerate(namespace):
    n += (_LEX_DISTANCE[i- 1 - MAX_NAMESPACE_LENGTH] *
          NAMESPACE_CHARACTERS.index(c)
          + 1)
  return n
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/ext/mapreduce/namespace_range.py/_namespace_to_ord/swapped operands of `-`