Helper that returns another range

def _get_range(self, endpoint, *args, method='GET', **kwargs):
        """ Helper that returns another range"""
        if args:
            url = self.build_url(self._endpoints.get(endpoint).format(*args))
        else:
            url = self.build_url(self._endpoints.get(endpoint))
        if not kwargs:
            kwargs = None
        if method == 'GET':
            response = self.session.get(url, params=kwargs)
        elif method == 'POST':
            response = self.session.post(url, data=kwargs)
        if not response:
            return None
        return self.__class__(parent=self, **{self._cloud_data_key: response.json()})