code: def __replace_base_variables(text, req_len, idx):
          
          return text \
              .replace("{i}", str(idx + 1)) \
              .replace("{n}", str(req_len))
docs: Replace i and n in text with index+1 and req_len.
  
          :param text: base text to modify
          :param req_len: amount of required resources
          :param idx: index of resource we are working on
          :return: modified string