def Serialize(obj):
  """Return a binary serialized version of object.

  Depending on the serialization method, some complex objects or input
  formats may not be serializable.

  UTF-8 strings (by themselves or in other structures e.g. lists) are always
  supported.

  Args:
    obj: any object
  Returns:
    str, possibly containing ascii values >127
  Raises:
    SerializeError: if an error occured during serialization
  """
  try:
    return json.dumps(obj)
  except __HOLE__ as e:
    raise SerializeError(e)
dataset/ETHPy150Open google/simian/src/simian/mac/common/util.py/Serialize