def get_section_by_name(self, section_name):
        """Get a section by its name.

        Get a list of sections for a given gradebook,
        specified by a gradebookid.

        Args:
            section_name (str): The section's name.

        Raises:
            requests.RequestException: Exception connection error
            ValueError: Unable to decode response content

        Returns:
            tuple: tuple of group id, and section dictionary

            An example return value is:

            .. code-block:: python

                (
                    1327565,
                    {
                        u'editable': True,
                        u'groupId': 1327565,
                        u'groupingScheme': u'Recitation',
                        u'members': None,
                        u'name': u'r01',
                        u'shortName': u'r01',
                        u'staffs': None
                    }
                )

        """
        sections = self.unravel_sections(self.get_sections())
        for section in sections:
            if section['name'] == section_name:
                return section['groupId'], section
        return None, None
def get_section_by_name ( self , section_name ) : sections = self . unravel_sections ( self . get_sections ( ) ) for section in sections : if section [ 'name' ] == section_name : return section [ 'groupId' ] , section return None , None
Get a section by its name.

        Get a list of sections for a given gradebook,
        specified by a gradebookid.

        Args:
            section_name (str): The section's name.

        Raises:
            requests.RequestException: Exception connection error
            ValueError: Unable to decode response content

        Returns:
            tuple: tuple of group id, and section dictionary

            An example return value is:

            .. code-block:: python

                (
                    1327565,
                    {
                        u'editable': True,
                        u'groupId': 1327565,
                        u'groupingScheme': u'Recitation',
                        u'members': None,
                        u'name': u'r01',
                        u'shortName': u'r01',
                        u'staffs': None
                    }
                )