def get_attrs_flag(attrs):
 attrs_flag = 0
 if (u'bold' in attrs):
  attrs_flag |= ATTR_BOLD
 if (u'italic' in attrs):
  attrs_flag |= ATTR_ITALIC
 if (u'underline' in attrs):
  attrs_flag |= ATTR_UNDERLINE
 return attrs_flag

def get_attrs_flag ( attrs ) : attrs_flag = 0 if ( u'bold' in attrs ) : attrs_flag |= ATTR_BOLD if ( u'italic' in attrs ) : attrs_flag |= ATTR_ITALIC if ( u'underline' in attrs ) : attrs_flag |= ATTR_UNDERLINE return attrs_flag
convert an attribute array to a renderer flag .