from typing import Tuple
from datetime import datetime
import requests


def get_dialog(url: str, dialog_id: str) -> Tuple[list, list, list, list, datetime]:
    """Get data from one dialog."""
    resp = requests.get(f"{url}{dialog_id}").json()
    date_finish = datetime.strptime(resp["date_finish"], "%Y-%m-%d %H:%M:%S.%f")
    text = [utt["text"] for utt in resp["utterances"]]
    time = [utt["date_time"] for utt in resp["utterances"]]
    user = [utt["user"]["user_type"] for utt in resp["utterances"]]
    d_id = [dialog_id] * len(resp["utterances"])
    return d_id, user, time, text, date_finish