code: def base_prompt(self, prompt):
          
          if prompt is None:
              return None
          if not self.device.is_target:
              return prompt
          pattern = pattern_manager.pattern(self.platform, "prompt_dynamic", compiled=False)
          pattern = pattern.format(prompt="(?P<prompt>.*?)")
          result = re.search(pattern, prompt)
          if result:
              base = result.group("prompt") + "#"
              self.log("base prompt: {}".format(base))
              return base
          else:
              self.log("Unable to extract the base prompt")
              return prompt
docs: Extract the base prompt pattern.