def _ValidateClientId(client_id):
  if isinstance(client_id, unicode):
    client_id = client_id.encode('utf-8')
  elif not isinstance(client_id, str):
    raise InvalidChannelClientIdError

  if len(client_id) > MAXIMUM_CLIENT_ID_LENGTH:
    raise InvalidChannelClientIdError

  return client_id
Validates a client id.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/channel/channel.py/_ValidateClientId