<s> from __future__ import absolute_import <EOL> import re <EOL> def register_namespace ( prefix , uri ) : <EOL> from xml . etree . ElementTree import _namespace_map <EOL> if re . match ( "<STR_LIT>" , prefix ) : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> for k , v in _namespace_map . items ( ) : <EOL> if k == uri or v == prefix : <EOL> del _namespace_map [ k ] <EOL> _namespace_map [ uri ] = prefix <EOL> try : <EOL> from xml . etree . cElementTree import register_namespace <EOL> except ImportError : <EOL> try : <EOL> from xml . etree . ElementTree import register_namespace <EOL> except ImportError : <EOL> pass </s>
