<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 <NAME> <<EMAIL>>
#
# This software is licensed as described in the file LICENSE, which
# you should have received as part of this distribution.

import os
import tempfile
import shutil
import sys
import unittest2 as unittest
from testconfig import config

from couchapp.errors import ResourceNotFound
from couchapp.client import Database
from couchapp.util import popen3, deltree

couchapp_dir = os.path.join(os.path.dirname(__file__), '../')
couchapp_cli = os.path.join(os.path.dirname(__file__), '../bin/couchapp')
try:
    url = config['host']['url']
except KeyError:
    url = 'http://127.0.0.1:5984/'


def _tempdir():
    f, fname = tempfile.mkstemp()
    os.unlink(fname)
    return fname


class CliTestCase(unittest.TestCase):<commit_msg>[#186] Close fd properly to resolve the dir access issue<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 <NAME> <<EMAIL>>
#
# This software is licensed as described in the file LICENSE, which
# you should have received as part of this distribution.

import os
import tempfile
import shutil
import sys
import unittest2 as unittest
from testconfig import config

from couchapp.errors import ResourceNotFound
from couchapp.client import Database
from couchapp.util import popen3, deltree

couchapp_dir = os.path.join(os.path.dirname(__file__), '../')
couchapp_cli = os.path.join(os.path.dirname(__file__), '../bin/couchapp')
try:
    url = config['host']['url']
except KeyError:
    url = 'http://127.0.0.1:5984/'


def _tempdir():
    f, fname = tempfile.mkstemp()
    os.close(f)
    os.unlink(fname)
    return fname


class CliTestCase(unittest.TestCase):
{'fraction_non_alphanumeric': 0.12259194395796848, 'fraction_numerical': 0.021599532983070636, 'mean_word_length': 4.257668711656442, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '186029', 'n_tokens_mistral': 573, 'n_tokens_neox': 545, 'n_words': 167}