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