code: def _get_relative_reference(self, cursor, ref_key):
          
  
          magics = ["X", "Y", "Z"]
  
          # mapper takes magic, key, ref_key to build string
          def get_rel_key_ele(cursor_ele, ref_key_ele):
              """Returns relative key suffix for given key and reference key"""
  
              # cursor is current cursor position
              # ref_key is absolute target position
  
              diff_key_ele = ref_key_ele - cursor_ele
  
              if diff_key_ele == 0:
                  return u""
  
              elif diff_key_ele < 0:
                  return u"-" + str(abs(diff_key_ele))
  
              elif diff_key_ele > 0:
                  return u"+" + str(diff_key_ele)
  
              else:
                  msg = _("{key} seems to be no Integer")
                  msg = msg.format(key=diff_key_ele)
                  raise ValueError(msg)
  
          key_strings = []
  
          for magic, cursor_ele, ref_key_ele in zip(magics, cursor, ref_key):
              key_strings.append(magic +
                                 get_rel_key_ele(cursor_ele, ref_key_ele))
  
          key_string = u", ".join(key_strings)
  
          return u"S[" + key_string + u"]"
docs: Returns absolute reference code for key.
  
          Parameters
          ----------
  
          cursor: 3-tuple of Integer
          \tCurrent cursor position
          ref_key: 3-tuple of Integer
          \tAbsolute reference key