nodes: 0, module; 1, function_definition; 2, function_name:_sortByCreated; 3, parameters; 4, block; 5, identifier:a; 6, identifier:b; 7, expression_statement; 8, if_statement; 9, comment:"""Sort function for object by created date"""; 10, comparison_operator:a.created < b.created; 11, block; 12, elif_clause; 13, else_clause; 14, attribute; 15, attribute; 16, return_statement; 17, comparison_operator:a.created > b.created; 18, block; 19, block; 20, identifier:a; 21, identifier:created; 22, identifier:b; 23, identifier:created; 24, integer:1; 25, attribute; 26, attribute; 27, return_statement; 28, return_statement; 29, identifier:a; 30, identifier:created; 31, identifier:b; 32, identifier:created; 33, unary_operator; 34, integer:0; 35, integer:1
code: def _sortByCreated(a, b):
      """Sort function for object by created date"""
      if a.created < b.created:
          return 1
      elif a.created > b.created:
          return -1
      else:
          return 0