def _Encode(self, value):
    """Encode the value for the attribute."""
    try:
      return buffer(value.SerializeToString())
    except __HOLE__:
      if isinstance(value, (int, long)):
        return value
      else:
        # Types "string" and "bytes" are stored as strings here.
        return buffer(utils.SmartStr(value))
dataset/ETHPy150Open google/grr/grr/lib/data_stores/sqlite_data_store.py/SqliteDataStore._Encode