code: def prepare_anchor(self, anchor):
      if not anchor:
          raise EmitterError("anchor must not be empty")
      for ch in anchor:
          if not (
              "0" <= ch <= "9"
              or "A" <= ch <= "Z"
              or "a" <= ch <= "z"
              or ch in "-_"
          ):
              raise EmitterError(
                  "invalid character %r in the anchor: %r"
                  % (ch, anchor)
              )
      return anchor
  
imports: from .error import YAMLError
  from .events import *
label_desc: Use image node_id 44 for calling the Emitter obj's underlying member method code with example usage: obj.prepare_anchor(anchor) and returns: anchor