nodes: 0, module; 1, function_definition; 2, function_name:get_default_base_name; 3, parameters; 4, block; 5, identifier:self; 6, identifier:viewset; 7, expression_statement; 8, expression_statement; 9, if_statement; 10, return_statement; 11, comment:"""
          Attempt to automatically determine base name using `get_url_name`.
          """; 12, assignment; 13, comparison_operator:queryset is not None; 14, block; 15, call; 16, identifier:queryset; 17, call; 18, identifier:queryset; 19, None; 20, expression_statement; 21, if_statement; 22, attribute; 23, argument_list; 24, identifier:getattr; 25, argument_list; 26, assignment; 27, comparison_operator:get_url_name is not None; 28, block; 29, call; 30, identifier:get_default_base_name; 31, identifier:viewset; 32, identifier:viewset; 33, string; 34, None; 35, identifier:get_url_name; 36, call; 37, identifier:get_url_name; 38, None; 39, return_statement; 40, identifier:super; 41, argument_list; 42, string_content:queryset; 43, identifier:getattr; 44, argument_list; 45, call; 46, identifier:SortedDefaultRouter; 47, identifier:self; 48, attribute; 49, string; 50, None; 51, identifier:get_url_name; 52, argument_list; 53, identifier:queryset; 54, identifier:model; 55, string_content:get_url_name
code: def get_default_base_name(self, viewset):
          """
          Attempt to automatically determine base name using `get_url_name`.
          """
          queryset = getattr(viewset, 'queryset', None)
  
          if queryset is not None:
              get_url_name = getattr(queryset.model, 'get_url_name', None)
              if get_url_name is not None:
                  return get_url_name()
  
          return super(SortedDefaultRouter, self).get_default_base_name(viewset)