<commit_before>from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from os.path import join, dirname
from nose.tools import raises
from indra.sources.bbn.bbn_api import *

from indra.statements import *

# Path to the BBN test file
path_this = os.path.dirname(os.path.abspath(__file__))
data_folder = os.path.join(path_this, '../../data/tests_data/bbn_tests_data')
test_file_simple = os.path.join(data_folder, 'bbn_test_simple.json-ld')
test_file_negatedCause = os.path.join(data_folder,
        'bbn_test_negatedCause.json-ld')
test_file_negatedEffect = os.path.join(data_folder,
        'bbn_test_negatedEffect.json-ld')

def test_simple_extraction():
    """Verify that  processor extracts a simple causal assertion correctly from
    a JSON-LD file."""
    system extracted the information correctly from teh 
    bp = process_json_file(test_file_simple)
    statements = bp.statements

    assert(len(statements) == 1)
    s0 = statements[0]

    assert(isinstance(s0, Influence))
    assert(s0.subj.name == 'cow')
    assert(s0.obj.name == 'moo')

    assert(len(s0.evidence) == 1)
    ev0 = s0.evidence[0]
    assert(ev0.source_api == 'bbn')
    assert(ev0.text == 'Cow causes moo.')

def test_negated_cause():
    """We only want to extract causal relations between two positive events.
    The processor should give no statements for a negated cause."""
    bp = process_json_file(test_file_negatedCause)
    assert(len(bp.statements) == 0)

def test_negated_effect():<commit_msg>Remove broken line from test<commit_after>from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from os.path import join, dirname
from nose.tools import raises
from indra.sources.bbn.bbn_api import *

from indra.statements import *

# Path to the BBN test file
path_this = os.path.dirname(os.path.abspath(__file__))
data_folder = os.path.join(path_this, '../../data/tests_data/bbn_tests_data')
test_file_simple = os.path.join(data_folder, 'bbn_test_simple.json-ld')
test_file_negatedCause = os.path.join(data_folder,
        'bbn_test_negatedCause.json-ld')
test_file_negatedEffect = os.path.join(data_folder,
        'bbn_test_negatedEffect.json-ld')

def test_simple_extraction():
    """Verify that  processor extracts a simple causal assertion correctly from
    a JSON-LD file."""
    bp = process_json_file(test_file_simple)
    statements = bp.statements

    assert(len(statements) == 1)
    s0 = statements[0]

    assert(isinstance(s0, Influence))
    assert(s0.subj.name == 'cow')
    assert(s0.obj.name == 'moo')

    assert(len(s0.evidence) == 1)
    ev0 = s0.evidence[0]
    assert(ev0.source_api == 'bbn')
    assert(ev0.text == 'Cow causes moo.')

def test_negated_cause():
    """We only want to extract causal relations between two positive events.
    The processor should give no statements for a negated cause."""
    bp = process_json_file(test_file_negatedCause)
    assert(len(bp.statements) == 0)

def test_negated_effect():
{'fraction_non_alphanumeric': 0.10986842105263157, 'fraction_numerical': 0.009210526315789473, 'mean_word_length': 4.4014209591474245, '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': '6402090', 'n_tokens_mistral': 1048, 'n_tokens_neox': 1002, 'n_words': 238}