<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def format(item, **params):
 """Truns a python object into a JSON structure."""

    encoding = params.get('charset', 'UTF-8')
    return json.dumps(item, encoding=encoding)