'Create a dictionary representation of the object. Please see inline
comments on construction when dictionaries contain TwitterModels.'

def AsDict(self):

    data = {}
    for (key, value) in self.param_defaults.items():
        if isinstance(getattr(self, key, None), (list, tuple, set)):
            data[key] = list()
            for subobj in getattr(self, key, None):
                if getattr(subobj, u'AsDict', None):
                    data[key].append(subobj.AsDict())
                else:
                    data[key].append(subobj)
        elif getattr(getattr(self, key, None), u'AsDict', None):
            data[key] = getattr(self, key).AsDict()
        elif getattr(self, key, None):
            data[key] = getattr(self, key, None)
    return data
