nodes: 0, module; 1, function_definition; 2, function_name:get_students; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, expression_statement; 14, comment:# These are parameters required for the remote API call, so; 15, comment:# there aren't too many arguments, or too many variables; 16, comment:# pylint: disable=too-many-arguments,too-many-locals; 17, comment:# Set params by arguments; 18, expression_statement; 19, expression_statement; 20, if_statement; 21, expression_statement; 22, if_statement; 23, return_statement; 24, identifier:gradebook_id; 25, string; 26, identifier:simple; 27, False; 28, identifier:section_name; 29, string; 30, identifier:include_photo; 31, False; 32, identifier:include_grade_info; 33, False; 34, identifier:include_grade_history; 35, False; 36, identifier:include_makeup_grades; 37, False; 38, comment:"""Get students for a gradebook.
  
          Get a list of students for a given gradebook,
          specified by a gradebook id. Does not include grade data.
  
          Args:
              gradebook_id (str): unique identifier for gradebook, i.e. ``2314``
              simple (bool):
                  if ``True``, just return dictionary with keys ``email``,
                  ``name``, ``section``, default = ``False``
              section_name (str): section name
              include_photo (bool): include student photo, default= ``False``
              include_grade_info (bool):
                  include student's grade info, default= ``False``
              include_grade_history (bool):
                  include student's grade history, default= ``False``
              include_makeup_grades (bool):
                  include student's makeup grades, default= ``False``
  
          Raises:
              requests.RequestException: Exception connection error
              ValueError: Unable to decode response content
  
          Returns:
              list: list of student dictionaries
  
          .. code-block:: python
  
              [{
                  u'accountEmail': u'stellar.test2@gmail.com',
                  u'displayName': u'Molly Parker',
                  u'photoUrl': None,
                  u'middleName': None,
                  u'section': u'Unassigned',
                  u'sectionId': 1293925,
                  u'editable': False,
                  u'overallGradeInformation': None,
                  u'studentId': 1145,
                  u'studentAssignmentInfo': None,
                  u'sortableName': u'Parker, Molly',
                  u'surname': u'Parker',
                  u'givenName': u'Molly',
                  u'nickName': u'Molly',
                  u'email': u'stellar.test2@gmail.com'
              },]
  
          """; 39, assignment; 40, assignment; 41, identifier:section_name; 42, block; 43, assignment; 44, identifier:simple; 45, comment:# just return dict with keys email, name, section; 46, block; 47, subscript; 48, identifier:params; 49, call; 50, identifier:url; 51, string; 52, expression_statement; 53, if_statement; 54, expression_statement; 55, identifier:student_data; 56, call; 57, expression_statement; 58, function_definition; 59, return_statement; 60, identifier:student_data; 61, string; 62, identifier:dict; 63, argument_list; 64, string_content:students/{gradebookId}; 65, assignment; 66, comparison_operator:group_id is None; 67, block; 68, augmented_assignment; 69, attribute; 70, argument_list; 71, assignment; 72, function_name:remap; 73, parameters; 74, block; 75, list_comprehension; 76, string_content:data; 77, keyword_argument; 78, keyword_argument; 79, keyword_argument; 80, keyword_argument; 81, pattern_list; 82, call; 83, identifier:group_id; 84, None; 85, expression_statement; 86, expression_statement; 87, raise_statement; 88, identifier:url; 89, call; 90, identifier:self; 91, identifier:get; 92, call; 93, keyword_argument; 94, identifier:student_map; 95, call; 96, identifier:students; 97, expression_statement; 98, expression_statement; 99, comment:# match certs; 100, expression_statement; 101, return_statement; 102, call; 103, for_in_clause; 104, identifier:includePhoto; 105, call; 106, identifier:includeGradeInfo; 107, call; 108, identifier:includeGradeHistory; 109, call; 110, identifier:includeMakeupGrades; 111, call; 112, identifier:group_id; 113, identifier:_; 114, attribute; 115, argument_list; 116, assignment; 117, call; 118, call; 119, attribute; 120, argument_list; 121, attribute; 122, argument_list; 123, identifier:params; 124, identifier:params; 125, identifier:dict; 126, argument_list; 127, comment:"""Convert mit.edu domain to upper-case for student emails.
  
                  The mit.edu domain for user email must be upper-case,
                  i.e. MIT.EDU.
  
                  Args:
                      students (list): list of students
  
                  Returns:
                      dict: dictionary of updated student email domains
                  """; 128, assignment; 129, assignment; 130, identifier:newx; 131, identifier:remap; 132, argument_list; 133, identifier:x; 134, subscript; 135, attribute; 136, argument_list; 137, attribute; 138, argument_list; 139, attribute; 140, argument_list; 141, attribute; 142, argument_list; 143, identifier:self; 144, identifier:get_section_by_name; 145, identifier:section_name; 146, identifier:failure_message; 147, parenthesized_expression; 148, attribute; 149, argument_list; 150, identifier:PyLmodNoSuchSection; 151, argument_list; 152, string; 153, identifier:format; 154, identifier:group_id; 155, identifier:url; 156, identifier:format; 157, keyword_argument; 158, keyword_argument; 159, keyword_argument; 160, keyword_argument; 161, identifier:newx; 162, call; 163, subscript; 164, call; 165, identifier:x; 166, identifier:student_data; 167, string; 168, identifier:json; 169, identifier:dumps; 170, identifier:include_photo; 171, identifier:json; 172, identifier:dumps; 173, identifier:include_grade_info; 174, identifier:json; 175, identifier:dumps; 176, identifier:include_grade_history; 177, identifier:json; 178, identifier:dumps; 179, identifier:include_makeup_grades; 180, binary_operator:'in get_students -- Error: '
                      'No such section %s' % section_name; 181, identifier:log; 182, identifier:critical; 183, identifier:failure_message; 184, identifier:failure_message; 185, string_content:/section/{0}; 186, identifier:gradebookId; 187, boolean_operator; 188, identifier:accountEmail; 189, string; 190, identifier:displayName; 191, string; 192, identifier:section; 193, string; 194, identifier:dict; 195, generator_expression; 196, identifier:newx; 197, string; 198, attribute; 199, argument_list; 200, string_content:data; 201, concatenated_string; 202, identifier:section_name; 203, identifier:gradebook_id; 204, attribute; 205, string_content:email; 206, string_content:name; 207, string_content:section; 208, tuple; 209, for_in_clause; 210, string_content:email; 211, subscript; 212, identifier:replace; 213, string; 214, string; 215, string; 216, string; 217, identifier:self; 218, identifier:gradebook_id; 219, subscript; 220, subscript; 221, identifier:k; 222, identifier:student_map; 223, identifier:newx; 224, string; 225, string_content:@mit.edu; 226, string_content:@MIT.EDU; 227, string_content:in get_students -- Error:; 228, string_content:No such section %s; 229, identifier:student_map; 230, identifier:k; 231, identifier:students; 232, identifier:k; 233, string_content:email
code: def get_students(
              self,
              gradebook_id='',
              simple=False,
              section_name='',
              include_photo=False,
              include_grade_info=False,
              include_grade_history=False,
              include_makeup_grades=False
      ):
          """Get students for a gradebook.
  
          Get a list of students for a given gradebook,
          specified by a gradebook id. Does not include grade data.
  
          Args:
              gradebook_id (str): unique identifier for gradebook, i.e. ``2314``
              simple (bool):
                  if ``True``, just return dictionary with keys ``email``,
                  ``name``, ``section``, default = ``False``
              section_name (str): section name
              include_photo (bool): include student photo, default= ``False``
              include_grade_info (bool):
                  include student's grade info, default= ``False``
              include_grade_history (bool):
                  include student's grade history, default= ``False``
              include_makeup_grades (bool):
                  include student's makeup grades, default= ``False``
  
          Raises:
              requests.RequestException: Exception connection error
              ValueError: Unable to decode response content
  
          Returns:
              list: list of student dictionaries
  
          .. code-block:: python
  
              [{
                  u'accountEmail': u'stellar.test2@gmail.com',
                  u'displayName': u'Molly Parker',
                  u'photoUrl': None,
                  u'middleName': None,
                  u'section': u'Unassigned',
                  u'sectionId': 1293925,
                  u'editable': False,
                  u'overallGradeInformation': None,
                  u'studentId': 1145,
                  u'studentAssignmentInfo': None,
                  u'sortableName': u'Parker, Molly',
                  u'surname': u'Parker',
                  u'givenName': u'Molly',
                  u'nickName': u'Molly',
                  u'email': u'stellar.test2@gmail.com'
              },]
  
          """
          # These are parameters required for the remote API call, so
          # there aren't too many arguments, or too many variables
          # pylint: disable=too-many-arguments,too-many-locals
  
          # Set params by arguments
          params = dict(
              includePhoto=json.dumps(include_photo),
              includeGradeInfo=json.dumps(include_grade_info),
              includeGradeHistory=json.dumps(include_grade_history),
              includeMakeupGrades=json.dumps(include_makeup_grades),
          )
  
          url = 'students/{gradebookId}'
          if section_name:
              group_id, _ = self.get_section_by_name(section_name)
              if group_id is None:
                  failure_message = (
                      'in get_students -- Error: '
                      'No such section %s' % section_name
                  )
                  log.critical(failure_message)
                  raise PyLmodNoSuchSection(failure_message)
              url += '/section/{0}'.format(group_id)
  
          student_data = self.get(
              url.format(
                  gradebookId=gradebook_id or self.gradebook_id
              ),
              params=params,
          )
  
          if simple:
              # just return dict with keys email, name, section
              student_map = dict(
                  accountEmail='email',
                  displayName='name',
                  section='section'
              )
  
              def remap(students):
                  """Convert mit.edu domain to upper-case for student emails.
  
                  The mit.edu domain for user email must be upper-case,
                  i.e. MIT.EDU.
  
                  Args:
                      students (list): list of students
  
                  Returns:
                      dict: dictionary of updated student email domains
                  """
                  newx = dict((student_map[k], students[k]) for k in student_map)
                  # match certs
                  newx['email'] = newx['email'].replace('@mit.edu', '@MIT.EDU')
                  return newx
  
              return [remap(x) for x in student_data['data']]
  
          return student_data['data']