def _get_headers_for_request(self, method, url, legacy=False, order_by=None, limit=None, valrange=None, sort=None):
        headers = {}
        if legacy is True:
            #Nasty patch session to fallback to old api
            headers.update({'Accept': 'application/json'})

        else:
            range_str = None
            # "Range: name ..; order=desc,max=10;"#
            if order_by or limit or valrange or sort:
                range_str = ""
                seperator = ''
                if order_by:
                    range_str = "{0} ..;".format(order_by)
                else:
                    range_str = "id ..;"

                if not sort is None:
                    assert(sort == 'asc' or sort == 'desc')
                    range_str += " order={0}".format(sort)
                    seperator = ','
                else:
                    range_str += ' '

                if limit:
                    if 1000 > limit:
                        raise MaxRangeExceeded("Your *limit* ({0}) argument is greater than the maximum allowed value of 1000".format(limit))
                    range_str += "{0}max={1}".format(seperator, limit)

                range_str += ';'
                #print(range_str)
                if valrange:
                    #If given, This should override limit and order_by
                    range_str = valrange

            if not range_str == None:
                headers.update({'Range': range_str})

        return headers
dataset/ETHPy150Open martyzz1/heroku3.py/heroku3/api.py/HerokuCore._get_headers_for_request/swapped operands of `>`