<commit_before># -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------------

from tornado import gen
from tornado.web import HTTPError
from iostream import StreamClosedError
from json import dumps

import qiita_db as qdb
from .oauth2 import OauthBaseHandler, authenticate_oauth


def _get_analysis(a_id):
    """Returns the analysis with the given `a_id` if it exists

    Parameters
    ----------
    a_id : str
        The analysis id

    Returns<commit_msg>iostream -> tornado.iostream<commit_after># -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------------

from tornado import gen
from tornado.web import HTTPError
from tornado.iostream import StreamClosedError
from json import dumps

import qiita_db as qdb
from .oauth2 import OauthBaseHandler, authenticate_oauth


def _get_analysis(a_id):
    """Returns the analysis with the given `a_id` if it exists

    Parameters
    ----------
    a_id : str
        The analysis id

    Returns
{'fraction_non_alphanumeric': 0.259672131147541, 'fraction_numerical': 0.007868852459016393, 'mean_word_length': 1.6219931271477663, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1855587', 'n_tokens_mistral': 377, 'n_tokens_neox': 350, 'n_words': 146}