nodes: 0, module; 1, function_definition; 2, function_name:list_assignment_groups; 3, parameters; 4, block; 5, identifier:self; 6, identifier:course_id; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, expression_statement; 13, expression_statement; 14, expression_statement; 15, expression_statement; 16, comment:# REQUIRED - PATH - course_id; 17, expression_statement; 18, expression_statement; 19, comment:# OPTIONAL - include; 20, expression_statement; 21, if_statement; 22, comment:# OPTIONAL - exclude_assignment_submission_types; 23, expression_statement; 24, if_statement; 25, comment:# OPTIONAL - override_assignment_dates; 26, expression_statement; 27, if_statement; 28, comment:# OPTIONAL - grading_period_id; 29, expression_statement; 30, if_statement; 31, comment:# OPTIONAL - scope_assignments_to_student; 32, expression_statement; 33, if_statement; 34, expression_statement; 35, return_statement; 36, identifier:exclude_assignment_submission_types; 37, None; 38, identifier:grading_period_id; 39, None; 40, identifier:include; 41, None; 42, identifier:override_assignment_dates; 43, None; 44, identifier:scope_assignments_to_student; 45, None; 46, comment:"""
          List assignment groups.
  
          Returns the list of assignment groups for the current context. The returned
          groups are sorted by their position field.
          """; 47, assignment; 48, assignment; 49, assignment; 50, comment:"""ID"""; 51, assignment; 52, comment:"""Associations to include with the group. "discussion_topic", "all_dates"
          "assignment_visibility" & "submission" are only valid are only valid if "assignments" is also included.
          The "assignment_visibility" option additionally requires that the Differentiated Assignments course feature be turned on."""; 53, comparison_operator:include is not None; 54, block; 55, comment:"""If "assignments" are included, those with the specified submission types
          will be excluded from the assignment groups."""; 56, comparison_operator:exclude_assignment_submission_types is not None; 57, block; 58, comment:"""Apply assignment overrides for each assignment, defaults to true."""; 59, comparison_operator:override_assignment_dates is not None; 60, block; 61, comment:"""The id of the grading period in which assignment groups are being requested
          (Requires the Multiple Grading Periods feature turned on.)"""; 62, comparison_operator:grading_period_id is not None; 63, block; 64, comment:"""If true, all assignments returned will apply to the current user in the
          specified grading period. If assignments apply to other students in the
          specified grading period, but not the current user, they will not be
          returned. (Requires the grading_period_id argument and the Multiple Grading
          Periods feature turned on. In addition, the current user must be a student.)"""; 65, comparison_operator:scope_assignments_to_student is not None; 66, block; 67, call; 68, call; 69, identifier:path; 70, dictionary; 71, identifier:data; 72, dictionary; 73, identifier:params; 74, dictionary; 75, subscript; 76, identifier:course_id; 77, identifier:include; 78, None; 79, expression_statement; 80, expression_statement; 81, identifier:exclude_assignment_submission_types; 82, None; 83, expression_statement; 84, expression_statement; 85, identifier:override_assignment_dates; 86, None; 87, expression_statement; 88, identifier:grading_period_id; 89, None; 90, expression_statement; 91, identifier:scope_assignments_to_student; 92, None; 93, expression_statement; 94, attribute; 95, argument_list; 96, attribute; 97, argument_list; 98, identifier:path; 99, string:"course_id"; 100, call; 101, assignment; 102, call; 103, assignment; 104, assignment; 105, assignment; 106, assignment; 107, attribute; 108, identifier:debug; 109, call; 110, identifier:self; 111, identifier:generic_request; 112, string:"GET"; 113, call; 114, keyword_argument; 115, keyword_argument; 116, keyword_argument; 117, attribute; 118, argument_list; 119, subscript; 120, identifier:include; 121, attribute; 122, argument_list; 123, subscript; 124, identifier:exclude_assignment_submission_types; 125, subscript; 126, identifier:override_assignment_dates; 127, subscript; 128, identifier:grading_period_id; 129, subscript; 130, identifier:scope_assignments_to_student; 131, identifier:self; 132, identifier:logger; 133, attribute; 134, argument_list; 135, attribute; 136, argument_list; 137, identifier:data; 138, identifier:data; 139, identifier:params; 140, identifier:params; 141, identifier:all_pages; 142, True; 143, identifier:self; 144, identifier:_validate_enum; 145, identifier:include; 146, list; 147, identifier:params; 148, string:"include"; 149, identifier:self; 150, identifier:_validate_enum; 151, identifier:exclude_assignment_submission_types; 152, list; 153, identifier:params; 154, string:"exclude_assignment_submission_types"; 155, identifier:params; 156, string:"override_assignment_dates"; 157, identifier:params; 158, string:"grading_period_id"; 159, identifier:params; 160, string:"scope_assignments_to_student"; 161, string:"GET /api/v1/courses/{course_id}/assignment_groups with query params: {params} and form data: {data}"; 162, identifier:format; 163, keyword_argument; 164, keyword_argument; 165, dictionary_splat; 166, string:"/api/v1/courses/{course_id}/assignment_groups"; 167, identifier:format; 168, dictionary_splat; 169, string:"assignments"; 170, string:"discussion_topic"; 171, string:"all_dates"; 172, string:"assignment_visibility"; 173, string:"overrides"; 174, string:"submission"; 175, string:"online_quiz"; 176, string:"discussion_topic"; 177, string:"wiki_page"; 178, string:"external_tool"; 179, identifier:params; 180, identifier:params; 181, identifier:data; 182, identifier:data; 183, identifier:path; 184, identifier:path
code: def list_assignment_groups(self, course_id, exclude_assignment_submission_types=None, grading_period_id=None, include=None, override_assignment_dates=None, scope_assignments_to_student=None):
          """
          List assignment groups.
  
          Returns the list of assignment groups for the current context. The returned
          groups are sorted by their position field.
          """
          path = {}
          data = {}
          params = {}
  
          # REQUIRED - PATH - course_id
          """ID"""
          path["course_id"] = course_id
  
          # OPTIONAL - include
          """Associations to include with the group. "discussion_topic", "all_dates"
          "assignment_visibility" & "submission" are only valid are only valid if "assignments" is also included.
          The "assignment_visibility" option additionally requires that the Differentiated Assignments course feature be turned on."""
          if include is not None:
              self._validate_enum(include, ["assignments", "discussion_topic", "all_dates", "assignment_visibility", "overrides", "submission"])
              params["include"] = include
  
          # OPTIONAL - exclude_assignment_submission_types
          """If "assignments" are included, those with the specified submission types
          will be excluded from the assignment groups."""
          if exclude_assignment_submission_types is not None:
              self._validate_enum(exclude_assignment_submission_types, ["online_quiz", "discussion_topic", "wiki_page", "external_tool"])
              params["exclude_assignment_submission_types"] = exclude_assignment_submission_types
  
          # OPTIONAL - override_assignment_dates
          """Apply assignment overrides for each assignment, defaults to true."""
          if override_assignment_dates is not None:
              params["override_assignment_dates"] = override_assignment_dates
  
          # OPTIONAL - grading_period_id
          """The id of the grading period in which assignment groups are being requested
          (Requires the Multiple Grading Periods feature turned on.)"""
          if grading_period_id is not None:
              params["grading_period_id"] = grading_period_id
  
          # OPTIONAL - scope_assignments_to_student
          """If true, all assignments returned will apply to the current user in the
          specified grading period. If assignments apply to other students in the
          specified grading period, but not the current user, they will not be
          returned. (Requires the grading_period_id argument and the Multiple Grading
          Periods feature turned on. In addition, the current user must be a student.)"""
          if scope_assignments_to_student is not None:
              params["scope_assignments_to_student"] = scope_assignments_to_student
  
          self.logger.debug("GET /api/v1/courses/{course_id}/assignment_groups with query params: {params} and form data: {data}".format(params=params, data=data, **path))
          return self.generic_request("GET", "/api/v1/courses/{course_id}/assignment_groups".format(**path), data=data, params=params, all_pages=True)