class_docstr: The base dataset class for prompt-tuning or p-tuning.
  TODO: (@adithyare) should be merged into GPTPromptLearningDataset
class_docstr_tok: ["The","base","dataset","class","for","prompt-tuning","or","p-tuning",".","TODO",":","(","@","adithyare",")","should","be","merged","into","GPTPromptLearningDataset"]
docstr: Add leading space to text if there is a space before it in the template 
docstr_tok: ["Add","leading","space","to","text","if","there","is","a","space","before","it","in","the","template"]
code: def _add_leading_space(self, taskname, field_name, field_text):
      """Add leading space to text if there is a space before it in the template"""
      prompt_template = self.task_templates[taskname]["prompt_template"]
      field_text_start = prompt_template.find("{" + field_name + "}")
      if (
          field_text_start != 0
          and prompt_template[field_text_start - 1] == " "
      ):
          field_text = " " + field_text
  
      return field_text
  
file_path: NeMo/nemo/collections/nlp/data/language_modeling/megatron/base_prompt_learning_dataset.py
imports: import torch
  from nemo.collections.nlp.modules.common import VirtualPromptSource
  from nemo.core import Dataset
  from nemo.utils import logging
label_desc: Use image node_id 4 for calling the BasePromptLearningDataset obj's underlying member method code with example usage: obj._add_leading_space(taskname, field_name, field_text) and returns: field_text