class_docstr: Scenario for the entity data imputation task.
  
  This scenario supports the Restaurant and Buy datasets from
  https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9458712. We process the datasets
  as explained in the paper: remove all rows with NaN values and manually select 10% of the rows
  to serve as a test set. A categorical column from this set will be imputed. 20% of the remaining data
  is validation data.
  
  Entity data imputation is a core preprocessing step in structured data ETL pipelines. The task
  is as follows. Given a structured relation A with possible incomplete/NaN call values,
  determine what value should be used to fill in the cell. This task has traditionally relied
  on relational dependencies (e.g., if city = 'San Francisco' then state = 'CA') to infer missing
  values or some ML model trained to learn dependencies between cell values.
  
  An example is
  
      Input: title: adobe creative suite cs3 design premium upsell [ mac ] | price: 1599.0 | manufacturer:
  
  Reference [CORRECT]: adobe
  
  The above example highlights the model will need to reason over input titles and possibly external
  knowledge (e.g. that creative suite is from adobe) to generate the answer.
docstr: Read in structured data from given dataset.
docstr_tok: ["Read","in","structured","data","from","given","dataset","."]
code: def read_tables(self, data_path: Path) -> pd.DataFrame:
      """Read in structured data from given dataset."""
      if self.dataset == "Buy":
          table = pd.read_csv(data_path / "Buy.csv")
          # Remove unique ID column
          del table["id"]
          # To get the shape values as in the paper, we drop nan descriptions
          table = table[~table["description"].isna()]
      elif self.dataset == "Restaurant":
          columns = []
          data = []
          # Manual loading of text arff data (scipy doesn't support yet)
          in_data = False
          for line in open(data_path / "fz.arff"):
              if len(line.strip()) <= 0:
                  continue
              if in_data:
                  data.append(line.strip())
              if line.startswith("@"):
                  if line.startswith("@attribute"):
                      _, name, _ = line.split(maxsplit=2)
                      columns.append(name)
                  if line.startswith("@data"):
                      in_data = True
          table = pd.read_csv(
              StringIO("\n".join(data)),
              header=None,
              sep=",",
              names=columns,
          )
          # Remove unique id
          del table["class"]
          # Remove explicit quote marks that carried over from the arff file
          for c in table.columns:
              table[c] = table[c].str.replace('"', "").str.strip()
          table = table.dropna()
      else:
          raise ValueError(f"{self.dataset} not recognized.")
      # Remove all rows with NaN values - we will manually add them back later
      return table
  
file_path: H2O/h2o_hf/helm/src/helm/benchmark/scenarios/entity_data_imputation_scenario.py
imports: from io import StringIO
  import pandas
  from pathlib import Path
  from typing import List, Tuple
  from helm.common.hierarchical_logger import hlog
  from helm.common.general import ensure_file_downloaded
  from .scenario import Scenario, Instance, Reference, TRAIN_SPLIT, VALID_SPLIT, TEST_SPLIT, CORRECT_TAG, Input, Output
label_desc: Use image node_id 2 for calling the EntityDataImputationScenario obj's underlying member method code with example usage: obj.read_tables(data_path) and returns: table