docs: def limit_text_max_length(text, max_length, separator='_'):
      """
      Limits the length of a string. The returned string will be the first `max_length/2` characters of the input string
      plus a separator plus the last `max_length/2` characters of the input string.
      
      :param text: the text to be limited
      :param max_length: the maximum length of the output string
      :param separator: the separator between the first "max_length"/2 characters of the input string and
                        the last "max_length/2" characters of the input string
      :return: the shortened input string
      """
      if max_length is not None:
          if isinstance(text, string_types) and len(text) > max_length:
              max_length = int(max_length)
              half_length = float(max_length - 1) / 2
              return text[:int(math.ceil(half_length))] + separator + text[-int(math.floor(half_length)):]
      return text