def __next__(self):
        if len(self.urls) == 0:
            raise StopIteration

        obj = self.load(self.urls.pop(0))

        # make sure data is string type
        if isinstance(obj, six.binary_type):
            obj = obj.decode('utf-8')
        elif not isinstance(obj, six.string_types):
            raise ValueError('Unknown types: [{0}]'.format(str(type(obj))))

        # a very simple logic to distinguish json and yaml
        try:
            if obj.startswith('{'):
                obj = json.loads(obj)
            else:
                obj = yaml.load(obj)
        except __HOLE__:
            raise Exception('Unknown format startswith {0} ...'.format(obj[:10]))

        return obj
dataset/ETHPy150Open mission-liao/pyswagger/pyswagger/getter.py/Getter.__next__