def _GetValueAndType(self, key):
    """Fetch value from memcache and detect its type.

    Args:
      key: String

    Returns:
      (value, type), value is a Python object or None if the key was not set in
      the cache, type is a string describing the type of the value.
    """
    try:
      value = memcache.get(key)
    except (pickle.UnpicklingError, AttributeError, EOFError, ImportError,
            IndexError), e:
      msg = e % 'Failed to retrieve value from cache: %s'
      return msg, 'error'

    if value is None:
      return None, self.DEFAULT_TYPESTR_FOR_NEW

    for typeobj, _, typestr in self.TYPES:
      if isinstance(value, typeobj):
        break
    else:
      typestr = 'pickled'
      value = pprint.pformat(value, indent=2)

    return value, typestr
dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/google/appengine/ext/admin/__init__.py/MemcachePageHandler._GetValueAndType/swapped operands of `%`