diff --git a/.github/workflows/qe_mp-coverage.yml b/.github/workflows/qe_mp-coverage.yml new file mode 100644 index 0000000..f0fb7aa --- /dev/null +++ b/.github/workflows/qe_mp-coverage.yml @@ -0,0 +1,51 @@ +name: "Riksdagen Persons: Estimate MP coverage" + +on: + pull_request: + branches: + - 'dev' + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.8] + steps: + - name: Checkout PR source branch + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pyriksdagen + + - name: Estimate MP coverage + run: | + python quality/qe_mp-coverage.py + + - name: Plot MP coverage + run: | + python quality/plot/mp-coverage/mp-coverage.py + + - name: Add and commit changes + run: | + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add quality/estimates/mp-coverage/coverage-summary.txt + git add quality/estimates/mp-coverage/mp-coverage.csv + git add quality/estimates/mp-coverage/*.png + git commit --allow-empty -m "chore: update MP coverage" + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.head_ref }} diff --git a/docs/dark-mode/syntax-highlighting.css b/docs/dark-mode/syntax-highlighting.css new file mode 100644 index 0000000..b0a7fe3 --- /dev/null +++ b/docs/dark-mode/syntax-highlighting.css @@ -0,0 +1,80 @@ +/* monokai color scheme, see pdoc/template/README.md */ +pre { line-height: 125%; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 20px; } +.pdoc-code .hll { background-color: #49483e } +.pdoc-code { background: #272822; color: #f8f8f2 } +.pdoc-code .c { color: #75715e } /* Comment */ +.pdoc-code .err { color: #960050; background-color: #1e0010 } /* Error */ +.pdoc-code .esc { color: #f8f8f2 } /* Escape */ +.pdoc-code .g { color: #f8f8f2 } /* Generic */ +.pdoc-code .k { color: #66d9ef } /* Keyword */ +.pdoc-code .l { color: #ae81ff } /* Literal */ +.pdoc-code .n { color: #f8f8f2 } /* Name */ +.pdoc-code .o { color: #f92672 } /* Operator */ +.pdoc-code .x { color: #f8f8f2 } /* Other */ +.pdoc-code .p { color: #f8f8f2 } /* Punctuation */ +.pdoc-code .ch { color: #75715e } /* Comment.Hashbang */ +.pdoc-code .cm { color: #75715e } /* Comment.Multiline */ +.pdoc-code .cp { color: #75715e } /* Comment.Preproc */ +.pdoc-code .cpf { color: #75715e } /* Comment.PreprocFile */ +.pdoc-code .c1 { color: #75715e } /* Comment.Single */ +.pdoc-code .cs { color: #75715e } /* Comment.Special */ +.pdoc-code .gd { color: #f92672 } /* Generic.Deleted */ +.pdoc-code .ge { color: #f8f8f2; font-style: italic } /* Generic.Emph */ +.pdoc-code .gr { color: #f8f8f2 } /* Generic.Error */ +.pdoc-code .gh { color: #f8f8f2 } /* Generic.Heading */ +.pdoc-code .gi { color: #a6e22e } /* Generic.Inserted */ +.pdoc-code .go { color: #66d9ef } /* Generic.Output */ +.pdoc-code .gp { color: #f92672; font-weight: bold } /* Generic.Prompt */ +.pdoc-code .gs { color: #f8f8f2; font-weight: bold } /* Generic.Strong */ +.pdoc-code .gu { color: #75715e } /* Generic.Subheading */ +.pdoc-code .gt { color: #f8f8f2 } /* Generic.Traceback */ +.pdoc-code .kc { color: #66d9ef } /* Keyword.Constant */ +.pdoc-code .kd { color: #66d9ef } /* Keyword.Declaration */ +.pdoc-code .kn { color: #f92672 } /* Keyword.Namespace */ +.pdoc-code .kp { color: #66d9ef } /* Keyword.Pseudo */ +.pdoc-code .kr { color: #66d9ef } /* Keyword.Reserved */ +.pdoc-code .kt { color: #66d9ef } /* Keyword.Type */ +.pdoc-code .ld { color: #e6db74 } /* Literal.Date */ +.pdoc-code .m { color: #ae81ff } /* Literal.Number */ +.pdoc-code .s { color: #e6db74 } /* Literal.String */ +.pdoc-code .na { color: #a6e22e } /* Name.Attribute */ +.pdoc-code .nb { color: #f8f8f2 } /* Name.Builtin */ +.pdoc-code .nc { color: #a6e22e } /* Name.Class */ +.pdoc-code .no { color: #66d9ef } /* Name.Constant */ +.pdoc-code .nd { color: #a6e22e } /* Name.Decorator */ +.pdoc-code .ni { color: #f8f8f2 } /* Name.Entity */ +.pdoc-code .ne { color: #a6e22e } /* Name.Exception */ +.pdoc-code .nf { color: #a6e22e } /* Name.Function */ +.pdoc-code .nl { color: #f8f8f2 } /* Name.Label */ +.pdoc-code .nn { color: #f8f8f2 } /* Name.Namespace */ +.pdoc-code .nx { color: #a6e22e } /* Name.Other */ +.pdoc-code .py { color: #f8f8f2 } /* Name.Property */ +.pdoc-code .nt { color: #f92672 } /* Name.Tag */ +.pdoc-code .nv { color: #f8f8f2 } /* Name.Variable */ +.pdoc-code .ow { color: #f92672 } /* Operator.Word */ +.pdoc-code .w { color: #f8f8f2 } /* Text.Whitespace */ +.pdoc-code .mb { color: #ae81ff } /* Literal.Number.Bin */ +.pdoc-code .mf { color: #ae81ff } /* Literal.Number.Float */ +.pdoc-code .mh { color: #ae81ff } /* Literal.Number.Hex */ +.pdoc-code .mi { color: #ae81ff } /* Literal.Number.Integer */ +.pdoc-code .mo { color: #ae81ff } /* Literal.Number.Oct */ +.pdoc-code .sa { color: #e6db74 } /* Literal.String.Affix */ +.pdoc-code .sb { color: #e6db74 } /* Literal.String.Backtick */ +.pdoc-code .sc { color: #e6db74 } /* Literal.String.Char */ +.pdoc-code .dl { color: #e6db74 } /* Literal.String.Delimiter */ +.pdoc-code .sd { color: #e6db74 } /* Literal.String.Doc */ +.pdoc-code .s2 { color: #e6db74 } /* Literal.String.Double */ +.pdoc-code .se { color: #ae81ff } /* Literal.String.Escape */ +.pdoc-code .sh { color: #e6db74 } /* Literal.String.Heredoc */ +.pdoc-code .si { color: #e6db74 } /* Literal.String.Interpol */ +.pdoc-code .sx { color: #e6db74 } /* Literal.String.Other */ +.pdoc-code .sr { color: #e6db74 } /* Literal.String.Regex */ +.pdoc-code .s1 { color: #e6db74 } /* Literal.String.Single */ +.pdoc-code .ss { color: #e6db74 } /* Literal.String.Symbol */ +.pdoc-code .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ +.pdoc-code .fm { color: #a6e22e } /* Name.Function.Magic */ +.pdoc-code .vc { color: #f8f8f2 } /* Name.Variable.Class */ +.pdoc-code .vg { color: #f8f8f2 } /* Name.Variable.Global */ +.pdoc-code .vi { color: #f8f8f2 } /* Name.Variable.Instance */ +.pdoc-code .vm { color: #f8f8f2 } /* Name.Variable.Magic */ diff --git a/docs/dark-mode/theme.css b/docs/dark-mode/theme.css new file mode 100644 index 0000000..1dfe7c4 --- /dev/null +++ b/docs/dark-mode/theme.css @@ -0,0 +1,20 @@ +:root { + --pdoc-background: #212529; +} + +.pdoc { + --text: #f7f7f7; + --muted: #9d9d9d; + --link: #58a6ff; + --link-hover: #3989ff; + --code: #333; + --active: #555; + + --accent: #343434; + --accent2: #555; + + --nav-hover: rgba(0, 0, 0, 0.1); + --name: #77C1FF; + --def: #0cdd0c; + --annotation: #00c037; +} diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..23abfd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/riksdagen-persons.html b/docs/riksdagen-persons.html new file mode 100644 index 0000000..c7feed4 --- /dev/null +++ b/docs/riksdagen-persons.html @@ -0,0 +1,450 @@ + + + + + + + riksdagen-persons API documentation + + + + + + + + + +
+
+

+riksdagen-persons

+ +

Riksdagen Persons

+ +

This repository contains data related to Members of Parliament, Ministers, Speakers, and other Political figures who participate in the workings of the Riksdag.

+ +

Repo Structure

+ +

The data/ directory

+ +

Contains metadata on individuals.

+ +

The test/ directory

+ +

Contains integrity tests related to the riksdagen-persons repository and to the estimation of quality and coverage of the data in data/.

+ +

Data

+ +

The data/ directory contains a number of csv files in Normal form where the person_id served as a primary key.

+ +

data/chair_mp.csv

+ +
    +
  • chair_id
  • +
  • parliament_year
  • +
  • start
  • +
  • end
  • +
  • person_id
  • +
+ +

data/chairs.csv

+ +
    +
  • chair_id
  • +
  • chamber
  • +
  • chair_nr
  • +
+ +

data/described_by_source.csv

+ +
    +
  • person_id
  • +
  • source
  • +
  • volume
  • +
+ +

data/explicit_no_party.csv

+ +
    +
  • person_id
  • +
  • wiki_id
  • +
  • pages
  • +
  • ref
  • +
  • vol
  • +
+ +

data/external_identifiers.csv

+ +
    +
  • person_id
  • +
  • authority
  • +
  • identifier
  • +
+ +

data/government.csv

+ +
    +
  • start
  • +
  • end
  • +
  • government
  • +
  • government_id
  • +
+ +

data/location_specifier.csv

+ +
    +
  • person_id
  • +
  • location
  • +
+ +

data/member_of_parliament.csv

+ +
    +
  • person_id
  • +
  • start
  • +
  • end
  • +
  • district
  • +
  • role
  • +
+ +

data/minister.csv

+ +
    +
  • person_id
  • +
  • start
  • +
  • end
  • +
  • government
  • +
  • role
  • +
+ +

data/name.csv

+ +
    +
  • person_id
  • +
  • name
  • +
  • primary_name
  • +
+ +

data/party_abbreviation.csv

+ +
    +
  • party
  • +
  • abbreviation
  • +
  • ocr_correction
  • +
+ +

data/party_affiliation.csv

+ +
    +
  • person_id
  • +
  • start
  • +
  • end
  • +
  • party
  • +
  • party_id
  • +
+ +

data/person.csv

+ +
    +
  • person_id
  • +
  • born
  • +
  • dead
  • +
  • gender
  • +
  • riksdagen_id
  • +
+ +

data/place_of_birth.csv

+ +
    +
  • person_id
  • +
  • link
  • +
  • place
  • +
+ +

data/place_of_death.csv

+ +
    +
  • person_id
  • +
  • link
  • +
  • place
  • +
+ +

data/portraits.csv

+ +
    +
  • person_id
  • +
  • portrait
  • +
+ +

data/references_map.csv

+ +
    +
  • person_id
  • +
  • bibtex_key
  • +
  • wiki_id
  • +
  • page
  • +
+ +

data/riksdag-year.csv

+ +
    +
  • parliament_year
  • +
  • specifier
  • +
  • chamber
  • +
  • start
  • +
  • end
  • +
+ +

data/speaker.csv

+ +
    +
  • person_id
  • +
  • start
  • +
  • end
  • +
  • role
  • +
+ +

data/twitter.csv

+ +
    +
  • person_id
  • +
  • twitter
  • +
+ +

data/wiki_id.csv

+ +
    +
  • person_id
  • +
  • wiki_id
  • +
+
+ + + + + +
1"""
+2.. include:: README.md
+3"""
+
+ + +
+
+ + \ No newline at end of file diff --git a/docs/riksdagen-persons/quality.html b/docs/riksdagen-persons/quality.html new file mode 100644 index 0000000..4767191 --- /dev/null +++ b/docs/riksdagen-persons/quality.html @@ -0,0 +1,309 @@ + + + + + + + riksdagen-persons.quality API documentation + + + + + + + + + +
+
+

+riksdagen-persons.quality

+ +

Riksdagen Persons: Quality Estimates

+ +

This directory contains code and data related to estimating the quality of the Riksdagen Persons metadata corpus, along with the estimates themselves.

+ +

What's here?

+ +

./

+ +

Python code used to estimate various quality dimensions.

+ +
    +
  • qe_mp-coverage.py : Estimates coverage of MPs over time
  • +
+ +

Support files

+ +
    +
  • README.md : this file
  • +
  • __init__.py : used for building the documentation
  • +
+ +

data/

+ +

Contains data necessary to run the quality estimation code.

+ +

docs/

+ +

Contains explanation and justifications for each quality dimension.

+ +

estimates/

+ +

Contains versioned output of quality estimations.

+ +

plot/

+ +

Contains code for generating plots from the estimate results

+ +

Individual Quality Estimates

+ +

MP Coverage -- qe_mp-coverage.py

+ +

We want to know that we have the correct number of MPs in the metadata for each parliament year and chamber.

+ +

+
+ + + + + +
 1"""
+ 2.. include:: README.md
+ 3
+ 4## Individual Quality Estimates
+ 5
+ 6### MP Coverage -- `qe_mp-coverage.py`
+ 7
+ 8.. include:: docs/qe_mp-coverage.md
+ 9    :start-after: Summary
+10    :end-before: What is the problem
+11"""
+
+ + +
+
+ + \ No newline at end of file diff --git a/docs/riksdagen-persons/quality/qe_mp-coverage.html b/docs/riksdagen-persons/quality/qe_mp-coverage.html new file mode 100644 index 0000000..8b31d1b --- /dev/null +++ b/docs/riksdagen-persons/quality/qe_mp-coverage.html @@ -0,0 +1,722 @@ + + + + + + + riksdagen-persons.quality.qe_mp-coverage API documentation + + + + + + + + + +
+
+

+riksdagen-persons.quality.qe_mp-coverage

+ +

Calculates MP coverage and generates plots.

+
+ + + + + +
  1#!/usr/bin/env python3
+  2"""
+  3Calculates MP coverage and generates plots.
+  4"""
+  5from pyriksdagen.metadata import load_Corpus_metadata
+  6from pyriksdagen.utils import get_data_location
+  7from tqdm import tqdm
+  8import argparse
+  9import datetime as dt
+ 10import pandas as pd
+ 11
+ 12
+ 13baselines = {
+ 14    "ak":0,
+ 15    "fk":0,
+ 16    "ek":0
+ 17}
+ 18ledamot_map = {
+ 19    "fk": 1,
+ 20    "ak": 2,
+ 21    "ek": 0
+ 22}
+ 23skip = [
+ 24    '1909/prot-1909----reg-01.xml',
+ 25    '1909/prot-1909----reg-02.xml',
+ 26    '197677/prot-197677--.xml',
+ 27    '197677/prot-197778--.xml',
+ 28]
+ 29
+ 30
+ 31
+ 32
+ 33def is_within_tolerance(nmp, baseline):
+ 34    ratio = nmp/baseline
+ 35    #print(f" ---> R: {ratio}")
+ 36    if ratio > 1.1:
+ 37        return False, ratio
+ 38    elif ratio > 0.9:
+ 39        return True, ratio
+ 40    else:
+ 41        return False, ratio
+ 42
+ 43
+ 44def get_spec(protocol_path):
+ 45    spec = None
+ 46    spl = protocol_path.split('/')[-1].split('-')
+ 47    if len(spl) == 4:
+ 48        return spec
+ 49    else:
+ 50        if len(spl[2]) > 0:
+ 51            spec = spl[2]
+ 52        return spec
+ 53
+ 54
+ 55def mk_py(row):
+ 56    if pd.isna(row['spec']):
+ 57        return row['year']
+ 58    else:
+ 59        return str(row['year']) + row['spec']
+ 60
+ 61
+ 62def get_ch(protocol_path):
+ 63    chamber = None
+ 64    spl = protocol_path.split('/')[-1].split('-')
+ 65    if len(spl) == 4:
+ 66        chamber = "ek"
+ 67    else:
+ 68        chamber = spl[3]
+ 69    return chamber
+ 70
+ 71
+ 72def get_baseline(row, baseline_df):
+ 73    y = row['year']
+ 74    c = row['chamber']
+ 75    fdf = baseline_df.loc[(baseline_df['year'] == y) & (baseline_df['chamber'] == c)].copy()
+ 76    fdf.reset_index(inplace=True)
+ 77    return fdf.at[0, "n_mps"]
+ 78
+ 79
+ 80
+ 81
+ 82def main(args):
+ 83
+ 84    print("checking MP coverage...")
+ 85    baseline_df = pd.read_csv("test/data/baseline-n-mps-year.csv")
+ 86    baseline_df['year'] = baseline_df['year'].apply(lambda x: str(x)[:4])
+ 87
+ 88    dates = pd.read_csv("test/data/session-dates.csv", sep=";")
+ 89    dates = dates[~dates['protocol'].isin(skip)]
+ 90    dates = dates[~dates['date'].isin(["2021", "1977"])]
+ 91
+ 92    for _ in ["N_MP", "passes_test", "almost_passes_test",
+ 93              "ratio", "year", "spec", "parliament_year",
+ 94              "chamber", "baseline_N", "MEPs"]:
+ 95        if _ not in dates.columns:
+ 96            dates[_] = None
+ 97
+ 98    dates["year"] = dates["protocol"].apply(lambda x: str(x.split('/')[0][:4]))
+ 99    dates["spec"] = dates["protocol"].apply(lambda x: get_spec(x))
+100    dates["parliament_year"] = dates.apply(mk_py, axis=1)
+101    dates['chamber'] = dates['protocol'].apply(lambda x: get_ch(x))
+102    dates['baseline_N'] = dates.apply(get_baseline, args=(baseline_df,), axis=1)
+103
+104    corpus_meta = load_Corpus_metadata(metadata_folder='data')
+105    mp_meta = corpus_meta[corpus_meta['source'] == 'member_of_parliament']
+106    mp_meta = mp_meta[mp_meta.start.notnull()]
+107
+108    mp_meta['start'] = mp_meta['start'].apply(lambda x: pd.to_datetime(x, format='%Y-%m-%d', errors='ignore'))
+109    mp_meta['end'] = mp_meta['end'].apply(lambda x: pd.to_datetime(x, format='%Y-%m-%d', errors='ignore'))
+110
+111    print(mp_meta[['start', 'end']].describe())
+112
+113    filtered_DFs = {}
+114    for k, v in ledamot_map.items():
+115        filtered_DFs[k] = mp_meta.loc[mp_meta['chamber'] == v]
+116
+117    shouldnt_happen = 0
+118
+119    with tqdm(total=len(dates)) as prgbr:
+120        for i, r in dates.iterrows():
+121            N_MP = 0
+122            chamber = r['chamber']
+123            MEPs = []
+124            if not pd.isna(chamber):
+125                parliament_day = r['date']
+126                baseline = r['baseline_N']
+127                prgbr.set_postfix_str(f"{chamber} / {r['parliament_year']} / {shouldnt_happen}")
+128
+129                if len(parliament_day) == 10:
+130                    #print(r['date'], type(r['date']))
+131                    day = dt.datetime.strptime(r['date'], '%Y-%m-%d')
+132                    year = day.year
+133
+134                    sub_df = filtered_DFs[chamber]
+135                    sub_df = sub_df[sub_df["start"] <= day]
+136                    sub_df = sub_df[sub_df["end"] > day]
+137
+138                    N_MP = len(sub_df["person_id"].unique())
+139                    MEPs = list(sub_df["person_id"].unique())
+140
+141                dates.at[i, 'N_MP'] = N_MP
+142
+143                if N_MP != 0:
+144                    if N_MP == r['baseline_N']:
+145                        dates.at[i, 'passes_test'] = True
+146                        dates.at[i, 'almost_passes_test'], dates.at[i, "ratio"] = is_within_tolerance(N_MP, baseline)
+147                    else:
+148                        dates.at[i, 'passes_test'] = False
+149                        dates.at[i, 'almost_passes_test'], dates.at[i, "ratio"] = is_within_tolerance(N_MP, baseline)
+150                else:
+151                    dates.at[i, 'passes_test'] = False
+152                    dates.at[i, 'almost_passes_test'] = False
+153                    dates.at[i, "ratio"] = 0
+154            else:
+155                dates.at[i, 'passes_test'] = "None"
+156                dates.at[i, 'almost_passes_test'] = "None"
+157                dates.at[i, "ratio"] = "None"
+158            dates.at[i, "MEPs"] = list(MEPs)
+159            prgbr.update()
+160    dates = dates.sort_values(by=['protocol', 'date'], ignore_index=True)
+161    dates.to_csv("quality/estimates/mp-coverage/coverage.csv", index=False, sep=";")
+162
+163
+164
+165    total_passed = len(dates.loc[dates['passes_test'] == True])
+166    total_almost = len(dates.loc[dates['almost_passes_test'] == True])
+167    no_passdf = dates.loc[dates['almost_passes_test'] == False]
+168    total = len(dates)
+169    with open("quality/estimates/mp-coverage/coverage-summary.txt", "w+") as out:
+170        out.write(f"Of {total} parliament days, {total_passed} have correct N MPs in metadata: {total_passed/total}.\n")
+171        out.write(f"   {total_almost} pass or almost passed within the margin of error, i.e. +- 10%: {total_almost/total}.\n")
+172    print(f"Of {total} parliament days, {total_passed} have correct N MPs in metadata: {total_passed/total}.")
+173    print(f"   {total_almost} pass or almost passed within the margin of error, i.e. +- 10%: {total_almost/total}.")
+174
+175
+176
+177
+178if __name__ == '__main__':
+179    parser = argparse.ArgumentParser(description=__doc__)
+180    parser.add_argument("--metadata-path", type=str, default=None)
+181    args = parser.parse_args()
+182    main(args)
+
+ + +
+
+
+ baselines = +{'ak': 0, 'fk': 0, 'ek': 0} + + +
+ + + + +
+
+
+ ledamot_map = +{'fk': 1, 'ak': 2, 'ek': 0} + + +
+ + + + +
+
+
+ skip = + + ['1909/prot-1909----reg-01.xml', '1909/prot-1909----reg-02.xml', '197677/prot-197677--.xml', '197677/prot-197778--.xml'] + + +
+ + + + +
+
+ +
+ + def + is_within_tolerance(nmp, baseline): + + + +
+ +
34def is_within_tolerance(nmp, baseline):
+35    ratio = nmp/baseline
+36    #print(f" ---> R: {ratio}")
+37    if ratio > 1.1:
+38        return False, ratio
+39    elif ratio > 0.9:
+40        return True, ratio
+41    else:
+42        return False, ratio
+
+ + + + +
+
+ +
+ + def + get_spec(protocol_path): + + + +
+ +
45def get_spec(protocol_path):
+46    spec = None
+47    spl = protocol_path.split('/')[-1].split('-')
+48    if len(spl) == 4:
+49        return spec
+50    else:
+51        if len(spl[2]) > 0:
+52            spec = spl[2]
+53        return spec
+
+ + + + +
+
+ +
+ + def + mk_py(row): + + + +
+ +
56def mk_py(row):
+57    if pd.isna(row['spec']):
+58        return row['year']
+59    else:
+60        return str(row['year']) + row['spec']
+
+ + + + +
+
+ +
+ + def + get_ch(protocol_path): + + + +
+ +
63def get_ch(protocol_path):
+64    chamber = None
+65    spl = protocol_path.split('/')[-1].split('-')
+66    if len(spl) == 4:
+67        chamber = "ek"
+68    else:
+69        chamber = spl[3]
+70    return chamber
+
+ + + + +
+
+ +
+ + def + get_baseline(row, baseline_df): + + + +
+ +
73def get_baseline(row, baseline_df):
+74    y = row['year']
+75    c = row['chamber']
+76    fdf = baseline_df.loc[(baseline_df['year'] == y) & (baseline_df['chamber'] == c)].copy()
+77    fdf.reset_index(inplace=True)
+78    return fdf.at[0, "n_mps"]
+
+ + + + +
+
+ +
+ + def + main(args): + + + +
+ +
 83def main(args):
+ 84
+ 85    print("checking MP coverage...")
+ 86    baseline_df = pd.read_csv("test/data/baseline-n-mps-year.csv")
+ 87    baseline_df['year'] = baseline_df['year'].apply(lambda x: str(x)[:4])
+ 88
+ 89    dates = pd.read_csv("test/data/session-dates.csv", sep=";")
+ 90    dates = dates[~dates['protocol'].isin(skip)]
+ 91    dates = dates[~dates['date'].isin(["2021", "1977"])]
+ 92
+ 93    for _ in ["N_MP", "passes_test", "almost_passes_test",
+ 94              "ratio", "year", "spec", "parliament_year",
+ 95              "chamber", "baseline_N", "MEPs"]:
+ 96        if _ not in dates.columns:
+ 97            dates[_] = None
+ 98
+ 99    dates["year"] = dates["protocol"].apply(lambda x: str(x.split('/')[0][:4]))
+100    dates["spec"] = dates["protocol"].apply(lambda x: get_spec(x))
+101    dates["parliament_year"] = dates.apply(mk_py, axis=1)
+102    dates['chamber'] = dates['protocol'].apply(lambda x: get_ch(x))
+103    dates['baseline_N'] = dates.apply(get_baseline, args=(baseline_df,), axis=1)
+104
+105    corpus_meta = load_Corpus_metadata(metadata_folder='data')
+106    mp_meta = corpus_meta[corpus_meta['source'] == 'member_of_parliament']
+107    mp_meta = mp_meta[mp_meta.start.notnull()]
+108
+109    mp_meta['start'] = mp_meta['start'].apply(lambda x: pd.to_datetime(x, format='%Y-%m-%d', errors='ignore'))
+110    mp_meta['end'] = mp_meta['end'].apply(lambda x: pd.to_datetime(x, format='%Y-%m-%d', errors='ignore'))
+111
+112    print(mp_meta[['start', 'end']].describe())
+113
+114    filtered_DFs = {}
+115    for k, v in ledamot_map.items():
+116        filtered_DFs[k] = mp_meta.loc[mp_meta['chamber'] == v]
+117
+118    shouldnt_happen = 0
+119
+120    with tqdm(total=len(dates)) as prgbr:
+121        for i, r in dates.iterrows():
+122            N_MP = 0
+123            chamber = r['chamber']
+124            MEPs = []
+125            if not pd.isna(chamber):
+126                parliament_day = r['date']
+127                baseline = r['baseline_N']
+128                prgbr.set_postfix_str(f"{chamber} / {r['parliament_year']} / {shouldnt_happen}")
+129
+130                if len(parliament_day) == 10:
+131                    #print(r['date'], type(r['date']))
+132                    day = dt.datetime.strptime(r['date'], '%Y-%m-%d')
+133                    year = day.year
+134
+135                    sub_df = filtered_DFs[chamber]
+136                    sub_df = sub_df[sub_df["start"] <= day]
+137                    sub_df = sub_df[sub_df["end"] > day]
+138
+139                    N_MP = len(sub_df["person_id"].unique())
+140                    MEPs = list(sub_df["person_id"].unique())
+141
+142                dates.at[i, 'N_MP'] = N_MP
+143
+144                if N_MP != 0:
+145                    if N_MP == r['baseline_N']:
+146                        dates.at[i, 'passes_test'] = True
+147                        dates.at[i, 'almost_passes_test'], dates.at[i, "ratio"] = is_within_tolerance(N_MP, baseline)
+148                    else:
+149                        dates.at[i, 'passes_test'] = False
+150                        dates.at[i, 'almost_passes_test'], dates.at[i, "ratio"] = is_within_tolerance(N_MP, baseline)
+151                else:
+152                    dates.at[i, 'passes_test'] = False
+153                    dates.at[i, 'almost_passes_test'] = False
+154                    dates.at[i, "ratio"] = 0
+155            else:
+156                dates.at[i, 'passes_test'] = "None"
+157                dates.at[i, 'almost_passes_test'] = "None"
+158                dates.at[i, "ratio"] = "None"
+159            dates.at[i, "MEPs"] = list(MEPs)
+160            prgbr.update()
+161    dates = dates.sort_values(by=['protocol', 'date'], ignore_index=True)
+162    dates.to_csv("quality/estimates/mp-coverage/coverage.csv", index=False, sep=";")
+163
+164
+165
+166    total_passed = len(dates.loc[dates['passes_test'] == True])
+167    total_almost = len(dates.loc[dates['almost_passes_test'] == True])
+168    no_passdf = dates.loc[dates['almost_passes_test'] == False]
+169    total = len(dates)
+170    with open("quality/estimates/mp-coverage/coverage-summary.txt", "w+") as out:
+171        out.write(f"Of {total} parliament days, {total_passed} have correct N MPs in metadata: {total_passed/total}.\n")
+172        out.write(f"   {total_almost} pass or almost passed within the margin of error, i.e. +- 10%: {total_almost/total}.\n")
+173    print(f"Of {total} parliament days, {total_passed} have correct N MPs in metadata: {total_passed/total}.")
+174    print(f"   {total_almost} pass or almost passed within the margin of error, i.e. +- 10%: {total_almost/total}.")
+
+ + + + +
+
+ + \ No newline at end of file diff --git a/docs/riksdagen-persons/test.html b/docs/riksdagen-persons/test.html new file mode 100644 index 0000000..42dbff0 --- /dev/null +++ b/docs/riksdagen-persons/test.html @@ -0,0 +1,243 @@ + + + + + + + riksdagen-persons.test API documentation + + + + + + + + + +
+
+

+riksdagen-persons.test

+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/riksdagen-persons/test/chairs.html b/docs/riksdagen-persons/test/chairs.html new file mode 100644 index 0000000..f92e00f --- /dev/null +++ b/docs/riksdagen-persons/test/chairs.html @@ -0,0 +1,2865 @@ + + + + + + + riksdagen-persons.test.chairs API documentation + + + + + + + + + +
+
+

+riksdagen-persons.test.chairs

+ +

Test chars and chair-mp mapping metadata

+
+ + + + + +
  1#!/usr/bin/env python3
+  2"""
+  3Test chars and chair-mp mapping metadata
+  4"""
+  5from datetime import datetime
+  6from pyriksdagen.date_handling import yearize_mandates
+  7from pytest_cfg_fetcher.fetch import fetch_config
+  8import json
+  9import pandas as pd
+ 10import unittest
+ 11import warnings
+ 12import sys
+ 13
+ 14
+ 15
+ 16
+ 17class ChairHog(Warning):
+ 18
+ 19    def __init__(self, m):
+ 20        self.message = "\n" + f"The following MPs sit in two chairs in {m}:."
+ 21
+ 22    def __str__(self):
+ 23        return self.message
+ 24
+ 25
+ 26class ChairInWrongTimePeriod(Warning):
+ 27
+ 28    def __init__(self, m):
+ 29        self.message = f"There is {m}."
+ 30
+ 31    def __str__(self):
+ 32        return self.message
+ 33
+ 34
+ 35class ChairMissingFromRange(Warning):
+ 36
+ 37    def __init__(self, m):
+ 38        self.message = f" in {m} is missing."
+ 39
+ 40    def __str__(self):
+ 41        return self.message
+ 42
+ 43
+ 44class ChairOutOfRange(Warning):
+ 45
+ 46    def __init__(self, chamber):
+ 47        self.message = f"There are chairs that are not within the acceptable range of the chamber: {chamber}."
+ 48
+ 49    def __str__(self):
+ 50        return self.message
+ 51
+ 52
+ 53class ChairYearOutOfRange(Warning):
+ 54
+ 55    def __init__(self, m):
+ 56        self.message = f"In {m} <-- chair is missing."
+ 57
+ 58    def __str__(self):
+ 59        return self.message
+ 60
+ 61
+ 62class DuplicateIDWarning(Warning):
+ 63
+ 64    def __init__(self, m):
+ 65        self.message = f"{m}"
+ 66
+ 67    def __str__(self):
+ 68        return self.message
+ 69
+ 70
+ 71class EmptyChair(Warning):
+ 72
+ 73    def __init__(self, m):
+ 74        self.message = "\n" + f"The following chairs are empty in in {m}:."
+ 75
+ 76    def __str__(self):
+ 77        return self.message
+ 78
+ 79
+ 80class KnaMP(Warning):
+ 81
+ 82    def __init__(self, m):
+ 83        self.message = "\n" + f"The following chairs are occupied by more than one person at the same time in {m}:."
+ 84
+ 85    def __str__(self):
+ 86        return self.message
+ 87
+ 88
+ 89
+ 90
+ 91class Test(unittest.TestCase):
+ 92    #
+ 93    #  --->  get var fns
+ 94    #  -----------------
+ 95    #
+ 96    #  read in chairs.csv
+ 97    def get_chairs(self):
+ 98        return pd.read_csv("data/chairs.csv")
+ 99
+100    #  read in chair_mp.csv
+101    def get_chair_mp(self):
+102        return pd.read_csv("data/chair_mp.csv")
+103
+104    # read in mep metadata
+105    def get_mep(self):
+106        df = pd.read_csv("data/member_of_parliament.csv")
+107        return df.rename(columns={"start": "meta_start", "end":"meta_end"})
+108
+109    # read in parliament start end dates
+110    def get_riksdag_year(self):
+111        return pd.read_csv("data/riksdag-year.csv")
+112
+113    #  set max values for each chamber
+114    def get_max_chair(self):
+115        max_chair = {
+116            'ak':233,
+117            'fk':151,
+118            'ek':350
+119        }
+120        return max_chair
+121
+122    #  Out of range chair for specific years
+123    def get_oor_year(self):
+124        oor_year = {
+125            '1957':
+126                    [    # until 1957 -- if year < 1957
+127                    '814127872a174909bd6ecaeaf59290fe',  # a231
+128                    'd423710cb9e64b17b93484e120f07e66',  # a232
+129                    'c77cdeebf789416e98cf8afb05b75a23',  # a233
+130                    '34ad45b358764a388b53c45ae1ce3681'   # f151
+131                    ],
+132            '1959':
+133                    [    # until 1959 -- elif year < 1959
+134                    '814127872a174909bd6ecaeaf59290fe',  # a231
+135                    'd423710cb9e64b17b93484e120f07e66',  # a232
+136                    'c77cdeebf789416e98cf8afb05b75a23'   # a233
+137                    ],
+138            '1961':
+139                    [    # unitl 1961 -- elif year < 1961
+140                    'd423710cb9e64b17b93484e120f07e66',  # a232
+141                    'c77cdeebf789416e98cf8afb05b75a23'   # a233
+142                    ],
+143            '1965':
+144                    [    # until 1965 -- elif year < 1965
+145                    'c77cdeebf789416e98cf8afb05b75a23'   # a233
+146                    ],
+147            '7677':
+148                    [    # from 197677
+149                    'af0ebaa9aed64c2d91750aa72651ea74'   # e350
+150                    ]
+151        }
+152        return oor_year
+153
+154    #
+155    #  --->  misc fns
+156    #  --------------
+157    #
+158    def get_duplicated_items(self, l):
+159        """
+160        return duplicates in a list
+161        """
+162        seen = set()
+163        return [_ for _ in l if _ in seen or seen.add(_)]
+164
+165
+166    def what_time_it_is(self):
+167        """
+168        get formatted datetimestring
+169        """
+170        return datetime.now().strftime('%Y%m%d-%H%M%S')
+171
+172
+173    #
+174    #  --->  Test integrity of chairs data
+175    #  -------------------------------------------
+176    #
+177    #@unittest.skip
+178    def test_unique_chair_id(self):
+179        """
+180        check chair IDs are unique
+181        """
+182        print("Testing: chairs have unique IDs")
+183        chairs = self.get_chairs()
+184        chair_ids = chairs['chair_id'].values
+185        if len(chair_ids) != len(set(chair_ids)):
+186            warnings.warn("There's probably a duplicate chair ID.", DuplicateIDWarning)
+187        self.assertEqual(len(chair_ids), len(set(chair_ids)))
+188
+189    #@unittest.skip
+190    def test_chair_nrs_in_range(self):
+191        """
+192        check no chairs are numbered higher than the max chair nr for that chamber
+193        """
+194        print("Testing: chairs within max range for chamber")
+195        chairs = self.get_chairs()
+196        max_chair = self.get_max_chair()
+197        for k, v in max_chair.items():
+198            oor_chairs = chairs.loc[(chairs['chamber'] == k) & (chairs['chair_nr'] > v)]
+199            if len(oor_chairs) > 0:
+200                warnings.warn(k, ChairOutOfRange)
+201            self.assertEqual(len(oor_chairs), 0)
+202
+203    #
+204    #  --->  Test integrity of chair_mp mapping
+205    #  --------------------------------
+206    #
+207    #@unittest.skip
+208    def test_chair_id_sets(self):
+209        """
+210        check chair IDs in chair_mp are the same set as chairs
+211        """
+212        print("Testing: chair ids are the same set in chairs.csv and chair_mp.csv")
+213        chairs = self.get_chairs()
+214        chair_mp = self.get_chair_mp()
+215        chair_ids_a = chairs['chair_id'].unique()
+216        chair_ids_b = chair_mp['chair_id'].unique()
+217        if set(chair_ids_a) != set(chair_ids_b):
+218            warnings.warn(ChairIDMismatchW)
+219        self.assertEqual(len(chair_ids_a), len(chair_ids_b))
+220
+221    #@unittest.skip
+222    def test_chair_chambertime_concurrence(self):
+223        """
+224        check no chairs from tvåkammartiden are used in enkammartid and vice-versa
+225        """
+226        print("Testing: no chairs from tvåkammartiden are used in enkammartid and vice-versa")
+227        chairs = self.get_chairs()
+228        config = fetch_config("chairs")
+229        tvok_chairs = chairs.loc[chairs['chamber'] != 'ek', 'chair_id'].unique()
+230        enk_chairs =  chairs.loc[chairs['chamber'] == 'ek', 'chair_id'].unique()
+231        chair_mp = self.get_chair_mp()
+232        tvok_chair_mp_chairs = chair_mp.loc[
+233            chair_mp['parliament_year'] < 1971,
+234            'chair_id'
+235        ].unique()
+236        enk_chair_mp_chairs = chair_mp.loc[
+237            chair_mp['parliament_year'] > 1970,
+238            'chair_id'
+239        ].unique()
+240        tkc_in_enkt = []           # tvåkammar chair in enkammartid
+241        ekc_in_tvkt = []           # enkammar chair in tvåkammartid
+242        for c in tvok_chair_mp_chairs:
+243            if c in enk_chairs:
+244                ekc_in_tvkt.append(c)
+245        for c in enk_chair_mp_chairs:
+246            if c in tvok_chairs:
+247                tkc_in_enkt.append(c)
+248        if len(tkc_in_enkt) > 0:
+249            warnings.warn('tvåkammar chair in enkammartid',ChairInWrongTimePeriod)
+250            if config and config['write_tkc_in_enkt']:
+251                with open(f"{config['test_out_dir']}/{self.what_time_it_is()}_tkc_in_enkt.txt", "w+") as o:
+252                    [o.write(f"{_}\n") for _ in tkc_in_enkt]
+253        if len(ekc_in_tvkt) > 0:
+254            warnings.warn('enkammar chair in tvåkammartid', ChairInWrongTimePeriod)
+255            if config and config['write_ekc_in_tvkt']:
+256                with open(f"{config['test_out_dir']}/{self.what_time_it_is()}_ekc_in_tvkt.txt", "w+") as o:
+257                    [o.write(f"{_}\n") for _ in ekc_in_tvkt]
+258        self.assertEqual(len(tkc_in_enkt), 0)
+259        self.assertEqual(len(ekc_in_tvkt), 0)
+260
+261    #@unittest.skip
+262    def test_chair_nrs_in_range_for_year(self):
+263        """
+264        check that chairs are within acceptable range for a given year
+265           and that every seat within that range is present at least once
+266           in the chair_mp file (whether filled or not)
+267        """
+268        print("Testing: chairs are within acceptable range for a given year\n     and that every seat within that range is present at least once")
+269        chairs = self.get_chairs()
+270        config = fetch_config("chairs")
+271        tvok_chairs = chairs.loc[chairs['chamber'] != 'ek', 'chair_id'].unique()
+272        enk_chairs = chairs.loc[chairs['chamber'] == 'ek', 'chair_id'].unique()
+273        chair_mp = self.get_chair_mp()
+274        oor_year = self.get_oor_year()
+275        rd_years = chair_mp['parliament_year'].unique()
+276        OutOfRange = []
+277        missing_in_R = []
+278        for y in rd_years:
+279            year_chair_mp_chairs = chair_mp.loc[
+280                chair_mp['parliament_year'] == y,
+281                'chair_id'
+282            ].unique()
+283            excludes = []
+284            if y < 1971:
+285                if y <= 1957:
+286                    excludes = oor_year['1957']
+287                elif y < 1959:
+288                    excludes = oor_year['1959']
+289                elif y < 1961:
+290                    excludes = oor_year['1961']
+291                elif y < 1965:
+292                    excludes = oor_year['1965']
+293                if len(excludes) > 0:
+294                    for x in excludes:
+295                        if x in year_chair_mp_chairs:
+296                            OutOfRange.append([y, x])
+297                            warnings.warn(f"{y}: {x}", ChairYearOutOfRange)
+298                if len(tvok_chairs) > len(year_chair_mp_chairs)+len(excludes):
+299                    for c in tvok_chairs:
+300                        if c not in year_chair_mp_chairs and c not in excludes:
+301                            missing_in_R.append([y, c])
+302                            warnings.warn(f"{y}: {c}", ChairMissingFromRange)
+303                elif len(tvok_chairs) > len(year_chair_mp_chairs)+len(excludes):
+304                    self.assertFalse(True, "¡Sth is super wrong!")
+305            else:
+306                if y > 197576 or y == 1980:
+307                    excludes = oor_year['7677']
+308                if len(excludes) > 0:
+309                    for x in excludes:
+310                        if x in year_chair_mp_chairs:
+311                            OutOfRange.append([y, x])
+312                            warnings.warn(f"{y}: {x}", ChairYearOutOfRange)
+313                if len(enk_chairs) < len(year_chair_mp_chairs)+len(excludes):
+314                    for c in tvok_chairs:
+315                        if c not in year_chair_mp_chairs and c not in excludes:
+316                            missing_in_R.append([y, c])
+317                            warnings.warn(f"{y}: {c}", ChairMissingFromRange)
+318                elif len(enk_chairs) > len(year_chair_mp_chairs)+len(excludes):
+319                    self.assertFalse(True, "¡Sth is super wrong!")
+320        if len(OutOfRange) > 0:
+321            if config and config["write_chair_nrs_in_range"]:
+322                df = pd.DataFrame(OutOfRange, columne=["year", "chair"])
+323                df.to_csv(
+324                    f"{config['test_out_dir']}/{what_time_it_is}_chair-OOR.csv",
+325                    sep=';',
+326                    index=False)
+327        if len(missing_in_R) > 0:
+328            if config and config["write_chair_nrs_in_range"]:
+329                df = pd.DataFrame(missing_in_R, columne=["year", "chair"])
+330                df.to_csv(
+331                    f"{config['test_out_dir']}/{self.what_time_it_is()}_chair-missing-in-R.csv",
+332                    sep=';',
+333                    index=False)
+334        self.assertEqual(len(OutOfRange), 0)
+335        self.assertEqual(len(missing_in_R), 0)
+336
+337    #
+338    #  --->  Test integrity of bum to chair mapping
+339    # ---------------------------------------------
+340    #
+341    @unittest.skip
+342    def test_chair_hogs(self):
+343        """
+344        check no single person sits in two places at once
+345        """
+346        print("Testing: no single person sits in two places at once")
+347        chair_mp = self.get_chair_mp()
+348        chair_mp.rename(columns={"start": "chair_start", "end":"chair_end"}, inplace=True)
+349        chair_mp = chair_mp[chair_mp["person_id"].notna()]
+350        chairs = self.get_chairs()
+351        chair_mp = pd.merge(chair_mp, chairs, on="chair_id", how="left")
+352        mep_by_year = yearize_mandates()
+353        mep_by_year.rename(columns={"start": "meta_start", "end":"meta_end"}, inplace=True)
+354        mep_by_year = mep_by_year[mep_by_year["meta_start"].notna()]
+355        config = fetch_config("chairs")
+356        if config and config['write_ch_chmp_merge']:
+357            mep_by_year.to_csv(
+358                f"{config['test_out_dir']}/{self.what_time_it_is()}_chair-chairmp_merge.csv",
+359                sep=';',
+360                index=False)
+361        chair_mp = pd.merge(chair_mp, mep_by_year, on=["person_id", "parliament_year"], how="left")
+362
+363        if config and config['write_trouble_matching']:
+364            outdf = chair_mp.loc[pd.isna(chair_mp["role"])].copy()
+365            if not outdf.empty:
+366                outdf.to_csv(
+367                    f"{config['test_out_dir']}/{self.what_time_it_is()}_trouble-matching-yearize.csv",
+368                    sep=';',
+369                    index=False)
+370
+371        general_start_end = self.get_riksdag_year()
+372        no_chair_hogs = True
+373        counter = 0
+374        ddups = []
+375        issues = pd.DataFrame(columns=chair_mp.columns)
+376        for y in chair_mp['parliament_year'].unique():
+377            year_chair_mp = chair_mp.loc[chair_mp['parliament_year'] == y]
+378            yse = general_start_end.loc[general_start_end['parliament_year'] == y].copy()
+379            yse.reset_index(drop=True, inplace=True)
+380            yse.sort_values(by=["chamber", "start", "end"], inplace=True)
+381            cs = yse["chamber"].unique()
+382            d = {}
+383            for c in cs:
+384                cdf = yse.loc[yse["chamber"] == c].copy()
+385                cdf.reset_index(drop=True, inplace=True)
+386                d[c] = {"earliest": cdf.at[0, "start"], "latest": cdf.at[len(cdf.index)-1, "end"]}
+387            mps = year_chair_mp.loc[pd.notnull(year_chair_mp['person_id']), 'person_id'].values
+388            if len(mps) > len(set(mps)):
+389                dups = self.get_duplicated_items(mps)
+390                ch = []
+391                for dup in dups:
+392                    df = year_chair_mp.loc[year_chair_mp["person_id"] == dup].copy()
+393                    df.drop_duplicates(subset=["chair_id", "parliament_year", "chair_start", "chair_end", "person_id"], inplace=True)
+394                    if len(df["chair_id"].unique()) == 1:
+395                        pass
+396                    elif len(df["chamber"].unique()) > 1:
+397                        if dup not in ch:
+398                            ch.append(dup)
+399                            print("\n--->>>>", dup)
+400                            print(df)
+401                        print("IN TWO CHAMBERS")
+402                        issues = pd.concat([issues, df], ignore_index=True)
+403                    else:
+404                        ranges = []
+405                        for i, r in df.iterrows():
+406                            rstart = None
+407                            if pd.notnull(r["chair_start"]):
+408                                rstart = r["chair_start"]
+409                            elif pd.notnull(r['meta_start']):
+410                                rstart = r['meta_start']
+411                            else:
+412                                rstart = d[r["chamber"]]["earliest"]
+413                            rend = None
+414                            if pd.notnull(r["chair_end"]):
+415                                rend = r["chair_end"]
+416                            elif pd.notnull(r["meta_end"]):
+417                                rend = r["meta_end"]
+418                            else:
+419                                rend = d[r["chamber"]]["latest"]
+420                            ranges.append((rstart, rend))
+421                        ranges = sorted(ranges, key=lambda x: (x[0], x[1]))
+422                        for ridx, _range in enumerate(ranges):
+423                            if ridx < len(ranges)-1:
+424                                delta = (datetime.strptime(_range[1], "%Y-%m-%d") - datetime.strptime(ranges[ridx+1][0], "%Y-%m-%d")).days
+425                                if max(0, delta) > 0:
+426                                    issues = pd.concat([issues,df], ignore_index=True)
+427                                    if dup not in ch:
+428                                        ch.append(dup)
+429                                        print("\n--->>>>", dup)
+430                                        print(ranges)
+431                                        print(df)
+432                                        print(_range, ranges[ridx+1])
+433
+434                if len(ch) > 0:
+435                    print("\n\n")
+436                    warnings.warn(f"{y}: [{', '.join(ch)}]", ChairHog)
+437                    no_chair_hogs = False
+438                    counter += len(ch)
+439                    [ddups.append(_) for _ in ch]
+440        if config and config['write_chairhogs']:
+441            issues.drop_duplicates(inplace=True)
+442            issues.to_csv(
+443                f"{config['test_out_dir']}/{self.what_time_it_is()}_ChairHogs.csv",
+444                sep=';',
+445                index=False)
+446        print(counter, ddups)
+447        self.assertTrue(no_chair_hogs)
+448
+449
+450    @unittest.skip
+451    def test_knaMP(self):
+452        """
+453        Check no one is sharing a chare
+454        """
+455        print("Testing no one sits on the same chair at the same time")
+456        config = fetch_config("chairs")
+457        chair_mp = self.get_chair_mp()
+458        chair_mp.rename(columns={"start": "chair_start", "end":"chair_end"}, inplace=True)
+459        chair_mp = chair_mp[chair_mp["person_id"].notna()]
+460        chairs = self.get_chairs()
+461        chair_mp = pd.merge(chair_mp, chairs, on="chair_id", how="left")
+462        mep_by_year = yearize_mandates()
+463        mep_by_year.rename(columns={"start": "meta_start", "end":"meta_end"}, inplace=True)
+464        mep_by_year = mep_by_year[mep_by_year["meta_start"].notna()]
+465        chair_mp = pd.merge(chair_mp, mep_by_year, on=["person_id", "parliament_year"], how="left")
+466        general_start_end = self.get_riksdag_year()
+467        ingen_knahund = True
+468        counter = 0
+469        ddups = []
+470        issues = pd.DataFrame(columns=chair_mp.columns)
+471        for y in chair_mp['parliament_year'].unique():
+472            year_chair_mp = chair_mp.loc[chair_mp['parliament_year'] == y].copy()
+473            yse = general_start_end.loc[general_start_end['parliament_year'] == y].copy()
+474            yse.reset_index(drop=True, inplace=True)
+475            yse.sort_values(by=["chamber", "start", "end"], inplace=True)
+476            cs = yse["chamber"].unique()
+477            d = {}
+478            for c in cs:
+479                cdf = yse.loc[yse["chamber"] == c].copy()
+480                cdf.reset_index(drop=True, inplace=True)
+481                d[c] = {"earliest": cdf.at[0, "start"], "latest": cdf.at[len(cdf.index)-1, "end"]}
+482            year_chair_mp.drop_duplicates(inplace=True)
+483            chairs = year_chair_mp.loc[pd.notnull(year_chair_mp['chair_id']), 'chair_id'].values
+484            if len(chairs) > len(set(chairs)):
+485                dups = self.get_duplicated_items(chairs)
+486                kh = []
+487                for dup in dups:
+488                    df = year_chair_mp.loc[year_chair_mp["chair_id"] == dup].copy()
+489                    df.drop_duplicates(subset=["chair_id", "parliament_year", "chair_start", "chair_end", "person_id"], inplace=True)
+490                    if len(df["person_id"].unique()) == 1:
+491                        pass
+492                    else:
+493                        ranges = []
+494                        for i, r in df.iterrows():
+495                            rstart = None
+496                            if pd.notnull(r["chair_start"]):
+497                                rstart = r["chair_start"]
+498                            elif pd.notnull(r["meta_start"]):
+499                                rstart = r["meta_start"]
+500                            else:
+501                                rstart = d[r["chamber"]]["earliest"]
+502                            rend = None
+503                            if pd.notnull(r["chair_end"]):
+504                                rend = r["chair_end"]
+505                            elif pd.notnull(r["meta_end"]):
+506                                rend = r["meta_end"]
+507                            else:
+508                                rend = d[r["chamber"]]["latest"]
+509                            ranges.append((rstart, rend))
+510
+511                        ranges = sorted(ranges, key=lambda x: (x[0], x[1]))
+512                        for ridx, _range in enumerate(ranges):
+513                            if ridx < len(ranges)-1:
+514                                delta = (datetime.strptime(_range[1], "%Y-%m-%d") - datetime.strptime(ranges[ridx+1][0], "%Y-%m-%d")).days
+515                                if max(0, delta) > 0:
+516                                    issues = pd.concat([issues,df], ignore_index=True)
+517                                    if dup not in kh:
+518                                        kh.append(dup)
+519                                        print("\n--->>>>", dup)
+520                                        print(df)
+521                                        print(ranges)
+522                                        print(_range, ranges[ridx+1])
+523                if len(kh) > 0:
+524                    print("\n\n")
+525                    warnings.warn(f"{y}: [{', '.join(kh)}]", KnaMP)
+526                    ingen_knahund = False
+527                    counter += len(kh)
+528                    [ddups.append(_) for _ in kh]
+529        if config and config['write_knahund']:
+530            issues.drop_duplicates(inplace=True)
+531            issues.to_csv(
+532                f"{config['test_out_dir']}/{self.what_time_it_is()}_LoveSeats.csv",
+533                sep=';',
+534                index=False)
+535
+536        print(counter, ddups)
+537        self.assertTrue(ingen_knahund)
+538
+539    #
+540    #  --->  Test coverage
+541    # ---------------------
+542    #
+543    @unittest.skip
+544    def test_chair_coverage(self):
+545        """
+546        test all chairs are filled
+547        """
+548        print("Test coverage of chair-MP mapping.")
+549        config = fetch_config("chairs")
+550        chair_mp = self.get_chair_mp()
+551        no_empty_chairs = True
+552        empty_chairs = []
+553        counter = 0
+554        for y in chair_mp['parliament_year'].unique():
+555            y_empty_chairs = []
+556            y_counter = 0
+557            year_chair_mp = chair_mp.loc[chair_mp['parliament_year'] == y]
+558            year_chairs = year_chair_mp["chair_id"].unique()
+559            if year_chair_mp["person_id"].isnull().any():
+560                for i, r in year_chair_mp.iterrows():
+561                    if pd.isna(r["person_id"]):
+562                        df = year_chair_mp.loc[
+563                            (year_chair_mp["chair_id"] == r["chair_id"]) &
+564                            (pd.notnull(year_chair_mp["person_id"]))]
+565                        if df.empty:
+566                            y_counter += 1
+567                            y_empty_chairs.append(r["chair_id"])
+568            if y_counter > 0:
+569                no_empty_chairs = False
+570                print("\n\n")
+571                warnings.warn(f"{y}: [{', '.join(y_empty_chairs)}]", EmptyChair)
+572                counter += y_counter
+573                [empty_chairs.append([str(y), _]) for _ in y_empty_chairs]
+574                print("\n" + str(y_counter / len(year_chairs)) + " emptiness in year")
+575
+576        if config and config['write_empty_seats']:
+577            issues = pd.DataFrame(empty_chairs, columns=['year', 'chair_id'])
+578            issues.to_csv(
+579                f"{config['test_out_dir']}/{self.what_time_it_is()}_EmptySeats.csv",
+580                sep=';',
+581                index=False)
+582
+583        print(counter, empty_chairs)
+584        self.assertTrue(no_empty_chairs)
+585
+586
+587
+588
+589if __name__ == '__main__':
+590    unittest.main()
+
+ + +
+
+ +
+ + class + ChairHog(builtins.Warning): + + + +
+ +
18class ChairHog(Warning):
+19
+20    def __init__(self, m):
+21        self.message = "\n" + f"The following MPs sit in two chairs in {m}:."
+22
+23    def __str__(self):
+24        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + ChairHog(m) + + + +
+ +
20    def __init__(self, m):
+21        self.message = "\n" + f"The following MPs sit in two chairs in {m}:."
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + ChairInWrongTimePeriod(builtins.Warning): + + + +
+ +
27class ChairInWrongTimePeriod(Warning):
+28
+29    def __init__(self, m):
+30        self.message = f"There is {m}."
+31
+32    def __str__(self):
+33        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + ChairInWrongTimePeriod(m) + + + +
+ +
29    def __init__(self, m):
+30        self.message = f"There is {m}."
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + ChairMissingFromRange(builtins.Warning): + + + +
+ +
36class ChairMissingFromRange(Warning):
+37
+38    def __init__(self, m):
+39        self.message = f" in {m} is missing."
+40
+41    def __str__(self):
+42        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + ChairMissingFromRange(m) + + + +
+ +
38    def __init__(self, m):
+39        self.message = f" in {m} is missing."
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + ChairOutOfRange(builtins.Warning): + + + +
+ +
45class ChairOutOfRange(Warning):
+46
+47    def __init__(self, chamber):
+48        self.message = f"There are chairs that are not within the acceptable range of the chamber: {chamber}."
+49
+50    def __str__(self):
+51        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + ChairOutOfRange(chamber) + + + +
+ +
47    def __init__(self, chamber):
+48        self.message = f"There are chairs that are not within the acceptable range of the chamber: {chamber}."
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + ChairYearOutOfRange(builtins.Warning): + + + +
+ +
54class ChairYearOutOfRange(Warning):
+55
+56    def __init__(self, m):
+57        self.message = f"In {m} <-- chair is missing."
+58
+59    def __str__(self):
+60        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + ChairYearOutOfRange(m) + + + +
+ +
56    def __init__(self, m):
+57        self.message = f"In {m} <-- chair is missing."
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + DuplicateIDWarning(builtins.Warning): + + + +
+ +
63class DuplicateIDWarning(Warning):
+64
+65    def __init__(self, m):
+66        self.message = f"{m}"
+67
+68    def __str__(self):
+69        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + DuplicateIDWarning(m) + + + +
+ +
65    def __init__(self, m):
+66        self.message = f"{m}"
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + EmptyChair(builtins.Warning): + + + +
+ +
72class EmptyChair(Warning):
+73
+74    def __init__(self, m):
+75        self.message = "\n" + f"The following chairs are empty in in {m}:."
+76
+77    def __str__(self):
+78        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + EmptyChair(m) + + + +
+ +
74    def __init__(self, m):
+75        self.message = "\n" + f"The following chairs are empty in in {m}:."
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + KnaMP(builtins.Warning): + + + +
+ +
81class KnaMP(Warning):
+82
+83    def __init__(self, m):
+84        self.message = "\n" + f"The following chairs are occupied by more than one person at the same time in {m}:."
+85
+86    def __str__(self):
+87        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + KnaMP(m) + + + +
+ +
83    def __init__(self, m):
+84        self.message = "\n" + f"The following chairs are occupied by more than one person at the same time in {m}:."
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + Test(unittest.case.TestCase): + + + +
+ +
 92class Test(unittest.TestCase):
+ 93    #
+ 94    #  --->  get var fns
+ 95    #  -----------------
+ 96    #
+ 97    #  read in chairs.csv
+ 98    def get_chairs(self):
+ 99        return pd.read_csv("data/chairs.csv")
+100
+101    #  read in chair_mp.csv
+102    def get_chair_mp(self):
+103        return pd.read_csv("data/chair_mp.csv")
+104
+105    # read in mep metadata
+106    def get_mep(self):
+107        df = pd.read_csv("data/member_of_parliament.csv")
+108        return df.rename(columns={"start": "meta_start", "end":"meta_end"})
+109
+110    # read in parliament start end dates
+111    def get_riksdag_year(self):
+112        return pd.read_csv("data/riksdag-year.csv")
+113
+114    #  set max values for each chamber
+115    def get_max_chair(self):
+116        max_chair = {
+117            'ak':233,
+118            'fk':151,
+119            'ek':350
+120        }
+121        return max_chair
+122
+123    #  Out of range chair for specific years
+124    def get_oor_year(self):
+125        oor_year = {
+126            '1957':
+127                    [    # until 1957 -- if year < 1957
+128                    '814127872a174909bd6ecaeaf59290fe',  # a231
+129                    'd423710cb9e64b17b93484e120f07e66',  # a232
+130                    'c77cdeebf789416e98cf8afb05b75a23',  # a233
+131                    '34ad45b358764a388b53c45ae1ce3681'   # f151
+132                    ],
+133            '1959':
+134                    [    # until 1959 -- elif year < 1959
+135                    '814127872a174909bd6ecaeaf59290fe',  # a231
+136                    'd423710cb9e64b17b93484e120f07e66',  # a232
+137                    'c77cdeebf789416e98cf8afb05b75a23'   # a233
+138                    ],
+139            '1961':
+140                    [    # unitl 1961 -- elif year < 1961
+141                    'd423710cb9e64b17b93484e120f07e66',  # a232
+142                    'c77cdeebf789416e98cf8afb05b75a23'   # a233
+143                    ],
+144            '1965':
+145                    [    # until 1965 -- elif year < 1965
+146                    'c77cdeebf789416e98cf8afb05b75a23'   # a233
+147                    ],
+148            '7677':
+149                    [    # from 197677
+150                    'af0ebaa9aed64c2d91750aa72651ea74'   # e350
+151                    ]
+152        }
+153        return oor_year
+154
+155    #
+156    #  --->  misc fns
+157    #  --------------
+158    #
+159    def get_duplicated_items(self, l):
+160        """
+161        return duplicates in a list
+162        """
+163        seen = set()
+164        return [_ for _ in l if _ in seen or seen.add(_)]
+165
+166
+167    def what_time_it_is(self):
+168        """
+169        get formatted datetimestring
+170        """
+171        return datetime.now().strftime('%Y%m%d-%H%M%S')
+172
+173
+174    #
+175    #  --->  Test integrity of chairs data
+176    #  -------------------------------------------
+177    #
+178    #@unittest.skip
+179    def test_unique_chair_id(self):
+180        """
+181        check chair IDs are unique
+182        """
+183        print("Testing: chairs have unique IDs")
+184        chairs = self.get_chairs()
+185        chair_ids = chairs['chair_id'].values
+186        if len(chair_ids) != len(set(chair_ids)):
+187            warnings.warn("There's probably a duplicate chair ID.", DuplicateIDWarning)
+188        self.assertEqual(len(chair_ids), len(set(chair_ids)))
+189
+190    #@unittest.skip
+191    def test_chair_nrs_in_range(self):
+192        """
+193        check no chairs are numbered higher than the max chair nr for that chamber
+194        """
+195        print("Testing: chairs within max range for chamber")
+196        chairs = self.get_chairs()
+197        max_chair = self.get_max_chair()
+198        for k, v in max_chair.items():
+199            oor_chairs = chairs.loc[(chairs['chamber'] == k) & (chairs['chair_nr'] > v)]
+200            if len(oor_chairs) > 0:
+201                warnings.warn(k, ChairOutOfRange)
+202            self.assertEqual(len(oor_chairs), 0)
+203
+204    #
+205    #  --->  Test integrity of chair_mp mapping
+206    #  --------------------------------
+207    #
+208    #@unittest.skip
+209    def test_chair_id_sets(self):
+210        """
+211        check chair IDs in chair_mp are the same set as chairs
+212        """
+213        print("Testing: chair ids are the same set in chairs.csv and chair_mp.csv")
+214        chairs = self.get_chairs()
+215        chair_mp = self.get_chair_mp()
+216        chair_ids_a = chairs['chair_id'].unique()
+217        chair_ids_b = chair_mp['chair_id'].unique()
+218        if set(chair_ids_a) != set(chair_ids_b):
+219            warnings.warn(ChairIDMismatchW)
+220        self.assertEqual(len(chair_ids_a), len(chair_ids_b))
+221
+222    #@unittest.skip
+223    def test_chair_chambertime_concurrence(self):
+224        """
+225        check no chairs from tvåkammartiden are used in enkammartid and vice-versa
+226        """
+227        print("Testing: no chairs from tvåkammartiden are used in enkammartid and vice-versa")
+228        chairs = self.get_chairs()
+229        config = fetch_config("chairs")
+230        tvok_chairs = chairs.loc[chairs['chamber'] != 'ek', 'chair_id'].unique()
+231        enk_chairs =  chairs.loc[chairs['chamber'] == 'ek', 'chair_id'].unique()
+232        chair_mp = self.get_chair_mp()
+233        tvok_chair_mp_chairs = chair_mp.loc[
+234            chair_mp['parliament_year'] < 1971,
+235            'chair_id'
+236        ].unique()
+237        enk_chair_mp_chairs = chair_mp.loc[
+238            chair_mp['parliament_year'] > 1970,
+239            'chair_id'
+240        ].unique()
+241        tkc_in_enkt = []           # tvåkammar chair in enkammartid
+242        ekc_in_tvkt = []           # enkammar chair in tvåkammartid
+243        for c in tvok_chair_mp_chairs:
+244            if c in enk_chairs:
+245                ekc_in_tvkt.append(c)
+246        for c in enk_chair_mp_chairs:
+247            if c in tvok_chairs:
+248                tkc_in_enkt.append(c)
+249        if len(tkc_in_enkt) > 0:
+250            warnings.warn('tvåkammar chair in enkammartid',ChairInWrongTimePeriod)
+251            if config and config['write_tkc_in_enkt']:
+252                with open(f"{config['test_out_dir']}/{self.what_time_it_is()}_tkc_in_enkt.txt", "w+") as o:
+253                    [o.write(f"{_}\n") for _ in tkc_in_enkt]
+254        if len(ekc_in_tvkt) > 0:
+255            warnings.warn('enkammar chair in tvåkammartid', ChairInWrongTimePeriod)
+256            if config and config['write_ekc_in_tvkt']:
+257                with open(f"{config['test_out_dir']}/{self.what_time_it_is()}_ekc_in_tvkt.txt", "w+") as o:
+258                    [o.write(f"{_}\n") for _ in ekc_in_tvkt]
+259        self.assertEqual(len(tkc_in_enkt), 0)
+260        self.assertEqual(len(ekc_in_tvkt), 0)
+261
+262    #@unittest.skip
+263    def test_chair_nrs_in_range_for_year(self):
+264        """
+265        check that chairs are within acceptable range for a given year
+266           and that every seat within that range is present at least once
+267           in the chair_mp file (whether filled or not)
+268        """
+269        print("Testing: chairs are within acceptable range for a given year\n     and that every seat within that range is present at least once")
+270        chairs = self.get_chairs()
+271        config = fetch_config("chairs")
+272        tvok_chairs = chairs.loc[chairs['chamber'] != 'ek', 'chair_id'].unique()
+273        enk_chairs = chairs.loc[chairs['chamber'] == 'ek', 'chair_id'].unique()
+274        chair_mp = self.get_chair_mp()
+275        oor_year = self.get_oor_year()
+276        rd_years = chair_mp['parliament_year'].unique()
+277        OutOfRange = []
+278        missing_in_R = []
+279        for y in rd_years:
+280            year_chair_mp_chairs = chair_mp.loc[
+281                chair_mp['parliament_year'] == y,
+282                'chair_id'
+283            ].unique()
+284            excludes = []
+285            if y < 1971:
+286                if y <= 1957:
+287                    excludes = oor_year['1957']
+288                elif y < 1959:
+289                    excludes = oor_year['1959']
+290                elif y < 1961:
+291                    excludes = oor_year['1961']
+292                elif y < 1965:
+293                    excludes = oor_year['1965']
+294                if len(excludes) > 0:
+295                    for x in excludes:
+296                        if x in year_chair_mp_chairs:
+297                            OutOfRange.append([y, x])
+298                            warnings.warn(f"{y}: {x}", ChairYearOutOfRange)
+299                if len(tvok_chairs) > len(year_chair_mp_chairs)+len(excludes):
+300                    for c in tvok_chairs:
+301                        if c not in year_chair_mp_chairs and c not in excludes:
+302                            missing_in_R.append([y, c])
+303                            warnings.warn(f"{y}: {c}", ChairMissingFromRange)
+304                elif len(tvok_chairs) > len(year_chair_mp_chairs)+len(excludes):
+305                    self.assertFalse(True, "¡Sth is super wrong!")
+306            else:
+307                if y > 197576 or y == 1980:
+308                    excludes = oor_year['7677']
+309                if len(excludes) > 0:
+310                    for x in excludes:
+311                        if x in year_chair_mp_chairs:
+312                            OutOfRange.append([y, x])
+313                            warnings.warn(f"{y}: {x}", ChairYearOutOfRange)
+314                if len(enk_chairs) < len(year_chair_mp_chairs)+len(excludes):
+315                    for c in tvok_chairs:
+316                        if c not in year_chair_mp_chairs and c not in excludes:
+317                            missing_in_R.append([y, c])
+318                            warnings.warn(f"{y}: {c}", ChairMissingFromRange)
+319                elif len(enk_chairs) > len(year_chair_mp_chairs)+len(excludes):
+320                    self.assertFalse(True, "¡Sth is super wrong!")
+321        if len(OutOfRange) > 0:
+322            if config and config["write_chair_nrs_in_range"]:
+323                df = pd.DataFrame(OutOfRange, columne=["year", "chair"])
+324                df.to_csv(
+325                    f"{config['test_out_dir']}/{what_time_it_is}_chair-OOR.csv",
+326                    sep=';',
+327                    index=False)
+328        if len(missing_in_R) > 0:
+329            if config and config["write_chair_nrs_in_range"]:
+330                df = pd.DataFrame(missing_in_R, columne=["year", "chair"])
+331                df.to_csv(
+332                    f"{config['test_out_dir']}/{self.what_time_it_is()}_chair-missing-in-R.csv",
+333                    sep=';',
+334                    index=False)
+335        self.assertEqual(len(OutOfRange), 0)
+336        self.assertEqual(len(missing_in_R), 0)
+337
+338    #
+339    #  --->  Test integrity of bum to chair mapping
+340    # ---------------------------------------------
+341    #
+342    @unittest.skip
+343    def test_chair_hogs(self):
+344        """
+345        check no single person sits in two places at once
+346        """
+347        print("Testing: no single person sits in two places at once")
+348        chair_mp = self.get_chair_mp()
+349        chair_mp.rename(columns={"start": "chair_start", "end":"chair_end"}, inplace=True)
+350        chair_mp = chair_mp[chair_mp["person_id"].notna()]
+351        chairs = self.get_chairs()
+352        chair_mp = pd.merge(chair_mp, chairs, on="chair_id", how="left")
+353        mep_by_year = yearize_mandates()
+354        mep_by_year.rename(columns={"start": "meta_start", "end":"meta_end"}, inplace=True)
+355        mep_by_year = mep_by_year[mep_by_year["meta_start"].notna()]
+356        config = fetch_config("chairs")
+357        if config and config['write_ch_chmp_merge']:
+358            mep_by_year.to_csv(
+359                f"{config['test_out_dir']}/{self.what_time_it_is()}_chair-chairmp_merge.csv",
+360                sep=';',
+361                index=False)
+362        chair_mp = pd.merge(chair_mp, mep_by_year, on=["person_id", "parliament_year"], how="left")
+363
+364        if config and config['write_trouble_matching']:
+365            outdf = chair_mp.loc[pd.isna(chair_mp["role"])].copy()
+366            if not outdf.empty:
+367                outdf.to_csv(
+368                    f"{config['test_out_dir']}/{self.what_time_it_is()}_trouble-matching-yearize.csv",
+369                    sep=';',
+370                    index=False)
+371
+372        general_start_end = self.get_riksdag_year()
+373        no_chair_hogs = True
+374        counter = 0
+375        ddups = []
+376        issues = pd.DataFrame(columns=chair_mp.columns)
+377        for y in chair_mp['parliament_year'].unique():
+378            year_chair_mp = chair_mp.loc[chair_mp['parliament_year'] == y]
+379            yse = general_start_end.loc[general_start_end['parliament_year'] == y].copy()
+380            yse.reset_index(drop=True, inplace=True)
+381            yse.sort_values(by=["chamber", "start", "end"], inplace=True)
+382            cs = yse["chamber"].unique()
+383            d = {}
+384            for c in cs:
+385                cdf = yse.loc[yse["chamber"] == c].copy()
+386                cdf.reset_index(drop=True, inplace=True)
+387                d[c] = {"earliest": cdf.at[0, "start"], "latest": cdf.at[len(cdf.index)-1, "end"]}
+388            mps = year_chair_mp.loc[pd.notnull(year_chair_mp['person_id']), 'person_id'].values
+389            if len(mps) > len(set(mps)):
+390                dups = self.get_duplicated_items(mps)
+391                ch = []
+392                for dup in dups:
+393                    df = year_chair_mp.loc[year_chair_mp["person_id"] == dup].copy()
+394                    df.drop_duplicates(subset=["chair_id", "parliament_year", "chair_start", "chair_end", "person_id"], inplace=True)
+395                    if len(df["chair_id"].unique()) == 1:
+396                        pass
+397                    elif len(df["chamber"].unique()) > 1:
+398                        if dup not in ch:
+399                            ch.append(dup)
+400                            print("\n--->>>>", dup)
+401                            print(df)
+402                        print("IN TWO CHAMBERS")
+403                        issues = pd.concat([issues, df], ignore_index=True)
+404                    else:
+405                        ranges = []
+406                        for i, r in df.iterrows():
+407                            rstart = None
+408                            if pd.notnull(r["chair_start"]):
+409                                rstart = r["chair_start"]
+410                            elif pd.notnull(r['meta_start']):
+411                                rstart = r['meta_start']
+412                            else:
+413                                rstart = d[r["chamber"]]["earliest"]
+414                            rend = None
+415                            if pd.notnull(r["chair_end"]):
+416                                rend = r["chair_end"]
+417                            elif pd.notnull(r["meta_end"]):
+418                                rend = r["meta_end"]
+419                            else:
+420                                rend = d[r["chamber"]]["latest"]
+421                            ranges.append((rstart, rend))
+422                        ranges = sorted(ranges, key=lambda x: (x[0], x[1]))
+423                        for ridx, _range in enumerate(ranges):
+424                            if ridx < len(ranges)-1:
+425                                delta = (datetime.strptime(_range[1], "%Y-%m-%d") - datetime.strptime(ranges[ridx+1][0], "%Y-%m-%d")).days
+426                                if max(0, delta) > 0:
+427                                    issues = pd.concat([issues,df], ignore_index=True)
+428                                    if dup not in ch:
+429                                        ch.append(dup)
+430                                        print("\n--->>>>", dup)
+431                                        print(ranges)
+432                                        print(df)
+433                                        print(_range, ranges[ridx+1])
+434
+435                if len(ch) > 0:
+436                    print("\n\n")
+437                    warnings.warn(f"{y}: [{', '.join(ch)}]", ChairHog)
+438                    no_chair_hogs = False
+439                    counter += len(ch)
+440                    [ddups.append(_) for _ in ch]
+441        if config and config['write_chairhogs']:
+442            issues.drop_duplicates(inplace=True)
+443            issues.to_csv(
+444                f"{config['test_out_dir']}/{self.what_time_it_is()}_ChairHogs.csv",
+445                sep=';',
+446                index=False)
+447        print(counter, ddups)
+448        self.assertTrue(no_chair_hogs)
+449
+450
+451    @unittest.skip
+452    def test_knaMP(self):
+453        """
+454        Check no one is sharing a chare
+455        """
+456        print("Testing no one sits on the same chair at the same time")
+457        config = fetch_config("chairs")
+458        chair_mp = self.get_chair_mp()
+459        chair_mp.rename(columns={"start": "chair_start", "end":"chair_end"}, inplace=True)
+460        chair_mp = chair_mp[chair_mp["person_id"].notna()]
+461        chairs = self.get_chairs()
+462        chair_mp = pd.merge(chair_mp, chairs, on="chair_id", how="left")
+463        mep_by_year = yearize_mandates()
+464        mep_by_year.rename(columns={"start": "meta_start", "end":"meta_end"}, inplace=True)
+465        mep_by_year = mep_by_year[mep_by_year["meta_start"].notna()]
+466        chair_mp = pd.merge(chair_mp, mep_by_year, on=["person_id", "parliament_year"], how="left")
+467        general_start_end = self.get_riksdag_year()
+468        ingen_knahund = True
+469        counter = 0
+470        ddups = []
+471        issues = pd.DataFrame(columns=chair_mp.columns)
+472        for y in chair_mp['parliament_year'].unique():
+473            year_chair_mp = chair_mp.loc[chair_mp['parliament_year'] == y].copy()
+474            yse = general_start_end.loc[general_start_end['parliament_year'] == y].copy()
+475            yse.reset_index(drop=True, inplace=True)
+476            yse.sort_values(by=["chamber", "start", "end"], inplace=True)
+477            cs = yse["chamber"].unique()
+478            d = {}
+479            for c in cs:
+480                cdf = yse.loc[yse["chamber"] == c].copy()
+481                cdf.reset_index(drop=True, inplace=True)
+482                d[c] = {"earliest": cdf.at[0, "start"], "latest": cdf.at[len(cdf.index)-1, "end"]}
+483            year_chair_mp.drop_duplicates(inplace=True)
+484            chairs = year_chair_mp.loc[pd.notnull(year_chair_mp['chair_id']), 'chair_id'].values
+485            if len(chairs) > len(set(chairs)):
+486                dups = self.get_duplicated_items(chairs)
+487                kh = []
+488                for dup in dups:
+489                    df = year_chair_mp.loc[year_chair_mp["chair_id"] == dup].copy()
+490                    df.drop_duplicates(subset=["chair_id", "parliament_year", "chair_start", "chair_end", "person_id"], inplace=True)
+491                    if len(df["person_id"].unique()) == 1:
+492                        pass
+493                    else:
+494                        ranges = []
+495                        for i, r in df.iterrows():
+496                            rstart = None
+497                            if pd.notnull(r["chair_start"]):
+498                                rstart = r["chair_start"]
+499                            elif pd.notnull(r["meta_start"]):
+500                                rstart = r["meta_start"]
+501                            else:
+502                                rstart = d[r["chamber"]]["earliest"]
+503                            rend = None
+504                            if pd.notnull(r["chair_end"]):
+505                                rend = r["chair_end"]
+506                            elif pd.notnull(r["meta_end"]):
+507                                rend = r["meta_end"]
+508                            else:
+509                                rend = d[r["chamber"]]["latest"]
+510                            ranges.append((rstart, rend))
+511
+512                        ranges = sorted(ranges, key=lambda x: (x[0], x[1]))
+513                        for ridx, _range in enumerate(ranges):
+514                            if ridx < len(ranges)-1:
+515                                delta = (datetime.strptime(_range[1], "%Y-%m-%d") - datetime.strptime(ranges[ridx+1][0], "%Y-%m-%d")).days
+516                                if max(0, delta) > 0:
+517                                    issues = pd.concat([issues,df], ignore_index=True)
+518                                    if dup not in kh:
+519                                        kh.append(dup)
+520                                        print("\n--->>>>", dup)
+521                                        print(df)
+522                                        print(ranges)
+523                                        print(_range, ranges[ridx+1])
+524                if len(kh) > 0:
+525                    print("\n\n")
+526                    warnings.warn(f"{y}: [{', '.join(kh)}]", KnaMP)
+527                    ingen_knahund = False
+528                    counter += len(kh)
+529                    [ddups.append(_) for _ in kh]
+530        if config and config['write_knahund']:
+531            issues.drop_duplicates(inplace=True)
+532            issues.to_csv(
+533                f"{config['test_out_dir']}/{self.what_time_it_is()}_LoveSeats.csv",
+534                sep=';',
+535                index=False)
+536
+537        print(counter, ddups)
+538        self.assertTrue(ingen_knahund)
+539
+540    #
+541    #  --->  Test coverage
+542    # ---------------------
+543    #
+544    @unittest.skip
+545    def test_chair_coverage(self):
+546        """
+547        test all chairs are filled
+548        """
+549        print("Test coverage of chair-MP mapping.")
+550        config = fetch_config("chairs")
+551        chair_mp = self.get_chair_mp()
+552        no_empty_chairs = True
+553        empty_chairs = []
+554        counter = 0
+555        for y in chair_mp['parliament_year'].unique():
+556            y_empty_chairs = []
+557            y_counter = 0
+558            year_chair_mp = chair_mp.loc[chair_mp['parliament_year'] == y]
+559            year_chairs = year_chair_mp["chair_id"].unique()
+560            if year_chair_mp["person_id"].isnull().any():
+561                for i, r in year_chair_mp.iterrows():
+562                    if pd.isna(r["person_id"]):
+563                        df = year_chair_mp.loc[
+564                            (year_chair_mp["chair_id"] == r["chair_id"]) &
+565                            (pd.notnull(year_chair_mp["person_id"]))]
+566                        if df.empty:
+567                            y_counter += 1
+568                            y_empty_chairs.append(r["chair_id"])
+569            if y_counter > 0:
+570                no_empty_chairs = False
+571                print("\n\n")
+572                warnings.warn(f"{y}: [{', '.join(y_empty_chairs)}]", EmptyChair)
+573                counter += y_counter
+574                [empty_chairs.append([str(y), _]) for _ in y_empty_chairs]
+575                print("\n" + str(y_counter / len(year_chairs)) + " emptiness in year")
+576
+577        if config and config['write_empty_seats']:
+578            issues = pd.DataFrame(empty_chairs, columns=['year', 'chair_id'])
+579            issues.to_csv(
+580                f"{config['test_out_dir']}/{self.what_time_it_is()}_EmptySeats.csv",
+581                sep=';',
+582                index=False)
+583
+584        print(counter, empty_chairs)
+585        self.assertTrue(no_empty_chairs)
+
+ + +

A class whose instances are single test cases.

+ +

By default, the test code itself should be placed in a method named +'runTest'.

+ +

If the fixture may be used for many test cases, create as +many test methods as are needed. When instantiating such a TestCase +subclass, specify in the constructor arguments the name of the test method +that the instance is to execute.

+ +

Test authors should subclass TestCase for their own tests. Construction +and deconstruction of the test's environment ('fixture') can be +implemented by overriding the 'setUp' and 'tearDown' methods respectively.

+ +

If it is necessary to override the __init__ method, the base class +__init__ method must always be called. It is important that subclasses +should not change the signature of their __init__ method, since instances +of the classes are instantiated automatically by parts of the framework +in order to be run.

+ +

When subclassing TestCase, you can set these attributes:

+ +
    +
  • failureException: determines which exception will be raised when +the instance's assertion methods fail; test methods raising this +exception will be deemed to have 'failed' rather than 'errored'.
  • +
  • longMessage: determines whether long messages (including repr of +objects used in assert methods) will be printed on failure in addition +to any explicit message passed.
  • +
  • maxDiff: sets the maximum length of a diff in failure messages +by assert methods using difflib. It is looked up as an instance +attribute so can be configured by individual tests if required.
  • +
+
+ + +
+ +
+ + def + get_chairs(self): + + + +
+ +
98    def get_chairs(self):
+99        return pd.read_csv("data/chairs.csv")
+
+ + + + +
+
+ +
+ + def + get_chair_mp(self): + + + +
+ +
102    def get_chair_mp(self):
+103        return pd.read_csv("data/chair_mp.csv")
+
+ + + + +
+
+ +
+ + def + get_mep(self): + + + +
+ +
106    def get_mep(self):
+107        df = pd.read_csv("data/member_of_parliament.csv")
+108        return df.rename(columns={"start": "meta_start", "end":"meta_end"})
+
+ + + + +
+
+ +
+ + def + get_riksdag_year(self): + + + +
+ +
111    def get_riksdag_year(self):
+112        return pd.read_csv("data/riksdag-year.csv")
+
+ + + + +
+
+ +
+ + def + get_max_chair(self): + + + +
+ +
115    def get_max_chair(self):
+116        max_chair = {
+117            'ak':233,
+118            'fk':151,
+119            'ek':350
+120        }
+121        return max_chair
+
+ + + + +
+
+ +
+ + def + get_oor_year(self): + + + +
+ +
124    def get_oor_year(self):
+125        oor_year = {
+126            '1957':
+127                    [    # until 1957 -- if year < 1957
+128                    '814127872a174909bd6ecaeaf59290fe',  # a231
+129                    'd423710cb9e64b17b93484e120f07e66',  # a232
+130                    'c77cdeebf789416e98cf8afb05b75a23',  # a233
+131                    '34ad45b358764a388b53c45ae1ce3681'   # f151
+132                    ],
+133            '1959':
+134                    [    # until 1959 -- elif year < 1959
+135                    '814127872a174909bd6ecaeaf59290fe',  # a231
+136                    'd423710cb9e64b17b93484e120f07e66',  # a232
+137                    'c77cdeebf789416e98cf8afb05b75a23'   # a233
+138                    ],
+139            '1961':
+140                    [    # unitl 1961 -- elif year < 1961
+141                    'd423710cb9e64b17b93484e120f07e66',  # a232
+142                    'c77cdeebf789416e98cf8afb05b75a23'   # a233
+143                    ],
+144            '1965':
+145                    [    # until 1965 -- elif year < 1965
+146                    'c77cdeebf789416e98cf8afb05b75a23'   # a233
+147                    ],
+148            '7677':
+149                    [    # from 197677
+150                    'af0ebaa9aed64c2d91750aa72651ea74'   # e350
+151                    ]
+152        }
+153        return oor_year
+
+ + + + +
+
+ +
+ + def + get_duplicated_items(self, l): + + + +
+ +
159    def get_duplicated_items(self, l):
+160        """
+161        return duplicates in a list
+162        """
+163        seen = set()
+164        return [_ for _ in l if _ in seen or seen.add(_)]
+
+ + +

return duplicates in a list

+
+ + +
+
+ +
+ + def + what_time_it_is(self): + + + +
+ +
167    def what_time_it_is(self):
+168        """
+169        get formatted datetimestring
+170        """
+171        return datetime.now().strftime('%Y%m%d-%H%M%S')
+
+ + +

get formatted datetimestring

+
+ + +
+
+ +
+ + def + test_unique_chair_id(self): + + + +
+ +
179    def test_unique_chair_id(self):
+180        """
+181        check chair IDs are unique
+182        """
+183        print("Testing: chairs have unique IDs")
+184        chairs = self.get_chairs()
+185        chair_ids = chairs['chair_id'].values
+186        if len(chair_ids) != len(set(chair_ids)):
+187            warnings.warn("There's probably a duplicate chair ID.", DuplicateIDWarning)
+188        self.assertEqual(len(chair_ids), len(set(chair_ids)))
+
+ + +

check chair IDs are unique

+
+ + +
+
+ +
+ + def + test_chair_nrs_in_range(self): + + + +
+ +
191    def test_chair_nrs_in_range(self):
+192        """
+193        check no chairs are numbered higher than the max chair nr for that chamber
+194        """
+195        print("Testing: chairs within max range for chamber")
+196        chairs = self.get_chairs()
+197        max_chair = self.get_max_chair()
+198        for k, v in max_chair.items():
+199            oor_chairs = chairs.loc[(chairs['chamber'] == k) & (chairs['chair_nr'] > v)]
+200            if len(oor_chairs) > 0:
+201                warnings.warn(k, ChairOutOfRange)
+202            self.assertEqual(len(oor_chairs), 0)
+
+ + +

check no chairs are numbered higher than the max chair nr for that chamber

+
+ + +
+
+ +
+ + def + test_chair_id_sets(self): + + + +
+ +
209    def test_chair_id_sets(self):
+210        """
+211        check chair IDs in chair_mp are the same set as chairs
+212        """
+213        print("Testing: chair ids are the same set in chairs.csv and chair_mp.csv")
+214        chairs = self.get_chairs()
+215        chair_mp = self.get_chair_mp()
+216        chair_ids_a = chairs['chair_id'].unique()
+217        chair_ids_b = chair_mp['chair_id'].unique()
+218        if set(chair_ids_a) != set(chair_ids_b):
+219            warnings.warn(ChairIDMismatchW)
+220        self.assertEqual(len(chair_ids_a), len(chair_ids_b))
+
+ + +

check chair IDs in chair_mp are the same set as chairs

+
+ + +
+
+ +
+ + def + test_chair_chambertime_concurrence(self): + + + +
+ +
223    def test_chair_chambertime_concurrence(self):
+224        """
+225        check no chairs from tvåkammartiden are used in enkammartid and vice-versa
+226        """
+227        print("Testing: no chairs from tvåkammartiden are used in enkammartid and vice-versa")
+228        chairs = self.get_chairs()
+229        config = fetch_config("chairs")
+230        tvok_chairs = chairs.loc[chairs['chamber'] != 'ek', 'chair_id'].unique()
+231        enk_chairs =  chairs.loc[chairs['chamber'] == 'ek', 'chair_id'].unique()
+232        chair_mp = self.get_chair_mp()
+233        tvok_chair_mp_chairs = chair_mp.loc[
+234            chair_mp['parliament_year'] < 1971,
+235            'chair_id'
+236        ].unique()
+237        enk_chair_mp_chairs = chair_mp.loc[
+238            chair_mp['parliament_year'] > 1970,
+239            'chair_id'
+240        ].unique()
+241        tkc_in_enkt = []           # tvåkammar chair in enkammartid
+242        ekc_in_tvkt = []           # enkammar chair in tvåkammartid
+243        for c in tvok_chair_mp_chairs:
+244            if c in enk_chairs:
+245                ekc_in_tvkt.append(c)
+246        for c in enk_chair_mp_chairs:
+247            if c in tvok_chairs:
+248                tkc_in_enkt.append(c)
+249        if len(tkc_in_enkt) > 0:
+250            warnings.warn('tvåkammar chair in enkammartid',ChairInWrongTimePeriod)
+251            if config and config['write_tkc_in_enkt']:
+252                with open(f"{config['test_out_dir']}/{self.what_time_it_is()}_tkc_in_enkt.txt", "w+") as o:
+253                    [o.write(f"{_}\n") for _ in tkc_in_enkt]
+254        if len(ekc_in_tvkt) > 0:
+255            warnings.warn('enkammar chair in tvåkammartid', ChairInWrongTimePeriod)
+256            if config and config['write_ekc_in_tvkt']:
+257                with open(f"{config['test_out_dir']}/{self.what_time_it_is()}_ekc_in_tvkt.txt", "w+") as o:
+258                    [o.write(f"{_}\n") for _ in ekc_in_tvkt]
+259        self.assertEqual(len(tkc_in_enkt), 0)
+260        self.assertEqual(len(ekc_in_tvkt), 0)
+
+ + +

check no chairs from tvåkammartiden are used in enkammartid and vice-versa

+
+ + +
+
+ +
+ + def + test_chair_nrs_in_range_for_year(self): + + + +
+ +
263    def test_chair_nrs_in_range_for_year(self):
+264        """
+265        check that chairs are within acceptable range for a given year
+266           and that every seat within that range is present at least once
+267           in the chair_mp file (whether filled or not)
+268        """
+269        print("Testing: chairs are within acceptable range for a given year\n     and that every seat within that range is present at least once")
+270        chairs = self.get_chairs()
+271        config = fetch_config("chairs")
+272        tvok_chairs = chairs.loc[chairs['chamber'] != 'ek', 'chair_id'].unique()
+273        enk_chairs = chairs.loc[chairs['chamber'] == 'ek', 'chair_id'].unique()
+274        chair_mp = self.get_chair_mp()
+275        oor_year = self.get_oor_year()
+276        rd_years = chair_mp['parliament_year'].unique()
+277        OutOfRange = []
+278        missing_in_R = []
+279        for y in rd_years:
+280            year_chair_mp_chairs = chair_mp.loc[
+281                chair_mp['parliament_year'] == y,
+282                'chair_id'
+283            ].unique()
+284            excludes = []
+285            if y < 1971:
+286                if y <= 1957:
+287                    excludes = oor_year['1957']
+288                elif y < 1959:
+289                    excludes = oor_year['1959']
+290                elif y < 1961:
+291                    excludes = oor_year['1961']
+292                elif y < 1965:
+293                    excludes = oor_year['1965']
+294                if len(excludes) > 0:
+295                    for x in excludes:
+296                        if x in year_chair_mp_chairs:
+297                            OutOfRange.append([y, x])
+298                            warnings.warn(f"{y}: {x}", ChairYearOutOfRange)
+299                if len(tvok_chairs) > len(year_chair_mp_chairs)+len(excludes):
+300                    for c in tvok_chairs:
+301                        if c not in year_chair_mp_chairs and c not in excludes:
+302                            missing_in_R.append([y, c])
+303                            warnings.warn(f"{y}: {c}", ChairMissingFromRange)
+304                elif len(tvok_chairs) > len(year_chair_mp_chairs)+len(excludes):
+305                    self.assertFalse(True, "¡Sth is super wrong!")
+306            else:
+307                if y > 197576 or y == 1980:
+308                    excludes = oor_year['7677']
+309                if len(excludes) > 0:
+310                    for x in excludes:
+311                        if x in year_chair_mp_chairs:
+312                            OutOfRange.append([y, x])
+313                            warnings.warn(f"{y}: {x}", ChairYearOutOfRange)
+314                if len(enk_chairs) < len(year_chair_mp_chairs)+len(excludes):
+315                    for c in tvok_chairs:
+316                        if c not in year_chair_mp_chairs and c not in excludes:
+317                            missing_in_R.append([y, c])
+318                            warnings.warn(f"{y}: {c}", ChairMissingFromRange)
+319                elif len(enk_chairs) > len(year_chair_mp_chairs)+len(excludes):
+320                    self.assertFalse(True, "¡Sth is super wrong!")
+321        if len(OutOfRange) > 0:
+322            if config and config["write_chair_nrs_in_range"]:
+323                df = pd.DataFrame(OutOfRange, columne=["year", "chair"])
+324                df.to_csv(
+325                    f"{config['test_out_dir']}/{what_time_it_is}_chair-OOR.csv",
+326                    sep=';',
+327                    index=False)
+328        if len(missing_in_R) > 0:
+329            if config and config["write_chair_nrs_in_range"]:
+330                df = pd.DataFrame(missing_in_R, columne=["year", "chair"])
+331                df.to_csv(
+332                    f"{config['test_out_dir']}/{self.what_time_it_is()}_chair-missing-in-R.csv",
+333                    sep=';',
+334                    index=False)
+335        self.assertEqual(len(OutOfRange), 0)
+336        self.assertEqual(len(missing_in_R), 0)
+
+ + +

check that chairs are within acceptable range for a given year + and that every seat within that range is present at least once + in the chair_mp file (whether filled or not)

+
+ + +
+
+ +
+
@unittest.skip
+ + def + test_chair_hogs(self): + + + +
+ +
342    @unittest.skip
+343    def test_chair_hogs(self):
+344        """
+345        check no single person sits in two places at once
+346        """
+347        print("Testing: no single person sits in two places at once")
+348        chair_mp = self.get_chair_mp()
+349        chair_mp.rename(columns={"start": "chair_start", "end":"chair_end"}, inplace=True)
+350        chair_mp = chair_mp[chair_mp["person_id"].notna()]
+351        chairs = self.get_chairs()
+352        chair_mp = pd.merge(chair_mp, chairs, on="chair_id", how="left")
+353        mep_by_year = yearize_mandates()
+354        mep_by_year.rename(columns={"start": "meta_start", "end":"meta_end"}, inplace=True)
+355        mep_by_year = mep_by_year[mep_by_year["meta_start"].notna()]
+356        config = fetch_config("chairs")
+357        if config and config['write_ch_chmp_merge']:
+358            mep_by_year.to_csv(
+359                f"{config['test_out_dir']}/{self.what_time_it_is()}_chair-chairmp_merge.csv",
+360                sep=';',
+361                index=False)
+362        chair_mp = pd.merge(chair_mp, mep_by_year, on=["person_id", "parliament_year"], how="left")
+363
+364        if config and config['write_trouble_matching']:
+365            outdf = chair_mp.loc[pd.isna(chair_mp["role"])].copy()
+366            if not outdf.empty:
+367                outdf.to_csv(
+368                    f"{config['test_out_dir']}/{self.what_time_it_is()}_trouble-matching-yearize.csv",
+369                    sep=';',
+370                    index=False)
+371
+372        general_start_end = self.get_riksdag_year()
+373        no_chair_hogs = True
+374        counter = 0
+375        ddups = []
+376        issues = pd.DataFrame(columns=chair_mp.columns)
+377        for y in chair_mp['parliament_year'].unique():
+378            year_chair_mp = chair_mp.loc[chair_mp['parliament_year'] == y]
+379            yse = general_start_end.loc[general_start_end['parliament_year'] == y].copy()
+380            yse.reset_index(drop=True, inplace=True)
+381            yse.sort_values(by=["chamber", "start", "end"], inplace=True)
+382            cs = yse["chamber"].unique()
+383            d = {}
+384            for c in cs:
+385                cdf = yse.loc[yse["chamber"] == c].copy()
+386                cdf.reset_index(drop=True, inplace=True)
+387                d[c] = {"earliest": cdf.at[0, "start"], "latest": cdf.at[len(cdf.index)-1, "end"]}
+388            mps = year_chair_mp.loc[pd.notnull(year_chair_mp['person_id']), 'person_id'].values
+389            if len(mps) > len(set(mps)):
+390                dups = self.get_duplicated_items(mps)
+391                ch = []
+392                for dup in dups:
+393                    df = year_chair_mp.loc[year_chair_mp["person_id"] == dup].copy()
+394                    df.drop_duplicates(subset=["chair_id", "parliament_year", "chair_start", "chair_end", "person_id"], inplace=True)
+395                    if len(df["chair_id"].unique()) == 1:
+396                        pass
+397                    elif len(df["chamber"].unique()) > 1:
+398                        if dup not in ch:
+399                            ch.append(dup)
+400                            print("\n--->>>>", dup)
+401                            print(df)
+402                        print("IN TWO CHAMBERS")
+403                        issues = pd.concat([issues, df], ignore_index=True)
+404                    else:
+405                        ranges = []
+406                        for i, r in df.iterrows():
+407                            rstart = None
+408                            if pd.notnull(r["chair_start"]):
+409                                rstart = r["chair_start"]
+410                            elif pd.notnull(r['meta_start']):
+411                                rstart = r['meta_start']
+412                            else:
+413                                rstart = d[r["chamber"]]["earliest"]
+414                            rend = None
+415                            if pd.notnull(r["chair_end"]):
+416                                rend = r["chair_end"]
+417                            elif pd.notnull(r["meta_end"]):
+418                                rend = r["meta_end"]
+419                            else:
+420                                rend = d[r["chamber"]]["latest"]
+421                            ranges.append((rstart, rend))
+422                        ranges = sorted(ranges, key=lambda x: (x[0], x[1]))
+423                        for ridx, _range in enumerate(ranges):
+424                            if ridx < len(ranges)-1:
+425                                delta = (datetime.strptime(_range[1], "%Y-%m-%d") - datetime.strptime(ranges[ridx+1][0], "%Y-%m-%d")).days
+426                                if max(0, delta) > 0:
+427                                    issues = pd.concat([issues,df], ignore_index=True)
+428                                    if dup not in ch:
+429                                        ch.append(dup)
+430                                        print("\n--->>>>", dup)
+431                                        print(ranges)
+432                                        print(df)
+433                                        print(_range, ranges[ridx+1])
+434
+435                if len(ch) > 0:
+436                    print("\n\n")
+437                    warnings.warn(f"{y}: [{', '.join(ch)}]", ChairHog)
+438                    no_chair_hogs = False
+439                    counter += len(ch)
+440                    [ddups.append(_) for _ in ch]
+441        if config and config['write_chairhogs']:
+442            issues.drop_duplicates(inplace=True)
+443            issues.to_csv(
+444                f"{config['test_out_dir']}/{self.what_time_it_is()}_ChairHogs.csv",
+445                sep=';',
+446                index=False)
+447        print(counter, ddups)
+448        self.assertTrue(no_chair_hogs)
+
+ + +

check no single person sits in two places at once

+
+ + +
+
+ +
+
@unittest.skip
+ + def + test_knaMP(self): + + + +
+ +
451    @unittest.skip
+452    def test_knaMP(self):
+453        """
+454        Check no one is sharing a chare
+455        """
+456        print("Testing no one sits on the same chair at the same time")
+457        config = fetch_config("chairs")
+458        chair_mp = self.get_chair_mp()
+459        chair_mp.rename(columns={"start": "chair_start", "end":"chair_end"}, inplace=True)
+460        chair_mp = chair_mp[chair_mp["person_id"].notna()]
+461        chairs = self.get_chairs()
+462        chair_mp = pd.merge(chair_mp, chairs, on="chair_id", how="left")
+463        mep_by_year = yearize_mandates()
+464        mep_by_year.rename(columns={"start": "meta_start", "end":"meta_end"}, inplace=True)
+465        mep_by_year = mep_by_year[mep_by_year["meta_start"].notna()]
+466        chair_mp = pd.merge(chair_mp, mep_by_year, on=["person_id", "parliament_year"], how="left")
+467        general_start_end = self.get_riksdag_year()
+468        ingen_knahund = True
+469        counter = 0
+470        ddups = []
+471        issues = pd.DataFrame(columns=chair_mp.columns)
+472        for y in chair_mp['parliament_year'].unique():
+473            year_chair_mp = chair_mp.loc[chair_mp['parliament_year'] == y].copy()
+474            yse = general_start_end.loc[general_start_end['parliament_year'] == y].copy()
+475            yse.reset_index(drop=True, inplace=True)
+476            yse.sort_values(by=["chamber", "start", "end"], inplace=True)
+477            cs = yse["chamber"].unique()
+478            d = {}
+479            for c in cs:
+480                cdf = yse.loc[yse["chamber"] == c].copy()
+481                cdf.reset_index(drop=True, inplace=True)
+482                d[c] = {"earliest": cdf.at[0, "start"], "latest": cdf.at[len(cdf.index)-1, "end"]}
+483            year_chair_mp.drop_duplicates(inplace=True)
+484            chairs = year_chair_mp.loc[pd.notnull(year_chair_mp['chair_id']), 'chair_id'].values
+485            if len(chairs) > len(set(chairs)):
+486                dups = self.get_duplicated_items(chairs)
+487                kh = []
+488                for dup in dups:
+489                    df = year_chair_mp.loc[year_chair_mp["chair_id"] == dup].copy()
+490                    df.drop_duplicates(subset=["chair_id", "parliament_year", "chair_start", "chair_end", "person_id"], inplace=True)
+491                    if len(df["person_id"].unique()) == 1:
+492                        pass
+493                    else:
+494                        ranges = []
+495                        for i, r in df.iterrows():
+496                            rstart = None
+497                            if pd.notnull(r["chair_start"]):
+498                                rstart = r["chair_start"]
+499                            elif pd.notnull(r["meta_start"]):
+500                                rstart = r["meta_start"]
+501                            else:
+502                                rstart = d[r["chamber"]]["earliest"]
+503                            rend = None
+504                            if pd.notnull(r["chair_end"]):
+505                                rend = r["chair_end"]
+506                            elif pd.notnull(r["meta_end"]):
+507                                rend = r["meta_end"]
+508                            else:
+509                                rend = d[r["chamber"]]["latest"]
+510                            ranges.append((rstart, rend))
+511
+512                        ranges = sorted(ranges, key=lambda x: (x[0], x[1]))
+513                        for ridx, _range in enumerate(ranges):
+514                            if ridx < len(ranges)-1:
+515                                delta = (datetime.strptime(_range[1], "%Y-%m-%d") - datetime.strptime(ranges[ridx+1][0], "%Y-%m-%d")).days
+516                                if max(0, delta) > 0:
+517                                    issues = pd.concat([issues,df], ignore_index=True)
+518                                    if dup not in kh:
+519                                        kh.append(dup)
+520                                        print("\n--->>>>", dup)
+521                                        print(df)
+522                                        print(ranges)
+523                                        print(_range, ranges[ridx+1])
+524                if len(kh) > 0:
+525                    print("\n\n")
+526                    warnings.warn(f"{y}: [{', '.join(kh)}]", KnaMP)
+527                    ingen_knahund = False
+528                    counter += len(kh)
+529                    [ddups.append(_) for _ in kh]
+530        if config and config['write_knahund']:
+531            issues.drop_duplicates(inplace=True)
+532            issues.to_csv(
+533                f"{config['test_out_dir']}/{self.what_time_it_is()}_LoveSeats.csv",
+534                sep=';',
+535                index=False)
+536
+537        print(counter, ddups)
+538        self.assertTrue(ingen_knahund)
+
+ + +

Check no one is sharing a chare

+
+ + +
+
+ +
+
@unittest.skip
+ + def + test_chair_coverage(self): + + + +
+ +
544    @unittest.skip
+545    def test_chair_coverage(self):
+546        """
+547        test all chairs are filled
+548        """
+549        print("Test coverage of chair-MP mapping.")
+550        config = fetch_config("chairs")
+551        chair_mp = self.get_chair_mp()
+552        no_empty_chairs = True
+553        empty_chairs = []
+554        counter = 0
+555        for y in chair_mp['parliament_year'].unique():
+556            y_empty_chairs = []
+557            y_counter = 0
+558            year_chair_mp = chair_mp.loc[chair_mp['parliament_year'] == y]
+559            year_chairs = year_chair_mp["chair_id"].unique()
+560            if year_chair_mp["person_id"].isnull().any():
+561                for i, r in year_chair_mp.iterrows():
+562                    if pd.isna(r["person_id"]):
+563                        df = year_chair_mp.loc[
+564                            (year_chair_mp["chair_id"] == r["chair_id"]) &
+565                            (pd.notnull(year_chair_mp["person_id"]))]
+566                        if df.empty:
+567                            y_counter += 1
+568                            y_empty_chairs.append(r["chair_id"])
+569            if y_counter > 0:
+570                no_empty_chairs = False
+571                print("\n\n")
+572                warnings.warn(f"{y}: [{', '.join(y_empty_chairs)}]", EmptyChair)
+573                counter += y_counter
+574                [empty_chairs.append([str(y), _]) for _ in y_empty_chairs]
+575                print("\n" + str(y_counter / len(year_chairs)) + " emptiness in year")
+576
+577        if config and config['write_empty_seats']:
+578            issues = pd.DataFrame(empty_chairs, columns=['year', 'chair_id'])
+579            issues.to_csv(
+580                f"{config['test_out_dir']}/{self.what_time_it_is()}_EmptySeats.csv",
+581                sep=';',
+582                index=False)
+583
+584        print(counter, empty_chairs)
+585        self.assertTrue(no_empty_chairs)
+
+ + +

test all chairs are filled

+
+ + +
+
+
Inherited Members
+
+
unittest.case.TestCase
+
TestCase
+
failureException
+
longMessage
+
maxDiff
+
addTypeEqualityFunc
+
addCleanup
+
addClassCleanup
+
setUp
+
tearDown
+
setUpClass
+
tearDownClass
+
countTestCases
+
defaultTestResult
+
shortDescription
+
id
+
subTest
+
run
+
doCleanups
+
doClassCleanups
+
debug
+
skipTest
+
fail
+
assertFalse
+
assertTrue
+
assertRaises
+
assertWarns
+
assertLogs
+
assertEqual
+
assertNotEqual
+
assertAlmostEqual
+
assertNotAlmostEqual
+
assertSequenceEqual
+
assertListEqual
+
assertTupleEqual
+
assertSetEqual
+
assertIn
+
assertNotIn
+
assertIs
+
assertIsNot
+
assertDictEqual
+
assertDictContainsSubset
+
assertCountEqual
+
assertMultiLineEqual
+
assertLess
+
assertLessEqual
+
assertGreater
+
assertGreaterEqual
+
assertIsNone
+
assertIsNotNone
+
assertIsInstance
+
assertNotIsInstance
+
assertRaisesRegex
+
assertWarnsRegex
+
assertRegex
+
assertNotRegex
+
failUnlessRaises
+
failIf
+
assertRaisesRegexp
+
assertRegexpMatches
+
assertNotRegexpMatches
+
failUnlessEqual
+
assertEquals
+
failIfEqual
+
assertNotEquals
+
failUnlessAlmostEqual
+
assertAlmostEquals
+
failIfAlmostEqual
+
assertNotAlmostEquals
+
failUnless
+
assert_
+ +
+
+
+
+
+ + \ No newline at end of file diff --git a/docs/riksdagen-persons/test/db.html b/docs/riksdagen-persons/test/db.html new file mode 100644 index 0000000..4be3993 --- /dev/null +++ b/docs/riksdagen-persons/test/db.html @@ -0,0 +1,2252 @@ + + + + + + + riksdagen-persons.test.db API documentation + + + + + + + + + +
+
+

+riksdagen-persons.test.db

+ +

throw ERROR on inconsistencies on our side

+ +

WARN on upstream errors

+
+ + + + + +
  1"""
+  2throw ERROR on inconsistencies on our side
+  3
+  4WARN on upstream errors
+  5"""
+  6from datetime import datetime
+  7from lxml import etree
+  8from pathlib import Path
+  9from pyriksdagen.db import load_metadata
+ 10from pyriksdagen.utils import (
+ 11    get_doc_dates,
+ 12    parse_protocol,
+ 13    protocol_iterators,
+ 14)
+ 15from pytest_cfg_fetcher.fetch import fetch_config
+ 16import pandas as pd
+ 17import unittest
+ 18import warnings
+ 19import yaml
+ 20
+ 21
+ 22
+ 23
+ 24class DuplicateWarning(Warning):
+ 25    def __init__(self, duplicate_df):
+ 26        self.message = f"Following duplicates found\n{duplicate_df}"
+ 27
+ 28    def __str__(self):
+ 29        return self.message
+ 30
+ 31
+ 32class MissingPersonWarning(Warning):
+ 33    def __init__(self, missing_persons):
+ 34        self.message = f"The following people are missing from the corpus metadata (person.csv)\n{missing_persons}"
+ 35
+ 36    def __str__(self):
+ 37        return self.message
+ 38
+ 39
+ 40class MissingNameWarning(Warning):
+ 41    def __init__(self, missing_names):
+ 42        self.message = f"The following people are missing from the corpus metadata (name.csv)\n{missing_names}"
+ 43
+ 44    def __str__(self):
+ 45        return self.message
+ 46
+ 47
+ 48class MissingLocationWarning(Warning):
+ 49    def __init__(self, missing_location):
+ 50        self.message = f"The following people are missing from the corpus metadata (location_specifier.csv)\n{missing_location}"
+ 51
+ 52    def __str__(self):
+ 53        return self.message
+ 54
+ 55
+ 56class MissingMemberWarning(Warning):
+ 57    def __init__(self, missing_member):
+ 58        self.message = f"The following people are missing members (member_of_parliament.csv)\n{missing_member}"
+ 59
+ 60    def __str__(self):
+ 61        return self.message
+ 62
+ 63
+ 64class MissingPartyWarning(Warning):
+ 65    def __init__(self, missing_location):
+ 66        self.message = f"The following people are missing from the corpus metadata (party_affiliation.csv)\n{missing_location}"
+ 67
+ 68    def __str__(self):
+ 69        return self.message
+ 70
+ 71
+ 72class CatalogIntegrityWarning(Warning):
+ 73    def __init__(self, issue):
+ 74        self.message = f"There's an integrity issue --| {issue} |-- maybe fix that."
+ 75
+ 76    def __str__(self):
+ 77        return self.message
+ 78
+ 79
+ 80
+ 81
+ 82class Test(unittest.TestCase):
+ 83    #
+ 84    # ---> Helper functions
+ 85    #
+ 86    def get_duplicates(self, df_name, columns):
+ 87        """
+ 88        Return a the df of a csv,  a df of unique rows, and a df of duplicates.
+ 89        """
+ 90        p = Path(".") / "data"
+ 91        path = p / f"{df_name}.csv"
+ 92        df = pd.read_csv(path)
+ 93
+ 94        df_duplicate = df[df.duplicated(columns, keep=False)]
+ 95        df_unique = df.drop_duplicates(columns)
+ 96        return df, df_unique, df_duplicate
+ 97
+ 98
+ 99    def get_emil(self):
+100        """
+101        Return a df of hand-checked (by Emil) "members of parliament" metadata.
+102        """
+103        emil_df = pd.read_csv('test/data/known-mps-catalog.csv', sep=';')
+104        return emil_df
+105
+106
+107    def get_meta_df(self, df_name):
+108        """
+109        Return csv as a df by name.
+110        """
+111        p = Path(".") / "data"
+112        path = p / f"{df_name}.csv"
+113        df = pd.read_csv(path)
+114        return df
+115
+116
+117    def write_error_df(self, df_name, errs, outpath):
+118        """
+119        Take a list of errors and write the output as a dataframe
+120        """
+121        now = datetime.now().strftime('%Y%m%d-%H%M%S')
+122        errs.to_csv(f"{outpath}/{now}_db_{df_name}.csv", sep=';', index=False)
+123
+124    #
+125    # ---> Tests
+126    #
+127    def test_government(self):
+128        """
+129        test no duplicate rows in government data
+130        """
+131        columns = ["start", "end"]
+132        df_name = "government"
+133        df, df_unique, df_duplicate = self.get_duplicates(df_name, columns)
+134        self.assertEqual(len(df), len(df_unique), df_duplicate)
+135
+136
+137    def test_member_of_parliament(self):
+138        """
+139        Test no duplicates in MP data
+140        """
+141        columns = ["person_id", "start", "end"]
+142        df_name = "member_of_parliament"
+143        df, df_unique, df_duplicate = self.get_duplicates(df_name, columns)
+144        self.assertEqual(len(df), len(df_unique), df_duplicate)
+145
+146
+147    def test_minister(self):
+148        """
+149        test no duplicates in Minister data
+150        """
+151        df_name = "minister"
+152        df, df_unique, df_duplicate = self.get_duplicates(df_name, None)
+153        self.assertEqual(len(df), len(df_unique), df_duplicate)
+154
+155
+156    def test_party_affiliation(self):
+157        """
+158        test no duplicates in party data
+159        """
+160        columns = ["person_id", "start", "end"]
+161        df_name = "party_affiliation"
+162        df, df_unique, df_duplicate = self.get_duplicates(df_name, columns)
+163
+164        if len(df) != len(df_unique):
+165            warnings.warn(str(df_duplicate), DuplicateWarning)
+166
+167        df, df_unique, df_duplicate = self.get_duplicates(df_name, None)
+168        self.assertEqual(len(df), len(df_unique), df_duplicate)
+169
+170
+171    def test_person(self):
+172        """
+173        test no duplicates in person
+174        """
+175        columns = ["person_id"]
+176        df_name = "person"
+177        df, df_unique, df_duplicate = self.get_duplicates(df_name, columns)
+178        self.assertEqual(len(df), len(df_unique), df_duplicate)
+179
+180
+181    def test_speaker(self):
+182        """
+183        test no duplicates in speaker data
+184        """
+185        columns = ["start", "end", "role"]
+186        df_name = "speaker"
+187        df, df_unique, df_duplicate = self.get_duplicates(df_name, columns)
+188
+189        if len(df) != len(df_unique):
+190            warnings.warn(str(df_duplicate), DuplicateWarning)
+191
+192        df, df_unique, df_duplicate = self.get_duplicates(df_name, None)
+193        self.assertEqual(len(df), len(df_unique), df_duplicate)
+194
+195
+196    def test_twitter(self):
+197        """
+198        test no duplicates in twitter data
+199        """
+200        df_name = "twitter"
+201        df, df_unique, df_duplicate = self.get_duplicates(df_name, None)
+202
+203        if len(df) != len(df_unique):
+204            warnings.warn(str(df_duplicate), DuplicateWarning)
+205
+206        df, df_unique, df_duplicate = self.get_duplicates(df_name, None)
+207        self.assertEqual(len(df), len(df_unique), df_duplicate)
+208
+209
+210    def test_emil_integrity(self):
+211        """
+212        test integrity of the known-mp-catalog
+213        """
+214        emil = self.get_emil()
+215        config = fetch_config("db")
+216
+217        person_id_issue = emil[(emil['person_id'].isna()) | (emil['person_id'] == "Q00FEL00")]
+218        if not person_id_issue.empty:
+219            warnings.warn(f'{len(person_id_issue)} person_id issues', CatalogIntegrityWarning)
+220            if config and congif["write_catalog_integrity"]:
+221                self.write_error_df("swerik-id-issue", person_id_issue, config["test_out_dir"])
+222
+223        birthdate_NA = emil[(emil['born'].isna()) | (emil['born'] == "Multival")]
+224        if not birthdate_NA.empty:
+225            warnings.warn(f"{len(birthdate_NA)} birthdates missing", CatalogIntegrityWarning)
+226            if config and congif["write_catalog_integrity"]:
+227                self.write_error_df("missing-birthdate", birthdate_NA, config["test_out_dir"])
+228
+229        self.assertEqual(len(person_id_issue), 0, person_id_issue)
+230        self.assertEqual(len(birthdate_NA), 0, birthdate_NA)
+231
+232
+233    def test_cf_emil_person(self):
+234        """
+235        test that every entry on the person catalog is in the person.csv file
+236        """
+237        df_name = "person"
+238        df = self.get_meta_df(df_name)
+239        emil = self.get_emil()
+240        config = fetch_config("db")
+241
+242        missing_persons = pd.DataFrame(columns=list(emil.columns))
+243        for i, row in emil.iterrows():
+244            if row['person_id'] not in df['person_id'].unique():
+245                missing_persons.loc[len(missing_persons)] = row
+246
+247        if not missing_persons.empty:
+248            warnings.warn(str(missing_persons), MissingPersonWarning)
+249            if config and config['write_missing_person']:
+250                self.write_error_df(df_name, missing_persons, config["test_out_dir"])
+251
+252        self.assertTrue(missing_persons.empty, missing_persons)
+253
+254
+255    def test_cf_emil_name(self):
+256        """
+257        test that every entry on the person catalog is in the name.csv file
+258        """
+259        df_name = "name"
+260        df = self.get_meta_df(df_name)
+261        emil = self.get_emil()
+262        config = fetch_config("db")
+263
+264        missing_names = pd.DataFrame(columns=list(emil.columns))
+265        for i, row in emil.iterrows():
+266            if row['person_id'] not in df['person_id'].unique():
+267                missing_names.loc[len(missing_names)] = row
+268
+269        if not missing_names.empty:
+270            warnings.warn(str(missing_names), MissingNameWarning)
+271            if config and config['write_missing_name']:
+272                self.write_missing(df_name, missing_names, config["test_out_dir"])
+273
+274        self.assertTrue(missing_names.empty, missing_names)
+275
+276
+277    def test_cf_known_iorter_metadata(self):
+278        """
+279        test that every entry on the person catalog is in the location_specifier.csv with the same location
+280        """
+281        df_name = "location_specifier"
+282        df = self.get_meta_df(df_name)
+283        iorter = pd.read_csv("test/data/known-iorter.csv", sep=";")
+284        config = fetch_config("db")
+285
+286        missing_locations = pd.DataFrame(columns=list(iorter.columns))
+287        for i, row in iorter.iterrows():
+288            filtered = df.loc[(df["person_id"] == row["person_id"]) & (df["location"] == row["iort"])]
+289            if len(filtered) < 1:
+290                missing_locations.loc[len(missing_locations)] = row
+291
+292        if not missing_locations.empty:
+293            warnings.warn(str(missing_locations), MissingLocationWarning)
+294            if config and config['write_missing_iorter']:
+295                self.write_error_df(df_name, missing_locations, config["test_out_dir"])
+296
+297        self.assertTrue(missing_locations.empty, missing_locations)
+298
+299
+300    def test_cf_emil_member(self):
+301        """
+302        test that every entry on the person catalog is in the member_of_parliament.csv file
+303        """
+304        df_name = "member_of_parliament"
+305        df = self.get_meta_df(df_name)
+306        emil = self.get_emil()
+307        config = fetch_config("db")
+308
+309        missing_members = pd.DataFrame(columns=list(emil.columns))
+310        for i, row in emil.iterrows():
+311            if row['person_id'] not in df['person_id'].unique():
+312                missing_members.loc[len(missing_members)] = row
+313
+314        if not missing_members.empty:
+315            warnings.warn(str(missing_members), MissingMemberWarning)
+316            if config and congig['write_missing_mep']:
+317                self.write_error_df(df_name, missing_members, config["test_out_dir"])
+318
+319        self.assertTrue(missing_members.empty, missing_members)
+320
+321
+322    @unittest.skip("Skipping party_affiliation test")
+323    def test_cf_emil_party(self):
+324        """
+325        test that every entry on the person catalog is in the party_affiliation.csv file
+326        """
+327        df_name = "party_affiliation"
+328        df = self.get_meta_df(df_name)
+329        emil = self.get_emil()
+330        config = fetch_config("db")
+331
+332        missing_parties = pd.DataFrame(columns=list(emil.columns))
+333        for i, row in emil.iterrows():
+334            if row['person_id'] not in df['person_id'].unique():
+335                missing_parties.loc[len(missing_parties)] = row
+336
+337        if not missing_parties.empty:
+338            warnings.warn(str(missing_parties), MissingPartyWarning)
+339            if config and config["write_missing_party"]:
+340                self.write_error_df(df_name, missing_parties, config["test_out_dir"])
+341
+342        self.assertTrue(missing_parties.empty, missing_parties)
+343
+344
+345    @unittest.skip
+346    def test_session_dates(self):
+347        """
+348        test that all protocols are in the known session dates
+349
+350        session dates scraped from protocols -- necessary? useful?
+351        """
+352        dates_df = pd.read_csv("test/data/session-dates.csv", sep=';')
+353        protocols = sorted(list(protocol_iterators("corpus/protocols/", start=1867, end=2022)))
+354        config = fetch_config("db")
+355
+356        date_counter = 0
+357        err = False
+358        for protocol in protocols:
+359            E, dates = get_doc_dates(protocol)
+360            if E:
+361                err = True
+362        if err:
+363            rows = []
+364            cols = ["protocol", "date"]
+365            for i, r in dates_df.iterrows():
+366                root = parse_protocol(r['protocol'])
+367                d = r["date"]
+368                date_match = root.findall(f'{tei_ns}docDate[@when="{d}"]')
+369                if len(date_match) != 1:
+370                    rows.append([r['protocol']. r['date']])
+371            if len(rows) > 0:
+372                if config and config["write_unknown_dates"]:
+373                    df = pd.DataFrame(rows, columns=cols)
+374                    self.write_error_df("session-dates", df, config["test_out_dir"])
+375
+376            self.assertEqual(
+377                len(rows), 0,
+378                f"{len(rows)} date issues // dates not in the known session dates csv")
+379
+380
+381
+382
+383if __name__ == '__main__':
+384    unittest.main()
+
+ + +
+
+ +
+ + class + DuplicateWarning(builtins.Warning): + + + +
+ +
25class DuplicateWarning(Warning):
+26    def __init__(self, duplicate_df):
+27        self.message = f"Following duplicates found\n{duplicate_df}"
+28
+29    def __str__(self):
+30        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + DuplicateWarning(duplicate_df) + + + +
+ +
26    def __init__(self, duplicate_df):
+27        self.message = f"Following duplicates found\n{duplicate_df}"
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + MissingPersonWarning(builtins.Warning): + + + +
+ +
33class MissingPersonWarning(Warning):
+34    def __init__(self, missing_persons):
+35        self.message = f"The following people are missing from the corpus metadata (person.csv)\n{missing_persons}"
+36
+37    def __str__(self):
+38        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + MissingPersonWarning(missing_persons) + + + +
+ +
34    def __init__(self, missing_persons):
+35        self.message = f"The following people are missing from the corpus metadata (person.csv)\n{missing_persons}"
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + MissingNameWarning(builtins.Warning): + + + +
+ +
41class MissingNameWarning(Warning):
+42    def __init__(self, missing_names):
+43        self.message = f"The following people are missing from the corpus metadata (name.csv)\n{missing_names}"
+44
+45    def __str__(self):
+46        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + MissingNameWarning(missing_names) + + + +
+ +
42    def __init__(self, missing_names):
+43        self.message = f"The following people are missing from the corpus metadata (name.csv)\n{missing_names}"
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + MissingLocationWarning(builtins.Warning): + + + +
+ +
49class MissingLocationWarning(Warning):
+50    def __init__(self, missing_location):
+51        self.message = f"The following people are missing from the corpus metadata (location_specifier.csv)\n{missing_location}"
+52
+53    def __str__(self):
+54        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + MissingLocationWarning(missing_location) + + + +
+ +
50    def __init__(self, missing_location):
+51        self.message = f"The following people are missing from the corpus metadata (location_specifier.csv)\n{missing_location}"
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + MissingMemberWarning(builtins.Warning): + + + +
+ +
57class MissingMemberWarning(Warning):
+58    def __init__(self, missing_member):
+59        self.message = f"The following people are missing members (member_of_parliament.csv)\n{missing_member}"
+60
+61    def __str__(self):
+62        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + MissingMemberWarning(missing_member) + + + +
+ +
58    def __init__(self, missing_member):
+59        self.message = f"The following people are missing members (member_of_parliament.csv)\n{missing_member}"
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + MissingPartyWarning(builtins.Warning): + + + +
+ +
65class MissingPartyWarning(Warning):
+66    def __init__(self, missing_location):
+67        self.message = f"The following people are missing from the corpus metadata (party_affiliation.csv)\n{missing_location}"
+68
+69    def __str__(self):
+70        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + MissingPartyWarning(missing_location) + + + +
+ +
66    def __init__(self, missing_location):
+67        self.message = f"The following people are missing from the corpus metadata (party_affiliation.csv)\n{missing_location}"
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + CatalogIntegrityWarning(builtins.Warning): + + + +
+ +
73class CatalogIntegrityWarning(Warning):
+74    def __init__(self, issue):
+75        self.message = f"There's an integrity issue --| {issue} |-- maybe fix that."
+76
+77    def __str__(self):
+78        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + CatalogIntegrityWarning(issue) + + + +
+ +
74    def __init__(self, issue):
+75        self.message = f"There's an integrity issue --| {issue} |-- maybe fix that."
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + Test(unittest.case.TestCase): + + + +
+ +
 83class Test(unittest.TestCase):
+ 84    #
+ 85    # ---> Helper functions
+ 86    #
+ 87    def get_duplicates(self, df_name, columns):
+ 88        """
+ 89        Return a the df of a csv,  a df of unique rows, and a df of duplicates.
+ 90        """
+ 91        p = Path(".") / "data"
+ 92        path = p / f"{df_name}.csv"
+ 93        df = pd.read_csv(path)
+ 94
+ 95        df_duplicate = df[df.duplicated(columns, keep=False)]
+ 96        df_unique = df.drop_duplicates(columns)
+ 97        return df, df_unique, df_duplicate
+ 98
+ 99
+100    def get_emil(self):
+101        """
+102        Return a df of hand-checked (by Emil) "members of parliament" metadata.
+103        """
+104        emil_df = pd.read_csv('test/data/known-mps-catalog.csv', sep=';')
+105        return emil_df
+106
+107
+108    def get_meta_df(self, df_name):
+109        """
+110        Return csv as a df by name.
+111        """
+112        p = Path(".") / "data"
+113        path = p / f"{df_name}.csv"
+114        df = pd.read_csv(path)
+115        return df
+116
+117
+118    def write_error_df(self, df_name, errs, outpath):
+119        """
+120        Take a list of errors and write the output as a dataframe
+121        """
+122        now = datetime.now().strftime('%Y%m%d-%H%M%S')
+123        errs.to_csv(f"{outpath}/{now}_db_{df_name}.csv", sep=';', index=False)
+124
+125    #
+126    # ---> Tests
+127    #
+128    def test_government(self):
+129        """
+130        test no duplicate rows in government data
+131        """
+132        columns = ["start", "end"]
+133        df_name = "government"
+134        df, df_unique, df_duplicate = self.get_duplicates(df_name, columns)
+135        self.assertEqual(len(df), len(df_unique), df_duplicate)
+136
+137
+138    def test_member_of_parliament(self):
+139        """
+140        Test no duplicates in MP data
+141        """
+142        columns = ["person_id", "start", "end"]
+143        df_name = "member_of_parliament"
+144        df, df_unique, df_duplicate = self.get_duplicates(df_name, columns)
+145        self.assertEqual(len(df), len(df_unique), df_duplicate)
+146
+147
+148    def test_minister(self):
+149        """
+150        test no duplicates in Minister data
+151        """
+152        df_name = "minister"
+153        df, df_unique, df_duplicate = self.get_duplicates(df_name, None)
+154        self.assertEqual(len(df), len(df_unique), df_duplicate)
+155
+156
+157    def test_party_affiliation(self):
+158        """
+159        test no duplicates in party data
+160        """
+161        columns = ["person_id", "start", "end"]
+162        df_name = "party_affiliation"
+163        df, df_unique, df_duplicate = self.get_duplicates(df_name, columns)
+164
+165        if len(df) != len(df_unique):
+166            warnings.warn(str(df_duplicate), DuplicateWarning)
+167
+168        df, df_unique, df_duplicate = self.get_duplicates(df_name, None)
+169        self.assertEqual(len(df), len(df_unique), df_duplicate)
+170
+171
+172    def test_person(self):
+173        """
+174        test no duplicates in person
+175        """
+176        columns = ["person_id"]
+177        df_name = "person"
+178        df, df_unique, df_duplicate = self.get_duplicates(df_name, columns)
+179        self.assertEqual(len(df), len(df_unique), df_duplicate)
+180
+181
+182    def test_speaker(self):
+183        """
+184        test no duplicates in speaker data
+185        """
+186        columns = ["start", "end", "role"]
+187        df_name = "speaker"
+188        df, df_unique, df_duplicate = self.get_duplicates(df_name, columns)
+189
+190        if len(df) != len(df_unique):
+191            warnings.warn(str(df_duplicate), DuplicateWarning)
+192
+193        df, df_unique, df_duplicate = self.get_duplicates(df_name, None)
+194        self.assertEqual(len(df), len(df_unique), df_duplicate)
+195
+196
+197    def test_twitter(self):
+198        """
+199        test no duplicates in twitter data
+200        """
+201        df_name = "twitter"
+202        df, df_unique, df_duplicate = self.get_duplicates(df_name, None)
+203
+204        if len(df) != len(df_unique):
+205            warnings.warn(str(df_duplicate), DuplicateWarning)
+206
+207        df, df_unique, df_duplicate = self.get_duplicates(df_name, None)
+208        self.assertEqual(len(df), len(df_unique), df_duplicate)
+209
+210
+211    def test_emil_integrity(self):
+212        """
+213        test integrity of the known-mp-catalog
+214        """
+215        emil = self.get_emil()
+216        config = fetch_config("db")
+217
+218        person_id_issue = emil[(emil['person_id'].isna()) | (emil['person_id'] == "Q00FEL00")]
+219        if not person_id_issue.empty:
+220            warnings.warn(f'{len(person_id_issue)} person_id issues', CatalogIntegrityWarning)
+221            if config and congif["write_catalog_integrity"]:
+222                self.write_error_df("swerik-id-issue", person_id_issue, config["test_out_dir"])
+223
+224        birthdate_NA = emil[(emil['born'].isna()) | (emil['born'] == "Multival")]
+225        if not birthdate_NA.empty:
+226            warnings.warn(f"{len(birthdate_NA)} birthdates missing", CatalogIntegrityWarning)
+227            if config and congif["write_catalog_integrity"]:
+228                self.write_error_df("missing-birthdate", birthdate_NA, config["test_out_dir"])
+229
+230        self.assertEqual(len(person_id_issue), 0, person_id_issue)
+231        self.assertEqual(len(birthdate_NA), 0, birthdate_NA)
+232
+233
+234    def test_cf_emil_person(self):
+235        """
+236        test that every entry on the person catalog is in the person.csv file
+237        """
+238        df_name = "person"
+239        df = self.get_meta_df(df_name)
+240        emil = self.get_emil()
+241        config = fetch_config("db")
+242
+243        missing_persons = pd.DataFrame(columns=list(emil.columns))
+244        for i, row in emil.iterrows():
+245            if row['person_id'] not in df['person_id'].unique():
+246                missing_persons.loc[len(missing_persons)] = row
+247
+248        if not missing_persons.empty:
+249            warnings.warn(str(missing_persons), MissingPersonWarning)
+250            if config and config['write_missing_person']:
+251                self.write_error_df(df_name, missing_persons, config["test_out_dir"])
+252
+253        self.assertTrue(missing_persons.empty, missing_persons)
+254
+255
+256    def test_cf_emil_name(self):
+257        """
+258        test that every entry on the person catalog is in the name.csv file
+259        """
+260        df_name = "name"
+261        df = self.get_meta_df(df_name)
+262        emil = self.get_emil()
+263        config = fetch_config("db")
+264
+265        missing_names = pd.DataFrame(columns=list(emil.columns))
+266        for i, row in emil.iterrows():
+267            if row['person_id'] not in df['person_id'].unique():
+268                missing_names.loc[len(missing_names)] = row
+269
+270        if not missing_names.empty:
+271            warnings.warn(str(missing_names), MissingNameWarning)
+272            if config and config['write_missing_name']:
+273                self.write_missing(df_name, missing_names, config["test_out_dir"])
+274
+275        self.assertTrue(missing_names.empty, missing_names)
+276
+277
+278    def test_cf_known_iorter_metadata(self):
+279        """
+280        test that every entry on the person catalog is in the location_specifier.csv with the same location
+281        """
+282        df_name = "location_specifier"
+283        df = self.get_meta_df(df_name)
+284        iorter = pd.read_csv("test/data/known-iorter.csv", sep=";")
+285        config = fetch_config("db")
+286
+287        missing_locations = pd.DataFrame(columns=list(iorter.columns))
+288        for i, row in iorter.iterrows():
+289            filtered = df.loc[(df["person_id"] == row["person_id"]) & (df["location"] == row["iort"])]
+290            if len(filtered) < 1:
+291                missing_locations.loc[len(missing_locations)] = row
+292
+293        if not missing_locations.empty:
+294            warnings.warn(str(missing_locations), MissingLocationWarning)
+295            if config and config['write_missing_iorter']:
+296                self.write_error_df(df_name, missing_locations, config["test_out_dir"])
+297
+298        self.assertTrue(missing_locations.empty, missing_locations)
+299
+300
+301    def test_cf_emil_member(self):
+302        """
+303        test that every entry on the person catalog is in the member_of_parliament.csv file
+304        """
+305        df_name = "member_of_parliament"
+306        df = self.get_meta_df(df_name)
+307        emil = self.get_emil()
+308        config = fetch_config("db")
+309
+310        missing_members = pd.DataFrame(columns=list(emil.columns))
+311        for i, row in emil.iterrows():
+312            if row['person_id'] not in df['person_id'].unique():
+313                missing_members.loc[len(missing_members)] = row
+314
+315        if not missing_members.empty:
+316            warnings.warn(str(missing_members), MissingMemberWarning)
+317            if config and congig['write_missing_mep']:
+318                self.write_error_df(df_name, missing_members, config["test_out_dir"])
+319
+320        self.assertTrue(missing_members.empty, missing_members)
+321
+322
+323    @unittest.skip("Skipping party_affiliation test")
+324    def test_cf_emil_party(self):
+325        """
+326        test that every entry on the person catalog is in the party_affiliation.csv file
+327        """
+328        df_name = "party_affiliation"
+329        df = self.get_meta_df(df_name)
+330        emil = self.get_emil()
+331        config = fetch_config("db")
+332
+333        missing_parties = pd.DataFrame(columns=list(emil.columns))
+334        for i, row in emil.iterrows():
+335            if row['person_id'] not in df['person_id'].unique():
+336                missing_parties.loc[len(missing_parties)] = row
+337
+338        if not missing_parties.empty:
+339            warnings.warn(str(missing_parties), MissingPartyWarning)
+340            if config and config["write_missing_party"]:
+341                self.write_error_df(df_name, missing_parties, config["test_out_dir"])
+342
+343        self.assertTrue(missing_parties.empty, missing_parties)
+344
+345
+346    @unittest.skip
+347    def test_session_dates(self):
+348        """
+349        test that all protocols are in the known session dates
+350
+351        session dates scraped from protocols -- necessary? useful?
+352        """
+353        dates_df = pd.read_csv("test/data/session-dates.csv", sep=';')
+354        protocols = sorted(list(protocol_iterators("corpus/protocols/", start=1867, end=2022)))
+355        config = fetch_config("db")
+356
+357        date_counter = 0
+358        err = False
+359        for protocol in protocols:
+360            E, dates = get_doc_dates(protocol)
+361            if E:
+362                err = True
+363        if err:
+364            rows = []
+365            cols = ["protocol", "date"]
+366            for i, r in dates_df.iterrows():
+367                root = parse_protocol(r['protocol'])
+368                d = r["date"]
+369                date_match = root.findall(f'{tei_ns}docDate[@when="{d}"]')
+370                if len(date_match) != 1:
+371                    rows.append([r['protocol']. r['date']])
+372            if len(rows) > 0:
+373                if config and config["write_unknown_dates"]:
+374                    df = pd.DataFrame(rows, columns=cols)
+375                    self.write_error_df("session-dates", df, config["test_out_dir"])
+376
+377            self.assertEqual(
+378                len(rows), 0,
+379                f"{len(rows)} date issues // dates not in the known session dates csv")
+
+ + +

A class whose instances are single test cases.

+ +

By default, the test code itself should be placed in a method named +'runTest'.

+ +

If the fixture may be used for many test cases, create as +many test methods as are needed. When instantiating such a TestCase +subclass, specify in the constructor arguments the name of the test method +that the instance is to execute.

+ +

Test authors should subclass TestCase for their own tests. Construction +and deconstruction of the test's environment ('fixture') can be +implemented by overriding the 'setUp' and 'tearDown' methods respectively.

+ +

If it is necessary to override the __init__ method, the base class +__init__ method must always be called. It is important that subclasses +should not change the signature of their __init__ method, since instances +of the classes are instantiated automatically by parts of the framework +in order to be run.

+ +

When subclassing TestCase, you can set these attributes:

+ +
    +
  • failureException: determines which exception will be raised when +the instance's assertion methods fail; test methods raising this +exception will be deemed to have 'failed' rather than 'errored'.
  • +
  • longMessage: determines whether long messages (including repr of +objects used in assert methods) will be printed on failure in addition +to any explicit message passed.
  • +
  • maxDiff: sets the maximum length of a diff in failure messages +by assert methods using difflib. It is looked up as an instance +attribute so can be configured by individual tests if required.
  • +
+
+ + +
+ +
+ + def + get_duplicates(self, df_name, columns): + + + +
+ +
87    def get_duplicates(self, df_name, columns):
+88        """
+89        Return a the df of a csv,  a df of unique rows, and a df of duplicates.
+90        """
+91        p = Path(".") / "data"
+92        path = p / f"{df_name}.csv"
+93        df = pd.read_csv(path)
+94
+95        df_duplicate = df[df.duplicated(columns, keep=False)]
+96        df_unique = df.drop_duplicates(columns)
+97        return df, df_unique, df_duplicate
+
+ + +

Return a the df of a csv, a df of unique rows, and a df of duplicates.

+
+ + +
+
+ +
+ + def + get_emil(self): + + + +
+ +
100    def get_emil(self):
+101        """
+102        Return a df of hand-checked (by Emil) "members of parliament" metadata.
+103        """
+104        emil_df = pd.read_csv('test/data/known-mps-catalog.csv', sep=';')
+105        return emil_df
+
+ + +

Return a df of hand-checked (by Emil) "members of parliament" metadata.

+
+ + +
+
+ +
+ + def + get_meta_df(self, df_name): + + + +
+ +
108    def get_meta_df(self, df_name):
+109        """
+110        Return csv as a df by name.
+111        """
+112        p = Path(".") / "data"
+113        path = p / f"{df_name}.csv"
+114        df = pd.read_csv(path)
+115        return df
+
+ + +

Return csv as a df by name.

+
+ + +
+
+ +
+ + def + write_error_df(self, df_name, errs, outpath): + + + +
+ +
118    def write_error_df(self, df_name, errs, outpath):
+119        """
+120        Take a list of errors and write the output as a dataframe
+121        """
+122        now = datetime.now().strftime('%Y%m%d-%H%M%S')
+123        errs.to_csv(f"{outpath}/{now}_db_{df_name}.csv", sep=';', index=False)
+
+ + +

Take a list of errors and write the output as a dataframe

+
+ + +
+
+ +
+ + def + test_government(self): + + + +
+ +
128    def test_government(self):
+129        """
+130        test no duplicate rows in government data
+131        """
+132        columns = ["start", "end"]
+133        df_name = "government"
+134        df, df_unique, df_duplicate = self.get_duplicates(df_name, columns)
+135        self.assertEqual(len(df), len(df_unique), df_duplicate)
+
+ + +

test no duplicate rows in government data

+
+ + +
+
+ +
+ + def + test_member_of_parliament(self): + + + +
+ +
138    def test_member_of_parliament(self):
+139        """
+140        Test no duplicates in MP data
+141        """
+142        columns = ["person_id", "start", "end"]
+143        df_name = "member_of_parliament"
+144        df, df_unique, df_duplicate = self.get_duplicates(df_name, columns)
+145        self.assertEqual(len(df), len(df_unique), df_duplicate)
+
+ + +

Test no duplicates in MP data

+
+ + +
+
+ +
+ + def + test_minister(self): + + + +
+ +
148    def test_minister(self):
+149        """
+150        test no duplicates in Minister data
+151        """
+152        df_name = "minister"
+153        df, df_unique, df_duplicate = self.get_duplicates(df_name, None)
+154        self.assertEqual(len(df), len(df_unique), df_duplicate)
+
+ + +

test no duplicates in Minister data

+
+ + +
+
+ +
+ + def + test_party_affiliation(self): + + + +
+ +
157    def test_party_affiliation(self):
+158        """
+159        test no duplicates in party data
+160        """
+161        columns = ["person_id", "start", "end"]
+162        df_name = "party_affiliation"
+163        df, df_unique, df_duplicate = self.get_duplicates(df_name, columns)
+164
+165        if len(df) != len(df_unique):
+166            warnings.warn(str(df_duplicate), DuplicateWarning)
+167
+168        df, df_unique, df_duplicate = self.get_duplicates(df_name, None)
+169        self.assertEqual(len(df), len(df_unique), df_duplicate)
+
+ + +

test no duplicates in party data

+
+ + +
+
+ +
+ + def + test_person(self): + + + +
+ +
172    def test_person(self):
+173        """
+174        test no duplicates in person
+175        """
+176        columns = ["person_id"]
+177        df_name = "person"
+178        df, df_unique, df_duplicate = self.get_duplicates(df_name, columns)
+179        self.assertEqual(len(df), len(df_unique), df_duplicate)
+
+ + +

test no duplicates in person

+
+ + +
+
+ +
+ + def + test_speaker(self): + + + +
+ +
182    def test_speaker(self):
+183        """
+184        test no duplicates in speaker data
+185        """
+186        columns = ["start", "end", "role"]
+187        df_name = "speaker"
+188        df, df_unique, df_duplicate = self.get_duplicates(df_name, columns)
+189
+190        if len(df) != len(df_unique):
+191            warnings.warn(str(df_duplicate), DuplicateWarning)
+192
+193        df, df_unique, df_duplicate = self.get_duplicates(df_name, None)
+194        self.assertEqual(len(df), len(df_unique), df_duplicate)
+
+ + +

test no duplicates in speaker data

+
+ + +
+
+ +
+ + def + test_twitter(self): + + + +
+ +
197    def test_twitter(self):
+198        """
+199        test no duplicates in twitter data
+200        """
+201        df_name = "twitter"
+202        df, df_unique, df_duplicate = self.get_duplicates(df_name, None)
+203
+204        if len(df) != len(df_unique):
+205            warnings.warn(str(df_duplicate), DuplicateWarning)
+206
+207        df, df_unique, df_duplicate = self.get_duplicates(df_name, None)
+208        self.assertEqual(len(df), len(df_unique), df_duplicate)
+
+ + +

test no duplicates in twitter data

+
+ + +
+
+ +
+ + def + test_emil_integrity(self): + + + +
+ +
211    def test_emil_integrity(self):
+212        """
+213        test integrity of the known-mp-catalog
+214        """
+215        emil = self.get_emil()
+216        config = fetch_config("db")
+217
+218        person_id_issue = emil[(emil['person_id'].isna()) | (emil['person_id'] == "Q00FEL00")]
+219        if not person_id_issue.empty:
+220            warnings.warn(f'{len(person_id_issue)} person_id issues', CatalogIntegrityWarning)
+221            if config and congif["write_catalog_integrity"]:
+222                self.write_error_df("swerik-id-issue", person_id_issue, config["test_out_dir"])
+223
+224        birthdate_NA = emil[(emil['born'].isna()) | (emil['born'] == "Multival")]
+225        if not birthdate_NA.empty:
+226            warnings.warn(f"{len(birthdate_NA)} birthdates missing", CatalogIntegrityWarning)
+227            if config and congif["write_catalog_integrity"]:
+228                self.write_error_df("missing-birthdate", birthdate_NA, config["test_out_dir"])
+229
+230        self.assertEqual(len(person_id_issue), 0, person_id_issue)
+231        self.assertEqual(len(birthdate_NA), 0, birthdate_NA)
+
+ + +

test integrity of the known-mp-catalog

+
+ + +
+
+ +
+ + def + test_cf_emil_person(self): + + + +
+ +
234    def test_cf_emil_person(self):
+235        """
+236        test that every entry on the person catalog is in the person.csv file
+237        """
+238        df_name = "person"
+239        df = self.get_meta_df(df_name)
+240        emil = self.get_emil()
+241        config = fetch_config("db")
+242
+243        missing_persons = pd.DataFrame(columns=list(emil.columns))
+244        for i, row in emil.iterrows():
+245            if row['person_id'] not in df['person_id'].unique():
+246                missing_persons.loc[len(missing_persons)] = row
+247
+248        if not missing_persons.empty:
+249            warnings.warn(str(missing_persons), MissingPersonWarning)
+250            if config and config['write_missing_person']:
+251                self.write_error_df(df_name, missing_persons, config["test_out_dir"])
+252
+253        self.assertTrue(missing_persons.empty, missing_persons)
+
+ + +

test that every entry on the person catalog is in the person.csv file

+
+ + +
+
+ +
+ + def + test_cf_emil_name(self): + + + +
+ +
256    def test_cf_emil_name(self):
+257        """
+258        test that every entry on the person catalog is in the name.csv file
+259        """
+260        df_name = "name"
+261        df = self.get_meta_df(df_name)
+262        emil = self.get_emil()
+263        config = fetch_config("db")
+264
+265        missing_names = pd.DataFrame(columns=list(emil.columns))
+266        for i, row in emil.iterrows():
+267            if row['person_id'] not in df['person_id'].unique():
+268                missing_names.loc[len(missing_names)] = row
+269
+270        if not missing_names.empty:
+271            warnings.warn(str(missing_names), MissingNameWarning)
+272            if config and config['write_missing_name']:
+273                self.write_missing(df_name, missing_names, config["test_out_dir"])
+274
+275        self.assertTrue(missing_names.empty, missing_names)
+
+ + +

test that every entry on the person catalog is in the name.csv file

+
+ + +
+
+ +
+ + def + test_cf_known_iorter_metadata(self): + + + +
+ +
278    def test_cf_known_iorter_metadata(self):
+279        """
+280        test that every entry on the person catalog is in the location_specifier.csv with the same location
+281        """
+282        df_name = "location_specifier"
+283        df = self.get_meta_df(df_name)
+284        iorter = pd.read_csv("test/data/known-iorter.csv", sep=";")
+285        config = fetch_config("db")
+286
+287        missing_locations = pd.DataFrame(columns=list(iorter.columns))
+288        for i, row in iorter.iterrows():
+289            filtered = df.loc[(df["person_id"] == row["person_id"]) & (df["location"] == row["iort"])]
+290            if len(filtered) < 1:
+291                missing_locations.loc[len(missing_locations)] = row
+292
+293        if not missing_locations.empty:
+294            warnings.warn(str(missing_locations), MissingLocationWarning)
+295            if config and config['write_missing_iorter']:
+296                self.write_error_df(df_name, missing_locations, config["test_out_dir"])
+297
+298        self.assertTrue(missing_locations.empty, missing_locations)
+
+ + +

test that every entry on the person catalog is in the location_specifier.csv with the same location

+
+ + +
+
+ +
+ + def + test_cf_emil_member(self): + + + +
+ +
301    def test_cf_emil_member(self):
+302        """
+303        test that every entry on the person catalog is in the member_of_parliament.csv file
+304        """
+305        df_name = "member_of_parliament"
+306        df = self.get_meta_df(df_name)
+307        emil = self.get_emil()
+308        config = fetch_config("db")
+309
+310        missing_members = pd.DataFrame(columns=list(emil.columns))
+311        for i, row in emil.iterrows():
+312            if row['person_id'] not in df['person_id'].unique():
+313                missing_members.loc[len(missing_members)] = row
+314
+315        if not missing_members.empty:
+316            warnings.warn(str(missing_members), MissingMemberWarning)
+317            if config and congig['write_missing_mep']:
+318                self.write_error_df(df_name, missing_members, config["test_out_dir"])
+319
+320        self.assertTrue(missing_members.empty, missing_members)
+
+ + +

test that every entry on the person catalog is in the member_of_parliament.csv file

+
+ + +
+
+ +
+
@unittest.skip('Skipping party_affiliation test')
+ + def + test_cf_emil_party(self): + + + +
+ +
323    @unittest.skip("Skipping party_affiliation test")
+324    def test_cf_emil_party(self):
+325        """
+326        test that every entry on the person catalog is in the party_affiliation.csv file
+327        """
+328        df_name = "party_affiliation"
+329        df = self.get_meta_df(df_name)
+330        emil = self.get_emil()
+331        config = fetch_config("db")
+332
+333        missing_parties = pd.DataFrame(columns=list(emil.columns))
+334        for i, row in emil.iterrows():
+335            if row['person_id'] not in df['person_id'].unique():
+336                missing_parties.loc[len(missing_parties)] = row
+337
+338        if not missing_parties.empty:
+339            warnings.warn(str(missing_parties), MissingPartyWarning)
+340            if config and config["write_missing_party"]:
+341                self.write_error_df(df_name, missing_parties, config["test_out_dir"])
+342
+343        self.assertTrue(missing_parties.empty, missing_parties)
+
+ + +

test that every entry on the person catalog is in the party_affiliation.csv file

+
+ + +
+
+ +
+
@unittest.skip
+ + def + test_session_dates(self): + + + +
+ +
346    @unittest.skip
+347    def test_session_dates(self):
+348        """
+349        test that all protocols are in the known session dates
+350
+351        session dates scraped from protocols -- necessary? useful?
+352        """
+353        dates_df = pd.read_csv("test/data/session-dates.csv", sep=';')
+354        protocols = sorted(list(protocol_iterators("corpus/protocols/", start=1867, end=2022)))
+355        config = fetch_config("db")
+356
+357        date_counter = 0
+358        err = False
+359        for protocol in protocols:
+360            E, dates = get_doc_dates(protocol)
+361            if E:
+362                err = True
+363        if err:
+364            rows = []
+365            cols = ["protocol", "date"]
+366            for i, r in dates_df.iterrows():
+367                root = parse_protocol(r['protocol'])
+368                d = r["date"]
+369                date_match = root.findall(f'{tei_ns}docDate[@when="{d}"]')
+370                if len(date_match) != 1:
+371                    rows.append([r['protocol']. r['date']])
+372            if len(rows) > 0:
+373                if config and config["write_unknown_dates"]:
+374                    df = pd.DataFrame(rows, columns=cols)
+375                    self.write_error_df("session-dates", df, config["test_out_dir"])
+376
+377            self.assertEqual(
+378                len(rows), 0,
+379                f"{len(rows)} date issues // dates not in the known session dates csv")
+
+ + +

test that all protocols are in the known session dates

+ +

session dates scraped from protocols -- necessary? useful?

+
+ + +
+
+
Inherited Members
+
+
unittest.case.TestCase
+
TestCase
+
failureException
+
longMessage
+
maxDiff
+
addTypeEqualityFunc
+
addCleanup
+
addClassCleanup
+
setUp
+
tearDown
+
setUpClass
+
tearDownClass
+
countTestCases
+
defaultTestResult
+
shortDescription
+
id
+
subTest
+
run
+
doCleanups
+
doClassCleanups
+
debug
+
skipTest
+
fail
+
assertFalse
+
assertTrue
+
assertRaises
+
assertWarns
+
assertLogs
+
assertEqual
+
assertNotEqual
+
assertAlmostEqual
+
assertNotAlmostEqual
+
assertSequenceEqual
+
assertListEqual
+
assertTupleEqual
+
assertSetEqual
+
assertIn
+
assertNotIn
+
assertIs
+
assertIsNot
+
assertDictEqual
+
assertDictContainsSubset
+
assertCountEqual
+
assertMultiLineEqual
+
assertLess
+
assertLessEqual
+
assertGreater
+
assertGreaterEqual
+
assertIsNone
+
assertIsNotNone
+
assertIsInstance
+
assertNotIsInstance
+
assertRaisesRegex
+
assertWarnsRegex
+
assertRegex
+
assertNotRegex
+
failUnlessRaises
+
failIf
+
assertRaisesRegexp
+
assertRegexpMatches
+
assertNotRegexpMatches
+
failUnlessEqual
+
assertEquals
+
failIfEqual
+
assertNotEquals
+
failUnlessAlmostEqual
+
assertAlmostEquals
+
failIfAlmostEqual
+
assertNotAlmostEquals
+
failUnless
+
assert_
+ +
+
+
+
+
+ + \ No newline at end of file diff --git a/docs/riksdagen-persons/test/mandates.html b/docs/riksdagen-persons/test/mandates.html new file mode 100644 index 0000000..cf0d74b --- /dev/null +++ b/docs/riksdagen-persons/test/mandates.html @@ -0,0 +1,628 @@ + + + + + + + riksdagen-persons.test.mandates API documentation + + + + + + + + + +
+
+

+riksdagen-persons.test.mandates

+ +

Test that known MP start/end dates that have been manually verified do not change in the metadata.

+
+ + + + + +
 1"""
+ 2Test that known MP start/end dates that have been manually verified do not change in the metadata.
+ 3"""
+ 4from datetime import datetime
+ 5from pytest_cfg_fetcher.fetch import fetch_config
+ 6import json
+ 7import pandas as pd
+ 8import unittest
+ 9import warnings
+10
+11
+12
+13
+14class DateErrorWarning(Warning):
+15    def __init__(self, date_error):
+16        self.message = f"Date Error: {date_error}"
+17
+18    def __str__(self):
+19        return self.message
+20
+21
+22
+23class Test(unittest.TestCase):
+24
+25    def fetch_known_mandate_dates(self):
+26        return pd.read_csv("test/data/mandate-dates.csv", sep=';')
+27
+28
+29    def fetch_mep_meta(self):
+30        return pd.read_csv("data/member_of_parliament.csv")
+31
+32
+33    def test_manually_checked_mandates(self):
+34        mep = self.fetch_mep_meta()
+35        df = self.fetch_known_mandate_dates()
+36        config = fetch_config("mandates")
+37        counter = 0
+38        rows = []
+39        cols = ["person_id", "date", "type"]
+40        for i, r in df.iterrows():
+41            fil = mep.loc[(mep['person_id'] == r["person_id"]) & (mep[r["type"].lower()] == r['date'])]
+42            if fil.empty:
+43                counter += 1
+44                rows.append([r["person_id"], r["date"], r["type"]])
+45                warnings.warn(f"({r['type']}): {r['date']}, {r['person_id']}" , DateErrorWarning)
+46        if len(rows) > 0:
+47            if config and config['write_errors']:
+48                now = datetime.now().strftime("%Y%m%d-%H%M")
+49                out = pd.DataFrame(rows, columns=cols)
+50                out.to_csv(f"{config['test_out_dir']}{now}_mandates-test.csv", index=False)
+51
+52        self.assertEqual(counter, 0)
+53
+54
+55
+56
+57if __name__ == '__main__':
+58    unittest.test()
+
+ + +
+
+ +
+ + class + DateErrorWarning(builtins.Warning): + + + +
+ +
15class DateErrorWarning(Warning):
+16    def __init__(self, date_error):
+17        self.message = f"Date Error: {date_error}"
+18
+19    def __str__(self):
+20        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + DateErrorWarning(date_error) + + + +
+ +
16    def __init__(self, date_error):
+17        self.message = f"Date Error: {date_error}"
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + Test(unittest.case.TestCase): + + + +
+ +
24class Test(unittest.TestCase):
+25
+26    def fetch_known_mandate_dates(self):
+27        return pd.read_csv("test/data/mandate-dates.csv", sep=';')
+28
+29
+30    def fetch_mep_meta(self):
+31        return pd.read_csv("data/member_of_parliament.csv")
+32
+33
+34    def test_manually_checked_mandates(self):
+35        mep = self.fetch_mep_meta()
+36        df = self.fetch_known_mandate_dates()
+37        config = fetch_config("mandates")
+38        counter = 0
+39        rows = []
+40        cols = ["person_id", "date", "type"]
+41        for i, r in df.iterrows():
+42            fil = mep.loc[(mep['person_id'] == r["person_id"]) & (mep[r["type"].lower()] == r['date'])]
+43            if fil.empty:
+44                counter += 1
+45                rows.append([r["person_id"], r["date"], r["type"]])
+46                warnings.warn(f"({r['type']}): {r['date']}, {r['person_id']}" , DateErrorWarning)
+47        if len(rows) > 0:
+48            if config and config['write_errors']:
+49                now = datetime.now().strftime("%Y%m%d-%H%M")
+50                out = pd.DataFrame(rows, columns=cols)
+51                out.to_csv(f"{config['test_out_dir']}{now}_mandates-test.csv", index=False)
+52
+53        self.assertEqual(counter, 0)
+
+ + +

A class whose instances are single test cases.

+ +

By default, the test code itself should be placed in a method named +'runTest'.

+ +

If the fixture may be used for many test cases, create as +many test methods as are needed. When instantiating such a TestCase +subclass, specify in the constructor arguments the name of the test method +that the instance is to execute.

+ +

Test authors should subclass TestCase for their own tests. Construction +and deconstruction of the test's environment ('fixture') can be +implemented by overriding the 'setUp' and 'tearDown' methods respectively.

+ +

If it is necessary to override the __init__ method, the base class +__init__ method must always be called. It is important that subclasses +should not change the signature of their __init__ method, since instances +of the classes are instantiated automatically by parts of the framework +in order to be run.

+ +

When subclassing TestCase, you can set these attributes:

+ +
    +
  • failureException: determines which exception will be raised when +the instance's assertion methods fail; test methods raising this +exception will be deemed to have 'failed' rather than 'errored'.
  • +
  • longMessage: determines whether long messages (including repr of +objects used in assert methods) will be printed on failure in addition +to any explicit message passed.
  • +
  • maxDiff: sets the maximum length of a diff in failure messages +by assert methods using difflib. It is looked up as an instance +attribute so can be configured by individual tests if required.
  • +
+
+ + +
+ +
+ + def + fetch_known_mandate_dates(self): + + + +
+ +
26    def fetch_known_mandate_dates(self):
+27        return pd.read_csv("test/data/mandate-dates.csv", sep=';')
+
+ + + + +
+
+ +
+ + def + fetch_mep_meta(self): + + + +
+ +
30    def fetch_mep_meta(self):
+31        return pd.read_csv("data/member_of_parliament.csv")
+
+ + + + +
+
+ +
+ + def + test_manually_checked_mandates(self): + + + +
+ +
34    def test_manually_checked_mandates(self):
+35        mep = self.fetch_mep_meta()
+36        df = self.fetch_known_mandate_dates()
+37        config = fetch_config("mandates")
+38        counter = 0
+39        rows = []
+40        cols = ["person_id", "date", "type"]
+41        for i, r in df.iterrows():
+42            fil = mep.loc[(mep['person_id'] == r["person_id"]) & (mep[r["type"].lower()] == r['date'])]
+43            if fil.empty:
+44                counter += 1
+45                rows.append([r["person_id"], r["date"], r["type"]])
+46                warnings.warn(f"({r['type']}): {r['date']}, {r['person_id']}" , DateErrorWarning)
+47        if len(rows) > 0:
+48            if config and config['write_errors']:
+49                now = datetime.now().strftime("%Y%m%d-%H%M")
+50                out = pd.DataFrame(rows, columns=cols)
+51                out.to_csv(f"{config['test_out_dir']}{now}_mandates-test.csv", index=False)
+52
+53        self.assertEqual(counter, 0)
+
+ + + + +
+
+
Inherited Members
+
+
unittest.case.TestCase
+
TestCase
+
failureException
+
longMessage
+
maxDiff
+
addTypeEqualityFunc
+
addCleanup
+
addClassCleanup
+
setUp
+
tearDown
+
setUpClass
+
tearDownClass
+
countTestCases
+
defaultTestResult
+
shortDescription
+
id
+
subTest
+
run
+
doCleanups
+
doClassCleanups
+
debug
+
skipTest
+
fail
+
assertFalse
+
assertTrue
+
assertRaises
+
assertWarns
+
assertLogs
+
assertEqual
+
assertNotEqual
+
assertAlmostEqual
+
assertNotAlmostEqual
+
assertSequenceEqual
+
assertListEqual
+
assertTupleEqual
+
assertSetEqual
+
assertIn
+
assertNotIn
+
assertIs
+
assertIsNot
+
assertDictEqual
+
assertDictContainsSubset
+
assertCountEqual
+
assertMultiLineEqual
+
assertLess
+
assertLessEqual
+
assertGreater
+
assertGreaterEqual
+
assertIsNone
+
assertIsNotNone
+
assertIsInstance
+
assertNotIsInstance
+
assertRaisesRegex
+
assertWarnsRegex
+
assertRegex
+
assertNotRegex
+
failUnlessRaises
+
failIf
+
assertRaisesRegexp
+
assertRegexpMatches
+
assertNotRegexpMatches
+
failUnlessEqual
+
assertEquals
+
failIfEqual
+
assertNotEquals
+
failUnlessAlmostEqual
+
assertAlmostEquals
+
failIfAlmostEqual
+
assertNotAlmostEquals
+
failUnless
+
assert_
+ +
+
+
+
+
+ + \ No newline at end of file diff --git a/docs/riksdagen-persons/test/mp-frequency-test.html b/docs/riksdagen-persons/test/mp-frequency-test.html new file mode 100644 index 0000000..ce1f774 --- /dev/null +++ b/docs/riksdagen-persons/test/mp-frequency-test.html @@ -0,0 +1,1093 @@ + + + + + + + riksdagen-persons.test.mp-frequency-test API documentation + + + + + + + + + +
+
+

+riksdagen-persons.test.mp-frequency-test

+ +

Assert that at least 95% of parliament days have the correct number of MPs in the metadata with a 10% tolerance.

+
+ + + + + +
  1#!/usr/bin/env python3
+  2"""
+  3Assert that at least 95% of parliament days have the correct number of MPs in the metadata with a 10% tolerance.
+  4"""
+  5from pyriksdagen.metadata import (
+  6    load_Corpus_metadata
+  7)
+  8from pyriksdagen.utils import (
+  9    get_data_location,
+ 10)
+ 11from pytest_cfg_fetcher.fetch import fetch_config
+ 12from tqdm import tqdm
+ 13import datetime as dt
+ 14import pandas as pd
+ 15import unittest, warnings
+ 16
+ 17
+ 18
+ 19class Info(Warning):
+ 20    def __init__(self, m):
+ 21        self.message = m
+ 22    def __str__(self):
+ 23        return self.message
+ 24
+ 25class Test(unittest.TestCase):
+ 26
+ 27    def write_err_df(self, name_str, df, outdir):
+ 28        now = dt.datetime.now().strftime('%Y%m%d-%H%M%S')
+ 29        df.to_csv(f"{outdir}/{now}_{name_str}.csv", index=False)
+ 30
+ 31    def get_spec(self, protocol_path):
+ 32        spec = None
+ 33        spl = protocol_path.split('/')[-1].split('-')
+ 34        if len(spl) == 4:
+ 35            return spec
+ 36        else:
+ 37            if len(spl[2]) > 0:
+ 38                spec = spl[2]
+ 39            return spec
+ 40
+ 41    def mk_py(self, row):
+ 42        if pd.isna(row['spec']):
+ 43            return row['year']
+ 44        else:
+ 45            return str(row['year']) + row['spec']
+ 46
+ 47    def get_baseline(self, row, baseline_df):
+ 48        y = row['year']
+ 49        c = row['chamber']
+ 50        fdf = baseline_df.loc[(baseline_df['year'] == y) & (baseline_df['chamber'] == c)].copy()
+ 51        fdf.reset_index(inplace=True)
+ 52        return fdf.at[0, "n_mps"]
+ 53
+ 54    def get_ch(self, protocol_path):
+ 55        chamber = None
+ 56        spl = protocol_path.split('/')[-1].split('-')
+ 57        if len(spl) == 4:
+ 58            chamber = "ek"
+ 59        else:
+ 60            chamber = spl[3]
+ 61        return chamber
+ 62
+ 63    def is_within_tolerance(self, nmp, baseline):
+ 64        ratio = nmp/baseline
+ 65        #print(f" ---> R: {ratio}")
+ 66        if ratio > 1.1:
+ 67            return False, ratio
+ 68        elif ratio > 0.9:
+ 69            return True, ratio
+ 70        else:
+ 71            return False, ratio
+ 72
+ 73    def preprocess_Corpus_metadata(self):
+ 74        corpus_meta = load_Corpus_metadata(metadata_folder='data')
+ 75        mp_meta = corpus_meta[corpus_meta['source'] == 'member_of_parliament']
+ 76        mp_meta = mp_meta[mp_meta.start.notnull()]
+ 77        mp_meta['start'] = mp_meta['start'].apply(lambda x: pd.to_datetime(x, format='%Y-%m-%d', errors='ignore'))
+ 78        mp_meta['end'] = mp_meta['end'].apply(lambda x: pd.to_datetime(x, format='%Y-%m-%d', errors='ignore'))
+ 79        return mp_meta
+ 80
+ 81    def expand_dates_df(self, dates, baseline_df):
+ 82        for _ in ["N_MP", "passes_test", "almost_passes_test",
+ 83                "ratio", "year", "spec", "parliament_year",
+ 84                "chamber", "baseline_N", "MEPs"]:
+ 85            if _ not in dates.columns:
+ 86                dates[_] = None
+ 87
+ 88        dates["year"] = dates["protocol"].apply(lambda x: str(x.split('/')[0][:4]))
+ 89        dates["spec"] = dates["protocol"].apply(lambda x: self.get_spec(x))
+ 90        dates["parliament_year"] = dates.apply(self.mk_py, axis=1)
+ 91        dates['chamber'] = dates['protocol'].apply(lambda x: self.get_ch(x))
+ 92        dates['baseline_N'] = dates.apply(self.get_baseline, args=(baseline_df,), axis=1)
+ 93        return dates
+ 94
+ 95    def test_mp_frequency(self):
+ 96        config = fetch_config("mp-freq-test")
+ 97        baseline_df = pd.read_csv(f"./test/data/baseline-n-mps-year.csv")
+ 98        baseline_df['year'] = baseline_df['year'].apply(lambda x: str(x)[:4])
+ 99        dates = pd.read_csv(f"./test/data/session-dates.csv", sep=";")
+100        dates = self.expand_dates_df(dates, baseline_df)
+101        mp_meta = self.preprocess_Corpus_metadata()
+102
+103        ledamot_map = {
+104            "fk": 1,
+105            "ak": 2,
+106            "ek": 0
+107        }
+108
+109        filtered_DFs = {}
+110        for k, v in ledamot_map.items():
+111            filtered_DFs[k] = mp_meta.loc[mp_meta['chamber'] == v]
+112
+113        shouldnt_happen = 0
+114
+115        with tqdm(total=len(dates)) as prgbr:
+116            for i, r in dates.iterrows():
+117                N_MP = 0
+118                chamber = r['chamber']
+119                MEPs = []
+120                if not pd.isna(chamber):
+121                    parliament_day = r['date']
+122                    baseline = r['baseline_N']
+123                    prgbr.set_postfix_str(f"{chamber} / {r['parliament_year']} / {shouldnt_happen}")
+124
+125                    if len(parliament_day) == 10:
+126                        #print(r['date'], type(r['date']))
+127                        day = dt.datetime.strptime(r['date'], '%Y-%m-%d')
+128                        year = day.year
+129
+130                        sub_df = filtered_DFs[chamber]
+131                        sub_df = sub_df[sub_df["start"] <= day]
+132                        sub_df = sub_df[sub_df["end"] > day]
+133
+134                        N_MP = len(sub_df["person_id"].unique())
+135                        MEPs = list(sub_df["person_id"].unique())
+136
+137                    dates.at[i, 'N_MP'] = N_MP
+138
+139                    if N_MP != 0:
+140                        if N_MP == r['baseline_N']:
+141                            dates.at[i, 'passes_test'] = True
+142                            dates.at[i, 'almost_passes_test'], dates.at[i, "ratio"] = self.is_within_tolerance(N_MP, baseline)
+143                        else:
+144                            dates.at[i, 'passes_test'] = False
+145                            dates.at[i, 'almost_passes_test'], dates.at[i, "ratio"] = self.is_within_tolerance(N_MP, baseline)
+146                    else:
+147                        dates.at[i, 'passes_test'] = False
+148                        dates.at[i, 'almost_passes_test'] = False
+149                        dates.at[i, "ratio"] = 0
+150                else:
+151                    dates.at[i, 'passes_test'] = "None"
+152                    dates.at[i, 'almost_passes_test'] = "None"
+153                    dates.at[i, "ratio"] = "None"
+154                dates.at[i, "MEPs"] = list(MEPs)
+155                prgbr.update()
+156        dates = dates.sort_values(by=['protocol', 'date'], ignore_index=True)
+157
+158        total_passed = len(dates.loc[dates['passes_test'] == True])
+159        total_almost = len(dates.loc[dates['almost_passes_test'] == True])
+160        total = len(dates)
+161        if total > total_almost:
+162            if config and config["write-err-days"]:
+163                no_passdf = dates.loc[dates['almost_passes_test'] == False]
+164                self.write_err_df("mp-freq-oor", no_passdf, config["test_out_dir"])
+165
+166        warnings.warn(f"\n\n\n --> of {total} Parliament days, {total_almost} almost have the correct number of MPs (+/-10%) {total_almost/total}\n", Info)
+167
+168        warnings.warn(f"\n\n\n --> of {total} Parliament days, {total_passed} have exactly the correct number of MPs (+/-10%) {total_passed/total}\n", Info)
+169
+170        self.assertTrue(total_almost/total > 0.95)
+171
+172
+173
+174
+175if __name__ == '__main__':
+176    unittest.main()
+
+ + +
+
+ +
+ + class + Info(builtins.Warning): + + + +
+ +
20class Info(Warning):
+21    def __init__(self, m):
+22        self.message = m
+23    def __str__(self):
+24        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + Info(m) + + + +
+ +
21    def __init__(self, m):
+22        self.message = m
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + Test(unittest.case.TestCase): + + + +
+ +
 26class Test(unittest.TestCase):
+ 27
+ 28    def write_err_df(self, name_str, df, outdir):
+ 29        now = dt.datetime.now().strftime('%Y%m%d-%H%M%S')
+ 30        df.to_csv(f"{outdir}/{now}_{name_str}.csv", index=False)
+ 31
+ 32    def get_spec(self, protocol_path):
+ 33        spec = None
+ 34        spl = protocol_path.split('/')[-1].split('-')
+ 35        if len(spl) == 4:
+ 36            return spec
+ 37        else:
+ 38            if len(spl[2]) > 0:
+ 39                spec = spl[2]
+ 40            return spec
+ 41
+ 42    def mk_py(self, row):
+ 43        if pd.isna(row['spec']):
+ 44            return row['year']
+ 45        else:
+ 46            return str(row['year']) + row['spec']
+ 47
+ 48    def get_baseline(self, row, baseline_df):
+ 49        y = row['year']
+ 50        c = row['chamber']
+ 51        fdf = baseline_df.loc[(baseline_df['year'] == y) & (baseline_df['chamber'] == c)].copy()
+ 52        fdf.reset_index(inplace=True)
+ 53        return fdf.at[0, "n_mps"]
+ 54
+ 55    def get_ch(self, protocol_path):
+ 56        chamber = None
+ 57        spl = protocol_path.split('/')[-1].split('-')
+ 58        if len(spl) == 4:
+ 59            chamber = "ek"
+ 60        else:
+ 61            chamber = spl[3]
+ 62        return chamber
+ 63
+ 64    def is_within_tolerance(self, nmp, baseline):
+ 65        ratio = nmp/baseline
+ 66        #print(f" ---> R: {ratio}")
+ 67        if ratio > 1.1:
+ 68            return False, ratio
+ 69        elif ratio > 0.9:
+ 70            return True, ratio
+ 71        else:
+ 72            return False, ratio
+ 73
+ 74    def preprocess_Corpus_metadata(self):
+ 75        corpus_meta = load_Corpus_metadata(metadata_folder='data')
+ 76        mp_meta = corpus_meta[corpus_meta['source'] == 'member_of_parliament']
+ 77        mp_meta = mp_meta[mp_meta.start.notnull()]
+ 78        mp_meta['start'] = mp_meta['start'].apply(lambda x: pd.to_datetime(x, format='%Y-%m-%d', errors='ignore'))
+ 79        mp_meta['end'] = mp_meta['end'].apply(lambda x: pd.to_datetime(x, format='%Y-%m-%d', errors='ignore'))
+ 80        return mp_meta
+ 81
+ 82    def expand_dates_df(self, dates, baseline_df):
+ 83        for _ in ["N_MP", "passes_test", "almost_passes_test",
+ 84                "ratio", "year", "spec", "parliament_year",
+ 85                "chamber", "baseline_N", "MEPs"]:
+ 86            if _ not in dates.columns:
+ 87                dates[_] = None
+ 88
+ 89        dates["year"] = dates["protocol"].apply(lambda x: str(x.split('/')[0][:4]))
+ 90        dates["spec"] = dates["protocol"].apply(lambda x: self.get_spec(x))
+ 91        dates["parliament_year"] = dates.apply(self.mk_py, axis=1)
+ 92        dates['chamber'] = dates['protocol'].apply(lambda x: self.get_ch(x))
+ 93        dates['baseline_N'] = dates.apply(self.get_baseline, args=(baseline_df,), axis=1)
+ 94        return dates
+ 95
+ 96    def test_mp_frequency(self):
+ 97        config = fetch_config("mp-freq-test")
+ 98        baseline_df = pd.read_csv(f"./test/data/baseline-n-mps-year.csv")
+ 99        baseline_df['year'] = baseline_df['year'].apply(lambda x: str(x)[:4])
+100        dates = pd.read_csv(f"./test/data/session-dates.csv", sep=";")
+101        dates = self.expand_dates_df(dates, baseline_df)
+102        mp_meta = self.preprocess_Corpus_metadata()
+103
+104        ledamot_map = {
+105            "fk": 1,
+106            "ak": 2,
+107            "ek": 0
+108        }
+109
+110        filtered_DFs = {}
+111        for k, v in ledamot_map.items():
+112            filtered_DFs[k] = mp_meta.loc[mp_meta['chamber'] == v]
+113
+114        shouldnt_happen = 0
+115
+116        with tqdm(total=len(dates)) as prgbr:
+117            for i, r in dates.iterrows():
+118                N_MP = 0
+119                chamber = r['chamber']
+120                MEPs = []
+121                if not pd.isna(chamber):
+122                    parliament_day = r['date']
+123                    baseline = r['baseline_N']
+124                    prgbr.set_postfix_str(f"{chamber} / {r['parliament_year']} / {shouldnt_happen}")
+125
+126                    if len(parliament_day) == 10:
+127                        #print(r['date'], type(r['date']))
+128                        day = dt.datetime.strptime(r['date'], '%Y-%m-%d')
+129                        year = day.year
+130
+131                        sub_df = filtered_DFs[chamber]
+132                        sub_df = sub_df[sub_df["start"] <= day]
+133                        sub_df = sub_df[sub_df["end"] > day]
+134
+135                        N_MP = len(sub_df["person_id"].unique())
+136                        MEPs = list(sub_df["person_id"].unique())
+137
+138                    dates.at[i, 'N_MP'] = N_MP
+139
+140                    if N_MP != 0:
+141                        if N_MP == r['baseline_N']:
+142                            dates.at[i, 'passes_test'] = True
+143                            dates.at[i, 'almost_passes_test'], dates.at[i, "ratio"] = self.is_within_tolerance(N_MP, baseline)
+144                        else:
+145                            dates.at[i, 'passes_test'] = False
+146                            dates.at[i, 'almost_passes_test'], dates.at[i, "ratio"] = self.is_within_tolerance(N_MP, baseline)
+147                    else:
+148                        dates.at[i, 'passes_test'] = False
+149                        dates.at[i, 'almost_passes_test'] = False
+150                        dates.at[i, "ratio"] = 0
+151                else:
+152                    dates.at[i, 'passes_test'] = "None"
+153                    dates.at[i, 'almost_passes_test'] = "None"
+154                    dates.at[i, "ratio"] = "None"
+155                dates.at[i, "MEPs"] = list(MEPs)
+156                prgbr.update()
+157        dates = dates.sort_values(by=['protocol', 'date'], ignore_index=True)
+158
+159        total_passed = len(dates.loc[dates['passes_test'] == True])
+160        total_almost = len(dates.loc[dates['almost_passes_test'] == True])
+161        total = len(dates)
+162        if total > total_almost:
+163            if config and config["write-err-days"]:
+164                no_passdf = dates.loc[dates['almost_passes_test'] == False]
+165                self.write_err_df("mp-freq-oor", no_passdf, config["test_out_dir"])
+166
+167        warnings.warn(f"\n\n\n --> of {total} Parliament days, {total_almost} almost have the correct number of MPs (+/-10%) {total_almost/total}\n", Info)
+168
+169        warnings.warn(f"\n\n\n --> of {total} Parliament days, {total_passed} have exactly the correct number of MPs (+/-10%) {total_passed/total}\n", Info)
+170
+171        self.assertTrue(total_almost/total > 0.95)
+
+ + +

A class whose instances are single test cases.

+ +

By default, the test code itself should be placed in a method named +'runTest'.

+ +

If the fixture may be used for many test cases, create as +many test methods as are needed. When instantiating such a TestCase +subclass, specify in the constructor arguments the name of the test method +that the instance is to execute.

+ +

Test authors should subclass TestCase for their own tests. Construction +and deconstruction of the test's environment ('fixture') can be +implemented by overriding the 'setUp' and 'tearDown' methods respectively.

+ +

If it is necessary to override the __init__ method, the base class +__init__ method must always be called. It is important that subclasses +should not change the signature of their __init__ method, since instances +of the classes are instantiated automatically by parts of the framework +in order to be run.

+ +

When subclassing TestCase, you can set these attributes:

+ +
    +
  • failureException: determines which exception will be raised when +the instance's assertion methods fail; test methods raising this +exception will be deemed to have 'failed' rather than 'errored'.
  • +
  • longMessage: determines whether long messages (including repr of +objects used in assert methods) will be printed on failure in addition +to any explicit message passed.
  • +
  • maxDiff: sets the maximum length of a diff in failure messages +by assert methods using difflib. It is looked up as an instance +attribute so can be configured by individual tests if required.
  • +
+
+ + +
+ +
+ + def + write_err_df(self, name_str, df, outdir): + + + +
+ +
28    def write_err_df(self, name_str, df, outdir):
+29        now = dt.datetime.now().strftime('%Y%m%d-%H%M%S')
+30        df.to_csv(f"{outdir}/{now}_{name_str}.csv", index=False)
+
+ + + + +
+
+ +
+ + def + get_spec(self, protocol_path): + + + +
+ +
32    def get_spec(self, protocol_path):
+33        spec = None
+34        spl = protocol_path.split('/')[-1].split('-')
+35        if len(spl) == 4:
+36            return spec
+37        else:
+38            if len(spl[2]) > 0:
+39                spec = spl[2]
+40            return spec
+
+ + + + +
+
+ +
+ + def + mk_py(self, row): + + + +
+ +
42    def mk_py(self, row):
+43        if pd.isna(row['spec']):
+44            return row['year']
+45        else:
+46            return str(row['year']) + row['spec']
+
+ + + + +
+
+ +
+ + def + get_baseline(self, row, baseline_df): + + + +
+ +
48    def get_baseline(self, row, baseline_df):
+49        y = row['year']
+50        c = row['chamber']
+51        fdf = baseline_df.loc[(baseline_df['year'] == y) & (baseline_df['chamber'] == c)].copy()
+52        fdf.reset_index(inplace=True)
+53        return fdf.at[0, "n_mps"]
+
+ + + + +
+
+ +
+ + def + get_ch(self, protocol_path): + + + +
+ +
55    def get_ch(self, protocol_path):
+56        chamber = None
+57        spl = protocol_path.split('/')[-1].split('-')
+58        if len(spl) == 4:
+59            chamber = "ek"
+60        else:
+61            chamber = spl[3]
+62        return chamber
+
+ + + + +
+
+ +
+ + def + is_within_tolerance(self, nmp, baseline): + + + +
+ +
64    def is_within_tolerance(self, nmp, baseline):
+65        ratio = nmp/baseline
+66        #print(f" ---> R: {ratio}")
+67        if ratio > 1.1:
+68            return False, ratio
+69        elif ratio > 0.9:
+70            return True, ratio
+71        else:
+72            return False, ratio
+
+ + + + +
+
+ +
+ + def + preprocess_Corpus_metadata(self): + + + +
+ +
74    def preprocess_Corpus_metadata(self):
+75        corpus_meta = load_Corpus_metadata(metadata_folder='data')
+76        mp_meta = corpus_meta[corpus_meta['source'] == 'member_of_parliament']
+77        mp_meta = mp_meta[mp_meta.start.notnull()]
+78        mp_meta['start'] = mp_meta['start'].apply(lambda x: pd.to_datetime(x, format='%Y-%m-%d', errors='ignore'))
+79        mp_meta['end'] = mp_meta['end'].apply(lambda x: pd.to_datetime(x, format='%Y-%m-%d', errors='ignore'))
+80        return mp_meta
+
+ + + + +
+
+ +
+ + def + expand_dates_df(self, dates, baseline_df): + + + +
+ +
82    def expand_dates_df(self, dates, baseline_df):
+83        for _ in ["N_MP", "passes_test", "almost_passes_test",
+84                "ratio", "year", "spec", "parliament_year",
+85                "chamber", "baseline_N", "MEPs"]:
+86            if _ not in dates.columns:
+87                dates[_] = None
+88
+89        dates["year"] = dates["protocol"].apply(lambda x: str(x.split('/')[0][:4]))
+90        dates["spec"] = dates["protocol"].apply(lambda x: self.get_spec(x))
+91        dates["parliament_year"] = dates.apply(self.mk_py, axis=1)
+92        dates['chamber'] = dates['protocol'].apply(lambda x: self.get_ch(x))
+93        dates['baseline_N'] = dates.apply(self.get_baseline, args=(baseline_df,), axis=1)
+94        return dates
+
+ + + + +
+
+ +
+ + def + test_mp_frequency(self): + + + +
+ +
 96    def test_mp_frequency(self):
+ 97        config = fetch_config("mp-freq-test")
+ 98        baseline_df = pd.read_csv(f"./test/data/baseline-n-mps-year.csv")
+ 99        baseline_df['year'] = baseline_df['year'].apply(lambda x: str(x)[:4])
+100        dates = pd.read_csv(f"./test/data/session-dates.csv", sep=";")
+101        dates = self.expand_dates_df(dates, baseline_df)
+102        mp_meta = self.preprocess_Corpus_metadata()
+103
+104        ledamot_map = {
+105            "fk": 1,
+106            "ak": 2,
+107            "ek": 0
+108        }
+109
+110        filtered_DFs = {}
+111        for k, v in ledamot_map.items():
+112            filtered_DFs[k] = mp_meta.loc[mp_meta['chamber'] == v]
+113
+114        shouldnt_happen = 0
+115
+116        with tqdm(total=len(dates)) as prgbr:
+117            for i, r in dates.iterrows():
+118                N_MP = 0
+119                chamber = r['chamber']
+120                MEPs = []
+121                if not pd.isna(chamber):
+122                    parliament_day = r['date']
+123                    baseline = r['baseline_N']
+124                    prgbr.set_postfix_str(f"{chamber} / {r['parliament_year']} / {shouldnt_happen}")
+125
+126                    if len(parliament_day) == 10:
+127                        #print(r['date'], type(r['date']))
+128                        day = dt.datetime.strptime(r['date'], '%Y-%m-%d')
+129                        year = day.year
+130
+131                        sub_df = filtered_DFs[chamber]
+132                        sub_df = sub_df[sub_df["start"] <= day]
+133                        sub_df = sub_df[sub_df["end"] > day]
+134
+135                        N_MP = len(sub_df["person_id"].unique())
+136                        MEPs = list(sub_df["person_id"].unique())
+137
+138                    dates.at[i, 'N_MP'] = N_MP
+139
+140                    if N_MP != 0:
+141                        if N_MP == r['baseline_N']:
+142                            dates.at[i, 'passes_test'] = True
+143                            dates.at[i, 'almost_passes_test'], dates.at[i, "ratio"] = self.is_within_tolerance(N_MP, baseline)
+144                        else:
+145                            dates.at[i, 'passes_test'] = False
+146                            dates.at[i, 'almost_passes_test'], dates.at[i, "ratio"] = self.is_within_tolerance(N_MP, baseline)
+147                    else:
+148                        dates.at[i, 'passes_test'] = False
+149                        dates.at[i, 'almost_passes_test'] = False
+150                        dates.at[i, "ratio"] = 0
+151                else:
+152                    dates.at[i, 'passes_test'] = "None"
+153                    dates.at[i, 'almost_passes_test'] = "None"
+154                    dates.at[i, "ratio"] = "None"
+155                dates.at[i, "MEPs"] = list(MEPs)
+156                prgbr.update()
+157        dates = dates.sort_values(by=['protocol', 'date'], ignore_index=True)
+158
+159        total_passed = len(dates.loc[dates['passes_test'] == True])
+160        total_almost = len(dates.loc[dates['almost_passes_test'] == True])
+161        total = len(dates)
+162        if total > total_almost:
+163            if config and config["write-err-days"]:
+164                no_passdf = dates.loc[dates['almost_passes_test'] == False]
+165                self.write_err_df("mp-freq-oor", no_passdf, config["test_out_dir"])
+166
+167        warnings.warn(f"\n\n\n --> of {total} Parliament days, {total_almost} almost have the correct number of MPs (+/-10%) {total_almost/total}\n", Info)
+168
+169        warnings.warn(f"\n\n\n --> of {total} Parliament days, {total_passed} have exactly the correct number of MPs (+/-10%) {total_passed/total}\n", Info)
+170
+171        self.assertTrue(total_almost/total > 0.95)
+
+ + + + +
+
+
Inherited Members
+
+
unittest.case.TestCase
+
TestCase
+
failureException
+
longMessage
+
maxDiff
+
addTypeEqualityFunc
+
addCleanup
+
addClassCleanup
+
setUp
+
tearDown
+
setUpClass
+
tearDownClass
+
countTestCases
+
defaultTestResult
+
shortDescription
+
id
+
subTest
+
run
+
doCleanups
+
doClassCleanups
+
debug
+
skipTest
+
fail
+
assertFalse
+
assertTrue
+
assertRaises
+
assertWarns
+
assertLogs
+
assertEqual
+
assertNotEqual
+
assertAlmostEqual
+
assertNotAlmostEqual
+
assertSequenceEqual
+
assertListEqual
+
assertTupleEqual
+
assertSetEqual
+
assertIn
+
assertNotIn
+
assertIs
+
assertIsNot
+
assertDictEqual
+
assertDictContainsSubset
+
assertCountEqual
+
assertMultiLineEqual
+
assertLess
+
assertLessEqual
+
assertGreater
+
assertGreaterEqual
+
assertIsNone
+
assertIsNotNone
+
assertIsInstance
+
assertNotIsInstance
+
assertRaisesRegex
+
assertWarnsRegex
+
assertRegex
+
assertNotRegex
+
failUnlessRaises
+
failIf
+
assertRaisesRegexp
+
assertRegexpMatches
+
assertNotRegexpMatches
+
failUnlessEqual
+
assertEquals
+
failIfEqual
+
assertNotEquals
+
failUnlessAlmostEqual
+
assertAlmostEquals
+
failIfAlmostEqual
+
assertNotAlmostEquals
+
failUnless
+
assert_
+ +
+
+
+
+
+ + \ No newline at end of file diff --git a/docs/riksdagen-persons/test/party-affiliation.html b/docs/riksdagen-persons/test/party-affiliation.html new file mode 100644 index 0000000..6a0fb01 --- /dev/null +++ b/docs/riksdagen-persons/test/party-affiliation.html @@ -0,0 +1,817 @@ + + + + + + + riksdagen-persons.test.party-affiliation API documentation + + + + + + + + + +
+
+

+riksdagen-persons.test.party-affiliation

+ +

Tests related to party affiliations.

+
+ + + + + +
  1"""
+  2Tests related to party affiliations.
+  3"""
+  4from datetime import datetime
+  5from pytest_cfg_fetcher.fetch import fetch_config
+  6import pandas as pd
+  7import unittest
+  8import warnings
+  9
+ 10
+ 11
+ 12
+ 13
+ 14class Unlisted(Warning):
+ 15
+ 16    def __init__(self, m):
+ 17        self.message = m
+ 18
+ 19    def __str__(self):
+ 20        return self.message
+ 21
+ 22
+ 23class Info(Warning):
+ 24
+ 25    def __init__(self, m):
+ 26        self.message = m
+ 27
+ 28    def __str__(self):
+ 29        return self.message
+ 30
+ 31
+ 32
+ 33
+ 34class Test(unittest.TestCase):
+ 35
+ 36    def write_err_df(self, name_str, lol, cols, outdir):
+ 37        now = datetime.now().strftime('%Y%m%d-%H%M%S')
+ 38        df = pd.DataFrame(lol, columns=cols)
+ 39        df.to_csv(f"{outdir}/{now}_{name_str}.csv", index=False)
+ 40
+ 41
+ 42    #@unittest.skip
+ 43    def test_independent_mp(self):
+ 44        config = fetch_config("independent-mp")
+ 45        test_file = pd.read_csv("test/data/independent-mp.csv", sep=';')
+ 46        independent = pd.read_csv("data/explicit_no_party.csv")
+ 47        ind_wiki = independent['wiki_id'].unique()
+ 48        ind_swerik = independent['person_id'].unique()
+ 49        missing_ind = []
+ 50        for i, r in test_file.iterrows():
+ 51            if r['wiki_id'] not in ind_wiki:
+ 52                if r['person_id'] not in ind_swerik:
+ 53                    missing_ind.append([r['wiki_id'], r['person_id']])
+ 54                    warnings.warn(f"Missing From Wikidata {r['wiki_id']} : {r['person_id']}", Unlisted)
+ 55        extra_ind = []
+ 56        [extra_ind.append(_) for _ in ind_wiki if _ not in test_file['wiki_id'].unique()]
+ 57        if len(extra_ind) > 0:
+ 58            [warnings.warn(f"\n--> Missing from testfile {_}", Unlisted) for _ in extra_ind]
+ 59            warnings.warn(f"\n\n\n~~ {len(extra_ind)} MPs currently listed as independent not in the testfile ({len(test_file)})\n", Info)
+ 60            if config and config['write-unlisted-ind-testfile']:
+ 61                extra_ind = [[_] for _ in extra_ind]
+ 62                self.write_err_df("unlisted-ind-testfile", extra_ind, ["wiki_id"], config['test_out_dir'])
+ 63        if len(missing_ind) > 0:
+ 64            warnings.warn(f"\n\n\n~~ {len(missing_ind)} MPs currently listed as independent in testfile do not appear as such in Wikidata\n", Info)
+ 65            if config and config['write-unlisted-ind-wiki']:
+ 66                self.write_err_df("unlisted-ind-wiki", missing_ind, ["wiki_id", "person_id"], config['test_out_dir'])
+ 67        self.assertEqual(len(missing_ind), 0)
+ 68        #self.assertEqual(len(extra_ind), 0)
+ 69
+ 70
+ 71    #@unittest.skip
+ 72    def test_party(self):
+ 73        config = fetch_config("party-affiliation")
+ 74        test_file = pd.read_csv("test/data/known-party-affiliation.csv", sep=';')
+ 75        party_affiliation = pd.read_csv("data/party_affiliation.csv")
+ 76
+ 77        bad_affil = []
+ 78        for i, r in test_file.iterrows():
+ 79            if (pd.notnull(r['start']) or r['start'] == '') and \
+ 80               (pd.notnull(r["end"]) or r['end'] == ''):
+ 81                Q = party_affiliation.loc[
+ 82                        (party_affiliation['person_id'] == r["person_id"]) &
+ 83                        (party_affiliation['party_id'] == r['party_id']) &
+ 84                        (party_affiliation['start'] == str(r['start'])[:4]) &
+ 85                        (party_affiliation['end'] == str(r['end'])[:4])]
+ 86            else:
+ 87                Q = party_affiliation.loc[
+ 88                        (party_affiliation['person_id'] == r["person_id"]) &
+ 89                        (party_affiliation['party_id'] == r['party_id'])]
+ 90            if len(Q) == 0:
+ 91                bad_affil.append([r[_] for _ in test_file.columns])
+ 92                warnings.warn(f"\n -> Not found in wikidata {'|'.join([str(r[_]) if pd.notnull(r[_]) else '' for _ in test_file.columns])}", Unlisted)
+ 93        if len(bad_affil) > 0:
+ 94            warnings.warn(f"\n\n\n~~ {len(bad_affil)} mismatches between wikidata and ({len(test_file)}) known party affiliations\n", Info)
+ 95            if config and config["write-party-affil-err"]:
+ 96                self.write_err_df("unmatched-party-affiliations", bad_affil, test_file.columns, config["test_out_dir"])
+ 97        self.assertEqual(len(bad_affil), 0)
+ 98
+ 99
+100
+101
+102if __name__ == '__main__':
+103    unittest.main()
+
+ + +
+
+ +
+ + class + Unlisted(builtins.Warning): + + + +
+ +
15class Unlisted(Warning):
+16
+17    def __init__(self, m):
+18        self.message = m
+19
+20    def __str__(self):
+21        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + Unlisted(m) + + + +
+ +
17    def __init__(self, m):
+18        self.message = m
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + Info(builtins.Warning): + + + +
+ +
24class Info(Warning):
+25
+26    def __init__(self, m):
+27        self.message = m
+28
+29    def __str__(self):
+30        return self.message
+
+ + +

Base class for warning categories.

+
+ + +
+ +
+ + Info(m) + + + +
+ +
26    def __init__(self, m):
+27        self.message = m
+
+ + + + +
+
+
+ message + + +
+ + + + +
+
+
Inherited Members
+
+
builtins.BaseException
+
with_traceback
+
args
+ +
+
+
+
+
+ +
+ + class + Test(unittest.case.TestCase): + + + +
+ +
35class Test(unittest.TestCase):
+36
+37    def write_err_df(self, name_str, lol, cols, outdir):
+38        now = datetime.now().strftime('%Y%m%d-%H%M%S')
+39        df = pd.DataFrame(lol, columns=cols)
+40        df.to_csv(f"{outdir}/{now}_{name_str}.csv", index=False)
+41
+42
+43    #@unittest.skip
+44    def test_independent_mp(self):
+45        config = fetch_config("independent-mp")
+46        test_file = pd.read_csv("test/data/independent-mp.csv", sep=';')
+47        independent = pd.read_csv("data/explicit_no_party.csv")
+48        ind_wiki = independent['wiki_id'].unique()
+49        ind_swerik = independent['person_id'].unique()
+50        missing_ind = []
+51        for i, r in test_file.iterrows():
+52            if r['wiki_id'] not in ind_wiki:
+53                if r['person_id'] not in ind_swerik:
+54                    missing_ind.append([r['wiki_id'], r['person_id']])
+55                    warnings.warn(f"Missing From Wikidata {r['wiki_id']} : {r['person_id']}", Unlisted)
+56        extra_ind = []
+57        [extra_ind.append(_) for _ in ind_wiki if _ not in test_file['wiki_id'].unique()]
+58        if len(extra_ind) > 0:
+59            [warnings.warn(f"\n--> Missing from testfile {_}", Unlisted) for _ in extra_ind]
+60            warnings.warn(f"\n\n\n~~ {len(extra_ind)} MPs currently listed as independent not in the testfile ({len(test_file)})\n", Info)
+61            if config and config['write-unlisted-ind-testfile']:
+62                extra_ind = [[_] for _ in extra_ind]
+63                self.write_err_df("unlisted-ind-testfile", extra_ind, ["wiki_id"], config['test_out_dir'])
+64        if len(missing_ind) > 0:
+65            warnings.warn(f"\n\n\n~~ {len(missing_ind)} MPs currently listed as independent in testfile do not appear as such in Wikidata\n", Info)
+66            if config and config['write-unlisted-ind-wiki']:
+67                self.write_err_df("unlisted-ind-wiki", missing_ind, ["wiki_id", "person_id"], config['test_out_dir'])
+68        self.assertEqual(len(missing_ind), 0)
+69        #self.assertEqual(len(extra_ind), 0)
+70
+71
+72    #@unittest.skip
+73    def test_party(self):
+74        config = fetch_config("party-affiliation")
+75        test_file = pd.read_csv("test/data/known-party-affiliation.csv", sep=';')
+76        party_affiliation = pd.read_csv("data/party_affiliation.csv")
+77
+78        bad_affil = []
+79        for i, r in test_file.iterrows():
+80            if (pd.notnull(r['start']) or r['start'] == '') and \
+81               (pd.notnull(r["end"]) or r['end'] == ''):
+82                Q = party_affiliation.loc[
+83                        (party_affiliation['person_id'] == r["person_id"]) &
+84                        (party_affiliation['party_id'] == r['party_id']) &
+85                        (party_affiliation['start'] == str(r['start'])[:4]) &
+86                        (party_affiliation['end'] == str(r['end'])[:4])]
+87            else:
+88                Q = party_affiliation.loc[
+89                        (party_affiliation['person_id'] == r["person_id"]) &
+90                        (party_affiliation['party_id'] == r['party_id'])]
+91            if len(Q) == 0:
+92                bad_affil.append([r[_] for _ in test_file.columns])
+93                warnings.warn(f"\n -> Not found in wikidata {'|'.join([str(r[_]) if pd.notnull(r[_]) else '' for _ in test_file.columns])}", Unlisted)
+94        if len(bad_affil) > 0:
+95            warnings.warn(f"\n\n\n~~ {len(bad_affil)} mismatches between wikidata and ({len(test_file)}) known party affiliations\n", Info)
+96            if config and config["write-party-affil-err"]:
+97                self.write_err_df("unmatched-party-affiliations", bad_affil, test_file.columns, config["test_out_dir"])
+98        self.assertEqual(len(bad_affil), 0)
+
+ + +

A class whose instances are single test cases.

+ +

By default, the test code itself should be placed in a method named +'runTest'.

+ +

If the fixture may be used for many test cases, create as +many test methods as are needed. When instantiating such a TestCase +subclass, specify in the constructor arguments the name of the test method +that the instance is to execute.

+ +

Test authors should subclass TestCase for their own tests. Construction +and deconstruction of the test's environment ('fixture') can be +implemented by overriding the 'setUp' and 'tearDown' methods respectively.

+ +

If it is necessary to override the __init__ method, the base class +__init__ method must always be called. It is important that subclasses +should not change the signature of their __init__ method, since instances +of the classes are instantiated automatically by parts of the framework +in order to be run.

+ +

When subclassing TestCase, you can set these attributes:

+ +
    +
  • failureException: determines which exception will be raised when +the instance's assertion methods fail; test methods raising this +exception will be deemed to have 'failed' rather than 'errored'.
  • +
  • longMessage: determines whether long messages (including repr of +objects used in assert methods) will be printed on failure in addition +to any explicit message passed.
  • +
  • maxDiff: sets the maximum length of a diff in failure messages +by assert methods using difflib. It is looked up as an instance +attribute so can be configured by individual tests if required.
  • +
+
+ + +
+ +
+ + def + write_err_df(self, name_str, lol, cols, outdir): + + + +
+ +
37    def write_err_df(self, name_str, lol, cols, outdir):
+38        now = datetime.now().strftime('%Y%m%d-%H%M%S')
+39        df = pd.DataFrame(lol, columns=cols)
+40        df.to_csv(f"{outdir}/{now}_{name_str}.csv", index=False)
+
+ + + + +
+
+ +
+ + def + test_independent_mp(self): + + + +
+ +
44    def test_independent_mp(self):
+45        config = fetch_config("independent-mp")
+46        test_file = pd.read_csv("test/data/independent-mp.csv", sep=';')
+47        independent = pd.read_csv("data/explicit_no_party.csv")
+48        ind_wiki = independent['wiki_id'].unique()
+49        ind_swerik = independent['person_id'].unique()
+50        missing_ind = []
+51        for i, r in test_file.iterrows():
+52            if r['wiki_id'] not in ind_wiki:
+53                if r['person_id'] not in ind_swerik:
+54                    missing_ind.append([r['wiki_id'], r['person_id']])
+55                    warnings.warn(f"Missing From Wikidata {r['wiki_id']} : {r['person_id']}", Unlisted)
+56        extra_ind = []
+57        [extra_ind.append(_) for _ in ind_wiki if _ not in test_file['wiki_id'].unique()]
+58        if len(extra_ind) > 0:
+59            [warnings.warn(f"\n--> Missing from testfile {_}", Unlisted) for _ in extra_ind]
+60            warnings.warn(f"\n\n\n~~ {len(extra_ind)} MPs currently listed as independent not in the testfile ({len(test_file)})\n", Info)
+61            if config and config['write-unlisted-ind-testfile']:
+62                extra_ind = [[_] for _ in extra_ind]
+63                self.write_err_df("unlisted-ind-testfile", extra_ind, ["wiki_id"], config['test_out_dir'])
+64        if len(missing_ind) > 0:
+65            warnings.warn(f"\n\n\n~~ {len(missing_ind)} MPs currently listed as independent in testfile do not appear as such in Wikidata\n", Info)
+66            if config and config['write-unlisted-ind-wiki']:
+67                self.write_err_df("unlisted-ind-wiki", missing_ind, ["wiki_id", "person_id"], config['test_out_dir'])
+68        self.assertEqual(len(missing_ind), 0)
+69        #self.assertEqual(len(extra_ind), 0)
+
+ + + + +
+
+ +
+ + def + test_party(self): + + + +
+ +
73    def test_party(self):
+74        config = fetch_config("party-affiliation")
+75        test_file = pd.read_csv("test/data/known-party-affiliation.csv", sep=';')
+76        party_affiliation = pd.read_csv("data/party_affiliation.csv")
+77
+78        bad_affil = []
+79        for i, r in test_file.iterrows():
+80            if (pd.notnull(r['start']) or r['start'] == '') and \
+81               (pd.notnull(r["end"]) or r['end'] == ''):
+82                Q = party_affiliation.loc[
+83                        (party_affiliation['person_id'] == r["person_id"]) &
+84                        (party_affiliation['party_id'] == r['party_id']) &
+85                        (party_affiliation['start'] == str(r['start'])[:4]) &
+86                        (party_affiliation['end'] == str(r['end'])[:4])]
+87            else:
+88                Q = party_affiliation.loc[
+89                        (party_affiliation['person_id'] == r["person_id"]) &
+90                        (party_affiliation['party_id'] == r['party_id'])]
+91            if len(Q) == 0:
+92                bad_affil.append([r[_] for _ in test_file.columns])
+93                warnings.warn(f"\n -> Not found in wikidata {'|'.join([str(r[_]) if pd.notnull(r[_]) else '' for _ in test_file.columns])}", Unlisted)
+94        if len(bad_affil) > 0:
+95            warnings.warn(f"\n\n\n~~ {len(bad_affil)} mismatches between wikidata and ({len(test_file)}) known party affiliations\n", Info)
+96            if config and config["write-party-affil-err"]:
+97                self.write_err_df("unmatched-party-affiliations", bad_affil, test_file.columns, config["test_out_dir"])
+98        self.assertEqual(len(bad_affil), 0)
+
+ + + + +
+
+
Inherited Members
+
+
unittest.case.TestCase
+
TestCase
+
failureException
+
longMessage
+
maxDiff
+
addTypeEqualityFunc
+
addCleanup
+
addClassCleanup
+
setUp
+
tearDown
+
setUpClass
+
tearDownClass
+
countTestCases
+
defaultTestResult
+
shortDescription
+
id
+
subTest
+
run
+
doCleanups
+
doClassCleanups
+
debug
+
skipTest
+
fail
+
assertFalse
+
assertTrue
+
assertRaises
+
assertWarns
+
assertLogs
+
assertEqual
+
assertNotEqual
+
assertAlmostEqual
+
assertNotAlmostEqual
+
assertSequenceEqual
+
assertListEqual
+
assertTupleEqual
+
assertSetEqual
+
assertIn
+
assertNotIn
+
assertIs
+
assertIsNot
+
assertDictEqual
+
assertDictContainsSubset
+
assertCountEqual
+
assertMultiLineEqual
+
assertLess
+
assertLessEqual
+
assertGreater
+
assertGreaterEqual
+
assertIsNone
+
assertIsNotNone
+
assertIsInstance
+
assertNotIsInstance
+
assertRaisesRegex
+
assertWarnsRegex
+
assertRegex
+
assertNotRegex
+
failUnlessRaises
+
failIf
+
assertRaisesRegexp
+
assertRegexpMatches
+
assertNotRegexpMatches
+
failUnlessEqual
+
assertEquals
+
failIfEqual
+
assertNotEquals
+
failUnlessAlmostEqual
+
assertAlmostEquals
+
failIfAlmostEqual
+
assertNotAlmostEquals
+
failUnless
+
assert_
+ +
+
+
+
+
+ + \ No newline at end of file diff --git a/docs/search.js b/docs/search.js new file mode 100644 index 0000000..41898b8 --- /dev/null +++ b/docs/search.js @@ -0,0 +1,46 @@ +window.pdocSearch = (function(){ +/** elasticlunr - http://weixsong.github.io * Copyright (C) 2017 Oliver Nightingale * Copyright (C) 2017 Wei Song * MIT Licensed */!function(){function e(e){if(null===e||"object"!=typeof e)return e;var t=e.constructor();for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.9.5",lunr=t,t.utils={},t.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),t.utils.toString=function(e){return void 0===e||null===e?"":e.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=e;if("function"!=typeof t)throw new TypeError("last argument must be a function");n.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},t.EventEmitter.prototype.removeListener=function(e,t){if(this.hasHandler(e)){var n=this.events[e].indexOf(t);-1!==n&&(this.events[e].splice(n,1),0==this.events[e].length&&delete this.events[e])}},t.EventEmitter.prototype.emit=function(e){if(this.hasHandler(e)){var t=Array.prototype.slice.call(arguments,1);this.events[e].forEach(function(e){e.apply(void 0,t)},this)}},t.EventEmitter.prototype.hasHandler=function(e){return e in this.events},t.tokenizer=function(e){if(!arguments.length||null===e||void 0===e)return[];if(Array.isArray(e)){var n=e.filter(function(e){return null===e||void 0===e?!1:!0});n=n.map(function(e){return t.utils.toString(e).toLowerCase()});var i=[];return n.forEach(function(e){var n=e.split(t.tokenizer.seperator);i=i.concat(n)},this),i}return e.toString().trim().toLowerCase().split(t.tokenizer.seperator)},t.tokenizer.defaultSeperator=/[\s\-]+/,t.tokenizer.seperator=t.tokenizer.defaultSeperator,t.tokenizer.setSeperator=function(e){null!==e&&void 0!==e&&"object"==typeof e&&(t.tokenizer.seperator=e)},t.tokenizer.resetSeperator=function(){t.tokenizer.seperator=t.tokenizer.defaultSeperator},t.tokenizer.getSeperator=function(){return t.tokenizer.seperator},t.Pipeline=function(){this._queue=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in t.Pipeline.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[n]=e},t.Pipeline.getRegisteredFunction=function(e){return e in t.Pipeline.registeredFunctions!=!0?null:t.Pipeline.registeredFunctions[e]},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.getRegisteredFunction(e);if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i+1,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i,0,n)},t.Pipeline.prototype.remove=function(e){var t=this._queue.indexOf(e);-1!==t&&this._queue.splice(t,1)},t.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,i=this._queue.length,o=0;n>o;o++){for(var r=e[o],s=0;i>s&&(r=this._queue[s](r,o,e),void 0!==r&&null!==r);s++);void 0!==r&&null!==r&&t.push(r)}return t},t.Pipeline.prototype.reset=function(){this._queue=[]},t.Pipeline.prototype.get=function(){return this._queue},t.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.DocumentStore,this.index={},this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},t.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;n._fields=e.fields,n._ref=e.ref,n.documentStore=t.DocumentStore.load(e.documentStore),n.pipeline=t.Pipeline.load(e.pipeline),n.index={};for(var i in e.index)n.index[i]=t.InvertedIndex.load(e.index[i]);return n},t.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new t.InvertedIndex,this},t.Index.prototype.setRef=function(e){return this._ref=e,this},t.Index.prototype.saveDocument=function(e){return this.documentStore=new t.DocumentStore(e),this},t.Index.prototype.addDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.addDoc(i,e),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));this.documentStore.addFieldLength(i,n,o.length);var r={};o.forEach(function(e){e in r?r[e]+=1:r[e]=1},this);for(var s in r){var u=r[s];u=Math.sqrt(u),this.index[n].addToken(s,{ref:i,tf:u})}},this),n&&this.eventEmitter.emit("add",e,this)}},t.Index.prototype.removeDocByRef=function(e){if(e&&this.documentStore.isDocStored()!==!1&&this.documentStore.hasDoc(e)){var t=this.documentStore.getDoc(e);this.removeDoc(t,!1)}},t.Index.prototype.removeDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.hasDoc(i)&&(this.documentStore.removeDoc(i),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));o.forEach(function(e){this.index[n].removeToken(e,i)},this)},this),n&&this.eventEmitter.emit("remove",e,this))}},t.Index.prototype.updateDoc=function(e,t){var t=void 0===t?!0:t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},t.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];var i=this.index[t].getDocFreq(e),o=1+Math.log(this.documentStore.length/(i+1));return this._idfCache[n]=o,o},t.Index.prototype.getFields=function(){return this._fields.slice()},t.Index.prototype.search=function(e,n){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var i=null;null!=n&&(i=JSON.stringify(n));for(var o=new t.Configuration(i,this.getFields()).get(),r={},s=Object.keys(e),u=0;u0&&t.push(e);for(var i in n)"docs"!==i&&"df"!==i&&this.expandToken(e+i,t,n[i]);return t},t.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},t.Configuration=function(e,n){var e=e||"";if(void 0==n||null==n)throw new Error("fields should not be null");this.config={};var i;try{i=JSON.parse(e),this.buildUserConfig(i,n)}catch(o){t.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(n)}},t.Configuration.prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},t.Configuration.prototype.buildUserConfig=function(e,n){var i="OR",o=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(o=e.expand||o),"fields"in e)for(var r in e.fields)if(n.indexOf(r)>-1){var s=e.fields[r],u=o;void 0!=s.expand&&(u=s.expand),this.config[r]={boost:s.boost||0===s.boost?s.boost:1,bool:s.bool||i,expand:u}}else t.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,o,n)},t.Configuration.prototype.addAllFields2UserConfig=function(e,t,n){n.forEach(function(n){this.config[n]={boost:1,bool:e,expand:t}},this)},t.Configuration.prototype.get=function(){return this.config},t.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){var e,t;for(e=0;e1;){if(r===e)return o;e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o]}return r===e?o:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];i>1;)e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o];return r>e?o:e>r?o+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,i=0,o=this.length,r=e.length,s=this.elements,u=e.elements;;){if(n>o-1||i>r-1)break;s[n]!==u[i]?s[n]u[i]&&i++:(t.add(s[n]),n++,i++)}return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){var t,n,i;this.length>=e.length?(t=this,n=e):(t=e,n=this),i=t.clone();for(var o=0,r=n.toArray();oRiksdagen Persons\n\n

This repository contains data related to Members of Parliament, Ministers, Speakers, and other Political figures who participate in the workings of the Riksdag.

\n\n

Repo Structure

\n\n

The data/ directory

\n\n

Contains metadata on individuals.

\n\n

The test/ directory

\n\n

Contains integrity tests related to the riksdagen-persons repository and to the estimation of quality and coverage of the data in data/.

\n\n

Data

\n\n

The data/ directory contains a number of csv files in Normal form where the person_id served as a primary key.

\n\n

data/chair_mp.csv

\n\n
    \n
  • chair_id
  • \n
  • parliament_year
  • \n
  • start
  • \n
  • end
  • \n
  • person_id
  • \n
\n\n

data/chairs.csv

\n\n
    \n
  • chair_id
  • \n
  • chamber
  • \n
  • chair_nr
  • \n
\n\n

data/described_by_source.csv

\n\n
    \n
  • person_id
  • \n
  • source
  • \n
  • volume
  • \n
\n\n

data/explicit_no_party.csv

\n\n
    \n
  • person_id
  • \n
  • wiki_id
  • \n
  • pages
  • \n
  • ref
  • \n
  • vol
  • \n
\n\n

data/external_identifiers.csv

\n\n
    \n
  • person_id
  • \n
  • authority
  • \n
  • identifier
  • \n
\n\n

data/government.csv

\n\n
    \n
  • start
  • \n
  • end
  • \n
  • government
  • \n
  • government_id
  • \n
\n\n

data/location_specifier.csv

\n\n
    \n
  • person_id
  • \n
  • location
  • \n
\n\n

data/member_of_parliament.csv

\n\n
    \n
  • person_id
  • \n
  • start
  • \n
  • end
  • \n
  • district
  • \n
  • role
  • \n
\n\n

data/minister.csv

\n\n
    \n
  • person_id
  • \n
  • start
  • \n
  • end
  • \n
  • government
  • \n
  • role
  • \n
\n\n

data/name.csv

\n\n
    \n
  • person_id
  • \n
  • name
  • \n
  • primary_name
  • \n
\n\n

data/party_abbreviation.csv

\n\n
    \n
  • party
  • \n
  • abbreviation
  • \n
  • ocr_correction
  • \n
\n\n

data/party_affiliation.csv

\n\n
    \n
  • person_id
  • \n
  • start
  • \n
  • end
  • \n
  • party
  • \n
  • party_id
  • \n
\n\n

data/person.csv

\n\n
    \n
  • person_id
  • \n
  • born
  • \n
  • dead
  • \n
  • gender
  • \n
  • riksdagen_id
  • \n
\n\n

data/place_of_birth.csv

\n\n
    \n
  • person_id
  • \n
  • link
  • \n
  • place
  • \n
\n\n

data/place_of_death.csv

\n\n
    \n
  • person_id
  • \n
  • link
  • \n
  • place
  • \n
\n\n

data/portraits.csv

\n\n
    \n
  • person_id
  • \n
  • portrait
  • \n
\n\n

data/references_map.csv

\n\n
    \n
  • person_id
  • \n
  • bibtex_key
  • \n
  • wiki_id
  • \n
  • page
  • \n
\n\n

data/riksdag-year.csv

\n\n
    \n
  • parliament_year
  • \n
  • specifier
  • \n
  • chamber
  • \n
  • start
  • \n
  • end
  • \n
\n\n

data/speaker.csv

\n\n
    \n
  • person_id
  • \n
  • start
  • \n
  • end
  • \n
  • role
  • \n
\n\n

data/twitter.csv

\n\n
    \n
  • person_id
  • \n
  • twitter
  • \n
\n\n

data/wiki_id.csv

\n\n
    \n
  • person_id
  • \n
  • wiki_id
  • \n
\n"}, "riksdagen-persons.quality": {"fullname": "riksdagen-persons.quality", "modulename": "riksdagen-persons.quality", "kind": "module", "doc": "

Riksdagen Persons: Quality Estimates

\n\n

This directory contains code and data related to estimating the quality of the Riksdagen Persons metadata corpus, along with the estimates themselves.

\n\n

What's here?

\n\n

./

\n\n

Python code used to estimate various quality dimensions.

\n\n
    \n
  • qe_mp-coverage.py : Estimates coverage of MPs over time
  • \n
\n\n

Support files

\n\n
    \n
  • README.md : this file
  • \n
  • __init__.py : used for building the documentation
  • \n
\n\n

data/

\n\n

Contains data necessary to run the quality estimation code.

\n\n

docs/

\n\n

Contains explanation and justifications for each quality dimension.

\n\n

estimates/

\n\n

Contains versioned output of quality estimations.

\n\n

plot/

\n\n

Contains code for generating plots from the estimate results

\n\n

Individual Quality Estimates

\n\n

MP Coverage -- qe_mp-coverage.py

\n\n

We want to know that we have the correct number of MPs in the metadata for each parliament year and chamber.

\n\n

\n"}, "riksdagen-persons.quality.qe_mp-coverage": {"fullname": "riksdagen-persons.quality.qe_mp-coverage", "modulename": "riksdagen-persons.quality.qe_mp-coverage", "kind": "module", "doc": "

Calculates MP coverage and generates plots.

\n"}, "riksdagen-persons.quality.qe_mp-coverage.baselines": {"fullname": "riksdagen-persons.quality.qe_mp-coverage.baselines", "modulename": "riksdagen-persons.quality.qe_mp-coverage", "qualname": "baselines", "kind": "variable", "doc": "

\n", "default_value": "{'ak': 0, 'fk': 0, 'ek': 0}"}, "riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"fullname": "riksdagen-persons.quality.qe_mp-coverage.ledamot_map", "modulename": "riksdagen-persons.quality.qe_mp-coverage", "qualname": "ledamot_map", "kind": "variable", "doc": "

\n", "default_value": "{'fk': 1, 'ak': 2, 'ek': 0}"}, "riksdagen-persons.quality.qe_mp-coverage.skip": {"fullname": "riksdagen-persons.quality.qe_mp-coverage.skip", "modulename": "riksdagen-persons.quality.qe_mp-coverage", "qualname": "skip", "kind": "variable", "doc": "

\n", "default_value": "['1909/prot-1909----reg-01.xml', '1909/prot-1909----reg-02.xml', '197677/prot-197677--.xml', '197677/prot-197778--.xml']"}, "riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance": {"fullname": "riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance", "modulename": "riksdagen-persons.quality.qe_mp-coverage", "qualname": "is_within_tolerance", "kind": "function", "doc": "

\n", "signature": "(nmp, baseline):", "funcdef": "def"}, "riksdagen-persons.quality.qe_mp-coverage.get_spec": {"fullname": "riksdagen-persons.quality.qe_mp-coverage.get_spec", "modulename": "riksdagen-persons.quality.qe_mp-coverage", "qualname": "get_spec", "kind": "function", "doc": "

\n", "signature": "(protocol_path):", "funcdef": "def"}, "riksdagen-persons.quality.qe_mp-coverage.mk_py": {"fullname": "riksdagen-persons.quality.qe_mp-coverage.mk_py", "modulename": "riksdagen-persons.quality.qe_mp-coverage", "qualname": "mk_py", "kind": "function", "doc": "

\n", "signature": "(row):", "funcdef": "def"}, "riksdagen-persons.quality.qe_mp-coverage.get_ch": {"fullname": "riksdagen-persons.quality.qe_mp-coverage.get_ch", "modulename": "riksdagen-persons.quality.qe_mp-coverage", "qualname": "get_ch", "kind": "function", "doc": "

\n", "signature": "(protocol_path):", "funcdef": "def"}, "riksdagen-persons.quality.qe_mp-coverage.get_baseline": {"fullname": "riksdagen-persons.quality.qe_mp-coverage.get_baseline", "modulename": "riksdagen-persons.quality.qe_mp-coverage", "qualname": "get_baseline", "kind": "function", "doc": "

\n", "signature": "(row, baseline_df):", "funcdef": "def"}, "riksdagen-persons.quality.qe_mp-coverage.main": {"fullname": "riksdagen-persons.quality.qe_mp-coverage.main", "modulename": "riksdagen-persons.quality.qe_mp-coverage", "qualname": "main", "kind": "function", "doc": "

\n", "signature": "(args):", "funcdef": "def"}, "riksdagen-persons.test": {"fullname": "riksdagen-persons.test", "modulename": "riksdagen-persons.test", "kind": "module", "doc": "

\n"}, "riksdagen-persons.test.chairs": {"fullname": "riksdagen-persons.test.chairs", "modulename": "riksdagen-persons.test.chairs", "kind": "module", "doc": "

Test chars and chair-mp mapping metadata

\n"}, "riksdagen-persons.test.chairs.ChairHog": {"fullname": "riksdagen-persons.test.chairs.ChairHog", "modulename": "riksdagen-persons.test.chairs", "qualname": "ChairHog", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.chairs.ChairHog.__init__": {"fullname": "riksdagen-persons.test.chairs.ChairHog.__init__", "modulename": "riksdagen-persons.test.chairs", "qualname": "ChairHog.__init__", "kind": "function", "doc": "

\n", "signature": "(m)"}, "riksdagen-persons.test.chairs.ChairHog.message": {"fullname": "riksdagen-persons.test.chairs.ChairHog.message", "modulename": "riksdagen-persons.test.chairs", "qualname": "ChairHog.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod": {"fullname": "riksdagen-persons.test.chairs.ChairInWrongTimePeriod", "modulename": "riksdagen-persons.test.chairs", "qualname": "ChairInWrongTimePeriod", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.__init__": {"fullname": "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.__init__", "modulename": "riksdagen-persons.test.chairs", "qualname": "ChairInWrongTimePeriod.__init__", "kind": "function", "doc": "

\n", "signature": "(m)"}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.message": {"fullname": "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.message", "modulename": "riksdagen-persons.test.chairs", "qualname": "ChairInWrongTimePeriod.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.chairs.ChairMissingFromRange": {"fullname": "riksdagen-persons.test.chairs.ChairMissingFromRange", "modulename": "riksdagen-persons.test.chairs", "qualname": "ChairMissingFromRange", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.chairs.ChairMissingFromRange.__init__": {"fullname": "riksdagen-persons.test.chairs.ChairMissingFromRange.__init__", "modulename": "riksdagen-persons.test.chairs", "qualname": "ChairMissingFromRange.__init__", "kind": "function", "doc": "

\n", "signature": "(m)"}, "riksdagen-persons.test.chairs.ChairMissingFromRange.message": {"fullname": "riksdagen-persons.test.chairs.ChairMissingFromRange.message", "modulename": "riksdagen-persons.test.chairs", "qualname": "ChairMissingFromRange.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.chairs.ChairOutOfRange": {"fullname": "riksdagen-persons.test.chairs.ChairOutOfRange", "modulename": "riksdagen-persons.test.chairs", "qualname": "ChairOutOfRange", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.chairs.ChairOutOfRange.__init__": {"fullname": "riksdagen-persons.test.chairs.ChairOutOfRange.__init__", "modulename": "riksdagen-persons.test.chairs", "qualname": "ChairOutOfRange.__init__", "kind": "function", "doc": "

\n", "signature": "(chamber)"}, "riksdagen-persons.test.chairs.ChairOutOfRange.message": {"fullname": "riksdagen-persons.test.chairs.ChairOutOfRange.message", "modulename": "riksdagen-persons.test.chairs", "qualname": "ChairOutOfRange.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.chairs.ChairYearOutOfRange": {"fullname": "riksdagen-persons.test.chairs.ChairYearOutOfRange", "modulename": "riksdagen-persons.test.chairs", "qualname": "ChairYearOutOfRange", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.__init__": {"fullname": "riksdagen-persons.test.chairs.ChairYearOutOfRange.__init__", "modulename": "riksdagen-persons.test.chairs", "qualname": "ChairYearOutOfRange.__init__", "kind": "function", "doc": "

\n", "signature": "(m)"}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.message": {"fullname": "riksdagen-persons.test.chairs.ChairYearOutOfRange.message", "modulename": "riksdagen-persons.test.chairs", "qualname": "ChairYearOutOfRange.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.chairs.DuplicateIDWarning": {"fullname": "riksdagen-persons.test.chairs.DuplicateIDWarning", "modulename": "riksdagen-persons.test.chairs", "qualname": "DuplicateIDWarning", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.chairs.DuplicateIDWarning.__init__": {"fullname": "riksdagen-persons.test.chairs.DuplicateIDWarning.__init__", "modulename": "riksdagen-persons.test.chairs", "qualname": "DuplicateIDWarning.__init__", "kind": "function", "doc": "

\n", "signature": "(m)"}, "riksdagen-persons.test.chairs.DuplicateIDWarning.message": {"fullname": "riksdagen-persons.test.chairs.DuplicateIDWarning.message", "modulename": "riksdagen-persons.test.chairs", "qualname": "DuplicateIDWarning.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.chairs.EmptyChair": {"fullname": "riksdagen-persons.test.chairs.EmptyChair", "modulename": "riksdagen-persons.test.chairs", "qualname": "EmptyChair", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.chairs.EmptyChair.__init__": {"fullname": "riksdagen-persons.test.chairs.EmptyChair.__init__", "modulename": "riksdagen-persons.test.chairs", "qualname": "EmptyChair.__init__", "kind": "function", "doc": "

\n", "signature": "(m)"}, "riksdagen-persons.test.chairs.EmptyChair.message": {"fullname": "riksdagen-persons.test.chairs.EmptyChair.message", "modulename": "riksdagen-persons.test.chairs", "qualname": "EmptyChair.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.chairs.KnaMP": {"fullname": "riksdagen-persons.test.chairs.KnaMP", "modulename": "riksdagen-persons.test.chairs", "qualname": "KnaMP", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.chairs.KnaMP.__init__": {"fullname": "riksdagen-persons.test.chairs.KnaMP.__init__", "modulename": "riksdagen-persons.test.chairs", "qualname": "KnaMP.__init__", "kind": "function", "doc": "

\n", "signature": "(m)"}, "riksdagen-persons.test.chairs.KnaMP.message": {"fullname": "riksdagen-persons.test.chairs.KnaMP.message", "modulename": "riksdagen-persons.test.chairs", "qualname": "KnaMP.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.chairs.Test": {"fullname": "riksdagen-persons.test.chairs.Test", "modulename": "riksdagen-persons.test.chairs", "qualname": "Test", "kind": "class", "doc": "

A class whose instances are single test cases.

\n\n

By default, the test code itself should be placed in a method named\n'runTest'.

\n\n

If the fixture may be used for many test cases, create as\nmany test methods as are needed. When instantiating such a TestCase\nsubclass, specify in the constructor arguments the name of the test method\nthat the instance is to execute.

\n\n

Test authors should subclass TestCase for their own tests. Construction\nand deconstruction of the test's environment ('fixture') can be\nimplemented by overriding the 'setUp' and 'tearDown' methods respectively.

\n\n

If it is necessary to override the __init__ method, the base class\n__init__ method must always be called. It is important that subclasses\nshould not change the signature of their __init__ method, since instances\nof the classes are instantiated automatically by parts of the framework\nin order to be run.

\n\n

When subclassing TestCase, you can set these attributes:

\n\n
    \n
  • failureException: determines which exception will be raised when\nthe instance's assertion methods fail; test methods raising this\nexception will be deemed to have 'failed' rather than 'errored'.
  • \n
  • longMessage: determines whether long messages (including repr of\nobjects used in assert methods) will be printed on failure in addition\nto any explicit message passed.
  • \n
  • maxDiff: sets the maximum length of a diff in failure messages\nby assert methods using difflib. It is looked up as an instance\nattribute so can be configured by individual tests if required.
  • \n
\n", "bases": "unittest.case.TestCase"}, "riksdagen-persons.test.chairs.Test.get_chairs": {"fullname": "riksdagen-persons.test.chairs.Test.get_chairs", "modulename": "riksdagen-persons.test.chairs", "qualname": "Test.get_chairs", "kind": "function", "doc": "

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.chairs.Test.get_chair_mp": {"fullname": "riksdagen-persons.test.chairs.Test.get_chair_mp", "modulename": "riksdagen-persons.test.chairs", "qualname": "Test.get_chair_mp", "kind": "function", "doc": "

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.chairs.Test.get_mep": {"fullname": "riksdagen-persons.test.chairs.Test.get_mep", "modulename": "riksdagen-persons.test.chairs", "qualname": "Test.get_mep", "kind": "function", "doc": "

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.chairs.Test.get_riksdag_year": {"fullname": "riksdagen-persons.test.chairs.Test.get_riksdag_year", "modulename": "riksdagen-persons.test.chairs", "qualname": "Test.get_riksdag_year", "kind": "function", "doc": "

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.chairs.Test.get_max_chair": {"fullname": "riksdagen-persons.test.chairs.Test.get_max_chair", "modulename": "riksdagen-persons.test.chairs", "qualname": "Test.get_max_chair", "kind": "function", "doc": "

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.chairs.Test.get_oor_year": {"fullname": "riksdagen-persons.test.chairs.Test.get_oor_year", "modulename": "riksdagen-persons.test.chairs", "qualname": "Test.get_oor_year", "kind": "function", "doc": "

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.chairs.Test.get_duplicated_items": {"fullname": "riksdagen-persons.test.chairs.Test.get_duplicated_items", "modulename": "riksdagen-persons.test.chairs", "qualname": "Test.get_duplicated_items", "kind": "function", "doc": "

return duplicates in a list

\n", "signature": "(self, l):", "funcdef": "def"}, "riksdagen-persons.test.chairs.Test.what_time_it_is": {"fullname": "riksdagen-persons.test.chairs.Test.what_time_it_is", "modulename": "riksdagen-persons.test.chairs", "qualname": "Test.what_time_it_is", "kind": "function", "doc": "

get formatted datetimestring

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"fullname": "riksdagen-persons.test.chairs.Test.test_unique_chair_id", "modulename": "riksdagen-persons.test.chairs", "qualname": "Test.test_unique_chair_id", "kind": "function", "doc": "

check chair IDs are unique

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"fullname": "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range", "modulename": "riksdagen-persons.test.chairs", "qualname": "Test.test_chair_nrs_in_range", "kind": "function", "doc": "

check no chairs are numbered higher than the max chair nr for that chamber

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"fullname": "riksdagen-persons.test.chairs.Test.test_chair_id_sets", "modulename": "riksdagen-persons.test.chairs", "qualname": "Test.test_chair_id_sets", "kind": "function", "doc": "

check chair IDs in chair_mp are the same set as chairs

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"fullname": "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence", "modulename": "riksdagen-persons.test.chairs", "qualname": "Test.test_chair_chambertime_concurrence", "kind": "function", "doc": "

check no chairs from tv\u00e5kammartiden are used in enkammartid and vice-versa

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"fullname": "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year", "modulename": "riksdagen-persons.test.chairs", "qualname": "Test.test_chair_nrs_in_range_for_year", "kind": "function", "doc": "

check that chairs are within acceptable range for a given year\n and that every seat within that range is present at least once\n in the chair_mp file (whether filled or not)

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"fullname": "riksdagen-persons.test.chairs.Test.test_chair_hogs", "modulename": "riksdagen-persons.test.chairs", "qualname": "Test.test_chair_hogs", "kind": "function", "doc": "

check no single person sits in two places at once

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.chairs.Test.test_knaMP": {"fullname": "riksdagen-persons.test.chairs.Test.test_knaMP", "modulename": "riksdagen-persons.test.chairs", "qualname": "Test.test_knaMP", "kind": "function", "doc": "

Check no one is sharing a chare

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.chairs.Test.test_chair_coverage": {"fullname": "riksdagen-persons.test.chairs.Test.test_chair_coverage", "modulename": "riksdagen-persons.test.chairs", "qualname": "Test.test_chair_coverage", "kind": "function", "doc": "

test all chairs are filled

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.db": {"fullname": "riksdagen-persons.test.db", "modulename": "riksdagen-persons.test.db", "kind": "module", "doc": "

throw ERROR on inconsistencies on our side

\n\n

WARN on upstream errors

\n"}, "riksdagen-persons.test.db.DuplicateWarning": {"fullname": "riksdagen-persons.test.db.DuplicateWarning", "modulename": "riksdagen-persons.test.db", "qualname": "DuplicateWarning", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.db.DuplicateWarning.__init__": {"fullname": "riksdagen-persons.test.db.DuplicateWarning.__init__", "modulename": "riksdagen-persons.test.db", "qualname": "DuplicateWarning.__init__", "kind": "function", "doc": "

\n", "signature": "(duplicate_df)"}, "riksdagen-persons.test.db.DuplicateWarning.message": {"fullname": "riksdagen-persons.test.db.DuplicateWarning.message", "modulename": "riksdagen-persons.test.db", "qualname": "DuplicateWarning.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.db.MissingPersonWarning": {"fullname": "riksdagen-persons.test.db.MissingPersonWarning", "modulename": "riksdagen-persons.test.db", "qualname": "MissingPersonWarning", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.db.MissingPersonWarning.__init__": {"fullname": "riksdagen-persons.test.db.MissingPersonWarning.__init__", "modulename": "riksdagen-persons.test.db", "qualname": "MissingPersonWarning.__init__", "kind": "function", "doc": "

\n", "signature": "(missing_persons)"}, "riksdagen-persons.test.db.MissingPersonWarning.message": {"fullname": "riksdagen-persons.test.db.MissingPersonWarning.message", "modulename": "riksdagen-persons.test.db", "qualname": "MissingPersonWarning.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.db.MissingNameWarning": {"fullname": "riksdagen-persons.test.db.MissingNameWarning", "modulename": "riksdagen-persons.test.db", "qualname": "MissingNameWarning", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.db.MissingNameWarning.__init__": {"fullname": "riksdagen-persons.test.db.MissingNameWarning.__init__", "modulename": "riksdagen-persons.test.db", "qualname": "MissingNameWarning.__init__", "kind": "function", "doc": "

\n", "signature": "(missing_names)"}, "riksdagen-persons.test.db.MissingNameWarning.message": {"fullname": "riksdagen-persons.test.db.MissingNameWarning.message", "modulename": "riksdagen-persons.test.db", "qualname": "MissingNameWarning.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.db.MissingLocationWarning": {"fullname": "riksdagen-persons.test.db.MissingLocationWarning", "modulename": "riksdagen-persons.test.db", "qualname": "MissingLocationWarning", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.db.MissingLocationWarning.__init__": {"fullname": "riksdagen-persons.test.db.MissingLocationWarning.__init__", "modulename": "riksdagen-persons.test.db", "qualname": "MissingLocationWarning.__init__", "kind": "function", "doc": "

\n", "signature": "(missing_location)"}, "riksdagen-persons.test.db.MissingLocationWarning.message": {"fullname": "riksdagen-persons.test.db.MissingLocationWarning.message", "modulename": "riksdagen-persons.test.db", "qualname": "MissingLocationWarning.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.db.MissingMemberWarning": {"fullname": "riksdagen-persons.test.db.MissingMemberWarning", "modulename": "riksdagen-persons.test.db", "qualname": "MissingMemberWarning", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.db.MissingMemberWarning.__init__": {"fullname": "riksdagen-persons.test.db.MissingMemberWarning.__init__", "modulename": "riksdagen-persons.test.db", "qualname": "MissingMemberWarning.__init__", "kind": "function", "doc": "

\n", "signature": "(missing_member)"}, "riksdagen-persons.test.db.MissingMemberWarning.message": {"fullname": "riksdagen-persons.test.db.MissingMemberWarning.message", "modulename": "riksdagen-persons.test.db", "qualname": "MissingMemberWarning.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.db.MissingPartyWarning": {"fullname": "riksdagen-persons.test.db.MissingPartyWarning", "modulename": "riksdagen-persons.test.db", "qualname": "MissingPartyWarning", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.db.MissingPartyWarning.__init__": {"fullname": "riksdagen-persons.test.db.MissingPartyWarning.__init__", "modulename": "riksdagen-persons.test.db", "qualname": "MissingPartyWarning.__init__", "kind": "function", "doc": "

\n", "signature": "(missing_location)"}, "riksdagen-persons.test.db.MissingPartyWarning.message": {"fullname": "riksdagen-persons.test.db.MissingPartyWarning.message", "modulename": "riksdagen-persons.test.db", "qualname": "MissingPartyWarning.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.db.CatalogIntegrityWarning": {"fullname": "riksdagen-persons.test.db.CatalogIntegrityWarning", "modulename": "riksdagen-persons.test.db", "qualname": "CatalogIntegrityWarning", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.db.CatalogIntegrityWarning.__init__": {"fullname": "riksdagen-persons.test.db.CatalogIntegrityWarning.__init__", "modulename": "riksdagen-persons.test.db", "qualname": "CatalogIntegrityWarning.__init__", "kind": "function", "doc": "

\n", "signature": "(issue)"}, "riksdagen-persons.test.db.CatalogIntegrityWarning.message": {"fullname": "riksdagen-persons.test.db.CatalogIntegrityWarning.message", "modulename": "riksdagen-persons.test.db", "qualname": "CatalogIntegrityWarning.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.db.Test": {"fullname": "riksdagen-persons.test.db.Test", "modulename": "riksdagen-persons.test.db", "qualname": "Test", "kind": "class", "doc": "

A class whose instances are single test cases.

\n\n

By default, the test code itself should be placed in a method named\n'runTest'.

\n\n

If the fixture may be used for many test cases, create as\nmany test methods as are needed. When instantiating such a TestCase\nsubclass, specify in the constructor arguments the name of the test method\nthat the instance is to execute.

\n\n

Test authors should subclass TestCase for their own tests. Construction\nand deconstruction of the test's environment ('fixture') can be\nimplemented by overriding the 'setUp' and 'tearDown' methods respectively.

\n\n

If it is necessary to override the __init__ method, the base class\n__init__ method must always be called. It is important that subclasses\nshould not change the signature of their __init__ method, since instances\nof the classes are instantiated automatically by parts of the framework\nin order to be run.

\n\n

When subclassing TestCase, you can set these attributes:

\n\n
    \n
  • failureException: determines which exception will be raised when\nthe instance's assertion methods fail; test methods raising this\nexception will be deemed to have 'failed' rather than 'errored'.
  • \n
  • longMessage: determines whether long messages (including repr of\nobjects used in assert methods) will be printed on failure in addition\nto any explicit message passed.
  • \n
  • maxDiff: sets the maximum length of a diff in failure messages\nby assert methods using difflib. It is looked up as an instance\nattribute so can be configured by individual tests if required.
  • \n
\n", "bases": "unittest.case.TestCase"}, "riksdagen-persons.test.db.Test.get_duplicates": {"fullname": "riksdagen-persons.test.db.Test.get_duplicates", "modulename": "riksdagen-persons.test.db", "qualname": "Test.get_duplicates", "kind": "function", "doc": "

Return a the df of a csv, a df of unique rows, and a df of duplicates.

\n", "signature": "(self, df_name, columns):", "funcdef": "def"}, "riksdagen-persons.test.db.Test.get_emil": {"fullname": "riksdagen-persons.test.db.Test.get_emil", "modulename": "riksdagen-persons.test.db", "qualname": "Test.get_emil", "kind": "function", "doc": "

Return a df of hand-checked (by Emil) \"members of parliament\" metadata.

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.db.Test.get_meta_df": {"fullname": "riksdagen-persons.test.db.Test.get_meta_df", "modulename": "riksdagen-persons.test.db", "qualname": "Test.get_meta_df", "kind": "function", "doc": "

Return csv as a df by name.

\n", "signature": "(self, df_name):", "funcdef": "def"}, "riksdagen-persons.test.db.Test.write_error_df": {"fullname": "riksdagen-persons.test.db.Test.write_error_df", "modulename": "riksdagen-persons.test.db", "qualname": "Test.write_error_df", "kind": "function", "doc": "

Take a list of errors and write the output as a dataframe

\n", "signature": "(self, df_name, errs, outpath):", "funcdef": "def"}, "riksdagen-persons.test.db.Test.test_government": {"fullname": "riksdagen-persons.test.db.Test.test_government", "modulename": "riksdagen-persons.test.db", "qualname": "Test.test_government", "kind": "function", "doc": "

test no duplicate rows in government data

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.db.Test.test_member_of_parliament": {"fullname": "riksdagen-persons.test.db.Test.test_member_of_parliament", "modulename": "riksdagen-persons.test.db", "qualname": "Test.test_member_of_parliament", "kind": "function", "doc": "

Test no duplicates in MP data

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.db.Test.test_minister": {"fullname": "riksdagen-persons.test.db.Test.test_minister", "modulename": "riksdagen-persons.test.db", "qualname": "Test.test_minister", "kind": "function", "doc": "

test no duplicates in Minister data

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.db.Test.test_party_affiliation": {"fullname": "riksdagen-persons.test.db.Test.test_party_affiliation", "modulename": "riksdagen-persons.test.db", "qualname": "Test.test_party_affiliation", "kind": "function", "doc": "

test no duplicates in party data

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.db.Test.test_person": {"fullname": "riksdagen-persons.test.db.Test.test_person", "modulename": "riksdagen-persons.test.db", "qualname": "Test.test_person", "kind": "function", "doc": "

test no duplicates in person

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.db.Test.test_speaker": {"fullname": "riksdagen-persons.test.db.Test.test_speaker", "modulename": "riksdagen-persons.test.db", "qualname": "Test.test_speaker", "kind": "function", "doc": "

test no duplicates in speaker data

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.db.Test.test_twitter": {"fullname": "riksdagen-persons.test.db.Test.test_twitter", "modulename": "riksdagen-persons.test.db", "qualname": "Test.test_twitter", "kind": "function", "doc": "

test no duplicates in twitter data

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.db.Test.test_emil_integrity": {"fullname": "riksdagen-persons.test.db.Test.test_emil_integrity", "modulename": "riksdagen-persons.test.db", "qualname": "Test.test_emil_integrity", "kind": "function", "doc": "

test integrity of the known-mp-catalog

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"fullname": "riksdagen-persons.test.db.Test.test_cf_emil_person", "modulename": "riksdagen-persons.test.db", "qualname": "Test.test_cf_emil_person", "kind": "function", "doc": "

test that every entry on the person catalog is in the person.csv file

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"fullname": "riksdagen-persons.test.db.Test.test_cf_emil_name", "modulename": "riksdagen-persons.test.db", "qualname": "Test.test_cf_emil_name", "kind": "function", "doc": "

test that every entry on the person catalog is in the name.csv file

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"fullname": "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata", "modulename": "riksdagen-persons.test.db", "qualname": "Test.test_cf_known_iorter_metadata", "kind": "function", "doc": "

test that every entry on the person catalog is in the location_specifier.csv with the same location

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"fullname": "riksdagen-persons.test.db.Test.test_cf_emil_member", "modulename": "riksdagen-persons.test.db", "qualname": "Test.test_cf_emil_member", "kind": "function", "doc": "

test that every entry on the person catalog is in the member_of_parliament.csv file

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"fullname": "riksdagen-persons.test.db.Test.test_cf_emil_party", "modulename": "riksdagen-persons.test.db", "qualname": "Test.test_cf_emil_party", "kind": "function", "doc": "

test that every entry on the person catalog is in the party_affiliation.csv file

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.db.Test.test_session_dates": {"fullname": "riksdagen-persons.test.db.Test.test_session_dates", "modulename": "riksdagen-persons.test.db", "qualname": "Test.test_session_dates", "kind": "function", "doc": "

test that all protocols are in the known session dates

\n\n

session dates scraped from protocols -- necessary? useful?

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.mandates": {"fullname": "riksdagen-persons.test.mandates", "modulename": "riksdagen-persons.test.mandates", "kind": "module", "doc": "

Test that known MP start/end dates that have been manually verified do not change in the metadata.

\n"}, "riksdagen-persons.test.mandates.DateErrorWarning": {"fullname": "riksdagen-persons.test.mandates.DateErrorWarning", "modulename": "riksdagen-persons.test.mandates", "qualname": "DateErrorWarning", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.mandates.DateErrorWarning.__init__": {"fullname": "riksdagen-persons.test.mandates.DateErrorWarning.__init__", "modulename": "riksdagen-persons.test.mandates", "qualname": "DateErrorWarning.__init__", "kind": "function", "doc": "

\n", "signature": "(date_error)"}, "riksdagen-persons.test.mandates.DateErrorWarning.message": {"fullname": "riksdagen-persons.test.mandates.DateErrorWarning.message", "modulename": "riksdagen-persons.test.mandates", "qualname": "DateErrorWarning.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.mandates.Test": {"fullname": "riksdagen-persons.test.mandates.Test", "modulename": "riksdagen-persons.test.mandates", "qualname": "Test", "kind": "class", "doc": "

A class whose instances are single test cases.

\n\n

By default, the test code itself should be placed in a method named\n'runTest'.

\n\n

If the fixture may be used for many test cases, create as\nmany test methods as are needed. When instantiating such a TestCase\nsubclass, specify in the constructor arguments the name of the test method\nthat the instance is to execute.

\n\n

Test authors should subclass TestCase for their own tests. Construction\nand deconstruction of the test's environment ('fixture') can be\nimplemented by overriding the 'setUp' and 'tearDown' methods respectively.

\n\n

If it is necessary to override the __init__ method, the base class\n__init__ method must always be called. It is important that subclasses\nshould not change the signature of their __init__ method, since instances\nof the classes are instantiated automatically by parts of the framework\nin order to be run.

\n\n

When subclassing TestCase, you can set these attributes:

\n\n
    \n
  • failureException: determines which exception will be raised when\nthe instance's assertion methods fail; test methods raising this\nexception will be deemed to have 'failed' rather than 'errored'.
  • \n
  • longMessage: determines whether long messages (including repr of\nobjects used in assert methods) will be printed on failure in addition\nto any explicit message passed.
  • \n
  • maxDiff: sets the maximum length of a diff in failure messages\nby assert methods using difflib. It is looked up as an instance\nattribute so can be configured by individual tests if required.
  • \n
\n", "bases": "unittest.case.TestCase"}, "riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates": {"fullname": "riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates", "modulename": "riksdagen-persons.test.mandates", "qualname": "Test.fetch_known_mandate_dates", "kind": "function", "doc": "

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.mandates.Test.fetch_mep_meta": {"fullname": "riksdagen-persons.test.mandates.Test.fetch_mep_meta", "modulename": "riksdagen-persons.test.mandates", "qualname": "Test.fetch_mep_meta", "kind": "function", "doc": "

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.mandates.Test.test_manually_checked_mandates": {"fullname": "riksdagen-persons.test.mandates.Test.test_manually_checked_mandates", "modulename": "riksdagen-persons.test.mandates", "qualname": "Test.test_manually_checked_mandates", "kind": "function", "doc": "

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.mp-frequency-test": {"fullname": "riksdagen-persons.test.mp-frequency-test", "modulename": "riksdagen-persons.test.mp-frequency-test", "kind": "module", "doc": "

Assert that at least 95% of parliament days have the correct number of MPs in the metadata with a 10% tolerance.

\n"}, "riksdagen-persons.test.mp-frequency-test.Info": {"fullname": "riksdagen-persons.test.mp-frequency-test.Info", "modulename": "riksdagen-persons.test.mp-frequency-test", "qualname": "Info", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.mp-frequency-test.Info.__init__": {"fullname": "riksdagen-persons.test.mp-frequency-test.Info.__init__", "modulename": "riksdagen-persons.test.mp-frequency-test", "qualname": "Info.__init__", "kind": "function", "doc": "

\n", "signature": "(m)"}, "riksdagen-persons.test.mp-frequency-test.Info.message": {"fullname": "riksdagen-persons.test.mp-frequency-test.Info.message", "modulename": "riksdagen-persons.test.mp-frequency-test", "qualname": "Info.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.mp-frequency-test.Test": {"fullname": "riksdagen-persons.test.mp-frequency-test.Test", "modulename": "riksdagen-persons.test.mp-frequency-test", "qualname": "Test", "kind": "class", "doc": "

A class whose instances are single test cases.

\n\n

By default, the test code itself should be placed in a method named\n'runTest'.

\n\n

If the fixture may be used for many test cases, create as\nmany test methods as are needed. When instantiating such a TestCase\nsubclass, specify in the constructor arguments the name of the test method\nthat the instance is to execute.

\n\n

Test authors should subclass TestCase for their own tests. Construction\nand deconstruction of the test's environment ('fixture') can be\nimplemented by overriding the 'setUp' and 'tearDown' methods respectively.

\n\n

If it is necessary to override the __init__ method, the base class\n__init__ method must always be called. It is important that subclasses\nshould not change the signature of their __init__ method, since instances\nof the classes are instantiated automatically by parts of the framework\nin order to be run.

\n\n

When subclassing TestCase, you can set these attributes:

\n\n
    \n
  • failureException: determines which exception will be raised when\nthe instance's assertion methods fail; test methods raising this\nexception will be deemed to have 'failed' rather than 'errored'.
  • \n
  • longMessage: determines whether long messages (including repr of\nobjects used in assert methods) will be printed on failure in addition\nto any explicit message passed.
  • \n
  • maxDiff: sets the maximum length of a diff in failure messages\nby assert methods using difflib. It is looked up as an instance\nattribute so can be configured by individual tests if required.
  • \n
\n", "bases": "unittest.case.TestCase"}, "riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"fullname": "riksdagen-persons.test.mp-frequency-test.Test.write_err_df", "modulename": "riksdagen-persons.test.mp-frequency-test", "qualname": "Test.write_err_df", "kind": "function", "doc": "

\n", "signature": "(self, name_str, df, outdir):", "funcdef": "def"}, "riksdagen-persons.test.mp-frequency-test.Test.get_spec": {"fullname": "riksdagen-persons.test.mp-frequency-test.Test.get_spec", "modulename": "riksdagen-persons.test.mp-frequency-test", "qualname": "Test.get_spec", "kind": "function", "doc": "

\n", "signature": "(self, protocol_path):", "funcdef": "def"}, "riksdagen-persons.test.mp-frequency-test.Test.mk_py": {"fullname": "riksdagen-persons.test.mp-frequency-test.Test.mk_py", "modulename": "riksdagen-persons.test.mp-frequency-test", "qualname": "Test.mk_py", "kind": "function", "doc": "

\n", "signature": "(self, row):", "funcdef": "def"}, "riksdagen-persons.test.mp-frequency-test.Test.get_baseline": {"fullname": "riksdagen-persons.test.mp-frequency-test.Test.get_baseline", "modulename": "riksdagen-persons.test.mp-frequency-test", "qualname": "Test.get_baseline", "kind": "function", "doc": "

\n", "signature": "(self, row, baseline_df):", "funcdef": "def"}, "riksdagen-persons.test.mp-frequency-test.Test.get_ch": {"fullname": "riksdagen-persons.test.mp-frequency-test.Test.get_ch", "modulename": "riksdagen-persons.test.mp-frequency-test", "qualname": "Test.get_ch", "kind": "function", "doc": "

\n", "signature": "(self, protocol_path):", "funcdef": "def"}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"fullname": "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance", "modulename": "riksdagen-persons.test.mp-frequency-test", "qualname": "Test.is_within_tolerance", "kind": "function", "doc": "

\n", "signature": "(self, nmp, baseline):", "funcdef": "def"}, "riksdagen-persons.test.mp-frequency-test.Test.preprocess_Corpus_metadata": {"fullname": "riksdagen-persons.test.mp-frequency-test.Test.preprocess_Corpus_metadata", "modulename": "riksdagen-persons.test.mp-frequency-test", "qualname": "Test.preprocess_Corpus_metadata", "kind": "function", "doc": "

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"fullname": "riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df", "modulename": "riksdagen-persons.test.mp-frequency-test", "qualname": "Test.expand_dates_df", "kind": "function", "doc": "

\n", "signature": "(self, dates, baseline_df):", "funcdef": "def"}, "riksdagen-persons.test.mp-frequency-test.Test.test_mp_frequency": {"fullname": "riksdagen-persons.test.mp-frequency-test.Test.test_mp_frequency", "modulename": "riksdagen-persons.test.mp-frequency-test", "qualname": "Test.test_mp_frequency", "kind": "function", "doc": "

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.party-affiliation": {"fullname": "riksdagen-persons.test.party-affiliation", "modulename": "riksdagen-persons.test.party-affiliation", "kind": "module", "doc": "

Tests related to party affiliations.

\n"}, "riksdagen-persons.test.party-affiliation.Unlisted": {"fullname": "riksdagen-persons.test.party-affiliation.Unlisted", "modulename": "riksdagen-persons.test.party-affiliation", "qualname": "Unlisted", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.party-affiliation.Unlisted.__init__": {"fullname": "riksdagen-persons.test.party-affiliation.Unlisted.__init__", "modulename": "riksdagen-persons.test.party-affiliation", "qualname": "Unlisted.__init__", "kind": "function", "doc": "

\n", "signature": "(m)"}, "riksdagen-persons.test.party-affiliation.Unlisted.message": {"fullname": "riksdagen-persons.test.party-affiliation.Unlisted.message", "modulename": "riksdagen-persons.test.party-affiliation", "qualname": "Unlisted.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.party-affiliation.Info": {"fullname": "riksdagen-persons.test.party-affiliation.Info", "modulename": "riksdagen-persons.test.party-affiliation", "qualname": "Info", "kind": "class", "doc": "

Base class for warning categories.

\n", "bases": "builtins.Warning"}, "riksdagen-persons.test.party-affiliation.Info.__init__": {"fullname": "riksdagen-persons.test.party-affiliation.Info.__init__", "modulename": "riksdagen-persons.test.party-affiliation", "qualname": "Info.__init__", "kind": "function", "doc": "

\n", "signature": "(m)"}, "riksdagen-persons.test.party-affiliation.Info.message": {"fullname": "riksdagen-persons.test.party-affiliation.Info.message", "modulename": "riksdagen-persons.test.party-affiliation", "qualname": "Info.message", "kind": "variable", "doc": "

\n"}, "riksdagen-persons.test.party-affiliation.Test": {"fullname": "riksdagen-persons.test.party-affiliation.Test", "modulename": "riksdagen-persons.test.party-affiliation", "qualname": "Test", "kind": "class", "doc": "

A class whose instances are single test cases.

\n\n

By default, the test code itself should be placed in a method named\n'runTest'.

\n\n

If the fixture may be used for many test cases, create as\nmany test methods as are needed. When instantiating such a TestCase\nsubclass, specify in the constructor arguments the name of the test method\nthat the instance is to execute.

\n\n

Test authors should subclass TestCase for their own tests. Construction\nand deconstruction of the test's environment ('fixture') can be\nimplemented by overriding the 'setUp' and 'tearDown' methods respectively.

\n\n

If it is necessary to override the __init__ method, the base class\n__init__ method must always be called. It is important that subclasses\nshould not change the signature of their __init__ method, since instances\nof the classes are instantiated automatically by parts of the framework\nin order to be run.

\n\n

When subclassing TestCase, you can set these attributes:

\n\n
    \n
  • failureException: determines which exception will be raised when\nthe instance's assertion methods fail; test methods raising this\nexception will be deemed to have 'failed' rather than 'errored'.
  • \n
  • longMessage: determines whether long messages (including repr of\nobjects used in assert methods) will be printed on failure in addition\nto any explicit message passed.
  • \n
  • maxDiff: sets the maximum length of a diff in failure messages\nby assert methods using difflib. It is looked up as an instance\nattribute so can be configured by individual tests if required.
  • \n
\n", "bases": "unittest.case.TestCase"}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"fullname": "riksdagen-persons.test.party-affiliation.Test.write_err_df", "modulename": "riksdagen-persons.test.party-affiliation", "qualname": "Test.write_err_df", "kind": "function", "doc": "

\n", "signature": "(self, name_str, lol, cols, outdir):", "funcdef": "def"}, "riksdagen-persons.test.party-affiliation.Test.test_independent_mp": {"fullname": "riksdagen-persons.test.party-affiliation.Test.test_independent_mp", "modulename": "riksdagen-persons.test.party-affiliation", "qualname": "Test.test_independent_mp", "kind": "function", "doc": "

\n", "signature": "(self):", "funcdef": "def"}, "riksdagen-persons.test.party-affiliation.Test.test_party": {"fullname": "riksdagen-persons.test.party-affiliation.Test.test_party", "modulename": "riksdagen-persons.test.party-affiliation", "qualname": "Test.test_party", "kind": "function", "doc": "

\n", "signature": "(self):", "funcdef": "def"}}, "docInfo": {"riksdagen-persons": {"qualname": 0, "fullname": 2, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 600}, "riksdagen-persons.quality": {"qualname": 0, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 208}, "riksdagen-persons.quality.qe_mp-coverage": {"qualname": 0, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 9}, "riksdagen-persons.quality.qe_mp-coverage.baselines": {"qualname": 1, "fullname": 7, "annotation": 0, "default_value": 16, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"qualname": 2, "fullname": 8, "annotation": 0, "default_value": 16, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.quality.qe_mp-coverage.skip": {"qualname": 1, "fullname": 7, "annotation": 0, "default_value": 26, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance": {"qualname": 3, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 3}, "riksdagen-persons.quality.qe_mp-coverage.get_spec": {"qualname": 2, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 12, "bases": 0, "doc": 3}, "riksdagen-persons.quality.qe_mp-coverage.mk_py": {"qualname": 2, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 3}, "riksdagen-persons.quality.qe_mp-coverage.get_ch": {"qualname": 2, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 12, "bases": 0, "doc": 3}, "riksdagen-persons.quality.qe_mp-coverage.get_baseline": {"qualname": 2, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 17, "bases": 0, "doc": 3}, "riksdagen-persons.quality.qe_mp-coverage.main": {"qualname": 1, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 3}, "riksdagen-persons.test": {"qualname": 0, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs": {"qualname": 0, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 9}, "riksdagen-persons.test.chairs.ChairHog": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.chairs.ChairHog.__init__": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 9, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.ChairHog.message": {"qualname": 2, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.__init__": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 9, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.message": {"qualname": 2, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.ChairMissingFromRange": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.chairs.ChairMissingFromRange.__init__": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 9, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.ChairMissingFromRange.message": {"qualname": 2, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.ChairOutOfRange": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.chairs.ChairOutOfRange.__init__": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 9, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.ChairOutOfRange.message": {"qualname": 2, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.ChairYearOutOfRange": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.__init__": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 9, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.message": {"qualname": 2, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.DuplicateIDWarning": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.chairs.DuplicateIDWarning.__init__": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 9, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.DuplicateIDWarning.message": {"qualname": 2, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.EmptyChair": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.chairs.EmptyChair.__init__": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 9, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.EmptyChair.message": {"qualname": 2, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.KnaMP": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.chairs.KnaMP.__init__": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 9, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.KnaMP.message": {"qualname": 2, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.Test": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 3, "doc": 268}, "riksdagen-persons.test.chairs.Test.get_chairs": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.Test.get_chair_mp": {"qualname": 4, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.Test.get_mep": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.Test.get_riksdag_year": {"qualname": 4, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.Test.get_max_chair": {"qualname": 4, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.Test.get_oor_year": {"qualname": 4, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 3}, "riksdagen-persons.test.chairs.Test.get_duplicated_items": {"qualname": 4, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 7}, "riksdagen-persons.test.chairs.Test.what_time_it_is": {"qualname": 5, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 5}, "riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"qualname": 5, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 7}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"qualname": 6, "fullname": 10, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 16}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"qualname": 5, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 14}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"qualname": 5, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 14}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"qualname": 8, "fullname": 12, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 35}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"qualname": 4, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 12}, "riksdagen-persons.test.chairs.Test.test_knaMP": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 9}, "riksdagen-persons.test.chairs.Test.test_chair_coverage": {"qualname": 4, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 7}, "riksdagen-persons.test.db": {"qualname": 0, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 15}, "riksdagen-persons.test.db.DuplicateWarning": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.db.DuplicateWarning.__init__": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 10, "bases": 0, "doc": 3}, "riksdagen-persons.test.db.DuplicateWarning.message": {"qualname": 2, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.db.MissingPersonWarning": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.db.MissingPersonWarning.__init__": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 10, "bases": 0, "doc": 3}, "riksdagen-persons.test.db.MissingPersonWarning.message": {"qualname": 2, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.db.MissingNameWarning": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.db.MissingNameWarning.__init__": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 10, "bases": 0, "doc": 3}, "riksdagen-persons.test.db.MissingNameWarning.message": {"qualname": 2, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.db.MissingLocationWarning": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.db.MissingLocationWarning.__init__": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 10, "bases": 0, "doc": 3}, "riksdagen-persons.test.db.MissingLocationWarning.message": {"qualname": 2, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.db.MissingMemberWarning": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.db.MissingMemberWarning.__init__": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 10, "bases": 0, "doc": 3}, "riksdagen-persons.test.db.MissingMemberWarning.message": {"qualname": 2, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.db.MissingPartyWarning": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.db.MissingPartyWarning.__init__": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 10, "bases": 0, "doc": 3}, "riksdagen-persons.test.db.MissingPartyWarning.message": {"qualname": 2, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.db.CatalogIntegrityWarning": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.db.CatalogIntegrityWarning.__init__": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 9, "bases": 0, "doc": 3}, "riksdagen-persons.test.db.CatalogIntegrityWarning.message": {"qualname": 2, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.db.Test": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 3, "doc": 268}, "riksdagen-persons.test.db.Test.get_duplicates": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 22, "bases": 0, "doc": 20}, "riksdagen-persons.test.db.Test.get_emil": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 15}, "riksdagen-persons.test.db.Test.get_meta_df": {"qualname": 4, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 17, "bases": 0, "doc": 10}, "riksdagen-persons.test.db.Test.write_error_df": {"qualname": 4, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 27, "bases": 0, "doc": 14}, "riksdagen-persons.test.db.Test.test_government": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 9}, "riksdagen-persons.test.db.Test.test_member_of_parliament": {"qualname": 5, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 8}, "riksdagen-persons.test.db.Test.test_minister": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 8}, "riksdagen-persons.test.db.Test.test_party_affiliation": {"qualname": 4, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 8}, "riksdagen-persons.test.db.Test.test_person": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 7}, "riksdagen-persons.test.db.Test.test_speaker": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 8}, "riksdagen-persons.test.db.Test.test_twitter": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 8}, "riksdagen-persons.test.db.Test.test_emil_integrity": {"qualname": 4, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 9}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"qualname": 5, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 16}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"qualname": 5, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 16}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"qualname": 6, "fullname": 10, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 20}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"qualname": 5, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 18}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"qualname": 5, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 17}, "riksdagen-persons.test.db.Test.test_session_dates": {"qualname": 4, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 21}, "riksdagen-persons.test.mandates": {"qualname": 0, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 20}, "riksdagen-persons.test.mandates.DateErrorWarning": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.mandates.DateErrorWarning.__init__": {"qualname": 3, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 10, "bases": 0, "doc": 3}, "riksdagen-persons.test.mandates.DateErrorWarning.message": {"qualname": 2, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.mandates.Test": {"qualname": 1, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 3, "doc": 268}, "riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates": {"qualname": 5, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 3}, "riksdagen-persons.test.mandates.Test.fetch_mep_meta": {"qualname": 4, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 3}, "riksdagen-persons.test.mandates.Test.test_manually_checked_mandates": {"qualname": 5, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 3}, "riksdagen-persons.test.mp-frequency-test": {"qualname": 0, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 24}, "riksdagen-persons.test.mp-frequency-test.Info": {"qualname": 1, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.mp-frequency-test.Info.__init__": {"qualname": 3, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 9, "bases": 0, "doc": 3}, "riksdagen-persons.test.mp-frequency-test.Info.message": {"qualname": 2, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.mp-frequency-test.Test": {"qualname": 1, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 0, "bases": 3, "doc": 268}, "riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"qualname": 4, "fullname": 10, "annotation": 0, "default_value": 0, "signature": 27, "bases": 0, "doc": 3}, "riksdagen-persons.test.mp-frequency-test.Test.get_spec": {"qualname": 3, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 17, "bases": 0, "doc": 3}, "riksdagen-persons.test.mp-frequency-test.Test.mk_py": {"qualname": 3, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 3}, "riksdagen-persons.test.mp-frequency-test.Test.get_baseline": {"qualname": 3, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 22, "bases": 0, "doc": 3}, "riksdagen-persons.test.mp-frequency-test.Test.get_ch": {"qualname": 3, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 17, "bases": 0, "doc": 3}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"qualname": 4, "fullname": 10, "annotation": 0, "default_value": 0, "signature": 21, "bases": 0, "doc": 3}, "riksdagen-persons.test.mp-frequency-test.Test.preprocess_Corpus_metadata": {"qualname": 4, "fullname": 10, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 3}, "riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"qualname": 4, "fullname": 10, "annotation": 0, "default_value": 0, "signature": 22, "bases": 0, "doc": 3}, "riksdagen-persons.test.mp-frequency-test.Test.test_mp_frequency": {"qualname": 4, "fullname": 10, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 3}, "riksdagen-persons.test.party-affiliation": {"qualname": 0, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 8}, "riksdagen-persons.test.party-affiliation.Unlisted": {"qualname": 1, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.party-affiliation.Unlisted.__init__": {"qualname": 3, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 9, "bases": 0, "doc": 3}, "riksdagen-persons.test.party-affiliation.Unlisted.message": {"qualname": 2, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.party-affiliation.Info": {"qualname": 1, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 8}, "riksdagen-persons.test.party-affiliation.Info.__init__": {"qualname": 3, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 9, "bases": 0, "doc": 3}, "riksdagen-persons.test.party-affiliation.Info.message": {"qualname": 2, "fullname": 7, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "riksdagen-persons.test.party-affiliation.Test": {"qualname": 1, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 3, "doc": 268}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"qualname": 4, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 32, "bases": 0, "doc": 3}, "riksdagen-persons.test.party-affiliation.Test.test_independent_mp": {"qualname": 4, "fullname": 9, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 3}, "riksdagen-persons.test.party-affiliation.Test.test_party": {"qualname": 3, "fullname": 8, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 3}}, "length": 129, "save": true}, "index": {"qualname": {"root": {"docs": {"riksdagen-persons.test.chairs.ChairHog.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.__init__": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning.__init__": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning.__init__": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.__init__": {"tf": 1}}, "df": 19, "b": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.get_baseline": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_baseline": {"tf": 1}}, "df": 2, "s": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.baselines": {"tf": 1}}, "df": 1}}}}}}}}}, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 1}}, "df": 1}}}}}}}, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "p": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 1}}, "df": 1}, "i": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.main": {"tf": 1}}, "df": 1}}, "x": {"docs": {"riksdagen-persons.test.chairs.Test.get_max_chair": {"tf": 1}}, "df": 1}, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates": {"tf": 1}}, "df": 1, "s": {"docs": {"riksdagen-persons.test.mandates.Test.test_manually_checked_mandates": {"tf": 1}}, "df": 1}}}}}, "u": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons.test.mandates.Test.test_manually_checked_mandates": {"tf": 1}}, "df": 1}}}}}}}, "k": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.mk_py": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.mk_py": {"tf": 1}}, "df": 2}, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.ChairHog.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.message": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.message": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.message": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.message": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.message": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning.message": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning.message": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.message": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.message": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.message": {"tf": 1}}, "df": 19}}}}}, "p": {"docs": {"riksdagen-persons.test.chairs.Test.get_mep": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_mep_meta": {"tf": 1}}, "df": 2}, "t": {"docs": {}, "df": 0, "a": {"docs": {"riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_mep_meta": {"tf": 1}}, "df": 2, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {"riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.preprocess_Corpus_metadata": {"tf": 1}}, "df": 2}}}}}}, "m": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}}, "df": 2}}}}}, "p": {"docs": {"riksdagen-persons.test.chairs.Test.get_chair_mp": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.test_mp_frequency": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.test_independent_mp": {"tf": 1}}, "df": 3}, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.db.MissingPersonWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning.message": {"tf": 1}}, "df": 3}}}}}}}}}}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.db.MissingPartyWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.message": {"tf": 1}}, "df": 3}}}}}}}}}}}}, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.db.MissingNameWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.message": {"tf": 1}}, "df": 3}}}}}}}}}}}, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.db.MissingLocationWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.message": {"tf": 1}}, "df": 3}}}}}}}}}}}}}}}, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.db.MissingMemberWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.message": {"tf": 1}}, "df": 3}}}}}}}}}}}}}}}}}}, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.db.Test.test_minister": {"tf": 1}}, "df": 1}}}}}}}}, "s": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "p": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 1}}, "df": 1}}}, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.get_spec": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_spec": {"tf": 1}}, "df": 2}, "a": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.db.Test.test_speaker": {"tf": 1}}, "df": 1}}}}}}, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}}, "df": 1}}, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}}, "df": 1}}}}}}}, "i": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance": {"tf": 1}, "riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"tf": 1}}, "df": 3}, "n": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}}, "df": 2, "i": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.chairs.ChairHog.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.__init__": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning.__init__": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning.__init__": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.__init__": {"tf": 1}}, "df": 19}}, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 1}}, "df": 1}}}}}}}, "f": {"docs": {}, "df": 0, "o": {"docs": {"riksdagen-persons.test.mp-frequency-test.Info": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.__init__": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.message": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.message": {"tf": 1}}, "df": 6}}, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.party-affiliation.Test.test_independent_mp": {"tf": 1}}, "df": 1}}}}}}}}}}, "t": {"docs": {"riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 1}}, "df": 1, "e": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1}}, "df": 1}}}}, "d": {"docs": {"riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}}, "df": 2}, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}}, "df": 1}}}}}}, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"tf": 1}}, "df": 2}}}}}, "h": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 1}}, "df": 1}}}, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1}}, "df": 3}}}}}, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"tf": 1}}, "df": 2}}}}}}}}, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_chairs": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_chair_mp": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_mep": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_riksdag_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_max_chair": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_oor_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1}, "riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_knaMP": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_chair_coverage": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}, "riksdagen-persons.test.db.Test.get_emil": {"tf": 1}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}, "riksdagen-persons.test.db.Test.test_government": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_minister": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_party_affiliation": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_person": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_speaker": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_twitter": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_mep_meta": {"tf": 1}, "riksdagen-persons.test.mandates.Test.test_manually_checked_mandates": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_spec": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.mk_py": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_baseline": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_ch": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.preprocess_Corpus_metadata": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.test_mp_frequency": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.test_independent_mp": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test.test_party": {"tf": 1.4142135623730951}}, "df": 54}}}, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 1}}, "df": 1}}}, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.db.Test.test_twitter": {"tf": 1}}, "df": 1}}}}}}}, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.get_spec": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_ch": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_baseline": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_chairs": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_chair_mp": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_mep": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_riksdag_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_max_chair": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_oor_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}, "riksdagen-persons.test.db.Test.get_emil": {"tf": 1}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_spec": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_baseline": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_ch": {"tf": 1}}, "df": 16}}, "o": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.db.Test.test_government": {"tf": 1}}, "df": 1}}}}}}}}}}, "p": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.mk_py": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.mk_py": {"tf": 1}}, "df": 2}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1}}, "df": 1}}}}}}}, "t": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons.test.db.Test.test_party_affiliation": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.test_party": {"tf": 1}}, "df": 3}}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.db.Test.test_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}}, "df": 2}}}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.mp-frequency-test.Test.preprocess_Corpus_metadata": {"tf": 1}}, "df": 1}}}}}}}}}}, "c": {"docs": {}, "df": 0, "h": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.get_ch": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_ch": {"tf": 1}}, "df": 2, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.chairs.Test.get_chair_mp": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_max_chair": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_coverage": {"tf": 1}}, "df": 9, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.chairs.ChairHog": {"tf": 1}, "riksdagen-persons.test.chairs.ChairHog.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairHog.message": {"tf": 1}}, "df": 3}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.ChairInWrongTimePeriod": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.message": {"tf": 1}}, "df": 3}}}}}}}}}}}}}}}}}, "m": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.ChairMissingFromRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.message": {"tf": 1}}, "df": 3}}}}}}}}}}}}}}}}, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.ChairOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange.message": {"tf": 1}}, "df": 3}}}}}}}}}}, "y": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.ChairYearOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.message": {"tf": 1}}, "df": 3}}}}}}}}}}}}}}, "s": {"docs": {"riksdagen-persons.test.chairs.Test.get_chairs": {"tf": 1}}, "df": 1}}}, "m": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}}, "df": 1}}}}}}}}}, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.mandates.Test.test_manually_checked_mandates": {"tf": 1}}, "df": 1}}}}}}, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}}, "df": 1}}}}}}}}}, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_coverage": {"tf": 1}}, "df": 1}}}}}}, "r": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.mp-frequency-test.Test.preprocess_Corpus_metadata": {"tf": 1}}, "df": 1}}}}}, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.db.CatalogIntegrityWarning": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning.message": {"tf": 1}}, "df": 3}}}}}}}}}}}}}}}}}}}}}}, "f": {"docs": {"riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}}, "df": 5}}, "d": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.chairs.DuplicateIDWarning": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.message": {"tf": 1}}, "df": 3}}}}}}}}}, "d": {"docs": {"riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1}}, "df": 1}, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.db.DuplicateWarning": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.message": {"tf": 1}}, "df": 3}}}}}}}, "s": {"docs": {"riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}}, "df": 1}}}}}}}}}, "f": {"docs": {"riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1}}, "df": 5}, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"tf": 1}}, "df": 3}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.mandates.DateErrorWarning": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning.__init__": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning.message": {"tf": 1}}, "df": 3}}}}}}}}}}}}}}}}, "e": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.chairs.EmptyChair": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.message": {"tf": 1}}, "df": 3}}}}}}}}, "i": {"docs": {}, "df": 0, "l": {"docs": {"riksdagen-persons.test.db.Test.get_emil": {"tf": 1}, "riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}}, "df": 6}}}, "r": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1}}, "df": 2, "o": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}}, "df": 1}}}}, "x": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"tf": 1}}, "df": 1}}}}}}, "k": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "p": {"docs": {"riksdagen-persons.test.chairs.KnaMP": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.message": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_knaMP": {"tf": 1}}, "df": 4}}}, "o": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates": {"tf": 1}}, "df": 2}}}}}, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.chairs.Test.get_riksdag_year": {"tf": 1}}, "df": 1}}}}}}, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}}, "df": 2}}}}}, "y": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.chairs.Test.get_riksdag_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_oor_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}}, "df": 3}}}}, "o": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.chairs.Test.get_oor_year": {"tf": 1}}, "df": 1}}, "f": {"docs": {"riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1}}, "df": 1}}, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "q": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 1}}, "df": 1}}}}, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.party-affiliation.Unlisted": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.message": {"tf": 1}}, "df": 3}}}}}}}}, "n": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}}, "df": 2}}, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}}, "df": 1}}}}, "f": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}}, "df": 1}}, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_mep_meta": {"tf": 1}}, "df": 2}}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "q": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons.test.mp-frequency-test.Test.test_mp_frequency": {"tf": 1}}, "df": 1}}}}}}}}}, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1}}, "df": 1}}}}, "a": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.db.Test.test_party_affiliation": {"tf": 1}}, "df": 1}}}}}}}}}}}}}, "fullname": {"root": {"docs": {"riksdagen-persons.test.chairs.ChairHog.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.__init__": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning.__init__": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning.__init__": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.__init__": {"tf": 1}}, "df": 19, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.chairs.Test.get_riksdag_year": {"tf": 1}}, "df": 1, "e": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.baselines": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_spec": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.mk_py": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_ch": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_baseline": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.main": {"tf": 1}, "riksdagen-persons.test": {"tf": 1}, "riksdagen-persons.test.chairs": {"tf": 1}, "riksdagen-persons.test.chairs.ChairHog": {"tf": 1}, "riksdagen-persons.test.chairs.ChairHog.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairHog.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.message": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.message": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.message": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.message": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_chairs": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_chair_mp": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_mep": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_riksdag_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_max_chair": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_oor_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1}, "riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_knaMP": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_coverage": {"tf": 1}, "riksdagen-persons.test.db": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.message": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning.message": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}, "riksdagen-persons.test.db.Test.get_emil": {"tf": 1}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}, "riksdagen-persons.test.db.Test.test_government": {"tf": 1}, "riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1}, "riksdagen-persons.test.db.Test.test_minister": {"tf": 1}, "riksdagen-persons.test.db.Test.test_party_affiliation": {"tf": 1}, "riksdagen-persons.test.db.Test.test_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_speaker": {"tf": 1}, "riksdagen-persons.test.db.Test.test_twitter": {"tf": 1}, "riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}, "riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}, "riksdagen-persons.test.mandates": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning.__init__": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning.message": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_mep_meta": {"tf": 1}, "riksdagen-persons.test.mandates.Test.test_manually_checked_mandates": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.__init__": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.message": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_spec": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.mk_py": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_baseline": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_ch": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.preprocess_Corpus_metadata": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.test_mp_frequency": {"tf": 1}, "riksdagen-persons.test.party-affiliation": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.message": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.message": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.test_independent_mp": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.test_party": {"tf": 1}}, "df": 129}}}}}}}}, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}}, "df": 2}}}}}, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.db.Test.test_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}}, "df": 2, "s": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.baselines": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_spec": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.mk_py": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_ch": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_baseline": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.main": {"tf": 1}, "riksdagen-persons.test": {"tf": 1}, "riksdagen-persons.test.chairs": {"tf": 1}, "riksdagen-persons.test.chairs.ChairHog": {"tf": 1}, "riksdagen-persons.test.chairs.ChairHog.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairHog.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.message": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.message": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.message": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.message": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_chairs": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_chair_mp": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_mep": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_riksdag_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_max_chair": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_oor_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1}, "riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_knaMP": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_coverage": {"tf": 1}, "riksdagen-persons.test.db": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.message": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning.message": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}, "riksdagen-persons.test.db.Test.get_emil": {"tf": 1}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}, "riksdagen-persons.test.db.Test.test_government": {"tf": 1}, "riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1}, "riksdagen-persons.test.db.Test.test_minister": {"tf": 1}, "riksdagen-persons.test.db.Test.test_party_affiliation": {"tf": 1}, "riksdagen-persons.test.db.Test.test_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_speaker": {"tf": 1}, "riksdagen-persons.test.db.Test.test_twitter": {"tf": 1}, "riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}, "riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}, "riksdagen-persons.test.mandates": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning.__init__": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning.message": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_mep_meta": {"tf": 1}, "riksdagen-persons.test.mandates.Test.test_manually_checked_mandates": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.__init__": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.message": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_spec": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.mk_py": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_baseline": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_ch": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.preprocess_Corpus_metadata": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.test_mp_frequency": {"tf": 1}, "riksdagen-persons.test.party-affiliation": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.message": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.message": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.test_independent_mp": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.test_party": {"tf": 1}}, "df": 129}}}}}}, "y": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.mk_py": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.mk_py": {"tf": 1}}, "df": 2}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1}}, "df": 1}}}}}}}, "t": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons.test.db.Test.test_party_affiliation": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}, "riksdagen-persons.test.party-affiliation": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.message": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.message": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.test_independent_mp": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.test_party": {"tf": 1.4142135623730951}}, "df": 13}}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.mp-frequency-test.Test.preprocess_Corpus_metadata": {"tf": 1}}, "df": 1}}}}}}}}}}, "q": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.baselines": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_spec": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.mk_py": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_ch": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_baseline": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.main": {"tf": 1}}, "df": 11}}}}}}, "e": {"docs": {"riksdagen-persons.quality.qe_mp-coverage": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.baselines": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_spec": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.mk_py": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_ch": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_baseline": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.main": {"tf": 1}}, "df": 10}}, "m": {"docs": {}, "df": 0, "p": {"docs": {"riksdagen-persons.quality.qe_mp-coverage": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.baselines": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_spec": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.mk_py": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_ch": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_baseline": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.main": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_chair_mp": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.__init__": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.message": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_spec": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.mk_py": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_baseline": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_ch": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.preprocess_Corpus_metadata": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.test_mp_frequency": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test.test_independent_mp": {"tf": 1}}, "df": 26}, "a": {"docs": {}, "df": 0, "p": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 1}}, "df": 1}, "i": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.main": {"tf": 1}}, "df": 1}}, "x": {"docs": {"riksdagen-persons.test.chairs.Test.get_max_chair": {"tf": 1}}, "df": 1}, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates": {"tf": 1}}, "df": 1, "s": {"docs": {"riksdagen-persons.test.mandates": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning.__init__": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning.message": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_mep_meta": {"tf": 1}, "riksdagen-persons.test.mandates.Test.test_manually_checked_mandates": {"tf": 1.4142135623730951}}, "df": 8}}}}}, "u": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons.test.mandates.Test.test_manually_checked_mandates": {"tf": 1}}, "df": 1}}}}}}}, "k": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.mk_py": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.mk_py": {"tf": 1}}, "df": 2}, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.ChairHog.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.message": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.message": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.message": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.message": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.message": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning.message": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning.message": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.message": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.message": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.message": {"tf": 1}}, "df": 19}}}}}, "p": {"docs": {"riksdagen-persons.test.chairs.Test.get_mep": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_mep_meta": {"tf": 1}}, "df": 2}, "t": {"docs": {}, "df": 0, "a": {"docs": {"riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_mep_meta": {"tf": 1}}, "df": 2, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {"riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.preprocess_Corpus_metadata": {"tf": 1}}, "df": 2}}}}}}, "m": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}}, "df": 2}}}}}, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.db.MissingPersonWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning.message": {"tf": 1}}, "df": 3}}}}}}}}}}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.db.MissingPartyWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.message": {"tf": 1}}, "df": 3}}}}}}}}}}}}, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.db.MissingNameWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.message": {"tf": 1}}, "df": 3}}}}}}}}}}}, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.db.MissingLocationWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.message": {"tf": 1}}, "df": 3}}}}}}}}}}}}}}}, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.db.MissingMemberWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.message": {"tf": 1}}, "df": 3}}}}}}}}}}}}}}}}}}, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.db.Test.test_minister": {"tf": 1}}, "df": 1}}}}}}}}, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.quality.qe_mp-coverage": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.baselines": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_spec": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.mk_py": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_ch": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_baseline": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.main": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_coverage": {"tf": 1}}, "df": 11}}}}}}, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}}, "df": 1}}}}}}}}}, "r": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.mp-frequency-test.Test.preprocess_Corpus_metadata": {"tf": 1}}, "df": 1}}}}}, "h": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.get_ch": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_ch": {"tf": 1}}, "df": 2, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.chairs.Test.get_chair_mp": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_max_chair": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_coverage": {"tf": 1}}, "df": 9, "s": {"docs": {"riksdagen-persons.test.chairs": {"tf": 1}, "riksdagen-persons.test.chairs.ChairHog": {"tf": 1}, "riksdagen-persons.test.chairs.ChairHog.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairHog.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.message": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.message": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.message": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.message": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_chairs": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.get_chair_mp": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_mep": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_riksdag_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_max_chair": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_oor_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1}, "riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_knaMP": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_coverage": {"tf": 1}}, "df": 42}, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.chairs.ChairHog": {"tf": 1}, "riksdagen-persons.test.chairs.ChairHog.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairHog.message": {"tf": 1}}, "df": 3}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.ChairInWrongTimePeriod": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.message": {"tf": 1}}, "df": 3}}}}}}}}}}}}}}}}}, "m": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.ChairMissingFromRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.message": {"tf": 1}}, "df": 3}}}}}}}}}}}}}}}}, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.ChairOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange.message": {"tf": 1}}, "df": 3}}}}}}}}}}, "y": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.ChairYearOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.message": {"tf": 1}}, "df": 3}}}}}}}}}}}}}}}}, "m": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}}, "df": 1}}}}}}}}}, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.mandates.Test.test_manually_checked_mandates": {"tf": 1}}, "df": 1}}}}}}, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.db.CatalogIntegrityWarning": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning.message": {"tf": 1}}, "df": 3}}}}}}}}}}}}}}}}}}}}}}, "f": {"docs": {"riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}}, "df": 5}}, "b": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.get_baseline": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_baseline": {"tf": 1}}, "df": 2, "s": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.baselines": {"tf": 1}}, "df": 1}}}}}}}}}, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 1}}, "df": 1}}}}}}}, "s": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "p": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 1}}, "df": 1}}}, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.get_spec": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_spec": {"tf": 1}}, "df": 2}, "a": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.db.Test.test_speaker": {"tf": 1}}, "df": 1}}}}}}, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}}, "df": 1}}, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}}, "df": 1}}}}}}}, "i": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance": {"tf": 1}, "riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"tf": 1}}, "df": 3}, "n": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}}, "df": 2, "i": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.chairs.ChairHog.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.__init__": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning.__init__": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning.__init__": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.__init__": {"tf": 1}}, "df": 19}}, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 1}}, "df": 1}}}}}}}, "f": {"docs": {}, "df": 0, "o": {"docs": {"riksdagen-persons.test.mp-frequency-test.Info": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.__init__": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.message": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.message": {"tf": 1}}, "df": 6}}, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.party-affiliation.Test.test_independent_mp": {"tf": 1}}, "df": 1}}}}}}}}}}, "t": {"docs": {"riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 1}}, "df": 1, "e": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1}}, "df": 1}}}}, "d": {"docs": {"riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}}, "df": 2}, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}}, "df": 1}}}}}}, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"tf": 1}}, "df": 2}}}}}, "h": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 1}}, "df": 1}}}, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1}}, "df": 3}}}}}, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"tf": 1}}, "df": 2}}}}}}}}, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test": {"tf": 1}, "riksdagen-persons.test.chairs": {"tf": 1}, "riksdagen-persons.test.chairs.ChairHog": {"tf": 1}, "riksdagen-persons.test.chairs.ChairHog.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairHog.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange.message": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.message": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.message": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.message": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.message": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.get_chairs": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.get_chair_mp": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.get_mep": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.get_riksdag_year": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.get_max_chair": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.get_oor_year": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.Test.test_knaMP": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.Test.test_chair_coverage": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.message": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning.message": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.get_emil": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_government": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.test_minister": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.test_party_affiliation": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.test_person": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.test_speaker": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.test_twitter": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mandates": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning.__init__": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning.message": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test.fetch_mep_meta": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test.test_manually_checked_mandates": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Info": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Info.__init__": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Info.message": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test.get_spec": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test.mk_py": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test.get_baseline": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test.get_ch": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test.preprocess_Corpus_metadata": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test.test_mp_frequency": {"tf": 2}, "riksdagen-persons.test.party-affiliation": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.message": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.message": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test.test_independent_mp": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Test.test_party": {"tf": 1.7320508075688772}}, "df": 117}}}, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 1}}, "df": 1}}}, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.db.Test.test_twitter": {"tf": 1}}, "df": 1}}}}}}}, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.get_spec": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_ch": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_baseline": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_chairs": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_chair_mp": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_mep": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_riksdag_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_max_chair": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_oor_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}, "riksdagen-persons.test.db.Test.get_emil": {"tf": 1}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_spec": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_baseline": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_ch": {"tf": 1}}, "df": 16}}, "o": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.db.Test.test_government": {"tf": 1}}, "df": 1}}}}}}}}}}, "d": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.chairs.DuplicateIDWarning": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.message": {"tf": 1}}, "df": 3}}}}}}}}}, "d": {"docs": {"riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1}}, "df": 1}, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.db.DuplicateWarning": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.message": {"tf": 1}}, "df": 3}}}}}}}, "s": {"docs": {"riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}}, "df": 1}}}}}}}}}, "b": {"docs": {"riksdagen-persons.test.db": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.message": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.message": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning.message": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}, "riksdagen-persons.test.db.Test.get_emil": {"tf": 1}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}, "riksdagen-persons.test.db.Test.test_government": {"tf": 1}, "riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1}, "riksdagen-persons.test.db.Test.test_minister": {"tf": 1}, "riksdagen-persons.test.db.Test.test_party_affiliation": {"tf": 1}, "riksdagen-persons.test.db.Test.test_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_speaker": {"tf": 1}, "riksdagen-persons.test.db.Test.test_twitter": {"tf": 1}, "riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}, "riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}}, "df": 41}, "f": {"docs": {"riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1}}, "df": 5}, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"tf": 1}}, "df": 3}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.mandates.DateErrorWarning": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning.__init__": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning.message": {"tf": 1}}, "df": 3}}}}}}}}}}}}}}}}, "e": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.chairs.EmptyChair": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.message": {"tf": 1}}, "df": 3}}}}}}}}, "i": {"docs": {}, "df": 0, "l": {"docs": {"riksdagen-persons.test.db.Test.get_emil": {"tf": 1}, "riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}}, "df": 6}}}, "r": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1}}, "df": 2, "o": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}}, "df": 1}}}}, "x": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"tf": 1}}, "df": 1}}}}}}, "k": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "p": {"docs": {"riksdagen-persons.test.chairs.KnaMP": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.message": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_knaMP": {"tf": 1}}, "df": 4}}}, "o": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates": {"tf": 1}}, "df": 2}}}}}, "y": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.chairs.Test.get_riksdag_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_oor_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}}, "df": 3}}}}, "o": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.chairs.Test.get_oor_year": {"tf": 1}}, "df": 1}}, "f": {"docs": {"riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1}}, "df": 1}}, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "q": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 1}}, "df": 1}}}}, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.party-affiliation.Unlisted": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.message": {"tf": 1}}, "df": 3}}}}}}}}, "n": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}}, "df": 2}}, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}}, "df": 1}}}}, "f": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}}, "df": 1}}, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_mep_meta": {"tf": 1}}, "df": 2}}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "q": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons.test.mp-frequency-test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.__init__": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.message": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_spec": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.mk_py": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_baseline": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_ch": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.preprocess_Corpus_metadata": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.test_mp_frequency": {"tf": 1.4142135623730951}}, "df": 14}}}}}}}}}, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1}}, "df": 1}}}}, "a": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.db.Test.test_party_affiliation": {"tf": 1}, "riksdagen-persons.test.party-affiliation": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.message": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.message": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.test_independent_mp": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.test_party": {"tf": 1}}, "df": 12}}}}}}}}}}}}}, "annotation": {"root": {"docs": {}, "df": 0}}, "default_value": {"root": {"0": {"1": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 1}}, "df": 1}, "2": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 1}}, "df": 1}, "docs": {"riksdagen-persons.quality.qe_mp-coverage.baselines": {"tf": 1.7320508075688772}, "riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 1}}, "df": 2}, "1": {"9": {"0": {"9": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 1.4142135623730951}}, "df": 1, "/": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 1.4142135623730951}}, "df": 1}}}}}}, "docs": {}, "df": 0}, "7": {"6": {"7": {"7": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 1}}, "df": 1, "/": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 1.4142135623730951}}, "df": 1}}}}}}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "7": {"7": {"8": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {"riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 1}}, "df": 1}, "2": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 1}}, "df": 1}, "docs": {"riksdagen-persons.quality.qe_mp-coverage.baselines": {"tf": 2}, "riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 2}, "riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 1.4142135623730951}}, "df": 3, "x": {"2": {"7": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.baselines": {"tf": 2.449489742783178}, "riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 2.449489742783178}, "riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 2.8284271247461903}}, "df": 3}, "docs": {}, "df": 0}, "docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "l": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 2}}, "df": 1}}}, "a": {"docs": {}, "df": 0, "k": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.baselines": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 1}}, "df": 2}}, "f": {"docs": {}, "df": 0, "k": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.baselines": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 1}}, "df": 2}}, "e": {"docs": {}, "df": 0, "k": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.baselines": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 1}}, "df": 2}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 1.4142135623730951}}, "df": 1}}}}}, "signature": {"root": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance": {"tf": 3.7416573867739413}, "riksdagen-persons.quality.qe_mp-coverage.get_spec": {"tf": 3.1622776601683795}, "riksdagen-persons.quality.qe_mp-coverage.mk_py": {"tf": 3.1622776601683795}, "riksdagen-persons.quality.qe_mp-coverage.get_ch": {"tf": 3.1622776601683795}, "riksdagen-persons.quality.qe_mp-coverage.get_baseline": {"tf": 3.7416573867739413}, "riksdagen-persons.quality.qe_mp-coverage.main": {"tf": 3.1622776601683795}, "riksdagen-persons.test.chairs.ChairHog.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.chairs.ChairMissingFromRange.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.chairs.ChairOutOfRange.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.chairs.DuplicateIDWarning.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.chairs.EmptyChair.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.chairs.KnaMP.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.chairs.Test.get_chairs": {"tf": 3.1622776601683795}, "riksdagen-persons.test.chairs.Test.get_chair_mp": {"tf": 3.1622776601683795}, "riksdagen-persons.test.chairs.Test.get_mep": {"tf": 3.1622776601683795}, "riksdagen-persons.test.chairs.Test.get_riksdag_year": {"tf": 3.1622776601683795}, "riksdagen-persons.test.chairs.Test.get_max_chair": {"tf": 3.1622776601683795}, "riksdagen-persons.test.chairs.Test.get_oor_year": {"tf": 3.1622776601683795}, "riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 3.7416573867739413}, "riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 3.1622776601683795}, "riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 3.1622776601683795}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 3.1622776601683795}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 3.1622776601683795}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 3.1622776601683795}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 3.1622776601683795}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 3.1622776601683795}, "riksdagen-persons.test.chairs.Test.test_knaMP": {"tf": 3.1622776601683795}, "riksdagen-persons.test.chairs.Test.test_chair_coverage": {"tf": 3.1622776601683795}, "riksdagen-persons.test.db.DuplicateWarning.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.db.MissingPersonWarning.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.db.MissingNameWarning.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.db.MissingLocationWarning.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.db.MissingMemberWarning.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.db.MissingPartyWarning.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.db.CatalogIntegrityWarning.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 4.242640687119285}, "riksdagen-persons.test.db.Test.get_emil": {"tf": 3.1622776601683795}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 3.7416573867739413}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 4.69041575982343}, "riksdagen-persons.test.db.Test.test_government": {"tf": 3.1622776601683795}, "riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 3.1622776601683795}, "riksdagen-persons.test.db.Test.test_minister": {"tf": 3.1622776601683795}, "riksdagen-persons.test.db.Test.test_party_affiliation": {"tf": 3.1622776601683795}, "riksdagen-persons.test.db.Test.test_person": {"tf": 3.1622776601683795}, "riksdagen-persons.test.db.Test.test_speaker": {"tf": 3.1622776601683795}, "riksdagen-persons.test.db.Test.test_twitter": {"tf": 3.1622776601683795}, "riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 3.1622776601683795}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 3.1622776601683795}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 3.1622776601683795}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 3.1622776601683795}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 3.1622776601683795}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 3.1622776601683795}, "riksdagen-persons.test.db.Test.test_session_dates": {"tf": 3.1622776601683795}, "riksdagen-persons.test.mandates.DateErrorWarning.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates": {"tf": 3.1622776601683795}, "riksdagen-persons.test.mandates.Test.fetch_mep_meta": {"tf": 3.1622776601683795}, "riksdagen-persons.test.mandates.Test.test_manually_checked_mandates": {"tf": 3.1622776601683795}, "riksdagen-persons.test.mp-frequency-test.Info.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 4.69041575982343}, "riksdagen-persons.test.mp-frequency-test.Test.get_spec": {"tf": 3.7416573867739413}, "riksdagen-persons.test.mp-frequency-test.Test.mk_py": {"tf": 3.7416573867739413}, "riksdagen-persons.test.mp-frequency-test.Test.get_baseline": {"tf": 4.242640687119285}, "riksdagen-persons.test.mp-frequency-test.Test.get_ch": {"tf": 3.7416573867739413}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"tf": 4.242640687119285}, "riksdagen-persons.test.mp-frequency-test.Test.preprocess_Corpus_metadata": {"tf": 3.1622776601683795}, "riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"tf": 4.242640687119285}, "riksdagen-persons.test.mp-frequency-test.Test.test_mp_frequency": {"tf": 3.1622776601683795}, "riksdagen-persons.test.party-affiliation.Unlisted.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.party-affiliation.Info.__init__": {"tf": 2.8284271247461903}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 5.0990195135927845}, "riksdagen-persons.test.party-affiliation.Test.test_independent_mp": {"tf": 3.1622776601683795}, "riksdagen-persons.test.party-affiliation.Test.test_party": {"tf": 3.1622776601683795}}, "df": 74, "n": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "p": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"tf": 1}}, "df": 2}}, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1}}, "df": 5, "s": {"docs": {"riksdagen-persons.test.db.MissingNameWarning.__init__": {"tf": 1}}, "df": 1}}}}}, "b": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_baseline": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_baseline": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"tf": 1}}, "df": 5}}}}}}}}, "p": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.get_spec": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_ch": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_spec": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_ch": {"tf": 1}}, "df": 4}}}}}}}, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.get_spec": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_ch": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_spec": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_ch": {"tf": 1}}, "df": 4}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.db.MissingPersonWarning.__init__": {"tf": 1}}, "df": 1}}}}}}}, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "w": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.mk_py": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage.get_baseline": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.mk_py": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_baseline": {"tf": 1}}, "df": 4}}}, "d": {"docs": {}, "df": 0, "f": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.get_baseline": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_baseline": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"tf": 1}}, "df": 8}, "u": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.db.DuplicateWarning.__init__": {"tf": 1}}, "df": 1}}}}}}}}, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.mandates.DateErrorWarning.__init__": {"tf": 1}}, "df": 1, "s": {"docs": {"riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"tf": 1}}, "df": 1}}}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.quality.qe_mp-coverage.main": {"tf": 1}}, "df": 1}}}}, "m": {"docs": {"riksdagen-persons.test.chairs.ChairHog.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair.__init__": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP.__init__": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted.__init__": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info.__init__": {"tf": 1}}, "df": 10, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.db.MissingPersonWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.__init__": {"tf": 1}}, "df": 5}}}}}}, "e": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.db.MissingMemberWarning.__init__": {"tf": 1}}, "df": 1}}}}}}, "c": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.chairs.ChairOutOfRange.__init__": {"tf": 1}}, "df": 1}}}}}}, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}}, "df": 1}}}}, "s": {"docs": {"riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1}}, "df": 1}}}}, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "f": {"docs": {"riksdagen-persons.test.chairs.Test.get_chairs": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_chair_mp": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_mep": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_riksdag_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_max_chair": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_oor_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1}, "riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_knaMP": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_coverage": {"tf": 1}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}, "riksdagen-persons.test.db.Test.get_emil": {"tf": 1}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}, "riksdagen-persons.test.db.Test.test_government": {"tf": 1}, "riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1}, "riksdagen-persons.test.db.Test.test_minister": {"tf": 1}, "riksdagen-persons.test.db.Test.test_party_affiliation": {"tf": 1}, "riksdagen-persons.test.db.Test.test_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_speaker": {"tf": 1}, "riksdagen-persons.test.db.Test.test_twitter": {"tf": 1}, "riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}, "riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates": {"tf": 1}, "riksdagen-persons.test.mandates.Test.fetch_mep_meta": {"tf": 1}, "riksdagen-persons.test.mandates.Test.test_manually_checked_mandates": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_spec": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.mk_py": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_baseline": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.get_ch": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.preprocess_Corpus_metadata": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test.test_mp_frequency": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.test_independent_mp": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.test_party": {"tf": 1}}, "df": 49}}}, "t": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1}}, "df": 2}}}, "l": {"docs": {"riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1}}, "df": 1, "o": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.db.MissingLocationWarning.__init__": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning.__init__": {"tf": 1}}, "df": 2}}}}}}, "l": {"docs": {"riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1}}, "df": 1}}}, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.db.CatalogIntegrityWarning.__init__": {"tf": 1}}, "df": 1}}}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}}, "df": 1}, "o": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.mandates.DateErrorWarning.__init__": {"tf": 1}}, "df": 1}}}}}, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {"riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}}, "df": 1}}}}, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1}}, "df": 2}}}}}}}}, "bases": {"root": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.ChairHog": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info": {"tf": 1}}, "df": 19}}}}}}}}, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.chairs.ChairHog": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info": {"tf": 1}}, "df": 19}}}}}}}, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}}, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}}}}, "doc": {"root": {"1": {"0": {"docs": {"riksdagen-persons.test.mp-frequency-test": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "9": {"5": {"docs": {"riksdagen-persons.test.mp-frequency-test": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {"riksdagen-persons": {"tf": 18.76166303929372}, "riksdagen-persons.quality": {"tf": 9.055385138137417}, "riksdagen-persons.quality.qe_mp-coverage": {"tf": 1.7320508075688772}, "riksdagen-persons.quality.qe_mp-coverage.baselines": {"tf": 1.7320508075688772}, "riksdagen-persons.quality.qe_mp-coverage.ledamot_map": {"tf": 1.7320508075688772}, "riksdagen-persons.quality.qe_mp-coverage.skip": {"tf": 1.7320508075688772}, "riksdagen-persons.quality.qe_mp-coverage.is_within_tolerance": {"tf": 1.7320508075688772}, "riksdagen-persons.quality.qe_mp-coverage.get_spec": {"tf": 1.7320508075688772}, "riksdagen-persons.quality.qe_mp-coverage.mk_py": {"tf": 1.7320508075688772}, "riksdagen-persons.quality.qe_mp-coverage.get_ch": {"tf": 1.7320508075688772}, "riksdagen-persons.quality.qe_mp-coverage.get_baseline": {"tf": 1.7320508075688772}, "riksdagen-persons.quality.qe_mp-coverage.main": {"tf": 1.7320508075688772}, "riksdagen-persons.test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.ChairHog": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.ChairHog.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.ChairHog.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.ChairMissingFromRange": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.ChairMissingFromRange.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.ChairMissingFromRange.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.ChairOutOfRange": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.ChairOutOfRange.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.ChairOutOfRange.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.ChairYearOutOfRange": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.ChairYearOutOfRange.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.DuplicateIDWarning": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.DuplicateIDWarning.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.DuplicateIDWarning.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.EmptyChair": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.EmptyChair.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.EmptyChair.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.KnaMP": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.KnaMP.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.KnaMP.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.Test": {"tf": 5.656854249492381}, "riksdagen-persons.test.chairs.Test.get_chairs": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.Test.get_chair_mp": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.Test.get_mep": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.Test.get_riksdag_year": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.Test.get_max_chair": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.Test.get_oor_year": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_knaMP": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_chair_coverage": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db": {"tf": 2}, "riksdagen-persons.test.db.DuplicateWarning": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.DuplicateWarning.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.DuplicateWarning.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.MissingPersonWarning": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.MissingPersonWarning.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.MissingPersonWarning.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.MissingNameWarning": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.MissingNameWarning.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.MissingNameWarning.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.MissingLocationWarning": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.MissingLocationWarning.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.MissingLocationWarning.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.MissingMemberWarning": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.MissingMemberWarning.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.MissingMemberWarning.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.MissingPartyWarning": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.MissingPartyWarning.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.MissingPartyWarning.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.CatalogIntegrityWarning": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.CatalogIntegrityWarning.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.CatalogIntegrityWarning.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test": {"tf": 5.656854249492381}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.get_emil": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_government": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_minister": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_party_affiliation": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_person": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_speaker": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_twitter": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_session_dates": {"tf": 2}, "riksdagen-persons.test.mandates": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mandates.DateErrorWarning": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mandates.DateErrorWarning.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mandates.DateErrorWarning.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mandates.Test": {"tf": 5.656854249492381}, "riksdagen-persons.test.mandates.Test.fetch_known_mandate_dates": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mandates.Test.fetch_mep_meta": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mandates.Test.test_manually_checked_mandates": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Info": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Info.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Info.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 5.656854249492381}, "riksdagen-persons.test.mp-frequency-test.Test.write_err_df": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test.get_spec": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test.mk_py": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test.get_baseline": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test.get_ch": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test.is_within_tolerance": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test.preprocess_Corpus_metadata": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test.expand_dates_df": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test.test_mp_frequency": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Unlisted": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Unlisted.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Unlisted.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Info": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Info.__init__": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Info.message": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 5.656854249492381}, "riksdagen-persons.test.party-affiliation.Test.write_err_df": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Test.test_independent_mp": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Test.test_party": {"tf": 1.7320508075688772}}, "df": 129, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1, "e": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons": {"tf": 1.7320508075688772}, "riksdagen-persons.quality": {"tf": 1.4142135623730951}}, "df": 2}}}}}}}}, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "o": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}, "r": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons": {"tf": 1.4142135623730951}, "riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.test.party-affiliation": {"tf": 1}}, "df": 3}}}}}, "f": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}, "a": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}}, "s": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}}, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}}}}, "q": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}, "riksdagen-persons.test.db.Test.get_emil": {"tf": 1}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}}, "df": 4}}}}}, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons": {"tf": 1.7320508075688772}}, "df": 1}}, "w": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}, "riksdagen-persons.test.db.Test.test_government": {"tf": 1}}, "df": 2}}}, "u": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 6, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1.4142135623730951}}, "df": 1}}}}}, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons": {"tf": 4.242640687119285}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1}, "riksdagen-persons.test.db.Test.test_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}}, "df": 8, "s": {"docs": {"riksdagen-persons": {"tf": 1.4142135623730951}, "riksdagen-persons.quality": {"tf": 1.4142135623730951}}, "df": 2}}}}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons": {"tf": 2}, "riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.test.db.Test.get_emil": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1}}, "df": 5}}}}}}}, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}, "y": {"docs": {"riksdagen-persons": {"tf": 2}, "riksdagen-persons.test.db.Test.test_party_affiliation": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}, "riksdagen-persons.test.party-affiliation": {"tf": 1}}, "df": 4}, "s": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}, "g": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1, "s": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}, "r": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons": {"tf": 1.4142135623730951}}, "df": 1}}}}, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}}, "df": 1}}}}}, "o": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons": {"tf": 1.4142135623730951}}, "df": 1, "d": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}, "s": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1}}, "df": 1}}}}, "o": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1, "s": {"docs": {"riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.quality.qe_mp-coverage": {"tf": 1}}, "df": 2}}}}, "y": {"docs": {"riksdagen-persons.quality": {"tf": 1.7320508075688772}}, "df": 1, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}}}}, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.quality": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 7}}, "e": {"docs": {"riksdagen-persons": {"tf": 3}, "riksdagen-persons.quality": {"tf": 2.8284271247461903}, "riksdagen-persons.test.chairs.Test": {"tf": 3.872983346207417}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 3.872983346207417}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}, "riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}, "riksdagen-persons.test.mandates": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 3.872983346207417}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 3.872983346207417}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 3.872983346207417}}, "df": 21, "m": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}}}}}, "i": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}}, "df": 5}}, "s": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}, "a": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}, "riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}, "riksdagen-persons.test.mandates": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}}, "df": 16}, "n": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 6}}, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "w": {"docs": {"riksdagen-persons.test.db": {"tf": 1}}, "df": 1}}}}, "o": {"docs": {"riksdagen-persons": {"tf": 1.7320508075688772}, "riksdagen-persons.quality": {"tf": 2}, "riksdagen-persons.test.chairs.Test": {"tf": 2.23606797749979}, "riksdagen-persons.test.db.Test": {"tf": 2.23606797749979}, "riksdagen-persons.test.mandates.Test": {"tf": 2.23606797749979}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 2.23606797749979}, "riksdagen-persons.test.party-affiliation": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 2.23606797749979}}, "df": 8, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.mp-frequency-test": {"tf": 1}}, "df": 1}}}}}}}}, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.test.chairs": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 2.8284271247461903}, "riksdagen-persons.test.chairs.Test.test_chair_coverage": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 2.8284271247461903}, "riksdagen-persons.test.db.Test.test_government": {"tf": 1}, "riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1}, "riksdagen-persons.test.db.Test.test_minister": {"tf": 1}, "riksdagen-persons.test.db.Test.test_party_affiliation": {"tf": 1}, "riksdagen-persons.test.db.Test.test_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_speaker": {"tf": 1}, "riksdagen-persons.test.db.Test.test_twitter": {"tf": 1}, "riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}, "riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}, "riksdagen-persons.test.mandates": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 2.8284271247461903}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 2.8284271247461903}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 2.8284271247461903}}, "df": 23, "s": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}}, "df": 7}, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mandates.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.7320508075688772}}, "df": 5}}}}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.test.db.Test.test_twitter": {"tf": 1}}, "df": 2}}}}}, "o": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1}}, "df": 1}}, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}, "v": {"docs": {}, "df": 0, "\u00e5": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}}, "df": 1}}}}}}}}}}}}}, "a": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}}, "df": 1}}}}, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons": {"tf": 2}, "riksdagen-persons.quality": {"tf": 2.23606797749979}}, "df": 2}}}}}, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": null}, "riksdagen-persons.test.db.Test": {"tf": null}, "riksdagen-persons.test.mandates.Test": {"tf": null}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": null}, "riksdagen-persons.test.party-affiliation.Test": {"tf": null}}, "df": 5}}, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}}}, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}}, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.quality": {"tf": 2}, "riksdagen-persons.quality.qe_mp-coverage": {"tf": 1}}, "df": 3}}}}}}, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1}}, "df": 2, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}, "p": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}}, "d": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.quality": {"tf": 2}, "riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 6}}}, "s": {"docs": {}, "df": 0, "v": {"docs": {"riksdagen-persons": {"tf": 4.69041575982343}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}}, "df": 8}}, "h": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}}, "df": 6, "s": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_coverage": {"tf": 1}}, "df": 5}}}, "m": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons": {"tf": 1.4142135623730951}, "riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}}, "df": 3}}}}, "r": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs": {"tf": 1}}, "df": 1}, "e": {"docs": {"riksdagen-persons.test.chairs.Test.test_knaMP": {"tf": 1}}, "df": 1}}, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 6}}}}, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "k": {"docs": {"riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_knaMP": {"tf": 1}}, "df": 7, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.db.Test.get_emil": {"tf": 1}}, "df": 1}}}}}}, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.quality.qe_mp-coverage": {"tf": 1}}, "df": 1}}}}}}}, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.ChairHog": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info": {"tf": 1}}, "df": 19}}}}}}}, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}}, "df": 6}}}}}, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}}, "df": 5}}}, "n": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mandates.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.7320508075688772}}, "df": 5}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.ChairHog": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.DuplicateWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.DateErrorWarning": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Info": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Unlisted": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}}, "df": 24, "e": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {"riksdagen-persons": {"tf": 2.449489742783178}, "riksdagen-persons.quality": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.test_government": {"tf": 1}, "riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1}, "riksdagen-persons.test.db.Test.test_minister": {"tf": 1}, "riksdagen-persons.test.db.Test.test_party_affiliation": {"tf": 1}, "riksdagen-persons.test.db.Test.test_speaker": {"tf": 1}, "riksdagen-persons.test.db.Test.test_twitter": {"tf": 1}}, "df": 8, "/": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1, "s": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}}}, "e": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}}, "g": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}}}}, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}}, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}}, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}, "p": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons": {"tf": 1.4142135623730951}}, "df": 1}}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons": {"tf": 1.4142135623730951}}, "df": 1}}}}, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}}}, "i": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}, "t": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "i": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}, "f": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}}, "df": 1}}}}}}, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 1}}, "df": 1}}}}}}}}}}, "s": {"docs": {"riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates": {"tf": 1}}, "df": 2}}}, "y": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.mp-frequency-test": {"tf": 1}}, "df": 1}}}, "i": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons": {"tf": 1.7320508075688772}, "riksdagen-persons.quality": {"tf": 1}}, "df": 2}}}}}}}, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1, "s": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}}}}}}, "f": {"docs": {}, "df": 0, "f": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "b": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}, "t": {"docs": {}, "df": 0, "h": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}, "f": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}}}}}}, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}}, "df": 5}}}}}}}}, "e": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}, "o": {"docs": {"riksdagen-persons.test.mandates": {"tf": 1}}, "df": 1, "c": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}}}}}}}}, "s": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}, "u": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.db.Test.test_government": {"tf": 1}}, "df": 1, "s": {"docs": {"riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}, "riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1}, "riksdagen-persons.test.db.Test.test_minister": {"tf": 1}, "riksdagen-persons.test.db.Test.test_party_affiliation": {"tf": 1}, "riksdagen-persons.test.db.Test.test_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_speaker": {"tf": 1}, "riksdagen-persons.test.db.Test.test_twitter": {"tf": 1}}, "df": 8}}}}}}}}}, "f": {"docs": {"riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.get_emil": {"tf": 1}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}}, "df": 3}}, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}}, "df": 1, "s": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.test.db.Test.get_emil": {"tf": 1}}, "df": 2}}}}}, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.quality": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs": {"tf": 1}, "riksdagen-persons.test.db.Test.get_emil": {"tf": 1}, "riksdagen-persons.test.mandates": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1}}, "df": 6}}}}}, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 2.23606797749979}, "riksdagen-persons.test.db.Test": {"tf": 2.23606797749979}, "riksdagen-persons.test.mandates.Test": {"tf": 2.23606797749979}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 2.23606797749979}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 2.23606797749979}}, "df": 5, "s": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 2.449489742783178}, "riksdagen-persons.test.db.Test": {"tf": 2.449489742783178}, "riksdagen-persons.test.mandates.Test": {"tf": 2.449489742783178}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 2.449489742783178}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 2.449489742783178}}, "df": 5}}}}}, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5, "s": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}}, "df": 5}}}}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.db.Test.test_minister": {"tf": 1}}, "df": 1, "s": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}}, "p": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.quality": {"tf": 1.7320508075688772}, "riksdagen-persons.quality.qe_mp-coverage": {"tf": 1}, "riksdagen-persons.test.chairs": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1}, "riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 1}, "riksdagen-persons.test.mandates": {"tf": 1}}, "df": 9, "s": {"docs": {"riksdagen-persons.quality": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1}}, "df": 2}}, "a": {"docs": {}, "df": 0, "p": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1, "p": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.chairs": {"tf": 1}}, "df": 1}}}}}, "y": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}, "n": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}}, "df": 5}, "u": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons.test.mandates": {"tf": 1}}, "df": 1}}}}}}, "x": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}}, "df": 1, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "f": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "m": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}, "d": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}, "u": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}, "o": {"docs": {}, "df": 0, "f": {"docs": {"riksdagen-persons": {"tf": 2.8284271247461903}, "riksdagen-persons.quality": {"tf": 2}, "riksdagen-persons.test.chairs.Test": {"tf": 2.6457513110645907}, "riksdagen-persons.test.db.Test": {"tf": 2.6457513110645907}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.get_emil": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}, "riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 2.6457513110645907}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 2.6457513110645907}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 2.6457513110645907}}, "df": 13}, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}, "n": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 12, "c": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1}}, "df": 2}}, "e": {"docs": {"riksdagen-persons.test.chairs.Test.test_knaMP": {"tf": 1}}, "df": 1}}, "c": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}}, "df": 2}}}}, "r": {"docs": {"riksdagen-persons.test.db": {"tf": 1}}, "df": 1}}, "w": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}, "r": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}}, "df": 1, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}, "b": {"docs": {}, "df": 0, "j": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}, "s": {"docs": {"riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}}, "df": 6, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.db.Test.test_speaker": {"tf": 1}}, "df": 1, "s": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}, "c": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}}, "df": 2}}}, "y": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons": {"tf": 2.6457513110645907}}, "df": 1, "/": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.mandates": {"tf": 1}}, "df": 1}}}}}}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}, "t": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 6, "u": {"docs": {}, "df": 0, "p": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}, "s": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}, "a": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}}, "df": 1}}, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1.4142135623730951}}, "df": 1}}}}}}, "o": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons": {"tf": 1.4142135623730951}}, "df": 1}}}}}, "u": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}}}, "c": {"docs": {}, "df": 0, "h": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}, "b": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}}, "df": 5, "e": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 6}}}, "c": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}, "g": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}, "t": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1}}, "df": 1}}, "d": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.db": {"tf": 1}}, "df": 1}}}, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mandates.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.7320508075688772}}, "df": 5}}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.chairs.Test.test_knaMP": {"tf": 1}}, "df": 1}}}}}}, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}}, "df": 2}}}, "c": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}}, "df": 1}}}}}}}, "a": {"docs": {"riksdagen-persons": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test": {"tf": 2}, "riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_knaMP": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 2}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 2}, "riksdagen-persons.test.db.Test.get_emil": {"tf": 1}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test": {"tf": 2}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 2}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 2}}, "df": 14, "n": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5, "d": {"docs": {"riksdagen-persons": {"tf": 1.7320508075688772}, "riksdagen-persons.quality": {"tf": 1.7320508075688772}, "riksdagen-persons.quality.qe_mp-coverage": {"tf": 1}, "riksdagen-persons.test.chairs": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}}, "df": 13}, "y": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}, "s": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.7320508075688772}}, "df": 9, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}}, "df": 6, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}}, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}, "s": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}, "o": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}}}}}}, "b": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}}}}}, "f": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}}, "df": 2, "s": {"docs": {"riksdagen-persons.test.party-affiliation": {"tf": 1}}, "df": 1}}}}}}}}}}}, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}, "l": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_coverage": {"tf": 1}, "riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}}, "df": 2}}, "r": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_coverage": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.7320508075688772}}, "df": 12}, "g": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}}, "t": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1}}, "df": 3, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5, "s": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}}}, "d": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}, "c": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}}, "df": 1}}}}}}}}}}, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}, "l": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}}, "df": 6, "s": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.quality": {"tf": 1}}, "df": 2}}, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_coverage": {"tf": 1}}, "df": 2}}}}, "x": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}}, "df": 5}}}}}}, "o": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.quality": {"tf": 2}, "riksdagen-persons.test.chairs.ChairHog": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.DateErrorWarning": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Info": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Unlisted": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}}, "df": 27, "m": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 1}}, "df": 1}}}}}}}}, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "m": {"docs": {"riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}, "riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}}, "df": 3}}, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "k": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}}, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "l": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}}, "df": 5, "e": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}}}}}}, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}, "w": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "o": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1, "s": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}, "n": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mandates.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.7320508075688772}}, "df": 5}, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 6}}}}}, "a": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}, "i": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "i": {"docs": {"riksdagen-persons": {"tf": 1.7320508075688772}}, "df": 1}}, "t": {"docs": {}, "df": 0, "h": {"docs": {"riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1}}, "df": 3, "i": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1.4142135623730951}}, "df": 1}}}}, "l": {"docs": {}, "df": 0, "l": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mandates.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.7320508075688772}}, "df": 5}}}, "e": {"docs": {"riksdagen-persons.quality": {"tf": 1.4142135623730951}}, "df": 1}, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}, "r": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.db": {"tf": 1}}, "df": 1, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.chairs.ChairHog": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info": {"tf": 1}}, "df": 19}}}}}}, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}}, "df": 1}}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons": {"tf": 1.7320508075688772}, "riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 2.449489742783178}, "riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 2.449489742783178}, "riksdagen-persons.test.db.Test.test_government": {"tf": 1}, "riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1}, "riksdagen-persons.test.db.Test.test_minister": {"tf": 1}, "riksdagen-persons.test.db.Test.test_party_affiliation": {"tf": 1}, "riksdagen-persons.test.db.Test.test_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_speaker": {"tf": 1}, "riksdagen-persons.test.db.Test.test_twitter": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}, "riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}, "riksdagen-persons.test.mandates": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 2.449489742783178}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 2.449489742783178}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 2.449489742783178}}, "df": 27, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 6, "s": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}}}, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 1}}, "df": 2}}}}}}}, "i": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mandates.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.7320508075688772}}, "df": 6}}, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mandates.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.7320508075688772}}, "df": 5, "s": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}}, "df": 5}}}, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}}}}, "c": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.test.db": {"tf": 1}}, "df": 1}}}}}}}}}}}}}}, "d": {"docs": {"riksdagen-persons": {"tf": 5.196152422706632}}, "df": 1, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1, "s": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}}}}}, "s": {"docs": {"riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_id_sets": {"tf": 1}}, "df": 2}}, "t": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mandates.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.7320508075688772}}, "df": 5, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "f": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}, "f": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mandates.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.7320508075688772}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.7320508075688772}}, "df": 5}, "s": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 2}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_knaMP": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 2}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 2}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 2}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 2}}, "df": 12}, "m": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}}, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}}}, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.quality": {"tf": 1}}, "df": 2, "s": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}, "e": {"docs": {"riksdagen-persons.quality": {"tf": 1.4142135623730951}}, "df": 1, "s": {"docs": {"riksdagen-persons.quality": {"tf": 2.23606797749979}}, "df": 1}}}}}}}}, "n": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons": {"tf": 2.6457513110645907}}, "df": 1}, "v": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}}}, "k": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}}, "df": 1}}}}}}}}}, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}}, "df": 5}}}}, "x": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}}}}}, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}}, "df": 5}}}}}}}}, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"riksdagen-persons.quality": {"tf": 1.4142135623730951}}, "df": 1}}}, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.db": {"tf": 1}}, "df": 1, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}, "s": {"docs": {"riksdagen-persons.test.db": {"tf": 1}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}}, "df": 2}}}}}, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_member": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_party": {"tf": 1}}, "df": 6}}}}, "m": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "l": {"docs": {"riksdagen-persons.test.db.Test.get_emil": {"tf": 1}}, "df": 1}}}}, "q": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.quality": {"tf": 2.6457513110645907}}, "df": 2}}}}}}, "e": {"docs": {"riksdagen-persons.quality": {"tf": 1.4142135623730951}}, "df": 1}}, "n": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1}}, "df": 3, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}}, "df": 1}}}}}}}, "o": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_hogs": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_knaMP": {"tf": 1}, "riksdagen-persons.test.db.Test.test_government": {"tf": 1}, "riksdagen-persons.test.db.Test.test_member_of_parliament": {"tf": 1}, "riksdagen-persons.test.db.Test.test_minister": {"tf": 1}, "riksdagen-persons.test.db.Test.test_party_affiliation": {"tf": 1}, "riksdagen-persons.test.db.Test.test_person": {"tf": 1}, "riksdagen-persons.test.db.Test.test_speaker": {"tf": 1}, "riksdagen-persons.test.db.Test.test_twitter": {"tf": 1}}, "df": 12, "r": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}, "t": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 7}}, "r": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}}, "df": 2}, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_emil_name": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 8, "d": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 7}}}}}}}, "e": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons": {"tf": 1.4142135623730951}}, "df": 1}}, "n": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "w": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1, "n": {"docs": {"riksdagen-persons.test.db.Test.test_emil_integrity": {"tf": 1}, "riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}, "riksdagen-persons.test.mandates": {"tf": 1}}, "df": 3}}}}}, "y": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons": {"tf": 1.7320508075688772}, "riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}}, "df": 3}}}, "o": {"docs": {}, "df": 0, "u": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}, "b": {"docs": {}, "df": 0, "y": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 2.23606797749979}, "riksdagen-persons.test.db.Test": {"tf": 2.23606797749979}, "riksdagen-persons.test.db.Test.get_emil": {"tf": 1}, "riksdagen-persons.test.db.Test.get_meta_df": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 2.23606797749979}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 2.23606797749979}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 2.23606797749979}}, "df": 8}, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}, "i": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}, "b": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "x": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}, "u": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}}}}}, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.ChairHog": {"tf": 1}, "riksdagen-persons.test.chairs.ChairInWrongTimePeriod": {"tf": 1}, "riksdagen-persons.test.chairs.ChairMissingFromRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.ChairYearOutOfRange": {"tf": 1}, "riksdagen-persons.test.chairs.DuplicateIDWarning": {"tf": 1}, "riksdagen-persons.test.chairs.EmptyChair": {"tf": 1}, "riksdagen-persons.test.chairs.KnaMP": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.DuplicateWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPersonWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingNameWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingLocationWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingMemberWarning": {"tf": 1}, "riksdagen-persons.test.db.MissingPartyWarning": {"tf": 1}, "riksdagen-persons.test.db.CatalogIntegrityWarning": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.DateErrorWarning": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Info": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Unlisted": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Info": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 24}}}, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 3}, "riksdagen-persons.test.db.Test": {"tf": 3}, "riksdagen-persons.test.mandates.Test": {"tf": 3}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 3}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 3}}, "df": 5, "e": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.mandates": {"tf": 1}}, "df": 1}}}}, "v": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1, "u": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}}}, "a": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}}, "df": 1}}, "i": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.mandates": {"tf": 1}}, "df": 1}}}}}}}, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}}, "df": 1}}}}, "g": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons": {"tf": 1.7320508075688772}, "riksdagen-persons.test.db.Test.test_government": {"tf": 1}}, "df": 2}}}}}}}}}, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons": {"tf": 1}}, "df": 1}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}, "e": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.quality.qe_mp-coverage": {"tf": 1}}, "df": 1}}}}}}}, "t": {"docs": {"riksdagen-persons.test.chairs.Test.what_time_it_is": {"tf": 1}}, "df": 1}}, "i": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}}, "df": 1}}}}}, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"riksdagen-persons": {"tf": 1}, "riksdagen-persons.test.db.Test.test_cf_known_iorter_metadata": {"tf": 1.4142135623730951}}, "df": 2}}}}}}, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}}}}}, "o": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "k": {"docs": {"riksdagen-persons": {"tf": 1.4142135623730951}}, "df": 1}}, "s": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.chairs.Test.get_duplicated_items": {"tf": 1}, "riksdagen-persons.test.db.Test.write_error_df": {"tf": 1}}, "df": 2}}}, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range_for_year": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1}}, "df": 2}}}}}, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}, "a": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.quality": {"tf": 1}, "riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 8}}, "n": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.test.db.Test.get_emil": {"tf": 1}}, "df": 1}}}, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"riksdagen-persons.test.chairs.Test.test_chair_nrs_in_range": {"tf": 1}}, "df": 1}}}}}}, "u": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"riksdagen-persons.quality": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.chairs.Test.test_chair_chambertime_concurrence": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mandates.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1.4142135623730951}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1.4142135623730951}}, "df": 7}, "f": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {"riksdagen-persons.test.db.Test.test_session_dates": {"tf": 1}}, "df": 1}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5}}}}, "p": {"docs": {"riksdagen-persons.test.chairs.Test": {"tf": 1}, "riksdagen-persons.test.db.Test": {"tf": 1}, "riksdagen-persons.test.mandates.Test": {"tf": 1}, "riksdagen-persons.test.mp-frequency-test.Test": {"tf": 1}, "riksdagen-persons.test.party-affiliation.Test": {"tf": 1}}, "df": 5, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {"riksdagen-persons.test.db": {"tf": 1}}, "df": 1}}}}}}}, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "q": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "e": {"docs": {"riksdagen-persons.test.chairs.Test.test_unique_chair_id": {"tf": 1}, "riksdagen-persons.test.db.Test.get_duplicates": {"tf": 1}}, "df": 2}}}}}}, "j": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "s": {"docs": {"riksdagen-persons.quality": {"tf": 1}}, "df": 1}}}}}}}}}}}}}}}}}, "pipeline": ["trimmer"], "_isPrebuiltIndex": true}; + + // mirrored in build-search-index.js (part 1) + // Also split on html tags. this is a cheap heuristic, but good enough. + elasticlunr.tokenizer.setSeperator(/[\s\-.;&_'"=,()]+|<[^>]*>/); + + let searchIndex; + if (docs._isPrebuiltIndex) { + console.info("using precompiled search index"); + searchIndex = elasticlunr.Index.load(docs); + } else { + console.time("building search index"); + // mirrored in build-search-index.js (part 2) + searchIndex = elasticlunr(function () { + this.pipeline.remove(elasticlunr.stemmer); + this.pipeline.remove(elasticlunr.stopWordFilter); + this.addField("qualname"); + this.addField("fullname"); + this.addField("annotation"); + this.addField("default_value"); + this.addField("signature"); + this.addField("bases"); + this.addField("doc"); + this.setRef("fullname"); + }); + for (let doc of docs) { + searchIndex.addDoc(doc); + } + console.timeEnd("building search index"); + } + + return (term) => searchIndex.search(term, { + fields: { + qualname: {boost: 4}, + fullname: {boost: 2}, + annotation: {boost: 2}, + default_value: {boost: 2}, + signature: {boost: 2}, + bases: {boost: 2}, + doc: {boost: 1}, + }, + expand: true + }); +})(); \ No newline at end of file diff --git a/quality/README.md b/quality/README.md new file mode 100644 index 0000000..fbec8bd --- /dev/null +++ b/quality/README.md @@ -0,0 +1,36 @@ +# Riksdagen Persons: Quality Estimates + +This directory contains code and data related to estimating the quality of the Riksdagen Persons metadata corpus, along with the estimates themselves. + +## What's here? + +### `./` + +Python code used to estimate various quality dimensions. + +- `qe_mp-coverage.py` : Estimates coverage of MPs over time + + +Support files + +- `README.md` : this file +- `__init__.py` : used for building the documentation + + +### `data/` + +Contains data necessary to run the quality estimation code. + + +### `docs/` + +Contains explanation and justifications for each quality dimension. + + +### `estimates/` + +Contains versioned output of quality estimations. + +### `plot/` + +Contains code for generating plots from the estimate results diff --git a/quality/docs/qe_mp-coverage.md b/quality/docs/qe_mp-coverage.md new file mode 100644 index 0000000..92ea970 --- /dev/null +++ b/quality/docs/qe_mp-coverage.md @@ -0,0 +1,20 @@ +# MP Coverage + +## Summary + +We want to know that we have the correct number of MPs in the metadata for each parliament year and chamber. + + +## What is the problem + +It's straightforward to add known information to a database, but less so to estimate information that is missing. In this case we want to make sure that we have enough MPs per parliament year and chamber, but also not too many. Since there are a fixed number of seats in the parliament, we have a fixed baseline against which we can check that we have an adequate number of MPs for each day of conducted parliament business. + + +## Estimation procedure + +An extensive list of MPs and their mandate periods have been compiled using Wikidata, Riksdagen Öppna data, and Biografi Banden with the help of students at Uppsala University and experts at the Riksdagenbibliotek. + +For each parliament day (date for which there is a Record), this dimension checks the number of MPs with an overlapping mandate and compares that number with the baseline number of MPs who should have been sitting in the parliament. + + +## The code diff --git a/quality/estimates/mp-coverage/coverage-summary.txt b/quality/estimates/mp-coverage/coverage-summary.txt new file mode 100644 index 0000000..85ebf1b --- /dev/null +++ b/quality/estimates/mp-coverage/coverage-summary.txt @@ -0,0 +1,2 @@ +Of 34516 parliament days, 8122 have correct N MPs in metadata: 0.23531116004171979. + 33783 pass or almost passed within the margin of error, i.e. +- 10%: 0.9787634720129795. diff --git a/quality/estimates/mp-coverage/mp-coverage-ratio.png b/quality/estimates/mp-coverage/mp-coverage-ratio.png new file mode 100644 index 0000000..008737b Binary files /dev/null and b/quality/estimates/mp-coverage/mp-coverage-ratio.png differ diff --git a/quality/estimates/mp-coverage/mp-coverage.csv b/quality/estimates/mp-coverage/mp-coverage.csv new file mode 100644 index 0000000..16edd2a --- /dev/null +++ b/quality/estimates/mp-coverage/mp-coverage.csv @@ -0,0 +1,156 @@ +year,v0.10.0,v0.12.0,v0.14.0,v1.0.0rc5,v1.0.0,v1.1.0,v0.0.0 +1867,1.0092764542936283,0.9993484764542936,0.9984986149584488,0.9984986149584488,0.9984986149584488,0.9984986149584488,0.9984986149584487 +1868,1.002579222926426,1.002579222926426,1.0010721961972997,1.0010721961972997,1.0010721961972997,1.0010721961972997,1.0010721961972997 +1869,0.9916618188869498,0.989947409860562,0.9860839457313326,0.9860839457313326,0.9860839457313326,0.9860839457313326,0.9860839457313326 +1870,1.0184555365825738,1.0120925317013432,1.0004902660241988,1.0004902660241988,1.0004902660241988,1.0004902660241988,1.0004902660241988 +1871,1.0414319558412433,1.0294014326945504,1.025997548609279,1.025997548609279,1.025997548609279,1.025997548609279,1.025997548609279 +1872,1.00839672033982,1.0111626988047022,0.9977781227410782,0.9977781227410782,0.9977781227410782,0.9977781227410782,0.9977781227410782 +1873,0.9991341817010309,1.0014967246563575,0.9962299030436916,0.9962299030436916,0.9962299030436916,0.9962299030436916,0.9962299030436916 +1874,1.0191204016675115,1.0104034631851728,1.0054746035434623,1.0054746035434623,1.0054746035434623,1.0054746035434623,1.0054746035434623 +1875,1.0033112013210403,0.9996462318242282,0.9934515618549608,0.9934515618549608,0.9934515618549608,0.9934515618549608,0.9934515618549609 +1876,0.9981960985563024,0.9946363944072694,0.991794394986442,0.991794394986442,0.991794394986442,0.991794394986442,0.991794394986442 +1877,1.0043177523683504,0.997894570628932,0.996107759277054,0.996107759277054,0.996107759277054,0.996107759277054,0.996107759277054 +1878,1.018034446984295,1.0099378864875754,1.0055816362514325,1.0055816362514325,1.0055816362514325,1.0055816362514325,1.0055816362514325 +1879,1.0093485481624342,1.0026786670952532,0.9991963998714236,0.9991963998714236,0.9991963998714236,0.9991963998714236,0.9991963998714237 +1880,1.0154621848739496,0.998935574229692,0.9970448179271711,0.9970448179271708,0.9970448179271708,0.9970448179271708,0.9970448179271708 +1881,1.0133998855016455,1.007597901597472,1.0021197792236864,1.0021197792236864,1.0021197792236864,1.0021197792236864,1.0021197792236864 +1882,1.000976922509769,0.9974931799749316,0.9936420401305952,0.9936420401305952,0.9936420401305952,0.9936420401305952,0.9936420401305952 +1883,1.0132178489287251,1.0010549688407768,0.9988960469406888,0.998896046940689,0.998896046940689,0.998896046940689,0.998896046940689 +1884,1.0070709146968138,1.0026310380267214,0.9957489098873468,0.9957489098873468,0.9957489098873468,0.9957489098873468,0.9957489098873469 +1885,1.0150900870052215,1.0100253086729762,1.0052660454399494,1.0052660454399494,1.0052660454399494,1.0052660454399494,1.0052660454399494 +1886,1.0222699048466737,1.0119588022124737,1.0051783330154491,1.0051783330154491,1.0051783330154491,1.0051783330154491,1.0051783330154493 +1887,1.1866438152130312,1.153742885399828,1.1285553141545293,1.1285553141545293,1.1309046713084507,1.1309046713084507,1.1309046713084507 +1888,1.0130208333333333,1.0023138372747749,0.9962003018643644,0.9962003018643644,0.9962003018643644,0.9962003018643644,0.9962003018643643 +1889,1.0182457163385694,1.0057144989335318,1.003935085152577,1.003935085152577,1.003935085152577,1.003935085152577,1.003935085152577 +1890,1.0175356758078695,1.011961392794115,1.0061400725744083,1.0061400725744083,1.0061400725744083,1.0061400725744083,1.0061400725744085 +1891,1.0045830869308103,0.9953223749582624,0.9941909348008868,0.9941909348008864,0.9941909348008864,0.9941909348008864,0.9941909348008865 +1892,1.0829600219369284,1.0621806784535035,1.059308205320558,1.059308205320558,1.059308205320558,1.059308205320558,1.059308205320558 +1893,1.0031014621178556,1.0,0.993402591547544,0.993402591547544,0.993402591547544,0.993402591547544,0.9934025915475441 +1894,1.0045637743006166,1.00019845392406,0.999936068534531,0.999936068534531,0.999936068534531,0.999936068534531,0.999936068534531 +1895,0.9944082125603868,0.9897433574879227,0.9896316425120774,0.9896316425120774,0.9896316425120774,0.9896316425120774,0.9896316425120774 +1896,0.9952569169960476,0.9952569169960476,0.9908780903665816,0.9908780903665816,0.9908780903665816,0.9908780903665816,0.9908780903665815 +1897,1.0045217391304346,1.0009565217391303,0.999459420289855,0.999459420289855,0.999459420289855,0.999459420289855,0.999459420289855 +1898,1.0068460245015611,0.997717991832813,0.996777964608856,0.996777964608856,0.996777964608856,0.996777964608856,0.9967779646088559 +1899,1.0031999999999996,0.9987809523809524,0.9945722567287788,0.9945722567287784,0.9945722567287784,0.9945722567287784,0.9945722567287785 +1900,1.0021291448516578,0.9953608012747552,0.9941361256544502,0.9941361256544502,0.9941361256544502,0.9941361256544502,0.9941361256544502 +1901,1.0052759197324417,1.0000515607580824,0.9989506688963208,0.998950668896321,0.998950668896321,0.998950668896321,0.998950668896321 +1902,0.9977287475665152,0.9968332251784556,0.9923498449780084,0.9923498449780084,0.9923498449780084,0.9923498449780084,0.9923498449780084 +1903,1.011713554987212,1.0041943734015348,1.0036968146942573,1.0036968146942573,1.0036968146942573,1.0036968146942573,1.0036968146942573 +1904,1.0119267734553774,1.0050587337909995,1.00457055682685,1.00457055682685,1.00457055682685,1.00457055682685,1.00457055682685 +1905,1.05569200132758,1.0234561345281556,1.0201084190729062,1.0201084190729062,1.0201084190729062,1.0201084190729062,1.0201084190729062 +1906,1.0065144596651447,1.0001230891403612,0.9992257296009528,0.9992257296009528,0.9992257296009528,0.9992257296009528,0.9992257296009529 +1907,1.0165064102564103,1.0027313266443705,1.0007079152731326,1.0007079152731326,1.0007079152731326,1.0007079152731326,1.0007079152731326 +1908,1.0038830584707648,0.9944677661169417,0.9894202898550724,0.9894202898550724,0.9894202898550724,0.9894202898550724,0.9894202898550725 +1909,1.0144544708777687,1.0016570959803115,1.0001736395952965,1.0001736395952965,1.0001736395952965,1.0001736395952965,1.0001736395952965 +1910,1.0072514619883042,0.994830917874396,0.993335875921688,0.9933358759216884,0.9933358759216884,0.9933358759216884,0.9933358759216883 +1911,1.0047554347826089,0.9909756728778468,0.979138198757764,0.979138198757764,0.979138198757764,0.979138198757764,0.979138198757764 +1912,1.0054901120868136,1.003005640037124,0.9922224601984722,0.9922224601984722,0.9922224601984722,0.9922224601984722,0.9922224601984722 +1913,1.0184476650563608,1.0020354267310787,1.0002950080515296,1.0002950080515296,1.0002950080515296,1.0002950080515296,1.0002950080515296 +1914,1.1364444444444446,1.0966395215090867,1.0927784679089028,1.0927784679089028,1.0927784679089028,1.0927784679089028,1.0927784679089028 +1915,1.0142486651411131,1.0032773963895243,1.001018306636155,1.001018306636155,1.001018306636155,1.001018306636155,1.0010183066361553 +1916,1.0241841004184105,1.001492935540598,1.0001261294039172,1.000126129403917,1.000126129403917,1.000126129403917,1.000126129403917 +1917,1.004080826970028,0.9913157758038544,0.9888608383980052,0.9888608383980054,0.9888608383980054,0.9888608383980054,0.9888608383980054 +1918,1.0243478260869563,0.99836427291972,0.9940180752320468,0.9940180752320468,0.9940180752320468,0.9940180752320468,0.9940180752320469 +1919,1.27045694799659,1.211380221653879,1.184835464620631,1.1848354646206307,1.1848354646206307,1.1848354646206307,1.1848354646206307 +1920,1.0114333800841515,0.983619448340346,0.9773782141187471,0.9773782141187471,0.9773782141187471,0.9773782141187471,0.9773782141187473 +1921,0.960986974866997,0.9545453433620746,0.9254497645691924,0.9254497645691924,0.9277245765303004,0.9277245765303004,0.9277245765303004 +1922,1.0034594391116132,0.999189409624192,0.9952682100508186,0.9952682100508184,0.9976962168266512,0.9976962168266512,0.9976962168266513 +1923,0.9982665809952168,0.9975569358178056,0.9967601913329048,0.9967601913329048,0.999073320482616,0.999073320482616,0.9990733204826159 +1924,1.0096078431372546,1.0003282182438191,0.9872605853935776,0.9872605853935776,0.9872605853935776,0.9872605853935776,0.9872605853935776 +1925,1.0077272727272724,0.9971541501976288,0.9933399209486168,0.9933399209486168,0.9933399209486168,0.9933399209486168,0.9933399209486169 +1926,1.0034447600320442,0.9975442429539,0.9959944650790182,0.9959944650790185,0.9959944650790185,0.9959944650790185,0.9959944650790185 +1927,1.0011879552451752,0.9966118495156566,0.9948411804460464,0.9948411804460464,0.9948411804460464,0.9948411804460464,0.9948411804460463 +1928,1.0120798239623645,0.9935624857728202,0.9858046892783972,0.9858046892783976,0.9858046892783976,0.9858046892783976,0.9858046892783976 +1929,1.010537084398977,1.0015302642796249,1.0001477692526284,1.0001477692526284,1.0001477692526284,1.0001477692526284,1.0001477692526284 +1930,1.0025928329367657,0.997747494411998,0.994443723411926,0.994443723411926,0.994443723411926,0.994443723411926,0.9944437234119259 +1931,1.0081159420289854,0.9939159713072758,0.9909427609427608,0.9909427609427608,0.9909427609427608,0.9909427609427608,0.9909427609427609 +1932,1.0025008983111754,0.9941717570966584,0.9842627859623908,0.9842627859623908,0.9842627859623908,0.9842627859623908,0.9842627859623908 +1933,1.0086714975845406,0.9994469870327994,0.9968014238494788,0.9968014238494788,0.9968014238494788,0.9968014238494788,0.9968014238494788 +1934,1.007646176911544,1.0003926608124507,0.9960019990004996,0.9960019990004996,0.9960019990004996,0.9960019990004996,0.9960019990004996 +1935,1.00551828847481,0.9969979296066253,0.9929661835748792,0.9929661835748792,0.9929661835748792,0.9929661835748792,0.9929661835748793 +1936,1.010185185185185,1.0025577026301666,0.9914747718733226,0.9914747718733228,0.994622920021471,0.994622920021471,0.994622920021471 +1937,1.0120923913043478,1.0003925120772947,0.9905480072463768,0.9905480072463768,0.9905480072463768,0.9905480072463768,0.9905480072463767 +1938,1.0109281875915972,1.003634587200782,1.001029148347175,1.001029148347175,1.001029148347175,1.001029148347175,1.001029148347175 +1939,1.0255583972719522,1.0129641943734016,0.998311167945439,0.998311167945439,0.998311167945439,0.998311167945439,0.998311167945439 +1940,1.0184829431438125,1.0016927536231883,0.998485618729097,0.998485618729097,0.998485618729097,0.998485618729097,0.998485618729097 +1941,1.007402188233946,0.9931912699776594,0.9893693074411408,0.989369307441141,0.989369307441141,0.989369307441141,0.989369307441141 +1942,1.0220653859116955,0.995557802494102,0.9939507920458376,0.9939507920458376,0.9942298618132795,0.9942298618132795,0.9942298618132795 +1943,1.02516008155618,1.00603515732628,1.004907698242134,1.0049076982421337,1.0049076982421337,1.0049076982421337,1.0049076982421337 +1944,1.0098550724637676,1.0014385839866953,0.9993252554050844,0.9993252554050844,0.9993252554050844,0.9993252554050844,0.9993252554050843 +1945,1.00256543370106,1.0013941163746485,0.9987583820030284,0.9987583820030284,0.9987583820030284,0.9987583820030284,0.9987583820030284 +1946,1.0168,1.0067014492753623,1.0056389986824767,1.0056389986824767,1.0056389986824767,1.0056389986824767,1.0056389986824767 +1947,1.0080434782608696,1.0042973602484475,1.0035015527950313,1.0035015527950313,1.0035015527950313,1.0035015527950313,1.0035015527950313 +1948,1.0122918891431478,1.0001057716755657,0.99832901093313,0.99832901093313,0.99832901093313,0.99832901093313,0.9983290109331299 +1949,1.015755233494364,1.0085281803542672,1.0063999999999995,1.0063999999999995,1.0063999999999995,1.0063999999999995,1.0063999999999997 +1950,1.0146255557480224,1.0014053929210691,0.9999780587793752,0.9999780587793752,0.9999780587793752,0.9999780587793752,0.9999780587793751 +1951,1.004273504273504,1.0017069243156198,0.9990164746686488,0.9990164746686488,0.9990164746686488,0.9990164746686488,0.9990164746686487 +1952,1.002087215320911,1.0029399585921326,0.9976436335403726,0.9976436335403728,0.9976436335403728,0.9976436335403728,0.9976436335403728 +1953,1.0010832832431709,1.0030414746543777,0.9955413076871704,0.99554130768717,0.99554130768717,0.99554130768717,0.9955413076871701 +1954,1.0172288295314225,1.0084083966985118,1.0037720153376226,1.0037720153376224,1.0037720153376224,1.0037720153376224,1.0037720153376224 +1955,1.001883425099677,1.0007050186697042,0.9963141573318144,0.9963141573318144,0.9963141573318144,0.9963141573318144,0.9963141573318145 +1956,1.0028961748633878,0.997424566405322,0.9947398431931574,0.9947398431931574,0.9947398431931574,0.9947398431931574,0.9947398431931574 +1957,1.012068808384598,0.994999620262778,0.9881651097440572,0.9881651097440572,0.9881651097440572,0.9881651097440572,0.9881651097440571 +1958,1.0679751900760304,1.052688711848376,1.049230601331442,1.0492306013314414,1.0492306013314414,1.0492306013314414,1.0492306013314414 +1959,1.0047166821273965,0.9970980210265924,0.9961815862708718,0.996181586270872,0.996181586270872,0.996181586270872,0.9961815862708719 +1960,1.005221238938053,0.998395586714171,0.9963575067999848,0.9963575067999848,0.9963575067999848,0.9963575067999848,0.9963575067999849 +1961,0.99124299984706,0.9890388551699,0.987622064021152,0.987622064021152,0.987622064021152,0.987622064021152,0.9876220640211519 +1962,1.0010798100872558,0.9886498457224492,0.987867039836004,0.9878670398360038,0.9878670398360038,0.9878670398360038,0.9878670398360038 +1963,0.9831705847477344,0.9908531649668122,0.9895156889422092,0.9895156889422092,0.9895156889422092,0.9895156889422092,0.9895156889422091 +1964,1.005824364307912,0.989590883366264,0.9869727801662084,0.9869727801662084,0.9869727801662084,0.9869727801662084,0.9869727801662083 +1965,0.9907461423034896,0.987789404508828,0.9849738886072807,0.9849738886072807,0.9849738886072807,0.9849738886072807,0.9849738886072809 +1966,0.9946100001808724,0.991377662968068,0.9909414345029866,0.9909414345029866,0.9909414345029866,0.9909414345029866,0.9909414345029866 +1967,0.9855259393481964,0.9885811847999753,0.9649103716522018,0.9649103716522018,0.9649103716522018,0.9649103716522018,0.9649103716522018 +1968,0.9998874333725184,0.9902676386588763,0.9876588738388818,0.9876588738388818,0.9876588738388818,0.9876588738388818,0.9876588738388818 +1969,0.9901307230983496,0.9908583472350064,0.9873875932213764,0.9873875932213764,0.9873875932213764,0.9873875932213764,0.9873875932213764 +1970,0.993537565980958,0.9898297494991432,0.9754859185628552,0.9754859185628554,0.9759933910959044,0.9759933910959044,0.9759933910959045 +1971,1.0007892659826363,1.001049723756906,1.0007892659826363,1.0007892659826363,1.0007892659826363,1.0007892659826363,1.0007892659826363 +1972,1.0045158488927486,1.0054884932696482,1.0045158488927486,1.0045158488927486,1.0045158488927486,1.0045158488927486,1.0045158488927486 +1973,1.002826254826255,1.0057142857142856,1.002764478764479,1.002764478764479,1.002764478764479,1.002764478764479,1.002764478764479 +1974,0.988044733044733,1.0016017316017316,0.988044733044733,0.988044733044733,0.988044733044733,0.988044733044733,0.988044733044733 +1975,1.005127445168939,1.0069531713100175,1.0039774748073504,1.003977474807351,1.003977474807351,1.003977474807351,1.0039774748073507 +1976,1.005948673227856,1.024464307960633,1.0039398280802292,1.0039398280802292,1.0039398280802292,1.0039398280802292,1.0039398280802292 +1977,1.0008808610163311,1.0040499357072707,1.003058383629011,1.003058383629011,1.003058383629011,1.003058383629011,1.003058383629011 +1978,1.0079934085123652,1.0064869584465734,1.000811638402794,1.000811638402794,1.0025578907239567,1.0025578907239567,1.0025578907239567 +1979,1.009468045346954,1.0263712243904095,1.005113424012141,1.0051134240121409,1.007644653838749,1.007644653838749,1.0076446538387487 +1980,1.0077001759858704,1.0109657621712973,1.0071093208978457,1.0071093208978457,1.009803111836797,1.009803111836797,1.009803111836797 +1981,1.012532418457724,1.0142396546380823,1.007927230417077,1.007927230417077,1.0135056518216865,1.0135056518216865,1.0135056518216865 +1982,1.0076274264498166,1.0281228920802754,1.0029229820181835,1.0029229820181838,1.0029921650245313,1.0029921650245313,1.0029921650245313 +1983,1.006,1.0092091690544411,1.006,1.006,1.006,1.006,1.006 +1984,1.01048351661953,1.0114984497515271,1.0081380309059518,1.0081380309059516,1.0081504081392687,1.0081504081392687,1.0081504081392687 +1985,1.00995357915942,1.019525531462319,1.0078452471815915,1.0078452471815915,1.0106480149147286,1.0106480149147286,1.0106480149147286 +1986,1.008907437398779,1.009709418213529,1.008907437398779,1.008907437398779,1.008907437398779,1.008907437398779,1.008907437398779 +1987,1.006929027401154,1.0094794011230863,1.006929027401154,1.006929027401154,1.006929027401154,1.006929027401154,1.006929027401154 +1988,1.0037317914314638,1.024012147624522,1.0037317914314638,1.0037317914314636,1.0037317914314636,1.0037317914314636,1.0037317914314636 +1989,1.0048836748301526,1.0036942927681969,1.0030094970355554,1.0030094970355554,1.0031176226775516,1.0031176226775516,1.0031176226775516 +1990,1.0060416250194353,1.0064192265831502,1.005042091468426,1.005042091468426,1.00790742098132,1.00790742098132,1.00790742098132 +1991,1.0018049319766262,1.009002098233423,0.998939602463732,0.9989396024637324,0.998984725763148,0.998984725763148,0.9989847257631479 +1992,1.0005590886854427,1.0010482912852052,0.9995107974002376,0.9995107974002376,1.0023761269131315,1.0023761269131315,1.0023761269131315 +1993,0.999404011461318,1.0017879656160458,0.999404011461318,0.999404011461318,0.999404011461318,0.999404011461318,0.999404011461318 +1994,0.999365869697966,1.0093475503781295,0.999365869697966,0.999365869697966,0.999365869697966,0.999365869697966,0.999365869697966 +1995,0.9993771022798056,1.0000498318176156,0.9993771022798056,0.9993771022798056,0.9993771022798056,0.9993771022798056,0.9993771022798057 +1996,0.9998314512051238,1.0,0.9998314512051238,0.999831451205124,0.999831451205124,0.999831451205124,0.999831451205124 +1997,0.9999295410775518,1.0000234863074828,0.9999295410775518,0.9999295410775518,0.9999295410775518,0.9999295410775518,0.9999295410775518 +1998,0.9997441670077772,1.0093379042161277,0.9997441670077772,0.9997441670077774,0.9997441670077774,0.9997441670077774,0.9997441670077774 +1999,0.9999328438395416,1.000044770773639,0.9999328438395416,0.9999328438395416,0.9999328438395416,0.9999328438395416,0.9999328438395416 +2000,0.999751821853214,1.0,0.999751821853214,0.999751821853214,0.999751821853214,0.999751821853214,0.999751821853214 +2001,0.9997707736389684,1.0000916905444126,0.9997707736389684,0.9997707736389684,0.9997707736389684,0.9997707736389684,0.9997707736389685 +2002,1.001150829066654,1.0083611254638547,0.9992719244680353,0.9992719244680353,0.9992719244680353,0.9992719244680353,0.9992719244680351 +2003,1.0007484069623231,1.0028225634007617,1.002394902279434,1.0023949022794338,1.0023949022794338,1.0023949022794338,1.0023949022794338 +2004,0.9997015281757404,1.002865329512894,1.0025668576886342,1.0025668576886342,1.0025668576886342,1.0025668576886342,1.0025668576886342 +2005,0.9997035866021146,1.0028455686197018,1.0025689161150082,1.0025689161150084,1.0025689161150084,1.0025689161150084,1.0025689161150084 +2006,0.9992204618236978,1.010639642676555,1.002085791336592,1.002085791336592,1.002085791336592,1.002085791336592,1.002085791336592 +2007,0.9997982162314862,1.0029460430202997,1.0026635457443809,1.0026635457443809,1.0026635457443809,1.0026635457443809,1.0026635457443807 +2008,0.9998577495986508,1.0028653295128942,1.002723079111545,1.002723079111545,1.002723079111545,1.002723079111545,1.002723079111545 +2009,0.999824571662476,1.0028458374753917,1.0026899011753698,1.0026899011753698,1.0026899011753698,1.0026899011753698,1.0026899011753698 +2010,0.9994179799426934,1.011103151862464,1.0022833094555872,1.0022833094555872,1.0022833094555872,1.0022833094555872,1.0022833094555872 +2011,0.9995292672943102,1.002865329512894,1.0023945968072043,1.0023945968072043,1.0023945968072043,1.0023945968072043,1.0023945968072043 +2012,0.9996207652115288,1.0028863981122536,1.0024860947244223,1.0024860947244227,1.0024860947244227,1.0024860947244227,1.0024860947244227 +2013,0.9996364880468714,1.0028225634007617,1.002501817559766,1.002501817559766,1.002501817559766,1.002501817559766,1.002501817559766 +2014,0.999487502038344,1.0116476809467234,1.0023528315512382,1.002352831551238,1.002352831551238,1.002352831551238,1.002352831551238 +2015,0.9997795900374696,1.0028873705091472,1.002644919550364,1.0026449195503635,1.0026449195503635,1.0026449195503635,1.0026449195503637 +2016,0.9995723388786724,1.002908095625027,1.002437668391567,1.0024376683915668,1.0024376683915668,1.0024376683915668,1.0024376683915668 +2017,0.9995964324629728,1.0029056862665968,1.002461761975867,1.002461761975867,1.002461761975867,1.002461761975867,1.002461761975867 +2018,0.9993348342202212,1.012459066721244,1.0022001637331148,1.0022001637331148,1.0022001637331148,1.0022001637331148,1.0022001637331148 +2019,0.9998451173236274,1.002865329512894,1.0027104468365216,1.0027104468365216,1.0027104468365216,1.0027104468365216,1.0027104468365216 +2020,0.9997279750462442,1.0028653295128942,1.0025933045591384,1.0025933045591382,1.0025933045591382,1.0025933045591382,1.0025933045591382 +2021,1.2331611445175348,0.93205610802105,1.003571572702692,1.003571572702692,1.003571572702692,1.002421405222164,1.002421405222164 diff --git a/quality/estimates/mp-coverage/mp-coverage.png b/quality/estimates/mp-coverage/mp-coverage.png new file mode 100644 index 0000000..2c02ee3 Binary files /dev/null and b/quality/estimates/mp-coverage/mp-coverage.png differ diff --git a/quality/plot/mp-coverage/mp-coverage.py b/quality/plot/mp-coverage/mp-coverage.py new file mode 100644 index 0000000..9de2674 --- /dev/null +++ b/quality/plot/mp-coverage/mp-coverage.py @@ -0,0 +1,147 @@ +#!/usr/bin/env python3 +""" +Plots MP coverage per year/chamber/session +""" +import argparse +import matplotlib.pyplot as plt +import os +import pandas as pd +import re + + +skip = [ + 'prot-1909----reg-01.xml', + 'prot-1909----reg-02.xml', + 'prot-197677--.xml', + 'prot-197778--.xml', +] # these were "test" protocols & break code :| + + + + +def plot_coverage_ratio(df): + versions = df.columns + versions = [v for v in versions if "rc" not in v] + versions = sorted(set(versions), key=lambda v: list(map(int, v[1:].split('.'))), reverse=True) + versions = versions[:4] + df = df[versions] + p, a = plt.subplots() + a.plot(df) + lines = a.get_children() + for i, l in enumerate(lines, -len(lines)): + l.set_zorder(abs(i)) + a.axhline(y=1, color='green', linestyle='--', linewidth=1, label='_nolegend_') + a.set_title("Ratio: members of parliament to seats") + a.legend(versions, loc ="upper left") + p.savefig("quality/estimates/mp-coverage/mp-coverage-ratio.png") + + +def plot_coverage(version, df): + year = df['parliament_year'].unique() + #print(year) + plt.figure(figsize=(38.20, 10.80)) + + fk = df.loc[df["chamber"] == "fk"] + plt.plot(fk['parliament_year'], fk['baseline_N'], label = "First Chamber baseline") + for ix, y in enumerate(fk['parliament_year'].unique()): + col = "blue" + plt.boxplot(fk.loc[fk['parliament_year'] == y, "N_MP"].tolist(), positions=[ix], + manage_ticks=False, + boxprops=dict(color=col), + flierprops=dict(markeredgecolor=col, marker=".", markersize=3), + whiskerprops=dict(color=col), + capprops=dict(color=col), + medianprops=dict(color="red")) + + ak = df.loc[df["chamber"] == "ak"] + plt.plot(ak['parliament_year'], ak['baseline_N'], label = "Second Chamber baseline") + c = 0 + for ix, y in enumerate(ak['parliament_year'].unique()): + c += 1 + col = "orange" + plt.boxplot(ak.loc[ak['parliament_year'] == y, "N_MP"].tolist(), positions=[ix], + manage_ticks=False, + boxprops=dict(color=col), + flierprops=dict(markeredgecolor=col, marker=".", markersize=3), + whiskerprops=dict(color=col), + capprops=dict(color=col), + medianprops=dict(color="red")) + + ek = df.loc[df["chamber"] == "ek"] + plt.plot(ek['parliament_year'], ek['baseline_N'], label = "Unicameral baseline") + for ix, y in enumerate(ek['parliament_year'].unique(), start = c): + col = "green" + plt.boxplot(ek.loc[ek['parliament_year'] == y, "N_MP"].tolist(), positions=[ix], + manage_ticks=False, + boxprops=dict(color=col), + flierprops=dict(markeredgecolor=col, marker=".", markersize=3), + whiskerprops=dict(color=col), + capprops=dict(color=col), + medianprops=dict(color="red")) + + plt.title(f"MEP Coverage, relativee to baseline values ({version})", fontsize="40") + plt.legend(fontsize="35") + plt.xticks(range(0, len(year), 5), year[::5], rotation = 90, fontsize=25) + plt.yticks(fontsize=20) + #plt.xticks(rotation=90) + plt.savefig("quality/estimates/mp-coverage/mp-coverage.png", + dpi=100, + bbox_inches='tight', + pad_inches = 0.2 + ) + + + + +def main(args): + + print("plotting MP coverage") + df = pd.read_csv("quality/estimates/mp-coverage/coverage.csv", sep=";") + plot_coverage(args.version, df) + + + + print("plotting quality of MP coverage") + mp_coverage_df = pd.read_csv("quality/estimates/mp-coverage/mp-coverage.csv") + mp_coverage_df.set_index('year', inplace=True) + + for s in skip: + df.drop(df[df['protocol']==s].index, inplace=True) + + df['parliament_year'] = df['parliament_year'].apply(lambda x: int(x[:4])) + pyears = df['parliament_year'].unique() + + D = {} + + for py in pyears: + D[py] = df.loc[df['parliament_year']==py, "ratio"].mean() + + mp_coverage_df[args.version] = D + + mp_coverage_df.to_csv("quality/estimates/mp-coverage/mp-coverage.csv") + + + plot_coverage_ratio(mp_coverage_df) + + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("-v", "--version", + type=str, + default = None, + help="Version of the riksdagen-persons (!!!) repository") + args = parser.parse_args() + if args.version: + exp = re.compile(r"v([0-9]+)([.])([0-9]+)([.])([0-9]+)(b|rc)?([0-9]+)?") + if exp.search(args.version) is None: + print(f"{args.version} is not a valid version number. Exiting") + exit() + else: + args.version = exp.search(args.version).group(0) + else: + args.version = "v0.0.0" + + + main(args) + diff --git a/quality/qe_mp-coverage.py b/quality/qe_mp-coverage.py new file mode 100644 index 0000000..be2978d --- /dev/null +++ b/quality/qe_mp-coverage.py @@ -0,0 +1,182 @@ +#!/usr/bin/env python3 +""" +Calculates MP coverage and generates plots. +""" +from pyriksdagen.metadata import load_Corpus_metadata +from pyriksdagen.utils import get_data_location +from tqdm import tqdm +import argparse +import datetime as dt +import pandas as pd + + +baselines = { + "ak":0, + "fk":0, + "ek":0 +} +ledamot_map = { + "fk": 1, + "ak": 2, + "ek": 0 +} +skip = [ + '1909/prot-1909----reg-01.xml', + '1909/prot-1909----reg-02.xml', + '197677/prot-197677--.xml', + '197677/prot-197778--.xml', +] + + + + +def is_within_tolerance(nmp, baseline): + ratio = nmp/baseline + #print(f" ---> R: {ratio}") + if ratio > 1.1: + return False, ratio + elif ratio > 0.9: + return True, ratio + else: + return False, ratio + + +def get_spec(protocol_path): + spec = None + spl = protocol_path.split('/')[-1].split('-') + if len(spl) == 4: + return spec + else: + if len(spl[2]) > 0: + spec = spl[2] + return spec + + +def mk_py(row): + if pd.isna(row['spec']): + return row['year'] + else: + return str(row['year']) + row['spec'] + + +def get_ch(protocol_path): + chamber = None + spl = protocol_path.split('/')[-1].split('-') + if len(spl) == 4: + chamber = "ek" + else: + chamber = spl[3] + return chamber + + +def get_baseline(row, baseline_df): + y = row['year'] + c = row['chamber'] + fdf = baseline_df.loc[(baseline_df['year'] == y) & (baseline_df['chamber'] == c)].copy() + fdf.reset_index(inplace=True) + return fdf.at[0, "n_mps"] + + + + +def main(args): + + print("checking MP coverage...") + baseline_df = pd.read_csv("test/data/baseline-n-mps-year.csv") + baseline_df['year'] = baseline_df['year'].apply(lambda x: str(x)[:4]) + + dates = pd.read_csv("test/data/session-dates.csv", sep=";") + dates = dates[~dates['protocol'].isin(skip)] + dates = dates[~dates['date'].isin(["2021", "1977"])] + + for _ in ["N_MP", "passes_test", "almost_passes_test", + "ratio", "year", "spec", "parliament_year", + "chamber", "baseline_N", "MEPs"]: + if _ not in dates.columns: + dates[_] = None + + dates["year"] = dates["protocol"].apply(lambda x: str(x.split('/')[0][:4])) + dates["spec"] = dates["protocol"].apply(lambda x: get_spec(x)) + dates["parliament_year"] = dates.apply(mk_py, axis=1) + dates['chamber'] = dates['protocol'].apply(lambda x: get_ch(x)) + dates['baseline_N'] = dates.apply(get_baseline, args=(baseline_df,), axis=1) + + corpus_meta = load_Corpus_metadata(metadata_folder='data') + mp_meta = corpus_meta[corpus_meta['source'] == 'member_of_parliament'] + mp_meta = mp_meta[mp_meta.start.notnull()] + + mp_meta['start'] = mp_meta['start'].apply(lambda x: pd.to_datetime(x, format='%Y-%m-%d', errors='ignore')) + mp_meta['end'] = mp_meta['end'].apply(lambda x: pd.to_datetime(x, format='%Y-%m-%d', errors='ignore')) + + print(mp_meta[['start', 'end']].describe()) + + filtered_DFs = {} + for k, v in ledamot_map.items(): + filtered_DFs[k] = mp_meta.loc[mp_meta['chamber'] == v] + + shouldnt_happen = 0 + + with tqdm(total=len(dates)) as prgbr: + for i, r in dates.iterrows(): + N_MP = 0 + chamber = r['chamber'] + MEPs = [] + if not pd.isna(chamber): + parliament_day = r['date'] + baseline = r['baseline_N'] + prgbr.set_postfix_str(f"{chamber} / {r['parliament_year']} / {shouldnt_happen}") + + if len(parliament_day) == 10: + #print(r['date'], type(r['date'])) + day = dt.datetime.strptime(r['date'], '%Y-%m-%d') + year = day.year + + sub_df = filtered_DFs[chamber] + sub_df = sub_df[sub_df["start"] <= day] + sub_df = sub_df[sub_df["end"] > day] + + N_MP = len(sub_df["person_id"].unique()) + MEPs = list(sub_df["person_id"].unique()) + + dates.at[i, 'N_MP'] = N_MP + + if N_MP != 0: + if N_MP == r['baseline_N']: + dates.at[i, 'passes_test'] = True + dates.at[i, 'almost_passes_test'], dates.at[i, "ratio"] = is_within_tolerance(N_MP, baseline) + else: + dates.at[i, 'passes_test'] = False + dates.at[i, 'almost_passes_test'], dates.at[i, "ratio"] = is_within_tolerance(N_MP, baseline) + else: + dates.at[i, 'passes_test'] = False + dates.at[i, 'almost_passes_test'] = False + dates.at[i, "ratio"] = 0 + else: + dates.at[i, 'passes_test'] = "None" + dates.at[i, 'almost_passes_test'] = "None" + dates.at[i, "ratio"] = "None" + dates.at[i, "MEPs"] = list(MEPs) + prgbr.update() + dates = dates.sort_values(by=['protocol', 'date'], ignore_index=True) + dates.to_csv("quality/estimates/mp-coverage/coverage.csv", index=False, sep=";") + + + + total_passed = len(dates.loc[dates['passes_test'] == True]) + total_almost = len(dates.loc[dates['almost_passes_test'] == True]) + no_passdf = dates.loc[dates['almost_passes_test'] == False] + total = len(dates) + with open("quality/estimates/mp-coverage/coverage-summary.txt", "w+") as out: + out.write(f"Of {total} parliament days, {total_passed} have correct N MPs in metadata: {total_passed/total}.\n") + out.write(f" {total_almost} pass or almost passed within the margin of error, i.e. +- 10%: {total_almost/total}.\n") + print(f"Of {total} parliament days, {total_passed} have correct N MPs in metadata: {total_passed/total}.") + print(f" {total_almost} pass or almost passed within the margin of error, i.e. +- 10%: {total_almost/total}.") + + + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--metadata-path", type=str, default=None) + args = parser.parse_args() + main(args)