class_docstr: Tests for dataset analysis utilities.
class_docstr_tok: ["Tests","for","dataset","analysis","utilities","."]
docstr: Tests calculate_relation_functionality.
docstr_tok: ["Tests","calculate_relation_functionality","."]
code: def test_calculate_relation_functionality(self):
      """Tests calculate_relation_functionality."""
      df = dataset_analysis.get_relation_functionality_df(
          dataset=self.dataset,
      )
  
      # check correct type
      assert isinstance(df, pandas.DataFrame)
  
      assert {
          triple_analysis.RELATION_ID_COLUMN_NAME,
          triple_analysis.FUNCTIONALITY_COLUMN_NAME,
          triple_analysis.INVERSE_FUNCTIONALITY_COLUMN_NAME,
      }.issubset(df.columns)
  
      # check relation_id value range
      assert (
          df[triple_analysis.RELATION_ID_COLUMN_NAME]
          .isin(self.dataset.relation_to_id.values())
          .all()
      )
  
imports: import itertools
  import unittest
  from typing import Iterable, Mapping
  import numpy
  import pandas
  from pykeen.datasets import Dataset, Nations
  from pykeen.datasets import analysis
  from pykeen.triples import analysis
  from pykeen.typing import LABEL_HEAD, LABEL_TAIL
label_desc: Use image node_id 7 for calling the DatasetAnalysisTests obj's underlying member method code with example usage: obj.test_calculate_relation_functionality() without return types