def encode_params(params_dict):
 encoded = [(smart_str(k), smart_str(v)) for (k, v) in params_dict.items()]
 encoded_dict = dict(encoded)
 return encoded_dict

def encode_params ( params_dict ) : encoded = [ ( smart_str ( k ) , smart_str ( v ) ) for ( k , v ) in params_dict . items ( ) ] encoded_dict = dict ( encoded ) return encoded_dict
take the dictionary of params and encode keys and values to ascii if its unicode .