<commit_before># -*- coding: utf-8 -*-
""" \file identity/ldap/models.py
\brief Implements the models neccessary to map to LDAP.

\author <NAME> (cactuscommander) <EMAIL>
\author <NAME> (mehcode) <EMAIL>

\copyright Copyright 2012 © Concordus Applications, Inc.
           All Rights Reserved.
"""
from django.db import models
from identity.common.models import Host, Timestamp
from identity.models import Provider


class Directory(Timestamp):
    """Represents a LDAP directory.
    """

    class Meta:
        verbose_name_plural = 'directories'

    ## The provider that this data store is to back.
    provider = models.ForeignKey(Provider)

    ## The host on which the LDAP directory resides.
    host = models.ForeignKey(
        Host,
        help_text="The host on which the LDAP directory resides.")

    ## The base distinguished name.
    base_dn = models.CharField(
        verbose_name="base distinguished name",
        max_length=1024,
        blank=True,
        help_text="""
            The base distinguished name that is prepended to every query
            against LDAP.
        """,
    )

    def __unicode__(self):
        """Returns a textual representation of this."""
        return unicode(self.host)


class Object(Timestamp):
    """Represents an object inside a LDAP directory.
    """

    ## The LDAP directory on which it resides.
    directory = models.ForeignKey(Directory)

    ## Descriptive name of this LDAP object.
    description = models.CharField(max_length=512)<commit_msg>Added text representation of ldap object.<commit_after># -*- coding: utf-8 -*-
""" \file identity/ldap/models.py
\brief Implements the models neccessary to map to LDAP.

\author <NAME> (cactuscommander) <EMAIL>
\author <NAME> (mehcode) <EMAIL>

\copyright Copyright 2012 © Concordus Applications, Inc.
           All Rights Reserved.
"""
from django.db import models
from identity.common.models import Host, Timestamp
from identity.models import Provider


class Directory(Timestamp):
    """Represents a LDAP directory.
    """

    class Meta:
        verbose_name_plural = 'directories'

    ## The provider that this data store is to back.
    provider = models.ForeignKey(Provider)

    ## The host on which the LDAP directory resides.
    host = models.ForeignKey(
        Host,
        help_text="The host on which the LDAP directory resides.")

    ## The base distinguished name.
    base_dn = models.CharField(
        verbose_name="base distinguished name",
        max_length=1024,
        blank=True,
        help_text="""
            The base distinguished name that is prepended to every query
            against LDAP.
        """,
    )

    def __unicode__(self):
        """Returns a textual representation of this."""
        return unicode(self.host)


class Object(Timestamp):
    """Represents an object inside a LDAP directory.
    """

    ## The LDAP directory on which it resides.
    directory = models.ForeignKey(Directory)

    ## Descriptive name of this LDAP object.
    description = models.CharField(max_length=512)

    def __unicode__(self):
        """Returns a textual representation of this."""
        return unicode(self.description)
{'fraction_non_alphanumeric': 0.09389671361502347, 'fraction_numerical': 0.007511737089201878, 'mean_word_length': 2.850602409638554, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2105469', 'n_tokens_mistral': 910, 'n_tokens_neox': 840, 'n_words': 304}