def _utf8_params(params):
    assert isinstance(params, dict)
    encoded_params = []
    for k, v in params.items():
        if v is None:
            continue
        if isinstance(v, numeric_types):
            v = str(v)
        if isinstance(v, (list, tuple)):
            v = [_utf8(x) for x in v]
        else:
            v = _utf8(v)
        encoded_params.append((k, v))
    return dict(encoded_params)
encode a dictionary of URL parameters (including iterables) as utf-8
dataset/ETHPy150Open bitly/bitly-api-python/bitly_api/bitly_api.py/_utf8_params