<commit_before>from django.utils.functional import cached_property

from corehq.apps.registry.exceptions import RegistryNotFound
from corehq.apps.registry.models import DataRegistry


class DataRegistryHelper:
    def __init__(self, current_domain, registry_slug):
        self.current_domain = current_domain
        self.registry_slug = registry_slug

    @cached_property
    def registry(self):
        try:
            return DataRegistry.objects.accessible_to_domain(
                self.current_domain, self.registry_slug
            ).get()
        except DataRegistry.DoesNotExist:
            raise RegistryNotFound(self.registry_slug)

    @property
    def visible_domains(self):
        return self.registry.get_granted_domains(self.current_domain)
<commit_msg>include current domain in list of 'visible' domains<commit_after>from django.utils.functional import cached_property

from corehq.apps.registry.exceptions import RegistryNotFound
from corehq.apps.registry.models import DataRegistry


class DataRegistryHelper:
    def __init__(self, current_domain, registry_slug):
        self.current_domain = current_domain
        self.registry_slug = registry_slug

    @cached_property
    def registry(self):
        try:
            return DataRegistry.objects.accessible_to_domain(
                self.current_domain, self.registry_slug
            ).get()
        except DataRegistry.DoesNotExist:
            raise RegistryNotFound(self.registry_slug)

    @property
    def visible_domains(self):
        return {self.current_domain} | self.registry.get_granted_domains(self.current_domain)

{'fraction_non_alphanumeric': 0.06575682382133995, 'fraction_numerical': 0.0, 'mean_word_length': 3.3712737127371275, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '7366217', 'n_tokens_mistral': 436, 'n_tokens_neox': 425, 'n_words': 88}