'Helper function for building an attribute dictionary.'

def build_attrs_compat(self, extra_attrs=None, **kwargs):

    attrs = self.attrs.copy()
    if (extra_attrs is not None):
        attrs.update(extra_attrs)
    if (kwargs is not None):
        attrs.update(kwargs)
    return attrs
