<commit_before>from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division

from contextlib import contextmanager
from optparse import make_option
import json

from django.core.exceptions import ObjectDoesNotExist
from django.contrib.gis.geos import fromstr
from django.conf import settings

from treemap.models import (User, Plot, Tree, Species)
from ._private import InstanceDataCommand

# model specification:
#
# model_class:        the django class object used to instantiate objects
#
# dependencies:       a mapping where keys are the names of models that
#                     must also be in the MODELS dict and values are the
#                     names of fields for the currently model that have
#                     foreign key relationships to the dependency model
#
# common_fields:      fields that must be in the provided data and the otm2
#                     django model.
# renamed_fields:     a mapping where keys are fields in the provided data
#                     and values are their names in the otm2 model.
#
# undecided_fields:   fields that we're not sure what to do with. These should
#                     be resolved into other categories before this is used
#                     for a production migration.
# removed_fields:     fields in the provided data that will be discarded.
#
# missing_fields:     fields in the otm2 django model that are not provided.
#
# value_transformers: a mapping where keys are the name of fields in the
#                     _provided_ data and and values are binary functions
#                     that take a value and transform it to some other value.

MODELS = {
    'tree': {
        'model_class': Tree,
        'dependencies': {'species': 'species',
                         'user': 'steward_user',
                         'plot': 'plot'},
        'common_fields': {'plot', 'species', 'readonly', 'canopy_height',
                          'date_planted', 'date_removed', 'height'},
        'renamed_fields': {'dbh': 'diameter'},
        'undecided_fields': {'import_event'},
        'removed_fields': {'tree_owner', 'steward_name', 'sponsor',
                           'species_other1', 'species_other2',
                           'orig_species', 'present', 'last_updated',
                           'last_updated_by', 's_order', 'photo_count',<commit_msg>Fix inaccurate documentation<commit_after>from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division

from contextlib import contextmanager
from optparse import make_option
import json

from django.core.exceptions import ObjectDoesNotExist
from django.contrib.gis.geos import fromstr
from django.conf import settings

from treemap.models import (User, Plot, Tree, Species)
from ._private import InstanceDataCommand

# model specification:
#
# model_class:        the django class object used to instantiate objects
#
# dependencies:       a mapping where keys are the names of models that
#                     must also be in the MODELS dict and values are the
#                     names of fields for the currently model that have
#                     foreign key relationships to the dependency model
#
# common_fields:      fields that must be in the provided data and the otm2
#                     django model.
# renamed_fields:     a mapping where keys are fields in the provided data
#                     and values are their names in the otm2 model.
#
# undecided_fields:   fields that we're not sure what to do with. These should
#                     be resolved into other categories before this is used
#                     for a production migration.
# removed_fields:     fields in the provided data that will be discarded.
#
# missing_fields:     fields in the otm2 django model that are not provided.
#
# value_transformers: a mapping where keys are the name of fields in the
#                     _provided_ data and and values are unary functions
#                     that take a value and transform it to some other value.

MODELS = {
    'tree': {
        'model_class': Tree,
        'dependencies': {'species': 'species',
                         'user': 'steward_user',
                         'plot': 'plot'},
        'common_fields': {'plot', 'species', 'readonly', 'canopy_height',
                          'date_planted', 'date_removed', 'height'},
        'renamed_fields': {'dbh': 'diameter'},
        'undecided_fields': {'import_event'},
        'removed_fields': {'tree_owner', 'steward_name', 'sponsor',
                           'species_other1', 'species_other2',
                           'orig_species', 'present', 'last_updated',
                           'last_updated_by', 's_order', 'photo_count',
{'fraction_non_alphanumeric': 0.07184628237259816, 'fraction_numerical': 0.0020885547201336674, 'mean_word_length': 2.374911909795631, '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': '4551501', 'n_tokens_mistral': 1218, 'n_tokens_neox': 1167, 'n_words': 483}