<commit_before># -*- coding: utf-8 -*-

import os
import unittest

import networkx as nx

from pybel.parser.utils import cartesian_dictionary
from pybel.resources.document import sanitize_file_lines
from pybel.utils import ensure_quotes, subdict_matches
from tests.constants import any_subdict_matches

dir_path = os.path.dirname(os.path.realpath(__file__))


class TestSubdictMatching(unittest.TestCase):
    def test_dict_matches_1(self):
        target = {
            'k1': 'v1',
            'k2': 'v2'
        }
        query = {
            'k1': 'v1',
            'k2': 'v2'
        }
        self.assertTrue(subdict_matches(target, query))

    def test_dict_matches_2(self):
        target = {
            'k1': 'v1',
            'k2': 'v2',<commit_msg>Remove unused import<commit_after># -*- coding: utf-8 -*-

import os
import unittest

import networkx as nx

from pybel.resources.document import sanitize_file_lines
from pybel.utils import ensure_quotes, subdict_matches
from tests.constants import any_subdict_matches

dir_path = os.path.dirname(os.path.realpath(__file__))


class TestSubdictMatching(unittest.TestCase):
    def test_dict_matches_1(self):
        target = {
            'k1': 'v1',
            'k2': 'v2'
        }
        query = {
            'k1': 'v1',
            'k2': 'v2'
        }
        self.assertTrue(subdict_matches(target, query))

    def test_dict_matches_2(self):
        target = {
            'k1': 'v1',
            'k2': 'v2',
{'fraction_non_alphanumeric': 0.11494252873563218, 'fraction_numerical': 0.02028397565922921, 'mean_word_length': 2.4660421545667446, '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': '5869055', 'n_tokens_mistral': 489, 'n_tokens_neox': 487, 'n_words': 103}