<commit_before># Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: <EMAIL>
# Maintained By: <EMAIL>

from collections import namedtuple
from .common import *
from .registry import service

"""All gGRC REST services."""


def contributed_services():
  """The list of all gGRC collection services as a list of
  (url, ModelClass) tuples.
  """
  import ggrc.models.all_models as models

  return [
    service('background_tasks', models.BackgroundTask),
    service('audits', models.Audit),
    service('categorizations', models.Categorization),
    service('category_bases', models.CategoryBase),
      service('control_categories', models.ControlCategory),
      service('control_assertions', models.ControlAssertion),
    service('contexts', models.Context),
    service('controls', models.Control),
    service('control_controls', models.ControlControl),
    service('control_sections', models.ControlSection),
    service('data_assets', models.DataAsset),
    service('directives', models.Directive, ReadOnlyResource),
      service('contracts', models.Contract),
      service('policies', models.Policy),
      service('regulations', models.Regulation),
      service('standards', models.Standard),
    service('directive_controls', models.DirectiveControl),
    service('directive_sections', models.DirectiveSection),
    service('documents', models.Document),
    service('events', models.Event, ReadOnlyResource),
    service('facilities', models.Facility),
    service('help', models.Help),
    service('markets', models.Market),
    service('meetings', models.Meeting),
    service('object_controls', models.ObjectControl),
    service('object_documents', models.ObjectDocument),
    service('object_objectives', models.ObjectObjective),
    service('object_owners', models.ObjectOwner),
    service('object_people', models.ObjectPerson),
    service('object_sections', models.ObjectSection),
    service('objectives', models.Objective),
    service('objective_controls', models.ObjectiveControl),
    service('options', models.Option),
    service('org_groups', models.OrgGroup),
    service('people', models.Person),
    service('products', models.Product),
    service('projects', models.Project),
    service('programs', models.Program),
    service('program_controls', models.ProgramControl),
    service('program_directives', models.ProgramDirective),
    service('relationships', models.Relationship),
    service('requests', models.Request),
    service('responses', models.Response),
      service('documentation_responses', models.DocumentationResponse),
      service('interview_responses', models.InterviewResponse),
      service('population_sample_responses', models.PopulationSampleResponse),
    service('revisions', models.Revision, ReadOnlyResource),
    service('section_bases', models.SectionBase, ReadOnlyResource),
      service('sections', models.Section),
      service('clauses', models.Clause),
    service('section_objectives', models.SectionObjective),
    service('systems_or_processes', models.SystemOrProcess, ReadOnlyResource),
      service('systems', models.System),
      service('processes', models.Process),
    service('notification_config', models.NotificationConfig),
    ]


def all_services():
  from ggrc.extensions import get_extension_modules

  services = contributed_services()

  for extension_module in get_extension_modules():
    contributions = getattr(extension_module, 'contributed_services', None)
    if contributions:
      if callable(contributions):
        contributions = contributions()
      services.extend(contributions)
  return services


def init_extra_services(app):
  from ggrc.login import login_required<commit_msg>Alphabetized services to be easier to find<commit_after># Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: <EMAIL>
# Maintained By: <EMAIL>

from collections import namedtuple
from .common import *
from .registry import service

"""All gGRC REST services."""


def contributed_services():
  """The list of all gGRC collection services as a list of
  (url, ModelClass) tuples.
  """
  import ggrc.models.all_models as models

  return [
    service('audits', models.Audit),
    service('background_tasks', models.BackgroundTask),
    service('categorizations', models.Categorization),
    service('category_bases', models.CategoryBase),
    service('clauses', models.Clause),
    service('contexts', models.Context),
    service('contracts', models.Contract),
    service('control_assertions', models.ControlAssertion),
    service('control_categories', models.ControlCategory),
    service('control_controls', models.ControlControl),
    service('control_sections', models.ControlSection),
    service('controls', models.Control),
    service('data_assets', models.DataAsset),
    service('directives', models.Directive, ReadOnlyResource),
    service('directive_controls', models.DirectiveControl),
    service('directive_sections', models.DirectiveSection),
    service('documentation_responses', models.DocumentationResponse),
    service('documents', models.Document),
    service('events', models.Event, ReadOnlyResource),
    service('facilities', models.Facility),
    service('help', models.Help),
    service('interview_responses', models.InterviewResponse),
    service('markets', models.Market),
    service('meetings', models.Meeting),
    service('notification_config', models.NotificationConfig),
    service('object_controls', models.ObjectControl),
    service('object_documents', models.ObjectDocument),
    service('object_objectives', models.ObjectObjective),
    service('object_owners', models.ObjectOwner),
    service('object_people', models.ObjectPerson),
    service('object_sections', models.ObjectSection),
    service('objectives', models.Objective),
    service('objective_controls', models.ObjectiveControl),
    service('options', models.Option),
    service('org_groups', models.OrgGroup),
    service('people', models.Person),
    service('policies', models.Policy),
    service('population_sample_responses', models.PopulationSampleResponse),
    service('processes', models.Process),
    service('products', models.Product),
    service('programs', models.Program),
    service('program_controls', models.ProgramControl),
    service('program_directives', models.ProgramDirective),
    service('projects', models.Project),
    service('regulations', models.Regulation),
    service('relationships', models.Relationship),
    service('requests', models.Request),
    service('responses', models.Response),
    service('revisions', models.Revision, ReadOnlyResource),
    service('section_bases', models.SectionBase, ReadOnlyResource),
    service('section_objectives', models.SectionObjective),
    service('sections', models.Section),
    service('standards', models.Standard),
    service('systems', models.System),
    service('systems_or_processes', models.SystemOrProcess, ReadOnlyResource),
    ]


def all_services():
  from ggrc.extensions import get_extension_modules

  services = contributed_services()

  for extension_module in get_extension_modules():
    contributions = getattr(extension_module, 'contributed_services', None)
    if contributions:
      if callable(contributions):
        contributions = contributions()
      services.extend(contributions)
  return services


def init_extra_services(app):
  from ggrc.login import login_required
{'fraction_non_alphanumeric': 0.1254747871643746, 'fraction_numerical': 0.0015717092337917485, 'mean_word_length': 5.498723404255319, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4096505', 'n_tokens_mistral': 2023, 'n_tokens_neox': 1978, 'n_words': 417}