def detour_info(self):
        """Retrieves the detour information of the incident/incidents from
        the output response

        Returns:
            detour_info(namedtuple): List of named tuples of detour info of
            the incident/incidents
        """
        resource_list = self.traffic_incident()
        detour_info = namedtuple('detour_info', 'detour_info')
        if len(resource_list) == 1 and resource_list[0] is None:
            return None
        else:
            try:
                return [detour_info(resource['detour'])
                        for resource in resource_list]
            except (KeyError, TypeError):
                try:
                    return [detour_info(resource['detourInfo'])
                            for resource in resource_list]
                except KeyError:
                    return None
def detour_info ( self ) : resource_list = self . traffic_incident ( ) detour_info = namedtuple ( 'detour_info' , 'detour_info' ) if len ( resource_list ) == 1 and resource_list [ 0 ] is None : return None else : try : return [ detour_info ( resource [ 'detour' ] ) for resource in resource_list ] except ( KeyError , TypeError ) : try : return [ detour_info ( resource [ 'detourInfo' ] ) for resource in resource_list ] except KeyError : return None
Retrieves the detour information of the incident/incidents from
        the output response

        Returns:
            detour_info(namedtuple): List of named tuples of detour info of
            the incident/incidents