nodes: 0, module; 1, function_definition; 2, function_name:get_boundaries; 3, parameters; 4, block; 5, identifier:self; 6, identifier:filter_type; 7, identifier:value; 8, expression_statement; 9, assert_statement; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, if_statement; 14, return_statement; 15, comment:"""Compute the boundaries to pass to zrangebylex depending of the filter type
  
          The third return value, ``exclude`` is ``None`` except for the filters
          `lt` and `gt` because we cannot explicitly exclude it when
           querying the sorted-set
  
          For the parameters, see BaseRangeIndex.store
  
          Notes
          -----
          For zrangebylex:
          - `(` means "not included"
          - `[` means "included"
          - `\xff` is the last char, it allows to say "starting with"
          - `-` alone means "from the very beginning"
          - `+` alone means "to the very end"
  
          """; 16, comparison_operator:filter_type in self.handled_suffixes; 17, assignment; 18, assignment; 19, assignment; 20, comparison_operator:filter_type in (None, 'eq'); 21, comment:# we include the separator to only get the members with the exact value; 22, block; 23, elif_clause; 24, elif_clause; 25, elif_clause; 26, elif_clause; 27, elif_clause; 28, expression_list; 29, identifier:filter_type; 30, attribute; 31, identifier:start; 32, string; 33, identifier:end; 34, string; 35, identifier:exclude; 36, None; 37, identifier:filter_type; 38, tuple; 39, expression_statement; 40, expression_statement; 41, comparison_operator:filter_type == 'gt'; 42, comment:# starting at the value, excluded; 43, block; 44, comparison_operator:filter_type == 'gte'; 45, comment:# starting at the value, included; 46, block; 47, comparison_operator:filter_type == 'lt'; 48, comment:# ending with the value, excluded; 49, block; 50, comparison_operator:filter_type == 'lte'; 51, comment:# ending with the value, included (but not starting with, hence the separator); 52, block; 53, comparison_operator:filter_type == 'startswith'; 54, comment:# using `\xff` to simulate "startswith"; 55, block; 56, identifier:start; 57, identifier:end; 58, identifier:exclude; 59, identifier:self; 60, identifier:handled_suffixes; 61, string_content:-; 62, string_content:+; 63, None; 64, string; 65, assignment; 66, assignment; 67, identifier:filter_type; 68, string; 69, expression_statement; 70, expression_statement; 71, identifier:filter_type; 72, string; 73, expression_statement; 74, identifier:filter_type; 75, string; 76, expression_statement; 77, expression_statement; 78, identifier:filter_type; 79, string; 80, expression_statement; 81, expression_statement; 82, identifier:filter_type; 83, string; 84, expression_statement; 85, expression_statement; 86, string_content:eq; 87, identifier:start; 88, binary_operator:u'[%s%s' % (value, self.separator); 89, identifier:end; 90, binary_operator:start.encode('utf-8') + b'\xff'; 91, string_content:gt; 92, assignment; 93, assignment; 94, string_content:gte; 95, assignment; 96, string_content:lt; 97, assignment; 98, assignment; 99, string_content:lte; 100, assignment; 101, assignment; 102, string_content:startswith; 103, assignment; 104, assignment; 105, string; 106, tuple; 107, call; 108, string; 109, identifier:start; 110, binary_operator:u'(%s' % value; 111, identifier:exclude; 112, identifier:value; 113, identifier:start; 114, binary_operator:u'[%s' % value; 115, identifier:end; 116, binary_operator:u'(%s' % value; 117, identifier:exclude; 118, identifier:value; 119, identifier:end; 120, binary_operator:u'[%s%s' % (value, self.separator); 121, identifier:end; 122, binary_operator:end.encode('utf-8') + b'\xff'; 123, identifier:start; 124, binary_operator:u'[%s' % value; 125, identifier:end; 126, binary_operator:start.encode('utf-8') + b'\xff'; 127, string_content:[%s%s; 128, identifier:value; 129, attribute; 130, attribute; 131, argument_list; 132, string_content; 133, string; 134, identifier:value; 135, string; 136, identifier:value; 137, string; 138, identifier:value; 139, string; 140, tuple; 141, call; 142, string; 143, string; 144, identifier:value; 145, call; 146, string; 147, identifier:self; 148, identifier:separator; 149, identifier:start; 150, identifier:encode; 151, string; 152, escape_sequence:\xff; 153, string_content:(%s; 154, string_content:[%s; 155, string_content:(%s; 156, string_content:[%s%s; 157, identifier:value; 158, attribute; 159, attribute; 160, argument_list; 161, string_content; 162, string_content:[%s; 163, attribute; 164, argument_list; 165, string_content; 166, string_content:utf-8; 167, identifier:self; 168, identifier:separator; 169, identifier:end; 170, identifier:encode; 171, string; 172, escape_sequence:\xff; 173, identifier:start; 174, identifier:encode; 175, string; 176, escape_sequence:\xff; 177, string_content:utf-8; 178, string_content:utf-8
code: def get_boundaries(self, filter_type, value):
          """Compute the boundaries to pass to zrangebylex depending of the filter type
  
          The third return value, ``exclude`` is ``None`` except for the filters
          `lt` and `gt` because we cannot explicitly exclude it when
           querying the sorted-set
  
          For the parameters, see BaseRangeIndex.store
  
          Notes
          -----
          For zrangebylex:
          - `(` means "not included"
          - `[` means "included"
          - `\xff` is the last char, it allows to say "starting with"
          - `-` alone means "from the very beginning"
          - `+` alone means "to the very end"
  
          """
  
          assert filter_type in self.handled_suffixes
  
          start = '-'
          end = '+'
          exclude = None
  
          if filter_type in (None, 'eq'):
              # we include the separator to only get the members with the exact value
              start = u'[%s%s' % (value, self.separator)
              end = start.encode('utf-8') + b'\xff'
  
          elif filter_type == 'gt':
              # starting at the value, excluded
              start = u'(%s' % value
              exclude = value
  
          elif filter_type == 'gte':
              # starting at the value, included
              start = u'[%s' % value
  
          elif filter_type == 'lt':
              # ending with the value, excluded
              end = u'(%s' % value
              exclude = value
  
          elif filter_type == 'lte':
              # ending with the value, included (but not starting with, hence the separator)
              end = u'[%s%s' % (value, self.separator)
              end = end.encode('utf-8') + b'\xff'
  
          elif filter_type == 'startswith':
              # using `\xff` to simulate "startswith"
              start = u'[%s' % value
              end = start.encode('utf-8') + b'\xff'
  
          return start, end, exclude