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