code: def prepare_tag_prefix(self, prefix):
      if not prefix:
          raise EmitterError("tag prefix must not be empty")
      chunks = []
      start = end = 0
      if prefix[0] == "!":
          end = 1
      while end < len(prefix):
          ch = prefix[end]
          if (
              "0" <= ch <= "9"
              or "A" <= ch <= "Z"
              or "a" <= ch <= "z"
              or ch in "-;/?!:@&=+$,_.~*'()[]"
          ):
              end += 1
          else:
              if start < end:
                  chunks.append(prefix[start:end])
              start = end = end + 1
              data = ch.encode("utf-8")
              for ch in data:
                  chunks.append("%%%02X" % ord(ch))
      if start < end:
          chunks.append(prefix[start:end])
      return "".join(chunks)
  
imports: from .error import YAMLError
  from .events import *
label_desc: Use image node_id 42 for calling the Emitter obj's underlying member method code with example usage: obj.prepare_tag_prefix(prefix) and returns: str