3
���h� � @ s2 d Z ddlmZ ddlZddlZddlZddlmZmZm Z m
Z
mZmZ ddl
mZ ddlmZ ddlmZmZ ddlmZ dd lmZ dd
lmZ ddlmZ ddlmZmZmZ dd
l m!Z! ddl"m#Z# da$da%da&da'dd� Z(ej)d�Z*e*fe+e+d�dd�Z,dd� Z-dd� Z.G dd� d�Z/G dd� de/�Z0e+d�dd �Z1d!d"iZ2d>Z3G d&d'� d'e/�Z4d(d)� Z5d*d+� Z6e4e4e0e0d,�Z7d-d.� Z8e+d�d/d0�Z9d1d2� Z:d3d4� Z;ed5d6�d?eee+e
f e e+ e ee<ee< f e ee<ee< f e ee<ee< e=f e ee+e+f e>e e+ e e+ e+e e e>e>ee d;�d<d=��Z?dS )@zW
:mod:`pandas.io.html` is a module containing functionality for dealing with
HTML IO.
� )�abcN)�Dict�List�Optional�Pattern�Sequence�Union)�FilePathOrBuffer)�import_optional_dependency)�AbstractMethodError�EmptyDataError)�deprecate_nonkeyword_arguments)�is_list_like)�!create_series_with_explicit_dtype)� DataFrame)�is_url�urlopen�validate_header_arg)�pprint_thing)�
TextParserFc C sR t rd S tdddd�} | d k atdddd�}|d k atdddd�}|d k ada d S )N�bs4F�ignore)Zraise_on_missingZ
on_versionz
lxml.etree�html5libT)�_IMPORTSr
�_HAS_BS4� _HAS_LXML�
_HAS_HTML5LIB)r �lxmlr � r �0/tmp/pip-build-5_djhm0z/pandas/pandas/io/html.py�
_importers! s r z[\r\n]+|\s{2,})�s�returnc C s |j d| j� �S )a�
Replace extra whitespace inside of a string with a single space.
Parameters
----------
s : str or unicode
The string from which to remove extra whitespace.
regex : re.Pattern
The regular expression to use to remove extra whitespace.
Returns
-------
subd : str or unicode
`s` with all extra whitespace replaced with a single space.
� )�sub�strip)r! �regexr r r �_remove_whitespace@ s r' |