'Output the Layers as a Python dict'

def as_dict(self, options=None):

    sublayer_dicts = []
    append = sublayer_dicts.append
    sublayers = self.sublayers
    for sublayer in sublayers:
        sublayer_dict = sublayer.as_dict()
        if sublayer_dict:
            append(sublayer_dict)
    if sublayer_dicts:
        if options:
            options[self.dictname] = sublayer_dicts
        else:
            return sublayer_dicts
