def string_b64encode(s):
 return base64.urlsafe_b64encode(s).strip('=')

def string_b64encode ( s ) : return base64 . urlsafe_b64encode ( s ) . strip ( '=' )
this function is useful to convert a string to a valid id to be used in es .