<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def course_blocks(self, course_id, username):
 """ Fetches course blocks. Args: course_id (str):
 An edx course id. username (str):
 username of the user to query for (can reveal hidden modules) Returns: Structure """

        resp = self.requester.get(
            urljoin(self.base_url, '/api/courses/v1/blocks/'),
            params={
                "depth": "all",
                "username": username,
                "course_id": course_id,
                "requested_fields": "children,display_name,id,type,visible_to_staff_only",
            })

        resp.raise_for_status()

        return Structure(resp.json())