{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "490dc40c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Populating the interactive namespace from numpy and matplotlib\n"
     ]
    }
   ],
   "source": [
    "%pylab inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "3cce39dd",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "os.environ['CUDA_VISIBLE_DEVICES'] = ''"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "4f92bb44",
   "metadata": {},
   "outputs": [],
   "source": [
    "import re\n",
    "import pandas as pd\n",
    "import tqdm\n",
    "\n",
    "DATA_DIR = \"/mnt/data-ssd-1/data/supreme_court/\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0a5e6073",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "739b6abd",
   "metadata": {},
   "source": [
    "## Get Meta"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 149,
   "id": "04ce9712",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import requests\n",
    "import urllib.parse\n",
    "import time\n",
    "import random\n",
    "import sox"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 142,
   "id": "d6eb8e7a",
   "metadata": {},
   "outputs": [],
   "source": [
    "MAIN_URL = \"https://www.supremecourt.gov/oral_arguments/\"\n",
    "OVERVIEW_URL = MAIN_URL + \"argument_audio/\"\n",
    "DEFAULT_HEADER = {\n",
    "  \"User-Agent\": \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36\",\n",
    "  \"X-Requested-With\": \"XMLHttpRequest\"\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "18a84f57",
   "metadata": {},
   "outputs": [],
   "source": [
    "r = requests.get(OVERVIEW_URL, headers=DEFAULT_HEADER)\n",
    "years_found = sorted([int(n) for n in re.findall(r\"\\<a id\\=\\\"ctl00.+?year.+?btn.+\\>([0-9]+?)\\<\", r.text)])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 258,
   "id": "3c4bf3c1",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 12/12 [00:05<00:00,  2.30it/s]\n"
     ]
    }
   ],
   "source": [
    "def get_meta_by_year(year_str):\n",
    "    # get all tables from url for a year\n",
    "    year_url = urllib.parse.urljoin(OVERVIEW_URL, year_str)\n",
    "    r = requests.get(year_url, headers=DEFAULT_HEADER)\n",
    "    dfs = pd.read_html(r.text)\n",
    "    # parse valid tables\n",
    "    data = []\n",
    "    for _df in dfs:\n",
    "        if _df.shape[0] > 0 and _df.shape[1] == 2 and set(_df.columns) == {\"Oral Argument\", \"Date Argued\"}:\n",
    "            df = _df.copy()\n",
    "            # extract id\n",
    "            id_strs = _df[\"Oral Argument\"].str.extract(r\"^([^\\s]+?)\\s\")[0].values\n",
    "            df['id'] = id_strs\n",
    "            # remove id from the argument name\n",
    "            name_strs = _df[\"Oral Argument\"].str.extract(r\"^[^\\s]+?\\s(.+)$\")[0].values\n",
    "            df['Oral Argument'] = name_strs\n",
    "            # format date\n",
    "            df['Date Argued'] = pd.to_datetime(df['Date Argued'], format=\"%m/%d/%y\")\n",
    "            # rename columns\n",
    "            df = df.rename({\"Oral Argument\": \"name\", \"Date Argued\": \"date\"}, axis=1, errors=\"raise\")\n",
    "            data.append(df)\n",
    "        elif sum(_df.shape) > 2 and _df.columns.dtype == object:\n",
    "            # could put some alerts here around format changes\n",
    "            pass\n",
    "    meta_df = pd.concat(data, axis=0).reset_index(drop=True)\n",
    "    # create argument url\n",
    "    urls_strs = [\n",
    "        MAIN_URL.strip(\"/\") + \"/\" + s.strip(\"/\") \n",
    "        for s in re.findall(r\"href[^\\s]+(\\/audio\\/[^\\s]+)[\\\"\\']\", r.text)\n",
    "    ]\n",
    "    # make sure that most match (the non-matching are re-arguments)\n",
    "    avg_match = np.mean([a == b for a, b in zip([s.split(\"/\")[-1] for s in urls_strs], meta_df['id'].values)])\n",
    "    assert(avg_match >= 0.9)\n",
    "    meta_df['url'] = urls_strs\n",
    "    meta_df['url_id'] = meta_df['url'].str.split(\"/\").str[-1]\n",
    "    return meta_df\n",
    "\n",
    "\n",
    "dfs = []\n",
    "for year in tqdm.tqdm(years_found):\n",
    "    year_str = str(year)\n",
    "    dfs.append(get_meta_by_year(year_str))\n",
    "    # courtesy pause\n",
    "    time.sleep(0.2 + random.random() / 5)\n",
    "meta_df = pd.concat(dfs, axis=0).reset_index(drop=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3b833f0a",
   "metadata": {},
   "outputs": [],
   "source": [
    "# check if ids unique\n",
    "assert(meta_df[\"url_id\"].value_counts().max() == 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "19e93a42",
   "metadata": {},
   "outputs": [],
   "source": [
    "pdf_base_url = \"https://www.supremecourt.gov/oral_arguments/\"\n",
    "mp3_base_url = \"https://www.supremecourt.gov/media/audio/\"\n",
    "\n",
    "failed_urls = []\n",
    "pdf_urls = []\n",
    "mp3_urls = []\n",
    "for _, row in tqdm.tqdm(meta_df.iterrows(), total=meta_df.shape[0]):\n",
    "    detail_url = row[\"url\"]\n",
    "    try:\n",
    "        r = requests.get(detail_url, headers=DEFAULT_HEADER)\n",
    "        pdf_url = pdf_base_url.strip(\"/\") + re.search(\"\\/argument\\_transcripts\\/.{1,50}?\\.pdf\", r.text).group(0)\n",
    "        mp3_url = mp3_base_url.strip(\"/\") + re.search(\"\\/mp3files\\/.{1,50}+?\\.mp3\", r.text).group(0)\n",
    "    except:\n",
    "        # this shouldn't occur\n",
    "        pdf_url = \"\"\n",
    "        mp3_url = \"\"\n",
    "        print(\"'{}' failed.\".format(row[\"url_id\"]))\n",
    "    pdf_urls.append(pdf_url)\n",
    "    mp3_urls.append(mp3_url)\n",
    "    # courtesy pause\n",
    "    time.sleep(0.2 + random.random() / 5)\n",
    "    \n",
    "meta_df[\"pdf_url\"] = pdf_urls\n",
    "meta_df[\"mp3_url\"] = mp3_urls"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 301,
   "id": "30b701d6",
   "metadata": {},
   "outputs": [],
   "source": [
    "meta_df.to_csv(DATA_DIR + \"scrape_meta.csv\", index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0f192a05",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "cbc932c9",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "8fb902b5",
   "metadata": {},
   "source": [
    "## Download files"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c6757d5b",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import requests\n",
    "import urllib.parse\n",
    "import time\n",
    "import random\n",
    "import sox"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 302,
   "id": "068db4da",
   "metadata": {},
   "outputs": [],
   "source": [
    "meta_df = pd.read_csv(DATA_DIR + \"scrape_meta.csv\")\n",
    "meta_df[\"date\"] = pd.to_datetime(meta_df[\"date\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 303,
   "id": "724eee50",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>date</th>\n",
       "      <th>id</th>\n",
       "      <th>url</th>\n",
       "      <th>url_id</th>\n",
       "      <th>pdf_url</th>\n",
       "      <th>mp3_url</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Tapia v. United States</td>\n",
       "      <td>2011-04-18</td>\n",
       "      <td>10-5400</td>\n",
       "      <td>https://www.supremecourt.gov/oral_arguments/au...</td>\n",
       "      <td>10-5400</td>\n",
       "      <td>https://www.supremecourt.gov/oral_arguments/ar...</td>\n",
       "      <td>https://www.supremecourt.gov/media/audio/mp3fi...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Microsoft Corp. v. i4i Ltd. Partnership</td>\n",
       "      <td>2011-04-18</td>\n",
       "      <td>10-290</td>\n",
       "      <td>https://www.supremecourt.gov/oral_arguments/au...</td>\n",
       "      <td>10-290</td>\n",
       "      <td>https://www.supremecourt.gov/oral_arguments/ar...</td>\n",
       "      <td>https://www.supremecourt.gov/media/audio/mp3fi...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                      name       date       id  \\\n",
       "0                   Tapia v. United States 2011-04-18  10-5400   \n",
       "1  Microsoft Corp. v. i4i Ltd. Partnership 2011-04-18   10-290   \n",
       "\n",
       "                                                 url   url_id  \\\n",
       "0  https://www.supremecourt.gov/oral_arguments/au...  10-5400   \n",
       "1  https://www.supremecourt.gov/oral_arguments/au...   10-290   \n",
       "\n",
       "                                             pdf_url  \\\n",
       "0  https://www.supremecourt.gov/oral_arguments/ar...   \n",
       "1  https://www.supremecourt.gov/oral_arguments/ar...   \n",
       "\n",
       "                                             mp3_url  \n",
       "0  https://www.supremecourt.gov/media/audio/mp3fi...  \n",
       "1  https://www.supremecourt.gov/media/audio/mp3fi...  "
      ]
     },
     "execution_count": 303,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "meta_df.head(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 304,
   "id": "258c55b7",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 789/789 [1:09:52<00:00,  5.31s/it]\n"
     ]
    }
   ],
   "source": [
    "RAW_DATA_DIR = \"/mnt/data-ssd-1/data/supreme_court/raw_data/\"\n",
    "\n",
    "# need to add retries for this scrape\n",
    "sess = requests.Session()\n",
    "sess.mount('https://supremecourt.gov', requests.adapters.HTTPAdapter(max_retries=3))\n",
    "\n",
    "data = []\n",
    "for _, row in tqdm.tqdm(meta_df.iterrows(), total=meta_df.shape[0]):\n",
    "    pdf_url = row[\"pdf_url\"]\n",
    "    mp3_url = row[\"mp3_url\"]\n",
    "    _id = row[\"url_id\"]\n",
    "    \n",
    "    if not (\n",
    "        (type(pdf_url) == str and len(pdf_url) > 0) and \n",
    "        (type(mp3_url) == str and len(mp3_url) > 0)\n",
    "    ):\n",
    "        continue\n",
    "    \n",
    "    # get audio\n",
    "    local_audio_path = RAW_DATA_DIR + _id + \".mp3\"\n",
    "    if not os.path.isfile(local_audio_path):\n",
    "        r = sess.get(mp3_url, headers=DEFAULT_HEADER, allow_redirects=True)\n",
    "        with open(local_audio_path, 'wb') as f:\n",
    "            f.write(r.content)\n",
    "    \n",
    "    # get transcript\n",
    "    local_transcript_path = RAW_DATA_DIR + _id + \".pdf\"\n",
    "    if not os.path.isfile(local_transcript_path):\n",
    "        r = sess.get(pdf_url, headers=DEFAULT_HEADER, allow_redirects=True)\n",
    "        with open(local_transcript_path, 'wb') as f:\n",
    "            f.write(r.content)\n",
    "    \n",
    "    # get duration\n",
    "    duration_s = sox.file_info.duration(local_audio_path)\n",
    "    \n",
    "    data.append((_id, local_audio_path, local_transcript_path, duration_s))\n",
    "    \n",
    "    # courtesy pause\n",
    "    time.sleep(2 + random.random() * 2)\n",
    "    \n",
    "file_df = pd.DataFrame(data, columns=[\"uuid\", \"audio_path\", \"transcript_path\", \"duration_s\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 311,
   "id": "1c874f14",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "833.4 hours of audio\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>uuid</th>\n",
       "      <th>audio_path</th>\n",
       "      <th>transcript_path</th>\n",
       "      <th>duration_s</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>10-5400</td>\n",
       "      <td>/mnt/data-ssd-1/data/supreme_court/raw_data/10...</td>\n",
       "      <td>/mnt/data-ssd-1/data/supreme_court/raw_data/10...</td>\n",
       "      <td>3492.310000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>10-290</td>\n",
       "      <td>/mnt/data-ssd-1/data/supreme_court/raw_data/10...</td>\n",
       "      <td>/mnt/data-ssd-1/data/supreme_court/raw_data/10...</td>\n",
       "      <td>3530.527007</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      uuid                                         audio_path  \\\n",
       "0  10-5400  /mnt/data-ssd-1/data/supreme_court/raw_data/10...   \n",
       "1   10-290  /mnt/data-ssd-1/data/supreme_court/raw_data/10...   \n",
       "\n",
       "                                     transcript_path   duration_s  \n",
       "0  /mnt/data-ssd-1/data/supreme_court/raw_data/10...  3492.310000  \n",
       "1  /mnt/data-ssd-1/data/supreme_court/raw_data/10...  3530.527007  "
      ]
     },
     "execution_count": 311,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "print(round(file_df[\"duration_s\"].sum() / 60 / 60, 1), \"hours of audio\")\n",
    "file_df.head(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 313,
   "id": "d76d0811",
   "metadata": {},
   "outputs": [],
   "source": [
    "file_df.to_csv(DATA_DIR + \"raw_file_meta.csv\", index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b6e8930a",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5725bc23",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "1cb34a68",
   "metadata": {},
   "source": [
    "## Parse annotations"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 159,
   "id": "a017d3a6",
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import Iterable\n",
    "import unidecode\n",
    "import json\n",
    "import string\n",
    "\n",
    "from collections import Counter\n",
    "import editdistance\n",
    "from pdfminer.high_level import extract_pages\n",
    "from pdfminer.layout import LAParams\n",
    "\n",
    "LAUGHTER = \"[laughter]\"\n",
    "ALLOWED_CHARS = set(string.ascii_letters + string.digits + \" -,.':?\\\"();$/&\")\n",
    "\n",
    "def _normalize_whitespace(text):\n",
    "    return re.sub(r\"\\s+\", \" \", text).strip()\n",
    "\n",
    "def _cleanup_chars(text):\n",
    "    # replace special symbols\n",
    "    text = text.replace(\"\\xad\", \"-\").replace(\"\\xa0\", \" \")\n",
    "    text = text.replace(\"{\", \"(\").replace(\"}\", \")\")\n",
    "    text = text.replace(\"[\", \"(\").replace(\"]\", \")\")\n",
    "    text = text.replace(\"!\", \".\")\n",
    "    text = unidecode.unidecode(text)\n",
    "    text = \"\".join([c if c in ALLOWED_CHARS else \" \" for c in text])\n",
    "    text = re.sub(r\"\\s\", \" \", text)\n",
    "    return text\n",
    "\n",
    "def _find_start_end_pages(pages):\n",
    "    start_page_idx = -1\n",
    "    end_page_idx = -1\n",
    "    for n_page, page in enumerate(pages):\n",
    "        if not isinstance(page, Iterable):\n",
    "            continue\n",
    "        for para in page:\n",
    "            if not hasattr(para, \"get_text\"):\n",
    "                break\n",
    "            text = _cleanup_chars(para.get_text())\n",
    "            if re.search(r\"P\\s+R\\s+O\\s+C\\s+E\\s+E\\s+D\\s+I\\s+N\\s+G\\s+S\", text):\n",
    "                if start_page_idx >= 0:\n",
    "                    raise ValueError(\"found multiple start pages.\")\n",
    "                start_page_idx = n_page\n",
    "            if \"submitted.)\" in text or \"adjourned.)\" in text or \"concluded.)\" in text:\n",
    "                if end_page_idx >= 0:\n",
    "                    raise ValueError(\"found multiple end pages.\")\n",
    "                end_page_idx = n_page\n",
    "    if start_page_idx < 0:\n",
    "        raise ValueError(\"start page not found.\")\n",
    "    if end_page_idx < 0:\n",
    "        raise ValueError(\"end page not found.\")\n",
    "    if end_page_idx - start_page_idx < 5:\n",
    "        raise ValueError(\"too few pages.\")\n",
    "    return start_page_idx, end_page_idx\n",
    "\n",
    "def _get_raw_lines(pages):\n",
    "    lines = []\n",
    "    for n_page, page in enumerate(pages):\n",
    "        if not isinstance(page, Iterable):\n",
    "            continue\n",
    "        for n_para, para in enumerate(page):\n",
    "            if not isinstance(para, Iterable):\n",
    "                continue\n",
    "            for n_line, line in enumerate(para):\n",
    "                if not hasattr(line, \"get_text\") or not hasattr(line, \"bbox\"):\n",
    "                    continue\n",
    "                text = _cleanup_chars(line.get_text())\n",
    "                x1, y1, x2, y2 = [round(f, 1) for f in line.bbox]\n",
    "                lines.append(((n_page, n_para, n_line), (x1, y1, x2, y2), text))\n",
    "    if len(lines) < 1000:\n",
    "        raise ValueError(\"too few lines of text.\")\n",
    "    return lines\n",
    "\n",
    "def _verify_lines_coordinates(lines):\n",
    "    \"\"\"roughly check coordinates of elements in pdf\"\"\"\n",
    "    if (\n",
    "        (min([min(x1, x2) for _, (x1, _, x2, _), _ in lines]) < 0) or\n",
    "        (min([min(y1, y2) for _, (_, y1, _, y2), _ in lines]) < 0) or\n",
    "        (max([max(x1, x2) for _, (x1, _, x2, _), _ in lines]) < 200) or\n",
    "        (max([max(y1, y2) for _, (_, y1, _, y2), _ in lines]) < 500) or\n",
    "        (max([max(x1, x2) for _, (x1, _, x2, _), _ in lines]) > 800) or\n",
    "        (max([max(y1, y2) for _, (_, y1, _, y2), _ in lines]) > 1000)\n",
    "    ):\n",
    "        raise ValueError(\"coordinates of pdf seem off.\")\n",
    "        \n",
    "def _merge_lines(raw_lines, y_tol=2):\n",
    "    # remove empty lines incase rogue whitespace\n",
    "    lines = [l for l in raw_lines if len(l[-1].strip()) > 0]\n",
    "    _verify_lines_coordinates(lines)\n",
    "    # get avg width for character\n",
    "    char_width = mean([(x2 - x1) / len(text) for _, (x1, _, x2, _), text in lines])\n",
    "    # sort by increasing page and decresing y\n",
    "    sorted_lines = sorted(lines, key=lambda k: (k[0][0], -k[1][1]))\n",
    "    # group lines by y\n",
    "    grouped_lines = []\n",
    "    buffer = []\n",
    "    prev_y1 = 0\n",
    "    for (n_page, _, _), (x1, y1, x2, y2), text in sorted_lines:\n",
    "        if abs(y1 - prev_y1) > y_tol and len(buffer) > 0:\n",
    "            grouped_lines.append(buffer)\n",
    "            buffer = []\n",
    "        buffer.append((n_page, (x1, y1, x2, y2), text))\n",
    "        prev_y1 = y1\n",
    "    if len(buffer) > 0:\n",
    "        grouped_lines.append(buffer)\n",
    "    # merge lines by x\n",
    "    merged_lines = []\n",
    "    for group in grouped_lines:\n",
    "        assert(len(set([n_page for n_page, _, _ in group])) == 1)\n",
    "        # sort group by x1, merge accordingly and update bounding box\n",
    "        sorted_group = sorted(group, key=lambda k: (k[1][0], k[1][2]))\n",
    "        n_page, (x1, y1, x2, y2), text = sorted_group[0]\n",
    "        for _, (t_x1, t_y1, t_x2, t_y2), t_text in sorted_group[1:]:\n",
    "            n_space = max(0, int(round((t_x1 - x2) / char_width)))\n",
    "            text += \" \" * n_space + t_text\n",
    "            x2 = t_x2\n",
    "            y1 = min(y1, t_y1)\n",
    "            y2 = max(y2, t_y2)\n",
    "        merged_lines.append((n_page, (x1, y1, x2, y2), text))\n",
    "    return merged_lines\n",
    "\n",
    "def _get_left_x(lines):\n",
    "    \"\"\"Get smallest x offset of a non-space character.\"\"\"\n",
    "    # get avg width for character\n",
    "    char_width = mean([(x2 - x1) / len(text) for _, (x1, _, x2, _), text in lines])\n",
    "    offs_xs = []\n",
    "    for _, (x1, _, _, _), text in lines:\n",
    "        offs = x1\n",
    "        for c in text:\n",
    "            if c == \" \":\n",
    "                offs += char_width\n",
    "            else:\n",
    "                break\n",
    "        offs_xs.append(offs)\n",
    "    return min(offs_xs)\n",
    "\n",
    "def _filter_lines(lines, tol_x=40):\n",
    "    left_border_x = _get_left_x(lines)\n",
    "    filtered_lines = []\n",
    "    for n_page, (x1, _, _, _), text in lines:\n",
    "        # only lines with a line number close to left border\n",
    "        m = re.search(r\"^\\s*[0-9]{1,3}\\s\\s\", text)\n",
    "        if x1 <= left_border_x + tol_x and m:\n",
    "            text_snip = text[m.end() - 2:]\n",
    "            # remove empty\n",
    "            if len(text_snip.strip()) == 0:\n",
    "                continue\n",
    "            # remove headers\n",
    "            if re.match(r\"^\\s*[^a-z\\:]+\\s*$\", text_snip) and len(re.findall(r\"[A-Z]\", text_snip)) >= 5:\n",
    "                continue\n",
    "            # remove time\n",
    "            if re.match(r\"^\\s*\\([0-9]{1,2}\\:[0-9]{1,2}\\s+[ap]\\.m\\.\\)\\s*$\", text_snip):\n",
    "                continue\n",
    "            # fix capitalization in eg MR. McALLISTER:\n",
    "            text_snip = re.sub(r\"^(\\s*[A-Z\\s\\,\\.\\']{0,50}?)Mc([A-Z\\s\\,\\.\\']{0,50}?\\:)\", r\"\\1MC \\2\", text_snip)\n",
    "            text_snip = re.sub(r\"^(\\s*[A-Z\\s\\,\\.\\']{0,50}?)Mr\\.([A-Z\\s\\,\\.\\']{0,50}?\\:)\", r\"\\1MR.\\2\", text_snip)\n",
    "            text_snip = re.sub(r\"^(\\s*[A-Z\\s\\,\\.\\']{0,50}?)Ms\\.([A-Z\\s\\,\\.\\']{0,50}?\\:)\", r\"\\1MS.\\2\", text_snip)\n",
    "            filtered_lines.append((n_page, text_snip))\n",
    "    # sanity check first and last line\n",
    "    if not re.search(r\"^\\s*[A-Z][A-Z\\s\\,\\.\\'\\-]{5,50}\\:\", filtered_lines[0][1]):\n",
    "        raise ValueError(\"first lines seems incorrect.\")\n",
    "    if (\n",
    "        \"submitted.)\" not in filtered_lines[-1][1] and \n",
    "        \"adjourned.)\" not in filtered_lines[-1][1] and\n",
    "        \"concluded.)\" not in filtered_lines[-1][1]\n",
    "    ):\n",
    "        raise ValueError(\"last lines seems incorrect.\")\n",
    "    return filtered_lines\n",
    "\n",
    "def _merge_strings_section(strings):\n",
    "    section_text = \" \".join(strings)\n",
    "    # replace laughter meta\n",
    "    section_text = re.sub(r\"\\(.?[lL]aughter.?\\)\", \" {} \".format(LAUGHTER), section_text)\n",
    "    # remove parens text\n",
    "    section_text = re.sub(r\"\\([^\\)]{5,100}?\\)\", \" \", section_text)\n",
    "    section_text = _normalize_whitespace(section_text)\n",
    "    if len(section_text) == 0:\n",
    "        raise ValueError(\"empty section found.\")\n",
    "    return section_text\n",
    "\n",
    "def _normalize_speaker_name(name):\n",
    "    name = re.sub(r\"\\bMC[\\s\\.]*\", \"Mc\", name)  # better formatting\n",
    "    name = re.sub(r\"JUST\\s([A-Z])\", \"JUSTICE \\\\1\", name)  # abbreviation\n",
    "    name = re.sub(r\"(M[RS])[\\s\\.]+([A-Z])\", \"\\\\1. \\\\2\", name)  # incorrect puntuation\n",
    "    name = re.sub(r\"^JUDGE \", \"JUSTICE \", name)  # common mistake\n",
    "    name = re.sub(r\"^CHIEF JUDGE \", \"CHIEF JUSTICE \", name)  # common mistake\n",
    "    return name\n",
    "\n",
    "def _fixup_speaker_typos(sections):\n",
    "    # count speaker occurences\n",
    "    speaker_counts = Counter()\n",
    "    for s, _ in sections:\n",
    "        speaker_counts[s] += 1\n",
    "    # build mapper for mistakes\n",
    "    speaker_name_fixup_map = {}\n",
    "    potential_speaker_errors = [s for s, c in speaker_counts.items() if c == 1]\n",
    "    for s in potential_speaker_errors:\n",
    "        # sometimes chief is incorrect\n",
    "        if speaker_counts[\"CHIEF \" + s] > 1:\n",
    "            speaker_name_fixup_map[s] = \"CHIEF \" + s\n",
    "            continue\n",
    "        if speaker_counts[re.sub(r\"^CHIEF \", \"\", s)] > 1:\n",
    "            speaker_name_fixup_map[s] = re.sub(r\"^CHIEF \", \"\", s)\n",
    "            continue\n",
    "        # if unambiguous fixup for editdistance 1 available then do it\n",
    "        better_alternatives = []\n",
    "        for sa, c in speaker_counts.items():\n",
    "            if c > 1 and editdistance.eval(s, sa) == 1 and len(s) >= 5 and len(sa) >= 5:\n",
    "                better_alternatives.append(sa)\n",
    "        if len(better_alternatives) == 1:\n",
    "            speaker_name_fixup_map[s] = better_alternatives[0]\n",
    "    # do the fixup\n",
    "    sections = [(speaker_name_fixup_map.get(s, s), t) for s, t in sections]\n",
    "    return sections\n",
    "\n",
    "def _parse_sections(lines):\n",
    "    sections = []\n",
    "    known_speaker = None\n",
    "    buffer = []\n",
    "    for _, text in lines:\n",
    "        # TODO: do we also want to respect indent here for speaker parsing?\n",
    "        speaker = None\n",
    "        m = re.search(r\"^\\s*([A-Z][A-Z\\s\\,\\.\\'\\-]{5,50}?)\\:\", text)\n",
    "        # minimal example: 'MR. HO'\n",
    "        if m and len(re.findall(r\"[A-Z]\", m.group(1))) >= 4:       \n",
    "            speaker = _normalize_speaker_name(_normalize_whitespace(text[:m.end() - 1]))\n",
    "            clean_text = _normalize_whitespace(text[m.end():])\n",
    "        else:\n",
    "            clean_text = _normalize_whitespace(text)\n",
    "        if speaker is not None and speaker != known_speaker and len(buffer) > 0:\n",
    "            section_text = _merge_strings_section(buffer)\n",
    "            sections.append((known_speaker, section_text))\n",
    "            buffer = []\n",
    "        if speaker is not None:\n",
    "            known_speaker = speaker\n",
    "        buffer.append(clean_text)\n",
    "    if len(buffer) > 0:\n",
    "        section_text = _merge_strings_section(buffer)\n",
    "        sections.append((known_speaker, section_text))\n",
    "    if len(sections) < 10:\n",
    "        raise ValueError(\"too few sections.\")\n",
    "    if any([s is None for s, _ in sections]):\n",
    "        raise ValueError(\"unknown speaker present.\")\n",
    "    charset = set(\"\".join([t for _, t in sections]))\n",
    "    invalid_chars = charset - ALLOWED_CHARS - set([\"[\",\"]\"])\n",
    "    if len(invalid_chars) > 0:\n",
    "        raise ValueError(\"unexpected characters '{}' remaining in sections.\".format(\"\".join(invalid_chars)))\n",
    "    # check for unparsed speakers\n",
    "    for _, t in sections:\n",
    "        for s in re.findall(r\"[A-Z][A-Z\\s\\,\\.\\'\\-]{5,50}?\\:\", t):\n",
    "            if len(re.findall(r\"[A-Z]\", s)) >= 4:\n",
    "                raise ValueError(\"potentially unparsed speaker found: '{}'.\".format(t))\n",
    "    # fixup speaker typos\n",
    "    sections = _fixup_speaker_typos(sections)\n",
    "    return sections\n",
    "\n",
    "def _replace_speakers(sections, speaker_remap):\n",
    "    fixed_sections = [\n",
    "        (speaker_remap.get(s, s), t) \n",
    "        for s, t in sections\n",
    "    ]\n",
    "    return fixed_sections\n",
    "        \n",
    "def _transcript_specific_fixup(uuid, sections):\n",
    "    if uuid == \"09-868\":\n",
    "        speaker_remap = {\"CHIEF JUSTICE\": \"CHIEF JUSTICE ROBERTS\"}\n",
    "        fixed_sections = _replace_speakers(sections, speaker_remap) \n",
    "    elif uuid == \"09-987\":\n",
    "        speaker_remap = {\"GENERAL KAGAN\": \"JUSTICE KAGAN\"}\n",
    "        fixed_sections = _replace_speakers(sections, speaker_remap)     \n",
    "    elif uuid == \"11-1118\":\n",
    "        speaker_remap = {\"GINSBURG\": \"JUSTICE GINSBURG\"}\n",
    "        fixed_sections = _replace_speakers(sections, speaker_remap)\n",
    "        fixed_sections = [\n",
    "            (s, re.sub(r\"\\s+JUSTICE$\", \"\", t)) \n",
    "            for s, t in fixed_sections\n",
    "        ]\n",
    "    elif uuid == \"11-551\":\n",
    "        speaker_remap = {\"JUSTICE PHILLIPS\": \"JUSTICE KENNEDY\"}\n",
    "        fixed_sections = _replace_speakers(sections, speaker_remap) \n",
    "    elif uuid == \"12-895\":\n",
    "        speaker_remap = {\"MR. SCALIA\": \"JUSTICE SCALIA\"}\n",
    "        fixed_sections = _replace_speakers(sections, speaker_remap) \n",
    "    elif uuid == \"12-930\":\n",
    "        speaker_remap = {\"MS. GOLDBERG\": \"MS. GOLDENBERG\"}\n",
    "        fixed_sections = _replace_speakers(sections, speaker_remap) \n",
    "    elif uuid == \"13-433\":\n",
    "        speaker_remap = {\"MR. THEIRMAN\": \"MR. THIERMAN\"}\n",
    "        fixed_sections = _replace_speakers(sections, speaker_remap) \n",
    "    elif uuid == \"14-556-q2\":\n",
    "        speaker_remap = {\"MR. HALLWARD-DREIMEIER\": \"MR. HALLWARD-DRIEMEIER\"}\n",
    "        fixed_sections = _replace_speakers(sections, speaker_remap)\n",
    "    elif uuid == \"15-109\":\n",
    "        speaker_remap = {\"MR. BREYER\": \"JUSTICE BREYER\", \"MR. RAMIREZ\": \"MR. MARTINEZ\"}\n",
    "        fixed_sections = _replace_speakers(sections, speaker_remap)  \n",
    "    elif uuid == \"16-1454\":\n",
    "        speaker_remap = {\"MR. CHELSER\": \"MR. CHESLER\"}\n",
    "        fixed_sections = _replace_speakers(sections, speaker_remap)\n",
    "        fixed_sections = [\n",
    "            (s, re.sub(r\"Mr\\. Chelser\", \"Mr. Chesler\", t)) \n",
    "            for s, t in fixed_sections\n",
    "        ]\n",
    "    elif uuid == \"16-299\":\n",
    "        speaker_remap = {\"MS. KAGAN\": \"JUSTICE KAGAN\"}\n",
    "        fixed_sections = _replace_speakers(sections, speaker_remap)\n",
    "    elif uuid == \"17-1484\":\n",
    "        speaker_remap = {\"MR. BREYER\": \"JUSTICE BREYER\"}\n",
    "        fixed_sections = _replace_speakers(sections, speaker_remap)\n",
    "    elif uuid == \"17-988\":\n",
    "        speaker_remap = {\"MR. SOTOMAYOR\": \"JUSTICE SOTOMAYOR\"}\n",
    "        fixed_sections = _replace_speakers(sections, speaker_remap)  \n",
    "    elif uuid == \"18-1171\":\n",
    "        speaker_remap = {\"MR. CHEMERINKSY\": \"MR. CHEMERINSKY\"}\n",
    "        fixed_sections = _replace_speakers(sections, speaker_remap)  \n",
    "    elif uuid == \"18-725\":\n",
    "        speaker_remap = {\"MR. UNIKOWKSY\": \"MR. UNIKOWSKY\"}\n",
    "        fixed_sections = _replace_speakers(sections, speaker_remap)  \n",
    "    elif uuid == \"18-8369\":\n",
    "        speaker_remap = {\"MR. MR. OLSON\": \"MR. OLSON\"}\n",
    "        fixed_sections = _replace_speakers(sections, speaker_remap)\n",
    "    elif uuid == \"18-935\":\n",
    "        speaker_remap = {\"JSUTICE BREYER\": \"JUSTICE BREYER\"}\n",
    "        fixed_sections = _replace_speakers(sections, speaker_remap)  \n",
    "    elif uuid == \"19-635\":\n",
    "        speaker_remap = {\"JUSTICE TO KAVANAUGH\": \"JUSTICE KAVANAUGH\"}\n",
    "        fixed_sections = _replace_speakers(sections, speaker_remap)\n",
    "    else:\n",
    "        fixed_sections = sections[:]\n",
    "    return fixed_sections\n",
    "\n",
    "def _check_final_coverage(raw_lines, sections):\n",
    "    base_text = \"\".join([t for _, _, t in raw_lines])\n",
    "    parsed_text = \"\".join([\"\".join([s, t]) for s, t in sections])\n",
    "    tot_chars = len(re.findall(r\"[a-zA-Z]\", base_text))\n",
    "    parsed_chars = len(re.findall(r\"[a-zA-Z]\", parsed_text))\n",
    "    frac_parsed = parsed_chars / tot_chars\n",
    "    if frac_parsed < 0.8:\n",
    "        raise ValueError(\"only {} of total chars were parsed\".format(round(frac_parsed, 1)))\n",
    "    \n",
    "def get_annotated_sections(uuid, pdf_path):\n",
    "    pages = list(extract_pages(pdf_path, laparams=LAParams(boxes_flow=None)))\n",
    "    start_page_idx, end_page_idx = _find_start_end_pages(pages)\n",
    "    raw_lines = _get_raw_lines(pages[start_page_idx:end_page_idx + 1])\n",
    "    lines = _merge_lines(raw_lines)\n",
    "    filtered_lines = _filter_lines(lines)\n",
    "    sections = _parse_sections(filtered_lines)\n",
    "    fixed_sections = _transcript_specific_fixup(uuid, sections)\n",
    "    _check_final_coverage(raw_lines, fixed_sections)\n",
    "    return fixed_sections"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 160,
   "id": "e57a69ad",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>uuid</th>\n",
       "      <th>audio_path</th>\n",
       "      <th>transcript_path</th>\n",
       "      <th>duration_s</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>10-5400</td>\n",
       "      <td>/mnt/data-ssd-1/data/supreme_court/raw_data/10...</td>\n",
       "      <td>/mnt/data-ssd-1/data/supreme_court/raw_data/10...</td>\n",
       "      <td>3492.310000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>10-290</td>\n",
       "      <td>/mnt/data-ssd-1/data/supreme_court/raw_data/10...</td>\n",
       "      <td>/mnt/data-ssd-1/data/supreme_court/raw_data/10...</td>\n",
       "      <td>3530.527007</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      uuid                                         audio_path  \\\n",
       "0  10-5400  /mnt/data-ssd-1/data/supreme_court/raw_data/10...   \n",
       "1   10-290  /mnt/data-ssd-1/data/supreme_court/raw_data/10...   \n",
       "\n",
       "                                     transcript_path   duration_s  \n",
       "0  /mnt/data-ssd-1/data/supreme_court/raw_data/10...  3492.310000  \n",
       "1  /mnt/data-ssd-1/data/supreme_court/raw_data/10...  3530.527007  "
      ]
     },
     "execution_count": 160,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "file_df = pd.read_csv(DATA_DIR + \"raw_file_meta.csv\")\n",
    "file_df.head(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 161,
   "id": "ac2eae20",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 789/789 [47:53<00:00,  3.64s/it]  "
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "10 out of 789 failed.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "failed_ids = []\n",
    "data = {}\n",
    "for _, row in tqdm.tqdm(file_df.iloc[::-1].iterrows(), total=file_df.shape[0]):\n",
    "    uuid = row[\"uuid\"]\n",
    "    pdf_path = row[\"transcript_path\"]\n",
    "    try:\n",
    "        annotated_sections = get_annotated_sections(uuid, pdf_path)\n",
    "        data[row[\"uuid\"]] = annotated_sections\n",
    "    except:\n",
    "        failed_ids.append(row[\"uuid\"])\n",
    "print(\"{} out of {} failed.\".format(file_df.shape[0] - len(data), file_df.shape[0]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9c77eea7",
   "metadata": {},
   "outputs": [],
   "source": [
    "# TODO known parsing errors: \n",
    "#    missing newline: '       unreasonable?                MR. GUPTA:  Yeah.  That -- that is  '),\n",
    "#    20-5279, rogue chars: '               -- JUSTICE KAGAN:  -- the crimes have  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "10f38dd7",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b1fbee3f",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9b3aee3e",
   "metadata": {},
   "outputs": [],
   "source": [
    "# # raw data - dir containing: \n",
    "#    folders: \n",
    "#      audio - mp3 files from source\n",
    "#      text - pdf files from source\n",
    "#    files: \n",
    "#      meta.jsonl - metadata for each transcript such as date and url\n",
    "\n",
    "# # dervied data - dir with date containing: \n",
    "#    folders: \n",
    "#      texts - txt files of transcript ready for aligner\n",
    "#      alignments - json output of aligner\n",
    "#      slices - folders with uuids containing wavs of slices\n",
    "#    files: \n",
    "#      text_meta.jsonl - metadata for each transcript such as speakers\n",
    "#      slices_meta.jsonl - metadata for slices such as transcription and speakers"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8b7ca27b",
   "metadata": {},
   "outputs": [],
   "source": [
    "# # github files\n",
    "# utils/notebook.py\n",
    "\n",
    "# utils/conversion.py\n",
    "# utils/alignment.py\n",
    "# datasets/supreme_court/downloader.py\n",
    "# datasets/supreme_court/parser.py\n",
    "# datasets/supreme_court/slicer.py\n",
    "# scripts/supreme_court/README.md\n",
    "# scripts/supreme_court/fetch_data.py\n",
    "# scripts/supreme_court/process_data.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6c2d3b4e",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "cae074fd",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 162,
   "id": "1fa3826d",
   "metadata": {},
   "outputs": [],
   "source": [
    "c = Counter()\n",
    "for uuid, sections in data.items():\n",
    "    for speaker, text in sections:\n",
    "        c[speaker] += 1\n",
    "for k, v in c.items():\n",
    "    if v == 1:\n",
    "        print(uuid, k)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 163,
   "id": "98611853",
   "metadata": {},
   "outputs": [],
   "source": [
    "# pd.Series(speaker_turns).sort_values(ascending=False).head(20)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 164,
   "id": "0f27686b",
   "metadata": {},
   "outputs": [],
   "source": [
    "# sid = \"MR. HALLWARD-DREIMEIER\"\n",
    "# guuid = None\n",
    "# for uuid, sections in data.items():\n",
    "#     b_found = False\n",
    "#     for speaker, text in sections:\n",
    "#         if speaker == sid:\n",
    "#             b_found = True\n",
    "#             break\n",
    "#     if b_found:\n",
    "#         guuid = uuid\n",
    "#         print(uuid)\n",
    "# nf = None\n",
    "# for n, (k, v) in enumerate(data[guuid]):\n",
    "#     if k == sid:\n",
    "#         nf = n\n",
    "#         break\n",
    "# data[guuid][n-3:n+3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e5b1db96",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e3232fb7",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4c665915",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "64b5e161",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "b388c2cb",
   "metadata": {},
   "source": [
    "#### Save data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "a784f5d4",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(DATA_DIR + \"sections.json\", \"w\") as f:\n",
    "    json.dump(data, f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3a7ddfbc",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "710b9dc0",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "661b0452",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "55975bef",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "e595207d",
   "metadata": {},
   "source": [
    "### Experiment on failures"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 155,
   "id": "ebfdc308",
   "metadata": {},
   "outputs": [],
   "source": [
    "!cp /mnt/data-ssd-1/data/supreme_court/raw_data/15-109.pdf ."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 154,
   "id": "3d968cb3",
   "metadata": {},
   "outputs": [],
   "source": [
    "pdf_path = \"/mnt/data-ssd-1/data/supreme_court/raw_data/15-109.pdf\"\n",
    "uuid = pdf_path.split(\"/\")[-1].split(\".\")[0]\n",
    "pages = list(extract_pages(pdf_path, laparams=LAParams(boxes_flow=None)))\n",
    "start_page_idx, end_page_idx = _find_start_end_pages(pages)\n",
    "raw_lines = _get_raw_lines(pages[start_page_idx:end_page_idx + 1])\n",
    "lines = _merge_lines(raw_lines)\n",
    "filtered_lines = _filter_lines(lines)\n",
    "sections = _parse_sections(filtered_lines)\n",
    "fixed_sections = _transcript_specific_fixup(uuid, sections)\n",
    "_check_final_coverage(raw_lines, fixed_sections)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "65e6b793",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "001f16b2",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5e2cc600",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "b6620f8e",
   "metadata": {},
   "source": [
    "## Playground"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d2b424b4",
   "metadata": {},
   "outputs": [],
   "source": [
    "for _, row in tqdm.tqdm(file_df.iloc[1:].iterrows(), total=file_df.shape[0]):\n",
    "    pdf_path = row[\"transcript_path\"]\n",
    "    pages = list(extract_pages(pdf_path, laparams=LAParams(boxes_flow=None)))\n",
    "    start_page_idx, end_page_idx = _find_start_end_pages(pages)\n",
    "    raw_lines = _get_raw_lines(pages[start_page_idx:end_page_idx + 1])\n",
    "    s = \"\".join([e[-1] for e in raw_lines])\n",
    "    b_found = False\n",
    "    for l in raw_lines:\n",
    "        if \"@\" in l[-1]: \n",
    "            print(\"@\")\n",
    "            b_found = True\n",
    "#         if \"/\" in l[-1]: \n",
    "#             print(\"/\")\n",
    "#             b_found = True\n",
    "#         if \"&\" in l[-1]: \n",
    "#             print(\"&\")\n",
    "#             b_found = True\n",
    "    if b_found:\n",
    "        print(row)\n",
    "        break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "96c9ffe3",
   "metadata": {},
   "outputs": [],
   "source": [
    "\"/\" in \"10-174\"\n",
    "\"&\" in \"09-1476\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "id": "8b2f03d3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "We'll hear argument next in Case 20-915, Unicolors versus H&M Hennes & Mauritz. Mr. Rosenkranz.\n",
      "Justice Gorsuch is participating remotely this morning. We will hear argument this morning in Case 20-843, New York State Rifle & Pistol Association versus Bruen. Mr. Clement.\n",
      "You look at the plain text. From Brown & Williamson, we know you'd also look at the statutory context, and I also think the statutory context here is incredibly important. When you have the distinction between the emergency power and the regular power -- this was the dialogue earlier with Justice Thomas about necessary versus reasonably necessary or appropriate -- all of those textual clues, where powers have been lodged within the federal government, the fact that this is within the Department of Labor rather than Department of Human and Health -- Health and Human Services, also King versus Burwell too on, is this the agency that has expertise over communicable diseases? No, it's not.\n",
      "-- across the day. Okay. So many companies put in time-of-day metering, and, therefore, it's cheaper if you get your electricity at night and store it. And so EPA might say: Hey, when you're doing that, PJM or -- this isn't plant. This is the computer for about a hundred plants. When you do that, add a cent to your presumed cost to reflect the fact that it's coal-based, or subtract a stent -- a cent when it's L&G-based and subtract two cents if it's solar-based. Eh, that's not a big deal. And if you think two cents is a big deal, let's make it a quarter of a cent, okay? And so there we are. I have something that's fairly minor Congress might well have delegated, and it is not within the fence.\n",
      "Okay. Okay. Okay. The component one is -- I want to make sure I answer that. I do think that products liability turns on the finished product that's sold, if you think about your Air & Liquid case, which was all about that. And I think, again, it has to be objectively discernible. So, if there's some component in there, but we don't know that the -- that the defendant has made a decision about how it's going to submit itself to the market, I don't think it's a good idea to have --\n",
      "Harper & Row is a case in which the district judge made findings, and this Court said, when there are established findings and the court, not a jury, is going to resolve fair use, it can be the appellate court or the district court. Here, you have the opposite. You have a general jury verdict. There are no subsidiary findings whatsoever. The jury was asked to and properly instructed to weigh all the evidence and the fair use factors. You can't unpack it in nearly the same way you could with a court in Harper & Row.\n",
      "Now I also think that First Options rests heavily and basically repeats AT&T, so I've read AT&T about five times. What it seems to say is, if you have a question, parties, or one of them, whether this dispute falls under the terms of the contract that have arbitration for 1 -- paragraphs 1 through 7 or is rather a Section 10 dispute, where there is no arbitration clearly, you don't know if it's a Section 8 or a Section 10, well, what happens? What AT&T says is, but that is a question of arbitrability. It is a question whether this dispute is arbitrable. So it's for the judge. But where there is an arbitration clause in the contract, as there was in First Options as far as the owners knew, but where there is a -- where there is an arbitration clause, then there is a presumption of arbitrability. All right? So that seems to me, Judge, you decide. You decide whether this particular dispute is sent to an arbitrator or -- or for the court, i.e., is it arbitrable, you decide, Judge, but if there's an arbitration clause in the contract, you decide with the presumption of arbitrability that it will normally be arbitrable. That's what it seems to say. And so the judge was right to decide it below, but he didn't decide it right because he should have given it a presumption of arbitrability. Now that's how I read those two cases, but also in the back of my mind is what in heaven's name happens in labor arbitration. In the ordinary labor arbitration case -- and that's where all this law comes from -- where -- one party, the labor union, says this is a Section 8 agreement, arbitrate it. No, says the employer. It is a Section 10 kind of situation grievance and, therefore, it falls within the exception, don't arbitrate it. How do they decide that? The scope -- see, that's like the scope of the -- of the arbitration clause in the -- in -- in the agreement. Do -- do you see what -- did you follow that?\n",
      "Mr. Perry. ON BEHALF OF SMITH & NEPHEW, INC., ET AL.\n",
      "I -- I agree with you, Justice Kavanaugh, that what the Court is doing in Lechmere and Babcock is undertaking a -- a -- a constitutional avoidance inquiry. I think that we were unable or precluded from -- from interpreting the Access Regulation or the ALRA in a similar manner because of the Pandol & Sons decision from 1976.\n",
      "We'll hear argument next in Case 18-107, R.G. & G.R. Harris Funeral Homes versus the Equal Employment Opportunity Commission. Mr. Cole.\n",
      "-- that they're currently carried by AT&T and DirecTV, which is -- which are now one company. Now it should be perfectly clear to everybody in this courtroom that that's an allegation that they were only able to make in the third complaint in this case. It was not in the first or the second complaint. And the reason for that is, during the pendency of the entire litigation in this case, they were suing AT&T and DirecTV as they were suing us. And that --\n",
      "Well, Your Honor, in -- in Yates, the Court concluded that Fish was not a tangible object, even though, in ordinary English, it's obviously a tangible object. You can hold it in your hand. In Brown & Williamson, the Court concluded that nicotine was not a drug for purposes of the -- of the Food, Drug and Cosmetic Act, even though, in common understanding, it can --\n",
      "No, and Section 121 deals with this directly. It spells out in like over 3,000 words how states can incorporate into EPA's, their plans, and EPA can override that state standard. And it goes -- then states have the remedy to sue. It's one of the exceptions under 113. And so -- and I think you're right that their position under the savings clause is that not only could state law say don't enact EPA's remedy because we hate it and do a different remedy, but state courts could order independent warring cleanups, you know, case by case, block by block, house by house. And this Court, in the Abilene Cotton case and in the AT&T case, interpreted almost an identically worded savings clause and said you can't interpret those clauses to completely destroy other parts of the Act. And this would utterly destroy EPA's whole design under CERCLA.\n",
      "We'll hear argument first this morning in Case 18-280, the New York State Rifle & Pistol Association versus the City of New York. Mr. Clement.\n",
      "What about a D&C after a miscarriage? As I understand it, these two procedures are very much alike. Are similar regulations, about 30 miles, and admitting privileges applicable to a D&C following a miscarriage?\n",
      "Yeah. Eastland -- Eastland was not -- didn't even raise that issue. Eastland was, in fact, personal papers. But, with respect, I guess the main point I would make is whatever presumption this Court has previously applied in cases that involve separation of powers, it should not put a -- any -- any finger on the scale for Congress's asserted legislative power in this case. And, indeed, in numerous separation of powers cases, starting with Kilbourn, the Court has declined to extend any presumption that -- that -- that Congress had a legitimate power. That was also true below in the D.C. Circuit in Tobin, in the Senate Select Committee case, and even in the AT&T cases.\n",
      "Your Honor, we don't ask the Court to pierce the veil or to treat these entities as alter egos. Rather, we're focused on the unique nature of speech and the way speech can be attributed even when corporate formalities are observed. And I think the right line of case law here is not just this Court's decision in 2013 in AOSI but also cases like Pleasant Grove City v. Summum; Walker v. Texas Division, Sons -- Division, Sons of Confederate Veterans; Pacific Gas & Electric; and, as Justice Sotomayor mentioned, the Hurley parade case. All of those cases recognize that legally separate entities or individuals and entities can have speech attributed from one to the other without engaging in any kind of veil-piercing or alter ego analysis, which would get the Court mired into the corporate formalities, which we don't advocate. Rather, we think a more limited holding based on the nature of speech and the First Amendment would suffice.\n",
      "-- into R&D in order to come up with an alternative, that's all within their control, not ours. And the tort\n",
      "I'm sorry. Isn't that what condemnation, whether it's regular or inverse, does? The first question the court answers is, is there a taking? So it does reach the constitutional question. Even in a -- in a regular condemnation -- condemnation proceeding, they have to decide whether it -- the government has a public interest or not. That's what makes it constitutional. So I don't understand. Can I ask another question, however? Assuming that you were right and that you had a federal cause of action or should have one under 1983, when this case goes to a federal court, why would a district court be -- abuse its discretion for abstaining under any of the three doctrines, Pullman, Louisiana Power & Light, or Colorado River? All of them say that district courts can abstain when a legal issue involves state law and that state law could obviate the federal proceeding. So one of two things can happen in the state court below. They say no taking, and then there's no taking; or, second, there's a taking, and the inverse condemnation proceeding will provide the remedy. So, in many ways, this obviates the proceeding altogether.\n",
      "That would -- that would certainly be a much closer case. Our argument is that -- that SORNA would still be unconstitutional simply because of the total lack of standard. Even in cases like NBC or American Power & Light where the Court has upheld arguably very broad delegations, there has been some standard in the law that, even if seemingly broad as written, drew upon an existing body of established law. So, for example, in NBC, the public interest, convenience, and necessity certification for licensing was an established body of law, that it was a certification that states had made to public service industries since roughly the 1870s. There's no existing body of law to give context --\n",
      "Suppose somebody -- suppose somebody sent you a letter addressed to the White & Case office in New York City. I bet that would get to you, wouldn't it?\n",
      "Mr. Chief Justice, and may it please the Court: In the PG&E case, this Court held that, although the State of California had the undisputed regulatory power to in place a moratorium on the construction of new nuclear plants, it was preempted under the Atomic Energy Act from using that undisputed de jure authority as a means for indirectly and de facto regulating the nuclear safety of nuclear plants. The --\n",
      "Thank you, Mr. Chief Justice. Respondents' argument today really assumes the answer to the inquiry when Respondent argues that the parties never would have wanted to arbitrate wholly groundless claims of arbitrability. The exact same argument could be made where the underlying substantive claims are frivolous. The argument could be made that the parties would never have wanted for that to go to the arbitrator and would have instead wanted a court to short-circuit that inquiry. But this Court in AT&T Technologies made clear that, even if a court thinks that a claim is not arguable, it is still obligated to send that claim to arbitration, where the parties have so intended.\n",
      "Your Honor, as a factual matter, after being denied the material, he did engage in some cross-examination that appears in the record. But I think critical, Your Honor, is that, without the material itself, any meaningful cross-examination regarding the expert's methodology, the provenance of the expert's labor market surveys was impossible. And I would note that it would be a rare case when you would be asked to cross-examine a statistical expert who is opining upon specific numbers that the expert has then modified through calculations without actually seeing the data sources itself. I think this Court's decision in Florida Power & Light is an important precedent in this respect because, there, the Court noted that the testimony, the well-founded testimony of an expert may be enough if firsthand information is unavailable. And, here, particularly because there were two sources the expert relied upon, the Bureau of Labor Statistics data, which was public, but then also her private labor market surveys, which the ALJ never saw and we never saw, that made any form of cross-examination or meaningful inquiry into the basis for these numbers impossible.\n",
      "This Court in Merchant Heat & Light said you step into the role of the plaintiff.\n",
      "We'll hear argument next in Case 17-1307, Obduskey versus McCarthy & Holthus. Mr. Geyser.\n",
      "We'll hear argument first this morning in Case 17-290, Merck Sharp & Dohme versus Albrecht. Mr. Dvoretzky.\n",
      "I'm saying, a very good book, the Law & Its Compass, Lord Radcliffe, all our liberties come from freedom of religion. You have your religion. I have mine. And we're not going to kill each other. Okay? So we say history counts. Now what he raised is a problem. So what about saying past is past, if you go back 93 years, but no more. We're now 54 religions. We're now everything under the sun. And people will take offense. Now how do I do that? Is that sensible? Is it ridiculous? What do you think?\n",
      "If -- to take your hypothetical example -- if, in North Carolina, the legislature said we in our wisdom have decided that the people in Charlotte are going to be represented by a Democrat, the people in Asheville are going to be represented by a Republican, that we're going to split Guilford County and North Carolina A&T to ensure that the students in that school are going to be represented by a Republican in one district and a Republican in another, they would be dictating electoral outcomes even if it were seven/six. The whole idea of the democratic process in a general election is the people elect a member of Congress in a general election in which everybody can vote. And when you rig the districts in that manner, you are making the general election irrelevant. You're making the primary election in which only some people can vote --\n",
      "We'll hear argument first this morning in Case 17-1705, PDR Network versus Carlton & Harris Chiropractic. Mr. Phillips.\n",
      "There's absolutely no history here, Your Honor. Those cases that you're talking about, I think it is Bowles and John R. Sand & Gravel, those are cases where there's 100 years of direct precedent of this Court and of all the courts of appeals. There is nothing like that in this case. In fact, the only cases we have are Zipes and Arbaugh, essentially, and those are cases that cut in our favor. Every other case that this Court has analyzed jurisdictional rules in, where the scheme is similar to us, you have to do something before you go to district court. Those have looked exactly like our case in terms of the final resolution. This Court has held that they are not jurisdictional. So EME Homer City, Union Pacific, Mach Mining, all those cases, Henderson, Reed Elsevier, all of them come out our way. And in some of those the language and the text of the statute is better for our friends on the other side than this statute here.\n",
      "Under -- if that's true, it's under the Borak-type framework that courts would supply remedies when Congress didn't, but this Court was very clear about this in Sandoval, and I believe other cases, where it said that regulations can't create implied private rights. Statutes do. And this Court in Ernst & Ernst said that Section 10(b) was the source of the implied private right.\n",
      "What about the reality? I think we have in one of these cases, in Ernst & Young, the individual claim is $1,800. To proceed alone in the arbitral forum will cost much more than any potential recovery for one. That's why this is truly a situation where there is strength in numbers, and that was the core idea of the NLRA. There is strength in numbers. We have to protect the individual worker from being in a situation where he can't protect his rights.\n",
      "And judgments. And -- and one last point, Justice Kennedy, on judgments. I do think, Justice Breyer, that the judgments piece is part of this. I mean, three years ago, this Court in the B&B Hardware case, I think, saw the difficulties of adopting a bright-line rule for when administrative adjudications would or would not be preclusive. That is not true here. There is no question in the CAAF -- in the court-martial system that when the Court of Appeals for the Armed Forces issues a judgment, it is binding, it is preclusive, it is usually sending a service member to prison, and perhaps it's even leading to a capital sentence.\n",
      "So our view is that the President can supplement; he just can't supplant. In this Court's decisions in the Brown & Williamson case and the UARG greenhouse gas, and Concepcion and Abilene Cotton, the Savings Clause cases, all say there are three things you look at. And it's not a flat bar. It can't be like a direct contravention. Even they say it's not a direct contravention in their reply brief at page 19. So the three things are, first, can these two solutions coexist or not? Second, has Congress prescribed a reticulated comprehensive scheme? And, third, you know, is there any other indication that Congress considered the issue and went in a different direction? With respect to all of those for here -- and, again, only this proclamation satisfies all three of those factors -- Congress has a comprehensive reticulated scheme that deals with the exact single problem that he's identified, which is countries not cooperating. It can't coexist with the solution of a flat ban. It makes no sense, for example, to have the in-person visa requirement -- visa interview, which is in 12 -- 1202(h)(2), which is for -- for people who come from state sponsors of terrorism or who have a \"group\" with a likelihood of providing inaccurate information. Congress said there has to be an in-person interview for that. It doesn't make sense to say, well, you're going to have a flat ban. It doesn't make sense to have a Visa Waiver Program which is all about countries that provide zero information to the United States -- state sponsors of terrorism and the like -- and say we're going to give you a carrot and then say, oh, no, forget about the Visa Waiver Program.\n",
      "Thank you, Mr. Chief Justice. A few quick points. My very able friend has referred repeatedly to a statute providing for make-whole relief to provide the full amount of restitution. Of course, that is not what subsection (b)(4) says, as Justice Sotomayor pointed out. That's what other statutes say. The offense-specific provisions provide that kind of relief when Congress wanted to. If Congress were concerned about overlooking expenses like child care and transportation, it would have phrased this entirely differently. It would have said that you can recover necessary expenses, including child care and transportation. And that, in fact, is what Congress did in the offense-specific statutes. It said you get the full amount of recovery, and the full amount includes the following categories, including their attorneys' fees and the kind of expenses provided here. Congress chose the polar opposite formulation here, invoking the classic ejusdem generis formulation. My friend has suggested that 3664(f)(1)(A) somehow controls the amount of restitution here. This Court rejected the identical proposition in Hughey when it looked at the Victim and Witness Protection Act. It said that (f)(1)(A) is a procedural statute. It does not dictate the outer bounds of a permissible restitution award. You have to look to subsection (b) in this case in order to do that. Mr. Chief Justice, you are absolutely correct that trying to figure out what expenses are necessary here is an incredibly difficult task. The government may not think this is imposing a burden on district judges. It's interesting that the judges themselves disagree. Judge Higginson in his concurrence cited different articles and studies showing the -- the incredible burden and the complexity of determining exactly these sorts of restitution amounts. And if you look at the record here, we have a great example of how difficult this is to parse out. Page 28 of the Joint Appendix shows that one of the expenses that Winston & Strawn incurred -- incurred, was looking at potential third-party liability against Dry Van's auditors. That, of course, has nothing to do with investigating the Petitioner's offense. These are exactly the kinds of expenses that a corporation reasonably incurs in an internal investigation, and it's incredibly hard to disaggregate those expenses from the expenses that would be necessary for the government to incur or that the government even would have bothered to do in the first place.\n",
      "We'll hear argument in Case 16-1215, Lamar, Archer & Cofrin versus Appling. Mr. Garre.\n",
      "We'll hear argument first this morning in Case No. 15-423, Bolivarian Republic of Venezuela v. Helmerich & Payne International Drilling Company. Ms. Stetson.\n",
      "Okay. Let me -- let me -- let me put aside that exchange. The -- the -- in fact, the report does acknowledge what is obvious from the face of the statute and which I believe -- and this Court recognized in Microsoft v. AT&T, which is the 271 provisions were modeled after induced infringement under 271(b) and contributory infringement under 271(c). And -- and --\n",
      "Its function is to tell the public from whom did the goods or services emanate. It is not expressive in its own right. Now, it is certainly true that many commercial actors will attempt to devise trademarks that not only can identify them as the source, but that also are intended to convey positive messages about their products. For example, if you see the -- the name Jiffy Lube or a B&B that's called Piney Vista. The -- the mark is -- is sort of a dual-purpose communication. It both identifies the source and it serves as a kind of miniature advertisement. There's always the danger, as some of the amicus briefs on our side point out, that when a person uses as his mark words that have other meanings in common discourse, that it will distract the consumer from the intended purpose of the trademark qua trademark, which is to identify source, and basically Congress says, as long as you are promoting your own product, saying nice things about people, we'll put up with that level of distraction.\n",
      "We borrowed \"direct\" from Cooter & Gell and from the other sanction regimes that all have various iterations of what I call direct causation. Now, they may refer to it as direct effect; they may refer to it as direct result. But at the end of the day. That's what they're applying. Now, we looked at Fox v. Vice and saw essentially the same analysis, because what those cases are trying to determine in -- in the other sanction regimes is, what is the excess cost? And Fox approached that slightly differently, looking at it -- calling it incremental costs, calling it but-for. So, essentially, we think the tests are synonymous. And the reason that it's a little bit different than, say, proximate cause is because we're dealing with the American rule and -- and coming up with an exception to the American rule. But, obviously, the exception is not -- it's not an all-or-nothing claim, and obviously Fox made that --\n",
      "Right, Your Honor. So both of those rights are different from the First Amendment. They are equally fundamental, but they are different. So in the case of voting, North Carolina does not take away -- North Carolina draws the line at people who have completed their parole, their period of supervised release. But in Richardson v. Ramirez, the Court looked to the text and history and tradition and said in Section 2 of the Fourteenth Amendment there was affirmative sanction for felon disenfranchisement. If you look at that same section, which dealt with the people who rebelled in the Civil War, you didn't need to restore their First Amendment rights. And -- and with the Second Amendment, when somebody is convicted of a crime, they immediately lose their Second Amendment rights. They don't lose their First Amendment rights. So in the Simon & Schuster case, this Court vindicated the rights of somebody who was a serial killer who wanted to write from prison, where he was serving a life sentence for murder, about his experience. So --\n",
      "Well, the -- my response to that, Your Honor, Mr. Chief Justice, is that the Kentucky Supreme Court certainly engaged in trying to understand the intentions of the words that the principals meant. And it simply said that a principal -- no principal who grants the power to their son, their daughter, their -- their spouse, their -- their attorney-in-fact to buy and sell property or engage in contracts involving property would ever think about -- would allow that -- that attorney-in-fact to engage -- engage in one of these arbitration agreements. In that -- in the earlier case regarding powers of attorney in Kentucky -- and that was -- I believe it's U.S. Guarantee & Trust. It's an older case, from -- from 1912. The -- there's language to the effect of giving the power for an agent to buy or sell property does not intrinsically give that person the -- the power to mortgage property, although one could say that that should naturally flow from -- from the -- the overarching language. So that's the -- the sort of backdrop and context in which the Kentucky Supreme Court is operating. If I could turn for a second to DIRECTV, which is a -- obviously relied upon, to a large extent, by Kindred. In that particular case, I think that this Court reiterated its basic assumption that ordinarily, what a State instrument means is a question for State law in the State courts. And only in exceptional circumstances will this Court engage in a preemption, and in essence, an independent review and reinterpretation of that State instrument. And in DIRECTV, the two similar points that seem to -- to stand out are that that California Appellate Court singled out arbitration, singled out the Federal Arbitration Act for not incorporating Federal Arbitration Act preemption into the way they read their California contract, the DIRECTV contract. And they did so without attempting to tie that effectively to what the parties might intend in the DIRECTV contract. Here, we do not have that. We have the Kentucky Supreme Court announcing an interpretive rule that -- and it may be difficult for them to -- to work it out over -- over time, but again, that's the way the common law develops, that if you have a general waiver of a fundamental constitutional right by a power of attorney, that has to be spelled out in the document.\n",
      "I think, your Honor, in -- I think this case shows that an action to enforce a subpoena is more like those. And this Court in Highmark talked about the district court living with a case. In -- in our case, the district court had experience, not only with the parties in the context of the subpoena at issue, but also with a parallel proceeding that the agency brought under the ADEA, and had experience in that. So I think this case shows that there are instances where the district court does live with a case longer. But even if that were not so, Justice Ginsburg, I think the other factors in Pierce, and Koon, and Cooter & Gell, and the other cases that this Court has articulated and given, put meat on the -- on the Pierce factors. I think perhaps the most important is the fact-sensitive, context-sensitive nature which I think is very much like the other inquiries that -- that Your Honor --\n",
      "Mr. Chief Justice, and may it please the Court: I'd like to address the domestic exhaustion issue first, and I'd like to begin by responding to Justice Kennedy's question about why hasn't the exhaustion doctrine been codified. The Court's historic cases in the domestic exhaustion field have located the exhaustion principle in the language of the predecessors of what is now 35 U.S.C. 154(a)(1). That is the provision of the Patent Act that says the patent owner has the right to exclude others from making, using, selling, offering for sale, or importing the patented invention. And in addressing predecessor versions of that language, this Court said those exclusive rights in essence don't encompass the right to control resale or use of a lawfully sold article. For example, in Bauer & Cie v. O'Donnell, the Court said -- addressed the proper interpretation of the exclusive right to vend, and it said the right to vend was exercised when the first authorized sale was made. The right to vend does not encompass the right to set resale prices. In motion picture patents, the Court said that its task was to determine the meaning of Congress enacting the predecessor version of 154(a)(1). In -- in order -- other cases, the Court has referred to lawfully sold articles as being no longer under the protection of the act of Congress, or that the exhaustion rule delimits the scope of the patent grant. So it's true that the Patent Act doesn't contain an analogue to 17 U.S.C. 109(a), which is the Copyright Act provision that specifically addresses the scope of exhaustion, but the exhaustion doctrine has historically been understood by this Court as a gloss on the exclusive rights conferred by 154(a)(1) and its predecessors, and unless Congress wanted to change the exhaustion rule, either to get -- get rid of it entirely or to substitute some different triggering event, there was no need for it to amend -- to -- to codify an explicit exhaustion provision by continuing in effect and by tweaking the exclusive rights conferred by the grant of a patent, Congress should be understood to have manifested its intention that historic conceptions of domestic -- domestic exhaustion would continue to have sway. Now, the second point I make about domestic exhaustion is that the court of appeals' err, in our view, stem to a large extent from its misreading of general talking pictures. General talking pictures dealt not with a -- not with simply a restriction on the use that purchasers could make after an article had been lawfully sold. It dealt with the conditions on which its patentee's licensee could sell the article in the first place. And the -- the exhaustion doctrine is also -- often referred to colloquially as the first-sale doctrine, and I think that's a reason -- there's a reason for that. It's that the presence or absence of exhaustion turns on whether there has been a lawful first sale, and if the licensee departs from the instruction of the patentee and sells the article in a way that is not authorized, there's no lawful first sale, and therefore, no patent exhaustion. But once the article has been lawfully sold, any restrictions on resale or use that the patentee purports to impose downstream can be enforceable only under contract law or commercial law, not under patent law. And that brings me to my third point about domestic exhaustion, which is one of the arguments on the other side is -- on the Respondent's side is that application of domestic exhaustion principles here would prevent parties from reaching agreements that might be economically advantageous to both of them. And so the Respondent says, well, if I have had particular buyer who only wants to use the cartridge once and doesn't want to pay extra for the privilege of reusing it, if he never intends to do that, why shouldn't we be able to negotiate a deal under which I charge him less in return for his commitment to only use it once? And the answer is nothing in the exhaustion doctrine prevents parties from reaching those agreements and enforcing them as a matter of contract law, if they are enforceable under the -- the law of the relevant jurisdiction. The policy judgment that this Court has historically attributed to Congress is not a judgment that these sorts of restrictions are bad or should be unenforceable. It's simply a judgment that possession of a patent doesn't give the patentee any greater rights to make or enforce restrictions like this than a seller of similar unpatented property would have under the rules of -- of general contract law. And so, in several of the exhaustion decisions, the Court has distinguished between the limits on patent remedies and the alternative remedies that might be available under what the Court has often referred to as the general law, the body of contract and commercial law that applies to -- to all sellers. I'd like to turn now, if I may, to the question of international exhaustion. And the position of the United States on -- on this issue is between that of the two parties, it's our view that a patent -- a U.S. patent owner who sells goods -- patented goods abroad should be able to reserve its U.S. rights but need -- needs to do so expressly. And I'd like to start --\n",
      "In -- in Procter & Gamble, Your Honor. And in Procter & Gamble, you have a discovery order saying that the United States had to turn over a grand jury transcript. If you read the briefing, if you look at the oral argument, the parties conceded it had no effect on the -- the -- the plaintiff's case, the government's case. It was a purely --\n",
      "Sir, it is the case that the purpose of the statute of repose, we quite agree, is so that the -- all of the possible asserted liability is filed within the period in question. And so that would be true under a variety of provisions of the securities laws, under ERISA, a lot of things. What American Pipe holds is that the class action complaint does do that. So it's very important, I think, that my friend doesn't say that they were in any way unaware that we had this claim against them. What they want us to do is to move to intervene in the litigation, and what American Pipe and Crown, Cork & Seal, and United Airlines all tell us is that we don't want to foist upon the district judges, and retired district judges have filed an amicus brief, having to go through, churn through this paperwork of entirely unnecessary --\n",
      "One of the briefs, by the way, says that you had no authority to deregulate it. You know, we had a case involving the Federal Communications Commission which wanted to dispense the filing of tariffs on the part of everybody, I think, except AT&T. And we held that the statute requires the agency to regulate rates and required filed rates. Isn't that a problem here too?\n",
      "First, is that there is no administrable line that he can identify between something that's wrong and really, really wrong. But in any event, it's not -- it's not correct that the contract is improperly interpreted. Here are the reasons: The first is that, Justice Breyer, if you and I have a contract that says if California law would prevent us from having a class action waiver, we will not arbitrate at all. That is not preempted. That's the second holding of Volt. Remember, all AT&T versus Concepcion is, is a rule that says, if California forces us to engage in class action arbitration. But you and I can agree to anything at all. This contract, when it says, \"If the law of your State would find the class action waiver invalid\" is a perfectly fine thing for us to agree to. That's State law and even accounts for preemption because the FAA does not preempt California law in that circumstance.\n",
      "In Monsanto and in Caplin & Drysdale, those were cases involving tainted funds, drug money.\n",
      "So the -- the Court's concern, it was always a narrow interpretation of the statute for very important reasons. And that is to minimize the dislocation of the lower Federal courts' functioning and structure, which always happens when you have to bring in two extra judges. And secondly, to control this Court's mandatory appellate docket. So those are always at work when the Court was reading the statute. And Congress knew this. And on page 5, the Senate report acknowledges this narrow reading without disavowing it or instructing this Court to do otherwise. So the statute always was read not in the most embracing terms, as it said in Swift & Company v. Wickham at page 126, not in the most embracing terms, but in restrictive -- in a restrictive way because of the important concerns of judicial administration that were at stake, but also to best serve the historical purpose, which is to protect States from the improvident injunction by a single judge.\n",
      "And -- and respectfully, I disagree with Petitioner's counsel on this issue. I believe Norfolk & Western Railway v. Hiles, which is this Court's opinion, indicates that -- or states that if there is an issue raised in the lower court and it is raised in the State's highest court, in this case, the Georgia Supreme Court, but the Georgia Supreme Court denies discretionary review, then it is before this Court on certiorari from the lower court. So --\n",
      "Do you think that the -- that the ROTC graduates from the University of Texas make superior officers to those who -- who graduate from, let's say, Texas A&M or Texas Tech?\n",
      "We'll hear argument first this morning in Case 14-1132, Merrill Lynch, Pierce, Fenner & Smith v. Manning. Mr. Hacker.\n",
      "The second is the D&C, the dilation and -- what's it called? Dilation and --\n",
      "That is a huge difference, because this -- the message this all sends to my clients is don't take FERC's direction that you should be competing based on market forces and efficiency. We should stop competing efficiently on the PJM and try to put the best bid together based on the three-year advanced auction. We should start competing for subsidies, and we should start competing for guarantees. The second part of your question, what about FERC primary jurisdiction. This is all a bit rich coming from my friends on the other side because, as Justice Alito alluded to, when this all started, their position was this has nothing to do with FERC at all. This is a financial arrangement that FERC can't even look at. Then my friend talks about how, well, they eventually got market-based rate authority from FERC in a submission. Well, I -- I'd ask you to take a look at what they said on Joint Appendix page 142 of that submission. What they said about the contract is they said, quote, \"CPV Maryland also notes that it included the CFD in this application solely for informational purposes and is not requesting that the Commission address or discuss Commission jurisdiction over the CFD in its decision on CPV's Maryland's request for market-based rate.\" Don't look what's behind that curtain, Mr. FERC. We don't want you to do anything with that. We're just here to try to get market-based rate authority. For them now to come in, not having raised any objection to the Supremacy Clause cause of action -- and by the way, there was a Commerce Clause cause of action there as well, which is maybe why the parties overlooked it, and I do think that's not jurisdictional, so I think we're past that. So for them to come in now and say, oh, this has to go to FERC, I'm sorry; it's a bit rich. And I understood why they were making the MOPR argument at the early stages of this litigation before FERC filed the brief. But I am a little mystified why, at this late stage of the game, after FERC has filed three briefs saying that the MOPR is not sufficient to eliminate price-suppressive bids, that they're still saying we win because FERC's on our side. I mean, that is a bit mystifying. And I think FERC is absolutely right on this for the reasons that we've already talked about. I mean, you can't really even apply the MOPR in an apples-to-apples way if you have this kind of 20-year guarantee, because the cost of capitals are completely out of whack. And of course, they do have the problem that their own testimony is they wouldn't be on the market at all if they didn't have this 20-year guarantee. So in the first capacity auction that we had to deal with, the price was suppressed. In every energy auction since then, the price was suppressed. And that's why I think FERC -- you know, they never tried to design the MOPR as this perfect thing. You talked about the 90 percent and the 70 percent? Way back in one of those proceedings, my client said, FERC, why isn't it a hundred percent? If you think about the economics of this, it should be a hundred percent. And FERC's response was, eh, close counts, this isn't perfect, we don't pretend it's perfect so we think 90 perfect is a rough compromise. Fair enough. Probably not arbitrary and capricious, but it doesn't mean that this is something that the MOPR is some perfect solution. I also don't think there's anything terribly anomalous about the procedural posture of this case. I think it's exact procedural posture you had in front of you in the Schneidewind case. That was a district court action, declaratory judgment for preemption. What I think makes this a preemption case, and what completely distinguishes voluntary bilateral contracts, is State action. It's the State action forcing the LSCs to make these payments, and essentially conditioning CPV's participation on the PJM market on the bid-and-clear requirement. That's State action that's preempted. In the typical voluntary bilateral contract, you don't have State action. The parties make their agreement. They eventually submit it to FERC, or if it's a market-based rate, somebody can object. And the only time you really get State action at that point is at the very end of the process when the State's doing retail rate regulation, and that's the point where Mississippi Power & Light and Nantahala come in and say if at that late stage when there's finally State action that the State has to take FERC's wholesale rate determinations as a given; they can't second guess them at late stage. But here you got the State action right up front, and the State action is preempted.\n",
      "It works very differently, Justice Ginsburg. To get certified for filing of a second or successive 2255 motion, a defendant has to go to the court of appeals and request authorization and receive it under 2255(h). And 2255(h)(2) permits certification when a new rule of constitutional law has been made retroactive to cases on collateral review by this Court. So it requires a ruling from this Court that the ruling that's relied upon is retroactive. And the courts of appeals have split, methodologically and substantively, on whether this Court has made Johnson retroactive. To be very brief about it, the government's position is that this Court has done so through a combination of holdings. It's a syllogism. All substantive rules are retroactive; Johnson is a substantive rule; therefore, this Court's jurisprudence makes Johnson retroactive. But that has occasioned substantial disagreement in the courts of appeals. Unfortunately, Congress precluded certiorari review in the AEDPA, so this Court cannot directly review that conflict. If the Court in this case were to hold that Johnson is retroactive, it would make Johnson retroactive, and thereby entitle the second or successive filers to come in. And the government believes that that would be appropriate because if, in fact, they are serving an ACCA sentence based on a residual clause conviction, they're in jail for a minimum of five years longer than Congress ever validly authorized. And in the government's view, that's the kind of substantive holding that Justice Harlan had in mind in the Mackey case, which was the progenitor of the Teague opinion. It's -- means that the criminal process has come to rest at a point where it never should have come to rest. The residual clause was not found to be unconstitutional until Johnson, but once the Court has concluded -- contrary to the government's argument, to be sure -- but that it is facially void, it means that Congress never supplied a valid basis for those sentences. And we think that it is consistent with the doctrinal framework that the Court has announced for habeas cases and for the substantive versus procedural inquiry to hold it retroactive. Now the amicus in support of the judgment has offered an alternative way of analyzing retroactivity. Its method -- its approach is to look at the source of the underlying right rather than the effect that it has in the criminal proceeding. That approach is in some ways reminiscent of the first step in retroactivity analysis under Linkletter v. Walker, the very approach that the Court overthrew in Teague. That inquiry said, what was the purpose of the new rule being designed? The amicus's argument would send the courts back to look at that as opposed to looking at the -- the effect of the rule. And Justice Harlan himself, I think, offered us a very clear indication that he understood that it was the effect of the rule, rather than the source of the rule. He examined two cases in combination in the Mackey decision and the United States in Coin & Currency that involved a Fifth Amendment violation, punishing somebody for compelling -- you know, compelled self-incrimination. And that is a procedural rule, but when it is the very basis for criminal liability, in other words, punishing somebody for failing to incriminate themselves, Justice Harlan said that's a substantive effect, and it's entitled to retroactivity. When, on the other hand, it simply gives rise to evidence that should not have been admitted in an otherwise valid proceeding, it produces a procedural rule that Justice Harlan believed was not entitled to retroactivity. Same right, two different outcomes depending on the effect in the particular case. And we think that that effects-based approach is what the Court adopted in Schriro v. Summerlin and in Teague and has applied in numerous other cases. And it's also the basis for the government's view that while Johnson does apply to the sentencing guidelines, in the sentencing guidelines context, it does not create a substantive rule. It creates a procedural rule. The sentencing guidelines serve as information that the judge must legally consider in imposing the sentence, but it does not alter the statutory maximum or require a statutory minimum. So a mistake in applying the guidelines functions as a piece of misinformation. It's analogous to wrongly weighed facts or legal considerations within a preexisting range. And in our view, that is, under the definition that Justice Sotomayor articulated, and other definitions, a procedural rule. It influences the way a guideline sentence influences what the judge does, but the judge's charge remains the same, to impose a sentence that is sufficient, but not greater than necessary, to achieve the purposes of punishment within a preexisting statutory minimum and maximum.\n",
      "We'll hear argument this morning in Case 14-1418, Zubik v. Burwell, and the consolidated cases. Mr. Clement. NOS. 15-35, 15-05, 15-119 & 15-191\n",
      "It could. And, Justice Kagan, if you were to decide that the three verbs that are in 1962(a), (b) and (c), which are influencing, buying, or investing in, had to have a domestic component, we still would satisfy that, because our allegations in the complaint are that RJR from its corporate headquarters in New York and Winston-Salem was engaging in those conducts to effect and corrupt the foreign enterprise, or the domestic enterprise, as was the case with Brown & Williamson.\n",
      "We'll hear argument first this morning in Case 15-375, Supap Kirtsaeng v. John Wiley & Sons. Mr. Rosenkranz.\n",
      "Thank you, Counsel. Mr. McCarthy. ORAL ARGUMENT OF THOMAS R. McCARTHY IN NOS. 14-1468 & 14-1507\n",
      "I thought that we held that quite a lot in respect to corporate taxes. The three cases we found here, J.D. Adams, Gwin White & Prince, Hennerford, Central Greyhound of New York, all said that corporations, when they are taxed on their income by a state, that they have to apportion in a fair manner. Is that right?\n",
      "We will hear argument next in Case 13-1010, M&G Polymers v. Tackett. Ms. Ho.\n",
      "Well, I was talking about the private right of action cases, Justice Kennedy. So with respect to statutes that -- that predate Irwin, if you actually look at how Irwin has fared and what the Irwin scorecard is, more often than not, this Court has held that there isn't equitable tolling in suits against the government. The Court's considered that in five cases, and in four of them, Brockamp, Beggerly, John R. Sand & Gravel, and Auburn Regional Medical Center, it's held that the presumption, if it applies, is rebutted. So I think --\n",
      "Your Honor, I confess that I haven't gone through the -- the code with an effort to try to figure out where ones that are not jurisdictional. I think the ones that I have looked at are the ones that the Court has addressed, most significantly in the Brokamp case, in Beggerly, in Auburn Regional, in John R. Sand & Gravel, and now in -- in this case. And I think what -- what those precedents show is that what the Court has done with Irwin is not to treat it as a conclusive presumption, but, rather, to treat it as a rebuttable presumption --\n",
      "Well, and I think as we put it, Your Honor, that the scopes have to be virtually identical. We recognize that there could be some difference in change because whenever a mark is changed there will be some daylight between the two. We recognize that that is inherent in tacking, that there will always be some change, some degree of squeeze-out. The judgment determination is how much of a change, how much of a squeeze-out is -- is -- is permissible in one case such that the two marks can be viewed as legally the same mark to allow the tacking doctrine to operate. As another example just to point to that I think might come at this the opposite way, this -- in the red brief at page 50, there is the -- the example that the Respondents provide of D&J Master Clean, and this is an example where tacking was, in -- in -- in fact, allowed. In that context, the original mark was the mark \"Servicemaster.\" The second-in-time competitor came on the scene using the mark \"Master Clean.\" The third-in-time then, the -- the Servicemaster altered their mark to \"Servicemaster Clean\" and used that mark to exclude the intervening competitor, the \"Master Clean\" competitor. And the Court permitted tacking, again viewing this as a question of law. The reason it allowed tacking in that particular case was it sought to understand how close the later mark or the -- the \"Master Clean\" mark, this intervening mark, was to the rights that the trademark owner had in its original mark of \"Servicemaster,\" and it made a judgment finding that it was reasonably foreseeable that \"Servicemaster\" would -- would adopt the mark \"Servicemaster Clean,\" and thus there was nothing unfair in the marketplace to excluding \"Master Clean,\" that the implications of tacking in that case were, in fact, appropriate. And I think this -- this further shows the kind of legal determination and -- and reasoning that -- that turns on the interests of all the market participants that is uniquely situated to -- to the role that a court can play.\n",
      "We'll hear argument first this morning in Case 13-352, B&B Hardware v. Hargis Industries. Mr. Jay.\n",
      "We'll hear argument next in Case 12-1497, Kellogg Brown & Root Services v. United States, Ex Rel. Benjamin Carter. Mr. Elwood.\n",
      "Well, Justice Breyer, I think that both -- that Hildebrant, Smiley, Hawke, and also this Court's -- the -- a case that this Court decided a few months after Smiley, and that was block quoted in the Court's opinion last week in Yates, the Atlantic Cleaners & Dyers case, all strongly support the reading of the word -- the meaning of the word \"legislature\" that we advocate, and that was, in fact, the consensus definition of \"legislature.\" And I agree with you that I'm --\n",
      "Well, the American rule applies to litigation, and so obviously, in bankruptcy, you have some litigation, you have some non-litigation. But when you have a fee litigation matter arise, the American rule certainly applies, and Section 330, doesn't -- because it exists, doesn't mean the American rule, you know, is tossed out the window. The American rule still controls and you have to look at what Congress actually authorized. And so I think, for example, the Court's decision in Cooter & Gell --\n",
      "We'll hear argument first this morning in Case 14-86, the Equal Employment Opportunity Commission v. Abercrombie & Fitch Stores. Mr. Gershengorn.\n",
      "Justice Scalia, I believe that was the issue in Monsanto and Caplin & Drysdale, where this Court held a 5-to-4 decision that assets that are demonstrably tainted can be restrained over the objection of the defendant who needs those assets to retain counsel of choice. Today, I'm asking the Court not to allow the restraint of those assets that are demonstrably not tainted.\n",
      "We will hear argument next in Case 12-729, Heimeshoff v. Hartford Life & Accident Insurance. Mr. Wessler.\n",
      "We will hear argument next this morning in Case 12-79, Chadbourne & Parke v. Troice in the consolidated cases. Mr. Clement.\n",
      "Justice Alito, it gives employees two things. They give another defendant, which means another insurance policy. So for example, if you sue the company you get the E&O policy. If you sue the president at the same time, you get the D&O policy. So you get two separate insurance policies , which is more money, more availability. You get the personal liability. Officers hate to be sued; so do contractors. And if the public company goes out of business, you get that protection of monetary relief.\n",
      "It was his purpose for doing it. And the cases you can look at are Nye & Nissen --\n",
      "Okay. The last thing I wanted to address is there is a lot of discussion, particularly in some of the amicus briefs, to the effect that the board was acting under Federally delegated authority here under some -- as some kind of deputized Federal agent. That is not the case at all here. The board was acting under its State law authority. Sprint relies, for instance, on the AT&T vs. Iowa Utilities Board case for the proposition that the 1996 Telecommunications Act asserted Federal authority to regulate local telecommunications matters. That's true, insofar as it goes, but that case is limited to matters addressed by the '96 Act, which was addressed to create in competition within the local exchange marketplace. What we're talking about in this case is access services by which a long distance carrier, such as Sprint, delivers a long distance call to the local exchange carrier, such as Windstream, for completion to Windstream's customers. That service remains practically a monopoly service. Sprint has no way to get those calls to Windstream's customers, other than by connecting it to Windstream and letting Windstream -- compensating Windstream for carrying those calls to the end. Because of that, the Federal Telecommunications Act of '96, in Section 251(g), expressly reserved the tariffed access charge regime and did not affect the State's jurisdiction over intrastate access charges. Sprint acknowledges that in its reply brief at pages 22 and 23, but claims that the situation is unclear as to what applied between 1996 and 2011. But the fact remains that Sprint paid those intrastate access charges without protest from 1996 to 2009, when it made the unilateral decision to change the process and start withholding those payments.\n",
      "Mr. Chief Justice, and may it please the Court: The government began at step 2 of Chevron, but I would submit that this case can and should be resolved at step 1. The government is asking this Court to read the statute in a highly disfavored way, such that it is not harmonious, but at war with itself, and nothing in the language requires that. In fact, I would recommend that the Court turn to the back page of the government's brief, where the statute is actually set forth. And we can see that provision (h)(3) consists of one sentence, and that sentence consists of two parts, separated by a comma. Before the comma, the language sets forth one and only one eligibility criterion. After the comma, the language sets forth two things that shall be done if the eligibility criterion is satisfied. Now, importantly, the government does not contend that there is any ambiguity in the language before the comma. Everyone agrees that it contemplates and includes all derivative beneficiaries. There's no dispute about that. And a bedrock rule at the step 1 inquiry is that the Court reads the statute as a harmonious whole. That goes double when we're talking about a single sentence. So if there is a possible reading of this sentence that is harmonious with the clear opening clause that applies to all derivative beneficiaries under step 1 of Chevron. That is the reading the Court gives to the statute. It's especially important here because the precise question at issue in this case is a question of eligibility and scope. Who gets the benefit of the two benefits set forth -- the two duties set forth by the shalls in the language after the comma? And Congress spoke to that directly in the language before the comma, all derivative beneficiaries who have gone through the (h)(1) formula and whose age is determined to be over 21. Now, the government's claim of ambiguity here depends on asking the Court to read one of the benefits after the comma, automatic conversion, in such a narrow and limited way, a way not required by the plain language, a way that even the BIA actually did not adopt, but such that it is incompatible with the broad scope set forth before the comma. The Court should be very suspicious of that reading because it is exactly the contrary of the traditional tool of statutory construction going back to Brown & Williamson and FTC v. Mandel that says the Court reads a statute holistically as a harmonious whole. For the government's argument to work, the Court would have to be satisfied that we were in a situation like National Association of Home Builders v. Defenders of Wildlife, which is the only case that they cite for their ambiguity claim, but there, the Court faced two different statutes and acted at different times that were clearly contradictory. You could not comply with both of them at the same time. You had to pick one or other the other. And in that context, this Court said that opens the door to Agency interpretation. So in order for the --\n",
      "Now, why does the First Amendment allow a person to go to the heart of the military base, put on any demonstration they want, the statute doesn't apply for the reason that, once every four months, the PG&E has an easement to go out and read the meter.\n",
      "What it first says to the remanufacturers is that if you remanufacture our cartridge -- our Prebate cartridges, generally, you infringe our rights. But you will also infringe those rights, if you use Static Control's products to do it. But merely because one is a target, we do not believe it necessarily translates into standing. It did not translate into standing in the AGC case; the union was the target, and this Court, nevertheless, denied standing. The Fifth Circuit decision, the Procter & Gamble decision, which involved Procter & Gamble and Amway; there, the parties were actually competitors. And because of the nature of the statements that -- that Procter & Gamble allegedly made about compensation to Amway's distributors and how they get distributors, there, they were actually direct competitors, and standing was not provided, which, again, we think just reinforces that this is a narrow statutory remedy. The -- the -- couple points about the zone of interest test, which was advocated by Static in -- in their brief. That is certainly a general prudential background consideration. We think it would apply along with prohibition on -- on generalized grievances and asserting rights of third parties. But, here, it merely asked the question. We think AGC provides the answer to that question. And the zone of interest has been largely used in the APA context, and it's -- it's appropriate in -- in that context. There's a two-step inquiry under the APA. First, the APA itself is a procedural act, but, then, you have to go to the underlying substantive statute to determine who a party is -- what party is agreeing. The zone of interest, therefore, has to administer hundreds, if not thousands, of very different federal substantive statutes, and so some flexibility needs to be inherent in -- in that test. If such a test were employed, we think, in the Lanham Act, we could lead to over-enforcement, which has its own set of harms. We don't think you want to deter companies from putting even truthful information into the marketplace, for fear of facing lawsuits by remote parts suppliers. And -- and so, in this instance, we think the AGC test itself provides the answer to the question of what is in -- in the zone of interest.\n",
      "I'm sorry. Could you explain that? Because I thought that the purpose -- that the whole point of the C&L Enterprises case is to say that when a tribe agrees to arbitration, it has waived its sovereign immunity for that purpose in that proceeding. Are you saying that there was something special in this agreement?\n",
      "The solution to the point that you're raising, Justice Breyer, is to recognize that Petitioner was a contributing cause to all of Amy's losses. Amy's losses come from a vast, faceless, anonymous crowd of thousands of people scattered around the globe, from Denver to Denmark, who are looking at pictures of her being raped as an eight-year-old girl. And that aggregate group of people all contribute to a loss. And I'm sure that Your Honor is familiar with cases from this Court, for example, the Norfolk & Western case, where asbestos manufacturers all contributed to a particular loss. The result in that case was joint and several liability. Each person who contributed to the loss was on the hook for the damages in their entirety.\n",
      "Congress, in Section 522(k), specified specifically that a debtor's exempt property is not liable for any administrative expense. The bankruptcy court was not free to override that express and specific prohibition in the name of equity, a point that has been clear for at least 80 years, since this Court's case in Ginsberg & Sons, and said Congress made the judgment that debtors and their dependents, even dishonest debtors, ought not be deprived of their exempt property such that they would emerge from bankruptcy as wards of the State. Instead, Congress authorized other serious punishments for debtor misconduct. But arguments for punishment that the Code forbids must be addressed to Congress and not the supposed equitable discretion of the bankruptcy court. Now, if I could, I'd like to --\n",
      "Mr. Chief Justice, and may it please the Court: In this morning's first case, you will decide what principles should guide a district court's award of attorneys' fees under Section 285. Whatever standard you choose to adopt in that case, we believe that a district court's application to the particular facts of a case before it ought to be reviewed under a unitary abuse of discretion standard. That approach is consistent with this Court's repeated statements that decisions about the supervision of litigation ought to be reviewed under a deferential standard. And in this particular context, it's also supported by the text and history of Section 285, by 60 years of consistent appellate practice, and by the same sorts of practical considerations that led this Court to adopt a similar approach to very similar questions in Pierce and in Cooter & Gell. I'd like to start, if I could, by focusing on a point that hasn't come up so far in the argument, which is we've heard a lot about why district courts are best situated to make the determination in a particular case that they've lived with, often for years at a time, of whether or not a particular litigating position is unreasonable. And we think that's true and a very good reason to accord deference here. But we think another good reason to accord deference in this context is that applying de novo review requires a substantial expenditure of appellate resources. I think this case is a good example. The Federal Circuit affirmed the district court's decision on the merits in an unpublished decision and, in fact, without written opinion. But when it reviewed the district court's award of fees under a de novo standard, it was required to engage in a lengthy analysis that produced a lengthy written opinion. And we think applying a de novo standard and requiring appellate courts, and the Federal Circuit in particular, to engage in that kind of review encourages collateral appeals and encourages the expenditure of resources on decisions that don't actually produce the law --\n",
      "Well, I think we need to look at the basis of the judgment, which is grounded in the fact that they've -- they've found constitutionally that the -- the PRE standard was required. And I think this Court's precedent in BE&K just two years earlier says that the validity of fee-shifting statutes is not governed by the PRE standard. And if -- if the Court were to so hold, that would throw into question all of the fee statutes of this country because, accordingly, they presumptively would have to have the sham litigation test to be constitutional.\n",
      "Mr. Chief Justice, and may it please the Court: There are at least two issues in this case in which EPA and the Petitioners agree. The first is that the term \"air pollutant\" cannot be given a uniform construction throughout the Clean Air Act even after this Court's ruling in Massachusetts that \"air pollutant\" includes all things airborne for purposes of Title II. The second point of agreement is that greenhouse gases cannot be treated the same as other air pollutants for purposes of the PSD and Title V programs, because the unambiguous statutory requirements of those programs are incompatible with sensible regulation of greenhouse gases. EPA thinks it can fix this problem by imposing an atextual agency-created regime that applies only to greenhouse gases. The proper response, however, is for EPA to conclude that Congress never delegated regulatory authority over greenhouse gases in the PSD and Title V programs. Congress does not establish round holes for square pegs, and Brown & Williamson holds in these situations, an agency cannot make a round hole square by rewriting unambiguous statutory language.\n",
      "Well, but -- but two points. I mean, you -- I would submit you should be very cautious about interpreting these duties in ways that will make ESOPs unworkable, and I think that would basically cause many companies to say we can't put fiduciaries in that situation, so we're not going to have ESOPs at all. And the -- you know, again, because the special purpose of an ESOP is to give the employees a piece of the rock, ownership in the company, if the company is going through temporary hard times, even if there's a situation where there's some, you know, material misinformation that is out in the market, that may all be corrected in the long term. You know, in this case, if the fiduciaries had shut down the ESOP, they would certainly have been sued because they would have violated the plan terms, and the -- the plan has done very well. It's gone up from $2 to over $22. So they might have had a very hard time winning that case because they would have been challenged that prudence didn't really require you to shut it down. Yes, we were going through some severe problems, but we came through them. That's the razor's edge. That's the rock and the hard place. They're going to be sued unless you recognize this presumption that every court of appeals has recognized to give the ESOP fiduciary some leeway. They're going to be different from any other fiduciary in any other plan because it's the company's stock. And if they, you know -- if -- if the stock goes down under this open-ended duty of prudence, they're going to be sued for not having anticipated that and done something, sold, stopped trading, put out information. But if they don't do it and the stock goes up, they're going to be sued for that. And, in fact, you know, if you recognize the government's approach, there'll be a whole new class of cases, which is, if the stock goes up, their -- plaintiffs' lawyers will be able to argue, well, the fiduciary should have -- should have anticipated that, and the participants who were selling and deciding to move over to the S&P 500 fund, you let them sell their stock too cheaply, and that's a violation. So it's -- it's unworkable. We submit.\n",
      "Mr. Chief Justice, and may it please the Court: The Federal Circuit's holding that a party may be liable for inducing infringement under Section 271(b), even though no one has committed direct infringement, is wrong for two primary reasons. First, Section 271(b)'s text makes clear that to be liable for inducement, a party must induce conduct that constitutes direct infringement under 271(a). And second, I think in expanding 271(b), the Federal Circuit departed from the approach that this Court has -- has repeatedly employed in interpreting Section 271. I think the Federal Circuit was understandably concerned about allowing inducers to perform some steps of a process themselves to escape liability, but this Court has twice held in both Microsoft v. AT&T and before that Deep South v. Laitram that judicial concerns about gaps in 271's coverage should not drive the Court's interpretation of that provision. That is because any time that you close a gap in 271, expanding patent rights, you are invariably implicating competing policy concerns and it's for Congress to resolve those concerns. So to go to the -- the concern about circumvention, I think if Congress were just considering the -- the traditional active inducer who simply induces a party to perform all the steps of a process, that person compared to someone who performs some steps himself and induces someone else to perform the rest of the steps, there's no obvious policy reason to distinguish between those two actors.\n",
      "But now you're saying that AT&T system, Netflix, Hulu, all of those systems get their content and they don't push it down to you. They do exactly what you do. They let you choose what you want to see.\n",
      "-- because the time is about to expire, so you've got a marginal candidate who wants to go to the University of Texas at Austin and is also interested in ROTC. Maybe if race is taken into account, the candidate gets in. Maybe if it isn't, he doesn't get in. How does that impact the military? The candidate will then probably go to Texas A&M or Texas Tech? Is it your position that he will be an inferior military officer if he went to one of those schools?\n",
      "Ms. O'Connell. SUPPORTING PETITIONERS IN NOS. 11-218 & 10-930\n",
      "We'll hear argument next this morning in Case No. 11-597, Arkansas Game & Fish Commission v. The United States. Mr. Goodhart.\n",
      "No, I think the text of (b)(20) -- of (b)(3) expressly requires that questions, whether they be damages or liability that are common to the class, predominate over those that are individual as to class members. And I -- I fully accept -- and I am not arguing -- that the mere fact that there may be individual damages questions precludes class certification. I am actually arguing for the flip side of that issue, which is that just because it -- it may not be preclusive in certain cases doesn't mean that it is preclusive in no case. I would refer the Court to the Fifth Circuit's opinion by Judge Garwood in the Bell v. AT&T case, which was, like this, an antitrust case, where the Fifth Circuit acknowledged that, in many of these cases, it's almost hornbook law that there may be individual issues that would not preclude class cert, but that there are certain cases in which -- you know, the theory of injury and -- and the proof that would be needed to make it out is so sui generous and individualized --\n",
      "We'll hear argument next in Case 11-696 -- 697, Kirtsaeng v. John Wiley & Sons. Mr. Rosenkranz.\n",
      "No, I don't think anything that expressly. But the A&T and the --\n",
      "I'm sorry. Is it AT&T v. --\n",
      "In the AT&T Mobility case, the Court remarked that this was a -- that the arbitration agreement had certain provisions that made it easier for the consumer to use the arbitral forum. Is there anything like that in this arbitration clause?\n",
      "The Court hasn't had that case exactly, but it did decide Microsoft v. AT&T, and granted that was on a slightly different issue, but in that case the Court recognized -- that case, it was copies from a master disk, and it treated them as separate copies because they were actually separate articles, even though it was really easy to do, even though the actual copying is not done by human hands, it's done by -- by mechanical processes. In fact, in that case the Court talked and compared the making of software to the reproduction through biological processes, which is what we are talking about here. And so all we are asking the Court to do today -- I recognize it's a new technology and to the extent new technologies require different rules, Congress is the body that should be making those different rules. And when Congress has acted in this area, in the Plant Variety Protection Act and also in the software context in the Copyright Act, it has not adopted the wholesale exemption that Petitioner is asking for here.\n",
      "Not necessarily correct. There are a whole string of cases in which property owners raise takings as a defense rather than turning over the property. Kaiser Aetna is perhaps the most -- best known recent case, but out of an administrative context, there's the Florida Power & Light case. Penn Central was -- was like this. Loretto v. Teleprompter is like this. There's a whole string of cases. The government themselves cite six such cases, most of them fairly old, for this proposition. So there's nothing unusual about bringing a -- a defensive takings claim. Mr. Chief Justice, unless --\n",
      "Putting aside the question of local counsel, could we find that there was an abandonment if the law firm of Sullivan & Cromwell continued to represent Mr. Maples after the two young attorneys left the firm?\n",
      "It would have to do so under the B&O Railroad case in the early 1930s -- there was another Justice Brandeis opinion -- in which it would have to make a finding that to make that regulation that you posit, Justice Kagan, was necessary to avoid unnecessary peril to life or limb. In that case, the Court struck down the ICC's attempt to issue a regulation on a particular type of equipment because the ICC could not make that demonstration. So, in the current world, the FRA would regulate under the FRSA; it would not regulate under the LIA because under this Court's jurisprudence it is a harder standard to meet to implement a regulatory standard. That's our point. The regulatory field here does not need to be read as expansively as the other side posits, because the FRA has all the authority it needs under the FRSA if it chooses to promulgate those rules, and it has not chosen to promulgate those rules. The FRA can use conflict pre-emption to displace any State rule, but what they are seeking to do is to take the doctrine of implied field pre-emption, gain immunity from State law liability, and not be subject to any Federal rules. And it's that proposition that is an extraordinary proposition of implied field pre-emption. We found no case from this Court that goes that far.\n",
      "Everything is silent. I think it was not. As to the question about whether courts could impose concurrent consecutive sentences, what the report says, footnotes 310, 314, 318, pages 126, 127, and 129 of the sentencing report, there were some courts that thought that a prior statute stopped them from imposing only concurrent sentences in the dual sovereignty context. Congress made very clear -- in fact, it cited by name United States v. Segal, one of the cases the Government cites for this proposition, as being incorrect. We want to make it clear, Congress says in a report, you can impose concurrent sentences, but all along consecutive sentences were imposed anticipatorily. And so, this is sort of like, you know, the rule that someone cannot have M&M's at all being held to mean that you cannot have candy after dinner if you have Snickers after dinner every night. Once you remove the obstacle to having M&M's, then presumably you can have them after dinner as well. There was no rule that you couldn't have candy after dinner. There was no rule that Federal courts could not sentence anticipatorily. There was simply a statutory bar that some courts thought stopped them from imposing concurrent sentences in the dual sovereignty context.\n",
      "We'll hear argument first this morning in Case 11-139, United States v. Home Concrete & Supply. Mr. Stewart.\n",
      "Well, the Court in the MCI -- in the MCI v. AT&T case did indicate that. But in any event, the -- on its terms, that definition supports our reading over Kan Pacific's because it does indicate, even as to that dictionary definition, that the -- that the most common meaning of the term is the meaning referring to spoken communication. And this Court frequently looks to the most common meaning for purposes of statutory interpretation, as it did in Mallard in construing the word \"request,\" and in Ramsey in construing the word \"envelope.\"\n",
      "Let me try to answer that question, Justice Kennedy, and get back to the question you asked me earlier. The -- the -- I do think one striking feature of the argument here that this is a novel exercise of power is that what Congress chose to do was to rely on market mechanisms and efficiency and a method that has more choice than would the traditional Medicare or Medicaid type model. And so, it seems a little ironic to suggest that that counts against it. But beyond that, in the sense that it's novel, this provision is novel in the same way, or unprecedented in the same way, that the Sherman Act was unprecedented when the Court upheld it in the Northern Securities case, or the Packers and Stockyards Act was unprecedented when the Court upheld it, or the National Labor Relations Act was unprecedented when the Court upheld it in Jones & Laughlin, or the dairy price supports in Wrightwood Dairy and Rock Royal. And --\n",
      "And so, that's -- I think it's rather detailed, but I think it's a rather clear indication that the Anti-Injunction Act applies. The -- the refund statute that does specifically refer to penalties -- that has nothing to do with this argument that it's assessed and collected in the same manner as a tax. That would simply go to the point that, well, you can't just call it a tax, because they've referred to it as a penalty. And, finally, on jurisdiction, you know, I think the key point is we have a long line of this Court's decisions that's really been ratified by Congress, with all these exceptions in jurisdictional terms. As I read Bowles and John R. Sand & Gravel, the gist of those decisions was not any sort of special rule about appeals, It's that when we have that situation, which I would submit applies as much to the collection of Federal taxes as it does to appeals from Federal district courts when we have this degree of -- of precedent, including precedent from Congress in the form of amendments to this Anti-Injunction Act, that should be -- the presumption should be that this is jurisdictional. If there are no further questions.\n",
      "I think Gertz v. Welch says that. Dun & Bradstreet says you have to at least look at the context of the situation.\n",
      "Campbell & Powers. Those are both cases where the criminal defendant asserted rights of -- in one case it's a petit juror and another in the other case it was a grand juror, and there were discriminatory preemptory challenges in those cases, and the court allowed those criminal defendants to assert those constitutional rights. Several members of the court also found there was standing in Miller. Kowalski pointed out in Craig v. Boren that there is a very forgiving standard when third-party rights are at issue in the case.\n",
      "We will hear argument first this morning in Case 09-893, AT&T Mobility v. Concepcion. Mr. Pincus.\n",
      "It gave them that flexibility, the agency determined in the 1994 chief counsel letter and we hope the Court does read it, makes it clear that the agency concluded that in this situation, and it's a rare situation, the manufacturer was in the best position to decide what was most appropriate for its vehicles. And, again, there is this flexibility objective. If you look at Fidelity Federal Savings & Loan v. A. la Cuesta, the decision cited on page 19 of our brief, you have this Court recognizing that a Federal law that gave flexibility where you have a state mandate that interferes with that flexibility, that is an actual conflict. Ultimately under Geier, this Court is looking for the existence of an actual conflict. We think a rule that says manufacturers, you are free to choose between this type of seatbelt and that type of seatbelt, and the reason we are giving you that flexibility is to advance federal safety and practicability objectives. We are not going to require you to put a lap/shoulder belt in there because that would frustrate those Federal objectives, the state law tort suit that would mandate the very thing that the agency chose not to, to advance federal objectives is preempted. If there are no further questions?\n",
      "There are -- there are certainly a number of instances where they definitely are talking about the trial. I do think it -- it is even muddy the extent to which they are incorporating trial facts versus summary judgment facts. The example I gave about this point where Ms. Bright conceded on cross that Ms. Ortiz indeed would have been separated and the assault, second assault, precluded, it's one of two things: Either the Sixth Circuit's reviewing summary judgment and picking a couple of trial facts it thinks helps to review and missing the facts, or it's doing -- it's looking ahead at these trial facts and because -- particularly because the district court never weighed in on that, on a Rule 50(b), it's botching the record. And it goes to the heart of this Court's cases from Cone v. West Virginia Pulp & Paper in 1947 up through Unitherm, which says we have to have the district court review the sufficiency of the evidence before the court of appeals could even have the power to possibly consider --\n",
      "Well, the district court found that there was a real prospect of employee backlash if the employees knew about these benefit reductions. It's well-established in behavioral economics that people are very averse to losses. So if a -- if the statute and the regulations are requiring the loss to be disclosed, it isn't going out on a limb to say that there's going to be a reaction to that. And here, Cigna knew that there was a reaction to that, and they had examples from the press of with Deloitte & Touche had had a similar situation where they had to roll back the cash balance changes because employees were so upset. I think, in response to Justice Alito's question, the -- I don't think that the individual has to -- that if the individual has to prove possible prejudice, then I think that, as -- as our district court ruled here, then I think the standard inevitably becomes very close to actual prejudice. And so I think that the possible prejudice is really to the employee group. It's to the -- the statute is in terms of the average plan participant. It's all based on objective standards.\n",
      "We'll hear argument first this morning in Case 09-1279, Federal Communications Commission v. AT&T, Inc. Mr. Yang.\n",
      "Yes, you do, Your Honor. You get (c)(2) and (c)(3) at TELRIC rates. And so, the answer to the question presented is yes, for three reasons: First, because the FCC says so. And, as the expert agency charged with interpreting and implementing the Act, that conclusion is entitled to deference. Second, the FCC's conclusion is consistent with the plain text of the statute and the implementing regulations. And, third, the FCC's conclusion is consistent with the policies embodied in the Act, because the practical result of affirming the Sixth Circuit opinion in this case is that a competitive carrier, like Sprint for example, will be forced to either charge its customers more for interconnection or lay tens of thousands of duplicate entrance facility cables, and those are precisely what the Act were designed to prevent. I'd like to start with the Sixth Circuit opinion -- and, specifically, this is at page 20a of the Talk America cert petition appendix -- because this goes to the heart of AT&T's position and the Sixth Circuit's conclusion with respect to the orange plugs and cords analogy. You'll recall that the Sixth Circuit said this was like a situation where a homeowner had a plug in their garage and a long orange cord extending out to a park, which the court called the entrance facility, and then the competitive carrier would be that person in the park. On page 20a of the petition appendix in footnote 9, about halfway down, this is the key flaw in the Sixth Circuit's reasoning: The Sixth Circuit says, \"If you, as the homeowner\" -- that's the -- I'm sorry, that's the incumbent -- \"had said that they may plug into the surge protector, then the big orange extension cord is just an 'entrance facility.' But, if you had said they must plug into the big orange extension cord, then the big orange extension cord becomes the 'interconnection facility' and, consequently, the park goers\" -- the competitors -- \"may plug into it.\" The problem with this is that the Sixth Circuit was wrong in that the incumbent doesn't get to choose where the point of connection is. The statute and the regulations and the FCC make clear it's the competitor that gets to choose. So, if the competitor chooses the end of the extension cord where it connects to the CLEC network in the park, then even the Sixth Circuit agrees with us and the Seventh, Eighth, and Ninth Circuits that the entrance facility is the interconnection facility.\n",
      "Mr. Boutrous, there was a case, it was in the '70s, and it was a class action against AT&T for, I think, promotion into middle management. What was at issue there was a part -- a test, part objective, but then in the end, the final step was a so-called total person test, and women disproportionately flunked at that total person. And the idea wasn't at all complicated. It was that most people prefer themselves; and so, a decisionmaker, all other things being equal, would prefer someone that looked like him. And that was found, that total -- the application of that total person concept was found to be a violation of Title VII. This sounds quite similar. I mean, it's not just -- it's not subjective. You have an expert -- I know you have some questions about that expert -- but the expert saying that gender bias can creep into a system like that simply because of the natural phenomenon that people tend to feel comfortable with people like themselves.\n",
      "And again, it says, the court finds that plaintiff failed to allege State tort law violations in the complaint such that defendants were adequately noticed, that a separate defense as to these claims would need to be prepared at the beginning of the litigation. The record -- this is on -- that's on 32A of the petition appendix. It goes on to say, the record reflects that throughout the litigation the focus of both plaintiff and defendant was plaintiff's section 1983 claim. And if you look at the -- the correspondence between the parties, the summary judgment papers, it is 1983 from start to finish, until -- well, until the 11th hour. And in fact there's even a specific statement in which the city, in an abundance of caution says, just to be clear, there are no State law claims here; and I think the district court is within its discretion. I would point the Court to the cases in which this Court has examined the standard of review for rule 11 decisions, and the Court has held in Cooter & Gell and in Pierce that we give district courts very, very wide berth on these questions, precisely because they're on the ground, they recognize what the -- what the standards are for pleading who is going to be on notice as to what, and this is a funny case in that regard. It's unusual in that these things were really put to the side and parked until the 11th hour.\n",
      "No, I think -- I think historically that -- that's a fairly accurate description of what has happened with the emergence of the Petition Clause over the last 6 or 700 years of Anglo-American history. There were no courts to which people could seek redress against the crown at the time of Magna Carta. Over time the courts became available to do that. Insofar as they did, on our view, the Petition Clause would now apply. And if I might turn to a question you asked earlier. You expressed some skepticism about whether the Petition Clause applies to lawsuits. I note that in at least half a dozen decisions that this Court has held that, and I think that was the premise of your concurring opinion in the BE & K Construction case a few years ago. And we don't in this regard have to get deeply into history in the debate about whether courts are covered. The text of the First -- of the Petition Clause is sufficient on its face. It doesn't say petitions to the legislature. It says petitions to the government, and that was clearly a deliberate choice, because the States --\n"
     ]
    }
   ],
   "source": [
    "for k, v in data.items():\n",
    "    b_found = False\n",
    "    for _, e in v:\n",
    "        if \"&\" in e:\n",
    "            print(e)\n",
    "            break\n",
    "#             import pdb; pdb.set_trace()\n",
    "    if b_found:\n",
    "        print('found')\n",
    "        break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "id": "e1ca25a5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CHIEF JUSTICE ROBERTS\n",
      "  We'll hear argument first this morning in Case 09-1403, Erica P. John Fund v. Halliburton Company. Mr. Boies.\n",
      "\n",
      "MR. BOIES\n",
      "  Mr. Chief Justice, may it please the Court: The district court below found, and it is not disputed here, that the plaintiff fulfilled all of the requirements of Rule 23(a) for class certification. The district court also found, and the court of appeals affirmed, that the plaintiffs demonstrated all of the requirements for class certification under 23(b)(3) except for the Fifth Circuit's loss causation requirement. The court below recognized that whether or not there was an efficient market was not disputed. It was conceded that we have an efficient market here. There were no challenges --\n",
      "\n",
      "CHIEF JUSTICE ROBERTS\n",
      "  Mr. Boies, if could I just stop you there.\n",
      "\n",
      "MR. BOIES\n",
      "  Certainly.\n",
      "\n",
      "CHIEF JUSTICE ROBERTS\n",
      "  What if that had been disputed? Is that something that can be disputed at the certification stage?\n",
      "\n",
      "MR. BOIES\n",
      "  Yes, Your Honor. The --\n",
      "\n",
      "JUSTICE KAGAN\n",
      "  Mr. Boies, what's the difference then? Why could that be disputed at the certification stage, but not the question of price impact?\n",
      "\n",
      "MR. BOIES\n",
      "  Because the issue of efficient market goes to the presumption of reliance, and if the court holds at the certification stage that there is no efficient market, then the basis for presuming class-wide reliance is impacted. And so you can have a situation in which the common issues do not predominate over the individualized issues. That cannot happen with respect to loss causation because, as Respondent concedes here, loss causation is a common issue.\n",
      "\n",
      "JUSTICE KAGAN\n",
      "  Well, how about materiality? Could you rebut materiality at the certification stage?\n",
      "\n",
      "MR. BOIES\n",
      "  No, Your Honor, we don't think you can rebut materiality at the -- at the certification stage. I would note that under the Fifth Circuit rule, loss causation is in addition to materiality.\n",
      "\n",
      "JUSTICE KAGAN\n",
      "  Well, now I'm a little confused, because the efficient market and materiality are all part of the prima facie case triggering the Basic presumption. So, why couldn't you rebut one part of that case but not another part of that case?\n",
      "\n",
      "MR. BOIES\n",
      "  Because the issue of materiality is something that goes to a class-wide common issue. The issue of reliance can go to whether or not issues predominate or not. Rule 23(b)(3) talks about whether common issues predominate or not. That's the issue at class certification stage. The merits issue is not implicated at class certification --\n",
      "\n",
      "JUSTICE ALITO\n",
      "  But common reliance --\n",
      "\n",
      "MR. BOIES\n",
      "  -- under Rule 23 --\n",
      "\n",
      "JUSTICE ALITO\n",
      "  -- can be rebutted at the -- common reliance can be rebutted at the certification stage?\n",
      "\n",
      "MR. BOIES\n",
      "  Excuse me, Your Honor?\n",
      "\n",
      "JUSTICE ALITO\n",
      "  The Basic presumption can be -- can the Basic presumption be rebutted at the certification stage?\n",
      "\n",
      "MR. BOIES\n",
      "  The Basic presumption of reliance, yes, Your Honor. For example, if you were to take a situation in which you -- not present here, but where you disputed whether or not the market was efficient or not, that is something that could be decided at the class certification stage.\n",
      "\n",
      "JUSTICE ALITO\n",
      "  Can it be rebutted by proof other than proof generally disproving the efficiency of the market?\n",
      "\n",
      "MR. BOIES\n",
      "  We believe under the Court's decision in Basic that that is something that is reserved for trial, that -- that rebuttal.\n",
      "\n",
      "JUSTICE ALITO\n",
      "  And what is that based on, the footnote in Basic?\n",
      "\n",
      "MR. BOIES\n",
      "  Yes. Yes, Your Honor.\n",
      "\n",
      "JUSTICE ALITO\n",
      "  Well, that's pretty thin, isn't it? It's a -- it's dictum in a footnote in an opinion issued at a time when conditional class certification was permitted. Do you have anything else to support that?\n",
      "\n",
      "MR. BOIES\n",
      "  I don't from this Court, Your Honor.\n",
      "\n",
      "JUSTICE ALITO\n",
      "  Do you have anything in the rule to support that?\n",
      "\n",
      "MR. BOIES\n",
      "  Anything in the rule?\n",
      "\n",
      "JUSTICE ALITO\n",
      "  Yes.\n",
      "\n",
      "MR. BOIES\n",
      "  Well, I think the -- I think what the rule does is it talks about whether issues of common issue predominate over individualized issue. And since this is something that would be at the class certification stage, not creating individualized issues, we would think that is something that's reserved for trial.\n",
      "\n",
      "JUSTICE GINSBURG\n",
      "  Mr. Boies, how would it work in your view of the case? That is, you say that the loss, what's been called loss causation, is not something to be decided at the certification stage, but at the trial or summary judgment. Well, how -- how would the plaintiff class prove loss causation? Given the reliance hurdle that you have surmounted, now you're in -- you have your class certified; how does the class prove loss causation.\n",
      "\n",
      "MR. BOIES\n",
      "  As -- as this Court indicated in Dura, in order to prove loss causation, you must demonstrate that you had either an increase in the prices, and this -- this assumes that you are concealing negative information; the reverse would be true if you were concealing positive information -- an increase at the time that the concealment took place or a decline when the actual facts were revealed. And it would be required at summary judgment by a summary judgment standard, and at trial by a trial standard, and at the pleading stage by a pleading standard, for the plaintiff to make out that case. In other words, there are three times loss causation is tested: Pleadings, summary judgment, and trial. The question is whether a fourth test should be interposed at the class certification stage.\n",
      "\n",
      "JUSTICE SOTOMAYOR\n",
      "  Counsel, doesn't a lack of response to a disclosure -- couldn't it be in some situations reflective of an inefficient market?\n",
      "\n",
      "MR. BOIES\n",
      "  Yes, Your Honor, I think it could. I think that you -- you could very well have a situation in which if you demonstrated a lack of response, that could impact the issue of efficiency; and I think that would be an issue that-- that in a proper case where unlike this one it was presented --\n",
      "\n",
      "JUSTICE SOTOMAYOR\n",
      "  Why is it? Why is this case -- why can't you pigeonhole this case into that argument, which, it appears what your -- what the Respondents have done is move away from the loss causation proof and gone to the issue of whether they rebutted reliance or not.\n",
      "\n",
      "MR. BOIES\n",
      "  The -- the problem is, as the Fifth Circuit noted at page 335 of the F.3d report, efficiency of this market was conceded below. In other words, the Respondents conceded that this market was efficient? So that issue -- that issue was not presented, and the rebuttal issue was not -- was not presented in this case.\n",
      "\n",
      "JUSTICE SCALIA\n",
      "  Mr. -- Mr. Boies, you talked about loss causation. The Respondents assert that that's not what the Fifth Circuit was really doing, that -- that really they're just trying to rebut the presumption essentially of -- of Basic by -- by showing that at the -- at the far end, there was -- there was nothing that could justify the presumption. Would you be satisfied if we just said that we agree with you that the requirement to prove loss causation is -- is no good, and sent it back to the Fifth Circuit and then let the Fifth Circuit adopt the theory that Respondents assert they have already adopted? I mean, it's sort of a Pyrrhic victory, it seems to me, if you haven't just disapproved loss causation.\n",
      "\n",
      "MR. BOIES\n",
      "  Well, it depends on how the Fifth Circuit then construes reliance.\n",
      "\n",
      "JUSTICE SCALIA\n",
      "  Well, they -- they would construe it the way Respondents say they have already construed it.\n",
      "\n",
      "MR. BOIES\n",
      "  Your Honor, I think that if they simply changed the wording and called loss causation reliance, obviously it wouldn't make any difference. But as this Court indicated in Basic, and just last month in Matrixx, loss causation and reliance are two distinct elements. And the reason that's important in this particular context is that reliance can create a situation where you have individualized issues predominating over common issues. Loss causation can't because, as Respondents concede here, loss causation is a class-wide issue. Either -- there either is loss causation or is not loss causation. That, as this Court held in Dura, is an element of the merits case. It is one that we must prove at all three stages -- pleadings, summary judgment, and trial. But it is not something that goes to the Rule 23 standard.\n",
      "\n",
      "JUSTICE SCALIA\n",
      "  I think what you've said is that there's really no difference between loss causation and what Respondents assert that the Fifth Circuit found.\n",
      "\n",
      "MR. BOIES\n",
      "  No, Your Honor. I did not mean to say that. I think that there is a difference. I think there's a -- I think there are -- there are two differences. There's a difference between what Respondents say and what the Fifth Circuit says. The Fifth Circuit talks about loss causation, says it's in addition to efficient market, does not talk about reliance.\n",
      "\n",
      "JUSTICE SCALIA\n",
      "  Right.\n",
      "\n",
      "MR. BOIES\n",
      "  There's also a difference between what Respondents say and what this Court has said in Basic and Matrixx and the other cases, in terms of what is required to prove for class certification. What is required to prove for class certification under Rule 23, unless and until Rule 23 is changed, is that common issues predominate. Common issues will predominate even with respect to what the Respondents here argue because -- because what they argue, just like loss causation, is a common issue.\n",
      "\n",
      "JUSTICE SCALIA\n",
      "  Okay, but -- but you -- you would want us to say that and not just say that loss causation --\n",
      "\n",
      "MR. BOIES\n",
      "  Yes. Yes, Your Honor. Yes, Your Honor.\n",
      "\n",
      "JUSTICE SOTOMAYOR\n",
      "  How do you see or what difference do you see between their loss causation evidence and an inefficient market? Could they -- assuming there was no stipulation in this case, do you see any difference in -- in how they could use the fact that other information affected the market and not this one? Or is it your theory of the case that there is no evidence that they could marshal to show that this is an inefficient market?\n",
      "\n",
      "MR. BOIES\n",
      "  I don't believe under this Court's decision in Basic that, given the actual objective facts that have been admitted -- it's a very public market, very widespread distribution of information, a lot of analysts are reporting on it -- I don't believe that as a objective factual matter they would be able ever to demonstrate that this was not an efficient market. If you had a much smaller market, indeed if you -- if you had a market as the Court was considering in Basic, which was a much smaller market, much less public, much less analyst support, there may be areas in which they -- they could rebut it. But I think, given what we all know about the Halliburton stocks -- widely traded, large number of shares traded, a lot of analysts, a lot of public information -- I don't believe under this Court's decision in Basic you could conclude reasonably that that was not an efficient market.\n",
      "\n",
      "JUSTICE ALITO\n",
      "  What do you say to -- to the following argument, that there are some economists who say that, even in a market that is generally efficient, there can be instances in which the market does not incorporate certain statements into the price of a stock; and therefore even when it is demonstrated that the market meets the test for efficiency that the lower courts have settled upon in the wake of Basic, the defendant in a -- in a class action where there is reliance on the Basic presumption should be permitted at the class certification stage to prove that the allegedly fraudulent statements had no impact on price, and by doing that destroy the theory that the class relied on the statements, because they relied on the price which incorporated the statements?\n",
      "\n",
      "MR. BOIES\n",
      "  I -- I think, Your Honor, that if you have a situation in which the proof is class-wide, it is something that goes only to summary judgment or trial. It does not go to the class certification stage. With respect to the issue of whether somebody is relying on an efficient market, that is distinct from whether a particular statement was or was not actionable. In other words, the summary judgment issue, the trial issue, is whether the particular statement was actionable and that includes all of the things that the court identifies. But those issues are going to be, if there is an efficient market, class-wide issues. In other words, it's not going to be the case that in a particular instance a statement did not get into the market will affect only one member of the class. It's going to affect all members of the class. Because it is something that is common all of the class members, Rule 23 says that is something for trial, not for class certification.\n",
      "\n",
      "JUSTICE KAGAN\n",
      "  Well, whether there's an efficient market is also common to all members of the class, so why would you make an exception for that?\n",
      "\n",
      "MR. BOIES\n",
      "  Because if there's no efficient market, then individualized issues are going to predominate. That is, the test under Rule 23 is whether individual issues or common issues are going to predominate. If you destroy the efficient market theory in a particular case, then individual issues of reliance can predominate. However, that can't happen with respect to loss causation or price distortion or any of these other issues that are fundamental to the merits and are common to the entire class, because if there's no loss causation, there's no cause of action. As this Court held in Dura, there must be loss causation. So if there's no loss causation there aren't any individual issues to adjudicate. If there are no more questions, I would save the remainder of my time for rebuttal.\n",
      "\n",
      "CHIEF JUSTICE ROBERTS\n",
      "  Thank you, counsel. Ms. Saharsky.\n",
      "\n",
      "MS. SAHARSKY\n",
      "  Mr. Chief Justice, and may it please the Court: The Fifth Circuit erred in requiring proof of loss causation at class certification for three reasons: First, it's conducting a merits inquiry that's not tethered to the Rule 23 requirements; second, it's taking a presumption and requiring plaintiffs to prove it; and third, it's confusing the distinct elements of reliance and loss causation. Just to start in with some of the Court's questions: First, Justice Scalia's: Does the court require proof of loss causation? The Fifth Circuit could not be more clear. It is not talking about rebutting the presumption of reliance, giving the defendants an opportunity to do that at class certification. It is putting an affirmative burden on plaintiffs that they have to meet in every single case, even if the defendants do not come to court with any evidence. And that is a very heavy burden, as the district court in this case realized. And just to make this as concrete as possible, loss causation is the question at the end of the day, whether the price decline that caused the losses was sufficiently related to the earlier alleged material misstatement and whether there was any other cause that could have led to the price decline. So if a plaintiff cannot come in and prove loss causation, there could be many reasons for that. It may be because the market is not efficient. It could also be because there's no material misstatement. But it could also be, as this Court recognized in Dura, that there was a material misstatement, it did inflate the stock price, but then other causes such as a bad economy or other news about the company came along, and that's what caused the stock price to drop. Justice --\n",
      "\n",
      "JUSTICE SCALIA\n",
      "  But you acknowledged that if the cause was the fact that the market was not efficient, that could be raised at the certification stage.\n",
      "\n",
      "MS. SAHARSKY\n",
      "  Well, that's certainly what the Court suggested in Basic and what the courts of appeals have done, is to say that that's a threshold showing that is sufficiently collateral to the merits that it needs to be made, so that the presumption can be invoked in the first instance. But these ideas about rebutting the presumption by showing that at the end of the day the plaintiff can't prove its case, these are things, as Mr. Boies said, that stand or fall on a class-wide basis. And the real problem with the Fifth Circuit's decision is that it did not tie its proof of loss causation to the requirements of Rule 23. Everyone agrees here that loss causation stands or falls on a class-wide basis.\n",
      "\n",
      "JUSTICE KENNEDY\n",
      "  The rule isn't, I take it -- or correct me if I'm wrong -- that simply because the issue is on a class-wide basis, it can't be challenged at the certification stage. We don't have a rule that's that broad, do we? Or am I missing a point?\n",
      "\n",
      "MS. SAHARSKY\n",
      "  Well, that's what Rule 23, 23(b)(3), which is the one at issue here -- the question is do common issues predominate over individual ones. What you're trying to answer is can this group of people proceed together, not can this group of people make out their case.\n",
      "\n",
      "JUSTICE KENNEDY\n",
      "  But suppose there's no demonstrated basis that that common issue exists?\n",
      "\n",
      "MS. SAHARSKY\n",
      "  Then I think the plaintiff should lose at the 12(b)(6) stage, and that is a stage that has real bite after this Court's decision in Dura and after the PSLRA. There are heightened pleading requirements that apply. There are plaintiffs that will lose at summary judgment on the issue of loss causation, for example, because, A, either they don't allege a price drop, B, they don't connect the price drop to the earlier distortion of the market when there's a material misstatement. There can be many reasons that they lose at that merits stage, but class certification is not a merits stage, and the Fifth Circuit made it one because of its own policy judgments about the effects of class certification. And with all due respect to the Fifth Circuit, it's just not that Court's judgment to make that --\n",
      "\n",
      "CHIEF JUSTICE ROBERTS\n",
      "  Class certification is not a merits determination except with respect to reliance? Except with respect to the fraud on the market theory? That you can; that is a merits inquiry and you can decide it at the class certification stage?\n",
      "\n",
      "JUSTICE KENNEDY\n",
      "  And except, just to add to the Chief Justice's question, an efficient market theory?\n",
      "\n",
      "MS. SAHARSKY\n",
      "  That's right. You're asking is this theory going to be available to the plaintiffs at trial, and the way that the plaintiffs show that the theory is available to them is by establishing an efficient market and saying that they traded within the time period while the price was distorted. It's just like establishing any other threshold inquiry that would make evidence or a legal theory available at trial. But the question the Court is supposed to be asking at the 23, at the Rule 23 stage, the class certification stage, is not can these people win on the merits. And that's a question the Fifth Circuit was asking. The question it's supposed to ask is can this group of people proceed together.\n",
      "\n",
      "JUSTICE ALITO\n",
      "  You seem to -- maybe I don't understand your argument, but you and Mr. Boies seem to be arguing that whether there is a common question -- that it is a common question whether there is a common question, and therefore that has to wait until the merits stage. Is that what you're saying?\n",
      "\n",
      "MS. SAHARSKY\n",
      "  No, that's not what we're saying. What we're saying is when common issues predominate on the issue of reliance, and when the Petitioners -- or when the plaintiffs invoke fraud on the market and they show that there is an efficient market, this Court said in Basic, they can all proceed together because they are showing that the price -- that the material misstatement was reflected in the stock price. This is an impersonal market in which you rely on the stock price. They all rely on it in the same way.\n",
      "\n",
      "JUSTICE ALITO\n",
      "  And if they show that the statement was not incorporated in the price, in the price, and they're not claiming that they relied, that every member of the class actually relied on the statement, they're all claiming they relied on the price - if they show that the statement wasn't incorporated in the price, then why doesn't reliance cease to be a common issue and become a question of an individual issue that would have to be proved by each, each member of the class?\n",
      "\n",
      "MS. SAHARSKY\n",
      "  Well, in that circumstance reliance ceases to be and the case cannot be established on the merits. They stand or fall together on the merits. Their theory is the same for all of them.\n",
      "\n",
      "JUSTICE ALITO\n",
      "  Yeah, but the fact that they would lose on the merits doesn't necessarily mean that they are entitled to class certification.\n",
      "\n",
      "MS. SAHARSKY\n",
      "  Right. They're entitled to class certification if they have a common issue. And what the Court said in Basic is that if they set out the prerequisites for the fraud on the market, which the court of appeals agreed were met in this case, that they could proceed together. That threshold showing is required. Justice Kagan, I take your point that there is -- that even the question of whether the market is efficient is a common one, so perhaps one could logically say: Well, they have a common issue on the efficiency of the market; why should they even have to show that at class certification? But this Court said in Basic, and the courts of appeals have said, it's reasonable in that case since it's so divorced from the merits to require a threshold showing to even allow them to invoke the presumption at the outset. But that is very, very different from what the Fifth Circuit said in this case. The Fifth Circuit in this case said basically: Prove your whole case. You don't just have to prove that there was a price decrease; you have to prove that there was an initial material misstatement, that it distorted the stock price, that it led to a price decrease and that the price decrease can't be, can't be shown by any other superseding cause. It's essentially, as the Seventh Circuit said --\n",
      "\n",
      "JUSTICE SCALIA\n",
      "  Can you -- can you do this in reverse? I mean, suppose the class comes in and, instead of proving at the outset that the market's an efficient market and allege a misrepresentation, they come in at the back end and they say: When that statement that we assert was a misrepresentation was corrected, the price of stock went down and we lost money. Now, it seems to me you would have to argue, well, that's a good allegation if it's an efficient market, which is a common question, right?\n",
      "\n",
      "MS. SAHARSKY\n",
      "  Right.\n",
      "\n",
      "JUSTICE SCALIA\n",
      "  So they can certify under Rule 23 by using the back end. Instead of proving the efficient market, they can prove that there was a statement correcting the alleged misrepresentation, the price of stock went down, right, and they can certify the class?\n",
      "\n",
      "MS. SAHARSKY\n",
      "  No. The Court said --\n",
      "\n",
      "JUSTICE SCALIA\n",
      "  Why not? It would be -- it would be a common question whether the market's efficient or not.\n",
      "\n",
      "MS. SAHARSKY\n",
      "  This Court said in Basic that in order to establish the presumption that you need to show the efficiency of the market, the trading during the relevant time period. I agree with you that --\n",
      "\n",
      "JUSTICE SCALIA\n",
      "  They're not relying on that assumption. They -- they come in and show that there was a correction of what we alleged was a misstatement and the market went down. That's all that they allege. And of course, that proves anything only if there's an efficient market. But that will be a common question to the whole class, so we'll, we'll -- we'll save that for later.\n",
      "\n",
      "MS. SAHARSKY\n",
      "  Well, with respect, just alleging that the market went down would not be enough to show that there was an initial price distortion because of the company's material misstatement. Stock prices can go down for any number of reasons. There's a significant linkage that's required between the initial material misstatement and the eventual loss.\n",
      "\n",
      "JUSTICE SCALIA\n",
      "  Well, but they assert that. They assert that the reason it went down was because of the initial misstatement.\n",
      "\n",
      "MS. SAHARSKY\n",
      "  Certainly in the courts of appeals now, that's not the way the plaintiffs proceed. The way they proceed is on the Basic theory.\n",
      "\n",
      "JUSTICE SCALIA\n",
      "  I understand that. I'm just saying that seems to me it's a crazy way to run a railroad.\n",
      "\n",
      "MS. SAHARSKY\n",
      "  I don't think that that's --\n",
      "\n",
      "JUSTICE SCALIA\n",
      "  If you can allege what's upfront, you can allege what's -- what's in the back, and what's upfront becomes a common question, so you certify the whole class.\n",
      "\n",
      "MS. SAHARSKY\n",
      "  With respect, Your Honor, I mean, if you -- if you would like to -- if you would like to expand even beyond Basic and allow class certification. But the courts of appeals have used Basic for 20 years, Congress is well aware of it and has not seen fit to change it. This is the way that these cases proceed. This Court at the time of Basic recognized that every court of appeals had thought that it made sense to proceed in that way, using the fraud on the market theory. This is well established. And just to be clear, Respondents never suggested in this case that Basic should be revisited. This is not an issue that the courts below considered. This is not an issue that was fully briefed, and it's not something that we think should be considered. The problem in this case is that the Fifth Circuit took it upon itself to tighten the Rule 23 requirements. It was not satisfied with the rules as they exist, and it took the class certification stage and turned it into a merits inquiry stage. They required plaintiffs to prove almost their entire case at this stage of the litigation, and that just wasn't right, because the class certification stage -- can I finish this -- is about whether plaintiffs can proceed as a group together, as the Court in Amchem said they often can in securities fraud actions. The judgment should be reversed.\n",
      "\n",
      "CHIEF JUSTICE ROBERTS\n",
      "  Thank you, counsel. Mr. Sterling.\n",
      "\n",
      "MR. STERLING\n",
      "  Thank you, Mr. Chief Justice, and may it please the Court: Basic recognized that, absent the class-wide presumption of fraud on the market reliance, individual issues of reliance predominate, as they do in any other fraud context. Consequently, when a district court, after the rigorous analysis required by Rule 23, finds that the presumption is unavailable or rebutted, reliance ceases to be a class-wide issue.\n",
      "\n",
      "JUSTICE SOTOMAYOR\n",
      "  I -- I -- when -- what in the Fifth Circuit's decision puts this inquiry into the reliance prong and where did you argue it this way below?\n",
      "\n",
      "MR. STERLING\n",
      "  We argued it below based upon the premise in Basic that the presumption is rebutted when there is proof --\n",
      "\n",
      "JUSTICE SOTOMAYOR\n",
      "  Could you --\n",
      "\n",
      "MR. STERLING\n",
      "  -- that the market price did not distort --\n",
      "\n",
      "JUSTICE SOTOMAYOR\n",
      "  Could you give me a place in the record where you actually said that, as opposed to relying on Oscar to argue that the Fifth Circuit was right in addressing as a merits question whether the plaintiff had proven loss causation?\n",
      "\n",
      "MR. STERLING\n",
      "  It was not addressed as a merits question, Justice Sotomayor. It was addressed, as Oscar said, as a prerequisite for finding reliance in order to certify the class.\n",
      "\n",
      "JUSTICE SOTOMAYOR\n",
      "  So you're not defending the rationale of the Fifth Circuit now? You're -- you're sort of backing yourself into the reliance element?\n",
      "\n",
      "MR. STERLING\n",
      "  We are not defending all of the language in Oscar, clearly, but the basic test in the Fifth Circuit, as our case made clear on pages 116a and 119a of the petition appendix, is not loss causation; it's price impact, because Basic says at page 248 any showing that severs the link between the misrepresentation and the stock price defeats the presumption. Basic makes clear on that same page that a showing that the stock price was not distorted by the misrepresentation defeats the presumption.\n",
      "\n",
      "JUSTICE KAGAN\n",
      "  But, Mr. Sterling, if I think -- if I disagree with you and I think that Oscar said that loss causation needs to be shown at the certification stage, you agree that that is not a correct statement of the law; is that correct?\n",
      "\n",
      "MR. STERLING\n",
      "  We do agree with that, Justice Kagan. But our opinion made clear that it's not loss causation as this Court knows it in Dura; the test is simply price impact. And the Fifth Circuit recognized -- and the Fund recognized this below on page 551a of the Joint Appendix -- their only burden under the Fifth Circuit caselaw was to show price impact, and they could show it either of two ways. Their papers show this, page 116 and 119a of the joint appendix. They can show price inflation upon a misrepresentation, which, as this Court made clear in Dura, is not synonymous with loss causation. Or failing that -- and they could not show that here because their own proof showed that none of the alleged misrepresentations moved the market. So, the alternative way to show price impact is simply to show a price decline following a corrective disclosure. And while that showing is similar to loss causation, it's an easier, less rigorous showing of loss causation, because under the price impact test at the Fifth Circuit, all the plaintiff need show is that it's reasonable to infer that some portion of the decline was attributable to the revelation of the truth.\n",
      "\n",
      "JUSTICE KAGAN\n",
      "  Mr. Sterling, I wasn't sure what argument you were making in your brief. One possible argument you could be making is that the plaintiffs have to show a price impact. Another possible argument you could be making is that you have to have the opportunity to rebut the plaintiff's use of the Basic presumption by yourself showing that there was no price impact. And you seemed often to be saying the first, even though I would think that the second is the most you can make as a -- as a plausible argument.\n",
      "\n",
      "MR. STERLING\n",
      "  If we suggested the first, Justice Kagan, I apologize because we did not intend to. Basic puts the initial burden on the defendant to show the absence of price impact, showing that the presumed fact does not exist. Once that threshold showing is made, the burden remains on the plaintiff under Rule 301 and Rule 23 to show by a preponderance of the evidence that the market price was in fact, distorted.\n",
      "\n",
      "JUSTICE SCALIA\n",
      "  But -- but why do you --\n",
      "\n",
      "JUSTICE GINSBURG\n",
      "  The way the Fifth Circuit wrote the decision, the Fifth Circuit seems to be saying: Plaintiffs, you didn't show an initially false representation; and you, you plaintiff, didn't show a -- a corrective statement that caused a price drop. As I read the Fifth Circuit's decision, it says: Plaintiff, you failed to prove one of the two things that you would have to prove. And you say: No, they really put the burden on -- on defendants, Fifth Circuit put the burden on defendant and found that defendant had met it instead of the other way around?\n",
      "\n",
      "MR. STERLING\n",
      "  We agree, Your Honor, that the Fifth Circuit put the initial burden of production on the plaintiff and that's contrary to Basic. We -- we agree with that. However, in terms of the Fifth Circuit's language that I believe Your Honor's referring to, that is when the Fifth Circuit was discussing the alleged corrective disclosures. Because the plaintiff could not show that any of the alleged misrepresentations moved the market, they had to rely upon what they claimed were corrective disclosures. That was the only way they could show price impact. The Fifth Circuit, at various times, looked at each of the alleged corrective disclosures and said that's not a corrective disclosure because it doesn't reveal the truth in any way; it's bad news, but it's non-culpable bad news. It doesn't in any way suggest that Halliburton said something during the class period that was false.\n",
      "\n",
      "JUSTICE BREYER\n",
      "  Can I -- I'm trying this question out. Try to give me your best answer. If I don't have it clear enough, just forgive it and go on to another. As I'm understanding this case with Basic, the idea is there is a presumption. Somebody lies and says there's an oil well I found oil in. A lot of people buy on the stock market. It turns out there was no oil, and a lot of people say they lost money. All right. The point of the stock market presumption is to say: Smith, you're a typical plaintiff and this presumption is going to help you by the following. We're going to say what happened to the typical person on the stock market during that period happened to you, and there are a lot of people who bought and sold on the stork market. And that's why efficient markets is needed to show at the certification stage, because if there weren't certification -- if that isn't shown, the whole thing falls apart. But what you're just saying on terms of whether the revelation lowered the price has nothing to do with the question of what happened to the typical person, Smith, happened to you, nothing to do with it. It has to do with whether anybody was hurt. Now, that has nothing to do with the certification stage. That's the win or lose stage. Now, that's how I'm understanding it at the moment. So what's wrong with the way I understand it?\n",
      "\n",
      "MR. STERLING\n",
      "  Justice Breyer, the -- the problem is, we're back to reliance. Basic exists -- Basic creates a presumption as an exception to the long understood rule that fraud cases were not appropriate vehicles for class actions because each individual would have to say, Mr. Smith in your hypothetical, I read Halliburton's statement and I relied upon it. Basic said, because that's so impractical cases would never be certified, we're going to say we're going to assume the entire market is like Mr. Smith, and Mr. Smith relies on the integrity of the stock price when the stock price is distorted by the misrepresentation. But if the stock price was not in fact distorted by the misrepresentation, it makes no sense to say everybody relied on the misrepresentation through its effect on the stock price.\n",
      "\n",
      "JUSTICE SCALIA\n",
      "  Which means you would lose. I -- I mean, which means that the plaintiff would lose. But it doesn't mean that there is not a common issue, that the -- that the latter question, whether in fact the market was affected or not is, is not a common question. Rule 23 only requires that -- that there be a common question.\n",
      "\n",
      "MR. STERLING\n",
      "  But Justice Scalia, Basic sets forth a special rule. Basic is an exception to the long-understood rule about the nonsusceptibility in class actions to class treatment of fraud cases. Basic says it's not just enough to allege the operative facts, and we will presume reliance. Basic says you have to plead and prove them, and all of those operative facts are subject to common proof. The efficient market: the efficient market applies to everybody, it's common proof. Everybody recognizes, everybody agrees, Mr. Boies said so today, and the government said so today: if the market -- if the district court does not find that the market -- that the market for the stock is efficient at the class certification stage, you can't certify, because it's not reasonable to infer then that the misrepresentation was translated into the stock price. Materiality is another requirement under Basic. It's a threshold condition. Again, common proof. All the courts except for the Seventh Circuit agree materiality must be proven at the class certification level. Same thing for whether the misrepresentation was public. If it was not publicly made, it's not reasonable to infer that it had an impact on the stock price. All of these operative facts are subject to common proof. But Basic says unless those facts are proven at the class certification stage, the presumption of class-wide reliance doesn't apply and individual issues of reliance predominate. The same must be true for rebuttal proof. Basic says eight times that the presumption is rebuttable, and it makes no sense at all to rely upon these indirect or surrogate, circumstantial proof of whether the misrepresentation moved the market. That's all these are -- materiality, whether it was publicly made, whether the market was efficient. These are all just surrogates of whether it is reasonable to believe or to infer that the stock price was in fact distorted by the misrepresentation.\n",
      "\n",
      "JUSTICE SOTOMAYOR\n",
      "  Well, could you explain to me why in this case it's not reasonable to believe, meaning assuming the truth, that there was falsity in the statements made, those alleged --\n",
      "\n",
      "MR. STERLING\n",
      "  Because -- I'm sorry.\n",
      "\n",
      "JUSTICE SOTOMAYOR\n",
      "  Assuming truth to those statements, why wouldn't a market react to corrective measures? Because what I see is a difference between saying it's an inefficient market or that the statements had no price impact for some other merits-related reason. But why does that tie to an inefficient market at all?\n",
      "\n",
      "MR. STERLING\n",
      "  Well, again, general market efficiency is just a proxy or a surrogate for whether it's reasonable to think the conditions exist for the stock price to be affected by a misrepresentation.\n",
      "\n",
      "JUSTICE SOTOMAYOR\n",
      "  So tell me why on its face, with the false statements alleged here, why would it be unreasonable to conclude that the market wouldn't respond to them?\n",
      "\n",
      "MR. STERLING\n",
      "  One reason is because the market deemed the information to be immaterial, the market didn't care about it, the market didn't react to it. Another reason could be that, while a market is generally efficient, a market was inefficient for this type of information. I --\n",
      "\n",
      "JUSTICE SOTOMAYOR\n",
      "  Well, but you conceded efficiency below, so you've sort of given up that argument.\n",
      "\n",
      "MR. STERLING\n",
      "  We conceded efficiency below because, candidly, their own proof showed that none of the misrepresentations moved the market. And what we have here is not circumstantial proof of general market efficiency or materiality or whether the statement was public; here there was direct proof that none of these misrepresentations moved the market, and that is the whole premise of the Basic class-wide presumption of reliance. Basic itself says if the stock price was not distorted by the misrepresentation, you can't say the entire class relied upon the misrepresentation to the stock price. And that's exactly what we have here. It is the DNA proof, and it makes no sense for district courts to be certifying class actions based upon this indirect or circumstantial proof while ignoring the direct proof of the absence of price impact. And in effect what they're asking this Court to do is to extend Basic. Basic itself is a judicially created presumption designed to make a judicially created cause of action easier to be maintained as a class action. Now, it was one thing for courts decades ago to imply a private cause of action under 10(b) and it was another thing for this Court to create a rebuttable presumption of reliance in Basic in order to make it easier to maintain these cases as class actions. But it would do violence to Stoneridge's admonition that the 10b cause of action ought not be further expanded to make that rebuttable presumption of reliance irrebuttable at the class certification stage.\n",
      "\n",
      "JUSTICE GINSBURG\n",
      "  But your -- your argument seems to say, to -- to get a class certified you have to virtually prove your case on the merits. You -- you leave almost nothing over. I mean, if you've won the class action certification on your basis and you've shown the material misleading and the price dropped as a consequence, the efficient market first -- you've shown all that, what else is left on the merits? You win on the merits if you win certification.\n",
      "\n",
      "MR. STERLING\n",
      "  Justice Ginsburg, that -- that is not our position. Our position is in order to get the class-wide presumption of reliance, it's the plaintiff's burden to plead and prove upfront as threshold facts, a public misrepresentation that was material made in an efficient market. However, the defendant has the right at the class certification stage to rebut that presumption by any showing, to quote Basic, \"that severs the length between the misrepresentation and the stock price.\" When that threshold showing is made, the burden is back on the plaintiff to demonstrate the necessary linkage. It's not a finding on the merits. A determination at the class certification stage is simply one of whether the Rule 23(b) predominance requirement is met and whether the class can appropriately proceed as a class, as opposed to in the traditional individual fashion, and that finding is not binding on the ultimate finder of fact.\n",
      "\n",
      "JUSTICE KAGAN\n",
      "  Mr. Sterling, maybe this is just to repeat Justice Ginsburg's question, but what else is there? I mean, what would not be proper to introduce in the way that you're talking about at the certification stage?\n",
      "\n",
      "MR. STERLING\n",
      "  Falsity, scienter, actual proof of loss causation, and damages.\n",
      "\n",
      "JUSTICE KAGAN\n",
      "  The Fifth Circuit suggested that scienter could come in at the -- at the certification stage. You're disclaiming that?\n",
      "\n",
      "MR. STERLING\n",
      "  Footnote 35 of the Fifth Circuit opinion makes clear that it is not requiring scienter. The Fifth Circuit says, in response -- in analyzing what is or is not a corrective disclosure, it says it has to do something that suggests that a statement was made that is potentially actionable was false. Otherwise it's not a revelation of the truth. And all that is, again, is a second way under the Fifth Circuit's test of showing whether there is the necessary price impact to justify certifying a class, or alternatively to determine that individual issues of reliance predominate. And allowing the defendants to rebut the presumption of reliance at the class certification stage is consistent with this Court's class action case law and with Rule 23. This Court has consistently said that the Rule 23 requirements are not to be presumed, they're not to be assumed, they have to be found. Actual conformance is the test.\n",
      "\n",
      "JUSTICE GINSBURG\n",
      "  The only requirement we're talking about is (b)(3) because it's -- it's not argued and the district court found that all of the 23(a) requirements were satisfied. That's not the particular --\n",
      "\n",
      "MR. STERLING\n",
      "  Correct Your Honor. But 23(b)(3) requires a court to make a finding that predominance exists. And the 2003 amendments to the -- to Rule 23 make clear that a court should not certify a class unless and until it is satisfied that all of the Rule 23 requirements are met; and it makes no sense to say that a court is going to conduct this rigorous analysis and make the Rule 23(b)(3) findings without considering the defendant's rebuttal proof of whether, in fact, there was price impact, because Basic itself says if there is no price impact, the presumption falls away, individual issues of reliance predominate, and the class cannot be certified.\n",
      "\n",
      "JUSTICE KAGAN\n",
      "  On your rebuttal proof point, you said just now that all you had to do was come forward with some evidence, but that the burden remains on the plaintiff. Is that -- what kind of evidence do you think you have to come forward with in order to flip the burden back to the plaintiff?\n",
      "\n",
      "MR. STERLING\n",
      "  Well, under Basic, it's any showing that severs the link, and here it was proof -- we had our own expert that demonstrated that, again kind of harping on their expert -- none of the misrepresentations inflated the stock price --\n",
      "\n",
      "JUSTICE KAGAN\n",
      "  So you're saying you can put an expert on the stand and the expert will say there was no price impact, and then the plaintiffs have to make the case that there, in fact, was a -- a price impact at the certification stage, that the plaintiffs have to prove that by a preponderance?\n",
      "\n",
      "MR. STERLING\n",
      "  Correct, Your Honor.\n",
      "\n",
      "JUSTICE KAGAN\n",
      "  Once you put a expert on the -- on the stand.\n",
      "\n",
      "MR. STERLING\n",
      "  Under Rule 301, the presumption does not shift the ultimate burden of proof. It stays on the party that -- that bears it. That is consistent with Rule 23 as well, which puts the burden on the plaintiff, to prove all of the Rule 23 elements exist.\n",
      "\n",
      "JUSTICE KAGAN\n",
      "  Well, that does suggest that the Basic presumption isn't worth much in your world. That you put an expert on the stand, and the Basic presumption falls away, and the plaintiffs have to actually prove their case at that very early stage that there was no price impact.\n",
      "\n",
      "MR. STERLING\n",
      "  We agree, Your Honor, that they have to show price impact, but that's not a hard burden to show. If any of their 22 -- they allege that we made misrepresentations that were false on 22 days during the class period. All they had to do was show one day during that class period statistically significant price movement, and they're in. Or all they had to show was any of the alleged -- I've forgotten how many -- corrective disclosures during the class period. Any one day, if there was a -- a meaningful price movement that a court could infer was related to the revelation of truth, that's all they need to show. But they couldn't show that.\n",
      "\n",
      "CHIEF JUSTICE ROBERTS\n",
      "  Counsel, I suppose if you prevail and a defendant tries to establish at the certification stage that there's no loss causation and loses, then that's law of the case and you've missed the three opportunities that Mr. Boies was willing to give you at the pleading stage, summary judgment, and the merits. That issue is out of the case if you lose, right?\n",
      "\n",
      "MR. STERLING\n",
      "  No, Your Honor, because the finding at the class certification stage is not binding upon the ultimate fact finder. So if the -- if the Court determines by a preponderance of the evidence that reliance is not there, if the Court -- if the case goes to trial and an individual plaintiff brings his or her own case based upon subjective reliance, that the Court's determination that the class certification stage is not binding on the jury.\n",
      "\n",
      "CHIEF JUSTICE ROBERTS\n",
      "  What if there's no -- no new evidence? One of the objections to your theory is you don't have discovery at the certification stage. What if you have no new evidence to put on at later stages?\n",
      "\n",
      "MR. STERLING\n",
      "  It's possible that the jury would agree with the judge who made the determination at the class certification hearing, it's possible that the judge -- that the jury might not. But the discovery issue, Your Honor, is a complete red herring, because Rule 23 makes clear that the district court has ample discretion at the class certification stage to allow discovery into the merits to the extent that they are relevant to the class certification issue. And more importantly here, the Fund never asked for discovery. In fact, when the Fund filed its motion for class certification on page 139A of the joint appendix, the Fund said no discovery is needed to resolve this motion except for expert discovery. The Fund never asked for discovery at the district court level, the Fund never asked for discovery at the Fifth Circuit. The only time they've ever hinted that they wanted discovery related to the class certification issue was at this Court.\n",
      "\n",
      "JUSTICE SCALIA\n",
      "  I thought that the whole reason you -- you say that the class certification stage is so significant is precisely because once the class is certified, there will be immense discovery on the merits of the case, which will be so expensive for defendants that they're inclined to throw in the towel. Now you're telling us that you -- you want to move discovery up to the class certification stage?\n",
      "\n",
      "MR. STERLING\n",
      "  Justice Scalia, that was not my point, and I apologize if -- if it came out that way.\n",
      "\n",
      "JUSTICE SCALIA\n",
      "  I -- I -- I'm sure it wasn't your point, but -- [laughter]\n",
      "\n",
      "MR. STERLING\n",
      "  All -- all -- all I was -- all I suggesting that if a plaintiff were to say, you know, Your Honor, to the district court, we think we -- we can't -- we should not have the class certification hearing yet because we need some discovery on point A, B, C, which did not happen here, the district court can say fine or can say I don't think you need it. But the premise of your question is certainly correct. The grant of class certification is a seminal event in a 10b-5 case. It has huge repercussions for the defendant.\n",
      "\n",
      "CHIEF JUSTICE ROBERTS\n",
      "  No, no, no. You -- on page 13 of your brief you say one of the objections to it -- to your opponents or your friends' view is that it would just postpone the defendant's ability to rebut the presumption, result in countless classes being certified with the certain knowledge that they would have to be decertified later. Well, if it's so certain, then there's no in terrorem effect.\n",
      "\n",
      "MR. STERLING\n",
      "  Just when -- that's assuming that the defendant has the wherewithal to stick it out through it all, but the sheer grant of class certification which aggregates hundreds, tens, thousands -- tens of thousands of these claims together in one big case makes every one of these cases, in effect, a company case, and it puts huge settlement pressure on the defendant. I mean, in -- in this case Halliburton had 440 million shares of stock outstanding during the class period. The class period lasts 2 1/2 years. It's easy to do the math and say that had this class been certified, there would have been huge pressure upon Halliburton to settle.\n",
      "\n",
      "JUSTICE BREYER\n",
      "  Does your rule apply in all fraud cases? That is, a thousand farmers say, Mr. Jackson was our common buying agent, and the defendant lied to Mr. Jackson, and he relied on the lie. It is a common issue whether he relied on the lie or he didn't rely on the lie. I can understand somebody saying at the certification stage they have to see whether he's really a common agent. But let's imagine that's assumed. The only question left is, did he rely or not rely? Is that a question for the merits or is that a question for the common -- for the --\n",
      "\n",
      "MR. STERLING\n",
      "  Basic is really an exception that applies only --\n",
      "\n",
      "JUSTICE BREYER\n",
      "  So you're saying in the case that I just gave you reliance is for the merits?\n",
      "\n",
      "MR. STERLING\n",
      "  Correct, Your Honor.\n",
      "\n",
      "JUSTICE BREYER\n",
      "  Whether he really relied or didn't rely, the common agent is for the merits?\n",
      "\n",
      "MR. STERLING\n",
      "  But you couldn't have --\n",
      "\n",
      "JUSTICE BREYER\n",
      "  Is that -- is that your answer is?\n",
      "\n",
      "MR. STERLING\n",
      "  No, Your Honor. You couldn't have a case in that situation because reliance is an individual issue.\n",
      "\n",
      "JUSTICE BREYER\n",
      "  No. A thousand people say Mr. Jackson is our common buying agent, and the defendant lied to this common buying agent, and he represented us. Relied on that. I'm asking if you that issue of reliance in an appropriate case is for the certification stage?\n",
      "\n",
      "MR. STERLING\n",
      "  Yes, Your Honor, because --\n",
      "\n",
      "JUSTICE BREYER\n",
      "  Yes.\n",
      "\n",
      "MR. STERLING\n",
      "  -- you still have everybody having to say Mr. Jackson is my agent. That's --\n",
      "\n",
      "JUSTICE BREYER\n",
      "  And they also have to prove there is a lie?\n",
      "\n",
      "MR. STERLING\n",
      "  Right. And that's a -- but the individualized question of reliance is simply, is Mr. Jackson your agent or not? Because of that there is no common issue that -- that predominates on reliance.\n",
      "\n",
      "JUSTICE BREYER\n",
      "  Okay.\n",
      "\n",
      "MR. STERLING\n",
      "  If there are no further questions, we would ask that the judgment below be affirmed. Thank you.\n",
      "\n",
      "CHIEF JUSTICE ROBERTS\n",
      "  Thank you, Mr. Sterling. Mr. Boies, you have 5 minutes remaining.\n",
      "\n",
      "MR. BOIES\n",
      "  Thank you, Your Honor. Thank you, Mr. Chief Justice. Let me respond to Mr. Sterling's statement that all we had to do was show one statistically significant price movement. As the Court is aware from the briefing, on December 7th of 2001, the Halliburton put out a release that indicated that their prior statements that their asbestos reserves were -- were adequate were not -- were not true. The stock dropped 42 percent, more than 42 percent. The actual drop was 42.4. Expert witnesses calculated that the company's specific drop was slightly larger than that because the market was generally going up that day. But it was a dramatic drop. Their own expert, as is indicated in the briefing, agreed that there wasn't anything else happening that day other than asbestos news, and so --\n",
      "\n",
      "CHIEF JUSTICE ROBERTS\n",
      "  So you win, so you win at the certification stage or at the pleading stage, whatever. So why is it such I big deal to you here?\n",
      "\n",
      "MR. BOIES\n",
      "  Because under the -- the Fifth Circuit rule, I understand that counsel disavows the actual language of the Fifth Circuit rule, but it was that language that the district court relied on in failing to certify the class. And with -- with -- with respect to the Fifth Circuit test, what the Fifth Circuit says is that because the announcement on December 7th did not specifically reference the prior announcements, it cannot be considered a correction of those prior announcements. Indeed, the court, the Fifth Circuit goes even further, and this is at page 338 of the F. Supp. opinion. It says, quote: The district court must decide whether the corrective disclosure more probably than not shows that the original estimates or predictions were designed to defraud. So what the Fifth Circuit is doing is it's bringing, even the defrauding aspect, not just the falsity aspect, but the defrauding aspect right into the class certification stage. And I think Justice Scalia's question was exactly on point with respect to discovery, because either they're going to make these merits decisions without discovery or you're going to have all of the discovery before you have the class certification. It's got to be one or the other. And in either case what is happening is you're converting what Rule 23 says is an issue as to whether common issues predominate into an issue as to what is the strength of the merits claim that the plaintiff has, and while it is true, reliance is part of the merits claim. The reason reliance is different is because reliance, if it -- if there is no reliance, if there's no efficient market, then reliance can make individual issues predominate, but when the only issue is not a step issue like efficient market, but is a direct merits issue, there isn't any way that you can make individual issues predominate regardless of how you decide it; and loss causation and price distortion are both those kind of common issues; and counsel says he doesn't defend the -- the actual loss causation statements of the -- of the -- of the Fifth Circuit, and what I would ask is whether the Court, if the Court does decide to send it back, that the Court look at what the right standard is for the court below to be applying when it deals with class certification. And I would urge the Court that when you have pleadings, summary judgment, and trial tests for merits questions, then you don't need another merits test on -- at the class certification stage, even if Rule 23 permitted it, which we don't think it does. What Rule 23 is designed to do is simply say are individual issues or common issues going to predominate? And all of the class have the same loss causation, have the same price distortion issues. If the Court has no more questions, that completes my argument.\n",
      "\n",
      "CHIEF JUSTICE ROBERTS\n",
      "  Thank you, counsel, counsel. The case is submitted.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "n = -5\n",
    "\n",
    "uuid = list(data.keys())[n]\n",
    "for k, v in data[uuid]:\n",
    "    print(k)\n",
    "    print(\"  \" + v)\n",
    "    print()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7ee7df3b",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a40f0dee",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fbf84e9c",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
