3
���h� � ! @ sl d dl Z e jd dkZer`eZeZeZdd� Zdd� Z e
Z
eZd dlm
Z
d dlZd dlmZ nHeZeZeZd d� Zd
d� Z eZ
d dlmZmZ e
Z
d dlZd dlmZ yd dlmZ W nF ek
r� yd dlmZ W n ek
r� d dlmZ Y nX Y nX yd dlZej j!fZ"W n ek
�r0 f Z"Y nX yd d
l#m$Z$ W n$ ek
�rf G dd� d�Z$Y nX dS )� N� c C s t | j� �S )N)�iter�items)�d� r �4/tmp/pip-build-5_djhm0z/xray/xarray/core/pycompat.py� iteritems
s r c C s t | j� �S )N)r �values)r r r r �
itervalues
s r
)�reduce)�urlretrievec C s | j � S )N)r )r r r r r s c C s | j � S )N)r
)r r r r r
s )�izip�imap)�OrderedDict)�suppressc @ s( e Zd ZdZdd� Zdd� Zdd� ZdS ) r aW Context manager to suppress specified exceptions
After the exception is suppressed, execution proceeds with the next
statement following the with statement.
with suppress(FileNotFoundError):
os.remove(somefile)
# Execution still resumes here if the file was already removed
c G s
|| _ d S )N)�_exceptions)�self�
exceptionsr r r �__init__E s zsuppress.__init__c C s d S )Nr )r r r r � __enter__H s zsuppress.__enter__c C s |d k ot || j�S )N)�
issubclassr )r �exctype�excinst�exctbr r r �__exit__K s
zsuppress.__exit__N)�__name__�
__module__�__qualname__�__doc__r r r r r r r r : s r )%�sys�version_info�PY3�str�
basestringZunicode_type�bytesZ
bytes_typer r
�range�zip� functoolsr �builtins�urllib.requestr �unicode�xrange� itertoolsr
r �map�__builtin__�urllibZ
cyordereddictr �ImportError�collectionsZordereddictZ
dask.arrayZdask�array�ArrayZdask_array_type�
contextlibr r r r r �<module> sL
|