nodes: 0, module; 1, function_definition; 2, function_name:get_dates_for_project; 3, parameters; 4, block; 5, identifier:self; 6, identifier:project; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, comment:"""
          Return a list of the dates we have in cache for the specified project,
          sorted in ascending date order.
  
          :param project: project name
          :type project: str
          :return: list of datetime.datetime objects
          :rtype: datetime.datetime
          """; 13, assignment; 14, assignment; 15, identifier:f; 16, call; 17, block; 18, call; 19, identifier:file_re; 20, call; 21, identifier:all_dates; 22, list; 23, attribute; 24, argument_list; 25, if_statement; 26, expression_statement; 27, if_statement; 28, expression_statement; 29, identifier:sorted; 30, argument_list; 31, attribute; 32, argument_list; 33, identifier:os; 34, identifier:listdir; 35, attribute; 36, not_operator; 37, block; 38, assignment; 39, comparison_operator:m is None; 40, block; 41, call; 42, identifier:all_dates; 43, identifier:re; 44, identifier:compile; 45, binary_operator:r'^%s_([0-9]{8})\.json$' % project; 46, identifier:self; 47, identifier:cache_path; 48, call; 49, continue_statement; 50, identifier:m; 51, call; 52, identifier:m; 53, None; 54, continue_statement; 55, attribute; 56, argument_list; 57, string; 58, identifier:project; 59, attribute; 60, argument_list; 61, attribute; 62, argument_list; 63, identifier:all_dates; 64, identifier:append; 65, call; 66, string_content:^%s_([0-9]{8})\.json$; 67, attribute; 68, identifier:isfile; 69, call; 70, identifier:file_re; 71, identifier:match; 72, identifier:f; 73, attribute; 74, argument_list; 75, identifier:os; 76, identifier:path; 77, attribute; 78, argument_list; 79, identifier:datetime; 80, identifier:strptime; 81, call; 82, string; 83, attribute; 84, identifier:join; 85, attribute; 86, identifier:f; 87, attribute; 88, argument_list; 89, string_content:%Y%m%d; 90, identifier:os; 91, identifier:path; 92, identifier:self; 93, identifier:cache_path; 94, identifier:m; 95, identifier:group; 96, integer:1
code: def get_dates_for_project(self, project):
          """
          Return a list of the dates we have in cache for the specified project,
          sorted in ascending date order.
  
          :param project: project name
          :type project: str
          :return: list of datetime.datetime objects
          :rtype: datetime.datetime
          """
          file_re = re.compile(r'^%s_([0-9]{8})\.json$' % project)
          all_dates = []
          for f in os.listdir(self.cache_path):
              if not os.path.isfile(os.path.join(self.cache_path, f)):
                  continue
              m = file_re.match(f)
              if m is None:
                  continue
              all_dates.append(datetime.strptime(m.group(1), '%Y%m%d'))
          return sorted(all_dates)