<commit_before>#!/usr/bin/python2.5
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Handler for Atom PFIF 1.2 person and note feeds."""

__author__ = '<EMAIL> (<NAME>)'

import atom
import config
import datetime
import model
import pfif
import utils

HARD_MAX_RESULTS = 200  # Clients can ask for more, but won't get more.
PERSON_SUBTITLE_BASE = "PFIF Person Feed generated by Person Finder at "
NOTE_SUBTITLE_BASE = "PFIF Note Feed generated by Person Finder at "

def get_latest_entry_date(entities):
    if entities:
        return max(entity.entry_date for entity in entities)
    return utils.get_utcnow()

def get_latest_repo_updated_date(repos):
    dates = [config.get_for_repo(repo, 'updated_date') for repo in repos]
    return max(dates + [None]) or utils.get_utcnow()

def make_hidden_notes_blank(notes):
    for note in notes:
        if note.hidden:
            note.text = ''


class Repo(utils.BaseHandler):
    TITLE = 'Person Finder Repository Feed'<commit_msg>kpy: Minor rephrasing in get_latest_repo_updated_date.<commit_after>#!/usr/bin/python2.5
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Handler for Atom PFIF 1.2 person and note feeds."""

__author__ = '<EMAIL> (<NAME>)'

import atom
import config
import datetime
import model
import pfif
import utils

HARD_MAX_RESULTS = 200  # Clients can ask for more, but won't get more.
PERSON_SUBTITLE_BASE = "PFIF Person Feed generated by Person Finder at "
NOTE_SUBTITLE_BASE = "PFIF Note Feed generated by Person Finder at "

def get_latest_entry_date(entities):
    if entities:
        return max(entity.entry_date for entity in entities)
    return utils.get_utcnow()

def get_latest_repo_updated_date(repos):
    dates = [config.get_for_repo(repo, 'updated_date') for repo in repos]
    return dates and max(dates) or utils.get_utcnow()

def make_hidden_notes_blank(notes):
    for note in notes:
        if note.hidden:
            note.text = ''


class Repo(utils.BaseHandler):
    TITLE = 'Person Finder Repository Feed'
{'fraction_non_alphanumeric': 0.07930809399477806, 'fraction_numerical': 0.0097911227154047, 'mean_word_length': 4.125418060200669, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1114038', 'n_tokens_mistral': 943, 'n_tokens_neox': 896, 'n_words': 360}