def _ValidateClientId(client_id):
 if (not isinstance(client_id, basestring)):
  raise InvalidChannelClientIdError(('"%s" is not a string.' % client_id))
 if isinstance(client_id, unicode):
  client_id = client_id.encode('utf-8')
 if (len(client_id) > MAXIMUM_CLIENT_ID_LENGTH):
  msg = ('Client id length %d is greater than max length %d' % (len(client_id), MAXIMUM_CLIENT_ID_LENGTH))
  raise InvalidChannelClientIdError(msg)
 return client_id

def _ValidateClientId ( client_id ) : if ( not isinstance ( client_id , basestring ) ) : raise InvalidChannelClientIdError ( ( '"%s" is not a string.' % client_id ) ) if isinstance ( client_id , unicode ) : client_id = client_id . encode ( 'utf-8' ) if ( len ( client_id ) > MAXIMUM_CLIENT_ID_LENGTH ) : msg = ( 'Client id length %d is greater than max length %d' % ( len ( client_id ) , MAXIMUM_CLIENT_ID_LENGTH ) ) raise InvalidChannelClientIdError ( msg ) return client_id
validates a client id .