def pretty_use_unicode(flag=None):
 global _use_unicode
 global unicode_warnings
 if (flag is None):
  return _use_unicode
 if unicode_warnings:
  known = [('LATIN SUBSCRIPT SMALL LETTER %s' % i) for i in 'HKLMNPST']
  unicode_warnings = '\n'.join([l for l in unicode_warnings.splitlines() if (not any(((i in l) for i in known)))])
 if (flag and unicode_warnings):
  warnings.warn(unicode_warnings)
  unicode_warnings = ''
 use_unicode_prev = _use_unicode
 _use_unicode = flag
 return use_unicode_prev

def pretty_use_unicode ( flag = None ) : global _use_unicode global unicode_warnings if ( flag is None ) : return _use_unicode if unicode_warnings : known = [ ( 'LATIN SUBSCRIPT SMALL LETTER %s' % i ) for i in 'HKLMNPST' ] unicode_warnings = '\n' . join ( [ l for l in unicode_warnings . splitlines ( ) if ( not any ( ( ( i in l ) for i in known ) ) ) ] ) if ( flag and unicode_warnings ) : warnings . warn ( unicode_warnings ) unicode_warnings = '' use_unicode_prev = _use_unicode _use_unicode = flag return use_unicode_prev
set whether pretty-printer should use unicode by default .