nodes: 0, module; 1, function_definition; 2, function_name:get_contributor_sort_value; 3, parameters; 4, block; 5, identifier:self; 6, identifier:obj; 7, expression_statement; 8, expression_statement; 9, if_statement; 10, return_statement; 11, comment:"""Generate display name for contributor."""; 12, assignment; 13, boolean_operator; 14, block; 15, else_clause; 16, call; 17, identifier:user; 18, attribute; 19, attribute; 20, attribute; 21, expression_statement; 22, block; 23, attribute; 24, argument_list; 25, identifier:obj; 26, identifier:contributor; 27, identifier:user; 28, identifier:first_name; 29, identifier:user; 30, identifier:last_name; 31, assignment; 32, expression_statement; 33, call; 34, identifier:lower; 35, identifier:contributor; 36, call; 37, assignment; 38, attribute; 39, argument_list; 40, attribute; 41, argument_list; 42, identifier:contributor; 43, attribute; 44, identifier:contributor; 45, identifier:strip; 46, identifier:user; 47, identifier:get_full_name; 48, identifier:user; 49, identifier:username
code: def get_contributor_sort_value(self, obj):
          """Generate display name for contributor."""
          user = obj.contributor
  
          if user.first_name or user.last_name:
              contributor = user.get_full_name()
          else:
              contributor = user.username
  
          return contributor.strip().lower()