def ToScatteredId(v):
 if (v >= _MAX_SCATTERED_COUNTER):
  raise datastore_errors.BadArgumentError(('counter value too large (%d)' % v))
 return ((_MAX_SEQUENTIAL_ID + 1) + long(ReverseBitsInt64((v << _SCATTER_SHIFT))))

def ToScatteredId ( v ) : if ( v >= _MAX_SCATTERED_COUNTER ) : raise datastore_errors . BadArgumentError ( ( 'counter value too large (%d)' % v ) ) return ( ( _MAX_SEQUENTIAL_ID + 1 ) + long ( ReverseBitsInt64 ( ( v << _SCATTER_SHIFT ) ) ) )
map counter value v to the scattered id space .