def serialize(self, obj=None):
        # If we have nothing; serialize as an empty object.
        if obj is None:
            return ''

        try:
            # Attempt to serialize the incoming object using the URL encoder.
            return super(URLSerializer, self).serialize(urlencode(obj, True))

        except __HOLE__:
            # Raise up our hands; we cannot serialize this.
            raise ValueError
dataset/ETHPy150Open armet/python-armet/armet/serializers/url.py/URLSerializer.serialize