def get(self, url, is_file=False):
        result = []
        if is_file:
            r = self._get(url, is_file=True)
        else:
            r = self._get(url)

        raise_errors(r)

        content = r.headers['Content-Type']

        if content == 'application/json':
            data = r.json()

            for k in list(data):
                if not k == 'version':
                    key = k

            if key not in PLURALS:
                try:
                    datatype = JSON_MAP[key]
                except __HOLE__:
                    raise NotFound(key)
                if datatype is None:
                    result = data[key]
                else:
                    result = JsonObjectFactory.create(datatype, data[key])
            else:
                datatype = PLURALS[key]
                for d in data[key]:
                    result.append(JsonObjectFactory.create(datatype, d))

        elif content == 'text/plain':
            result = r.text

        elif r.headers['Content-Type'] == 'application/zip':

            # Strip the 'attachment; filename='' from Content-Disposition
            filename = r.headers["Content-Disposition"][21:]
            # Save the data to a file
            with open(filename, 'wb') as f:
                for chunk in r.iter_content(chunk_size=1024):
                    if chunk:  # filter out keep-alive new chunks
                        if type(chunk) == bytes:
                            f.write(chunk)
                        else:
                            f.write(chunk.encode("UTF-8"))
                        f.flush()
            return filename
        else:
            result = None
        return result
dataset/ETHPy150Open dave-tucker/hp-sdn-client/hpsdnclient/rest.py/RestClient.get