def _AnalyzeKeywords(self, keywords):
    start_time = rdfvalue.RDFDatetime().Now() - rdfvalue.Duration("180d")
    end_time = rdfvalue.RDFDatetime(self.LAST_TIMESTAMP)
    filtered_keywords = []
    unversioned_keywords = []

    for k in keywords:
      if k.startswith(self.START_TIME_PREFIX):
        try:
          start_time = rdfvalue.RDFDatetime(k[self.START_TIME_PREFIX_LEN:])
        except ValueError:
          pass
      elif k.startswith(self.END_TIME_PREFIX):
        try:
          time = rdfvalue.RDFDatetime()

          time.ParseFromHumanReadable(k[self.END_TIME_PREFIX_LEN:], eoy=True)
          end_time = time
        except (__HOLE__, ValueError):
          pass
      elif k[0] == "+":
        kw = k[1:]
        filtered_keywords.append(kw)
        unversioned_keywords.append(kw)
      else:
        filtered_keywords.append(k)

    if not filtered_keywords:
      filtered_keywords.append(".")

    return start_time, end_time, filtered_keywords, unversioned_keywords
dataset/ETHPy150Open google/grr/grr/lib/client_index.py/ClientIndex._AnalyzeKeywords