Can you please write me a python 3 function to read data from a json file and load it into a dictionary? I want the name of the function to be load().
user
A JSON file might contain data that cannot be unambiguously formatted as a Python dictionary.

For example, the contents of a JSON file could be

```json
"foo"
```

or

```json
[1,2,3]
```

Here is a simple function that reads data from a JSON file and returns it as a Python object decoded according to this table: https://docs.python.org/3/library/json.html#json-to-py-table

```python
import json

def load(filename):
    file = open(filename, 'r')
    data = json.load(file)
    file.close()
    return data
```

If you would like for the function to format non-object JSON files as a dictionary, I can give such an example as well, the most simple solution being to wrap the value in a dictionary with a static key.
assistant