code: def generate_prompt(
      self,
      instruction: str,
      input: Union[None, str] = None,
      label: Union[None, str] = None,
  ) -> str:
      # returns the full prompt from instruction and optional input
      # if a label (=response, =output) is provided, it's also appended.
      if input:
          res = self.template["prompt_input"].format(
              instruction=instruction, input=input
          )
      else:
          res = self.template["prompt_no_input"].format(
              instruction=instruction
          )
      if label:
          res = f"{res}{label}"
      if self._verbose:
          print(res)
      return res
  
file_path: DeepKE/example/llm/InstructKGC/src/utils/prompter.py
imports: import json
  import os.path
  from typing import Union
label_desc: Use image node_id 2 for calling the Prompter obj's underlying member method code with example usage: obj.generate_prompt(instruction, input, label) and returns: res