I'd rewrite this slightly:

```
If 'csv' is False, returns a dict of student's name: username.

If 'csv' is True, returns a header array, and an array of arrays in the format:
  student names, usernames
for CSV download.
```