def METHOD_NAME(self, tag):
    """Reorder a tag's attributes however you want.
    By default, attributes are sorted alphabetically. This makes
    behavior consistent between Python 2 and Python 3, and preserves
    backwards compatibility with older versions of Beautiful Soup.
    If `empty_boolean_attributes` is True, then attributes whose
    values are set to the empty string will be treated as boolean
    attributes.
    """
    if tag.attrs is None:
        return []
    return sorted(
        (k, (None if self.empty_attributes_are_booleans and v == '' else v))
        for k, v in list(tag.attrs.items())
    )