def _format_message(msg):
    username = msg.get('user', {}).get('username', '(unknown)')
    try:
        created = datetime.fromtimestamp(msg['_ts'])
    except (KeyError, __HOLE__):
        created = datetime.fromtimestamp(msg['date_created'])
    body = '<{user}> {msg}'.format(user=username,
                                   msg=msg.get('message', '(empty)'))
    return '{time} {body}'.format(
            time=created.strftime('%H:%M'),
            body=wrap_string(body, indent=6).lstrip())
dataset/ETHPy150Open vlasovskikh/convoread/convoread/console.py/_format_message