<commit_before># -*- coding: utf-8 -*-

# Copyright 2014 Alcatel-Lucent USA Inc.
# NU{{ model.name }}
# {{ model.description }}

{% for api in model.apis['children'].values() %}
from ..fetchers import NU{{ api.plural_name }}Fetcher{% endfor %}
from bambou import NURESTObject{% if model.has_time_attribute %}
from time import time{% endif %}


class NU{{ model.name }}(NURESTObject):
    """ Represents a {{ model.name }} in the VSD

        Notes:
            {{ model.description }}

        Warning:
            This file has been autogenerated. You should never change it.
            Override vsdk.NU{{ model.name }} instead.
    """

    __rest_name__ = u"{{ model.remote_name }}"

    def __init__(self, **kwargs):
        """ Initializes a {{ model.name }} instance

            Notes:
                You can specify all parameters while calling this methods.
                A special argument named `data` will enable you to load the
                object from a Python dictionary

            Examples:
                >>> {{ model.name.lower() }} = NU{{ model.name }}(id=u'xxxx-xxx-xxx-xxx', name=u'{{ model.name }}')
                >>> {{ model.name.lower() }} = NU{{ model.name }}(data=my_dict)
        """

        super(NU{{ model.name }}, self).__init__()

        # Read/Write Attributes
        {% for attribute in model.attributes %}
        self._{{ attribute.local_name|lower }} = None{% endfor %}
        {% for attribute in model.attributes %}
        self.expose_attribute(local_name=u"{{ attribute.local_name|lower }}", remote_name=u"{{ attribute.remote_name }}", attribute_type={{ attribute.local_type }}, is_required={{ attribute.required }}, is_unique={{ attribute.unique }}{% if attribute.allowed_choices and attribute.allowed_choices|length > 0  %}, choices={{ attribute.allowed_choices|sort|trim }}{% endif %}){% endfor %}
        {% if model.apis['children']|length > 0 %}
        # Fetchers
        {% for api in model.apis['children'].values() %}
        self.{{ api.instance_plural_name }} = NU{{ api.plural_name }}Fetcher.fetcher_with_object(parent_object=self)
        {% endfor %}{% endif %}

        self._compute_args(**kwargs)

    # Properties
    {% for attribute in model.attributes %}
    def _get_{{ attribute.local_name }}(self):
        """ Get {{ attribute.local_name }} value.

            Notes:
                {{ attribute.description }}

                {% if attribute.local_name != attribute.remote_name %}
                This attribute is named `{{ attribute.remote_name }}` in VSD API.
                {% endif %}
        """
        return self._{{ attribute.local_name }}

    def _set_{{ attribute.local_name }}(self, value):
        """ Set {{ attribute.local_name }} value.

            Notes:
                {{ attribute.description }}

                {% if attribute.local_name != attribute.remote_name %}
                This attribute is named `{{ attribute.remote_name }}` in VSD API.
                {% endif %}
        """
        self._{{ attribute.local_name }} = value

    {{ attribute.local_name }} = property(_get_{{ attribute.local_name }}, _set_{{ attribute.local_name }})
    {% endfor %}
<commit_msg>Forced metadata fetcher in all VSD objects except metadata<commit_after># -*- coding: utf-8 -*-

# Copyright 2014 Alcatel-Lucent USA Inc.
# NU{{ model.name }}
# {{ model.description }}

{% for api in model.apis['children'].values() %}
from ..fetchers import NU{{ api.plural_name }}Fetcher{% endfor %}
from ..fetchers import NUMetadatasFetcher
from bambou import NURESTObject{% if model.has_time_attribute %}
from time import time{% endif %}


class NU{{ model.name }}(NURESTObject):
    """ Represents a {{ model.name }} in the VSD

        Notes:
            {{ model.description }}

        Warning:
            This file has been autogenerated. You should never change it.
            Override vsdk.NU{{ model.name }} instead.
    """

    __rest_name__ = u"{{ model.remote_name }}"

    def __init__(self, **kwargs):
        """ Initializes a {{ model.name }} instance

            Notes:
                You can specify all parameters while calling this methods.
                A special argument named `data` will enable you to load the
                object from a Python dictionary

            Examples:
                >>> {{ model.name.lower() }} = NU{{ model.name }}(id=u'xxxx-xxx-xxx-xxx', name=u'{{ model.name }}')
                >>> {{ model.name.lower() }} = NU{{ model.name }}(data=my_dict)
        """

        super(NU{{ model.name }}, self).__init__()

        # Read/Write Attributes
        {% for attribute in model.attributes %}
        self._{{ attribute.local_name|lower }} = None{% endfor %}
        {% for attribute in model.attributes %}
        self.expose_attribute(local_name=u"{{ attribute.local_name|lower }}", remote_name=u"{{ attribute.remote_name }}", attribute_type={{ attribute.local_type }}, is_required={{ attribute.required }}, is_unique={{ attribute.unique }}{% if attribute.allowed_choices and attribute.allowed_choices|length > 0  %}, choices={{ attribute.allowed_choices|sort|trim }}{% endif %}){% endfor %}
        {% if model.apis['children']|length > 0 %}
        # Fetchers
        {% for api in model.apis['children'].values() %}
        self.{{ api.instance_plural_name }} = NU{{ api.plural_name }}Fetcher.fetcher_with_object(parent_object=self)
        {% endfor %}{% endif %}
        {% if not model.remote_name.startswith('metadata') %}
        self.metadata = NUMetadatasFetcher.fetcher_with_object(parent_object=self)
        {% endif %}

        self._compute_args(**kwargs)

    # Properties
    {% for attribute in model.attributes %}
    def _get_{{ attribute.local_name }}(self):
        """ Get {{ attribute.local_name }} value.

            Notes:
                {{ attribute.description }}

                {% if attribute.local_name != attribute.remote_name %}
                This attribute is named `{{ attribute.remote_name }}` in VSD API.
                {% endif %}
        """
        return self._{{ attribute.local_name }}

    def _set_{{ attribute.local_name }}(self, value):
        """ Set {{ attribute.local_name }} value.

            Notes:
                {{ attribute.description }}

                {% if attribute.local_name != attribute.remote_name %}
                This attribute is named `{{ attribute.remote_name }}` in VSD API.
                {% endif %}
        """
        self._{{ attribute.local_name }} = value

    {{ attribute.local_name }} = property(_get_{{ attribute.local_name }}, _set_{{ attribute.local_name }})
    {% endfor %}

{'fraction_non_alphanumeric': 0.14458194989435558, 'fraction_numerical': 0.002112888620585572, 'mean_word_length': 2.440809968847352, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '1889617', 'n_tokens_mistral': 1978, 'n_tokens_neox': 1808, 'n_words': 456}