# Path: stackalytics/dashboard/helpers.py
# INFINITY_HTML = '&#x221E;'
# def _extend_author_fields(record):
# def _extend_record_common_fields(record):
# def _extend_by_parent_info(record, parent, prefix='parent_'):
# def extend_record(record):
# def get_current_company(user):
# def extend_user(user):
# def extend_module(module_id, project_type, release):
# def get_activity(records, start_record, page_size, query_message=None):
# def get_contribution_summary(records):
# def format_datetime(timestamp):
# def format_date(timestamp):
# def format_launchpad_module_link(module):
# def make_link(title, uri=None, options=None):
# def make_blueprint_link(module, name):
# def make_commit_message(record):
# def make_page_title(project_type_inst, release, module_inst, company,
#                     user_inst):
# def filter_bug_title(title):
# 
# Path: stackalytics/dashboard/parameters.py
# LOG = logging.getLogger(__name__)
# DEFAULTS = {
#     'review_nth': 5,
# }
# METRIC_LABELS = {
#     'loc': 'Lines of code',
#     'commits': 'Commits',
#     'marks': 'Reviews',
#     'emails': 'Emails',
#     'bpd': 'Drafted Blueprints',
#     'bpc': 'Completed Blueprints',
#     'filed-bugs': 'Filed Bugs',
#     'resolved-bugs': 'Resolved Bugs',
#     'person-day': "Person-day effort",
#     'ci': 'CI votes',
#     'patches': 'Patch Sets',
#     'translations': 'Translations',
# }
# METRIC_TO_RECORD_TYPE = {
#     'loc': ['commit'],
#     'commits': ['commit'],
#     'marks': ['mark'],
#     'emails': ['email'],
#     'bpd': ['bpd'],
#     'bpc': ['bpc'],
#     'filed-bugs': ['bugf'],
#     'resolved-bugs': ['bugr'],
#     'members': ['member'],
#     'person-day': ['mark', 'patch', 'email', 'bpd', 'bugf'],
#     'ci': ['ci'],
#     'patches': ['patch'],
#     'translations': ['tr'],
# }
# FILTER_PARAMETERS = ['release', 'project_type', 'module', 'company', 'user_id',
#                      'metric', 'start_date', 'end_date', 'blueprint_id',
#                      'core_in']
# DEFAULT_RECORDS_LIMIT = 10
# DEFAULT_STATIC_ACTIVITY_SIZE = 100
# def get_default(param_name):
# def get_parameter(kwargs, name, plural_name=None, use_default=True):
# def get_single_parameter(kwargs, name, use_default=True):


