@staticmethod
def _pack_params(params):
    """
        Convert query parameters into the canonical format expected by the server.

        :param dict[str, *] params: map from query parameter key to value
        :rtype: list[(str, str)]
        """
    if params is None:
        return None
    result = []
    include = params.pop('include', None)
    if include is not None:
        result.append(('include', ','.join(include)))
    for k, v in (params.items() if isinstance(params, dict) else params):
        if isinstance(v, list):
            for item in map(str, v):
                result.append((k, item))
        elif isinstance(v, bool):
            result.append((k, int(v)))
        else:
            result.append((k, v))
    return result
