def restrict_to_setting(df, setting, run='eval'):
  """Restrict an experiment dataframe to one hyperparameter setting."""
  setting_df = df[df['run'] == run]
  for k, v in setting.items():
    if k in df.columns.values:
      setting_df = setting_df[setting_df[k] == v]
  return setting_df