def _validate_encode_value(value, do_pickle):
  flags = 0
  stored_value = value

  if isinstance(value, str):
    pass
  elif isinstance(value, unicode):
    stored_value = value.encode('utf-8')
    flags |= TYPE_UNICODE
  elif isinstance(value, bool):


    stored_value = str(int(value))
    flags |= TYPE_BOOL
  elif isinstance(value, int):
    stored_value = str(value)
    flags |= TYPE_INT
  elif isinstance(value, long):
    stored_value = str(value)
    flags |= TYPE_LONG
  else:
    stored_value = do_pickle(value)
    flags |= TYPE_PICKLED





  if len(stored_value) > MAX_VALUE_SIZE:
    raise ValueError('Values may not be more than %d bytes in length; '
                     'received %d bytes' % (MAX_VALUE_SIZE, len(stored_value)))

  return (stored_value, flags)
Get an storage driver which can be used to create an ``IDeployer``.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/memcache/__init__.py/_validate_encode_value--crossover with--dataset/ETHPy150Open ClusterHQ/flocker/flocker/node/script.py/AgentService.get_api