<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2017
#
# Distributed under terms of the MIT license.

import click
import datetime
import json
import logging
import logging.config
import os
import random
import requests
import sys
import uuid

logging.config.fileConfig(
    os.path.join(os.path.dirname(os.path.realpath(__file__)), 'logging.conf'))
logger = logging.getLogger("aclu_importer")


API_BASE_URL = "http://localhost:50050"
API_BASE_URL_FORMAT = "{0}/{{0}}".format(API_BASE_URL)


@click.command()
@click.option('--feature_collection_path', default=None, help='Path to feature collection file being imported.')
def import_features(feature_collection_path=None):
    # Let's just hardcode one implementation and we'll worry about the
    # abstraction later.
    #
    # I think what needs to be done here is that we use a template file (via
    # Jinja) that we feed into this script. The template file has the 'default'
    # properties aka the holes we need to fill via lambdas and it's basically
    # used to complete the feature for submission. I imagine different
    # feature/geojson files will each need a unique template (and it should
    # scale somewhat nicely)

    if feature_collection_path and os.path.isfile(os.path.realpath(feature_collection_path)):
        organization = _get_organization("Park")

        if organization:
            for feature in _features_from_path(os.path.realpath(feature_collection_path)):
                f = {<commit_msg>Added features to logger name to be able to import_holidays<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2017
#
# Distributed under terms of the MIT license.

import click
import datetime
import json
import logging
import logging.config
import os
import random
import requests
import sys
import uuid

logging.config.fileConfig(
    os.path.join(os.path.dirname(os.path.realpath(__file__)), 'logging.conf'))
logger = logging.getLogger("aclu_importer.features")


API_BASE_URL = "http://localhost:50050"
API_BASE_URL_FORMAT = "{0}/{{0}}".format(API_BASE_URL)


@click.command()
@click.option('--feature_collection_path', default=None, help='Path to feature collection file being imported.')
def import_features(feature_collection_path=None):
    # Let's just hardcode one implementation and we'll worry about the
    # abstraction later.
    #
    # I think what needs to be done here is that we use a template file (via
    # Jinja) that we feed into this script. The template file has the 'default'
    # properties aka the holes we need to fill via lambdas and it's basically
    # used to complete the feature for submission. I imagine different
    # feature/geojson files will each need a unique template (and it should
    # scale somewhat nicely)

    if feature_collection_path and os.path.isfile(os.path.realpath(feature_collection_path)):
        organization = _get_organization("Park")

        if organization:
            for feature in _features_from_path(os.path.realpath(feature_collection_path)):
                f = {
{'fraction_non_alphanumeric': 0.09073170731707317, 'fraction_numerical': 0.007804878048780488, 'mean_word_length': 4.001626016260163, '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': '2213670', 'n_tokens_mistral': 893, 'n_tokens_neox': 849, 'n_words': 301}