def _prepare_params(dirty_params, prefix=None):
params = {}<EOL>for k, v in dirty_params.items():<EOL><INDENT>if hasattr(v, "<STR_LIT>"):<EOL><INDENT>v = v.isoformat()<EOL><DEDENT>elif isinstance(v, bool):<EOL><INDENT>v = str(v).lower()<EOL><DEDENT>if prefix:<EOL><INDENT>params["<STR_LIT>" % (prefix, k)] = v<EOL><DEDENT>else:<EOL><INDENT>params[k] = v<EOL><DEDENT><DEDENT>return params<EOL>
Prepares parameters to be sent to challonge.com.

    The `prefix` can be used to convert parameters with keys that
    look like ("name", "url", "tournament_type") into something like
    ("tournament[name]", "tournament[url]", "tournament[tournament_type]"),
    which is how challonge.com expects parameters describing specific
    objects.