import mock
import testtools
from stackalytics.dashboard import helpers
from stackalytics.dashboard import parameters
        }

        expected = '''\
Implemented new driver for Cinder &lt;:
Implements Blueprint ''' + (
            '<a href="https://blueprints.launchpad.net/cinder/+spec/'
            'super-driver" class="ext_link">super-driver</a>' + '\n' +
            'Change-Id: <a href="https://review.openstack.org/#q,'
            'Ie49ccd2138905e178843b375a9b16c3fe572d1db,n,z" class="ext_link">'
            'Ie49ccd2138905e178843b375a9b16c3fe572d1db</a>')

        observed = helpers.make_commit_message(record)

        self.assertEqual(expected, observed,
                         'Commit message should be processed correctly')

    @mock.patch('stackalytics.dashboard.vault.get_vault')
    @mock.patch('stackalytics.dashboard.vault.get_user_from_runtime_storage')
    def test_make_page_title(self, user_patch, vault_patch):
        def _pt(id, title=None, is_openstack=True):
            return dict(id=id.lower(), title=title or id,
                        parent=dict(id='openstack') if is_openstack else None)

        user_inst = {'user_name': 'John Doe'}
        module_inst = {'module_group_name': 'neutron'}

        self.assertEqual('OpenStack community contribution in all releases',
                         helpers.make_page_title(
                             _pt('OpenStack'), 'all', None, None, None))
        self.assertEqual('OpenStack community contribution in Havana release',

# Path: stackalytics/dashboard/helpers.py
# INFINITY_HTML = '&#x221E;'
# def _extend_author_fields(record):
# def _extend_record_common_fields(record):
# def _extend_by_parent_info(record, parent, prefix='parent_'):
# def extend_record(record):
# def get_current_company(user):
# def extend_user(user):
# def extend_module(module_id, project_type, release):
# def get_activity(records, start_record, page_size, query_message=None):
# def get_contribution_summary(records):
# def format_datetime(timestamp):
# def format_date(timestamp):
# def format_launchpad_module_link(module):
# def make_link(title, uri=None, options=None):
# def make_blueprint_link(module, name):
# def make_commit_message(record):
# def make_page_title(project_type_inst, release, module_inst, company,
#                     user_inst):
# def filter_bug_title(title):
# 
# Path: stackalytics/dashboard/parameters.py
# LOG = logging.getLogger(__name__)
# DEFAULTS = {
#     'review_nth': 5,
# }
# METRIC_LABELS = {
#     'loc': 'Lines of code',
#     'commits': 'Commits',
#     'marks': 'Reviews',
#     'emails': 'Emails',
#     'bpd': 'Drafted Blueprints',
#     'bpc': 'Completed Blueprints',
#     'filed-bugs': 'Filed Bugs',
#     'resolved-bugs': 'Resolved Bugs',
#     'person-day': "Person-day effort",
#     'ci': 'CI votes',
#     'patches': 'Patch Sets',
#     'translations': 'Translations',
# }
# METRIC_TO_RECORD_TYPE = {
#     'loc': ['commit'],
#     'commits': ['commit'],
#     'marks': ['mark'],
#     'emails': ['email'],
#     'bpd': ['bpd'],
#     'bpc': ['bpc'],
#     'filed-bugs': ['bugf'],
#     'resolved-bugs': ['bugr'],
#     'members': ['member'],
#     'person-day': ['mark', 'patch', 'email', 'bpd', 'bugf'],
#     'ci': ['ci'],
#     'patches': ['patch'],
#     'translations': ['tr'],
# }
# FILTER_PARAMETERS = ['release', 'project_type', 'module', 'company', 'user_id',
#                      'metric', 'start_date', 'end_date', 'blueprint_id',
#                      'core_in']
# DEFAULT_RECORDS_LIMIT = 10
# DEFAULT_STATIC_ACTIVITY_SIZE = 100
# def get_default(param_name):
# def get_parameter(kwargs, name, plural_name=None, use_default=True):
# def get_single_parameter(kwargs, name, use_default=True):


# Path: stackalytics/tests/unit/test_web_utils.py
import mock
import testtools
from stackalytics.dashboard import helpers
from stackalytics.dashboard import parameters

        }

        expected = '''\
Implemented new driver for Cinder &lt;:
Implements Blueprint ''' + (
            '<a href="https://blueprints.launchpad.net/cinder/+spec/'
            'super-driver" class="ext_link">super-driver</a>' + '\n' +
            'Change-Id: <a href="https://review.openstack.org/#q,'
            'Ie49ccd2138905e178843b375a9b16c3fe572d1db,n,z" class="ext_link">'
            'Ie49ccd2138905e178843b375a9b16c3fe572d1db</a>')

        observed = helpers.make_commit_message(record)

        self.assertEqual(expected, observed,
                         'Commit message should be processed correctly')

    @mock.patch('stackalytics.dashboard.vault.get_vault')
    @mock.patch('stackalytics.dashboard.vault.get_user_from_runtime_storage')
    def test_make_page_title(self, user_patch, vault_patch):
        def _pt(id, title=None, is_openstack=True):
            return dict(id=id.lower(), title=title or id,
                        parent=dict(id='openstack') if is_openstack else None)

        user_inst = {'user_name': 'John Doe'}
        module_inst = {'module_group_name': 'neutron'}

        self.assertEqual('OpenStack community contribution in all releases',
                         helpers.make_page_title(
                             _pt('OpenStack'), 'all', None, None, None))
        self.assertEqual('OpenStack community contribution in Havana release',

                         helpers.make_page_title(